:root {
  color-scheme: dark;
  --bg: #030817;
  --panel: rgba(12, 20, 42, 0.78);
  --panel-2: rgba(17, 29, 58, 0.72);
  --line: rgba(124, 180, 255, 0.18);
  --text: #f6f8ff;
  --muted: #a9badc;
  --blue: #39d9ff;
  --amber: #ffa51e;
  --red: #ff4f9a;
  --purple: #a855f7;
  --teal: #25f4d0;
  --magenta: #ff4fd8;
  --cyan: #37e7ff;
  --violet: #8a5cff;
  --glass: rgba(10, 18, 40, 0.62);
  --stripe: rgba(255, 255, 255, 0.035);
  --table-bg: rgba(0, 0, 0, 0.07);
  --th-bg: rgba(255, 255, 255, 0.06);
  --hover-bg: rgba(67, 136, 255, 0.08);
  --modal-mask: rgba(2, 6, 14, 0.72);
}

body.light {
  color-scheme: light;
  --bg: #eff4ff;
  --panel: #dae7ff;
  --panel-2: #edf3ff;
  --line: #bfcee7;
  --text: #0f2340;
  --muted: #3f597f;
  --blue: #2f6bff;
  --amber: #e28a00;
  --red: #d63b4a;
  --purple: #6b46c1;
  --teal: #1fb3aa;
  --stripe: rgba(28, 56, 102, 0.06);
  --table-bg: #fdfdfd;
  --th-bg: #edf3ff;
  --hover-bg: #e4eeff;
  --modal-mask: rgba(16, 28, 48, 0.62);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 79, 216, 0.16), transparent 28%),
    radial-gradient(circle at 84% 12%, rgba(55, 231, 255, 0.16), transparent 24%),
    radial-gradient(circle at 72% 72%, rgba(138, 92, 255, 0.13), transparent 32%),
    linear-gradient(135deg, #020617 0%, #061026 45%, #030715 100%);
  color: var(--text);
  font: 13px/1.45 "Plus Jakarta Sans", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body.light::before,
body.light::after {
  display: none;
}

body::before {
  z-index: 0;
  opacity: 0.48;
  background:
    linear-gradient(110deg, transparent 0 38%, rgba(55, 231, 255, 0.12) 39%, transparent 41% 100%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 84px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 72px);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.85), transparent 74%);
}

body::after {
  z-index: 1;
  opacity: 0.34;
  background:
    radial-gradient(circle at 26% 38%, rgba(55, 231, 255, 0.2) 0 1px, transparent 2px),
    radial-gradient(circle at 66% 18%, rgba(255, 79, 216, 0.2) 0 1px, transparent 2px),
    radial-gradient(circle at 82% 56%, rgba(138, 92, 255, 0.22) 0 1px, transparent 2px);
  background-size: 180px 180px, 220px 220px, 260px 260px;
  animation: neon-particle-drift 24s cubic-bezier(0.32, 0.72, 0, 1) infinite alternate;
}

@keyframes neon-particle-drift {
  from { transform: translate3d(0, 0, 0); opacity: 0.24; }
  to { transform: translate3d(18px, -14px, 0); opacity: 0.42; }
}

@media (prefers-reduced-motion: reduce) {
  body::after {
    animation: none;
  }
}

.sidebar,
.main {
  position: relative;
  z-index: 2;
}

body.sidebar-collapsed {
  grid-template-columns: 64px minmax(0, 1fr);
}

* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--blue), var(--line) 35%) color-mix(in srgb, var(--panel), var(--bg) 35%);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: color-mix(in srgb, var(--panel), var(--bg) 35%);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid color-mix(in srgb, var(--panel), var(--bg) 35%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue), var(--line) 35%);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--blue);
}

.sidebar {
  min-height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  padding: 18px 12px;
  border-right: 1px solid rgba(55, 231, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(12, 20, 42, 0.9), rgba(5, 10, 24, 0.82)),
    radial-gradient(circle at 0% 8%, rgba(255, 79, 216, 0.16), transparent 34%);
  box-shadow: 18px 0 44px rgba(0, 0, 0, 0.25), inset -1px 0 0 rgba(255, 255, 255, 0.05);
  position: sticky;
  top: 0;
  align-self: start;
  transition: padding 160ms ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 30px 0 18px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex: 0 0 auto;
  box-shadow: 0 10px 24px rgba(47, 107, 255, 0.18);
}

.brand h1,
.topbar h1,
.section-head h2 {
  margin: 0;
  font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
}

.brand h1 {
  font-size: 18px;
  color: #ffffff;
  text-shadow: 0 0 22px rgba(55, 231, 255, 0.22);
}

.brand p,
.topbar p,
.section-head p,
.source-note p {
  margin: 4px 0 0;
  color: var(--muted);
}

.brand p,
.filter-section h2 {
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 11px;
}

.mode-button,
#resetButton,
#refreshButton,
#uploadButton,
.sidebar-toggle,
.font-toggle,
.tab,
.metric-card button {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  height: 34px;
  border-radius: 6px;
  cursor: pointer;
}

.sidebar-toggle {
  position: absolute;
  top: 16px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 999px;
  font-size: 20px;
  line-height: 1;
}

.mobile-sidebar-toggle {
  display: none;
}

.font-toggle {
  display: inline-grid;
  place-items: center;
  width: 40px;
  padding: 0;
  font-weight: 900;
}

.font-toggle[aria-pressed="true"] {
  color: var(--amber);
  border-color: var(--amber);
}

body.audience-font {
  font-size: 17px;
  line-height: 1.62;
}

body.sidebar-collapsed .sidebar {
  padding: 18px 10px;
  overflow: hidden;
}

body.sidebar-collapsed .brand {
  justify-content: center;
  margin: 48px 0 22px;
}

body.sidebar-collapsed .brand > div,
body.sidebar-collapsed .filter-section,
body.sidebar-collapsed .source-note,
body.sidebar-collapsed .sidebar .mode-button {
  display: none;
}

body.sidebar-collapsed .sidebar-toggle {
  left: 17px;
  right: auto;
}

.mode-button,
#resetButton,
#refreshButton,
#uploadButton {
  width: 100%;
}

#refreshButton,
#uploadButton {
  margin-top: 8px;
}

.filter-section {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.filter-section h2 {
  color: var(--muted);
  margin: 0 0 11px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.15px;
  font-size: 11px;
  margin-bottom: 11px;
}

.threshold-control {
  gap: 8px;
}

.threshold-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
}

.threshold-mode-button {
  min-height: 31px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
  cursor: pointer;
}

.threshold-mode-button:hover {
  border-color: var(--blue);
  color: var(--text);
}

.threshold-mode-button.active {
  border-color: color-mix(in srgb, var(--amber), var(--line) 35%);
  background: color-mix(in srgb, var(--amber), transparent 86%);
  color: var(--amber);
}

.filter-multi {
  position: relative;
  max-height: 33px;
}

.filter-multi-toggle {
  width: 100%;
  height: 33px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 8px;
  padding: 0 9px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.filter-multi-toggle:hover {
  border-color: var(--blue);
}

.filter-multi.open .filter-multi-toggle {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(67, 136, 255, 0.16);
}

.filter-multi-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-multi-toggle .caret {
  font-size: 12px;
  opacity: 0.8;
}

.filter-multi-panel {
  position: absolute;
  inset: 38px auto auto 0;
  z-index: 30;
  width: 100%;
  max-height: 300px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.2);
  padding: 8px;
  display: none;
}

.sidebar input[type="search"] {
  background: var(--panel-2);
}

.filter-multi.open .filter-multi-panel {
  display: block;
}

.filter-multi-options {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 250px;
  overflow: auto;
}

.filter-multi-tools {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  gap: 6px;
  padding-bottom: 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.filter-multi-search {
  width: 100%;
  height: 31px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  border-radius: 7px;
  padding: 0 10px;
  font-size: 13px;
}

.filter-multi-search:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(67, 136, 255, 0.14);
}

.filter-multi-count {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.filter-multi-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  min-height: 28px;
}

.filter-multi-option[hidden],
.filter-multi-empty[hidden] {
  display: none;
}

.filter-multi-option--all {
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  padding: 8px 12px;
  background: var(--panel);
  z-index: 1;
  margin-bottom: 4px;
}

.filter-multi-option:hover {
  background: var(--hover-bg);
}

.filter-multi-option input {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
}

.filter-multi-option input {
  margin: 0;
}

.filter-multi-empty {
  padding: 14px 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

select,
input[type="number"],
input[type="search"],
input[type="file"] {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  border-radius: 4px;
  padding: 0 10px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
}

input[type="file"] {
  height: auto;
  padding: 8px 10px;
}

input[type="range"] {
  accent-color: var(--blue);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
}

.source-note {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.main {
  padding: 52px 32px 28px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  font-size: 25px;
  color: var(--magenta);
  text-shadow: 0 0 30px rgba(255, 79, 216, 0.28), 0 0 18px rgba(55, 231, 255, 0.12);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 14px;
}

.utility-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.freshness-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 118px;
  padding: 7px 10px;
  border: 1px solid rgba(55, 231, 255, 0.35);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(11, 22, 48, 0.76), rgba(12, 15, 34, 0.58));
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.freshness-badge strong {
  color: var(--text);
  font-size: 13px;
}

.freshness-badge.good {
  border-color: color-mix(in srgb, var(--teal), var(--line) 35%);
}

.freshness-badge.warn {
  border-color: color-mix(in srgb, var(--amber), var(--line) 35%);
}

.freshness-badge.bad {
  border-color: color-mix(in srgb, var(--red), var(--line) 35%);
}

.guide-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(96, 165, 250, 0.48);
  background: linear-gradient(135deg, rgba(57, 217, 255, 0.2), rgba(138, 92, 255, 0.18));
  color: var(--text);
  border-radius: 999px;
  padding: 0;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.guide-button:hover {
  border-color: var(--blue);
  background: var(--hover-bg);
}

.dashboard-tooltip {
  position: fixed;
  z-index: 100;
  display: none;
  max-width: 260px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  white-space: pre-line;
  pointer-events: none;
}

.dashboard-tooltip.show {
  display: block;
}

.cards {
  display: grid;
  grid-template-columns: repeat(7, minmax(135px, 1fr));
  gap: 14px;
  margin: 24px 0 18px;
}

.metric-card {
  border: 1px solid rgba(134, 185, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(18, 30, 64, 0.72), rgba(9, 17, 38, 0.68));
  border-radius: 14px;
  padding: 18px 20px;
  border-top: 3px solid var(--cyan);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 34px rgba(0, 0, 0, 0.18);
  transition: transform 520ms cubic-bezier(0.32, 0.72, 0, 1), border-color 520ms cubic-bezier(0.32, 0.72, 0, 1), box-shadow 520ms cubic-bezier(0.32, 0.72, 0, 1);
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(55, 231, 255, 0.48);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 22px 46px rgba(55, 231, 255, 0.12);
}

.metric-card h3 {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.7px;
  font-size: 12px;
}

.metric-card .value {
  margin-top: 10px;
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
}

.metric-card .caption {
  color: var(--muted);
  margin-top: 8px;
  font-size: 13px;
}

.tabs {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(55, 231, 255, 0.22);
  border-radius: 18px;
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 79, 216, 0.08), transparent 30%),
    linear-gradient(110deg, rgba(55, 231, 255, 0.12), rgba(8, 16, 38, 0.74) 48%, rgba(138, 92, 255, 0.1)),
    rgba(3, 9, 23, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    inset 0 -1px 0 rgba(55, 231, 255, 0.08),
    0 20px 54px rgba(0, 0, 0, 0.24),
    0 0 46px rgba(55, 231, 255, 0.08);
}

.tabs::before,
.tabs::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
}

.tabs::before {
  inset: 1px;
  border-radius: 16px;
  background:
    linear-gradient(90deg, rgba(55, 231, 255, 0.12) 0 1px, transparent 1px 72px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 18px);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  opacity: 0.38;
}

.tabs::after {
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(55, 231, 255, 0.8), rgba(255, 79, 216, 0.78), transparent);
  box-shadow: 0 0 18px rgba(55, 231, 255, 0.36);
  opacity: 0.7;
}

.tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  height: auto;
  padding: 0 16px;
  border: 0;
  border-bottom: 0;
  background: transparent;
  border-radius: 12px;
  color: rgba(190, 209, 238, 0.82);
  font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-shadow: 0 0 18px rgba(55, 231, 255, 0);
  transition:
    transform 520ms cubic-bezier(0.32, 0.72, 0, 1),
    color 520ms cubic-bezier(0.32, 0.72, 0, 1),
    background 520ms cubic-bezier(0.32, 0.72, 0, 1),
    box-shadow 520ms cubic-bezier(0.32, 0.72, 0, 1);
}

.tab::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(55, 231, 255, 0.72), rgba(138, 92, 255, 0.72), rgba(255, 79, 216, 0.72));
  opacity: 0;
  transform: scaleX(0.78) scaleY(0.88);
  transition:
    opacity 520ms cubic-bezier(0.32, 0.72, 0, 1),
    transform 520ms cubic-bezier(0.32, 0.72, 0, 1);
  z-index: -2;
}

.tab::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: calc(12px - 1px);
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.28), transparent 22%),
    linear-gradient(135deg, rgba(8, 23, 48, 0.96), rgba(10, 16, 39, 0.9));
  opacity: 0;
  transition: opacity 520ms cubic-bezier(0.32, 0.72, 0, 1);
  z-index: -1;
}

.tab:hover {
  color: #e8f7ff;
  transform: translateY(-1px);
  background: rgba(55, 231, 255, 0.07);
}

