@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/Geist-Variable.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/GeistMono-Variable.woff2") format("woff2");
}

/* ══ ADS RE-THEME LAYER (mockup) ═══════════════════════════════════════
   Loaded AFTER the live dashboard CSS (prod bc5e357). The live rules keep
   their meaning; this layer (1) remaps the colour tokens to the Flow Pouch
   palette used by the inventory re-theme (THM, prod 703eddf), (2) swaps the
   fonts to Geist, (3) adds the shared shell: dark top bar, FLOW logo, tab
   pills, theme toggle, rounded frame, (4) fixes table columns.
   Palette: light shell #121212 / frame #F3F3F3 / card #FFF / accent #00A150
   / green text #00733A; dark shell #000 / frame #121212 / card #1C1C1C /
   accent #01EF7A. */

:root {
  --font-sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --shell: #121212;
  --shell-text: #ffffff;
  --shell-muted: #a3a3a3;
  --frame: #f3f3f3;
  --accent-fill: #00a150;
  --on-ink: #ffffff;

  /* live tokens → brand */
  --paper: #f3f3f3;
  --surface: #ffffff;
  --ink: #121212;
  --muted: #5e5e5e;
  --line: #eaeaea;
  --accent: #00733a;
  --win: #00733a;
  --win-fill: #00a150;
  --win-soft: #e8fbf1;
  --test: #d4d4d4;
  --miss: #e08a8e;
  --miss-ink: #b42318;
  --miss-soft: #fdeceb;
  --warn: #9a5b00;
  --warn-soft: #fdf3e2;
  --row-hover: #f7f7f7;
  --today: rgba(0, 161, 80, 0.07);
  --wk-bar: #00a150;
  --wk-bar-part: #9fdcbc;
}
html[data-theme="dark"] {
  --shell: #000000;
  --frame: #121212;
  --on-ink: #121212;

  --paper: #121212;
  --surface: #1c1c1c;
  --ink: #f3f3f3;
  --muted: #a3a3a3;
  --line: #2a2a2a;
  --accent: #01ef7a;
  --win: #01ef7a;
  --win-fill: #01ef7a;
  --win-soft: #0f2a1c;
  --test: #3a3a3a;
  --miss: #b25e63;
  --miss-ink: #f08a8f;
  --miss-soft: #3a1e20;
  --warn: #e0a93e;
  --warn-soft: #33260f;
  --row-hover: #242424;
  --today: rgba(1, 239, 122, 0.08);
  --wk-bar: #00a150;
  --wk-bar-part: #0b4a2a;
}

/* ── Base ─────────────────────────────────────────────────────────── */
html,
body {
  background: var(--shell);
  font-family: var(--font-sans);
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}
:focus-visible {
  outline-color: var(--accent);
}
/* Ad names and ids stay monospace (they are codes); everything else is Geist. */
.mrow .aid,
.urow .uid,
#adtTable td:first-child,
.fixnote code {
  font-family: var(--font-mono);
}

