/* Strat CMS. Palette and type from strategyedge.co.za: navy, sky and teal on paper. */
:root {
  --night: #06101f;
  --navy: #0b1e38;
  --navy-2: #12294a;
  --navy-3: #1b365e;
  --ink: #0e1b2c;
  --ink-2: #3a4a5e;
  --ink-3: #5a6a7e;
  --paper: #f3f6fa;
  --line: #d9e0ea;
  --white: #ffffff;
  --blue: #2f6bff;
  --blue-deep: #1f4fd6;
  --sky: #9dbcff;
  --sky-soft: #e8efff;
  --teal: #2dd4bf;
  --teal-deep: #0f9f8f;
  --teal-soft: #dcfaf5;
  --amber: #b45309;
  --amber-soft: #fff4e0;
  --red: #c2273a;
  --red-soft: #fdecee;
  --on-dark: #e8eef8;
  --on-dark-2: #b4c2d6;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --r-sm: 6px;
  --r: 12px;
  --shadow: 0 1px 2px rgba(11, 30, 56, 0.06), 0 4px 16px rgba(11, 30, 56, 0.06);
  --rail: 248px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.5 var(--display); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
a { color: var(--blue-deep); }
button, input, select, textarea { font: inherit; color: inherit; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--white); padding: 8px 12px; z-index: 100; border-radius: var(--r-sm); }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.ic { width: 20px; height: 20px; flex: none; }
.ic-sm { width: 16px; height: 16px; }
.ic-xl { width: 40px; height: 40px; color: var(--teal-deep); }
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--ink-3); }

/* ---------------- layout */
.layout { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }
.rail { background: var(--navy); color: var(--on-dark); display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.rail::after { content: ""; position: absolute; inset: auto 0 0 0; height: 220px; background: radial-gradient(circle at 0 100%, rgba(45, 212, 191, 0.16), transparent 70%); pointer-events: none; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--white); text-decoration: none; padding: 4px 8px 22px; }
.brand img { border-radius: 8px; }
.brand-word { display: flex; flex-direction: column; line-height: 1.1; }
.brand-word b { font-weight: 800; letter-spacing: 0.12em; font-size: 15px; }
.brand-word small { font-size: 10px; letter-spacing: 0.14em; color: var(--on-dark-2); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; color: var(--on-dark-2); text-decoration: none; font-weight: 600; position: relative; }
.nav-link:hover { background: var(--navy-2); color: var(--white); }
.nav-link.active { background: var(--navy-3); color: var(--white); }
.nav-link.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--teal); }
.badge { margin-left: auto; background: var(--teal); color: var(--night); font-size: 12px; min-width: 22px; padding: 1px 7px; border-radius: 999px; text-align: center; }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid rgba(157, 188, 255, 0.18); position: relative; z-index: 1; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: var(--white); font-weight: 800; }
.me-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.me-text b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { color: var(--on-dark-2); font-size: 12px; }
.me .icon-btn { margin-left: auto; color: var(--on-dark-2); }
.workspace { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 18px 32px; background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; min-height: 72px; }
.page-title { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; margin: 0; margin-right: auto; }
.main { padding: 24px 32px 48px; min-width: 0; }
.tabbar { display: none; }
.icon-btn.only-phone, .only-phone { display: none; }