.tab.active {
  color: #ffffff;
  background: transparent;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.14),
    0 12px 30px rgba(55, 231, 255, 0.18),
    0 0 42px rgba(255, 79, 216, 0.22);
  text-shadow: 0 0 16px rgba(55, 231, 255, 0.5);
  transform: translateY(-2px);
}

.tab.active::before,
.tab.active::after {
  opacity: 1;
  transform: scaleX(1) scaleY(1);
}

.tab.active .tab-badge {
  transform: translateY(-1px);
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--magenta, #ff4fd8), #ff6b8f);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
  box-shadow: 0 0 18px rgba(255, 79, 216, 0.28);
  transition:
    transform 520ms cubic-bezier(0.32, 0.72, 0, 1),
    box-shadow 520ms cubic-bezier(0.32, 0.72, 0, 1);
}

.panel {
  display: none;
  padding-top: 18px;
}

.panel.active {
  display: block;
}

body.light .tabs {
  border-color: rgba(37, 99, 235, 0.18);
  background:
    linear-gradient(135deg, rgba(219, 39, 119, 0.08), transparent 32%),
    linear-gradient(110deg, rgba(37, 99, 235, 0.1), rgba(255, 255, 255, 0.86) 48%, rgba(124, 58, 237, 0.08)),
    rgba(255, 255, 255, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 18px 42px rgba(15, 23, 42, 0.08);
}

body.light .tabs::before {
  background:
    linear-gradient(90deg, rgba(37, 99, 235, 0.08) 0 1px, transparent 1px 72px),
    linear-gradient(180deg, rgba(15, 23, 42, 0.045) 0 1px, transparent 1px 18px);
}

body.light .tabs::after {
  background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.58), rgba(219, 39, 119, 0.58), transparent);
  box-shadow: 0 0 18px rgba(37, 99, 235, 0.2);
}

body.light .tab {
  color: rgba(54, 70, 101, 0.84);
}

body.light .tab:hover {
  color: #15233d;
  background: rgba(37, 99, 235, 0.07);
}

body.light .tab.active {
  color: #0f172a;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.72),
    0 13px 30px rgba(37, 99, 235, 0.16),
    0 0 38px rgba(219, 39, 119, 0.15);
  text-shadow: none;
}

body.light .tab::after {
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.78), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.9));
}

.executive-kpis {
  display: grid;
  grid-template-columns: repeat(7, minmax(104px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.executive-card,
.overview-block {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(134, 185, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(17, 29, 61, 0.74), rgba(8, 15, 35, 0.68));
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 40px rgba(0, 0, 0, 0.18);
}

.executive-card {
  position: relative;
  padding: 12px 14px;
  border-top: 3px solid var(--line);
  overflow: hidden;
}

.executive-card::after,
.overview-block::after,
.auditor-panel::after,
.modal-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(255, 79, 216, 0.08), transparent 30%, rgba(55, 231, 255, 0.08));
  opacity: 0.7;
}

.executive-card.good { border-top-color: var(--teal); }
.executive-card.warn { border-top-color: var(--amber); }
.executive-card.bad { border-top-color: var(--magenta); }
.executive-card.neutral { border-top-color: var(--cyan); }

.executive-card span,
.executive-card small,
.block-head span,
.owner-row span,
.batch-row span {
  color: var(--muted);
}

.executive-card span {
  display: block;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  font-size: 11px;
}

.executive-card strong {
  display: block;
  margin-top: 6px;
  font-size: 27px;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 0 18px rgba(55, 231, 255, 0.16);
}

.executive-card small {
  display: block;
  margin-top: 6px;
  font-size: 12px;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.62fr);
  gap: 12px;
  align-items: stretch;
}

.auditor-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.auditor-movement-panel {
  min-height: 0;
  margin-bottom: 16px;
}

.weekly-movement {
  display: grid;
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  gap: 10px;
}

.movement-card {
  min-height: 82px;
  padding: 12px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.movement-card.good { border-top-color: var(--teal); }
.movement-card.warn { border-top-color: var(--amber); }
.movement-card.bad { border-top-color: var(--red); }
.movement-card.neutral { border-top-color: var(--blue); }

.movement-card.active,
.movement-card:hover {
  border-color: var(--blue);
  background: var(--hover-bg);
}

.movement-card span,
.movement-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.movement-card strong {
  display: block;
  margin: 6px 0 2px;
  font-size: 27px;
  line-height: 1;
}

.active-card-filter,
.auditor-filter-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 4px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--panel-2), var(--blue) 7%);
}

.active-card-filter[hidden],
.auditor-filter-strip[hidden] {
  display: none;
}

.active-card-filter div,
.auditor-filter-strip div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.active-card-filter span,
.active-card-filter small,
.auditor-filter-strip span,
.auditor-filter-strip small {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.active-card-filter strong,
.auditor-filter-strip strong {
  color: var(--blue);
  font-size: 13px;
}

.active-card-filter button,
.auditor-filter-strip button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.active-card-filter button:hover,
.auditor-filter-strip button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.auditor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.auditor-panel {
  position: relative;
  overflow: hidden;
  border-color: rgba(134, 185, 255, 0.18);
  background: linear-gradient(180deg, rgba(17, 29, 61, 0.74), rgba(8, 15, 35, 0.68));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 40px rgba(0, 0, 0, 0.18);
}

.modal-panel,
.guide-panel,
.audited-guide-panel {
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 79, 216, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(12, 22, 48, 0.94), rgba(5, 10, 24, 0.92));
  border-color: rgba(134, 185, 255, 0.22);
  box-shadow: 0 30px 84px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.modal-panel {
  position: relative;
  overflow: hidden;
}

.executive-card > *,
.overview-block > *,
.auditor-panel > *,
.modal-panel > * {
  position: relative;
  z-index: 1;
}

.filter-section select,
.filter-section input,
.sidebar input[type="search"],
.audited-filter-row select,
.audited-filter-row input,
.auditor-trend-select-label select {
  border-color: rgba(134, 185, 255, 0.2);
  background: rgba(4, 11, 27, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.filter-section select:focus,
.filter-section input:focus,
.sidebar input[type="search"]:focus,
.audited-filter-row select:focus,
.audited-filter-row input:focus,
.auditor-trend-select-label select:focus {
  outline: 0;
  border-color: rgba(55, 231, 255, 0.62);
  box-shadow: 0 0 0 3px rgba(55, 231, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.dashboard-tooltip,
.auditor-focus-list button[data-risk-tooltip]::after {
  border-color: rgba(55, 231, 255, 0.32);
  background: rgba(4, 10, 24, 0.96);
  box-shadow: 0 18px 48px rgba(55, 231, 255, 0.12), 0 18px 48px rgba(0, 0, 0, 0.3);
}
  min-width: 0;
  min-height: 250px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.pareto-chart {
  display: block;
  color: var(--text);
  min-height: 224px;
}

.pareto-combo-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.pareto-grid-line {
  stroke: currentColor;
  stroke-width: 1;
  stroke-opacity: 0.09;
}

.pareto-axis-line {
  stroke: currentColor;
  stroke-width: 1;
  stroke-opacity: 0.16;
}

.pareto-axis-line.right {
  stroke: var(--red);
  stroke-opacity: 0.25;
}

.pareto-axis-left,
.pareto-label-line,
.pareto-share-label {
  fill: currentColor;
  font-size: 12px;
}

.pareto-axis-left {
  opacity: 0.48;
}

.pareto-axis-right,
.pareto-cumulative-label {
  fill: var(--red);
  font-size: 12px;
}

.pareto-axis-right {
  opacity: 0.7;
}

.pareto-bar-rect {
  opacity: 0.9;
}

.pareto-value-label {
  fill: currentColor;
  font-size: 13px;
  font-weight: 800;
}

.pareto-label-line {
  opacity: 0.7;
  font-weight: 650;
}

.pareto-share-label {
  opacity: 0.42;
}

.pareto-cumulative-line {
  stroke: var(--red);
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.pareto-line-dot {
  fill: var(--panel);
  stroke: var(--red);
  stroke-width: 3;
}

.pareto-cumulative-label {
  font-weight: 800;
}

.auditor-load,
.audit-buckets {
  display: grid;
  gap: 10px;
}

.pareto-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.9fr) minmax(180px, 1.4fr) 44px;
  gap: 10px;
  align-items: center;
}

.pareto-label {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.pareto-label strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.pareto-label span,
.auditor-load-row span,
.auditor-load-row small,
.audit-bucket span {
  color: var(--muted);
  font-size: 12px;
}

.pareto-track {
  position: relative;
  height: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
}

.pareto-bar {
  position: absolute;
  inset: 0 auto 0 0;
  min-width: 4px;
  border-radius: inherit;
  background: var(--blue);
}

.pareto-1 { background: var(--amber); }
.pareto-2 { background: var(--purple); }
.pareto-3 { background: var(--teal); }
.pareto-4 { background: var(--red); }

.pareto-track i {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: var(--text);
  opacity: 0.38;
}

.pareto-row b {
  text-align: right;
  font-size: 13px;
  font-weight: 650;
}

.auditor-load-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.auditor-load-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.auditor-load-row small {
  grid-column: 1 / -1;
}

.audit-buckets {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.audit-bucket {
  min-height: 78px;
  padding: 14px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
}

.audit-bucket.good { border-top-color: var(--teal); }
.audit-bucket.warn { border-top-color: var(--amber); }
.audit-bucket.bad { border-top-color: var(--red); }
.audit-bucket.neutral { border-top-color: var(--blue); }

.audit-bucket strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.audit-bucket span {
  display: block;
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.table-section-head {
  margin-top: 8px;
}

.auditor-table {
  min-width: 2160px;
}

.movement-badge,
.mini-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.movement-badge.good,
.mini-badge.good { color: var(--teal); border-color: color-mix(in srgb, var(--teal), var(--line) 50%); }
.movement-badge.warn,
.mini-badge.warn { color: var(--amber); border-color: color-mix(in srgb, var(--amber), var(--line) 50%); }
.movement-badge.bad,
.mini-badge.bad { color: var(--red); border-color: color-mix(in srgb, var(--red), var(--line) 50%); }
.movement-badge.neutral,
.mini-badge.neutral { color: var(--blue); border-color: color-mix(in srgb, var(--blue), var(--line) 50%); }

.delta {
  font-weight: 700;
}

.delta.up { color: var(--teal); }
.delta.down { color: var(--red); }
.delta.flat { color: var(--muted); }

.escalation-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.repeat-offender-row td:first-child {
  box-shadow: inset 3px 0 0 var(--red);
}

.auditor-guide-panel {
  width: min(1120px, calc(100vw - 34px));
}

#auditedClientsModal {
  z-index: 110;
}

#exemptionsModal {
  z-index: 105;
}

#auditorMappingModal {
  z-index: 112;
}

.auditor-detail-panel {
  inset: 36px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: auto;
  height: auto;
}

.audited-clients-panel {
  inset: 32px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: auto;
  height: auto;
  background: color-mix(in srgb, var(--panel), var(--bg) 8%);
}

.exemptions-panel {
  inset: 42px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: auto;
  height: auto;
}

.auditor-mapping-panel {
  inset: 36px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  width: auto;
  height: auto;
}

.exemptions-modal-body {
  min-height: 0;
  overflow: auto;
  padding: 18px 22px 24px;
}

.exemptions-modal-table {
  max-height: min(62vh, 640px);
  background: var(--table-bg);
}

.auditor-mapping-tools {
  display: grid;
  grid-template-columns: minmax(220px, 420px) 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
}

.auditor-mapping-tools input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text);
  padding: 0 12px;
}

.auditor-mapping-tools span,
.auditor-mapping-status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auditor-mapping-table {
  min-height: 0;
  margin: 16px 22px 0;
  background: var(--table-bg);
}

.auditor-mapping-table td {
  vertical-align: middle;
}

.auditor-mapping-table td:first-child {
  min-width: 220px;
}

.auditor-mapping-table td:first-child strong,
.auditor-mapping-table td:first-child small {
  display: block;
}

.auditor-mapping-table td:first-child small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.auditor-mapping-table select,
.auditor-mapping-table input {
  width: 100%;
  min-width: 150px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  padding: 0 10px;
  font-size: 13px;
}

.mapping-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.mapping-status-pill.changed {
  border-color: var(--amber);
  color: var(--amber);
  background: color-mix(in srgb, var(--amber), transparent 88%);
}

.auditor-mapping-status {
  min-height: 18px;
  margin: 10px 22px 0;
}

.auditor-mapping-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px 20px;
}

.auditor-mapping-actions button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text);
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
}

.auditor-mapping-actions button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.auditor-detail-panel .modal-head span {
  display: block;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 1.6px;
  font-size: 12px;
  font-weight: 800;
}

.auditor-detail-panel .guide-body {
  min-height: 0;
  padding: 22px 24px 28px;
}

.audited-clients-body {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 20px 26px 24px;
}

.audited-head-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.audited-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.audited-view-toggle button {
  min-width: 112px;
  height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.audited-view-toggle button.active {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.22);
}

.audited-guide-toggle {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.audited-guide-toggle.active {
  border-color: color-mix(in srgb, var(--blue), var(--line) 30%);
  background: color-mix(in srgb, var(--blue), transparent 92%);
  color: var(--blue);
}

.audited-guide-backdrop[hidden],
.audited-guide-panel[hidden] {
  display: none !important;
}

.audited-guide-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(3px);
}

