/* HIS Atlas by Brider — Prototype stylesheet
   Palette: WHO sky-blue primary + Brider navy accent
*/

:root {
  --who-blue:        #0093D5;
  --who-blue-dark:   #0077AB;
  --who-blue-light:  #E6F4FB;
  --who-blue-pale:   #F4FAFD;
  --brider-navy:     #0B2545;
  --brider-accent:   #2E86AB;
  --grey-900:        #1F2937;
  --grey-700:        #374151;
  --grey-600:        #4B5563;
  --grey-500:        #6B7280;
  --grey-400:        #9CA3AF;
  --grey-300:        #D1D5DB;
  --grey-200:        #E5E7EB;
  --grey-100:        #F3F4F6;
  --grey-50:         #F9FAFB;
  --green:           #10B981;
  --amber:           #F59E0B;
  --red:             #EF4444;
  --purple:          #8B5CF6;
  --shadow-sm:       0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow-md:       0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg:       0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
  --radius-sm:       4px;
  --radius:          8px;
  --radius-lg:       12px;
}

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

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--grey-900);
  background: var(--grey-50);
  -webkit-font-smoothing: antialiased;
}

/* ========== Layout shell ========== */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

aside.sidebar {
  background: var(--brider-navy);
  color: white;
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar .brand {
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 16px;
}
.sidebar .brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: white;
}
.sidebar .brand-sub {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  margin-top: 2px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar .user-card {
  margin: 0 14px 18px;
  padding: 12px 14px;
  background: rgba(0,147,213,0.10);
  border: 1px solid rgba(0,147,213,0.20);
  border-radius: 8px;
}
.sidebar .user-name {
  font-size: 13px;
  font-weight: 700;
  color: white;
  letter-spacing: -0.01em;
}
.sidebar .user-role {
  font-size: 10.5px;
  color: rgba(255,255,255,0.65);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.sidebar nav { display: flex; flex-direction: column; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
}
.sidebar nav a:hover {
  color: white;
  background: rgba(255,255,255,0.04);
}
.sidebar nav a.active {
  color: white;
  background: rgba(0,147,213,0.18);
  border-left-color: var(--who-blue);
  font-weight: 600;
}
.sidebar nav a .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}

.sidebar .footer {
  margin-top: auto;
  padding: 16px 20px;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar .footer a { color: var(--who-blue); text-decoration: none; }

main.content {
  padding: 32px 40px 80px;
  max-width: 1400px;
  width: 100%;
}

header.page-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--grey-200);
}
header.page-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--brider-navy);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
header.page-header .lead {
  font-size: 14px;
  color: var(--grey-600);
  max-width: 800px;
  line-height: 1.55;
}

/* ========== Tiles / KPI dashboard ========== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.kpi {
  background: white;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--who-blue);
}
.kpi.kpi-navy::before  { background: var(--brider-navy); }
.kpi.kpi-amber::before { background: var(--amber); }
.kpi.kpi-green::before { background: var(--green); }
.kpi .kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--grey-500);
  font-weight: 600;
  margin-bottom: 8px;
}
.kpi .kpi-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--brider-navy);
  letter-spacing: -0.02em;
  line-height: 1;
}
.kpi .kpi-sub {
  margin-top: 6px;
  font-size: 11px;
  color: var(--grey-500);
}

/* ========== Cards ========== */
.card {
  background: white;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--grey-200);
}
.card-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--brider-navy);
  letter-spacing: -0.01em;
}
.card-header .meta {
  font-size: 12px;
  color: var(--grey-500);
}

/* Stage progress ribbon */
.stage-ribbon {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 8px 0;
}
.stage {
  position: relative;
  padding: 14px 16px 12px;
  background: var(--grey-100);
  border-radius: var(--radius-sm);
  font-size: 12px;
  text-align: center;
  color: var(--grey-600);
  border-bottom: 3px solid var(--grey-300);
  transition: all 0.2s ease;
}
.stage.done {
  background: var(--who-blue-light);
  color: var(--who-blue-dark);
  border-bottom-color: var(--who-blue);
}
.stage.active {
  background: var(--brider-navy);
  color: white;
  border-bottom-color: var(--who-blue);
  font-weight: 600;
}
.stage .stage-num {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
  opacity: 0.7;
}
.stage .stage-name {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
}

