/* Zyworks Client Portal */
/* ==== THEME TOKENS (generated by scripts/theme_tokens.py, edit there) ==== */
:root {
  --brand-orange: #ff7e1f;
  --brand-pink: #ff646d;
  --brand-grad: linear-gradient(90deg, #ff7e1f 0%, #ff646d 100%);
  --brand-grad-diag: linear-gradient(135deg, #ff7e1f 0%, #ff646d 100%);
  --navy: #102c44;
  --radius: 14px;
  --radius-sm: 9px;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Barlow Semi Condensed', 'Inter', ui-sans-serif, system-ui, sans-serif;
}
/* Dark is the default */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141414;
  --sidebar: #191919;
  --surface: #202020;
  --surface-2: #262626;
  --surface-3: #282828;
  --input-bg: #1a1a1a;
  --ink: #f5f5f5;
  --ink-2: #d4d4d4;
  --muted: #a3a3a3;
  --line: #333333;
  --line-2: #404040;
  --accent: #ff8a4c;
  --accent-2: #ffa774;
  --accent-soft: rgba(255, 107, 26, 0.14);
  --accent-border: rgba(255, 107, 26, 0.42);
  --primary: #ff6b1a;
  --primary-2: #ff8236;
  --on-primary: #141414;
  --on-brand: #141414;
  --review: #ff8a99;
  --review-soft: rgba(255, 100, 109, 0.14);
  --review-border: rgba(255, 100, 109, 0.42);
  --done: #5ad19a;
  --done-soft: rgba(90, 209, 154, 0.13);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.13);
  --amber-ink: #fcd34d;
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.13);
  --red-border: rgba(248, 113, 113, 0.42);
  --on-danger: #141414;
  --danger-hover: #fca5a5;
  --blue: #7aa7ff;
  --blue-soft: rgba(122, 167, 255, 0.14);
  --blue-border: rgba(122, 167, 255, 0.42);
  --dot-todo: #737373;
  --hero-bg: radial-gradient(520px 260px at 100% 0%, rgba(255, 107, 26, 0.3), transparent 70%), radial-gradient(420px 240px at 78% 120%, rgba(255, 100, 109, 0.22), transparent 70%), #202020;
  --hero-solid: #202020;
  --hero-ink: #f5f5f5;
  --hero-muted: #b8b8b8;
  --hero-eyebrow: #ff9a5c;
  --ring-hole: #1a1a1a;
  --ring-track: rgba(255, 255, 255, 0.12);
  --column-bg: #1a1a1a;
  --column-review-bg: rgba(255, 100, 109, 0.07);
  --admin-bar-bg: #0f0f0f;
  --admin-bar-ink: #d4d4d4;
  --admin-bar-link: #ff8a4c;
  --plan-next-bg: linear-gradient(160deg, rgba(255, 107, 26, 0.13), rgba(255, 100, 109, 0.08));
  --auth-bg: radial-gradient(900px 420px at 15% -10%, rgba(255, 107, 26, 0.18), transparent 70%), radial-gradient(900px 420px at 95% 110%, rgba(255, 100, 109, 0.14), transparent 70%), #141414;
  --focus-ring: rgba(255, 107, 26, 0.45);
  --scrim: rgba(0, 0, 0, 0.6);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fbf7f1;
  --sidebar: #ffffff;
  --surface: #ffffff;
  --surface-2: #fdf9f4;
  --surface-3: #ffffff;
  --input-bg: #ffffff;
  --ink: #102c44;
  --ink-2: #3c5163;
  --muted: #66737f;
  --line: #efe6da;
  --line-2: #e0d4c4;
  --accent: #b53a22;
  --accent-2: #94301c;
  --accent-soft: #fff0e8;
  --accent-border: #ffc9a8;
  --primary: #ff6b1a;
  --primary-2: #f25c0a;
  --on-primary: #141414;
  --on-brand: #141414;
  --review: #c8304a;
  --review-soft: #ffe9ec;
  --review-border: #f6c3cb;
  --done: #11704f;
  --done-soft: #e2f4eb;
  --amber: #a85c00;
  --amber-soft: #fff1dc;
  --amber-ink: #6b4300;
  --red: #b42318;
  --red-soft: #fde8e6;
  --red-border: #f4c3bd;
  --on-danger: #ffffff;
  --danger-hover: #8f1c13;
  --blue: #2563d9;
  --blue-soft: #e7effd;
  --blue-border: #bfd0f5;
  --dot-todo: #b9ad9d;
  --hero-bg: radial-gradient(520px 260px at 100% 0%, rgba(255, 100, 109, 0.45), transparent 70%), radial-gradient(420px 240px at 78% 120%, rgba(255, 126, 31, 0.35), transparent 70%), #102c44;
  --hero-solid: #102c44;
  --hero-ink: #ffffff;
  --hero-muted: #c9d6e1;
  --hero-eyebrow: #ffb48c;
  --ring-hole: #173a57;
  --ring-track: rgba(255, 255, 255, 0.14);
  --column-bg: #f5eee5;
  --column-review-bg: #ffeeee;
  --admin-bar-bg: #102c44;
  --admin-bar-ink: #d6e1ea;
  --admin-bar-link: #ffb48c;
  --plan-next-bg: linear-gradient(160deg, #fff4ec, #ffeef0);
  --auth-bg: radial-gradient(900px 420px at 15% -10%, #ffe2cc, transparent 70%), radial-gradient(900px 420px at 95% 110%, #ffdade, transparent 70%), #fbf7f1;
  --focus-ring: rgba(255, 107, 26, 0.28);
  --scrim: rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 2px rgba(16, 44, 68, 0.05), 0 1px 1px rgba(16, 44, 68, 0.03);
  --shadow-lg: 0 12px 32px rgba(16, 44, 68, 0.1);
}
/* Auto follows the device setting */
@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    color-scheme: light;
    --bg: #fbf7f1;
    --sidebar: #ffffff;
    --surface: #ffffff;
    --surface-2: #fdf9f4;
    --surface-3: #ffffff;
    --input-bg: #ffffff;
    --ink: #102c44;
    --ink-2: #3c5163;
    --muted: #66737f;
    --line: #efe6da;
    --line-2: #e0d4c4;
    --accent: #b53a22;
    --accent-2: #94301c;
    --accent-soft: #fff0e8;
    --accent-border: #ffc9a8;
    --primary: #ff6b1a;
    --primary-2: #f25c0a;
    --on-primary: #141414;
    --on-brand: #141414;
    --review: #c8304a;
    --review-soft: #ffe9ec;
    --review-border: #f6c3cb;
    --done: #11704f;
    --done-soft: #e2f4eb;
    --amber: #a85c00;
    --amber-soft: #fff1dc;
    --amber-ink: #6b4300;
    --red: #b42318;
    --red-soft: #fde8e6;
    --red-border: #f4c3bd;
    --on-danger: #ffffff;
    --danger-hover: #8f1c13;
    --blue: #2563d9;
    --blue-soft: #e7effd;
    --blue-border: #bfd0f5;
    --dot-todo: #b9ad9d;
    --hero-bg: radial-gradient(520px 260px at 100% 0%, rgba(255, 100, 109, 0.45), transparent 70%), radial-gradient(420px 240px at 78% 120%, rgba(255, 126, 31, 0.35), transparent 70%), #102c44;
    --hero-solid: #102c44;
    --hero-ink: #ffffff;
    --hero-muted: #c9d6e1;
    --hero-eyebrow: #ffb48c;
    --ring-hole: #173a57;
    --ring-track: rgba(255, 255, 255, 0.14);
    --column-bg: #f5eee5;
    --column-review-bg: #ffeeee;
    --admin-bar-bg: #102c44;
    --admin-bar-ink: #d6e1ea;
    --admin-bar-link: #ffb48c;
    --plan-next-bg: linear-gradient(160deg, #fff4ec, #ffeef0);
    --auth-bg: radial-gradient(900px 420px at 15% -10%, #ffe2cc, transparent 70%), radial-gradient(900px 420px at 95% 110%, #ffdade, transparent 70%), #fbf7f1;
    --focus-ring: rgba(255, 107, 26, 0.28);
    --scrim: rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 2px rgba(16, 44, 68, 0.05), 0 1px 1px rgba(16, 44, 68, 0.03);
    --shadow-lg: 0 12px 32px rgba(16, 44, 68, 0.1);
  }
}
/* Printed invoices are always light */
@media print {
  :root, :root[data-theme] {
    color-scheme: light;
    --bg: #fbf7f1;
    --sidebar: #ffffff;
    --surface: #ffffff;
    --surface-2: #fdf9f4;
    --surface-3: #ffffff;
    --input-bg: #ffffff;
    --ink: #102c44;
    --ink-2: #3c5163;
    --muted: #66737f;
    --line: #efe6da;
    --line-2: #e0d4c4;
    --accent: #b53a22;
    --accent-2: #94301c;
    --accent-soft: #fff0e8;
    --accent-border: #ffc9a8;
    --primary: #ff6b1a;
    --primary-2: #f25c0a;
    --on-primary: #141414;
    --on-brand: #141414;
    --review: #c8304a;
    --review-soft: #ffe9ec;
    --review-border: #f6c3cb;
    --done: #11704f;
    --done-soft: #e2f4eb;
    --amber: #a85c00;
    --amber-soft: #fff1dc;
    --amber-ink: #6b4300;
    --red: #b42318;
    --red-soft: #fde8e6;
    --red-border: #f4c3bd;
    --on-danger: #ffffff;
    --danger-hover: #8f1c13;
    --blue: #2563d9;
    --blue-soft: #e7effd;
    --blue-border: #bfd0f5;
    --dot-todo: #b9ad9d;
    --hero-bg: radial-gradient(520px 260px at 100% 0%, rgba(255, 100, 109, 0.45), transparent 70%), radial-gradient(420px 240px at 78% 120%, rgba(255, 126, 31, 0.35), transparent 70%), #102c44;
    --hero-solid: #102c44;
    --hero-ink: #ffffff;
    --hero-muted: #c9d6e1;
    --hero-eyebrow: #ffb48c;
    --ring-hole: #173a57;
    --ring-track: rgba(255, 255, 255, 0.14);
    --column-bg: #f5eee5;
    --column-review-bg: #ffeeee;
    --admin-bar-bg: #102c44;
    --admin-bar-ink: #d6e1ea;
    --admin-bar-link: #ffb48c;
    --plan-next-bg: linear-gradient(160deg, #fff4ec, #ffeef0);
    --auth-bg: radial-gradient(900px 420px at 15% -10%, #ffe2cc, transparent 70%), radial-gradient(900px 420px at 95% 110%, #ffdade, transparent 70%), #fbf7f1;
    --focus-ring: rgba(255, 107, 26, 0.28);
    --scrim: rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 2px rgba(16, 44, 68, 0.05), 0 1px 1px rgba(16, 44, 68, 0.03);
    --shadow-lg: 0 12px 32px rgba(16, 44, 68, 0.1);
  }
}
/* ==== END THEME TOKENS ==== */

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1, h2, .stat-value, .mini-stats strong, .metric-grid strong, .section-title, .brand-text { font-family: var(--font-display); }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.005em; }
h2 { font-size: 19px; font-weight: 600; letter-spacing: 0; }
h3 { font-size: 15px; font-weight: 600; }
h4 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
p { margin: 0; }
small { font-size: 12.5px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 2px 6px; border-radius: 5px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.icon { flex-shrink: 0; display: block; }
.stack { display: grid; gap: 16px; }
.stack-sm { display: grid; gap: 12px; }
.stack-lg { display: grid; gap: 24px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 256px; flex-shrink: 0; background: var(--sidebar); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: grid; gap: 6px; padding: 6px 10px 14px; }
.brand-logo { display: block; height: 36px; width: auto; }
a.brand:hover { text-decoration: none; }
.brand-text { font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.brand-mark-img { display: block; height: 22px; width: auto; }
.nav { display: grid; gap: 2px; }
.nav + .nav-client, .nav-client { margin-top: 10px; padding: 10px 10px 6px; border-top: 1px solid var(--line); }
.nav-client small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.nav-client strong { font-size: 14px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-weight: 500; font-size: 14px;
}
.nav-item:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.nav-item { position: relative; }
.nav-item.active { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.nav-item.active::before { content: ''; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand-grad-diag); }
.nav-item.active .icon { color: var(--accent); opacity: 1; }
.nav-item .icon { opacity: 0.85; }
.nav-count {
  margin-left: auto; background: var(--brand-grad); color: var(--on-brand); font-size: 11.5px; font-weight: 600;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center;
}
.as-button { width: 100%; border: 0; background: none; cursor: pointer; font: inherit; font-weight: 500; font-size: 14px; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 4px; }
.who { display: flex; gap: 10px; align-items: center; padding: 4px 8px 8px; min-width: 0; }
.who div { min-width: 0; }
.who strong, .who small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { color: var(--muted); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: var(--brand-grad-diag); color: var(--on-brand); font-weight: 700; font-size: 13px;
}
.avatar.lg { width: 40px; height: 40px; border-radius: 10px; font-size: 16px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { width: 100%; max-width: 1240px; margin: 0 auto; padding: 28px 32px 64px; }
.topbar { display: none; }
.nav-toggle, .nav-scrim { display: none; }

.admin-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 32px;
  background: var(--admin-bar-bg); color: var(--admin-bar-ink); font-size: 13px; border-bottom: 3px solid transparent; border-image: var(--brand-grad) 1;
}
.admin-bar span { display: flex; align-items: center; gap: 8px; }
.admin-bar a { color: var(--admin-bar-link); font-weight: 600; }
.admin-bar.previewing { background: var(--brand-grad); color: var(--on-brand); font-weight: 500; }
.admin-bar.previewing a { color: var(--on-brand); text-decoration: underline; }

/* ---------- Buttons & badges ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-2); border-color: var(--primary-2); }
.btn-brand { background: var(--brand-grad); border: 0; color: var(--on-brand); }
.btn-brand:hover { filter: brightness(1.04); }
.btn-danger { background: var(--red); border-color: var(--red); color: var(--on-danger); }
.btn-danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); }
.btn-danger-ghost { color: var(--red); border-color: transparent; background: transparent; }
.btn-danger-ghost:hover { background: var(--red-soft); border-color: transparent; }
.btn-small { height: 32px; padding: 0 11px; font-size: 13px; }
.btn-block { width: 100%; height: 44px; }
.btn-review { color: var(--review); border-color: var(--review-border); background: var(--review-soft); }
.btn-review:hover { background: var(--review-soft); border-color: var(--review); }
.btn-link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: var(--radius-sm); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }

.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.badge-done { background: var(--done-soft); color: var(--done); border-color: transparent; }
.badge-in_progress { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.badge-review { background: var(--review-soft); color: var(--review); border-color: transparent; }
.badge-todo { background: var(--surface-2); color: var(--ink-2); }
.badge-amber { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.badge-blue { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.badge-red { background: var(--red-soft); color: var(--red); border-color: transparent; }

.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--line-2); display: inline-block; }
.dot-todo { background: var(--dot-todo); }
.dot-in_progress { background: var(--blue); }
.dot-review { background: var(--review); }
.dot-done { background: var(--done); }
.dot-amber { background: var(--amber); }
.dot-red { background: var(--red); }

.toast {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: 18px; border-radius: var(--radius-sm);
  background: var(--done-soft); color: var(--done); font-weight: 600; font-size: 14px; animation: fade 4s ease forwards;
}
@keyframes fade { 0%, 80% { opacity: 1; } 100% { opacity: 0.0; } }
.alert { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--red-soft); color: var(--red); font-size: 14px; }

/* ---------- Cards & headers ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card > h2 { margin-bottom: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.link-more { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 600; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.page-header p { margin-top: 4px; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; margin-top: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.empty { text-align: center; padding: 32px 16px; display: grid; justify-items: center; gap: 6px; }
.empty-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.empty-title { font-weight: 600; }

/* ---------- Dashboard ---------- */
.hero {
  display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 26px 28px;
  border-radius: 18px; color: var(--hero-ink); position: relative; overflow: hidden; isolation: isolate;
  background: var(--hero-bg);
}
.hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--brand-grad); }
.hero h1 { font-size: 28px; max-width: 26ch; }
.hero .eyebrow { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--hero-eyebrow); font-weight: 600; margin-bottom: 6px; }
.hero .muted { color: var(--hero-muted); }
.hero-note { margin-top: 10px; max-width: 62ch; font-size: 14.5px; }
.hero-progress { display: grid; justify-items: center; gap: 8px; flex-shrink: 0; }
.hero-progress .muted { font-size: 13px; }
.ring {
  --deg: calc(var(--p) * 3.6deg);
  width: 112px; height: 112px; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: radial-gradient(closest-side, var(--ring-hole) 79%, transparent 80% 100%), conic-gradient(var(--brand-orange) 0deg, var(--brand-pink) var(--deg), var(--ring-track) var(--deg));
}
.ring strong { font-size: 26px; line-height: 1; }
.ring small { color: var(--hero-muted); font-size: 12px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat {
  display: grid; gap: 4px; align-content: start; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--ink); box-shadow: var(--shadow); min-width: 0;
}
a.stat:hover { text-decoration: none; border-color: var(--line-2); box-shadow: var(--shadow-lg); }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 30px; font-weight: 700; letter-spacing: 0; line-height: 1.15; }
.stat-value.stat-text { font-size: 20px; line-height: 1.3; padding: 3px 0 2px; }
.stat-foot { font-size: 12.5px; color: var(--muted); }
.stat-attn { border-color: var(--review-border); background: linear-gradient(0deg, var(--surface), var(--review-soft)); }
.stat-attn .stat-value { color: var(--review); }
.stat-warn { border-color: var(--red-border); background: linear-gradient(0deg, var(--surface), var(--red-soft)); }
.stat-warn .stat-value { color: var(--red); }

