:root {
  --navy: #10233f;
  --navy-2: #173754;
  --teal: #176b87;
  --teal-2: #1d829f;
  --teal-pale: #eef7f8;
  --ink: #16263a;
  --muted: #627187;
  --line: #dce5ec;
  --line-strong: #c9d5df;
  --surface: #ffffff;
  --surface-soft: #f7fafb;
  --canvas: #f3f6f8;
  --success: #08795a;
  --warning: #9a5b05;
  --danger: #a91f3a;
  --shadow-sm: 0 2px 9px rgba(16, 35, 63, .06);
  --shadow: 0 10px 32px rgba(16, 35, 63, .08);
  --shadow-lg: 0 22px 60px rgba(16, 35, 63, .18);
  --radius-sm: 9px;
  --radius: 14px;
  --sidebar-width: 270px;
  --sidebar-collapsed: 78px;
  --focus: 0 0 0 3px rgba(29, 130, 159, .24);
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
button:focus-visible, a:focus-visible, summary:focus-visible,
input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(61, 174, 190, .55);
  outline-offset: 2px;
}
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 500;
  transform: translateY(-160%);
  padding: 9px 13px;
  border-radius: 8px;
  color: #fff;
  background: var(--navy);
}
.skip-link:focus { transform: translateY(0); }

/* Application navigation */
.app-layout { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  padding: 22px 17px;
  display: flex;
  flex-direction: column;
  z-index: 40;
  overflow-y: auto;
  overflow-x: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 20% -10%, rgba(72, 196, 204, .18), transparent 28%),
    linear-gradient(180deg, var(--navy), #0b1a2e);
  box-shadow: 4px 0 20px rgba(6, 19, 34, .08);
  transition: width .2s ease, transform .2s ease;
}
.brand {
  display: flex;
  align-items: center;
  min-height: 40px;
  gap: 11px;
  text-decoration: none;
}
.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, #45c0cc, var(--teal));
  box-shadow: 0 7px 18px rgba(0, 0, 0, .22);
  font-size: 20px;
  font-weight: 850;
}
.brand strong { display: block; font-size: 17px; letter-spacing: .2px; }
.brand small, .user-chip small {
  display: block;
  margin-top: 2px;
  color: #aebdcb;
  font-size: 10px;
  letter-spacing: .35px;
}
.sidebar-collapse {
  position: fixed;
  top: 20px;
  left: calc(var(--sidebar-width) - 22px);
  z-index: 55;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 50%;
  color: #dbe5ed;
  background: #16304c;
  box-shadow: 0 5px 16px rgba(6, 19, 34, .24);
  cursor: pointer;
}
.sidebar-collapse svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform .2s ease;
}
.nav-search {
  position: relative;
  display: block;
  margin: 24px 0 16px;
}
.nav-search-rail {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 11px;
  color: #b9c9d6;
  background: rgba(255, 255, 255, .06);
  cursor: pointer;
}
.nav-search-rail:hover {
  color: #fff;
  border-color: rgba(72, 196, 204, .48);
  background: rgba(72, 196, 204, .12);
}
.nav-search-rail svg,
.nav-search > span svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}
.nav-search > span:not(.sr-only) {
  position: absolute;
  left: 11px;
  top: 10px;
  color: #9babbc;
  z-index: 1;
}
.nav-search input {
  width: 100%;
  min-height: 38px;
  margin: 0;
  padding: 7px 10px 7px 31px;
  border: 1px solid rgba(255, 255, 255, .12);
  color: #fff;
  background: rgba(255, 255, 255, .07);
}
.nav-search input::placeholder { color: #99a9b9; }
.nav-search input:focus { border-color: rgba(72, 196, 204, .6); box-shadow: none; }
.nav-groups { flex: 1; margin-bottom: 18px; }
.nav-shortcuts {
  display: grid;
  gap: 2px;
  margin: 0 3px 13px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.nav-shortcut-heading {
  margin: 0 6px 3px;
  color: #7f94a7;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
}
.nav-shortcuts a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 31px;
  padding: 5px 7px;
  border-radius: 7px;
  color: #bdcbd7;
  text-decoration: none;
  font-size: 10.5px;
}
.nav-shortcuts a:hover, .nav-shortcuts a.active {
  color: #fff;
  background: rgba(255,255,255,.09);
}
.nav-shortcuts.recent { margin-bottom: 15px; }
.nav-group {
  position: relative;
  margin-bottom: 9px;
}
.nav-group > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  margin: 0 3px 5px;
  padding: 5px 6px;
  border-radius: 9px;
  color: #91a3b6;
  cursor: pointer;
  list-style: none;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .95px;
  text-transform: uppercase;
  transition: color .15s ease, background .15s ease;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary:hover {
  color: #dbe6ed;
  background: rgba(255, 255, 255, .045);
}
.nav-group > summary b {
  margin-left: auto;
  transition: transform .15s ease;
}
.nav-group:not([open]) > summary b { transform: rotate(-90deg); }
.nav-category-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #8fa8ba;
}
.nav-category-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}
.nav-category-copy {
  min-width: 0;
  display: grid;
  line-height: 1.15;
}
.nav-category-copy small {
  margin-top: 3px;
  color: #71869a;
  font-size: 8px;
  font-weight: 650;
  letter-spacing: .2px;
  text-transform: none;
}
.nav-flyout-heading { display: none; }
.nav-group a {
  display: flex;
  gap: 9px;
  align-items: center;
  min-height: 36px;
  margin-bottom: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #c9d5df;
  text-decoration: none;
  font-size: 12.5px;
  transition: background .15s ease, color .15s ease;
}
.nav-group a .nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-link-arrow {
  margin-left: auto;
  color: #71869a;
  opacity: 0;
  transform: translateX(-3px);
  transition: opacity .15s ease, transform .15s ease;
}
.nav-group a:hover .nav-link-arrow,
.nav-group a:focus-visible .nav-link-arrow {
  opacity: 1;
  transform: translateX(0);
}
.nav-group a:hover, .nav-group a.active {
  color: #fff;
  background: rgba(255, 255, 255, .1);
}
.nav-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #61748c;
}
.nav-group a.active .nav-dot {
  background: #48c4cc;
  box-shadow: 0 0 0 4px rgba(72, 196, 204, .13);
}
.sidebar-footer {
  display: grid;
  gap: 6px;
  padding-top: 13px;
  border-top: 1px solid rgba(255, 255, 255, .11);
}
.sidebar-footer > a, .link-button {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 32px;
  border: 0;
  padding: 5px 7px;
  color: #bac8d5;
  background: none;
  text-decoration: none;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}
