:root {
  --oneco-purple-600: #6D1D6C;
  --oneco-purple-200: #E2D2E2;
  --oneco-darkpurple-600: #412050;
  --ink: #1a1a1a;
  --muted: #666;
  --line: #ddd;
  --bg: #f4f1f5;
  --card: #fff;

  /* Status colours: chosen for at least 4.5:1 text contrast on the tile. */
  --ok-bg: #007058;      --ok-fg: #fff;
  --warning-bg: #F6931D; --warning-fg: #1a1a1a;
  --critical-bg: #B3122B; --critical-fg: #fff;
  --unknown-bg: #5c5c5c; --unknown-fg: #fff;
  /* Service mode is a deliberate pause, so it is a lighter grey than "unknown" (which signals a problem). */
  --service-bg: #d4d4d4; --service-fg: #1a1a1a;

  --font: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--oneco-purple-600); }

.topbar { background: var(--oneco-purple-600); color: #fff; }
.topbar-inner { max-width: 1400px; margin: 0 auto; padding: 12px 16px; display: flex; gap: 10px 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.brand { color: #fff; text-decoration: none; font-size: 20px; font-weight: 700; }
.brand span { font-weight: 400; opacity: .85; margin-left: 6px; }
.brand-wrap { display: inline-flex; align-items: center; gap: 8px; }
.app-version { color: #fff; font-size: 12px; line-height: 1.4; padding: 1px 7px; border: 1px solid rgba(255,255,255,.55); border-radius: 999px; opacity: .9; white-space: nowrap; }
.app-version[hidden] { display: none; }
.topbar-meta { font-size: 13px; opacity: .9; }
.system-nav { display: flex; flex-wrap: wrap; gap: 4px 6px; flex: 1 1 auto; align-items: center; }
.system-link { display: inline-flex; align-items: center; gap: 6px; color: #fff; text-decoration: none; font-size: 14px; padding: 5px 10px; border-radius: 999px; border: 1px solid transparent; }
.system-link:hover { border-color: rgba(255,255,255,.6); }
.system-link:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.system-link[aria-current="page"] { background: #fff; color: var(--oneco-purple-600); font-weight: 700; }
.system-link .dot { box-shadow: 0 0 0 1.5px #fff; }
.nav-badge { font-size: 11px; padding: 0 5px; border-radius: 4px; border: 1px solid currentColor; opacity: .85; }

.banner { background: var(--critical-bg); color: #fff; padding: 10px 16px; text-align: center; font-size: 14px; }
.container { max-width: 1400px; margin: 0 auto; padding: 20px 16px 40px; }

.overview-toolbar { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; margin-bottom: 14px; font-size: 14px; }
.overview-toolbar select { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid #bbb; border-radius: 4px; background: #fff; }
.toolbar-field { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.toolbar-field select { font-weight: 400; }
.toolbar-help { flex-basis: 100%; margin-top: -4px; }
.tag-filter { display: flex; flex-wrap: nowrap; gap: 6px 8px; max-width: 100%; align-items: center; font-size: 14px; }
.tag-filter-label { font-weight: 700; margin-right: 4px; }
.tag-filter input { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid #bbb; border-radius: 4px; background: #fff; width: min(260px, 60vw); }
.access-note { margin: 0 0 12px; }
.access-editor { display: flex; flex-direction: column; gap: 6px; min-width: 220px; }
.access-editor input[type="text"] { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid #bbb; border-radius: 4px; }
.access-editor input[hidden] { display: none; }
.access-row { display: grid; grid-template-columns: minmax(110px, 9em) auto minmax(140px, 1fr); gap: 6px 10px; align-items: center; font-size: 14px; }
.access-system { font-weight: 700; }
.access-list > div + div { margin-top: 4px; }
.access-editor .choices { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 4px; }
.access-editor .choices[hidden], .access-editor .choice[hidden] { display: none; }
.access-editor input[type="search"] { font: inherit; font-size: 14px; padding: 5px 8px; border: 1px solid #bbb; border-radius: 4px; max-width: 320px; }
.choice-list { max-height: 220px; overflow-y: auto; border: 1px solid #ccc; border-radius: 4px; padding: 6px 8px; background: #fff; display: flex; flex-direction: column; gap: 2px; }
.choice { display: flex; gap: 6px; align-items: center; font-size: 14px; }
.tag.choice-tag { background: #e8eefc; }
@media (max-width: 560px) { .access-row { grid-template-columns: 1fr; } }
.filter-warning { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; background: #fff4d6; border: 2px solid #b26b00; color: #4a2c00; border-radius: 8px; padding: 12px 16px; margin-bottom: 14px; font-size: 15px; }
.filter-warning .grow { flex: 1 1 320px; }
.filter-warning-problems { margin-top: 6px; font-weight: 700; color: #8a0e21; }
.tile-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tile-tags span { font-size: 11px; padding: 1px 6px; border-radius: 4px; border: 1px solid currentColor; opacity: .9; }
.summary { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.summary .chip { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 14px; display: inline-flex; gap: 8px; align-items: center; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.dot.ok { background: var(--ok-bg); } .dot.warning { background: var(--warning-bg); }
.dot.critical { background: var(--critical-bg); } .dot.unknown { background: var(--unknown-bg); }
.dot.service { background: var(--service-bg); border: 1px solid #999; }
.chip-alert { width: 16px; height: 16px; border-radius: 50%; background: #fff; color: #1a1a1a; border: 1.5px solid rgba(0,0,0,.45); font-size: 11px; font-weight: 700; line-height: 13px; text-align: center; flex: none; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; gap: 6px; min-height: 140px; padding: 16px 18px; border-radius: 8px; text-decoration: none; box-shadow: 0 1px 2px rgba(0,0,0,.08); transition: transform .08s ease, box-shadow .08s ease; }
.tile:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.15); }
.tile:focus-visible { outline: 3px solid var(--oneco-darkpurple-600); outline-offset: 2px; }
.tile.ok { background: var(--ok-bg); color: var(--ok-fg); }
.tile.warning { background: var(--warning-bg); color: var(--warning-fg); }
.tile.critical { background: var(--critical-bg); color: var(--critical-fg); }
.tile.unknown { background: var(--unknown-bg); color: var(--unknown-fg); }
.tile.service { background: var(--service-bg); color: var(--service-fg); }
.tile-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.service-badge { flex: none; font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--service-bg); color: var(--service-fg); border: 1px solid rgba(0, 0, 0, .15); white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tile-name { font-size: 18px; font-weight: 700; }
/* White disc with dark "!" stays readable on every status colour (and on custom colours). */
.tile-alert { flex: none; width: 26px; height: 26px; border-radius: 50%; background: #fff; color: #1a1a1a; border: 2px solid rgba(0,0,0,.35); font-weight: 700; font-size: 17px; line-height: 22px; text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.tile-status { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.tile-meta { font-size: 13px; opacity: .92; margin-top: auto; }
.icon { font-size: 18px; line-height: 1; }

.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; margin-bottom: 12px; font-size: 14px; }
.breadcrumb .sep { color: var(--muted); }
.breadcrumb [aria-current="page"] { font-weight: 700; }
.page-title { font-size: 22px; margin: 0 0 16px; }
.tile-category { font-size: 13px; opacity: .9; }
/* System without data (planned, or no locations yet): neutral card, not a status colour. */
.tile.neutral { background: var(--card); color: var(--ink); border: 1px dashed #b9a9bd; box-shadow: none; }
.tile.neutral .tile-status { font-size: 16px; font-weight: 400; color: var(--muted); }
.detail-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; padding: 16px 18px; border-radius: 8px; margin-bottom: 16px; }
.detail-head.ok { background: var(--ok-bg); color: var(--ok-fg); }
.detail-head.warning { background: var(--warning-bg); color: var(--warning-fg); }
.detail-head.critical { background: var(--critical-bg); color: var(--critical-fg); }
.detail-head.unknown { background: var(--unknown-bg); color: var(--unknown-fg); }
.detail-head.service { background: var(--service-bg); color: var(--service-fg); }
.detail-head h1 { margin: 0; font-size: 24px; }
.detail-head .grow { flex: 1; }
.detail-head a { color: inherit; font-size: 14px; }
.section-title { font-size: 18px; margin: 28px 0 8px; }
.analysis table td.num { text-align: center; font-variant-numeric: tabular-nums; }
.analysis .muted-row td { color: var(--muted); font-style: italic; }
.analysis code { font-size: 13px; background: #f4f1f5; padding: 1px 4px; border-radius: 3px; }
.analysis details { margin-top: 10px; font-size: 14px; }
.analysis .subhead { font-size: 15px; margin: 14px 0 6px; }
.type-table input { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid #bbb; border-radius: 4px; width: 100%; min-width: 140px; }
.section .result:not(:empty) { margin: 10px 0; }
table.kv th { width: 34%; max-width: 260px; background: #faf8fb; white-space: normal; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 12px; font-size: 14px; }
.toolbar input[type="search"], .toolbar select { font: inherit; padding: 6px 8px; border: 1px solid #bbb; border-radius: 4px; background: #fff; }
.toolbar input[type="search"] { max-width: 100%; box-sizing: border-box; }
/* Column choice (tables.js): «Kolonner» in the table's caption. The list opens in the flow (not as a floating menu),
   so it is never clipped by the horizontally scrolling .table-wrap. */
th[hidden], td[hidden] { display: none; }
caption.table-tools { caption-side: top; text-align: left; padding: 6px 12px; border-bottom: 1px solid #eee; font-size: 13px; }
.col-picker { display: inline-block; vertical-align: top; max-width: 100%; }
/* Right after «Kolonner», not at the far right: a wide table's caption is wider than the screen. */
.export-btns { display: inline-flex; gap: 6px; margin-left: 8px; vertical-align: top; }
.btn-small { font: inherit; font-size: 13px; padding: 3px 10px; border: 1px solid #ccc; border-radius: 4px; background: #fff; color: var(--ink); cursor: pointer; }
.btn-small:hover { border-color: #999; }
.btn-small:focus-visible { outline: 2px solid var(--oneco-purple-600); outline-offset: 2px; }
.col-picker summary { display: inline-block; cursor: pointer; padding: 3px 8px; border: 1px solid #ccc; border-radius: 4px; background: #fff; list-style: none; user-select: none; color: var(--muted); }
.col-picker summary:hover, .col-picker[open] summary { color: var(--ink); border-color: #999; }
.col-picker summary::-webkit-details-marker { display: none; }
.col-picker summary::after { content: ' ▾'; }
.col-picker[open] summary::after { content: ' ▴'; }
.col-menu { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 8px 0 2px; max-width: calc(100vw - 64px); }
.col-menu .check { font-size: 13px; }
.col-menu .muted { font-size: 12px; }
.col-menu .btn-inline { margin: 0; }
.mono { font-family: Consolas, 'Courier New', monospace; white-space: nowrap; }

.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid #eee; vertical-align: top; }
th { background: #faf8fb; font-weight: 700; white-space: nowrap; }
/* Sortable headers (tables.js): the whole header is the button; the arrow shows the current direction. */
.sort-btn { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.sort-btn:focus-visible { outline: 2px solid var(--oneco-purple-600); outline-offset: 2px; border-radius: 2px; }
.sort-btn:hover { text-decoration: underline; }
.sort-mark { font-size: 10px; color: #b3a7b6; min-width: 10px; }
th.sorted .sort-mark { color: var(--oneco-darkpurple-600); }
tr:last-child td { border-bottom: none; }
.state { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-weight: 700; }
.state.offline { color: var(--critical-bg); } .state.online { color: var(--ok-bg); } .state.inactive { color: var(--muted); }
.state.service { color: var(--service-fg); background: var(--service-bg); padding: 1px 8px; border-radius: 999px; font-weight: 600; }
tr.in-service td { color: var(--muted); }
/* Alta users without activity for the administrator's number of days (settings.userActivity). */
tr.inactive-warning td { background: #fff4c2; }
tr.inactive-critical td { background: #fbd5d5; }
.legend-swatch { display: inline-block; width: 12px; height: 12px; border: 1px solid rgba(0, 0, 0, 0.25); border-radius: 2px; vertical-align: -1px; margin: 0 4px 0 10px; }
.legend-swatch.inactive-warning { background: #fff4c2; }
.legend-swatch.inactive-critical { background: #fbd5d5; }
.sched-editor { display: flex; flex-direction: column; gap: 10px; padding: 8px 4px; font-size: 14px; }
.sched-window { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; border-left: 3px solid var(--service-bg); padding-left: 10px; }
.sched-days { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.sched-editor input[type="time"], .sched-editor input[type="date"] { font: inherit; font-size: 14px; padding: 4px 6px; border: 1px solid #bbb; border-radius: 4px; background: #fff; }
.tag { display: inline-block; background: var(--oneco-purple-200); color: var(--oneco-darkpurple-600); border-radius: 4px; padding: 1px 6px; margin: 0 4px 3px 0; font-size: 12px; }
.muted { color: var(--muted); }
.empty { padding: 24px; text-align: center; color: var(--muted); }
.error-box { background: #fff; border-left: 4px solid var(--critical-bg); padding: 12px 14px; margin-bottom: 16px; }
.service-box { background: #fff; border-left: 4px solid #8a8a8a; padding: 12px 14px; margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; font-size: 14px; }
.service-box .grow { flex: 1 1 260px; }
.service-box select { font: inherit; padding: 6px 8px; border: 1px solid #bbb; border-radius: 4px; background: #fff; }
.service-box .fail { color: #8a0e21; flex-basis: 100%; }
.service-box .fail:empty { display: none; }

/* ---------- Admin ---------- */
.topbar-actions { display: flex; gap: 16px; align-items: baseline; }
.topbar-link, .btn-link { color: #fff; font-size: 14px; }
.btn-link { background: none; border: none; padding: 0; font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head h1, .container > h1 { font-size: 24px; margin: 0 0 16px; }
.btn { font: inherit; font-size: 14px; padding: 7px 14px; border-radius: 4px; border: 1px solid #bbb; background: #fff; color: var(--ink); cursor: pointer; }
.btn:hover { border-color: var(--oneco-purple-600); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.primary { background: var(--oneco-purple-600); border-color: var(--oneco-purple-600); color: #fff; }
.btn.danger { color: var(--critical-bg); }
.actions { white-space: nowrap; display: flex; gap: 6px; }
.tags-cell { min-width: 160px; }
.tags-cell input { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid #bbb; border-radius: 4px; width: 100%; margin-bottom: 6px; }
.btn-inline { margin-left: 8px; background: none; border: none; padding: 0; font: inherit; font-size: 12px; color: var(--oneco-purple-600); text-decoration: underline; cursor: pointer; }
.fail-text { color: #8a0e21; margin-top: 4px; }
.small { font-size: 12px; }
.notice { background: #fff; border-left: 4px solid var(--oneco-purple-600); padding: 12px 14px; margin-bottom: 16px; }
.notice.ok { border-left-color: var(--ok-bg); }
.form { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 20px; max-width: 640px; display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field[hidden] { display: none; }
.field .label { font-weight: 700; font-size: 14px; }
.field input { font: inherit; padding: 8px 10px; border: 1px solid #bbb; border-radius: 4px; }
.field input:disabled { background: #f1f1f1; color: var(--muted); }
.field .help { font-size: 12px; color: var(--muted); }
.check { font-size: 14px; display: flex; align-items: center; gap: 6px; }
.fieldset { border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.fieldset legend { font-weight: 700; padding: 0 4px; }
.fieldset .help { font-size: 12px; color: var(--muted); margin: 0; }
.fieldset .label { font-weight: 700; font-size: 14px; }
.fieldset select, .fieldset input[type="number"] { font: inherit; padding: 6px 8px; border: 1px solid #bbb; border-radius: 4px; background: #fff; max-width: 200px; }
.color-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.color-row input[type="color"] { width: 44px; height: 32px; padding: 2px; border: 1px solid #bbb; border-radius: 4px; background: #fff; flex: none; }
.swatch { display: inline-block; min-width: 76px; padding: 6px 8px; border-radius: 4px; font-size: 12px; font-weight: 700; text-align: center; flex: none; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px 12px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.result:empty { display: none; }
.result { padding: 10px 12px; border-radius: 4px; font-size: 14px; }
.result.ok { background: #e3f3ec; color: #00513f; }
.result.fail { background: #fbe7ea; color: #8a0e21; }

/* ---------- Login ---------- */
.login-container { display: flex; justify-content: center; padding-top: 48px; }
.login-card { width: 100%; max-width: 420px; }
.login-card h1 { font-size: 24px; margin: 0 0 16px; }
.login-card .form { max-width: none; }
.user-menu { font-size: 14px; display: flex; gap: 12px; align-items: baseline; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 18px; }
.tab { font: inherit; font-size: 15px; background: none; border: none; padding: 10px 14px; cursor: pointer; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tab[aria-selected="true"] { color: var(--oneco-purple-600); border-bottom-color: var(--oneco-purple-600); font-weight: 700; }
.section + .section { margin-top: 28px; }
.section h2, .page-head h2, .container > h2 { font-size: 18px; margin: 0 0 12px; }
.table-wrap select, .field select { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid #bbb; border-radius: 4px; background: #fff; }
.table-wrap select:disabled { background: #f1f1f1; color: var(--muted); }

/* ---------- Zendesk KPIs ---------- */
.kpi-panel { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 18px; }
.kpi-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.seg { display: inline-flex; border: 1px solid #bbb; border-radius: 6px; overflow: hidden; }
.seg-btn { font: inherit; font-size: 14px; background: #fff; border: none; padding: 6px 14px; cursor: pointer; }
.seg-btn + .seg-btn { border-left: 1px solid #bbb; }
.seg-btn[aria-selected="true"], .seg-btn[aria-pressed="true"] { background: var(--oneco-purple-600); color: #fff; font-weight: 700; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; background: #fcfbfd; }
.kpi-label { font-size: 12px; color: var(--muted); }
.kpi-value { font-size: 22px; font-weight: 700; margin: 2px 0; }
.kpi-sub { font-size: 12px; color: var(--muted); }
.chart { display: flex; align-items: flex-end; gap: 4px; height: 140px; padding: 6px 0 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.chart-col { flex: 1 0 18px; display: flex; flex-direction: column; align-items: center; height: 100%; }
.chart-bars { flex: 1; display: flex; align-items: flex-end; gap: 2px; width: 100%; justify-content: center; }
.chart .bar { width: 40%; min-height: 1px; border-radius: 2px 2px 0 0; }
.chart .bar.created { background: var(--oneco-purple-600); }
.chart .bar.solved { background: var(--ok-bg); }
.chart-label { font-size: 10px; color: var(--muted); white-space: nowrap; margin-top: 3px; writing-mode: vertical-rl; transform: rotate(180deg); max-height: 46px; }
.dists { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.dist-title { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.chip-small { display: inline-block; font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; margin: 0 4px 4px 0; background: #fff; }
.trend-details { margin-top: 12px; font-size: 14px; }
.trend-table td.num { text-align: center; font-variant-numeric: tabular-nums; }
.zd-rules { display: flex; flex-direction: column; gap: 12px; }
.zd-hours[hidden] { display: none; }
.zd-hours { display: flex; flex-direction: column; gap: 8px; border-left: 3px solid var(--oneco-purple-200); padding-left: 10px; }
.zd-inline { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-end; }
.zd-inline input[type="text"] { font: inherit; padding: 6px 8px; border: 1px solid #bbb; border-radius: 4px; width: 160px; }
.zd-targets input { font: inherit; font-size: 14px; padding: 5px 7px; border: 1px solid #bbb; border-radius: 4px; width: 100px; }
.zd-rules select, .zd-rules input[type="number"], .zd-rules input[type="time"] { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid #bbb; border-radius: 4px; background: #fff; }
.zd-range { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 0 0 12px; font-size: 14px; }
.zd-filters { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 0 0 12px; font-size: 14px; }
.zd-filters select { font: inherit; font-size: 14px; padding: 5px 7px; border: 1px solid #bbb; border-radius: 4px; background: #fff; max-width: 260px; }
.zd-field-list { border: 1px solid #ddd; border-radius: 6px; padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.zd-range input[type="date"] { font: inherit; font-size: 14px; padding: 5px 7px; border: 1px solid #bbb; border-radius: 4px; background: #fff; }
.events-link { margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.events-form { margin: 0 0 12px; }
.events-form select { font: inherit; font-size: 14px; padding: 5px 7px; border: 1px solid #bbb; border-radius: 4px; background: #fff; max-width: 280px; }
.event-types { border: 1px solid #ddd; border-radius: 6px; padding: 6px 12px 8px; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; }
.event-types legend { font-size: 13px; color: #555; padding: 0 4px; }
.events-table.loading { opacity: 0.5; }
.pager { display: flex; gap: 12px; align-items: center; margin: 10px 0; }
td.nowrap { white-space: nowrap; }
.access-editor .access-features { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 16px; padding-left: 2px; }
.access-editor .access-features[hidden] { display: none; }
.event-type-settings { max-height: none; margin-bottom: 8px; }
.sev { display: inline-block; border-radius: 4px; padding: 1px 7px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.sev-critical { background: #8b0000; color: #fff; }
.sev-high { background: #c62828; color: #fff; }
.sev-medium { background: #ef8f00; color: #1a1a1a; }
.sev-low { background: #fff1c2; color: #4a2c00; }
.sev-info { background: #e8eaef; color: #333; }
.result.ok, .result.fail { white-space: pre-line; }
.event-presets { margin: 0 0 10px; }
.log-filters { margin: 10px 0 12px; }
.log-filters input[type="search"], .log-filters select { font: inherit; font-size: 14px; padding: 5px 7px; border: 1px solid #bbb; border-radius: 4px; background: #fff; }
.log-table td { vertical-align: top; }
.log-table td.small { word-break: break-word; }
.log-level { display: inline-block; border-radius: 4px; padding: 1px 7px; font-size: 12px; font-weight: 700; }
.log-info { background: #e8eaef; color: #333; }
.log-warn { background: #fff1c2; color: #4a2c00; }
.log-error { background: #c62828; color: #fff; }
tr.log-warn { background: #fffaf0; }
.poll-minutes { max-width: 120px; }
.status-badge { display: inline-block; border-radius: 4px; padding: 1px 7px; font-size: 12px; font-weight: 700; }
.status-badge.active { background: #e3f3ec; color: #00513f; }
.status-badge.disabled { background: #e8eaef; color: #444; }
.status-badge.pending { background: #fff1d6; color: #6b4500; }
.warn-text { color: #8a4b00; }
.danger-zone { margin-top: 32px; padding: 14px 16px; border: 1px solid #e3b5bc; border-radius: 8px; background: var(--card); }
.danger-zone .section-title { margin-top: 0; }
.danger-zone .fail { color: #8a0e21; margin-top: 8px; }
.danger-zone .fail:empty { display: none; }
.reset-result { display: flex; flex-direction: column; gap: 6px; }
.reset-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.temp-password { font-family: Consolas, 'Courier New', monospace; font-size: 18px; letter-spacing: 1px; padding: 4px 10px; background: #f4f1f5; border: 1px solid var(--line); border-radius: 4px; user-select: all; }
tr.user-disabled td:first-child { color: #777; text-decoration: line-through; }

/* Uptime statistics (stats.js) */
.stats-form { display: flex; flex-direction: column; gap: 8px; margin: 0 0 16px; }
.stats-form-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.stats-head { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: flex-start; margin-bottom: 12px; }
.stats-head .grow { flex: 1; }
.stats-head .page-title { margin-bottom: 6px; }
.stats-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.live-status { display: inline-flex; gap: 6px; align-items: center; font-weight: 700; }
.stats-chart .chart-bars { align-items: stretch; }
.chart-stack { width: 60%; height: 100%; display: flex; flex-direction: column-reverse; }
.chart-stack .bar { width: 100%; border-radius: 0; min-height: 0; }
.chart .bar.down, .legend-swatch.down { background: var(--critical-bg); }
.chart .bar.unknown, .legend-swatch.unknown { background: var(--unknown-bg); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 4px; }
.chart-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.legend-swatch { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.top-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.top-card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
.top-card h3 { font-size: 15px; margin: 2px 0 8px; }
.top-card ol { margin: 0; padding-left: 22px; font-size: 14px; }
.top-card li { padding: 3px 0; border-bottom: 1px solid #f0edf1; }
.top-card li:last-child { border-bottom: none; }
.top-row { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; }
.top-name { min-width: 0; overflow-wrap: anywhere; }
.top-value { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-col.no-data .chart-bars { background: repeating-linear-gradient(135deg, transparent 0 4px, #eee 4px 6px); }
.chart-col.no-data .chart-label { opacity: .6; }
.legend-swatch.no-data { background: repeating-linear-gradient(135deg, #fff 0 2px, #ccc 2px 4px); border: 1px solid #ccc; }
/* Numbers are centred under their (centred) header, so a value is easy to match with its column. */
td.num, th.num { text-align: center; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Step one day/week/month back and forward (statistics pages, Zendesk KPIs) */
.stepper { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.stepper .btn { padding: 4px 12px; font-size: 18px; line-height: 1; }
.stepper-text { min-width: 9em; text-align: center; }
.chart-col.selected { background: var(--oneco-purple-200); border-radius: 3px; }

/* Alta location page: the camera table has up to 12 columns. The page may use the full window width, short
   values never wrap, and the columns with free text keep a readable minimum width; on narrow windows the table
   scrolls sideways inside .table-wrap instead of squeezing columns. */
.container.wide { max-width: none; }
.cam-table th, .cam-table td { padding: 8px 10px; }
.cam-table td.col-name { min-width: 130px; }
.cam-table td.col-notes { min-width: 120px; }
.cam-table td.col-schedule { min-width: 230px; }
.cam-table .tag { white-space: nowrap; }
.cam-table .btn-inline { white-space: nowrap; }
/* The camera table scrolls inside its own box (window height) with a sticky header row, so the sideways
   scrollbar is always on screen when the columns do not fit, instead of below the last camera. */
.cam-wrap { max-height: calc(100vh - 140px); overflow: auto; }
.cam-wrap thead th { position: sticky; top: 0; z-index: 1; }
