/* LTI Command Center — tokens from letstalkinteractive.com and the Justice Health Atlas. */
:root {
  color-scheme: light;
  --paper: #ffffff;
  --surface: #ffffff;
  --sunk: #f1f6f8;
  --ink: #0f2129;
  --muted: #56707c;
  --line: #dce7eb;
  --teal: #1494bc;
  --teal-ink: #0d7699;
  --navy: #0e5a8a;
  --save: #16875a;
  --save-bg: #e3f4ec;
  --cost: #b8432e;
  --warn: #c47f12;
  --warn-bg: #fbf4e8;
  --info: #0e5a8a;
  --shadow: 0 1px 2px rgba(11, 59, 82, 0.06), 0 8px 24px -12px rgba(11, 59, 82, 0.18);
  --display: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --lti-primary: var(--teal);
  --lti-primary-dark: var(--teal-ink);
  --lti-primary-light: #e3f5fa;
  --lti-background: #f4f8fa;
  --lti-surface: var(--surface);
  --lti-text: var(--ink);
  --lti-text-muted: var(--muted);
  --lti-border: var(--line);
  --status-success: var(--save);
  --status-warning: var(--warn);
  --status-danger: var(--cost);
  --status-info: var(--info);
  --shadow-card: var(--shadow);
  --radius-card: 12px;
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body {
  margin: 0;
  min-width: 360px;
  background: var(--lti-background);
  color: var(--ink);
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.5;
}
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid #e0a526; outline-offset: 2px; }

.app-shell { min-height: 100vh; }

/* Sidebar */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  width: 256px;
  padding: 18px 14px 14px;
  background: #0b1c24;
  border-right: 0;
  transition: transform 0.24s ease;
}
.brand-block { padding: 0 8px 14px; }
.wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.01em;
  line-height: 1.15;
  color: #fff;
}
.wordmark span {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  letter-spacing: 0.16em;
  font-weight: 700;
  color: #7dd3ec;
}
.brand-subtitle {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8aa4b0;
}
.workspace-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  text-align: left;
  color: #fff;
}
.workspace-switch:hover { border-color: var(--teal); }
.workspace-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-family: var(--display);
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.02em;
}
.workspace-copy { display: grid; gap: 2px; min-width: 0; flex: 1; }
.workspace-copy strong { font-family: var(--display); font-size: 12.5px; font-weight: 800; color: #fff; }
.workspace-copy small { color: #8aa4b0; font-size: 11px; }
.chevron { color: #8aa4b0; font-size: 16px; }

.nav-groups { overflow-y: auto; flex: 1; margin: 14px 0 8px; padding: 0 4px; scrollbar-width: thin; }
.nav-group { margin: 0 0 14px; }
.nav-heading {
  padding: 0 10px 8px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7d96a2;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  margin: 1px 0;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #c5d4db;
  text-align: left;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-item.active {
  background: var(--teal);
  color: #fff;
  font-weight: 600;
}
.nav-icon { width: 16px; color: #8aa4b0; text-align: center; font-size: 14px; }
.nav-item.active .nav-icon { color: #fff; }

.sidebar-bottom { padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.secure-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 8px 12px;
  color: #8aa4b0;
  font-size: 11.5px;
  line-height: 1.45;
}
.secure-icon { color: #7dd3ec; font-size: 16px; }
.secure-note small { color: #7d96a2; font-size: 10.5px; }
.profile-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 8px 4px;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  text-align: left;
  color: #fff;
}
.avatar, .top-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 800;
}
.profile-button span:nth-child(2) { display: grid; gap: 2px; flex: 1; }
.profile-button strong { font-size: 12.5px; font-weight: 700; color: #fff; }
.profile-button small { color: #8aa4b0; font-size: 11px; }
.more { color: #8aa4b0; letter-spacing: 2px; }

/* Main */
.main-area { min-height: 100vh; margin-left: 256px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
}
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12.5px;
}
.breadcrumbs b { color: #b7c5cb; font-weight: 400; }
.breadcrumbs strong {
  color: var(--ink);
  font-family: var(--display);
  font-weight: 700;
}
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.icon-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}
.icon-button:hover { background: var(--sunk); }
.notification i {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cost);
}
.top-avatar { width: 30px; height: 30px; }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 20px; }

.page-content { max-width: 1440px; margin: 0 auto; padding: 24px 32px 28px; }
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.eyebrow {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.eyebrow span { padding: 0 6px; color: #9aadb4; }
h1 {
  margin: 8px 0 6px;
  font-family: var(--display);
  font-size: clamp(24px, 2.8vw, 32px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 800;
}
#pageDescription { margin: 0; color: var(--muted); font-size: 14.5px; max-width: 62ch; }
.report-help {
  margin-top: 8px;
  max-width: 72ch;
}
.report-help-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8a9aa3;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.report-help-toggle::before {
  content: "+";
  display: inline-block;
  width: 1em;
  color: #a8b5bc;
  font-weight: 700;
}
.report-help-toggle[aria-expanded="true"] {
  color: var(--muted);
}
.report-help-toggle[aria-expanded="true"]::before { content: "-"; }
.report-help-toggle:hover { color: var(--ink); }
.report-help-body {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 28, 36, 0.02);
}
.report-help-summary {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.45;
}
.report-help-defs {
  display: grid;
  gap: 8px;
  margin: 0;
}
.report-help-defs div {
  display: grid;
  gap: 2px;
}
.report-help-defs dt {
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
}
.report-help-defs dd {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}
.report-help-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.report-help-note strong { color: var(--ink); font-weight: 600; }
.heading-meta { display: flex; align-items: center; gap: 16px; padding-bottom: 2px; }
.updated { color: var(--muted); font-size: 12px; }
.updated i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--save);
}
.export-button {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--teal);
  color: #fff;
  font-family: var(--display);
  font-size: 12.5px;
  font-weight: 700;
}
.export-button:hover { filter: brightness(1.08); }
.export-button span { color: #fff; font-size: 14px; }

.filter-stack {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  min-height: 62px;
  padding: 10px 14px;
}
.filter-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 12px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 12.5px;
  font-weight: 700;
}
.filter-symbol { color: var(--teal); font-size: 14px; }
.filter-divider { width: 1px; height: 30px; margin-left: 4px; background: var(--line); }
.filter-control {
  display: grid;
  flex: 1;
  gap: 5px;
  min-width: 130px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.filter-control select,
.filter-control input[type="date"],
.filter-control input[type="search"] {
  width: 100%;
  padding: 6px 4px 2px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--body);
  font-size: 13.5px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}
.filter-control input[type="search"] {
  cursor: text;
}
.filter-control input[type="search"]::-webkit-search-cancel-button {
  cursor: pointer;
}
.org-filter-control { flex: 1.35; min-width: 180px; max-width: 300px; }
.search-select { position: relative; }
.search-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: 260px;
  margin: 0;
  padding: 6px 0;
  overflow: auto;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(20, 28, 36, 0.12);
}
.search-select-menu[hidden] { display: none; }
.search-select-menu li {
  padding: 8px 12px;
  color: var(--ink);
  font-family: var(--body);
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}
.search-select-menu li small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}
.search-select-menu li[aria-selected="true"],
.search-select-menu li:hover {
  background: rgba(20, 28, 36, 0.05);
}
.search-select-menu li.muted {
  color: var(--muted);
  cursor: default;
}
.date-input-control { flex: 0 0 132px; min-width: 120px; }
.date-coverage {
  padding: 8px 14px 12px;
  border-top: 1px solid var(--line);
}
.date-coverage-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}
.date-coverage-meta strong { color: var(--ink); font-size: 12.5px; }
.date-coverage-meta .gap-hint { color: var(--cost); font-weight: 600; }
.date-coverage-stats { margin-left: auto; font-family: var(--mono); font-size: 11px; letter-spacing: 0.02em; }
.date-rail { position: relative; padding: 2px 2px 18px; }
.date-rail-bars {
  display: flex;
  height: 10px;
  overflow: hidden;
  border-radius: 6px;
  background: #eef3f5;
}
.date-rail-bars i { flex: 1 1 0; min-width: 1px; }
.date-rail-bars i.on { background: var(--teal); }
.date-rail-bars i.gap {
  background: repeating-linear-gradient(-45deg, #f6e6d8, #f6e6d8 3px, #fbf4e8 3px, #fbf4e8 6px);
}
.date-rail-window {
  position: absolute;
  top: 2px;
  height: 10px;
  border: 2px solid var(--navy);
  border-radius: 6px;
  box-sizing: content-box;
  pointer-events: none;
}
.date-rail input[type="range"] {
  position: absolute;
  left: 0;
  width: 100%;
  top: 16px;
  height: 16px;
  margin: 0;
  background: none;
  pointer-events: none;
  appearance: none;
}
.date-rail input[type="range"]::-webkit-slider-thumb {
  pointer-events: auto;
  appearance: none;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 1px var(--navy);
  cursor: grab;
}
.date-rail input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 1px var(--navy);
  cursor: grab;
}
.date-rail-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.advanced-filter {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--sunk);
  color: var(--ink);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.advanced-filter span { color: var(--teal); font-size: 14px; vertical-align: -1px; }
.advanced-panel {
  display: flex;
  gap: 20px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: var(--sunk);
}
.advanced-panel[hidden] { display: none; }
.advanced-panel .filter-control { max-width: 220px; }
.context-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 38px;
  color: var(--muted);
  font-size: 12px;
}
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chip {
  padding: 3px 9px;
  border-radius: 999px;
  background: #e3f5fa;
  color: var(--teal-ink);
  font-size: 11.5px;
  font-weight: 600;
}
.period-note { display: flex; align-items: center; gap: 8px; }
.period-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }

