/* ==========================================================================
   HRP UPTIME DASHBOARD
   Same design system as the support / WIP dashboards (tokens copied verbatim
   so the estate stays visually consistent), plus:
     - a login card, since this app is not behind SSO
     - a print sheet, because this one gets shown to a client
   ========================================================================== */

:root {
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-full: 9999px;
}

[data-theme="dark"] {
  --bg-app: #0b0f19;
  --bg-gradient: radial-gradient(circle at 50% 0%, #151d30 0%, #0b0f19 100%);

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-inverse: #0b0f19;

  --glass-bg: rgba(17, 24, 39, 0.65);
  --glass-bg-inset: rgba(17, 24, 39, 0.45);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-focus: rgba(99, 102, 241, 0.4);
  --glass-shadow: rgba(0, 0, 0, 0.4);
  --glass-shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.5);

  --color-green: 142, 70%, 50%;
  --color-blue: 217, 91%, 60%;
  --color-purple: 271, 91%, 65%;
  --color-orange: 27, 90%, 55%;
  --color-red: 350, 89%, 60%;
  --color-neutral: 215, 15%, 65%;
}

[data-theme="light"] {
  --bg-app: #f4f6fa;
  --bg-gradient: radial-gradient(circle at 50% 0%, #e2e8f0 0%, #f4f6fa 100%);

  --text-main: #1f2937;
  --text-muted: #6b7280;
  --text-inverse: #ffffff;

  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-bg-inset: rgba(255, 255, 255, 0.5);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-border-focus: rgba(99, 102, 241, 0.5);
  --glass-shadow: rgba(31, 41, 55, 0.08);
  --glass-shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.05);

  --color-green: 142, 76%, 36%;
  --color-blue: 217, 91%, 50%;
  --color-purple: 271, 80%, 50%;
  --color-orange: 27, 90%, 45%;
  --color-red: 350, 80%, 50%;
  --color-neutral: 215, 15%, 45%;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--bg-app);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition-slow), color var(--transition-slow);
}

.glow-accent {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}
.glow-1 { width: 420px; height: 420px; background: hsl(var(--color-blue)); top: -120px; left: -80px; }
.glow-2 { width: 380px; height: 380px; background: hsl(var(--color-purple)); top: 40%; right: -120px; }

.app-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px 24px;
  position: relative;
  z-index: 1;
}

.bg-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 30px -10px var(--glass-shadow);
  transition: border var(--transition-normal), box-shadow var(--transition-normal), background var(--transition-slow);
}
.bg-glass-inset {
  background: var(--glass-bg-inset);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow-inset);
}
.hidden { display: none !important; }

