/* Dockbare UI — no build step, no external assets. */
:root {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f7;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #dbeafe;
  --primary-text: #1e40af;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --success-text: #166534;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --warning-text: #92400e;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --danger-text: #991b1b;
  --info-soft: #e0f2fe;
  --info-text: #075985;
  --sidebar-bg: #0f172a;
  --sidebar-text: #cbd5e1;
  --sidebar-muted: #64748b;
  --sidebar-active: rgba(255,255,255,.08);
  --sidebar-hover: rgba(255,255,255,.05);
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.04);
  --shadow-lg: 0 10px 30px rgba(15,23,42,.18);
  --radius: 10px;
  --radius-sm: 7px;
  --ring: 0 0 0 3px rgba(37,99,235,.25);
}
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #111a2e;
  --surface-2: #16213a;
  --surface-3: #1c2742;
  --border: #233049;
  --border-strong: #34425f;
  --text: #e5eaf3;
  --text-2: #b4bfd3;
  --muted: #8593ad;
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-soft: #1e3a8a;
  --primary-text: #bfdbfe;
  --success: #22c55e;
  --success-soft: #14532d;
  --success-text: #bbf7d0;
  --warning: #f59e0b;
  --warning-soft: #78350f;
  --warning-text: #fde68a;
  --danger: #ef4444;
  --danger-soft: #7f1d1d;
  --danger-text: #fecaca;
  --info-soft: #0c4a6e;
  --info-text: #bae6fd;
  --sidebar-bg: #0a0f1d;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 20px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0 0 10px; }
code, pre { font-family: var(--mono); font-size: 12.5px; }
pre { margin: 0; white-space: pre-wrap; word-break: break-word; }
hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.gap-2 { gap: 4px; } .gap-4 { gap: 16px; }
.mt { margin-top: 12px; } .mb { margin-bottom: 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* icons */
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.icon.sm { width: 15px; height: 15px; }
.icon.lg { width: 22px; height: 22px; }
.icon.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex: none; background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column; padding: 16px 12px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; color: #fff; }
.brand img { width: 30px; height: 30px; }
.brand .name { font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.brand .ver { color: var(--sidebar-muted); font-size: 11px; margin-left: 4px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: var(--sidebar-text); font-weight: 500; font-size: 13.5px;
}
.nav a:hover { background: var(--sidebar-hover); text-decoration: none; color: #fff; }
.nav a.active { background: var(--sidebar-active); color: #fff; }
.nav a .icon { opacity: .85; }
.nav .badge { margin-left: auto; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-foot button { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; color: var(--sidebar-text); padding: 8px 10px; border-radius: 8px; cursor: pointer; font: inherit; font-size: 13px; }
.sidebar-foot button:hover { background: var(--sidebar-hover); color: #fff; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 14px 24px; background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20;
}
.topbar .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.page { padding: 22px 24px 60px; max-width: 1280px; width: 100%; }
.menu-btn { display: none; }
.backdrop-nav { display: none; }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: none; }
  .backdrop-nav.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 30; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .page { padding: 16px 16px 60px; }
}

/* cards & grids */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.card-h h2 { font-size: 14px; }
.card-h .actions { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.card-c { padding: 16px; }
.card-c.tight { padding: 0; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.cols-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
@media (max-width: 1100px) { .cols-4, .cols-5 { grid-template-columns: repeat(2, minmax(0,1fr)); } .cols-3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 640px) { .cols-2, .cols-3, .cols-4, .cols-5 { grid-template-columns: 1fr; } }

.stat { padding: 14px 16px; }
.stat .label { color: var(--muted); font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 24px; font-weight: 650; letter-spacing: -.02em; margin-top: 4px; }
.stat .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* banners */
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); border: 1px solid; margin-bottom: 14px; font-size: 13px; }
.banner .icon { margin-top: 1px; }
.banner.warn { background: var(--warning-soft); border-color: rgba(217,119,6,.35); color: var(--warning-text); }
.banner.danger { background: var(--danger-soft); border-color: rgba(220,38,38,.35); color: var(--danger-text); }
.banner.info { background: var(--info-soft); border-color: rgba(14,116,144,.3); color: var(--info-text); }
.banner.success { background: var(--success-soft); border-color: rgba(22,163,74,.35); color: var(--success-text); }
.banner code { background: rgba(0,0,0,.08); padding: 1px 5px; border-radius: 4px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 12px; font: inherit; font-size: 13px; font-weight: 500;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer;
  transition: background .12s, border-color .12s, box-shadow .12s; white-space: nowrap; line-height: 1.2;
}
.btn:hover { background: var(--surface-2); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }
.btn-danger-ghost { color: var(--danger); border-color: transparent; background: transparent; }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-3); }
.btn-sm { padding: 4px 8px; font-size: 12px; }
.btn-sm .icon { width: 14px; height: 14px; }
.btn-icon { padding: 5px; width: 30px; height: 30px; }
.btn-icon.btn-sm { width: 26px; height: 26px; padding: 3px; }
.btn.loading { pointer-events: none; opacity: .8; }

/* forms */
label.field { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-2); margin-bottom: 4px; }
.input, select, textarea, input[type=text], input[type=password], input[type=number], input[type=time], input[type=date], input[type=datetime-local], input[type=email], input[type=url], input[type=search] {
  width: 100%; padding: 7px 10px; font: inherit; font-size: 13.5px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); outline: none; transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: var(--ring); }