.audited-guide-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 91;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1120px, calc(100vw - 48px));
  max-height: min(82vh, 780px);
  overflow: hidden;
  border: 1px solid #d7e2f2;
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.24);
  transform: translate(-50%, -50%);
}

.audited-guide-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--blue), transparent 94%), var(--panel));
}

.audited-guide-head span {
  display: block;
  margin-bottom: 6px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.audited-guide-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  line-height: 1.15;
}

.audited-guide-head p {
  margin: 7px 0 0;
  max-width: 820px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

#auditedGuideClose {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.audited-guide-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  overflow: auto;
  padding: 18px 22px 22px;
}

.audited-guide-body > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.audited-guide-body h3 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.audited-guide-body p {
  display: grid;
  gap: 2px;
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.audited-guide-body strong {
  color: var(--text);
  font-size: 12px;
}

.audited-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

@media (max-width: 760px) {
  .audited-guide-panel {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 24px);
  }

  .audited-guide-head,
  .audited-guide-body {
    padding-left: 14px;
    padding-right: 14px;
  }

  .audited-guide-body {
    grid-template-columns: 1fr;
  }
}

.audited-kpi {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  min-height: 116px;
  padding: 18px 16px;
}

.audited-kpi i {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--blue);
  font-style: normal;
}

.audited-kpi i svg {
  width: 27px;
  height: 27px;
}

.audited-kpi.warn i,
.audited-kpi.warn strong { color: var(--amber); }
.audited-kpi.bad i,
.audited-kpi.bad strong { color: var(--red); }
.audited-kpi.good i { color: var(--teal); }
.audited-kpi.neutral i { color: var(--purple); }

.audited-kpi i.icon-blue { color: var(--blue); }
.audited-kpi i.icon-amber { color: var(--amber); }
.audited-kpi i.icon-red { color: var(--red); }
.audited-kpi i.icon-teal { color: var(--teal); }
.audited-kpi i.icon-purple { color: var(--purple); }

.audited-kpi strong {
  margin-top: 8px;
  color: var(--amber);
  font-size: 30px;
  line-height: 1.1;
}

.audited-insights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.audited-insights .auditor-panel {
  min-height: 214px;
  padding: 16px;
}

.audited-insight-list {
  display: grid;
  gap: 8px;
}

.audited-donut-panel {
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.audited-donut {
  position: relative;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 2px;
  width: 142px;
  height: 142px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: conic-gradient(var(--donut));
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.audited-donut::before {
  content: "";
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
}

.audited-donut strong,
.audited-donut span {
  position: relative;
  z-index: 1;
  display: block;
  line-height: 1.1;
}

.audited-donut strong {
  font-size: 22px;
  font-weight: 400;
}

.audited-donut span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.audited-donut-legend {
  display: grid;
  gap: 8px;
}

.audited-legend-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  text-align: left;
}

.audited-legend-row i {
  width: 11px;
  height: 11px;
  border-radius: 3px;
}

.audited-legend-row i.good { background: var(--teal); }
.audited-legend-row i.warn { background: var(--amber); }
.audited-legend-row i.bad { background: var(--red); }
.audited-legend-row i.neutral { background: #c8ced8; }

.audited-legend-row small {
  color: var(--muted);
  font-size: 12px;
}

.audited-bar-row,
.audited-queue-row,
.audited-risk-table button {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.audited-bar-row {
  display: grid;
  gap: 5px;
  padding: 5px 0 8px;
}

.audited-bar-row div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.audited-bar-row span,
.audited-queue-row span,
.audited-risk-table span {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audited-bar-row b {
  display: block;
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line), transparent 25%);
  overflow: hidden;
}

.audited-bar-row b i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--amber);
}

.audited-queue-row,
.audited-risk-table button,
.audited-risk-table > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 30px;
  padding: 5px 0;
}

.audited-queue-row strong {
  min-width: 24px;
  padding: 2px 8px;
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.queue-rank-1 { background: var(--red); }
.queue-rank-2 { background: #f97316; }
.queue-rank-3 { background: var(--amber); }
.queue-rank-4 { background: var(--blue); }

.audited-risk-table > div {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.audited-risk-table strong {
  color: var(--amber);
  font-weight: 800;
}

.audited-risk-table strong.good { color: var(--teal); }
.audited-risk-table strong.warn { color: var(--amber); }
.audited-risk-table strong.bad { color: var(--red); }

.audited-insight-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text);
  text-align: left;
}

.audited-insight-row span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audited-insight-row strong {
  color: var(--amber);
  font-size: 16px;
  font-weight: 700;
}

.audited-filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  align-items: end;
  margin-top: 14px;
  padding: 0 6px;
  border: 0;
  background: transparent;
}

.audited-filter-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.audited-filter-row select,
.audited-filter-row input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 10px;
}

.audited-table-wrap {
  margin-top: 14px;
  max-height: min(62vh, 760px);
  border-radius: 7px;
  background: var(--table-bg);
}

.audited-clients-table {
  min-width: 1720px;
}

.audited-clients-table th,
.audited-clients-table td {
  padding: 8px 10px;
  height: 40px;
  vertical-align: top;
}

.audited-clients-table td {
  font-size: 12.5px;
  line-height: 1.35;
}

.audited-comment {
  max-width: 340px;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.audited-auditors-view {
  display: grid;
  gap: 16px;
}

.audited-auditors-view[hidden],
#auditedExecutiveView[hidden] {
  display: none !important;
}

.auditor-recommendation-band {
  display: flex;
  align-items: center;
  min-height: 42px;
  margin-bottom: 2px;
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--blue), var(--line) 62%);
  border-left: 4px solid var(--blue);
  border-radius: 7px;
  background: color-mix(in srgb, var(--blue), transparent 94%);
  color: var(--text);
  font-size: 13px;
}

.auditor-productivity-hidden {
  display: none !important;
}

.auditor-control-kpis {
  margin-bottom: 16px;
}

.auditor-view-grid {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.auditor-view-main {
  display: grid;
  gap: 18px;
}

.auditor-productivity-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(320px, 0.85fr);
  gap: 14px;
  align-items: stretch;
}

.productivity-panel {
  min-height: 280px;
}

.auditor-workload-panel {
  align-self: stretch;
  min-height: 640px;
}

.auditor-side-panels,
.auditor-ops-bottom {
  display: grid;
  gap: 14px;
}

