:root {
  --primary: #06279E;
  --navy: #101B37;
  --navy-2: #172448;
  --impact: #00C2FF;
  --impact-dim: rgba(0, 194, 255, 0.16);
  --paper: #F4F6FB;
  --card: #FFFFFF;
  --ink: #101B37;
  --muted: #5B657A;
  --line: #E3E8F3;
  --ok: #0F9D6B;
  --warn: #C47B00;
  --bad: #C0364A;
  --shadow: 0 18px 40px rgba(16, 27, 55, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Manrope, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

h1, h2, h3, .brand, .nav-title, .metric-value, .status-pill {
  font-family: Sora, Manrope, sans-serif;
}

.app { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }

.sidebar {
  background: linear-gradient(180deg, var(--navy) 0%, #0B142C 100%);
  color: #fff;
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.brand { display: flex; flex-direction: column; gap: 4px; padding: 0 8px; }
.brand strong { font-size: 22px; letter-spacing: -0.03em; }
.brand span { color: var(--impact); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav button {
  appearance: none; border: 0; background: transparent; color: #D7DEF0;
  text-align: left; padding: 12px 14px; border-radius: 12px; cursor: pointer;
  font: 600 14px/1.2 Manrope, sans-serif;
}
.nav button:hover { background: rgba(255,255,255,0.06); }
.nav button.active { background: var(--impact-dim); color: #fff; box-shadow: inset 0 0 0 1px rgba(0,194,255,0.35); }
.sidebar-foot { margin-top: auto; color: #8B95B0; font-size: 12px; padding: 0 8px; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 32px; background: #fff; border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-size: 22px; letter-spacing: -0.03em; }
.topbar p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.chips { display: flex; gap: 8px; align-items: center; }
.chip {
  background: #EEF2FB; color: var(--navy); border-radius: 999px;
  padding: 6px 10px; font-size: 12px; font-weight: 700;
}
.chip.cyan { background: var(--impact-dim); color: var(--primary); }

.content { padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 22px; }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.metric, .card {
  background: var(--card); border-radius: 18px; box-shadow: var(--shadow);
  border: 1px solid #EEF1F8;
}
.metric { padding: 18px 18px 16px; }
.metric label { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.metric-value { display: block; margin-top: 6px; font-size: 28px; letter-spacing: -0.04em; }
.metric small { color: var(--muted); font-size: 12px; }

.queue { display: flex; flex-direction: column; gap: 14px; }
.item {
  display: grid; grid-template-columns: 148px 1fr auto; gap: 18px;
  padding: 16px; align-items: start;
}
.preview {
  width: 148px; height: 198px; border-radius: 14px; overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(0,194,255,0.45), transparent 40%),
    linear-gradient(160deg, var(--primary), var(--navy));
  color: #fff; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 12px; font-size: 12px; font-weight: 700;
}
.preview.static { background: linear-gradient(160deg, #0833C4, #00C2FF); }
.preview.story { aspect-ratio: 9/16; height: 198px; }
.item h3 { margin: 0 0 6px; font-size: 18px; letter-spacing: -0.03em; }
.meta { color: var(--muted); font-size: 13px; display: flex; gap: 10px; flex-wrap: wrap; }
.caption { margin: 12px 0 0; font-size: 14px; white-space: pre-wrap; color: #243049; max-width: 70ch; }
.actions { display: flex; flex-direction: column; gap: 8px; min-width: 140px; }
button.btn {
  appearance: none; border: 0; border-radius: 12px; padding: 10px 14px;
  font: 700 13px/1 Sora, sans-serif; cursor: pointer;
}
.btn.approve { background: var(--ok); color: #fff; }
.btn.adjust { background: #F3E6C8; color: #7A4D00; }
.btn.reject { background: #F8D7DC; color: var(--bad); }
.btn.ghost { background: #EEF2FB; color: var(--navy); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.status-pill {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: 4px 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
}
.st-pending_approval, .st-draft { background: #E8EEFF; color: var(--primary); }
.st-approved, .st-scheduled, .st-published, .st-promoted { background: #D9F3E8; color: #0B7A54; }
.st-changes_requested { background: #F8E7C3; color: #8A5600; }
.st-rejected { background: #F8D7DC; color: var(--bad); }

.story-grid, .reel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.beat, .reel { padding: 16px; }
.beat b, .reel b { display: block; margin-bottom: 8px; }
.copy {
  background: #F7F9FD; border: 1px dashed #CDD6EA; border-radius: 12px;
  padding: 10px 12px; font-size: 14px; white-space: pre-wrap; margin: 8px 0 12px;
}
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters button { background: #fff; border: 1px solid var(--line); }
.filters button.active { border-color: var(--impact); background: var(--impact-dim); }

.calendar { display: grid; gap: 10px; }
.day-row { padding: 14px 16px; }
.day-row h3 { margin: 0 0 8px; font-size: 15px; }
.day-row ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.day-row li { display: flex; gap: 10px; font-size: 14px; align-items: center; }

.note {
  background: #F3F7FF; border-left: 3px solid var(--impact);
  padding: 12px 14px; border-radius: 0 12px 12px 0; color: #243049; font-size: 13px;
}
.empty { color: var(--muted); padding: 28px; text-align: center; }

dialog { border: 0; border-radius: 18px; padding: 0; width: min(480px, 92vw); box-shadow: var(--shadow); }
dialog form { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
dialog h3 { margin: 0; }
dialog textarea { min-height: 110px; border-radius: 12px; border: 1px solid var(--line); padding: 10px; font: 14px Manrope, sans-serif; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; align-items: center; padding: 16px; gap: 16px; }
  .nav { flex-direction: row; overflow: auto; }
  .cards, .item { grid-template-columns: 1fr; }
  .preview { width: 100%; height: 160px; }
  .sidebar-foot { display: none; }
}


body.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(0,194,255,0.18), transparent 55%),
    linear-gradient(180deg, #0B142C 0%, var(--navy) 55%, #07101F 100%);
}
.login-card {
  width: min(440px, calc(100vw - 32px));
  background: #fff;
  border-radius: 24px;
  padding: 36px 32px 32px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.28);
}
.login-card .brand { margin-bottom: 28px; }
.login-card .brand strong { color: var(--navy); }
.login-card h1 { margin: 0 0 8px; font-size: 26px; letter-spacing: -0.04em; }
.login-card p { margin: 0 0 24px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.login-card a.btn.google {
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; background: var(--primary); color: #fff;
  border-radius: 14px; padding: 14px 16px; font-weight: 700;
}
.login-card a.btn.google:hover { filter: brightness(1.08); }
.login-error { color: var(--bad) !important; font-weight: 700; }