input[readonly] { background: var(--surface-2); color: var(--muted); }
textarea { min-height: 80px; resize: vertical; font-family: var(--mono); font-size: 12px; }
select { -webkit-appearance: none; -moz-appearance: none; appearance: none; background-color: var(--surface); background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2716%27%20height%3D%2716%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%2364748b%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27m6%209%206%206%206-6%27%2F%3E%3C%2Fsvg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-position-x: calc(100% - 8px); background-position-y: 50%; background-size: 16px 16px; padding-right: 30px; }
select::-ms-expand { display: none; }
select option { background: var(--surface); color: var(--text); }
select:disabled { opacity: .7; }
.form-row { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-row.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
@media (max-width: 560px) { .form-row, .form-row.cols-3 { grid-template-columns: 1fr; } }
.form-group { margin-bottom: 12px; }
.help { color: var(--muted); font-size: 12px; margin-top: 4px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); margin: 0; }
.check-list { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow: auto; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.input-group { position: relative; }
.input-group .btn-icon { position: absolute; right: 3px; top: 3px; width: 26px; height: 26px; }
.input-group input { padding-right: 34px; }
.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--border-strong); border-radius: 20px; transition: .15s; cursor: pointer; }
.switch .track:before { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track:before { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 6px 10px; font: inherit; font-size: 12.5px; cursor: pointer; color: var(--text-2); }
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button.active { background: var(--primary); color: #fff; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); font-size: 13px; }
th { color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td .actions { display: flex; gap: 2px; justify-content: flex-end; }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); }
.empty .icon { width: 28px; height: 28px; opacity: .5; margin-bottom: 6px; }

/* badges / pills */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.5; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge .icon { width: 12px; height: 12px; }
.badge.ok, .badge.success { background: var(--success-soft); color: var(--success-text); }
.badge.warn, .badge.warning { background: var(--warning-soft); color: var(--warning-text); }
.badge.danger, .badge.error, .badge.failed { background: var(--danger-soft); color: var(--danger-text); }
.badge.info, .badge.primary { background: var(--primary-soft); color: var(--primary-text); }
.badge.outline { background: transparent; border: 1px solid var(--border-strong); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--success); } .dot.warn { background: var(--warning); } .dot.bad { background: var(--danger); } .dot.off { background: var(--border-strong); } .dot.info { background: var(--primary); }
.pills { display: flex; gap: 4px; flex-wrap: wrap; }

