/* City of Centennial brand theme (Brand Standard.md, 2024 Comms Style Guide v2).
   Console mode = dark "mission control" built from the brand palette: Mountain Blue family backgrounds,
   White / Light Blue / Sunrise text (all approved on Mountain Blue). Darker shades of Mountain Blue only raise contrast.
   Status colors are outside the palette; each is checked >= 4.5:1 on --mon-bg and --mon-panel (noted inline). */
:root {
  --brand-primary: #002E6D;   /* Mountain Blue */
  --brand-link: #0055B8;      /* Medium Blue */
  --brand-secondary: #3D7CC9; /* Sky Blue */
  --brand-tint: #95D4E9;      /* Light Blue */
  --brand-accent: #FFD600;    /* Sunrise */
  --brand-font-sans: "Figtree", Arial, sans-serif;
  --brand-font-serif: "Noto Serif", "Times New Roman", serif;

  /* Console surfaces: Mountain Blue and darker shades of it */
  --mon-bg: #001634;          /* deep Mountain Blue */
  --mon-panel: #00224F;       /* between deep and Mountain Blue */
  --mon-line: #1E4F8F;        /* panel borders (decorative, non-text) */
  --mon-text: #FFFFFF;
  --mon-dim: var(--brand-tint);           /* Light Blue on deep blue: >= 9:1 */
  --st-ok: #5BE08A;           /* green: 10.9:1 on --mon-bg, 9.6:1 on --mon-panel */
  --st-warn: var(--brand-accent);         /* Sunrise: approved on Mountain Blue */
  --st-crit: #FF7A7A;         /* red: 7.0:1 on --mon-bg, 6.2:1 on --mon-panel */
  --st-off: #A9B8CC;          /* grey: 8.9:1 on --mon-bg */

  --bs-body-font-family: var(--brand-font-sans);
  --bs-link-color: var(--brand-link);
  --bs-link-color-rgb: 0, 85, 184;
  --bs-link-hover-color: var(--brand-primary);
  --bs-primary: var(--brand-link);
  --bs-primary-rgb: 0, 85, 184;
}

h1, h2, h3, h4 { color: var(--brand-primary); font-weight: 700; }
.lead, .serif { font-family: var(--brand-font-serif); }

