/* GeoMonitor NOC TV dashboard (/dashboard/noc) — GeoMonitor glass theme (CeruleanBlue).
   Everything is sized in rem and the root font scales with the viewport:
   16px @1920x1080, 32px @3840x2160. Light/dark follow the shared `theme` preference. */

:root,
[data-bs-theme="dark"] {
  --primary: #00b8d6;
  --primary-rgb: 0, 184, 214;
  --violet: #8b5cf6;
  --brand-purple: #8966a4;
  --teal: #00a686;
  --brand-gradient: linear-gradient(135deg, var(--primary), var(--violet));

  --page-bg: linear-gradient(145deg, #0b1222 0%, #17153d 48%, #082f49 100%);
  --orb-1: rgba(0, 184, 214, 0.16);
  --orb-2: rgba(137, 102, 164, 0.16);
  --orb-3: rgba(0, 166, 134, 0.12);

  --glass: rgba(15, 23, 42, 0.58);
  --glass-strong: rgba(22, 32, 54, 0.9);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --glass-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.35);
  --panel: rgba(15, 23, 42, 0.62);
  --panel-2: rgba(30, 41, 66, 0.62);
  --border: rgba(255, 255, 255, 0.09);
  --track: rgba(255, 255, 255, 0.08);
  --chip: rgba(255, 255, 255, 0.07);

  --text: #eef3fb;
  --muted: #94a3b8;
  --dim: #64748b;

  --green: #22c55e;
  --green-rgb: 34, 197, 94;
  --amber: #f5a524;
  --amber-rgb: 245, 165, 36;
  --red: #f43f5e;
  --red-rgb: 244, 63, 94;
  --offline: #ff5470;
  --offline-rgb: 255, 84, 112;
  --gray: #8492a6;
  --gray-rgb: 132, 146, 166;
  --blue: #22d3ee;
  --blue-rgb: 34, 211, 238;
  --maint: #a78bfa;
  --maint-rgb: 167, 139, 250;
  --on-amber: #1f1300;

  --mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --body-font: "DM Sans", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --title-font: "Jost", "DM Sans", "Segoe UI", sans-serif;
  color-scheme: dark;
}

