/* Schirm – light dashboard with floating panels. No build step, no external assets. */
:root {
  --bg: #e9edf3;
  --stage: #f4f6fa;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --line: #e6eaf0;
  --line-2: #d6dce5;
  --text: #1b2330;
  --text-2: #4a5568;
  --muted: #7b8698;
  --accent: #0f6b78;
  --accent-2: #0c5460;
  --accent-soft: #e7f0f2;
  --accent-ring: #b7d3d7;
  --track: #e8edf4;
  /* categorical (validated, fixed order) */
  --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100;
  --c5: #e87ba4; --c6: #008300; --c7: #4a3aa7; --c8: #e34948;
  /* status (reserved) */
  --good: #0ca30c; --good-ink: #0a7a0a; --good-soft: #e6f6e6;
  --warning: #fab219; --warning-ink: #9a6400; --warning-soft: #fff4dc;
  --critical: #d03b3b; --critical-ink: #b42f2f; --critical-soft: #fdeaea;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(30, 45, 70, .04), 0 8px 24px rgba(30, 45, 70, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 15px; margin: 0; font-weight: 650; }
h3 { font-size: 12px; margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.dim { color: var(--muted); }
.small { font-size: 12.5px; }
.block { display: block; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.text-bad { color: var(--critical-ink); }
.text-ok { color: var(--good-ink); }
.text-warn { color: var(--warning-ink); }
.mt { margin-top: 18px; }
.pad { padding: 0 20px 16px; }
.pad-lg { padding: 28px 20px; }
.icon { flex: none; vertical-align: -3px; }

/* ---------------- Shell: floating sidebar + stage ---------------- */
.shell > * { min-width: 0; }
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 22px; padding: 22px; min-height: 100vh; align-items: start; }
.sidebar { position: sticky; top: 22px; max-height: calc(100vh - 44px); overflow-y: auto; scrollbar-width: thin; background: var(--panel); border-radius: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; padding: 22px 14px 16px; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; color: var(--text); }
.side-brand:hover { text-decoration: none; }
.side-logo { max-width: 100%; max-height: 54px; object-fit: contain; }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 19px; font-weight: 800; letter-spacing: .02em; color: var(--accent); }
.brand-text em { font-style: normal; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.nav-group { display: flex; flex-direction: column; gap: 1px; margin-bottom: 10px; }
.nav-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); padding: 6px 14px 4px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary.nav-label { cursor: pointer; }
summary.nav-label::-webkit-details-marker { display: none; }
summary.nav-label::after { content: "▾"; font-size: 10px; margin-left: 6px; }
details:not([open]) > summary.nav-label::after { content: "▸"; }
summary.nav-label span { margin-left: auto; font-weight: 600; }
.site-link-nav { font-size: 13px !important; padding: 6px 14px !important; }
.site-link-nav span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.site-link-nav i { width: 8px; height: 8px; border-radius: 50%; flex: none; margin: 0 4px 0 5px; }
.dot-ok { background: var(--good); } .dot-warn { background: var(--warning); } .dot-bad { background: var(--critical); } .dot-muted { background: var(--line-2); }
.side-company { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-2); padding: 8px 14px 0; border-top: 1px solid var(--line); line-height: 1.4; }
.side-company span { display: block; font-weight: 500; font-style: italic; color: var(--accent); }
.side-company:hover { text-decoration: none; color: var(--accent); }
.stage-foot { padding: 0 30px 22px; font-size: 12px; color: var(--muted); }
.link-card { display: flex; align-items: center; gap: 14px; padding: 22px; color: var(--text); margin: 0; }
.link-card:hover { text-decoration: none; box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow); }
.link-card .icon { color: var(--accent); }
.link-card strong { display: block; }
.link-card span { display: block; }
.logo-preview { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 10px; border: 1px dashed var(--line-2); border-radius: 12px; align-self: end; }
.logo-preview img { max-height: 48px; max-width: 100%; }
input[type=file] { padding: 7px; }
.profile { display: flex; align-items: center; gap: 12px; margin: 0 4px 16px; padding: 12px; background: var(--panel-2); border-radius: 14px; }
.profile-avatar { width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 17px; font-weight: 700; color: #fff; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 4px var(--accent-ring); }
.profile-avatar:hover { text-decoration: none; }
.profile-name { font-weight: 650; line-height: 1.2; }
.profile-role { font-size: 12px; color: var(--muted); }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 8px 14px; border-radius: 11px; color: var(--text-2); font-weight: 500; font-size: 13.5px; }
.side-nav a:hover { background: var(--panel-2); text-decoration: none; color: var(--text); }
.side-nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.side-nav a.active .icon { color: var(--accent); }
.side-nav .icon { color: var(--muted); }
.nav-badge { margin-left: auto; font-style: normal; font-size: 11.5px; font-weight: 700; min-width: 22px; text-align: center; padding: 1px 7px; border-radius: 999px; }
.nav-badge-warn { background: var(--warning-soft); color: var(--warning-ink); }
.nav-badge-bad { background: var(--critical-soft); color: var(--critical-ink); }
.nav-badge-info { background: var(--accent-soft); color: var(--accent); }
.nav-badge-muted { background: var(--panel-2); color: var(--muted); }
.side-foot { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.side-foot form { margin: 0; }
.cron-state { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding: 0 14px; }
.cron-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.cron-state.warn i { background: var(--warning); }
.logout { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: 0; padding: 10px 14px; border-radius: 12px; font: 500 14px var(--font); color: var(--text-2); cursor: pointer; }
.logout:hover { background: var(--panel-2); color: var(--text); }

.stage { background: var(--stage); border-radius: 26px; box-shadow: var(--shadow); min-width: 0; min-height: calc(100vh - 44px); }
.stage-head { display: grid; grid-template-columns: auto minmax(200px, 460px) auto; justify-content: space-between; align-items: center; gap: 24px; padding: 26px 30px 6px; }
.page-title { font-size: 28px; font-weight: 800; letter-spacing: -.01em; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
.global-search { display: flex; border: 1.5px solid var(--line-2); border-radius: 10px; background: var(--panel); overflow: hidden; }
.global-search input { border: 0; border-radius: 0; background: transparent; padding: 9px 14px; }
.global-search input:focus { box-shadow: none; }
.global-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.global-search button { border: 0; border-left: 1.5px solid var(--line-2); background: var(--panel-2); color: var(--text-2); padding: 0 14px; cursor: pointer; }
.user-chip { display: flex; align-items: center; gap: 12px; background: var(--panel); border-radius: 999px; padding: 6px 6px 6px 18px; box-shadow: var(--shadow); }
.user-chip strong { display: block; font-size: 14px; line-height: 1.2; }
.chip-icons { display: flex; gap: 8px; justify-content: center; margin-top: 2px; }
.chip-icons a { color: var(--muted); }
.chip-icons a:hover { color: var(--accent); }
.chip-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; box-shadow: 0 0 0 3px var(--accent-soft); }

.main { padding: 18px 30px 36px; }

/* ---------------- Page head (sub pages) ---------------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { display: none; }
.page-head p { margin: 2px 0 0; }
.back { display: inline-block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions form { margin: 0; }

/* ---------------- Cards ---------------- */
.card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 22px; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card.narrow { max-width: 660px; padding: 24px; }
.card.empty { padding: 48px 24px; text-align: center; }
.card.empty h2 { font-size: 18px; margin-bottom: 6px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: start; }
.grid-2 > .card, .grid-3 > .card { margin-bottom: 0; }
.grid-2 + .card, .grid-2 + .grid-2, .grid-3 + .card { margin-top: 22px; }
.grid-wide-left { grid-template-columns: 1.6fr 1fr; }
.stack .grid-2 { gap: 12px; }

/* ---------------- Dashboard widgets ---------------- */
.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 22px; margin-bottom: 22px; }
.dash-grid > .card { margin: 0; }
.w-main { grid-column: span 8; }
.w-side { grid-column: span 4; }
.w-half { grid-column: span 6; }
.w-area { grid-column: span 5; }
.w-donut { grid-column: span 4; }
.w-cal { grid-column: span 3; }
.widget { padding: 20px 22px; }
.widget-top { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; }
.widget-title { font-size: 24px; font-weight: 400; letter-spacing: -.01em; }
.rings { display: flex; gap: 18px; flex-wrap: wrap; }
.ring-item { display: flex; align-items: center; gap: 8px; }
.ring-item strong { display: block; font-size: 12.5px; line-height: 1.2; }
.ring-item span { display: block; font-size: 11px; color: var(--muted); line-height: 1.3; max-width: 110px; }
.ring-track { fill: none; stroke: var(--track); stroke-width: 5; }
.ring-value { fill: none; stroke-width: 5; stroke-linecap: round; }
.ring-good { stroke: var(--accent); }
.ring-warning { stroke: var(--warning); }
.ring-critical { stroke: var(--critical); }
.ring-muted { stroke: var(--line-2); }
.ring-accent { stroke: var(--accent); }
.ring-text { font-weight: 700; font-family: var(--font); fill: var(--text); }