/* ========== Platform cards (inventory page) ========== */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.platform-card {
  background: white;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}
.platform-card:hover {
  border-color: var(--who-blue);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.platform-card .pc-cluster {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--who-blue);
  font-weight: 700;
  margin-bottom: 6px;
}
.platform-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--brider-navy);
  margin-bottom: 4px;
  line-height: 1.25;
}
.platform-card .pc-purpose {
  font-size: 12px;
  color: var(--grey-600);
  line-height: 1.45;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.platform-card .pc-meta {
  display: flex;
  gap: 10px;
  font-size: 10.5px;
  color: var(--grey-500);
  flex-wrap: wrap;
  align-items: center;
}
.platform-card .pc-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  background: var(--grey-100);
  color: var(--grey-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10px;
}
.platform-card .pc-status.production { background: rgba(16,185,129,0.1); color: var(--green); }
.platform-card .pc-status.development { background: rgba(245,158,11,0.1); color: var(--amber); }
.platform-card.pc-add {
  border-style: dashed;
  border-color: var(--grey-300);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  color: var(--grey-500);
  min-height: 180px;
}
.platform-card.pc-add:hover {
  border-color: var(--who-blue);
  color: var(--who-blue);
  background: var(--who-blue-pale);
}
.platform-card.pc-add .pc-add-icon {
  font-size: 32px;
  font-weight: 200;
  margin-bottom: 4px;
  line-height: 1;
}

/* Disposition badge */
.disposition-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.disposition-badge.retain      { background: rgba(16,185,129,0.12); color: var(--green); }
.disposition-badge.consolidate { background: rgba(245,158,11,0.12); color: var(--amber); }
.disposition-badge.migrate     { background: rgba(139,92,246,0.12); color: var(--purple); }
.disposition-badge.sunset      { background: rgba(239,68,68,0.12); color: var(--red); }
.disposition-badge.unset       { background: var(--grey-100); color: var(--grey-500); }

/* ========== Modal (drill-in) ========== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11,37,69,0.55);
  backdrop-filter: blur(2px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 100;
  padding: 40px 20px;
  overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: white;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 800px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin: auto;
}
.modal-header {
  padding: 20px 28px;
  background: var(--brider-navy);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.modal-header .mh-cluster {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.65);
  margin-bottom: 4px;
  font-weight: 600;
}
.modal-header h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.modal-header .mh-close {
  background: transparent;
  color: white;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 4px;
  opacity: 0.8;
}
.modal-header .mh-close:hover { opacity: 1; background: rgba(255,255,255,0.08); }
.modal-body { padding: 24px 28px; max-height: 70vh; overflow-y: auto; }

.field-group {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--grey-100);
}
.field-group:last-child { border-bottom: none; }
.field-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--grey-500);
  font-weight: 600;
  padding-top: 8px;
}
.field-value textarea,
.field-value input[type=text],
.field-value select {
  width: 100%;
  border: 1px solid var(--grey-300);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  color: var(--grey-900);
  background: white;
  resize: vertical;
}
.field-value textarea { min-height: 70px; }
.field-value textarea:focus,
.field-value input:focus,
.field-value select:focus {
  outline: none;
  border-color: var(--who-blue);
  box-shadow: 0 0 0 3px rgba(0,147,213,0.15);
}

.modal-footer {
  padding: 16px 28px;
  background: var(--grey-50);
  border-top: 1px solid var(--grey-200);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ========== Buttons ========== */
.btn {
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary {
  background: var(--who-blue);
  color: white;
}
.btn-primary:hover { background: var(--who-blue-dark); }
.btn-secondary {
  background: white;
  color: var(--grey-700);
  border: 1px solid var(--grey-300);
}
.btn-secondary:hover { background: var(--grey-50); }
.btn-ghost {
  background: transparent;
  color: var(--who-blue);
  padding: 6px 10px;
}
.btn-ghost:hover { background: var(--who-blue-light); }

/* ========== Tables ========== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 13px;
}
.data-table thead {
  background: var(--brider-navy);
  color: white;
}
.data-table th {
  text-align: left;
  padding: 11px 14px;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--grey-100);
  vertical-align: top;
}
.data-table tbody tr:hover { background: var(--who-blue-pale); }

/* ========== Heatmap ========== */
.heatmap-wrap {
  background: white;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 22px;
  overflow-x: auto;
}
.heatmap {
  display: grid;
  font-size: 11px;
  min-width: 720px;
}
.heatmap .hm-row { display: grid; }
.heatmap .hm-cell {
  padding: 12px 8px;
  border: 1px solid white;
  text-align: center;
  font-weight: 600;
  color: white;
  position: relative;
  cursor: default;
  transition: transform 0.1s;
}
.heatmap .hm-cell:hover { transform: scale(1.05); z-index: 2; box-shadow: var(--shadow-md); }
.heatmap .hm-label {
  background: var(--grey-50);
  color: var(--grey-700);
  font-weight: 700;
  text-align: left;
  padding: 12px 10px;
  border: 1px solid var(--grey-100);
  font-size: 10.5px;
}
.heatmap .hm-label.hm-corner { background: var(--brider-navy); color: white; }

.intensity-0 { background: var(--grey-100); color: var(--grey-500); }
.intensity-1 { background: #B7E0F2; color: var(--who-blue-dark); }
.intensity-2 { background: #66C0E5; }
.intensity-3 { background: var(--who-blue); }
.intensity-4 { background: var(--who-blue-dark); }

/* Strategic alignment heatmap */
.alignment-heatmap .align-cell {
  padding: 14px 10px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  border: 1px solid white;
}
.align-green { background: #D1FAE5; color: #065F46; }
.align-amber { background: #FEF3C7; color: #92400E; }
.align-red   { background: #FEE2E2; color: #991B1B; }

/* ========== Architecture stack visualization ========== */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.stack-layer {
  background: var(--grey-50);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: center;
}
.stack-layer .layer-name {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--grey-500);
  font-weight: 700;
  margin-bottom: 8px;
}
.stack-layer .layer-tech {
  font-size: 13px;
  font-weight: 600;
  color: var(--brider-navy);
  line-height: 1.3;
}

.standards-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.std-badge {
  display: inline-block;
  padding: 4px 10px;
  background: var(--who-blue-light);
  color: var(--who-blue-dark);
  border-radius: 12px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.std-badge.std-met     { background: rgba(16,185,129,0.12); color: var(--green); }
.std-badge.std-partial { background: rgba(245,158,11,0.12); color: var(--amber); }
.std-badge.std-missing { background: rgba(239,68,68,0.12); color: var(--red); }

/* ========== Hub-and-spoke diagram ========== */
.hub-spoke {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 8px;
  background: linear-gradient(180deg, var(--who-blue-pale) 0%, white 100%);
  border-radius: var(--radius);
  border: 1px solid var(--grey-200);
  position: relative;
  min-height: 360px;
}
.hub-spoke .hub {
  background: var(--brider-navy);
  color: white;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 0 0 6px rgba(11,37,69,0.08), 0 0 0 12px rgba(11,37,69,0.04);
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 8px;
}
.hub-spoke .hub .hub-sub {
  font-size: 9.5px;
  font-weight: 500;
  opacity: 0.75;
  margin-top: 4px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hub-spoke .spokes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hub-spoke .spoke {
  position: absolute;
  background: white;
  border: 2px solid var(--who-blue);
  color: var(--brider-navy);
  padding: 7px 12px;
  border-radius: 18px;
  font-size: 11px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  pointer-events: auto;
}

/* ========== Roadmap timeline ========== */
.roadmap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 4px;
}
.phase {
  background: white;
  border: 1px solid var(--grey-200);
  border-top: 4px solid var(--who-blue);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.phase.phase-quick { border-top-color: var(--green); }
.phase.phase-strat { border-top-color: var(--who-blue); }
.phase.phase-long  { border-top-color: var(--purple); }
.phase h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--brider-navy);
  margin-bottom: 4px;
}
.phase .phase-window {
  font-size: 11px;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 12px;
}
.phase ul { list-style: none; }
.phase li {
  font-size: 12.5px;
  color: var(--grey-700);
  padding: 6px 0 6px 18px;
  border-bottom: 1px solid var(--grey-100);
  position: relative;
}
.phase li:last-child { border-bottom: none; }
.phase li::before {
  content: '→';
  position: absolute;
  left: 0;
  top: 5px;
  color: var(--who-blue);
  font-weight: 700;
}

/* ========== Risk register list ========== */
.risk-list { display: flex; flex-direction: column; gap: 8px; }
.risk-item {
  display: grid;
  grid-template-columns: 32px 1fr 90px 90px;
  gap: 14px;
  padding: 12px 14px;
  background: var(--grey-50);
  border-radius: var(--radius-sm);
  align-items: center;
  font-size: 12.5px;
}
.risk-num {
  width: 24px;
  height: 24px;
  background: var(--brider-navy);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}
.risk-pill {
  text-align: center;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.risk-pill.lvl-low    { background: rgba(16,185,129,0.12); color: var(--green); }
.risk-pill.lvl-medium { background: rgba(245,158,11,0.12); color: var(--amber); }
.risk-pill.lvl-high   { background: rgba(239,68,68,0.12); color: var(--red); }

/* ========== KII tracker ========== */
.kii-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.kii-cell {
  padding: 12px 14px;
  background: var(--grey-50);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}
.kii-cell:hover { border-color: var(--who-blue); }
.kii-cell .kii-cluster {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--who-blue);
  margin-bottom: 4px;
}
.kii-cell .kii-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--brider-navy);
  line-height: 1.3;
}
.kii-cell.done {
  background: rgba(16,185,129,0.08);
  border-color: var(--green);
}
.kii-cell.done .kii-cluster { color: var(--green); }
.kii-cell.done::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 10px;
  color: var(--green);
  font-weight: 700;
  font-size: 14px;
}

/* ========== Charts grid ========== */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 24px;
}
@media (max-width: 1100px) { .charts-grid { grid-template-columns: 1fr; } }
.chart-card {
  background: white;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.chart-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--brider-navy);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.chart-sub {
  font-size: 11px;
  color: var(--grey-500);
  margin-bottom: 14px;
}

/* ========== Wizard / Add-platform pill ========== */
.wizard-step-pills {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--grey-200);
}
.step-pill {
  flex: 1;
  text-align: center;
  padding: 7px 10px;
  background: var(--grey-100);
  border-radius: 14px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--grey-500);
}
.step-pill.active { background: var(--who-blue); color: white; }
.step-pill.done   { background: var(--green); color: white; }

