/* ═══════════════════════════════════════════════════════════
   Edge WHS Overview Dashboard — CSS
   Viewport: 1800 × 1012 (16:9)
   Design: Editorial-corporate, IBM Plex type family
   ═══════════════════════════════════════════════════════════ */

:root {
  /* Layout */
  --dash-w: 1800px;
  --dash-h: 1012px;
  --header-h: 52px;
  --filter-h: 58px;
  --kpi-h: 148px;
  --footer-h: 30px;

  /* Surfaces */
  --bg: #F5F4EE;
  --surface: #FFFFFF;
  --surface-2: #FAF9F4;

  /* Ink */
  --ink-1: #1A1A1A;
  --ink-2: #4A4945;
  --ink-3: #8A8881;
  --ink-4: #BFBDB4;

  /* Rules */
  --rule: #E5E3DA;
  --rule-strong: #D0CDC1;

  /* Semantic colours */
  --c-blue: #2A5BA8;
  --c-blue-bg: #E8EEF7;
  --c-amber: #B8761A;
  --c-amber-bg: #F7EDD8;
  --c-red: #A8332E;
  --c-red-bg: #F5DEDD;
  --c-green: #3D6B1F;
  --c-green-bg: #E5EFD9;
  --c-teal: #1F6B5E;
  --c-teal-bg: #DCEBE7;
}

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

html, body {
  background: #2C2A24;
  font-family: 'IBM Plex Sans', sans-serif;
  color: var(--ink-1);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: 100%;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Canvas ─── */
.canvas {
  width: var(--dash-w);
  height: var(--dash-h);
  background: var(--bg);
  display: grid;
  grid-template-rows: var(--header-h) var(--filter-h) var(--kpi-h) 28px 1fr var(--footer-h);
  position: relative;
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(0,0,0,0.4);
}

/* ─── Login overlay ─── */
.login-overlay {
  position: absolute;
  inset: 0;
  background: var(--ink-1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 100;
  color: #fff;
}
.login-overlay h2 { font-family: 'IBM Plex Serif', serif; font-size: 24px; font-weight: 500; }
.login-overlay p { color: var(--ink-4); font-size: 14px; margin-bottom: 8px; }
.login-overlay .dot { display: inline-block; width: 8px; height: 8px; background: var(--c-red); border-radius: 50%; margin-right: 8px; }
.login-btn { padding: 12px 32px; background: var(--surface); color: var(--ink-1); border: none; border-radius: 3px; font-size: 14px; font-weight: 500; cursor: pointer; font-family: inherit; }
.login-btn:hover { background: var(--surface-2); }

/* ─── Header ─── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}
.header-left { display: flex; align-items: baseline; gap: 20px; }
.brand {
  font-family: 'IBM Plex Serif', serif;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.brand img {
  height: 30px;
  vertical-align: middle;
  margin-right: 10px;
}
.crumb {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.header-right { display: flex; align-items: center; gap: 16px; font-size: 12px; color: var(--ink-2); }
.header-right .pill-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--c-green-bg);
  color: var(--c-green);
  border-radius: 3px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--ink-1);
  color: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
}

/* ─── Filter bar ─── */
.filterbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
}
.filter-group { display: flex; align-items: center; gap: 0; }
.filter-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: 12px;
}
.filter-chain {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 2px;
}
.filter-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  color: var(--ink-1);
  border-radius: 2px;
}
.filter-pill:hover { background: var(--surface); }
.label-mini {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.filter-sep { color: var(--ink-4); font-size: 11px; padding: 0 2px; }
.filter-select-scope {
  border: none;
  background: transparent;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-1);
  padding: 6px 20px 6px 4px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%238A8881' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  border-radius: 2px;
}
.filter-select-scope:hover { background-color: var(--surface); }
.filter-select-scope:focus { outline: none; background-color: var(--surface); }

