/* ============================================================
   Brown University Health — CMMS Command Center
   Design System: Brown Health × CSL Consulting — Modern Technical
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  /* ── Core palette ── */
  /* Blue — lighter royal blue so white logo & text read clearly */
  --navy:        #1A5CA8;
  --navy-dark:   #124591;
  --navy-mid:    #2470C4;
  --navy-light:  #EBF3FC;

  /* Teal (Brown Health's signature healthy-data accent) */
  --teal:        #007B87;
  --teal-dark:   #005F6A;
  --teal-light:  #E0F5F7;
  --teal-glow:   rgba(0,123,135,.18);

  /* Red — CSL bold / Brown Health cardinal */
  --red:         #C8102E;        /* large graphic accents only */
  --red-text:    #A80D24;        /* text & small icons — AA on white */
  --red-light:   #FDEEF1;

  /* Gold — kept for logo ring & ribbon only */
  --gold:        #FFC72C;
  --gold-text:   #8A6100;

  /* Neutral surfaces */
  --bg:          #F4F7FC;        /* cool-tinted page background */
  --card:        #FFFFFF;
  --border:      #DDE3EC;
  --border-dark: #C6CEDB;

  /* Grayscale */
  --gray-100:    #F8FAFB;
  --gray-200:    #EEF1F6;
  --gray-500:    #64748B;
  --gray-700:    #374151;
  --gray-900:    #0D1B2E;

  /* Semantic */
  --green:       #0C7C59;        /* success / healthy — AA on white */
  --green-light: #E6F6F1;
  --amber:       #8A6100;        /* warning text — AA on white */
  --amber-bg:    #FFF8E0;

  /* Text */
  --text:        #0D1B2E;        /* near-black navy */
  --text-mid:    #374761;
  --text-light:  #64748B;

  /* Kept for Brown brand identity in wordmark / footer */
  --brown:       #4E3629;

  /* Typography — IBM Plex Sans (enterprise technical UI) + Barlow Condensed (display/KPIs) + IBM Plex Mono (data) */
  --font-serif:  'Barlow Condensed', 'Barlow', system-ui, sans-serif;
  --font-sans:   'IBM Plex Sans', 'Barlow', system-ui, sans-serif;
  --font-mono:   'IBM Plex Mono', 'Courier New', monospace;

  /* Layout */
  --header-h:    64px;
  --pulse-h:     34px;
  --chip-h:      46px;
  --tab-h:       46px;
  --sticky-top:  calc(var(--header-h) + var(--pulse-h) + var(--chip-h) + var(--tab-h));

  /* Geometry */
  --radius:      10px;
  --radius-lg:   16px;
  --radius-xl:   22px;

  /* Elevation */
  --shadow:      0 1px 3px rgba(13,27,46,.05), 0 4px 16px rgba(13,27,46,.06);
  --shadow-hover:0 4px 10px rgba(13,27,46,.08), 0 12px 32px rgba(13,27,46,.10);
  --shadow-lg:   0 8px 40px rgba(13,27,46,.20);
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

h1,h2,h3,h4 {
  font-family: var(--font-serif);
  color: var(--navy);
  line-height: 1.2;
  letter-spacing: -0.018em;
}

::selection { background: var(--teal-light); color: var(--teal-dark); }

button { cursor: pointer; font-family: inherit; border: none; background: none; }
select { font-family: inherit; font-size: 13px; }
input  { font-family: inherit; font-size: 14px; }
table  { border-collapse: collapse; width: 100%; }
a      { color: var(--teal); }