/* Display numbers: Geist semibold instead of Archivo 800 */
.card .num,
td.pct,
.wkt td.tot,
.wkc-stat .num,
.wkc-tip b,
.fixline .n,
.field input {
  font-weight: 600;
  letter-spacing: -0.02em;
}
.card .num {
  font-size: 44px;
}
.launch-strip .card .num {
  font-weight: 600;
}
td.adt-good,
td.adt-bad {
  font-weight: 700;
}
.board .bhead h2,
.kpi-pane h2,
.adt-panel h2,
.modal .mhead h3 {
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Small uppercase labels: sans, like the inventory table headers */
th,
.card .lbl,
.legend,
.launch-strip-hd,
.toolbar label,
.mcols,
.foot,
.hiddenpeople,
.adt-legend,
.pace-legend,
.pace-sub,
.wkc-legend,
.wkc-stat .lbl,
.unmatched > summary {
  letter-spacing: 0.04em;
}
th {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
}
.foot,
.hiddenpeople,
.pace-sub,
.modal .mhead .msub,
.mfoot .note,
.mfoot .monthline {
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
}

/* Wins, dots, chips: brand green fill */
.sq.w,
.legend .w i,
.mrow .dot.w,
.adt-dot-on {
  background: var(--win-fill);
}

/* ── Cards / surfaces: THM radius 12, hairline border ─────────────── */
.card,
.board,
.field,
.unmatched,
.adt-panel,
.rulebox,
.fixline,
.syncgaps,
.syncstatus,
.errbar,
.wkc-stat {
  border-radius: 12px;
}
.modal {
  border-radius: 16px;
  border: 1px solid var(--line);
}
.overlay {
  background: rgb(0 0 0 / 0.55);
}
.modal .close {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.menuList,
.adt-pop {
  border-radius: 12px;
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.18);
}

/* ── Buttons ──────────────────────────────────────────────────────── */
/* Secondary buttons: rounded pills, sans */
.exportBtn,
.savebtn,
.filterSel,
.menuBtn,
.wk-arrow {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  border-color: var(--line);
  border-radius: 999px;
}
.exportBtn,
.savebtn,
.filterSel {
  padding: 6px 14px;
}
.menuBtn,
.wk-arrow {
  border-radius: 999px;
}
.exportBtn:hover,
.savebtn:hover,
.filterSel:hover,
.menuBtn:hover,
.wk-arrow:hover:not(:disabled) {
  border-color: var(--ink);
}
.exportBtn[aria-pressed="true"] {
  background: var(--ink);
  color: var(--on-ink);
  border-color: var(--ink);
}
/* Primary actions: ink fill, green on hover (THM rule) */
.adt-savebtn,
.adt-applybtn,
.adt-pill[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--on-ink);
}
.adt-savebtn,
.adt-applybtn {
  border-radius: 999px;
}
.adt-savebtn:hover,
.adt-applybtn:hover {
  opacity: 1;
  background: var(--accent);
  color: var(--on-ink);
}
html:not([data-theme="dark"]) .adt-savebtn:hover,
html:not([data-theme="dark"]) .adt-applybtn:hover {
  color: #ffffff;
}
.adt-pill {
  font-weight: 500;
}
.adt-pill:hover {
  border-color: var(--ink);
}
.adt-filterbtn {
  font-weight: 500;
}
.adt-filterbtn:hover {
  border-color: var(--ink);
}

/* Inputs: card-coloured wells with a hairline, not grey paper */
.field input,
.adt-field input,
.adt-datein,
#adtSearch,
.mobileSortWrap select {
  background: var(--surface);
  border-color: var(--line);
}
html[data-theme="dark"] .field input,
html[data-theme="dark"] .adt-field input,
html[data-theme="dark"] .adt-datein,
html[data-theme="dark"] #adtSearch,
html[data-theme="dark"] .mobileSortWrap select {
  background: var(--paper);
}
#adtSearch {
  border-radius: 999px;
  padding: 8px 16px;
}
.field input {
  font-size: 22px;
}

/* Role badge + agency badge */
.role {
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 500;
  border-radius: 999px;
  padding: 2px 8px;
}
th .sortord {
  border-radius: 999px;
  padding: 0 5px;
}
.fixchip,
.mrow .astatus {
  font-family: var(--font-sans);
  font-weight: 500;
  border-radius: 999px;
  padding: 2px 8px;
  text-align: center;
}

/* ── Tables: fixed columns + ellipsis ─────────────────────────────── */
td {
  font-weight: 450;
}
tbody tr:hover {
  background: var(--row-hover);
}
@media (min-width: 561px) {
  #tbl {
    table-layout: fixed;
    min-width: 900px;
  }
  #tbl th:nth-child(1) {
    width: 21%;
  }
  #tbl th:nth-child(2) {
    width: 10%;
  }
  #tbl th:nth-child(n + 3):nth-child(-n + 8) {
    width: 10.5%;
  }
  #tbl th:nth-child(9) {
    width: 84px;
  }
  #tbl th,
  #tbl td {
    padding-left: 12px;
    padding-right: 12px;
  }
  #tbl th:first-child,
  #tbl td:first-child {
    padding-left: 20px;
  }
  #tbl td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #tbl td.who .pname {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #tbl td:has(.rowmenu) {
    overflow: visible;
  }
  #tbl th {
    white-space: normal;
  }

  #adtTable {
    table-layout: fixed;
    width: 100%;
    min-width: 980px;
  }
  #adtTable th:nth-child(1) {
    width: 30%;
  }
  #adtTable th:nth-child(2) {
    width: 8%;
  }
  #adtTable th:nth-child(3) {
    width: 9%;
  }
  #adtTable th:nth-child(4) {
    width: 6%;
  }
  #adtTable th:nth-child(n + 5) {
    width: 7.8%;
  }
  #adtTable th,
  #adtTable td {
    padding-left: 10px;
    padding-right: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #adtTable td:first-child {
    max-width: none;
  }
}

