:root {
  --app-bg: #d9d9d9;
  --sheet-grid: #e6ebf2;
  --shell-border: #cfcfcf;
  --shell-border-strong: #bdbdbd;
  --shell-panel: #f2f2f2;
  --shell-panel-2: #e9e9e9;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --ink: #172537;
  --muted: #62758d;
  --accent: #0d6efd;
  --accent-2: #0a58ca;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 1px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 10px 24px rgba(15, 23, 42, 0.06), 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 45px rgba(15, 23, 42, 0.08), 0 4px 14px rgba(15, 23, 42, 0.05);
  --radius-xl: 1rem;
  --radius-lg: 0.85rem;
  --radius-md: 0.7rem;
  --table-font-size: 0.92rem;
  --table-cell-py: 0.52rem;
  --table-cell-px: 0.55rem;
}

body {
  min-height: 100vh;
  font-family: "Manrope", system-ui, sans-serif;
  color: var(--ink);
  background: var(--app-bg);
  font-size: 14px;
}

.program-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.program-topbar {
  background: rgba(248, 248, 248, 0.9);
  backdrop-filter: saturate(140%) blur(14px);
  border-color: var(--shell-border) !important;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.program-titlebar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 54px;
  padding: 0 1.1rem 0 0.75rem;
  background: linear-gradient(180deg, #fdfefe 0%, #f4f6fa 100%);
  border-bottom: 1px solid var(--shell-border);
}

.program-titlegroup {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
}

.program-appname {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: #223248;
  text-align: right;
}

.program-menubar .nav-link {
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
  color: #223248;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 0.55rem;
  transition: background-color 140ms ease, color 140ms ease;
}

.program-menubar .nav-link:hover,
.program-menubar .nav-link:focus {
  background: rgba(70, 70, 70, 0.06);
  color: #1b2430;
}

.program-menubar .dropdown-menu {
  border: 1px solid var(--shell-border);
  border-radius: 0.8rem;
  box-shadow: var(--shadow-lg);
  padding: 0.35rem;
}

.program-menubar .dropdown-item {
  border-radius: 0.5rem;
  font-size: 0.88rem;
  padding: 0.45rem 0.65rem;
}

.program-menubar .dropdown-item:hover,
.program-menubar .dropdown-item:focus {
  background: rgba(70, 70, 70, 0.06);
}

.program-menubar .modules-menu {
  min-width: 15rem;
}

.program-menubar .modules-menu .modules-menu-toolbar .btn {
  border-radius: 0.55rem;
  font-size: 0.82rem;
}

.program-menubar .module-submenu {
  position: relative;
}

.program-menubar .module-submenu > .module-submenu-toggle {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
}

.program-menubar .module-submenu > .module-submenu-toggle::after {
  content: "";
  display: inline-block;
  width: 0.35rem;
  height: 0.35rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  float: right;
  margin-top: 0.35rem;
  transform: rotate(-45deg);
  transition: transform 120ms ease;
}

.program-menubar .module-submenu.submenu-open > .module-submenu-toggle::after {
  transform: rotate(45deg);
}

@media (min-width: 992px) {
  .program-menubar .module-submenu > .dropdown-menu {
    top: -0.35rem;
    left: calc(100% - 0.05rem);
    margin-left: 0.2rem;
  }

  .program-menubar .module-submenu.submenu-open > .dropdown-menu {
    display: block;
  }
}

.sidebar-toggle-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.nav-mode-badge {
  vertical-align: middle;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  border-radius: 999px;
  padding: 0.35rem 0.6rem;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.18);
}

.program-body {
  flex: 1;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  transition: grid-template-columns 180ms ease;
  min-height: 0;
}

.program-shell.layout-standard .program-body {
  grid-template-columns: 250px minmax(0, 1fr);
}

.program-shell.layout-compact .program-body {
  grid-template-columns: 210px minmax(0, 1fr);
}

.program-shell.layout-wide .program-body {
  grid-template-columns: 310px minmax(0, 1fr);
}

.program-shell.layout-focus .program-body {
  grid-template-columns: 0 minmax(0, 1fr);
}

