/* JustNewsToday dashboard — dark-first, systems-vault-inspired */
/* Tokens matched to systems-vault's admin dark mode: slate surfaces + indigo brand */
:root {
  --bg: #020617;        /* slate-950 */
  --bg-panel: #0f172a;  /* slate-900 */
  --bg-hover: #1e293b;  /* slate-800 */
  --border: #334155;    /* slate-700 */
  --text: #e2e8f0;      /* slate-200 */
  --muted: #94a3b8;     /* slate-400 */
  --accent: #4f46e5;    /* indigo-600 (systems-vault --brand) */
  --accent-hover: #6366f1;
  --green: #2fbf71;
  --amber: #e6a23c;
  --red: #e05252;
  --radius: 10px;
  font-size: 15px;
}
* { box-sizing: border-box; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  min-height: 100vh;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* Login */
.login { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
  width: 380px; padding: 40px; text-align: center;
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 16px;
}
.login-card h1 { margin: 14px 0 4px; font-size: 1.5rem; }
.login-card form { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.divider { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: var(--muted); }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #8b5cf6); color: #fff;
}

/* Shell */
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.sidebar {
  display: flex; flex-direction: column; padding: 18px 12px; gap: 18px;
  background: var(--bg-panel); border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; padding: 0 8px; }
#nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
#nav a {
  padding: 9px 12px; border-radius: 8px; color: var(--muted);
  text-decoration: none; font-weight: 500;
}
#nav a:hover { background: var(--bg-hover); color: var(--text); }
#nav a.active { background: var(--bg-hover); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.sidebar-footer { display: flex; flex-direction: column; gap: 8px; padding: 0 8px; }

.main { padding: 28px 32px; max-width: 1200px; width: 100%; }
.main h2 { margin-bottom: 4px; }
.page-sub { color: var(--muted); margin-bottom: 22px; }

/* Cards / stats */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.card {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
}
.card .stat { font-size: 1.7rem; font-weight: 700; margin-top: 4px; }
.panel {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 18px;
}
.panel h3 { margin-bottom: 12px; font-size: 1.02rem; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
tr:hover td { background: var(--bg-hover); }
td a { color: var(--accent-hover); text-decoration: none; }

/* Pills */
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.pill.published, .pill.connected, .pill.on { background: rgba(47,191,113,.14); color: var(--green); }
.pill.processing, .pill.raw, .pill.video_pending { background: rgba(79,124,255,.14); color: var(--accent-hover); }
.pill.needs_review { background: rgba(230,162,60,.15); color: var(--amber); }
.pill.rejected, .pill.video_failed, .pill.disconnected, .pill.off { background: rgba(224,82,82,.14); color: var(--red); }

/* Buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-hover); color: var(--text); font-weight: 600;
  cursor: pointer; text-decoration: none; font-size: 0.92rem;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-google { background: #fff; color: #1a1a1a; border-color: #fff; width: 100%; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--red); }
.btn.small { padding: 5px 10px; font-size: 0.82rem; }
input, select, textarea {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 9px 12px; font: inherit; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.form-row { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 140px; }
label.check { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
label.check input { width: auto; }

.score { font-variant-numeric: tabular-nums; font-weight: 700; }
.score.pass { color: var(--green); }
.score.fail { color: var(--amber); }
pre.draft {
  white-space: pre-wrap; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px; font-size: 0.88rem; max-height: 400px; overflow: auto;
}
.toast {
  position: fixed; bottom: 24px; right: 24px; padding: 12px 18px;
  background: var(--bg-hover); border: 1px solid var(--accent); border-radius: 10px;
  animation: fade 3s forwards;
}
@keyframes fade { 0%,80% { opacity: 1 } 100% { opacity: 0 } }
code.inline { background: var(--bg); padding: 2px 7px; border-radius: 6px; font-size: 0.85rem; word-break: break-all; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; }
  #nav { flex-direction: row; }
}
