/* ============================================================
   Newton Status Page
   Pinnacle Technologies © 2026
   Theme matched to the Newton app:
     • Font   — Poppins (Newton loads Poppins 300–700 via WebFont)
     • Dark   — Newton's dark-mode.less (VS Code Dark+ palette)
     • Light  — Pinnacle Neutral colors (_vantage-colors.less)
     • Accent — Pinnacle Growth teal (#70c8b6 / #41a994)
   ============================================================ */

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

/* ── Theme variables ─────────────────────────────────────────
   Surfaces and text follow the Pinnacle Platform palettes
   (pinnacle-platform-new LandingPage.css): light by default on :root, and
   three dark themes selected by html.dark-mode + data-dark-theme, which
   theme.js sets. Accent and status colours stay Pinnacle Growth teal so a
   green cell means the same thing in every theme. */
:root {
  color-scheme: light;
  --bg:            #F8FAFC;
  --bg-secondary:  #ffffff;
  --bg-secondary-rgb: 255, 255, 255;
  --bg-tertiary:   #F1F5F9;
  --bg-elevated:   #E2E8F0;
  --card:          #ffffff;
  --card-hover:    #ffffff;
  --border:        #E2E8F0;
  --border-accent: rgba(65, 169, 148, 0.25);
  --text:          #475467;
  --text-light:    #94A3B8;
  --text-bright:   #0F172A;
  --accent:        #41a994;  /* pinnacleGrowthAltDColor */
  --accent-glow:   rgba(65, 169, 148, 0.15);
  --accent-dim:    rgba(65, 169, 148, 0.08);
  --green:         #41a994;
  --yellow:        #feda7b;  /* pinnacleIlluminationColor */
  --red:           #ed1e35;  /* pinnacleInnovationColor   */
  --font:          'Poppins', sans-serif;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --transition:    0.2s ease;
}

/* Shared by every dark theme. color-scheme makes native controls (scrollbars,
   date pickers, form fields) render dark too. */
html.dark-mode {
  color-scheme: dark;
  --border-accent: rgba(112, 200, 182, 0.35);
  --accent:        #70c8b6;  /* pinnacleGrowthColor */
  --accent-glow:   rgba(112, 200, 182, 0.3);
  --accent-dim:    rgba(112, 200, 182, 0.15);
  --green:         #70c8b6;
  --shadow:        0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ── VS Code (also the fallback dark theme) ── */
html.dark-mode,
html.dark-mode[data-dark-theme="vscode"] {
  --bg:            #1e1e1e;
  --bg-secondary:  #252525;
  --bg-secondary-rgb: 37, 37, 37;
  --bg-tertiary:   #2d2d2d;
  --bg-elevated:   #3d3d3d;
  --card:          #252525;
  --card-hover:    #2d2d2d;
  --border:        #3d3d3d;
  --text:          #b0b0b0;
  --text-light:    #6e6e6e;
  --text-bright:   #cccccc;
}

/* ── Dracula ── */
html.dark-mode[data-dark-theme="dracula"] {
  --bg:            #282a36;
  --bg-secondary:  #21222c;
  --bg-secondary-rgb: 33, 34, 44;
  --bg-tertiary:   #2d2f3f;
  --bg-elevated:   #44475a;
  --card:          #21222c;
  --card-hover:    #2d2f3f;
  --border:        #44475a;
  --text:          #a9b0c4;
  --text-light:    #6272a4;
  --text-bright:   #f8f8f2;
}

/* ── Carbon (IBM), the default dark theme ── */
html.dark-mode[data-dark-theme="carbon"] {
  --bg:            #161616;
  --bg-secondary:  #262626;
  --bg-secondary-rgb: 38, 38, 38;
  --bg-tertiary:   #393939;
  --bg-elevated:   #525252;
  --card:          #262626;
  --card-hover:    #393939;
  --border:        #525252;
  --text:          #c6c6c6;
  --text-light:    #6f6f6f;
  --text-bright:   #f4f4f4;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--text-bright); }

.main-content { flex: 1; padding-bottom: 60px; }

/* ── Container ──────────────────────────────────────────────── */
.container { max-width: 960px; margin: 0 auto; padding: 0 32px; }

/* ── Navbar ──────────────────────────────────────────────────
   Ported from the Pinnacle Platform navbar
   (pinnacle-platform-new/src/components/Navbar.css): black in light mode,
   the theme's secondary surface in dark mode. Only the parts this page uses
   are kept: logo, appearance menu and theme picker.
   One deliberate difference: the platform uses rgba(0,0,0,0.5), which reads
   as black there only because it sits over a dark hero image. Over this
   page's light background it renders mid-grey, so light mode uses 0.88. */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: 72px;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.dark-mode .navbar {
  background: rgba(var(--bg-secondary-rgb), 0.1);
}

.navbar-container {
  width: 100%;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-logo { display: flex; align-items: center; text-decoration: none; }
.logo-image  { height: 44px; width: auto; }

.navbar-actions { display: flex; align-items: center; gap: 8px; }

/* Dark mode toggle */
.dark-mode-toggle-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s ease;
}
.dark-mode-toggle-nav:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
  color: white;
  transform: scale(1.05);
}
.dark-mode .dark-mode-toggle-nav {
  background: rgba(255, 255, 255, 0.08);
  color: #e8c07d;
}
.dark-mode-toggle-nav.active {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
}
.dark-mode .dark-mode-toggle-nav.active {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.35);
}