/* ---------------- controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 8px; padding: 9px 16px; font-weight: 700; cursor: pointer; text-decoration: none; line-height: 1.2; min-height: 40px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover:not([disabled]) { background: var(--blue-deep); }
.btn-ghost { background: var(--white); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover:not([disabled]) { border-color: var(--sky); background: var(--sky-soft); }
.btn-quiet { background: transparent; color: var(--ink-2); padding: 6px 10px; min-height: 32px; }
.btn-quiet:hover { color: var(--blue-deep); }
.btn-approve { background: var(--teal); color: var(--night); }
.btn-approve:hover:not([disabled]) { background: #22bfa9; }
.btn-deny { background: var(--white); color: var(--red); border-color: #f2b8c0; }
.btn-deny:hover:not([disabled]) { background: var(--red-soft); }
.btn-lg { padding: 13px 20px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 12px; }
.icon-btn { background: transparent; border: 0; padding: 6px; border-radius: 8px; cursor: pointer; display: inline-grid; place-items: center; color: var(--ink-2); }
.icon-btn:hover { background: rgba(157, 188, 255, 0.18); }
input[type="text"], input[type="email"], input[type="search"], input[type="date"], input[type="datetime-local"], textarea, .select {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; background: var(--white); min-height: 40px;
}
input:focus, textarea:focus, .select:focus { border-color: var(--blue); outline: 2px solid rgba(47, 107, 255, 0.18); }
input[disabled], textarea[disabled], select[disabled] { background: var(--paper); color: var(--ink-2); }
textarea { resize: vertical; line-height: 1.5; }
textarea.code { font: 13px/1.55 ui-monospace, "Cascadia Code", Consolas, monospace; }
.text-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--white); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 13px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; min-height: 34px; }
.chip:hover { border-color: var(--sky); }
.chip.on { background: var(--navy); color: var(--white); border-color: var(--navy); }
.filters { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.filters .select { width: auto; min-width: 170px; }
.search-wrap { position: relative; flex: 0 1 320px; display: flex; align-items: center; }
.search-wrap .ic { position: absolute; left: 12px; color: var(--ink-3); }
.search { padding-left: 36px !important; }
.fine { font-size: 13px; color: var(--ink-3); margin: 4px 0; }
.warn { color: var(--amber); }
.muted { color: var(--ink-3); }
code { font: 12.5px ui-monospace, Consolas, monospace; background: var(--paper); padding: 1px 6px; border-radius: 4px; }

/* ---------------- status and channels */
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.01em; white-space: nowrap; }
.pill.st-draft { background: #eef1f6; color: var(--ink-2); }
.pill.st-in_review { background: var(--sky-soft); color: var(--blue-deep); }
.pill.st-changes_requested { background: var(--amber-soft); color: var(--amber); }
.pill.st-approved { background: var(--teal-soft); color: var(--teal-deep); }
.pill.st-scheduled, .pill.st-publishing { background: #e3ecff; color: var(--blue-deep); }
.pill.st-published { background: var(--teal); color: var(--night); }
.pill.st-failed { background: var(--red-soft); color: var(--red); }
.pill.st-archived { background: #eceff3; color: var(--ink-3); }
.ch { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.ch .ic { color: var(--blue); }
.ch-linkedin .ic { color: #0a66c2; }
.ch-instagram .ic { color: #c13584; }
.ch-youtube .ic { color: #e62117; }
.ver { font: 600 12px ui-monospace, Consolas, monospace; color: var(--ink-3); background: var(--paper); border-radius: 6px; padding: 1px 6px; }

/* ---------------- board */
.board { display: grid; grid-template-columns: repeat(6, minmax(160px, 1fr)); gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.col { background: #e9eef5; border-radius: var(--r); padding: 12px; min-height: 160px; }
.col-head { display: flex; align-items: center; justify-content: space-between; }
.col-head h2 { font-size: 14px; font-weight: 800; margin: 0; letter-spacing: 0.01em; }
.count { font: 700 12px var(--display); color: var(--ink-3); background: var(--white); border-radius: 999px; padding: 1px 8px; }
.col-hint { font-size: 12px; color: var(--ink-3); margin: 2px 0 10px; }
.col-review { background: #e6edff; }
.col-attention { background: #fbf0e3; }
.col-published { background: #dff6f1; }
.col-body { display: flex; flex-direction: column; gap: 10px; }
.card-item { display: block; background: var(--white); border-radius: 10px; padding: 12px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); border: 1px solid transparent; border-left: 4px solid var(--line); }
.card-item:hover { border-color: var(--sky); border-left-color: var(--blue); }
.card-item.st-in_review { border-left-color: var(--blue); }
.card-item.st-approved, .card-item.st-published { border-left-color: var(--teal); }
.card-item.st-changes_requested { border-left-color: #f0a24b; }
.card-item.st-failed { border-left-color: var(--red); }
.card-item.st-scheduled, .card-item.st-publishing { border-left-color: var(--sky); }
.card-top { display: flex; justify-content: space-between; align-items: center; }
.card-title { font-size: 14px; font-weight: 700; line-height: 1.35; margin: 8px 0 6px; overflow-wrap: anywhere; }
.card-meta { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--ink-3); margin: 0; flex-wrap: wrap; }
.empty { font-size: 13px; color: var(--ink-3); text-align: center; padding: 18px 0; margin: 0; }
.empty-state { text-align: center; padding: 64px 16px; color: var(--ink-3); display: grid; justify-items: center; gap: 8px; }

/* ---------------- table */
.table-wrap { background: var(--white); border-radius: var(--r); box-shadow: var(--shadow); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); padding: 12px 16px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 16px; border-bottom: 1px solid #edf1f6; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.t-title a { font-weight: 700; color: var(--ink); text-decoration: none; display: block; }
.t-title a:hover { color: var(--blue-deep); }
.t-title small { color: var(--ink-3); font-size: 12px; }
.t-when { white-space: nowrap; color: var(--ink-2); }

/* ---------------- approvals list */
.approval-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-width: 860px; }
.approval-row { display: flex; align-items: center; gap: 14px; background: var(--white); padding: 14px 16px; border-radius: var(--r); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); }
.approval-row > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.approval-row small { color: var(--ink-3); }

/* ---------------- item */
.item { max-width: 1400px; }
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.item-head { margin-bottom: 14px; }
.item-title-row { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.item-title { font-size: 26px; line-height: 1.2; margin: 8px 0 4px; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.item-sub { color: var(--ink-3); font-size: 13px; margin: 0; overflow-wrap: anywhere; }
.next-step { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-radius: var(--r); background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--sky); margin-bottom: 16px; }
.next-step p { margin: 0; flex: 1; }
.next-step.st-approved, .next-step.st-published { border-left-color: var(--teal); }
.next-step.st-changes_requested { border-left-color: #f0a24b; background: #fffaf2; }
.next-step.st-failed { border-left-color: var(--red); background: #fff7f8; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; font-weight: 700; color: var(--ink-3); cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--navy); border-bottom-color: var(--teal); }
.edit-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.edit-col { min-width: 0; }
.editor { display: flex; flex-direction: column; gap: 14px; background: var(--white); padding: 20px; border-radius: var(--r); box-shadow: var(--shadow); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.field-hint, .count-hint { font-size: 12px; color: var(--ink-3); }
.count-hint.over, .field-hint.over { color: var(--red); font-weight: 700; }
.hero-thumb { display: block; max-width: 320px; width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line, #dde3ec); margin: 0 0 12px; }
.hero-thumb[hidden] { display: none; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sub { font-size: 14px; margin: 6px 0 0; }
.cards { display: flex; flex-direction: column; gap: 12px; }
.card-edit { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 14px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.card-edit legend { font-weight: 800; font-size: 13px; padding: 0 6px; display: flex; align-items: center; gap: 8px; }
.card-tools { display: inline-flex; }
.save-bar { position: sticky; bottom: 0; display: flex; gap: 12px; align-items: center; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; margin-top: 12px; box-shadow: 0 -6px 20px rgba(11, 30, 56, 0.06); }
.save-bar input { flex: 1; }
.save-state { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.save-state.dirty { color: var(--amber); font-weight: 700; }
.side-preview { position: sticky; top: 92px; }
.preview-box { display: flex; flex-direction: column; gap: 8px; }
.preview-frame { width: 100%; height: calc(100vh - 220px); min-height: 520px; border: 1px solid var(--line); border-radius: var(--r); background: var(--white); box-shadow: var(--shadow); }
.preview-box.device-phone { align-items: center; }
.preview-box.device-phone .preview-frame { width: 390px; max-width: 100%; height: 760px; border-radius: 28px; border: 10px solid var(--navy); }
.preview-tools { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.preview-tools .select { width: auto; min-width: 280px; }
.review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; max-width: 1100px; }
.panel { background: var(--white); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.panel h3 { margin: 0; font-size: 16px; }
.panel p { margin: 0; }
.hash code { word-break: break-all; }
.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.mono { font: 12.5px ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.danger-zone { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.history-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.history-grid > div { display: grid; gap: 16px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.tl { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding-bottom: 16px; position: relative; }
.tl::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 2px; background: var(--line); }
.tl:last-child::before { display: none; }
.tl-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--sky); margin-top: 4px; border: 3px solid var(--white); box-shadow: 0 0 0 1px var(--line); }
.tl-decision .tl-dot, .tl-publication .tl-dot { background: var(--teal); }
.tl-comment .tl-dot { background: #f0a24b; }
.tl b { display: block; }
.tl small { color: var(--ink-3); }
.tl-detail { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.versions { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.versions li { display: grid; grid-template-columns: 40px 1fr auto auto; gap: 10px; align-items: center; font-size: 13px; }
.comment { border-top: 1px solid #edf1f6; padding-top: 8px; }
.comment p { margin: 4px 0 0; white-space: pre-wrap; }
.loading { color: var(--ink-3); padding: 40px 0; }

/* ---------------- dialog */
.dialog { border: 0; border-radius: 16px; padding: 0; width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 30px 80px rgba(6, 16, 31, 0.35); }
.dialog::backdrop { background: rgba(6, 16, 31, 0.55); }
.dialog form { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px; max-height: calc(100vh - 32px); overflow-y: auto; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
.dialog-head h2 { margin: 0; font-size: 20px; }
.dialog-body .editor { box-shadow: none; padding: 0; }
.dialog-foot { display: flex; gap: 10px; justify-content: flex-end; position: sticky; bottom: -20px; background: var(--white); padding: 12px 0 0; }

/* ---------------- login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 85% 10%, rgba(47, 107, 255, 0.35), transparent 45%), radial-gradient(circle at 0% 100%, rgba(45, 212, 191, 0.18), transparent 45%), var(--night); }
.login-card { width: min(420px, 100%); background: var(--white); border-radius: 18px; padding: 32px; display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35); }
.login-card h1 { margin: 0; font-size: 28px; letter-spacing: 0.04em; }
.dev-login { width: 100%; display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; text-align: left; }

/* ---------------- toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 1000; max-width: min(420px, calc(100vw - 40px)); }
.toast { background: var(--navy); color: var(--white); padding: 12px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(6, 16, 31, 0.3); font-weight: 600; font-size: 14px; border-left: 4px solid var(--sky); transition: opacity 0.4s, transform 0.4s; }
.toast-ok { border-left-color: var(--teal); }
.toast-error { border-left-color: #ff6b7d; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------------- tablet */
@media (max-width: 1200px) {
  .edit-grid { grid-template-columns: 1fr; }
  .side-preview { position: static; }
}
@media (max-width: 1100px) and (min-width: 761px) {
  .board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------------- phone */
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .rail { display: none; }
  .topbar { padding: 12px 16px; min-height: 60px; gap: 10px; }
  .page-title { font-size: 19px; }
  .main { padding: 16px 16px 96px; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; background: var(--navy); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 20; }
  .tabbar .nav-link { flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 11px; color: var(--on-dark-2); justify-content: center; }
  .tabbar .nav-link.active { background: transparent; color: var(--teal); }
  .tabbar .nav-link.active::before { display: none; }
  .tabbar .badge { position: absolute; top: 2px; right: calc(50% - 26px); margin: 0; font-size: 10px; min-width: 18px; padding: 0 5px; }
  .filters { gap: 8px; }
  .search-wrap { flex: 1 1 100%; }
  .filters .select { flex: 1 1 100%; }
  .chips { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 2px; }
  .chip { flex: none; }
  .board { grid-template-columns: 1fr; gap: 10px; overflow: visible; }
  .col { min-height: 0; }
  .col.is-empty .col-body, .col.is-empty .col-hint { display: none; }
  .col.is-empty { padding: 10px 12px; opacity: 0.8; }
  .table th:nth-child(4), .table td:nth-child(4), .table th:nth-child(5), .table td:nth-child(5) { display: none; }
  .table td, .table th { padding: 10px 12px; }
  .item-title { font-size: 21px; }
  .next-step { flex-direction: column; align-items: stretch; }
  .tab { padding: 10px; }
  .tab span { font-size: 13px; }
  .row2 { grid-template-columns: 1fr; }
  .editor { padding: 14px; }
  .save-bar { flex-wrap: wrap; bottom: 72px; }
  .save-bar input { flex: 1 1 100%; }
  .save-bar .btn { flex: 1; }
  .review-grid, .history-grid { grid-template-columns: 1fr; }
  .preview-frame { height: 70vh; min-height: 420px; }
  .preview-tools .select { min-width: 0; flex: 1 1 100%; }
  .versions li { grid-template-columns: 34px 1fr auto; }
  .versions li code { display: none; }
  .toasts { right: 12px; left: 12px; bottom: 84px; max-width: none; }
  .btn-row .btn { flex: 1; }
  .topbar .btn span { display: none; }
  .icon-btn.only-phone, .only-phone { display: inline-grid; }
}
