/* WeCan Seeding Hub — design tokens
   Ink navy + jar-lid cobalt for action, petroleum-jelly amber for "where we are now". */
:root {
  color-scheme: light;
  --brand: #2346c8;          /* set from Settings → Branding */
  --brand-accent: #e9a23b;
  --brand-side: #172036;
  --canvas: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --sunken: #eceff5;
  --ink: #172036;
  --ink-2: #4b5468;
  --ink-3: #737c90;
  --line: #dde2eb;
  --line-strong: #c6cddb;
  --cobalt: var(--brand);
  --cobalt-ink: color-mix(in srgb, var(--brand) 80%, black);
  --cobalt-wash: color-mix(in srgb, var(--brand) 10%, white);
  --on-cobalt: #ffffff;
  --amber: var(--brand-accent);
  --amber-ink: color-mix(in srgb, var(--brand-accent) 50%, black);
  --amber-wash: color-mix(in srgb, var(--brand-accent) 13%, white);
  --good: #0f8a3c;
  --good-wash: #e3f4e9;
  --warn: #b26a00;
  --warn-wash: #fff2d9;
  --bad: #c43535;
  --bad-wash: #fbe7e7;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --track: #e3e7ef;
  --side: var(--brand-side);
  --side-ink: #c9d0e0;
  --side-ink-strong: #ffffff;
  --side-hover: color-mix(in srgb, var(--brand-side) 85%, white);
  --shadow-pop: 0 12px 32px rgba(23, 32, 54, .16), 0 2px 6px rgba(23, 32, 54, .08);
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --font-ui: "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --font-display: "Bai Jamjuree", "IBM Plex Sans Thai", system-ui, sans-serif;
  --side-w: 232px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --canvas: #0e1320; --surface: #161c2c; --surface-2: #1b2234; --sunken: #111727;
    --ink: #e8ecf4; --ink-2: #b4bccc; --ink-3: #8a93a6; --line: #273049; --line-strong: #364160;
    --cobalt: color-mix(in srgb, var(--brand) 60%, white); --cobalt-ink: color-mix(in srgb, var(--brand) 38%, white); --cobalt-wash: color-mix(in srgb, var(--brand) 28%, #161c2c); --on-cobalt: #0e1320;
    --amber: color-mix(in srgb, var(--brand-accent) 85%, white); --amber-ink: color-mix(in srgb, var(--brand-accent) 55%, white); --amber-wash: color-mix(in srgb, var(--brand-accent) 22%, #161c2c);
    --good: #4cc47a; --good-wash: #15301f; --warn: #f2b356; --warn-wash: #352812; --bad: #ff7b7b; --bad-wash: #3a1a1d;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --track: #252d42;
    --side: color-mix(in srgb, var(--brand-side) 55%, black); --side-hover: color-mix(in srgb, var(--brand-side) 55%, #1f2840);
    --shadow-pop: 0 12px 32px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0e1320; --surface: #161c2c; --surface-2: #1b2234; --sunken: #111727;
  --ink: #e8ecf4; --ink-2: #b4bccc; --ink-3: #8a93a6; --line: #273049; --line-strong: #364160;
  --cobalt: color-mix(in srgb, var(--brand) 60%, white); --cobalt-ink: color-mix(in srgb, var(--brand) 38%, white); --cobalt-wash: color-mix(in srgb, var(--brand) 28%, #161c2c); --on-cobalt: #0e1320;
  --amber: color-mix(in srgb, var(--brand-accent) 85%, white); --amber-ink: color-mix(in srgb, var(--brand-accent) 55%, white); --amber-wash: color-mix(in srgb, var(--brand-accent) 22%, #161c2c);
  --good: #4cc47a; --good-wash: #15301f; --warn: #f2b356; --warn-wash: #352812; --bad: #ff7b7b; --bad-wash: #3a1a1d;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --track: #252d42;
  --side: color-mix(in srgb, var(--brand-side) 55%, black); --side-hover: color-mix(in srgb, var(--brand-side) 55%, #1f2840);
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--canvas); color: var(--ink); font: 14px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
a { color: var(--cobalt); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.num { font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.sm { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -.01em; }
h1 { font-size: 26px; line-height: 1.2; font-weight: 700; }
h2 { font-size: 17px; line-height: 1.3; font-weight: 600; }
h3 { font-size: 14.5px; font-weight: 600; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.side {
  background: var(--side); color: var(--side-ink); position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 18px 12px; gap: 4px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: var(--side-ink-strong); }
.brand img { width: 30px; height: 30px; }
.brand b { font-family: var(--font-display); font-size: 16px; display: block; line-height: 1.1; }
.brand span { font-size: 11.5px; color: var(--side-ink); }
.brand.has-logo { flex-direction: column; align-items: flex-start; gap: 8px; }
.brand-logo { width: auto !important; height: auto !important; max-height: 44px; max-width: 170px; background: #fff; padding: 6px 10px; border-radius: 10px; object-fit: contain; }
.brand.has-logo b { font-size: 13px; font-weight: 600; color: var(--side-ink); letter-spacing: .01em; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px;
  color: var(--side-ink); font-weight: 500; text-decoration: none; position: relative;
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a:hover { background: var(--side-hover); color: var(--side-ink-strong); }
.nav a[aria-current="page"] { background: var(--side-hover); color: var(--side-ink-strong); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--amber); }
.nav .badge { margin-left: auto; background: var(--amber); color: #2a1a00; font-size: 11px; font-weight: 600; border-radius: 99px; padding: 0 7px; line-height: 18px; }
.side-foot { margin-top: auto; padding: 10px; font-size: 12px; line-height: 1.45; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #4cc47a; margin-right: 6px; box-shadow: 0 0 0 3px rgba(76, 196, 122, .2); }
.live-dot.off { background: #8a93a6; box-shadow: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; padding: 10px 28px; min-height: 58px;
}
.campaign-pick { display: flex; align-items: center; gap: 8px; min-width: 0; }
.campaign-pick select { border: 0; background: transparent; font-family: var(--font-display); font-weight: 600; font-size: 16px; padding: 4px 22px 4px 0; max-width: 46vw; text-overflow: ellipsis; cursor: pointer; }
.topbar .grow { flex: 1; }
.search { position: relative; width: min(340px, 34vw); }
.search input { width: 100%; padding: 8px 12px 8px 34px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-3); }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-pop); max-height: 60vh; overflow: auto; z-index: 40; }
.search-results button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 12px; cursor: pointer; }
.search-results button:hover, .search-results button.on { background: var(--cobalt-wash); }
.user-btn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 4px 12px 4px 4px; cursor: pointer; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--cobalt-wash); color: var(--cobalt-ink); display: grid; place-items: center; font-weight: 600; font-size: 12px; font-family: var(--font-display); flex: none; }
.page { padding: 26px 28px 80px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .lede { color: var(--ink-2); margin: 6px 0 0; max-width: 70ch; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 8px; padding: 8px 14px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 500; cursor: pointer; white-space: nowrap; line-height: 1.2;
}
.btn:hover { border-color: var(--ink-3); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--cobalt); border-color: var(--cobalt); color: var(--on-cobalt); }
.btn.primary:hover { background: var(--cobalt-ink); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--sunken); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.icon { padding: 6px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.field small { color: var(--ink-3); font-size: 12px; }
.input, .select, textarea.input {
  width: 100%; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 8px 10px; min-height: 38px;
}
textarea.input { min-height: 84px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus { outline: 2px solid color-mix(in srgb, var(--cobalt) 40%, transparent); border-color: var(--cobalt); }
.input[readonly] { background: var(--surface-2); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 14px; }
.span2 { grid-column: span 2; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--cobalt); }

.seg { display: inline-flex; background: var(--sunken); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; cursor: pointer; color: var(--ink-2); font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 99px;
  padding: 5px 11px; cursor: pointer; font-size: 13px; color: var(--ink-2); white-space: nowrap;
}
.chip[aria-pressed="true"], .chip.on { background: var(--cobalt-wash); border-color: var(--cobalt); color: var(--cobalt-ink); }
.chip .x { opacity: .6; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters select { max-width: 210px; text-overflow: ellipsis; }
.t td.nw { white-space: nowrap; }
.t td.grp { max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* status pills — text label always present, colour is a second cue */
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 2px 10px 2px 8px; font-size: 12.5px; font-weight: 500; white-space: nowrap; background: var(--sunken); color: var(--ink-2); border: 1px solid transparent; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .9; }
.pill.s-waiting { background: var(--sunken); color: var(--ink-2); }
.pill.s-review { background: #efeafd; color: #5a3fc0; }
.pill.s-approved { background: #e0f5ef; color: #127a5a; }
.pill.s-ready { background: var(--cobalt-wash); color: var(--cobalt-ink); }
.pill.s-pending { background: var(--warn-wash); color: var(--warn); }
.pill.s-posted { background: var(--good-wash); color: var(--good); }
.pill.s-follow { background: #fde9df; color: #b2461a; }
.pill.s-hold { background: var(--sunken); color: var(--ink-3); border-color: var(--line-strong); }
.pill.s-deleted { background: var(--bad-wash); color: var(--bad); text-decoration: line-through; }
:root[data-theme="dark"] .pill.s-review { background: #2a2350; color: #b9a8ff; }
:root[data-theme="dark"] .pill.s-approved { background: #13352b; color: #6fd6b0; }
:root[data-theme="dark"] .pill.s-follow { background: #3b2216; color: #ff9f72; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pill.s-review { background: #2a2350; color: #b9a8ff; }
  :root:not([data-theme="light"]) .pill.s-approved { background: #13352b; color: #6fd6b0; }
  :root:not([data-theme="light"]) .pill.s-follow { background: #3b2216; color: #ff9f72; }
}
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 6px; background: var(--sunken); color: var(--ink-2); white-space: nowrap; }
.tag.amber { background: var(--amber-wash); color: var(--amber-ink); }
.tag.bad { background: var(--bad-wash); color: var(--bad); }
.tag.good { background: var(--good-wash); color: var(--good); }
.tag.cobalt { background: var(--cobalt-wash); color: var(--cobalt-ink); }

/* ---------- panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; min-width: 0; }
.panel.flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head p { margin: 0; color: var(--ink-3); font-size: 13px; }
.panel-head .end { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.panel.flush .panel-head { padding: 16px 20px 0; }
.cols { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.cols-2e { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 18px; }

/* ---------- pace hero (overview) ---------- */
.pace { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px 26px 18px; margin-bottom: 18px; }
.pace-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px 36px; align-items: end; }
.pace-big { font-family: var(--font-display); font-weight: 700; font-size: 64px; line-height: .9; letter-spacing: -.03em; }
.pace-big small { font-size: 22px; color: var(--ink-3); font-weight: 500; letter-spacing: 0; margin-left: 6px; }
.pace-say { font-size: 16px; color: var(--ink-2); max-width: 54ch; margin: 0 0 4px; line-height: 1.45; }
.pace-say b { color: var(--ink); font-weight: 600; }
.pace-facts { display: grid; grid-template-columns: repeat(4, auto); gap: 4px 26px; }
.fact { display: flex; flex-direction: column; }
.fact .v { font-family: var(--font-display); font-size: 22px; font-weight: 600; line-height: 1.1; }
.fact .k { font-size: 12.5px; color: var(--ink-3); }
.ribbon { margin-top: 22px; position: relative; }
.ribbon svg { display: block; width: 100%; overflow: visible; }
.ribbon .wk-label { font: 500 11.5px var(--font-ui); fill: var(--ink-3); }
.ribbon .wk-num { font: 600 12.5px var(--font-display); fill: var(--ink); }
.ribbon .today-label { font: 600 11.5px var(--font-ui); fill: var(--amber-ink); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-top: 10px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); max-height: calc(100vh - 230px); }
table.t { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; }
.t th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); text-align: left; font-weight: 600; font-size: 12.5px; color: var(--ink-2); padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t th.sortable { cursor: pointer; user-select: none; }
.t th.sortable:hover { color: var(--ink); }
.t td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; max-width: 320px; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: var(--surface-2); }
.t tr.sel td { background: var(--cobalt-wash) !important; }
.t td.r, .t th.r { text-align: right; }
.t td.trunc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.t td.edit { cursor: text; }
.t td.edit:hover { box-shadow: inset 0 0 0 1px var(--line-strong); }
.t td.editing { padding: 2px 4px; box-shadow: inset 0 0 0 2px var(--cobalt); }
.t td.editing .input, .t td.editing .select { min-height: 32px; padding: 4px 8px; border: 0; outline: 0; background: transparent; }
.t td.sticky-l, .t th.sticky-l { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.t th.sticky-l { z-index: 3; background: var(--surface-2); }
.t .cb { width: 34px; }
.t.compact td { padding: 5px 10px; }
.t tfoot td { position: sticky; bottom: 0; background: var(--surface-2); font-weight: 600; border-top: 1px solid var(--line); }
.empty { text-align: center; padding: 48px 20px; color: var(--ink-3); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.flash td { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: var(--amber-wash); } to { background: transparent; } }
.dupe { color: var(--warn); font-size: 12px; font-weight: 600; margin-left: 6px; }
.link-cell { display: inline-flex; align-items: center; gap: 4px; }
.link-cell svg { width: 14px; height: 14px; }

.bulkbar { position: sticky; bottom: 16px; z-index: 15; margin: 12px auto 0; width: fit-content; max-width: 100%; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--ink); color: var(--canvas); border-radius: 12px; padding: 8px 10px 8px 16px; box-shadow: var(--shadow-pop); }
.bulkbar .select { min-height: 32px; padding: 4px 8px; width: auto; background: var(--surface); color: var(--ink); }
.bulkbar .btn { padding: 5px 12px; }

/* ---------- 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(--sunken); border-radius: var(--r-md); padding: 10px; min-height: 120px; }
.lane.over { outline: 2px dashed var(--cobalt); outline-offset: -2px; }
.lane-head { display: flex; align-items: center; gap: 8px; margin: 2px 2px 10px; }
.lane-head .count { margin-left: auto; color: var(--ink-3); font-size: 12.5px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; cursor: grab; }
.card:hover { border-color: var(--line-strong); }
.card.dragging { opacity: .5; }
.card .t1 { font-weight: 600; margin-bottom: 2px; }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.lane .more { width: 100%; }

/* ---------- today ---------- */
.today-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 18px; align-items: start; }
.todo { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.todo-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.todo-head .n { margin-left: auto; font-family: var(--font-display); font-weight: 600; font-size: 20px; }
.todo-head .hint { display: block; font-size: 12.5px; color: var(--ink-3); font-weight: 400; }
.todo.urgent .todo-head { box-shadow: inset 4px 0 0 var(--bad); }
.todo.soon .todo-head { box-shadow: inset 4px 0 0 var(--amber); }
.todo.calm .todo-head { box-shadow: inset 4px 0 0 var(--cobalt); }
.todo-list { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow: auto; }
.todo-item { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.todo-item:last-child { border-bottom: 0; }
.todo-item .who { min-width: 0; flex: 1; cursor: pointer; }
.todo-item .who b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo-item .who span { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.todo-item .acts { display: flex; gap: 4px; flex: none; }
.todo-empty { padding: 18px 16px; color: var(--ink-3); font-size: 13px; }
.todo.clear-all .todo-item .who b { font-weight: 500; color: var(--ink-2); }
.greet { font-family: var(--font-display); font-size: 28px; font-weight: 700; }

/* ---------- bars ---------- */
.bar { height: 8px; background: var(--track); border-radius: 99px; overflow: hidden; position: relative; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: var(--cobalt); border-radius: 99px; }
.bar.amber > i { background: var(--amber); }
.bar.good > i { background: var(--good); }
.quota { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.quota:last-child { border-bottom: 0; }
.quota .bar { grid-column: 1 / -1; height: 10px; }
.quota .bar > i.queued { background: color-mix(in srgb, var(--cobalt) 30%, var(--track)); }

/* heatmap */
.heat { border-collapse: separate; border-spacing: 3px; width: 100%; font-size: 13px; }
.heat th { font-weight: 500; color: var(--ink-3); font-size: 12px; padding: 2px 4px; white-space: nowrap; text-align: center; }
.heat th.row { text-align: left; color: var(--ink-2); font-weight: 500; font-size: 13px; }
.heat td { text-align: center; border-radius: 6px; padding: 6px 2px; font-family: var(--font-display); font-weight: 600; min-width: 42px; position: relative; }
.heat td.zero { color: var(--ink-3); font-weight: 400; }
.heat td.short { background: var(--amber-wash); color: var(--amber-ink); }
.heat td.missed { background: var(--bad-wash); color: var(--bad); }
.heat td.done { background: var(--good-wash); color: var(--good); }
.heat td.over { background: var(--cobalt-wash); color: var(--cobalt-ink); }
.heat td.future { background: var(--surface-2); color: var(--ink-2); font-weight: 500; }

/* charts */
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .axis { font: 11.5px var(--font-ui); fill: var(--ink-3); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .lbl { font: 600 12px var(--font-display); fill: var(--ink); }
.tip { position: fixed; z-index: 100; pointer-events: none; background: var(--ink); color: var(--canvas); font-size: 12.5px; padding: 7px 10px; border-radius: 8px; box-shadow: var(--shadow-pop); max-width: 280px; line-height: 1.4; }
.tip b { font-weight: 600; }
.hbar-row { display: grid; grid-template-columns: minmax(120px, 34%) 1fr auto; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.hbar-row .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.hbar-row .val { font-family: var(--font-display); font-weight: 600; min-width: 52px; text-align: right; }
.stackbar { display: flex; height: 12px; border-radius: 4px; overflow: hidden; gap: 2px; background: transparent; }
.stackbar i { display: block; height: 100%; }
.stackbar i:first-child { border-radius: 4px 0 0 4px; }
.stackbar i:last-child { border-radius: 0 4px 4px 0; }

/* stat line (engagement) */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 18px; }
.stat { background: var(--surface); padding: 14px 18px; }
.stat .v { font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1.1; }
.stat .k { color: var(--ink-3); font-size: 12.5px; }

/* ---------- drawer / modal ---------- */
.scrim { position: fixed; inset: 0; background: rgba(14, 19, 32, .38); z-index: 50; animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); z-index: 51; box-shadow: var(--shadow-pop); display: flex; flex-direction: column; animation: slidein .2s cubic-bezier(.2, .8, .2, 1); }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
.drawer-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 12px; }
.drawer-head h2 { font-size: 19px; }
.drawer-head .sub { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.drawer-body { flex: 1; overflow: auto; padding: 18px 20px 28px; }
.drawer-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; background: var(--surface-2); }
.drawer-foot .grow { flex: 1; }
.section { margin-bottom: 22px; }
.section > h3 { margin-bottom: 10px; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.modal { position: fixed; z-index: 52; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: 22px; animation: fade .15s; }
.modal.wide { width: min(860px, calc(100vw - 32px)); }
.modal h2 { margin-bottom: 6px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.menu { position: fixed; z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-pop); padding: 6px; min-width: 200px; }
.menu button, .menu a { display: flex; width: 100%; gap: 8px; align-items: center; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; color: var(--ink); }
.menu button:hover, .menu a:hover { background: var(--sunken); text-decoration: none; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; background: var(--ink); color: var(--canvas); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow-pop); display: flex; gap: 12px; align-items: center; font-size: 13.5px; animation: fade .2s; max-width: calc(100vw - 32px); }
.toast.err { background: var(--bad); color: #fff; }
.toast button { background: none; border: 0; color: var(--amber); font-weight: 600; cursor: pointer; padding: 0; }

/* timeline (payments, history) */
.rounds { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 18px; }
.round { flex: 0 0 auto; min-width: 210px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-md); padding: 12px 14px; cursor: pointer; }
.round[aria-pressed="true"] { border-color: var(--cobalt); box-shadow: 0 0 0 1px var(--cobalt); }
.round .d { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.round .amt { font-family: var(--font-display); font-weight: 700; font-size: 22px; margin-top: 4px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: start; }
.feed li:last-child { border-bottom: 0; }
.feed .when { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: var(--amber-wash); color: var(--ink); margin-bottom: 16px; }
.callout.bad { background: var(--bad-wash); }
.callout.info { background: var(--cobalt-wash); }
.callout svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--amber-ink); }
.callout.bad svg { color: var(--bad); }
.callout.info svg { color: var(--cobalt-ink); }
.callout p { margin: 0; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; color: var(--ink-3); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--amber); }
.listedit { display: flex; flex-direction: column; gap: 6px; }
.listedit .row { display: flex; gap: 6px; align-items: center; }
.listedit .row .input { min-height: 34px; padding: 5px 9px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 13.5px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.masked { letter-spacing: .1em; color: var(--ink-3); }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: var(--side); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art h1 { font-size: 44px; max-width: 12ch; line-height: 1.05; color: #fff; }
.login-art p { color: var(--side-ink); max-width: 40ch; font-size: 15px; }
.login-art svg.deco { position: absolute; right: -60px; bottom: -40px; width: 70%; opacity: .9; }
.login-form { display: grid; place-items: center; padding: 32px; }
.login-form form { width: min(360px, 100%); display: flex; flex-direction: column; gap: 14px; }
.err { color: var(--bad); font-size: 13px; min-height: 18px; }

/* bottom nav (mobile) */
.tabbar { display: none; }

@media (max-width: 1180px) {
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .pace-top { grid-template-columns: auto minmax(0, 1fr); }
  .pace-facts { grid-column: 1 / -1; justify-content: start; }
}
@media (max-width: 860px) {
  :root { --side-w: 0px; }
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar { padding: 8px 16px; gap: 8px; }
  .search { width: 40px; flex: none; }
  .search input { padding-right: 0; color: transparent; cursor: pointer; }
  .search input::placeholder { color: transparent; }
  .search:focus-within { position: absolute; left: 10px; right: 10px; width: auto; z-index: 5; }
  .search:focus-within input { color: var(--ink); cursor: text; }
  .search:focus-within input::placeholder { color: var(--ink-3); }
  .ribbon { overflow-x: auto; margin-left: -4px; margin-right: -4px; padding-bottom: 6px; }
  .ribbon svg { min-width: 760px; }
  .campaign-pick select { max-width: 40vw; font-size: 15px; }
  .user-btn span.nm { display: none; }
  .page { padding: 18px 16px 96px; }
  .cols-2e { grid-template-columns: 1fr; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .pace { padding: 18px 16px 14px; }
  .pace-big { font-size: 48px; }
  .pace-top { grid-template-columns: 1fr; }
  .pace-facts { grid-template-columns: repeat(2, auto); }
  .today-grid { grid-template-columns: 1fr; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--ink-3); padding: 6px 0; text-decoration: none; }
  .tabbar a svg { width: 21px; height: 21px; }
  .tabbar a[aria-current="page"] { color: var(--cobalt); }
  .table-wrap { max-height: none; }
  .login { grid-template-columns: 1fr; }
  .login-art { min-height: 220px; padding: 28px; }
  .login-art h1 { font-size: 32px; }
  .drawer { width: 100vw; }
  .bulkbar { bottom: 76px; }
  .page-head .actions { margin-left: 0; }
  .hide-m { display: none !important; }
}
/* mobile card list for posts */
.mlist { display: none; }
@media (max-width: 860px) {
  .has-mlist .desk-only { display: none; }
  .has-mlist .mlist { display: flex; flex-direction: column; gap: 8px; }
  .mcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
  .mcard .r1 { display: flex; gap: 8px; align-items: center; }
  .mcard .r1 b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mcard .r2 { color: var(--ink-3); font-size: 12.5px; margin-top: 4px; }
  .mcard .r3 { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .side, .topbar, .tabbar, .bulkbar, .page-head .actions { display: none !important; }
  .shell { display: block; }
  .page { padding: 0; }
}

/* ---------- campaigns ---------- */
.split-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 36px; align-items: end; }
.split-bar { display: flex; gap: 3px; height: 14px; margin-top: 20px; border-radius: 6px; overflow: hidden; background: var(--track); }
.split-bar i { display: block; height: 100%; }
.split-bar i.org { background: var(--good); border-radius: 6px 0 0 6px; }
.split-bar i.camp { background: var(--cobalt); border-radius: 0 6px 6px 0; }
.camp-num { color: var(--cobalt-ink); font-weight: 600; font-size: 12.5px; }
@media (max-width: 860px) { .split-top { grid-template-columns: 1fr; } }

/* ---------- projects ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.proj { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; color: inherit; font: inherit; }
.proj:hover { border-color: var(--line-strong); }
.proj.current { border-color: var(--cobalt); box-shadow: 0 0 0 1px var(--cobalt); }
.proj h2 { font-size: 18px; }
.proj .meta { display: flex; gap: 18px; flex-wrap: wrap; }
.proj.new svg { width: 28px; height: 28px; }
.proj.new { align-items: center; justify-content: center; border-style: dashed; color: var(--ink-3); min-height: 170px; }

/* ---------- client report ---------- */
.report { max-width: 1080px; margin: 0 auto; }
.report-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding-bottom: 20px; border-bottom: 2px solid var(--ink); margin-bottom: 24px; }
.report-head img { max-height: 52px; max-width: 200px; object-fit: contain; }
.report-head .t { flex: 1; min-width: 240px; }
.report-head h1 { font-size: 30px; }
.report-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 22px; }
.report-kpis .stat .v { font-size: 34px; }
.report section { break-inside: avoid; }
.public-shell { min-height: 100vh; padding: 32px 20px 60px; background: var(--canvas); }
@media (max-width: 860px) { .report-kpis { grid-template-columns: repeat(2, 1fr); } }
@media print {
  body { background: #fff; }
  .public-shell { padding: 0; }
  .report .no-print { display: none !important; }
  .panel, .pace, .report-kpis { border-color: #ccc; }
}
