/**
 * ET4D professional UI layer — clean feed-style layout inspired by
 * common professional network patterns (neutral canvas, white cards, blue accent).
 */
.et4d-skip-link {
  z-index: 1100;
}

:root {
  --et4d-page-bg: #f3f2ef;
  --et4d-card-border: rgba(0, 0, 0, 0.08);
  --et4d-card-radius: 0.5rem;
  --et4d-accent: #0a66c2;
  --et4d-accent-hover: #004182;
  --et4d-accent-soft: rgba(10, 102, 194, 0.12);
  --et4d-text: rgba(0, 0, 0, 0.9);
  --et4d-text-muted: rgba(0, 0, 0, 0.6);
  --et4d-focus-ring: 0 0 0 3px rgba(10, 102, 194, 0.35);
  --et4d-ok: #1b7f4a;
  --et4d-ok-bg: rgba(27, 127, 74, 0.12);
  --et4d-warn: #b8860b;
  --et4d-warn-bg: rgba(184, 134, 11, 0.14);
  --et4d-bad: #c53030;
  --et4d-bad-bg: rgba(197, 48, 48, 0.1);
  --bs-primary: #0a66c2;
  --bs-primary-rgb: 10, 102, 194;
  --bs-link-color: #0a66c2;
  --bs-link-hover-color: #004182;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--et4d-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Focus & keyboard: visible rings on interactive elements */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.form-check-input:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.menu-link:focus-visible {
  outline: none;
  box-shadow: var(--et4d-focus-ring);
}

.dropdown-toggle:focus-visible {
  box-shadow: var(--et4d-focus-ring);
  border-radius: 0.375rem;
}

/* Click / press feedback */
.btn {
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-primary:active:not(:disabled) {
  filter: brightness(0.95);
}

.layout-menu .menu-link {
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.08s ease;
  border-radius: 0 2rem 2rem 0;
}

.layout-menu .menu-link:active {
  transform: scale(0.985);
}

.layout-menu .menu-icon {
  font-size: 1.2rem;
  width: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, transform 0.2s ease;
}

.layout-menu .menu-item:not(.active) > .menu-link:hover .menu-icon,
.layout-menu .menu-item:not(.active) > .menu-link:focus .menu-icon {
  color: var(--et4d-accent);
  transform: translateX(1px);
}

.layout-wrapper .layout-page {
  background-color: var(--et4d-page-bg) !important;
}

.content-wrapper {
  background-color: transparent;
}

/* Top bar: flat white strip */
#layout-navbar.layout-navbar,
.layout-navbar.bg-navbar-theme {
  background-color: #fff !important;
  box-shadow: inset 0 -1px 0 var(--et4d-card-border);
  border-radius: 0 !important;
}

.layout-navbar .header-username {
  color: var(--et4d-text-muted) !important;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Sidebar: light rail with active rail indicator */
.layout-menu.menu-vertical.bg-menu-theme {
  background-color: #fff !important;
  box-shadow: inset -1px 0 0 var(--et4d-card-border);
}

.layout-menu .menu-item.active > .menu-link {
  background-color: rgba(10, 102, 194, 0.08) !important;
  color: var(--et4d-accent) !important;
  font-weight: 600;
  border-radius: 0 2rem 2rem 0;
  margin-right: 0.5rem;
}

.layout-menu .menu-item:not(.active) > .menu-link:hover,
.layout-menu .menu-item:not(.active) > .menu-link:focus {
  background-color: rgba(0, 0, 0, 0.04) !important;
}

.layout-menu .menu-item:not(.active) > .menu-link:hover > div,
.layout-menu .menu-item:not(.active) > .menu-link:focus > div {
  font-weight: 600;
  font-style: normal;
}

.layout-menu .menu-icon {
  color: var(--et4d-text-muted);
}

.layout-menu .menu-item.active .menu-icon {
  color: var(--et4d-accent);
}

/* Cards sit on the canvas */
.card {
  border: 1px solid var(--et4d-card-border);
  border-radius: var(--et4d-card-radius);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.card.shadow-sm {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08) !important;
}

.btn-primary {
  background-color: var(--et4d-accent);
  border-color: var(--et4d-accent);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--et4d-accent-hover);
  border-color: var(--et4d-accent-hover);
}

.btn-outline-primary {
  color: var(--et4d-accent);
  border-color: var(--et4d-accent);
}

.btn-outline-primary:hover {
  background-color: rgba(10, 102, 194, 0.08);
  color: var(--et4d-accent-hover);
  border-color: var(--et4d-accent-hover);
}

.btn-outline-secondary {
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.08s ease;
}

.btn-outline-secondary:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

a:not(.btn):not(.menu-link):not(.dropdown-item):not(.app-brand-link):not(.nav-link):not(.et4d-app-row) {
  text-underline-offset: 0.2em;
}

a:not(.btn):not(.menu-link):not(.text-decoration-none):not(.et4d-app-row):hover {
  text-decoration-thickness: 1px;
}

.text-primary {
  color: var(--et4d-accent) !important;
}

.bg-label-primary,
.badge.bg-label-primary {
  background-color: rgba(10, 102, 194, 0.12) !important;
  color: var(--et4d-accent) !important;
}

/* Footer */
.content-footer.footer.bg-footer-theme {
  background-color: transparent !important;
  border-top: 1px solid var(--et4d-card-border);
}

.content-footer .link-secondary:hover {
  color: var(--et4d-accent) !important;
}

/* Optional small eyebrow above h1 (unused in current templates — single h1 preferred) */
.et4d-page-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--et4d-text-muted);
  margin-bottom: 0.25rem;
}

.et4d-page-heading {
  font-size: clamp(1.35rem, 2.5vw, 1.6rem);
  font-weight: 600;
  color: var(--et4d-text);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 0;
}

/* Rail list (partners, links) */
.et4d-rail-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.et4d-rail-list li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--et4d-card-border);
  font-size: 0.9375rem;
  color: var(--et4d-text);
}

.et4d-rail-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.et4d-rail-list li:first-child {
  padding-top: 0;
}

/* Auth cards */
.et4d-auth-card {
  border-radius: var(--et4d-card-radius);
  overflow: hidden;
}

.et4d-auth-card .card-header {
  background: #fff;
  border-bottom: 1px solid var(--et4d-card-border);
  padding: 1.25rem 1.5rem;
}

.et4d-auth-card .card-header h4 {
  font-weight: 600;
  font-size: 1.25rem;
  margin: 0;
  color: var(--et4d-text);
}

/* Home: align accent with global primary */
.home-section .home-card-eyebrow {
  color: var(--et4d-accent);
}

.home-section .card-home-primary {
  border-color: rgba(10, 102, 194, 0.35);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(10, 102, 194, 0.12);
  background: #fff;
}

.home-section .feature-icon {
  background: rgba(10, 102, 194, 0.1);
  color: var(--et4d-accent);
  box-shadow: none;
}

/* Home: compact app launcher (dense rows, one card — Office-style hub) */
.et4d-app-launcher {
  overflow: hidden;
}

.et4d-app-rows {
  padding: 0.35rem 0;
}

.et4d-app-rows > li {
  margin: 0;
}

.et4d-app-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.85rem 1.25rem;
  text-decoration: none;
  color: var(--et4d-text);
  border-bottom: 1px solid var(--et4d-card-border);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.et4d-app-rows > li:last-child .et4d-app-row {
  border-bottom: 0;
}

.et4d-app-row:hover {
  background-color: rgba(0, 0, 0, 0.03);
  color: var(--et4d-text);
}

.et4d-app-row:active {
  background-color: rgba(10, 102, 194, 0.06);
}