/* ══ SHELL ═══════════════════════════════════════════════════════════ */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px 20px;
  margin: 0;
  padding: 10px 14px 10px 18px;
  color: var(--shell-text);
  flex-shrink: 0;
  background: var(--shell);
}
.topbar .brand {
  display: flex;
  align-items: center;
  font: inherit;
  text-decoration: none;
}
.brand-logo {
  display: block;
  height: 20px;
  width: auto;
}
nav.tabs {
  display: flex;
  gap: 4px;
  margin: 0;
  min-width: 0;
  border: 0;
  box-shadow: none;
  overflow-x: auto;
  scrollbar-width: none;
}
nav.tabs::-webkit-scrollbar {
  display: none;
}
nav.tabs button.tab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: 36px;
  margin: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  font: 500 14px var(--font-sans);
  color: var(--shell-muted);
  white-space: nowrap;
  transition:
    background-color 150ms,
    color 150ms;
}
nav.tabs button.tab:hover {
  color: #ffffff;
  background: rgb(255 255 255 / 0.07);
}
nav.tabs button.tab.on {
  background: #ffffff;
  color: #121212;
}
nav.tabs button.tab:focus-visible {
  outline: 2px solid #01ef7a;
  outline-offset: -2px;
  border-radius: 999px;
}
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: #e2e2e2;
  cursor: pointer;
}
.icon-btn:hover {
  background: rgb(255 255 255 / 0.08);
  color: #ffffff;
}
.icon-btn:focus-visible {
  outline: 2px solid #01ef7a;
  outline-offset: 2px;
}
html[data-theme="dark"] .theme-moon,
html:not([data-theme="dark"]) .theme-sun {
  display: none;
}
.stage {
  flex: 1;
  min-height: 0;
  display: flex;
  padding: 0 8px;
}
.frame {
  flex: 1;
  min-width: 0;
  background: var(--frame);
  border-radius: 16px 16px 0 0;
  overflow-y: auto;
  overflow-x: hidden;
  color: var(--ink);
}
.frame > .wrap {
  max-width: 1400px;
  padding: 24px 24px 64px;
}
/* < 1024: tab pills get their own scrolling row under the top bar (THM) */
@media (max-width: 1023.98px) {
  nav.tabs {
    order: 3;
    flex-basis: 100%;
    margin: 0 -14px 0 -18px;
    padding: 0 14px 0 18px;
  }
}
@media (max-width: 560px) {
  .stage {
    padding: 0 6px;
  }
  .frame > .wrap {
    padding: 16px 14px 48px;
  }
  .topbar-right {
    width: auto;
  }
  nav.tabs {
    gap: 2px;
  }
  nav.tabs button.tab {
    padding: 0 9px;
    font-size: 13px;
  }
}

/* ══ LOGIN ═══════════════════════════════════════════════════════════ */
.login-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}
.loginCard {
  width: 100%;
  max-width: 384px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 32px 28px 28px;
}
.loginCard .login-title {
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.loginCard .login-sub {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 26px;
}
.loginForm {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.loginForm label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.loginForm input[type="password"] {
  display: block;
  width: 100%;
  margin-top: 6px;
  font: 500 15px var(--font-sans);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong, #d4d4d4);
  border-radius: 8px;
  padding: 9px 12px;
}
html[data-theme="dark"] .loginForm input[type="password"] {
  background: var(--paper);
  border-color: #3a3a3a;
}
.loginForm .submitBtn {
  width: 100%;
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--on-ink);
  font: 600 14px var(--font-sans);
  cursor: pointer;
}
.loginForm .submitBtn:hover {
  background: var(--accent);
}
html:not([data-theme="dark"]) .loginForm .submitBtn:hover {
  color: #ffffff;
}
.loginErr {
  display: none;
  font-size: 12.5px;
  color: var(--miss-ink);
}
.loginErr.show {
  display: block;
}

/* Week picker select: keep the live 28px height, no vertical padding */
.wk-sel {
  height: 30px;
  padding-top: 0;
  padding-bottom: 0;
}