.program-sidebar {
  background:
    linear-gradient(180deg, rgba(248,248,248,0.96), rgba(239,239,239,0.98)),
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 29px,
      rgba(160, 160, 160, 0.06) 30px
    );
  border-color: var(--shell-border) !important;
  overflow: auto;
  min-width: 0;
  transition: opacity 140ms ease;
  box-shadow: inset -1px 0 0 rgba(160, 160, 160, 0.18);
}

.program-sidebar-head {
  background: linear-gradient(180deg, rgba(250,250,250,0.97), rgba(241,241,241,0.96));
  border-color: var(--shell-border) !important;
}

.sidebar-appname {
  font-weight: 800;
  color: #1b2b3f;
  font-size: 0.94rem;
  letter-spacing: 0.01em;
}

.sidebar-home-link {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 0.8rem;
  text-decoration: none;
  color: #3f4b59;
}

.program-content {
  min-width: 0;
}

.program-content .container-fluid {
  font-size: 0.92rem;
}

.program-content .h4 {
  font-size: 1.05rem;
}

.program-content .display-6 {
  font-size: 1.65rem;
}

.analytics-kpi-value {
  font-size: 1.15rem;
}

.analytics-chart {
  width: 100%;
  height: 320px;
  border-radius: 0.9rem;
  border: 1px solid rgba(217, 225, 236, 0.85);
  background: linear-gradient(180deg, rgba(252,252,252,0.96), rgba(244,244,244,0.93));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
  position: relative;
}

.analytics-chart-sm {
  height: 320px;
}

.rfi-radar-chart-box {
  height: 340px;
  max-height: 42vh;
  border-radius: 0.9rem;
  border: 1px solid rgba(217, 225, 236, 0.85);
  background: linear-gradient(180deg, rgba(252,252,252,0.96), rgba(244,244,244,0.93));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
  padding: 0.4rem;
}

.quotes-rfi-analytics-chart {
  height: 300px;
}

.quotes-rfi-analytics-chart-sm {
  height: 200px;
}

.analytics-chart:empty::before {
  content: "Loading chart...";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #7b8ba1;
  font-size: 0.9rem;
}

.supplier-map-canvas {
  width: 100%;
  height: 560px;
  border-radius: 0.85rem;
  border: 1px solid var(--shell-border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.65);
}

.scrap-map-canvas {
  width: 100%;
  height: 560px;
  border-radius: 0.85rem;
  border: 1px solid var(--shell-border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.65);
}

.supplier-map-card.is-fullscreen {
  width: 100vw;
  height: 100vh;
  margin: 0;
  border-radius: 0;
  background: #fff;
}

.supplier-map-card.is-fullscreen .card-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-top: 0.75rem;
  background: rgba(255, 255, 255, 0.96) !important;
}

.supplier-map-card.is-fullscreen .card-body {
  height: calc(100vh - 88px);
}

.supplier-map-card.is-fullscreen .supplier-map-canvas {
  height: calc(100vh - 120px);
  border-radius: 0.35rem;
}

#scrapMapCard.is-fullscreen {
  width: 100vw;
  height: 100vh;
  margin: 0;
  border-radius: 0;
  background: #fff;
}

#scrapMapCard.is-fullscreen .card-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-top: 0.75rem;
  background: rgba(255, 255, 255, 0.96) !important;
}

#scrapMapCard.is-fullscreen .card-body {
  height: calc(100vh - 88px);
}

#scrapMapCard.is-fullscreen .scrap-map-canvas {
  height: calc(100vh - 120px);
  border-radius: 0.35rem;
}

.savings-rec-mini {
  background: rgba(255, 255, 255, 0.85);
}

.savings-rec-mini:hover,
.savings-rec-mini:focus {
  background: rgba(80, 80, 80, 0.04);
}

.program-shell.sidebar-collapsed .program-body {
  grid-template-columns: 0 minmax(0, 1fr);
}

.program-shell.sidebar-collapsed .program-sidebar {
  opacity: 0;
  overflow: hidden;
  border-right: 0 !important;
}

.program-shell.layout-focus .program-content .container-fluid {
  max-width: 100%;
  padding-left: 0.9rem !important;
  padding-right: 0.9rem !important;
}

.side-section-title {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7b90;
  margin: 0 0 0.5rem;
}

