/* Luminar Media Client Portal — design system
   Palette: charcoal ink, ivory ground, one champagne-gold accent.
   Type: Fraunces (titles, goal figures) + Manrope (interface, tabular numbers). */

@font-face {
  font-family: "Fraunces";
  src: url("../fonts/Fraunces.ttf") format("truetype");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/Manrope.ttf") format("truetype");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --charcoal: #242429;
  --graphite: #4A4A52;
  --slate: #8A8A93;
  --stone: #E6E2DA;
  --stone-soft: #EFECE6;
  --ivory: #F7F5F0;
  --surface: #FFFFFF;
  --gold: #B8975A;
  --gold-ink: #8C6F38;      /* gold dark enough for text on light grounds */
  --gold-tint: #F3ECDF;

  --good: #4E7A5E;
  --warn: #C2913A;
  --bad: #A5503F;
  --good-tint: #E7EFE9;
  --warn-tint: #F6EEDD;
  --bad-tint: #F4E4E0;

  --sidebar-bg: #242429;
  --sidebar-ink: #F2EFE8;
  --sidebar-quiet: #9E9DA6;
  --sidebar-line: #36363D;

  --ink: var(--charcoal);
  --ink-2: var(--graphite);
  --ink-3: var(--slate);
  --line: var(--stone);
  --ground: var(--ivory);

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-ui: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;

  --r-panel: 12px;
  --r-control: 8px;
  --sidebar-w: 256px;
  --focus: 0 0 0 3px color-mix(in srgb, var(--gold) 45%, transparent);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #F2EFE8;
    --ink-2: #C9C7CE;
    --ink-3: #9E9DA6;
    --line: #2E2E35;
    --stone-soft: #26262C;
    --ground: #141417;
    --surface: #1E1E23;
    --gold: #CBAE74;
    --gold-ink: #CBAE74;
    --gold-tint: #2C2820;
    --good: #7FA98C;
    --warn: #D6AE62;
    --bad: #C97D6C;
    --good-tint: #1F2A23;
    --warn-tint: #2D2719;
    --bad-tint: #2E201D;
    --sidebar-bg: #101013;
    --sidebar-line: #26262C;
    color-scheme: dark;
  }
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--ground);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.2; }
p { margin: 0 0 12px; }
a { color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 16px; border-radius: var(--r-control); }
.skip:focus { left: 16px; }
.muted { color: var(--ink-3); }
.hint { color: var(--ink-3); font-size: 13px; margin: 6px 0 0; }
.optional { color: var(--ink-3); font-weight: 400; font-size: 13px; }

/* ── App shell ── */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: var(--sidebar-bg); color: var(--sidebar-ink);
  display: flex; flex-direction: column; z-index: 40;
  overflow-y: auto;
}
.sidebar__brand { display: flex; align-items: center; justify-content: space-between; padding: 28px 24px 20px; }
.sidebar__logo { color: var(--sidebar-ink); display: block; width: 148px; }
.logo-mark { display: block; width: 100%; height: auto; }
.sidebar__close { display: none; background: none; border: 0; color: var(--sidebar-quiet); font-size: 24px; cursor: pointer; }

.switcher { padding: 0 16px 16px; }
.switcher select {
  width: 100%; appearance: none; cursor: pointer;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239E9DA6' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--sidebar-ink); border: 1px solid var(--sidebar-line); border-radius: var(--r-control);
  padding: 9px 32px 9px 12px; font: 600 14px/1.3 var(--font-ui);
}
.switcher select option { color: #242429; }

.nav { flex: 1; padding: 4px 12px 24px; }
.nav__client { font-family: var(--font-display); font-size: 18px; padding: 0 12px 12px; margin: 0; }
.nav__group { color: var(--sidebar-quiet); font-size: 12px; font-weight: 600; letter-spacing: .02em; padding: 18px 12px 6px; margin: 0; }
.nav__list { list-style: none; margin: 0; padding: 0; }
.nav__list a {
  display: block; padding: 7px 12px; border-radius: var(--r-control);
  color: var(--sidebar-quiet); text-decoration: none; font-size: 14px; font-weight: 500;
  position: relative;
}
.nav__list a:hover { color: var(--sidebar-ink); background: rgba(255,255,255,.04); }
.nav__list a[aria-current="page"] { color: var(--sidebar-ink); background: rgba(255,255,255,.06); }
.nav__list a[aria-current="page"]::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 2px; border-radius: 2px; background: var(--gold);
}