.todo-list { list-style: none; margin: 0; padding: 0; display: grid; }
.todo-list li { display: flex; gap: 12px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); }
.todo-list li:first-child { border-top: 0; padding-top: 0; }
.todo-list a { font-weight: 600; color: var(--ink); }
.todo-list small { display: block; }

.meeting-next { display: flex; gap: 14px; align-items: flex-start; }
.meeting-next p { margin: 2px 0 10px; font-size: 14px; }
.meeting-last { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.date-chip {
  width: 52px; flex-shrink: 0; border-radius: 10px; overflow: hidden; text-align: center; border: 1px solid var(--line); background: var(--surface);
}
.date-chip small { display: block; background: var(--brand-grad); color: var(--on-brand); font-size: 11px; font-weight: 600; text-transform: uppercase; padding: 2px 0; letter-spacing: 0.05em; }
.date-chip strong { display: block; font-size: 19px; padding: 4px 0 5px; }

.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 8px 0 12px; }
.mini-stats div, .metric-grid div { display: grid; gap: 2px; align-content: start; }
.mini-stats small, .metric-grid small { color: var(--muted); font-size: 12.5px; }
.mini-stats strong { font-size: 20px; letter-spacing: -0.01em; }
.delta { font-size: 12px; font-weight: 600; color: var(--muted); }
.delta.up { color: var(--done); }
.delta.down { color: var(--red); }

