/* ════════════════════════════════════════════════════════════════════
   WHITE OAK MEDIA — Client Portal
   10-design-system.css — REDESIGN OVERRIDE LAYER
   ────────────────────────────────────────────────────────────────────
   Authoritative design-system layer from the 2026-06 handoff. Loads LAST
   so it wins the cascade over 01–09 without editing them. Strategy:
   "override layer first" — instant, reversible visual lift; old rules are
   retired in a later cleanup phase.

   Faithful to the handoff: flat (no shadows anywhere), warm cream
   surfaces, navy-deep shells with an oak accent rail, Gilroy in three
   weights only (300 / 500 / 800), hierarchy from color + weight + space.

   Phase 0 — token foundation (canonical names + alias legacy --color-*)
   Phase 1 — shells + shared components
   To revert the whole redesign: remove the <link> to this file.
   ════════════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════════════
   PHASE 0 — TOKEN FOUNDATION
   ════════════════════════════════════════════════════════════════════ */
:root {
  /* ─── Canonical brand tokens (handoff names) ─── */
  --oak:          #b45143;
  --oak-light:    #c8695c;
  --terracotta:   #c96b4f;
  --rust:         #8b3a2a;
  --copper:       #c07a50;
  --amber:        #d4944a;
  --gold:         #e8b252;
  --blush:        #d4a09a;

  --navy:         #2e3642;
  --navy-deep:    #1a2029;
  --charcoal:     #1e1e1e;
  --midnight:     #141c24;
  --slate-blue:   #4a6178;

  --cream:        #f3f1eb;
  --warm-white:   #faf7f2;
  --cream-dark:   #e8e2d6;
  --stone:        #e0d4c1;
  --tan:          #d4c4a0;
  --dim:          #8a8275;

  --sage:         #7a8c6e;
  --forest:       #3d5a3e;

  /* On-light dark text variants for contrast on tinted chips */
  --sage-ink:     #3d5a3e;
  --amber-ink:    #a8702f;
  --rust-ink:     #8b3a2a;

  /* Soft tint backgrounds */
  --oak-bg:       rgba(180, 81, 67, 0.10);
  --sage-bg:      #eef2eb;
  --amber-bg:     #fef4e7;
  --slate-bg:     #ebf0f5;
  --rust-bg:      #f8e8e3;
  --gold-bg:      #fef7e6;

  /* ─── Semantic ─── */
  --fg-1:         var(--navy-deep);
  --fg-2:         var(--navy);
  --fg-3:         var(--dim);
  --fg-inverse:   var(--cream);
  --accent:       var(--oak);
  --accent-hover: var(--oak-light);
  --success:      var(--sage);
  --warning:      var(--amber);
  --error:        var(--oak);
  --bg-primary:   var(--cream);
  --bg-secondary: var(--warm-white);
  --bg-raised:    #ffffff;
  --bg-dark:      var(--navy-deep);
  --border-1:     var(--cream-dark);
  --border-2:     var(--stone);

  /* ─── Type ─── */
  --font-sans:    'Gilroy', 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Gilroy', 'Inter', system-ui, -apple-system, sans-serif;
  --fw-light:     300;
  --fw-medium:    500;
  --fw-extrabold: 800;

  /* ─── Letter spacing / line height ─── */
  --ls-tight:  -0.025em;
  --ls-snug:   -0.02em;
  --ls-label:   0.12em;
  --ls-eyebrow: 0.16em;
  --lh-body:    1.65;
  --lh-heading: 1.1;

  /* ─── Motion ─── */
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast:    120ms;
  --dur-base:    200ms;
  --dur-slow:    400ms;

  /* ─── FLATTEN: re-point every legacy shadow var to nothing ─── */
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
  --shadow-xl: none;

  /* ─── ALIAS: re-point legacy --color-* names onto the warm palette ───
     This shifts the bulk of the old 01–09 CSS to the new language with
     zero markup or selector edits. Cool corporate blues → warm system. */
  --color-primary:        var(--oak);
  --color-primary-hover:  var(--oak-light);
  --color-primary-light:  var(--oak-bg);
  --color-primary-subtle: rgba(180, 81, 67, 0.06);
  --color-navy:           var(--navy-deep);
  --color-navy-light:     var(--navy);
  --color-cream:          var(--cream);
  --color-cream-dark:     var(--cream-dark);
  --color-text:           var(--navy-deep);
  --color-text-secondary: var(--navy);
  --color-text-muted:     var(--dim);
  --color-border:         var(--cream-dark);
  --color-border-light:   #f0ece3;

  --color-success:    var(--sage);
  --color-success-bg: var(--sage-bg);
  --color-warning:    var(--amber);
  --color-warning-bg: var(--amber-bg);
  --color-danger:     var(--rust);
  --color-danger-bg:  var(--rust-bg);
  --color-info:       var(--slate-blue);   /* kill the corporate blue */
  --color-info-bg:    var(--slate-bg);

  --font-body:    var(--font-sans);
}