/* Appearance dropdown */
.appearance-dropdown { position: relative; width: 40px; height: 40px; }
.appearance-overlay  { position: fixed; inset: 0; z-index: 999; }
.appearance-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 230px;
  background: white;
  border-radius: 12px;
  border: 1px solid #EAECF0;
  box-shadow: 0 16px 36px rgba(16, 24, 40, 0.14);
  overflow: hidden;
  z-index: 1000;
  animation: slideDown 0.15s ease;
  padding-bottom: 8px;
}
.dark-mode .appearance-menu {
  background: var(--bg-secondary);
  border-color: var(--border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}
.appearance-header {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94A3B8;
  padding: 12px 16px 8px;
}
.dark-mode .appearance-header { color: var(--text-light); }

.appearance-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px 10px;
}
.appearance-mode-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #344054;
}
.dark-mode .appearance-mode-label { color: var(--text); }
.appearance-mode-label svg { color: #6B7280; flex-shrink: 0; }
.dark-mode .appearance-mode-label svg { color: var(--text-light); }

/* Pill toggle switch */
.mode-toggle-pill {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
}
.mode-toggle-pill.off { background: #D1D5DB; }
.mode-toggle-pill.on  { background: var(--accent); }
.mode-toggle-thumb {
  position: absolute;
  top: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: left 0.2s ease;
}
.mode-toggle-pill.off .mode-toggle-thumb { left: 3px; }
.mode-toggle-pill.on  .mode-toggle-thumb { left: 19px; }

.appearance-divider { height: 1px; background: #EAECF0; margin: 2px 0 0; }
.dark-mode .appearance-divider { background: var(--border); }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Theme picker */
.theme-picker { padding: 12px 16px 8px; }
.theme-picker-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  color: #94A3B8;
}
.dark-mode .theme-picker-header { color: var(--text-light); }
.theme-picker-header svg { flex-shrink: 0; }
.theme-picker-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.theme-swatches { display: flex; gap: 8px; }
.theme-swatch {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 6px 4px 7px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  font-family: inherit;
}
.theme-swatch:hover { background: #F1F5F9; border-color: #CBD5E1; }
.dark-mode .theme-swatch:hover { background: var(--bg-tertiary); border-color: var(--border); }
.theme-swatch.active { border-color: var(--swatch-accent); background: rgba(0, 0, 0, 0.03); }
.dark-mode .theme-swatch.active { background: rgba(255, 255, 255, 0.04); }
.swatch-preview {
  display: block;
  width: 100%;
  height: 30px;
  border-radius: 6px;
  background: var(--swatch-bg);
  border: 1.5px solid var(--swatch-border);
  position: relative;
  overflow: hidden;
}
.swatch-preview::before {
  content: '';
  position: absolute;
  top: 6px; left: 6px; right: 6px;
  height: 3px;
  border-radius: 2px;
  background: var(--swatch-accent);
  opacity: 0.7;
}
.swatch-preview::after {
  content: '';
  position: absolute;
  top: 14px; left: 6px; right: 12px;
  height: 2px;
  border-radius: 2px;
  background: var(--swatch-border);
  opacity: 0.8;
}
.swatch-name { font-size: 0.6875rem; font-weight: 500; color: #64748B; white-space: nowrap; }
.dark-mode .swatch-name { color: var(--text-light); }
.theme-swatch.active .swatch-name { color: #0F172A; font-weight: 600; }
.dark-mode .theme-swatch.active .swatch-name { color: var(--text-bright); }
.swatch-active-dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--swatch-accent);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.8);
}
.dark-mode .swatch-active-dot { box-shadow: 0 0 0 2px var(--bg-secondary); }

/* Profile dropdown (admin page only), from the platform navbar */
.profile-dropdown { position: relative; }
.profile-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}
.profile-trigger:hover { background: rgba(255, 255, 255, 0.1); }
.profile-name { font-size: 0.875rem; font-weight: 400; color: rgba(255, 255, 255, 0.9); }
.chevron { opacity: 0.7; transition: transform 0.2s ease; }
.chevron.rotated { transform: rotate(180deg); }
.profile-overlay { position: fixed; inset: 0; z-index: 999; }
.profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: white;
  border-radius: 12px;
  border: 1px solid #EAECF0;
  box-shadow: 0 20px 40px rgba(16, 24, 40, 0.15);
  overflow: hidden;
  z-index: 1000;
  animation: slideDown 0.2s ease;
}
.profile-header { display: flex; align-items: center; gap: 12px; padding: 16px; }
.profile-menu-avatar-placeholder {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #F2F4F7;
  display: flex; align-items: center; justify-content: center;
  color: #667085;
  flex-shrink: 0;
}
.profile-info { display: flex; flex-direction: column; min-width: 0; }
.profile-menu-name {
  font-size: 0.875rem; font-weight: 600; color: #101828;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.profile-menu-email {
  font-size: 0.8125rem; color: #667085;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.profile-divider { height: 1px; background: #EAECF0; }
.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #344054;
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}
.profile-menu-item:hover { background: #F9FAFB; }
.profile-menu-item.logout { color: #D92D20; }
.profile-menu-item.logout:hover { background: #FEF3F2; color: #D92D20; }

.dark-mode .profile-menu {
  background: var(--bg-secondary);
  border-color: var(--border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}
.dark-mode .profile-menu-name  { color: var(--text-bright); }
.dark-mode .profile-menu-email { color: var(--text-light); }
.dark-mode .profile-divider    { background: var(--border); }
.dark-mode .profile-menu-item  { color: var(--text); }
.dark-mode .profile-menu-item:hover { background: var(--bg-tertiary); color: var(--text-bright); }
.dark-mode .profile-menu-item.logout { color: #f87171; }
.dark-mode .profile-menu-item.logout:hover { background: rgba(248, 113, 113, 0.1); color: #f87171; }
.dark-mode .profile-menu-avatar-placeholder { background: var(--bg-elevated); color: var(--text-light); }

@media (max-width: 768px) {
  .navbar { height: 64px; }
  .navbar-container { padding: 0 16px; }
  .profile-name { display: none; }
}

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 112px 0 48px;
  text-align: center;
}

.hero-status-row {
  display: flex; align-items: center; gap: 24px;
  max-width: 560px; margin: 0 auto; text-align: left;
}

/* ── Status Ring ─────────────────────────────────────────────── */
.status-ring {
  position: relative; width: 64px; height: 64px; flex-shrink: 0;
}

.status-ring-circle {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--accent-dim); border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 2;
  transition: background var(--transition), border-color var(--transition);
}
.status-ring-circle svg { width: 26px; height: 26px; color: var(--accent); transition: color var(--transition); }

.status-ring-pulse {
  position: absolute; inset: -8px; border-radius: 50%;
  border: 2px solid var(--accent); opacity: 0;
  animation: ringPulse 3s ease-out infinite;
}
.status-ring-pulse:nth-child(2) { animation-delay: 1s; }

@keyframes ringPulse {
  0%   { transform: scale(1);    opacity: 0.6; }
  100% { transform: scale(1.55); opacity: 0; }
}

.status-ring-circle.degraded { background: rgba(240,180,41,0.12); border-color: var(--yellow); }
.status-ring-circle.degraded svg { color: var(--yellow); }
.status-ring-pulse.degraded  { border-color: var(--yellow); }
.status-ring-circle.down { background: rgba(224,82,82,0.12); border-color: var(--red); }
.status-ring-circle.down svg { color: var(--red); }
.status-ring-pulse.down  { border-color: var(--red); animation: none; opacity: 0.4; }

/* ── Hero Text Block ─────────────────────────────────────────── */
.hero-text-block { min-width: 0; }

.hero-text-block h1 {
  font-size: clamp(18px, 3vw, 22px); font-weight: 700;
  color: var(--text-bright); margin: 0 0 4px; line-height: 1.25;
}
.hero-subtitle    { font-size: 13px; color: var(--text); margin: 0 0 4px; }
.hero-last-checked { font-size: 11px; color: var(--text-light); margin: 0; }

/* ── Card ───────────────────────────────────────────────────── */
.glass-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: background var(--transition), border-color var(--transition);
}

/* ── Section Layout ──────────────────────────────────────────── */
.section { position: relative; margin-bottom: 28px; }

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--text-light);
}

/* ── Availability Card ──────────────────────────────────────── */
.avail-card { padding: 28px 32px 24px; }

.avail-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
}