.filters-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filter-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; padding: 3px 12px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--text-2); background: var(--panel); }
.filter-pill:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.filter-pill.active, .filter-pill.static { background: var(--accent); border-color: var(--accent); color: #fff; }
.filter-pill.static { cursor: default; }
.filter-pill.static::after { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.8); }

.perf { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 18px; align-items: start; }
.site-mini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.site-mini li { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 7px 8px 7px 12px; box-shadow: 0 2px 6px rgba(30,45,70,.05); }
.site-mini a { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; flex: 1; min-width: 0; color: var(--text); }
.site-mini a:hover { text-decoration: none; }
.mini-name { grid-column: 1 / -1; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.mini-name i, .legend i, .donut-legend i, .stat-row i { width: 9px; height: 9px; border-radius: 3px; flex: none; display: inline-block; }
.mini-ms { font-size: 11px; color: var(--muted); align-self: center; font-variant-numeric: tabular-nums; }
.spark { display: block; }

.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { font: 11px var(--font); fill: var(--muted); }
.chart .line { stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { stroke: var(--panel); stroke-width: 2; }
.chart .area-soft { opacity: .12; }
.chart .area { opacity: .55; stroke: none; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .crosshair { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; pointer-events: none; }
.chart .bar, .chart .slice { cursor: pointer; transition: opacity .12s; }
.chart .bar:hover, .chart .slice:hover { opacity: .8; }
.chart .slice { stroke: var(--panel); stroke-width: 2; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; padding: 0; font-size: 12px; color: var(--text-2); }
.legend li { display: flex; align-items: center; gap: 6px; }

.gauge-wrap { text-align: center; padding: 0 6px; }
.gauge { max-width: 300px; margin: 0 auto; }
.gauge-track { fill: none; stroke: var(--track); stroke-width: 22; }
.gauge-value { fill: none; stroke-width: 22; }
.gauge-good { stroke: var(--accent); }
.gauge-warning { stroke: var(--warning); }
.gauge-critical { stroke: var(--critical); }
.needle { fill: var(--accent-2); }
.needle-hub { fill: var(--accent); stroke: var(--panel); stroke-width: 3; }
.gauge-pct { font: 700 26px var(--font); fill: var(--accent); }
.gauge-caption { margin: -2px 0 10px; }
.gauge-facts { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 16px; padding: 0; }
.gauge-facts li { background: var(--panel-2); border-radius: 10px; padding: 6px 4px; }
.gauge-facts strong { display: block; font-size: 17px; }
.gauge-facts span { font-size: 11px; color: var(--muted); }
.subhead { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; font-weight: 600; color: var(--text-2); border-top: 1px solid var(--line); padding-top: 14px; margin-bottom: 6px; }
.subhead a { font-weight: 500; font-size: 12px; }

.stat-row { display: flex; gap: 22px; flex-wrap: wrap; margin: 2px 0 8px; }
.stat-row div { display: grid; grid-template-columns: auto auto; gap: 0 6px; align-items: center; }
.stat-row strong { font-size: 20px; }
.stat-row span { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted); }

.w-split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; }
.donut-wrap { display: flex; align-items: center; gap: 14px; }
.donut { width: 132px; flex: none; }
.donut-value { font: 700 26px var(--font); fill: var(--text); }
.donut-label { font: 12px var(--font); fill: var(--muted); }
.donut-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; flex: 1; font-size: 12.5px; }
.donut-legend li { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.donut-legend strong { white-space: nowrap; }
.donut-legend strong { font-variant-numeric: tabular-nums; }
.donut-legend em { font-style: normal; color: var(--muted); font-size: 11.5px; font-weight: 500; margin-left: 4px; }

.calendar { font-size: 12.5px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; background: var(--accent); color: #fff; border-radius: 8px; padding: 4px 8px; margin-bottom: 8px; }
.cal-head a { color: #fff; font-size: 11px; padding: 2px 6px; }
.cal-head a:hover { text-decoration: none; opacity: .8; }
.cal-head strong { font-size: 12.5px; letter-spacing: .04em; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-dow { color: var(--muted); font-size: 11.5px; padding-bottom: 4px; }
.cal-day { position: relative; display: grid; place-items: center; height: 30px; border-radius: 50%; color: var(--text-2); font-variant-numeric: tabular-nums; }
.cal-day:hover { background: var(--accent-soft); text-decoration: none; }
.cal-day.today { background: var(--accent); color: #fff; font-weight: 700; box-shadow: 0 0 0 3px var(--accent-soft); }
.cal-day.has { font-weight: 650; color: var(--text); }
.cal-dots { position: absolute; bottom: 1px; display: flex; gap: 2px; }
.cal-dots i, .cal-legend i { width: 5px; height: 5px; border-radius: 50%; display: inline-block; }
.d-update { background: var(--c1); }
.d-problem { background: var(--critical); }
.d-ban { background: var(--c2); }
.cal-legend { display: flex; gap: 12px; justify-content: center; margin-top: 8px; font-size: 11px; color: var(--muted); }
.cal-legend span { display: flex; align-items: center; gap: 5px; }
.cal-legend i { width: 7px; height: 7px; }

/* ---------------- KPI strip (sub pages) ---------------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 22px; margin-bottom: 22px; }
.kpi { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; color: var(--text); position: relative; min-width: 0; }
a.kpi:hover { text-decoration: none; box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow); }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 30px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; color: var(--text); }
.kpi-value small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.kpi-value.small-value { font-size: 15px; padding: 7px 0; }
.kpi-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi::before { content: ""; position: absolute; left: 20px; top: 0; width: 36px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.kpi-bad::before { background: var(--critical); }
.kpi-bad .kpi-value { color: var(--critical-ink); }
.kpi-warn::before { background: var(--warning); }
.kpi-warn .kpi-value { color: var(--warning-ink); }
.kpi-ok::before { background: var(--good); }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr[data-href] { cursor: pointer; }
.table tbody tr:hover td { background: #fafbfd; }
.table th.num, .table td.num { text-align: right; }
.table .check { width: 38px; padding-right: 0; }
.group-row td { background: var(--panel-2) !important; }
.site-link { color: var(--text); }
.site-cell { display: flex; align-items: center; gap: 12px; }
.site-fav { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 750; flex: none; }
.status-cell { min-width: 160px; font-size: 12.5px; }
.row-running td { background: var(--accent-soft) !important; }
.row-ok .status-cell { color: var(--good-ink); }
.row-bad .status-cell { color: var(--critical-ink); }
.row-warn .status-cell { color: var(--warning-ink); }

/* ---------------- Status pills ---------------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; padding: 2px 10px; border-radius: 999px; white-space: nowrap; line-height: 1.7; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-ok { background: var(--good-soft); color: var(--good-ink); }
.pill-warn { background: var(--warning-soft); color: var(--warning-ink); }
.pill-bad { background: var(--critical-soft); color: var(--critical-ink); }
.pill-muted { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.pill-info { background: var(--accent-soft); color: var(--accent); }
.count { display: inline-block; min-width: 24px; padding: 0 7px; border-radius: 999px; font-size: 12px; font-weight: 700; text-align: center; line-height: 21px; }
.count-warn { background: var(--warning-soft); color: var(--warning-ink); }
.count-bad { background: var(--critical-soft); color: var(--critical-ink); }
.count-ok { background: var(--good-soft); color: var(--good-ink); }

/* ---------------- Tabs ---------------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs a { padding: 6px 14px; border-radius: 999px; color: var(--text-2); font-weight: 550; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.tabs a:hover { background: var(--panel-2); text-decoration: none; }
.tabs a.active { background: var(--accent); color: #fff; }
.tabs a.active .count { background: rgba(255,255,255,.25); color: #fff; }
.tabs-page { background: var(--panel); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; margin-bottom: 22px; overflow-x: auto; flex-wrap: nowrap; }
.tabs-page a { white-space: nowrap; }
.segmented { display: inline-flex; background: var(--panel); border-radius: 999px; padding: 4px; box-shadow: var(--shadow); }
.segmented a { padding: 5px 14px; color: var(--text-2); font-weight: 550; font-size: 13px; border-radius: 999px; }
.segmented a.active { background: var(--accent); color: #fff; }
.segmented a:hover { text-decoration: none; }

/* ---------------- Buttons & forms ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: 600 13.5px var(--font); padding: 8px 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.btn:disabled, .btn.is-busy { opacity: .6; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 28%, transparent); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn-danger { background: var(--critical-soft); border-color: transparent; color: var(--critical-ink); }
.btn-danger:hover { background: var(--critical); color: #fff; border-color: var(--critical); }
.btn-ghost { background: none; border-color: transparent; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn .spinner, .spinner { width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.stack { display: flex; flex-direction: column; gap: 14px; }
.card > form.stack.pad, .card > div.stack.pad { padding-top: 16px; }
label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13px; color: var(--text-2); }
label small { font-weight: 400; }
input, select, textarea { font: 14px var(--font); color: var(--text); background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; width: 100%; }
input.mono, textarea.mono { font-family: var(--mono); font-size: 13px; }
input::placeholder, textarea::placeholder { color: #a3adbb; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
input[type=color] { height: 40px; padding: 3px; }
.check-label, .radio { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; color: var(--text); }
.checks { display: flex; flex-direction: column; gap: 8px; }
fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; margin: 0; }
legend { font-weight: 700; padding: 0 6px; }
.search { width: 230px; padding: 7px 12px; }
.filters select { width: auto; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--line); align-items: flex-end; }
.inline-form input, .inline-form select { width: auto; flex: 1 1 140px; }
.copy-field { display: flex; gap: 8px; }
.copy-field input { flex: 1; }
.code-block { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: 12.5px var(--mono); white-space: pre-wrap; word-break: break-all; margin: 0; }
.save-bar { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--stage) 45%); padding: 16px 0; margin: 0 0 12px; display: flex; justify-content: flex-end; }

/* ---------------- Flash, toast, tooltip ---------------- */
.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-size: 13.5px; }
.flash-success { background: var(--good-soft); color: var(--good-ink); }
.flash-error { background: var(--critical-soft); color: var(--critical-ink); }
.flash-warning { background: var(--warning-soft); color: var(--warning-ink); }
.flash a { color: inherit; text-decoration: underline; font-weight: 600; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: 440px; background: #1b2330; color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.2); opacity: 0; transform: translateY(8px); transition: .2s; pointer-events: none; z-index: 50; font-size: 13.5px; }
.toast.show { opacity: 1; transform: none; }
.toast.bad { background: var(--critical-ink); }
.toast.ok { background: #16603a; }
.tip { position: fixed; z-index: 60; pointer-events: none; background: var(--panel); color: var(--text); border-radius: 10px; box-shadow: 0 8px 24px rgba(30,45,70,.18); border: 1px solid var(--line); padding: 8px 12px; font-size: 12.5px; min-width: 140px; }
.tip-title { font-weight: 700; margin-bottom: 4px; }
.tip-row { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; line-height: 1.7; }
.tip-row i { width: 9px; height: 9px; border-radius: 3px; }
.tip-row b { font-variant-numeric: tabular-nums; }

/* ---------------- Lists ---------------- */
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; margin: 0; padding: 16px 20px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; word-break: break-word; }
.checklist { list-style: none; margin: 0; padding: 0 20px 16px; display: flex; flex-direction: column; gap: 9px; }
.card-head + .checklist { padding-top: 16px; }
.checklist li { display: flex; gap: 10px; align-items: baseline; }
.checklist .pill { flex: none; min-width: 84px; justify-content: center; }
.feed { list-style: none; margin: 0; padding: 6px 20px; }
.feed li { display: grid; grid-template-columns: 12px 1fr auto; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); align-items: start; }
.feed li:last-child { border-bottom: 0; }
.feed time { text-align: right; white-space: nowrap; }
.feed .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); margin-top: 6px; }
.feed-success .dot { background: var(--good); }
.feed-warning .dot { background: var(--warning); }
.feed-error .dot { background: var(--critical); }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 18px; }
.steps p { margin: 4px 0 8px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 14px; border-top: 1px solid var(--line); }

/* ---------------- Uptime bars (site detail) ---------------- */
.uptime-chart { padding: 16px 20px 6px; }
.uptime-chart svg { width: 100%; height: 64px; display: block; }
.bar-ok { fill: var(--c1); opacity: .85; }
.bar-warn { fill: var(--warning); }
.bar-bad { fill: var(--critical); }
.bar-empty { fill: var(--track); }
.bar-info { fill: var(--c1); }
.uptime-axis { display: flex; justify-content: space-between; margin-top: 4px; }
.card .uptime-chart + .dl { padding-top: 6px; }
.card > h3.mt { padding: 0 20px; }

/* ---------------- Bare pages ---------------- */
body.bare { display: grid; place-items: start center; min-height: 100vh; padding: 10vh 16px; }
.bare-wrap { width: 100%; max-width: 420px; }
.bare-wrap:has(.wide) { max-width: 660px; }
.bare-brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 800; font-size: 22px; margin-bottom: 22px; }
.bare-logo { width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.bare-logo-img { max-height: 70px; max-width: 280px; }
.bare-foot { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 22px; }
.bare-foot a { color: var(--text-2); font-weight: 600; }
.bare-foot span { font-style: italic; color: var(--accent); }
.bare-card { padding: 28px; }
.bare-card h1 { margin-bottom: 16px; font-size: 20px; }
.main .bare-card { max-width: 660px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1320px) {
  .w-main, .w-side, .w-area { grid-column: span 12; }
  .w-donut, .w-cal { grid-column: span 6; }
  .w-side { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
  .w-side > .filters-row { grid-column: 1 / -1; }
  .w-side > .subhead { border-top: 0; padding-top: 0; }
  .w-side > .subhead, .w-side > .chart, .w-side > .legend, .w-side > p { grid-column: 2; }
  .w-side > .gauge-wrap { grid-column: 1; grid-row: 2 / span 4; }
}
@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; padding: 12px; gap: 12px; }
  .sidebar { position: static; height: auto; max-height: none; overflow: visible; flex-direction: row; align-items: center; padding: 10px 14px; gap: 10px; border-radius: 16px; flex-wrap: wrap; }
  .profile, .side-company, .nav-label, .nav-sites { display: none; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side-brand { padding: 0 6px; }
  .side-nav { flex-direction: row; overflow-x: auto; overflow-y: visible; order: 3; width: 100%; min-width: 0; flex: 1 1 100%; margin: 0; }
  .nav-group { flex-direction: row; margin: 0; }
  .side-nav a { padding: 8px 12px; white-space: nowrap; }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; }
  .cron-state { display: none; }
  .stage { min-height: 0; border-radius: 18px; }
  .stage-head { grid-template-columns: 1fr auto; padding: 18px 18px 4px; }
  .global-search { grid-column: 1 / -1; order: 3; }
  .main { padding: 14px 18px 28px; }
  .w-half { grid-column: span 12; }
  .perf { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-wide-left { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .page-title { font-size: 21px; max-width: 60vw; }
  .user-chip strong, .chip-icons { display: none; }
  .user-chip { padding: 4px; }
  .w-side { display: block; }
  .rings { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .w-donut, .w-cal { grid-column: span 12; }
  .donut-wrap { flex-direction: column; align-items: stretch; }
  .donut { margin: 0 auto; }
  .dash-grid, .kpis { gap: 14px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .search { width: 100%; }
  .dl { grid-template-columns: 1fr; gap: 0; }
  .dl dd { margin-bottom: 8px; }
  .widget { padding: 16px; }
  .side-foot .logout span, .logout { font-size: 0; gap: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
