/* 16x9 Ajans panel. One token set, light + dark. No inline styles (CSP). */
:root {
  --bg: #f4f3ef; --surface: #ffffff; --surface-2: #f8f7f4; --ink: #15171c; --muted: #5b606b;
  --line: #e3e2dd; --accent: #2f5bd3; --accent-ink: #ffffff; --good: #1e7a55; --warn: #8a5a12;
  --bad: #a3361f; --good-bg: #d8f2e6; --warn-bg: #fcebd2; --bad-bg: #fbe1da; --info-bg: #dcebfb;
  --radius: 12px; --space: 16px;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1013; --surface: #1a1c21; --surface-2: #16181c; --ink: #f2f1ec; --muted: #a3a8b2;
    --line: #2c2f36; --accent: #6b9bf7; --accent-ink: #0f1013; --good: #4fd39e; --warn: #f5b35c;
    --bad: #f08a73; --good-bg: #183428; --warn-bg: #3a2d1a; --bad-bg: #3d1e1a; --info-bg: #1a2c40;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 0 0 var(--space); }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }

.top { display: flex; align-items: center; gap: 20px; padding: 12px 24px; background: var(--surface);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; flex-wrap: wrap; }
.top .logo { font-weight: 700; letter-spacing: .02em; color: var(--ink); }
.top nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.top nav a { color: var(--muted); padding: 6px 10px; border-radius: 8px; }
.top nav a.on, .top nav a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
main { max-width: 1180px; margin: 0 auto; padding: 24px 16px 64px; }

.grid { display: grid; gap: var(--space); }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 0; }
.stack > * + * { margin-top: var(--space); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.connected, .badge.published, .badge.active, .badge.replied, .badge.produced { background: var(--good-bg); color: var(--good); }
.badge.approved, .badge.inbox, .badge.processing, .badge.planned, .badge.needs_review { background: var(--info-bg); color: var(--accent); }
.badge.pending, .badge.draft, .badge.finished, .badge.escalated { background: var(--warn-bg); color: var(--warn); }
.badge.error, .badge.failed, .badge.rejected, .badge.stopped, .badge.skipped { background: var(--bad-bg); color: var(--bad); }

.flash { background: var(--info-bg); border: 1px solid var(--line); padding: 12px 16px; border-radius: var(--radius);
  margin-bottom: var(--space); }
.alert { background: var(--warn-bg); color: var(--warn); padding: 12px 16px; border-radius: var(--radius); }

form.inline { display: inline; }
label { display: block; font-weight: 600; font-size: 13px; margin: 0 0 4px; }
.field { margin-bottom: 14px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 4px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2);
  color: var(--ink); font: inherit; }
textarea { min-height: 180px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
button, .btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font: inherit; font-weight: 600;
  cursor: pointer; }
button:hover, .btn:hover { border-color: var(--muted); text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.danger { background: var(--bad-bg); color: var(--bad); border-color: transparent; }

.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs img { width: 120px; height: auto; border-radius: 8px; border: 1px solid var(--line); }
.preview img, .preview video { width: 100%; max-width: 360px; border-radius: var(--radius); border: 1px solid var(--line); }
.preview-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.preview-strip img { width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.day { margin-bottom: 20px; }
.slot { display: grid; grid-template-columns: 56px 92px 1fr auto; gap: 12px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--line); }
.slot img { width: 92px; height: 115px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.slot .ph { width: 92px; height: 115px; border-radius: 6px; background: var(--surface-2); border: 1px dashed var(--line); }
.kit img { width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.status-grid { display: grid; grid-template-columns: 140px repeat(4, 1fr); gap: 8px; align-items: center; }
.auth { max-width: 420px; margin: 8vh auto; }
.qr { width: 220px; background: #fff; padding: 10px; border-radius: 8px; }
pre { white-space: pre-wrap; word-break: break-word; background: var(--surface-2); padding: 12px; border-radius: 8px;
  font-size: 13px; margin: 0; }
@media (max-width: 640px) {
  .slot { grid-template-columns: 48px 72px 1fr; }
  .slot img, .slot .ph { width: 72px; height: 90px; }
  .slot .act { grid-column: 1 / -1; }
  .status-grid { grid-template-columns: 90px repeat(4, 1fr); font-size: 12px; }
}