/* ── Site Header ───────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: linear-gradient(130deg, var(--navy-dark) 0%, var(--navy) 65%, var(--navy-mid) 100%);
}
.site-header::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--teal) 0%, var(--gold) 45%, transparent 85%);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 24px;
}
.header-brand { display: flex; align-items: center; gap: 16px; }
.logo-placeholder { display: flex; align-items: center; flex-shrink: 0; }
.header-logo { height: 42px; display: block; width: auto; }
.header-divider { width: 1px; height: 36px; background: rgba(255,255,255,.22); flex-shrink: 0; }
.header-text { display: flex; flex-direction: column; gap: 3px; }
.wordmark {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 15.5px;
  color: #fff;
  letter-spacing: -0.02em;
}
.wordmark-sub { font-weight: 300; opacity: .7; }
.app-title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal-light);
  opacity: .9;
}
.header-meta { display: flex; align-items: center; gap: 12px; }
.btn-export {
  padding: 7px 16px;
  border: 1.5px solid rgba(255,255,255,.45);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .15s;
}
.btn-export:hover { background: rgba(255,255,255,.18); border-color: #fff; transform: translateY(-1px); }
.btn-export:active { transform: scale(.96); }
.btn-export:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; }
.btn-export:disabled { opacity: .6; cursor: wait; }
.demo-ribbon {
  background: var(--gold);
  color: var(--navy-dark);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 5px 16px;
  border-radius: 999px;
  text-transform: uppercase;
  box-shadow: 0 0 0 3px rgba(255,199,44,.2);
}

/* ── Source Pulse Strip ────────────────────────────────────── */
.pulse-strip {
  position: sticky;
  top: var(--header-h);
  z-index: 99;
  background: var(--navy-dark);
  height: var(--pulse-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.pulse-strip-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 24px;
  width: 100%;
  font-size: 12px;
}
.pulse-source {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255,255,255,.72);
}
.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gray-500);
  flex-shrink: 0;
}
.pulse-source[data-status="ok"]   .pulse-dot { background: var(--teal); animation: pulse-glow 2.2s ease-in-out infinite; }
.pulse-source[data-status="warn"] .pulse-dot { background: var(--gold); animation: none; }
.pulse-source[data-status="err"]  .pulse-dot { background: var(--red); }
.pulse-label { font-weight: 600; color: rgba(255,255,255,.92); font-size: 12px; }
.pulse-detail { font-family: var(--font-mono); font-size: 10.5px; opacity: .75; }
.pulse-timestamp { margin-left: auto; color: rgba(255,255,255,.5); font-family: var(--font-mono); font-size: 10.5px; }

@keyframes pulse-glow {
  0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0,123,135,.7); }
  50%      { opacity: .85; box-shadow: 0 0 0 4px rgba(0,123,135,0); }
}

/* ── Campus Chip Bar ───────────────────────────────────────── */
.chip-bar {
  position: sticky;
  top: calc(var(--header-h) + var(--pulse-h));
  z-index: 98;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 24px;
  height: var(--chip-h);
  overflow-x: auto;
  scrollbar-width: none;
}
.chip-bar::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  padding: 6px 15px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--text-mid);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: background .18s, color .18s, border-color .18s, transform .18s, box-shadow .18s;
}
.chip:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.chip:hover {
  border-color: var(--teal);
  color: var(--teal);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px var(--teal-glow);
}
.chip:active { transform: translateY(0) scale(.95); }
.chip--active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  box-shadow: 0 2px 10px rgba(27,46,82,.28);
}
.chip--all { font-weight: 600; }

/* ── Tab Navigation ────────────────────────────────────────── */
.tab-nav {
  position: sticky;
  top: calc(var(--header-h) + var(--pulse-h) + var(--chip-h));
  z-index: 97;
  background: var(--card);
  border-bottom: 2px solid var(--border);
  display: flex;
  padding: 0 24px;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  position: relative;
  padding: 12px 18px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-light);
  white-space: nowrap;
  transition: color .18s;
}
.tab-btn::after {
  content: '';
  position: absolute;
  left: 18px; right: 18px; bottom: -2px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .22s cubic-bezier(.4,0,.2,1);
}
.tab-btn:hover { color: var(--navy); }
.tab-btn:hover::after { transform: scaleX(.45); }
.tab-btn--active { color: var(--navy); font-weight: 700; }
.tab-btn--active::after { transform: scaleX(1); }
.tab-btn:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }

/* ── Main Content ──────────────────────────────────────────── */
.main-content { padding: 24px; max-width: 1640px; margin: 0 auto; }
.tab-panel { display: none; }
.tab-panel--active { display: block; }

/* Staggered entrance for panel content — playful but quick */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tab-panel--active > * { animation: rise-in .38s cubic-bezier(.22,1,.36,1) both; }
.tab-panel--active > *:nth-child(1) { animation-delay: 0s; }
.tab-panel--active > *:nth-child(2) { animation-delay: .04s; }
.tab-panel--active > *:nth-child(3) { animation-delay: .08s; }
.tab-panel--active > *:nth-child(4) { animation-delay: .12s; }
.tab-panel--active > *:nth-child(5) { animation-delay: .16s; }
.tab-panel--active > *:nth-child(6) { animation-delay: .20s; }
.tab-panel--active > *:nth-child(7) { animation-delay: .24s; }
.tab-panel--active > *:nth-child(n+8) { animation-delay: .28s; }

/* ── Section Title Row ─────────────────────────────────────── */
.section-title-row { margin: 28px 0 14px; }
.section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before {
  content: '';
  width: 4px; height: 18px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--teal), var(--red));
  flex-shrink: 0;
}

/* ── KPI Cards ─────────────────────────────────────────────── */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .18s, box-shadow .18s;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal) 0%, var(--navy) 100%);
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--teal); }
.kpi-card[data-goto] { cursor: pointer; }
.kpi-card[data-goto]:active { transform: translateY(-1px) scale(.985); }
.kpi-card[data-goto]:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.kpi-card[data-goto]::after {
  content: '→';
  position: absolute;
  top: 12px; right: 14px;
  font-size: 14px;
  color: var(--teal);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .18s, transform .18s;
}
.kpi-card[data-goto]:hover::after { opacity: 1; transform: translateX(0); }
.kpi-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-light);
}
.kpi-value {
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--navy);
  line-height: 1.1;
  margin: 6px 0 4px;
  font-variant-numeric: tabular-nums;
}
.kpi-sub { font-size: 12px; color: var(--text-light); }
.kpi-sub--warn { color: var(--red-text); font-weight: 600; }
.kpi-sub--ok   { color: var(--green); }

/* ── Alert Banner ──────────────────────────────────────────── */
.alert-banner {
  background: var(--red-light);
  border: 1px solid #F1C4CC;
  border-left: 4px solid var(--red-text);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 22px;
}
.alert-banner-title { font-weight: 700; color: var(--red-text); font-size: 13px; margin-bottom: 8px; }
.alert-item { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; padding: 3px 0; color: var(--text-mid); }
.alert-item::before { content: '⚠'; flex-shrink: 0; color: var(--red-text); }

/* ── Chart Grid ────────────────────────────────────────────── */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 14px;
  margin-bottom: 22px;
}
.charts-grid--2col { grid-template-columns: 1fr 1fr; }
.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: box-shadow .18s;
}
.chart-card:hover { box-shadow: var(--shadow-hover); }
.chart-card--wide { grid-column: span 2; }
.chart-card--sm   { grid-column: span 1; }
.chart-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.chart-title {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--navy);
  margin-bottom: 10px;
}
.chart-subtitle { font-size: 12px; color: var(--text-light); margin-bottom: 8px; }
.chart-wrap { position: relative; height: 220px; }
.chart-wrap--tall { height: 280px; }