/* ─── Base: body is Light 300, warm cream, relaxed leading ─── */
body {
  font-family: var(--font-sans);
  font-weight: var(--fw-light);
  background: var(--cream);
  color: var(--navy);
  line-height: var(--lh-body);
}

/* Headings: ExtraBold 800, tight tracking, deepest ink */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: var(--fw-extrabold); color: var(--navy-deep); letter-spacing: var(--ls-snug); line-height: var(--lh-heading); }
h1 { letter-spacing: var(--ls-tight); }

/* Links: oak, no underline until hover */
a { color: var(--oak); }

/* Uppercase micro-labels: Medium 500, oak, tracked */
.label-upper {
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-label);
  color: var(--oak);
  text-transform: uppercase;
}

/* Page mount animation: fade-and-rise only, honors reduced-motion */
.page.active { animation: womRise var(--dur-slow) var(--ease-out); }
@keyframes womRise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .page.active { animation: none; } }

/* FLATTEN literal shadows broadly — the system is flat everywhere */
.card, .section-card, .stat-card, .modal, .modal-content,
.notification-panel, .mobile-more-drawer, .login-card,
.monitor-card, .team-card, .referral-card, .tutorial-card {
  box-shadow: none !important;
}

/* ════════════════════════════════════════════════════════════════════
   PHASE 1 — APP SHELL
   ════════════════════════════════════════════════════════════════════ */

/* ─── Topbar — warm white, hairline only (the one allowed "shadow") ─── */
.topbar {
  background: var(--warm-white);
  border-bottom: 1px solid var(--border-1);
  box-shadow: none;
  height: calc(60px + env(safe-area-inset-top, 0px));
}
.topbar .btn-primary { padding: 0.5rem 1.1rem; }

/* ─── Sidebar — Navy Deep shell with oak accent rail ─── */
.sidebar {
  background: var(--navy-deep);
  border-right: 1px solid rgba(255,255,255,0.06);
}
.sidebar-nav { padding: 1rem 0.6rem; gap: 0.1rem; }

