:root {
  --bg: #faf8f5;
  --bg-soft: #f5f0ea;
  --surface: rgba(255, 255, 255, 0.74);
  --surface-strong: rgba(255, 255, 255, 0.9);
  --surface-muted: rgba(255, 252, 248, 0.82);
  --text: #2d2520;
  --text-soft: #6b6560;
  --primary: #b85c47;
  --primary-strong: #9c4b37;
  --secondary: #e6b86a;
  --accent: #d4a159;
  --olive: #7d8a66;
  --success: #5b8c5a;
  --danger: #c84c3c;
  --border: rgba(45, 37, 32, 0.12);
  --border-strong: rgba(45, 37, 32, 0.18);
  --shadow-lg: 0 24px 80px rgba(69, 49, 37, 0.14);
  --shadow-md: 0 14px 30px rgba(69, 49, 37, 0.1);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background:
    radial-gradient(circle at 0% 0%, rgba(230, 184, 106, 0.26), transparent 26%),
    radial-gradient(circle at 100% 10%, rgba(184, 92, 71, 0.18), transparent 22%),
    radial-gradient(circle at 50% 100%, rgba(125, 138, 102, 0.12), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
  font-family: "Segoe UI Variable", "Trebuchet MS", "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.page-shell {
  position: relative;
  width: min(1380px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 0 28px;
}

.auth-shell,
.setup-shell {
  width: min(1440px, calc(100vw - 20px));
  padding: 10px 0 20px;
}

.page-backdrop {
  position: fixed;
  z-index: -1;
  pointer-events: none;
  filter: blur(36px);
  opacity: 0.72;
}

.page-backdrop-a {
  top: 30px;
  left: -80px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(184, 92, 71, 0.18);
}

.page-backdrop-b {
  top: 180px;
  right: -60px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(230, 184, 106, 0.2);
}

.topbar,
.panel,
.flash,
.summary-card,
.feature-card,
.note-card,
.timelog-card,
.empty-panel {
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.topbar {
  position: sticky;
  top: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  margin-bottom: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
}

.brand,
.auth-brand,
.password-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 18px;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: linear-gradient(145deg, var(--primary), var(--accent));
  box-shadow: 0 14px 26px rgba(184, 92, 71, 0.24);
}

.brand-copy strong,
.brand-copy small,
.auth-brand strong,
.auth-brand small,
.password-brand strong,
.password-brand small {
  display: block;
}

.brand-copy strong,
.auth-brand strong,
.password-brand strong {
  font-size: 1.02rem;
}

.brand-copy small,
.auth-brand small,
.password-brand small,
.lead,
.section-meta,
.field span,
.secondary-link,
.callout p,
.auth-domain,
.summary-card p,
.summary-card small,
.timelog-top small,
.timelog-meta,
.flash,
.row-count,
.hint-card p {
  color: var(--text-soft);
}

.topbar-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  background: rgba(45, 37, 32, 0.05);
  border: 1px solid rgba(45, 37, 32, 0.08);
}

.user-chip strong,
.user-chip small,
.user-chip span {
  display: block;
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(145deg, var(--primary), var(--accent));
  font-weight: 700;
}

.ghost-button,
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(45, 37, 32, 0.1);
  color: var(--text);
}

.secondary-button {
  background: rgba(230, 184, 106, 0.18);
  border-color: rgba(212, 161, 89, 0.28);
  color: var(--text);
}

.primary-button {
  color: #fff;
  background: linear-gradient(145deg, var(--primary), var(--primary-strong));
  box-shadow: 0 18px 30px rgba(184, 92, 71, 0.28);
}

.danger-button {
  color: var(--danger);
  border-color: rgba(200, 76, 60, 0.16);
}

.ghost-button:hover,
.primary-button:hover,
.secondary-button:hover,
.tab-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(69, 49, 37, 0.08);
}

.content,
.auth-stage,
.stacked-form,
.summary-grid,
.workspace-card,
.timelog-section {
  display: grid;
  gap: 20px;
}

.flash {
  padding: 14px 18px;
  margin-bottom: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(14px);
}

.flash-success {
  border-color: rgba(91, 140, 90, 0.22);
  background: rgba(91, 140, 90, 0.08);
}

.flash-error {
  border-color: rgba(200, 76, 60, 0.22);
  background: rgba(200, 76, 60, 0.08);
}

