/* Crimora admin dashboard — dark slate + red accent, matching the app.
   No build step, no framework: this file is served exactly as written. */

:root {
  --bg: #0f172a;
  --panel: #1a2438;
  --panel-2: #223047;
  --border: #2c3b56;
  --text: #e6ecf7;
  --muted: #93a3bd;
  --accent: #ef4444;
  --accent-dim: #b91c1c;
  --ok: #22c55e;
  --warn: #f59e0b;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif;
}

a { color: #7dd3fc; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }

/* ---------- layout ---------- */

header.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
}

.brand { font-weight: 700; letter-spacing: 0.5px; }
.brand .mark { color: var(--accent); }
.brand .env { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 8px; }

nav.tabs { display: flex; gap: 4px; flex-wrap: wrap; }

nav.tabs button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 7px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
}
nav.tabs button:hover { color: var(--text); background: var(--panel-2); }
nav.tabs button.active { color: var(--text); background: var(--panel-2); border-color: var(--border); }
nav.tabs button .badge {
  display: inline-block;
  margin-left: 7px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 700;
}

.spacer { flex: 1; }
.whoami { color: var(--muted); font-size: 13px; }
.whoami strong { color: var(--text); }

main { padding: 20px; max-width: 1200px; margin: 0 auto; }

/* ---------- components ---------- */

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}

.card h3 { margin: 0 0 4px; font-size: 16px; }
.meta { color: var(--muted); font-size: 13px; }
.meta span + span::before { content: "·"; margin: 0 8px; color: var(--border); }

button {
  font: inherit;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  padding: 8px 14px;
  cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--muted); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--accent-dim); }
button.danger { border-color: var(--accent-dim); color: #fca5a5; }
button.small { padding: 5px 10px; font-size: 13px; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

input, select, textarea {
  font: inherit;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
}
textarea { resize: vertical; min-height: 84px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters > div { flex: 1 1 160px; }
.filters label { margin-top: 0; }

/* Wide content must scroll inside its own box, never the page. */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
tbody tr:hover { background: var(--panel-2); }

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--muted);
}
.pill.ok { color: var(--ok); border-color: #14532d; }
.pill.warn { color: var(--warn); border-color: #78350f; }
.pill.bad { color: #fca5a5; border-color: var(--accent-dim); }

.raw {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--warn);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 10px 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.raw .tag { display: block; font-size: 11px; color: var(--warn); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 5px; }

.notice { padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; }
.notice.err { background: #3f1d1d; border: 1px solid var(--accent-dim); }
.notice.ok { background: #16351f; border: 1px solid #14532d; }
.notice.info { background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); }

.empty { color: var(--muted); padding: 28px; text-align: center; }

/* ---------- timeline ---------- */

.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 18px 18px; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -25px;
  top: 5px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--panel-2);
  border: 2px solid var(--muted);
}
.timeline li.audit::before { background: var(--accent); border-color: var(--accent); }
.timeline .when { color: var(--muted); font-size: 12px; }
.timeline .what { font-weight: 600; margin: 2px 0; }
.timeline .who { color: var(--muted); font-size: 13px; }
.timeline .details { margin-top: 6px; font-size: 13px; color: var(--muted); }
.timeline .details code { background: var(--bg); padding: 1px 6px; border-radius: 5px; }

/* ---------- login ---------- */

.login-wrap { max-width: 380px; margin: 12vh auto; }
.login-wrap .brand { font-size: 26px; text-align: center; margin-bottom: 6px; }
.login-wrap .sub { text-align: center; color: var(--muted); margin-bottom: 22px; font-size: 14px; }

.pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 14px; color: var(--muted); font-size: 13px; }

@media (max-width: 640px) {
  main { padding: 14px; }
  header.topbar { gap: 10px; }
}