/* ── Tables ────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.data-table { background: var(--card); font-size: 13px; }
.data-table thead tr { background: var(--navy); }
.data-table thead th {
  padding: 12px 14px;
  text-align: left;
  color: rgba(255,255,255,.9);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
  user-select: none;
}
.data-table thead th[data-sort] { cursor: pointer; }
.data-table thead th[data-sort]:hover { background: var(--navy-mid); }
.data-table thead th[data-sort]:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.data-table thead th[aria-sort="ascending"]::after  { content: ' ↑'; opacity: .9; }
.data-table thead th[aria-sort="descending"]::after { content: ' ↓'; opacity: .9; }
.data-table thead th[aria-sort="none"][data-sort]::after { content: ' ⇅'; opacity: .35; }
.data-table tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:nth-child(even) { background: var(--gray-100); }
.data-table tbody tr:hover { background: var(--navy-light); }
.data-table tbody tr[data-wo-id] { cursor: pointer; }
.data-table td { padding: 10px 14px; vertical-align: middle; }
.data-table td.mono { font-family: var(--font-mono); font-size: 12px; }

/* ── Priority Pills ────────────────────────────────────────── */
.pill { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.pill--p1 { background: var(--red-text); color: #fff; }
.pill--p2 { background: #fff; color: var(--red-text); border: 1.5px solid var(--red-text); }
.pill--p3 { background: #3F5068; color: #fff; }
.pill--p4 { background: var(--gray-200); color: var(--gray-700); }

/* ── Status Pills ──────────────────────────────────────────── */
.pill--open       { background: var(--amber-bg);  color: var(--amber);    border: 1px solid #E8D07A; }
.pill--inprogress { background: var(--teal-light); color: var(--teal-dark); border: 1px solid #9DD9E0; }
.pill--onhold     { background: var(--red-light);  color: var(--red-text); border: 1px solid #F1C4CC; }
.pill--completed  { background: var(--green-light);color: var(--green);    border: 1px solid #9DD8C8; }

/* ── SLA Display ───────────────────────────────────────────── */
.sla--ok      { color: var(--green);   font-family: var(--font-mono); font-size: 12px; }
.sla--warn    { color: var(--amber);   font-weight: 600; font-family: var(--font-mono); font-size: 12px; }
.sla--overdue { color: var(--red-text);font-weight: 700; font-family: var(--font-mono); font-size: 12px; }

/* ── WO Toolbar ────────────────────────────────────────────── */
.wo-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.wo-toolbar-left, .wo-toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.search-input {
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  min-width: 240px;
  background: var(--card);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.search-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-glow);
}
.filter-select {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.filter-select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-glow);
}
.result-count { font-size: 12px; color: var(--text-light); font-family: var(--font-mono); }

/* ── Filter Tokens ─────────────────────────────────────────── */
.filter-tokens { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.filter-token {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--teal-light);
  border: 1px solid #9DD9E0;
  border-radius: 999px;
  font-size: 12px;
  color: var(--teal-dark);
  font-weight: 600;
  animation: token-in .18s ease-out;
}
@keyframes token-in { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }
.filter-token-remove {
  background: none;
  border: none;
  color: var(--teal-dark);
  font-size: 14px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  opacity: .7;
}
.filter-token-remove:hover { opacity: 1; }
.filter-token-remove:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; opacity: 1; }

/* ── Show More ─────────────────────────────────────────────── */
.show-more-wrap { text-align: center; padding: 14px 0; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn-secondary {
  padding: 8px 20px;
  border: 1.5px solid var(--navy);
  border-radius: 999px;
  background: var(--card);
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
  transition: background .15s, color .15s, transform .15s, box-shadow .15s;
}
.btn-secondary:hover {
  background: var(--navy);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(27,46,82,.25);
}
.btn-secondary:active { transform: translateY(0) scale(.96); }
.btn-secondary:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* ── FCI Dot ───────────────────────────────────────────────── */
.fci-dot { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 12px; }
.fci-dot::before { content: '●'; font-size: 10px; }
.fci-dot--green { color: var(--green); }
.fci-dot--gold  { color: var(--amber); }
.fci-dot--red   { color: var(--red-text); }

/* ── Slide-over Drawer ─────────────────────────────────────── */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(13,27,46,.45);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .25s, visibility .25s;
}
.drawer-overlay.is-open { opacity: 1; visibility: visible; pointer-events: all; }

.drawer {
  position: fixed;
  top: 0; right: 0;
  width: 480px; max-width: 100vw;
  height: 100vh;
  background: var(--card);
  z-index: 201;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .28s cubic-bezier(.4,0,.2,1), visibility .28s;
}
.drawer.is-open { transform: translateX(0); visibility: visible; }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: linear-gradient(120deg, var(--navy-dark), var(--navy));
  color: #fff;
  flex-shrink: 0;
}
.drawer-title { font-family: var(--font-serif); font-size: 17px; color: #fff; letter-spacing: -0.02em; }
.drawer-close {
  color: rgba(255,255,255,.75);
  font-size: 20px;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: color .12s, background .12s;
}
.drawer-close:hover { color: #fff; background: rgba(255,255,255,.15); }
.drawer-close:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px; }
.drawer-footer {
  padding: 12px 22px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-light);
  font-style: italic;
  background: var(--gray-100);
}
.drawer-field { margin-bottom: 16px; }
.drawer-field-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-light);
  margin-bottom: 3px;
  font-family: var(--font-mono);
}
.drawer-field-value { font-size: 14px; color: var(--text); }
.drawer-field-value.mono { font-family: var(--font-mono); font-size: 13px; }
.drawer-activity { margin-top: 18px; }
.drawer-activity-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-light);
  margin-bottom: 10px;
  font-family: var(--font-mono);
}
.activity-item { padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-mid); }
.activity-item:last-child { border-bottom: none; }
.activity-ts { font-family: var(--font-mono); font-size: 11px; color: var(--text-light); margin-top: 2px; }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(13,27,46,.5);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s, visibility .2s;
}
.modal-overlay.is-open { opacity: 1; visibility: visible; pointer-events: all; }
.modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 760px;
  max-width: 95vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: scale(.95);
  transition: transform .2s;
}
.modal-overlay.is-open .modal { transform: scale(1); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: linear-gradient(120deg, var(--navy-dark), var(--navy));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  flex-shrink: 0;
}
.modal-title { font-family: var(--font-serif); font-size: 17px; color: #fff; letter-spacing: -0.02em; }
.modal-close {
  color: rgba(255,255,255,.75);
  font-size: 20px;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: color .12s, background .12s;
}
.modal-close:hover { color: #fff; background: rgba(255,255,255,.15); }
.modal-close:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; }
.modal-body { flex: 1; overflow-y: auto; padding: 0; }

/* ── PM Gauges ─────────────────────────────────────────────── */
.gauges-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.gauge-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 160px;
  max-width: 220px;
  position: relative;
}
.gauge-wrap { position: relative; width: 160px; height: 160px; }
.gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.gauge-value { font-family: var(--font-serif); font-size: 26px; font-weight: 700; }
.gauge-label { font-size: 12.5px; font-weight: 600; color: var(--navy); text-align: center; margin-top: 8px; }
.gauge-subtitle { font-size: 11px; color: var(--text-light); margin-top: 2px; font-family: var(--font-mono); }

