:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;color:#eaf5ff;background:#07121e;font-synthesis:none;--panel:#102235;--border:#28415a;--muted:#9fb7cd;--blue:#39aafe;--green:#26dab1}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:linear-gradient(155deg,#091827,#07111d)}
body{font-size:14px;line-height:1.45}
.topbar{height:auto;min-height:76px;padding:18px 24px;display:flex;align-items:center;justify-content:space-between;gap:18px;border-bottom:1px solid #233c51;background:#0d1c2b}
.brand{display:flex;align-items:center;gap:16px;flex-wrap:wrap;font-size:19px;font-weight:700}.brand strong{font-size:25px}.brand-icon{color:#3cb5ff;font-size:28px}.separator{height:25px;width:1px;background:#63809b}.header-actions{display:flex;align-items:center;gap:16px;white-space:nowrap}.domain{color:#91b7d8}.private-tag{color:#57bcff;border:1px solid #348ccc;border-radius:8px;padding:5px 12px;font-weight:700;font-size:13px}
.layout{max-width:1650px;margin:0 auto;padding:16px;display:grid;gap:14px}.connection{padding:9px 13px;background:#122c43;border:1px solid #315576;border-radius:7px;color:#b5d5f4;display:none}.connection:not(:empty){display:block}.connection.ok{display:none}.connection.error{display:block;background:#38212a;border-color:#834b55;color:#f9bbbf}
.card{background:linear-gradient(165deg,#13283d,#0e1c2d);border:1px solid var(--border);border-radius:12px;min-width:0;padding:20px;box-shadow:0 5px 18px #00000012}
.kpis{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px}.metric{min-height:128px}.metric-label{color:#cddff0;font-size:15px}.metric-value{font-size:26px;font-weight:750;margin-top:12px;line-height:1.15;overflow-wrap:anywhere}.metric small{display:block;color:var(--muted);margin-top:8px}.accent-green{border-color:#227966;background:linear-gradient(150deg,#11342f,#13283a)}.accent-green .metric-value{color:#39e3b3}.metric-value.warn{color:#ffc27b}.metric-value.error{color:#ffa4a9}
h2{font-size:18px;margin:0;font-weight:720;line-height:1.3}.muted,.caution{color:var(--muted);font-size:12px}.card p{margin:9px 0 0}.panel-head{display:flex;justify-content:space-between;align-items:flex-start;gap:18px}.panel-head p{color:#a7c0d7;margin-top:4px}.panel-head strong{color:var(--blue);font-size:18px;white-space:nowrap}
.progress-label{display:flex;justify-content:space-between;gap:10px;margin-top:16px;margin-bottom:7px;color:#c9e0ef}.progress-label.second{margin-top:14px}
progress{width:100%;height:19px;appearance:none;-webkit-appearance:none;border:0;border-radius:99px;overflow:hidden;background:#243e5a}
progress::-webkit-progress-bar{background:#243e5a;border-radius:99px}progress::-webkit-progress-value{background:linear-gradient(90deg,#1e85f3,#46c0ff);border-radius:99px}progress::-moz-progress-bar{background:#40abff;border-radius:99px}
progress.green::-webkit-progress-value{background:linear-gradient(90deg,#08aa93,#39e0b5)}progress.green::-moz-progress-bar{background:#26d8ad}
.caution{margin-top:14px!important;line-height:1.5;border-left:3px solid #4e779b;padding-left:10px}
.mid-grid{display:grid;grid-template-columns:1.45fr 1fr 1fr;gap:14px}.chart-wrap{margin-top:18px}svg#throughput{width:100%;height:185px;display:block}.svg-empty{fill:#9ab1c7;font-size:14px}.svg-grid{stroke:#2b455a;stroke-width:1}.svg-label{fill:#aac3d7;font-size:12px}.svg-line{fill:none;stroke:#35abff;stroke-width:3;stroke-linejoin:round}.svg-dot{fill:#48b9ff;stroke:#d5efff;stroke-width:1}
.donut-section{display:flex;gap:24px;align-items:center;margin:22px 0}.donut{width:165px;max-width:55%;aspect-ratio:1;position:relative}.donut svg{width:100%;height:100%;transform:rotate(-90deg)}.donut circle{fill:none;stroke-width:16}.donut-track{stroke:#2c435b}.donut-done{stroke:var(--green);stroke-linecap:round;transition:stroke-dasharray .4s}.donut-number{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column}.donut-number strong{font-size:30px}.donut-number span{font-size:12px;color:var(--muted)}
.legend{flex:1;min-width:105px}.legend p{display:flex;align-items:center;gap:7px;margin:13px 0}.legend strong{margin-left:auto}.square{display:inline-block;flex:0 0 9px;height:9px;border-radius:2px}.completed{background:var(--green)}.active{background:#37aeff}.neutral{background:#8d9aaa}
.resources{margin-top:18px}.resources>div{display:flex;justify-content:space-between;gap:12px;border-bottom:1px solid #2b4356;padding:10px 0;color:#c8deec}.resources strong{color:#f2f8ff}
.bottom-grid{display:grid;grid-template-columns:1.8fr 1fr;gap:14px}.table-scroll{overflow-x:auto;margin-top:18px}table{width:100%;border-collapse:collapse;text-align:left;min-width:630px;font-variant-numeric:tabular-nums}th{padding:10px 9px;background:#1b3148;color:#d7e6f2;font-weight:650;font-size:12px;white-space:nowrap}td{padding:11px 9px;border-bottom:1px solid #243e56;font-size:13px}td:first-child{color:#44b5ff;font-weight:700}.empty{color:#8da8be!important;text-align:center;padding:20px}.pill{display:inline-flex;align-items:center;border-radius:20px;padding:3px 9px;font-size:12px;font-weight:700;background:#243c58;color:#ccdfef}.pill.committed{color:#4ce8b4;background:#11433a}.pill.running{color:#60c5ff;background:#143c5e}.pill.stopped,.pill.unverified,.pill.failed{color:#ffd095;background:#553c25}
button{padding:7px 12px;background:#173853;color:#bce9ff;border:1px solid #3b7da7;border-radius:7px;cursor:pointer;font:inherit;font-size:12px}button:hover{background:#235273}button:focus-visible{outline:2px solid #65cbff;outline-offset:3px}
.events{list-style:none;margin:18px 0 0;padding:0}.events li{display:flex;gap:12px;justify-content:space-between;padding:11px 4px;border-bottom:1px solid #284255}.events time{white-space:nowrap;font-size:11px;color:var(--muted)}.event-kind{font-weight:600;text-transform:capitalize}
footer{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;color:#7795ad;font-size:12px;padding:10px 4px 22px}
@media(max-width:1200px){.kpis{grid-template-columns:repeat(3,minmax(0,1fr))}.mid-grid{grid-template-columns:1fr 1fr}.mid-grid>.card:first-child{grid-column:1/-1}.bottom-grid{grid-template-columns:1fr}}
@media(max-width:680px){.topbar{padding:14px;align-items:flex-start;flex-direction:column}.brand{font-size:15px;gap:8px}.brand strong{font-size:21px}.separator{height:20px}.layout{padding:9px;gap:9px}.card{padding:14px}.kpis{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.metric{min-height:116px}.metric-value{font-size:22px}.metric-label{font-size:13px}.mid-grid{grid-template-columns:1fr}.mid-grid>.card:first-child{grid-column:auto}.bottom-grid{grid-template-columns:1fr}.panel-head{flex-wrap:wrap}.panel-head strong{font-size:16px}.progress-label{font-size:12px}.donut-section{gap:14px}.events li{align-items:start;flex-direction:column;gap:3px}h2{font-size:17px}}


/* Owner-approved in-page login: no external heading or dashboard data visible
   until /api/status succeeds through the existing Nginx credential gate. */
#login-screen[hidden],#dashboard-shell[hidden],.login-error[hidden]{display:none!important}
.login-screen{min-height:100vh;min-height:100dvh;display:grid;place-items:center;padding:22px;background:linear-gradient(145deg,#f8fafb,#eff4f7);color:#142530}
.login-card{width:min(100%,480px);padding:30px;border:1px solid #c1cfd8;border-radius:14px;background:#fff;box-shadow:0 9px 26px #102e4020}
.login-heading{display:flex;align-items:center;gap:14px;margin-bottom:26px}
.login-heading h1{font-size:26px;line-height:1.1;margin:0;font-weight:750;color:#12222e}
.login-heading p{font-size:14px;color:#647686;margin:7px 0 10px}
.login-lock{height:58px;width:58px;flex:0 0 58px;display:grid;place-items:center;background:#e7eff2;border:1px solid #b8d0d8;border-radius:12px}
.padlock{width:21px;height:18px;border:3px solid #152936;border-radius:4px;position:relative;margin-top:11px}
.padlock:before{content:"";position:absolute;width:11px;height:13px;border:3px solid #152936;border-radius:9px 9px 0 0;border-bottom:0;bottom:12px;left:2px}
.login-badge{display:inline-flex;border:1px solid #c0d0d8;border-radius:20px;padding:4px 11px;background:#eff4f7;color:#526776;font-size:11px;letter-spacing:1.2px;font-weight:750}
.login-card label{display:block;margin:16px 0 7px;font-size:16px;color:#162732}
.login-card input{width:100%;height:46px;border:1px solid #bacbd5;border-radius:5px;background:#f4f8fa;color:#10232d;font:inherit;font-size:16px;padding:8px 10px}
.login-card input:focus-visible{outline:2px solid #087e8c;outline-offset:1px}
.login-submit{display:block;width:100%;margin-top:26px;padding:13px;background:#108c89;color:white;border:1px solid #108c89;border-radius:6px;font-size:17px}
.login-submit:hover{background:#0c7776}.login-submit:disabled{opacity:.65;cursor:wait}
.login-error{color:#9e2531;margin:12px 0 0;font-size:13px}

/* Header and three-option appearance selector, independent of data polling. */
.topbar{display:block}
.brand-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.brand{flex-wrap:nowrap;white-space:nowrap}
.dashboard-title{margin:14px 0 10px;font-size:18px;line-height:1.25;font-weight:720}
.header-actions{justify-content:flex-start}
.theme-switch{display:inline-flex;flex-shrink:0;align-items:center;border:1px solid #547da0;border-radius:9px;overflow:hidden}
.theme-switch button{border:0;border-radius:0;padding:8px 10px;background:transparent;color:#bcd3e8;font-size:12px;font-weight:650;text-transform:uppercase}
.theme-switch button:hover{background:#183d59}
.theme-switch button[aria-pressed="true"]{background:#108c89;color:#fff}

/* Prominent, accessible manual refresh near the top-right header controls. */
.header-actions{flex-wrap:wrap;row-gap:8px}
.header-refresh{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;font-size:12px;font-weight:700}
.header-refresh .refresh-icon{font-size:21px;line-height:1}
.header-refresh:disabled{opacity:.65;cursor:progress}
.header-refresh:disabled .refresh-icon{animation:ai-refresh-turn .9s linear infinite}
@keyframes ai-refresh-turn{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.header-refresh:disabled .refresh-icon{animation:none}}
.refresh-status{color:var(--muted);font-size:12px;margin-top:8px;min-height:16px}
.refresh-status.stale{color:#e9aa78}
:root[data-theme="light"] .refresh-status.stale{color:#aa521f}
@media(max-width:680px){.header-actions{gap:8px}.header-refresh{margin-left:auto;padding:5px 9px}}

.kpis{grid-template-columns:repeat(4,minmax(0,1fr))}

/* Light palette; dark remains the unchanged base palette above. System follows
   prefers-color-scheme and is resolved by JavaScript on media changes. */
:root[data-theme="light"]{--panel:#fff;--border:#bdcdda;--muted:#52697a;--blue:#076aa3;--green:#0d9987;color:#132938;background:#f4f8fa}
:root[data-theme="light"] body{background:linear-gradient(155deg,#f8fbfd,#ecf3f6);color:#132938}
:root[data-theme="light"] .topbar{background:#f1f6f8;border-bottom-color:#c9d8e1}
:root[data-theme="light"] .brand-icon{color:#0688c1}
:root[data-theme="light"] .separator{background:#a3b9c6}
:root[data-theme="light"] .domain{color:#456c86}
:root[data-theme="light"] .private-tag{color:#076fa9;border-color:#519ed1}
:root[data-theme="light"] .theme-switch{border-color:#b7cdd9;background:#fff}
:root[data-theme="light"] .theme-switch button{color:#344d5e}
:root[data-theme="light"] .theme-switch button:hover{background:#e2edf1}
:root[data-theme="light"] .theme-switch button[aria-pressed="true"]{color:#fff;background:#108c89}
:root[data-theme="light"] .card{background:linear-gradient(165deg,#fff,#f4f8fa);box-shadow:0 5px 18px #273a4510}
:root[data-theme="light"] .accent-green{border-color:#75b5a9;background:linear-gradient(150deg,#e9f9f5,#f4fbfb)}
:root[data-theme="light"] .accent-green .metric-value{color:#087e71}
:root[data-theme="light"] .metric-label,:root[data-theme="light"] .progress-label{color:#304e62}
:root[data-theme="light"] .panel-head p,:root[data-theme="light"] .resources>div{color:#577082}
:root[data-theme="light"] .resources strong{color:#142b3b}
:root[data-theme="light"] .resources>div,:root[data-theme="light"] .events li,:root[data-theme="light"] td{border-bottom-color:#d4e0e8}
:root[data-theme="light"] th{background:#e0ecf2;color:#1c4057}
:root[data-theme="light"] td:first-child{color:#0877b2}
:root[data-theme="light"] .pill{background:#e0ecf2;color:#33576e}
:root[data-theme="light"] .pill.committed{background:#d4f4e9;color:#087e65}
:root[data-theme="light"] .pill.running{background:#d9eefc;color:#0a72ae}
:root[data-theme="light"] .pill.stopped,:root[data-theme="light"] .pill.unverified,:root[data-theme="light"] .pill.failed{background:#fff1d5;color:#85591e}
:root[data-theme="light"] .svg-grid{stroke:#c9d8e1}
:root[data-theme="light"] .svg-label,:root[data-theme="light"] .svg-empty{fill:#5c7688}
:root[data-theme="light"] .svg-dot{stroke:#fff}
:root[data-theme="light"] .donut-track{stroke:#d7e4ec}
:root[data-theme="light"] progress,:root[data-theme="light"] progress::-webkit-progress-bar{background:#dbe6ed}
:root[data-theme="light"] .caution{border-left-color:#83a9bf}
:root[data-theme="light"] .connection{background:#e7f2f8;border-color:#a5c6d8;color:#31536b}
:root[data-theme="light"] .connection.error{background:#fff0f1;border-color:#d5a2a6;color:#9c313c}
:root[data-theme="light"] footer{color:#5d7789}
:root[data-theme="light"] .events time{color:#586f80}
:root[data-theme="light"] button:not(.theme-switch button):not(.login-submit){background:#e5f2f8;color:#096c9d;border-color:#8cb9d1}
@media(max-width:1200px){.kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:680px){
 .login-card{padding:26px 24px}.login-heading{gap:12px}.login-heading h1{font-size:24px}.login-heading p{font-size:12px}
 .topbar{padding:14px}.brand-row{gap:6px}.brand{gap:7px}.brand strong{font-size:20px}.brand-icon{font-size:22px}
 .theme-switch button{font-size:10px;padding:7px 6px}
 .dashboard-title{font-size:15px;margin:12px 0 9px}
 .kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:360px){.brand-row{flex-wrap:wrap}}