.flash-warning {
  border-color: rgba(212, 161, 89, 0.25);
  background: rgba(212, 161, 89, 0.1);
}

.fade-in {
  animation: fade-in 0.45s ease-out both;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  font-weight: 700;
}

.dashboard-hero,
.workspace-card,
.auth-card,
.password-card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-xl);
}

.dashboard-hero {
  grid-template-columns: minmax(0, 1.2fr) auto;
  align-items: end;
  padding: 30px 32px;
}

.dashboard-hero h1,
.auth-copy h1,
.password-copy h1 {
  margin: 10px 0 12px;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(2.35rem, 4vw, 3.8rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(45, 37, 32, 0.08);
  color: var(--text-soft);
}

.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-card {
  position: relative;
  padding: 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
}

.summary-card strong {
  display: block;
  margin: 12px 0 6px;
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  line-height: 1;
}

.summary-icon {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  font-weight: 800;
}

.summary-card-neutral .summary-icon {
  background: rgba(45, 37, 32, 0.07);
  color: var(--text-soft);
}

.summary-card-warm .summary-icon {
  background: rgba(230, 184, 106, 0.2);
  color: #7a5d2c;
}

.summary-card-success .summary-icon {
  background: rgba(91, 140, 90, 0.14);
  color: var(--success);
}

.workspace-card {
  padding: 22px;
}

.section-tabs {
  overflow-x: auto;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(45, 37, 32, 0.08);
}

.tabs-list {
  display: flex;
  gap: 10px;
  min-width: max-content;
}

.tab-link {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 16px 16px 12px 12px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(45, 37, 32, 0.06);
  white-space: nowrap;
}

.tab-link.active {
  background: linear-gradient(145deg, var(--primary), var(--accent));
  color: #fff;
  border-color: transparent;
}

.workspace-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.workspace-head h2,
.timelog-section h2,
.auth-card-head h2,
.password-copy h1 {
  margin: 8px 0 10px;
}

.workspace-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.row-count {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(184, 92, 71, 0.1);
}

.row-count.subtle {
  background: rgba(45, 37, 32, 0.05);
}

.table-wrap {
  overflow: auto;
  border-radius: 22px;
  border: 1px solid rgba(45, 37, 32, 0.08);
  background: rgba(255, 255, 255, 0.62);
}

.scrollbar-thin::-webkit-scrollbar {
  height: 7px;
  width: 7px;
}

.scrollbar-thin::-webkit-scrollbar-track {
  background: rgba(237, 232, 227, 0.3);
  border-radius: 999px;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
  background: rgba(184, 92, 71, 0.28);
  border-radius: 999px;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.resizable-table.is-resizable {
  table-layout: fixed;
}

th,
td {
  padding: 15px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(45, 37, 32, 0.08);
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  position: sticky;
  background: rgba(250, 248, 245, 0.96);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  position: sticky;
  overflow: visible;
  white-space: nowrap;
}

td {
  word-break: break-word;
}

.th-label {
  display: block;
  padding-right: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.column-resizer {
  position: absolute;
  top: 0;
  right: -5px;
  width: 12px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.column-resizer::after {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 5px;
  width: 2px;
  border-radius: 999px;
  background: rgba(184, 92, 71, 0.3);
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
}

th:hover .column-resizer::after,
.column-resizer.is-active::after {
  opacity: 1;
}

.column-resizer.is-active::after {
  background: rgba(184, 92, 71, 0.7);
}

body.is-resizing-columns,
body.is-resizing-columns * {
  cursor: col-resize !important;
  user-select: none !important;
}

tbody tr {
  animation: fade-in 0.3s ease-out both;
}

tbody tr:hover {
  background: rgba(184, 92, 71, 0.04);
}

tbody tr.bot-row {
  background: rgba(184, 92, 71, 0.06);
}

.status-col {
  width: 140px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.status-pill-bot {
  background: rgba(184, 92, 71, 0.12);
  color: var(--primary);
}

.status-pill-linked {
  background: rgba(125, 138, 102, 0.14);
  color: var(--olive);
}

.status-pill-import {
  background: rgba(45, 37, 32, 0.06);
  color: var(--text-soft);
}

.status-pill-success {
  background: rgba(91, 140, 90, 0.12);
  color: var(--success);
}

.timelog-section {
  gap: 18px;
}

.timelog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.timelog-card {
  padding: 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(14px);
}

.timelog-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.timelog-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.15rem;
}

.timelog-card p {
  margin: 0 0 14px;
  line-height: 1.6;
}

.timelog-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid rgba(45, 37, 32, 0.08);
  font-size: 0.92rem;
}

.empty-panel {
  justify-items: center;
  padding: 38px 24px;
  text-align: center;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.66);
  backdrop-filter: blur(14px);
}

.empty-panel h3 {
  margin: 10px 0 8px;
}

.empty-panel p {
  max-width: 620px;
  margin: 0;
  color: var(--text-soft);
  line-height: 1.6;
}

.empty-icon,
.feature-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  color: var(--primary);
  font-weight: 800;
  background: rgba(184, 92, 71, 0.12);
}

.feature-icon-secondary {
  color: #7a5d2c;
  background: rgba(230, 184, 106, 0.24);
}

.auth-stage {
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 470px);
  align-items: stretch;
  min-height: calc(100vh - 40px);
}