.period-block { display: flex; align-items: center; gap: 14px; }
.period-toggle {
  display: flex;
  background: var(--ink-1);
  border-radius: 3px;
  padding: 2px;
}
.period-toggle button {
  background: transparent;
  border: none;
  color: var(--ink-4);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 2px;
}
.period-toggle button.active {
  background: var(--surface);
  color: var(--ink-1);
}
.quarter-pills { display: flex; gap: 3px; }
.quarter-pill {
  background: var(--surface);
  border: 1px solid var(--rule);
  color: var(--ink-2);
  padding: 5px 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  border-radius: 3px;
}
.quarter-pill.active {
  background: var(--ink-1);
  color: var(--surface);
  border-color: var(--ink-1);
}
.quarter-pill:hover:not(.active) { border-color: var(--rule-strong); }

/* ─── KPI strip ─── */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
}
.kpi {
  background: var(--surface);
  padding: 16px 20px 14px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: background 0.15s;
  border-right: 1px solid var(--rule);
}
.kpi:last-child { border-right: none; }
.kpi:hover { background: var(--surface-2); }
.kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.kpi-name {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: relative;
  cursor: help;
}
.kpi-name[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--ink-1);
  color: var(--surface);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 11px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  padding: 6px 10px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
}
.kpi-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  padding: 2px 5px;
  border-radius: 2px;
  letter-spacing: 0.05em;
}
.tag-lag { background: var(--c-blue-bg); color: var(--c-blue); }
.tag-act { background: var(--c-amber-bg); color: var(--c-amber); }
.tag-lead { background: var(--c-teal-bg); color: var(--c-teal); }

.kpi-body {
  display: flex;
  gap: 12px;
  align-items: end;
  flex: 1;
}
.kpi-body > div:not(.kpi-divider) { flex: 1; }
.kpi-divider { width: 1px; min-width: 1px; max-width: 1px; background: var(--rule); height: 50px; align-self: center; flex: 0 0 1px; }
.kpi-col-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}
.kpi-value {
  font-family: 'IBM Plex Serif', serif;
  font-size: 32px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink-1);
}
.kpi-delta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.delta-up { color: var(--c-red); }
.delta-down { color: var(--c-green); }
.delta-flat { color: var(--ink-3); }

/* ─── Summary bar ─── */
.summary-bar {
  display: flex;
  align-items: center;
  padding: 0 28px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--rule);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--ink-3);
  gap: 24px;
  letter-spacing: 0.02em;
}
.summary-bar strong {
  color: var(--ink-2);
  font-weight: 500;
}

/* ─── Body — three columns ─── */
.body {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr;
  gap: 0;
  background: var(--surface);
  overflow: hidden;
  min-height: 0;
}
.panel {
  background: var(--surface);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  border-right: 1px solid var(--rule);
}
.panel:last-child { border-right: none; }
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* ─── Flag icons ─── */
.flag-icon {
  display: inline-block;
  width: 18px;
  height: 13px;
  vertical-align: middle;
  margin-right: 4px;
  border-radius: 1px;
  box-shadow: 0 0 0 0.5px rgba(0,0,0,0.1);
}
.panel-title {
  font-family: 'IBM Plex Serif', serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.panel-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.panel-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--ink-3);
}

/* ─── Footer ─── */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--surface);
  border-top: 1px solid var(--rule);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--ink-3);
  position: relative;
}
.footer-status { display: flex; gap: 20px; }
.footer-status i { font-size: 12px; margin-right: 4px; }

/* ─── Loading state ─── */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: var(--ink-3);
  font-size: 13px;
  height: 100%;
}
.spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--rule);
  border-top-color: var(--ink-2);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Placeholder content ─── */
.placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-4);
  font-size: 12px;
  font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ═══ ISSUES MODAL ═══════════════════════════════════════════════════════════ */
.im-scrim {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 800;
}
.im-scrim.open { opacity: 1; pointer-events: auto; }

.im-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: 1400px;
  max-width: 90vw;
  height: 720px;
  max-height: 85vh;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.25);
  z-index: 850;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.im-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

/* ─── Modal header ─── */
.im-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 32px 16px;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}
.im-title {
  font-family: 'IBM Plex Serif', serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.im-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}
.im-close {
  border: none;
  background: transparent;
  font-size: 18px;
  color: var(--ink-3);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 3px;
  line-height: 1;
}
.im-close:hover { background: var(--surface-2); color: var(--ink-1); }

/* ─── Modal filters ─── */
.im-filters {
  padding: 12px 32px;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}