/* ---------- Header ---------- */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.header-left { display: flex; align-items: center; gap: 14px; }
.header-logo {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, hsl(var(--color-blue)), hsl(var(--color-purple)));
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
}
.header-logo svg { width: 24px; height: 24px; }
.app-header h1 {
  font-family: var(--font-heading);
  font-size: 26px; font-weight: 800; line-height: 1.1;
}
.app-header h1 span {
  background: linear-gradient(135deg, hsl(var(--color-blue)), hsl(var(--color-purple)));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.view-tabs {
  display: flex;
  background: var(--glass-bg-inset);
  padding: 4px; border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  gap: 4px; flex-wrap: wrap;
}
.view-tab {
  background: transparent; border: none;
  color: var(--text-muted);
  padding: 8px 16px; border-radius: 10px;
  font-family: var(--font-heading);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all var(--transition-fast);
}
.view-tab:hover { color: var(--text-main); }
.view-tab.active {
  background: var(--glass-bg);
  color: var(--text-main);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-right { display: flex; align-items: center; gap: 10px; }
.status-indicator {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  background: var(--glass-bg-inset);
  border: 1px solid var(--glass-border);
  padding: 7px 12px; border-radius: var(--radius-full);
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: hsl(var(--color-green));
  box-shadow: 0 0 0 0 hsla(var(--color-green), 0.6);
  animation: pulse 2s infinite;
}
.pulse-dot.error { background: hsl(var(--color-red)); box-shadow: 0 0 0 0 hsla(var(--color-red), 0.6); animation: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 hsla(var(--color-green), 0.5); }
  70% { box-shadow: 0 0 0 8px hsla(var(--color-green), 0); }
  100% { box-shadow: 0 0 0 0 hsla(var(--color-green), 0); }
}

.nav-arrow-btn, .theme-toggle-btn {
  background: var(--glass-bg-inset);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--transition-fast);
}
.nav-arrow-btn:hover, .theme-toggle-btn:hover { border-color: var(--glass-border-focus); transform: translateY(-1px); }
.nav-arrow-btn svg, .theme-toggle-btn svg { width: 17px; height: 17px; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* ---------- Coverage banner ----------
   The most important component on the page. It says what the data behind
   every other number can and cannot see. */
.coverage-banner {
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
  border: 1px solid hsla(var(--color-orange), 0.35);
  background: hsla(var(--color-orange), 0.08);
  display: flex; gap: 14px; align-items: flex-start;
}
.coverage-banner.ok { border-color: hsla(var(--color-green), 0.3); background: hsla(var(--color-green), 0.07); }
.coverage-banner.bad { border-color: hsla(var(--color-red), 0.4); background: hsla(var(--color-red), 0.08); }
.coverage-icon { flex-shrink: 0; width: 20px; height: 20px; color: hsl(var(--color-orange)); margin-top: 1px; }
.coverage-banner.ok .coverage-icon { color: hsl(var(--color-green)); }
.coverage-banner.bad .coverage-icon { color: hsl(var(--color-red)); }
.coverage-body h3 { font-family: var(--font-heading); font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.coverage-body ul { list-style: none; display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.coverage-body li { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; padding-left: 14px; position: relative; }
.coverage-body li::before { content: "·"; position: absolute; left: 4px; font-weight: 700; }
.coverage-body li strong { color: var(--text-main); font-weight: 600; }

.report-meta {
  display: flex; gap: 20px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-muted);
  margin-bottom: 20px; padding: 0 4px;
}
.report-meta strong { color: var(--text-main); font-weight: 600; }

/* ---------- Metrics ---------- */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px; margin-bottom: 24px;
}
.metric-card {
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex; align-items: center; gap: 20px;
}
.metric-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.metric-icon.green { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.metric-icon.blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.metric-icon.purple { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.metric-icon.orange { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.metric-icon.red { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.metric-icon svg { width: 24px; height: 24px; }
.metric-info h3 {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted); font-weight: 600;
}
.metric-value {
  font-family: var(--font-heading);
  font-size: 28px; font-weight: 700; margin-top: 2px; line-height: 1.2;
}
.metric-trend { font-size: 12px; margin-top: 4px; display: block; font-weight: 500; color: var(--text-muted); }
.text-green { color: #10b981; }
.text-red { color: #ef4444; }
.text-blue { color: #3b82f6; }
.text-orange { color: #f59e0b; }

/* ---------- Panels ---------- */
.panel { border-radius: var(--radius-lg); padding: 24px; margin-bottom: 24px; }
.panel.no-pad { padding: 0; overflow: hidden; }
.panel-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.panel-head h2 { font-family: var(--font-heading); font-size: 16px; font-weight: 700; }
.panel-note { font-size: 12px; color: var(--text-muted); }
.panel-note code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; background: var(--glass-bg-inset);
  padding: 1px 5px; border-radius: 4px;
}
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: start; }

/* ---------- Monthly chart (hand-rolled bars, no library) ---------- */
.monthly-chart { display: flex; gap: 18px; align-items: flex-end; min-height: 190px; padding-top: 10px; }
.mc-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.mc-bar-wrap {
  width: 100%; height: 140px;
  display: flex; align-items: flex-end; justify-content: center;
  background: var(--glass-bg-inset);
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  position: relative; overflow: hidden;
}
.mc-bar {
  width: 100%;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: linear-gradient(180deg, hsla(var(--color-green), 0.85), hsla(var(--color-green), 0.35));
  transition: height var(--transition-slow);
  min-height: 2px;
}
.mc-bar.warn { background: linear-gradient(180deg, hsla(var(--color-orange), 0.85), hsla(var(--color-orange), 0.35)); }
.mc-bar.bad { background: linear-gradient(180deg, hsla(var(--color-red), 0.85), hsla(var(--color-red), 0.35)); }
.mc-bar.none { background: repeating-linear-gradient(45deg, var(--glass-border), var(--glass-border) 4px, transparent 4px, transparent 8px); }
.mc-value { font-family: var(--font-heading); font-size: 14px; font-weight: 700; }
.mc-value.muted { color: var(--text-muted); font-weight: 500; }
.mc-label { font-size: 11px; color: var(--text-muted); font-weight: 600; }

/* ---------- Tables ---------- */
.table-scroll {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
}
.breakdown-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.breakdown-table th {
  background: var(--glass-bg-inset);
  padding: 12px 16px; font-weight: 600; color: var(--text-muted);
  border-bottom: 1px solid var(--glass-border);
  position: sticky; top: 0; z-index: 1;
  font-family: var(--font-heading);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px;
  white-space: nowrap;
}
.breakdown-table td { padding: 10px 16px; border-bottom: 1px solid var(--glass-border); color: var(--text-main); }
.breakdown-table tbody tr:last-child td { border-bottom: none; }
.breakdown-table tbody tr.subtotal-row td {
  background: var(--glass-bg-inset);
  font-family: var(--font-heading); font-weight: 700;
}
.num { font-variant-numeric: tabular-nums; }
.good { color: #10b981; font-weight: 600; }
.warn { color: #f59e0b; font-weight: 600; }
.bad { color: #ef4444; font-weight: 600; }
.muted { color: var(--text-muted); }

/* Something the data doesn't have, said out loud rather than left blank. */
.cell-empty { color: var(--text-muted); font-style: italic; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 3px 8px; border-radius: var(--radius-sm);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.3px; text-transform: uppercase;
  white-space: nowrap;
}
.badge.blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.badge.green { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.badge.purple { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.badge.orange { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge.red { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.badge.neutral { background: rgba(156, 163, 175, 0.15); color: #9ca3af; }

/* ---------- Environments list ---------- */
.env-list { display: flex; flex-direction: column; gap: 12px; }
.env-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--glass-bg-inset);
  border: 1px solid var(--glass-border);
}
.env-name { font-family: var(--font-heading); font-weight: 600; font-size: 13px; flex: 1; }
.env-sub { font-size: 11px; color: var(--text-muted); font-weight: 400; display: block; margin-top: 2px; }
.env-uptime { font-family: var(--font-heading); font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Inline checkbox + label (the "show deploy outages" toggle). */
.check-inline {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-muted); cursor: pointer;
  user-select: none;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 10px 16px; border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.check-inline:hover { border-color: var(--glass-border-focus); color: var(--text-main); }
.check-inline input { accent-color: hsl(var(--color-orange)); cursor: pointer; }
/* The Overview copy of the toggle sits on its own line above the metrics. */
.deploy-toggle-bar { margin-bottom: 20px; align-self: flex-start; width: fit-content; }

/* ---------- Ticket lists ---------- */
.ticket-group + .ticket-group { margin-top: 22px; }
.ticket-group-head {
  font-family: var(--font-heading);
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-muted); margin-bottom: 10px;
  display: flex; align-items: baseline; gap: 8px;
}
.ticket-group-head span {
  font-family: var(--font-body); font-size: 11px;
  font-weight: 400; text-transform: none; letter-spacing: 0;
}

.ticket-list { display: flex; flex-direction: column; gap: 8px; }
.ticket-row {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  background: var(--glass-bg-inset);
  border: 1px solid var(--glass-border);
  text-decoration: none; color: var(--text-main);
  transition: all var(--transition-fast);
}
.ticket-row:hover { border-color: hsla(var(--color-red), 0.5); transform: translateX(2px); }
/* Resolved urgent tickets still count for the period, but shouldn't shout. */
.ticket-row.resolved { opacity: 0.62; }
.ticket-row.resolved:hover { opacity: 1; border-color: hsla(var(--color-green), 0.5); }
.ticket-key {
  font-family: var(--font-heading); font-weight: 700; font-size: 12px;
  color: hsl(var(--color-blue)); flex-shrink: 0;
}
.ticket-summary {
  flex: 1; font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ticket-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ticket-age { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
@media (max-width: 650px) {
  .ticket-row { flex-wrap: wrap; gap: 8px; }
  .ticket-summary { white-space: normal; flex-basis: 100%; }
}

/* ---------- Client Time (retainer) cards ---------- */
.clienttime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 24px;
}
.client-card {
  --accent: var(--color-blue);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex; flex-direction: column; gap: 20px;
  border: 1px solid hsla(var(--accent), 0.3);
  position: relative; overflow: hidden;
}
.client-card.ct-under { --accent: var(--color-green); }
.client-card.ct-over { --accent: var(--color-red); }
.client-card.ct-warning { --accent: var(--color-orange); }
.client-card.ct-adhoc { --accent: var(--color-blue); }
.client-card::before {
  content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 2px;
  border-radius: 2px; background: hsl(var(--accent));
  box-shadow: 0 0 16px 2px hsla(var(--accent), 0.7);
}
.client-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.client-card-header h2 { font-family: var(--font-heading); font-size: 17px; font-weight: 700; }
.client-maconomy { font-size: 12px; color: var(--text-muted); display: block; margin-top: 3px; }

.card-content-row { display: flex; align-items: center; gap: 24px; }
.card-dial-wrapper { position: relative; width: 90px; height: 90px; flex-shrink: 0; }
.dial-svg { width: 90px; height: 90px; transform: rotate(-90deg); }
.dial-bg-ring { fill: none; stroke: var(--glass-border); }
.dial-fill-ring { fill: none; stroke-linecap: round; transition: stroke-dashoffset var(--transition-slow); }
.dial-fill-ring.under { stroke: #10b981; }
.dial-fill-ring.warning { stroke: #f59e0b; }
.dial-fill-ring.over { stroke: #ef4444; }
.dial-fill-ring.adhoc { stroke: #3b82f6; }
.dial-text {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.dial-num { font-family: var(--font-heading); font-size: 15px; font-weight: 700; line-height: 1.1; }
.dial-subtext { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }

.card-stats-column { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.stat-row-item {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--glass-border);
}
.stat-row-item:last-child { border-bottom: none; padding-bottom: 0; }
.stat-row-item .label { font-size: 12px; color: var(--text-muted); }
.stat-row-item .val { font-family: var(--font-heading); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }

.card-sparkline-wrapper { display: flex; flex-direction: column; gap: 6px; }
.sparkline-header { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); }
.sparkline-svg { width: 100%; height: 34px; }
.sparkline-path { fill: none; stroke: var(--spk); stroke-width: 2; vector-effect: non-scaling-stroke; }
.sparkline-area { fill: var(--spk); opacity: 0.08; stroke: none; }
.sparkline-marker { fill: var(--spk); stroke: var(--bg-app); stroke-width: 1.5; }

.client-card[role="button"] { cursor: pointer; transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal); }
.client-card[role="button"]:hover { transform: translateY(-4px); border-color: hsla(var(--accent), 0.6); box-shadow: 0 18px 40px -12px hsla(var(--accent), 0.28); }
.client-card[role="button"]:focus-visible { outline: 2px solid hsl(var(--color-blue)); outline-offset: 2px; }
.ct-open-hint { color: hsl(var(--color-blue)); font-weight: 600; }

/* Client Time modal */
.card-dial-wrapper.ct-modal-dial { width: 120px; height: 120px; }
.ct-modal-dial .dial-svg { width: 120px; height: 120px; }
.ct-modal-dial .dial-num { font-size: 19px; }
.ct-bar-chart { width: 100%; height: auto; }
.ct-bar-label { fill: var(--text-muted); font-size: 9px; font-family: var(--font-body); }
.ct-axis { fill: var(--text-muted); font-size: 9px; font-family: var(--font-body); }
.ct-grid { stroke: var(--glass-border); stroke-width: 1; }
.ct-contract-line { stroke: hsl(var(--color-orange)); stroke-width: 1.5; stroke-dasharray: 4 3; }
.breakdown-table tr.ct-active-row td { background: hsla(var(--color-blue), 0.08); }

@media (max-width: 550px) {
  .clienttime-grid { grid-template-columns: 1fr; }
  .card-content-row { flex-direction: column; align-items: stretch; }
}

/* ---------- Incident cards ---------- */
.incident-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.incident-card {
  --accent: var(--color-red);
  border-radius: var(--radius-lg);
  padding: 20px; cursor: pointer;
  display: flex; flex-direction: column; gap: 14px;
  position: relative; overflow: hidden;
  border: 1px solid hsla(var(--accent), 0.3);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  transition: transform var(--transition-normal), border var(--transition-normal), box-shadow var(--transition-normal);
}
.incident-card.accent-red { --accent: var(--color-red); }
.incident-card.accent-orange { --accent: var(--color-orange); }
.incident-card.accent-blue { --accent: var(--color-blue); }
.incident-card.accent-neutral { --accent: var(--color-neutral); }
.incident-card::before {
  content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 2px;
  border-radius: 2px; background: hsl(var(--accent));
  box-shadow: 0 0 16px 2px hsla(var(--accent), 0.75);
}
.incident-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: hsla(var(--accent), 0.6);
  box-shadow: 0 18px 40px -12px hsla(var(--accent), 0.28);
}
.ic-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ic-date { font-family: var(--font-heading); font-size: 15px; font-weight: 700; }
.ic-env { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.ic-duration {
  font-family: var(--font-heading);
  font-size: 22px; font-weight: 800;
  color: hsl(var(--accent));
  font-variant-numeric: tabular-nums; line-height: 1;
}
.ic-duration span { font-size: 11px; font-weight: 600; color: var(--text-muted); display: block; margin-top: 3px; }
.ic-reason { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.ic-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.ic-foot {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; padding-top: 12px;
  border-top: 1px solid var(--glass-border);
  font-size: 11px; color: var(--text-muted);
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 24px;
}
.modal-content {
  max-width: 820px; width: 100%;
  max-height: 88vh; overflow-y: auto;
  border-radius: var(--radius-lg);
  padding: 32px; position: relative;
}
.modal-close {
  position: absolute; top: 20px; right: 20px;
  background: var(--glass-bg-inset);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-main);
}
.modal-close svg { width: 15px; height: 15px; }
.modal-head { margin-bottom: 22px; padding-right: 44px; }
.modal-head h2 { font-family: var(--font-heading); font-size: 20px; font-weight: 700; }
.modal-head p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.modal-section { margin-bottom: 24px; }
.modal-section h3 {
  font-family: var(--font-heading);
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-muted); margin-bottom: 12px;
}
.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.fact {
  background: var(--glass-bg-inset);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.fact-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); font-weight: 600; }
.fact-value { font-family: var(--font-heading); font-size: 15px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }

.evidence {
  background: hsla(var(--color-blue), 0.06);
  border: 1px solid hsla(var(--color-blue), 0.25);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.evidence h4 { font-family: var(--font-heading); font-size: 12px; font-weight: 700; margin-bottom: 8px; }
/* A deploy outage is our doing, not a platform fault — amber, not blue. */
.evidence.deploy { background: hsla(var(--color-orange), 0.07); border-color: hsla(var(--color-orange), 0.3); }
.evidence p { font-size: 12px; color: var(--text-muted); line-height: 1.55; }
.evidence a { color: hsl(var(--color-blue)); text-decoration: none; font-weight: 600; }
.evidence a:hover { text-decoration: underline; }
.evidence ul { list-style: none; margin-top: 6px; display: flex; flex-direction: column; gap: 5px; }
.evidence li { font-size: 12px; }

/* ---------- Filters / search ---------- */
.filter-controls {
  display: flex; justify-content: space-between; align-items: center;
  gap: 20px; margin-bottom: 24px; flex-wrap: wrap;
}
.search-box { position: relative; flex: 1; min-width: 280px; }
.search-box input {
  width: 100%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 12px 16px 12px 46px;
  border-radius: var(--radius-md);
  font-family: var(--font-body); font-size: 14px; outline: none;
  transition: all var(--transition-normal);
}
.search-box input:focus {
  border-color: var(--glass-border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background: var(--glass-bg-inset);
}
.search-icon {
  position: absolute; left: 16px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--text-muted); pointer-events: none;
}

/* ---------- States ---------- */
.loading-state, .empty-state {
  grid-column: 1 / -1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 80px 20px; text-align: center;
}
.spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--glass-border);
  border-top-color: hsl(var(--color-blue));
  border-radius: var(--radius-full);
  animation: spin 1s infinite linear;
  margin-bottom: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state h3 { font-family: var(--font-heading); font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); max-width: 420px; font-size: 14px; line-height: 1.6; }

.error-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; z-index: 1100;
  background: var(--bg-app);
  background-image: var(--bg-gradient);
}
.error-card {
  border-radius: var(--radius-lg);
  padding: 40px; max-width: 460px; text-align: center;
}
.error-icon { color: hsl(var(--color-red)); margin-bottom: 16px; }
.error-icon svg { width: 42px; height: 42px; }
.error-card h3 { font-family: var(--font-heading); font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.error-card p { color: var(--text-muted); font-size: 14px; line-height: 1.6; }

/* ---------- Login ---------- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.login-wrap { width: 100%; max-width: 400px; position: relative; z-index: 1; }
.login-card {
  border-radius: var(--radius-lg);
  padding: 40px 34px;
  display: flex; flex-direction: column; gap: 6px;
}
.login-logo {
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, hsl(var(--color-blue)), hsl(var(--color-purple)));
  display: flex; align-items: center; justify-content: center;
  color: #fff; margin-bottom: 18px;
}
.login-logo svg { width: 27px; height: 27px; }
.login-card h1 { font-family: var(--font-heading); font-size: 25px; font-weight: 800; line-height: 1.15; }
.login-card h1 span {
  background: linear-gradient(135deg, hsl(var(--color-blue)), hsl(var(--color-purple)));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.login-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 22px; }
.login-card label {
  font-size: 12px; font-weight: 600;
  color: var(--text-muted); margin-top: 12px; margin-bottom: 6px;
}
.login-card input {
  background: var(--glass-bg-inset);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 14px; outline: none;
  transition: all var(--transition-fast);
}
.login-card input:focus {
  border-color: var(--glass-border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.login-card button {
  margin-top: 24px;
  background: linear-gradient(135deg, hsl(var(--color-blue)), hsl(var(--color-purple)));
  border: none; color: #fff;
  padding: 12px; border-radius: var(--radius-md);
  font-family: var(--font-heading); font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all var(--transition-fast);
}
.login-card button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 20px -6px hsla(var(--color-blue), 0.5); }
.login-card button:disabled { opacity: 0.6; cursor: not-allowed; }
.login-error {
  margin-top: 14px; font-size: 12.5px;
  color: #ef4444; text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .header-right { width: 100%; justify-content: space-between; }
  .view-tabs { width: 100%; }
}
@media (max-width: 550px) {
  .app-container { padding: 24px 16px; }
  .metric-card { padding: 16px; }
  .metric-value { font-size: 22px; }
  .field-grid { grid-template-columns: 1fr; }
  .report-toolbar { flex-direction: column; align-items: stretch; }
  .modal-content { padding: 24px 18px; }
}

/* ---------- Print ----------
   This report gets printed to PDF and sent to the client, so the glass /
   dark-mode treatment has to get out of the way entirely: force light ink on
   white, drop the chrome, and let the report table run to full length instead
   of scrolling inside a fixed-height box. */
@media print {
  .glow-accent, .app-header, .report-toolbar, .filter-controls,
  .modal-overlay, .error-screen, .nav-arrow-btn, .theme-toggle-btn { display: none !important; }

  body {
    background: #fff !important;
    background-image: none !important;
    color: #111 !important;
  }
  .app-container { max-width: none; padding: 0; }
  .bg-glass, .panel, .metric-card {
    background: #fff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid #ddd !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
  .coverage-banner { border: 1px solid #999 !important; background: #fafafa !important; break-inside: avoid; }
  .coverage-body li, .panel-note, .metric-trend { color: #444 !important; }
  .hidden { display: none !important; }
  main.hidden { display: none !important; }
  @page { size: A3 landscape; margin: 12mm; }
}