.side-nav .nav-link {
  color: #223248;
  border-radius: 0.65rem;
  padding: 0.55rem 0.65rem;
  font-size: 0.92rem;
  border: 1px solid transparent;
  transition: all 140ms ease;
}

.side-nav .nav-link:hover,
.side-nav .nav-link:focus {
  background: rgba(80, 80, 80, 0.04);
  border-color: rgba(90, 90, 90, 0.10);
  transform: translateY(-1px);
}

.side-nav .nav-link.active {
  background: linear-gradient(180deg, rgba(120,120,120,0.10), rgba(120,120,120,0.05));
  color: #1f2b38;
  font-weight: 600;
  border-color: rgba(110, 110, 110, 0.14);
  box-shadow: 0 5px 12px rgba(30, 30, 30, 0.05);
}

.side-nav .nav-link small {
  color: #6b7b90;
  font-size: 0.82rem;
}

.side-nav-main .nav-link {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.side-nav-main .nav-link small {
  display: none !important;
}

.side-panel {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--shell-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.quotes-sidebar-lite .side-nav .nav-link.active {
  background: rgba(80, 80, 80, 0.04);
  border-color: rgba(90, 90, 90, 0.10);
  box-shadow: none;
  transform: none;
}

.module-hub-page .module-hero {
  background:
    radial-gradient(circle at 8% 12%, rgba(19, 99, 223, 0.12), transparent 45%),
    radial-gradient(circle at 92% 25%, rgba(15, 139, 141, 0.10), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(249, 251, 255, 0.95));
}

.module-spotlight {
  --spotlight-accent: #1363df;
  background: linear-gradient(160deg, rgba(255,255,255,0.95), rgba(244,248,255,0.95));
  border: 1px solid rgba(30, 45, 70, 0.08);
  border-radius: 1rem;
  box-shadow: var(--shadow-sm);
  padding: 1rem;
  position: relative;
  overflow: hidden;
}

.module-spotlight::before {
  content: "";
  position: absolute;
  inset: auto -15% -35% auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in oklab, var(--spotlight-accent) 22%, white), transparent 70%);
  pointer-events: none;
}

.module-spotlight-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #66788d;
}

.module-spotlight-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1c2a3a;
  margin-top: 0.15rem;
}

.module-spotlight-desc {
  color: #5d6f84;
  font-size: 0.92rem;
  margin-top: 0.15rem;
}

.module-card {
  color: inherit;
  border-radius: 1rem;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  border: 1px solid rgba(24, 36, 52, 0.06) !important;
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(250,252,255,0.92));
}

.module-card:hover,
.module-card:focus {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(17, 24, 39, 0.08) !important;
}

.module-card-group {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #435569;
}

.module-card-group::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--module-accent, #1363df);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--module-accent, #1363df) 18%, white);
}

.module-card-group .bi,
.module-card-title .bi {
  opacity: 0.9;
}

.module-card-title {
  font-weight: 700;
  color: #162434;
  margin-bottom: 0.2rem;
}

.module-card-desc {
  color: #5c6d81;
  font-size: 0.9rem;
  min-height: 2.4em;
}

.module-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #1f5fbf;
  font-weight: 600;
  font-size: 0.9rem;
}

.module-group-filter.active {
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.14);
}

.recent-module-chip {
  border: 1px solid rgba(24, 36, 52, 0.08);
  border-radius: 0.8rem;
  padding: 0.6rem 0.7rem;
  background: rgba(255, 255, 255, 0.8);
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.recent-module-chip:hover,
.recent-module-chip:focus {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(19, 99, 223, 0.2);
  transform: translateY(-1px);
}

.recent-module-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.6rem;
  background: rgba(19, 99, 223, 0.08);
  color: #1e5fbe;
  flex: 0 0 2rem;
}

@media (prefers-reduced-motion: reduce) {
  .module-card {
    transition: none;
  }
  .recent-module-chip {
    transition: none;
  }
}

.side-kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.5rem;
  font-size: 0.85rem;
}

.side-kv dt {
  color: #6b7b90;
  margin: 0;
}

.side-kv dd {
  margin: 0;
  color: #223248;
}

.user-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(180deg, #16a34a, #0f766e);
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.15);
}

.sheet-wrap {
  max-height: 70vh;
  overflow: auto;
}

