:root {
  --maroon: #7b1113; --maroon-ink: #5c0c0e; --green: #014421; --gold: #f3aa2c;
  --bg: #f7f5f2; --surface: #ffffff; --surface-2: #f0ece6; --ink: #1d1a17; --muted: #6b645c; --line: #e3ddd4;
  --ok: #1a7f45; --warn: #b7791f; --bad: #b42318; --accent: var(--maroon);
  --radius: 12px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.05);
  color-scheme: light;
}
/* Dark theme: follows the device unless the viewer picked Light or Dark (data-theme, set by theme.js) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14110f; --surface: #1d1916; --surface-2: #26211d; --ink: #f1ece6; --muted: #a59d93; --line: #352e28;
    --ok: #4ade80; --warn: #fbbf24; --bad: #f87171; --accent: #e7787a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14110f; --surface: #1d1916; --surface-2: #26211d; --ink: #f1ece6; --muted: #a59d93; --line: #352e28;
  --ok: #4ade80; --warn: #fbbf24; --bad: #f87171; --accent: #e7787a; color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background-color: var(--bg); color: var(--ink);
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 9%, transparent) 1px, transparent 1.3px),
    radial-gradient(1200px 600px at 100% 0%, color-mix(in srgb, var(--maroon) 7%, transparent), transparent 70%);
  background-size: 22px 22px, 100% 100%; background-attachment: scroll, fixed; font: 16px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

header.top { background: var(--maroon); color: #fff; }
header.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; margin-right: auto; }
.brand .mark { width: 36px; height: 36px; flex: none; display: block; border-radius: 9px; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.brand small { display: block; opacity: .8; font-size: 12px; line-height: 1.2; }
.brand strong { display: block; line-height: 1.2; }
nav a { color: #fff; text-decoration: none; opacity: .9; margin-left: 18px; font-size: 15px; }
nav a:hover { opacity: 1; text-decoration: underline; }

.hero { position: relative; overflow: hidden; color: #fff; padding: 56px 0 72px;
  background: radial-gradient(900px 420px at 85% 30%, rgba(243,170,44,.16), transparent 60%),
    linear-gradient(160deg, var(--maroon) 0%, var(--maroon-ink) 60%, #3a0708 100%); }
.hero .wrap { position: relative; z-index: 1; }
.hero-net { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,.35) 35%, #000 65%); mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,.35) 35%, #000 65%); }
.hero-net .links { stroke: rgba(255,255,255,.16); stroke-width: 1; }
.hero-net .nodes { fill: rgba(255,255,255,.35); }
.hero-net .pulse { fill: var(--gold); transform-box: fill-box; transform-origin: center; animation: node 4.4s ease-out infinite; opacity: 0; }
@keyframes node { 0% { opacity: .9; transform: scale(.6); } 60% { opacity: 0; transform: scale(3.2); } 100% { opacity: 0; } }
@media (max-width: 760px) { .hero-net { opacity: .5; -webkit-mask-image: none; mask-image: none; } }
@media (prefers-reduced-motion: reduce) { .hero-net .pulse { animation: none; opacity: .8; } }
.hero h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.15; margin: 0 0 12px; letter-spacing: -.5px; max-width: 720px; }
.hero p { max-width: 640px; opacity: .9; margin: 0 0 24px; font-size: 18px; }
.btn { display: inline-block; padding: 11px 18px; border-radius: 10px; font-weight: 600; text-decoration: none; border: 0; cursor: pointer; font: inherit; font-weight: 600; }
.btn.primary { background: var(--gold); color: #2b1a00; }
.btn.ghost { background: rgba(255,255,255,.12); color: #fff; margin-left: 8px; }
.btn.solid { background: var(--maroon); color: #fff; }
.btn:disabled { opacity: .6; cursor: wait; }

.statusbar { margin-top: -40px; position: relative; z-index: 2; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.status-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--muted); flex: none; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 18%, transparent); }
.dot.ok { background: var(--ok); color: var(--ok); } .dot.warn { background: var(--warn); color: var(--warn); } .dot.bad { background: var(--bad); color: var(--bad); }
.status-row h2 { margin: 0; font-size: 20px; }
.status-row .meta { margin-left: auto; color: var(--muted); font-size: 14px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-top: 16px; }
.kpi { background: var(--surface-2); border-radius: 10px; padding: 14px 16px; }
.kpi b { display: block; font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: 13px; }

section { padding: 56px 0 8px; }
section h2.title { font-size: 26px; margin: 0 0 6px; letter-spacing: -.3px; }
section p.lead { color: var(--muted); margin: 0 0 24px; max-width: 680px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.svc h3 { margin: 10px 0 6px; font-size: 17px; }
.svc p { margin: 0; color: var(--muted); font-size: 15px; }
.svc .ico { width: 40px; height: 40px; border-radius: 10px; background: color-mix(in srgb, var(--maroon) 12%, transparent); color: var(--accent); display: grid; place-items: center; }
.svc .ico svg { width: 22px; height: 22px; }

form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { form .row { grid-template-columns: 1fr; } nav a { margin: 0 14px 0 0; } }
label { display: block; font-size: 14px; font-weight: 600; margin: 0 0 6px; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; }
textarea { min-height: 140px; resize: vertical; }
.field { margin-bottom: 14px; }
.hp { position: absolute; left: -9999px; }
.notice { padding: 12px 14px; border-radius: 8px; margin-top: 12px; display: none; }
.notice.ok { display: block; background: color-mix(in srgb, var(--ok) 14%, transparent); }
.notice.err { display: block; background: color-mix(in srgb, var(--bad) 14%, transparent); }

.contact dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.contact dt { color: var(--muted); }
.contact dd { margin: 0; }

footer { margin-top: 64px; padding: 28px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

/* ops dashboard */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; cursor: pointer; user-select: none; }
tbody tr:hover { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: var(--surface-2); white-space: nowrap; }
.pill.bad { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.pill.sev5, .pill.sev4 { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.pill.sev3, .pill.sev2 { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 16px 0; }
.toolbar input, .toolbar select { width: auto; flex: 1 1 180px; }
.err-banner { background: color-mix(in srgb, var(--bad) 14%, transparent); padding: 10px 14px; border-radius: 8px; margin-top: 12px; font-size: 14px; }
.cols { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }

/* live + status detail */
.live { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 8px; vertical-align: middle; opacity: .5; }
.live.on { background: var(--ok); opacity: 1; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--ok) 25%, transparent); } }
@media (prefers-reduced-motion: reduce) { .live.on { animation: none; } }
.net-detail { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pill.src { display: inline-flex; align-items: center; gap: 6px; }
.mini { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.mini.ok { background: var(--ok); } .mini.warn { background: var(--warn); } .mini.bad { background: var(--bad); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; margin-left: auto; }
.sites { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 16px; font-size: 14px; }
.sites li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.sites li b { margin-left: auto; font-variant-numeric: tabular-nums; }
.notice.info.show { display: block; background: color-mix(in srgb, var(--warn) 14%, transparent); margin: 0 0 14px; font-size: 14px; }
.pill.sev1, .pill.sev0 { background: var(--surface-2); color: var(--muted); }
.pill.okp { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); text-decoration: none; }

/* track a request */
.track-form { display: grid; grid-template-columns: 1fr 1.5fr auto; gap: 14px; align-items: end; }
.track-form .btn { margin-bottom: 14px; }
@media (max-width: 640px) { .track-form { grid-template-columns: 1fr; } .track-form .btn { margin-bottom: 0; } }
.ticket { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 4px; }
.ticket h3 { margin: 0; font-size: 17px; }
.ticket .pill { margin-left: auto; }
.ticket .meta { color: var(--muted); font-size: 14px; }
.steps { list-style: none; padding: 0; margin: 16px 0 8px; display: flex; gap: 0; counter-reset: s; }
.steps li { flex: 1; position: relative; padding-top: 26px; font-size: 13px; color: var(--muted); text-align: center; }
.steps li::before { counter-increment: s; content: counter(s); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; z-index: 1; }
.steps li + li::after { content: ""; position: absolute; top: 11px; right: 50%; width: 100%; height: 2px; background: var(--line); }
.steps li.done { color: var(--ink); font-weight: 600; }
.steps li.done::before { content: "✓"; background: var(--ok); border-color: var(--ok); color: #fff; }
.steps li.done + li.done::after { background: var(--ok); }

/* ops: sources, tabs, alerts */
.sources { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 16px; }
.card.source { text-align: left; font: inherit; color: inherit; cursor: pointer; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.card.source[data-nofilter] { cursor: default; }
.card.source.active { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.card.source .dot { width: 10px; height: 10px; }
.card.source small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.card.source .ext { margin-left: auto; text-decoration: none; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 14px; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; font-size: 14px; white-space: nowrap; }
.check input { width: auto; }
.btn { background: var(--surface-2); color: var(--ink); }
.btn.small { padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.pill.src-zabbix { background: color-mix(in srgb, #d40000 14%, transparent); }
.pill.src-librenms { background: color-mix(in srgb, #2a7ab0 16%, transparent); }
.pill.src-observium { background: color-mix(in srgb, #3c8d40 16%, transparent); }
tr.fresh td { background: color-mix(in srgb, var(--gold) 14%, transparent); }
details summary { cursor: pointer; padding: 6px 0; }
.kv { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); width: 100%; }
.kv span { overflow-wrap: anywhere; text-align: left; }
.linklike { background: none; border: 0; border-bottom: 1px solid var(--line); font: inherit; color: inherit; cursor: pointer; }
.linklike:hover span { color: var(--accent); text-decoration: underline; }
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); width: min(560px, calc(100vw - 32px)); padding: 20px; }
dialog::backdrop { background: rgba(0,0,0,.4); }
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 10; max-width: calc(100vw - 32px); }
.toast { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: 8px; padding: 10px 14px; box-shadow: var(--shadow); font-size: 14px; }
.toast.warn { border-left-color: var(--warn); } .toast.bad { border-left-color: var(--bad); }

/* monthly report */
.muted { color: var(--muted); }
.report-tools { margin-top: 0; }
.report-tools input[type="month"] { flex: 0 1 200px; }
.report-tools .btn { text-decoration: none; }
.report-head { display: flex; gap: 14px; align-items: center; margin: 8px 0 16px; }
.report-head h1 { margin: 0; font-size: clamp(22px, 3.5vw, 30px); letter-spacing: -.3px; }
.report-head .meta { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.print-only { display: none; }
.hero-stat { display: grid; grid-template-columns: minmax(200px, 260px) 1fr; gap: 20px; align-items: center; }
@media (max-width: 760px) { .hero-stat { grid-template-columns: 1fr; } }
.hero-num .label { display: block; color: var(--muted); font-size: 14px; font-weight: 600; }
.hero-num b { display: block; font-size: 64px; line-height: 1; letter-spacing: -2px; font-variant-numeric: tabular-nums; margin: 6px 0; }
.hero-num .delta { color: var(--muted); font-size: 14px; }
.hero-stat .kpis { margin-top: 0; }
.chart-card, .report-grid, .ticket-list { margin-top: 16px; }
.card h3 { margin: 0 0 10px; font-size: 16px; }
.chart-card { position: relative; }
.chart { width: 100%; overflow: hidden; }
.chart svg { display: block; }
.chart .bar { fill: var(--accent); }
.chart .col .hit { fill: transparent; }
.chart .col.weekend .hit { fill: color-mix(in srgb, var(--ink) 4%, transparent); }
.chart .col.on .hit { fill: color-mix(in srgb, var(--ink) 9%, transparent); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--muted); stroke-width: 1; }
.chart .ylab, .chart .xlab { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .ylab { text-anchor: end; } .chart .xlab { text-anchor: middle; }
.chart-tip { position: absolute; transform: translate(-50%, -100%); background: var(--ink); color: var(--bg); padding: 6px 10px; border-radius: 6px; font-size: 13px; line-height: 1.35; pointer-events: none; white-space: nowrap; z-index: 3; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; }
@media (max-width: 900px) { .report-grid { grid-template-columns: 1fr; } }
table.breakdown th { cursor: default; }
table.breakdown td, table.breakdown th { padding: 6px 6px; border-bottom: 1px solid var(--line); }
table.breakdown .name { width: 55%; overflow-wrap: break-word; hyphens: auto; }
table.breakdown .barcell { width: 30%; min-width: 60px; }
table.breakdown .num { text-align: right; font-variant-numeric: tabular-nums; width: 1%; white-space: nowrap; }
table.breakdown tr.current td { font-weight: 700; }
table.breakdown tbody tr:hover { background: transparent; }
.chart-note { margin: -6px 0 8px; font-size: 13px; }
.hbar { display: block; margin-top: 6px; height: 10px; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--accent); }
table.breakdown tr.extra { display: none; }
.show-all table.breakdown tr.extra { display: table-row; }
.more { margin-top: 8px; }

@media print {
  @page { margin: 14mm; }
  :root { --bg: #fff; --surface: #fff; --surface-2: #f4f1ec; --ink: #111; --muted: #555; --line: #ddd; --accent: #7b1113; color-scheme: light; }
  body { background: #fff; font-size: 12px; }
  header.top, .report-tools, .ticket-list, .more, .chart-tip, .screen-only { display: none !important; }
  .hero-stat { grid-template-columns: 180px 1fr; gap: 12px; }
  .hero-num b { font-size: 48px; }
  .hero-stat .kpis { grid-template-columns: repeat(5, 1fr); gap: 8px; }
  .kpi { padding: 10px; } .kpi b { font-size: 20px; }
  .report-grid, .chart-card { margin-top: 10px; gap: 10px; }
  table.breakdown td, table.breakdown th { padding: 4px; }
  .print-only { display: block; }
  main.wrap { padding-top: 0 !important; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; padding: 12px; }
  .report-grid { grid-template-columns: 1fr 1fr; }
  table.breakdown tr.extra { display: table-row; }
  .hbar, .chart .bar, .kpi { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* content manager */
.small { font-size: 13px; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 14px; }
.savebar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.savebar .wrap { display: flex; align-items: center; gap: 10px; min-height: 56px; flex-wrap: wrap; }
.save-state { font-size: 14px; color: var(--muted); }
.save-state .unsaved { color: var(--warn); }
.cms-tabs { margin: 8px 0 16px; overflow-x: auto; flex-wrap: nowrap; }
.cms-tabs button { white-space: nowrap; }
.panel-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head p { margin: 0; max-width: 680px; }
.panel > p.muted { margin: 0 0 14px; max-width: 680px; }
.stack { display: grid; gap: 12px; }
.card.empty { color: var(--muted); text-align: center; padding: 32px; }
.editor { padding: 16px; }
.editor .field:last-child { margin-bottom: 0; }
.editor-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.editor-head select { width: auto; }
.editor-head .title-input { flex: 1 1 220px; width: auto; font-weight: 600; }
.row-tools { display: inline-flex; gap: 6px; margin-left: auto; }
.btn.small:disabled { opacity: .35; cursor: default; }
.btn.danger { color: var(--bad); }
.state { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.state.st-live { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.state.st-scheduled { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.editor.adv-outage { border-left: 4px solid var(--bad); } .editor.adv-maintenance { border-left: 4px solid var(--warn); } .editor.adv-info { border-left: 4px solid var(--accent); }
.svc-editor { display: flex; gap: 14px; align-items: flex-start; }
.svc-editor.is-hidden { opacity: .6; }
.svc-fields { flex: 1; min-width: 0; }
.svc-fields .editor-head { margin-bottom: 8px; }
.iconpick { position: relative; flex: none; }
.iconpick summary { list-style: none; width: 48px; height: 48px; border-radius: 10px; background: color-mix(in srgb, var(--maroon) 12%, transparent); color: var(--accent); display: grid; place-items: center; cursor: pointer; padding: 0; }
.iconpick summary::-webkit-details-marker { display: none; }
.iconpick summary svg, .icon-grid svg { width: 24px; height: 24px; }
.iconpick[open] summary { box-shadow: 0 0 0 2px var(--accent); }
.icon-grid { position: absolute; top: 54px; left: 0; z-index: 6; display: grid; grid-template-columns: repeat(4, 44px); gap: 6px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.icon-grid button { width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.icon-grid button:hover { border-color: var(--accent); color: var(--accent); }
.icon-grid button.on { background: color-mix(in srgb, var(--maroon) 14%, transparent); color: var(--accent); border-color: var(--accent); }
.form-grid h3 { margin: 18px 0 10px; font-size: 16px; }
.form-grid h3:first-child { margin-top: 0; }
.form-grid h3 small { font-weight: 400; font-size: 13px; }
#hist-rows tr.current td { background: color-mix(in srgb, var(--ok) 6%, transparent); }
@media (max-width: 640px) { .svc-editor { flex-direction: column; } .row-tools { margin-left: 0; } }
section.panel { padding: 0 0 24px; }
.state { white-space: nowrap; flex: none; }
.editor .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .editor .row { grid-template-columns: 1fr; } }
.editor textarea { min-height: 0; }
.svc-editor textarea { min-height: 64px; }

/* sign-in + accounts */
.login-page { display: grid; min-height: 100vh; place-items: center; background:
  radial-gradient(900px 500px at 85% -10%, color-mix(in srgb, var(--maroon) 22%, transparent), transparent 70%), var(--bg); }
.login-wrap { width: min(420px, calc(100vw - 32px)); padding: 32px 0; }
.login-brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; margin-bottom: 20px; }
.login-brand img { border-radius: 12px; box-shadow: var(--shadow); }
.login-brand strong { display: block; line-height: 1.25; }
.login-brand small { display: block; color: var(--muted); font-size: 13px; }
.login-card { padding: 28px; }
.login-card h1 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.3px; }
.login-card > p { margin: 0 0 20px; font-size: 14px; }
.login-card .check { margin: 2px 0 6px; }
.btn.wide { width: 100%; margin-top: 12px; padding: 12px; }
.login-foot { font-size: 13px; color: var(--muted); text-align: center; margin-top: 18px; }
.pw { position: relative; }
.pw input { padding-right: 84px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: var(--surface-2); color: var(--ink); border-radius: 6px; padding: 5px 10px; font: inherit; font-size: 13px; cursor: pointer; }
nav .who { color: #fff; opacity: .85; margin-left: 18px; font-size: 14px; padding-left: 14px; border-left: 1px solid rgba(255,255,255,.3); }
nav .navbtn { background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 8px; padding: 6px 12px; font: inherit; font-size: 14px; margin-left: 10px; cursor: pointer; }
nav .navbtn:hover { background: rgba(255,255,255,.24); }
.card-title { font-size: 18px; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.add-user { display: grid; grid-template-columns: 1fr 1.2fr .7fr 1.3fr auto; gap: 12px; align-items: end; }
.add-user .btn { margin-bottom: 14px; white-space: nowrap; }
@media (max-width: 900px) { .add-user { grid-template-columns: 1fr 1fr; } .add-user .btn { grid-column: 1 / -1; margin-bottom: 0; } }
@media (max-width: 560px) { .add-user { grid-template-columns: 1fr; } }
.pw-form { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 12px; align-items: end; max-width: 900px; }
.pw-form .btn { margin-bottom: 14px; white-space: nowrap; }
@media (max-width: 760px) { .pw-form { grid-template-columns: 1fr; } .pw-form .btn { margin-bottom: 0; } }
table.users th { cursor: default; }
table.users td { vertical-align: middle; }
table.users select { width: auto; padding: 5px 8px; }
table.users tr.off td { opacity: .55; }
table.users .actions { white-space: nowrap; text-align: right; }
table.users .actions .btn { margin-left: 4px; }
code.pwshow { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--surface); padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line); user-select: all; }
nav a.nav-login { display: inline-flex; align-items: center; gap: 6px; margin-left: 22px; padding: 7px 14px; border-radius: 999px; background: var(--gold); color: #2b1a00; font-weight: 600; opacity: 1; text-decoration: none; }
nav a.nav-login:hover { text-decoration: none; filter: brightness(1.06); }
nav a.nav-login svg { width: 16px; height: 16px; }
@media (max-width: 640px) { nav a.nav-login { margin-left: 0; } }


/* public advisories */
.advisories { display: grid; gap: 12px; margin-top: 16px; }
.advisory { --lvl: var(--accent); position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center;
  padding: 16px 20px 16px 24px; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  background: linear-gradient(90deg, color-mix(in srgb, var(--lvl) 9%, var(--surface)), var(--surface) 55%); }
.advisory::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--lvl); }
.advisory.maintenance { --lvl: var(--warn); }
.advisory.outage { --lvl: var(--bad); }
.adv-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--lvl); background: color-mix(in srgb, var(--lvl) 15%, transparent); align-self: start; }
.adv-icon svg { width: 22px; height: 22px; }
.adv-body { min-width: 0; }
.adv-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.adv-tag { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; line-height: 1.5; }
.adv-tag.level { color: var(--lvl); background: color-mix(in srgb, var(--lvl) 14%, transparent); }
.adv-tag.soon { color: var(--ink); border: 1px solid var(--line); }
.adv-title { margin: 0; font-size: 17px; line-height: 1.35; }
.adv-body p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.adv-when { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; padding: 10px 14px; border-radius: 10px; background: var(--surface-2); min-width: 190px; }
.adv-when svg { grid-row: span 2; width: 20px; height: 20px; color: var(--lvl); }
.adv-when span { font-size: 12px; color: var(--muted); }
.adv-when b { font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 760px) {
  .advisory { grid-template-columns: auto 1fr; padding: 14px 16px 14px 20px; }
  .adv-when { grid-column: 2; min-width: 0; justify-self: start; }
}
.adv-sites { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; padding: 0; }
.adv-sites li { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 8px; background: color-mix(in srgb, var(--lvl) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--lvl) 25%, transparent); }
.adv-sites li b { color: var(--lvl); margin-left: 2px; }
.adv-tag .pulse-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); margin-right: 6px; vertical-align: 1px; animation: pulse 2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .adv-tag .pulse-dot { animation: none; } }
.big-check { align-items: flex-start; gap: 10px; white-space: normal; font-size: 15px; margin-bottom: 8px; }
.big-check input { margin-top: 4px; }

/* page always fills the window; footer sits at the bottom */
html { background: var(--bg); }
body:not(.login-page) { min-height: 100vh; display: flex; flex-direction: column; }
body:not(.login-page) > main { flex: 1 0 auto; width: 100%; }
footer { flex: none; background: color-mix(in srgb, var(--surface) 55%, transparent); }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.foot-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.foot-brand img { flex: none; border-radius: 7px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot-links a { color: var(--muted); text-decoration: none; font-size: 14px; }
.foot-links a:hover { color: var(--accent); text-decoration: underline; }
@media (max-width: 640px) { .foot { flex-direction: column; align-items: flex-start; } }
body:not(.login-page) > :not(.to-top) { width: 100%; }

/* larger header brand */
header.top .wrap { min-height: 76px; }
.brand { gap: 14px; }
.brand .mark { width: 46px; height: 46px; border-radius: 11px; }
.brand strong { font-size: 19px; letter-spacing: -.2px; }
.brand small { font-size: 13.5px; margin-top: 2px; }
@media (max-width: 640px) {
  header.top .wrap { min-height: 64px; padding-top: 8px; padding-bottom: 8px; }
  .brand .mark { width: 40px; height: 40px; }
  .brand strong { font-size: 17px; }
  .brand small { font-size: 12.5px; }
}

/* theme switch */
.theme-btn { display: inline-flex; align-items: center; gap: 6px; margin-left: 14px; padding: 6px 10px; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,.14); color: #fff; font: inherit; font-size: 13px; }
.theme-btn:hover { background: rgba(255,255,255,.24); }
.theme-btn svg { width: 17px; height: 17px; }
.theme-btn .t-label { min-width: 34px; text-align: left; }
.theme-float { position: fixed; top: 16px; right: 16px; z-index: 20; background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow); margin: 0; }
.theme-float:hover { background: var(--surface-2); }
@media (max-width: 640px) { .theme-btn { margin-left: 0; } }

/* Tinig feedback prompt under "Track a request" */
.card.feedback { display: flex; align-items: center; gap: 20px; margin-top: 16px; }
.card.feedback[hidden] { display: none; }
.card.feedback h3 { margin: 0 0 4px; font-size: 17px; }
.card.feedback p { margin: 0; color: var(--muted); }
.card.feedback .btn { margin-left: auto; white-space: nowrap; }
.ticket .rate { margin-top: 14px; }
@media (max-width: 640px) { .card.feedback { flex-direction: column; align-items: stretch; } .card.feedback .btn { margin-left: 0; text-align: center; } }

/* Content Manager › Integrations */
.int-actions { display: flex; align-items: center; gap: 12px; }
.int-card h3 { margin: 0; font-size: 18px; }
.int-card .int-help { margin: -4px 0 12px; max-width: 760px; }
.int-card .int-err { margin: 0 0 12px; }
.int-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 16px; }
.int-fields .field small { display: block; margin-top: 4px; font-size: 12.5px; line-height: 1.4; }
.int-group { grid-column: 1 / -1; margin: 8px 0 10px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.secret-row { display: flex; gap: 8px; align-items: center; }
.secret-row input { flex: 1; min-width: 0; }
.int-card.is-off .int-fields, .int-card.is-off .int-help { opacity: .5; }
.int-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.test-ok { color: var(--ok); }
.test-bad { color: var(--bad); }
@media (max-width: 640px) { .int-actions { width: 100%; justify-content: space-between; } }

/* centered footer: copyright line above the links */
.foot { flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; }
.foot-brand { justify-content: center; }
.foot-links { justify-content: center; }
@media (max-width: 640px) { .foot { align-items: center; } .foot-brand { flex-direction: column; gap: 8px; } }

/* ---------- About us + organizational chart ---------- */
.about-text p { margin: 0 0 12px; max-width: 820px; line-height: 1.65; }
.about-text p:last-child { margin-bottom: 0; }
.about-text:empty { display: none; }
.org-title { font-size: 19px; margin: 36px 0 18px; }
.org-chart { --org-line: color-mix(in srgb, var(--maroon) 35%, var(--line)); --org-gap: 28px; display: flex; flex-direction: column; align-items: center; }
.org-level { display: flex; justify-content: center; width: 100%; }
.org-link { width: 2px; height: var(--org-gap); background: var(--org-line); }
.org-node { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; min-width: 240px; max-width: 360px; text-align: center; }
.org-node.org-top { border-top: 4px solid var(--maroon); }
.org-node.org-mid { border-top: 4px solid var(--gold); }
.org-role { font-weight: 700; font-size: 15px; letter-spacing: .02em; text-transform: uppercase; color: var(--accent); }
.org-top .org-role { font-size: 16px; }
.org-desc { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); }
.org-people { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: grid; gap: 10px; text-align: left; }
.org-person { display: flex; align-items: center; gap: 10px; }
.org-person b { display: block; font-size: 15px; }
.org-person small { display: block; color: var(--muted); font-size: 13px; }
.org-avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700;
  background: color-mix(in srgb, var(--maroon) 12%, transparent); color: var(--accent); }
.org-top .org-avatar { background: var(--maroon); color: #fff; }
.org-mid .org-avatar { background: var(--gold); color: #2b1a00; }
/* three teams side by side, joined by a bar under the Team Lead */
.org-branches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; width: 100%; position: relative; padding-top: var(--org-gap); }
.org-branches::before { content: ''; position: absolute; top: 0; left: calc((100% - 40px) / 6); right: calc((100% - 40px) / 6); border-top: 2px solid var(--org-line); } /* column centres: 3 columns, two 20px gaps */
.org-branch { position: relative; display: flex; justify-content: center; }
.org-branch::before { content: ''; position: absolute; top: calc(-1 * var(--org-gap)); left: 50%; height: var(--org-gap); border-left: 2px solid var(--org-line); }
.org-branch .org-node { width: 100%; max-width: none; min-width: 0; }
@media (max-width: 760px) {
  .org-branches { grid-template-columns: 1fr; gap: 14px; padding-top: 0; }
  .org-branches::before { display: none; }
  .org-branch::before { display: none; }
  .org-branch + .org-branch { padding-top: 0; }
  .org-node { min-width: 0; width: 100%; max-width: none; }
}
@media print { .org-node { box-shadow: none; } }
.team-editor .editor-head select { width: auto; }
.team-editor.is-hidden { opacity: .6; }

/* ---------- back to top button ---------- */
.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 9; width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--maroon); color: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22), 0 0 0 3px color-mix(in srgb, var(--gold) 0%, transparent);
  opacity: 0; visibility: hidden; transform: translateY(16px) scale(.9);
  transition: opacity .2s ease, transform .2s ease, visibility .2s, box-shadow .2s ease, background-color .2s ease; }
.to-top svg { width: 22px; height: 22px; transition: transform .2s ease; }
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--maroon-ink); transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0, 0, 0, .28), 0 0 0 3px var(--gold); }
.to-top:hover svg { transform: translateY(-2px); }
.to-top:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
:root[data-theme="dark"] .to-top { box-shadow: 0 6px 18px rgba(0, 0, 0, .5); }
#toasts { bottom: 78px; } /* keep pop-up notices clear of the button */
@media (max-width: 640px) { .to-top { right: 14px; bottom: 14px; width: 42px; height: 42px; } }
@media (prefers-reduced-motion: reduce) { .to-top, .to-top svg { transition: none; } .to-top:hover { transform: none; } }
@media print { .to-top { display: none !important; } }