.et4d-app-row:focus-visible {
  position: relative;
  z-index: 1;
  box-shadow: inset 0 0 0 2px var(--et4d-accent);
}

.et4d-app-row-icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.625rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--et4d-accent-soft);
  color: var(--et4d-accent);
  font-size: 1.35rem;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.et4d-app-row:hover .et4d-app-row-icon {
  transform: scale(1.05);
  background-color: rgba(10, 102, 194, 0.18);
}

.et4d-app-row-text strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--et4d-text);
}

.et4d-app-row-text span {
  display: block;
  font-size: 0.8125rem;
  color: var(--et4d-text-muted);
  line-height: 1.45;
  margin-top: 0.15rem;
}

.et4d-app-row .bx-chevron-right {
  margin-left: auto;
  font-size: 1.25rem;
  color: var(--et4d-text-muted);
  opacity: 0.65;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.et4d-app-row:hover .bx-chevron-right {
  transform: translateX(3px);
  opacity: 1;
  color: var(--et4d-accent);
}

.et4d-home-feature .card {
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.et4d-home-feature a:hover .card,
.et4d-home-feature a:focus-visible .card {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -12px rgba(0, 0, 0, 0.18);
}

.hero-orbit-ring {
  border-color: rgba(10, 102, 194, 0.22) !important;
}

.hero-orbit-ring--delay {
  border-color: rgba(55, 143, 233, 0.28) !important;
}

/* Alerts intro as a compact card */
.et4d-threshold-intro ul {
  padding-left: 1.1rem;
  margin-bottom: 0;
  color: var(--et4d-text);
}

.et4d-threshold-intro li {
  margin-bottom: 0.35rem;
}

/* Tables: calmer header */
.table thead th {
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--et4d-text-muted);
  border-bottom-width: 1px !important;
  background-color: #fafafa;
}

/* Form controls */
.form-control:focus,
.form-select:focus {
  border-color: var(--et4d-accent);
  box-shadow: 0 0 0 0.2rem rgba(10, 102, 194, 0.15);
}

/* Interaction polish: hover + transitions (150ms ease) */
.form-control,
.form-select,
input,
textarea,
select {
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, color 150ms ease;
}

.form-control:hover,
.form-select:hover,
input:hover,
textarea:hover,
select:hover {
  background-color: rgba(143, 184, 162, 0.08);
}

/* Validation states (UX spec: error = red border + red text only) */
.is-invalid,
.form-control.is-invalid,
.form-select.is-invalid {
  border-color: var(--et4d-bad) !important;
  box-shadow: none !important;
}

.is-invalid:focus,
.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
  border-color: var(--et4d-bad) !important;
  box-shadow: 0 0 0 2px rgba(197, 48, 48, 0.12) !important;
}

.invalid-feedback,
.et4d-inline-error {
  display: block;
  color: var(--et4d-bad) !important;
}

/* -------------------------------------------------------------------------
   Auth login polish (modern SaaS UX)
   ------------------------------------------------------------------------- */
.et4d-auth-page {
  background: #f5f6f2;
}

.et4d-auth-form .form-control {
  background: #ffffff !important;
  border: 1px solid #c9c1b6 !important;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.et4d-auth-form .form-control:focus {
  border-color: #2a5a45 !important;
  box-shadow: 0 0 0 3px rgba(42, 90, 69, 0.18) !important;
  transform: translateY(-1px);
}

/* Remove browser autofill "blue" look (Chrome/Edge) */
.et4d-auth-form input:-webkit-autofill,
.et4d-auth-form input:-webkit-autofill:hover,
.et4d-auth-form input:-webkit-autofill:focus,
.et4d-auth-form input:-webkit-autofill:active {
  -webkit-text-fill-color: #17362b !important;
  transition: background-color 99999s ease-in-out 0s;
  -webkit-box-shadow: 0 0 0px 1000px #ffffff inset !important;
  box-shadow: 0 0 0px 1000px #ffffff inset !important;
  caret-color: #17362b !important;
}

/* Standard autofill (Firefox) */
.et4d-auth-form input:autofill {
  box-shadow: 0 0 0px 1000px #ffffff inset !important;
}

.et4d-auth-inline-error {
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(201, 193, 182, 0.9);
  border-left: 3px solid #2a5a45;
  border-radius: 0.75rem;
  background: #ffffff;
  color: #17362b !important;
  font-size: 0.875rem;
}

/* Button loading (disable + spinner + "Please wait...") */
.btn.et4d-btn--loading,
button.et4d-btn--loading,
input[type="submit"].et4d-btn--loading {
  pointer-events: none;
}

.et4d-btn__spinner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
  background-color: var(--et4d-accent) !important;
}

.nav-pills .nav-link {
  color: var(--et4d-text-muted);
  border-radius: 2rem;
}

.nav-pills .nav-link:not(.active):hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--et4d-text);
}

/* -------------------------------------------------------------------------
   Subtle cards & profile panels (used across dashboards; mirrors professional
   app shells where content sits in bordered white panels on a gray canvas)
   ------------------------------------------------------------------------- */
.card-subtle {
  background-color: #fff;
  border: 1px solid var(--et4d-card-border);
  border-radius: var(--et4d-card-radius);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card-subtle:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.12);
}

.info-section-subtle {
  background-color: #fafafa;
  border: 1px solid var(--et4d-card-border);
  border-radius: var(--et4d-card-radius);
}

.info-section-subtle.d-grid.gap-3 {
  padding: 1.25rem 1.5rem;
}

.et4d-field-label {
  color: var(--et4d-text-muted) !important;
  font-size: 0.8125rem;
  font-weight: 600;
}

.et4d-field-value {
  color: var(--et4d-text) !important;
  font-weight: 500;
}

.et4d-field-value--multiline {
  color: rgba(0, 0, 0, 0.65) !important;
  line-height: 1.6;
}

.et4d-field-label--top {
  padding-top: 0.5rem;
}

.et4d-help-note {
  font-size: 0.75rem;
  color: var(--et4d-text-muted);
}

.et4d-badge-soft {
  font-size: 0.75rem;
  padding: 0.25rem 0.625rem;
  font-weight: 600;
}

/* Data tables (threshold / admin lists) */
.table.et4d-data-table {
  background-color: #fff;
  margin-bottom: 0;
}

.table.et4d-data-table thead th {
  font-weight: 600;
  color: var(--et4d-text-muted);
  padding: 0.75rem;
  vertical-align: middle;
  background-color: #fafafa;
  border-bottom: 1px solid var(--et4d-card-border);
}

.table.et4d-data-table tbody th,
.table.et4d-data-table tbody td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--et4d-card-border);
}

.table.et4d-data-table tbody th {
  font-weight: 500;
  color: var(--et4d-text);
}

.table.et4d-data-table tbody td {
  color: rgba(0, 0, 0, 0.65);
}

.table.et4d-data-table .et4d-table-empty {
  color: var(--et4d-text-muted);
}

.table.et4d-data-table .et4d-cell-muted {
  color: #adb5bd;
}

/* Nav user menu */
.navbar-dropdown .dropdown-menu {
  border: 1px solid var(--et4d-card-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  border-radius: var(--et4d-card-radius);
  padding: 0.35rem 0;
}

.navbar-dropdown .dropdown-item {
  padding: 0.5rem 1rem;
}

.navbar-dropdown .dropdown-item:active {
  background-color: rgba(10, 102, 194, 0.1);
  color: var(--et4d-accent);
}

.layout-navbar .avatar img {
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--et4d-card-border);
}