.im-filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.im-select {
  border: 1px solid var(--rule);
  background: var(--surface-2);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12px;
  color: var(--ink-1);
  padding: 6px 28px 6px 10px;
  border-radius: 3px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%238A8881' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.im-select:focus { outline: none; border-color: var(--rule-strong); }
.im-toggle {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 2px;
}
.im-toggle button {
  background: transparent;
  border: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  padding: 5px 12px;
  cursor: pointer;
  border-radius: 2px;
}
.im-toggle button.active {
  background: var(--surface);
  color: var(--ink-1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* ─── Modal table ─── */
.im-table-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 32px;
}
.im-table-header {
  display: flex;
  align-items: center;
  padding: 10px 0 8px;
  border-bottom: 2px solid var(--rule);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
.im-th {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  padding: 0 6px;
  white-space: nowrap;
  user-select: none;
}
.im-th:hover { color: var(--ink-1); }
.im-table-body { padding-bottom: 16px; }

.im-row {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.12s;
}
.im-row:hover { background: var(--surface-2); }
.im-cell {
  font-size: 12px;
  color: var(--ink-2);
  padding: 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.im-cell-desc {
  color: var(--ink-3);
  font-size: 11px;
}
.im-ref {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-1);
}
.im-overdue {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  color: var(--c-red);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-left: 4px;
}
.im-empty {
  text-align: center;
  padding: 40px 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 2px; }

/* ═══════════════════════════════════════════════════════════
   PHASE 2 — Panels, Lists, Breakdown, Slide-out
   ═══════════════════════════════════════════════════════════ */

/* ─── Shared panel elements ─── */
.panel-divider {
  border-top: 1px solid var(--rule);
  margin: 4px 0;
}

/* ─── KPI breakdown rows ─── */
.bd-header {
  display: flex;
  justify-content: flex-end;
  gap: 24px;
  padding-bottom: 6px;
  margin-bottom: 2px;
  border-bottom: 2px solid var(--rule);
}
.bd-header .bd-v {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  min-width: 54px;
  text-align: right;
}
.bd-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 12px;
}
.bd-label { color: var(--ink-2); }
.bd-vals { display: flex; gap: 16px; }
.bd-v {
  min-width: 50px;
  text-align: right;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 500;
  font-size: 11px;
}
.bd-v-td { color: var(--ink-1); }
.bd-v-ytd { color: var(--ink-2); }
.bd-v-q { color: var(--ink-3); }
.bd-row.bd-alert .bd-v { color: var(--c-red); }

/* ─── Clickable KPI rows ─── */
.bd-row.bd-clickable {
  cursor: pointer;
  margin: 0 -6px;
  padding: 6px;
  border-radius: 3px;
}
.bd-row.bd-clickable:hover { background: var(--surface-2); }
.bd-row.bd-clickable .bd-label { text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 2px; }

/* ─── List rows (incidents, audits) ─── */
.list-scroll {
  overflow-y: auto;
  overflow-x: hidden;
}
.list-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
}
.list-row.clickable {
  cursor: pointer;
  padding: 8px 6px;
  margin: 0 -6px;
  border-radius: 3px;
}
.list-row.clickable:hover {
  background: var(--surface-2);
}
.list-row-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}
.list-ref {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
}
.list-desc {
  font-size: 12px;
  color: var(--ink-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-row-meta {
  display: flex;
  justify-content: space-between;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--ink-3);
}
.list-row-meta .meta-alert { color: var(--c-red); font-weight: 500; }
.list-empty {
  text-align: center;
  color: var(--ink-4);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 24px 0;
}

/* ─── Status tiles (audit actions) ─── */
.status-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.status-tile {
  padding: 12px 10px;
  border-radius: 4px;
  text-align: center;
}
.tile-count {
  font-family: 'IBM Plex Serif', serif;
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  margin-bottom: 4px;
}
.tile-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tile-overdue { background: var(--c-red-bg); color: var(--c-red); }
.tile-overdue .tile-count { color: var(--c-red); }
.tile-progress { background: var(--c-amber-bg); color: var(--c-amber); }
.tile-progress .tile-count { color: var(--c-amber); }
.tile-new { background: var(--c-blue-bg); color: var(--c-blue); }
.tile-new .tile-count { color: var(--c-blue); }
.tile-closed { background: var(--c-green-bg); color: var(--c-green); }
.tile-closed .tile-count { color: var(--c-green); }

/* ─── Audit visual: donut + compact tiles ─── */
.audit-visual {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.donut-wrap {
  position: relative;
  flex-shrink: 0;
}
.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.donut-total {
  font-family: 'IBM Plex Serif', serif;
  font-size: 24px;
  font-weight: 500;
  color: var(--ink-1);
  line-height: 1;
}
.donut-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}
.donut-empty {
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-2);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--ink-4);
  flex-shrink: 0;
}
.status-tiles-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.status-tile-sm {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 3px;
}
.tile-sm-count {
  font-family: 'IBM Plex Serif', serif;
  font-size: 16px;
  font-weight: 500;
  min-width: 24px;
}
.tile-sm-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ─── Trend chart ─── */
.chart-container {
  margin: 4px 0 8px;
}
.chart-legend {
  display: flex;
  gap: 14px;
  margin-bottom: 6px;
}
.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ─── Breakdown tabs ─── */
.bd-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 12px;
  background: var(--surface-2);
  border-radius: 3px;
  padding: 2px;
}
.bd-tab {
  flex: 1;
  border: none;
  background: transparent;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  padding: 6px 0;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s;
}
.bd-tab:hover { color: var(--ink-1); }
.bd-tab.active {
  background: var(--surface);
  color: var(--ink-1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* ─── Breakdown table ─── */
.bd-table-header {
  display: flex;
  align-items: center;
  padding: 0 0 6px;
  border-bottom: 2px solid var(--rule);
  margin-bottom: 2px;
}
.bd-table-header .bd-table-name,
.bd-table-header .bd-table-cell {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.bd-table-row {
  display: flex;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 12px;
}
.bd-table-row.clickable {
  cursor: pointer;
  padding: 7px 6px;
  margin: 0 -6px;
  border-radius: 3px;
}
.bd-table-row.clickable:hover { background: var(--surface-2); }
.bd-table-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-1);
}
.bd-table-cell {
  width: 60px;
  text-align: right;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 500;
  font-size: 11px;
  color: var(--ink-2);
  flex-shrink: 0;
}

/* ═══ SLIDE-OUT PANEL ════════════════════════════════════════════════════════ */
.slideout-scrim {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 900;
}
.slideout-scrim.open {
  opacity: 1;
  pointer-events: auto;
}

.slideout {
  position: fixed;
  top: 0;
  right: 0;
  width: 520px;
  height: 100vh;
  background: var(--surface);
  box-shadow: -8px 0 30px rgba(0,0,0,0.15);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
  z-index: 950;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.slideout.open {
  transform: translateX(0);
}

/* ─── Slide-out header ─── */
.so-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}
.so-crumb {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.so-title {
  font-family: 'IBM Plex Serif', serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink-1);
}
.so-close {
  border: none;
  background: transparent;
  font-size: 18px;
  color: var(--ink-3);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 3px;
  line-height: 1;
}
.so-close:hover { background: var(--surface-2); color: var(--ink-1); }

/* ─── Slide-out body ─── */
.so-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px 28px;
}