.nav-tab {
  color: rgba(243,241,235,0.60);
  font-weight: var(--fw-medium);
  border-radius: var(--radius-sm, 6px);
  padding: 0.6rem 0.85rem;
  letter-spacing: 0.005em;
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.nav-tab svg { opacity: 0.7; }
.nav-tab:hover { color: var(--cream); background: rgba(255,255,255,0.05); }
.nav-tab:hover svg { opacity: 1; }
.nav-tab.active {
  color: #fff;
  background: rgba(0,0,0,0.28);
  font-weight: var(--fw-medium);
}
.nav-tab.active svg { opacity: 1; color: var(--oak-light); }
.nav-tab.active::before {
  content: '';
  position: absolute;
  left: 0; top: 7px; bottom: 7px;
  width: 3px; background: var(--oak);
  border-radius: 0 3px 3px 0;
}

/* Grouped nav section labels */
.nav-section-label {
  font-weight: var(--fw-medium);
  font-size: 0.62rem;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: rgba(243,241,235,0.34);
  padding: 1.1rem 0.85rem 0.4rem;
}
.nav-section-label:first-child { padding-top: 0.25rem; }

/* Brand lockup at top of sidebar / topbar reads on dark */
.sidebar .nav-logo, .sidebar .login-tree { filter: brightness(0) invert(1); }

/* ─── Topbar identity bits ─── */
.nav-avatar { background: var(--oak); font-weight: var(--fw-extrabold); }
.nav-user { border-left: 1px solid var(--border-2); }
.nav-user-name { color: var(--navy-deep); font-weight: var(--fw-medium); }
.nav-user-role { color: var(--dim); }
.notification-badge { background: var(--oak); font-weight: var(--fw-extrabold); box-shadow: 0 0 0 2px var(--warm-white); }

/* ─── Page header ─── */
.page-header h1 { color: var(--navy-deep); letter-spacing: var(--ls-tight); font-size: 1.875rem; }

/* ════════════════════════════════════════════════════════════════════
   PHASE 1 — BUTTONS
   ════════════════════════════════════════════════════════════════════ */
.btn {
  border-radius: var(--radius-sm, 6px);
  font-weight: var(--fw-medium);
  letter-spacing: 0;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}
/* Flat: bg shift only — no lift, no shadow */
.btn-primary { background: var(--oak); color: #fff; }
.btn-primary:hover { background: var(--oak-light); filter: none; transform: none; box-shadow: none; }
.btn-primary:active:not(:disabled):not([disabled]) { transform: none; opacity: 0.85; box-shadow: none; }

.btn-ghost {
  background: var(--warm-white);
  color: var(--navy);
  border: 1px solid var(--stone);
}
.btn-ghost:hover { background: var(--cream-dark); border-color: var(--dim); color: var(--navy-deep); box-shadow: none; }

.btn-danger { background: var(--rust); }
.btn-danger:hover { background: var(--rust); filter: brightness(1.08); }
.btn-success { background: var(--sage); }
.btn-success:hover { background: var(--sage); filter: brightness(0.94); }

.btn:active:not(:disabled):not([disabled]) { transform: none; opacity: 0.85; }
.btn-text { color: var(--oak); }
.btn-text:hover { background: var(--oak-bg); }

/* Focus-visible: 3px oak ring, offset */
.btn:focus-visible,
.nav-tab:focus-visible,
.nav-icon-btn:focus-visible {
  outline: 3px solid rgba(180,81,67,0.5);
  outline-offset: 2px;
}

/* ════════════════════════════════════════════════════════════════════
   PHASE 1 — FORMS
   ════════════════════════════════════════════════════════════════════ */
.form-group label {
  font-weight: var(--fw-medium);
  color: var(--navy);
  letter-spacing: 0;
}
.form-group input, .form-group textarea, .form-select {
  border: 1.5px solid var(--stone);
  border-radius: var(--radius-sm, 6px);
  background: #fff;
  color: var(--navy-deep);
  font-weight: var(--fw-light);
}
.form-group input:focus, .form-group textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--oak);
  box-shadow: 0 0 0 3px rgba(180,81,67,0.18);
}
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
  border-color: var(--oak);
  box-shadow: 0 0 0 3px rgba(180,81,67,0.12);
}
.form-group.has-error .form-error { color: var(--oak); }

/* Toggles / service checks pick up oak */
.client-type-toggle .type-btn.active { background: var(--oak); }
.service-checkbox:hover { border-color: var(--oak); background: rgba(180,81,67,0.05); }
.service-checkbox input[type="checkbox"] { accent-color: var(--oak); }

/* ════════════════════════════════════════════════════════════════════
   PHASE 1 — CARDS
   ════════════════════════════════════════════════════════════════════ */
/* Stat cards: flat, 1px border, ExtraBold number. Drop the rainbow
   auto-accent top borders — restraint per the new spec. Explicit
   data-accent still works for intentional emphasis. */