.auditor-ops-bottom {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.auditor-trend-summary {
  display: none;
}

.auditor-trend-summary span {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.auditor-trend-select-label {
  display: grid;
  gap: 4px;
  min-width: 250px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.auditor-trend-select-label select {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.auditor-workload-list button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.auditor-trend-chart {
  min-height: 0;
  margin-top: 12px;
  border: 1px solid rgba(45, 212, 191, 0.24);
  border-radius: 14px;
  background:
    radial-gradient(circle at 18% 0%, rgba(45, 212, 191, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(12, 21, 38, 0.98), rgba(9, 15, 27, 0.96));
  padding: 16px 18px 12px;
  color: #2dd4bf;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 16px 34px rgba(0, 0, 0, 0.18);
}

.auditor-trend-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
}

.auditor-trend-card-head strong {
  color: #eef6ff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1.3px;
  line-height: 1.2;
  text-transform: uppercase;
}

.auditor-trend-card-head span {
  color: #98aac6;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.auditor-trend-card-head span {
  display: grid;
  gap: 3px;
  justify-items: end;
  text-align: right;
}

.auditor-trend-card-head span b {
  color: #b8c8df;
  font-size: 11px;
  font-weight: 900;
}

.auditor-trend-card-head span small {
  color: #8394b0;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.auditor-trend-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 8px;
}

.auditor-trend-tabs span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 11px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  color: #d8e6f6;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 1px 0 rgba(24, 45, 79, 0.03);
}

.auditor-trend-tabs span.active {
  border-color: #2dd4bf;
  background: #14b8a6;
  color: #04111f;
}

.auditor-trend-svg {
  width: 100%;
  height: auto;
  aspect-ratio: 620 / 282;
  display: block;
}

.trend-grid {
  stroke: rgba(148, 163, 184, 0.16);
  stroke-width: 1;
}

.trend-grid-vertical {
  stroke: rgba(148, 163, 184, 0.1);
  stroke-width: 1;
}

.trend-axis-line {
  stroke: rgba(148, 163, 184, 0.22);
  stroke-width: 1;
}

.trend-axis,
.trend-day,
.trend-value {
  fill: #9fb0ca;
  font-size: 11px;
  font-weight: 800;
}

.trend-day,
.trend-value {
  text-anchor: middle;
}

.trend-area.completed {
  display: none;
}

.trend-line {
  fill: none;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-line-shadow {
  fill: none;
  stroke: rgba(45, 212, 191, 0.2);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-line.completed { stroke: #2dd4bf; fill: none; }
.trend-line.pending { stroke: var(--amber); fill: none; }
.trend-line.overdue { stroke: var(--red); fill: none; }
.trend-dot.completed { stroke: #2dd4bf; fill: #2dd4bf; }
.auditor-trend-legend i.completed,
.auditor-workload-list i.completed { stroke: var(--teal); background: var(--teal); fill: var(--teal); }
.trend-dot.pending,
.auditor-trend-legend i.pending,
.auditor-workload-list i.pending { stroke: var(--amber); background: var(--amber); fill: var(--amber); }
.trend-dot.overdue,
.auditor-trend-legend i.overdue,
.auditor-workload-list i.overdue { stroke: var(--red); background: var(--red); fill: var(--red); }

.trend-dot-halo {
  fill: #0b1323;
  stroke: rgba(45, 212, 191, 0.28);
  stroke-width: 4;
}

.trend-value-chip rect {
  fill: #0f1b2f;
  stroke: rgba(148, 163, 184, 0.28);
  stroke-width: 1;
}

.trend-value-chip text {
  fill: #d7e6f8;
  font-size: 9.5px;
  font-weight: 900;
  text-anchor: middle;
  dominant-baseline: middle;
}

.trend-average-line,
.legend-average-line {
  stroke: #91a1b8;
  stroke-width: 1.6;
  stroke-dasharray: 6 5;
  stroke-linecap: round;
  opacity: 0.82;
}

.auditor-trend-svg-legend text {
  fill: #d8e6f6;
  font-size: 11px;
  font-weight: 800;
}

.legend-dot.completed {
  fill: none;
  stroke: #2dd4bf;
  stroke-width: 3;
}

body.light .auditor-trend-chart {
  border-color: #cfe4dd;
  background:
    radial-gradient(circle at 18% 0%, rgba(20, 184, 166, 0.11), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 250, 248, 0.94));
  color: #0f9f8e;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

body.light .auditor-trend-card-head strong { color: #17233c; }
body.light .auditor-trend-card-head span { color: #64769a; }
body.light .auditor-trend-card-head span b { color: #64769a; }
body.light .auditor-trend-card-head span small { color: color-mix(in srgb, #64769a, transparent 12%); }
body.light .auditor-trend-tabs span {
  border-color: #dbe5f4;
  background: #ffffff;
  color: #203653;
}
body.light .auditor-trend-tabs span.active {
  border-color: #14b8a6;
  background: #14b8a6;
  color: #ffffff;
}
body.light .trend-grid { stroke: #e6edf7; }
body.light .trend-grid-vertical { stroke: #eef3fb; }
body.light .trend-axis-line { stroke: #d8e2f0; }
body.light .trend-axis,
body.light .trend-day,
body.light .trend-value { fill: #50658d; }
body.light .trend-line-shadow { stroke: rgba(20, 184, 166, 0.18); }
body.light .trend-dot-halo {
  fill: var(--panel);
  stroke: rgba(20, 184, 166, 0.24);
}
body.light .trend-value-chip rect {
  fill: var(--panel);
  stroke: #d8e2f2;
}
body.light .trend-value-chip text { fill: #273b5f; }
body.light .trend-average-line,
body.light .legend-average-line { stroke: #6f7f95; }
body.light .auditor-trend-svg-legend text { fill: #293b59; }

.auditor-trend-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.auditor-trend-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.auditor-trend-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.auditor-focus-list,
.auditor-coaching-list,
.auditor-workload-list,
.auditor-quality-funnel {
  display: grid;
  gap: 8px;
}

.auditor-workload-list {
  overflow: visible;
}

.auditor-workload-panel .block-head {
  align-items: flex-start;
}

.auditor-workload-panel .block-head span {
  text-align: right;
}

.auditor-focus-list button,
.auditor-coaching-list button {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 7px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.auditor-focus-list button[data-risk-tooltip]::after {
  content: attr(data-risk-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 6;
  width: min(360px, 86vw);
  max-width: 360px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: #07111f;
  color: #e6f0ff;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.32);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  text-transform: none;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  white-space: pre-line;
}

.auditor-focus-list button[data-risk-tooltip]:hover::after,
.auditor-focus-list button[data-risk-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

body.light .auditor-focus-list button[data-risk-tooltip]::after {
  border-color: #d8e2f0;
  background: #ffffff;
  color: #17233c;
  box-shadow: 0 18px 38px rgba(24, 45, 79, 0.18);
}

.auditor-focus-list span,
.auditor-coaching-list span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.auditor-focus-list b,
.auditor-coaching-list b {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auditor-focus-list small,
.auditor-coaching-list small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auditor-focus-list strong,
.auditor-coaching-list strong {
  min-width: 36px;
  padding: 3px 8px;
  border-radius: 6px;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.auditor-focus-list strong.bad,
.auditor-coaching-list button.bad strong { background: var(--red); }
.auditor-focus-list strong.warn,
.auditor-coaching-list button.warn strong { background: var(--amber); }
.auditor-coaching-list button.neutral strong { background: var(--blue); }
.auditor-coaching-list button.good strong { background: var(--teal); }

.auditor-coaching-list button.active {
  border-color: color-mix(in srgb, var(--blue), var(--line) 30%);
  background: color-mix(in srgb, var(--blue), transparent 94%);
}

.auditor-workload-list button {
  display: grid;
  gap: 7px;
  padding: 8px 9px;
}

.auditor-workload-list button > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.auditor-workload-list span {
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auditor-workload-list strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.auditor-workload-list b {
  display: flex;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line), transparent 25%);
}

.auditor-workload-list i {
  height: 100%;
}

.auditor-quality-funnel > div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 44px 44px;
  gap: 10px;
  align-items: center;
  min-height: 32px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
}

.auditor-quality-funnel span {
  font-weight: 800;
}

.auditor-quality-funnel b {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line), transparent 25%);
}

.auditor-quality-funnel i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.auditor-quality-funnel strong {
  color: var(--teal);
  font-weight: 900;
}

.auditor-quality-funnel small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.compact-action {
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}

.audited-actions-cell {
  vertical-align: middle;
  white-space: nowrap;
}

.audited-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.audited-clients-table .client-link {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--blue), transparent 68%);
  text-underline-offset: 3px;
}

.audited-clients-table .client-link:hover,
.audited-clients-table .client-link:focus-visible {
  text-decoration-color: currentColor;
}

.mode-button.subtle {
  color: var(--muted);
}

.audit-form-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#ownerNotificationModal {
  z-index: 120;
}

.owner-notification-panel {
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  display: block;
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}

.owner-notification-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px 24px;
}

.owner-notification-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.owner-notification-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.owner-notification-field label {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.owner-notification-field input,
.owner-notification-field textarea {
  width: 100%;
  font-family: monospace;
  font-size: 0.82rem;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  resize: vertical;
  box-sizing: border-box;
}

.sample-label {
  display: block;
  margin-top: 5px;
  color: var(--amber);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

body.light .audited-clients-panel,
body.light .audited-donut::before {
  background: #ffffff;
}

body.light .audited-kpi,
body.light .audited-insights .auditor-panel,
body.light .audited-table-wrap {
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(30, 52, 88, 0.08);
}

body.light .audited-filter-row select,
body.light .audited-filter-row input {
  background: #ffffff;
}

.auditor-detail-panel .auditor-panel {
  min-height: 0;
}

.audit-detail-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 12px;
}

.audit-detail-summary article {
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
}

.audit-detail-summary span,
.audit-detail-summary small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.audit-detail-summary strong {
  display: block;
  margin: 6px 0;
  font-size: 24px;
  line-height: 1.1;
}

.audit-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 14px;
  margin-top: 14px;
}

.audit-field-list {
  display: grid;
  gap: 8px;
}

.audit-field-list p {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 12px;
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.audit-field-list strong {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.audit-trend {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
}

.audit-trend-point {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
}

.audit-trend-point span,
.audit-trend-point small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.audit-trend-point strong {
  display: block;
  margin: 5px 0;
  font-size: 23px;
}

.audit-trend-current {
  border-color: var(--blue);
}

.audit-trend-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.audit-trend-flag {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 5px;
  border-radius: 3px;
  border: 1px solid currentColor;
  line-height: 1.4;
}

.audit-trend-flag--dq {
  color: var(--red);
}

.audit-trend-flag--rdns {
  color: var(--amber);
}

.audit-trend-flag--clean {
  color: var(--muted);
  border-color: var(--line);
}

.audit-trend-flag .trend-flag-value {
  font-style: normal;
  opacity: 0.7;
  font-size: 0.82em;
  margin-left: 2px;
}

.audit-trend-section {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.audit-trend-section-head {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.audit-trend-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.audit-trend-section-score {
  font-size: 13px;
  font-weight: 700;
}

.audit-trend-section--dq .audit-trend-section-score {
  color: var(--red);
}

.audit-trend-section--rdns .audit-trend-section-score {
  color: var(--amber);
}

.audit-trend-section .audit-trend-flags {
  margin-top: 4px;
}

.audit-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.audit-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.audit-form input,
.audit-form select,
.audit-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  padding: 9px 10px;
  font: inherit;
  text-transform: none;
  letter-spacing: 0;
}

.audit-detail-readonly .audit-form input[readonly],
.audit-detail-readonly .audit-form textarea[readonly],
.audit-detail-readonly .audit-form select:disabled {
  cursor: default;
  opacity: 1;
  color: var(--text);
  background: color-mix(in srgb, var(--panel-2), var(--bg) 20%);
}

.audit-detail-readonly td[data-cell-key] {
  cursor: default;
}

.audit-detail-readonly td[data-cell-key]:hover {
  outline: none;
}

.audit-form textarea {
  min-height: 86px;
  resize: vertical;
}

.audit-form .mode-button {
  align-self: end;
}

.audit-form label:has(#auditRootCauseOther) {
  grid-column: 1 / -1;
}

.audit-form .audit-comment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  grid-column: 1 / -1;
  margin-bottom: -8px;
}

.audit-form > textarea[readonly] {
  grid-column: 1 / -1;
  min-height: 70px;
  resize: vertical;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--muted);
  padding: 9px 10px;
  font: inherit;
}

.comment-ts {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

.audit-comment-history {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 280px;
  overflow-y: auto;
}

.history-entry {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.history-entry:last-child { border-bottom: none; padding-bottom: 0; }

.history-entry-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.history-entry-head strong { font-size: 13px; color: var(--text); }

.history-scores {
  font-size: 11px;
  color: var(--muted);
}

.history-entry p {
  margin: 0;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.history-entry small {
  font-size: 11px;
  color: var(--muted);
}

.muted { color: var(--muted); font-size: 13px; }

.guide-steps {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
}

.guide-steps li {
  margin-bottom: 8px;
}

.overview-block {
  padding: 12px;
  min-width: 0;
  font-size: 13px;
}

.overview-block-wide {
  min-height: 190px;
}

.readiness-overview-block {
  min-height: 300px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.owner-queue-block {
  min-height: 300px;
  display: grid;
  grid-template-rows: auto auto;
}

.block-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.block-head h3 {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
}

.block-title-button {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.block-title-button:hover,
.block-title-button:focus-visible {
  color: var(--blue);
}

.block-head span {
  font-size: 11px;
}

.readiness-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(124px, 1fr));
  gap: 8px;
  min-height: 0;
}

.readiness-lane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
  padding: 10px;
  border: 1px solid rgba(134, 185, 255, 0.18);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(13, 24, 54, 0.78), rgba(8, 14, 31, 0.72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.readiness-lane.good { border-top: 3px solid var(--teal); }
.readiness-lane.warn { border-top: 3px solid var(--amber); }
.readiness-lane.bad { border-top: 3px solid var(--magenta); }

.lane-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lane-head strong {
  font-size: 13px;
}

.lane-head span {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 24px;
  border-radius: 999px;
  background: var(--bg);
  font-weight: 800;
  font-size: 13px;
}

.lane-items,
.owner-queue,
.intervention-list,
.batch-readiness {
  display: grid;
  gap: 8px;
}

.owner-queue {
  align-content: start;
}

.lane-items {
  align-content: start;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.client-chip,
.intervention-row {
  width: 100%;
  border: 1px solid rgba(134, 185, 255, 0.16);
  background: rgba(6, 15, 34, 0.64);
  color: var(--text);
  border-radius: 9px;
  cursor: pointer;
  transition: transform 420ms cubic-bezier(0.32, 0.72, 0, 1), border-color 420ms cubic-bezier(0.32, 0.72, 0, 1), background 420ms cubic-bezier(0.32, 0.72, 0, 1);
}

.client-chip {
  min-height: 28px;
  padding: 4px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  text-align: left;
  font-size: 12px;
  line-height: 1.25;
}

.client-chip small {
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}

.client-chip--overflow {
  justify-content: center;
  color: var(--muted);
  font-style: italic;
  border-style: dashed;
}

.client-chip:hover,
.intervention-row:hover {
  transform: translateY(-1px);
  border-color: rgba(55, 231, 255, 0.48);
  background: rgba(55, 231, 255, 0.08);
}

.director-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, color-mix(in srgb, var(--blue), transparent 90%), transparent 65%);
  color: var(--muted);
}

.director-detail-head strong {
  color: var(--text);
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.director-detail-table {
  min-height: 0;
  max-height: min(72vh, 760px);
  overflow: auto;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.director-detail-table table {
  min-width: 100%;
}

.director-detail-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.director-portfolio-table table {
  min-width: 1380px;
}

.director-modal-panel {
  grid-template-rows: auto auto minmax(0, 1fr);
  max-width: min(1840px, calc(100vw - 16px));
  margin: 0 auto;
  border-color: color-mix(in srgb, var(--blue), var(--line) 70%);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.director-modal-panel .modal-head {
  padding: 22px 26px 18px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue), transparent 86%), transparent 48%),
    var(--panel);
}

.director-modal-panel .modal-head h2 {
  font-size: 28px;
}

.director-modal-panel .modal-meta {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  padding: 16px 26px;
  background: var(--panel-2);
}

.director-modal-panel .modal-meta .pill {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.director-modal-panel .modal-meta .chip-label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.director-modal-panel .modal-meta .chip-value {
  font-size: 22px;
  line-height: 1;
}

.sort-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.sort-header:hover {
  color: var(--amber);
}

.sort-header::after {
  content: "";
  color: var(--muted);
  font-size: 11px;
}

.sort-header.active::after {
  content: "^";
}

.sort-header.active[data-direction="desc"]::after {
  content: "v";
}

.signoff-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.signoff-status.pending {
  color: var(--amber);
  border-color: color-mix(in srgb, var(--amber), var(--line) 45%);
  background: color-mix(in srgb, var(--amber), transparent 88%);
}

.signoff-status.approved {
  color: var(--teal);
  border-color: color-mix(in srgb, var(--teal), var(--line) 45%);
  background: color-mix(in srgb, var(--teal), transparent 88%);
}

.portfolio-status {
  font-weight: 850;
}

.portfolio-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 28px;
  border-radius: 999px;
  background: var(--panel-2);
}

.portfolio-score.good { color: var(--teal); }
.portfolio-score.warn { color: var(--amber); }
.portfolio-score.bad { color: var(--red); }

.dq-score {
  font-weight: 850;
  color: var(--blue);
}

.issue-summary {
  display: inline-block;
  max-width: 280px;
  color: var(--muted);
  line-height: 1.35;
}

.portfolio-row.bad td:first-child {
  box-shadow: inset 4px 0 0 var(--red);
}

.portfolio-row.warn td:first-child {
  box-shadow: inset 4px 0 0 var(--amber);
}

.portfolio-row.good td:first-child {
  box-shadow: inset 4px 0 0 var(--teal);
}

.signoff-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.date-slicer {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
}

.date-slicer-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.date-slicer-head span,
.date-slicer label span {
  color: var(--muted);
  font-size: 12px;
}

.date-slicer-head strong {
  color: var(--amber);
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
}

.range-slicer {
  position: relative;
  height: 30px;
}

.range-slicer::before,
.range-slicer::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 14px;
  height: 5px;
  border-radius: 999px;
  pointer-events: none;
}

.range-slicer::before {
  background: var(--bg);
  border: 1px solid var(--line);
}

.range-slicer::after {
  left: var(--date-start, 0%);
  right: calc(100% - var(--date-end, 100%));
  background: var(--amber);
}

.range-slicer input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  appearance: none;
  background: transparent;
  pointer-events: none;
}

.range-slicer input[type="range"]::-webkit-slider-runnable-track {
  height: 30px;
  background: transparent;
}

.range-slicer input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 17px;
  height: 17px;
  margin-top: 6px;
  border-radius: 999px;
  border: 2px solid var(--panel);
  background: var(--amber);
  box-shadow: 0 0 0 1px var(--line), 0 4px 12px rgba(0, 0, 0, 0.25);
  pointer-events: auto;
}

.range-slicer input[type="range"]::-moz-range-track {
  height: 30px;
  background: transparent;
}

.range-slicer input[type="range"]::-moz-range-thumb {
  width: 17px;
  height: 17px;
  border-radius: 999px;
  border: 2px solid var(--panel);
  background: var(--amber);
  box-shadow: 0 0 0 1px var(--line), 0 4px 12px rgba(0, 0, 0, 0.25);
  pointer-events: auto;
}

.date-slicer-values {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.owner-row,
.batch-row,
.intervention-row {
  display: grid;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.owner-row {
  grid-template-columns: minmax(120px, 1fr) repeat(4, minmax(34px, 46px));
  column-gap: 5px;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
  transition: background 420ms cubic-bezier(0.32, 0.72, 0, 1), transform 420ms cubic-bezier(0.32, 0.72, 0, 1);
}

.owner-row:hover {
  background: rgba(55, 231, 255, 0.06);
  transform: translateX(2px);
}

.owner-queue-header {
  display: grid;
  grid-template-columns: minmax(128px, 1fr) repeat(6, minmax(48px, 58px));
  gap: 8px;
  padding: 0 10px 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.owner-queue-header span:not(:first-child) {
  text-align: center;
}

.owner-row div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.owner-row div:not(:first-child) {
  min-width: 44px;
}

.owner-row b {
  font-size: 14px;
  line-height: 1.1;
  font-weight: 700;
}

.owner-row span,
.batch-row span,
.intervention-row small {
  font-size: 11px;
  line-height: 1.25;
}

.owner-row div:not(:first-child) span {
  font-size: 10px;
  white-space: nowrap;
}

.owner-person span {
  font-size: 11px;
}

.owner-name-button {
  width: fit-content;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-name-button:hover,
.owner-name-button:focus-visible {
  color: var(--blue);
  text-decoration: underline;
  outline: none;
}

.batch-row {
  grid-template-columns: 100px minmax(120px, 1fr) 90px 90px 110px;
  width: 100%;
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font: inherit;
  text-align: left;
  transition: background 420ms cubic-bezier(0.32, 0.72, 0, 1), transform 420ms cubic-bezier(0.32, 0.72, 0, 1);
}

.batch-row:hover,
.batch-row:focus-visible {
  background: rgba(55, 231, 255, 0.06);
  outline: none;
  transform: translateX(2px);
}

.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg);
}

.progress span {
  display: block;
  height: 100%;
  background: var(--teal);
}

.intervention-row {
  grid-template-columns: minmax(120px, 1fr) 44px 130px;
  padding: 8px 10px;
  text-align: left;
  font-size: 12px;
}

.intervention-row strong {
  font-size: 14px;
}

.intervention-row strong.good { color: var(--teal); }
.intervention-row strong.warn { color: var(--amber); }
.intervention-row strong.bad { color: var(--red); }

.empty-state {
  color: var(--muted);
  padding: 14px 0;
}

.planning-summary,
.detail-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.detail-period-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.detail-period-controls button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  padding: 0 12px;
  font-weight: 800;
  cursor: pointer;
}

.detail-period-controls button.active {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue), var(--panel) 82%);
}

.top-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  height: 16px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}

.top-scroll > div {
  height: 1px;
}

.modal-panel > .top-scroll {
  margin: 10px 22px 6px;
}

.summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
}

.exemption-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.modal-exemptions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--amber), var(--panel) 94%);
}

.modal-exemption-head {
  display: grid;
  gap: 2px;
}

.modal-exemption-head strong {
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-size: 12px;
}

.modal-exemption-head span {
  color: var(--muted);
  font-size: 13px;
}

.modal-exemption-list {
  display: grid;
  grid-column: 1 / -1;
  gap: 6px;
}

.modal-exemption-list article {
  display: grid;
  gap: 2px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.modal-exemption-list article strong {
  font-size: 12px;
}

.modal-exemption-list article span,
.modal-exemption-list article small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.modal-exemption-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}

.modal-exemption-actions button,
.remove-exemption {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  padding: 0 11px;
  font-weight: 800;
  cursor: pointer;
}

.modal-exemption-actions button:hover,
.remove-exemption:hover {
  border-color: var(--amber);
  color: var(--amber);
}

.dev-audit-reference {
  display: grid;
  grid-template-columns: minmax(190px, 0.32fr) 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--panel-strong);
}

.dev-audit-reference span,
.dev-audit-reference small {
  color: var(--muted);
}

.dev-audit-reference > div:first-child span {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.dev-audit-reference strong {
  display: block;
  color: var(--text);
  font-size: 16px;
}

.dev-audit-copy {
  display: grid;
  gap: 6px;
}

.summary-pill strong {
  color: var(--text);
}

.summary-pill.good { border-color: color-mix(in srgb, var(--teal), var(--line) 40%); }
.summary-pill.warn { border-color: color-mix(in srgb, var(--amber), var(--line) 40%); }
.summary-pill.bad { border-color: color-mix(in srgb, var(--red), var(--line) 40%); }

.detail-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.legend-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.legend-swatch.tps,
.source-tps {
  background: rgba(67, 136, 255, 0.09);
}

.legend-swatch.go-live,
.source-golive {
  background: rgba(255, 165, 30, 0.16);
}

.legend-swatch.datanitiv,
.source-datanitiv {
  background: rgba(34, 197, 186, 0.09);
}

.legend-swatch.breach {
  background: rgba(255, 70, 85, 0.34);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
}

.section-head h2 {
  text-transform: uppercase;
  letter-spacing: 1.7px;
  font-size: 14px;
  color: var(--muted);
}

.section-head input {
  max-width: 360px;
}

.export-button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--blue), var(--line) 45%);
  border-radius: 7px;
  background: color-mix(in srgb, var(--blue), var(--panel) 88%);
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}

.export-button:hover {
  border-color: var(--blue);
  background: var(--hover-bg);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

#alerts > .table-wrap {
  max-height: calc(100vh - 250px);
}

#planning > .table-wrap {
  max-height: calc(100vh - 330px);
}

#scoring > .table-wrap {
  max-height: calc(100vh - 470px);
}

.tps-compare-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(150px, 0.42fr) minmax(340px, 1.25fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-2), var(--bg) 18%);
}

.tps-compare-controls > label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.tps-compare-controls > label > span,
.tps-compare-context small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.9px;
  text-transform: uppercase;
}

.tps-compare-controls select {
  width: 100%;
  min-width: 0;
}

.tps-compare-context {
  display: grid;
  grid-template-columns: minmax(140px, 0.6fr) minmax(220px, 1fr);
  gap: 8px;
  min-width: 0;
}

.tps-compare-context > span {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.tps-compare-context strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tps-compare-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.tps-compare-notice {
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--amber), var(--line) 40%);
  border-left: 4px solid var(--amber);
  border-radius: 7px;
  background: color-mix(in srgb, var(--amber), var(--panel) 92%);
  color: var(--text);
  font-size: 12px;
  line-height: 1.55;
}

.tps-compare-notice[hidden] {
  display: none;
}

.tps-compare-legend {
  margin: 0 0 10px;
}

.tps-compare-table-wrap {
  min-height: 220px;
  max-height: calc(100vh - 470px);
  border-radius: 6px;
}

.tps-compare-table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  --tps-metric-width: 176px;
  --tps-mode-width: 118px;
  --tps-week-width: 132px;
  /* Sticky columns must be opaque so scrolled week values cannot bleed through. */
  --tps-frozen-bg: color-mix(in srgb, var(--bg) 92%, var(--text) 8%);
  --tps-frozen-head-bg: color-mix(in srgb, var(--bg) 86%, var(--text) 14%);
}

.tps-compare-table col.tps-metric-col,
.tps-compare-table .tps-metric-col {
  width: var(--tps-metric-width);
  min-width: var(--tps-metric-width);
  max-width: var(--tps-metric-width);
}

.tps-compare-table col.tps-mode-col,
.tps-compare-table .tps-mode-col {
  width: var(--tps-mode-width);
  min-width: var(--tps-mode-width);
  max-width: var(--tps-mode-width);
}

.tps-compare-table col.tps-week-col,
.tps-compare-table .tps-week-col {
  width: var(--tps-week-width);
  min-width: var(--tps-week-width);
  max-width: var(--tps-week-width);
}

.tps-compare-table th,
.tps-compare-table td {
  box-sizing: border-box;
  height: 46px;
  padding: 8px 10px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tps-compare-table thead th {
  position: sticky;
  top: 0;
  z-index: 18;
  height: 52px;
  background: var(--th-bg);
  box-shadow: 0 1px 0 var(--line), 0 8px 14px rgba(0, 0, 0, 0.12);
  vertical-align: middle;
}

.tps-compare-table thead .tps-week-col {
  text-align: center;
}

.tps-compare-table thead .tps-week-col span,
.tps-compare-table thead .tps-week-col small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tps-compare-table thead .tps-week-col small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.7px;
}

.tps-compare-table .tps-metric-col,
.tps-compare-table .tps-mode-col {
  position: sticky;
  box-sizing: border-box;
  background: var(--tps-frozen-bg);
  background-clip: padding-box;
  box-shadow: 1px 0 0 var(--line);
}

.tps-compare-table .tps-metric-col {
  left: 0;
  z-index: 15;
}

.tps-compare-table .tps-mode-col {
  left: var(--tps-metric-width);
  z-index: 14;
  box-shadow: 1px 0 0 var(--line), 10px 0 16px rgba(0, 0, 0, 0.08);
}

.tps-compare-table thead .tps-metric-col,
.tps-compare-table thead .tps-mode-col {
  z-index: 28;
  background: var(--tps-frozen-head-bg);
}

.tps-compare-table tbody .tps-metric-col {
  color: var(--text);
  font-weight: 800;
  vertical-align: middle;
}

.tps-compare-table tbody .tps-week-col {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.tps-compare-table tbody .metric-group-start:not(:first-child) > td {
  border-top: 2px solid var(--border-medium);
}

.tps-compare-table .matrix-number {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tps-compare-table .tps-week-col.tps {
  background: color-mix(in srgb, var(--blue), var(--table-bg) 95%);
}

.tps-compare-table .tps-week-col.datanitiv {
  background: color-mix(in srgb, var(--teal), var(--table-bg) 95%);
}

.tps-compare-table .tps-week-col.go-live,
.tps-compare-table .tps-week-col.go-live-week {
  background: color-mix(in srgb, var(--amber), var(--table-bg) 86%);
  box-shadow: inset 2px 0 0 var(--amber), inset -2px 0 0 var(--amber);
}

.tps-compare-table thead .tps-week-col.tps {
  border-bottom: 3px solid var(--blue);
}

.tps-compare-table thead .tps-week-col.datanitiv {
  border-bottom: 3px solid var(--teal);
}

.tps-compare-table thead .tps-week-col.go-live,
.tps-compare-table thead .tps-week-col.go-live-week {
  border-bottom: 3px solid var(--amber);
}

.matrix-row-label,
.matrix-result {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.45px;
  text-transform: uppercase;
}

.matrix-row-label.tps { border-color: color-mix(in srgb, var(--blue), var(--line) 35%); color: var(--blue); }
.matrix-row-label.datanitiv { border-color: color-mix(in srgb, var(--teal), var(--line) 35%); color: var(--teal); }
.matrix-row-label.variance { border-color: color-mix(in srgb, var(--amber), var(--line) 35%); color: var(--amber); }
.matrix-row-label.comparison { color: var(--text); }

.matrix-result {
  min-width: 72px;
  justify-content: center;
  padding-inline: 6px;
  font-size: 9px;
}

.matrix-result.good { border-color: color-mix(in srgb, var(--teal), var(--line) 35%); color: var(--teal); }
.matrix-result.bad { border-color: color-mix(in srgb, var(--red), var(--line) 35%); color: var(--red); }
.matrix-result.warn { border-color: color-mix(in srgb, var(--amber), var(--line) 35%); color: var(--amber); }
.matrix-result.neutral { color: var(--muted); }

.tps-compare-table .variance-changed {
  color: var(--amber);
}

.tps-matrix-row:hover .tps-week-col,
.tps-matrix-row:hover .tps-mode-col {
  filter: brightness(1.06);
}

#scoring > .top-scroll {
  margin-bottom: 6px;
}

.table-wrap table {
  border-collapse: separate;
  border-spacing: 0;
}

.table-wrap th,
.table-wrap td,
.table-wrap strong,
.table-wrap b,
.table-wrap .pill,
.table-wrap .summary-pill,
.table-wrap .portfolio-score,
.table-wrap .portfolio-status,
.table-wrap .dq-score,
.table-wrap .signoff-status,
.table-wrap .client-link,
.modal-table th,
.modal-table td,
.modal-table strong,
.modal-table b {
  font-weight: 650;
}

.table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 8;
  background: var(--th-bg);
  box-shadow: 0 1px 0 var(--line), 0 8px 14px rgba(0, 0, 0, 0.12);
}

.sticky-key-table th:first-child,
.sticky-key-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 9;
  background: var(--table-bg);
  box-shadow: 1px 0 0 var(--line), 8px 0 14px rgba(0, 0, 0, 0.06);
}

