:root {
    color-scheme: dark;
    font-family: Inter, "Segoe UI", sans-serif;
    color: #f6f4ee;
    background: #111632;
    font-synthesis: none;
    --muted: #adb5d2;
    --border: rgba(255,255,255,.12);
    --panel: rgba(32,38,80,.76);
    --yellow: #ffd447;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at top left, #262958, #111632 58%); }
a { color: var(--yellow); }
button, input, select { font: inherit; }
button { padding: 10px 15px; border: 0; border-radius: 8px; color: #171b3c; background: var(--yellow); font-weight: 700; cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
[hidden] { display: none !important; }
.dashboard-shell { width: min(1240px, calc(100% - 36px)); margin: 0 auto; padding-bottom: 56px; }
.topbar, .topbar nav, .page-heading, .panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.topbar { min-height: 76px; border-bottom: 1px solid var(--border); }
.topbar nav { gap: 20px; }
.topbar a { text-decoration: none; }
.brand { color: #fff; font-size: 20px; font-weight: 800; }
.brand span { color: var(--yellow); }
.topbar nav button { padding: 8px 12px; color: #f6f4ee; background: rgba(255,255,255,.12); }
.page-heading { margin: 34px 0 20px; }
.page-heading h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(28px, 4vw, 40px); }
h2 { margin-bottom: 0; font-size: 21px; }
.eyebrow { margin: 0 0 7px; color: #8bdff1; font-size: 11px; font-weight: 800; letter-spacing: 1.6px; }
.muted, small { color: var(--muted); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card, .panel, .notice { border: 1px solid var(--border); border-radius: 14px; background: var(--panel); box-shadow: 0 14px 40px rgba(0,0,0,.12); }
.stat-card { min-height: 144px; padding: 18px; display: flex; flex-direction: column; gap: 9px; }
.stat-card strong { font-size: 34px; line-height: 1; }
.stat-card small { font-size: 12px; }
.stat-card.pending strong.pending-badge { width: fit-content; min-width: 34px; padding: 5px 10px; border-radius: 999px; color: #ff8585; background: rgba(255,100,100,.16); }
.stat-card.pending strong.pending-badge.empty { color: var(--muted); background: rgba(255,255,255,.08); }
.stat-card.online strong { color: #80e2a3; }
.stat-card.alerts strong { color: #ffd477; }
.panel { min-width: 0; margin-bottom: 18px; padding: 20px; }
.panel-heading { margin-bottom: 15px; }
.panel-heading small { max-width: 390px; line-height: 1.5; }
#test-analytics h3 { margin: 22px 0 8px; font-size: 15px; }
#test-analytics h3:first-of-type { margin-top: 14px; }
.panel-heading input { width: min(360px, 100%); padding: 11px 13px; border: 1px solid var(--border); border-radius: 8px; color: #fff; background: rgba(8,12,34,.55); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-size: 11px; letter-spacing: .5px; text-transform: uppercase; }
td button { margin: 2px 4px 2px 0; padding: 7px 9px; font-size: 12px; }
td select { max-width: 120px; padding: 7px; border: 1px solid var(--border); border-radius: 8px; color: #fff; background: #202650; }
td button.reject { color: #421c20; background: #ff9d9d; }
button.danger { color: #421c20; background: #ff9d9d; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; background: rgba(255,255,255,.12); white-space: nowrap; }
.badge.pending { color: #ffd477; background: rgba(255,184,71,.13); }
.badge.approved { color: #80e2a3; background: rgba(80,220,140,.12); }
.badge.rejected, .badge.inactive { color: #ff9d9d; background: rgba(255,100,100,.12); }
.two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.two-columns .panel { margin-bottom: 18px; }
.event-list { max-height: 380px; overflow: auto; }
.event-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.event-item:last-child { border-bottom: 0; }
.event-meta { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; font-size: 12px; }
.event-item p { margin: 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.event-item button { margin-top: 10px; padding: 7px 10px; font-size: 12px; }
.settings-panel { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 14px; }
.settings-panel .muted { margin: 9px 0 0; }
.setting-toggle { display: flex; align-items: center; gap: 9px; }
.setting-toggle input { width: 18px; height: 18px; accent-color: var(--yellow); }
.status { min-height: 18px; margin: 10px 0 0; }
.settings-panel .status { grid-column: 1 / -1; }
.notice { max-width: 560px; margin: 100px auto; padding: 28px; }
.notice h1 { margin-bottom: 12px; }
.notice p { color: var(--muted); }
@media (max-width: 850px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .two-columns { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 600px) {
    .dashboard-shell { width: min(100% - 24px, 1240px); }
    .topbar { min-height: 64px; }
    .topbar nav { gap: 10px; font-size: 13px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .stats-grid { gap: 9px; }
    .stat-card { min-height: 130px; padding: 14px; font-size: 13px; }
    .stat-card strong { font-size: 28px; }
    .panel { padding: 15px; }
    .panel-heading { align-items: flex-start; flex-direction: column; }
    .panel-heading input { width: 100%; }
    .settings-panel { grid-template-columns: 1fr; }
    .settings-panel .status { grid-column: 1; }
}