.sidebar-footer > a:hover, .link-button:hover { color: #fff; }
.user-chip {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 9px 7px 3px;
  overflow: hidden;
}
.user-chip strong {
  display: block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  white-space: nowrap;
}
.avatar {
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #294761;
  font-weight: 750;
}
.main-content {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: 30px 34px 60px;
  transition: margin-left .2s ease;
}
.mobile-nav-toggle { display: none; }
.sidebar-backdrop { display: none; }
.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed);
  padding-inline: 18px;
  overflow: visible;
}
.sidebar-collapsed .main-content { margin-left: var(--sidebar-collapsed); }
.sidebar-collapsed .brand-copy,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .user-copy { display: none; }
.sidebar-collapsed .brand { justify-content: center; }
.sidebar-collapsed .sidebar-collapse {
  top: 20px;
  left: calc(var(--sidebar-collapsed) - 22px);
}
.sidebar-collapsed .sidebar-collapse svg { transform: rotate(180deg); }
.sidebar-collapsed .nav-search-label { display: none; }
.sidebar-collapsed .nav-search-rail {
  display: flex;
  margin: 47px auto 17px;
}
.sidebar-collapsed .nav-groups {
  width: 42px;
  margin-inline: auto;
}
.sidebar-collapsed .nav-shortcuts {
  width: 42px;
  margin-inline: 0;
  padding-bottom: 7px;
}
.sidebar-collapsed .nav-shortcut-heading { display: none; }
.sidebar-collapsed .nav-shortcuts a {
  justify-content: center;
  width: 42px;
  min-height: 36px;
  padding: 0;
  font-size: 15px;
}
.sidebar-collapsed .nav-group { margin-bottom: 7px; }
.sidebar-collapsed .nav-group > summary {
  width: 42px;
  height: 42px;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  color: #9fb2c2;
}
.sidebar-collapsed .nav-group > summary:hover,
.sidebar-collapsed .nav-group[open] > summary,
.sidebar-collapsed .nav-group.active-category > summary {
  color: #fff;
  border-color: rgba(72, 196, 204, .22);
  background: rgba(72, 196, 204, .13);
}
.sidebar-collapsed .nav-group.active-category > summary::after {
  content: "";
  position: absolute;
  left: -18px;
  width: 3px;
  height: 22px;
  border-radius: 0 4px 4px 0;
  background: #48c4cc;
  box-shadow: 0 0 12px rgba(72, 196, 204, .42);
}
.sidebar-collapsed .nav-category-icon {
  width: 30px;
  height: 30px;
  color: currentColor;
}
.sidebar-collapsed .nav-category-icon svg {
  width: 20px;
  height: 20px;
}
.sidebar-collapsed .nav-category-copy,
.sidebar-collapsed .nav-group > summary b { display: none; }
.sidebar-collapsed .nav-group > .nav-group-panel { display: none; }
.sidebar-collapsed .nav-group[open] > .nav-group-panel {
  position: fixed;
  top: var(--flyout-top, 120px);
  left: calc(var(--sidebar-collapsed) + 10px);
  z-index: 90;
  display: block;
  width: 310px;
  max-height: min(520px, calc(100vh - 32px));
  padding: 10px;
  overflow-y: auto;
  border: 1px solid rgba(16, 35, 63, .12);
  border-radius: 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, .98);
  box-shadow: var(--shadow-lg);
  animation: nav-flyout-in .16s ease-out;
}
.sidebar-collapsed .nav-flyout-heading {
  display: grid;
  margin: 2px 3px 9px;
  padding: 8px 9px 12px;
  border-bottom: 1px solid var(--line);
}
.nav-flyout-heading > span {
  color: var(--teal);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.nav-flyout-heading strong {
  margin-top: 3px;
  color: var(--navy);
  font-size: 16px;
  letter-spacing: -.2px;
}
.nav-flyout-heading small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}
.sidebar-collapsed .nav-group a {
  justify-content: flex-start;
  min-height: 40px;
  margin-bottom: 3px;
  padding: 9px 10px;
  color: #40536a;
}
.sidebar-collapsed .nav-group a:hover,
.sidebar-collapsed .nav-group a.active {
  color: var(--navy);
  background: var(--teal-pale);
}
.sidebar-collapsed .nav-group a .nav-label { display: block; }
.sidebar-collapsed .nav-link-arrow { color: var(--teal); }
.sidebar-collapsed .nav-dot { width: 7px; height: 7px; }
.sidebar-collapsed .sidebar-footer > a,
.sidebar-collapsed .link-button,
.sidebar-collapsed .user-chip { justify-content: center; padding-inline: 0; }
@keyframes nav-flyout-in {
  from { opacity: 0; transform: translateX(-7px) scale(.985); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

/* Common page components */
.page-header {
  display: flex;
  justify-content: space-between;
  gap: 25px;
  align-items: flex-start;
  margin: 0 0 22px;
}
.page-header-actions { display: flex; align-items: center; gap: 8px; }
.favorite-report-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: #9aa8b5;
  background: #fff;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-size: 17px;
}
.favorite-report-button[aria-pressed="true"] {
  color: #c47b00;
  border-color: #e7cf9b;
  background: #fff8e9;
}
.breadcrumbs, .eyebrow {
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.05px;
}
.page-header h1 {
  margin: 6px 0;
  font-size: clamp(26px, 3vw, 35px);
  letter-spacing: -.75px;
  line-height: 1.15;
}
.page-header p {
  max-width: 790px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}
.snapshot-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.snapshot-chip small, .snapshot-chip strong { display: block; font-size: 10px; }
.snapshot-chip small { margin-bottom: 2px; color: var(--muted); }
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(8, 121, 90, .13);
}
.coverage-note, .warning-note {
  margin: 0 0 13px;
  padding: 11px 14px;
  border: 1px solid #ebce94;
  border-radius: 10px;
  color: #694100;
  background: #fff8e9;
  font-size: 12px;
}
.filter-panel, .surface, .visual-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
label, .filter-label {
  color: #3d4e65;
  font-size: 11px;
  font-weight: 750;
}
input, select {
  display: block;
  width: 100%;
  min-height: 40px;
  margin-top: 5px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  color: var(--ink);
  background: #fff;
}
input:focus, select:focus {
  border-color: var(--teal);
  box-shadow: var(--focus);
}
input:disabled, select:disabled, button:disabled {
  cursor: not-allowed;
  opacity: .55;
}
label small, .filter-help {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 450;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 11px;
  font-weight: 780;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  white-space: nowrap;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--teal); box-shadow: 0 4px 12px rgba(23, 107, 135, .15); }