/* KPI / cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 4px 0 14px;
}
.kpi-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 118px;
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--paper);
  box-shadow: var(--shadow);
  text-align: left;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--teal);
  box-shadow: 0 8px 28px -10px rgba(14, 90, 138, 0.22);
}
.kpi-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.kpi-info {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: 11px;
}
.kpi-mid {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0 8px;
}
.kpi-value {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(22px, 2vw, 26px);
  letter-spacing: -0.02em;
  line-height: 1;
  font-weight: 800;
}
.kpi-foot { display: flex; align-items: center; gap: 6px; margin-top: auto; color: var(--muted); font-size: 11.5px; }
.kpi-change { color: var(--save); font-family: var(--mono); font-size: 11.5px; font-weight: 500; }
.kpi-change.down { color: var(--cost); }
.sparkline {
  display: block;
  width: 72px;
  height: 28px;
  flex: 0 0 72px;
  overflow: visible;
  opacity: 0.9;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px 6px;
}
.panel-title {
  margin: 0;
  font-family: var(--display);
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.panel-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.panel-link {
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: var(--teal-ink);
  font-family: var(--display);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}
.panel-link:hover { text-decoration: underline; text-underline-offset: 2px; }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(256px, 1fr); gap: 14px; }
.trend-panel { min-height: 280px; }
.trend-controls { display: flex; align-items: center; gap: 8px; }
.trend-select {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
}
.segmented {
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--sunk);
}
.segmented button {
  padding: 5px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}
.segmented button.active {
  background: var(--teal);
  color: #fff;
}
.chart-wrap { position: relative; height: 220px; padding: 4px 12px 4px; overflow: visible; }
.chart-wrap svg { width: 100%; height: 100%; overflow: visible; display: block; }
.chart-gridline { stroke: var(--line); stroke-width: 1; }
.chart-label { fill: var(--muted); font-family: var(--mono); font-size: 11px; }
.chart-area { fill: url(#areaFill); }
.chart-line { fill: none; stroke: var(--teal); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chart-point { fill: #fff; stroke: var(--teal); stroke-width: 2; }
.chart-tooltip {
  position: absolute;
  display: none;
  z-index: 2;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 11.5px;
  pointer-events: none;
  box-shadow: var(--shadow);
}
.chart-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px 12px;
  color: var(--muted);
  font-size: 12px;
}
.legend-line { width: 16px; height: 3px; background: var(--teal); border-radius: 2px; }

.side-stack { display: grid; grid-template-rows: 1fr 1fr; gap: 14px; }
.signal-panel, .action-panel { min-height: 132px; }
.signal-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 16px 12px; }
.signal-mark {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 14px;
}
.signal-mark.info { background: #e3f5fa; color: var(--teal-ink); }
.signal-copy { flex: 1; }
.signal-copy strong { display: block; margin: 1px 0 4px; font-size: 13.5px; font-weight: 700; }
.signal-copy p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.signal-copy button {
  display: block;
  margin: 8px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--teal-ink);
  font-family: var(--display);
  font-size: 12.5px;
  font-weight: 700;
}

.portfolio-panel { margin-top: 14px; }
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  padding: 10px 16px 16px;
}
.product-card {
  position: relative;
  min-height: 116px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--sunk);
  cursor: pointer;
  transition: border 0.15s, background 0.15s;
}
.product-card:hover { border-color: var(--teal); background: #e3f5fa; }
.product-top { display: flex; gap: 10px; align-items: center; }
.product-symbol {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 800;
}
.product-name { font-family: var(--display); font-size: 13.5px; font-weight: 800; }
.product-type { margin-top: 3px; color: var(--muted); font-size: 11.5px; }
.product-stat { display: flex; justify-content: space-between; align-items: end; margin-top: 14px; }
.product-stat strong { font-family: var(--display); font-size: 19px; font-weight: 800; }
.product-stat span { color: var(--muted); font-size: 11.5px; }
.product-trend { position: absolute; right: 14px; top: 14px; color: var(--save); font-size: 12px; }

.lower-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 14px; margin-top: 14px; }
.table-panel, .activity-panel { min-height: 230px; }
.table-wrap { overflow-x: auto; padding: 4px 16px 14px; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th {
  padding: 8px 8px 7px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
td {
  padding: 10px 8px;
  border-bottom: 1px solid #eef3f5;
  color: #2a4049;
  font-size: 13px;
  white-space: nowrap;
}
tr:last-child td { border-bottom: 0; }
tbody tr[data-org], tbody tr[data-user] { cursor: pointer; }
tbody tr[data-org]:hover, tbody tr[data-user]:hover { background: var(--sunk); }
.org-cell { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; }
.org-logo {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #e3f5fa;
  color: var(--teal-ink);
  font-family: var(--display);
  font-size: 11px;
  font-weight: 800;
}
.health-pill, .status-pill {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--save-bg);
  color: var(--save);
  font-size: 11px;
  font-weight: 600;
}
.muted-cell { color: var(--muted); font-size: 12px; }
.health-pill.watch { background: var(--warn-bg); color: var(--warn); }
.health-pill.attention, .status-pill.inactive { background: #f8e8e5; color: var(--cost); }
.status-pill.muted { background: rgba(20, 28, 36, 0.06); color: var(--muted); }
.activity-list { padding: 2px 16px 12px; }
.activity-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 9px 0;
  border-bottom: 1px solid #eef3f5;
}
.activity-item:last-child { border-bottom: 0; }
.activity-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 7px;
  background: #e3f5fa;
  color: var(--teal-ink);
  font-size: 12px;
}
.activity-text { flex: 1; color: #2a4049; font-size: 13px; line-height: 1.45; }
.activity-text strong { color: var(--ink); font-weight: 700; }
.activity-time { color: var(--muted); font-family: var(--mono); font-size: 12px; white-space: nowrap; }

.section-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.section-grid .panel { min-width: 0; }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin: 18px 0 10px; }
.section-heading h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.table-card { margin-top: 14px; }
.table-card .table-wrap { padding-top: 8px; }
.full-table { min-height: 280px; }
.person-cell { display: flex; align-items: center; gap: 10px; }
.person-initial {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #e3f5fa;
  color: var(--teal-ink);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 800;
}
.person-cell strong { display: block; color: var(--ink); font-size: 13.5px; }
.person-cell small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.toolbar { display: flex; gap: 8px; align-items: center; }
.search-input {
  min-width: 200px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  font-size: 13px;
}
.search-input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(20, 148, 188, 0.15); }
.small-select {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 12.5px;
}
.table-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.pagination-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.page-size {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.page-size .small-select { min-width: 68px; }
.page-buttons { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.page-buttons button {
  min-width: 32px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
}
.page-buttons button:hover:not(:disabled) { border-color: var(--teal); color: var(--teal-ink); }
.page-buttons button:disabled { opacity: 0.45; cursor: default; }
.page-buttons button.active { border-color: var(--teal); background: #e3f5fa; color: var(--teal-ink); font-weight: 700; }
.page-ellipsis {
  min-width: 20px;
  text-align: center;
  color: var(--muted);
  user-select: none;
}

.action-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.action-summary { padding: 16px; }
.action-summary .count {
  margin: 12px 0 6px;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.action-summary p { margin: 0; color: var(--muted); font-size: 13px; }
.action-summary .etl-sync-plan { margin-top: 8px; color: var(--ink); font-size: 12.5px; font-weight: 600; }
.action-summary .etl-sync-blocked { margin-top: 6px; color: var(--cost); font-size: 12px; font-weight: 600; }
.action-summary .team-actions { justify-content: flex-start; }
.action-summary .kpi-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.etl-age {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  line-height: 1.2;
}
.etl-age-fresh {
  color: #0f6b4c;
  background: rgba(15, 107, 76, 0.12);
}
.etl-age-warm {
  color: #8a5a00;
  background: rgba(196, 140, 20, 0.14);
}
.etl-age-stale,
.etl-age-never {
  color: #9b2c2c;
  background: rgba(155, 44, 44, 0.12);
}
.action-list { display: grid; gap: 12px; margin-top: 14px; }
.action-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.action-entities {
  padding: 0 14px 12px;
  border-top: 1px solid var(--line);
  background: rgba(20, 28, 36, 0.015);
}
.action-entities .table-wrap { margin-top: 10px; }
.action-entities table { font-size: 13px; }
.action-entities th {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
}
.action-entities td:last-child { text-align: right; white-space: nowrap; }
.action-severity {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 8px;
  background: var(--warn-bg);
  color: var(--warn);
}
.action-severity.danger { background: #f8e8e5; color: var(--cost); }
.action-severity.info { background: #e3f5fa; color: var(--teal-ink); }
.action-details { flex: 1; }
.action-details strong { display: block; font-size: 14px; }
.action-details p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.action-category { color: var(--muted); font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em; }
.action-button {
  padding: 7px 11px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--teal);
  color: #fff;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
}

.two-column { display: grid; grid-template-columns: 1.4fr 0.9fr; gap: 14px; }
.metric-highlight { display: flex; align-items: center; gap: 14px; padding: 16px; }
.metric-highlight strong { font-family: var(--display); font-size: 24px; font-weight: 800; }
.metric-highlight span { display: block; margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.metric-highlight .metric-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #e3f5fa;
  color: var(--teal-ink);
  font-size: 20px;
}
.empty-state { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; margin-bottom: 6px; color: var(--ink); font-size: 15px; }
.empty-state p { margin: 0; font-size: 13px; }

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding: 14px 2px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.page-footer b { padding: 0 6px; color: #b7c5cb; font-weight: 400; }
.page-footer a { color: var(--teal-ink); text-decoration: none; }
.page-footer a:hover { text-decoration: underline; }
.toast {
  position: fixed;
  z-index: 40;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 14px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: none; }
.toast.toast-error {
  border-color: #e3b4ab;
  background: #fdf4f2;
  color: var(--cost);
  font-weight: 600;
}
.toast.toast-success {
  border-color: #b7d8c8;
  background: #f2faf6;
  color: #1f6b4a;
}
.overlay { display: none; }

@media (max-width: 1120px) {
  .page-content { padding: 20px 20px 20px; }
  .topbar { padding: 0 20px; }
  .sidebar { width: 228px; }
  .main-area { margin-left: 228px; }
  .compact-filter { display: none; }
  .overview-grid { grid-template-columns: minmax(0, 1.35fr) minmax(240px, 1fr); }
  .portfolio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 850px) {
  .sidebar { transform: translateX(-100%); width: 256px; box-shadow: 10px 0 30px rgba(15, 33, 41, 0.12); }
  .sidebar.open { transform: none; }
  .overlay.show { display: block; position: fixed; inset: 0; z-index: 9; background: rgba(15, 33, 41, 0.35); }
  .main-area { margin-left: 0; }
  .mobile-menu { display: block; }
  .topbar { justify-content: flex-start; gap: 12px; padding: 0 16px; }
  .topbar-actions { margin-left: auto; }
  .page-content { padding: 22px 16px 20px; }
  .overview-grid, .section-grid, .two-column, .lower-grid { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .action-cards { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading h1 { font-size: 24px; }
  .heading-meta { align-items: flex-start; }
  .updated { display: none; }
  .filter-bar { flex-wrap: wrap; }
  .filter-title { flex: 0 0 100%; padding: 0 0 8px; border-bottom: 1px solid var(--line); }
  .filter-divider { display: none; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: 1fr; }
  .page-footer { flex-direction: column; }
}

.profile-wrap { position: relative; }
.profile-menu {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: calc(100% + 8px);
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: #12313d;
  box-shadow: 0 12px 28px rgba(8, 18, 22, 0.35);
}
.profile-menu p {
  margin: 0 0 8px;
  color: #8aa4b0;
  font-size: 11.5px;
  word-break: break-all;
}
.profile-menu button, .profile-menu .profile-link {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  text-align: left;
  font-size: 12.5px;
}
.profile-menu button:hover, .profile-menu .profile-link:hover { background: rgba(255, 255, 255, 0.12); }

.team-form { display: grid; gap: 12px; padding: 0 17px 17px; }
.team-form label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.team-form input[type="text"], .team-form input[type="email"], .team-form input[type="password"] {
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.team-form input.is-invalid { border-color: var(--cost); box-shadow: 0 0 0 3px rgba(184, 67, 46, 0.12); }
.team-form .field-error { color: var(--cost); font-size: 11px; font-weight: 600; }
.team-form .form-error-banner {
  padding: 10px 12px;
  border: 1px solid #e3b4ab;
  border-radius: 8px;
  background: #fdf4f2;
  color: var(--cost);
  font-size: 13px;
  font-weight: 600;
}
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.role-grid label { display: flex; align-items: flex-start; gap: 8px; font-weight: 500; color: var(--ink); }
.role-grid small { display: block; color: var(--muted); font-size: 11px; }
.team-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.role-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.role-pills span {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--sunk);
  color: var(--muted);
  font-size: 11px;
}

.login-body {
  min-height: 100vh;
  margin: 0;
  background: #0f2129;
  color: #fff;
  font-family: var(--body);
}
.login-shell {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 420px);
  min-height: 100vh;
}
.login-brand {
  display: grid;
  align-content: center;
  padding: 48px;
  background: linear-gradient(160deg, #0f2129 0%, #13485a 100%);
}
.login-brand h1 {
  margin: 18px 0 10px;
  font-family: var(--display);
  font-size: 36px;
}
.login-brand p { max-width: 420px; color: #b7c5cb; line-height: 1.5; }
.login-card {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 40px 36px;
  background: #fff;
  color: var(--ink);
}
.login-card h2 { margin: 0; font-family: var(--display); font-size: 22px; }
.login-card p { margin: 0 0 8px; color: var(--muted); font-size: 13.5px; }
.login-card label { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.login-card input[type="email"], .login-card input[type="password"] {
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  color: var(--ink);
}
.login-remember { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.login-card button[type="submit"] {
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-family: var(--display);
  font-weight: 700;
}
.login-error {
  padding: 10px 12px;
  border-radius: 8px;
  background: #fdecea;
  color: var(--cost);
  font-size: 13px;
}
@media (max-width: 850px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: 220px; padding: 32px 24px; }
}