/* ── NFPA Cards ────────────────────────────────────────────── */
.nfpa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 22px; }
.nfpa-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.nfpa-card-title { font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.nfpa-pct { font-family: var(--font-serif); font-size: 28px; font-weight: 700; }
.nfpa-pct--green { color: var(--green); }
.nfpa-pct--gold  { color: var(--amber); }
.nfpa-pct--red   { color: var(--red-text); }
.nfpa-status { font-size: 11.5px; margin-top: 4px; color: var(--text-light); }

/* ── ILSM Cards ────────────────────────────────────────────── */
.ilsm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.ilsm-card {
  background: var(--red-light);
  border: 1px solid #F1C4CC;
  border-left: 4px solid var(--red-text);
  border-radius: var(--radius);
  padding: 14px 18px;
}
.ilsm-title { font-weight: 700; font-size: 13.5px; color: var(--red-text); margin-bottom: 6px; }
.ilsm-meta { font-size: 12px; color: var(--text-light); margin-bottom: 8px; font-family: var(--font-mono); }
.ilsm-measures { font-size: 13px; color: var(--text-mid); }

/* ── PM Status Pill ────────────────────────────────────────── */
.pm-status--overdue  { background: var(--red-light);  color: var(--red-text); border: 1px solid #F1C4CC; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.pm-status--today    { background: var(--amber-bg);   color: var(--amber);    border: 1px solid #E8D07A; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.pm-status--upcoming { background: var(--green-light);color: var(--green);    border: 1px solid #9DD8C8; padding: 2px 8px; border-radius: 10px; font-size: 11px; }

/* ── Capital Projects ──────────────────────────────────────── */
.portfolio-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.portfolio-kpi {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.portfolio-kpi-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-light);
}
.portfolio-kpi-value {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--navy);
  margin: 4px 0 2px;
  font-variant-numeric: tabular-nums;
}
.portfolio-kpi-sub { font-size: 11px; color: var(--text-light); }