/* Contact / avatar initials */
.et4d-avatar-placeholder {
  width: 140px;
  height: 140px;
  border: 4px solid #fff;
  background: linear-gradient(135deg, var(--et4d-accent) 0%, #378fe9 100%);
}

.et4d-avatar-placeholder span {
  font-size: 3rem;
  font-weight: 600;
}

.et4d-contact-avatar {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border: 4px solid #fff;
}

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

  .card-subtle:hover {
    transform: none;
  }

  .et4d-app-row,
  .et4d-app-row-icon,
  .et4d-app-row .bx-chevron-right {
    transition: none !important;
  }
}

/* -------------------------------------------------------------------------
   Agricultural / decision UX (tokens in :root above)
   ------------------------------------------------------------------------- */
.letter-spacing-sm {
  letter-spacing: 0.08em;
}

.et4d-dash-context {
  background: linear-gradient(135deg, rgba(10, 102, 194, 0.06), rgba(255, 255, 255, 0.95));
}

.et4d-page-icon-tile {
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
}

.et4d-section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  background: var(--et4d-accent-soft);
}

/* Grafana-style frame for embedded Dash */
.dash-app {
  border-radius: var(--et4d-card-radius);
  border: 1px solid var(--et4d-card-border);
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

/* Touch targets: barn / field use */
@media (max-width: 1199.98px) {
  .layout-menu .menu-link {
    min-height: 48px;
    padding-top: 0.65rem !important;
    padding-bottom: 0.65rem !important;
  }

  .et4d-app-row {
    min-height: 52px;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
}

/* -------------------------------------------------------------------------
   Public consumer dashboard (/dash/public/) — horizontal dot plot vs EU band
   ------------------------------------------------------------------------- */
.et4d-consumer-metric.chart-section {
  padding: 1.55rem 1.65rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%);
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.03),
    0 10px 30px rgba(15, 23, 42, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.et4d-consumer-metric.chart-section:hover {
  transform: translateY(-1px);
  box-shadow:
    0 2px 6px rgba(15, 23, 42, 0.05),
    0 14px 38px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border-color: rgba(100, 116, 139, 0.34);
}

.et4d-cd-metric-head__title {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.et4d-cd-metric-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.06));
}

.et4d-cd-metric-head h5 {
  font-weight: 750;
  color: #0f172a;
  font-size: clamp(1.08rem, 1.1vw + 0.85rem, 1.34rem);
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.et4d-cd-kpi-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.et4d-cd-kpi {
  display: inline-flex;
  align-items: baseline;
  gap: 0.42rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  border: 1px solid transparent;
  backdrop-filter: saturate(130%) blur(2px);
}

.et4d-cd-kpi__n {
  font-weight: 700;
  font-size: 1.125rem;
  font-variant-numeric: tabular-nums;
}

.et4d-cd-kpi__lbl {
  opacity: 0.85;
  font-weight: 500;
}

.et4d-cd-kpi--good {
  background: rgba(27, 127, 74, 0.1);
  border-color: rgba(27, 127, 74, 0.22);
  color: #14532d;
}

.et4d-cd-kpi--medium {
  background: rgba(180, 120, 0, 0.12);
  border-color: rgba(180, 120, 0, 0.25);
  color: #713f12;
}

.et4d-cd-kpi--poor {
  background: rgba(197, 48, 48, 0.1);
  border-color: rgba(197, 48, 48, 0.22);
  color: #7f1d1d;
}

.et4d-cd-kpi--empty {
  background: rgba(100, 116, 139, 0.1);
  border-color: rgba(100, 116, 139, 0.2);
  color: #334155;
}

.et4d-dp-subtitle {
  max-width: 48rem;
  line-height: 1.55;
  color: #64748b !important;
  font-size: 0.885rem;
}

.et4d-dp-legend--inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.35;
}

.et4d-dp-legend__inline-item {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  font-weight: 600;
  padding: 0.24rem 0.56rem;
  border-radius: 999px;
  background: rgba(241, 245, 249, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.et4d-dp-legend__inline-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.1);
}

.et4d-dp-legend__inline-dot--good {
  background: #22c55e;
}

.et4d-dp-legend__inline-dot--medium {
  background: #f59e0b;
}

.et4d-dp-legend__inline-dot--poor {
  background: #ef4444;
}

.et4d-dp-legend__inline-note {
  flex: 1 1 260px;
  font-size: 0.74rem;
  color: #64748b;
}

/* Consumer chart: vertical dot plot + horizontal value bands */
.et4d-dp-legend--cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 0.75rem;
  color: #334155;
  font-size: 0.8125rem;
  line-height: 1.35;
}

.et4d-dp-legend__card {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.45rem 0.55rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.85);
}

.et4d-dp-legend__card--ok {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(220, 252, 231, 0.35);
}

.et4d-dp-legend__card--warn {
  border-color: rgba(234, 179, 8, 0.4);
  background: rgba(254, 249, 195, 0.35);
}

.et4d-dp-legend__card--bad {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(254, 226, 226, 0.35);
}

.et4d-dp-legend__card--band {
  grid-column: 1 / -1;
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(187, 247, 208, 0.25);
}

