/* AID-I HQ
   Layout: a quiet left rail (staff) or top bar (client), with one wide working column.
   Black and gold first; the light theme is the brand's warm cream. */
:root {
  --bg: #0b0a09;        /* page */
  --surface: #131210;   /* panels */
  --surface-2: #1b1916; /* raised / hover */
  --line: #2a2723;
  --line-2: #3a352d;
  --fg: #f4f0ec;        /* cream ink */
  --muted: #a39c92;
  --dim: #6f6a63;
  --gold: #c8a860;
  --gold-2: #e2c98b;
  --gold-ink: #0b0a09;  /* text on gold */
  --gold-wash: rgba(200, 168, 96, .10);
  --good: #8fbf7f;  --good-wash: rgba(143, 191, 127, .12);
  --warn: #d9a84e;  --warn-wash: rgba(217, 168, 78, .13);
  --bad: #cf8a72;   --bad-wash: rgba(207, 138, 114, .13);
  --info: #8fa9c4;  --info-wash: rgba(143, 169, 196, .13);
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --display: 'Cormorant Garamond', 'Cormorant', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r: 12px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f1ea; --surface: #fffdf9; --surface-2: #efe9df; --line: #e3dacd; --line-2: #d3c7b6;
    --fg: #17140f; --muted: #6b6359; --dim: #9a9186;
    --gold: #9a7631; --gold-2: #7d5e22; --gold-ink: #fffdf9; --gold-wash: rgba(154, 118, 49, .10);
    --good: #4f7f43; --good-wash: rgba(79, 127, 67, .11);
    --warn: #a7741c; --warn-wash: rgba(167, 116, 28, .12);
    --bad: #a65a40; --bad-wash: rgba(166, 90, 64, .11);
    --info: #4f6f90; --info-wash: rgba(79, 111, 144, .11);
    --shadow: 0 18px 50px rgba(60, 45, 20, .16);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f5f1ea; --surface: #fffdf9; --surface-2: #efe9df; --line: #e3dacd; --line-2: #d3c7b6;
  --fg: #17140f; --muted: #6b6359; --dim: #9a9186;
  --gold: #9a7631; --gold-2: #7d5e22; --gold-ink: #fffdf9; --gold-wash: rgba(154, 118, 49, .10);
  --good: #4f7f43; --good-wash: rgba(79, 127, 67, .11);
  --warn: #a7741c; --warn-wash: rgba(167, 116, 28, .12);
  --bad: #a65a40; --bad-wash: rgba(166, 90, 64, .11);
  --info: #4f6f90; --info-wash: rgba(79, 111, 144, .11);
  --shadow: 0 18px 50px rgba(60, 45, 20, .16);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
#root { min-height: 100%; }
a { color: var(--gold); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
.num, td, .tabular { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ------------------------------------------------ wordmark */
.wordmark { font-family: var(--display); font-weight: 600; font-size: 26px; letter-spacing: .01em; color: var(--fg); display: inline-flex; align-items: center; line-height: 1; }
.wordmark i { display: inline-block; width: .42em; height: .085em; background: var(--gold); margin: 0 .06em; transform: translateY(.06em); border-radius: 2px; box-shadow: 0 0 10px rgba(200,168,96,.5); }
.wordmark small { font-family: var(--sans); font-size: 10px; letter-spacing: .26em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin-left: 10px; }
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot .wordmark { font-size: 44px; opacity: .85; }

/* ------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); padding: 22px 14px 18px max(14px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 22px; background: var(--bg); }
.rail .brand { padding: 0 8px; }
.nav { display: grid; gap: 2px; }
.nav button { display: flex; align-items: center; gap: 11px; width: 100%; background: none; border: 0; padding: 9px 10px; border-radius: 9px; color: var(--muted); font-weight: 500; text-align: left; }
.nav button:hover { background: var(--surface-2); color: var(--fg); }
.nav button[aria-current="page"] { background: var(--gold-wash); color: var(--fg); }
.nav button[aria-current="page"] svg { color: var(--gold); }
.nav .count { margin-left: auto; font-size: 11px; color: var(--muted); background: var(--surface-2); border-radius: 20px; padding: 1px 7px; }
.nav .count.hot { background: var(--warn-wash); color: var(--warn); }
.rail .foot { margin-top: auto; display: grid; gap: 10px; padding: 0 8px; font-size: 12px; color: var(--dim); }
.rail .me { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--gold); font-weight: 600; font-size: 12px; border: 1px solid var(--line-2); flex: none; }
.main { min-width: 0; padding: 26px max(16px, env(safe-area-inset-right, 0px)) 80px 34px; }
.main-inner { max-width: 1240px; margin: 0 auto; }

.topbar { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .topbar { display: flex; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; align-items: center; justify-content: space-between; gap: 12px; padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); background: var(--bg); border-bottom: 1px solid var(--line); }
  body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); }
  .tabbar button { background: none; border: 0; color: var(--muted); display: grid; justify-items: center; gap: 2px; font-size: 10.5px; padding: 6px 0; }
  .tabbar button[aria-current="page"] { color: var(--gold); }
  .main { padding: 18px max(16px, env(safe-area-inset-right, 0px)) 96px max(16px, env(safe-area-inset-left, 0px)); }
}
@media (min-width: 901px) { .tabbar { display: none; } }

/* ------------------------------------------------ demo ribbon */
.ribbon { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; background: var(--gold-wash); border-bottom: 1px solid var(--line); color: var(--gold-2); font-size: 12.5px; padding: 7px max(16px, env(safe-area-inset-right, 0px)) 7px max(16px, env(safe-area-inset-left, 0px)); }
.ribbon .seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 20px; overflow: hidden; }
.ribbon .seg button { background: none; border: 0; padding: 3px 11px; color: var(--muted); font-size: 12px; }
.ribbon .seg button[aria-pressed="true"] { background: var(--gold); color: var(--gold-ink); }

/* ------------------------------------------------ page head */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; margin-bottom: 22px; }
.eyebrow { font-size: 10.5px; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin: 0 0 6px; }
.page-head h1 { font-family: var(--display); font-weight: 600; font-size: clamp(30px, 4vw, 42px); line-height: 1.05; }
.page-head h1 em { font-style: italic; color: var(--gold); font-weight: 500; }
.page-head .sub { color: var(--muted); margin: 6px 0 0; max-width: 62ch; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ------------------------------------------------ buttons, inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 9px; padding: 8px 14px; border: 1px solid var(--line-2); background: var(--surface); color: var(--fg); font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--surface-2); border-color: var(--dim); }
.btn.gold { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); font-weight: 600; }
.btn.gold:hover { filter: brightness(1.07); }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--fg); background: var(--surface-2); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { background: none; border: 0; color: var(--muted); padding: 6px; border-radius: 8px; display: inline-grid; place-items: center; }
.icon-btn:hover { color: var(--fg); background: var(--surface-2); }

