/* Hub – a production desk for client content.
   Tokens: cool mineral paper, slate ink, prepress cyan for action, proof marks on post images. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url(/fonts/archivo-latin-ext-wdth-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url(/fonts/archivo-latin-wdth-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #EEF1EF;
  --sheet: #FAFBFA;
  --ink: #1C2629;
  --graphite: #56656A;
  --mist: #8A9799;
  --rule: #CDD5D3;
  --rule-soft: #DFE5E3;
  --cyan: #0C6E8A;
  --cyan-wash: #DCEDF1;
  --ok: #2D7A50;
  --ok-wash: #DDEFE4;
  --wait: #9A620F;
  --wait-wash: #F6EAD4;
  --stop: #B03A2E;
  --stop-wash: #F6DEDA;
  --radius: 6px;
  --rail: 216px;
  --gap: 24px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.5 "Archivo", system-ui, sans-serif;
  font-stretch: 100%;
  font-variant-numeric: tabular-nums;
}
a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 3px; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-stretch: 118%; letter-spacing: -0.01em; margin: 0; line-height: 1.15; }
h1 { font-size: 34px; font-weight: 680; }
h2 { font-size: 19px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; font-stretch: 108%; }
p { margin: 0 0 .75em; max-width: 72ch; }
small, .muted { color: var(--graphite); }
.faint { color: var(--mist); }
hr { border: 0; border-top: 1px solid var(--rule); margin: 24px 0; }

/* ---------- frame ---------- */
.frame { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
  padding: 22px 14px; border-right: 1px solid var(--rule); background: var(--sheet);
}
.mark { display: flex; align-items: center; gap: 10px; padding: 0 10px 20px; color: var(--ink); text-decoration: none; }
.mark svg { flex: none; }
.mark b { font-stretch: 125%; font-weight: 760; font-size: 17px; letter-spacing: -.01em; }
.rail nav { display: flex; flex-direction: column; gap: 2px; }
.rail nav a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; border-radius: var(--radius);
  color: var(--graphite); text-decoration: none; font-weight: 520;
}
.rail nav a:hover { background: var(--paper); color: var(--ink); }
.rail nav a[aria-current="page"] { background: var(--ink); color: var(--sheet); }
.rail nav a .count { font-size: 12px; font-weight: 650; min-width: 22px; text-align: center; padding: 1px 6px; border-radius: 10px; background: var(--wait-wash); color: var(--wait); }
.rail nav a[aria-current="page"] .count { background: var(--sheet); }
.rail .foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 10px; font-size: 13px; }
.mode { display: flex; align-items: center; gap: 8px; color: var(--graphite); text-decoration: none; }
.mode i { width: 8px; height: 8px; border-radius: 50%; background: var(--wait); }
.mode.live i { background: var(--ok); }