/* ── Budget What-if Simulation ─────────────────────────────── */
.sim-control {
  background: var(--teal-light);
  border: 1px solid #9DD9E0;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 16px;
}
.sim-label { font-size: 12.5px; font-weight: 700; color: var(--teal-dark); display: block; }
.sim-val { font-family: var(--font-mono); font-size: 13px; margin-left: 6px; }
.sim-hint { font-size: 11px; color: var(--text-light); margin-top: 4px; }
.sim-control input[type="range"] {
  width: 100%;
  margin-top: 8px;
  accent-color: var(--teal);
  cursor: grab;
}
.sim-control input[type="range"]:active { cursor: grabbing; }
.sim-control input[type="range"]:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; }

.capital-charts-row { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-bottom: 22px; }

.project-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; }
.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  transition: transform .18s, box-shadow .18s;
}
.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.project-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.project-name { font-family: var(--font-serif); font-size: 15px; font-weight: 700; color: var(--navy); }
.phase-chip {
  padding: 3px 11px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  background: var(--navy-light);
  color: var(--navy);
  white-space: nowrap;
  margin-left: 8px;
}
.project-meta { display: flex; gap: 16px; font-size: 12px; color: var(--text-light); margin-bottom: 12px; flex-wrap: wrap; }
.project-meta strong { color: var(--text-mid); }
.evm-badges { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.evm-badge {
  padding: 4px 12px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 700;
  border: 1.5px solid;
  cursor: default;
  position: relative;
}
.evm-badge--green { background: var(--green-light); color: var(--green);    border-color: #9DD8C8; }
.evm-badge--gold  { background: var(--amber-bg);    color: var(--amber);    border-color: #E8D07A; }
.evm-badge--red   { background: var(--red-light);   color: var(--red-text); border-color: #F1C4CC; }
.evm-badge[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%; left: 50%;
  transform: translateX(-50%);
  background: var(--navy); color: #fff;
  padding: 5px 10px; border-radius: 6px;
  font-size: 11px; font-weight: 400;
  white-space: nowrap; pointer-events: none; z-index: 10;
  margin-bottom: 5px;
}

/* Mini-Gantt */
.gantt-wrap { margin-top: 10px; }
.gantt-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-light);
  margin-bottom: 6px;
  font-family: var(--font-mono);
}
.gantt-bar {
  position: relative;
  height: 26px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: visible;
}
.gantt-phase {
  position: absolute;
  top: 0; height: 100%;
  border-radius: 3px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--navy-mid);
  transition: filter .15s;
}
.gantt-phase:hover { filter: brightness(1.15); }
.gantt-phase--late   { background: var(--red-text) !important; }
.gantt-phase--active { background: var(--teal) !important; }
.gantt-phase-label { font-size: 10px; color: #fff; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-today {
  position: absolute;
  top: -4px; bottom: -4px;
  width: 2px;
  background: var(--red);
  z-index: 2;
}
.gantt-today::after {
  content: 'Today';
  position: absolute;
  top: -18px; left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--red-text);
  font-weight: 700;
  white-space: nowrap;
  font-family: var(--font-mono);
}

