/* Capri. Tokens and components follow the design canvas. */
:root {
  --ground: #f3f2ee;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --col: #ebeae5;
  --line: #e2e0da;
  --line-soft: #f0eee9;
  --line-strong: #d5d3cc;
  --ink: #17171b;
  --ink-2: #3a3a42;
  --ink-3: #4a4a52;
  --muted: #66666e;
  --faint: #8a8a92;
  --accent: #2346c4;
  --accent-ink: #1b379c;
  --accent-soft: #e8ecfa;
  --accent-wash: #f1f4fd;
  --green: #0c6a4f;
  --green-soft: #dcefe6;
  --amber: #8a4a06;
  --amber-soft: #fbead2;
  --amber-bar: #c9821f;
  --red: #a3321b;
  --red-soft: #fae2da;
  --gray-soft: #ecebe6;
  --radius: 12px;
  --font: Geist, 'Helvetica Neue', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', monospace;
  --serif: 'Instrument Serif', Georgia, serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 14px/1.45 var(--font); }
a { color: var(--accent); }
a:hover { color: var(--accent-ink); }
img { display: block; }
h1, h2, h3 { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.ink3 { color: var(--ink-3); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; }
.row-top { display: flex; align-items: flex-start; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack-sm { display: flex; flex-direction: column; gap: 4px; }
.grow { flex: 1 1 auto; min-width: 0; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }

/* ------------------------------------------------------------------ shell */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 24px; padding: 22px 14px 16px; background: var(--surface); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font: 400 22px/1 var(--serif); }
.brand-txt b { display: block; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.brand-txt span { display: block; font-size: 12px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 10px; border-radius: 9px; text-decoration: none; color: var(--ink-2); font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current='page'] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.nav svg { flex: none; }
.nav .label { flex: 1; }
.badge { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--ink); color: #fff; font: 600 11px/20px var(--mono); text-align: center; }
.nav a[aria-current='page'] .badge { background: var(--accent); }
.today { display: flex; flex-direction: column; gap: 11px; padding: 14px 12px; border-radius: 12px; background: #f6f5f1; border: 1px solid #eceae4; }
.today-title { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.meter { display: flex; flex-direction: column; gap: 5px; font-size: 12px; }
.meter .spread { gap: 6px; }
.meter .label { color: var(--ink-3); }
.meter .val { font-family: var(--mono); }
.track { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.track > i { display: block; height: 100%; background: var(--ink); border-radius: 2px; }
.track.thick { height: 6px; border-radius: 3px; }
.track.amber > i { background: var(--amber-bar); }
.track.green > i { background: var(--green); }
.track.blue > i { background: var(--accent); }
.me { display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid #eceae4; margin-top: auto; }
.me b { display: block; font-size: 14px; }
.me span { display: block; font-size: 12px; color: var(--muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex: none; }
.avatar.sm { width: 22px; height: 22px; font-size: 9px; font-weight: 700; background: var(--gray-soft); color: var(--ink-3); }
.avatar.md { width: 28px; height: 28px; font-size: 10px; font-weight: 700; background: var(--gray-soft); color: var(--ink-3); }
.icon-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); display: flex; align-items: center; justify-content: center; color: var(--ink-3); cursor: pointer; padding: 0; }
.main { min-width: 0; padding: 26px 30px 40px; display: flex; flex-direction: column; gap: 18px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.eyebrow { font-size: 13px; font-weight: 500; color: var(--muted); }
.h1 { font: 400 42px/1 var(--serif); letter-spacing: -0.01em; margin-top: 6px; }
.h1.sm { font-size: 34px; }
.lede { font-size: 15px; color: var(--ink-3); margin-top: 6px; }
.h2 { font-size: 15px; font-weight: 600; }
.h2-sm { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.crumbs { display: flex; gap: 8px; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--ink-3); text-decoration: none; font-weight: 500; }

/* ------------------------------------------------------------------ bits */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.card.pad-lg { padding: 18px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card.focus { border: 1.5px solid var(--accent); box-shadow: 0 8px 22px rgba(35, 70, 196, 0.1); }
.card.dashed { background: var(--surface-2); border: 1.5px dashed #cfccc4; }
.card.problem { background: #fdf1ec; border-color: #f2c4b6; }

.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--gray-soft); color: var(--ink-3); }
.chip.lg { height: 24px; padding: 0 9px; }
.chip.blue { background: var(--accent-soft); color: var(--accent-ink); }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.amber { background: var(--amber-soft); color: var(--amber); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.dark { background: var(--ink); color: #fff; }
.chip.navy { background: var(--accent-ink); color: #fff; }
.tag { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 5px; font-size: 11px; font-weight: 600; background: var(--gray-soft); color: var(--ink-3); }
.tag.blue { background: var(--accent-soft); color: var(--accent-ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 9px; border: 1px solid transparent; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:disabled, .btn[aria-disabled='true'] { opacity: 0.55; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); color: #fff; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.dark:hover { background: #000; color: #fff; }
.btn.ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); font-weight: 500; }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger { background: var(--surface); border-color: #f2c4b6; color: var(--red); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn.tall { height: 50px; border-radius: 12px; font-size: 16px; }
form.inline { display: inline; margin: 0; }

.seg { display: inline-flex; gap: 4px; padding: 3px; border-radius: 10px; background: #e6e4de; }
.seg a, .seg button { height: 34px; padding: 0 13px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-3); font-size: 13px; font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.seg a[aria-current='true'], .seg button[aria-pressed='true'] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.seg .mono { color: var(--muted); font-size: 12px; }

.flash { padding: 11px 14px; border-radius: 10px; font-size: 14px; }
.flash.ok { background: var(--green-soft); color: var(--green); }
.flash.err { background: var(--red-soft); color: var(--red); }
.flash.info { background: var(--accent-soft); color: var(--accent-ink); }
.note { padding: 9px 11px; border-radius: 9px; font-size: 13px; line-height: 1.4; }
.note.amber { background: var(--amber-soft); color: var(--amber); }
.note.red { background: var(--red-soft); color: var(--red); }
.note.blue { background: var(--accent-soft); color: var(--accent-ink); }
.note.gray { background: var(--gray-soft); color: var(--ink-3); }
.empty { padding: 18px; border: 1.5px dashed #cfccc4; border-radius: 12px; color: var(--muted); font-size: 13px; text-align: center; }
.check { display: inline-flex; align-items: center; gap: 4px; color: var(--green); font-size: 12px; font-weight: 500; }
.check.bad { color: var(--red); }

/* thumbnails */
.thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.thumb { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 5px; background: #dddbd5; }
.thumb.bad { outline: 2px solid #e0775a; outline-offset: -2px; }
.face { width: 30px; height: 53px; object-fit: cover; border-radius: 5px; background: #dddbd5; flex: none; }
.face.md { width: 44px; height: 78px; border-radius: 6px; }
.face.lg { width: 58px; height: 103px; border-radius: 7px; }
.face.xs { width: 24px; height: 43px; border-radius: 4px; }
.face.blank { display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 10px; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.kpis.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px; display: flex; flex-direction: column; gap: 7px; }
.kpi .label { font-size: 13px; color: var(--ink-3); }
.kpi .val { font: 500 24px/1.1 var(--mono); letter-spacing: -0.02em; }
.kpi .val small { color: var(--faint); font-size: 24px; }
.kpi .sub { font-size: 12px; color: var(--muted); }
.kpi.amber { background: var(--amber-soft); border-color: #f1d3a6; }
.kpi.amber .label, .kpi.amber .val, .kpi.amber .sub { color: var(--amber); }

/* ------------------------------------------------------------------ board */
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 10px; background: var(--col); border-radius: 12px; padding: 10px; min-width: 0; min-height: 160px; }
.col-head { padding: 2px 4px 4px; }
.col-head b { font-size: 14px; }
.col-head .who { font-size: 12px; color: var(--muted); }
.mcard { display: flex; flex-direction: column; gap: 8px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); }
.mcard:hover { border-color: var(--line-strong); color: var(--ink); }
.mcard.you { border: 1.5px solid var(--accent); box-shadow: 0 6px 18px rgba(35, 70, 196, 0.1); }
.mcard .name { font-size: 14px; font-weight: 600; }
.mcard .meta { font-size: 12px; color: var(--muted); }
.ghost-card { border: 1.5px dashed #cfccc4; border-radius: 10px; padding: 10px 12px; font-size: 12px; color: var(--muted); }
.mini { display: flex; justify-content: space-between; gap: 6px; padding: 9px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; font-size: 12px; text-decoration: none; color: var(--ink); }

/* ------------------------------------------------------------------ queue */
.home { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }
.task { display: flex; align-items: center; gap: 18px; padding: 16px; background: var(--surface); border: 1.5px solid var(--accent); border-radius: 14px; box-shadow: 0 8px 22px rgba(35, 70, 196, 0.08); }
.task.problem { border-color: #e0775a; box-shadow: none; }
.task.soon { background: var(--surface-2); border: 1.5px dashed #cfccc4; box-shadow: none; }
.task h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.task .detail { font-size: 14px; color: var(--ink-3); }
.task .acts { display: flex; flex-direction: column; gap: 8px; flex: none; width: 160px; }
.list-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.list-row:last-child { border-bottom: 0; }
.list-row b { font-size: 14px; font-weight: 600; display: block; }
.list-row .sub { font-size: 13px; color: var(--ink-3); }

/* ------------------------------------------------------------------ tables */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.sel td { background: var(--accent-wash); }
.table tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.table a.rowlink { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.num { font-family: var(--mono); }
.table.compact th, .table.compact td { padding-left: 8px; padding-right: 8px; }
.table.compact th:first-child, .table.compact td:first-child { padding-left: 16px; }
.kpi .val .aside { font: 500 14px var(--font); color: var(--ink-3); letter-spacing: 0; }
.databar { display: flex; align-items: center; gap: 8px; }
.databar .track { flex: 1; height: 8px; border-radius: 4px; background: var(--gray-soft); }
.databar .track > i { background: var(--accent); border-radius: 0 4px 4px 0; }

/* ------------------------------------------------------------------ model page */
.two { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.stats-split { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.scroll-x { overflow-x: auto; }
.steps { list-style: none; margin: 0; padding: 14px 18px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.steps li { display: flex; gap: 9px; align-items: flex-start; }
.dot { width: 22px; height: 22px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; background: var(--gray-soft); color: var(--ink-3); font-size: 11px; font-weight: 700; }
.dot.done { background: var(--ink); color: #fff; }
.dot.now { background: var(--accent); color: #fff; }
.steps b { display: block; font-size: 14px; }
.steps .when { font: 500 12px var(--mono); color: var(--ink-3); }
.steps .who { font-size: 12px; color: var(--muted); line-height: 1.35; }
.gallery { display: flex; flex-wrap: wrap; gap: 6px; }
.gallery .item { position: relative; width: 64px; }
.gallery .item img { width: 64px; height: 114px; object-fit: cover; border-radius: 6px; background: #dddbd5; }
.gallery .item .cap { font-size: 11px; color: var(--ink-3); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery .item.bad img { outline: 2px solid #e0775a; outline-offset: -2px; }
.gallery .item .x, .reelgrid .r .x { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(23, 23, 27, 0.72); color: #fff; font-size: 12px; line-height: 20px; cursor: pointer; padding: 0; }
.drop { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1.5px dashed #cfccc4; border-radius: 12px; background: var(--surface-2); }
.drop.over { border-color: var(--accent); background: var(--accent-wash); }
.stat { background: #f6f5f1; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.stat .label { font-size: 12px; color: var(--ink-3); }
.stat .val { font: 500 20px var(--mono); }
.stat.green { background: var(--green-soft); }
.stat.green .label, .stat.green .val { color: var(--green); }
.stats2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stats3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.log { display: flex; flex-direction: column; }
.log div { display: flex; gap: 10px; padding: 5px 0; font-size: 12px; line-height: 1.4; }
.log .t { font: 500 11px var(--mono); color: var(--muted); width: 78px; flex: none; padding-top: 1px; }
.reelgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.reelgrid .r { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 12px; }
.reelgrid .r img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 6px; background: #dddbd5; }
.reelgrid .r .l { font: 600 12px var(--mono); }
.reelgrid .r .s { font-weight: 600; }
.reelgrid .r .m { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.input, .field input, .field select, .field textarea { height: 42px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 15px; font-weight: 400; width: 100%; }
.field textarea { height: auto; padding: 10px 12px; font-family: var(--mono); line-height: 1.45; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.hint { font-size: 12px; font-weight: 400; color: var(--muted); }
.search { display: flex; align-items: center; gap: 8px; height: 40px; width: 260px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); color: var(--muted); }
.search input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 14px; color: var(--ink); }
.codebox { font: 400 12px/1.5 var(--mono); background: var(--ink); color: #e9e9ee; border-radius: 10px; padding: 12px 14px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }

/* ------------------------------------------------------------------ stats chart */
.bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; align-items: end; height: 124px; border-bottom: 1px solid var(--line-strong); }
.bars .b { height: 124px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; position: relative; }
.bars .b i { display: block; width: 36px; max-width: 70%; border-radius: 4px 4px 0 0; background: var(--accent); }
.bars .b:hover i { background: var(--accent-ink); }
.bars .b .v { font: 600 12px var(--mono); visibility: hidden; }
.bars .b.show .v, .bars .b:hover .v, .bars .b:focus .v { visibility: visible; }
.bars-x { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; font-size: 12px; color: var(--ink-3); text-align: center; }
.bars-x .is-today { font-weight: 600; color: var(--ink); }

/* ------------------------------------------------------------------ login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login .card { width: 100%; max-width: 380px; padding: 28px; display: flex; flex-direction: column; gap: 16px; }

/* ------------------------------------------------------------------ VA (phone first) */
.va { max-width: 480px; margin: 0 auto; padding: 22px 16px 40px; display: flex; flex-direction: column; gap: 14px; }
.va .h1 { font-size: 38px; margin: 0; }
.va .card { border-radius: 16px; }
.va .btn { height: 48px; border-radius: 12px; font-size: 15px; }
.va .btn.tall { height: 52px; font-size: 16px; }
.va .tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 4px; border-radius: 12px; background: #e6e4de; }
.va .tabs a { display: flex; align-items: center; justify-content: center; gap: 6px; height: 44px; border-radius: 9px; color: var(--ink-3); font-weight: 500; text-decoration: none; }
.va .tabs a[aria-current='page'] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.va .reels6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
.va .reels6 img, .va .reels6 span { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 5px; background: #dddbd5; }
.va .reels6 span { display: flex; align-items: center; justify-content: center; color: var(--ink-3); font-size: 13px; font-weight: 600; background: #e6e4de; }
.va textarea { min-height: 120px; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home, .two, .stats-split { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .today, .side .me { display: none; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .main { padding: 18px 16px 32px; }
  .board, .kpis, .kpis.four { grid-template-columns: minmax(0, 1fr); }
  .task { flex-direction: column; align-items: stretch; }
  .task .acts { width: auto; }
}