.field { display: grid; gap: 5px; min-width: 0; }
.field > span { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.input, select.input, textarea.input { width: 100%; background: var(--bg); border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 11px; color: var(--fg); min-width: 0; }
textarea.input { resize: vertical; min-height: 76px; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-wash); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.form-grid .wide { grid-column: 1 / -1; }
.search { position: relative; min-width: 0; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--dim); pointer-events: none; }
.search .input { padding-left: 32px; }
.inline-edit { background: transparent; border: 1px solid transparent; border-radius: 7px; padding: 3px 6px; margin: -3px -6px; color: inherit; width: 100%; }
.inline-edit:hover { border-color: var(--line-2); }
.inline-edit:focus { outline: none; border-color: var(--gold); background: var(--bg); }

/* ------------------------------------------------ surfaces */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; min-width: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { font-family: var(--display); font-size: 22px; font-weight: 600; }
.panel-head .hint { color: var(--muted); font-size: 12.5px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) { .cols-2, .cols-3 { grid-template-columns: minmax(0, 1fr); } }
.stack { display: grid; gap: 16px; align-content: start; min-width: 0; }

/* ------------------------------------------------ stat tiles */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 16px; }
.stat { background: var(--surface); padding: 16px 18px; min-width: 0; }
.stat .label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.stat .value { font-family: var(--display); font-weight: 600; font-size: 38px; line-height: 1.05; margin-top: 6px; color: var(--fg); }
.stat .value small { font-family: var(--sans); font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.stat .foot { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat.gold .value { color: var(--gold); }
@media (max-width: 800px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ------------------------------------------------ pills, chips */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 20px; background: var(--surface-2); color: var(--muted); white-space: nowrap; border: 1px solid transparent; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.good { background: var(--good-wash); color: var(--good); }
.pill.warn { background: var(--warn-wash); color: var(--warn); }
.pill.bad { background: var(--bad-wash); color: var(--bad); }
.pill.info { background: var(--info-wash); color: var(--info); }
.pill.gold { background: var(--gold-wash); color: var(--gold); }
.pill.line { background: none; border-color: var(--line-2); }
.chip { font-size: 11.5px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 7px; white-space: nowrap; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12.5px; }
.gold-t { color: var(--gold); }
.good-t { color: var(--good); }
.warn-t { color: var(--warn); }
.bad-t { color: var(--bad); }
.serif { font-family: var(--display); }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { color: var(--muted); padding: 18px 0; text-align: center; font-size: 13px; }
.empty.box { border: 1px dashed var(--line-2); border-radius: var(--r); padding: 26px 16px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

/* ------------------------------------------------ lists */
.list { display: grid; }
.list > .item { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--line); min-width: 0; }
.list > .item:first-child { border-top: 0; }
.list .item .title { font-weight: 500; }
.list .item .meta { color: var(--muted); font-size: 12.5px; }
.check { appearance: none; width: 18px; height: 18px; border: 1.5px solid var(--line-2); border-radius: 5px; display: inline-grid; place-items: center; flex: none; margin-top: 1px; background: var(--bg); cursor: pointer; }
.check:checked { background: var(--gold); border-color: var(--gold); }
.check:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid var(--gold-ink); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.done-t { text-decoration: line-through; color: var(--dim); }

/* ------------------------------------------------ tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
table.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr.click:hover td { background: var(--surface-2); }
table.t td.r, table.t th.r { text-align: right; }

/* ------------------------------------------------ pipeline board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.lane { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; max-height: calc(100vh - 210px); min-width: 0; transition: border-color .15s, background .15s; }
.lane.over { border-color: var(--gold); background: var(--gold-wash); }
.lane-head { padding: 12px 14px 10px; border-bottom: 1px solid var(--line); }
.lane-head .row { justify-content: space-between; }
.lane-head h3 { font-size: 13px; font-weight: 600; }
.lane-head .sum { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.lane-body { padding: 10px; display: grid; gap: 8px; overflow-y: auto; align-content: start; min-height: 80px; }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; cursor: grab; display: grid; gap: 7px; transition: border-color .15s, transform .15s; min-width: 0; }
.card:hover { border-color: var(--line-2); }
.card.dragging { opacity: .45; }
.card .name { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.card .next { font-size: 12px; color: var(--muted); line-height: 1.4; }
.card .next.late { color: var(--warn); }
.card .foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11.5px; color: var(--dim); }
.stage-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* ------------------------------------------------ client hub */
.hub-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: end; margin-bottom: 18px; }
@media (max-width: 760px) { .hub-head { grid-template-columns: minmax(0, 1fr); } }
.hub-head h1 { font-family: var(--display); font-weight: 600; font-size: clamp(28px, 4vw, 40px); line-height: 1.05; }
.hub-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 13px; margin-top: 8px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--fg); }
.tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--gold); }
.back { background: none; border: 0; color: var(--muted); padding: 0; margin-bottom: 12px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.back:hover { color: var(--fg); }

/* ------------------------------------------------ big number / meters */
.hero-num { font-family: var(--display); font-weight: 600; font-size: 76px; line-height: .9; color: var(--gold); }
.hero-num small { font-size: 28px; color: var(--muted); font-weight: 500; }
.meter { height: 8px; background: var(--surface-2); border-radius: 8px; overflow: hidden; position: relative; }
.meter > i { display: block; height: 100%; border-radius: 8px; background: var(--gold); }
.meter.rival > i { background: var(--dim); }
.vs { display: grid; grid-template-columns: minmax(90px, 160px) minmax(0, 1fr) 44px; gap: 10px; align-items: center; font-size: 12.5px; }
.vs .who { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs .val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.channel { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
.channel:first-child { border-top: 0; padding-top: 0; }
.goal-track { position: relative; height: 10px; background: var(--surface-2); border-radius: 10px; margin: 14px 0 8px; }
.goal-track > i { position: absolute; inset: 0 auto 0 0; border-radius: 10px; background: linear-gradient(90deg, var(--gold-2), var(--gold)); }
.goal-track > b { position: absolute; top: -4px; width: 2px; height: 18px; background: var(--fg); opacity: .5; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--sans); }

/* ------------------------------------------------ timeline */
.timeline { display: grid; }
.tl { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding-bottom: 14px; position: relative; }
.tl::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 1px; background: var(--line); }
.tl:last-child::before { display: none; }
.tl .ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.tl .ic.gold { color: var(--gold); border-color: var(--gold); background: var(--gold-wash); }
.tl .what { font-weight: 500; }
.tl .when { color: var(--dim); font-size: 12px; }
.tl .body { color: var(--muted); font-size: 13px; white-space: pre-wrap; margin-top: 2px; }

/* ------------------------------------------------ modal / drawer / toast */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 50; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); animation: fade .15s ease; }
.modal { background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; width: min(560px, 100%); max-height: 90vh; overflow: auto; box-shadow: var(--shadow); animation: rise .2s ease; }
.modal.wide { width: min(820px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 0; }
.modal-head h2 { font-family: var(--display); font-size: 26px; font-weight: 600; }
.modal-body { padding: 16px 20px; display: grid; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 18px; flex-wrap: wrap; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 500; box-shadow: var(--shadow); animation: rise .2s ease; max-width: calc(100vw - 32px); }
@keyframes fade { from { opacity: 0 } }
@keyframes rise { from { opacity: 0; transform: translateY(8px) } }
.toast { animation-name: toastin; }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 8px) } }