/* ─── Metadata grid ─── */
.so-meta-grid {
  margin-bottom: 20px;
}
.so-meta-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 12px;
}
.so-meta-label {
  color: var(--ink-3);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.so-meta-value {
  color: var(--ink-1);
  text-align: right;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Sections ─── */
.so-section-head {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
}
.so-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
}
.so-empty {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--ink-4);
  text-align: center;
  padding: 20px 0;
}

/* ─── Entity KPI cards ─── */
.so-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}
.so-kpi-card {
  background: var(--surface-2);
  border-radius: 4px;
  padding: 12px 10px;
  text-align: center;
}
.so-kpi-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.so-kpi-val {
  font-family: 'IBM Plex Serif', serif;
  font-size: 20px;
  font-weight: 500;
  color: var(--ink-1);
}

/* ─── Tags ─── */
.so-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.so-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  padding: 3px 8px;
  background: var(--surface-2);
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--ink-2);
}

/* ─── Project list (entity slide-out) ─── */
.so-project-list {
  display: flex;
  flex-direction: column;
}
.so-project-row {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
}
.so-project-name {
  font-size: 13px;
  color: var(--ink-1);
  font-weight: 500;
}
.so-project-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--ink-3);
  margin-top: 2px;
}

/* ─── Incident list (KPI drill slide-out) ─── */
.so-incident-list {
  display: flex;
  flex-direction: column;
}
.so-incident-row {
  padding: 10px 8px;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  margin: 0 -8px;
  border-radius: 3px;
  transition: background 0.15s;
}
.so-incident-row:hover { background: var(--surface-2); }
.so-inc-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}
.so-inc-ref {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-1);
}
.so-inc-date {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--ink-3);
}
.so-inc-desc {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.4;
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.so-inc-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--ink-3);
}

