/* Content Hub. An internal tool, so it borrows the coaching portal's dark
   ground and lime signal rather than either brand's public look. Platform
   colours are the only other hue, because "which platform" is the first thing
   the eye needs on a calendar. */
:root {
  --bg: #0b0c09;
  --panel: #12140f;
  --panel-2: #1a1d15;
  --panel-3: #23271c;
  --text: #f2f1ea;
  --dim: #b9b8ae;
  --mute: #7d8072;
  --line: rgba(242, 241, 234, .10);
  --line-2: rgba(242, 241, 234, .18);
  --lime: #b8f523;
  --lime-ink: #10140a;
  --warn: #f2c94c;
  --bad: #ff8f6b;
  --good: #7ee08a;
  --r: 10px;
  --r-sm: 6px;
  --body: "Barlow", system-ui, sans-serif;
  --tech: "Chakra Petch", ui-monospace, monospace;
  --nav-w: 208px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.45 var(--body); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: .01em; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
.mute { color: var(--mute); }
.dim { color: var(--dim); }
.tech { font-family: var(--tech); letter-spacing: .04em; }
.boot { padding: 40vh 0; text-align: center; color: var(--mute); }
.hide { display: none !important; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spread { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.stack { display: grid; gap: 12px; }
.grow { flex: 1 1 auto; min-width: 0; }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: 100vh; }
.nav { position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; background: var(--panel); }
.nav .brand { display: flex; gap: 10px; align-items: center; padding: 4px 10px 18px; font-weight: 700; }
.nav .brand img { width: 26px; height: 26px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm); text-decoration: none; color: var(--dim); }
.nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a.on { background: var(--panel-3); color: var(--text); }
.nav a .n { margin-left: auto; font: 600 11px var(--tech); background: var(--lime); color: var(--lime-ink); border-radius: 99px; padding: 1px 7px; }
.nav .foot { margin-top: auto; padding: 10px; font-size: 12px; color: var(--mute); }
.nav svg { width: 18px; height: 18px; flex: none; }
main { padding: 24px 28px 64px; min-width: 0; }
.page-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 18px; }
.tabbar { display: none; }