/* ------------------------------------------------ command palette */
.palette { width: min(600px, 100%); align-self: start; margin-top: 10vh; }
.palette .input { font-size: 16px; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 16px 16px 0 0; background: var(--surface); }
.palette .input:focus { box-shadow: none; }
.palette .results { max-height: 50vh; overflow: auto; padding: 6px; }
.palette .res { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: 9px; }
.palette .res[aria-selected="true"], .palette .res:hover { background: var(--surface-2); }
.kbd { font-size: 11px; color: var(--dim); border: 1px solid var(--line-2); border-radius: 5px; padding: 0 5px; }

/* ------------------------------------------------ invoice paper */
.paper { background: #fffdf9; color: #17140f; border-radius: 10px; padding: 34px 38px; font-size: 13px; box-shadow: var(--shadow); }
.paper .wordmark { color: #17140f; font-size: 30px; }
.paper .wordmark i { background: #9a7631; box-shadow: none; }
.paper table { width: 100%; border-collapse: collapse; margin-top: 22px; }
.paper th { text-align: left; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #6b6359; border-bottom: 1px solid #e3dacd; padding: 8px 0; }
.paper td { padding: 9px 0; border-bottom: 1px solid #efe9df; }
.paper .r { text-align: right; }
.paper .tot td { border: 0; font-weight: 600; }
.paper .muted { color: #6b6359; }
@media print {
  body * { visibility: hidden; }
  .paper, .paper * { visibility: visible; }
  .paper { position: absolute; inset: 0; box-shadow: none; }
}

/* ------------------------------------------------ login */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.login .art { position: relative; overflow: hidden; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; padding: 40px; }
.login .art canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.login .art > * { position: relative; }
.login .art h1 { font-family: var(--display); font-weight: 500; font-size: clamp(38px, 5vw, 64px); line-height: 1.02; max-width: 12ch; }
.login .art h1 em { color: var(--gold); }
.login .form { display: grid; place-items: center; padding: 40px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px)); }
.login .form > div { width: min(380px, 100%); display: grid; gap: 14px; }
@media (max-width: 820px) { .login { grid-template-columns: minmax(0, 1fr); } .login .art { min-height: 300px; border-right: 0; border-bottom: 1px solid var(--line); padding: 28px max(16px, env(safe-area-inset-right, 0px)) 28px max(16px, env(safe-area-inset-left, 0px)); } }

/* ------------------------------------------------ client portal */
.portal-top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.portal-top .in { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); }
.portal-nav { display: flex; gap: 2px; overflow-x: auto; }
.portal-nav button { background: none; border: 0; padding: 8px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.portal-nav button[aria-current="page"] { color: var(--fg); background: var(--gold-wash); }
.portal-main { max-width: 1080px; margin: 0 auto; padding: 30px max(16px, env(safe-area-inset-right, 0px)) 90px max(16px, env(safe-area-inset-left, 0px)); }
.welcome h1 { font-family: var(--display); font-weight: 500; font-size: clamp(34px, 5vw, 54px); line-height: 1.04; }
.welcome h1 em { color: var(--gold); }
.welcome p { color: var(--muted); max-width: 60ch; margin: 10px 0 0; }
.dots-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .9; }
.feature { position: relative; overflow: hidden; }
.feature > *:not(canvas) { position: relative; }
@media (max-width: 900px) { .portal-nav.desk { display: none; } }
@media (min-width: 901px) { .portal-tabbar { display: none; } }

/* "Sync now" button */
@keyframes spin { to { transform: rotate(360deg) } }
.spin { animation: spin 1.1s linear infinite; }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