/* ========== Utilities ========== */
.row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 1; }
.muted { color: var(--grey-500); font-size: 12px; }
.eyebrow {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--who-blue);
  margin-bottom: 4px;
}
.section-divider {
  margin: 28px 0 20px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--grey-500);
  font-weight: 700;
}

@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; }
  aside.sidebar { position: static; height: auto; padding: 14px 0; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; padding: 0 8px; }
  .sidebar nav a { padding: 8px 12px; }
  .sidebar .footer { position: static; }
  main.content { padding: 20px; }
}

/* ============================================================
 * Mobile responsive overrides (≤900px)
 * Completes the older 800px rule with full layout collapse,
 * sidebar drawer, and content overflow handling.
 * ============================================================ */
.who-hamburger {
  display: none;
  position: fixed;
  top: 12px; left: 12px;
  z-index: 1001;
  width: 42px; height: 42px;
  background: white;
  border: 1px solid #DBE2EA;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(11,37,69,0.18);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.who-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(11,37,69,0.45);
  z-index: 999;
}
.who-backdrop.visible { display: block; }

@media (max-width: 900px) {
  html, body { overflow-x: hidden; max-width: 100vw; width: 100%; }
  body, .app, main.content, .page-header,
  .row, .kpi-row, .card, .charts-grid { max-width: 100vw; min-width: 0; }
  .app {
    display: block !important;
    grid-template-columns: 1fr !important;
  }

  /* Sidebar becomes a slide-out drawer */
  aside.sidebar {
    position: fixed !important;
    top: 0; left: 0; bottom: 0;
    width: 80%; max-width: 300px;
    height: 100vh !important;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 1000;
    box-shadow: 6px 0 24px rgba(0,0,0,0.25);
    overflow-y: auto;
    padding: 18px 0 !important;
  }
  aside.sidebar.visible { transform: translateX(0); }
  .sidebar nav { flex-direction: column !important; flex-wrap: nowrap !important; padding: 0 !important; }
  .sidebar nav a { padding: 10px 16px !important; }
  .sidebar .footer { position: static !important; margin-top: 18px; padding: 14px 16px; }

  .who-hamburger { display: flex; }

  main.content {
    padding: 64px 14px 28px !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
  .page-header { padding: 0 !important; }
  .page-header h1 { font-size: 22px !important; line-height: 1.25; }
  .page-header .lead { font-size: 13px !important; }
  .page-header .eyebrow { font-size: 10px !important; }

  /* Grids: collapse to single column */
  .row, .kpi-row, .charts-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
    width: 100%;
  }

  /* Stat KPI grids that use 2/3/4-column rules */
  [class*="kpi"] { min-width: 0 !important; overflow: hidden !important; }
  .kpi .value, .kpi-value { font-size: 18px !important; word-break: break-word !important; line-height: 1.2 !important; }
  .kpi .label, .kpi-label { font-size: 10px !important; }

  /* Cards: prevent overflow */
  .card { padding: 14px !important; max-width: 100% !important; overflow: hidden !important; }
  .card h2, .card h3 { font-size: 14px !important; }
  .card .sub { font-size: 11px !important; }

  /* Tables: scroll horizontally inside card */
  .card table, .data-table, .tbl { display: block; overflow-x: auto; max-width: 100%; }
  table th, table td { padding: 8px 10px !important; font-size: 12px !important; white-space: normal !important; }

  /* SVG charts and any chart-svg helpers */
  svg, .chart-svg, .chart, .svg-chart { max-width: 100% !important; height: auto !important; }

  /* Disposition matrix and heatmap layouts */
  .disposition-matrix, .heatmap-grid { width: 100% !important; max-width: 100vw !important; overflow-x: auto; }
}