.sticky-key-table thead th:first-child {
  z-index: 12;
  background: var(--th-bg);
}

.detail-table-wrap thead th {
  z-index: 20;
}

.detail-table-wrap {
  max-height: calc(100vh - 320px);
}

#detail {
  --detail-client-width: 210px;
  --detail-metric-width: 170px;
  --detail-mode-width: 96px;
  --detail-week-width: 112px;
  --detail-metric-left: var(--detail-client-width);
  --detail-mode-left: calc(var(--detail-client-width) + var(--detail-metric-width));
}

.detail-table-wrap table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.detail-table-wrap col.detail-client-col {
  width: var(--detail-client-width);
}

.detail-table-wrap col.detail-metric-col {
  width: var(--detail-metric-width);
}

.detail-table-wrap col.detail-mode-col {
  width: var(--detail-mode-width);
}

.detail-table-wrap col.detail-week-col {
  width: var(--detail-week-width);
}

#detail .detail-client-col,
#detail .detail-metric-col,
#detail .detail-mode-col {
  position: sticky;
  box-sizing: border-box;
  background: var(--table-bg);
  background-clip: padding-box;
  box-shadow: 1px 0 0 var(--line);
  overflow: hidden;
  text-overflow: ellipsis;
}

#detail .detail-client-col {
  left: 0;
  min-width: var(--detail-client-width);
  width: var(--detail-client-width);
  z-index: 14;
}

#detail .detail-metric-col {
  left: var(--detail-metric-left);
  min-width: var(--detail-metric-width);
  width: var(--detail-metric-width);
  z-index: 13;
}

#detail .detail-mode-col {
  left: var(--detail-mode-left);
  min-width: var(--detail-mode-width);
  width: var(--detail-mode-width);
  z-index: 12;
}

#detail thead .detail-client-col,
#detail thead .detail-metric-col,
#detail thead .detail-mode-col {
  z-index: 28;
  background: var(--th-bg);
}

#detail .detail-week-col {
  box-sizing: border-box;
  min-width: var(--detail-week-width);
  width: var(--detail-week-width);
}

