:root {
  color-scheme: dark;
  font-family: Inter, sans-serif;
  color: #f5f8f5;
  background: #080e0b;
  font-synthesis: none;
  --surface: #0d1711;
  --card: #111e16;
  --border: #223329;
  --muted: #a0afa4;
  --green: #10b981;
  --red: #f87171;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(ellipse at top left, #13251a 0, #080e0b 58%); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.shell { width: min(1200px, calc(100% - 40px)); margin: 0 auto; padding-bottom: 64px; }
.topbar { height: 82px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.brand img { display: block; width: 152px; height: 58px; padding: 3px; border-radius: 5px; background: #fff; object-fit: contain; }
.topbar__right { display: flex; align-items: center; gap: 18px; }
.topbar__label, .muted, .table-note, .empty-state { color: var(--muted); }
.topbar__label { font-size: 0.88rem; }
.panel { border: 1px solid var(--border); border-radius: 16px; background: rgba(17, 30, 22, 0.94); box-shadow: 0 16px 45px rgba(0, 0, 0, 0.16); }
.login-panel { width: min(460px, 100%); margin: 76px auto; padding: clamp(24px, 6vw, 40px); }
.eyebrow { color: var(--green); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; }
h1, h2 { margin: 0; font-family: "Space Grotesk", Inter, sans-serif; }
.login-panel h1 { margin-top: 12px; font-size: 2rem; }
.login-panel > .muted { margin: 10px 0 24px; line-height: 1.6; }
.login-form { display: grid; gap: 10px; }
.login-form label { margin-top: 8px; font-size: 0.88rem; font-weight: 600; }
.login-form input, .status-select {
  width: 100%; min-height: 44px; padding: 10px 12px; color: #f5f8f5;
  border: 1px solid #344a3b; border-radius: 9px; background: #0d1711;
}
.login-form input:focus, .status-select:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(16, 185, 129, 0.55); outline-offset: 2px;
}
.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 9px 15px; border: 1px solid transparent; border-radius: 9px; text-decoration: none; font-weight: 700; cursor: pointer; }
.button--primary { min-height: 46px; margin-top: 12px; background: var(--green); color: #03140c; }
.button--primary:hover { background: #34d399; }
.button--quiet { border-color: #344a3b; background: transparent; color: #e3ebe5; }
.button--quiet:hover { background: rgba(255, 255, 255, 0.06); }
.button:disabled { cursor: wait; opacity: 0.65; }
.notice { padding: 12px 14px; border: 1px solid; border-radius: 9px; font-size: 0.9rem; line-height: 1.5; }
.notice--warning { border-color: rgba(251, 191, 36, 0.3); background: rgba(251, 191, 36, 0.08); color: #fcd34d; }
.notice--error { border-color: rgba(248, 113, 113, 0.32); background: rgba(248, 113, 113, 0.08); color: #fca5a5; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 42px 0 24px; }
.page-heading h1 { margin: 8px 0; font-size: clamp(2rem, 5vw, 2.8rem); }
.page-heading .muted { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { display: grid; gap: 9px; padding: 21px; }
.stat > span { color: var(--muted); font-size: 0.9rem; }
.stat strong { font-family: "Space Grotesk", sans-serif; font-size: 2.1rem; }
.stat small { color: var(--green); }
.records-panel { overflow: hidden; }
.tabs { display: flex; gap: 6px; padding: 12px 14px 0; border-bottom: 1px solid var(--border); }
.tab { padding: 13px 16px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; }
.tab.is-active { border-bottom-color: var(--green); color: #f5f8f5; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-size: 0.73rem; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
td { font-size: 0.88rem; line-height: 1.5; }
tbody tr:last-child td { border-bottom: 0; }
.cell-message { min-width: 220px; max-width: 390px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cell-email { overflow-wrap: anywhere; }
.status-select { width: auto; min-width: 130px; min-height: 36px; padding: 6px 9px; font-size: 0.82rem; }
.empty-state { padding: 40px 16px 12px; text-align: center; }
.table-note { margin: 0; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 0.77rem; }
#dashboardError { margin: 0 0 20px; }

@media (max-width: 700px) {
  .shell { width: min(100% - 24px, 1200px); }
  .topbar { height: 70px; }
  .brand img { width: 126px; height: 48px; }
  .topbar__right { gap: 9px; }
  .topbar__label { font-size: 0.76rem; }
  .button { padding: 8px 11px; font-size: 0.84rem; }
  .page-heading { align-items: start; flex-direction: column; margin-top: 30px; }
  .stats { gap: 10px; }
  .stat { padding: 15px; }
  .stat strong { font-size: 1.7rem; }
  .tabs { padding-left: 8px; padding-right: 8px; }
  .tab { padding: 12px 10px; font-size: 0.82rem; }
  th, td { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