@media (max-width: 899px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav { display: none; }
  main { padding: 16px 16px calc(88px + var(--safe-b)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0 0; z-index: 20; background: rgba(18, 20, 15, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + var(--safe-b)); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--mute); text-decoration: none; background: none; border: 0; padding: 4px 0; position: relative; }
  .tabbar a.on { color: var(--lime); }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar .n { position: absolute; top: 0; left: 55%; font: 600 10px var(--tech); background: var(--lime); color: var(--lime-ink); border-radius: 99px; padding: 0 5px; }
  h1 { font-size: 21px; }
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 10px 12px; }
  .stat b { font-size: 24px; }
  .runway { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.more-sheet { position: fixed; inset: auto 0 calc(64px + var(--safe-b)) 0; z-index: 30; background: var(--panel-2); border-top: 1px solid var(--line-2); padding: 8px; display: grid; gap: 2px; }
.more-sheet a { padding: 12px 14px; border-radius: var(--r-sm); text-decoration: none; }
.more-sheet a:hover { background: var(--panel-3); }

/* ---- controls ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--dim); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.primary:disabled { background: var(--panel-3); color: var(--mute); border-color: var(--line-2); filter: none; }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn.sm { min-height: 28px; padding: 0 10px; font-size: 13px; }
.btn.icon { padding: 0; width: 32px; min-height: 32px; }
input[type=text], input[type=search], input[type=url], input[type=password], input[type=email], input[type=date], input[type=datetime-local], input[type=number], select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 8px 10px; min-height: 36px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--lime); }
textarea { resize: vertical; line-height: 1.5; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--mute) 50%), linear-gradient(135deg, var(--mute) 50%, transparent 50%); background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
.fld { display: grid; gap: 4px; }
.fld > span { font-size: 12px; color: var(--mute); text-transform: uppercase; letter-spacing: .06em; font-family: var(--tech); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 6px 12px; cursor: pointer; color: var(--dim); font-weight: 600; font-size: 13px; }
.seg button.on { background: var(--panel-3); color: var(--text); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters select, .filters input { width: auto; min-width: 130px; }
.filters input[type=checkbox] { min-width: 0; width: auto; }
.filters label.row { flex-wrap: nowrap; }
.filters input[type=search] { min-width: 180px; flex: 1 1 180px; max-width: 320px; }

/* ---- chips & badges ---- */
.chip { display: inline-flex; align-items: center; gap: 5px; font: 600 11px var(--tech); letter-spacing: .04em; padding: 2px 7px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--dim); white-space: nowrap; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--dim)); }
.chip.plat { border-color: color-mix(in srgb, var(--c) 45%, transparent); color: color-mix(in srgb, var(--c) 80%, var(--text)); }
.chip.brand-builtwilder { --c: var(--lime); }
.chip.brand-beastcreative { --c: #c9c9c9; }
.badge { font: 600 11px var(--tech); letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; background: var(--panel-3); color: var(--dim); white-space: nowrap; }
.badge.s-in_review, .badge.s-changes { background: rgba(242, 201, 76, .16); color: var(--warn); }
.badge.s-approved { background: rgba(184, 245, 35, .14); color: var(--lime); }
.badge.s-published { background: rgba(126, 224, 138, .14); color: var(--good); }
.badge.s-failed { background: rgba(255, 143, 107, .16); color: var(--bad); }
.badge.s-publishing { background: rgba(79, 140, 255, .18); color: #9ab9ff; }
.badge.s-cancelled { text-decoration: line-through; }

/* ---- cards & panels ---- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.panel h2 { margin-bottom: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; text-decoration: none; display: block; }
.stat b { display: block; font: 600 30px/1.1 var(--tech); }
.stat span { color: var(--mute); font-size: 13px; }
.stat.hot b { color: var(--lime); }
.stat.bad b { color: var(--bad); }
.list { display: grid; gap: 1px; background: var(--line); border-radius: var(--r-sm); overflow: hidden; }
.list > * { background: var(--panel); padding: 10px 12px; display: flex; gap: 10px; align-items: center; text-decoration: none; min-width: 0; }
.list > a:hover { background: var(--panel-2); }
.list .t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { color: var(--mute); padding: 18px 4px; font-size: 14px; }

/* ---- 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; scroll-snap-type: x proximity; }
.col { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); min-height: 120px; display: flex; flex-direction: column; scroll-snap-align: start; max-height: calc(100vh - 170px); }
.col-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 14px; position: sticky; top: 0; }
.col-head .n { font: 600 12px var(--tech); color: var(--mute); }
.col-body { padding: 8px; display: grid; gap: 8px; overflow-y: auto; align-content: start; flex: 1; }
.col.drop { outline: 2px dashed var(--lime); outline-offset: -4px; }
.card { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px; display: grid; gap: 6px; text-decoration: none; cursor: pointer; }
.card:hover { border-color: var(--line-2); }
.card.dragging { opacity: .4; }
.card .ttl { font-weight: 600; line-height: 1.3; }
.card .meta { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--mute); }
.card .fb { color: var(--warn); font: 600 11px var(--tech); }
@media (max-width: 899px) { .board { grid-auto-columns: 84%; } .col { max-height: none; } }

/* ---- piece page ---- */
.crumbs { font-size: 13px; color: var(--mute); margin-bottom: 8px; }
.crumbs a { text-decoration: none; }
.title-in { font-size: 24px; font-weight: 700; background: transparent; border: 1px solid transparent; padding: 4px 6px; margin-left: -7px; width: 100%; }
.title-in:hover { border-color: var(--line); }
.piece-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .piece-grid { grid-template-columns: minmax(0, 1fr); } }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.section { margin-top: 22px; }
.section > .spread { margin-bottom: 10px; }
.deliv { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); margin-bottom: 14px; }
.deliv-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.deliv-body { padding: 14px; display: grid; gap: 14px; }
.media { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.media video, .media img { max-height: 320px; max-width: 100%; border-radius: var(--r-sm); background: #000; }
.pl { border: 1px solid var(--line); border-left: 3px solid var(--c, var(--line-2)); border-radius: var(--r-sm); padding: 12px; display: grid; gap: 10px; background: var(--bg); }
.pl-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.count { font: 600 12px var(--tech); color: var(--mute); }
.count.over { color: var(--bad); }
.checks { display: grid; gap: 4px; font-size: 13px; }
.checks .error { color: var(--bad); }
.checks .warn { color: var(--warn); }
.checks .error::before { content: "✕ "; }
.checks .warn::before { content: "! "; }
.pl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.fb-item { border-left: 2px solid var(--line-2); padding: 6px 0 6px 10px; display: grid; gap: 4px; }
.fb-item.open { border-color: var(--warn); }
.fb-item.doing { border-color: #9ab9ff; }
.fb-item .who { font-size: 12px; color: var(--mute); }
.fb-item p { margin: 0; white-space: pre-wrap; }
.asset { display: flex; gap: 10px; align-items: center; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); min-width: 0; }
.asset .path { font: 12px var(--tech); color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; text-align: left; }
.script { font-size: 15px; line-height: 1.6; min-height: 180px; }

/* ---- calendar ---- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.cal .dow { background: var(--panel); padding: 6px 8px; font: 600 11px var(--tech); color: var(--mute); text-transform: uppercase; letter-spacing: .06em; }
.cal .day { background: var(--panel); min-height: 118px; padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal .day.other { background: #0e100c; }
.cal .day.other .dn { opacity: .4; }
.cal .day.today { box-shadow: inset 0 0 0 1px var(--lime); }
.cal .day.gap { background-image: repeating-linear-gradient(135deg, transparent 0 8px, rgba(255, 143, 107, .05) 8px 16px); }
.cal .day.drop { outline: 2px dashed var(--lime); outline-offset: -3px; }
.cal .dn { display: flex; justify-content: space-between; font: 600 12px var(--tech); color: var(--dim); }
.cal .dn .d { color: var(--mute); font-weight: 500; }
.ev { display: flex; gap: 5px; align-items: center; font-size: 12px; padding: 3px 6px; border-radius: 4px; background: color-mix(in srgb, var(--c) 16%, var(--panel-2)); border-left: 2px solid var(--c); text-decoration: none; overflow: hidden; white-space: nowrap; cursor: pointer; }
.ev .tm { font: 600 10px var(--tech); color: var(--dim); flex: none; }
.ev .tx { overflow: hidden; text-overflow: ellipsis; }
.ev.pub { opacity: .62; }
.ev.target { background: transparent; border: 1px dashed var(--line-2); border-left-width: 1px; color: var(--mute); }
.ev.draft { background: transparent; border: 1px dashed color-mix(in srgb, var(--c) 60%, transparent); border-left: 2px solid var(--c); }
.ev.dragging { opacity: .35; }
.cal.week .day { min-height: 420px; }
.runway { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 14px; }
.runway .r { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--c); border-radius: var(--r-sm); padding: 8px 10px; }
.runway .r b { font: 600 18px var(--tech); }
.runway .r.zero b { color: var(--bad); }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--mute); margin-top: 10px; }
@media (max-width: 899px) {
  .cal .day { min-height: 74px; padding: 3px; }
  .ev { padding: 2px 3px; font-size: 10px; }
  .ev .tx, .ev .tm { display: none; }
  .ev { width: 10px; height: 10px; padding: 0; border-radius: 50%; border: 0; background: var(--c); display: inline-block; }
  .cal .day .evs { display: flex; flex-wrap: wrap; gap: 3px; }
  .cal.week { grid-template-columns: minmax(0, 1fr); }
  .cal.week .dow { display: none; }
  .cal.week .day { min-height: 0; }
  .cal.week .ev { width: auto; height: auto; padding: 4px 6px; border-radius: 4px; display: flex; background: color-mix(in srgb, var(--c) 16%, var(--panel-2)); border-left: 2px solid var(--c); font-size: 13px; }
  .cal.week .ev .tx, .cal.week .ev .tm { display: inline; }
}

/* ---- review ---- */
.rv { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; gap: 12px; margin-bottom: 16px; }
.rv-copy { white-space: pre-wrap; background: var(--bg); border-radius: var(--r-sm); padding: 10px 12px; border-left: 3px solid var(--c); font-size: 15px; }
.rv-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rv-actions .btn { min-height: 44px; flex: 1 1 140px; }

/* ---- insights ---- */
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th, table.t td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t th { font: 600 11px var(--tech); color: var(--mute); text-transform: uppercase; letter-spacing: .06em; }
table.t td.n, table.t th.n { text-align: right; font-family: var(--tech); }
.scroll-x { overflow-x: auto; }
.bar { height: 8px; border-radius: 4px; background: var(--panel-3); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--c, var(--lime)); }
.mix { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr 2fr; gap: 6px 12px; align-items: center; font-size: 13px; }
.mix .h { font: 600 11px var(--tech); color: var(--mute); text-transform: uppercase; }
.status { display: flex; gap: 8px; align-items: center; }
.status .light { width: 9px; height: 9px; border-radius: 50%; background: var(--mute); }
.status .light.ok { background: var(--good); }
.status .light.bad { background: var(--bad); }
.status .light.warn { background: var(--warn); }

/* ---- login ---- */
.login { max-width: 360px; margin: 0 auto; padding: 18vh 20px 40px; display: grid; gap: 14px; }
.login img { width: 44px; }
.login .err { color: var(--bad); font-size: 14px; }

/* ---- dialog & toast ---- */
.dlg { background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--r); padding: 0; width: min(520px, calc(100vw - 32px)); }
.dlg::backdrop { background: rgba(0, 0, 0, .6); }
.dlg-form { padding: 18px; display: grid; gap: 12px; }
.dlg-form p { margin: 0; }
.dlg-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
#toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translate(-50%, 20px); opacity: 0; transition: .2s; background: var(--panel-3); border: 1px solid var(--line-2); padding: 10px 16px; border-radius: 99px; z-index: 100; pointer-events: none; font-size: 14px; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { border-color: var(--bad); color: var(--bad); }
@media (max-width: 899px) { #toast { bottom: calc(84px + var(--safe-b)); } }