.sheet-table {
  font-size: var(--table-font-size);
  background: transparent;
}

.sheet-table thead th {
  white-space: nowrap;
  border-bottom: 1px solid var(--shell-border);
  color: #4d627a;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  background: rgba(248, 250, 253, 0.92) !important;
}

.sheet-table tbody td,
.sheet-table tbody th {
  border-color: var(--sheet-grid);
  vertical-align: middle;
  padding-top: var(--table-cell-py);
  padding-bottom: var(--table-cell-py);
  padding-left: var(--table-cell-px);
  padding-right: var(--table-cell-px);
}

.sheet-table tbody tr:hover {
  background: rgba(80, 80, 80, 0.035);
}

.program-content .card {
  border-radius: var(--radius-xl);
  border: 1px solid rgba(217, 225, 236, 0.9) !important;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(252,253,255,0.96));
  box-shadow: var(--shadow-md);
}

body.theme-dark {
  --app-bg: #2b2b2b;
  --sheet-grid: #424242;
  --shell-border: #4b4b4b;
  --shell-border-strong: #5b5b5b;
  --shell-panel: #303030;
  --shell-panel-2: #383838;
  --surface: rgba(34, 34, 34, 0.9);
  --surface-strong: rgba(40, 40, 40, 0.96);
  --ink: #ebedf0;
  --muted: #b3bcc8;
  color-scheme: dark;
}

body.theme-dark {
  background: #2b2b2b;
  color: var(--ink);
}