.et4d-dp-legend__card-dot {
  flex-shrink: 0;
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 50%;
  margin-top: 0.15rem;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.et4d-dp-legend__card-dot--good {
  background: #22c55e;
}

.et4d-dp-legend__card-dot--medium {
  background: #f59e0b;
}

.et4d-dp-legend__card-dot--poor {
  background: #ef4444;
}

.et4d-dp-legend__band-mini {
  flex-shrink: 0;
  width: 2.25rem;
  height: 0.875rem;
  margin-top: 0.12rem;
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.95), rgba(34, 197, 94, 0.75));
  border: 1px solid rgba(22, 163, 74, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.et4d-dp-chart {
  margin-top: 0.25rem;
}

.et4d-dp-scale-intro {
  max-width: 52rem;
}

.et4d-dp-vwrap__eu-badge {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.65rem;
  padding: 0.4rem 0.65rem;
  border-radius: 0.5rem;
  background: linear-gradient(180deg, rgba(220, 252, 231, 0.95), rgba(187, 247, 208, 0.75));
  border: 1px solid rgba(22, 163, 74, 0.4);
  font-size: 0.875rem;
  font-weight: 600;
  color: #14532d;
}

.et4d-dp-vwrap__eu-badge-label {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
  opacity: 0.9;
}

.et4d-dp-vwrap__eu-badge-range {
  font-variant-numeric: tabular-nums;
}

.et4d-dp-vplot {
  --et4d-vplot-h: 17.5rem;
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  gap: 0.35rem 0.5rem;
  align-items: start;
}

.et4d-dp-vplot__y-axis {
  padding-top: 0.25rem;
}

.et4d-dp-vplot__y-unit {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.et4d-dp-vplot__y-tick-area {
  height: var(--et4d-vplot-h);
  position: relative;
  border-right: 1px solid rgba(148, 163, 184, 0.45);
  pointer-events: none;
}

.et4d-dp-vplot__y-ticks {
  position: absolute;
  inset: 0;
}

.et4d-dp-vplot__y-tick {
  position: absolute;
  right: 0.35rem;
  transform: translateY(50%);
  font-size: 0.65rem;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.et4d-dp-vplot__y-tick--eu {
  font-weight: 700;
  color: #15803d;
}

.et4d-dp-vplot__scroll {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.25rem;
}

.et4d-dp-vstack {
  min-width: max(100%, calc(var(--et4d-vcols, 1) * 4.75rem));
}

.et4d-dp-vcanvas {
  position: relative;
  height: var(--et4d-vplot-h);
  border-radius: 0.5rem;
  background: rgba(248, 250, 252, 0.92);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.et4d-dp-vxlabels {
  display: flex;
  margin-top: 0.15rem;
  gap: 0;
  width: 100%;
}

.et4d-dp-vcanvas__bands {
  position: absolute;
  inset: 6px 8px 6px 8px;
  border-radius: 0.35rem;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.et4d-dp-vzone {
  position: absolute;
  left: 0;
  right: 0;
  box-sizing: border-box;
}

.et4d-dp-vzone--danger {
  background: rgba(254, 202, 202, 0.58);
}

.et4d-dp-vzone--warn {
  background: rgba(253, 230, 138, 0.5);
}

.et4d-dp-vzone--ok {
  background: rgba(187, 247, 208, 0.38);
}

.et4d-dp-vzone--eu {
  background: linear-gradient(180deg, rgba(167, 243, 208, 0.95), rgba(74, 222, 128, 0.82));
  box-shadow:
    inset 0 0 0 1px rgba(22, 163, 74, 0.35),
    inset 0 2px 0 rgba(255, 255, 255, 0.5);
}

/* Very mild shimmer on EU band only */
.et4d-dp-vzone--eu-shimmer {
  animation: et4d-dp-eu-shimmer 4s ease-in-out infinite;
}

@keyframes et4d-dp-eu-shimmer {
  0%,
  100% {
    filter: brightness(1);
    box-shadow:
      inset 0 0 0 1px rgba(22, 163, 74, 0.35),
      inset 0 2px 0 rgba(255, 255, 255, 0.5),
      0 0 0 0 rgba(74, 222, 128, 0);
  }

  50% {
    filter: brightness(1.04);
    box-shadow:
      inset 0 0 0 1px rgba(22, 163, 74, 0.42),
      inset 0 2px 0 rgba(255, 255, 255, 0.55),
      0 0 18px rgba(74, 222, 128, 0.12);
  }
}

.et4d-dp-vcanvas__eu-lines {
  position: absolute;
  inset: 6px 8px 6px 8px;
  border-radius: 0.35rem;
  pointer-events: none;
  z-index: 1;
}

.et4d-dp-vcanvas__eu-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 2px solid rgba(21, 128, 61, 0.75);
  transform: translateY(1px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.et4d-dp-vcanvas__cols {
  position: absolute;
  inset: 6px 8px 6px 8px;
  display: flex;
  z-index: 2;
  align-items: stretch;
}

.et4d-dp-vcol {
  flex: 1 1 0;
  min-width: 4.25rem;
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(226, 232, 240, 0.85);
}

.et4d-dp-vcol:first-child {
  border-left: none;
}

.et4d-dp-vcol__track {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.et4d-dp-vcol__anchor {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  max-width: calc(100% - 4px);
  pointer-events: none;
}

.et4d-dp-vcol__cap {
  font-size: 0.65rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.2;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
  pointer-events: none;
  max-width: 100%;
  word-break: break-word;
}

.et4d-dp-vdot {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  cursor: help;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  pointer-events: auto;
}

.et4d-dp-vdot:hover,
.et4d-dp-vdot:focus-visible {
  transform: scale(1.12);
  outline: none;
  box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.35), 0 2px 8px rgba(15, 23, 42, 0.25);
}

.et4d-dp-vdot--good {
  background: #16a34a;
}

.et4d-dp-vdot--medium {
  background: #ca8a04;
}

.et4d-dp-vdot--poor {
  background: #dc2626;
}

.et4d-dp-vdot--empty {
  background: #94a3b8;
}

/* Slow, gentle pulse — outside range only */
.et4d-dp-vdot--pulse {
  animation: et4d-dp-vdot-pulse 3.2s ease-in-out infinite;
}

@keyframes et4d-dp-vdot-pulse {
  0%,
  100% {
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2), 0 0 0 0 rgba(220, 38, 38, 0.25);
  }

  50% {
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2), 0 0 0 6px rgba(220, 38, 38, 0);
  }
}

/* Borderline: very subtle emphasis */
.et4d-dp-vdot--soft {
  animation: et4d-dp-vdot-soft 3.5s ease-in-out infinite;
}

@keyframes et4d-dp-vdot-soft {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
  }

  50% {
    opacity: 0.92;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2), 0 0 0 1px rgba(202, 138, 4, 0.45);
  }
}

.et4d-dp-vcol__empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.25rem;
  pointer-events: none;
}

.et4d-dp-vcol__xlabel {
  flex: 1 1 0;
  min-width: 4.25rem;
  padding: 0.35rem 0.2rem 0.15rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: #475569;
  text-align: center;
  line-height: 1.2;
  max-height: 2.6rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
  border-left: 1px solid rgba(226, 232, 240, 0.85);
}

.et4d-dp-vcol__xlabel:first-child {
  border-left: none;
}

.et4d-dp-footnote {
  max-width: 52rem;
  line-height: 1.5;
}

/* Server-rendered SVG consumer charts (does not rely on layout CSS for correctness) */
.et4d-dp-svg-outer {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.78), rgba(241, 245, 249, 0.88));
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  padding: 0.65rem 0.55rem;
}

.et4d-cdp-svg-chart {
  display: block;
  max-width: 100%;
  height: auto;
}

.et4d-consumer-highcharts {
  min-height: 600px;
  transition: opacity 0.24s ease;
}

@media (prefers-reduced-motion: reduce) {
  .et4d-dp-vzone--eu-shimmer,
  .et4d-dp-vdot--pulse,
  .et4d-dp-vdot--soft {
    animation: none !important;
  }
}

@media (max-width: 767.98px) {
  .et4d-dp-legend--cards {
    grid-template-columns: 1fr;
  }

  .et4d-dp-vplot {
    grid-template-columns: 2.85rem minmax(0, 1fr);
    --et4d-vplot-h: 16rem;
  }
}

/* -------------------------------------------------------------------------
   UI SYSTEM OVERRIDES (production SaaS pass - structure unchanged)
   ------------------------------------------------------------------------- */
:root {
  /* Color system */
  --et4d-primary: #22c55e;
  --et4d-primary-hover: #16a34a;
  --et4d-primary-soft: #dcfce7;
  --et4d-accent: #3b82f6;
  --et4d-accent-soft: rgba(59, 130, 246, 0.12);
  --et4d-bg: #f8fafc;
  --et4d-card-bg: #ffffff;
  --et4d-text-primary: #0f172a;
  --et4d-text-secondary: #64748b;
  --et4d-border: #e2e8f0;
  --et4d-success: #22c55e;
  --et4d-warning: #f59e0b;
  --et4d-danger: #ef4444;

  /* Typography scale */
  --et4d-h1: clamp(1.5rem, 1.2rem + 1vw, 1.75rem); /* 24-28 */
  --et4d-h2: clamp(1.125rem, 1rem + 0.5vw, 1.25rem); /* 18-20 */
  --et4d-body: 0.9375rem; /* 15 */
  --et4d-meta: 0.75rem; /* 12 */
  --et4d-line-height: 1.5;

  /* Spacing scale: 8/12/16/24/32/48 */
  --et4d-space-1: 0.5rem;
  --et4d-space-2: 0.75rem;
  --et4d-space-3: 1rem;
  --et4d-space-4: 1.5rem;
  --et4d-space-5: 2rem;
  --et4d-space-6: 3rem;

  /* Common component tokens */
  --et4d-card-radius: 0.875rem;
  --et4d-card-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  --et4d-card-shadow-hover: 0 10px 20px rgba(15, 23, 42, 0.09);
  --et4d-btn-radius: 0.6875rem;
  --et4d-input-radius: 0.625rem;

  /* Keep bootstrap primary in sync */
  --bs-primary: #22c55e;
  --bs-primary-rgb: 34, 197, 94;
  --bs-link-color: #3b82f6;
  --bs-link-hover-color: #2563eb;
}