table {
  width: 100%;
  min-width: 980px;
  background: var(--table-bg);
}

th,
td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  background: var(--th-bg);
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
}

td {
  font-size: 13px;
  font-weight: 600;
}

.client-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}

body.audience-font .topbar h1 {
  font-size: 30px;
}

body.audience-font .topbar p,
body.audience-font .tab,
body.audience-font label,
body.audience-font input,
body.audience-font select,
body.audience-font button {
  font-size: 16px;
}

body.audience-font .brand h1 {
  font-size: 24px;
}

body.audience-font .brand p,
body.audience-font .filter-section h2,
body.audience-font .source-note p,
body.audience-font .section-head h2,
body.audience-font .block-head h3,
body.audience-font .lane-head strong,
body.audience-font .audited-guide-body h3,
body.audience-font .guide-section h3,
body.audience-font .auditor-trend-card-head strong {
  font-size: 15px;
}

body.audience-font .executive-card span,
body.audience-font .executive-card small,
body.audience-font .metric-card h3,
body.audience-font .metric-card .caption,
body.audience-font .block-head span,
body.audience-font .owner-row span,
body.audience-font .batch-row span,
body.audience-font .intervention-row small,
body.audience-font .client-chip,
body.audience-font .client-chip small,
body.audience-font .audited-guide-head span,
body.audience-font .auditor-trend-card-head span,
body.audience-font .auditor-trend-card-head span b,
body.audience-font .auditor-trend-tabs span,
body.audience-font .auditor-trend-select-label,
body.audience-font .auditor-focus-list small,
body.audience-font .auditor-coaching-list small,
body.audience-font .auditor-quality-funnel small,
body.audience-font .trend-axis,
body.audience-font .trend-day,
body.audience-font .auditor-trend-svg-legend text {
  font-size: 14px;
}

body.audience-font .executive-card strong {
  font-size: 36px;
}

body.audience-font .metric-card .value {
  font-size: 38px;
}

body.audience-font .overview-block,
body.audience-font .owner-name-button,
body.audience-font .lane-head span,
body.audience-font .owner-row b,
body.audience-font .intervention-row strong,
body.audience-font th,
body.audience-font td,
body.audience-font .client-link,
body.audience-font .pill,
body.audience-font .score-badge,
body.audience-font .audited-guide-body p,
body.audience-font .audited-guide-body strong,
body.audience-font .auditor-workload-list span,
body.audience-font .auditor-workload-list strong,
body.audience-font .auditor-focus-list b,
body.audience-font .auditor-coaching-list b,
body.audience-font .auditor-focus-list strong,
body.audience-font .auditor-coaching-list strong,
body.audience-font .auditor-quality-funnel span,
body.audience-font .auditor-quality-funnel strong,
body.audience-font .audited-clients-table td,
body.audience-font .audited-filter-row select,
body.audience-font .audited-filter-row input {
  font-size: 16px;
}

body.audience-font th,
body.audience-font td {
  padding: 12px 13px;
}

body.audience-font .modal-head h2 {
  font-size: 28px;
}

body.audience-font .audited-guide-head h3,
body.audience-font .guide-head h2 {
  font-size: 30px;
}

body.audience-font .modal-head p,
body.audience-font .modal-meta .pill,
body.audience-font .diagnostic-summary span,
body.audience-font .diagnostic-card span,
body.audience-font .modal-section-head span,
body.audience-font .signoff-status,
body.audience-font .signoff-note,
body.audience-font .dashboard-tooltip,
body.audience-font .guide-body,
body.audience-font .upload-status,
body.audience-font .audited-guide-head p,
body.audience-font .guide-section p,
body.audience-font .guide-list p,
body.audience-font .guide-table > div,
body.audience-font .guide-nav a,
body.audience-font .guide-callout,
body.audience-font .guide-example,
body.audience-font .auditor-focus-list button[data-risk-tooltip]::after {
  font-size: 16px;
}

.client-link:hover {
  color: var(--blue);
  text-decoration: underline;
}

.muted-cell {
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
}

#detailRows tr:nth-child(even) td,
#modalDetailRows tr:nth-child(even) td,
#auditorDetailProgramRows tr:nth-child(even) td {
  background: var(--stripe);
}

#detailRows tr.actual-row td,
#modalDetailRows tr.actual-row td,
#auditorDetailProgramRows tr.actual-row td {
  color: var(--amber);
  font-weight: 400;
}

#detailRows tr.actual-row td[rowspan],
#modalDetailRows tr.actual-row td[rowspan],
#auditorDetailProgramRows tr.actual-row td[rowspan] {
  color: var(--text);
  font-weight: 600;
}

#detailRows tr td.alert-value,
#modalDetailRows tr td.alert-value,
#auditorDetailProgramRows tr td.alert-value {
  color: #ffe5e7 !important;
  font-weight: 700 !important;
  background: rgba(255, 70, 85, 0.34) !important;
  border-color: rgba(255, 70, 85, 0.55) !important;
}

#detailRows tr td.source-tps,
#modalDetailRows tr td.source-tps,
#auditorDetailProgramRows tr td.source-tps {
  background: rgba(67, 136, 255, 0.09);
}

#detailRows tr td.source-golive,
#modalDetailRows tr td.source-golive,
#auditorDetailProgramRows tr td.source-golive {
  background: rgba(255, 165, 30, 0.16);
}

#detailRows tr td.source-datanitiv,
#modalDetailRows tr td.source-datanitiv,
#auditorDetailProgramRows tr td.source-datanitiv {
  background: rgba(34, 197, 186, 0.09);
}

/* DQ Score period: amber top border on headers, amber left-border on cells */
#detail thead th.dq-score-period,
#modalDetailHead th.dq-score-period,
#auditorDetailProgramHeader th.dq-score-period {
  border-top: 3px solid var(--amber);
  position: relative;
}
#detail thead th.dq-score-period::after,
#modalDetailHead th.dq-score-period::after,
#auditorDetailProgramHeader th.dq-score-period::after {
  content: "DQ";
  position: absolute;
  top: 2px;
  right: 3px;
  font-size: 9px;
  font-weight: 700;
  color: var(--amber);
  opacity: 0.8;
  line-height: 1;
}

#detailRows tr td.dq-score-period,
#modalDetailRows tr td.dq-score-period,
#auditorDetailProgramRows tr td.dq-score-period {
  box-shadow: inset 3px 0 0 rgba(255, 180, 0, 0.35);
}

/* Cutover Accuracy period: teal bottom border on headers, teal right-border on cells */
#detail thead th.cutover-score-period,
#modalDetailHead th.cutover-score-period,
#auditorDetailProgramHeader th.cutover-score-period {
  border-bottom: 3px solid var(--teal);
  position: relative;
}
#detail thead th.cutover-score-period::before,
#modalDetailHead th.cutover-score-period::before,
#auditorDetailProgramHeader th.cutover-score-period::before {
  content: "CO";
  position: absolute;
  bottom: 2px;
  right: 3px;
  font-size: 9px;
  font-weight: 700;
  color: var(--teal);
  opacity: 0.8;
  line-height: 1;
}

#detailRows tr td.cutover-score-period,
#modalDetailRows tr td.cutover-score-period,
#auditorDetailProgramRows tr td.cutover-score-period {
  box-shadow: inset -3px 0 0 rgba(34, 197, 186, 0.35);
}

/* Both periods: stack both indicators */
#detailRows tr td.dq-score-period.cutover-score-period,
#modalDetailRows tr td.dq-score-period.cutover-score-period,
#auditorDetailProgramRows tr td.dq-score-period.cutover-score-period {
  box-shadow: inset 3px 0 0 rgba(255, 180, 0, 0.35), inset -3px 0 0 rgba(34, 197, 186, 0.35);
}

#detailRows tr td.muted-period {
  color: transparent;
  background: color-mix(in srgb, var(--panel), var(--bg) 35%);
}

tr:hover td {
  background: var(--hover-bg);
}

#detailRows tr.metric-hover td,
#modalDetailRows tr.metric-hover td,
#auditorDetailProgramRows tr.metric-hover td {
  background: rgba(255, 221, 87, 0.26) !important;
}

#detailRows tr.metric-hover td.client-cell {
  background: inherit !important;
}

#detailRows tr.metric-hover td.alert-value,
#modalDetailRows tr.metric-hover td.alert-value,
#auditorDetailProgramRows tr.metric-hover td.alert-value {
  color: #ffe5e7 !important;
  background: rgba(255, 70, 85, 0.48) !important;
}

/* ── Cell comments ────────────────────────────────────────────── */
td[data-cell-key] {
  cursor: pointer;
}
td[data-cell-key]:hover {
  filter: brightness(1.08);
}

td.has-cell-comment {
  position: relative;
}
td.has-cell-comment::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 8px 8px 0;
  border-color: transparent var(--amber) transparent transparent;
  pointer-events: none;
}

.cell-comment-dialog {
  position: fixed;
  z-index: 9999;
  display: none;
  width: 288px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  padding: 12px 14px 14px;
  font-size: 13px;
  color: var(--text);
}

.cell-comment-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 9px;
  gap: 8px;
}

.cell-comment-dialog-head span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-comment-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;
}
.cell-comment-close:hover { color: var(--text); }

.cell-comment-dialog textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  padding: 7px 9px;
  resize: vertical;
  min-height: 72px;
  outline: none;
}
.cell-comment-dialog textarea:focus {
  border-color: var(--blue);
}

.cell-comment-dialog-actions {
  display: flex;
  gap: 6px;
  margin-top: 9px;
  justify-content: flex-end;
}

.cell-comment-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: transparent;
}

.auditor-program-reference {
  display: grid;
  gap: 10px;
}

.auditor-program-reference .auditor-reference-table {
  max-height: min(62vh, 640px);
  overflow: auto;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 2px 5px 2px 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  font-size: 12px;
}

.source-pill {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.score-card {
  display: grid;
  gap: 5px;
  min-height: 94px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 6px;
  padding: 12px 14px;
}

.score-card strong {
  color: var(--amber);
  font-size: 22px;
  line-height: 1;
}

.score-card.ztp-card {
  border-top: 3px solid var(--red);
}

.score-card.ztp-card strong {
  color: var(--red);
}

.score-card span {
  font-weight: 800;
}

.score-card small {
  color: var(--muted);
}

.score-badge {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 26px;
  border-radius: 999px;
  font-weight: 800;
}

.score-badge.good {
  color: #06231f;
  background: var(--teal);
}

.score-badge.warn {
  color: #231703;
  background: var(--amber);
}

.score-badge.bad {
  color: #fff;
  background: var(--red);
}

.status-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding-left: 12px;
  color: var(--text);
  font-weight: 700;
}

.status-label::before {
  content: "";
  position: absolute;
  left: 0;
  width: 5px;
  height: 20px;
  border-radius: 999px;
  background: var(--line);
}

.status-label.good::before {
  background: var(--teal);
}

.status-label.warn::before {
  background: var(--amber);
}

.status-label.bad::before {
  background: var(--red);
}

.heatmap {
  overflow: auto;
  max-height: calc(100vh - 310px);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.heatmap-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.heatmap-legend strong {
  margin-right: 2px;
  color: var(--text);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.heatmap-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
}

.heatmap-legend i {
  width: 14px;
  height: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.heat-row {
  display: grid;
  grid-template-columns: 230px repeat(var(--week-count), 38px);
  min-width: max-content;
}

.heat-cell {
  height: 32px;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}

.heat-row:first-child .heat-cell {
  position: sticky;
  top: 0;
  z-index: 8;
  background: var(--th-bg);
  color: var(--muted);
  font-weight: 650;
  text-transform: uppercase;
  box-shadow: 0 1px 0 var(--line), 0 8px 14px rgba(0, 0, 0, 0.12);
}

.heat-client {
  justify-content: start;
  padding-left: 10px;
  color: var(--text);
  font-weight: 700;
}

.heat-cell .client-link {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
  width: 100%;
  justify-self: start;
}

.heat-cell .client-link:hover {
  text-decoration: underline;
}

.sev-0 { background: transparent; }
.sev-1 { background: rgba(67, 136, 255, 0.35); color: var(--text); }
.sev-2 { background: rgba(255, 165, 30, 0.50); color: var(--text); }
.sev-3 { background: rgba(255, 70, 85, 0.65); color: var(--text); }
.sev-4, .sev-5 { background: rgba(139, 92, 246, 0.75); color: var(--text); }

body.light .sev-0 { background: transparent; }
body.light .sev-1 { background: #d6e4ff; color: #16345c; }
body.light .sev-2 { background: #ffd19b; color: #5a3600; }
body.light .sev-3 { background: #fcb5bb; color: #5f1a20; }
body.light .sev-4,
body.light .sev-5 { background: #d5c2ff; color: #352060; }

footer {
  margin-top: 32px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  border-radius: 6px;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 20;
}

.modal.open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--modal-mask);
}

.owner-report-modal {
  z-index: 28;
}

.owner-report-page {
  position: absolute;
  inset: 18px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1780px, calc(100vw - 36px));
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 90px rgba(2, 8, 20, 0.38);
  overflow: hidden;
}

.owner-report-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel-2), var(--blue) 5%), var(--panel));
}

.owner-report-head span,
.owner-report-section-head span,
.owner-report-kpi span,
.owner-report-kpi small,
.owner-report-pareto-row span {
  color: var(--muted);
}

.owner-report-head span {
  display: block;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 11px;
  font-weight: 800;
}

.owner-report-head h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1.08;
}

.owner-report-head p {
  margin: 7px 0 0;
  color: var(--muted);
}

.owner-report-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}

