/* ============================================================
   DS Pheme — styles. Eos design tokens (FRONTEND.md):
   Crimson #8B1A3C · Gold #F5A800 · ink #1A1A1A · muted #7a7068
   border #e0dbd9 · surface #f8f6f4 · DM Sans / DM Mono
   ============================================================ */
:root {
  --crimson: #8B1A3C; --crimson-deep: #6d142f; --gold: #F5A800;
  --ink: #1A1A1A; --muted: #7a7068; --border: #e0dbd9; --surface: #f8f6f4;
  --card: #ffffff;
  --green: #2e7d52; --green-bg: #eaf3de;
  --amber: #ba7517; --amber-bg: #faeeda;
  --red: #a32d2d;   --red-bg: #fcebeb;
  --blue: #185fa5;  --blue-bg: #e6f1fb;
  --shadow: 0 2px 10px rgba(26,26,26,.06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  background: var(--surface); color: var(--ink); font-size: 14px; line-height: 1.5;
}
.mono { font-family: 'DM Mono', monospace; }
.gold { color: var(--gold); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
a { color: var(--crimson); }

/* ── Login gate ── */
.login-gate { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #4a0e21, var(--crimson) 60%, #a92747); }
.login-card { background: var(--card); border-radius: 16px; padding: 44px 48px; text-align: center;
  box-shadow: 0 18px 50px rgba(0,0,0,.35); max-width: 400px; }
.login-logo { font-size: 40px; }
.login-card h1 { font-size: 26px; letter-spacing: .06em; margin: 8px 0 4px; color: var(--crimson); }
.login-card .btn { margin: 20px 0 12px; }

/* ── Layout ── */
#app { display: flex; min-height: 100vh; }
.sidebar { width: 216px; min-width: 216px; background: #2a0b17; color: #e8d8dd;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { padding: 18px 18px 14px; font-size: 16px; letter-spacing: .05em; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar nav { flex: 1; padding: 10px 0; }
.sidebar nav a { display: block; padding: 10px 18px; color: #d9c3cb; text-decoration: none; font-weight: 500; }
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active { background: var(--crimson); color: #fff; border-right: 3px solid var(--gold); }
.sidebar-foot { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-foot a { color: #d9c3cb; }
.main { flex: 1; padding: 26px 30px 70px; max-width: 1180px; }

/* ── Cards / headers ── */
.page-h { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 18px; flex-wrap: wrap; }
.page-h h1 { font-size: 21px; color: var(--crimson); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card h2 { font-size: 15px; margin-bottom: 10px; color: var(--crimson); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) {
  #app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .main { padding: 16px; }
}

/* ── Tables ── */
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: .5px solid var(--border); vertical-align: top; }
thead th { background: var(--crimson); color: #fff; font-weight: 500; font-size: 12px; }
tbody tr:hover { background: #faf5f2; }

/* ── Buttons / forms ── */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border);
  background: var(--card); color: var(--ink); border-radius: 9px; padding: 8px 14px; font-size: 13px;
  font-weight: 500; cursor: pointer; text-decoration: none; font-family: inherit; }
.btn:hover { border-color: var(--crimson); color: var(--crimson); }
.btn-primary { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.btn-primary:hover { background: var(--crimson-deep); color: #fff; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #3a2a00; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 7px; }
.btn-danger { color: var(--red); }
.btn-danger:hover { border-color: var(--red); }
.btn[disabled] { opacity: .5; cursor: default; }
label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin: 10px 0 4px; }
input[type=text], input[type=url], input[type=email], input[type=number],
input[type=datetime-local], input[type=date], select, textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
  font-size: 13px; font-family: inherit; background: #fff; color: var(--ink); }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--crimson); }

/* ── Pills / badges ── */
.pill { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 11.5px; font-weight: 500; }
.pill-draft     { background: var(--amber-bg); color: var(--amber); }
.pill-approved  { background: var(--blue-bg); color: var(--blue); }
.pill-scheduled { background: var(--green-bg); color: var(--green); }
.pill-published { background: #ece7f5; color: #5b3a8e; }
.pill-new { background: var(--blue-bg); color: var(--blue); }
.pill-packed { background: var(--green-bg); color: var(--green); }
.pill-dismissed { background: #eee; color: var(--muted); }
.score { display: inline-flex; align-items: center; justify-content: center; min-width: 38px;
  padding: 3px 7px; border-radius: 8px; font-family: 'DM Mono', monospace; font-weight: 500; font-size: 13px; }
.score-hi  { background: var(--green-bg); color: var(--green); }
.score-mid { background: var(--amber-bg); color: var(--amber); }
.score-lo  { background: #eee; color: var(--muted); }
.tag-chip { display: inline-block; background: #f3ecdf; color: #7a5a00; border-radius: 10px;
  padding: 2px 9px; margin: 2px 3px 2px 0; font-size: 12px; }
.tier-brand { background: #f6e3ea; color: var(--crimson); }
.tier-niche { background: var(--blue-bg); color: var(--blue); }
.tier-campaign { background: var(--green-bg); color: var(--green); }

/* ── Stories ── */
.story { display: flex; gap: 14px; padding: 14px 0; border-bottom: .5px solid var(--border); }
.story:last-child { border-bottom: none; }
.story .score { align-self: flex-start; margin-top: 2px; }
.story h3 { font-size: 14px; }
.story h3 a { color: var(--ink); text-decoration: none; }
.story h3 a:hover { color: var(--crimson); }
.story .angle { color: var(--crimson); font-size: 12.5px; margin-top: 3px; }
.story .actions { margin-top: 7px; display: flex; gap: 8px; }

/* ── Platform previews ── */
.pv-wrap { display: flex; justify-content: center; padding: 10px 0; }
.pv { width: 380px; max-width: 100%; border: 1px solid #d8d8d8; border-radius: 12px;
  background: #fff; overflow: hidden; font-size: 13.5px; box-shadow: 0 4px 18px rgba(0,0,0,.10); }
.pv-head { display: flex; align-items: center; gap: 9px; padding: 10px 12px; }
.pv-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--crimson); color: var(--gold);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; }
.pv-name { font-weight: 700; font-size: 13px; }
.pv-sub { color: #737373; font-size: 11.5px; }
.pv-img { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: #efe9e4 url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="60" height="60"%3E%3Ctext x="30" y="38" font-size="26" text-anchor="middle" opacity=".35"%3E%F0%9F%93%B7%3C/text%3E%3C/svg%3E') center no-repeat; display:block; }
.pv-img.wide { aspect-ratio: 1.91/1; }
.pv-body { padding: 10px 12px; white-space: pre-wrap; word-break: break-word; }
.pv-tags { color: #1877f2; }
.pv-x .pv-tags, .pv-x .pv-body a { color: #1d9bf0; }
.pv-li .pv-tags { color: #0a66c2; }
.pv-actions { display: flex; gap: 18px; padding: 8px 12px; color: #737373; border-top: 1px solid #f0f0f0; font-size: 15px; }
.pv-x { border-radius: 16px; }
.pv-li .pv-head { align-items: flex-start; }

/* ── Modal / toast ── */
.modal-back { position: fixed; inset: 0; background: rgba(26,26,26,.45); display: flex;
  align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 100; overflow-y: auto; }
.modal { background: var(--card); border-radius: 14px; padding: 22px; width: 640px; max-width: 100%; }
.modal h2 { color: var(--crimson); font-size: 17px; margin-bottom: 12px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.toast { position: fixed; bottom: 22px; right: 22px; background: var(--ink); color: #fff;
  padding: 11px 18px; border-radius: 10px; z-index: 200; box-shadow: 0 8px 24px rgba(0,0,0,.3);
  animation: toast-in .2s ease; max-width: 380px; }
.toast.err { background: var(--red); }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Misc ── */
.stat { text-align: center; padding: 16px 8px; }
.stat .n { font-family: 'DM Mono', monospace; font-size: 26px; color: var(--crimson); font-weight: 500; }
.stat .l { color: var(--muted); font-size: 12px; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { border: none; background: none; padding: 9px 16px; font: inherit; font-weight: 500;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tabs button.active { color: var(--crimson); border-bottom-color: var(--crimson); }
.hero-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.post-img-thumb { width: 100%; max-width: 240px; border-radius: 10px; border: 1px solid var(--border); display: block; }
.platform-ico { font-size: 15px; margin-right: 4px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