.stat-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-1);
  border-top-color: var(--border-1);
  border-radius: var(--radius-lg, 12px);
  box-shadow: none;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.stat-card:hover { transform: none; box-shadow: none; border-color: rgba(180,81,67,0.35); }
.stats-row .stat-card:not([data-accent]),
.stats-grid .stat-card:not([data-accent]),
.client-quick-stats .stat-card:not([data-accent]) {
  border-top-color: var(--border-1);
}
.stats-row .stat-card:not([data-accent]) .label-upper,
.stats-grid .stat-card:not([data-accent]) .label-upper,
.client-quick-stats .stat-card:not([data-accent]) .label-upper { color: var(--dim); }
.stat-card .stat-value, .stat-card .stat-number {
  font-family: var(--font-display);
  font-weight: var(--fw-extrabold);
  color: var(--navy-deep);
  letter-spacing: var(--ls-tight);
}

/* Section cards: flat warm-white, 1px border */
.section-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg, 12px);
  box-shadow: none;
}
.section-card-header .label-upper { color: var(--oak); }

/* Generic .card surfaces flatten too */
.card { box-shadow: none; border: 1px solid var(--border-1); border-radius: var(--radius-lg, 12px); }

/* ════════════════════════════════════════════════════════════════════
   PHASE 1 — TABLES
   ════════════════════════════════════════════════════════════════════ */
.clients-table th, .invoice-table th {
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  font-size: 0.66rem;
  color: var(--dim);
  background: var(--warm-white);
  border-bottom: 1px solid var(--border-1);
}
.clients-table td { border-bottom: 1px solid var(--border-1); }
.clients-table tbody tr:nth-child(even) { background: transparent; }
.clients-table tbody tr:hover { background: var(--warm-white); }

/* ════════════════════════════════════════════════════════════════════
   PHASE 1 — BADGES & PILLS
   ════════════════════════════════════════════════════════════════════ */