[data-bs-theme="light"] {
  --page-bg: linear-gradient(145deg, #d4f1f9 0%, #ebe4ff 38%, #dff6ff 68%, #fae8ff 100%);
  --orb-1: rgba(0, 184, 214, 0.22);
  --orb-2: rgba(137, 102, 164, 0.18);
  --orb-3: rgba(0, 166, 134, 0.14);

  --glass: rgba(255, 255, 255, 0.6);
  --glass-strong: rgba(255, 255, 255, 0.94);
  --glass-border: rgba(255, 255, 255, 0.7);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  --glass-shadow: 0 0.5rem 2rem rgba(15, 23, 42, 0.08);
  --panel: rgba(255, 255, 255, 0.6);
  --panel-2: rgba(255, 255, 255, 0.82);
  --border: rgba(15, 23, 42, 0.08);
  --track: rgba(15, 23, 42, 0.08);
  --chip: rgba(15, 23, 42, 0.06);

  --text: #0f172a;
  --muted: #526077;
  --dim: #7c8aa0;

  --green: #059669;
  --green-rgb: 5, 150, 105;
  --amber: #d97706;
  --amber-rgb: 217, 119, 6;
  --red: #e11d48;
  --red-rgb: 225, 29, 72;
  --offline: #be123c;
  --offline-rgb: 190, 18, 60;
  --gray: #64748b;
  --gray-rgb: 100, 116, 139;
  --blue: #0891b2;
  --blue-rgb: 8, 145, 178;
  --maint: #7c3aed;
  --maint-rgb: 124, 58, 237;
  --on-amber: #fff;
  color-scheme: light;
}

html {
  font-size: clamp(10px, min(0.8333vw, 1.4815vh), 72px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  color: var(--text);
  font-family: var(--body-font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
body {
  background: var(--page-bg);
  transition: background 0.4s;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 15%, var(--orb-1) 0%, transparent 40%),
    radial-gradient(circle at 90% 8%, var(--orb-2) 0%, transparent 36%),
    radial-gradient(circle at 70% 92%, var(--orb-3) 0%, transparent 40%);
}

body.hide-cursor, body.hide-cursor * { cursor: none !important; }

button { font: inherit; color: inherit; }

.glass {
  background: var(--glass);
  border: 0.0625rem solid var(--glass-border);
  box-shadow: var(--glass-shadow), var(--glass-hi);
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
}

.noc-app {
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 0.8rem;
  padding: 0.9rem 1.1rem 0.7rem;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.noc-header {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.3rem;
  border-radius: 1.1rem;
  overflow: hidden;
  background:
    linear-gradient(110deg, rgba(var(--primary-rgb), 0.14) 0%, transparent 50%),
    var(--glass);
}
.noc-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0.16rem;
  background: linear-gradient(90deg, var(--primary), var(--violet) 55%, transparent);
  opacity: 0.85;
}

.brand { display: flex; align-items: center; gap: 0.9rem; min-width: 0; }
.brand-logo {
  display: grid;
  place-items: center;
  width: 3.3rem;
  height: 3.3rem;
  border-radius: 0.95rem;
  color: #fff;
  background: var(--brand-gradient);
  box-shadow: 0 0.4rem 1.2rem rgba(var(--primary-rgb), 0.4);
  flex-shrink: 0;
}
.brand-logo svg { width: 1.8rem; height: 1.8rem; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.brand-title {
  font-family: var(--title-font);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.brand-title span {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-left: 0.15em;
}
.brand-sub {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-top: 0.15rem;
}

.mode-chip {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.05rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  background: rgba(var(--red-rgb), 0.14);
  border: 0.0625rem solid rgba(var(--red-rgb), 0.35);
  vertical-align: 0.08rem;
}

.system-status {
  --tone: var(--gray);
  --tone-rgb: var(--gray-rgb);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 2.2rem 0.6rem 1rem;
  border-radius: 999px;
  border: 0.0625rem solid rgba(var(--tone-rgb), 0.45);
  background:
    linear-gradient(90deg, rgba(var(--tone-rgb), 0.22), rgba(var(--tone-rgb), 0.08));
  color: var(--tone);
  font-family: var(--title-font);
  font-weight: 700;
  font-size: 1.9rem;
  letter-spacing: 0.04em;
  min-width: 34rem;
  line-height: 1.1;
  transition: color 0.3s, background 0.3s, border-color 0.3s;
}
.status-orb {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--tone);
  color: #fff;
  box-shadow: 0 0 0 0.35rem rgba(var(--tone-rgb), 0.18), 0 0 1.4rem rgba(var(--tone-rgb), 0.55);
  flex-shrink: 0;
}
.status-orb .icon { width: 1.8rem; height: 1.8rem; stroke-width: 2.4; }
.system-status .sub {
  display: block;
  font-family: var(--body-font);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  opacity: 0.75;
  margin-top: 0.15rem;
}
.system-status.healthy { --tone: var(--green); --tone-rgb: var(--green-rgb); }
.system-status.warning { --tone: var(--amber); --tone-rgb: var(--amber-rgb); }
.system-status.critical { --tone: var(--red); --tone-rgb: var(--red-rgb); animation: pulse-status 2.6s ease-in-out infinite; }
.system-status.lost {
  --tone: var(--amber);
  --tone-rgb: var(--amber-rgb);
  background: repeating-linear-gradient(-45deg, rgba(var(--amber-rgb), 0.2) 0 1rem, rgba(var(--amber-rgb), 0.07) 1rem 2rem);
}
.system-status.loading { --tone: var(--primary); --tone-rgb: var(--primary-rgb); }

.header-right { display: flex; justify-content: flex-end; align-items: center; gap: 1.4rem; }
.clockbox { padding-left: 1.4rem; border-left: 0.0625rem solid var(--glass-border); }
.clock {
  font-family: var(--title-font);
  font-size: 2.6rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: right;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.clock-date { color: var(--muted); font-size: 0.85rem; font-weight: 600; text-align: right; margin-top: 0.35rem; letter-spacing: 0.1em; }

/* ── Summary ────────────────────────────────────────────────────────────── */

.summary {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0.8rem;
}
.stat {
  --tone: var(--primary);
  --tone-rgb: var(--primary-rgb);
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.75rem;
  align-items: center;
  padding: 0.7rem 0.9rem;
  border-radius: 1rem;
  overflow: hidden;
  background: var(--glass);
  border: 0.0625rem solid var(--glass-border);
  box-shadow: var(--glass-shadow), var(--glass-hi);
  transition: background 0.3s, border-color 0.3s;
}
.stat::after {
  content: "";
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 0;
  height: 0.18rem;
  border-radius: 0.2rem 0.2rem 0 0;
  background: var(--tone);
  opacity: 0.85;
}
.stat-ic {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 0.8rem;
  color: var(--tone);
  background: rgba(var(--tone-rgb), 0.14);
}
.stat-ic svg { width: 1.45rem; height: 1.45rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stat .label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat .value {
  font-family: var(--title-font);
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stat .value small { font-family: var(--body-font); font-size: 0.95rem; color: var(--muted); font-weight: 600; }
.stat.ok { --tone: var(--green); --tone-rgb: var(--green-rgb); }
.stat.ok .value { color: var(--green); }
.stat.warn { --tone: var(--amber); --tone-rgb: var(--amber-rgb); background: linear-gradient(160deg, rgba(var(--amber-rgb), 0.16), var(--glass) 65%); }
.stat.warn .value { color: var(--amber); }
.stat.crit { --tone: var(--red); --tone-rgb: var(--red-rgb); background: linear-gradient(160deg, rgba(var(--red-rgb), 0.22), var(--glass) 65%); border-color: rgba(var(--red-rgb), 0.35); }
.stat.crit .value { color: var(--red); }
.stat.off { --tone: var(--offline); --tone-rgb: var(--offline-rgb); background: linear-gradient(160deg, rgba(var(--offline-rgb), 0.26), var(--glass) 70%); border-color: rgba(var(--offline-rgb), 0.4); }
.stat.off .value { color: var(--offline); }

/* ── Main ───────────────────────────────────────────────────────────────── */

.noc-main {
  display: grid;
  grid-template-columns: 1fr 31rem;
  gap: 0.9rem;
  min-height: 0;
}

.panel {
  border-radius: 1.1rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.1rem 0.6rem;
  border-bottom: 0.0625rem solid var(--border);
  gap: 1rem;
}
.panel-title {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--title-font);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.panel-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--brand-gradient);
  box-shadow: 0 0 0.6rem rgba(var(--primary-rgb), 0.7);
}
.panel-meta {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: var(--chip);
}
.panel-meta:empty { display: none; }

.grid-scroll {
  flex: 1;
  overflow: hidden;
  padding: 0.8rem;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.75rem;
}
.server-grid:empty { display: none; }

/* ── Server card ────────────────────────────────────────────────────────── */

.card {
  --accent: var(--gray);
  --accent-rgb: var(--gray-rgb);
  position: relative;
  background:
    linear-gradient(180deg, rgba(var(--accent-rgb), 0.12), transparent 45%),
    var(--panel-2);
  border: 0.0625rem solid var(--border);
  border-radius: 0.95rem;
  padding: 0.85rem 0.9rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.3s;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 0.22rem;
  background: linear-gradient(90deg, var(--accent), rgba(var(--accent-rgb), 0.15));
}
.card:hover { transform: translateY(-0.12rem); box-shadow: 0 0.6rem 1.6rem rgba(0, 0, 0, 0.25); }
.card.s-healthy { --accent: var(--green); --accent-rgb: var(--green-rgb); }
.card.s-warning { --accent: var(--amber); --accent-rgb: var(--amber-rgb); border-color: rgba(var(--amber-rgb), 0.3); }
.card.s-critical { --accent: var(--red); --accent-rgb: var(--red-rgb); border-color: rgba(var(--red-rgb), 0.45); background: linear-gradient(180deg, rgba(var(--red-rgb), 0.2), transparent 55%), var(--panel-2); }
.card.s-offline { --accent: var(--offline); --accent-rgb: var(--offline-rgb); border-color: rgba(var(--offline-rgb), 0.5); background: linear-gradient(180deg, rgba(var(--offline-rgb), 0.24), transparent 65%), var(--panel-2); }
.card.s-critical.unacked, .card.s-offline.unacked { animation: pulse-card 2.8s ease-in-out infinite; }
.card.s-unknown { --accent: var(--gray); --accent-rgb: var(--gray-rgb); }
.card.s-maintenance { --accent: var(--maint); --accent-rgb: var(--maint-rgb); }

.card-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.6rem 0.18rem 0.4rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: rgba(var(--accent-rgb, var(--gray-rgb)), 0.16);
}
.badge .icon { width: 1.05rem; height: 1.05rem; }
.card-since { color: var(--muted); font-size: 0.78rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.card-name {
  font-family: var(--title-font);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0.1rem 0 0;
  line-height: 1.15;
}
.card-sub, .card-loc {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-loc { color: var(--dim); }

.metrics { display: grid; gap: 0.32rem; margin-top: 0.3rem; }
.metric {
  display: grid;
  grid-template-columns: 5.2rem 1fr 3.6rem 1.1rem;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.95rem;
}
.metric .m-label { color: var(--muted); font-weight: 700; letter-spacing: 0.06em; font-size: 0.76rem; white-space: nowrap; }
.metric .m-value { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.metric .m-flag { width: 1.1rem; height: 1.1rem; display: flex; }
.metric .m-flag svg { width: 100%; height: 100%; }
.metric.hb { grid-template-columns: 5.2rem 1fr 1.1rem; }
.metric.hb .m-value { text-align: right; font-weight: 600; }
.bar { height: 0.42rem; background: var(--track); border-radius: 1rem; overflow: hidden; }
.bar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--violet));
  transition: width 0.6s ease;
}
.metric.lv-warning .m-value, .metric.lv-warning .m-flag { color: var(--amber); }
.metric.lv-warning .bar > i { background: linear-gradient(90deg, rgba(var(--amber-rgb), 0.55), var(--amber)); }
.metric.lv-critical .m-value, .metric.lv-critical .m-flag { color: var(--red); }
.metric.lv-critical .bar > i { background: linear-gradient(90deg, rgba(var(--red-rgb), 0.55), var(--red)); box-shadow: 0 0 0.5rem rgba(var(--red-rgb), 0.6); }
.metrics.stale .m-value, .metrics.stale .bar { opacity: 0.4; }

.card-issue {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(var(--accent-rgb), 0.12);
  border-left: 0.18rem solid var(--accent);
  border-radius: 0.4rem;
  padding: 0.32rem 0.55rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.15rem;
}
.card-issue:empty { display: none; }

.card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-top: 0.2rem;
  font-size: 0.78rem;
}
.card-foot .alerts-count { font-weight: 700; letter-spacing: 0.06em; margin-right: auto; }
.card.s-healthy .alerts-count { color: var(--muted); }
.tag {
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 0.68rem;
  white-space: nowrap;
}
.tag.t-red { background: var(--red); color: #fff; box-shadow: 0 0 0.6rem rgba(var(--red-rgb), 0.45); }
.tag.t-amber { background: var(--amber); color: var(--on-amber); }
.tag.t-gray { background: var(--chip); color: var(--text); border: 0.0625rem solid var(--border); }
.tag.t-blue { background: rgba(var(--blue-rgb), 0.16); color: var(--blue); }
.tag.t-green { background: rgba(var(--green-rgb), 0.16); color: var(--green); }
.card-updated { color: var(--dim); font-size: 0.7rem; font-variant-numeric: tabular-nums; }

.empty-state {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  color: var(--green);
}
.empty-state .icon {
  width: 7rem;
  height: 7rem;
  padding: 1.5rem;
  margin-bottom: 0.8rem;
  border-radius: 50%;
  background: rgba(var(--green-rgb), 0.12);
  box-shadow: 0 0 0 0.6rem rgba(var(--green-rgb), 0.06), 0 0 3rem rgba(var(--green-rgb), 0.3);
}
.empty-state b { font-family: var(--title-font); font-size: 2.2rem; font-weight: 600; letter-spacing: 0.06em; }
.empty-state span { color: var(--muted); font-size: 1.1rem; }
.empty-state.none { color: var(--muted); }
.empty-state.none .icon { background: var(--chip); box-shadow: none; }

/* ── Incidents ──────────────────────────────────────────────────────────── */

.incidents { flex: 1; overflow: hidden; padding: 0.7rem; display: flex; flex-direction: column; gap: 0.55rem; min-height: 0; position: relative; }
.incident {
  --accent: var(--amber);
  --accent-rgb: var(--amber-rgb);
  position: relative;
  background:
    linear-gradient(90deg, rgba(var(--accent-rgb), 0.14), transparent 70%),
    var(--panel-2);
  border: 0.0625rem solid var(--border);
  border-radius: 0.8rem;
  padding: 0.55rem 0.8rem 0.6rem 1.05rem;
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
}
.incident::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0.28rem;
  background: var(--accent);
}
.incident.sev-critical { --accent: var(--red); --accent-rgb: var(--red-rgb); border-color: rgba(var(--red-rgb), 0.3); }
.incident.sev-offline { --accent: var(--offline); --accent-rgb: var(--offline-rgb); border-color: rgba(var(--offline-rgb), 0.35); }
.incident.sev-warning { --accent: var(--amber); --accent-rgb: var(--amber-rgb); }
.incident.sev-info { --accent: var(--blue); --accent-rgb: var(--blue-rgb); }
.incident.unacked.sev-critical, .incident.unacked.sev-offline { animation: pulse-row 2.8s ease-in-out infinite; }
.inc-top { display: flex; align-items: center; gap: 0.6rem; }
.inc-sev { display: inline-flex; gap: 0.3rem; align-items: center; font-weight: 700; font-size: 0.75rem; letter-spacing: 0.08em; color: var(--accent); }
.inc-sev .icon { width: 1rem; height: 1rem; }
.inc-time { font-weight: 700; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.inc-dur {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: var(--chip);
  font-variant-numeric: tabular-nums;
}
.inc-server { font-family: var(--title-font); font-weight: 600; font-size: 1.1rem; margin-top: 0.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inc-msg { font-size: 0.92rem; font-weight: 500; }
.inc-meta { color: var(--muted); font-size: 0.76rem; margin-top: 0.12rem; font-variant-numeric: tabular-nums; }
.inc-status { margin-top: 0.35rem; display: flex; gap: 0.35rem; flex-wrap: wrap; }
.inc-more {
  color: var(--muted);
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem;
  border-radius: 0.6rem;
  border: 0.0625rem dashed var(--border);
  flex-shrink: 0;
}

.no-incidents {
  margin: auto;
  text-align: center;
  color: var(--green);
  font-family: var(--title-font);
  font-weight: 600;
  letter-spacing: 0.06em;
  font-size: 1.25rem;
}
.no-incidents .icon {
  width: 4.2rem;
  height: 4.2rem;
  padding: 0.9rem;
  display: block;
  margin: 0 auto 0.8rem;
  border-radius: 50%;
  background: rgba(var(--green-rgb), 0.14);
  box-shadow: 0 0 2rem rgba(var(--green-rgb), 0.3);
}

.resolved {
  border-top: 0.0625rem solid var(--border);
  padding: 0.55rem 0.9rem 0.65rem;
  flex-shrink: 0;
}
.resolved h4 { margin: 0 0 0.4rem; color: var(--muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.resolved-row { display: grid; grid-template-columns: 3.2rem 1fr auto; gap: 0.5rem; font-size: 0.78rem; color: var(--muted); padding: 0.12rem 0; align-items: center; }
.resolved-row b { color: var(--green); font-weight: 700; font-variant-numeric: tabular-nums; }
.resolved-row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Footer ─────────────────────────────────────────────────────────────── */

.noc-footer {
  display: flex;
  align-items: center;
  gap: 1.3rem;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 0.4rem 0.6rem 0.4rem 1rem;
  border-radius: 999px;
}
.noc-footer b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.foot-item { display: inline-flex; align-items: center; gap: 0.35rem; }
.noc-footer .sep { flex: 1; }
.foot-user { font-weight: 600; }
.dot { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--gray); }
.dot.ok { background: var(--green); box-shadow: 0 0 0.55rem var(--green); }
.dot.warn { background: var(--amber); box-shadow: 0 0 0.55rem var(--amber); }
.dot.bad { background: var(--red); box-shadow: 0 0 0.55rem var(--red); }
.foot-btn {
  background: var(--chip);
  border: 0.0625rem solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.85rem;
  color: var(--text);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.foot-btn:hover { border-color: var(--primary); color: var(--primary); }
.foot-btn.on { color: var(--green); border-color: rgba(var(--green-rgb), 0.5); background: rgba(var(--green-rgb), 0.12); }
.foot-stale {
  color: var(--on-amber);
  background: var(--amber);
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* ── Overlays ───────────────────────────────────────────────────────────── */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  backdrop-filter: blur(0.3rem);
  -webkit-backdrop-filter: blur(0.3rem);
}
.overlay[hidden] { display: none; }
.lost-box {
  border-radius: 1.4rem;
  padding: 2.5rem 5rem;
  text-align: center;
  background: var(--glass-strong);
  border-color: rgba(var(--amber-rgb), 0.5);
}
.lost-icon {
  display: grid;
  place-items: center;
  width: 5rem;
  height: 5rem;
  margin: 0 auto 1.1rem;
  border-radius: 50%;
  color: var(--amber);
  background: rgba(var(--amber-rgb), 0.15);
  box-shadow: 0 0 2.4rem rgba(var(--amber-rgb), 0.35);
  animation: pulse-lost 2s ease-in-out infinite;
}
.lost-icon svg { width: 2.6rem; height: 2.6rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lost-box h2 { font-family: var(--title-font); color: var(--amber); font-size: 2.8rem; font-weight: 700; margin: 0 0 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; }
.lost-box p { font-size: 1.35rem; margin: 0.4rem 0; color: var(--text); }
.lost-box .muted { color: var(--muted); font-size: 1.05rem; }

.modal {
  width: min(56rem, 92vw);
  max-height: 88vh;
  overflow: auto;
  background: var(--glass-strong);
  border-radius: 1.2rem;
  padding: 1.4rem 1.7rem;
}
.modal .badge, .modal .inc-sev {
  --accent-rgb: var(--gray-rgb);
  padding: 0.2rem 0.65rem 0.2rem 0.45rem;
  border-radius: 999px;
  background: var(--chip);
}
.modal h3 { font-family: var(--title-font); margin: 0.5rem 0 0.25rem; font-size: 1.8rem; font-weight: 600; }
.modal .muted { color: var(--muted); }
.modal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin: 1.1rem 0;
}
.modal-grid > div {
  padding: 0.55rem 0.75rem;
  border-radius: 0.7rem;
  background: var(--chip);
  border: 0.0625rem solid var(--border);
  min-width: 0;
}
.modal-grid div small { display: block; color: var(--muted); font-size: 0.68rem; letter-spacing: 0.1em; font-weight: 700; }
.modal-grid div span { font-size: 1.02rem; font-weight: 600; overflow-wrap: anywhere; }
.modal h4 { margin: 1.2rem 0 0.45rem; color: var(--muted); letter-spacing: 0.12em; font-size: 0.78rem; font-weight: 700; }
.timeline { list-style: none; padding: 0; margin: 0; font-size: 0.88rem; }
.timeline li {
  position: relative;
  padding: 0.4rem 0 0.4rem 1.2rem;
  border-bottom: 0.0625rem solid var(--border);
  display: grid;
  grid-template-columns: 9rem 9rem 1fr;
  gap: 0.8rem;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.82rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--brand-gradient);
}
.timeline li b { text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.78rem; color: var(--primary); }
.modal-actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 1.3rem; }
.btn {
  border: 0.0625rem solid var(--border);
  background: var(--chip);
  border-radius: 999px;
  padding: 0.5rem 1.3rem;
  cursor: pointer;
  font-weight: 700;
  transition: filter 0.2s;
}
.btn:hover { filter: brightness(1.12); }
.btn.primary { background: var(--brand-gradient); color: #fff; border-color: transparent; box-shadow: 0 0.3rem 1rem rgba(var(--primary-rgb), 0.35); }
.btn.danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn:disabled { opacity: 0.5; cursor: default; }
.svc-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.35rem 1rem; font-size: 0.88rem; }
.svc-list span { font-weight: 600; }

.toast-sound {
  position: fixed;
  right: 1.2rem;
  bottom: 3.6rem;
  background: var(--glass-strong);
  border: 0.0625rem solid var(--amber);
  color: var(--amber);
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 40;
  box-shadow: var(--glass-shadow);
}
.toast-sound[hidden] { display: none; }

.icon { flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

@keyframes pulse-card {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); }
  50% { box-shadow: 0 0 1.5rem 0.15rem rgba(var(--accent-rgb), 0.5); }
}
@keyframes pulse-row {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); }
  50% { box-shadow: 0 0 1rem 0.05rem rgba(var(--accent-rgb), 0.45); }
}
@keyframes pulse-status {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--red-rgb), 0); }
  50% { box-shadow: 0 0 1.8rem 0.2rem rgba(var(--red-rgb), 0.5); }
}
@keyframes pulse-lost {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}
@media (prefers-reduced-motion: reduce) {
  .card, .incident, .system-status, .lost-icon { animation: none !important; }
  .card:hover { transform: none; }
}