.avail-avg-value {
  font-size: 48px; font-weight: 700;
  color: var(--accent); line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}
.avail-avg-value.good  { color: var(--green); }
.avail-avg-value.warn  { color: var(--yellow); }
.avail-avg-value.bad   { color: var(--red); }
.avail-avg-value.empty { color: var(--text-light); }

.avail-avg-label {
  font-size: 12px; color: var(--text-light);
  margin-top: 6px;
}

/* ── Availability Strip ─────────────────────────────────────── */
.avail-strip {
  display: flex;
  gap: 2px;
}
.avail-cell  {
  flex: 1;
  min-width: 0;
  height: 40px;
  border-radius: 3px;
  background: var(--bg-tertiary);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}
.avail-cell:hover { opacity: 0.75; transform: scaleY(1.15); }
.avail-cell.good  { background: var(--green); opacity: 0.75; }
.avail-cell.warn  { background: var(--yellow); opacity: 0.75; }
.avail-cell.bad   { background: var(--red);    opacity: 0.75; }
.avail-cell.empty { background: var(--bg-tertiary); opacity: 1; }
.avail-cell.week-mark { margin-left: 4px; box-shadow: -3px 0 0 var(--border); }

html:not(.dark-mode) .avail-cell.empty { background: #D1D3D4; }

.avail-strip-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-light);
}

