:root {
  color-scheme: dark;
  --bg: #090b12;
  --panel: #121520;
  --panel-2: #181c29;
  --line: #292e3e;
  --text: #f5f4fb;
  --muted: #979caf;
  --violet: #9b8cff;
  --violet-2: #7261ee;
  --mint: #6ee7c4;
  --amber: #ffc66d;
  --danger: #ff7a8a;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 70% -20%, #202242 0, transparent 38%), var(--bg); color: var(--text); }
button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }
.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(24px, calc((100vw - 1180px) / 2)); border-bottom: 1px solid var(--line); background: rgba(9, 11, 18, .82); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 5; }
.brand, .top-actions { display: flex; align-items: center; gap: 12px; }
.brand { font-weight: 750; letter-spacing: -.02em; }
.brand-mark { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: linear-gradient(145deg, var(--violet), #5742dd); box-shadow: 0 14px 36px rgba(114, 97, 238, .35); font-size: 32px; }
.brand-mark.small { width: 32px; height: 32px; border-radius: 10px; font-size: 18px; box-shadow: none; }
.timezone { color: var(--muted); font-size: 13px; }
.link-button, .row-action { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px; }
.link-button:hover, .row-action:hover { color: var(--text); }
.page { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 52px 0 80px; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 34px; }
.eyebrow { color: var(--violet); font-size: 12px; text-transform: uppercase; letter-spacing: .16em; font-weight: 800; margin: 0 0 9px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(36px, 6vw, 66px); line-height: .98; margin-bottom: 18px; letter-spacing: -.055em; }
h2 { font-size: 22px; margin-bottom: 0; letter-spacing: -.025em; }
.muted { color: var(--muted); line-height: 1.6; }
.hero-actions, .section-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.button { border: 1px solid transparent; border-radius: 12px; color: var(--text); padding: 12px 17px; cursor: pointer; font-weight: 700; transition: transform .15s, border-color .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: progress; transform: none; }
.button.sleep, .button.primary { background: linear-gradient(135deg, var(--violet-2), #8c7cf8); box-shadow: 0 10px 24px rgba(114, 97, 238, .24); }
.button.wake { background: var(--panel-2); border-color: var(--line); }
.button.ghost { background: transparent; border-color: var(--line); color: #c8cada; padding: 9px 12px; font-size: 13px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.metric-card, .panel { border: 1px solid var(--line); background: linear-gradient(155deg, rgba(24, 28, 41, .88), rgba(17, 20, 31, .94)); border-radius: var(--radius); }
.metric-card { padding: 20px; display: flex; flex-direction: column; min-height: 142px; }
.metric-card.accent { background: linear-gradient(150deg, rgba(114, 97, 238, .32), rgba(24, 28, 41, .9)); border-color: rgba(155, 140, 255, .42); }
.metric-card span, .metric-card small { color: var(--muted); font-size: 13px; }
.metric-card strong { font-size: 28px; margin: auto 0 6px; letter-spacing: -.04em; }
.panel { padding: 24px; margin-top: 18px; overflow: hidden; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 20px; }
.chart-legend { display: flex; gap: 18px; color: var(--muted); font-size: 12px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 100%; margin-right: 5px; }
.dot.violet { background: var(--violet); }.dot.mint { background: var(--mint); }
.chart-wrap { height: 280px; }.chart-wrap.compact { height: 180px; margin-top: 26px; }
.table-wrap { overflow-x: auto; margin: 0 -24px -24px; }
table { border-collapse: collapse; width: 100%; min-width: 860px; }
th, td { text-align: left; padding: 14px 16px; border-top: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; }
tr.needs-attention td:first-child { border-left: 2px solid var(--amber); }
.status { border-radius: 20px; padding: 5px 9px; background: #242a38; color: #c9ccda; font-size: 12px; }
.status.complete { color: var(--mint); background: rgba(110, 231, 196, .1); }
.status.conflict, .status.invalid { color: var(--danger); background: rgba(255, 122, 138, .1); }
.status.open, .status.orphan { color: var(--amber); background: rgba(255, 198, 109, .1); }
.event-list { display: grid; gap: 9px; }
.event-row { display: grid; grid-template-columns: 1.2fr 180px 1fr auto; gap: 10px; align-items: center; padding: 13px; background: rgba(7, 9, 15, .35); border: 1px solid var(--line); border-radius: 12px; }
.event-row small { color: var(--muted); display: block; margin-top: 3px; }
.event-row.deleted { opacity: .55; }
input, select { width: 100%; background: #0c0f18; border: 1px solid var(--line); border-radius: 10px; color: var(--text); padding: 10px 12px; outline: none; }
input:focus, select:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(155, 140, 255, .12); }
.event-actions { display: flex; }
.row-action.danger { color: var(--danger); }
.empty { color: var(--muted); text-align: center; padding: 30px; }
dialog { color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 0; box-shadow: 0 30px 80px rgba(0,0,0,.55); width: min(440px, calc(100% - 28px)); }
dialog::backdrop { background: rgba(0, 0, 0, .65); backdrop-filter: blur(4px); }
.dialog-card { padding: 24px; display: grid; gap: 17px; }
.dialog-card label, .stack label { display: grid; gap: 7px; color: #c9ccda; font-size: 13px; }
.icon-button { color: var(--muted); background: transparent; border: 0; font-size: 28px; cursor: pointer; }
.toast { position: fixed; right: 22px; bottom: 22px; background: #252a3b; border: 1px solid #3b4257; border-radius: 12px; padding: 13px 16px; box-shadow: 0 12px 30px rgba(0,0,0,.4); transform: translateY(80px); opacity: 0; transition: .25s; z-index: 20; max-width: 360px; }
.toast.visible { transform: none; opacity: 1; }.toast.error { border-color: var(--danger); }
.login-body { display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); border: 1px solid var(--line); background: rgba(18, 21, 32, .95); border-radius: 24px; padding: 36px; box-shadow: 0 28px 100px rgba(0,0,0,.42); }
.login-card .brand-mark { margin-bottom: 28px; }.login-card h1 { font-size: 38px; }
.stack { display: grid; gap: 14px; margin-top: 28px; }.form-error { color: var(--danger); font-size: 13px; margin-bottom: 0; }
@media (max-width: 850px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .event-row { grid-template-columns: 1fr 1fr; }
  .event-actions { justify-content: flex-end; }
}
@media (max-width: 620px) {
  .page { width: min(100% - 24px, 1180px); padding-top: 32px; }
  .topbar { padding: 0 14px; }.timezone { display: none; }
  .hero { align-items: stretch; flex-direction: column; }
  .hero-actions .button { flex: 1; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { min-height: 126px; padding: 15px; }.metric-card strong { font-size: 23px; }
  .panel { padding: 18px; }.table-wrap { margin: 0 -18px -18px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .chart-legend { display: none; }.chart-wrap { height: 230px; }
  .event-row { grid-template-columns: 1fr; }
  .event-actions { justify-content: flex-start; }
}