.badge, .badge-status {
  border-radius: var(--radius-full, 9999px);
  font-weight: var(--fw-medium);
  letter-spacing: 0.04em;
}
.badge-count { background: var(--oak); color: #fff; font-weight: var(--fw-extrabold); }

/* Tinted status families on warm palette + ink text for contrast */
.badge-discovery, .badge-new        { background: var(--slate-bg); color: var(--slate-blue); }
.badge-design                        { background: var(--rust-bg);  color: var(--copper); }
.badge-development, .badge-in-progress { background: var(--amber-bg); color: var(--amber-ink); }
.badge-review, .badge-in-review      { background: var(--gold-bg);  color: var(--amber-ink); }
.badge-launch                        { background: var(--sage-bg);  color: var(--forest); }
.badge-maintenance                   { background: var(--sage-bg);  color: var(--sage-ink); }

/* Signature rust pill */
.wom-pill {
  display: inline-block;
  background: var(--rust);
  color: #fff;
  font-weight: var(--fw-extrabold);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 20px;
  border-radius: var(--radius-pill, 40px);
  line-height: 1;
}

/* ════════════════════════════════════════════════════════════════════
   PHASE 1 — MODALS (flat: scrim, not shadow; border for definition)
   ════════════════════════════════════════════════════════════════════ */
.modal-overlay { background: rgba(26,32,41,0.55); }
.modal, .modal-content {
  box-shadow: none;
  border: 1px solid var(--border-1);
  border-radius: var(--radius-xl, 16px);
}
.modal-header h2, .modal-header h3 { font-family: var(--font-display); font-weight: var(--fw-extrabold); color: var(--navy-deep); }

/* ════════════════════════════════════════════════════════════════════
   PHASE 1 — PROGRESS STEPPER (client onboarding / project phases)
   ════════════════════════════════════════════════════════════════════ */
.phase-step-dot.complete, .phase-step.complete .phase-step-dot { background: var(--sage); color: #fff; }
.phase-step-dot.active, .phase-step.active .phase-step-dot { background: var(--oak); color: #fff; }

/* ════════════════════════════════════════════════════════════════════
   PHASE 1 — SCROLLBAR (warm)
   ════════════════════════════════════════════════════════════════════ */
::-webkit-scrollbar-thumb { background: var(--stone); }
::-webkit-scrollbar-thumb:hover { background: var(--dim); }

/* ════════════════════════════════════════════════════════════════════
   PHASE 3a — DASHBOARD STAT CARDS: restraint, hero, attention rail
   De-rainbow the colored top-borders; one navy hero card carries the
   headline metric; attention metrics get an oak accent rail.
   ════════════════════════════════════════════════════════════════════ */
/* De-rainbow: any explicit data-accent card is flat by default */
.stat-card[data-accent] { border-top-color: var(--border-1); }
.stat-card[data-accent] .label-upper { color: var(--dim); }

/* Hero card — filled Navy Deep, white number, gold sub */
.stat-card[data-accent="hero"] {
  background: var(--navy-deep);
  border-color: var(--navy-deep);
  border-top-color: var(--navy-deep);
}
.stat-card[data-accent="hero"] .label-upper { color: rgba(243,241,235,0.55); }
.stat-card[data-accent="hero"] .stat-value,
.stat-card[data-accent="hero"] .stat-number { color: #fff; }
.stat-card[data-accent="hero"] .stat-sub,
.stat-card[data-accent="hero"] .stat-label { color: var(--gold); font-weight: var(--fw-medium); }
.stat-card[data-accent="hero"]:hover { border-color: var(--navy-deep); }

/* Attention metrics (overdue / needs-attention) — oak rail, not a red fill */
.stat-card[data-accent="rust"] {
  border-left: 3px solid var(--oak);
}
.stat-card[data-accent="rust"] .stat-value,
.stat-card[data-accent="rust"] .stat-number { color: var(--oak); }

/* ════════════════════════════════════════════════════════════════════
   PHASE 2 — PAGE STATE PRIMITIVES (reusable across every surface)
   ════════════════════════════════════════════════════════════════════ */

/* ─── Loading: warm shimmer skeletons (mirror the layout, no spinners) ─── */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--cream-dark);
  border-radius: var(--radius-sm, 6px);
}
.skeleton::after {
  content: '';
  position: absolute; inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  animation: womShimmer 1.4s var(--ease-out) infinite;
}
.skeleton-text { height: 0.85em; margin: 0.35em 0; }
.skeleton-line { height: 12px; margin: 8px 0; }
.skeleton-title { height: 22px; width: 40%; margin-bottom: 14px; }
.skeleton-card { height: 96px; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: var(--radius-full, 9999px); }
@keyframes womShimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .skeleton::after { animation: none; } }

/* ─── Empty: icon + headline + one line + the action that fills it ─── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: var(--space-12, 48px) var(--space-6, 24px);
  color: var(--dim);
}
.empty-state .empty-icon {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full, 9999px);
  background: var(--warm-white);
  border: 1px solid var(--border-1);
  color: var(--dim);
  margin-bottom: var(--space-4, 16px);
}
.empty-state .empty-icon svg { width: 24px; height: 24px; }
.empty-state h3, .empty-state .empty-title {
  font-family: var(--font-display);
  font-weight: var(--fw-extrabold);
  font-size: var(--fs-h4, 16px);
  color: var(--navy-deep);
  margin-bottom: var(--space-2, 8px);
}
.empty-state p, .empty-state .empty-guidance {
  font-weight: var(--fw-light);
  font-size: var(--fs-body-sm, 14px);
  color: var(--dim);
  max-width: 42ch;
  margin-bottom: var(--space-5, 20px);
}

/* ─── Error / recovery: plain language + next step ─── */
.error-state {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: var(--space-12, 48px) var(--space-6, 24px);
}
.error-state .error-icon { color: var(--oak); margin-bottom: var(--space-3, 12px); }
.error-state h3 { font-family: var(--font-display); font-weight: var(--fw-extrabold); color: var(--navy-deep); margin-bottom: var(--space-2, 8px); }
.error-state p { font-weight: var(--fw-light); color: var(--dim); max-width: 46ch; margin-bottom: var(--space-5, 20px); }

/* ─── Attention / urgency: oak-tinted card with accent rail ─── */
.attention-card {
  background: rgba(180,81,67,0.05);
  border: 1px solid var(--border-1);
  border-left: 3px solid var(--oak);
  border-radius: var(--radius-lg, 12px);
  padding: var(--space-5, 20px);
}
.attention-card .label-upper, .attention-card .attention-title { color: var(--oak); }

/* ─── Permission-scoped: a calm locked surface, not an error ─── */
.permission-locked {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: var(--space-12, 48px) var(--space-6, 24px);
  background: var(--warm-white);
  border: 1px dashed var(--border-2);
  border-radius: var(--radius-lg, 12px);
  color: var(--dim);
}
.permission-locked .lock-icon { color: var(--dim); margin-bottom: var(--space-3, 12px); }

/* ─── Success: sage accents, never loud ─── */
.success-note {
  display: inline-flex; align-items: center; gap: var(--space-2, 8px);
  color: var(--forest);
  font-weight: var(--fw-medium);
}

/* ════════════════════════════════════════════════════════════════════
   PHASE 3 — CLIENTS CARD GRID (matches 02-admin)
   ════════════════════════════════════════════════════════════════════ */
.clients-card-grid { gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.client-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg, 12px);
  padding: 18px 20px;
  box-shadow: none;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.client-card:hover { border-color: rgba(180,81,67,0.4); box-shadow: none; transform: none; }
.client-card--at-risk { border: 1.5px solid var(--oak); }

.client-card-header { gap: 13px; margin-bottom: 0; align-items: center; }
.clients-card-grid .client-card-avatar {
  width: 48px; height: 48px;
  border-radius: var(--radius-lg, 12px);
  background: var(--navy-deep);
  font-weight: var(--fw-extrabold);
  font-size: 0.92rem;
}
.client-card-name {
  font-family: var(--font-display);
  font-weight: var(--fw-extrabold);
  font-size: 1rem;
  color: var(--navy-deep);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.client-card-plan {
  font-size: 0.8rem;
  color: var(--dim);
  font-weight: var(--fw-light);
  margin-top: 3px;
}
.client-card-footer {
  border-top: 1px solid var(--border-1);
  padding-top: 14px;
  margin-top: 16px;
  font-size: 0.8rem;
}
.client-card-status { display: flex; align-items: center; gap: 7px; }
.health-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.client-card-health { font-weight: var(--fw-medium); }
.client-card-live { color: var(--dim); font-weight: var(--fw-light); }

/* Toolbar search → warm system */
.clients-search { border: 1.5px solid var(--stone); border-radius: var(--radius-sm, 6px); font-weight: var(--fw-light); }
.clients-search:focus { border-color: var(--oak); box-shadow: 0 0 0 3px rgba(180,81,67,0.18); }
.clients-view-btn.active { background: var(--oak); border-color: var(--oak); }

/* ════════════════════════════════════════════════════════════════════
   PHASE 3 — CLIENT DETAIL: header + oak-underline tabs (03-admin)
   ════════════════════════════════════════════════════════════════════ */
#client-detail-header h1 { font-size: 1.75rem; line-height: 1.12; }

/* Sub-nav tabs — underline, not pills */
.client-detail-tabs {
  display: flex; gap: 2px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border-1);
  margin-bottom: var(--space-6, 24px);
}
.client-detail-tab {
  background: none; border: none;
  padding: 12px 16px;
  font-family: var(--font-sans);
  font-weight: var(--fw-medium);
  font-size: 0.9rem;
  color: var(--dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.client-detail-tab:hover { color: var(--navy); }
.client-detail-tab.active { color: var(--navy-deep); border-bottom-color: var(--oak); }
.client-detail-tab .tab-count {
  display: inline-block; margin-left: 5px;
  background: var(--cream-dark); color: var(--dim);
  font-size: 0.62rem; font-weight: var(--fw-extrabold);
  border-radius: var(--radius-full, 9999px);
  padding: 1px 7px;
}
.client-detail-tab.active .tab-count { background: var(--oak-bg); color: var(--oak); }

/* ════════════════════════════════════════════════════════════════════
   PHASE 3 — CLIENT SHELL: calm light top-nav (01-client)
   Role-driven (body.role-client). Desktop only — mobile keeps the
   existing bottom-tab nav. CSS-only transform of the sidebar into a
   horizontal light nav bar; no DOM changes.
   ════════════════════════════════════════════════════════════════════ */
@media (min-width: 769px) {
  /* Topbar stays light; hide the hamburger (no collapsible sidebar here) */
  body.role-client .topbar { background: var(--warm-white); }
  body.role-client .sidebar-toggle { display: none; }
  body.role-client .nav-logo { filter: none; }

  /* Sidebar → horizontal nav bar beneath the topbar */
  body.role-client .sidebar {
    position: fixed; top: calc(60px + env(safe-area-inset-top, 0px)); left: 0; right: 0; bottom: auto;
    width: 100%; height: auto;
    background: var(--warm-white);
    border-right: none;
    border-bottom: 1px solid var(--border-1);
    flex-direction: row;
    overflow: visible;
    z-index: 100;
  }
  body.role-client .sidebar.collapsed { width: 100%; }
  body.role-client .sidebar-nav {
    flex-direction: row;
    align-items: center;
    gap: 2px;
    padding: 0 28px;
    width: 100%;
    max-width: var(--container-xl, 1200px);
    margin: 0 auto;
    flex: none;
  }
  body.role-client .nav-section-label { display: none; }

  /* Nav items: text-only, oak underline active (calm, no rail/fill) */
  body.role-client .nav-tab {
    color: var(--navy);
    padding: 18px 14px;
    border-radius: 0;
    border-bottom: 2px solid transparent;
    font-size: 0.92rem;
    font-weight: var(--fw-medium);
    white-space: nowrap;
  }
  body.role-client .nav-tab svg { display: none; }
  body.role-client .nav-tab:hover { background: none; color: var(--oak); }
  body.role-client .nav-tab.active {
    background: none;
    color: var(--oak);
    border-bottom-color: var(--oak);
  }
  body.role-client .nav-tab.active::before { display: none; }

  /* Content: full width, pushed below topbar + nav row */
  body.role-client .main-content,
  body.role-client .main-content.sidebar-collapsed {
    margin-left: 0 !important;
    margin-top: calc(60px + 57px + env(safe-area-inset-top, 0px));
  }
  body.role-client .page { max-width: var(--container-xl, 1200px); }
}

/* ════════════════════════════════════════════════════════════════════
   PHASE 3 — LOGIN: centered single-column token-flow (01-public)
   ════════════════════════════════════════════════════════════════════ */
.login-centered {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  background: var(--cream);
  padding: 9vh 1.5rem 3rem;
}
.login-stack { width: 100%; max-width: 440px; }
.login-brand-top {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  margin-bottom: 28px;
}
.login-brand-top .login-tree {
  width: 64px; height: 64px; object-fit: contain;
  filter: none;   /* natural-color oak tree on cream */
}
.login-brand-top h1 {
  font-family: var(--font-display);
  font-weight: var(--fw-extrabold);
  font-size: 1.9rem;
  color: var(--navy-deep);
  letter-spacing: var(--ls-tight);
  margin-top: 16px;
}
.login-subtitle { color: var(--dim); font-weight: var(--fw-light); font-size: 0.95rem; margin-top: 6px; }
.login-centered .login-card {
  max-width: none;
  padding: 2rem;
  border: 1px solid var(--border-1);
  border-radius: var(--radius-xl, 16px);
  box-shadow: none;
}
@media (max-width: 480px) {
  .login-centered { padding: 5vh 1rem 2rem; }
  .login-centered .login-card { padding: 1.5rem; }
}