body.theme-dark .program-topbar {
  background: rgba(38, 38, 38, 0.92);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

body.theme-dark .program-menubar .nav-link {
  color: #e3e8ef;
}

body.theme-dark .program-menubar .nav-link:hover,
body.theme-dark .program-menubar .nav-link:focus {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

body.theme-dark .program-menubar .dropdown-menu {
  background: #2f3134;
  border-color: #4a4d52;
}

body.theme-dark .program-menubar .dropdown-item,
body.theme-dark .program-menubar .dropdown-header {
  color: #e2e7ee;
}

body.theme-dark .program-menubar .dropdown-item:hover,
body.theme-dark .program-menubar .dropdown-item:focus,
body.theme-dark .program-menubar .dropdown-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

body.theme-dark .program-menubar .module-submenu > .module-submenu-toggle::after {
  color: #dfe6ef;
}

body.theme-dark .program-sidebar {
  background:
    linear-gradient(180deg, rgba(45,45,45,0.98), rgba(36,36,36,0.98)),
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 29px,
      rgba(255, 255, 255, 0.025) 30px
    );
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
}

body.theme-dark .program-sidebar-head {
  background: linear-gradient(180deg, rgba(52,52,52,0.96), rgba(43,43,43,0.96));
}

body.theme-dark .sidebar-appname,
body.theme-dark .side-nav .nav-link,
body.theme-dark .side-kv dd {
  color: #edf0f4;
}

body.theme-dark .sidebar-home-link,
body.theme-dark .side-kv dt,
body.theme-dark .side-section-title,
body.theme-dark .side-nav .nav-link small {
  color: #aab4c2;
}

body.theme-dark .side-nav .nav-link:hover,
body.theme-dark .side-nav .nav-link:focus {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

body.theme-dark .side-nav .nav-link.active {
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.14);
}

body.theme-dark .quotes-sidebar-lite .side-nav .nav-link.active {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

body.theme-dark .side-panel {
  background: rgba(41, 41, 41, 0.9);
  border-color: #4a4a4a;
}

body.theme-dark .module-hub-page .module-hero {
  background:
    radial-gradient(circle at 8% 12%, rgba(80, 140, 255, 0.14), transparent 45%),
    radial-gradient(circle at 92% 25%, rgba(67, 189, 191, 0.12), transparent 48%),
    linear-gradient(180deg, rgba(43,43,43,0.94), rgba(39,39,39,0.94));
}

body.theme-dark .module-spotlight {
  background: linear-gradient(180deg, rgba(53,53,53,0.94), rgba(43,43,43,0.94));
  border-color: rgba(255,255,255,0.08);
}

body.theme-dark .module-spotlight-title {
  color: #f2f5f8;
}

body.theme-dark .module-spotlight-desc,
body.theme-dark .module-spotlight-label {
  color: #b4becb;
}

body.theme-dark .module-card {
  background: linear-gradient(180deg, rgba(52,52,52,0.94), rgba(43,43,43,0.94));
  border-color: rgba(255,255,255,0.08) !important;
}

body.theme-dark .module-card-title {
  color: #f2f5f8;
}

body.theme-dark .module-card-desc,
body.theme-dark .module-card-group {
  color: #b8c2cf;
}

body.theme-dark .module-card-footer {
  color: #86b5ff;
}

body.theme-dark .recent-module-chip {
  background: rgba(47, 47, 47, 0.88);
  border-color: rgba(255,255,255,0.08);
}

body.theme-dark .recent-module-chip:hover,
body.theme-dark .recent-module-chip:focus {
  background: rgba(55, 55, 55, 0.95);
  border-color: rgba(134, 181, 255, 0.24);
}

body.theme-dark .recent-module-icon {
  background: rgba(134, 181, 255, 0.12);
  color: #9ec4ff;
}

body.theme-dark .program-content .card {
  border-color: #4c4f54 !important;
  background: linear-gradient(180deg, rgba(39,39,39,0.98), rgba(31,31,31,0.97));
  box-shadow: 0 10px 24px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.14);
}

body.theme-dark .program-content .card-header {
  border-bottom-color: rgba(255,255,255,0.07) !important;
}

body.theme-dark .program-content .display-6 {
  background: linear-gradient(180deg, #f4f6f8, #d9dee5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body.theme-dark .program-content .btn-outline-secondary {
  border-color: #62666c;
  color: #dbe1e9;
}

body.theme-dark .program-content .btn-outline-secondary:hover,
body.theme-dark .program-content .btn-outline-secondary:focus {
  background: rgba(255,255,255,0.07);
  border-color: #757a81;
  color: #fff;
}

body.theme-dark .program-content .btn-outline-primary {
  border-color: rgba(96, 165, 250, 0.35);
  color: #9bc4ff;
}

body.theme-dark .program-content .btn-outline-primary:hover,
body.theme-dark .program-content .btn-outline-primary:focus {
  background: rgba(96, 165, 250, 0.10);
  border-color: rgba(96, 165, 250, 0.50);
  color: #d6e8ff;
}

body.theme-dark .program-content .form-control,
body.theme-dark .program-content .form-select {
  background-color: rgba(34,34,34,0.96);
  border-color: #585c62;
  color: #edf0f4;
}

body.theme-dark .program-content .form-control::placeholder {
  color: #99a4b3;
}

body.theme-dark .program-content .form-control:focus,
body.theme-dark .program-content .form-select:focus {
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow: 0 0 0 0.18rem rgba(96, 165, 250, 0.12);
}

body.theme-dark .analytics-ms-caret {
  color: #b7c0cb;
}

body.theme-dark .analytics-ms-panel {
  background: rgba(38,38,38,0.98);
  border-color: #50545a;
}

body.theme-dark .analytics-ms-list {
  background: rgba(255,255,255,0.02);
  border-color: rgba(255,255,255,0.06);
}

body.theme-dark .analytics-ms-item {
  color: #e8edf4;
}

body.theme-dark .analytics-ms-item:hover {
  background: rgba(255,255,255,0.05);
}

body.theme-dark .analytics-ms-empty {
  color: #aeb8c5;
}

body.theme-dark .analytics-filter-chip {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.10);
  color: #e8edf4;
}

body.theme-dark .analytics-filter-chip:hover {
  background: rgba(255,255,255,0.11);
}

body.theme-dark .analytics-filter-chip-key,
body.theme-dark .analytics-filter-chip-x,
body.theme-dark .analytics-filter-chips-empty {
  color: #b6c0cc !important;
}

body.theme-dark .sheet-table thead th {
  color: #b8c2cf;
  background: rgba(49, 49, 49, 0.95) !important;
}

body.theme-dark .sheet-table tbody td,
body.theme-dark .sheet-table tbody th {
  color: #e8edf4;
}

body.theme-dark .sheet-table tbody tr:hover {
  background: rgba(255,255,255,0.035);
}

body.theme-dark .program-content .text-secondary,
body.theme-dark .small.text-secondary {
  color: #aeb8c5 !important;
}

body.theme-dark .analytics-chart {
  border-color: #4d4d4d;
  background: linear-gradient(180deg, rgba(44,44,44,0.96), rgba(36,36,36,0.94));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

body.theme-dark .analytics-chart:empty::before {
  color: #aeb8c5;
}

body.theme-dark .savings-rec-mini {
  background: rgba(41, 41, 41, 0.88);
  border-color: #50545a !important;
}

body.theme-dark .savings-rec-mini:hover,
body.theme-dark .savings-rec-mini:focus {
  background: rgba(255,255,255,0.05);
  border-color: #676d75 !important;
}

.program-content .card-header {
  background: transparent !important;
  border-bottom: 1px solid rgba(217, 225, 236, 0.75) !important;
  border-top-left-radius: var(--radius-xl) !important;
  border-top-right-radius: var(--radius-xl) !important;
  padding-top: 0.85rem;
  padding-bottom: 0.65rem;
}

.program-content .card-body {
  padding: 0.95rem 1rem;
}

.program-content .display-6 {
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #15253a;
  line-height: 1.05;
  background: linear-gradient(180deg, #203248, #0f172a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.program-content .card .text-secondary.small {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.program-content .text-secondary,
.small.text-secondary {
  color: var(--muted) !important;
}

.program-content .btn {
  border-radius: 0.65rem;
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(255,255,255,0.45) inset;
}

.program-content .btn-dark {
  background: linear-gradient(180deg, #223248, #1a2637);
  border-color: #1a2637;
}

.program-content .btn-outline-secondary {
  border-color: var(--shell-border-strong);
  color: #33475f;
}

.program-content .btn-outline-secondary:hover,
.program-content .btn-outline-secondary:focus {
  background: #eff4fb;
  color: #1f3148;
  border-color: #c3d0e2;
}

.program-content .btn-outline-primary {
  border-color: rgba(13, 110, 253, 0.3);
  color: var(--accent-2);
}

.program-content .btn-outline-primary:hover,
.program-content .btn-outline-primary:focus {
  background: rgba(13, 110, 253, 0.08);
  color: #0849af;
  border-color: rgba(13, 110, 253, 0.42);
}

.program-content .form-control,
.program-content .form-select {
  border-radius: 0.65rem;
  border-color: var(--shell-border);
  background-color: rgba(255,255,255,0.95);
  box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.02);
}

.program-content .form-control:focus,
.program-content .form-select:focus {
  border-color: rgba(13, 110, 253, 0.35);
  box-shadow: 0 0 0 0.18rem rgba(13, 110, 253, 0.10);
}

.analytics-ms {
  position: relative;
}

.analytics-ms-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  text-align: left;
  min-height: calc(1.5em + .75rem + 2px);
  cursor: pointer;
}

.analytics-ms-toggle-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-ms-caret {
  flex: 0 0 auto;
  color: #6b7280;
  font-size: 0.8rem;
}

.analytics-ms-panel {
  display: none;
  position: absolute;
  z-index: 1050;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  background: rgba(255,255,255,0.98);
  border: 1px solid var(--shell-border);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-lg);
  padding: 0.55rem;
}

.analytics-ms.is-open .analytics-ms-panel {
  display: block;
}

.analytics-ms-panel-head {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.analytics-ms-actions {
  display: flex;
  gap: 0.35rem;
}

.analytics-ms-actions .btn {
  padding: 0.18rem 0.45rem;
  font-size: 0.74rem;
}

.analytics-ms-list {
  max-height: 210px;
  overflow: auto;
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: 0.55rem;
  padding: 0.25rem;
  background: rgba(249,249,249,0.65);
}

.analytics-ms-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.4rem;
  border-radius: 0.45rem;
  cursor: pointer;
  margin: 0;
  font-size: 0.85rem;
}

.analytics-ms-item:hover {
  background: rgba(80,80,80,0.05);
}

.analytics-ms-item input {
  margin: 0;
}

.analytics-ms-empty {
  padding: 0.65rem 0.5rem;
  color: #7b8794;
  font-size: 0.82rem;
  text-align: center;
}

.analytics-filter-chips {
  min-height: 1.9rem;
}

.analytics-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(90,90,90,0.14);
  background: rgba(255,255,255,0.88);
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  font-size: 0.78rem;
  color: #223248;
  line-height: 1.1;
}

.analytics-filter-chip:hover {
  background: rgba(255,255,255,0.98);
}

.analytics-filter-chip-key {
  color: #667688;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.68rem;
}

.analytics-filter-chip-value {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-filter-chip-x {
  color: #7a8695;
  font-weight: 700;
  font-size: 0.9rem;
}

.program-content .table-responsive {
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
}

.sheet-wrap {
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
}

.savings-rec-mini {
  border-radius: 0.75rem !important;
  border-color: rgba(217,225,236,0.9) !important;
  box-shadow: var(--shadow-sm);
}

.savings-rec-mini:hover,
.savings-rec-mini:focus {
  background: rgba(13, 110, 253, 0.05);
  border-color: rgba(13, 110, 253, 0.18) !important;
  transform: translateY(-1px);
}

.toast {
  border-radius: 0.8rem;
  box-shadow: var(--shadow-lg);
}

.navbar-toggler,
#sidebarToggleBtn {
  border-radius: 0.65rem !important;
}

body.density-compact {
  --table-font-size: 0.84rem;
  --table-cell-py: 0.34rem;
  --table-cell-px: 0.45rem;
}

body.density-comfortable {
  --table-font-size: 0.92rem;
  --table-cell-py: 0.52rem;
  --table-cell-px: 0.55rem;
}

body.look-simple {
  --radius-xl: 0.35rem;
  --radius-lg: 0.35rem;
  --radius-md: 0.25rem;
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
}

body.look-simple {
  background: #f3f4f6;
}

body.look-simple .program-topbar {
  background: #fff;
  backdrop-filter: none;
  box-shadow: none;
}

body.look-simple .program-menubar .nav-link {
  border-radius: 0.3rem;
}

body.look-simple .program-menubar .dropdown-menu {
  border-radius: 0.35rem;
  box-shadow: none;
  padding: 0.2rem;
}

body.look-simple .program-menubar .dropdown-item {
  border-radius: 0.25rem;
}

body.look-simple .program-sidebar {
  background: #f8f9fb;
  box-shadow: none;
}

body.look-simple .program-sidebar-head {
  background: #fff;
}

body.look-simple .side-panel {
  background: #fff;
  border-radius: 0.35rem;
  box-shadow: none;
  border: 1px solid rgba(0,0,0,0.08);
}

body.look-simple .program-content .card,
body.look-simple .program-content .table-responsive,
body.look-simple .sheet-wrap,
body.look-simple .analytics-chart,
.look-simple .rfi-radar-chart-box,
body.look-simple .savings-rec-mini,
body.look-simple .toast {
  box-shadow: none !important;
}

body.look-simple .rfi-radar-chart-box {
  height: 280px;
  max-height: 34vh;
  border-radius: 0.35rem;
  background: #fff;
}

body.look-simple .quotes-rfi-analytics-chart {
  height: 240px;
}

body.look-simple .quotes-rfi-analytics-chart-sm {
  height: 170px;
}

body.look-simple .program-content .card {
  border-radius: 0.35rem;
}

body.look-simple .program-content .card-header {
  background: #f7f7f8;
}

body.look-simple .program-content .btn,
body.look-simple .navbar-toggler,
body.look-simple #sidebarToggleBtn {
  border-radius: 0.35rem !important;
}

body.look-simple .module-hub-page .module-hero,
body.look-simple .module-spotlight,
body.look-simple .module-card {
  box-shadow: none;
  background-image: none;
}

body.look-simple .program-content .text-secondary,
body.look-simple .small.text-secondary {
  color: #5f6977 !important;
}

body.look-simple.theme-dark {
  background: #1f2329;
}

body.look-simple.theme-dark .program-topbar {
  background: #232830;
}

body.look-simple.theme-dark .program-sidebar {
  background: #20252d;
}

body.look-simple.theme-dark .program-sidebar-head {
  background: #232830;
}

@media (max-width: 991.98px) {
  .program-body {
    grid-template-columns: 1fr;
  }

  .program-sidebar {
    border-right: 0 !important;
    border-bottom: 1px solid var(--shell-border);
  }

  .program-content .card {
    border-radius: 0.9rem;
  }
}