html,
body {
  font-size: var(--et4d-body);
  line-height: var(--et4d-line-height);
  color: var(--et4d-text-primary);
  background-color: var(--et4d-bg);
}

.layout-wrapper .layout-page {
  background-color: var(--et4d-bg) !important;
}

a:not(.btn):not(.menu-link):not(.dropdown-item):not(.app-brand-link):not(.nav-link):not(.et4d-app-row) {
  color: var(--bs-link-color);
}

a:not(.btn):not(.menu-link):not(.dropdown-item):not(.app-brand-link):not(.nav-link):not(.et4d-app-row):hover {
  color: var(--bs-link-hover-color);
}

.layout-navbar.bg-navbar-theme {
  background: #ffffff !important;
}

.layout-menu .menu-item.active > .menu-link {
  background-color: rgba(59, 130, 246, 0.12) !important;
  color: var(--et4d-accent) !important;
}

h1,
.h1,
.et4d-page-heading {
  font-size: var(--et4d-h1);
  font-weight: 600;
  line-height: 1.4;
  color: var(--et4d-text-primary);
}

h2,
.h2,
.card-header h2,
.section-title {
  font-size: var(--et4d-h2);
  font-weight: 500;
  line-height: 1.45;
  color: var(--et4d-text-primary);
}

p,
li,
label,
.form-label,
.et4d-field-value {
  font-size: var(--et4d-body);
  line-height: var(--et4d-line-height);
}

small,
.small,
.et4d-help-note,
.et4d-field-label,
.text-muted {
  font-size: var(--et4d-meta) !important;
  color: var(--et4d-text-secondary) !important;
}

/* Section hierarchy spacing */
section + section,
.section + .section,
.container-xxl > .card + .card,
.container-xxl > .row + .row {
  margin-top: var(--et4d-space-5);
}

/* Spacing scale normalization */
.p-2 { padding: var(--et4d-space-2) !important; }
.p-3 { padding: var(--et4d-space-3) !important; }
.p-4 { padding: var(--et4d-space-4) !important; }
.p-5 { padding: var(--et4d-space-5) !important; }
.mt-2 { margin-top: var(--et4d-space-2) !important; }
.mt-3 { margin-top: var(--et4d-space-3) !important; }
.mt-4 { margin-top: var(--et4d-space-4) !important; }
.mt-5 { margin-top: var(--et4d-space-5) !important; }
.mb-2 { margin-bottom: var(--et4d-space-2) !important; }
.mb-3 { margin-bottom: var(--et4d-space-3) !important; }
.mb-4 { margin-bottom: var(--et4d-space-4) !important; }
.mb-5 { margin-bottom: var(--et4d-space-5) !important; }
.gap-2 { gap: var(--et4d-space-2) !important; }
.gap-3 { gap: var(--et4d-space-3) !important; }
.gap-4 { gap: var(--et4d-space-4) !important; }

/* Card system */
.card,
.card-subtle,
.dashboard-card,
.et4d-consumer-metric.chart-section {
  border-radius: var(--et4d-card-radius) !important;
  border: 1px solid var(--et4d-border) !important;
  background: var(--et4d-card-bg) !important;
  box-shadow: var(--et4d-card-shadow) !important;
  transition: all 0.2s ease !important;
}

.card:hover,
.card-subtle:hover,
.dashboard-card:hover,
.et4d-consumer-metric.chart-section:hover {
  transform: translateY(-2px);
  box-shadow: var(--et4d-card-shadow-hover) !important;
}

.card-header,
.card-body,
.card-footer {
  padding: var(--et4d-space-3) !important;
}

/* Button system */
.btn {
  border-radius: var(--et4d-btn-radius) !important;
  transition: all 0.2s ease !important;
}

.btn-primary,
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
  background-color: var(--et4d-primary) !important;
  border-color: var(--et4d-primary) !important;
  color: #ffffff !important;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  filter: brightness(1.05);
  background-color: var(--et4d-primary-hover) !important;
  border-color: var(--et4d-primary-hover) !important;
  box-shadow: 0 6px 16px rgba(34, 197, 94, 0.24) !important;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

/* Inputs */
.form-control,
.form-select {
  border: 1px solid var(--et4d-border) !important;
  border-radius: var(--et4d-input-radius) !important;
  transition: all 0.2s ease !important;
}

.form-control:focus,
.form-select:focus,
.form-control:focus-visible,
.form-select:focus-visible {
  border-color: var(--et4d-primary) !important;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.18) !important;
  outline: none !important;
}

/* Data highlight */
.kpi-value,
.metric-value,
.et4d-cd-kpi__n,
.display-6,
.display-5 {
  color: var(--et4d-primary);
  font-weight: 700 !important;
}

.bg-label-primary,
.badge.bg-label-primary {
  background-color: rgba(34, 197, 94, 0.12) !important;
  color: var(--et4d-primary-hover) !important;
}

.et4d-field-label,
.et4d-dp-footnote,
.et4d-dp-subtitle {
  color: var(--et4d-text-secondary) !important;
}

/* Status colors */
.alert-success,
.badge-success,
.text-success { color: #15803d !important; }
.alert-warning,
.badge-warning,
.text-warning { color: #b45309 !important; }
.alert-danger,
.alert-error,
.badge-error,
.text-danger { color: #b91c1c !important; }

.bg-label-success,
.badge.bg-label-success { background-color: rgba(34, 197, 94, 0.12) !important; }
.bg-label-warning,
.badge.bg-label-warning { background-color: rgba(245, 158, 11, 0.14) !important; }
.bg-label-danger,
.badge.bg-label-danger,
.bg-label-error,
.badge.bg-label-error { background-color: rgba(239, 68, 68, 0.12) !important; }

/* Chart styling */
.highcharts-grid-line,
.highcharts-xaxis-grid .highcharts-grid-line,
.highcharts-yaxis-grid .highcharts-grid-line {
  stroke: rgba(100, 116, 139, 0.14) !important;
}

.highcharts-axis-labels text,
.highcharts-legend-item text,
.highcharts-data-label text {
  fill: #475569 !important;
  font-size: 12px !important;
}

.highcharts-series-0 { stroke: rgba(34, 197, 94, 0.72) !important; fill: rgba(34, 197, 94, 0.32) !important; }
.highcharts-series-1 { stroke: rgba(59, 130, 246, 0.72) !important; fill: rgba(59, 130, 246, 0.28) !important; }
.highcharts-series-2 { stroke: rgba(245, 158, 11, 0.72) !important; fill: rgba(245, 158, 11, 0.28) !important; }
.highcharts-series-3 { stroke: rgba(239, 68, 68, 0.7) !important; fill: rgba(239, 68, 68, 0.26) !important; }

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .card,
  .card-subtle,
  .dashboard-card,
  .btn,
  .form-control,
  .form-select {
    transition: none !important;
  }
}

/* -------------------------------------------------------------------------
   DESIGN SYSTEM ENFORCEMENT (high specificity to override vendor theme)
   ------------------------------------------------------------------------- */
html body {
  background: #f8fafc !important;
  color: #0f172a !important;
}

html body .layout-wrapper,
html body .layout-page,
html body .content-wrapper {
  background: #f8fafc !important;
}

html body .layout-navbar,
html body .layout-navbar.bg-navbar-theme,
html body #layout-navbar {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: none !important;
}

html body .layout-menu.menu-vertical,
html body .layout-menu.menu-vertical.bg-menu-theme {
  background: #ffffff !important;
  border-right: 1px solid #e2e8f0 !important;
  box-shadow: none !important;
}

html body .layout-menu .menu-link {
  color: #64748b !important;
  border-radius: 12px !important;
  transition: all 0.2s ease !important;
}

html body .layout-menu .menu-item:not(.active) > .menu-link:hover {
  background: rgba(59, 130, 246, 0.08) !important;
  color: #3b82f6 !important;
}

html body .layout-menu .menu-item.active > .menu-link {
  background: #dcfce7 !important;
  color: #16a34a !important;
  font-weight: 600 !important;
}

html body .layout-menu .menu-item.active > .menu-link .menu-icon,
html body .layout-menu .menu-item.active > .menu-link > div {
  color: #16a34a !important;
}

html body .card,
html body .card-subtle,
html body .dashboard-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 14px !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05) !important;
  transition: all 0.2s ease !important;
}