.auth-hero,
.auth-column,
.password-stage {
  display: flex;
}

.auth-hero {
  flex-direction: column;
  justify-content: center;
  padding: 44px clamp(20px, 5vw, 54px);
  border-radius: 34px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.16)),
    linear-gradient(160deg, rgba(255, 255, 255, 0.35), rgba(245, 240, 234, 0.74));
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.auth-copy {
  display: grid;
  gap: 28px;
  margin-top: 36px;
}

.feature-grid,
.auth-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.feature-card,
.note-card,
.callout {
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
}

.feature-card h2 {
  margin: 14px 0 10px;
  font-size: 1.1rem;
}

.feature-card p,
.note-card p {
  margin: 0;
  line-height: 1.6;
  color: var(--text-soft);
}

.note-card span {
  display: block;
  margin-bottom: 10px;
  color: var(--text-soft);
  font-size: 0.86rem;
}

.note-card strong {
  display: block;
  margin-bottom: 6px;
}

.auth-column {
  align-items: center;
  justify-content: center;
  padding: 28px clamp(16px, 4vw, 40px);
}

.auth-card,
.password-card {
  width: 100%;
  padding: 32px;
}

.auth-card-head p,
.password-copy p,
.callout p {
  margin: 0;
  line-height: 1.6;
}

.stacked-form {
  margin-top: 28px;
}

.field {
  display: grid;
  gap: 8px;
}

.field input {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(45, 37, 32, 0.12);
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field input:focus {
  border-color: rgba(184, 92, 71, 0.45);
  box-shadow: 0 0 0 4px rgba(184, 92, 71, 0.1);
}

.callout {
  margin-top: 24px;
}

.callout strong {
  display: block;
  margin-bottom: 6px;
}

.auth-domain {
  margin: 18px 0 0;
  text-align: center;
  font-size: 0.92rem;
}

.password-stage {
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 40px);
}

.password-card {
  max-width: 620px;
  margin: 0 auto;
}

.password-copy {
  margin-top: 24px;
}

.requirements-list {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--text-soft);
}

.requirements-list li + li {
  margin-top: 8px;
}

@media (max-width: 1180px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-stage,
  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .hero-badges {
    justify-content: flex-start;
  }
}

@media (max-width: 860px) {
  .page-shell,
  .auth-shell,
  .setup-shell {
    width: min(100vw - 16px, 100%);
  }

  .topbar {
    top: 8px;
    align-items: start;
    padding: 14px 16px;
  }

  .topbar-meta {
    justify-content: flex-start;
  }

  .summary-grid,
  .feature-grid,
  .auth-notes,
  .timelog-grid {
    grid-template-columns: 1fr;
  }

  .workspace-card,
  .dashboard-hero,
  .auth-card,
  .password-card {
    padding: 22px 18px;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding-top: 8px;
  }

  .auth-stage,
  .password-stage {
    min-height: auto;
  }

  .auth-hero {
    padding: 26px 18px;
    border-radius: 26px;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 16px;
  }

  .dashboard-hero h1,
  .auth-copy h1,
  .password-copy h1 {
    font-size: 2.2rem;
  }

  .ghost-button,
  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .topbar-meta,
  .workspace-stats {
    width: 100%;
  }

  .user-chip {
    width: 100%;
  }
}