.sidebar__me { border-top: 1px solid var(--sidebar-line); padding: 16px 16px 20px; display: flex; flex-direction: column; gap: 8px; }
.me { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--sidebar-ink); border-radius: var(--r-control); padding: 4px; }
.me__text { display: flex; flex-direction: column; min-width: 0; }
.me__name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me__role { color: var(--sidebar-quiet); font-size: 12px; }
.sidebar__me .link-quiet { color: var(--sidebar-quiet); padding-left: 4px; }

.avatar {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; letter-spacing: .02em;
  background: var(--gold); color: #242429;
}
.avatar--light { background: var(--gold-tint); color: var(--gold-ink); }

.shell { flex: 1; margin-left: var(--sidebar-w); min-width: 0; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 20px 48px 0; min-height: 56px; }
.topbar__menu { display: none; }
.topbar__client { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 13px; font-weight: 600; }
.client-logo { height: 22px; width: auto; max-width: 96px; object-fit: contain; }
.main { padding: 16px 48px 64px; max-width: 1200px; }
.main:focus { outline: none; }
.scrim { display: none; }

/* ── Page heads ── */
.page-head { margin: 8px 0 28px; }
.page-head h1 {
  font-family: var(--font-display); font-weight: 400; font-size: 36px; letter-spacing: -.01em;
  font-variation-settings: "opsz" 72, "SOFT" 30;
}
.page-head__sub { color: var(--ink-3); margin: 6px 0 0; }
.page-head--split { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.crumbs { margin: 0 0 8px; font-size: 13px; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }

/* ── Panels ── */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 24px; margin-bottom: 24px; }
.panel--flush { padding: 0; overflow: hidden; }
.panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel__title { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.panel__head .panel__title { margin: 0; }
.panel__title--pad { padding: 20px 24px 0; margin-bottom: 12px; }
.panel__lede { color: var(--ink-2); margin-bottom: 20px; max-width: 68ch; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.grid-2 > .panel { margin-bottom: 0; }
.grid-2 + * { margin-top: 24px; }
.notice { background: var(--gold-tint); border-radius: var(--r-control); padding: 12px 16px; color: var(--ink-2); margin-bottom: 20px; }

/* ── Buttons & links ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 14px/1 var(--font-ui); padding: 11px 18px; border-radius: var(--r-control);
  border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn--primary { background: var(--ink); color: var(--ground); }
.btn--primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--gold)); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink-3); }
.btn--danger { color: var(--bad); }
.btn--danger:hover { border-color: var(--bad); }
.btn--danger-solid { background: var(--bad); color: #fff; }
.btn--sm { padding: 8px 12px; font-size: 13px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link-quiet { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--ink-3); cursor: pointer; text-decoration: none; }
.link-quiet:hover { color: var(--ink); text-decoration: underline; }
.link-danger:hover { color: var(--bad); }

/* ── Forms ── */
.form { display: flex; flex-direction: column; gap: 18px; }
.form--wide { max-width: 760px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset:disabled { opacity: .7; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__row { display: flex; justify-content: space-between; align-items: baseline; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field-row--3 { grid-template-columns: repeat(3, 1fr); }
label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
legend.label { margin-bottom: 8px; padding: 0; }
input[type=text], input:not([type]), input[type=email], input[type=password], input[type=url], input[type=tel],
input[type=number], input[type=date], select, textarea {
  width: 100%; font: 400 15px/1.4 var(--font-ui); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-control);
  padding: 10px 12px; transition: border-color .15s;
}
select { appearance: none; padding-right: 32px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238A8A93' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center; }
textarea { resize: vertical; min-height: 96px; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: var(--focus); }
input[aria-invalid="true"] { border-color: var(--bad); }
input[type=file] { font: inherit; font-size: 13px; color: var(--ink-2); }
input[type=checkbox], input[type=radio] { accent-color: var(--charcoal); width: 16px; height: 16px; margin: 0; flex: none; }
@media (prefers-color-scheme: dark) { input[type=checkbox], input[type=radio] { accent-color: var(--gold); } }
.field-error { color: var(--bad); font-size: 13px; margin: 0; }
.form__actions { display: flex; gap: 12px; justify-content: flex-end; align-items: center; padding-top: 4px; }
.form__actions--start { justify-content: flex-start; }
.form__actions--pad { padding: 16px 24px 24px; justify-content: space-between; }
.form__actions-left { margin-right: auto; }
.form__foot { text-align: center; margin: 4px 0 0; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); font-size: 14px; cursor: pointer; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 18px; }

.choice-list, .module-list, .people { display: grid; gap: 10px; }
.module-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice, .module, .person {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-control); transition: border-color .15s, background-color .15s;
}
.choice input, .module input { margin-top: 3px; }
.person { align-items: center; }
.choice:hover, .module:hover, .person:hover { border-color: var(--ink-3); }
.choice:has(input:checked), .module:has(input:checked), .person:has(input:checked) { border-color: var(--gold); background: var(--gold-tint); }
.choice > span, .module__text, .person__text { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.choice > span > span, .module__text span, .person__text span { color: var(--ink-3); font-size: 13px; }

.logo-field { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo-field__img { height: 40px; width: auto; border: 1px solid var(--line); border-radius: 6px; padding: 4px; background: #fff; }

/* ── Flash ── */
.flash {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-control);
}
.flash p { margin: 0; flex: 1; }
.flash__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; }
.flash--error .flash__dot { background: var(--bad); }
.flash--error { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.flash__close { background: none; border: 0; font-size: 20px; line-height: 1; color: var(--ink-3); cursor: pointer; }

/* ── Tabs ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tabs a {
  padding: 10px 14px; text-decoration: none; color: var(--ink-3); font-weight: 600; font-size: 14px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--gold); }
.tabs__count { font-size: 12px; color: var(--ink-3); font-weight: 500; }

/* ── Pills (status) ── */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--stone-soft); color: var(--ink-2);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill--active { background: var(--good-tint); color: var(--good); }
.pill--onboarding, .pill--invited { background: var(--gold-tint); color: var(--gold-ink); }
.pill--archived, .pill--disabled, .pill--muted { background: var(--stone-soft); color: var(--ink-3); }

/* ── Tables ── */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 14px 24px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table thead th { font-size: 12px; font-weight: 600; color: var(--ink-3); padding-top: 12px; padding-bottom: 12px; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table .num { text-align: right; }
.table .center { text-align: center; }
.table tr.is-muted td { color: var(--ink-3); }
.table-scroll { overflow-x: auto; }
.table--matrix th, .table--matrix td { padding: 10px 16px; }
.table--matrix .perm-label { font-weight: 500; color: var(--ink-2); min-width: 280px; }
.table__group th { background: var(--stone-soft); font-size: 12px; font-weight: 700; color: var(--ink-2); padding: 8px 16px; }
.cell-person { display: flex; gap: 12px; align-items: center; text-decoration: none; }
.cell-person > span:last-child { display: flex; flex-direction: column; }
.cell-sub { color: var(--ink-3); font-size: 13px; }
.cell-actions { text-align: right; white-space: nowrap; }
.cell-actions > * { display: inline-block; margin-left: 16px; }
.inline-form { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.inline-form select { width: auto; min-width: 170px; padding-top: 7px; padding-bottom: 7px; }

/* ── Client list ── */
.client-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); }
.client-row { display: flex; align-items: center; gap: 24px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.client-row:last-child { border-bottom: 0; }
.client-row__main { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 0; text-decoration: none; }
.client-row__main:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.client-row__mark {
  width: 44px; height: 44px; flex: none; border-radius: 10px; display: grid; place-items: center;
  background: var(--stone-soft); font-family: var(--font-display); font-size: 17px; color: var(--ink-2); overflow: hidden;
}
.client-row__mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 6px; }
.client-row__name { display: flex; flex-direction: column; min-width: 0; }
.client-row__name strong { font-size: 16px; }
.client-row__name span { color: var(--ink-3); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-row__facts { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.fact { font-size: 13px; color: var(--ink-3); }
.fact--accent { color: var(--gold-ink); font-weight: 600; }
.mini-meter { display: inline-flex; align-items: center; gap: 8px; }
.mini-meter__track { width: 64px; height: 4px; background: var(--stone-soft); border-radius: 2px; overflow: hidden; }
.mini-meter__fill { display: block; height: 100%; width: var(--w, 0); background: var(--gold); }
.mini-meter__label { font-size: 12px; color: var(--ink-3); }

/* ── Accounts ── */
.account-list { list-style: none; margin: 0; padding: 0 0 8px; }
.account { border-top: 1px solid var(--line); }
.account__summary { display: flex; gap: 16px; align-items: center; padding: 14px 24px; cursor: pointer; list-style: none; }
.account__summary::-webkit-details-marker { display: none; }
.account__summary::after { content: "Edit"; margin-left: auto; font-size: 13px; color: var(--ink-3); }
details[open] > .account__summary::after { content: "Close"; }
.account__platform { font-weight: 600; width: 160px; flex: none; }
.account__name { color: var(--ink-2); font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account__name--empty { color: var(--ink-3); }
.account__form { padding: 4px 24px 20px; }

/* ── Home ── */
.team-list, .checklist { list-style: none; margin: 0; padding: 0; }
.team-list li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.team-list li:first-child { border-top: 0; padding-top: 0; }
.team-list__text { display: flex; flex-direction: column; flex: 1; font-size: 14px; }
.team-list__text span { color: var(--ink-3); font-size: 13px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; padding: 7px 0; font-size: 14px; }
.checklist__box { width: 16px; height: 16px; border: 1.5px solid var(--ink-3); border-radius: 4px; flex: none; margin-top: 2px; }
.checklist li.is-done { color: var(--ink-3); text-decoration: line-through; }
.checklist li.is-done .checklist__box { background: var(--gold); border-color: var(--gold); }
.ticks { padding-left: 20px; color: var(--ink-2); }
.ticks li { margin-bottom: 4px; }


/* ══════════════ Stage 2: goals, data entry, metrics ══════════════ */

.page-head__actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.period-switch select { width: auto; min-width: 170px; }
.static-value { margin: 0; padding: 10px 0; font-weight: 600; }
.unit { color: var(--ink-3); font-weight: 500; }
.panel__pad { padding: 0 24px 20px; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--warn-tint); color: var(--warn); }
.select-sm { width: auto; padding: 6px 30px 6px 10px; font-size: 13px; }
.sticky-actions { position: sticky; bottom: 0; background: var(--ground); padding: 16px 0; margin-bottom: 24px; z-index: 5; }

/* The goal ruler: gold fill from the starting point to today's actual; a charcoal tick where an even pace would be */
.ruler { margin: 14px 0 6px; }
.ruler__track { position: relative; height: 6px; border-radius: 3px; background: var(--stone-soft); }
.ruler__fill { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--gold); max-width: 100%; }
.ruler--reached .ruler__fill { background: var(--good); }
.ruler__tick { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; }
.ruler__scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin-top: 6px; }

.legend { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); margin-top: 8px; }
.legend__fill { width: 18px; height: 6px; border-radius: 3px; background: var(--gold); }
.legend__tick { width: 2px; height: 14px; background: var(--ink); margin-left: 12px; }

/* Goal groups and cards */
.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; align-items: start; margin-bottom: 20px; }
.goal-card__channel { font-size: 12px; font-weight: 600; color: var(--gold-ink); margin: 0 0 8px; }
.goal-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 22px 24px 18px; scroll-margin-top: 24px; }
.goal-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.goal-card__title { font-size: 15px; font-weight: 700; line-height: 1.35; }
.goal-card__metric { color: var(--ink-3); font-size: 13px; margin: 2px 0 0; }
.goal-card__numbers { margin-top: 14px; }
.goal-card__actual {
  font-family: var(--font-display); font-size: 40px; line-height: 1; margin: 0; letter-spacing: -.01em;
  font-variation-settings: "opsz" 96, "SOFT" 20; font-variant-numeric: lining-nums tabular-nums;
}
.goal-card__of { color: var(--ink-3); font-size: 13px; margin: 6px 0 0; }
.goal-card__of strong { color: var(--ink); }
.goal-card__facts { display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 6px 16px; margin: 12px 0 0; font-size: 12px; }
.goal-card__facts div { display: flex; flex-direction: column; }
.goal-card__facts dt { color: var(--ink-3); }
.goal-card__facts dd { margin: 0; font-weight: 600; color: var(--ink-2); }
.goal-card__revised, .goal-card__closing { font-size: 13px; color: var(--ink-2); margin: 14px 0 0; }
.goal-card__change { margin-top: 14px; padding: 10px 12px; border-radius: var(--r-control); background: var(--gold-tint); font-size: 13px; }
.goal-card__change p { margin: 0; }
.goal-card__change p + p { margin-top: 4px; }
.goal-card__feedback { margin: 12px 0 0; padding: 10px 12px; border-left: 2px solid var(--bad); background: var(--bad-tint); border-radius: 0 var(--r-control) var(--r-control) 0; font-size: 13px; }
.goal-card__feedback p { margin: 0 0 4px; }
.goal-card__feedback footer { color: var(--ink-3); font-size: 12px; }
.goal-card__note { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.goal-card__note p { margin: 6px 0 0; }
.goal-card__tools { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.goal-card__tools select { width: auto; min-width: 150px; padding-top: 6px; padding-bottom: 6px; font-size: 13px; }
.goal-card__more { margin-top: 12px; font-size: 13px; }
.goal-card__more summary { cursor: pointer; color: var(--ink-3); }
.goal-card__more summary:hover { color: var(--ink); }
.goal-card__more .form { margin-top: 12px; gap: 10px; }

.pill--good { background: var(--good-tint); color: var(--good); }
.pill--warn { background: var(--warn-tint); color: var(--warn); }
.pill--bad { background: var(--bad-tint); color: var(--bad); }
.pill--achieved { background: var(--gold-tint); color: var(--gold-ink); }

/* Overview goal rows */
.goal-rows { list-style: none; margin: 0; padding: 0; }
.goal-row { display: grid; grid-template-columns: minmax(160px, 1.2fr) minmax(160px, 2fr) 120px 130px; gap: 24px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.goal-row:first-child { border-top: 0; padding-top: 4px; }
.goal-row__name { display: flex; flex-direction: column; min-width: 0; }
.goal-row__name strong { font-size: 14px; }
.goal-row__name span { color: var(--ink-3); font-size: 12px; }
.goal-row__ruler .ruler { margin: 0; }
.goal-row__figure { display: flex; flex-direction: column; text-align: right; }
.goal-row__figure strong { font-family: var(--font-display); font-weight: 400; font-size: 22px; line-height: 1.1; }
.goal-row__figure span { color: var(--ink-3); font-size: 12px; }
.goal-row__status { text-align: right; }

/* Attention boxes */
.attention { border-color: color-mix(in srgb, var(--gold) 50%, var(--line)); background: var(--gold-tint); }
.attention .panel__title { margin-bottom: 10px; }
.attention--quiet { background: var(--surface); }
.attention__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.attention__list li { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.attention__list a { font-weight: 600; text-underline-offset: 3px; }

/* Approvals on the goals page */
.approval-box { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); }
.approval-box__note { background: var(--gold-tint); padding: 12px 16px; border-radius: var(--r-control); color: var(--ink-2); }
.approval-box__form { margin-top: 16px; }
.table--plain th, .table--plain td { padding: 12px 8px; }
.table--plain th[scope="row"] { font-weight: 600; }
.table--plain .cell-sub { display: block; font-weight: 400; }
.send-box { padding: 0; }
.send-box__summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; cursor: pointer; list-style: none; }
.send-box__summary::-webkit-details-marker { display: none; }
.send-box[open] .send-box__summary .btn { display: none; }
.send-box > .form { padding: 0 24px 24px; }

/* Data entry grid */
.data-nav { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; }
.data-nav__spacer { flex: 1; }
.data-section { margin-bottom: 20px; }
.data-grid th, .data-grid td { padding: 8px 6px; }
.data-grid th:first-child, .data-grid td:first-child { padding-left: 24px; }
.data-grid th:last-child, .data-grid td:last-child { padding-right: 24px; }
.data-grid__metric { min-width: 180px; max-width: 220px; position: sticky; left: 0; background: var(--surface); z-index: 1; font-weight: 600; font-size: 14px; }
.data-grid__metric .cell-sub { display: block; font-weight: 400; font-size: 12px; }
.data-grid__period { text-align: right; white-space: nowrap; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.data-grid__period span { display: block; font-weight: 400; color: var(--ink-3); font-size: 11px; }
.data-grid__period.is-current { color: var(--gold-ink); }
.data-grid__cell { text-align: right; }
.data-grid__cell input { width: 80px; text-align: right; padding: 7px 8px; font-size: 14px; font-variant-numeric: tabular-nums; }
.data-grid__cell.is-missing input { background: var(--warn-tint); border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); }
.data-grid__cell.has-api input::placeholder { color: var(--good); opacity: 1; }
.data-form .form__actions { margin-top: 4px; }
.metric-table td, .metric-table th { padding-top: 10px; padding-bottom: 10px; }
.metric-table th[scope="row"] label { font-weight: 600; color: var(--ink); font-size: 14px; }
.metric-table th[scope="row"] .cell-sub { display: block; font-weight: 400; }

@media (max-width: 860px) {
  .goal-grid { grid-template-columns: 1fr; }
  .goal-row { grid-template-columns: 1fr auto; gap: 8px 16px; }
  .goal-row__ruler { grid-column: 1 / -1; order: 3; }
  .goal-row__status { grid-column: 1 / -1; order: 4; text-align: left; }
  .goal-row__status:empty { display: none; }
  .goal-card { padding: 18px 16px 16px; }
  .goal-card__actual { font-size: 34px; }
  .send-box__summary { flex-direction: column; align-items: flex-start; }
  .data-grid__metric { min-width: 150px; }
  .data-grid__cell input { width: 84px; }
  .metric-table tr { grid-template-columns: 1fr auto auto !important; align-items: center; }
  .metric-table td.cell-actions { grid-column: auto; }
}

/* ── Empty states ── */
.empty { text-align: center; padding: 64px 24px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r-panel); }
.empty h2 { font-family: var(--font-display); font-weight: 400; font-size: 24px; margin-bottom: 8px; }
.empty p { color: var(--ink-3); max-width: 48ch; margin: 0 auto 20px; }
.empty--inline { border: 0; }
.empty-inline { color: var(--ink-3); }

/* ── Auth ── */
.auth { display: grid; grid-template-columns: minmax(360px, 520px) 1fr; min-height: 100vh; }
.auth__panel { padding: 56px 64px; display: flex; flex-direction: column; justify-content: center; max-width: 520px; width: 100%; }
.auth__logo { width: 168px; color: var(--ink); margin-bottom: 56px; }
.auth__title { font-family: var(--font-display); font-weight: 400; font-size: 34px; letter-spacing: -.01em; margin-bottom: 8px; }
.auth__lede { color: var(--ink-3); margin-bottom: 28px; }
.auth__aside {
  background: var(--sidebar-bg); color: var(--sidebar-ink);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 64px;
}
.auth__ruler { position: relative; height: 2px; background: var(--sidebar-line); margin-bottom: 28px; max-width: 520px; }
.auth__ruler-fill { position: absolute; inset: 0 auto 0 0; width: 64%; background: var(--gold); animation: ruler-grow 1.6s cubic-bezier(.2,.7,.2,1) both; }
.auth__ruler-tick { position: absolute; left: 58%; top: -8px; width: 2px; height: 18px; background: var(--sidebar-ink); }
.auth__line { font-family: var(--font-display); font-weight: 300; font-size: 32px; line-height: 1.25; max-width: 18ch; margin: 0; font-variation-settings: "opsz" 96, "SOFT" 50; }
@keyframes ruler-grow { from { width: 0; } }

/* ── Bare / errors ── */
.bare { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.error-page { text-align: center; max-width: 520px; }
.error-page__code { font-family: var(--font-display); font-size: 64px; color: var(--gold); margin: 0; line-height: 1; }
.error-page h1 { font-family: var(--font-display); font-weight: 400; font-size: 28px; margin: 12px 0; }
.error-page p { color: var(--ink-3); }
.error-page__detail { text-align: left; font-size: 12px; overflow: auto; max-height: 50vh; background: var(--surface); border: 1px solid var(--line); padding: 16px; border-radius: 8px; }

/* ── Responsive ── */
@media (max-width: 1080px) {
  .main, .topbar { padding-left: 32px; padding-right: 32px; }
  .module-list { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(20,20,23,.4); z-index: 30; }
  .sidebar__close { display: block; }
  .shell { margin-left: 0; }
  .topbar { padding: 16px 16px 0; }
  .topbar__menu {
    display: inline-flex; flex-direction: column; gap: 4px; justify-content: center;
    width: 40px; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-control);
    background: var(--surface); cursor: pointer;
  }
  .topbar__menu span { display: block; height: 1.5px; background: var(--ink); border-radius: 1px; }
  .main { padding: 12px 16px 48px; }
  .page-head h1 { font-size: 28px; }
  .grid-2, .field-row, .field-row--3 { grid-template-columns: 1fr; }
  .client-row { flex-wrap: wrap; gap: 12px; padding: 16px; }
  .client-row__facts { justify-content: flex-start; width: 100%; padding-left: 60px; }
  .table th, .table td { padding: 12px 16px; }
  .table thead { display: none; }
  .table:not(.table--matrix) tr { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .table:not(.table--matrix) td { border: 0; padding: 0; }
  .table:not(.table--matrix) td.cell-actions { grid-column: 1 / -1; text-align: left; }
  .cell-actions > * { margin: 0 16px 0 0; }
  .inline-form select { min-width: 0; width: 100%; }
  .account__platform { width: auto; }
  .account__summary { flex-wrap: wrap; padding: 14px 16px; }
  .account__form { padding: 4px 16px 16px; }
  .panel { padding: 20px 16px; }
  .panel--flush { padding: 0; }
  .panel__title--pad { padding: 16px 16px 0; }
  .auth { grid-template-columns: 1fr; }
  .auth__aside { display: none; }
  .auth__panel { padding: 40px 24px; margin: 0 auto; }
  .auth__logo { margin-bottom: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
