/* Clarity · presentation-only layer for the existing HSRD dashboard.
   Keep source periods, permissions, loading state, chart axes and drilldowns intact. */
body.ui-v2 {
  --ui-bg: #f6f8fb;
  --ui-surface: #fff;
  --ui-subtle: #f8fafc;
  --ui-text: #202c40;
  --ui-muted: #637189;
  --ui-line: #e4e9f0;
  --ui-accent: #3568d4;
  --ui-accent-soft: #edf3ff;
  --ui-positive: #218168;
  --ui-danger: #bf4d4d;
  --ui-warning: #996a20;
  --ui-radius: 8px;
  --ui-nav-width: 188px;
  line-height: 1.55;
}

/* A quiet navigation rail leaves visual priority to operating figures. */
body.ui-v2 .dashboard-nav {
  padding: 28px 12px 18px;
  background: #fff;
  border-right: 1px solid var(--ui-line);
  color: var(--ui-muted);
}
body.ui-v2 .nav-brand { padding: 0 10px 28px; gap: 10px; }
body.ui-v2 .nav-brand > span {
  width: 31px; height: 31px; border: 0; border-radius: 7px;
  background: #edf3ff; color: var(--ui-accent); font-size: 19px;
}
body.ui-v2 .nav-brand strong { color: #233855; font-size: 16px; letter-spacing: .09em; }
body.ui-v2 .nav-brand small { color: #77879d; font-size: 10px; letter-spacing: .12em; }
body.ui-v2 .dashboard-nav-group > h2 { color: #8390a3; font-size: 10px; letter-spacing: .1em; margin-top: 8px; }
body.ui-v2 .dashboard-nav a:not(.nav-brand),
body.ui-v2 .dashboard-nav-logout .link-button {
  color: #63728a; min-height: 38px; padding: 8px 12px; border-radius: 6px;
  font-size: 13px; font-weight: 500;
}
body.ui-v2 .dashboard-nav a::before { border-color: #a4b0c1; width: 5px; height: 5px; flex-basis: 5px; }
body.ui-v2 .dashboard-nav a:hover,
body.ui-v2 .dashboard-nav-logout .link-button:hover { background: #f5f7fb; color: #2f5db5; }
body.ui-v2 .dashboard-nav a[aria-current=page] {
  background: var(--ui-accent-soft); border-color: transparent; color: #285bbd; font-weight: 650;
}
body.ui-v2 .dashboard-nav a[aria-current=page]::before { background: #3568d4; border-color: #3568d4; }
body.ui-v2 .dashboard-nav-logout .link-button { border-top-color: var(--ui-line); }

body.ui-v2 :is(.dashboard, .admin-page, .domain-dashboard-page, .risk-dashboard-page, .mcn-dashboard-page, .ecommerce-dashboard, .overseas-dashboard-page) {
  max-width: 1840px; padding: 28px 30px 44px;
}
body.ui-v2 :is(.topbar, .domain-dashboard-header, .ecommerce-topbar) {
  min-height: 58px; margin-bottom: 18px; padding-bottom: 16px;
}
body.ui-v2 :is(.brand-lockup h1, .admin-header h1, .domain-dashboard-header h1, .ecommerce-topbar h1) {
  color: #20314b; font-size: 24px; font-weight: 650; letter-spacing: -.025em;
}
body.ui-v2 :is(.brand-lockup small, .admin-header small, .ecommerce-topbar small) {
  color: #73839a; font-size: 10px; letter-spacing: .1em;
}
body.ui-v2 .secure-chip { font-size: 10px; color: #73839a; background: #fff; }
body.ui-v2 .view-tabs { gap: 26px; margin-bottom: 14px; }
body.ui-v2 .view-tabs button { font-size: 13px; padding: 9px 0 10px; }
body.ui-v2 :is(.filters, .finance-query-bar, .hr-query-bar, .mcn-query, .risk-query, .overseas-query, .ecommerce-query) {
  padding: 11px 14px; border-radius: 7px; gap: 10px; box-shadow: none;
}
body.ui-v2 .query-scope-bar { margin: 8px 0 18px; font-size: 11px; }
body.ui-v2 .period-shortcuts button { font-size: 11px; padding: 4px 9px; }
body.ui-v2 .segments { background: #f5f7fa; border-color: transparent; }

/* Compact metric matrix, with room for provenance rather than truncated notes. */
body.ui-v2 :is(.executive-kpis, .domain-kpis, .mcn-kpis, .finance-kpis, .risk-kpis, .ecommerce-kpis, .overseas-kpis) {
  gap: 0; overflow: hidden; border: 1px solid var(--ui-line); border-radius: 8px;
  background: #fff;
}
body.ui-v2 :is(.executive-kpis .kpi, .domain-kpi, .mcn-kpis article, .risk-kpis article, .ecommerce-kpis article, .overseas-kpis article) {
  padding: 17px 19px; min-height: 115px; gap: 7px; border: 0;
  border-radius: 0; box-shadow: 1px 0 0 var(--ui-line), 0 1px 0 var(--ui-line);
  background: #fff;
}
body.ui-v2 :is(.executive-kpis .kpi, .domain-kpi, .mcn-kpis article, .risk-kpis article, .ecommerce-kpis article, .overseas-kpis article) > span {
  color: #66758b; font-size: 12px; font-weight: 500;
}
body.ui-v2 :is(.executive-kpis .kpi, .domain-kpi, .mcn-kpis article, .risk-kpis article, .ecommerce-kpis article, .overseas-kpis article) > strong {
  color: #233753; font-size: clamp(23px, 1.85vw, 30px); letter-spacing: -.035em;
  line-height: 1.25; font-weight: 600; font-variant-numeric: tabular-nums;
}
body.ui-v2 :is(.executive-kpis .kpi, .domain-kpi, .mcn-kpis article, .risk-kpis article, .ecommerce-kpis article, .overseas-kpis article) > small {
  color: #728096; font-size: 11px; line-height: 1.65;
}
body.ui-v2 .executive-kpis .kpi.primary { background: #f1f6ff; border-top: 2px solid #7298e4; padding-top: 15px; }
body.ui-v2 .executive-kpis .kpi.primary > strong { color: #2d60c3; }
body.ui-v2 .executive-kpis .kpi.primary > span { color: #5273a4; }
body.ui-v2 .executive-kpis .kpi.primary > small { color: #657f9e; }
body.ui-v2 :is(.domain-kpi.negative, .risk-kpis .red) > strong { color: var(--ui-danger); }
body.ui-v2 :is(.risk-kpis .yellow, .mcn-kpi-risk, .overseas-kpis .overseas-estimate) { background: #fffcf5; }
body.ui-v2 .result-strip {
  margin: 12px 0 20px; background: #fff; border-color: var(--ui-line); border-radius: 7px;
}
body.ui-v2 .result-strip > div { padding: 13px 18px; background: #fff; border-right: 1px solid var(--ui-line); }
body.ui-v2 .result-strip > div:last-child { border-right: 0; }
body.ui-v2 .result-strip strong { font-size: 21px; font-weight: 600; color: #314d71; }
body.ui-v2 .result-strip :is(span, small) { font-size: 11px; }

/* Section headers borrow the reference's blue labels, not its slide annotations. */
body.ui-v2 :is(.panel, .ecommerce-card) { padding: 20px; border-radius: 8px; box-shadow: none; }
body.ui-v2 .panel-title { margin-bottom: 17px; gap: 16px; }
body.ui-v2 .panel-title > div > small {
  display: inline-block; padding: 2px 7px; border-radius: 3px;
  background: #edf3fd; color: #587bad; font-size: 10px; letter-spacing: .04em;
}
body.ui-v2 .panel-title h2 { margin-top: 7px; font-size: 17px; font-weight: 650; color: #243957; }
body.ui-v2 .panel-title > span { color: #718198; font-size: 11px; }
body.ui-v2 :is(.management-grid, .strategy-grid, .profit-grid, .domain-dashboard-grid, .mcn-main-grid) { gap: 16px; }
body.ui-v2 .management-grid { grid-template-columns: minmax(0, 1.85fr) minmax(270px, .85fr); }
body.ui-v2 .action-panel { border-top: 2px solid #8ba8d7; padding-top: 19px; }
body.ui-v2 .action-list { gap: 0; }
body.ui-v2 .action-item { padding: 11px 0; }
body.ui-v2 .action-item strong { color: #354d6d; font-size: 13px; }
body.ui-v2 .action-item small { font-size: 11px; }
body.ui-v2 .action-item.clickable em { font-size: 11px; }
body.ui-v2 :is(.rule-note, .scope-caption) { font-size: 11px; line-height: 1.75; }
body.ui-v2 :is(.insight, .trend-detail) {
  background: #f7f9fc; border: 0; border-left: 2px solid #cad9f0; border-radius: 0;
  color: #5c7190; font-size: 11px; padding: 10px 12px;
}
body.ui-v2 .trend-svg .trend-bar { fill: #a3badf; }
body.ui-v2 .chart-bar { background: #a3badf; border-radius: 3px 3px 0 0; }
body.ui-v2 .chart-bar.selected { background: #d9a536; }
body.ui-v2 .trend-svg .trend-bar.selected { fill: #d9a536; }
body.ui-v2 .trend-svg .trend-average { stroke: #92a5be; }
body.ui-v2 .trend-svg .trend-grid, body.ui-v2 .trend-axis-line { stroke: #e9edf4; }
body.ui-v2 .trend-svg .trend-amount { fill: #496487; font-weight: 550; }
body.ui-v2 .trend-svg .trend-rise { fill: var(--ui-positive); }
body.ui-v2 .trend-svg .trend-fall { fill: var(--ui-danger); }

/* Funding and risk stay on the overview, visibly actionable without giant tiles. */
body.ui-v2 .attention-toolbar { gap: 8px; flex-wrap: wrap; font-size: 12px; }
body.ui-v2 .attention-cards { gap: 10px; margin-top: 15px; }
body.ui-v2 .attention-card {
  gap: 7px; padding: 16px; min-height: 120px; border-radius: 6px;
  background: #fbfcfe; border: 1px solid #e2e9f2; box-shadow: none; color: #506887;
}
body.ui-v2 .attention-card strong { font-size: 20px; font-weight: 600; letter-spacing: -.02em; color: #2e4769; }
body.ui-v2 .attention-card small { font-size: 11px; color: #728199; }
body.ui-v2 .attention-card:hover:not(:disabled) { border-color: #9fb9e2; background: #f2f6fd; }
body.ui-v2 .attention-preview { margin-top: 18px; padding-top: 16px; }
body.ui-v2 .attention-preview h3 { font-size: 15px; color: #314b6d; }
body.ui-v2 :is(.attention-detail .attention-note, .attention-detail .risk-card) { border-radius: 6px; }

body.ui-v2 table :is(th, td) { padding: 10px 12px; font-size: 12px; border-bottom-color: #eaf0f6; }
body.ui-v2 table th { background: #f6f9fd; color: #6d7e97; font-size: 11px; font-weight: 600; }
body.ui-v2 table .team-subtotal td { background: #f0f5fc; border-top: 1px solid #dfe8f5; color: #47638c; }
body.ui-v2 table tbody tr:hover > td { background-color: #f4f8ff; }
body.ui-v2 :is(.table-wrap, .domain-trend-table-wrap, .hr-team-table-wrap, .mcn-table-wrap, .ecommerce-table-wrap, .overseas-table-wrap) { border-radius: 6px; }
body.ui-v2 .task-note { font-size: 10px; line-height: 1.65; }
body.ui-v2 :is(.structure-kpi, .comparison-cards > div, .profit-components > div, .asset-facts > div) {
  background: #fafbfd; border-color: #e5ebf3; border-radius: 6px;
}
body.ui-v2 .structure-kpi:hover { background: #f0f5fe; border-color: #b4c8e8; }
body.ui-v2 .export-controls { background: #f8faff; border-color: #e0e8f6; border-radius: 6px; }
body.ui-v2 .empty-state { background: #f9fbfd; color: #718198; }
body.ui-v2 :is(.profit-caveat, .freshness-banner, .completeness-reasons, .asset-missing) {
  background: #fffcf5; border-color: #efe4cc; color: #886933;
}
body.ui-v2 .drilldown-overlay { backdrop-filter: none; background: #20334d55; }
body.ui-v2 .drilldown-drawer { background: #f6f8fb; box-shadow: -8px 0 32px #20334d12; }
body.ui-v2 .drilldown-customer-card { flex: 0 0 auto; height: auto; min-height: max-content; border-radius: 7px; }
body.ui-v2 .auth-page { background: #f6f8fb; }
body.ui-v2 .auth-card { border-top: 3px solid #8cace1; border-radius: 10px; box-shadow: 0 8px 35px #293e5c06; }
body.ui-v2 .auth-card .brand-mark { color: #3568d4; background: #ecf3ff; }
body.ui-v2 .auth-copy h2 { font-size: 24px; }

@media (min-width: 1560px) {
  body.ui-v2 :is(.executive-kpis, .mcn-kpis, .finance-kpis, .overseas-kpis) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  body.ui-v2 .executive-kpis .kpi { padding: 18px 16px; }
  body.ui-v2 .executive-kpis .kpi > strong { font-size: 25px; }
}
@media (max-width: 1279px) {
  body.ui-v2 { --ui-nav-width: 168px; }
  body.ui-v2 :is(.dashboard, .admin-page, .domain-dashboard-page, .ecommerce-dashboard) { padding: 22px; }
  body.ui-v2 .management-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  body.ui-v2 .dashboard-nav { padding: 7px 0; border-right: 0; background: transparent; }
  body.ui-v2 :is(.dashboard, .admin-page, .domain-dashboard-page, .ecommerce-dashboard) { padding: 20px; }
  body.ui-v2 .result-strip.non-collection-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.ui-v2 .result-strip > div { border-bottom: 1px solid var(--ui-line); }
}
@media (max-width: 600px) {
  body.ui-v2 :is(.dashboard, .admin-page, .domain-dashboard-page, .ecommerce-dashboard) { padding: 16px 12px 32px; }
  body.ui-v2 :is(.panel, .ecommerce-card) { padding: 16px; }
  body.ui-v2 .executive-kpis .kpi { padding: 14px 12px; min-height: 114px; }
  body.ui-v2 .executive-kpis .kpi > strong { font-size: 23px; }
  body.ui-v2 .executive-kpis .kpi.primary { padding-top: 12px; }
  body.ui-v2 .panel-title h2 { font-size: 16px; }
  body.ui-v2 .result-strip > div { padding: 12px; }
  body.ui-v2 .result-strip strong { font-size: 20px; }
  body.ui-v2 .attention-cards { grid-template-columns: minmax(0, 1fr); }
  body.ui-v2 .attention-card { min-height: 0; padding: 14px; }
}
@media print {
  body.ui-v2 { background: #fff; }
  body.ui-v2 .executive-kpis .kpi.primary { background: #fff; }
  body.ui-v2 .executive-kpis .kpi.primary > strong { color: #20314b; }
  body.ui-v2 .panel, body.ui-v2 .executive-kpis { break-inside: avoid; }
}