html body .card:hover,
html body .card-subtle:hover,
html body .dashboard-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.09) !important;
}

html body .btn-primary {
  background: #22c55e !important;
  border-color: #22c55e !important;
  color: #ffffff !important;
}

html body .btn-primary:hover,
html body .btn-primary:focus-visible {
  background: #16a34a !important;
  border-color: #16a34a !important;
}

html body .btn:not(.btn-primary) {
  transition: all 0.2s ease !important;
}

html body .form-control,
html body .form-select {
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  background: #ffffff !important;
}

html body .form-control:focus,
html body .form-select:focus {
  border-color: #22c55e !important;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.18) !important;
}

html body h1,
html body h2,
html body h3,
html body .page-title,
html body .et4d-page-heading {
  color: #0f172a !important;
}

html body p,
html body .text-muted,
html body .small {
  color: #64748b !important;
}

/* -------------------------------------------------------------------------
   STRICT COLOR SYSTEM RESET (neutral-first, signal-only colors)
   ------------------------------------------------------------------------- */
html body,
html body .layout-wrapper,
html body .layout-page,
html body .content-wrapper {
  background: #f8fafc !important;
  background-image: none !important;
}

/* 1) Cards: always white, neutral border */
html body .card,
html body .card-subtle,
html body .dashboard-card,
html body .et4d-consumer-metric.chart-section,
html body .info-section-subtle,
html body .form-section-subtle,
html body .preview-box-subtle,
html body .page-header,
html body .dash-app {
  background: #ffffff !important;
  background-image: none !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 14px !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05) !important;
}

/* 2) Sidebar: neutral base, green active only */
html body .layout-menu.menu-vertical,
html body .layout-menu.menu-vertical.bg-menu-theme {
  background: #ffffff !important;
}

html body .layout-menu .menu-link,
html body .layout-menu .menu-icon {
  color: #64748b !important;
}

html body .layout-menu .menu-item.active > .menu-link {
  background: rgba(34, 197, 94, 0.1) !important;
  color: #16a34a !important;
}

html body .layout-menu .menu-item.active > .menu-link .menu-icon,
html body .layout-menu .menu-item.active > .menu-link > div {
  color: #16a34a !important;
}

/* 3) Header / titles */
html body h1,
html body h2,
html body h3,
html body h4,
html body .page-title,
html body .et4d-page-heading {
  color: #0f172a !important;
}

html body .page-subtitle,
html body .et4d-dp-subtitle,
html body p,
html body small,
html body .small,
html body .text-muted {
  color: #64748b !important;
}

/* 4) Buttons */
html body .btn-primary {
  background: #22c55e !important;
  border-color: #22c55e !important;
  color: #ffffff !important;
}

html body .btn-primary:hover,
html body .btn-primary:focus-visible {
  background: #16a34a !important;
  border-color: #16a34a !important;
}

html body .btn-secondary,
html body .btn-outline-secondary {
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
}

