/* ==========================================================================
   SocialFlow — "Transmission Desk"

   The reference is a broadcast playout log: a station's running order for the
   day, where every item has a time, a destination and a state. Times are set
   in a mono face because they are read down a column, not across a sentence.
   Ink navy carries structure; amber marks anything still to go out; green
   means it went. Platform colour appears only in small chips, so a page with
   four networks on it does not turn into a paint box.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700&family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  --ink:        #16233A;
  --ink-soft:   #33445F;
  --ink-faint:  #6B7A93;
  --paper:      #EEF0F3;
  --surface:    #FFFFFF;
  --line:       #D9DEE5;
  --line-soft:  #E8EBEF;

  --signal:     #D98A1F;   /* queued / scheduled */
  --signal-bg:  #FDF3E3;
  --live:       #17795A;   /* published */
  --live-bg:    #E4F2ED;
  --fault:      #B23A32;   /* failed */
  --fault-bg:   #FBEAE8;

  --yt: #FF0033;  --fb: #1877F2;  --ig: #E1306C;  --tt: #111111;

  --r-sm: 3px; --r-md: 5px; --r-lg: 8px;
  --sp: 8px;
  --shadow: 0 1px 2px rgba(22,35,58,.06), 0 4px 16px rgba(22,35,58,.05);
  --rail: 236px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  font-size: 15px; line-height: 1.55;
  color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--signal); }

h1, h2, h3, h4 { font-family: 'Archivo', sans-serif; margin: 0; letter-spacing: -0.015em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }

.mono, time, .job-time, .kbd { font-family: 'IBM Plex Mono', monospace; font-variant-numeric: tabular-nums; }

.eyebrow {
  font-family: 'Archivo', sans-serif; font-size: 10.5px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint);
}

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.rail {
  width: var(--rail); flex: 0 0 var(--rail); background: var(--ink); color: #C8D2E2;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.rail-brand { padding: 22px 20px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.rail-brand .mark {
  font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 19px;
  color: #fff; letter-spacing: -.02em; display: flex; align-items: center; gap: 9px;
}
.rail-brand .mark::before {
  content: ''; width: 9px; height: 9px; border-radius: 50%;
  background: var(--signal); box-shadow: 0 0 0 3px rgba(217,138,31,.22);
}
.rail-brand .sub { font-size: 11px; color: #7C8CA6; margin-top: 3px; letter-spacing: .02em; }

.rail-nav { padding: 14px 10px; flex: 1; overflow-y: auto; }
.rail-nav .group { padding: 14px 10px 6px; }
.rail-nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 11px; margin-bottom: 1px;
  border-radius: var(--r-md); color: #C8D2E2; text-decoration: none; font-size: 14px;
  transition: background .12s, color .12s;
}
.rail-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.rail-nav a.on { background: rgba(255,255,255,.1); color: #fff; font-weight: 500; }
.rail-nav a.on svg { color: var(--signal); }
.rail-nav svg { width: 16px; height: 16px; flex: 0 0 16px; opacity: .85; }

.rail-foot { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; }
.rail-foot .who { color: #fff; font-weight: 500; }
.rail-foot .lic { color: #7C8CA6; margin-top: 2px; }
.rail-foot form { margin-top: 10px; }
.rail-foot button {
  background: none; border: 1px solid rgba(255,255,255,.18); color: #C8D2E2;
  padding: 5px 10px; border-radius: var(--r-sm); font: inherit; font-size: 12px; cursor: pointer;
}
.rail-foot button:hover { background: rgba(255,255,255,.08); color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 16px 30px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.topbar .lede { color: var(--ink-faint); font-size: 13px; margin-top: 2px; }
.content { flex: 1; padding: 26px 30px 40px; max-width: 1240px; width: 100%; }

/* ---------- footer ---------- */
.site-foot {
  border-top: 1px solid var(--line); background: var(--surface);
  padding: 18px 30px; display: flex; flex-wrap: wrap; gap: 6px 22px;
  align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--ink-faint);
}
.site-foot strong { color: var(--ink); font-weight: 600; }
.site-foot .links { display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------- cards & tables ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow); margin-bottom: 18px;
}
.card-head {
  padding: 14px 18px; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }

.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; padding: 9px 18px; font-family: 'Archivo', sans-serif; font-size: 10.5px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint);
  border-bottom: 1px solid var(--line); background: #FAFBFC;
}
td { padding: 12px 18px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #FBFCFD; }

/* ---------- stat tiles ---------- */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; }
.stat .n { font-family: 'Archivo', sans-serif; font-size: 30px; font-weight: 700; line-height: 1.05; }
.stat .k { margin-top: 4px; }
.stat.alert .n { color: var(--fault); }
.stat.queued .n { color: var(--signal); }
.stat.live .n { color: var(--live); }