/* Header bar: Mountain Blue + White (approved). Three columns: logo + menu | centered title | account */
.brand-bar { background: var(--brand-primary); border-bottom: 2px solid var(--brand-accent); }
.brand-grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; }
.site-title { color: #FFFFFF; font-weight: 800; font-size: 1.15rem; letter-spacing: .12em; text-transform: uppercase; text-align: center; white-space: nowrap; }
.brand-home { display: block; }
.brand-bar .nav-link { color: #FFFFFF; font-weight: 600; }
.brand-bar .nav-link:hover, .brand-bar .nav-link.active { color: var(--brand-tint); }
.brand-bar .nav-link.active { text-decoration: underline; text-underline-offset: .35em; }
.brand-name { color: #FFFFFF; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; text-decoration: none; display: flex; align-items: center; gap: .75rem; }
.brand-logo { height: 44px; width: auto; display: block; }   /* approved logo file only, never redrawn */
.brand-divider { width: 1px; height: 32px; background: rgba(255,255,255,.45); }
.account-who { color: var(--brand-tint); }
/* Avatar: Microsoft photo or initials, like pmportal */
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid #FFFFFF; }
.avatar-initials { display: inline-flex; align-items: center; justify-content: center;
                   background: var(--brand-tint); color: var(--brand-primary); font-weight: 700; font-size: .85rem; }   /* Mountain Blue on Light Blue: 8.6:1 */
.btn-header { --bs-btn-color: #FFFFFF; --bs-btn-border-color: #FFFFFF; --bs-btn-border-width: 2px;
              --bs-btn-hover-color: var(--brand-primary); --bs-btn-hover-bg: #FFFFFF; --bs-btn-hover-border-color: #FFFFFF;
              --bs-btn-active-color: var(--brand-primary); --bs-btn-active-bg: #FFFFFF; font-weight: 700; }
.btn-primary { --bs-btn-bg: var(--brand-link); --bs-btn-border-color: var(--brand-link);
               --bs-btn-hover-bg: var(--brand-primary); --bs-btn-hover-border-color: var(--brand-primary); }
@media (max-width: 1100px) { .brand-grid { grid-template-columns: 1fr; } .site-title { order: -1; } }

/* Accessibility */
:focus-visible { outline: 3px solid var(--brand-accent); outline-offset: 2px; box-shadow: 0 0 0 5px var(--brand-primary); }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 1000; padding: .5rem 1rem; background: var(--brand-accent); color: #000000; font-weight: 700; }
.skip-link:focus { left: 1rem; top: .5rem; }
.visually-hidden-focusable:not(:focus) { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ================= Console mode (dashboards) ================= */
body.mode-console { background: var(--mon-bg); color: var(--mon-text);
  background-image: radial-gradient(circle at 50% -20%, rgba(61,124,201,.25), transparent 60%),
                    repeating-linear-gradient(0deg, rgba(149,212,233,.04) 0 1px, transparent 1px 32px),
                    repeating-linear-gradient(90deg, rgba(149,212,233,.04) 0 1px, transparent 1px 32px); }
.mode-console h1, .mode-console h2, .mode-console h3 { color: var(--mon-text); }
.mode-console a { color: var(--brand-tint); }
.mode-console a:hover { color: #FFFFFF; }
.mode-console .site-foot { color: var(--mon-dim); border-top: 1px solid var(--mon-line); }
.mode-console .table { --bs-table-bg: transparent; --bs-table-color: var(--mon-text); --bs-table-border-color: var(--mon-line); }
.mode-console .form-control, .mode-console .form-select { background: var(--mon-bg); color: #FFFFFF; border-color: var(--mon-line); }

.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-variant-numeric: tabular-nums; }
.dim { color: var(--mon-dim); }

/* Status strip */
.status-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; padding: .9rem 1.25rem; margin-bottom: 1rem;
  border: 2px solid var(--mon-line); border-radius: .5rem; background: var(--mon-panel); }
.status-strip .big { font-size: clamp(1.4rem, 3vw, 2.4rem); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.status-strip .big-link { color: inherit; text-decoration: none; border-bottom: 2px dashed currentColor; }
.status-strip .big-link:hover { color: #FFFFFF; }
.status-strip span[class^="lvl-"] a { color: inherit; }
.status-strip.ok { border-color: var(--st-ok); box-shadow: 0 0 18px rgba(91,224,138,.25) inset; }
.status-strip.ok .big { color: var(--st-ok); text-shadow: 0 0 12px rgba(91,224,138,.5); }
.status-strip.warn { border-color: var(--st-warn); }
.status-strip.warn .big { color: var(--st-warn); }
.status-strip.crit { border-color: var(--st-crit); animation: crit-pulse 1.2s ease-in-out infinite; }
.status-strip.crit .big { color: var(--st-crit); }
@keyframes crit-pulse { 50% { box-shadow: 0 0 26px rgba(255,122,122,.55); } }
/* Clocks: ZULU / DENVER / LAST SYNC */
.clocks { display: flex; gap: 1.5rem; align-items: flex-end; }
.clk { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; }
.clk-l { font-size: .7rem; font-weight: 700; letter-spacing: .18em; color: var(--brand-accent); }   /* Sunrise on panel blue: approved */
.clk-t { font-size: 1.6rem; font-weight: 700; color: #FFFFFF; }
.clk-s { font-size: 1rem; font-weight: 700; padding-bottom: .2rem; }

/* Panels */
.panel { background: var(--mon-panel); border: 1px solid var(--mon-line); border-radius: .5rem; padding: .85rem 1rem; margin-bottom: 1rem; position: relative; overflow: hidden; }
.panel > h2 { font-size: .85rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-tint); margin: 0 0 .65rem; display: flex; justify-content: space-between; gap: .5rem; }
.panel::before { content: ""; position: absolute; inset: 0 auto auto 0; width: 40px; height: 2px; background: var(--brand-accent); }
.empty { color: var(--mon-dim); font-style: italic; padding: .75rem 0; }

/* Status lights: only red flashes */
.light { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; flex: none; vertical-align: middle; }
.light.ok { background: var(--st-ok); box-shadow: 0 0 8px var(--st-ok); }
.light.warn { background: var(--st-warn); box-shadow: 0 0 8px var(--st-warn); }
.light.crit { background: var(--st-crit); box-shadow: 0 0 10px var(--st-crit); animation: blink 1s steps(2, start) infinite; }
.light.off { background: var(--st-off); }
@keyframes blink { to { visibility: hidden; } }
.lvl-ok { color: var(--st-ok); } .lvl-warn { color: var(--st-warn); } .lvl-crit { color: var(--st-crit); } .lvl-off { color: var(--st-off); }

/* Host tiles */
.host-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.host { border: 1px solid var(--mon-line); border-radius: .5rem; padding: .75rem; background: rgba(0,22,52,.6); }
.host.warn { border-color: var(--st-warn); } .host.crit { border-color: var(--st-crit); }
.host-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.host-head a, .host-head span.name { font-weight: 700; color: #FFFFFF; text-decoration: none; }
.host-head a:hover { text-decoration: underline; }
.gauges { display: flex; gap: .75rem; justify-content: space-around; }
.gauge { text-align: center; font-size: .75rem; color: var(--mon-dim); }
.gauge svg { display: block; margin: 0 auto; }
.gauge .val { font-size: .95rem; font-weight: 700; fill: #FFFFFF; }
.vm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .35rem; margin-top: .6rem; }
.vm { display: flex; align-items: center; gap: .35rem; font-size: .8rem; padding: .25rem .4rem; border-radius: .3rem; background: rgba(61,124,201,.12); min-width: 0; }
.vm .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; color: #FFFFFF; text-decoration: none; }
.vm .spark { flex: none; }
/* Alive dial: spins while the machine is on (calm, ambient) */
.dial { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid rgba(149,212,233,.3); border-top-color: var(--st-ok); animation: spin 2.4s linear infinite; }
.dial.warn { border-top-color: var(--st-warn); } .dial.crit { border-top-color: var(--st-crit); animation-duration: .8s; }
.dial.off { animation: none; border-color: var(--st-off); opacity: .5; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Lists */
.rows { list-style: none; padding: 0; margin: 0; }
.rows li { display: flex; align-items: center; gap: .6rem; padding: .35rem 0; border-bottom: 1px dashed var(--mon-line); }
.rows li:last-child { border-bottom: 0; }
.rows .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.countdown { font-weight: 700; font-variant-numeric: tabular-nums; }
.bar { height: .5rem; background: rgba(149,212,233,.15); border-radius: .25rem; overflow: hidden; min-width: 60px; }
.bar > span { display: block; height: 100%; background: var(--st-ok); }
.bar.warn > span { background: var(--st-warn); } .bar.crit > span { background: var(--st-crit); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kpi { background: var(--mon-panel); border: 1px solid var(--mon-line); border-radius: .5rem; padding: .8rem 1rem; }
.kpi .n { font-size: 2rem; font-weight: 800; line-height: 1.1; }
.kpi .l { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--mon-dim); }

/* Ticker */
.ticker { position: sticky; bottom: 0; background: var(--mon-panel); border-top: 2px solid var(--brand-accent); overflow: hidden; white-space: nowrap; padding: .45rem 0; margin: 1rem -1rem -1rem; }
.ticker-track { display: inline-block; padding-left: 100%; animation: tick 60s linear infinite; }
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track { animation-play-state: paused; }
.ticker .ev { margin-right: 3rem; }
@keyframes tick { to { transform: translateX(-100%); } }

/* Kiosk: large, one page, no scrolling */
body.mode-kiosk { background: var(--mon-bg); color: #FFFFFF; overflow: hidden; height: 100vh; }
.mode-kiosk main { height: 100vh; padding: 1rem 1.25rem 0; display: flex; flex-direction: column; }
.mode-kiosk .kiosk-grid { flex: 1; display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; min-height: 0; }
.mode-kiosk .kiosk-grid > div { min-height: 0; overflow: hidden; }
.mode-kiosk .panel > h2 { font-size: 1rem; }
.mode-kiosk .host-grid { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
.pair-code { font-size: clamp(4rem, 14vw, 11rem); font-weight: 800; letter-spacing: .25em; color: var(--brand-accent); text-shadow: 0 0 30px rgba(255,214,0,.35); }

/* Radar sweep decoration (aria-hidden) */
.radar { width: 120px; height: 120px; border-radius: 50%; border: 1px solid var(--mon-line); position: relative; overflow: hidden; flex: none;
  background: repeating-radial-gradient(circle, transparent 0 19px, rgba(149,212,233,.18) 19px 20px); }
.radar::after { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(91,224,138,.45), transparent 60deg); animation: spin 4s linear infinite; }

/* Showcase panel (Viewer) */
.showcase { border-color: var(--brand-secondary); }
.showcase ol { padding-left: 1.2rem; margin: 0; }
.showcase li { margin-bottom: .35rem; }

@media (max-width: 900px) { .mode-kiosk .kiosk-grid { grid-template-columns: 1fr; } }