.owner-report-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text);
  padding: 0 11px;
  font-weight: 800;
  cursor: pointer;
}

#ownerReportClose {
  width: 34px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.owner-report-actions button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.owner-report-body {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 14px;
  overflow: auto;
  background: var(--bg);
}

.owner-report-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
}

.owner-report-kpi,
.owner-report-panel,
.owner-report-footer article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.owner-report-kpi {
  display: grid;
  gap: 4px;
  min-height: 86px;
  padding: 12px;
  border-top-width: 3px;
}

.owner-report-kpi.good { border-top-color: var(--teal); }
.owner-report-kpi.warn { border-top-color: var(--amber); }
.owner-report-kpi.bad { border-top-color: var(--red); }
.owner-report-kpi.neutral { border-top-color: var(--blue); }

.owner-report-kpi span,
.owner-report-section-head span {
  text-transform: uppercase;
  letter-spacing: 1.15px;
  font-size: 10px;
  font-weight: 800;
}

.owner-report-kpi strong {
  font-size: 25px;
  line-height: 1;
}

.owner-report-kpi small {
  font-size: 11px;
}

.owner-report-panel {
  position: relative;
  min-width: 0;
  padding: 14px;
}

.owner-report-section-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  min-height: 44px;
  margin-bottom: 12px;
  padding: 2px 2px 10px;
  border-bottom: 1px solid var(--line);
}

.owner-report-section-head > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.owner-report-section-head h3,
.owner-report-footer h3 {
  margin: 0;
  font-size: 13px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.owner-report-section-head span {
  display: block;
  line-height: 1.25;
}

.owner-report-table-wrap {
  overflow: auto;
}

.owner-report-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 900px;
}

.owner-report-table th,
.owner-report-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 12px;
  white-space: nowrap;
}

.owner-report-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-2);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 10px;
}

.owner-report-table tr:last-child td {
  border-bottom: 0;
}

.owner-report-bar {
  position: relative;
  display: grid;
  align-items: center;
  width: 140px;
  height: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
}

.owner-report-bar.readiness {
  width: 132px;
  max-width: 100%;
}

.owner-report-bar span,
.owner-report-pareto-track span {
  display: block;
  height: 100%;
  background: color-mix(in srgb, var(--amber), var(--blue) 25%);
}

.owner-report-bar.score.good span {
  background: color-mix(in srgb, var(--teal), #ffffff 8%);
}

.owner-report-bar.score.warn span {
  background: color-mix(in srgb, var(--amber), #ffffff 8%);
}

.owner-report-bar.score.bad span {
  background: color-mix(in srgb, var(--red), #ffffff 8%);
}

.owner-report-bar b {
  position: absolute;
  right: 8px;
  font-size: 11px;
}

.owner-report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(310px, 0.75fr);
  gap: 12px;
  align-items: start;
}

.owner-report-stack {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.owner-report-outliers {
  min-width: 940px;
}

.owner-report-outliers th:nth-child(4),
.owner-report-outliers td:nth-child(4),
.owner-report-improved th:nth-child(5),
.owner-report-improved td:nth-child(5) {
  width: 150px;
}

.owner-report-improved {
  min-width: 760px;
}

.owner-report-delta {
  color: var(--teal);
}

.owner-report-pareto-list {
  display: grid;
  gap: 10px;
}

.owner-report-pareto-row {
  display: grid;
  gap: 6px;
}

.owner-report-pareto-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.owner-report-pareto-track {
  height: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
}

.owner-report-footer {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr);
  gap: 12px;
}

.owner-report-footer article {
  padding: 12px;
}

.owner-report-footer p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.owner-report-next {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.owner-report-next h3 {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.owner-report-next p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.owner-report-signoff {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.owner-report-mini-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 10px;
  margin-bottom: 9px;
}

.owner-report-mini-head h3 {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.owner-report-mini-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.owner-report-threshold {
  display: grid;
  gap: 4px;
  justify-items: end;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.owner-report-threshold select {
  min-width: 88px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text);
  padding: 0 8px;
  font: inherit;
  letter-spacing: 0;
  text-transform: none;
}

.owner-report-signoff-list {
  display: grid;
  gap: 7px;
}

.owner-report-signoff-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
}

.owner-report-signoff-row div {
  min-width: 0;
}

.owner-report-signoff-row strong,
.owner-report-signoff-row span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-report-signoff-row strong {
  font-size: 12px;
}

.owner-report-signoff-row span,
.owner-report-signoff-row small {
  color: var(--muted);
  font-size: 11px;
}

.owner-report-signoff-row b {
  color: var(--teal);
  font-size: 13px;
}

.owner-report-signoff-row small {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  white-space: nowrap;
}

.guide-drawer {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 25;
}

.guide-drawer.open {
  display: block;
}

.guide-backdrop {
  position: absolute;
  inset: 0;
  background: var(--modal-mask);
}

.guide-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(720px, calc(100vw - 28px));
  height: 100%;
  border-left: 1px solid var(--line);
  background: var(--panel);
  box-shadow: -22px 0 70px rgba(0, 0, 0, 0.42);
}

.upload-panel {
  width: min(640px, calc(100vw - 28px));
}

.batch-readiness-panel {
  width: min(980px, calc(100vw - 28px));
}

.batch-detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.batch-detail-summary article {
  min-height: 84px;
  padding: 12px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.batch-detail-summary article.good { border-top-color: var(--teal); }
.batch-detail-summary article.warn { border-top-color: var(--amber); }
.batch-detail-summary article.bad { border-top-color: var(--red); }

.batch-detail-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.batch-detail-summary strong {
  display: block;
  margin-top: 8px;
  font-size: 25px;
  line-height: 1;
}

.batch-detail-section {
  display: grid;
  gap: 10px;
}

.upload-check {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 700;
}

.upload-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.upload-status {
  min-height: 24px;
  font-weight: 800;
}

.upload-status[data-tone="good"] {
  color: var(--teal);
}

.upload-status[data-tone="warn"] {
  color: var(--amber);
}

.upload-status[data-tone="bad"] {
  color: var(--red);
}

.upload-log-panel {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
}

.upload-log-panel .block-head {
  margin: 0;
}

.upload-log-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.upload-log-row {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.upload-log-row div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
}

.upload-log-row strong {
  color: var(--amber);
  font-size: 13px;
  font-weight: 750;
}

.upload-log-row span,
.upload-log-row small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.guide-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.guide-head span {
  display: block;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 1.6px;
  font-size: 12px;
  font-weight: 800;
}

.guide-head h2 {
  margin: 5px 0 0;
  font-size: 24px;
}

#guideClose {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.guide-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

.guide-nav a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--text);
  background: var(--panel);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.guide-nav a:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.guide-body {
  overflow: auto;
  padding: 22px 24px 28px;
}

.guide-section {
  display: grid;
  gap: 12px;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 16px;
}

.guide-section:last-child {
  border-bottom: 0;
}

.guide-section h3 {
  margin: 0;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
}

.guide-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.guide-list {
  display: grid;
  gap: 8px;
}

.guide-list p {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
}

.guide-list.compact p {
  grid-template-columns: 150px minmax(0, 1fr);
}

.guide-list strong {
  color: var(--text);
}

.guide-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.guide-table > div {
  display: grid;
  grid-template-columns: 1fr 2fr 120px;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

.guide-table > div:first-child {
  background: var(--table-head);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.1px;
  font-size: 12px;
}

.guide-table > div:last-child {
  border-bottom: 0;
}

.guide-table span {
  color: var(--text);
  line-height: 1.45;
}

.score-breakdown > div {
  grid-template-columns: 1fr 90px 2.1fr;
}

.formula-card,
.guide-callout,
.guide-example {
  border: 1px solid color-mix(in srgb, var(--amber), var(--line) 45%);
  border-radius: 7px;
  background: color-mix(in srgb, var(--amber), var(--panel) 90%);
  padding: 12px 14px;
}

.formula-card {
  color: var(--amber);
  font-size: 18px;
  font-weight: 900;
}

.guide-callout {
  color: var(--text);
  font-weight: 750;
}

.guide-example strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

@media (max-width: 760px) {
  .director-modal-panel .modal-meta {
    grid-template-columns: 1fr;
  }

  .director-modal-panel .modal-head h2 {
    font-size: 22px;
  }

  .director-detail-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    justify-content: stretch;
    gap: 10px;
  }

  .utility-actions {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
  }

  .freshness-badge {
    grid-column: 2;
    align-items: flex-start;
    width: 100%;
    min-width: 0;
  }

  .guide-list p,
  .guide-list.compact p,
  .guide-table > div,
  .score-breakdown > div {
    grid-template-columns: 1fr;
  }

  .guide-panel {
    width: min(620px, calc(100vw - 18px));
  }
}

.modal-panel {
  position: absolute;
  inset: 46px;
  display: grid;
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

#clientModal .modal-panel {
  display: block;
  overflow: auto;
}

.modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font-size: 22px;
}

.modal-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 15px;
}

#modalClose,
#directorModalClose,
#auditorDetailClose,
#auditedClientsClose,
#exemptionsClose,
#auditorMappingClose {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
}

.modal-meta .pill {
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.25;
}

.modal-meta .chip-value {
  color: var(--amber);
  font-weight: 800;
}

.modal-diagnostics {
  display: grid;
  gap: 14px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

.diagnostic-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.diagnostic-summary article,
.diagnostic-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.diagnostic-summary article {
  padding: 12px 14px;
}

.diagnostic-summary span,
.diagnostic-card span,
.modal-section-head span {
  color: var(--muted);
}

.diagnostic-summary span {
  display: block;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-size: 12px;
}

.diagnostic-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
}

.diagnostic-summary strong.good { color: var(--teal); }
.diagnostic-summary strong.warn { color: var(--amber); }
.diagnostic-summary strong.bad { color: var(--red); }

.diagnostic-action {
  grid-column: span 1;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 12px;
}

.insight-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--teal);
  border-radius: 7px;
  background: var(--panel);
}

.insight-card.warn {
  border-top-color: var(--amber);
}

.insight-card.bad {
  border-top-color: var(--red);
}

.insight-card span {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-size: 12px;
  font-weight: 800;
}

.insight-card strong {
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
}

.insight-card.good strong {
  color: var(--teal);
}

.insight-card.warn strong {
  color: var(--amber);
}

.insight-card.bad strong {
  color: var(--red);
}

.insight-card ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.45;
}

.modal-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.modal-section-head h3 {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  font-size: 14px;
}

.modal-section-head span {
  font-size: 15px;
  line-height: 1.45;
}

.diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 10px;
}

.diagnostic-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-top: 3px solid var(--teal);
}

.diagnostic-card.warn {
  border-top-color: var(--amber);
}

.diagnostic-card.bad {
  border-top-color: var(--red);
}

.diagnostic-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.diagnostic-card-head strong {
  font-size: 15px;
}

.diagnostic-card-head span {
  text-align: right;
}

