:root {
  color-scheme: dark;
  --bg: #070b12;
  --panel: #101722;
  --panel-soft: #151f2d;
  --line: #263344;
  --ink: #edf4ff;
  --muted: #93a4b8;
  --blue: #3b82f6;
  --blue-dark: #2563eb;
  --yellow: #facc15;
  --green: #22c55e;
  --red: #ef4444;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.18), transparent 34rem), linear-gradient(135deg, #070b12 0%, #0c111b 52%, #090d14 100%);
  color: var(--ink);
}

button, input, textarea, select { font: inherit; }

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

button:hover { transform: translateY(-1px); }
button:disabled { cursor: wait; opacity: 0.62; transform: none; }

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b111a;
  color: var(--ink);
  padding: 10px 12px;
}

textarea { resize: vertical; line-height: 1.5; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 0.86rem; font-weight: 800; }

.shell {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 40px) 48px;
}

.hero, .auth-panel, .pipeline-controls, .calendar-section, .drafts-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 23, 34, 0.86);
  box-shadow: var(--shadow);
}

.hero, .auth-panel {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 28px;
}

.auth-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; width: min(440px, 100%); }
.hidden { display: none !important; }

.eyebrow {
  margin: 0 0 8px;
  color: #79b7ff;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(2.3rem, 8vw, 5rem); line-height: 0.95; }
h2 { margin-bottom: 0; font-size: clamp(1.4rem, 3vw, 2rem); }

.summary {
  max-width: 640px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.primary-action { min-width: 190px; background: var(--blue); color: #fff; }
.primary-action:hover { background: var(--blue-dark); }
.ghost-action, .filter, .delete-button { border: 1px solid var(--line); background: transparent; color: var(--ink); }

.toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.metric {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 31, 45, 0.82);
}

.metric span { display: block; margin-bottom: 6px; font-size: 2rem; font-weight: 900; }
.metric p { margin-bottom: 0; color: var(--muted); }
.metric.review span { color: var(--yellow); }
.metric.approved span { color: var(--green); }
.metric.rejected span { color: var(--red); }

.pipeline-controls {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 18px;
  padding: 20px;
  margin-bottom: 18px;
}

.filter-row, .chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter.active, .chip {
  background: rgba(59, 130, 246, 0.16);
  color: #bfdbfe;
  border: 1px solid rgba(59, 130, 246, 0.42);
}

.chip { min-height: 36px; font-size: 0.86rem; }

.calendar-section, .drafts-section { padding: 22px; margin-top: 18px; }

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.calendar-lane {
  min-height: 130px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 31, 45, 0.58);
  padding: 12px;
}

.calendar-lane h3 { margin-bottom: 10px; font-size: 0.95rem; }
.calendar-item { margin: 0 0 8px; color: #c7d3e1; font-size: 0.88rem; line-height: 1.35; }

.draft-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.draft-card {
  display: flex;
  min-height: 360px;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.draft-type {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.status-badge {
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(147, 164, 184, 0.14);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.status-badge.needs-review { background: rgba(250, 204, 21, 0.14); color: var(--yellow); }
.status-badge.approved { background: rgba(34, 197, 94, 0.14); color: var(--green); }
.status-badge.rejected { background: rgba(239, 68, 68, 0.14); color: var(--red); }

.draft-title { margin-bottom: 0; font-size: 1.2rem; line-height: 1.25; }
.draft-date, .draft-meta { color: var(--muted); font-size: 0.88rem; }
.draft-preview { margin-bottom: 0; color: #c7d3e1; line-height: 1.55; }

.editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.editor summary {
  cursor: pointer;
  color: #bfdbfe;
  font-weight: 900;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.wide { grid-column: 1 / -1; }

.checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.checklist label {
  grid-template-columns: auto 1fr;
  align-items: center;
  color: #c7d3e1;
}

.checklist input { width: auto; }

.card-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.save-button { background: var(--blue); color: #fff; }
.approve-button, .publish-button { background: var(--green); color: #04130a; }
.reject-button { background: var(--red); color: #fff; }

.empty-state, .error-state {
  grid-column: 1 / -1;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.error-state { color: #fca5a5; }

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: min(380px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111827;
  color: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: 160ms ease;
}

.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  .hero, .auth-panel, .section-head { align-items: stretch; flex-direction: column; }
  .toolbar, .pipeline-controls, .calendar-grid, .draft-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .shell { padding-top: 16px; }
  .hero, .auth-panel, .calendar-section, .drafts-section { padding: 18px; }
  .toolbar, .pipeline-controls, .calendar-grid, .draft-grid, .form-grid, .checklist, .card-actions, .auth-form { grid-template-columns: 1fr; }
  .primary-action, .ghost-action { width: 100%; }
}