/* ─── Report links (audit slide-out) ─── */
.so-report-links {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.so-report-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 4px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  border: 1px solid var(--rule);
}
.so-btn-sp {
  background: var(--surface-2);
  color: var(--ink-1);
}
.so-btn-sp:hover { background: var(--bg); border-color: var(--rule-strong); }
.so-btn-dl {
  background: var(--c-blue-bg);
  color: var(--c-blue);
  border-color: transparent;
}
.so-btn-dl:hover { background: #d5dfee; }
.so-btn-dl:disabled { opacity: 0.6; cursor: wait; }
.so-btn-icon { font-size: 14px; }
.so-report-none {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--ink-4);
  padding: 8px 0;
}

/* ─── Follow-ups (incident) ─── */
.so-followups { display: flex; flex-direction: column; gap: 8px; }
.so-followup {
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 4px;
  border-left: 3px solid var(--rule-strong);
}
.so-fu-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.so-fu-desc { font-size: 12px; color: var(--ink-1); }
.so-fu-due { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--ink-3); }
.so-fu-meta { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--ink-3); display: flex; gap: 12px; }
.so-fu-outcome { color: var(--c-green); }

/* ─── Audit actions (in slideout) ─── */
.so-actions { display: flex; flex-direction: column; gap: 6px; }
.so-action {
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 4px;
  border-left: 3px solid var(--rule-strong);
  cursor: pointer;
  transition: background 0.15s;
}
.so-action:hover { background: var(--bg); }
.so-act-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.so-act-ref { font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 500; color: var(--ink-2); }
.so-act-desc { font-size: 12px; color: var(--ink-1); line-height: 1.4; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.so-act-meta { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--ink-3); display: flex; gap: 10px; flex-wrap: wrap; }

/* ─── Status & Priority badges ─── */
.so-act-status, .st-open, .st-closed {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.st-open { background: var(--c-amber-bg); color: var(--c-amber); }
.st-closed { background: var(--c-green-bg); color: var(--c-green); }

.so-act-pri, .pri-urgent, .pri-high, .pri-medium, .pri-low {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 2px;
}
.pri-urgent { background: var(--c-red-bg); color: var(--c-red); }
.pri-high { background: var(--c-amber-bg); color: var(--c-amber); }
.pri-medium { background: var(--c-blue-bg); color: var(--c-blue); }
.pri-low { background: var(--surface-2); color: var(--ink-3); }


/* ─── Audit status table (To Date / YTD / Q) ─── */
.audit-status-table {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.ast-header, .ast-row {
  display: grid;
  grid-template-columns: 70px 1fr 1fr 1fr;
  align-items: center;
  gap: 4px;
}
.ast-header {
  padding-bottom: 6px;
  border-bottom: 2px solid var(--rule);
  margin-bottom: 2px;
}
.ast-col-head {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: right;
}
.ast-row {
  padding: 7px 0;
  border-bottom: 1px solid var(--rule);
}
.ast-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}
.ast-val {
  font-family: 'IBM Plex Serif', serif;
  font-size: 16px;
  font-weight: 500;
  text-align: right;
}
.ast-overdue .ast-label { color: var(--c-red); }
.ast-overdue .ast-val { color: var(--c-red); }
.ast-open .ast-label { color: var(--c-amber); }
.ast-open .ast-val { color: var(--c-amber); }
.ast-closed .ast-label { color: var(--c-green); }
.ast-closed .ast-val { color: var(--c-green); }