.diagnostic-values {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.diagnostic-values div {
  display: grid;
  gap: 2px;
}

.diagnostic-values span {
  font-size: 11px;
}

.diagnostic-values b {
  font-size: 15px;
}

.sparkline {
  width: 150px;
  max-width: 100%;
  height: 38px;
  overflow: visible;
}

.sparkline-base {
  stroke: var(--line);
  stroke-width: 1;
}

.sparkline-path {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sparkline-cutover {
  stroke: var(--amber);
  stroke-width: 1.6;
  stroke-dasharray: 3 3;
}

.modal-table {
  border: 0;
  border-radius: 0;
  min-height: 0;
}

.modal-table table {
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
}

.modal-table thead th {
  position: sticky;
  top: 0;
  z-index: 16;
  background: var(--panel-2);
  box-shadow: 0 1px 0 var(--line), 0 8px 14px rgba(0, 0, 0, 0.18);
}

.evidence-modal {
  z-index: 90;
}

.evidence-modal-panel {
  inset: 10vh 8vw;
  grid-template-rows: auto minmax(0, 1fr);
}

.evidence-table {
  margin: 0;
  border-width: 1px 0 0;
  border-radius: 0;
}

.evidence-table table {
  min-width: 760px;
  width: 100%;
}

.evidence-table td,
.evidence-table th {
  font-size: 13px;
  font-weight: 650;
}

.evidence-link {
  border: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-weight: 750;
  text-align: left;
  padding: 0;
  cursor: pointer;
}

.evidence-link:hover {
  text-decoration: underline;
}

body.light .modal-table thead th {
  background: var(--th-bg);
}

@media (max-width: 1120px) {
  .tps-compare-controls {
    grid-template-columns: 1fr 1fr;
  }

  .tps-compare-context {
    grid-column: 1 / -1;
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .readiness-overview-block {
    min-height: 360px;
  }

  .owner-queue-block {
    min-height: 0;
  }
}

@media (max-width: 980px) {
  body {
    grid-template-columns: 1fr;
  }

  body.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .tps-compare-controls,
  .tps-compare-context {
    grid-template-columns: 1fr;
  }

  .tps-compare-context {
    grid-column: auto;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(330px, calc(100vw - 42px));
    min-height: 100vh;
    max-height: 100vh;
    padding: 28px 18px;
    box-shadow: 18px 0 54px rgba(0, 0, 0, 0.28);
    transform: translateX(0);
    transition: transform 180ms ease;
  }

  body.sidebar-collapsed .sidebar {
    width: min(330px, calc(100vw - 42px));
    padding: 28px 18px;
    overflow-y: auto;
    transform: translateX(-100%);
  }

  body.sidebar-collapsed .brand {
    justify-content: start;
    margin: 42px 0 28px;
  }

  body.sidebar-collapsed .brand > div,
  body.sidebar-collapsed .filter-section,
  body.sidebar-collapsed .source-note,
  body.sidebar-collapsed .sidebar .mode-button {
    display: none;
  }

  .sidebar-toggle,
  body.sidebar-collapsed .sidebar-toggle {
    display: none;
  }

  .mobile-sidebar-toggle {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 80;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--blue);
    border-radius: 999px;
    background: var(--blue);
    color: #fff;
    font-size: 19px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    cursor: pointer;
  }

  body:not(.sidebar-collapsed) .mobile-sidebar-toggle {
    background: var(--panel-2);
    color: var(--text);
    border-color: var(--line);
  }

  .main {
    padding: 72px 16px 28px;
  }

  .owner-report-page {
    inset: 10px;
    width: calc(100vw - 20px);
  }

  .owner-report-head,
  .owner-report-footer,
  .owner-report-grid {
    grid-template-columns: 1fr;
  }

  .owner-report-actions {
    justify-content: start;
  }

  .owner-report-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar,
  .section-head {
    display: grid;
    gap: 14px;
  }

  .topbar h1 {
    font-size: 23px;
    line-height: 1.2;
  }

  .topbar p,
  .section-head p {
    font-size: 14px;
  }

  .topbar-actions {
    justify-content: start;
  }

  .audited-head-actions {
    align-items: flex-start;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .auditor-trend-select-label {
    min-width: min(100%, 280px);
  }

  .tabs {
    gap: 8px;
    overflow-x: auto;
    padding: 8px;
    scroll-snap-type: x proximity;
  }

  .tab {
    flex: 0 0 auto;
    min-width: max-content;
    padding-inline: 14px;
    scroll-snap-align: start;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .metric-card {
    padding: 14px 13px;
  }

  .metric-card .value {
    font-size: 30px;
  }

  .executive-kpis,
  .auditor-kpis,
  .auditor-grid,
  .auditor-view-grid,
  .auditor-productivity-grid,
  .auditor-ops-bottom,
  .audited-guide-panel,
  .weekly-movement,
  .audit-detail-summary,
  .audit-detail-grid,
  .audit-trend,
  .audit-form,
  .readiness-board,
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .auditor-workload-list {
    max-height: none;
    overflow: visible;
  }

  .batch-detail-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pareto-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .pareto-row b {
    text-align: left;
  }

  .audit-buckets {
    grid-template-columns: 1fr;
  }

  .owner-row,
  .batch-row,
  .intervention-row,
  .diagnostic-summary,
  .insight-grid,
  .diagnostic-grid,
  .dev-audit-reference {
    grid-template-columns: 1fr;
  }

  .owner-queue-header {
    display: none;
  }

  .owner-row div:not(:first-child) {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
  }

  .owner-row div:not(:first-child)::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .score-grid {
    grid-template-columns: 1fr;
  }

  .table-wrap,
  .heatmap {
    border-radius: 5px;
  }

  #alerts > .table-wrap,
  #planning > .table-wrap,
  #scoring > .table-wrap,
  .heatmap {
    max-height: 62vh;
  }

  th,
  td {
    padding: 10px 9px;
    font-size: 13px;
  }

  .modal-panel {
    inset: 16px;
  }

  .modal-head,
  .modal-meta,
  .modal-exemptions,
  .modal-diagnostics {
    padding-inline: 16px;
  }

  .modal-panel {
    grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
  }

  .diagnostic-summary article {
    min-height: auto;
  }
}

@media print {
  body:has(#ownerReportModal.open) > :not(#ownerReportModal) {
    display: none !important;
  }

  #ownerReportModal,
  #ownerReportModal.open {
    position: static;
    display: block !important;
  }

  #ownerReportModal .modal-backdrop,
  #ownerReportModal .owner-report-actions {
    display: none !important;
  }

  .owner-report-page {
    position: static;
    inset: auto;
    width: 100%;
    max-height: none;
    border: 0;
    box-shadow: none;
    overflow: visible;
  }

  .owner-report-body {
    overflow: visible;
  }

  .owner-report-table th {
    position: static;
  }
}

@media (max-width: 560px) {
  .main {
    padding-inline: 12px;
  }

  .cards,
  .executive-kpis {
    grid-template-columns: 1fr;
  }

  .metric-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 6px 12px;
  }

  .metric-card h3,
  .metric-card .caption {
    grid-column: 1;
  }

  .metric-card .value {
    grid-column: 2;
    grid-row: 1 / span 2;
    font-size: 32px;
  }

  .overview-block,
  .executive-card,
  .score-card,
  .insight-card {
    border-radius: 6px;
  }

  .block-head,
  .modal-section-head,
  .diagnostic-card-head,
  .director-detail-head {
    display: grid;
    gap: 5px;
  }

  .heatmap-legend {
    gap: 6px;
  }

  .heatmap-legend span {
    font-size: 11px;
    padding: 4px 8px;
  }

  .modal-panel {
    inset: 0;
    border-radius: 0;
    grid-template-rows: auto auto auto minmax(0, 0.9fr) auto minmax(260px, 1fr);
  }

  .modal-head h2 {
    font-size: 20px;
  }

  .modal-head {
    align-items: center;
    gap: 12px;
    padding-block: 14px;
  }

  .modal-head p {
    font-size: 13px;
  }

  #modalClose,
  #directorModalClose {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
  }

  .modal-meta {
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding-block: 10px;
  }

  .modal-panel > .top-scroll {
    margin-inline: 16px;
  }

  .modal-exemptions {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .modal-exemption-actions {
    justify-content: start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .modal-exemption-actions button {
    flex: 0 0 auto;
    font-size: 12px;
  }

  .modal-meta .pill {
    flex: 0 0 auto;
    font-size: 12px;
  }

  .modal-diagnostics {
    max-height: 44vh;
    overflow: auto;
    padding-block: 12px;
  }

  #clientModal .modal-diagnostics {
    max-height: none;
    overflow: visible;
  }

  .diagnostic-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .diagnostic-summary .diagnostic-action {
    grid-column: 1 / -1;
  }

  .diagnostic-summary article {
    padding: 10px;
  }

  .diagnostic-summary strong {
    font-size: 18px;
  }

  .insight-card {
    padding: 12px;
  }

  .insight-card strong {
    font-size: 14px;
  }

  .insight-card ul {
    font-size: 13px;
    padding-left: 16px;
  }

  .diagnostic-card {
    padding: 10px;
  }

  .diagnostic-values {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .modal-table {
    min-height: 260px;
    overflow: auto;
  }

  .modal-table table {
    min-width: 860px;
  }

  .modal-table th,
  .modal-table td {
    padding: 9px 10px;
    font-size: 12px;
  }

  .modal-table thead th:first-child,
  .modal-table tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 7;
    min-width: 126px;
    background: var(--panel);
    box-shadow: 1px 0 0 var(--line);
  }

  .modal-table thead th:nth-child(2),
  .modal-table tbody td:nth-child(2) {
    position: sticky;
    left: 126px;
    z-index: 7;
    min-width: 76px;
    background: var(--panel);
    box-shadow: 1px 0 0 var(--line);
  }

  .modal-table thead th:first-child,
  .modal-table thead th:nth-child(2) {
    z-index: 18;
    background: var(--panel-2);
  }

  body.light .modal-table thead th:first-child,
  body.light .modal-table thead th:nth-child(2) {
    background: var(--th-bg);
  }

  body.light .modal-table tbody td:first-child,
  body.light .modal-table tbody td:nth-child(2) {
    background: var(--table-bg);
  }

  .guide-panel,
  .upload-panel {
    width: calc(100vw - 12px);
  }

  .guide-head,
  .guide-nav,
  .guide-body {
    padding-inline: 16px;
  }
}
.owner-row div:not(:first-child) {
  justify-items: center;
  text-align: center;
}

.audited-kpi .kpi-delta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.audited-kpi .kpi-delta b {
  font-size: 13px;
  line-height: 1;
}

.kpi-delta.good b { color: var(--teal); }
.kpi-delta.bad b { color: var(--red); }
.kpi-delta.neutral b { color: var(--muted); }

.audited-panel-link {
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 12.5px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.audited-panel-link:hover {
  text-decoration: underline;
}

.audited-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 2px 0;
}

.audited-pagination > span {
  color: var(--muted);
  font-size: 13px;
}

.audited-page-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.audited-page-controls select {
  width: auto;
  min-height: 32px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 6px;
  padding: 0 8px;
  font-size: 13px;
}

.page-buttons {
  display: inline-flex;
  gap: 6px;
}

.page-buttons button {
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.page-buttons button:hover:not(:disabled) {
  border-color: var(--blue);
}

.page-buttons button.active {
  border-color: var(--blue);
  color: var(--blue);
  font-weight: 800;
}

.page-buttons button:disabled {
  opacity: 0.4;
  cursor: default;
}

.auditor-access-modal {
  z-index: 120;
}

.upload-access-modal {
  z-index: 121;
}

.auditor-detail-modal {
  z-index: 115;
}

.auditor-access-panel {
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  display: block;
  width: min(420px, calc(100vw - 32px));
  height: auto;
}

.auditor-access-panel .modal-head {
  padding: 18px 22px;
}

.auditor-access-panel .modal-head span {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.4px;
  font-size: 11px;
}

.auditor-access-form {
  display: grid;
  gap: 10px;
  padding: 16px 22px 20px;
}

.auditor-access-form label {
  margin: 0;
}

.auditor-access-form input[type="password"] {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  border-radius: 7px;
  padding: 0 12px;
  font-size: 14px;
}

.auditor-access-form input[type="password"]:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(67, 136, 255, 0.16);
}

.auditor-access-error {
  margin: 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.auditor-access-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.auditor-access-actions button {
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.auditor-access-actions button.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.auditor-access-actions button:hover {
  border-color: var(--blue);
}

/* Keep the owner email copy surface readable even when generic modal/input rules change. */
#ownerNotificationModal.open {
  display: grid;
  place-items: center;
  padding: 32px;
}

#ownerNotificationModal .modal-backdrop {
  z-index: 0;
}

#ownerNotificationModal .owner-notification-panel {
  position: relative;
  inset: auto;
  z-index: 1;
  transform: none;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(980px, calc(100vw - 64px));
  max-height: calc(100vh - 64px);
  overflow: hidden;
}

#ownerNotificationModal .owner-notification-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px 24px;
}

#ownerNotificationModal .owner-notification-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
}

#ownerNotificationModal .owner-notification-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

#ownerNotificationModal .owner-notification-field-head .link-button {
  flex: 0 0 auto;
  width: auto;
  min-width: 112px;
  height: 32px;
  padding: 0 12px;
  text-align: center;
}

#ownerNotificationModal #ownerNotificationSubject,
#ownerNotificationModal #ownerNotificationBody {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

#ownerNotificationModal #ownerNotificationSubject {
  height: 42px;
  min-height: 42px;
}

#ownerNotificationModal #ownerNotificationBody {
  min-height: min(46vh, 480px);
  resize: vertical;
}

body:not(.light) .table-wrap,
body:not(.light) .audited-table-wrap,
body:not(.light) .modal-table,
body:not(.light) .owner-report-table-wrap {
  border-color: rgba(187, 202, 220, 0.16);
  background: rgba(7, 14, 26, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 18px 42px rgba(0, 0, 0, 0.18);
}

body:not(.light) .table-wrap thead th,
body:not(.light) .modal-table thead th,
body:not(.light) .audited-clients-table th {
  background: linear-gradient(180deg, rgba(24, 36, 53, 0.92), rgba(10, 18, 31, 0.9));
  color: #d8e1ec;
}

body:not(.light) .mode-button,
body:not(.light) .threshold-mode-button,
body:not(.light) .export-button,
body:not(.light) .compact-action,
body:not(.light) .audited-guide-toggle {
  border-color: rgba(187, 202, 220, 0.18);
  background: linear-gradient(135deg, rgba(152, 172, 196, 0.13), rgba(75, 88, 106, 0.13));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform 420ms cubic-bezier(0.32, 0.72, 0, 1), border-color 420ms cubic-bezier(0.32, 0.72, 0, 1), background 420ms cubic-bezier(0.32, 0.72, 0, 1);
}

body:not(.light) .mode-button:hover,
body:not(.light) .threshold-mode-button:hover,
body:not(.light) .export-button:hover,
body:not(.light) .compact-action:hover,
body:not(.light) .audited-guide-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(221, 229, 238, 0.36);
  background: linear-gradient(135deg, rgba(221, 229, 238, 0.14), rgba(112, 130, 152, 0.16));
}

body:not(.light) .block-head h3,
body:not(.light) .section-head h2 {
  color: #eef5ff;
  text-shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
}

body:not(.light) .tab-badge {
  background: linear-gradient(135deg, #6d7f96, #aab7c8);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
}

body:not(.light) .range-slicer::after {
  background: linear-gradient(90deg, #607289, #aebed0 52%, #7f91a7);
  box-shadow: 0 0 18px rgba(152, 172, 196, 0.16);
}

body:not(.light) .brand-mark {
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.24), 0 0 20px rgba(203, 213, 225, 0.1);
}

body:not(.light) {
  background:
    radial-gradient(circle at 18% 8%, rgba(143, 159, 181, 0.11), transparent 28%),
    radial-gradient(circle at 84% 12%, rgba(91, 108, 130, 0.1), transparent 24%),
    radial-gradient(circle at 72% 72%, rgba(63, 75, 94, 0.12), transparent 32%),
    linear-gradient(135deg, #050914 0%, #08101c 45%, #030711 100%);
}