.button.primary:hover:not(:disabled) { background: var(--teal-2); }
.button.primary.has-changes { box-shadow: 0 0 0 3px rgba(23, 107, 135, .12), 0 5px 13px rgba(23, 107, 135, .18); }
.button.secondary { color: #fff; background: var(--navy); }
.button.ghost { border-color: #ccd8e2; color: #405168; background: #fff; }
.button.ghost:hover:not(:disabled) { border-color: #aebfcb; background: #f9fbfc; }
.button.danger { border-color: #edb7c3; color: var(--danger); background: #fff7f8; }
.button.danger:hover:not(:disabled) { background: #fff1f4; }
.button.full { width: 100%; }
.button.small { height: 32px; min-height: 32px; padding: 5px 9px; }
.button.busy { min-width: 125px; }
.icon-button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: #edf2f5;
  cursor: pointer;
  font-size: 23px;
}
.inline-error {
  margin-bottom: 13px;
  padding: 11px 13px;
  border: 1px solid #edb7c3;
  border-radius: 9px;
  color: var(--danger);
  background: #fff1f4;
  font-size: 12px;
}

/* Operational warnings */
.warning-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.warning-summary {
  min-height: 126px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.warning-summary > span,
.warning-summary > small { display: block; color: var(--muted); font-size: 11px; }
.warning-summary > strong { display: block; margin: 7px 0 5px; font-size: 29px; }
.warning-summary.critical { border-top: 4px solid var(--danger); }
.warning-summary.warning { border-top: 4px solid #d58b18; }
.warning-summary.neutral { border-top: 4px solid var(--teal); }
.warning-workspace { padding: 18px; }
.warning-view-toggle {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}
.warning-view-toggle button {
  min-height: 32px;
  padding: 5px 11px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}
.warning-view-toggle button.active {
  color: var(--navy);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.warning-category-group { margin-top: 20px; }
.warning-category-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 9px;
}
.warning-category-group h3 { margin: 0; font-size: 16px; }
.warning-category-group header p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.warning-card-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.warning-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid #d58b18;
  border-radius: 11px;
  background: #fff;
}
.warning-card.critical { border-left-color: var(--danger); }
.warning-card-top,
.warning-card-footer,
.warning-card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.warning-card-top { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .5px; }
.warning-severity { color: var(--warning); font-weight: 850; }
.warning-card.critical .warning-severity { color: var(--danger); }
.warning-card h4 { margin: 10px 0 3px; font-size: 13px; }
.warning-card p { margin: 0; color: var(--muted); font-size: 11px; }
.warning-card dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 13px 0; }
.warning-card dl div { padding: 8px; border-radius: 8px; background: var(--surface-soft); }
.warning-card dt { color: var(--muted); font-size: 9px; }
.warning-card dd { margin: 3px 0 0; font-size: 12px; font-weight: 800; }
.warning-card-footer { padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.warning-sparkline { width: 92px; height: 26px; overflow: visible; }
.warning-sparkline polyline { fill: none; stroke: var(--teal); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.warning-rule-registry { margin-top: 14px; padding: 14px 17px; }
.warning-rule-registry summary { cursor: pointer; color: var(--navy); font-size: 12px; font-weight: 800; }
.rule-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.rule-grid article { padding: 10px; border: 1px solid var(--line); border-radius: 9px; }
.rule-grid span, .rule-grid small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.warning-evidence-table td small { display: block; margin-top: 3px; color: var(--muted); }
.warning-evidence-table th button {
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: inherit;
}
.warning-evidence-table th[aria-sort="ascending"] button::after {
  content: " ↑";
}
.warning-evidence-table th[aria-sort="descending"] button::after {
  content: " ↓";
}
.mapping-suggestions {
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}
.mapping-suggestions code { color: var(--teal); }
@media (max-width: 1100px) {
  .warning-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .warning-card-list { grid-template-columns: 1fr; }
  .rule-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .warning-summary-grid, .rule-grid { grid-template-columns: 1fr; }
  .warning-card-body { align-items: flex-start; }
  .warning-card dl { grid-template-columns: 1fr; }
}

/* Report filters */
.filter-panel { position: relative; z-index: 10; padding: 15px 17px; }
.applied-filter-summary {
  position: sticky;
  bottom: 8px;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  margin-top: 9px;
  padding: 5px 7px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
}
.grain-badge {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid #c9e1e5;
  border-radius: 999px;
  color: var(--teal);
  background: var(--teal-pale);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}
.chart-drill-breadcrumbs {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  padding: 0 18px 9px;
  color: var(--muted);
  font-size: 10px;
}
.chart-drill-breadcrumbs button {
  border: 0;
  padding: 3px 6px;
  border-radius: 6px;
  color: var(--teal);
  background: var(--teal-pale);
  cursor: pointer;
  font-weight: 750;
}
.visual-card:fullscreen {
  padding: 18px;
  overflow: auto;
  background: var(--surface);
}
.visual-card:fullscreen .chart { min-height: calc(100vh - 150px); }
.date-presets {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.date-presets > span {
  margin-right: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
}
.date-presets button {
  min-height: 29px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #4b5c70;
  background: #fff;
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
}
.date-presets button:hover { border-color: #a9c8d2; color: var(--teal); background: var(--teal-pale); }
.filter-primary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  align-items: start;
  gap: 11px;
}
.filter-primary > label:not(.compare-toggle) {
  display: grid;
  grid-template-rows: 15px 40px 16px;
  align-content: start;
  min-width: 148px;
}
.filter-primary > label:not(.compare-toggle) > input,
.filter-primary > label:not(.compare-toggle) > select {
  align-self: stretch;
}
.filter-primary > label:not(.compare-toggle) > small {
  align-self: end;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.compare-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  margin-top: 15px;
  padding: 0 5px;
  white-space: nowrap;
}
.compare-toggle input { width: 18px; min-height: auto; margin: 0; }
.filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 160px;
  margin-top: 15px;
  min-height: 40px;
}
.filter-more { margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line); }
.filter-more > summary {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  color: var(--teal);
  cursor: pointer;
  font-size: 11px;
  font-weight: 780;
}
.filter-more > summary small { color: var(--muted); font-weight: 500; }
.filter-more > summary small.warning { color: var(--warning); }
.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(165px, 1fr));
  gap: 13px;
  padding-top: 14px;
}
.filter-field { min-width: 0; }
.multi-select { position: relative; margin-top: 5px; }
.multi-select-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font-size: 11px;
  text-align: left;
}
.multi-select-trigger.has-selection { border-color: #8fbac7; color: #164f63; background: var(--teal-pale); }
.multi-select-trigger b { color: var(--muted); font-size: 13px; }
.multi-select-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: max(100%, 260px);
  z-index: 80;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--shadow-lg);
}
.multi-select-search { min-height: 36px; margin: 0 0 8px; }
.multi-select-tools {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px 7px;
  border-bottom: 1px solid var(--line);
}
.multi-select-tools button {
  border: 0;
  padding: 3px 0;
  color: var(--teal);
  background: transparent;
  cursor: pointer;
  font-size: 9px;
  font-weight: 750;
}
.multi-select-options {
  max-height: 240px;
  margin-top: 5px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.multi-select-option {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 5px 6px;
  border-radius: 7px;
  cursor: pointer;
  color: #34475f;
  font-size: 10px;
  font-weight: 550;
}
.multi-select-option:hover { background: #f2f7f8; }
.multi-select-option input { width: 16px; min-height: auto; margin: 0; box-shadow: none; }
.filter-option-state { padding: 20px 8px; color: var(--muted); text-align: center; font-size: 10px; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.filter-chip {
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid #b8d3dc;
  border-radius: 999px;
  color: #24576a;
  background: var(--teal-pale);
  cursor: pointer;
  font-size: 9px;
}
.filter-chip span { font-weight: 800; }
.filter-chip::after { content: " ×"; margin-left: 3px; font-weight: 900; }

/* Report results */
.report-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin: 17px 0;
}
.view-tabs {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.view-tabs button {
  min-width: 72px;
  min-height: 32px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: none;
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
}
.view-tabs button.active, .view-tabs button[aria-selected="true"] { color: #fff; background: var(--navy); }
.toolbar-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 13px;
  margin: 0 0 17px;
}
.kpi-card {
  min-height: 112px;
  padding: 16px 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.kpi-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 9px;
  font-weight: 820;
  letter-spacing: .65px;
  text-transform: uppercase;
}
.metric-info {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 1px solid #cbd6df;
  border-radius: 50%;
  color: var(--muted);
  background: #fff;
  cursor: help;
  font-family: Georgia, serif;
  font-size: 10px;
  font-weight: 800;
}
.kpi-card .value {
  margin: 8px 0 5px;
  overflow: hidden;
  font-size: clamp(20px, 2.1vw, 25px);
  font-weight: 790;
  letter-spacing: -.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kpi-card .comparison { font-size: 10px; font-weight: 720; }
.kpi-as-of {
  margin: -1px 0 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
}
.comparison .positive { color: var(--success); }
.comparison .negative { color: var(--danger); }
.comparison .neutral { color: var(--muted); }
.skeleton-card { overflow: hidden; }
.skeleton-card span, .skeleton-card strong, .skeleton-card small {
  display: block;
  height: 10px;
  margin-bottom: 12px;
  border-radius: 5px;
  background: linear-gradient(90deg, #edf2f5 25%, #f7f9fa 50%, #edf2f5 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}
.skeleton-card strong { width: 65%; height: 25px; }
.skeleton-card small { width: 45%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.visual-card { position: relative; min-height: 470px; padding: 18px; overflow: hidden; }
.visual-card.is-loading > :not(.result-progress) { opacity: .72; }
.visual-card-header, .section-header {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
}
.visual-card-header h2, .section-header h2 { margin: 0; font-size: 15px; }
.visual-card-header p, .section-header p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.chart-controls { display: flex; gap: 8px; align-items: flex-end; margin-left: auto; }
.chart-controls label { font-size: 9px; }
.chart-controls select { min-width: 110px; min-height: 32px; margin-top: 3px; padding: 4px 7px; font-size: 9px; }
.result-progress {
  position: absolute;
  top: 13px;
  right: 15px;
  z-index: 4;
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 6px 9px;
  border: 1px solid #cfe0e5;
  border-radius: 999px;
  color: var(--teal);
  background: rgba(255, 255, 255, .95);
  box-shadow: var(--shadow-sm);
  font-size: 9px;
  font-weight: 750;
}
.loader {
  width: 32px;
  height: 32px;
  border: 3px solid #cad8e1;
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.loader.small { width: 14px; height: 14px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.chart { width: 100%; height: 430px; margin: 8px 0 2px; }
.chart-tooltip-title { margin-bottom: 7px; font-weight: 800; }
.chart-tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  min-width: 210px;
  margin-top: 3px;
}
.chart-tooltip-row strong { margin-left: 18px; }
.table-scroll { width: 100%; max-height: 580px; margin-top: 14px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 11px; }
th {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 0;
  color: #45566d;
  background: #edf3f6;
  text-align: left;
  white-space: nowrap;
}
th button {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 39px;
  padding: 9px 10px;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  text-align: left;
}
th.numeric, th.numeric button, td.numeric { text-align: right; }
th.numeric button { justify-content: flex-end; }
td {
  padding: 10px;
  border-bottom: 1px solid #e8edf1;
  background: #fff;
  white-space: nowrap;
}
tbody tr:hover td { background: #f7fafb; }
table.compact td { padding-block: 6px; }
td.dimension-cell:first-child, th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  box-shadow: 1px 0 0 var(--line);
}
th:first-child { z-index: 4; }
.compact-empty, .empty-state {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 40px 15px;
  color: var(--muted);
  text-align: center;
}
.compact-empty strong { color: var(--ink); }
.empty-state { max-width: 520px; margin: 15vh auto; }
.empty-state h1 { color: var(--ink); }
.empty-icon { font-size: 33px; }

/* Customizer and dialogs */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(10, 25, 44, .35);
  backdrop-filter: blur(2px);
}
.customizer-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(520px, 94vw);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  border-left: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-lg);
  transition: transform .22s ease;
}
.customizer-drawer.open { transform: translateX(0); }
.drawer-header {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: flex-start;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}
.drawer-header h2 { margin: 4px 0 0; font-size: 21px; }
.drawer-content { flex: 1; padding: 22px; overflow-y: auto; }
.drawer-content section + section { margin-top: 28px; padding-top: 25px; border-top: 1px solid var(--line); }
.customizer-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.customizer-heading h3 { margin: 0; font-size: 14px; }
.customizer-heading p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.customizer-heading > span {
  height: fit-content;
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--teal);
  background: var(--teal-pale);
  font-size: 9px;
  font-weight: 800;
}
.check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.check-grid label {
  display: flex;
  gap: 7px;
  align-items: center;
  min-height: 37px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 550;
}
.check-grid label:has(input:checked) { border-color: #a8cbd4; color: #1c566a; background: var(--teal-pale); }
.check-grid input { width: auto; min-height: auto; margin: 0; }
.drawer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  background: #f8fafb;
}
dialog {
  width: min(500px, calc(100vw - 30px));
  border: 0;
  border-radius: 14px;
  padding: 0;
  box-shadow: 0 24px 70px rgba(16, 35, 63, .25);
}
dialog::backdrop { background: rgba(10, 25, 44, .55); }
.dialog-form { position: relative; padding: 23px; }
.dialog-form h2 { margin: 5px 0; }
.dialog-form p { color: var(--muted); font-size: 11px; line-height: 1.5; }
.dialog-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 24px;
}
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* Saved views, subscriptions and administration */
.surface { margin-bottom: 17px; padding: 18px; }
.workspace-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 17px;
}
.workspace-summary article {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: #fff;
  box-shadow: var(--shadow-sm);
  font-size: 10px;
  font-weight: 700;
}
.workspace-summary strong { color: var(--navy); font-size: 20px; }
.content-grid { display: grid; gap: 17px; }
.content-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.section-header { margin-bottom: 15px; }
.stack-form { display: grid; gap: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inline-form {
  display: flex;
  gap: 9px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin: 0 0 17px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}
.inline-form input, .inline-form select { width: auto; min-width: 150px; margin: 0; }
.mapping-form input { min-width: 130px; }
.list { display: grid; }
.list-row {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
  min-height: 58px;
  padding: 11px 3px;
  border-bottom: 1px solid #e8edf1;
}
.list-row:last-child { border-bottom: 0; }
.list-title-line { display: flex; gap: 8px; align-items: center; }
.list-row a { text-decoration-color: #adc6d0; text-underline-offset: 3px; }
td small, .list-row small, .admin-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}
.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  color: #5e6b79;
  background: #eef1f4;
  font-size: 9px;
  font-weight: 820;
  text-transform: uppercase;
}
.badge.success { color: var(--success); background: #e3f6ef; }
.badge.warning { color: var(--warning); background: #fff2d6; }
.badge.danger { color: var(--danger); background: #fee9ee; }
.admin-tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 7px;
  margin: -7px 0 18px;
  padding: 8px 0;
  overflow-x: auto;
  background: var(--canvas);
}
.admin-tabs a {
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  text-decoration: none;
  font-size: 10px;
}
.admin-tabs a:hover { border-color: #a9c8d2; color: var(--teal); }
.section-search input { min-width: 210px; margin: 0; }
.admin-table td form { margin: 0; }
.compact-form { display: contents; }
.compact-form select { width: 92px; min-height: 31px; margin: 0 0 4px; padding: 4px; }
.switch { display: flex; align-items: center; gap: 4px; }
.switch input { width: auto; min-height: auto; margin: 0; }
.permission-card { margin-bottom: 9px; padding: 0 13px 13px; border: 1px solid var(--line); border-radius: 10px; }
.permission-card summary {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}
.permission-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 13px; }
.permission-grid fieldset { border: 1px solid var(--line); border-radius: 8px; }
.permission-tools { display: flex; gap: 8px; margin: 4px 0 8px; }
.permission-tools button {
  border: 0;
  padding: 2px 0;
  color: var(--teal);
  background: none;
  cursor: pointer;
  font-size: 9px;
  font-weight: 750;
}
.permission-grid label { display: flex; gap: 5px; align-items: flex-start; margin: 5px 0; font-weight: 500; }
.permission-grid input { width: auto; min-height: auto; margin: 1px 0 0; }
input[type="checkbox"],
input[type="radio"] {
  width: 24px;
  height: 24px;
  min-height: 24px;
  flex: 0 0 24px;
  accent-color: var(--teal);
}
.section-copy { color: var(--muted); font-size: 11px; }
.flash-stack { position: fixed; top: 18px; right: 22px; z-index: 200; display: grid; gap: 8px; }
.flash {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  font-size: 11px;
}
.flash.error { border-left-color: var(--danger); }
.form-preview {
  padding: 10px 12px;
  border: 1px solid #d4e4e8;
  border-radius: 9px;
  color: #315466;
  background: #f0f7f8;
  font-size: 10px;
}

/* Authentication */
.auth-layout { min-height: 100vh; background: #edf2f6; }
.auth-shell {
  width: min(1040px, calc(100% - 32px));
  min-height: 610px;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  margin: 6vh auto;
  overflow: hidden;
  border: 1px solid rgba(16, 35, 63, .04);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 25px 70px rgba(16, 35, 63, .16);
}
.auth-panel {
  padding: 42px;
  color: #fff;
  background:
    radial-gradient(circle at 80% 10%, rgba(47, 184, 197, .28), transparent 32%),
    linear-gradient(150deg, var(--navy), #0a1b31);
}
.auth-brand { margin-bottom: 100px; }
.auth-copy h1 { max-width: 500px; margin: 12px 0 18px; font-size: 42px; line-height: 1.06; letter-spacing: -1.5px; }
.auth-copy > p { max-width: 500px; color: #c3cfda; line-height: 1.6; }
.auth-feature { margin-top: 18px; color: #d8e2ea; font-size: 12px; }
.auth-feature span { margin-right: 8px; color: #48c4cc; }
.sign-in-card { align-self: center; padding: 70px 45px; }
.sign-in-card h2 { margin: 7px 0 9px; font-size: 26px; }
.muted, .fine-print { color: var(--muted); font-size: 12px; line-height: 1.6; }
.fine-print { margin-top: 18px; font-size: 10px; }

@media (max-width: 1180px) {
  .filter-grid { grid-template-columns: repeat(3, 1fr); }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .sidebar, .sidebar-collapsed .sidebar {
    width: min(310px, 88vw);
    padding: 22px 17px;
    overflow-x: hidden;
    overflow-y: auto;
    transform: translateX(-105%);
  }
  .mobile-nav-open .sidebar { transform: translateX(0); }
  .sidebar-collapse { display: none; }
  .sidebar-collapsed .brand-copy,
  .sidebar-collapsed .nav-category-copy,
  .sidebar-collapsed .nav-group > summary b,
  .sidebar-collapsed .nav-label,
  .sidebar-collapsed .user-copy { display: initial; }
  .sidebar-collapsed .brand { justify-content: flex-start; }
  .sidebar-collapsed .nav-search-label {
    display: block;
    width: auto;
    height: auto;
    margin: 24px 0 16px;
  }
  .sidebar-collapsed .nav-search-rail { display: none; }
  .sidebar-collapsed .nav-search input { width: 100%; padding: 7px 10px 7px 31px; }
  .sidebar-collapsed .nav-groups { width: auto; margin-inline: 0; }
  .sidebar-collapsed .nav-group { margin-bottom: 9px; }
  .sidebar-collapsed .nav-group > summary {
    width: auto;
    height: auto;
    justify-content: flex-start;
    margin: 0 3px 5px;
    padding: 5px 6px;
    border: 0;
  }
  .sidebar-collapsed .nav-group.active-category > summary::after { display: none; }
  .sidebar-collapsed .nav-category-icon { width: 22px; height: 22px; }
  .sidebar-collapsed .nav-category-icon svg { width: 17px; height: 17px; }
  .sidebar-collapsed .nav-group[open] > .nav-group-panel {
    position: static;
    display: block;
    width: auto;
    max-height: none;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    color: inherit;
    background: none;
    box-shadow: none;
    animation: none;
  }
  .sidebar-collapsed .nav-flyout-heading { display: none; }
  .sidebar-collapsed .nav-group a,
  .sidebar-collapsed .sidebar-footer > a,
  .sidebar-collapsed .link-button,
  .sidebar-collapsed .user-chip { justify-content: flex-start; padding-inline: 7px; }
  .sidebar-collapsed .nav-group a { color: #c9d5df; }
  .sidebar-collapsed .nav-group a:hover,
  .sidebar-collapsed .nav-group a.active {
    color: #fff;
    background: rgba(255, 255, 255, .1);
  }
  .main-content, .sidebar-collapsed .main-content { margin-left: 0; padding: 72px 16px 45px; }
  .mobile-nav-toggle {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 35;
    display: flex;
    gap: 7px;
    align-items: center;
    min-height: 40px;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--navy);
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow-sm);
    font-size: 11px;
    font-weight: 780;
  }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 38;
    display: block;
    background: rgba(8, 21, 38, .5);
    backdrop-filter: blur(2px);
  }
  .page-header, .report-toolbar { flex-direction: column; align-items: stretch; }
  .snapshot-chip { width: fit-content; }
  .filter-primary > label:not(.compare-toggle) { flex: 1 1 135px; }
  .filter-actions { width: 100%; margin-left: 0; }
  .filter-actions .button { flex: 1; }
  .filter-more > summary { align-items: flex-start; }
  .filter-grid, .content-grid.two, .permission-grid, .auth-shell { grid-template-columns: 1fr; }
  .workspace-summary { grid-template-columns: 1fr 1fr 1fr; }
  .toolbar-actions { display: grid; grid-template-columns: repeat(2, 1fr); }
  .toolbar-actions .button { width: 100%; }
  .visual-card-header { align-items: flex-start; flex-wrap: wrap; }
  .chart-controls { width: 100%; margin-left: 0; overflow-x: auto; }
  .chart { height: 360px; }
  .auth-panel { display: none; }
  .auth-shell { min-height: auto; margin: 4vh auto; }
  .sign-in-card { padding: 42px 25px; }
}

@media (max-width: 520px) {
  .main-content { padding-inline: 12px; }
  .page-header h1 { font-size: 27px; }
  .date-presets { flex-wrap: nowrap; margin-inline: -2px; padding-bottom: 5px; overflow-x: auto; }
  .date-presets > * { flex: 0 0 auto; }
  .filter-grid, .kpi-grid, .form-row, .check-grid { grid-template-columns: 1fr; }
  .workspace-summary { grid-template-columns: 1fr; }
  .multi-select-popover { position: fixed; inset: auto 12px 12px; width: auto; max-height: 70vh; }
  .multi-select-options { max-height: 45vh; }
  .kpi-card { min-height: 100px; }
  .chart-controls label { min-width: 115px; }
  .chart { height: 320px; }
}

/* Partner 360 */
.partner-filter-panel { position: relative; z-index: 8; }
.partner-focus-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) minmax(160px, .9fr)
    minmax(135px, .75fr) repeat(2, minmax(135px, .72fr))
    minmax(130px, auto);
  gap: 10px;
  align-items: start;
}
.partner-focus-row label, .pipeline-heading label {
  display: grid;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.partner-focus-row label {
  grid-template-rows: 15px 40px 16px;
  gap: 0;
}
.pipeline-heading label { gap: 6px; }
.partner-focus-row select, .partner-focus-row input, .pipeline-heading select {
  min-height: 40px;
}
.partner-focus-field select { border-color: var(--teal); font-weight: 750; }
.partner-focus-row label small {
  min-height: 1.1em;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}
.partner-filter-actions {
  align-self: start;
  margin-top: 15px;
  margin-left: 0;
  padding-top: 0;
}
.partner-filter-actions .button { min-height: 40px; }
.partner-date-presets {
  margin: 12px 0 0;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}
.partner-filter-panel .filter-more { margin-top: 11px; }
.partner-toolbar { align-items: center; }
.partner-toolbar .toolbar-actions {
  margin-left: auto;
  align-items: stretch;
}
.partner-toolbar .toolbar-actions .button { min-height: 40px; }
.partner-tabs {
  display: flex;
  gap: 4px;
  min-width: max-content;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}
.partner-tabs button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.partner-tabs button[aria-selected="true"] {
  color: var(--teal);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.partner-section { display: grid; gap: 16px; }
.partner-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.partner-kpi-grid .kpi-card strong {
  font-size: clamp(20px, 2vw, 29px);
}
.partner-kpi-grid .kpi-card small {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.partner-kpi-grid .positive { color: var(--success); }
.partner-kpi-grid .negative { color: var(--danger); }
.partner-kpi-grid .neutral { color: var(--muted); }
.partner-fleet-strip {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}
.partner-fleet-strip > div {
  display: grid;
  gap: 5px;
  padding: 16px;
  background: var(--surface);
}
.partner-fleet-strip span {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}
.partner-fleet-strip strong { font-size: 18px; }
.partner-insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.insight-card {
  display: grid;
  gap: 5px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 12px;
  background: var(--surface);
}
.insight-card.decline, .insight-card.cancellation {
  border-left-color: var(--danger);
}
.insight-card span {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}
.insight-card small { color: var(--muted); }
.partner-visual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.partner-chart { min-height: 390px; }
.partner-pattern-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.partner-pattern-grid .visual-card { padding: 16px; }
.partner-pattern-grid .visual-card:last-child { grid-column: 1 / -1; }
.partner-network-grid {
  display: grid;
  grid-template-columns: minmax(560px, 1.25fr) minmax(380px, .75fr);
  gap: 16px;
  align-items: start;
}
.hierarchy-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.hierarchy-breadcrumbs button {
  border: 0;
  color: var(--teal);
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}
.hierarchy-table th.numeric, .hierarchy-table td.numeric { text-align: right; }
.hierarchy-expand {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  border: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.hierarchy-expand span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--teal);
}
.pipeline-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}
.pipeline-heading h2, .pipeline-heading p { margin: 0; }
.pipeline-heading p { margin-top: 4px; color: var(--muted); }
@media (max-width: 1180px) {
  .partner-focus-row { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
  .partner-network-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .partner-focus-row, .partner-kpi-grid, .partner-fleet-strip,
  .partner-insights, .partner-visual-grid, .partner-pattern-grid {
    grid-template-columns: 1fr;
  }
  .partner-pattern-grid .visual-card:last-child { grid-column: auto; }
  .partner-toolbar, .pipeline-heading {
    align-items: stretch;
    flex-direction: column;
  }
  .partner-filter-actions {
    width: 100%;
    margin-top: 0;
    margin-left: 0;
  }
  .partner-toolbar {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }
  .partner-toolbar .toolbar-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    min-width: 0;
    margin-left: 0;
  }
  .partner-toolbar .toolbar-actions .button { min-width: 0; }
  .partner-tabs {
    width: 100%;
    min-width: 0;
    overflow-x: auto;
  }
  .partner-network-grid { display: block; }
.partner-network-grid .table-scroll { margin-bottom: 16px; }
}

/* Fleet timeline */
.aligned-controls > .filter-control {
  display: grid !important;
  grid-template-rows: 15px 40px 16px !important;
}
.aligned-controls .aligned-action { align-self: start; margin-top: 15px; }
.fleet-simple-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
  padding-top: 14px;
}
.fleet-simple-filters label { color: var(--muted); font-size: 10px; font-weight: 750; }
.fleet-simple-filters select {
  width: 100%;
  min-height: 122px;
  margin-top: 5px;
  padding: 5px;
}
.fleet-simple-filters small { display: block; margin-top: 4px; font-weight: 500; }
.fleet-latest-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fleet-toolbar { align-items: end; }
.fleet-view-controls { display: flex; align-items: end; gap: 16px; }
.fleet-view-controls > label:first-child {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}
.fleet-view-controls select { min-width: 220px; }
.inline-toggle { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; }
.inline-toggle input { width: 18px; min-height: auto; margin: 0; }
.fleet-matrix-card { padding: 18px; overflow: hidden; }
.fleet-matrix-card.is-loading .fleet-matrix-scroll { opacity: .55; }
.fleet-matrix-scroll {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
  transition: opacity .15s ease;
}
.fleet-matrix {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}
.fleet-matrix th,
.fleet-matrix td {
  min-width: 205px;
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.fleet-matrix thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  color: var(--navy);
  background: #f4f8fa;
  text-align: center;
}
.fleet-matrix th:first-child {
  position: sticky;
  left: 0;
  z-index: 4;
  width: 240px;
  min-width: 240px;
  max-width: 240px;
  background: #fff;
  text-align: left;
  box-shadow: 5px 0 10px rgba(16,35,63,.05);
}
.fleet-matrix thead th:first-child { z-index: 6; background: #edf4f7; }
.fleet-group-row th:first-child { padding-left: 40px; color: var(--muted); background: #f8fafb; }
.fleet-period-drill {
  border: 0;
  color: var(--teal);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.fleet-matrix thead small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.fleet-expand {
  width: 25px;
  height: 25px;
  margin-right: 7px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--teal);
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}
.fleet-cell { display: grid; gap: 5px; min-height: 105px; }
.fleet-cell > strong { color: var(--navy); font-size: 18px; }
.fleet-cell > small, .fleet-cell > em { color: var(--muted); font-size: 9px; font-style: normal; }
.fleet-cell.incomplete { padding-left: 7px; border-left: 3px solid #d58b18; }
.fleet-cell-deltas { display: flex; flex-wrap: wrap; gap: 4px; }
.fleet-delta { padding: 2px 5px; border-radius: 5px; font-size: 9px; font-weight: 750; background: #eef2f5; }
.fleet-delta.positive { color: #08775a; background: #e8f7f1; }
.fleet-delta.negative { color: var(--danger); background: #fff1f4; }
.fleet-no-data { color: var(--muted); }
.fleet-pagination { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding-top: 13px; }
.warning-health-table td:first-child small { display: block; color: var(--muted); }

/* Recently viewed is collapsed until a user explicitly opens it. */
.nav-shortcuts.recent { display: block; }
.nav-shortcuts.recent > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 33px;
  padding: 5px 7px;
  border-radius: 7px;
  color: #bdcbd7;
  cursor: pointer;
  font-size: 10.5px;
  list-style: none;
}
.nav-shortcuts.recent > summary::-webkit-details-marker { display: none; }
.nav-shortcuts.recent > summary:hover { color:#fff; background:rgba(255,255,255,.09); }
.nav-shortcuts.recent > summary small { margin-left:auto; color:#7f94a7; }
.recent-report-panel { display:grid; gap:2px; padding-top:3px; }
.recent-report-panel .nav-flyout-heading { display:none; }
.sidebar-collapsed .nav-shortcuts.recent > summary {
  justify-content:center;
  width:42px;
  height:42px;
  padding:0;
  border:1px solid transparent;
  font-size:17px;
}
.sidebar-collapsed .nav-shortcuts.recent > summary small { display:none; }
.sidebar-collapsed .nav-shortcuts.recent > .recent-report-panel { display:none; }
.sidebar-collapsed .nav-shortcuts.recent[open] > .recent-report-panel {
  position:fixed;
  top:var(--flyout-top,120px);
  left:calc(var(--sidebar-collapsed) + 10px);
  z-index:90;
  display:grid;
  width:310px;
  max-height:min(420px,calc(100vh - 32px));
  padding:10px;
  overflow-y:auto;
  border:1px solid rgba(16,35,63,.12);
  border-radius:15px;
  color:var(--ink);
  background:rgba(255,255,255,.98);
  box-shadow:var(--shadow-lg);
}
.sidebar-collapsed .recent-report-panel .nav-flyout-heading { display:grid; padding:8px 9px; }
.sidebar-collapsed .recent-report-panel a {
  justify-content:flex-start;
  width:auto;
  min-height:40px;
  padding:9px 10px;
  color:#40536a;
  font-size:11px;
}
.sidebar-collapsed .recent-report-panel a .nav-label { display:block; }

@media (max-width: 900px) {
  .fleet-simple-filters { grid-template-columns: 1fr; }
  .fleet-latest-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .fleet-toolbar, .fleet-view-controls { align-items:stretch; flex-direction:column; }
}
@media (max-width: 560px) {
  .fleet-latest-grid { grid-template-columns:1fr; }
  .fleet-matrix th:first-child { width:180px; min-width:180px; max-width:180px; }
}

/* BI enhancement surfaces and shared alignment primitives */
.nav-footer-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  min-width: 18px;
  height: 18px;
}
textarea {
  display: block;
  width: 100%;
  min-height: 88px;
  margin-top: 5px;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  color: var(--ink);
  background: #fff;
  font: inherit;
  line-height: 1.45;
  resize: vertical;
}
textarea:focus {
  border-color: var(--teal);
  box-shadow: var(--focus);
}
.critical-note {
  border-color: #edb7c3;
  color: #81243b;
  background: #fff1f4;
}
.freshness-warning .status-dot {
  background: #d58b18;
  box-shadow: 0 0 0 4px rgba(213, 139, 24, .14);
}
.freshness-critical .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(183, 53, 81, .13);
}
.condition-builder {
  display: grid;
  gap: 10px;
  margin: 2px 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}
.condition-builder legend {
  padding: 0 5px;
  color: var(--navy);
  font-size: 11px;
  font-weight: 800;
}
.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}
.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.planning-comparison {
  display: grid;
  gap: 2px;
  margin-top: 5px;
  font-size: 9px;
}
.planning-comparison small,
.planning-variance { display: block; margin-top: 4px; }
.positive { color: var(--success); }
.negative, .danger-text { color: var(--danger); }
.report-context-grid { margin-top: 17px; }
.annotation-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.annotation-item:last-child { border-bottom: 0; }
.annotation-item small { color: var(--muted); }
.annotation-item p {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  color: #526072;
  font-size: 11px;
  line-height: 1.5;
}
.fleet-annotation-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  color: #c0772b;
  font-size: 12px;
  line-height: 1;
}
.related-report-list a { text-decoration: none; }
.home-section { margin-bottom: 22px; }
.home-kpi-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px;
}
.home-panel {
  display: flex;
  flex-direction: column;
  min-height: 215px;
}
.home-panel > .button { align-self: flex-start; margin-top: auto; }
.home-stat { display: grid; gap: 3px; margin: 5px 0 18px; }
.home-stat strong { color: var(--navy); font-size: 32px; }
.home-stat span { color: var(--muted); font-size: 11px; }
.warning-count-line {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  align-items: baseline;
  gap: 5px 8px;
  margin: 7px 0 18px;
}
.warning-count-line strong { font-size: 27px; }
.warning-count-line span { color: var(--muted); font-size: 10px; }
.workspace-summary.compact { grid-template-columns: 1fr; gap: 7px; }
.workspace-summary.compact article { box-shadow: none; }
.recent-exports { margin-top: 17px; }
.recent-export-list { display: grid; gap: 8px; }
.recent-export-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.recent-export-list article:last-child { border-bottom: 0; }
.recent-export-list article > div { display: grid; gap: 2px; min-width: 0; }
.recent-export-list [data-export-action] {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}
.recent-export-list small,
.export-unavailable { color: var(--muted); font-size: 11px; }
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #526072;
  background: #edf1f5;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .4px;
  text-transform: uppercase;
}
.status-succeeded { color: #176445; background: #e3f4eb; }
.status-failed { color: #9f2e38; background: #fae8ea; }
.status-running { color: #755400; background: #fff2c7; }
.report-directory { margin-top: 4px; }
.report-directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 10px;
}
.report-directory-grid > a {
  display: grid;
  gap: 5px;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface-soft);
  text-decoration: none;
}
.report-directory-grid > a:hover { border-color: #a9c8d2; background: #f2f8f9; }
.report-directory-grid span {
  color: var(--teal);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
}
.report-directory-grid small { color: var(--muted); line-height: 1.45; }
.glossary-toolbar .inline-form { margin: 0; padding: 0; border: 0; background: none; }
.glossary-toolbar .grow { flex: 1; }
.glossary-toolbar .grow input { width: 100%; }
.metric-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 14px;
}
.metric-definition { margin: 0; }
.metric-definition-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.metric-definition h2 { margin: 4px 0 0; font-size: 17px; }
.metric-definition > p { color: #526072; font-size: 11px; line-height: 1.55; }
.metric-definition dl { display: grid; gap: 7px; margin: 14px 0 0; }
.metric-definition dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
  font-size: 10px;
}
.metric-definition dt { color: var(--muted); }
.metric-definition dd { margin: 0; text-align: right; }
.planning-scenario-list { display: grid; gap: 10px; }
.group-permission-grid { margin: 13px 0; }

@media (max-width: 1024px) {
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .home-grid { grid-template-columns: 1fr; }
  .saved-view-row { align-items: flex-start; flex-direction: column; }
  .row-actions { justify-content: flex-start; }
}
@media (max-width: 560px) {
  .metric-catalog-grid { grid-template-columns: 1fr; }
  .filter-primary { grid-template-columns: 1fr; }
  .filter-actions { margin-top: 0; }
  .filter-actions .button { flex: 1; }
  .form-row { grid-template-columns: 1fr; }
  .recent-export-list article {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .recent-export-list article > :last-child {
    grid-column: 1 / -1;
    justify-self: flex-start;
  }
}

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