:root {
  color-scheme: dark;
  --bg: #090b10;
  --panel: #11151d;
  --panel-2: #151a24;
  --border: #262d3a;
  --muted: #929cad;
  --text: #f1f5fb;
  --accent: #6e8cff;
  --accent-2: #29d3c2;
  --good: #42d98b;
  --warn: #f3bd57;
  --bad: #ff7185;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
.site-header {
  height: 64px; padding: 0 28px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 680; letter-spacing: -.02em; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px;
  background: linear-gradient(135deg, #6c5cff, #20d3ff); font-weight: 850; color: white; }
nav { display: flex; align-items: center; gap: 20px; color: var(--muted); font-size: 14px; }
nav a:hover { color: var(--text); }
main { width: min(1480px, calc(100% - 48px)); margin: 0 auto; padding: 42px 0 70px; }
.auth-shell { min-height: calc(100vh - 150px); display: grid; place-items: center; }
.auth-card { width: min(440px, 100%); padding: 32px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 24px 90px #0008; }
.eyebrow { color: #8ea3ff; letter-spacing: .12em; font-size: 11px; font-weight: 760; }
h1 { margin: 10px 0 8px; font-size: clamp(30px, 4vw, 44px); letter-spacing: -.045em; }
.auth-card > p, .page-heading p, .panel-heading p { margin: 0; color: var(--muted); line-height: 1.5; }
label { display: block; margin: 25px 0 8px; font-size: 13px; font-weight: 650; }
input { width: 100%; border: 1px solid #323b4c; border-radius: 9px; background: #0b0e14; color: var(--text); padding: 12px 13px; outline: none; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #6e8cff26; }
button { border: 0; cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
.primary { width: 100%; margin-top: 14px; padding: 12px 16px; border-radius: 9px; background: #f2f5fb; color: #0a0c11; font-weight: 720; }
.small-primary { flex: none; padding: 9px 12px; border-radius: 8px; background: #f2f5fb; color: #0a0c11; font-weight: 720; }
.ghost { color: var(--muted); background: transparent; padding: 7px 0; }
.ghost:hover { color: var(--text); }
.ghost.full { display: block; width: 100%; margin-top: 10px; }
.error { min-height: 20px; margin: 9px 0 0 !important; color: var(--bad) !important; font-size: 13px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.refresh-state { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 12px #42d98b99; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.summary-card { min-height: 116px; padding: 20px; background: var(--panel); border: 1px solid var(--border); border-radius: 13px; }
.summary-label { color: var(--muted); font-size: 13px; }
.summary-value { margin-top: 14px; font-size: 32px; font-weight: 740; letter-spacing: -.04em; }
.summary-detail { margin-top: 5px; color: var(--muted); font-size: 12px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(330px, .8fr); gap: 18px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 13px; overflow: hidden; }
.panel-heading { padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
h2 { margin: 0 0 4px; font-size: 16px; letter-spacing: -.015em; }
.panel-heading p { font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { color: var(--muted); font-size: 11px; text-align: left; text-transform: uppercase; letter-spacing: .07em; font-weight: 650; }
th, td { padding: 14px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #ffffff04; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.muted { color: var(--muted); }
.state { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; background: #ffffff09; font-size: 11px; text-transform: capitalize; }
.state.completed, .state.online { color: var(--good); background: #42d98b16; }
.state.running, .state.ready { color: #86a6ff; background: #6e8cff18; }
.state.failed, .state.expired { color: var(--bad); background: #ff718516; }
.state.cancelled, .state.released, .state.offline { color: var(--muted); }
.state.uploading { color: var(--warn); background: #f3bd5716; }
.worker { padding: 18px 20px; border-bottom: 1px solid var(--border); }
.worker:last-child { border-bottom: 0; }
.worker-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.worker-name { font-weight: 650; }
.worker-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.empty { padding: 44px 22px; text-align: center; color: var(--muted); }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: 420px; padding: 12px 15px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); box-shadow: 0 18px 60px #0008; font-size: 13px; }
dialog { width: min(620px, calc(100% - 32px)); padding: 0; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 15px; box-shadow: 0 28px 100px #000c; }
dialog::backdrop { background: #02040acc; backdrop-filter: blur(4px); }
.dialog-card { padding: 25px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.dialog-heading h2 { margin-top: 7px; font-size: 23px; }
.dialog-card p { color: var(--muted); line-height: 1.5; font-size: 13px; }
.icon-button { width: 32px; height: 32px; border-radius: 8px; color: var(--muted); background: #ffffff09; font-size: 22px; line-height: 1; }
.icon-button:hover { color: var(--text); background: #ffffff10; }
pre { margin: 16px 0 0; padding: 15px; overflow-x: auto; border: 1px solid #323b4c; border-radius: 9px; background: #090b10; white-space: pre-wrap; overflow-wrap: anywhere; }
pre code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.5; }
.security-note { margin-bottom: 0; }
@media (max-width: 980px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .site-header { padding: 0 18px; }
  main { width: min(100% - 28px, 1480px); padding-top: 28px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .summary-grid { grid-template-columns: 1fr; }
  th, td { padding: 12px; }
  .auth-card { padding: 24px; }
}