/* 5) Inputs / forms */
html body .form-control,
html body .form-select,
html body input,
html body textarea,
html body select {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

html body .form-control:focus,
html body .form-select:focus,
html body input:focus,
html body textarea:focus,
html body select:focus {
  border-color: #22c55e !important;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.15) !important;
}

/* Remove tinted form wrappers */
html body .form-section-subtle,
html body .info-section-subtle {
  background: #ffffff !important;
}

/* 6) Status colors: signal-only (text/badge/dot), no row/card tint */
html body .text-success { color: #22c55e !important; }
html body .text-warning { color: #f59e0b !important; }
html body .text-danger,
html body .text-error { color: #ef4444 !important; }

html body .badge-success,
html body .bg-label-success { background: rgba(34, 197, 94, 0.12) !important; color: #15803d !important; }
html body .badge-warning,
html body .bg-label-warning { background: rgba(245, 158, 11, 0.12) !important; color: #b45309 !important; }
html body .badge-danger,
html body .bg-label-danger,
html body .badge-error,
html body .bg-label-error { background: rgba(239, 68, 68, 0.1) !important; color: #b91c1c !important; }

html body .alert,
html body .alert-success,
html body .alert-warning,
html body .alert-danger,
html body .alert-error {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

/* 7) Tables */
html body .table,
html body .table.et4d-data-table {
  background: #ffffff !important;
}

html body .table tbody tr:hover,
html body .table-hover > tbody > tr:hover {
  background: #f1f5f9 !important;
}

/* 8) Charts: white base, soft grid, low-opacity ranges */
html body .highcharts-background,
html body .highcharts-plot-background,
html body .highcharts-plot-area,
html body .highcharts-root {
  fill: #ffffff !important;
  background: #ffffff !important;
}

html body .highcharts-grid-line,
html body .highcharts-xaxis-grid .highcharts-grid-line,
html body .highcharts-yaxis-grid .highcharts-grid-line {
  stroke: #e2e8f0 !important;
  opacity: 0.65 !important;
}

html body .highcharts-series-0 { stroke: #22c55e !important; fill: rgba(34, 197, 94, 0.2) !important; }
html body .highcharts-series-1 { stroke: #3b82f6 !important; fill: rgba(59, 130, 246, 0.2) !important; }
html body .highcharts-series-2 { stroke: #f59e0b !important; fill: rgba(245, 158, 11, 0.18) !important; }
html body .highcharts-series-3 { stroke: #ef4444 !important; fill: rgba(239, 68, 68, 0.16) !important; }

html body .et4d-dp-vzone--ok {
  background: rgba(34, 197, 94, 0.12) !important;
}

html body .et4d-dp-vzone--warn {
  background: rgba(245, 158, 11, 0.12) !important;
}

html body .et4d-dp-vzone--danger {
  background: rgba(239, 68, 68, 0.1) !important;
}

html body .et4d-dp-vzone--eu,
html body .et4d-dp-vzone--eu-shimmer {
  background: rgba(34, 197, 94, 0.12) !important;
  box-shadow: none !important;
  animation: none !important;
}

/* Points */
html body .et4d-dp-vdot--good { background: #22c55e !important; }
html body .et4d-dp-vdot--medium { background: #f59e0b !important; }
html body .et4d-dp-vdot--poor { background: #ef4444 !important; }

/* 9) Icons */
html body i,
html body .bx,
html body .menu-icon {
  color: #64748b;
}

html body .menu-item.active .menu-icon,
html body .text-primary,
html body .icon-active {
  color: #22c55e !important;
}

/* -------------------------------------------------------------------------
   BRAND PALETTE LOCK (user-provided 5-color palette)
   #17362B #2A5A45 #8FB8A2 #F5F6F2 #C9C1B6
   ------------------------------------------------------------------------- */
:root {
  --et4d-primary: #2a5a45;
  --et4d-primary-hover: #17362b;
  --et4d-primary-soft: #8fb8a2;
  --et4d-bg: #f5f6f2;
  --et4d-card-bg: #ffffff;
  --et4d-border: #c9c1b6;
  --et4d-text-primary: #17362b;
  --et4d-text-secondary: #2a5a45;
  --et4d-success: #2a5a45;
  --et4d-warning: #8fb8a2;
  --et4d-danger: #c9c1b6;
  --bs-primary: #2a5a45;
  --bs-primary-rgb: 42, 90, 69;
  --bs-link-color: #2a5a45;
  --bs-link-hover-color: #17362b;
}

html body,
html body .layout-wrapper,
html body .layout-page,
html body .content-wrapper {
  background: #f5f6f2 !important;
}

html body .layout-navbar,
html body .layout-navbar.bg-navbar-theme,
html body #layout-navbar {
  background: #f5f6f2 !important;
  border-bottom: 1px solid #c9c1b6 !important;
}

html body .layout-menu.menu-vertical,
html body .layout-menu.menu-vertical.bg-menu-theme {
  background: #f5f6f2 !important;
  border-right: 1px solid #c9c1b6 !important;
}

html body .layout-menu .menu-link,
html body .layout-menu .menu-icon {
  color: #2a5a45 !important;
}

html body .layout-menu .menu-item.active > .menu-link {
  background: rgba(143, 184, 162, 0.28) !important;
  color: #17362b !important;
}

html body .layout-menu .menu-item.active > .menu-link .menu-icon,
html body .layout-menu .menu-item.active > .menu-link > div {
  color: #17362b !important;
}

html body .card,
html body .card-subtle,
html body .dashboard-card,
html body .et4d-consumer-metric.chart-section,
html body .dash-app {
  background: #ffffff !important;
  border: 1px solid #c9c1b6 !important;
  box-shadow: 0 4px 12px rgba(23, 54, 43, 0.08) !important;
}

html body .card:hover,
html body .card-subtle:hover,
html body .dashboard-card:hover {
  box-shadow: 0 10px 22px rgba(23, 54, 43, 0.12) !important;
}

html body h1,
html body h2,
html body h3,
html body h4,
html body .page-title,
html body .et4d-page-heading {
  color: #17362b !important;
}

html body p,
html body .text-muted,
html body small,
html body .small,
html body .page-subtitle {
  color: #2a5a45 !important;
}

html body .btn-primary {
  background: #2a5a45 !important;
  border-color: #2a5a45 !important;
  color: #ffffff !important;
}

html body .btn-primary:hover,
html body .btn-primary:focus-visible {
  background: #17362b !important;
  border-color: #17362b !important;
}

html body .btn-secondary,
html body .btn-outline-secondary {
  background: #f5f6f2 !important;
  border-color: #c9c1b6 !important;
  color: #17362b !important;
}

html body .form-control,
html body .form-select,
html body input,
html body textarea,
html body select {
  background: #ffffff !important;
  border-color: #c9c1b6 !important;
  color: #17362b !important;
}

html body .form-control:focus,
html body .form-select:focus,
html body input:focus,
html body textarea:focus,
html body select:focus {
  border-color: #2a5a45 !important;
  box-shadow: 0 0 0 2px rgba(42, 90, 69, 0.18) !important;
}

html body a:not(.btn):not(.menu-link):not(.dropdown-item):not(.app-brand-link):not(.nav-link):not(.et4d-app-row) {
  color: #2a5a45;
}

html body a:not(.btn):not(.menu-link):not(.dropdown-item):not(.app-brand-link):not(.nav-link):not(.et4d-app-row):hover {
  color: #17362b;
}

html body .table,
html body .table.et4d-data-table {
  background: #ffffff !important;
}

html body .table tbody tr:hover,
html body .table-hover > tbody > tr:hover {
  background: rgba(143, 184, 162, 0.12) !important;
}

html body .badge-success,
html body .bg-label-success { background: rgba(42, 90, 69, 0.16) !important; color: #17362b !important; }
html body .badge-warning,
html body .bg-label-warning { background: rgba(143, 184, 162, 0.2) !important; color: #17362b !important; }
html body .badge-danger,
html body .bg-label-danger { background: rgba(201, 193, 182, 0.28) !important; color: #17362b !important; }

html body .highcharts-background,
html body .highcharts-plot-background,
html body .highcharts-plot-area {
  fill: #ffffff !important;
}

html body .highcharts-grid-line,
html body .highcharts-xaxis-grid .highcharts-grid-line,
html body .highcharts-yaxis-grid .highcharts-grid-line {
  stroke: #c9c1b6 !important;
  opacity: 0.5 !important;
}

html body .highcharts-series-0 { stroke: #2a5a45 !important; fill: rgba(42, 90, 69, 0.2) !important; }
html body .highcharts-series-1 { stroke: #8fb8a2 !important; fill: rgba(143, 184, 162, 0.2) !important; }
html body .highcharts-series-2 { stroke: #17362b !important; fill: rgba(23, 54, 43, 0.16) !important; }
html body .highcharts-series-3 { stroke: #c9c1b6 !important; fill: rgba(201, 193, 182, 0.18) !important; }

/* Sidebar active state: override vendor blue remnants */
html body .layout-menu .menu-inner > .menu-item.active > .menu-link,
html body .layout-menu .menu-item.active:not(.open) > .menu-link,
html body .layout-menu .menu-item.active > .menu-link:not(.menu-toggle) {
  background-color: rgba(143, 184, 162, 0.28) !important;
  color: #17362b !important;
}

html body .layout-menu .menu-item.active > .menu-link::before,
html body .layout-menu .menu-item.active:not(.open) > .menu-link::before {
  background: #2a5a45 !important;
  border-color: #2a5a45 !important;
}

html body .layout-menu .menu-item.active > .menu-link .menu-icon,
html body .layout-menu .menu-item.active > .menu-link > div {
  color: #17362b !important;
}

/* Remove any remaining vendor purple indicator lines */
html body .layout-menu .menu-item::before,
html body .layout-menu .menu-item::after,
html body .layout-menu .menu-link::before,
html body .layout-menu .menu-link::after {
  border-color: transparent !important;
}

/* Keep only the active indicator in brand color */
html body .layout-menu .menu-item.active > .menu-link::before,
html body .layout-menu .menu-item.active:not(.open) > .menu-link::before {
  content: "" !important;
  background: #2a5a45 !important;
  border-color: #2a5a45 !important;
  opacity: 1 !important;
}

/* Force non-blue hover/focus states in sidebar */
html body .layout-menu .menu-item:not(.active) > .menu-link:hover,
html body .layout-menu .menu-item:not(.active) > .menu-link:focus,
html body .layout-menu .menu-item:not(.active) > .menu-link:active {
  background: rgba(143, 184, 162, 0.14) !important;
  color: #17362b !important;
  box-shadow: none !important;
}

html body .layout-menu .menu-item:not(.active) > .menu-link:hover .menu-icon,
html body .layout-menu .menu-item:not(.active) > .menu-link:focus .menu-icon,
html body .layout-menu .menu-item:not(.active) > .menu-link:active .menu-icon {
  color: #2a5a45 !important;
}

/* -------------------------------------------------------------------------
   PANEL FIXES: privacy toggles + messaging component
   ------------------------------------------------------------------------- */
html body .form-switch .form-check-input {
  width: 2.6rem !important;
  height: 1.4rem !important;
  margin-top: 0.15rem !important;
  background-color: #f5f6f2 !important;
  border: 1px solid #c9c1b6 !important;
  background-image: none !important;
  box-shadow: none !important;
}

html body .form-switch .form-check-input:focus {
  border-color: #2a5a45 !important;
  box-shadow: 0 0 0 2px rgba(42, 90, 69, 0.18) !important;
}

html body .form-switch .form-check-input:checked {
  background-color: #2a5a45 !important;
  border-color: #2a5a45 !important;
}

html body .form-switch .form-check-label {
  color: #17362b !important;
  font-weight: 500 !important;
}

html body .form-switch .form-text {
  color: #2a5a45 !important;
}

/* Messaging: remove purple/blue gradient theme */
html body .messaging-container {
  background: #ffffff !important;
  border: 1px solid #c9c1b6 !important;
  border-radius: 14px !important;
  box-shadow: 0 4px 12px rgba(23, 54, 43, 0.08) !important;
}

html body .messaging-header,
html body .message-modal-header {
  background: #f5f6f2 !important;
  color: #17362b !important;
  border-bottom: 1px solid #c9c1b6 !important;
}

html body .messaging-header-title i,
html body .messaging-header-meta,
html body .message-modal-close {
  color: #2a5a45 !important;
}

html body .messaging-tabs {
  background: #f5f6f2 !important;
  border-bottom: 1px solid #c9c1b6 !important;
}

html body .messaging-tab {
  color: #2a5a45 !important;
}

html body .messaging-tab:hover {
  background: rgba(143, 184, 162, 0.14) !important;
  color: #17362b !important;
}

html body .messaging-tab.active {
  color: #17362b !important;
  background: #ffffff !important;
}

html body .messaging-tab.active::after {
  background: #2a5a45 !important;
  height: 2px !important;
}

html body .messaging-tab-badge,
html body .messaging-tab.active .messaging-tab-badge {
  background: #2a5a45 !important;
  color: #ffffff !important;
}

html body .message-item {
  background: #f5f6f2 !important;
  border-left: 3px solid transparent !important;
}

html body .message-item:hover {
  background: #ffffff !important;
  border-left-color: #8fb8a2 !important;
}

html body .message-item-unread {
  background: rgba(143, 184, 162, 0.16) !important;
  border-left-color: #2a5a45 !important;
}

html body .message-item-unread:hover {
  background: rgba(143, 184, 162, 0.24) !important;
}

html body .message-item-icon {
  background: #ffffff !important;
  color: #2a5a45 !important;
}

html body .message-item-unread .message-item-icon {
  background: #2a5a45 !important;
  color: #ffffff !important;
}

html body .messaging-form-label i {
  color: #2a5a45 !important;
}

html body .messaging-compose-form select,
html body .messaging-compose-form input[type="text"],
html body .messaging-compose-form textarea {
  border: 1px solid #c9c1b6 !important;
  background: #ffffff !important;
}

html body .messaging-compose-form select:focus,
html body .messaging-compose-form input:focus,
html body .messaging-compose-form textarea:focus {
  border-color: #2a5a45 !important;
  box-shadow: 0 0 0 2px rgba(42, 90, 69, 0.18) !important;
}

html body .btn-messaging-primary {
  background: #2a5a45 !important;
  color: #ffffff !important;
}

html body .btn-messaging-primary:hover {
  background: #17362b !important;
  box-shadow: 0 4px 12px rgba(23, 54, 43, 0.24) !important;
}

html body .btn-messaging-secondary {
  background: #f5f6f2 !important;
  border: 1px solid #c9c1b6 !important;
  color: #17362b !important;
}

html body .btn-messaging-secondary:hover {
  background: #ffffff !important;
}

/* -------------------------------------------------------------------------
   ICON HARMONY SYSTEM (soft, readable, elegant)
   ------------------------------------------------------------------------- */
:root {
  --et4d-icon-fg-default: #2a5a45;
  --et4d-icon-fg-strong: #17362b;
  --et4d-icon-bg-default: rgba(143, 184, 162, 0.22);
  --et4d-icon-bg-strong: rgba(42, 90, 69, 0.22);
  --et4d-icon-bg-neutral: rgba(201, 193, 182, 0.34);
}

/* Base icon readability */
html body i.bx,
html body .menu-icon,
html body .tf-icons {
  color: var(--et4d-icon-fg-default) !important;
  opacity: 0.95;
}

/* Active/important icons */
html body .menu-item.active .menu-icon,
html body .btn-primary i.bx,
html body .icon-active {
  color: var(--et4d-icon-fg-strong) !important;
}

/* Icon containers used across panels/pages */
html body .insight-icon,
html body .feature-icon,
html body .dashboard-card-icon,
html body .et4d-app-row-icon,
html body .et4d-section-icon,
html body .et4d-page-icon-tile,
html body .message-item-icon {
  background: var(--et4d-icon-bg-default) !important;
  color: var(--et4d-icon-fg-default) !important;
  border: 1px solid rgba(42, 90, 69, 0.22) !important;
  box-shadow: none !important;
}

/* Gentle, stylish variation (different but consistent) */
html body .insight-grid .insight-card:nth-child(4n+1) .insight-icon,
html body .row [class*='col-']:nth-child(4n+1) .dashboard-card-icon {
  background: rgba(143, 184, 162, 0.22) !important;
  color: #2a5a45 !important;
}

html body .insight-grid .insight-card:nth-child(4n+2) .insight-icon,
html body .row [class*='col-']:nth-child(4n+2) .dashboard-card-icon {
  background: rgba(201, 193, 182, 0.28) !important;
  color: #17362b !important;
}

html body .insight-grid .insight-card:nth-child(4n+3) .insight-icon,
html body .row [class*='col-']:nth-child(4n+3) .dashboard-card-icon {
  background: rgba(42, 90, 69, 0.18) !important;
  color: #17362b !important;
}

html body .insight-grid .insight-card:nth-child(4n) .insight-icon,
html body .row [class*='col-']:nth-child(4n) .dashboard-card-icon {
  background: rgba(143, 184, 162, 0.3) !important;
  color: #17362b !important;
}

/* Sidebar icon behavior */
html body .layout-menu .menu-item:not(.active) .menu-icon {
  color: #2a5a45 !important;
}

html body .layout-menu .menu-item:not(.active) > .menu-link:hover .menu-icon,
html body .layout-menu .menu-item:not(.active) > .menu-link:focus .menu-icon {
  color: #17362b !important;
}

/* Messaging component icons alignment */
html body .messaging-tab i.bx,
html body .messaging-form-label i.bx,
html body .message-modal-from::before,
html body .message-modal-time::before {
  color: #2a5a45 !important;
}

/* LinkedIn CTA — official mark on badge, neutral chrome (tier‑1 product pattern) */
a.et4d-linkedin-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 100%;
  padding: 0.5rem 0.9rem 0.5rem 0.45rem;
  border-radius: 9999px;
  border: 1px solid rgba(23, 54, 43, 0.12);
  background: #fff;
  color: #17362b !important;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.3;
  text-decoration: none !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

a.et4d-linkedin-cta:hover {
  color: #17362b !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border-color: rgba(10, 102, 194, 0.28);
}

a.et4d-linkedin-cta:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.25), 0 2px 10px rgba(0, 0, 0, 0.04);
}

.et4d-linkedin-cta__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.375rem;
  height: 2.375rem;
  border-radius: 10px;
  background: #0a66c2;
  flex-shrink: 0;
}

.et4d-linkedin-cta__badge .bx {
  color: #fff !important;
  font-size: 1.35rem;
  line-height: 1;
  opacity: 1 !important;
}

.et4d-linkedin-cta__label {
  text-align: left;
}

.et4d-linkedin-cta__ext {
  margin-left: 0.15rem;
  font-size: 1rem !important;
  color: rgba(23, 54, 43, 0.38) !important;
  opacity: 1 !important;
}

a.et4d-linkedin-cta:hover .et4d-linkedin-cta__ext {
  color: rgba(23, 54, 43, 0.55) !important;
}