/* Tighter for small phones */
@media (max-width: 380px) {
  main.content { padding: 60px 10px 20px !important; }
  .kpi .value, .kpi-value { font-size: 22px !important; }
  .page-header h1 { font-size: 20px !important; }
}

/* ============================================================
 * Mobile responsive — Phase 2 (≤900px).
 * Targeted overrides for elements that escaped the earlier rules.
 * ============================================================ */
@media (max-width: 900px) {
  /* Stack card-header title + meta vertically (was flex-row, meta fell off the right) */
  .card-header { flex-direction: column !important; align-items: flex-start !important; gap: 4px !important; }
  .card-header .meta { font-size: 11px !important; line-height: 1.4 !important; }

  /* Stage ribbon: scroll horizontally instead of forcing all 5 stages into 412px */
  .stage-ribbon { display: flex !important; flex-wrap: nowrap !important; overflow-x: auto !important; gap: 6px !important; padding: 4px 2px 12px !important; }
  .stage-ribbon .stage { flex: 0 0 auto !important; min-width: 140px !important; }

  /* Disposition phased-implementation roadmap: 3-col → 1-col */
  .roadmap { display: grid !important; grid-template-columns: 1fr !important; gap: 12px !important; }
  .roadmap .phase { width: 100% !important; max-width: 100% !important; }

  /* Charts grid: collapse on mobile (some pages override it) */
  .charts-grid { grid-template-columns: 1fr !important; gap: 12px !important; }

  /* All SVG charts inside cards: lock to 100% width */
  .card svg, .card .chart-svg { max-width: 100% !important; height: auto !important; }

  /* Risk list: stack risk-item rows vertically on mobile */
  .risk-list .risk-item { flex-wrap: wrap !important; gap: 8px !important; }

  /* Inventory table inside cards already covered by `.card table` rule */

  /* Page header h1: tighter font + wrap */
  .page-header h1 { font-size: 22px !important; word-wrap: break-word !important; }
  .page-header .lead { font-size: 13px !important; }
}