/* progress */
.progress { height: 6px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.progress > div { height: 100%; background: var(--primary); border-radius: 6px; transition: width .3s; }
.progress.indeterminate > div { width: 40%; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
.progress.ok > div { background: var(--success); }
.progress.bad > div { background: var(--danger); }

/* volume cards */
.vol { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 10px; box-shadow: var(--shadow); }
.vol-h { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0,1.2fr) minmax(0,1fr) minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; cursor: pointer; }
.vol-h:hover { background: var(--surface-2); }
.vol-h .name { font-weight: 600; display: flex; align-items: center; gap: 8px; min-width: 0; }
.vol-h .name span.ellipsis { min-width: 0; }
.vol-h .sub { color: var(--muted); font-size: 12px; }
.vol-h .cell-label { display: none; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.vol-b { border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.vol-b .table-wrap { background: var(--surface); }
.vol-toolbar { display: flex; gap: 6px; padding: 8px 12px; flex-wrap: wrap; align-items: center; }
.ctr { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); background: var(--surface-3); padding: 1px 7px 1px 5px; border-radius: 999px; }
@media (max-width: 900px) {
  .vol-h { grid-template-columns: 1fr 1fr; }
  .vol-h .cell-label { display: block; }
  .vol-h > .act { grid-column: 1 / -1; justify-content: flex-end; }
}

/* events */
.events { display: flex; flex-direction: column; }
.event { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; align-items: start; }
.event:last-child { border-bottom: 0; }
.event .dot { margin-top: 6px; }
.event .time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.event .kind { color: var(--muted); font-size: 11.5px; font-family: var(--mono); }
.level-info .dot { background: var(--primary); }
.level-success .dot { background: var(--success); }
.level-warning .dot { background: var(--warning); }
.level-error .dot { background: var(--danger); }

/* list */
.list { display: flex; flex-direction: column; }
.list > div { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.list > div:last-child { border-bottom: 0; }

/* modals */
.modal-backdrop { position: fixed; inset: 0; background: rgba(2,6,23,.55); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); border: 1px solid var(--border); animation: pop .14s ease-out; }
.modal.wide { max-width: 860px; }
.modal.xl { max-width: 1100px; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-h h2 { font-size: 15px; }
.modal-h .close { margin-left: auto; }
.modal-c { padding: 18px; overflow: auto; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 14px 14px; flex-wrap: wrap; }
.modal-f .left { margin-right: auto; }

/* toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 200; max-width: 380px; }
.toast { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-left: 4px solid var(--primary); padding: 10px 12px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13px; display: flex; gap: 8px; align-items: flex-start; animation: pop .15s; }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

/* task bar */
.taskbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 150; display: flex; flex-direction: column; gap: 6px; width: min(560px, calc(100vw - 32px)); }
.task { background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; padding: 8px 12px; box-shadow: var(--shadow-lg); cursor: pointer; font-size: 13px; }
.task .t { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.task .t .icon { color: var(--primary); }
.task .meta { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; }
@media (max-width: 900px) { .taskbar { bottom: 8px; } .toasts { right: 8px; bottom: 8px; left: 8px; max-width: none; } }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 8px 14px; font: inherit; font-size: 13.5px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tabs button:hover { color: var(--text); }

/* misc */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-all; }
.log { background: #0b1120; color: #cbd5e1; border-radius: 8px; padding: 10px 12px; font-family: var(--mono); font-size: 12px; max-height: 50vh; overflow: auto; white-space: pre-wrap; }
html[data-theme="dark"] .log { background: #05080f; }
.spark { width: 100%; height: 64px; }
.spark path { fill: none; stroke: var(--primary); stroke-width: 2; }
.spark .area { fill: var(--primary); opacity: .12; stroke: none; }
.search { position: relative; }
.search .icon { position: absolute; left: 9px; top: 8px; color: var(--muted); }
.search input { padding-left: 30px; }
.sortable { cursor: pointer; }
.tag { font-family: var(--mono); font-size: 11.5px; background: var(--surface-3); padding: 1px 6px; border-radius: 4px; }
.dropdown { position: relative; }
.dropdown .menu { position: absolute; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--shadow-lg); min-width: 180px; z-index: 50; padding: 4px; display: none; }
.dropdown.open .menu { display: block; }
.dropdown .menu button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 6px; font: inherit; font-size: 13px; color: var(--text); cursor: pointer; }
.dropdown .menu button:hover { background: var(--surface-2); }
.dropdown .menu button.danger { color: var(--danger); }
.dropdown .menu hr { margin: 4px 0; }

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(1200px 600px at 20% -10%, rgba(37,99,235,.18), transparent), var(--bg); }
.login { width: 100%; max-width: 380px; }
.login .card-c { padding: 24px; }
.login .brand { color: var(--text); padding: 0 0 18px; justify-content: center; }
.login .brand .name { font-size: 20px; }
.login .err { margin-top: 8px; }

/* collapsible sidebar (desktop) */
.menu-btn { display: inline-flex; }
@media (min-width: 901px) {
  .app.collapsed .sidebar { width: 64px; padding: 16px 8px; }
  .app.collapsed .lbl, .app.collapsed .brand .name, .app.collapsed .brand .ver { display: none; }
  .app.collapsed .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .app.collapsed .nav a, .app.collapsed .sidebar-foot button { justify-content: center; padding-left: 0; padding-right: 0; }
}
.win { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); opacity: .8; }