/* ── Report a problem ──────────────────────────────────────── */
/* Sits in the navbar next to the appearance toggle, so it shares that
   button's height, border and white-on-dark treatment in every theme. */
.report-problem-btn {
  display: inline-flex;
  align-items: center;
  height: 40px;
  font-size: 0.875rem; font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 0 16px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.report-problem-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
  color: white;
}
.dark-mode .report-problem-btn { background: rgba(255, 255, 255, 0.08); }

/* ── Page ──────────────────────────────────────────────────── */
main.page-top { padding-top: 104px; width: 100%; }

/* ── Declared incident banner ──────────────────────────────── */
.incident-banner {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  background: var(--card);
}
.incident-banner.degraded { border-color: rgba(254,218,123,0.45); box-shadow: 0 6px 22px rgba(254,218,123,0.10); }
.incident-banner.down     { border-color: rgba(237,30,53,0.50);   box-shadow: 0 6px 22px rgba(237,30,53,0.14); }

.incident-banner-head { padding: 16px 20px; }
.incident-banner.degraded .incident-banner-head { background: #8a6a15; }
.incident-banner.down     .incident-banner-head { background: #a3162a; }
.incident-banner-head h1 { font-size: 16px; font-weight: 600; color: #fff; margin: 4px 0 0; }
.incident-banner-impact {
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: rgba(255,255,255,0.85);
}

.incident-banner-body { padding: 14px 20px 16px; }
.incident-banner-desc { font-size: 13px; color: var(--text-bright); margin: 0; }
/* Descriptions and updates can run to a few paragraphs: keep their line breaks. */
.incident-banner-desc, .event-update-message, .history-desc, .maintenance-desc { white-space: pre-line; line-height: 1.55; }
.updates-body .event-updates { margin-top: 6px; }
.incident-banner-body .updates-toggle { margin-top: 10px; }

/* ── Event updates (banners, notices, recent activity, admin) ─ */
.event-updates { list-style: none; margin: 10px 0 0; padding: 0; border-top: 1px solid var(--border); }
.event-updates li {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.event-updates li:last-child { border-bottom: none; padding-bottom: 0; }
.event-update-time    { font-size: 11px; color: var(--text-light); font-variant-numeric: tabular-nums; }
.event-update-message { font-size: 13px; color: var(--text-bright); }

/* ── Admin event cards ─────────────────────────────────────── */
.event-card { margin-bottom: 16px; border-left: 3px solid #009aff; }
.event-card.degraded { border-left-color: var(--yellow); }
.event-card.down     { border-left-color: var(--red); }
.event-card.ended    { opacity: 0.8; }
.event-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
/* The title and dates open and close the card. */
.event-card-toggle {
  flex: 1; min-width: 0; text-align: left;
  background: none; border: none; padding: 0 0 0 18px; margin: 0;
  font: inherit; color: inherit; cursor: pointer; position: relative;
}
.event-card-toggle::before {
  content: ''; position: absolute; left: 2px; top: 6px;
  width: 6px; height: 6px;
  border-right: 2px solid var(--text-light); border-bottom: 2px solid var(--text-light);
  transform: rotate(-45deg); transition: transform var(--transition);
}
.event-card-toggle[aria-expanded="true"]::before { transform: rotate(45deg); top: 4px; }
.event-card-title { display: block; font-size: 14px; font-weight: 600; color: var(--text-bright); }
.event-card-meta  { display: block; font-size: 11px; color: var(--text-light); margin-top: 2px; }
.event-card-desc  { font-size: 13px; color: var(--text); margin: 10px 0 0; white-space: pre-wrap; }
.event-card-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.event-update-actions { display: flex; gap: 10px; margin-top: 2px; }
.event-update-form { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.admin-field select {
  font-family: var(--font); font-size: 13px;
  color: var(--text-bright); background: var(--bg-tertiary);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 12px;
}

/* ── Panels ────────────────────────────────────────────────── */
.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.panel-title { font-size: 14px; font-weight: 600; color: var(--text-bright); }
.panel-meta  { font-size: 11px; color: var(--text-light); text-transform: uppercase; letter-spacing: 1px; }
.panel-body  { padding: 18px 20px 16px; }
.panel-actions { display: flex; justify-content: flex-end; margin-top: 18px; }

/* ── System panel ─────────────────────────────────────────────
   One per system: name and live dot, uptime over the window, the strip,
   then its recent activity as a collapsible section at the bottom. */
.system-panel .panel-head { gap: 12px; flex-wrap: wrap; }
.system-panel h1.panel-title { margin: 0; font-size: 15px; }
.panel-head-left  { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.panel-head-right { display: flex; align-items: center; gap: 10px; }
.panel-time { font-size: 11px; color: var(--text-light); font-variant-numeric: tabular-nums; }

/* Collapsed by default: the strip above already shows current status, this is
   for whoever wants to dig into what happened before. */
.panel-section { border-top: 1px solid var(--border); }
.panel-head-toggle {
  width: 100%;
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}
.panel-section .panel-head { border-bottom: none; }
.panel-section .panel-head-toggle[aria-expanded="true"] { border-bottom: 1px solid var(--border); }
.panel-subtitle { font-size: 13px; font-weight: 600; color: var(--text-bright); }
.panel-chevron {
  width: 16px; height: 16px; flex: none;
  color: var(--text-light);
  transition: transform var(--transition);
}
.panel-head-toggle[aria-expanded="true"] .panel-chevron { transform: rotate(180deg); }

.component-name { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text-bright); }
.component-dot  { width: 8px; height: 8px; border-radius: 50%; background: var(--text-light); flex: none; }
.component-dot.operational { background: var(--green); }
.component-dot.degraded    { background: var(--yellow); }
.component-dot.down        { background: var(--red); }
.component-uptime {
  font-size: 13px; font-weight: 600; color: var(--text-light);
  font-variant-numeric: tabular-nums;
}

/* ── Admin ─────────────────────────────────────────────────── */
main.admin-main { padding-top: 104px; width: 100%; }

.admin-card { padding: 20px 24px; overflow-x: auto; }
.admin-form { display: flex; flex-direction: column; gap: 14px; }
.admin-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.admin-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-light); }
.admin-field[hidden] { display: none; }
/* A date with hour and minute lists side by side. */
.dt-input { display: flex; gap: 8px; }
.dt-input input[type="date"] { flex: 1; min-width: 0; }
.dt-input select { width: auto; flex: none; }
.admin-field em { font-style: normal; opacity: 0.7; }
.admin-field input, .admin-field textarea {
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-bright);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
}
.admin-field input:focus, .admin-field textarea:focus {
  outline: none; border-color: var(--accent);
}
.admin-actions { display: flex; align-items: center; gap: 14px; }
.admin-btn {
  font-family: var(--font); font-size: 13px; font-weight: 600;
  color: #fff; background: var(--accent);
  border: none; border-radius: var(--radius-sm);
  padding: 9px 20px; cursor: pointer;
  transition: opacity var(--transition);
}
.admin-btn:hover { opacity: 0.88; }
.admin-btn:disabled { background: var(--bg-tertiary); color: var(--text-light); cursor: default; opacity: 1; }
.admin-status { font-size: 12px; color: var(--text-light); }
.admin-note { margin-top: 16px; font-size: 11px; color: var(--text-light); line-height: 1.6; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-light); text-align: left;
  padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.admin-table td {
  padding: 12px 14px; color: var(--text-bright);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-cell-action { text-align: right; }
.admin-empty { text-align: center; color: var(--text-light); padding: 20px 0; }
.admin-muted { color: var(--text-light); }
.admin-counted { color: var(--red); font-weight: 600; }
.admin-link-btn {
  font-family: var(--font); font-size: 12px;
  background: none; border: none; color: var(--red);
  cursor: pointer; padding: 0;
}
.admin-link-btn:hover { text-decoration: underline; }

/* ── History list ──────────────────────────────────────────── */
.history-list { list-style: none; margin: 0; padding: 0; }
.history-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.history-item:first-child { padding-top: 0; }
.history-item:last-child  { border-bottom: none; padding-bottom: 0; }
.history-dot {
  flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%;
  background: var(--red);
}
.history-item.maintenance .history-dot { background: #009aff; }
.history-item.ongoing .history-dot     { box-shadow: 0 0 0 3px rgba(237,30,53,0.20); }
.history-body  { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.history-title { font-size: 13px; color: var(--text-bright); }
.history-desc  { font-size: 12px; color: var(--text-light); }
.history-meta  { font-size: 11px; color: var(--text-light); font-variant-numeric: tabular-nums; }
.history-tag {
  flex: none; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-light);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 3px 9px;
}
.history-item.maintenance .history-tag { color: #009aff; border-color: rgba(0,154,255,0.35); }
/* Degraded: Pinnacle yellow, with darker text where yellow would not read on white. */
.history-item.degraded .history-dot { background: var(--yellow); }
.history-item.degraded.ongoing .history-dot { box-shadow: 0 0 0 3px rgba(254,218,123,0.35); }
.history-item.degraded .history-tag { color: #8a6a15; border-color: rgba(254,218,123,0.7); }
.dark-mode .history-item.degraded .history-tag { color: var(--yellow); }
.history-empty { color: var(--text-light); font-size: 13px; text-align: center; padding: 14px 0; }

/* ── Grouped history entries (several same-day occurrences) ───── */
.history-count {
  font-size: 11px; font-weight: 600; color: var(--text-light);
}
.history-expand {
  align-self: flex-start;
  font-family: var(--font); font-size: 11px; font-weight: 600;
  color: var(--accent); background: none; border: none;
  cursor: pointer; padding: 2px 0 0; margin: 0;
}
.history-expand:hover { color: var(--text-bright); }
.history-occurrences {
  list-style: none; margin: 2px 0 0; padding: 0 0 0 2px;
  border-left: 2px solid var(--border);
}
.history-occurrences li {
  font-size: 11px; color: var(--text-light);
  font-variant-numeric: tabular-nums;
  padding: 3px 0 3px 10px;
}

/* ── Admin tabs ────────────────────────────────────────────── */
.admin-tabs {
  display: flex; gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.admin-tab {
  font-family: var(--font); font-size: 13px; font-weight: 600;
  color: var(--text-light); background: none; border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 16px; margin-bottom: -1px; cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}
.admin-tab:hover  { color: var(--text-bright); }
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Admin report ──────────────────────────────────────────── */
.report-controls { grid-template-columns: 1fr 1fr auto; align-items: end; }
.report-buttons { display: flex; gap: 10px; }
.admin-btn-secondary {
  background: transparent; color: var(--accent);
  border: 1px solid var(--border);
  display: inline-flex; align-items: center; text-decoration: none;
}
.admin-btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.report-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.report-preset {
  font-family: var(--font); font-size: 11px;
  color: var(--text-light); background: var(--bg-tertiary);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 12px; cursor: pointer;
}
.report-preset:hover { color: var(--text-bright); border-color: var(--accent); }
.report-summary {
  margin: 12px 0 4px; padding: 16px 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--text-light);
}
.report-stats { display: flex; flex-wrap: wrap; gap: 28px; }
.report-sum { margin: 14px 0 0; font-size: 13px; line-height: 1.7; color: var(--text-light); }
.report-sum strong { color: var(--text-bright); font-weight: 600; font-variant-numeric: tabular-nums; }
.report-note { margin: -4px 0 8px; font-size: 12px; color: var(--text-light); }
/* Report tables scroll sideways on a narrow screen rather than overflow. */
.report-scroll { overflow-x: auto; }
.report-table th, .report-table td { padding-left: 10px; padding-right: 10px; }
.report-table td { font-variant-numeric: tabular-nums; }
.report-table td.report-wrap { white-space: normal; min-width: 160px; overflow-wrap: anywhere; }
.report-presets + .report-note { margin-top: 14px; }
.report-table td.report-period { white-space: normal; min-width: 150px; }
.report-stat { display: flex; flex-direction: column; gap: 3px; }
.report-stat strong { font-size: 16px; color: var(--text-bright); font-variant-numeric: tabular-nums; }
.report-heading {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-light); margin: 24px 0 8px;
}

/* ── Planned Maintenance Notices ───────────────────────────── */
.maintenance-notice {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  position: relative;
  overflow: hidden;
}
/* A coloured leading edge and border, so a notice reads as an alert at a
   glance rather than as another neutral card. */
.maintenance-notice::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 4px;
}
.maintenance-notice.active {
  border-color: rgba(254, 218, 123, 0.40);
}
.maintenance-notice.active::before   { background: var(--yellow); }
.maintenance-notice.upcoming {
  border-color: rgba(0, 154, 255, 0.32);
}
.maintenance-notice.upcoming::before { background: #009aff; }

.maintenance-icon {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
}
.maintenance-icon svg { width: 17px; height: 17px; }
.maintenance-notice.active   .maintenance-icon { background: rgba(254,218,123,0.15); color: var(--yellow); }
.maintenance-notice.upcoming .maintenance-icon { background: rgba(0,154,255,0.14);  color: #009aff; }

.maintenance-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.maintenance-tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
}
.maintenance-notice.active   .maintenance-tag { color: var(--yellow); }
.maintenance-notice.upcoming .maintenance-tag { color: #009aff; }

/* Slow pulse marks work that is happening right now, not merely scheduled. */
.maintenance-pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--yellow);
  animation: maintPulse 2s ease-in-out infinite;
}
@keyframes maintPulse {
  0%, 100% { opacity: 1;   box-shadow: 0 0 0 0 rgba(254,218,123,0.55); }
  50%      { opacity: 0.6; box-shadow: 0 0 0 6px rgba(254,218,123,0); }
}

.maintenance-title  { font-size: 14px; font-weight: 600; color: var(--text-bright); }
.maintenance-window { font-size: 12px; color: var(--text); font-variant-numeric: tabular-nums; }
.maintenance-desc   { font-size: 12px; color: var(--text-light); margin-top: 2px; }

/* ── Availability View Toggle ──────────────────────────────── */
.avail-view-toggle {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg-tertiary);
  border-radius: 8px;
}
.avail-view-btn {
  border: none;
  background: transparent;
  color: var(--text-light);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.avail-view-btn:hover { color: var(--text-bright); }
.avail-view-btn.active { background: var(--accent); color: #fff; }

/* ── Tooltip ────────────────────────────────────────────────── */
.analytics-tooltip {
  position: fixed; display: none; z-index: 999;
  background: #252526;
  border: 1px solid #3e3e42;
  border-radius: 8px; padding: 8px 12px;
  font-size: 12px; pointer-events: none;
  max-width: 280px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.tt-date { display: block; color: #6e6e6e; margin-bottom: 2px; }
.tt-val  { display: block; color: #70c8b6; font-weight: 600; }
.tt-inc  { display: block; color: #cccccc; font-size: 11px; margin-top: 4px; padding-left: 8px; border-left: 2px solid var(--yellow); }
.tt-more { display: block; color: #6e6e6e; font-size: 10px; font-style: italic; margin-top: 2px; }
.tt-section-label {
  display: block;
  color: #6e6e6e;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 8px;
}
.tt-none { display: block; color: #6e6e6e; font-size: 11px; margin-top: 2px; }

/* ── Footer (Pinnacle Platform) ──────────────────────────────── */
.footer {
  padding: 24px 0;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}
.footer p {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-light);
  margin: 0;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .hero { padding: 88px 0 32px; }
  .avail-card { padding: 20px 16px 16px; }
  .avail-avg-value { font-size: 36px; }
  .avail-strip { gap: 1px; }
  .avail-cell { height: 28px; }
}
/* Reasons can be long: they wrap and take the spare width, so the other
   columns and the actions stay in view. */
.admin-table td.adj-reason { white-space: normal; width: 100%; min-width: 220px; color: var(--text); }
#adjustmentList td:not(.admin-cell-action) { white-space: normal; }
#adjustmentList td:first-child { min-width: 190px; }