.activity { list-style: none; margin: 0; padding: 0; display: grid; }
.activity li { display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.activity li:first-child { border-top: 0; padding-top: 0; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-grad-diag); transform: translateY(-1px); }

/* ---------- Kanban ---------- */
.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.segmented a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 7px; color: var(--ink-2); font-weight: 600; font-size: 13.5px; }
.segmented a:hover { text-decoration: none; color: var(--ink); }
.segmented a.on { background: var(--ink); color: var(--bg); }
.kanban { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.column { background: var(--column-bg); border-radius: var(--radius); padding: 10px; min-height: 160px; }
.column > header { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; }
.column > header h2 { font-size: 14px; }
.column .count { margin-left: auto; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.col-review { background: var(--column-review-bg); box-shadow: inset 0 3px 0 var(--brand-pink); }
.column-body { display: grid; gap: 10px; min-height: 60px; }
.column-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 18px 0; border: 1.5px dashed var(--line-2); border-radius: var(--radius-sm); }
.column.drop-target { outline: 2px dashed var(--brand-orange); outline-offset: -2px; }
.task { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; box-shadow: var(--shadow); display: grid; gap: 8px; }
.task[draggable='true'] { cursor: grab; }
.task.dragging { opacity: 0.5; }
.task-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.task h3 { font-size: 14.5px; }
.task-desc { font-size: 13.5px; color: var(--ink-2); }
.task .btn-review { justify-self: start; }
.due { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 500; }
.due.late { color: var(--red); }
.feedback { background: var(--amber-soft); border-radius: 8px; padding: 8px 10px; font-size: 13.5px; }
.feedback small { font-weight: 600; color: var(--amber); }
.task-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; padding-top: 4px; border-top: 1px solid var(--line); }
.task-actions form { margin: 0; }
.changes { width: 100%; }
.changes > summary { list-style: none; }
.changes > summary::-webkit-details-marker { display: none; }
.changes[open] > summary { display: none; }
.changes form { display: grid; gap: 8px; }
.task-actions:has(.changes[open]) > form { display: none; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tfoot td { border-top: 2px solid var(--ink); border-bottom: 0; font-size: 15px; }
.card.flush .table { min-width: 560px; }
.card.flush { overflow-x: auto; }

/* ---------- Timeline ---------- */
.progress-line { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.progress-line .bar { flex: 1; min-width: 160px; height: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.progress-line .bar span { display: block; height: 100%; background: var(--brand-grad); border-radius: 6px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; position: relative; }
.timeline::before { content: ''; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: var(--line-2); }
.timeline li { display: grid; grid-template-columns: 32px 1fr; gap: 14px; position: relative; }
.tl-marker {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700;
  background: var(--surface); border: 2px solid var(--line-2); color: var(--muted); z-index: 1; margin-top: 14px;
}
.tl-done .tl-marker { background: var(--brand-grad-diag); border-color: transparent; color: var(--on-brand); }
.tl-in_progress .tl-marker { border-color: var(--brand-orange); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tl-in_progress .tl-body { border-color: var(--accent-border); }
.tl-body { display: grid; gap: 6px; }
.tl-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }

/* ---------- Meetings ---------- */
.meeting { display: grid; gap: 14px; }
.meeting-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.meeting-body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.meeting-body:has(> :only-child) { grid-template-columns: 1fr; }
.action-items { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 6px; align-content: start; }

.prose { font-size: 14.5px; color: var(--ink-2); }
.prose > * + * { margin-top: 8px; }
.prose h3, .prose h4, .prose h5 { color: var(--ink); font-size: 14px; text-transform: none; letter-spacing: 0; margin-top: 14px; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 20px; margin-bottom: 0; }
.prose li + li { margin-top: 3px; }

/* ---------- Documents ---------- */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.doc { display: grid; gap: 10px; align-content: start; }
.doc .btn { justify-self: start; }
.doc-head { display: flex; gap: 12px; align-items: flex-start; }
.doc-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }

/* ---------- Tasks & projects ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters select { font: inherit; font-size: 13.5px; height: 34px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 8px; background: var(--input-bg); color: var(--ink); }
.task-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.task-link { color: var(--ink); }
.task-link:hover { color: var(--accent); }
.task-project { display: block; margin-top: -4px; }
.task-internal { border-style: dashed; }
.needs-client { font-size: 12.5px; font-weight: 700; color: var(--review); }
.task-meta { display: flex; align-items: center; gap: 10px; }
.task-meta small { display: inline-flex; align-items: center; gap: 3px; }
.mini-avatars { display: flex; }
.avatar.xs { width: 22px; height: 22px; font-size: 10.5px; margin-left: -5px; border: 2px solid var(--surface); }
.avatar.xs:first-child { margin-left: 0; }
.avatar-client { background: var(--blue-soft); color: var(--blue); }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.project { display: grid; gap: 8px; align-content: start; }
.project h3 a { color: var(--ink); }
.task-head { display: grid; gap: 10px; }
.task-head h1 { font-size: 26px; }
.task-head-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.task-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; }
.task-facts dt { font-size: 12px; color: var(--muted); }
.task-facts dd { margin: 0; font-weight: 600; font-size: 14px; }
.task-desc-full { white-space: pre-wrap; color: var(--ink-2); }
.task-admin { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.task-admin .admin-edit { flex-basis: 100%; }
.checklist-items { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.checklist-items li { display: flex; align-items: center; gap: 10px; }
.checklist-items li.is-done .grow { text-decoration: line-through; color: var(--muted); }
.checklist-items form { margin: 0; }
.check-toggle { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--line-2); background: var(--input-bg); display: grid; place-items: center; color: var(--on-primary); cursor: pointer; padding: 0; }
li.is-done .check-toggle { background: var(--done); border-color: var(--done); }
.inline-add { display: flex; gap: 8px; }
.inline-add input { flex: 1; font: inherit; font-size: 14px; height: 34px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 10px; background: var(--input-bg); color: var(--ink); }
.comments { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 14px; }
.comment { display: flex; gap: 12px; }
.comment-internal { background: var(--amber-soft); border-radius: 10px; padding: 10px; }
.comment-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.comment-body { white-space: pre-wrap; margin-top: 2px; }
.comment-form textarea { font: inherit; font-size: 14px; width: 100%; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px; background: var(--input-bg); color: var(--ink); }
.comment-form .row-actions { justify-content: space-between; align-items: center; }

/* ---------- Files ---------- */
.folder-tabs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.folder-tabs > a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 13.5px; font-weight: 600; }
.folder-tabs > a:hover { text-decoration: none; color: var(--ink); }
.folder-tabs > a.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.folder-new > summary { list-style: none; }
.folder-new > summary::-webkit-details-marker { display: none; }
.folder-new[open] { flex-basis: 100%; }
.folder-new .inline-add { margin-top: 8px; }
.inline-add select { font: inherit; font-size: 13.5px; height: 34px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 8px; background: var(--input-bg); color: var(--ink); }
.upload-box { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.upload-box input[type="file"] { min-height: 0; padding: 7px; }
.files-table .file-actions { text-align: right; white-space: nowrap; }
.files-table .admin-edit form { margin-top: 8px; text-align: left; }
.files-table .admin-edit input:not([type="file"]), .files-table .admin-edit select { font: inherit; font-size: 13.5px; height: 32px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 8px; background: var(--input-bg); color: var(--ink); }
.versions ul { margin: 4px 0 0; padding-left: 18px; font-size: 13px; }

/* ---------- Messages ---------- */
.thread { max-height: 60vh; overflow-y: auto; }
.thread-internal { background: var(--amber-soft); }
.messages { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.msg { max-width: 78%; justify-self: start; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px 12px 12px 4px; padding: 10px 14px; }
.msg.mine { justify-self: end; background: var(--accent-soft); border-color: var(--accent-border); border-radius: 12px 12px 4px 12px; }
.msg-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.msg-body { white-space: pre-wrap; margin-top: 2px; overflow-wrap: anywhere; }
.msg-file { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 13.5px; font-weight: 600; }
.composer { display: grid; gap: 10px; }
.composer textarea { font: inherit; font-size: 14.5px; width: 100%; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px; background: var(--input-bg); color: var(--ink); resize: vertical; }
.composer-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.attach { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.attach input { font-size: 12.5px; max-width: 220px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 760px) { .msg { max-width: 92%; } }

/* ---------- Agency overview ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.workload { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.workload li { display: flex; align-items: baseline; gap: 10px; font-size: 14px; }
.workload .late { color: var(--red); font-weight: 600; }
@media (max-width: 1100px) { .grid-3 { grid-template-columns: 1fr; } }

.appearance-inline .theme-switch { max-width: 320px; margin: 8px 0 0; }

/* ---------- Service modules: deliverables, social calendar ---------- */
.deliv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.deliv { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 6px; align-content: start; box-shadow: var(--shadow); }
.attention-card { border-color: var(--review-border); }
.approval-box { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; padding-top: 6px; border-top: 1px solid var(--line); }
.approval-box form { margin: 0; }
.approval-box .changes form { display: grid; gap: 8px; }
.approval-box .changes textarea { font: inherit; font-size: 14px; width: 100%; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px; background: var(--input-bg); color: var(--ink); }
.internal-note { background: var(--amber-soft); }
.calendar-head { flex-wrap: wrap; justify-content: flex-start; }
.calendar-head h2 { min-width: 160px; text-align: center; }
.calendar-filter { margin-left: auto; display: flex; gap: 6px; }
.calendar-filter select { font: inherit; font-size: 13.5px; height: 32px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 8px; background: var(--input-bg); color: var(--ink); }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; padding: 4px 6px; }
.cal-day { min-height: 92px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.other { opacity: 0.45; }
.cal-day.today { border-color: var(--primary); }
.cal-num { font-size: 12px; font-weight: 700; color: var(--muted); }
.cal-item { display: block; font-size: 11.5px; line-height: 1.3; padding: 3px 5px; border-radius: 5px; background: var(--surface); border-left: 3px solid var(--line-2); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-item:hover { text-decoration: none; background: var(--accent-soft); }
.cal-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-item.st-client_review { border-left-color: var(--review); }
.cal-item.st-approved, .cal-item.st-scheduled { border-left-color: var(--blue); }
.cal-item.st-published { border-left-color: var(--done); }
.cal-item.st-changes_requested { border-left-color: var(--amber); }
.cal-item.st-draft, .cal-item.st-internal_review { border-left-style: dashed; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cal-legend .cal-item { display: inline-block; }
@media (max-width: 760px) {
  .calendar { grid-template-columns: 1fr; }
  .cal-dow, .cal-day.other { display: none; }
  .cal-day { min-height: 0; }
  .cal-day:not(:has(.cal-item)) { display: none; }
}

.requests { list-style: none; margin: 10px 0 0; padding: 0; display: grid; }
.requests > li { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.requests > li:first-child { border-top: 0; }
.requests strong, .requests small { display: block; }
.requests .reply { background: var(--surface-2); border-radius: 8px; padding: 6px 10px; margin-top: 6px; }
.requests .admin-edit { flex-basis: 100%; }
.requests .admin-edit select, .requests .admin-edit textarea { font: inherit; font-size: 14px; width: 100%; border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 8px; background: var(--input-bg); color: var(--ink); }
.website { display: grid; gap: 10px; }

/* ---------- My work ---------- */
.work-filters { gap: 12px; align-items: flex-end; }
.work-filters .field { min-width: 180px; }
.work-filters .field select { font: inherit; font-size: 14px; height: 36px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 8px; background: var(--input-bg); color: var(--ink); }
.work-list { display: grid; }
.work-item { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.work-list .work-item:first-child { border-top: 0; padding-top: 4px; }
.work-title { font-weight: 600; color: var(--ink); }
.work-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; margin-top: 4px; }
.work-meta .icon { display: inline-block; vertical-align: -1px; }
.due-overdue { color: var(--red); font-weight: 600; }
.work-overdue { border-color: var(--red-border); }
.status-form { display: flex; gap: 6px; align-items: center; }
.status-form select { font: inherit; font-size: 13.5px; height: 32px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 8px; background: var(--input-bg); color: var(--ink); }
.work-board .work-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.work-board .work-item.is-overdue { border-color: var(--red-border); }
.work-board .status-form, .work-board .status-form select { width: 100%; }

/* ---------- Integrations ---------- */
.source-tag.source-live { background: var(--done-soft, var(--surface-2)); color: var(--done); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 18px; margin: 0; }
.facts dt { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; }
.facts dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.notes { margin: 0; padding-left: 18px; color: var(--ink-2); }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--ink-2); }
.steps code, .notice code { font-size: 12.5px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }

/* ---------- SEO, Strategy ---------- */
.table-wrap { overflow-x: auto; margin-top: 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.table-wrap .table { min-width: 620px; }
.table td small { display: block; }
.rank-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.rank-row span { flex: 1; min-width: 0; }
.rank-row input { width: 76px; font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--input-bg); color: var(--ink); }
.backlinks { list-style: none; margin: 10px 0 0; padding: 0; display: grid; }
.backlinks > li { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.backlinks > li:first-child { border-top: 0; }
.backlinks strong, .backlinks small { display: block; overflow-wrap: anywhere; }
.backlinks .internal-note, .recs .internal-note { border-radius: 8px; padding: 6px 10px; margin-top: 6px; }
.backlinks p.internal-note .icon, .recs p.internal-note .icon { display: inline-block; vertical-align: -2px; }
.backlinks .admin-edit, .kpi .admin-edit { flex-basis: 100%; }
fieldset.internal-note { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 12px; margin: 0; }
fieldset.internal-note legend { font-size: 13px; font-weight: 600; padding: 0 6px; display: inline-flex; gap: 6px; align-items: center; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 10px; }
.kpi { display: grid; gap: 6px; align-content: start; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); min-width: 0; }
.kpi-bar { height: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.kpi-bar span { display: block; height: 100%; background: var(--brand-grad); }
.recs { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.rec { display: grid; gap: 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.rec-proposed { border-color: var(--review); }
.rec-declined { opacity: 0.75; }
.rec-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rec .reply { background: var(--surface-2); border-radius: 8px; padding: 6px 10px; margin: 0; }
.rec-respond { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rec-respond input { flex: 1; min-width: 200px; font: inherit; font-size: 14px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--input-bg); color: var(--ink); }

/* ---------- Invoices ---------- */
.invoice-doc { padding: 32px; display: grid; gap: 24px; }
.invoice-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.invoice-head .brand { padding: 0; }
.invoice-head .brand-logo { height: 40px; }
.invoice-doc { position: relative; overflow: hidden; }
.invoice-doc::before { content: ''; position: absolute; inset: 0 0 auto; height: 5px; background: var(--brand-grad); }
.invoice-meta { display: grid; justify-items: end; gap: 8px; }
.invoice-meta h1 { font-size: 22px; }
.invoice-parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.invoice-parties div { display: grid; gap: 2px; }
.invoice-items th { background: transparent; padding-left: 0; padding-right: 0; }
.invoice-items td { padding-left: 0; padding-right: 0; }
.invoice-items .num { padding-left: 16px; }
.pay-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; display: grid; gap: 8px; }
tr.clickable td a { color: var(--ink); }

/* ---------- Ads ---------- */
.campaigns { list-style: none; margin: 0; padding: 0; display: grid; }
.campaign { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.campaign:first-child { border-top: 0; }
.campaign small { display: block; }
.campaign .admin-edit { flex-basis: 100%; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); flex-shrink: 0; }
.pulse.running { background: #1fa37f; box-shadow: 0 0 0 0 rgba(31, 163, 127, 0.5); animation: pulse 2s infinite; }
.pulse.paused { background: var(--amber); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(31, 163, 127, 0.45); } 70% { box-shadow: 0 0 0 8px rgba(31, 163, 127, 0); } 100% { box-shadow: 0 0 0 0 rgba(31, 163, 127, 0); } }
.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; padding: 14px 0; margin-bottom: 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric-grid strong { font-size: 18px; letter-spacing: -0.01em; }
.card > .prose + .action-items { margin-top: 12px; }
.bars { display: flex; align-items: flex-end; gap: 14px; height: 180px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; min-width: 0; }
.bar-col .bar { width: 100%; max-width: 56px; background: linear-gradient(180deg, #ff646d, #ff7e1f); opacity: 0.55; border-radius: 6px 6px 2px 2px; min-height: 3px; }
.bar-col:last-child .bar { opacity: 1; }
.bar-val { font-size: 13px; font-weight: 600; }
.bar-col small { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ---------- CRM funnel ---------- */
.funnel { display: grid; gap: 10px; }
.funnel-row { display: grid; grid-template-columns: 140px 1fr 44px 96px; gap: 12px; align-items: center; }
.funnel.compact .funnel-row { grid-template-columns: 100px 1fr 32px; gap: 10px; }
.funnel-label { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.funnel-bar { height: 26px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.funnel.compact .funnel-bar { height: 18px; }
.funnel-bar span { display: block; height: 100%; background: var(--brand-grad); border-radius: 6px; }
.funnel-num { text-align: right; font-variant-numeric: tabular-nums; }
.funnel-val { text-align: right; font-size: 13px; }
.funnel-row .admin-edit { grid-column: 1 / -1; }

/* ---------- Admin ---------- */
.admin-panel { background: var(--surface); border: 1.5px dashed var(--accent-border); border-radius: var(--radius); }
.admin-panel > summary {
  cursor: pointer; list-style: none; padding: 12px 16px; font-weight: 600; color: var(--accent); display: flex; align-items: center; gap: 8px; font-size: 14px;
}
.admin-panel > summary::-webkit-details-marker { display: none; }
.admin-panel[open] > summary { border-bottom: 1px solid var(--line); }
.admin-panel > form { padding: 16px; }
.admin-edit > summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600;
  color: var(--muted); padding: 3px 8px 3px 6px; border-radius: 6px;
}
.admin-edit > summary::-webkit-details-marker { display: none; }
.admin-edit > summary:hover { background: var(--surface-2); color: var(--ink); }
.admin-edit[open] { border-top: 1px dashed var(--line-2); padding-top: 10px; }
.admin-edit[open] > summary { margin-bottom: 10px; }
.admin-edit > form { background: var(--surface-2); border-radius: 10px; padding: 14px; }
.task .admin-edit > form { grid-template-columns: 1fr; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-start; flex-wrap: wrap; }
.form-inline { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 14px; }
.form-inline .field { flex: 1; min-width: 200px; }
.field { display: grid; gap: 5px; min-width: 0; align-content: start; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea, .changes textarea, .items-row input {
  width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: var(--input-bg); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: 9px 11px; min-height: 40px;
}
.field textarea, .changes textarea { resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus, .changes textarea:focus, .items-row input:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus-ring);
}
.checks { gap: 8px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }
.check input[type='checkbox'] { width: 16px; height: 16px; accent-color: var(--brand-orange); }
.items-editor { display: grid; gap: 6px; }
.items-row { display: grid; grid-template-columns: 1fr 80px 120px; gap: 8px; }
.items-head small { color: var(--muted); font-weight: 600; }

.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.client-card { display: grid; gap: 14px; color: var(--ink); }
.client-card:hover { text-decoration: none; border-color: var(--line-2); box-shadow: var(--shadow-lg); }
.client-card-head { display: flex; gap: 12px; align-items: center; }
.client-card-head small { display: block; }
.client-card-stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.client-card-stats strong { color: var(--ink); }
.client-card-stats .attn strong { color: var(--review); }
.client-card-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.logins { list-style: none; margin: 12px 0 0; padding: 0; display: grid; }
.logins li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.logins small { display: block; }
.danger-zone { border-color: var(--red-border); }
.danger-zone h2 { color: var(--red); margin-bottom: 4px; }

/* ---------- Teams & roles ---------- */
.badge-brand { background: var(--brand-grad); color: var(--on-brand); border-color: transparent; }
.role-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.role-cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.role-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 4px; position: relative; overflow: hidden; }
.role-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line-2); }
.role-card.role-owner::before, .role-card.role-admin:first-child::before { background: var(--brand-grad-diag); }
.role-card.role-admin::before { background: var(--blue); }
.role-cards.two .role-admin::before { background: var(--brand-grad-diag); }
.people { list-style: none; margin: 0; padding: 0; }
.people > li { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line); }
.people > li:first-child { border-top: 0; }
.people strong, .people small { display: block; }
.people .works-on { color: var(--ink-2); margin-top: 2px; }
.people .person-edit { flex-basis: 100%; }
.person-actions { display: flex; gap: 6px; align-items: center; }
.person-actions form { margin: 0; }
.inline-role { display: flex; gap: 6px; }
.inline-role select { font: inherit; font-size: 13px; height: 32px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 8px; background: var(--input-bg); color: var(--ink); }
.js .js-hide { display: none; }
.pad { padding: 16px 18px; }
.assign-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.assign-grid.compact { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 12px; }
.check.assign { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; gap: 10px; }
.check.assign:has(input:checked) { border-color: var(--brand-orange); background: var(--accent-soft); }
.check.assign small { display: block; }
@media (max-width: 760px) {
  .role-cards, .role-cards.two { grid-template-columns: 1fr; }
  .person-actions { flex-basis: 100%; padding-left: 44px; }
}

/* ---------- Dashboard team strip ---------- */
.hero-team { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; font-size: 13.5px; color: var(--hero-muted); }
.hero-avatars { display: flex; }
.hero-avatars .avatar { width: 28px; height: 28px; font-size: 12px; border: 2px solid var(--hero-solid); margin-left: -8px; }
.hero-avatars .avatar:first-child { margin-left: 0; }
.hero-team .btn { height: 30px; }

/* ---------- Services & entitlements ---------- */
.nav-label { display: block; margin: 12px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.nav-tag { margin-left: auto; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--amber); background: var(--amber-soft); padding: 1px 6px; border-radius: 5px; }
.notice { display: flex; gap: 8px; align-items: flex-start; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.notice-amber { background: var(--amber-soft); border-color: transparent; color: var(--amber-ink); }
.source-tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; vertical-align: 1px; }
.source-line { font-size: 13px; color: var(--muted); margin: -6px 0 0; }
.service-list { display: grid; }
.service-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.service-row:first-child { border-top: 0; }
.service-row strong, .service-row small { display: block; }
.service-row.on strong { color: var(--ink); }
.service-actions { position: relative; }
.service-actions > summary { list-style: none; cursor: pointer; }
.service-actions > summary::-webkit-details-marker { display: none; }
.service-actions[open] { flex-basis: 100%; order: 3; }
.service-actions[open] > summary { display: none; }
.service-actions > form { background: var(--surface-2); border-radius: 10px; padding: 14px; }
.services-foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.services-foot h4 { margin-bottom: 8px; }
.chips { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.chip-brand { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-2); }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.overrides { margin-top: 14px; }
.override-list { display: grid; gap: 8px; }
.override-row { display: grid; grid-template-columns: 150px 150px 1fr auto auto; gap: 8px; align-items: center; }
.override-row select, .override-row input { font: inherit; font-size: 13.5px; height: 34px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 8px; background: var(--input-bg); color: var(--ink); min-width: 0; }
.service-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.service-picker small { display: block; }
@media (max-width: 760px) {
  .override-row { grid-template-columns: 1fr 1fr; }
  .override-row strong { grid-column: 1 / -1; }
}

/* ---------- Offers & plan ---------- */
.offer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.offer { display: grid; gap: 8px; align-content: start; position: relative; overflow: hidden; }
.offer::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--brand-grad); }
.offer-inactive { opacity: 0.7; }
.offer-inactive::before { background: var(--line-2); }
.offer-head { display: flex; gap: 6px; align-items: center; }
.offer-usage { margin-left: auto; }
.offer-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-2); }
.offer-meta span + span::before { content: '·'; margin-right: 14px; color: var(--muted); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: 13.5px; color: var(--ink-2); }
.checklist li { display: flex; gap: 7px; align-items: flex-start; }
.checklist .icon { color: var(--done); margin-top: 3px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.plan-item { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 6px; align-content: start; background: var(--surface-2); }
.plan-item-head { display: flex; gap: 6px; min-height: 22px; }
.plan-next { background: var(--plan-next-bg); border-color: var(--accent-border); }
.plan-next .btn { justify-self: start; margin-top: 4px; }
.eyebrow-sm { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.packages > li { padding-left: 0; padding-right: 0; }
.packages .admin-edit { flex-basis: 100%; }
.nav-ext { margin-left: auto; color: var(--muted); font-size: 13px; }
.sidebar-links { font-size: 12px; color: var(--muted); padding: 0 10px 6px; margin: 0; }
.sidebar-links a { color: var(--muted); }

/* ---------- Step 3: wizard, teams, audit ---------- */
.stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.stepper li { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; min-width: 0; }
.stepper li span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stepper .step-num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 12px; flex-shrink: 0; }
.stepper li.on { color: var(--ink); border-color: var(--accent-border); background: var(--accent-soft); }
.stepper li.on .step-num, .stepper li.done .step-num { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.stepper li.done { color: var(--ink-2); }
.wizard { display: grid; gap: 16px; }
.wizard-step { margin: 0; display: grid; gap: 14px; }
.wizard-step legend { font-family: var(--font-display); font-size: 20px; font-weight: 700; padding: 0 6px; margin-left: -6px; color: var(--ink); }
.wizard-nav { display: flex; justify-content: space-between; gap: 10px; }
.field-error { color: var(--red); font-weight: 600; }
.has-error input, .has-error select { border-color: var(--red) !important; }
input[aria-invalid="true"] { border-color: var(--red) !important; }
.req { color: var(--red); font-style: normal; }
.module-preview { padding-top: 12px; border-top: 1px solid var(--line); }
.module-preview h4 { margin-bottom: 8px; }
.assign-table { display: grid; }
.assign-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.assign-row:first-child { border-top: 0; }
.assign-row strong, .assign-row small { display: block; }
.assign-row select, .invite-row input, .invite-row select { font: inherit; font-size: 14px; height: 38px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 0 10px; background: var(--input-bg); color: var(--ink); min-width: 0; }
.invite-rows { display: grid; gap: 8px; }
.invite-row { display: grid; grid-template-columns: 1.4fr 1fr 160px; gap: 8px; }
.review-list { display: grid; gap: 0; margin: 0; }
.review-row { display: grid; grid-template-columns: 220px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.review-row:first-child { border-top: 0; }
.review-row dt { color: var(--muted); font-size: 13.5px; }
.review-row dd { margin: 0; }
.review-row ul { margin: 0; padding-left: 18px; }
.role-cards-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.role-cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.role-card.role-owner::before, .role-card.role-admin::before { background: var(--brand-grad-diag); }
.role-card.role-account_manager::before, .role-card.role-member::before { background: var(--blue); }
.role-card.role-specialist::before { background: var(--done); }
.role-card.role-finance::before { background: var(--amber); }
.people > li.is-deactivated { opacity: 0.6; }
.client-logo { display: block; max-height: 32px; max-width: 140px; margin-bottom: 6px; border-radius: 4px; }
.hero-logo { display: block; max-height: 40px; max-width: 160px; margin-bottom: 10px; border-radius: 6px; background: #fff; padding: 4px; }
.sample-banner { margin-bottom: 16px; }
.content > .notice { margin-bottom: 16px; }
.audit-filters { margin-top: 0; }
.audit-table td { vertical-align: top; }
@media (max-width: 900px) {
  .stepper { grid-template-columns: repeat(5, auto); overflow-x: auto; }
  .stepper li span:last-child { display: none; }
  .stepper li.on span:last-child { display: inline; }
}
@media (max-width: 760px) {
  .role-cards-6, .role-cards-3 { grid-template-columns: 1fr; }
  .invite-row { grid-template-columns: 1fr; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .review-row { grid-template-columns: 1fr; gap: 2px; }
  .assign-row { flex-wrap: wrap; }
  .assign-row select { flex-basis: 100%; }
}

/* ---------- Invoices ---------- */
.invoice-items tfoot tr.sub td { border-top: 0; font-size: 14px; color: var(--ink-2); padding-top: 6px; padding-bottom: 6px; }
.payments li { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.payments li.voided { opacity: 0.6; text-decoration: line-through; }
.inline-form { display: inline-flex; gap: 6px; margin-left: auto; }
.inline-form input { font: inherit; font-size: 13px; height: 32px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 8px; background: var(--input-bg); color: var(--ink); }
.staff-tools { display: grid; gap: 14px; }
.alert.wide { grid-column: 1 / -1; }

/* ---------- Theme: logo swap + switch ---------- */
.logo-on-light { display: none; }
:root[data-theme="light"] .logo-on-light { display: block; }
:root[data-theme="light"] .logo-on-dark { display: none; }
@media (prefers-color-scheme: light) {
  :root[data-theme="system"] .logo-on-light { display: block; }
  :root[data-theme="system"] .logo-on-dark { display: none; }
}
.theme-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 3px; margin: 4px 6px 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.theme-switch button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 30px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
:root[data-theme="dark"] .theme-switch button[aria-pressed="true"], :root:not([data-theme]) .theme-switch button[aria-pressed="true"] { background: var(--surface-3); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-content: center; justify-items: center; padding: 24px 16px; gap: 16px; background: var(--auth-bg); }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 32px 28px 28px; position: relative; overflow: hidden; box-shadow: var(--shadow-lg); display: grid; gap: 14px; }
.auth-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; background: var(--brand-grad); }
.auth-card .brand { padding: 0 0 10px; }
.auth-card .brand-logo { height: 36px; }
.auth-card h1 { font-size: 26px; }
.auth-foot { text-align: center; font-size: 13px; }
.code-input { font-size: 24px !important; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.resend { font-size: 14px; text-align: center; }
.dev-note { background: var(--amber-soft); color: var(--amber-ink); padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13.5px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .meeting-body { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(4, minmax(260px, 82vw)); scroll-snap-type: x mandatory; }
  .column { scroll-snap-align: start; }
}
@media (max-width: 760px) {
  .sidebar { position: fixed; z-index: 30; left: 0; top: 0; transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: var(--shadow-lg); }
  .nav-toggle:checked ~ .sidebar { transform: none; }
  .nav-toggle:checked ~ .nav-scrim { display: block; position: fixed; inset: 0; background: var(--scrim); z-index: 20; }
  .topbar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
  .topbar .brand-mark-img { height: 22px; }
  .topbar-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .content { padding: 20px 16px 48px; }
  .admin-bar { padding: 8px 16px; flex-wrap: wrap; }
  .hero { flex-direction: column; align-items: flex-start; padding: 22px; }
  .hero h1 { font-size: 23px; }
  .hero-progress { flex-direction: row; gap: 14px; }
  .ring { width: 84px; height: 84px; }
  .ring strong { font-size: 20px; }
  h1 { font-size: 22px; }
  .stats, .stats-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px; }
  .stat-value { font-size: 22px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .funnel-row { grid-template-columns: 100px 1fr 36px; }
  .funnel-val { display: none; }
  .invoice-doc { padding: 20px; }
  .activity li { grid-template-columns: 10px 1fr; }
  .activity li small { grid-column: 2; }
  .items-row { grid-template-columns: 1fr 60px 90px; }
  .hide-sm { display: none; }
  .card.flush .table { min-width: 0; }
  .table th, .table td { padding: 10px 12px; }
  .stats-3 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* ---------- Print (invoices) ---------- */
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .admin-bar, .no-print, .toast, .nav-scrim { display: none !important; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .logo-on-dark { display: none !important; }
  .logo-on-light { display: block !important; }
}