/* date/time inputs: native picker icon matches the theme */
input[type=time], input[type=date], input[type=datetime-local] { font-variant-numeric: tabular-nums; min-height: 36px; }
input[type=time]::-webkit-calendar-picker-indicator, input[type=date]::-webkit-calendar-picker-indicator, input[type=datetime-local]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .7; }
input[type=time]::-webkit-calendar-picker-indicator:hover, input[type=date]::-webkit-calendar-picker-indicator:hover, input[type=datetime-local]::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* file picker */
.file { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); cursor: pointer; transition: border-color .12s, background .12s; }
.file:hover, .file.drag { border-color: var(--primary); background: var(--primary-soft); }
.file input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.file .file-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border-strong); font-size: 13px; font-weight: 500; }
.file .file-name { color: var(--muted); font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file.has-file .file-name { color: var(--text); }
.file .file-hint { margin-left: auto; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.file:focus-within { box-shadow: var(--ring); border-style: solid; }

/* ================= availability bars (status colours are fixed, not themed) ================= */
.ubars { display: block; width: 100%; height: 24px; }
.ub { shape-rendering: geometricPrecision; transition: opacity .1s; }
.ub-ok { fill: #16a34a; } .ub-warn { fill: #f59e0b; } .ub-bad { fill: #dc2626; } .ub-na { fill: var(--surface-3); }
html[data-theme="dark"] .ub-na { fill: #1f2a44; }
.ubars:hover .ub { opacity: .55; } .ubars .ub:hover { opacity: 1; }
.ub-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
i.ub-ok { background: #16a34a; } i.ub-warn { background: #f59e0b; } i.ub-bad { background: #dc2626; } i.ub-na { background: var(--surface-3); border: 1px solid var(--border-strong); }
.ub-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; }
.ub-axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.ubars-sm { height: 14px; margin: 0; min-width: 120px; }
.st-tip { position: fixed; z-index: 500; pointer-events: none; background: var(--text); color: var(--bg); padding: 6px 9px; border-radius: 7px; font-size: 12px; line-height: 1.35; box-shadow: var(--shadow-lg); max-width: 260px; opacity: 0; transition: opacity .08s; white-space: pre-line; }
.st-tip.show { opacity: 1; }


/* ================= public status page ================= */
.status-wrap { min-height: 100vh; padding: 24px 16px 56px; background: var(--bg); }
.status { max-width: 860px; margin: 0 auto; }
.st-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.st-head .brand { padding: 0; color: var(--text); min-width: 0; }
.st-head .brand .name { font-size: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-head .st-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.st-tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-3); border-radius: 999px; margin-bottom: 16px; }
.st-tabs a { padding: 7px 18px; border-radius: 999px; color: var(--muted); font-weight: 500; font-size: 13.5px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.st-tabs a:hover { color: var(--text); text-decoration: none; }
.st-tabs a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.st-tabs .count:empty { display: none; }
.st-tabs .count { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 11px; text-align: center; }
.st-tabs a.active .count { background: var(--primary-soft); color: var(--primary-text); }

.st-hero { display: flex; align-items: center; gap: 18px; padding: 22px 24px; border-radius: 18px; color: #fff; box-shadow: var(--shadow-lg); margin-bottom: 10px; }
.st-hero .icon { width: 40px; height: 40px; stroke-width: 2.2; flex: none; }
.st-hero h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: #fff; line-height: 1.2; }
.st-hero p { margin: 6px 0 0; opacity: .92; font-size: 14px; line-height: 1.45; }
.st-hero .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.st-hero .chip { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); color: #fff; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.st-hero--operational { background: #15803d; }
.st-hero--degraded { background: #b45309; }
.st-hero--outage { background: #b91c1c; }
.st-hero--maintenance { background: #1d4ed8; }
.st-hero--unknown { background: #475569; }

.st-notice { display: block; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--border); border-left: 5px solid; background: var(--surface); box-shadow: var(--shadow); margin-bottom: 8px; color: var(--text); }
.st-notice:hover { text-decoration: none; background: var(--surface-2); }
.st-notice--danger { border-left-color: #dc2626; } .st-notice--warn { border-left-color: #f59e0b; } .st-notice--info { border-left-color: #2563eb; }
.st-notice .n-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.st-notice .n-top b { flex: 1 1 160px; min-width: 0; }
.st-notice .more { margin-left: auto; color: var(--muted); display: inline-flex; }
.st-notice .n-sub { margin-top: 6px; color: var(--text-2); font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.st-notice .n-sub .st { font-weight: 500; color: var(--text); }
#notices:empty { display: none; }

.st-section { margin-top: 16px; }
.st-section-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 2px 8px; }
.st-section-h h2 { font-size: 15px; }
.st-section-h .muted { margin-left: auto; font-size: 12.5px; }

.st-group { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; }
.st-group-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.st-group-h h2 { font-size: 14px; }
.st-group-h .muted { margin-left: auto; font-size: 12px; }
.st-svc { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.st-svc:last-child { border-bottom: 0; }
.st-svc:hover { background: var(--surface-2); }
.st-svc .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.st-svc .name { font-size: 15px; min-width: 0; }
.st-svc .dot { width: 10px; height: 10px; }
.st-svc .dot.bad { box-shadow: 0 0 0 4px rgba(220,38,38,.18); }
.st-svc .dot.ok { box-shadow: 0 0 0 4px rgba(22,163,74,.15); }
.st-svc .stats { margin-left: auto; display: inline-flex; gap: 14px; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text-2); white-space: nowrap; }
.st-svc .stats em { font-style: normal; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-right: 4px; }
.st-svc .since { color: var(--danger); font-size: 12.5px; margin: -4px 0 8px; }
.st-svc .ubars { height: 22px; }
.st-empty { padding: 22px; text-align: center; color: var(--muted); }

.st-overview { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); padding: 14px 18px 16px; }
.st-overview .st-section-h { margin: 0 0 10px; }
.st-overview .st-section-h h2 { font-size: 13px; color: var(--text-2); }
.st-overview .ubars { height: 22px; }

.st-ann { display: block; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--border); border-left: 6px solid; background: var(--surface); box-shadow: var(--shadow); margin-bottom: 10px; }
.st-ann--major { border-left-color: #dc2626; }
.st-ann--minor { border-left-color: #f59e0b; }
.st-ann--maintenance { border-left-color: #2563eb; }
.st-ann--resolved { border-left-color: #16a34a; }
.st-ann .t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-ann .t b { font-size: 16px; line-height: 1.3; flex: 1 1 200px; min-width: 0; }
.st-ann .msg { margin-top: 6px; white-space: pre-wrap; font-size: 13.5px; }
.st-ann .meta { margin-top: 8px; color: var(--text-2); font-size: 12.5px; display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; }
.st-ann .meta .live { margin: 0 10px 0 6px; }
.st-ann .steps { display: flex; gap: 4px; margin-top: 10px; flex-wrap: wrap; }
.st-ann .steps span { font-size: 11px; padding: 3px 9px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.st-ann .steps span.done { background: var(--success-soft); color: var(--success-text); }
.st-ann .steps span.now { background: var(--text); color: var(--bg); font-weight: 600; }
.st-ann .upd { display: grid; grid-template-columns: 120px 1fr; gap: 4px 14px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.st-ann .upd:first-of-type { margin-top: 12px; }
.st-ann .upd .st { font-weight: 600; }
.st-ann .upd .tm { color: var(--muted); font-size: 12px; }
.st-ann .upd .m { white-space: pre-wrap; line-height: 1.5; }
.upd-toggle { margin-top: 6px; }
.badge.solid-danger { background: #dc2626; color: #fff; }
.badge.solid-warn { background: #f59e0b; color: #431407; }
.badge.solid-info { background: #2563eb; color: #fff; }
.badge.solid-ok { background: #16a34a; color: #fff; }
.live { position: relative; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #dc2626; margin: 0 6px 0 4px; flex: none; vertical-align: middle; }
.live::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #dc2626; opacity: .6; animation: ping 1.4s ease-out infinite; }
@keyframes ping { 0% { transform: scale(.5); opacity: .8; } 100% { transform: scale(1.6); opacity: 0; } }

.st-day { margin-bottom: 16px; }
.st-day h3 { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 0 2px 6px; }
.st-tl { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.st-tl .item { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); align-items: start; }
.st-tl .item:last-child { border-bottom: 0; }
.st-tl .item .dot { margin-top: 5px; }
.st-tl .item .when { color: var(--muted); font-size: 12.5px; text-align: right; white-space: nowrap; }
.st-tl .item .msg { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.st-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 24px; }
.st-foot a { color: inherit; }

@media (max-width: 600px) {
  .status-wrap { padding: 16px 12px 48px; }
  .st-head .brand .name { font-size: 19px; }
  .st-head .brand img { width: 26px; height: 26px; }
  .st-tabs { display: flex; width: 100%; }
  .st-tabs a { flex: 1; padding: 8px 10px; }
  .st-hero { flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px; border-radius: 16px; }
  .st-hero .icon { width: 34px; height: 34px; }
  .st-hero h1 { font-size: 21px; }
  .st-hero p { font-size: 13.5px; }
  .st-section-h .muted, .st-group-h .muted { flex-basis: 100%; margin-left: 0; }
  .st-svc { padding: 12px 14px; }
  .st-svc .stats { flex-basis: 100%; margin-left: 0; justify-content: space-between; gap: 8px; order: 3; padding-top: 2px; }
  .st-svc .stats em { margin-right: 3px; }
  .st-svc .row .badge { margin-left: auto; }
  .st-svc .row { gap: 8px; }
  .st-notice .n-top b { flex-basis: 100%; order: 3; font-size: 15px; }
  .st-notice .n-top .more { order: 2; }
  .st-ann { padding: 14px; }
  .st-ann .upd { grid-template-columns: 1fr; gap: 2px; }
  .st-tl .item { grid-template-columns: 14px 1fr; }
  .st-tl .item .when { grid-column: 2; text-align: left; }
  .st-overview { padding: 12px 14px 14px; }
}

/* compact status line (replaces the hero) */
.st-status { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; border: 1px solid; margin-bottom: 10px; font-weight: 600; font-size: 15px; }
.st-status .icon { width: 22px; height: 22px; flex: none; }
.st-status .txt { flex: 1; min-width: 0; }
.st-status .chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.st-status .chip { font-size: 11.5px; font-weight: 500; padding: 2px 9px; border-radius: 999px; background: rgba(255,255,255,.55); border: 1px solid rgba(0,0,0,.06); }
html[data-theme="dark"] .st-status .chip { background: rgba(0,0,0,.25); border-color: rgba(255,255,255,.12); }
.st-status--operational { background: var(--success-soft); border-color: rgba(22,163,74,.35); color: var(--success-text); }
.st-status--degraded { background: var(--warning-soft); border-color: rgba(217,119,6,.4); color: var(--warning-text); }
.st-status--outage { background: var(--danger-soft); border-color: rgba(220,38,38,.4); color: var(--danger-text); }
.st-status--maintenance { background: var(--info-soft); border-color: rgba(37,99,235,.35); color: var(--info-text); }
.st-status--unknown { background: var(--surface-3); border-color: var(--border); color: var(--text-2); }
@media (max-width: 600px) { .st-status { flex-wrap: wrap; font-size: 14.5px; } .st-status .chips { flex-basis: 100%; justify-content: flex-start; padding-left: 32px; } }

/* announcements list (app) */
.ann-row { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.ann-row:last-child { border-bottom: 0; }
.ann-row.closed { opacity: .85; }
.ann-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ann-head .ann-title { font-size: 14px; }
.ann-head .actions { margin-left: auto; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.ann-updates { margin: 10px 0 0 4px; padding-left: 12px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.ann-upd { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.ann-upd .grow { white-space: pre-wrap; }
.ann-past { border-top: 1px solid var(--border); }
.ann-past summary { padding: 10px 16px; cursor: pointer; color: var(--muted); font-size: 13px; background: var(--surface-2); }
.ann-past summary:hover { color: var(--text); }
.st-status .chip .icon, .st-notice .icon, .st-ann .icon, .st-group-h .icon, .st-section-h .icon, .st-tl .icon, .st-foot .icon, .st-svc .since .icon { vertical-align: -2px; }
.st-status .chip .lbl { display: none; }
@media (min-width: 601px) { .st-status .chip .lbl { display: inline; } }
.st-ann .steps span .icon { width: 12px; height: 12px; vertical-align: -2px; }
.st-svc .row .badge.ok .icon { width: 13px; height: 13px; }
.st-tabs .icon { width: 15px; height: 15px; }
.st-tl .item .when .icon { width: 12px; height: 12px; }

/* detected outages + announcement stepper (app) */
.inc-row { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.inc-row:last-child { border-bottom: 0; }
.inc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inc-head .actions { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inc-out { margin-top: 8px; }
.inc-out code { display: block; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; font-size: 12px; white-space: pre-wrap; word-break: break-word; color: var(--text-2); }
.stepper { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.stepper .step { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.stepper .step:hover { color: var(--text); background: var(--surface-2); }
.stepper .step.done { background: var(--success-soft); color: var(--success-text); border-color: transparent; }
.stepper .step.now { background: var(--text); color: var(--bg); border-color: var(--text); cursor: default; font-weight: 600; }
.stepper .step:disabled { opacity: 1; }
.stepper .btn { margin-left: auto; }
.ann-head .actions { margin-left: auto; }
.ann-upd { width: 100%; text-align: left; border: 1px solid transparent; background: none; font: inherit; color: var(--text); padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.ann-upd:hover { background: var(--surface-2); border-color: var(--border); }
.ann-upd > .icon:last-child { color: var(--muted); opacity: 0; }
.ann-upd:hover > .icon:last-child { opacity: 1; }
.ann-updates { gap: 2px; }
.status-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.status-pick .sp { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-strong); cursor: pointer; font-size: 13px; }
.status-pick .sp input { position: absolute; opacity: 0; width: 0; height: 0; }
.status-pick .sp:has(input:checked) { background: var(--primary); color: #fff; border-color: var(--primary); }
.status-pick .sp.cur:not(:has(input:checked)) { border-style: dashed; }
.estimate { padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.estimate .icon { vertical-align: -3px; }
.check-list .vsize { margin-left: auto; white-space: nowrap; }
.quiet-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 6px; background: var(--surface-2); }
.quiet-row input[type=text] { flex: 1 1 160px; }
.quiet-row input[type=time] { width: 110px; }
.quiet-row select { width: 180px; }
.quiet-row .qdays { display: inline-flex; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.quiet-row .qdays .check { gap: 3px; }