/* ── Data Sources ──────────────────────────────────────────── */
.source-cards-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.source-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.source-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.source-name { font-family: var(--font-serif); font-size: 16px; font-weight: 700; color: var(--navy); }
.source-status-badge { padding: 3px 11px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.source-status-badge--ok   { background: var(--green-light); color: var(--green); }
.source-status-badge--warn { background: var(--amber-bg);    color: var(--amber); }
.source-detail-row { display: flex; justify-content: space-between; font-size: 12px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.source-detail-row:last-child { border-bottom: none; }
.source-detail-key { color: var(--text-light); }
.source-detail-val { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-mid); }

.pipeline-diagram {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 12px;
  color: var(--text-mid);
}
.pipeline-step--highlight { background: var(--navy-light); border-color: var(--navy-mid); }
.pipeline-step--active    { background: var(--navy); color: #fff; border-color: var(--navy); }
.pipeline-step--active .pipeline-icon { filter: invert(1); }
.pipeline-icon { font-size: 20px; }
.pipeline-label { font-weight: 600; }
.pipeline-arrow { font-size: 20px; color: var(--border-dark); }

.refresh-log {
  background: var(--navy-dark);
  color: #7DD3CB;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 18px 22px;
  border-radius: var(--radius);
  max-height: 240px;
  overflow-y: auto;
  line-height: 1.75;
  border: 1px solid rgba(255,255,255,.06);
}
.log-warn { color: #F6C453; }
.log-ok   { color: #7DD3CB; }
.log-err  { color: #FCA5A5; }

.workbook-stale td { color: var(--amber); }
.workbook-status--ok    { background: var(--green-light); color: var(--green); padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.workbook-status--stale { background: var(--amber-bg);    color: var(--amber); padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; }

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,.75);
  padding: 24px;
  margin-top: 48px;
  font-size: 12.5px;
  line-height: 1.65;
  border-top: 2px solid var(--teal);
}
.footer-inner { max-width: 1640px; margin: 0 auto; }
.site-footer p { margin-bottom: 6px; }
.site-footer p:last-child { margin-bottom: 0; }
.site-footer strong { color: rgba(255,255,255,.92); }

/* ── Campus Scorecard ──────────────────────────────────────── */
.uptime-ok   { color: var(--green); font-family: var(--font-mono); font-size: 12px; }
.uptime-warn { color: var(--amber); font-family: var(--font-mono); font-size: 12px; }
.campus-name { font-weight: 600; }

/* ── Dot Scale ─────────────────────────────────────────────── */
.dot-scale { display: inline-flex; gap: 2px; }
.dot-scale span { font-size: 9px; line-height: 1; }
.dot-scale span.filled { color: var(--navy); }
.dot-scale span.empty  { color: var(--border); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .charts-grid { grid-template-columns: 1fr 1fr; }
  .chart-card--wide { grid-column: span 2; }
  .capital-charts-row { grid-template-columns: 1fr; }
  .source-cards-row { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .charts-grid { grid-template-columns: 1fr; }
  .chart-card--wide { grid-column: span 1; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .project-cards { grid-template-columns: 1fr; }
  .drawer { width: 100vw; }
  .gauges-row { justify-content: center; }
}

/* ── Reduced Motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .pulse-dot { animation: none !important; }
  html { scroll-behavior: auto; }
}