main { padding: 32px 40px 64px; min-width: 0; max-width: 1360px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.head .sub { margin-top: 6px; color: var(--graphite); }
.crumb { font-size: 13px; color: var(--graphite); margin-bottom: 8px; }
.crumb a { color: var(--graphite); }

/* ---------- messages ---------- */
.note { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 20px; border: 1px solid; }
.note.ok { background: var(--ok-wash); border-color: #B9DCC6; color: #1F5A3A; }
.note.err { background: var(--stop-wash); border-color: #E8BDB6; color: #8A2B22; }

/* ---------- buttons & forms ---------- */
.btn, button {
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 8px 14px; border-radius: var(--radius);
  border: 1px solid var(--rule); background: var(--sheet); color: var(--ink); text-decoration: none;
}
.btn:hover, button:hover { border-color: var(--graphite); color: var(--ink); }
.btn.primary, button.primary { background: var(--cyan); border-color: var(--cyan); color: #fff; }
.btn.primary:hover, button.primary:hover { background: #095A71; }
button.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
button.stop { color: var(--stop); border-color: #E3B3AC; background: var(--sheet); }
button.link { border: 0; background: none; padding: 0; color: var(--cyan); font-weight: 500; }
button.link.danger { color: var(--stop); }
.btn.small, button.small { padding: 4px 10px; font-size: 13px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 560; color: var(--graphite); }
input, select, textarea {
  font: inherit; font-size: 14px; color: var(--ink);
  padding: 8px 10px; border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; width: 100%;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--cyan); outline-offset: -1px; border-color: var(--cyan); }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; }
label.check input { width: auto; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px 18px; }
.fields .wide { grid-column: 1 / -1; }
fieldset { min-inline-size: 0; border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 18px 18px; margin: 0 0 18px; background: var(--sheet); }
legend { font-weight: 650; font-stretch: 108%; padding: 0 6px; }

/* ---------- surfaces ---------- */
.panel { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px 22px; }
.panel + .panel { margin-top: var(--gap); }
.panel > h2 { margin-bottom: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.grid-2 > .panel + .panel { margin-top: 0; }
.stack > * + * { margin-top: var(--gap); }
.empty { padding: 22px; text-align: left; color: var(--graphite); border: 1px dashed var(--rule); border-radius: var(--radius); }

/* ---------- the day header ---------- */
.day h1 { font-size: 44px; font-stretch: 125%; font-weight: 720; letter-spacing: -.02em; }
.day .sub { font-size: 17px; }

/* ---------- ledger (money) ---------- */
.ledger-line { display: flex; flex-wrap: wrap; gap: 10px 40px; margin-bottom: 18px; }
.ledger-line div span { display: block; font-size: 13px; color: var(--graphite); }
.ledger-line div strong { font-size: 30px; font-stretch: 125%; font-weight: 700; letter-spacing: -.02em; }
.ledger-line .neg { color: var(--stop); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--graphite); padding: 6px 10px; border-bottom: 1px solid var(--rule); }
td { padding: 9px 10px; border-bottom: 1px solid var(--rule-soft); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
tfoot td { border-top: 1px solid var(--rule); border-bottom: 0; font-weight: 650; }
.neg { color: var(--stop); }
.pos { color: var(--ok); }
.bar { height: 6px; background: var(--rule-soft); border-radius: 3px; min-width: 80px; position: relative; overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; background: var(--ok); border-radius: 3px; }
.bar i.neg { background: var(--stop); }
.table-scroll { overflow-x: auto; }

/* ---------- people & clients ---------- */
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.client-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; }
td select { width: auto; padding: 4px 8px; font-size: 13px; }
td form.inline + form.inline { margin-left: 10px; }
a.client-name:hover { text-decoration: underline; }
.brand-strip { display: flex; height: 10px; border-radius: 3px; overflow: hidden; width: 120px; }
.brand-strip i { flex: 1; }

/* ---------- status chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 20px; white-space: nowrap; background: var(--rule-soft); color: var(--graphite); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.pending, .chip.in_review, .chip.onboarding, .chip.planned { background: var(--wait-wash); color: var(--wait); }
.chip.approved, .chip.active, .chip.paid { background: var(--ok-wash); color: var(--ok); }
.chip.rejected, .chip.failed, .chip.ended { background: var(--stop-wash); color: var(--stop); }
.chip.scheduled, .chip.invoiced { background: var(--cyan-wash); color: var(--cyan); }
.chip.published { background: var(--ink); color: var(--sheet); }
.chip.test { background: transparent; border: 1px dashed var(--mist); color: var(--graphite); }
.chip.test::before { display: none; }

/* ---------- proofs: the post images ---------- */
.proofs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 22px; }
.proofs.large { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.proof { position: relative; display: flex; flex-direction: column; gap: 8px; color: var(--ink); text-decoration: none; }
.proof .sheet { position: relative; padding: 10px; background: #fff; border: 1px solid var(--rule); }
.proof .sheet img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; background: var(--rule-soft); }
/* registration crop marks at the four corners */
.proof .sheet::before, .proof .sheet::after, .proof .sheet span::before, .proof .sheet span::after {
  content: ""; position: absolute; width: 10px; height: 10px; border-color: var(--mist); border-style: solid;
}
.proof .sheet::before { top: 3px; left: 3px; border-width: 1px 0 0 1px; }
.proof .sheet::after { top: 3px; right: 3px; border-width: 1px 1px 0 0; }
.proof .sheet span::before { bottom: 3px; left: 3px; border-width: 0 0 1px 1px; }
.proof .sheet span::after { bottom: 3px; right: 3px; border-width: 0 1px 1px 0; }
a.proof:hover .sheet { border-color: var(--graphite); }
.proof .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.proof .meta b { font-weight: 600; }
.proof .who { font-size: 12.5px; color: var(--graphite); display: flex; align-items: center; gap: 6px; }
.lang { font-size: 11.5px; font-weight: 700; padding: 1px 5px; border: 1px solid var(--rule); border-radius: 4px; color: var(--graphite); }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--rule-soft); }
.list li:last-child { border-bottom: 0; }
.list .when { flex: none; width: 112px; font-size: 13px; color: var(--graphite); }
.list .grow { flex: 1; min-width: 0; }
.attn li { align-items: flex-start; }
.attn .lvl { flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 2px; background: var(--mist); }
.attn .lvl.act { background: var(--stop); }
.attn .lvl.check { background: var(--wait); }
.attn a { color: var(--ink); text-decoration: none; }
.attn a:hover { text-decoration: underline; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin-bottom: 24px; flex-wrap: wrap; }
.tabs a { padding: 8px 12px; color: var(--graphite); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 550; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- checklist ---------- */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule-soft); }
.steps li:last-child { border-bottom: 0; }
.steps li::before { counter-increment: step; content: counter(step); flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; border: 1px solid var(--rule); color: var(--graphite); }
.steps li.done::before { content: "✓"; background: var(--ok); border-color: var(--ok); color: #fff; }
.steps li.done span { color: var(--graphite); text-decoration: line-through; text-decoration-color: var(--mist); }
.steps li span { flex: 1; }

/* ---------- variant page ---------- */
.variant { display: grid; grid-template-columns: minmax(280px, 460px) minmax(0, 1fr); gap: 32px; align-items: start; }
.variant .proof .sheet { padding: 14px; }
.blockers { list-style: none; padding: 0; margin: 0 0 14px; }
.blockers li { padding: 6px 0 6px 18px; position: relative; color: #8A2B22; }
.blockers li::before { content: ""; position: absolute; left: 2px; top: 13px; width: 8px; height: 2px; background: var(--stop); }
.siblings { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.siblings a { width: 62px; border: 1px solid var(--rule); padding: 3px; background: #fff; }
.siblings a[aria-current="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.siblings img { aspect-ratio: 4/5; object-fit: cover; }
.caption-preview { white-space: pre-wrap; background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px; font-size: 14px; }

/* ---------- calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); background: var(--sheet); }
.cal .dow { padding: 8px 10px; font-size: 12.5px; color: var(--graphite); border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: var(--paper); }
.cal .cell { min-height: 112px; padding: 6px 8px 8px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 4px; }
.cal .cell.out { background: var(--paper); }
.cal .cell .n { font-size: 13px; font-weight: 600; color: var(--graphite); }
.cal .cell.today .n { color: #fff; background: var(--ink); border-radius: 4px; padding: 0 6px; align-self: flex-start; }
.cal .ev { display: flex; gap: 6px; align-items: center; font-size: 12.5px; padding: 3px 6px; border-radius: 4px; background: var(--paper); color: var(--ink); text-decoration: none; border-left: 3px solid var(--mist); }
.cal .ev.published { border-left-color: var(--ink); }
.cal .ev.scheduled { border-left-color: var(--cyan); background: var(--cyan-wash); }
.cal .ev time { color: var(--graphite); }

/* ---------- metrics ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--sheet); }
.kpis div { padding: 14px 16px; border-right: 1px solid var(--rule-soft); }
.kpis div:last-child { border-right: 0; }
.kpis span { display: block; font-size: 12.5px; color: var(--graphite); }
.kpis strong { font-size: 24px; font-stretch: 120%; font-weight: 700; }
.mini-form { display: grid; grid-template-columns: repeat(6, minmax(64px, 1fr)) auto; gap: 6px; align-items: end; }
.mini-form input { padding: 5px 7px; font-size: 13px; }
.mini-form label { font-size: 11.5px; }
details summary { cursor: pointer; color: var(--cyan); font-weight: 550; font-size: 13.5px; }
details[open] summary { margin-bottom: 10px; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .grid-2, .variant { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .frame { grid-template-columns: minmax(0, 1fr); }
  .list .when { width: 92px; }
  .bar { min-width: 40px; }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .mark { padding: 0 8px 0 0; }
  .rail nav { flex-direction: row; flex-wrap: wrap; }
  .rail .foot { margin: 0 0 0 auto; flex-direction: row; padding: 0; }
  main { padding: 22px 16px 48px; }
  .day h1 { font-size: 32px; }
  .ledger-line { gap: 10px 24px; }
  .ledger-line div strong { font-size: 24px; }
  .mini-form { grid-template-columns: repeat(3, 1fr); }
  .cal .cell { min-height: 72px; }
  .cal .ev time, .cal .ev .t { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print {
  .rail, .no-print { display: none !important; }
  .frame { display: block; }
  main { padding: 0; }
  body { background: #fff; }
}