/* ---------- chips & states ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 20px;
  font-size: 11.5px; font-weight: 500; border: 1px solid var(--line); background: #fff; white-space: nowrap;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }
.chip.youtube   .dot { background: var(--yt); }
.chip.facebook  .dot { background: var(--fb); }
.chip.instagram .dot { background: var(--ig); }
.chip.tiktok    .dot { background: var(--tt); }

.state { display: inline-block; padding: 2px 9px; border-radius: var(--r-sm); font-size: 11.5px; font-weight: 600; }
.state.queued        { background: var(--signal-bg); color: var(--signal); }
.state.uploading,
.state.processing    { background: #E9EFF9; color: #2C5AA8; }
.state.published     { background: var(--live-bg); color: var(--live); }
.state.failed,
.state.preflight_failed { background: var(--fault-bg); color: var(--fault); }
.state.cancelled     { background: #EFEFF1; color: var(--ink-faint); }

/* ---------- forms ---------- */
label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 5px; }
.hint { font-size: 12.5px; color: var(--ink-faint); margin-top: 5px; line-height: 1.5; }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=time], input[type=url], input[type=number], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r-md);
  font: inherit; font-size: 14px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(217,138,31,.35); outline-offset: 1px; border-color: var(--signal);
}
textarea { resize: vertical; min-height: 88px; }
.field { margin-bottom: 16px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 180px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--r-md); border: 1px solid var(--ink);
  background: var(--ink); color: #fff; font: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer; text-decoration: none; transition: background .12s, transform .06s;
}
.btn:hover { background: var(--ink-soft); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: #F6F7F9; border-color: var(--ink-faint); }
.btn.danger { background: #fff; color: var(--fault); border-color: #E7C4C0; }
.btn.danger:hover { background: var(--fault-bg); }
.btn.sm { padding: 5px 11px; font-size: 12.5px; }
.btn svg { width: 15px; height: 15px; }

.check { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 9px; font-size: 14px; }
.check input { margin-top: 3px; flex: 0 0 auto; width: auto; }
.check label { margin: 0; font-weight: 400; }

/* ---------- notices ---------- */
.notice {
  padding: 12px 16px; border-radius: var(--r-md); margin-bottom: 16px; font-size: 14px;
  border: 1px solid; display: flex; gap: 10px; align-items: flex-start;
}
.notice.success { background: var(--live-bg); border-color: #B9DCD0; color: #10583F; }
.notice.error   { background: var(--fault-bg); border-color: #E7C4C0; color: #8E2B24; }
.notice.warn    { background: var(--signal-bg); border-color: #EBD3A6; color: #8A5610; }
.notice.info    { background: #EDF2FA; border-color: #C6D6EE; color: #24487F; }

/* ---------- the transmission board (signature) ---------- */
.board { display: flex; gap: 0; overflow-x: auto; border-radius: var(--r-lg);
         border: 1px solid var(--line); background: var(--surface); }
.board-day { flex: 1 0 168px; border-right: 1px solid var(--line-soft); min-height: 460px; }
.board-day:last-child { border-right: none; }
.board-day.today { background: #FCFAF5; }
.board-day-head {
  padding: 10px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0;
  background: #FAFBFC; z-index: 1;
}
.board-day.today .board-day-head { background: var(--signal-bg); }
.board-day-head .d { font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 13px; }
.board-day-head .m { font-size: 11px; color: var(--ink-faint); }
.board-slots { padding: 8px; display: flex; flex-direction: column; gap: 7px; }

.slot {
  border-left: 3px solid var(--signal); background: #FCFCFD; border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 7px 9px; font-size: 12.5px; border-top: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
}
.slot.published { border-left-color: var(--live); }
.slot.failed, .slot.preflight_failed { border-left-color: var(--fault); }
.slot.cancelled { border-left-color: #C3C7CE; opacity: .6; }
.slot .job-time { font-size: 12px; font-weight: 600; color: var(--ink); }
.slot .t { margin: 3px 0; line-height: 1.35; word-break: break-word; }
.slot .who { color: var(--ink-faint); font-size: 11.5px; }
.board-empty { padding: 14px 12px; color: #B4BBC6; font-size: 12px; }

/* ---------- misc ---------- */
.avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: var(--paper); }
.stack { display: flex; align-items: center; gap: 9px; }
.muted { color: var(--ink-faint); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.empty { text-align: center; padding: 46px 20px; color: var(--ink-faint); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.copybox {
  display: flex; gap: 8px; align-items: center; background: #F7F8FA;
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 10px;
}
.copybox code { font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; flex: 1; word-break: break-all; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; padding: 0 0 16px 38px; position: relative; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 25px; height: 25px;
  border-radius: 50%; background: var(--ink); color: #fff; font-family: 'IBM Plex Mono', monospace;
  font-size: 12px; display: flex; align-items: center; justify-content: center; font-weight: 600;
}
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a {
  padding: 8px 14px; text-decoration: none; font-size: 14px; color: var(--ink-faint);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a.on { color: var(--ink); border-bottom-color: var(--signal); font-weight: 500; }

.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 30px 20px; background: var(--ink); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface);
             border-radius: var(--r-lg); padding: 30px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.auth-card .mark { font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 21px;
                   display: flex; align-items: center; gap: 9px; margin-bottom: 4px; }
.auth-card .mark::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--signal); }
.auth-foot { text-align: center; margin-top: 20px; color: #7C8CA6; font-size: 12.5px; }
.auth-foot a { color: #C8D2E2; }

.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.plan { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; background: var(--surface); }
.plan.featured { border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-bg); }
.plan .price { font-family: 'Archivo', sans-serif; font-size: 21px; font-weight: 700; margin: 6px 0 12px; }
.plan ul { padding-left: 18px; margin: 12px 0; font-size: 13.5px; color: var(--ink-soft); }
.plan li { margin-bottom: 5px; }

.bar { height: 7px; background: var(--line-soft); border-radius: 4px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--signal); }

@media (max-width: 980px) {
  .g4, .g3, .plan-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .rail { width: 100%; height: auto; position: static; flex: none; }
  .rail-nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .rail-nav .group { display: none; }
  .rail-nav a { padding: 7px 10px; }
  .content, .topbar, .site-foot { padding-left: 16px; padding-right: 16px; }
  .g2, .g3, .g4, .plan-grid { grid-template-columns: 1fr; }
  .row > * { min-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
