/* ═══════════════════════════════════════════════════════════════════════
   macos.css — Mac OS Big Sur / Sonoma-inspired skin
   Loaded last in base.html so it overrides the older theme variables.
   Works in both light and dark themes (auto-adapts via data-theme).
═══════════════════════════════════════════════════════════════════════ */

:root {
  /* macOS system font stack */
  --mac-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
              "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* macOS palette is DERIVED from the existing per-theme variables in
     theme.css so text colors automatically stay readable on whatever
     background each theme uses (default/fiori/teal/slate are all light;
     only 'dark' is actually dark — overridden below). */
  --mac-bg-window      : var(--bg-secondary, #ffffff);
  --mac-bg-app         : var(--bg-primary,   #f2f2f6);
  --mac-bg-control     : var(--bg-secondary, #ffffff);
  --mac-bg-control-hov : var(--bg-hover,     #f0f0f3);
  --mac-bg-elevated    : var(--bg-secondary, #ffffff);
  --mac-bg-titlebar    : color-mix(in srgb, var(--bg-secondary, #ffffff) 80%, transparent);

  --mac-text           : var(--text-primary,   #1d1d1f);
  --mac-text-secondary : var(--text-secondary, #6e6e73);
  --mac-text-muted     : var(--text-muted,     #8a8a8e);
  --mac-divider        : var(--border-color, rgba(0,0,0,0.10));
  --mac-divider-strong : var(--border-color, rgba(0,0,0,0.16));

  --mac-accent         : #007aff;        /* macOS Blue */
  --mac-accent-hover   : #0066d6;
  --mac-success        : #34c759;
  --mac-warn           : #ff9500;
  --mac-danger         : #ff3b30;

  --mac-shadow-1: 0 1px 2px rgba(0,0,0,0.06), 0 1px 1px rgba(0,0,0,0.04);
  --mac-shadow-2: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --mac-shadow-window: 0 12px 36px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10),
                       0 0 0 0.5px rgba(0,0,0,0.10);

  --mac-radius-window: 10px;
  --mac-radius-card  : 8px;
  --mac-radius-btn   : 6px;
}

/* ── True dark theme — bump accent + heavier shadow ─────────────── */
html[data-theme="dark"] {
  --mac-accent         : #0a84ff;
  --mac-accent-hover   : #2a94ff;
  --mac-shadow-window: 0 16px 40px rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.35),
                       0 0 0 0.5px rgba(255,255,255,0.06);
}

/* ── Base ───────────────────────────────────────────────────────── */
html, body {
  font-family: var(--mac-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--mac-bg-app) !important;
  color: var(--mac-text);
  letter-spacing: -0.01em;
}

/* ── Navbar → macOS thin unified titlebar ───────────────────────── */
.app-navbar {
  background: var(--mac-bg-titlebar) !important;
  -webkit-backdrop-filter: saturate(180%) blur(22px);
          backdrop-filter: saturate(180%) blur(22px);
  border-bottom: 1px solid var(--mac-divider) !important;
  border-top: none !important;
  box-shadow: none !important;
  padding: 3px 12px !important;     /* THIN: 28-32px total height */
  min-height: 32px;
}
.app-navbar-inner {
  max-width: 1480px;
  margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  min-height: 26px;
}
.navbar-brand-text {
  font-weight: 600 !important;
  font-size: 12.5px !important;
  letter-spacing: -0.01em;
  color: var(--mac-text) !important;
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none;
}
.navbar-brand-icon { font-size: 14px; }

/* Navbar links — pill-style segmented controls */
.nav-link-custom {
  font-size: 12px !important;
  font-weight: 500 !important;
  padding: 3px 10px !important;
  border-radius: 5px !important;
  color: var(--mac-text-secondary) !important;
  background: transparent !important;
  border: none !important;
  transition: background-color 0.12s ease, color 0.12s ease;
  text-decoration: none;
}
.nav-link-custom:hover {
  background: var(--mac-bg-control-hov) !important;
  color: var(--mac-text) !important;
}
.nav-link-custom.active {
  background: color-mix(in srgb, var(--mac-accent) 16%, transparent) !important;
  color: var(--mac-accent) !important;
  font-weight: 600 !important;
}
.navbar-right { display: inline-flex; align-items: center; gap: 8px; }
.navbar-links { display: inline-flex; align-items: center; gap: 2px; }

/* ── Mobile burger toggle (hidden on desktop) ──────────────────── */
.navbar-burger {
  display: none;
  background: transparent;
  border: 1px solid var(--mac-divider);
  border-radius: 6px;
  color: var(--mac-text);
  width: 32px; height: 28px;
  align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
  font-size: 13px;
  line-height: 1;
  transition: background-color 0.12s ease;
}
.navbar-burger:hover { background: var(--mac-bg-control-hov); }

/* ── Responsive: ≤ 880px = mobile/tablet ───────────────────────── */
@media (max-width: 880px) {
  .app-navbar { padding: 4px 10px !important; min-height: 36px; }

  /* show the hamburger, hide nav-right by default */
  .navbar-burger { display: inline-flex; }

  .navbar-right {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 10px 14px 14px;
    /* SOLID page-bg color so it's never see-through */
    background: var(--mac-bg-window) !important;
    border-bottom: 1px solid var(--mac-divider);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
    z-index: 100;
  }
  .app-navbar { position: relative; }
  .app-navbar.is-open .navbar-right { display: flex; }

  /* Stack nav links vertically — full width, left-aligned.
     IMPORTANT: links inside the mobile dropdown live on the page-body
     surface, NOT the navbar. The dark-navbar override forces white text
     globally — undo it here.
     Selectors prefixed with `html` + qualified by `.is-open` so they
     beat the dark-navbar rule `html[data-theme="X"] .app-navbar .nav-link-custom`
     on specificity (which would otherwise win). */
  .navbar-links { flex-direction: column; align-items: stretch; gap: 4px; }

  html .app-navbar.is-open .navbar-right .nav-link-custom {
    padding: 8px 12px !important;
    font-size: 13.5px !important;
    border-radius: 7px !important;
    color: var(--mac-text) !important;
    background: transparent !important;
  }
  html .app-navbar.is-open .navbar-right .nav-link-custom:hover {
    background: var(--mac-bg-control-hov) !important;
    color: var(--mac-text) !important;
  }
  html .app-navbar.is-open .navbar-right .nav-link-custom.active {
    background: color-mix(in srgb, var(--mac-accent) 16%, transparent) !important;
    color: var(--mac-accent) !important;
  }

  /* Logout / Login / Theme pills inside the mobile dropdown reset to
     page-body colors too. Same specificity trick. */
  html .app-navbar.is-open .navbar-right .logout-btn,
  html .app-navbar.is-open .navbar-right .nav-login-btn,
  html .app-navbar.is-open .navbar-right .theme-toggle-btn {
    background: var(--mac-bg-control) !important;
    border-color: var(--mac-divider-strong) !important;
    color: var(--mac-text) !important;
  }
  html .app-navbar.is-open .navbar-right .nav-login-btn { color: var(--mac-accent) !important; }
  html .app-navbar.is-open .navbar-right .logout-btn::before { color: var(--mac-text-muted) !important; }
  html .app-navbar.is-open .navbar-right .theme-toggle-btn .theme-label,
  html .app-navbar.is-open .navbar-right .theme-toggle-arrow {
    color: var(--mac-text-secondary) !important;
  }

  /* Theme toolbar + logout/login take full width when stacked */
  .theme-toolbar { width: 100%; }
  .theme-toggle-btn { width: 100%; justify-content: space-between; padding: 6px 12px !important; font-size: 13px !important; }
  .theme-selector-dropdown { position: relative !important; top: auto; right: auto; width: 100%; }

  .logout-form { width: 100%; }
  .logout-btn, .nav-login-btn {
    width: 100%; justify-content: center;
    padding: 8px 12px !important;
    font-size: 13px !important;
  }
}

/* Burger icon colors in dark-navbar themes (light text on dark bg) */
html[data-theme="default"] .navbar-burger,
html[data-theme="dark"]    .navbar-burger,
html[data-theme="teal"]    .navbar-burger,
html[data-theme="slate"]   .navbar-burger {
  color: #ffffff;
  border-color: rgba(255,255,255,0.22);
}
html[data-theme="default"] .navbar-burger:hover,
html[data-theme="dark"]    .navbar-burger:hover,
html[data-theme="teal"]    .navbar-burger:hover,
html[data-theme="slate"]   .navbar-burger:hover {
  background: rgba(255,255,255,0.10);
}

/* Theme selector — softer */
.theme-toggle-btn {
  background: var(--mac-bg-control) !important;
  border: 1px solid var(--mac-divider) !important;
  color: var(--mac-text) !important;
  border-radius: 5px !important;
  padding: 2px 8px !important;
  font-size: 11.5px !important;
  box-shadow: var(--mac-shadow-1);
  line-height: 1.4 !important;
}
/* Force the "Theme" word visible on light navbars (fiori). High specificity
   to beat the inline `.theme-label { color:#555 !important }` in base.html. */
html .app-navbar .theme-toggle-btn .theme-label { color: var(--mac-text) !important; }
html .app-navbar .theme-toggle-arrow            { color: var(--mac-text-secondary) !important; }
.theme-current-chip {
  background: var(--mac-accent) !important;
  border-radius: 4px !important;
  font-size: 11px !important;
  padding: 1px 7px !important;
}
.theme-selector-dropdown {
  background: var(--mac-bg-elevated) !important;
  border: 1px solid var(--mac-divider) !important;
  border-radius: 10px !important;
  box-shadow: var(--mac-shadow-window) !important;
}
.theme-chip {
  background: transparent;
  border: 1px solid var(--mac-divider);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--mac-text);
  cursor: pointer;
}
.theme-chip.is-active {
  background: var(--mac-accent);
  color: #fff;
  border-color: var(--mac-accent);
}

/* Logout button — subtle, fits next to theme button */
.logout-btn {
  background: var(--mac-bg-control) !important;
  border: 1px solid var(--mac-divider) !important;
  color: var(--mac-text-secondary) !important;
  border-radius: 5px !important;
  padding: 2px 10px !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  box-shadow: var(--mac-shadow-1);
  display: inline-flex; align-items: center; gap: 5px;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.logout-btn::before {
  /* Font Awesome 7 Free — power-off glyph via :before */
  content: "\f011";                        /* fa-power-off */
  font-family: "Font Awesome 7 Free";
  font-weight: 900;                         /* solid */
  font-size: 11px;
  color: var(--mac-text-muted);
  transition: color 0.12s ease;
  margin-right: 1px;
}
.logout-btn:hover {
  background: var(--mac-bg-control-hov) !important;
  color: var(--mac-danger) !important;
  border-color: color-mix(in srgb, var(--mac-danger) 35%, var(--mac-divider)) !important;
}
.logout-btn:hover::before { color: var(--mac-danger); }
.logout-form { margin: 0; display: inline-flex; }

/* Login button mirrors logout style but with accent color */
.nav-login-btn {
  background: var(--mac-bg-control) !important;
  border: 1px solid var(--mac-divider) !important;
  color: var(--mac-accent) !important;
  border-radius: 5px !important;
  padding: 2px 10px !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  box-shadow: var(--mac-shadow-1);
  display: inline-flex; align-items: center; gap: 5px;
  text-decoration: none !important;
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.nav-login-btn:hover {
  background: var(--mac-accent) !important;
  color: #fff !important;
  border-color: var(--mac-accent) !important;
  text-decoration: none !important;
}

/* ═════════════════════════════════════════════════════════════════════
   DARK NAVBAR overrides — themes that paint the navbar dark (default,
   dark, teal, slate) need translucent-on-dark navbar controls so they
   don't appear as bright white blobs against the dark titlebar.
═════════════════════════════════════════════════════════════════════ */
html[data-theme="default"] .app-navbar,
html[data-theme="dark"]    .app-navbar,
html[data-theme="teal"]    .app-navbar,
html[data-theme="slate"]   .app-navbar {
  /* override macos default — these themes' navbars stay dark */
  background: color-mix(in srgb, #0b0f1a 78%, transparent) !important;
}
html[data-theme="default"] .app-navbar { background: color-mix(in srgb, #0d2145 80%, transparent) !important; }
html[data-theme="teal"]    .app-navbar { background: color-mix(in srgb, #062e2e 80%, transparent) !important; }
html[data-theme="slate"]   .app-navbar { background: color-mix(in srgb, #1a202c 82%, transparent) !important; }
html[data-theme="dark"]    .app-navbar { background: color-mix(in srgb, #111111 82%, transparent) !important; }

/* Navbar brand + links on dark navbars → light text */
html[data-theme="default"] .app-navbar .navbar-brand-text,
html[data-theme="dark"]    .app-navbar .navbar-brand-text,
html[data-theme="teal"]    .app-navbar .navbar-brand-text,
html[data-theme="slate"]   .app-navbar .navbar-brand-text { color: #f0f4ff !important; }

html[data-theme="default"] .app-navbar .nav-link-custom,
html[data-theme="dark"]    .app-navbar .nav-link-custom,
html[data-theme="teal"]    .app-navbar .nav-link-custom,
html[data-theme="slate"]   .app-navbar .nav-link-custom { color: rgba(255,255,255,0.78) !important; }

html[data-theme="default"] .app-navbar .nav-link-custom:hover,
html[data-theme="dark"]    .app-navbar .nav-link-custom:hover,
html[data-theme="teal"]    .app-navbar .nav-link-custom:hover,
html[data-theme="slate"]   .app-navbar .nav-link-custom:hover {
  background: rgba(255,255,255,0.12) !important;
  color: #ffffff !important;
}

html[data-theme="default"] .app-navbar .nav-link-custom.active,
html[data-theme="dark"]    .app-navbar .nav-link-custom.active,
html[data-theme="teal"]    .app-navbar .nav-link-custom.active,
html[data-theme="slate"]   .app-navbar .nav-link-custom.active {
  background: rgba(255,255,255,0.18) !important;
  color: #ffffff !important;
}

/* Theme + Logout + Login pills get translucent-light surface */
html[data-theme="default"] .theme-toggle-btn,
html[data-theme="dark"]    .theme-toggle-btn,
html[data-theme="teal"]    .theme-toggle-btn,
html[data-theme="slate"]   .theme-toggle-btn,
html[data-theme="default"] .logout-btn,
html[data-theme="dark"]    .logout-btn,
html[data-theme="teal"]    .logout-btn,
html[data-theme="slate"]   .logout-btn,
html[data-theme="default"] .nav-login-btn,
html[data-theme="dark"]    .nav-login-btn,
html[data-theme="teal"]    .nav-login-btn,
html[data-theme="slate"]   .nav-login-btn {
  background: rgba(255,255,255,0.10) !important;
  border-color: rgba(255,255,255,0.22) !important;
  color: rgba(255,255,255,0.88) !important;
  box-shadow: none !important;
}

html[data-theme="default"] .theme-toggle-btn:hover,
html[data-theme="dark"]    .theme-toggle-btn:hover,
html[data-theme="teal"]    .theme-toggle-btn:hover,
html[data-theme="slate"]   .theme-toggle-btn:hover,
html[data-theme="default"] .logout-btn:hover,
html[data-theme="dark"]    .logout-btn:hover,
html[data-theme="teal"]    .logout-btn:hover,
html[data-theme="slate"]   .logout-btn:hover,
html[data-theme="default"] .nav-login-btn:hover,
html[data-theme="dark"]    .nav-login-btn:hover,
html[data-theme="teal"]    .nav-login-btn:hover,
html[data-theme="slate"]   .nav-login-btn:hover {
  background: rgba(255,255,255,0.18) !important;
}

/* Theme button label + glyph: light text on dark navbar */
html[data-theme="default"] .app-navbar .theme-toggle-btn .theme-label,
html[data-theme="dark"]    .app-navbar .theme-toggle-btn .theme-label,
html[data-theme="teal"]    .app-navbar .theme-toggle-btn .theme-label,
html[data-theme="slate"]   .app-navbar .theme-toggle-btn .theme-label,
html[data-theme="default"] .app-navbar .theme-toggle-arrow,
html[data-theme="dark"]    .app-navbar .theme-toggle-arrow,
html[data-theme="teal"]    .app-navbar .theme-toggle-arrow,
html[data-theme="slate"]   .app-navbar .theme-toggle-arrow {
  color: #ffffff !important;
}

/* Logout glyph + hover state in dark navbars */
html[data-theme="default"] .logout-btn::before,
html[data-theme="dark"]    .logout-btn::before,
html[data-theme="teal"]    .logout-btn::before,
html[data-theme="slate"]   .logout-btn::before {
  color: rgba(255,255,255,0.55);
}
html[data-theme="default"] .logout-btn:hover,
html[data-theme="dark"]    .logout-btn:hover,
html[data-theme="teal"]    .logout-btn:hover,
html[data-theme="slate"]   .logout-btn:hover {
  color: #ffb8b8 !important;
  border-color: rgba(255,107,107,0.55) !important;
  background: rgba(255,59,48,0.18) !important;
}
html[data-theme="default"] .logout-btn:hover::before,
html[data-theme="dark"]    .logout-btn:hover::before,
html[data-theme="teal"]    .logout-btn:hover::before,
html[data-theme="slate"]   .logout-btn:hover::before { color: #ffb8b8; }

/* Login button accent on dark navbar */
html[data-theme="default"] .nav-login-btn,
html[data-theme="dark"]    .nav-login-btn,
html[data-theme="teal"]    .nav-login-btn,
html[data-theme="slate"]   .nav-login-btn {
  color: #cfe4ff !important;
}
html[data-theme="default"] .nav-login-btn:hover,
html[data-theme="dark"]    .nav-login-btn:hover,
html[data-theme="teal"]    .nav-login-btn:hover,
html[data-theme="slate"]   .nav-login-btn:hover {
  background: rgba(10,132,255,0.55) !important;
  border-color: rgba(10,132,255,0.85) !important;
  color: #ffffff !important;
}

/* ── Mac-style "window" container ───────────────────────────────── */
.mac-window {
  max-width: 1380px;
  margin: 14px auto;
  background: var(--mac-bg-window);
  border-radius: var(--mac-radius-window);
  box-shadow: var(--mac-shadow-window);
  overflow: hidden;
  border: 1px solid var(--mac-divider);
}
.mac-window-titlebar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: var(--mac-bg-titlebar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
          backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--mac-divider);
  min-height: 36px;
}
/* Decorative traffic lights — hidden per user request */
.mac-traffic-lights { display: none !important; }
.mac-window-title {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--mac-text);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mac-window-tools {
  display: inline-flex; gap: 8px;
  align-items: center;
  flex-shrink: 0;
  justify-content: flex-end;
}
.mac-window-body {
  padding: 16px 18px 18px;
  color: var(--mac-text);
}

/* ── Cards — translucent + soft shadow ──────────────────────────── */
.foc-card,
.foc-table-card,
.foc-total-bar,
.foc-section {
  background: var(--mac-bg-elevated) !important;
  border: 1px solid var(--mac-divider) !important;
  border-radius: var(--mac-radius-card) !important;
  box-shadow: var(--mac-shadow-2) !important;
  color: var(--mac-text) !important;
}

/* ── Buttons — Mac-style ─────────────────────────────────────────── */
.btn,
.foc-btn,
.foc-bulk-btn {
  font-family: var(--mac-font) !important;
  border-radius: var(--mac-radius-btn) !important;
  font-weight: 500 !important;
  font-size: 12.5px !important;
  padding: 4px 12px !important;
  min-height: 28px;
  line-height: 1.4 !important;
  border: 1px solid var(--mac-divider) !important;
  transition: filter 0.12s ease, transform 0.06s ease;
  box-shadow: var(--mac-shadow-1);
  letter-spacing: -0.01em;
}
.btn:active, .foc-btn:active, .foc-bulk-btn:active { transform: scale(0.98); }

/* Calculator action row buttons (Add Row / Clear All / Enter FOC % / Reset)
   override form.css's min-width: 120px so they hug their labels. */
.foc-btn-row .foc-btn {
  min-width: 0 !important;
  padding: 5px 14px !important;
  min-height: 30px;
}

/* Primary / Success / etc. — solid Mac-style fills.
   .foc-bulk-btn intentionally NOT in this list: it ships its own green
   gradient + left-aligned icon-only styling from the inline <style> block
   in form.html (the "Paste from Excel" trigger above the table). */
.btn-primary {
  background: var(--mac-accent) !important;
  border-color: var(--mac-accent) !important;
  color: #fff !important;
}
.btn-primary:hover {
  background: var(--mac-accent-hover) !important;
  filter: brightness(1.04);
}
.btn-success { background: var(--mac-success) !important; border-color: var(--mac-success) !important; color: #fff !important; }
.btn-warning { background: var(--mac-warn)    !important; border-color: var(--mac-warn)    !important; color: #1d1d1f !important; }
.btn-danger  { background: var(--mac-danger)  !important; border-color: var(--mac-danger)  !important; color: #fff !important; }
.btn-info    { background: #5ac8fa !important; border-color: #5ac8fa !important; color: #1d1d1f !important; }
.btn-secondary {
  background: var(--mac-bg-control) !important;
  border-color: var(--mac-divider-strong) !important;
  color: var(--mac-text) !important;
}
.btn-secondary:hover { background: var(--mac-bg-control-hov) !important; }
.btn-outline-secondary {
  background: transparent !important;
  border-color: var(--mac-divider-strong) !important;
  color: var(--mac-text) !important;
}
.btn-outline-secondary:hover { background: var(--mac-bg-control-hov) !important; }
.btn-sm, .foc-btn { font-size: 12px !important; padding: 3px 10px !important; min-height: 26px; }

/* ── Inputs ─────────────────────────────────────────────────────── */
.foc-input, .form-control, .form-select,
.adm-form-input, .adm-form-select {
  font-family: var(--mac-font) !important;
  background: var(--mac-bg-control) !important;
  border: 1px solid var(--mac-divider-strong) !important;
  border-radius: var(--mac-radius-btn) !important;
  color: var(--mac-text) !important;
  font-size: 13px !important;
  padding: 4px 9px !important;
  height: 30px !important;
  line-height: 20px !important;
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.04);
}
textarea.form-control, textarea.foc-input, textarea.adm-form-input {
  height: auto !important;            /* let textareas grow naturally */
  min-height: 60px;
  line-height: 1.5 !important;
}
.foc-input:focus, .form-control:focus, .form-select:focus,
.adm-form-input:focus, .adm-form-select:focus {
  border-color: var(--mac-accent) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mac-accent) 25%, transparent) !important;
}
.foc-input[readonly], .form-control[readonly], .adm-form-input[readonly] {
  background: var(--mac-bg-app) !important;
  color: var(--mac-text-secondary) !important;
}
.foc-input::placeholder, .form-control::placeholder,
.adm-form-input::placeholder, .adm-form-select::placeholder {
  color: var(--mac-text-muted) !important;
}

/* Calculator table cells: drop extra padding so the row reads compact */
.foc-table tbody td { padding: 4px 6px !important; }
.foc-table thead th { padding: 6px 8px !important; }

/* ── Admin form scaffolding (labels, help, badges, prefix) ──────── */
.adm-form-label {
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--mac-text-secondary) !important;
  margin-bottom: 4px !important;
  display: block;
}
.adm-form-help {
  /* original was hardcoded white — invisible on light themes */
  margin-top: 4px !important;
  font-size: 11.5px !important;
  color: var(--mac-text-muted) !important;
  line-height: 1.4;
}
.adm-form-group { margin-bottom: 14px; }
.adm-form-section {
  border-bottom: 1px solid var(--mac-divider) !important;
  padding-bottom: 12px;
  margin-bottom: 14px;
}
.adm-form-badge {
  display: inline-flex; align-items: center;
  font-size: 9.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 1px 7px !important;
  margin-left: 6px;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--mac-danger) 14%, transparent) !important;
  color: var(--mac-danger) !important;
  border: 1px solid color-mix(in srgb, var(--mac-danger) 45%, transparent) !important;
  vertical-align: middle;
}
.adm-form-badge--warn {
  background: color-mix(in srgb, var(--mac-warn) 14%, transparent) !important;
  color: var(--mac-warn) !important;
  border-color: color-mix(in srgb, var(--mac-warn) 45%, transparent) !important;
}
.adm-form-actions {
  display: flex; gap: 8px; align-items: center;
  margin-top: 14px;
}

/* ₹ prefix inside admin inputs */
.adm-input-prefix {
  color: var(--mac-text-muted) !important;
  font-size: 12.5px !important;
}
.adm-input-has-prefix { padding-left: 24px !important; }

/* Calculator table cells: drop extra padding so the row reads compact */
.foc-table tbody td { padding: 4px 6px !important; }
.foc-table thead th { padding: 6px 8px !important; }

/* ── Tables ──────────────────────────────────────────────────────── */
.foc-table, .app-table, .table {
  font-family: var(--mac-font) !important;
  font-size: 12.5px !important;
  color: var(--mac-text) !important;
  background: transparent !important;
}
.foc-table thead th, .app-table thead th, .table thead th {
  background: var(--mac-bg-titlebar) !important;
  color: var(--mac-text-secondary) !important;
  font-weight: 600 !important;
  font-size: 11.5px !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 12px !important;
  border-bottom: 1px solid var(--mac-divider-strong) !important;
  border-top: none !important;
}
.foc-table tbody td, .app-table tbody td, .table tbody td {
  padding: 8px 12px !important;
  border-color: var(--mac-divider) !important;
  background: transparent !important;
}
.foc-table tbody tr:hover, .app-table tbody tr:hover, .table tbody tr:hover {
  background: color-mix(in srgb, var(--mac-accent) 6%, transparent) !important;
}

/* ── Font Awesome icon helper ──────────────────────────────────────
   Use as: <i class="fa-solid fa-plus fa-ic"></i> Add row
   Gives the icon a tiny right-margin + consistent baseline so it sits
   neatly to the left of label text inside buttons / links / pills. */
.fa-ic { margin-right: 6px; line-height: 1; }
.fa-ic-r { margin-left: 6px; margin-right: 0; }   /* icon AFTER text */
.fa-ic-only { margin-right: 0; }                  /* icon-only buttons */

/* ═════════════════════════════════════════════════════════════════════
   FA ICON SEMANTIC COLORS
   Color icons by meaning *only* when they appear as decorative glyphs
   (page titles, plain links, chips, banners). Inside any styled button
   we force `color: inherit` so the icon takes the button's text color
   (white on solid blue/green/red etc.). The `:where()` keeps these
   rules at specificity 0 so button styling always wins effortlessly.
   The whole block is scoped to `main` so navbar icons stay neutral
   and adapt to dark/light navbar themes via their parent's color.
═════════════════════════════════════════════════════════════════════ */

/* ── Danger / destructive ── */
main :where(i.fa-trash, i.fa-trash-can,
            i.fa-circle-xmark, i.fa-ban,
            i.fa-calendar-xmark, i.fa-power-off) {
  color: var(--mac-danger);
}

/* ── Success / positive / money / start dates ── */
main :where(i.fa-circle-check, i.fa-check, i.fa-plus,
            i.fa-calendar-day, i.fa-phone,
            i.fa-sack-dollar, i.fa-lock-open) {
  color: var(--mac-success);
}

/* ── Warn / alert / protective ── */
main :where(i.fa-key, i.fa-bolt, i.fa-bullseye,
            i.fa-shield-halved, i.fa-lock,
            i.fa-folder, i.fa-triangle-exclamation,
            i.fa-hourglass-half, i.fa-oil-can) {
  color: var(--mac-warn);
}

/* ── Accent / actionable / informational ── */
main :where(i.fa-calculator, i.fa-clipboard, i.fa-receipt,
            i.fa-droplet, i.fa-upload, i.fa-download,
            i.fa-magnifying-glass, i.fa-pen-to-square, i.fa-pencil,
            i.fa-eye, i.fa-arrow-right, i.fa-envelope,
            i.fa-circle-info, i.fa-percent, i.fa-cubes,
            i.fa-chart-column, i.fa-arrow-up-right-from-square,
            i.fa-right-to-bracket, i.fa-user, i.fa-box,
            i.fa-boxes-stacked, i.fa-file-arrow-down,
            i.fa-file-arrow-up, i.fa-globe, i.fa-house,
            i.fa-floppy-disk) {
  color: var(--mac-accent);
}

/* ── Muted / neutral utility ── */
main :where(i.fa-gear, i.fa-arrow-left, i.fa-eye-slash,
            i.fa-arrows-rotate, i.fa-xmark, i.fa-code,
            i.fa-file-lines, i.fa-calendar, i.fa-font,
            i.fa-screwdriver-wrench, i.fa-chevron-right,
            i.fa-chevron-down, i.fa-chevron-up) {
  color: var(--mac-text-secondary);
}

/* ── Brand colors for social icons ── */
main :where(i.fa-brands.fa-github) { color: var(--mac-text); }
main :where(i.fa-brands.fa-linkedin, i.fa-brands.fa-linkedin-in) { color: #0a66c2; }
main :where(i.fa-brands.fa-x-twitter, i.fa-brands.fa-twitter) { color: var(--mac-text); }

/* ── Microsoft Office file colors (Excel green, Word blue, etc.) ── */
main :where(i.fa-file-excel) { color: #1D6F42; }   /* Office Excel green */
main :where(i.fa-file-word)  { color: #2B579A; }
main :where(i.fa-file-csv)   { color: #1D6F42; }
main :where(i.fa-file-pdf)   { color: #D24726; }

/* ── Theme palette icon (decorative, sits in navbar but inside .theme-toggle-btn) ── */
main :where(i.fa-palette) { color: #af52de; }

/* ─────────────────────────────────────────────────────────────────────
   RESET TO INHERIT — only inside buttons with SOLID COLORED FILLS where
   the icon must take the button's text color (typically white) to stay
   readable. Buttons with neutral / white backgrounds are intentionally
   omitted so their icons keep semantic color and add visual interest.
───────────────────────────────────────────────────────────────────── */
main :is(.btn, [class*="btn-"]) i,
main :is(.foc-bulk-btn, .foc-btn, .lp-btn-submit, .nav-login-btn) i,
main :is(.btn, .foc-btn, .foc-bulk-btn):hover i {
  color: inherit !important;
}

/* Edit / Delete / Landing row pills DO change to solid-fill on hover —
   icons must follow text color through that transition, so inherit. */
main :is(.adm-btn-edit, .adm-btn-delete, .adm-btn-landing) i {
  color: inherit !important;
}

/* Bootstrap badges have their own bg color — icon takes badge text color. */
main .badge i { color: inherit !important; }

/* Colored avatar / launcher tiles — icon stays white on the gradient bg */
main .owner-row-icon i { color: #fff !important; }
main .app-icon i,
main .unlock-icon i,
main .empty-icon i { color: inherit !important; }

/* NEUTRAL-bg surfaces (white card / chip) — let semantic colors shine:
       .foc-index-card  (dashboard data tiles)
       .adm-quick-btn   (Quick Action pills)
       .lp-link         (login utility chips)
       .about-chip      (contact chips on /about)
       .owner-row       (single Owner Settings row)
   These are intentionally NOT in the inherit list. */

/* ── Footer ──────────────────────────────────────────────────────── */
.app-footer {
  text-align: center;
  padding: 14px 0 22px;
  background: transparent;
  letter-spacing: -0.005em;
}
.app-footer-line {
  font-size: 11.5px;
  color: var(--mac-text-muted);
}
.app-footer-dev {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--mac-text-muted);
}
.app-footer-dev-link {
  color: var(--mac-text-secondary) !important;
  text-decoration: none !important;
  font-weight: 600;
  border-bottom: 1px dotted var(--mac-text-muted);
}
.app-footer-dev-link:hover {
  color: var(--mac-accent) !important;
  border-bottom-color: var(--mac-accent);
}
.app-footer-dev-role { color: var(--mac-text-muted); }

/* ── Live clock chip ─────────────────────────────────────────────── */
.foc-clock {
  background: var(--mac-bg-control) !important;
  border: 1px solid var(--mac-divider) !important;
  color: var(--mac-text-secondary) !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
  padding: 3px 10px !important;
  border-radius: 999px !important;
  box-shadow: var(--mac-shadow-1);
}

/* ── Order total bar — Mac-style ─────────────────────────────────── */
.foc-total-bar {
  padding: 12px 18px !important;
  margin-top: 14px;
}
.foc-total-label { font-size: 10.5px !important; color: var(--mac-text-secondary) !important; letter-spacing: 0.04em; }
.foc-total-value { font-size: 17px !important; color: var(--mac-text) !important; font-weight: 600 !important; }
.foc-total-value--main { color: var(--mac-accent) !important; }
.foc-total-divider { background: var(--mac-divider) !important; }

/* ── Bulk-paste button: left-aligned, green, icon-only ─────────────
   Visual styling (color, size, tooltip) lives in form.html's inline
   <style> — this block only sets the position rules with enough
   specificity to override the generic .foc-btn / .btn fonts. */
.foc-bulk-bar { margin: 0 0 12px; justify-content: flex-start !important; }

/* ── Alerts soften ───────────────────────────────────────────────── */
.alert {
  border-radius: 8px !important;
  border: 1px solid var(--mac-divider-strong) !important;
  font-size: 13px !important;
  padding: 10px 14px !important;
}

/* ── Toast container ─────────────────────────────────────────────── */
.toast-container-custom {
  position: fixed; top: 60px; right: 16px; z-index: 1080;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  border-radius: 10px !important;
  box-shadow: var(--mac-shadow-window) !important;
  font-family: var(--mac-font) !important;
  font-size: 13px !important;
}

/* ── Section titles ─────────────────────────────────────────────── */
.foc-section-title {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--mac-text-secondary) !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Modal overlay (bulk paste) — Mac sheet look ─────────────────── */
.foc-modal-overlay {
  background: rgba(0,0,0,0.35) !important;
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
}
.foc-modal {
  background: var(--mac-bg-window) !important;
  color: var(--mac-text) !important;
  border-radius: var(--mac-radius-window) !important;
  box-shadow: var(--mac-shadow-window) !important;
  border: none !important;
}
.foc-modal-head, .foc-modal-foot { border-color: var(--mac-divider) !important; }
.foc-modal-title { color: var(--mac-text) !important; }
.foc-modal-hint  { color: var(--mac-text-secondary) !important; }
.foc-modal-close { color: var(--mac-text-secondary) !important; }
.foc-modal-close:hover { color: var(--mac-danger) !important; }

/* Mac-style toolbar buttons inside the grid modal */
.xl-tool-btn {
  background: var(--mac-bg-control) !important;
  border: 1px solid var(--mac-divider-strong) !important;
  color: var(--mac-text) !important;
  border-radius: 6px !important;
  font-size: 12px !important;
}
.xl-tool-btn:hover { background: var(--mac-bg-control-hov) !important; }
.xl-count { color: var(--mac-text-muted) !important; }
.foc-modal-hint kbd, .foc-modal-hint code {
  background: var(--mac-bg-app) !important;
  border: 1px solid var(--mac-divider) !important;
  color: var(--mac-text) !important;
}

/* ── Page wrapper ─────────────────────────────────────────────── */
main { background: var(--mac-bg-app); min-height: calc(100vh - 50px); padding-bottom: 20px; }

/* ── Compact metric/summary cards ─────────────────────────────── */
.foc-sum-num { font-size: 22px !important; font-weight: 600 !important; letter-spacing: -0.02em; }
.foc-sum-lbl { font-size: 11px !important; color: var(--mac-text-secondary) !important; text-transform: uppercase; letter-spacing: 0.04em; }
.foc-sum-sub { font-size: 11px !important; }

/* Reduce default container vertical padding inside Mac windows */
.mac-window .container,
.mac-window .container-fluid { padding-top: 0 !important; padding-bottom: 0 !important; }

/* ═════════════════════════════════════════════════════════════════════
   TEXT VISIBILITY GUARANTEES (global, not scoped to .mac-window-body)
   Admin pages and compliance use a mix of inline styles, Bootstrap text
   utilities and old per-theme vars. The rules below make sure every text
   element is readable on whatever background the current theme produces.
═════════════════════════════════════════════════════════════════════ */
main { color: var(--mac-text); }
main h1, main h2, main h3, main h4, main h5, main h6,
main p, main label, main li, main dd, main dt,
main strong, main b, main em { color: inherit; }

/* Bootstrap text utilities — re-color against the active theme */
main .text-muted,
main .text-secondary,
main small.text-muted     { color: var(--mac-text-secondary) !important; }
main .text-dark           { color: var(--mac-text)           !important; }
main .text-body           { color: var(--mac-text)           !important; }
main .text-white          { color: #ffffff                   !important; }
/* keep semantic colors (success/danger/warning/info/primary/purple) intact */

/* Anchor links — accent unless they're styled buttons/cards.
   The :where() wrapper keeps these exclusions at specificity 0 so an
   anchor that's *also* a .btn keeps the button's own color. */
main a:where(:not(.btn)):where(:not([class*="btn-"])):where(:not(.foc-index-card)):where(:not(.adm-quick-btn)):where(:not(.nav-link-custom)):where(:not(.foc-bulk-btn)):where(:not(.adm-btn-edit)):where(:not(.adm-btn-delete)):where(:not(.adm-back-btn)):where(:not(.logout-btn)):where(:not(.app-launcher)) {
  color: var(--mac-accent);
  text-decoration: none;
}
main a:where(:not(.btn)):where(:not([class*="btn-"])):where(:not(.foc-index-card)):where(:not(.adm-quick-btn)):where(:not(.nav-link-custom)):where(:not(.foc-bulk-btn)):where(:not(.adm-btn-edit)):where(:not(.adm-btn-delete)):where(:not(.adm-back-btn)):where(:not(.logout-btn)):where(:not(.app-launcher)):hover {
  text-decoration: none;
}

/* ── Admin row action buttons (Edit/Delete) — Mac-styled ───────── */
.adm-btn-edit, .adm-btn-delete {
  font-size: 11.5px !important;
  padding: 3px 10px !important;
  border-radius: 6px !important;
  font-weight: 500 !important;
  border: 1px solid var(--mac-divider-strong) !important;
  background: var(--mac-bg-control) !important;
  text-decoration: none !important;
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.adm-btn-edit   { color: var(--mac-accent) !important; }
.adm-btn-delete { color: var(--mac-danger) !important; }
.adm-btn-edit:hover {
  background: var(--mac-accent) !important;
  border-color: var(--mac-accent) !important;
  color: #fff !important;
  text-decoration: none !important;
}
.adm-btn-delete:hover {
  background: var(--mac-danger) !important;
  border-color: var(--mac-danger) !important;
  color: #fff !important;
  text-decoration: none !important;
}

/* Landing-sheet download — green outline → solid on hover */
.adm-btn-landing {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 6px;
  font-weight: 500;
  border: 1px solid var(--mac-divider-strong) !important;
  background: var(--mac-bg-control) !important;
  color: var(--mac-success) !important;
  text-decoration: none !important;
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.adm-btn-landing:hover {
  background: var(--mac-success) !important;
  border-color: var(--mac-success) !important;
  color: #fff !important;
  text-decoration: none !important;
}

/* Bootstrap outline variants used in admin headers (anchor-as-button) */
main .btn-outline-primary {
  background: transparent !important;
  border: 1px solid var(--mac-accent) !important;
  color: var(--mac-accent) !important;
}
main .btn-outline-primary:hover {
  background: var(--mac-accent) !important;
  color: #fff !important;
}
main .btn-outline-secondary {
  background: transparent !important;
  border: 1px solid var(--mac-divider-strong) !important;
  color: var(--mac-text) !important;
}
main .btn-outline-secondary:hover {
  background: var(--mac-bg-control-hov) !important;
  color: var(--mac-text) !important;
}

/* Admin dashboard cards/buttons */
.foc-index-card {
  background: var(--mac-bg-elevated) !important;
  border: 1px solid var(--mac-divider) !important;
  border-radius: var(--mac-radius-card) !important;
  color: var(--mac-text) !important;
  box-shadow: var(--mac-shadow-2) !important;
  text-decoration: none;
}
.foc-index-card:hover {
  color: var(--mac-text) !important;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.10) !important;
}
.foc-index-title { color: var(--mac-text) !important; }
.foc-index-desc  { color: var(--mac-text-secondary) !important; }

.adm-dash-title    { color: var(--mac-text) !important;
                     font-weight: 600 !important; letter-spacing: -0.02em; }
.adm-dash-subtitle { color: var(--mac-text-secondary) !important; }
.adm-quick-title   { color: var(--mac-text-secondary) !important; }
.adm-dash-badge    { color: var(--mac-text-secondary) !important;
                     background: var(--mac-bg-control) !important;
                     border: 1px solid var(--mac-divider) !important; }
.adm-quick-btn {
  background: var(--mac-bg-control) !important;
  color: var(--mac-text) !important;
  border: 1px solid var(--mac-divider-strong) !important;
  border-radius: var(--mac-radius-btn) !important;
}
.adm-quick-btn:hover {
  background: var(--mac-bg-control-hov) !important;
  color: var(--mac-text) !important;
}

/* Admin list pages (product_list, pack_list, foc_list, mrp_list, ...) */
.adm-header, .adm-card, .adm-filter-bar, .adm-confirm-card,
.adm-page-title, .adm-page-subtitle {
  color: var(--mac-text);
}
.adm-card {
  background: var(--mac-bg-elevated) !important;
  border: 1px solid var(--mac-divider) !important;
  border-radius: var(--mac-radius-card) !important;
  box-shadow: var(--mac-shadow-2) !important;
}
.adm-page-title    { color: var(--mac-text) !important; font-weight: 600 !important; }
.adm-page-subtitle { color: var(--mac-text-secondary) !important; }
.adm-table { color: var(--mac-text) !important; background: transparent !important; }
.adm-table thead th {
  background: var(--mac-bg-titlebar) !important;
  color: var(--mac-text-secondary) !important;
  border-bottom: 1px solid var(--mac-divider-strong) !important;
}
.adm-table tbody td { color: var(--mac-text) !important; border-color: var(--mac-divider) !important; }

/* Compliance / form table cells */
.foc-th, .foc-th-strong  { color: var(--mac-text) !important;
                           background: var(--mac-bg-titlebar) !important; }
.foc-td, .foc-td-strong  { color: var(--mac-text) !important; }
.foc-td-muted            { color: var(--mac-text-secondary) !important; }
.foc-label-strong        { color: var(--mac-text) !important; }
.foc-label-muted         { color: var(--mac-text-secondary) !important; }
.foc-code                { color: var(--mac-text) !important;
                           background: var(--mac-bg-app) !important;
                           border: 1px solid var(--mac-divider);
                           padding: 1px 6px; border-radius: 4px;
                           font-family: ui-monospace, monospace; font-size: 12px; }
.foc-card-chip           { color: var(--mac-text) !important; }
.foc-collapse-toggle     { color: var(--mac-text) !important;
                           background: transparent !important; }
.foc-upload-title        { color: var(--mac-text) !important; }
.foc-upload-subtitle,
.foc-upload-help         { color: var(--mac-text-secondary) !important; }
.foc-collapse-arrow      { color: var(--mac-text-secondary) !important; }
.foc-sum-lbl             { color: var(--mac-text-secondary) !important; }

/* Bootstrap form labels */
main .form-label { color: var(--mac-text) !important; }

/* Pagination links */
main .page-link {
  background: var(--mac-bg-control) !important;
  color: var(--mac-text) !important;
  border-color: var(--mac-divider) !important;
}
main .page-item.active .page-link {
  background: var(--mac-accent) !important;
  color: #fff !important;
  border-color: var(--mac-accent) !important;
}
main .page-item.disabled .page-link {
  color: var(--mac-text-muted) !important;
  background: var(--mac-bg-app) !important;
}

/* Material descriptions in the calculator (.itemDesc) keep theme text */
.foc-table tbody td input.foc-input.valid { color: var(--mac-text) !important; }
.foc-table tbody td input.foc-input.invalid { color: var(--mac-danger) !important; }

/* Bootstrap alerts get themed backgrounds without losing readability */
.alert-info { background: color-mix(in srgb, #5ac8fa 18%, var(--mac-bg-elevated)) !important;
              color: var(--mac-text) !important; }
.alert-warning { background: color-mix(in srgb, #ff9500 18%, var(--mac-bg-elevated)) !important;
                 color: var(--mac-text) !important; }
.alert-danger { background: color-mix(in srgb, #ff3b30 18%, var(--mac-bg-elevated)) !important;
                color: var(--mac-text) !important; }
.alert-success { background: color-mix(in srgb, #34c759 18%, var(--mac-bg-elevated)) !important;
                 color: var(--mac-text) !important; }

/* ════════════════════════════════════════════════════════════════════════
   Theme-toggle pill — guaranteed contrast on every theme.
   Earlier blocks scatter background/color overrides per data-theme and
   sometimes lose to .theme-toggle-btn's generic !important fill, leaving
   the "Theme" label white-on-white on Blue/Teal/Slate. This block has
   higher specificity than every earlier rule, so it wins outright.
   ════════════════════════════════════════════════════════════════════════ */
html[data-theme] .app-navbar .theme-toggle-btn {
  background: rgba(255,255,255,0.14) !important;
  border: 1px solid rgba(255,255,255,0.28) !important;
  color: #ffffff !important;
  backdrop-filter: blur(6px);
}
html[data-theme="fiori"] .app-navbar .theme-toggle-btn {
  background: rgba(0,0,0,0.06) !important;
  border-color: rgba(0,0,0,0.12) !important;
  color: #1f2328 !important;
}
html[data-theme="fiori"] .app-navbar .theme-toggle-btn:hover {
  background: rgba(0,0,0,0.10) !important;
}
html[data-theme] .app-navbar .theme-toggle-btn:hover {
  background: rgba(255,255,255,0.22) !important;
}
/* Label + chevron just inherit the button color — works on every theme. */
html[data-theme] .app-navbar .theme-toggle-btn .theme-label,
html[data-theme] .app-navbar .theme-toggle-btn .theme-toggle-arrow,
html[data-theme] .app-navbar .theme-toggle-btn .fa-ic {
  color: inherit !important;
  opacity: 0.92;
}

/* ════════════════════════════════════════════════════════════════════════
   Form check + switch — iOS-style override
   Hi-specificity (html body) + appearance:none wipes browser/Bootstrap
   defaults. Switch thumb is rendered via background-image SVG with a
   built-in soft shadow (browsers don't reliably drop-shadow native input
   pseudo-elements, so the shadow lives in the SVG itself).
   ════════════════════════════════════════════════════════════════════════ */

html body .form-check {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px;
  min-height: 0 !important;
  padding-left: 0 !important;
  margin-bottom: 0 !important;
}
html body .form-check .form-check-label {
  margin: 0 !important;
  cursor: pointer;
  user-select: none;
}
html body .form-check.form-switch { padding-left: 0 !important; }

/* ── Square checkbox — 20×20 px, unambiguously square via aspect-ratio ── */
html body input[type="checkbox"].form-check-input,
html body input[type="checkbox"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  min-height: 20px !important;
  max-height: 20px !important;
  flex: 0 0 20px !important;
  aspect-ratio: 1 / 1 !important;     /* lock it square even inside flex grids */
  inline-size: 20px !important;
  block-size: 20px !important;
  margin: 0 !important;
  padding: 0 !important;
  background-color: #ffffff !important;
  background-image: none !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
  background-size: 14px 14px !important;
  border: 2px solid #cbd5e0 !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  vertical-align: middle !important;
  box-shadow: none !important;
  transition: background-color .12s ease, border-color .12s ease, transform .08s ease;
  float: none !important;
  position: relative !important;
  overflow: hidden;
}
html body input[type="checkbox"].form-check-input:hover,
html body input[type="checkbox"]:hover {
  border-color: #22c55e !important;
}
html body input[type="checkbox"].form-check-input:active,
html body input[type="checkbox"]:active {
  transform: scale(0.92);
}
html body input[type="checkbox"].form-check-input:checked,
html body input[type="checkbox"]:checked {
  background-color: #22c55e !important;
  border-color: #22c55e !important;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round' d='M5 10.5l3.5 3.5L15 7'/%3E%3C/svg%3E") !important;
}
html body input[type="checkbox"].form-check-input:focus-visible,
html body input[type="checkbox"]:focus-visible {
  outline: 3px solid rgba(34,197,94,0.30) !important;
  outline-offset: 1px !important;
}

/* ── Pill switch — 60×30 px (elongated), big white thumb with shadow ── */
html body .form-check.form-switch input[type="checkbox"].form-check-input,
html body .form-check.form-switch input[type="checkbox"] {
  width: 60px !important;
  height: 30px !important;
  min-width: 60px !important;
  max-width: 60px !important;
  min-height: 30px !important;
  max-height: 30px !important;
  flex: 0 0 60px !important;
  aspect-ratio: auto !important;     /* override the checkbox 1:1 rule */
  inline-size: 60px !important;
  block-size: 30px !important;
  border-radius: 999px !important;
  border: none !important;
  background-color: #e5e7eb !important;
  /* Thumb SVG: two circles — shadow circle 2 px below + white circle on top */
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Ccircle cx='15' cy='17' r='12.5' fill='rgba(0,0,0,0.18)'/%3E%3Ccircle cx='15' cy='15' r='12.5' fill='white'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: 1px center !important;
  background-size: 28px 28px !important;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.10) !important;
  transition: background-color .2s ease, background-position .2s ease !important;
  position: relative !important;
  overflow: visible;
}
html body .form-check.form-switch input[type="checkbox"].form-check-input:hover,
html body .form-check.form-switch input[type="checkbox"]:hover {
  background-color: #d1d5db !important;
}
html body .form-check.form-switch input[type="checkbox"].form-check-input:checked,
html body .form-check.form-switch input[type="checkbox"]:checked {
  background-color: #22c55e !important;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Ccircle cx='15' cy='17' r='12.5' fill='rgba(0,0,0,0.18)'/%3E%3Ccircle cx='15' cy='15' r='12.5' fill='white'/%3E%3C/svg%3E") !important;
  background-position: 31px center !important;   /* 60 - 28 - 1 = 31 */
}
html body .form-check.form-switch input[type="checkbox"].form-check-input:checked:hover,
html body .form-check.form-switch input[type="checkbox"]:checked:hover {
  background-color: #16a34a !important;
}
html body .form-check.form-switch input[type="checkbox"].form-check-input:focus-visible,
html body .form-check.form-switch input[type="checkbox"]:focus-visible {
  outline: 3px solid rgba(34,197,94,0.35) !important;
  outline-offset: 2px !important;
}

/* ════════════════════════════════════════════════════════════════════════
   Owner-Settings admin pages — dark-theme compatibility
   The user_list / user_form / site_settings templates ship inline <style>
   blocks with hard-coded #fff backgrounds and dark text for the light
   theme. Re-tint everything here when html[data-theme="dark"] is set so
   the same templates work on every theme without per-template edits.
   ════════════════════════════════════════════════════════════════════════ */
html[data-theme="dark"] {
  --owner-card-bg     : #1c1f2a;
  --owner-card-bd     : #2a2f3d;
  --owner-text        : #e6e8ee;
  --owner-text-soft   : #9aa1b0;
  --owner-input-bg    : #15171f;
  --owner-input-bd    : #2f3441;
  --owner-pill-bg     : #232733;
  --owner-pill-bg-hov : #2c3142;
}

/* ── Card surfaces (user-list table card, form cards, ss-sections) ── */
html[data-theme="dark"] .um-card,
html[data-theme="dark"] .um-card-row,
html[data-theme="dark"] .uf-card,
html[data-theme="dark"] .ss-section {
  background: var(--owner-card-bg) !important;
  border-color: var(--owner-card-bd) !important;
  color: var(--owner-text) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.35) !important;
}

/* Headings inside the cards stay readable */
html[data-theme="dark"] .ss-section h5,
html[data-theme="dark"] .um-header h4,
html[data-theme="dark"] .uf-card h4 {
  color: #6db5ff !important;
}

/* ── Table on dark theme ── */
html[data-theme="dark"] .um-table tbody td { color: var(--owner-text) !important; }
html[data-theme="dark"] .um-table tbody tr:first-child td { border-top: none !important; }
html[data-theme="dark"] .um-table tbody td { border-top-color: var(--owner-card-bd) !important; }
html[data-theme="dark"] .um-table tbody tr:hover { background: rgba(13,148,255,0.06) !important; }

/* ── Inputs (text / email / number / password) ── */
html[data-theme="dark"] .uf-card .form-control,
html[data-theme="dark"] .ss-section .form-control,
html[data-theme="dark"] .uf-card input[type="text"],
html[data-theme="dark"] .uf-card input[type="email"],
html[data-theme="dark"] .uf-card input[type="number"],
html[data-theme="dark"] .uf-card input[type="password"],
html[data-theme="dark"] .ss-section input[type="text"],
html[data-theme="dark"] .ss-section input[type="email"],
html[data-theme="dark"] .ss-section input[type="number"],
html[data-theme="dark"] .ss-section input[type="password"] {
  background: var(--owner-input-bg) !important;
  border-color: var(--owner-input-bd) !important;
  color: var(--owner-text) !important;
}
html[data-theme="dark"] .uf-card .form-control::placeholder,
html[data-theme="dark"] .ss-section .form-control::placeholder {
  color: #6a7280 !important;
}

/* ── Labels + helper text ── */
html[data-theme="dark"] .uf-card .form-label,
html[data-theme="dark"] .ss-section .form-label,
html[data-theme="dark"] .um-card .form-label {
  color: var(--owner-text-soft) !important;
}
html[data-theme="dark"] .uf-card .form-text,
html[data-theme="dark"] .ss-section .form-text {
  color: #7a808c !important;
}

/* ── Module-pill cards (uf-modules) ── */
html[data-theme="dark"] .uf-modules .uf-mod-pill {
  background: var(--owner-pill-bg) !important;
  border-color: var(--owner-input-bd) !important;
  color: var(--owner-text) !important;
}
html[data-theme="dark"] .uf-modules .uf-mod-pill:hover {
  background: var(--owner-pill-bg-hov) !important;
  border-color: #22c55e !important;
}
html[data-theme="dark"] .uf-modules .uf-mod-pill:has(input:checked) {
  background: rgba(34,197,94,0.15) !important;
  border-color: #22c55e !important;
  color: #6ee7a0 !important;
}

/* ── "Account is active" tinted panel ── */
html[data-theme="dark"] .uf-active-row {
  background: rgba(13,148,255,0.08) !important;
  border-color: rgba(13,148,255,0.25) !important;
}
html[data-theme="dark"] .uf-active-row .uf-ar-text label { color: #6db5ff !important; }

/* ── Help banner (info banner on Create form) ── */
html[data-theme="dark"] .uf-help-banner {
  background: rgba(13,148,255,0.12) !important;
  border-color: rgba(13,148,255,0.28) !important;
  color: #cdd6e2 !important;
}
html[data-theme="dark"] .uf-help-banner i { color: #6db5ff !important; }

/* ── Module-row dividers ── */
html[data-theme="dark"] .ss-module-row { border-bottom-color: var(--owner-card-bd) !important; }
html[data-theme="dark"] .ss-module-row .lab { color: var(--owner-text) !important; }
html[data-theme="dark"] .ss-module-row .sub { color: var(--owner-text-soft) !important; }

/* ── Encryption-mode picker — DARK-THEME OVERRIDE ONLY.
   The light-theme card + green-square-checkbox visuals are owned by
   the inline <style> block in site_settings.html (so they're easy to
   edit without touching macos.css). Here we just retint card surfaces
   for the dark theme; the green square indicator stays the same. */
html[data-theme="dark"] .ss-encmode label {
  background: var(--owner-pill-bg) !important;
  border-color: var(--owner-input-bd) !important;
  color: var(--owner-text) !important;
}
html[data-theme="dark"] .ss-encmode label:hover {
  background: var(--owner-pill-bg-hov) !important;
  border-color: #22c55e !important;
}
html[data-theme="dark"] .ss-encmode label:has(input:checked) {
  background: rgba(34,197,94,0.12) !important;
  border-color: #22c55e !important;
  color: #6ee7a0 !important;
  box-shadow: 0 2px 8px rgba(34,197,94,0.18) !important;
}
html[data-theme="dark"] .ss-encmode input[type="radio"] {
  background: #15171f !important;
  border-color: #4a5161 !important;
}
html[data-theme="dark"] .ss-encmode input[type="radio"]:checked {
  background-color: #22c55e !important;
  border-color: #22c55e !important;
}

/* ── Sub-nav (owner_subnav partial) ── */
html[data-theme="dark"] .owner-subnav {
  background: var(--owner-card-bg) !important;
  border-color: var(--owner-card-bd) !important;
}
html[data-theme="dark"] .owner-subnav a { color: var(--owner-text) !important; }
html[data-theme="dark"] .owner-subnav a:hover {
  background: rgba(13,148,255,0.12) !important;
  color: #6db5ff !important;
}
html[data-theme="dark"] .owner-subnav .osn-tab.is-active,
html[data-theme="dark"] .owner-subnav .osn-tab.is-active:hover {
  background: #0a84ff !important;
  color: #ffffff !important;
}
html[data-theme="dark"] .owner-subnav .osn-back {
  color: var(--owner-text-soft) !important;
  border-color: var(--owner-card-bd) !important;
}

/* RO MIS launchpad shell */
.shell {
  grid-template-columns: 172px minmax(0, 1fr) !important;
  background:
    radial-gradient(circle at 16% 8%, rgba(10, 132, 255, 0.12), transparent 28rem),
    radial-gradient(circle at 88% 18%, rgba(52, 199, 89, 0.10), transparent 24rem),
    var(--mac-bg-app) !important;
}

.sidebar {
  background: color-mix(in srgb, var(--mac-bg-window) 58%, transparent) !important;
  border-right: 1px solid var(--mac-divider) !important;
  color: var(--mac-text) !important;
  padding: 14px 12px !important;
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  backdrop-filter: saturate(180%) blur(28px);
}

.brand {
  color: var(--mac-text) !important;
  font-size: 13px !important;
  justify-content: center;
  margin-bottom: 14px !important;
  padding: 2px 4px 10px !important;
  text-align: center;
}

.brand::before {
  border-radius: 16px !important;
  height: 46px !important;
  width: 46px !important;
}

.sidebar .nav {
  display: grid !important;
  gap: 10px;
}

.app-folder {
  background: color-mix(in srgb, var(--mac-bg-elevated) 78%, transparent);
  border: 1px solid var(--mac-divider);
  border-radius: 18px;
  box-shadow: var(--mac-shadow-1);
  overflow: hidden;
}

.app-folder summary {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 7px;
  grid-template-columns: 1fr;
  justify-items: center;
  list-style: none;
  min-height: 96px;
  padding: 12px 8px;
  text-align: center;
}

.app-folder summary::-webkit-details-marker {
  display: none;
}

.app-folder summary > span:last-child {
  color: var(--mac-text);
  font-size: 12px;
  font-weight: 800;
}

.app-folder-icon {
  align-items: center;
  background:
    radial-gradient(circle at 28% 22%, rgba(255,255,255,0.65), transparent 22px),
    linear-gradient(135deg, #0a84ff, #5ac8fa);
  border-radius: 18px;
  box-shadow: 0 10px 22px rgba(10, 132, 255, 0.24);
  color: #fff;
  display: inline-flex;
  font-size: 22px;
  height: 54px;
  justify-content: center;
  width: 54px;
}

.app-folder:nth-of-type(2) .app-folder-icon {
  background:
    radial-gradient(circle at 28% 22%, rgba(255,255,255,0.62), transparent 22px),
    linear-gradient(135deg, #34c759, #30d158);
}

.app-folder:nth-of-type(3) .app-folder-icon {
  background:
    radial-gradient(circle at 28% 22%, rgba(255,255,255,0.62), transparent 22px),
    linear-gradient(135deg, #ff9500, #ffcc00);
}

.app-folder:nth-of-type(4) .app-folder-icon {
  background:
    radial-gradient(circle at 28% 22%, rgba(255,255,255,0.62), transparent 22px),
    linear-gradient(135deg, #af52de, #ff2d55);
}

.app-folder[open] {
  box-shadow: var(--mac-shadow-2);
}

.app-icon-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0 10px 12px;
}

.sidebar .nav .app-icon-grid a {
  align-items: center;
  background: transparent !important;
  border: 0 !important;
  border-radius: 12px !important;
  color: var(--mac-text) !important;
  display: grid !important;
  gap: 5px !important;
  justify-items: center;
  min-height: 72px !important;
  padding: 7px 4px !important;
  text-align: center;
}

.sidebar .nav .app-icon-grid a:hover {
  background: color-mix(in srgb, var(--mac-accent) 12%, transparent) !important;
}

.sidebar .nav .app-icon-grid a i {
  align-items: center;
  background: linear-gradient(135deg, var(--mac-accent), #5ac8fa);
  border-radius: 13px;
  box-shadow: 0 7px 16px rgba(10,132,255,0.20);
  color: #fff;
  display: inline-flex;
  flex: none !important;
  font-size: 16px;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.sidebar .nav .app-icon-grid a span {
  color: var(--mac-text-secondary);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.12;
}

.content {
  padding: 22px !important;
}

.topbar,
.panel,
.analytics-tile,
.bld-sales-card {
  background: color-mix(in srgb, var(--mac-bg-elevated) 82%, transparent) !important;
  border-color: var(--mac-divider) !important;
  box-shadow: var(--mac-shadow-1) !important;
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

.topbar {
  border-radius: var(--mac-radius-window) !important;
}

.topbar h1 {
  color: var(--mac-text) !important;
  font-size: 22px !important;
  font-weight: 800 !important;
}

button,
.button,
.btn-login {
  border-radius: var(--mac-radius-btn) !important;
  box-shadow: var(--mac-shadow-1);
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr !important;
  }

  .sidebar {
    height: auto !important;
    position: static !important;
  }

  .sidebar .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── Breadcrumb pill ── */
html[data-theme="dark"] .breadcrumb {
  background: var(--owner-card-bg) !important;
  border-color: var(--owner-card-bd) !important;
}
html[data-theme="dark"] .breadcrumb-item,
html[data-theme="dark"] .breadcrumb-item a { color: #6db5ff !important; }
html[data-theme="dark"] .breadcrumb-item.active { color: var(--owner-text-soft) !important; }
html[data-theme="dark"] .breadcrumb-item + .breadcrumb-item::before { color: #5a6377 !important; }

/* ── Footer button border on dark cards ── */
html[data-theme="dark"] .uf-foot { border-top-color: var(--owner-card-bd) !important; }

/* ── Search-bar input group on dark cards ── */
html[data-theme="dark"] .um-toolbar .input-group-text {
  background: var(--owner-input-bg) !important;
  border-color: var(--owner-input-bd) !important;
  color: var(--owner-text-soft) !important;
}

/* User-list subtext is already theme-safe. */
/* RO MIS compact sidebar and dense work screens. */
.shell {
  grid-template-columns: 232px minmax(0, 1fr) !important;
}

.sidebar {
  padding: 12px 10px !important;
}

.brand {
  align-items: center !important;
  display: flex !important;
  font-size: 14px !important;
  justify-content: flex-start !important;
  margin-bottom: 10px !important;
  min-height: 38px;
  padding: 5px 6px 10px !important;
  text-align: left !important;
}

.brand::before {
  border-radius: 9px !important;
  flex: 0 0 32px;
  height: 32px !important;
  width: 32px !important;
}

.sidebar .nav {
  display: block !important;
}

.nav-group {
  color: var(--mac-text-tertiary);
  font-size: 10px !important;
  letter-spacing: 0 !important;
  line-height: 1;
  margin: 12px 8px 5px !important;
  text-transform: uppercase;
}

.sidebar .nav a {
  align-items: center !important;
  border-radius: 8px !important;
  display: flex !important;
  font-size: 12.5px !important;
  gap: 8px !important;
  line-height: 1.15 !important;
  margin: 1px 0 !important;
  min-height: 30px !important;
  padding: 5px 8px !important;
  text-align: left !important;
}

.sidebar .nav a i {
  align-items: center;
  display: inline-flex;
  flex: 0 0 16px !important;
  font-size: 12px !important;
  justify-content: center;
  opacity: .9;
  width: 16px !important;
}

.sidebar .nav a span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content {
  padding: 14px 16px !important;
}

.topbar {
  border-radius: 10px !important;
  gap: 10px;
  margin-bottom: 12px !important;
  min-height: 44px;
  padding: 8px 10px !important;
}

.topbar h1 {
  font-size: 20px !important;
  line-height: 1.15 !important;
}

.topbar > div:last-child {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.panel,
.messages,
.form-panel,
.table-panel,
.filter-panel,
.upload-panel {
  border-radius: 9px !important;
  margin-bottom: 12px !important;
  padding: 12px !important;
}

.panel h2,
.panel h3,
.form-panel h2,
.table-panel h2,
.filter-panel h2,
.upload-panel h2 {
  font-size: 16px !important;
  line-height: 1.2 !important;
  margin: 0 0 9px !important;
}

.panel p,
.panel li,
.messages,
.helptext,
.text-muted,
small {
  font-size: 12px !important;
  line-height: 1.35 !important;
}

label,
.form-label {
  font-size: 12px !important;
  font-weight: 700 !important;
  margin-bottom: 4px !important;
}

input,
select,
textarea,
.form-control,
.form-select {
  border-radius: 7px !important;
  font-size: 12.5px !important;
  min-height: 34px !important;
  padding: 6px 9px !important;
}

textarea,
select[multiple] {
  min-height: 92px !important;
}

select[multiple].territory-select,
select[multiple][name*="district"],
select[multiple][name*="territory"] {
  min-height: 132px !important;
}

.date-picker-wrap {
  max-width: 220px;
}

.date-picker-wrap input {
  padding-right: 34px !important;
}

.date-picker-button {
  height: 28px !important;
  min-height: 28px !important;
  right: 3px !important;
  width: 28px !important;
}

button,
.button,
.btn,
.btn-login,
input[type="submit"] {
  align-items: center;
  border-radius: 8px !important;
  display: inline-flex;
  font-size: 12px !important;
  font-weight: 700 !important;
  gap: 6px !important;
  justify-content: center;
  line-height: 1.1 !important;
  min-height: 32px !important;
  padding: 6px 10px !important;
}

.button.secondary,
.btn-secondary {
  box-shadow: none !important;
}

table {
  font-size: 12.5px !important;
}

table th,
table td {
  padding: 7px 9px !important;
  vertical-align: middle !important;
}

table th {
  letter-spacing: 0 !important;
  line-height: 1.2 !important;
}

/* App-wide table typography: Segoe UI Bold items, headers one size larger. */
.content table th,
.content table td,
.panel table th,
.panel table td,
.table-wrap table th,
.table-wrap table td,
.foc-table thead th, .app-table thead th, .table thead th, .adm-table thead th,
.foc-table tbody td, .app-table tbody td, .table tbody td, .adm-table tbody td {
  font-family: "Segoe UI", "Segoe UI Bold", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif !important;
  font-weight: 700 !important;
}
.content table td,
.panel table td,
.table-wrap table td,
.foc-table tbody td, .app-table tbody td, .table tbody td, .adm-table tbody td {
  font-size: 13px !important;
  font-weight: 600 !important;   /* semibold items; headers stay bold */
}
.content table th,
.panel table th,
.table-wrap table th,
.foc-table thead th, .app-table thead th, .table thead th, .adm-table thead th {
  font-size: 15px !important;
}

.table-responsive,
.table-wrap {
  border-radius: 9px !important;
}

.actions,
.action-row,
.toolbar,
.button-row,
.form-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px !important;
}

.analytics-grid {
  gap: 10px !important;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)) !important;
}

.analytics-tile,
.metric-card,
.total-sales-card,
.activity-summary-card {
  border-radius: 10px !important;
  padding: 10px !important;
}

.tile-head,
.metric-head,
.card-head {
  gap: 8px !important;
}

.tile-head i,
.metric-head i,
.card-head i {
  border-radius: 8px !important;
  font-size: 13px !important;
  height: 30px !important;
  width: 30px !important;
}

.tile-head h2,
.metric-card h2,
.total-sales-card h2,
.activity-summary-card h2 {
  font-size: 18px !important;
  line-height: 1.15 !important;
}

.tile-head p,
.metric-card p,
.total-sales-card p,
.activity-summary-card p {
  font-size: 11.5px !important;
  line-height: 1.3 !important;
}

.tile-metrics,
.metric-grid,
.summary-grid,
.activity-grid {
  gap: 7px !important;
  margin: 9px 0 !important;
}

.tile-metrics > div,
.metric-grid > div,
.summary-grid > div,
.activity-grid > div {
  border-radius: 8px !important;
  padding: 7px !important;
}

.tile-metrics span,
.metric-grid span,
.summary-grid span,
.activity-grid span {
  font-size: 10.5px !important;
  line-height: 1.2 !important;
}

.tile-metrics strong,
.metric-grid strong,
.summary-grid strong,
.activity-grid strong {
  font-size: 15px !important;
  line-height: 1.15 !important;
}

.progress,
.progress-track,
.tile-progress {
  height: 7px !important;
}

.progress-label,
.tile-progress-label {
  font-size: 11px !important;
  margin-top: 5px !important;
}

.dashboard-tabs,
.tab-switcher {
  border-radius: 10px !important;
  gap: 6px !important;
  margin: 10px 0 !important;
  padding: 5px !important;
}

.dashboard-tabs a,
.dashboard-tabs button,
.tab-switcher a,
.tab-switcher button {
  min-height: 30px !important;
  padding: 6px 10px !important;
}

.bld-sales-card {
  border-radius: 10px !important;
  margin-bottom: 9px !important;
}

.bld-sales-card summary {
  padding: 9px 10px !important;
}

.bld-summary-main {
  gap: 8px !important;
  grid-template-columns: 32px 36px minmax(0, 1fr) auto !important;
}

.leaderboard-rank {
  border-radius: 8px !important;
  font-size: 12px !important;
  height: 32px !important;
  width: 32px !important;
}

.bld-avatar {
  border-radius: 10px !important;
  font-size: 14px !important;
  height: 36px !important;
  width: 36px !important;
}

.bld-summary-main h2 {
  font-size: 15px !important;
  line-height: 1.15 !important;
}

.bld-summary-main p {
  font-size: 11px !important;
}

.bld-total {
  font-size: 16px !important;
}

.bld-compare-grid,
.bld-segment-grid {
  gap: 7px !important;
  margin: 8px 0 !important;
}

.bld-compare-grid > div,
.bld-segment-card {
  border-radius: 8px !important;
  padding: 7px !important;
}

.bld-segment-card h3 {
  font-size: 13px !important;
  margin-bottom: 6px !important;
}

.bld-bar {
  height: 12px !important;
}

.bld-bar-label,
.bld-segment-card span,
.bld-segment-card small {
  font-size: 10.5px !important;
}

.form-grid,
.compact-grid {
  gap: 10px !important;
}

.login-card,
.auth-card {
  max-width: 420px !important;
  padding: 16px !important;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr !important;
  }

  .sidebar {
    max-height: none;
    overflow: visible;
  }

  .sidebar .nav {
    display: block !important;
  }

  .content {
    padding: 12px !important;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .analytics-grid {
    grid-template-columns: 1fr !important;
  }
}

/* RO MIS app-icon navigation and collapsible dashboard cards */
body {
  overflow-x: hidden;
}

.shell {
  display: block !important;
  min-height: 100vh;
}

.content {
  margin: 0 auto;
  max-width: 1480px;
  padding: 14px 18px 24px !important;
}

.topbar {
  align-items: center !important;
  border-radius: 12px !important;
  display: flex !important;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar h1 {
  max-width: min(60vw, 760px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-launcher {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 12px;
}

.app-launcher .app-folder {
  background: color-mix(in srgb, var(--mac-bg-elevated) 88%, transparent);
  border: 1px solid var(--mac-divider);
  border-radius: 12px;
  box-shadow: var(--mac-shadow-1);
  min-width: 0;
  overflow: hidden;
}

.app-launcher .app-folder summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 9px;
  list-style: none;
  min-height: 48px;
  padding: 8px 10px;
}

.app-launcher .app-folder summary::-webkit-details-marker {
  display: none;
}

.app-launcher .app-folder summary::after {
  color: var(--mac-text-tertiary);
  content: "\f078";
  font-family: "Font Awesome 6 Free";
  font-size: 10px;
  font-weight: 900;
  margin-left: auto;
  transition: transform .16s ease;
}

.app-launcher .app-folder[open] summary::after {
  transform: rotate(180deg);
}

.app-launcher .app-folder summary > span:last-child {
  color: var(--mac-text);
  font-size: 13px;
  font-weight: 850;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-launcher .app-folder-icon {
  align-items: center;
  border-radius: 11px;
  box-shadow: 0 8px 18px rgba(10, 132, 255, .18);
  color: #fff;
  display: inline-flex;
  flex: 0 0 34px;
  font-size: 15px;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.app-launcher .app-icon-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
  padding: 0 10px 10px;
}

.app-launcher .app-icon-grid a {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--mac-text-secondary);
  display: grid;
  gap: 5px;
  justify-items: center;
  min-height: 74px;
  padding: 7px 5px;
  text-align: center;
  text-decoration: none !important;
}

.app-launcher .app-icon-grid a:hover {
  background: color-mix(in srgb, var(--mac-accent) 10%, transparent);
  border-color: color-mix(in srgb, var(--mac-accent) 16%, transparent);
  color: var(--mac-text);
  text-decoration: none !important;
}

.app-launcher .app-icon-grid a i {
  align-items: center;
  background: linear-gradient(135deg, var(--mac-accent), #5ac8fa);
  border-radius: 12px;
  box-shadow: 0 7px 16px rgba(10, 132, 255, .18);
  color: #fff;
  display: inline-flex;
  font-size: 15px;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.app-launcher .app-icon-grid a span {
  color: inherit;
  font-size: 10.5px;
  font-weight: 750;
  line-height: 1.12;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.collapsible-card {
  overflow: hidden;
}

.collapsible-card > summary {
  cursor: pointer;
  display: block;
  list-style: none;
}

.collapsible-card > summary::-webkit-details-marker {
  display: none;
}

.collapsible-card .tile-head {
  align-items: center;
}

.collapsed-metrics {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  margin: 9px 0;
}

.collapsed-metrics > div {
  background: color-mix(in srgb, var(--mac-bg-app) 78%, #fff);
  border: 1px solid var(--mac-divider);
  border-radius: 8px;
  min-width: 0;
  padding: 7px 8px;
}

.collapsed-metrics span,
.collapsed-metrics small {
  color: var(--mac-text-secondary);
  display: block;
  font-size: 10.5px;
  font-weight: 750;
  line-height: 1.2;
}

.collapsed-metrics strong {
  color: var(--tile-accent, var(--mac-accent));
  display: block;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.15;
  margin: 2px 0;
}

.collapsible-card .analytics-progress + .analytics-progress {
  margin-top: 7px;
}

.collapsible-card .analytics-progress-row {
  gap: 8px;
}

.expand-hint {
  align-items: center;
  color: var(--mac-text-tertiary);
  display: inline-flex;
  font-size: 10.5px;
  font-weight: 800;
  gap: 5px;
  margin-top: 8px;
}

.collapsible-card[open] .expand-hint i {
  transform: rotate(180deg);
}

.collapsible-body {
  border-top: 1px solid var(--mac-divider);
  margin-top: 10px;
  padding-top: 10px;
}

.analytics-tile.collapsible-card,
.analytics-total-card.collapsible-card {
  min-width: 0;
}

.analytics-grid {
  align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
}

.analytics-total-card .analytics-progress-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .app-launcher {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .content {
    padding: 10px !important;
  }

  .topbar {
    position: static;
  }

  .topbar h1 {
    max-width: 100%;
    white-space: normal;
  }

  .app-launcher {
    grid-template-columns: 1fr;
  }

  .analytics-total-card .analytics-progress-row,
  .analytics-progress-row {
    grid-template-columns: 1fr;
  }
}

/* FOC-style RO MIS launcher shell */
body {
  background:
    radial-gradient(circle at 12% 18%, rgba(10, 132, 255, .08), transparent 34rem),
    linear-gradient(135deg, #eef6f6 0%, #f5f7fa 48%, #eef0f7 100%) !important;
}

.ro-app-bar {
  align-items: center;
  background: linear-gradient(100deg, #0f2f5f 0%, #1a4f95 52%, #2569b8 100%);
  box-shadow: 0 2px 16px rgba(15, 42, 82, .30);
  color: #fff;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  min-height: 62px;
  padding: 0 34px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.ro-app-brand {
  align-items: center;
  color: #fff !important;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 8px;
  min-height: 42px;
  text-decoration: none !important;
}

.ro-app-brand span {
  align-items: center;
  background: rgba(255,255,255,.18);
  border-radius: 9px;
  color: #fff;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  height: 30px;
  justify-content: center;
  width: 34px;
}

.ro-app-brand strong {
  color: #fff;
  font-size: 16px;
  font-weight: 850;
  letter-spacing: .2px;
}

/* Account dropdown (change password + logout). */
.ro-user-menu { position: relative; }
.ro-user-menu > summary {
  align-items: center;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  list-style: none;
  padding: 5px 12px 5px 5px;
}
.ro-user-menu > summary::-webkit-details-marker { display: none; }
.ro-user-menu > summary:hover { background: rgba(255,255,255,.24); }
.ro-user-avatar {
  align-items: center;
  background: #fff;
  border-radius: 50%;
  color: #12335f;
  display: inline-flex;
  font-size: 14px;
  height: 30px;
  justify-content: center;
  width: 30px;
}
.ro-user-caret { font-size: 11px; opacity: .9; transition: transform .15s ease; }
.ro-user-menu[open] > summary .ro-user-caret { transform: rotate(180deg); }
.ro-user-dropdown {
  background: #fff;
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(15, 42, 82, .24);
  display: grid;
  gap: 3px;
  min-width: 212px;
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 60;
}
.ro-user-dropdown form { margin: 0; }
.ro-user-dropdown a,
.ro-user-dropdown button {
  align-items: center;
  background: transparent !important;
  border: 0 !important;
  border-radius: 9px !important;
  box-shadow: none !important;
  color: #26384c !important;
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 750;
  gap: 10px;
  min-height: 0 !important;
  padding: 10px 11px !important;
  text-align: left;
  text-decoration: none !important;
  width: 100%;
}
.ro-user-dropdown a:hover,
.ro-user-dropdown button:hover { background: #eef4fc !important; transform: none !important; }
.ro-user-dropdown a i { color: #1a4f95; width: 16px; text-align: center; }
.ro-user-dropdown button i { color: #be123c; width: 16px; text-align: center; }

/* Logged-in user banner below the navbar. */
.ro-user-banner {
  align-items: center;
  background: #eef3fb;
  border-bottom: 1px solid #dbe6f5;
  color: #3a4c63;
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 8px;
  padding: 8px 34px;
}
.ro-user-banner-name { color: #12335f; font-weight: 850; }
.ro-user-banner-name i { color: #1a4f95; margin-right: 6px; }
.ro-user-banner-role { color: #5a6b82; font-weight: 700; }
.ro-user-banner-sep { color: #a7b6cb; }

/* Breadcrumb navigation. */
.breadcrumb-bar { align-items: center; color: #6a7a90; display: flex; flex-wrap: wrap; font-size: 12.5px; font-weight: 700; gap: 8px; margin: 0 0 8px; }
.breadcrumb-bar a { align-items: center; color: #1a4f95 !important; display: inline-flex; gap: 5px; text-decoration: none !important; }
.breadcrumb-bar a:hover { text-decoration: none !important; }
.breadcrumb-sep { color: #b7c2d2; font-size: 9px; }
.breadcrumb-current { color: #33475f; }

.ro-top-links {
  align-items: stretch;
  display: flex;
  flex: 1 1 auto;
  gap: 4px;
  justify-content: center;
  min-width: 0;
}

.ro-top-links a {
  align-items: center;
  border-radius: 7px;
  color: rgba(255,255,255,.82) !important;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  text-decoration: none !important;
  white-space: nowrap;
}

.ro-top-links a:hover {
  background: rgba(255,255,255,.13);
  color: #fff !important;
}

.ro-user-tools {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 8px;
  margin-left: auto;
}

.ro-user-tools form {
  margin: 0;
}

.ro-language-switcher,
.login-language-switcher {
  align-items: center;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px;
  color: #fff;
  display: inline-flex;
  gap: 5px;
  min-height: 32px;
  padding: 3px 7px;
}

.ro-language-switcher select,
.login-language-switcher select {
  appearance: auto;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: inherit !important;
  cursor: pointer;
  font-size: 12px !important;
  font-weight: 800;
  height: auto !important;
  min-height: 24px !important;
  padding: 0 2px !important;
  width: auto !important;
}

.ro-language-switcher option { color: #172b4d; }
.login-language-switcher { background:#fff;border-color:#ced9e8;color:#002060;position:fixed;right:18px;top:18px;z-index:20;box-shadow:0 5px 18px rgba(0,32,96,.12)}
html[lang="hi"] body { font-family:"Noto Sans Devanagari","Mangal","Nirmala UI","Segoe UI",sans-serif; }

.ro-inbox-link {
  align-items: center;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px;
  color: #fff !important;
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  gap: 7px;
  min-height: 32px;
  padding: 5px 10px;
  position: relative;
  text-decoration: none !important;
}

.ro-inbox-link:hover { background: rgba(255,255,255,.2); }
.ro-inbox-count {
  align-items: center;
  background: #ef4444;
  border: 2px solid #173b38;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 10px;
  height: 20px;
  justify-content: center;
  min-width: 20px;
  padding: 0 5px;
}

.ro-user-pill {
  align-items: center;
  color: rgba(255,255,255,.86);
  display: inline-flex;
  font-size: 12px;
  font-weight: 750;
  gap: 6px;
}

.ro-logout {
  background: rgba(255,255,255,.16) !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  border-radius: 10px !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.10) !important;
  color: #fff !important;
  gap: 6px !important;
  min-height: 32px !important;
  padding: 5px 10px !important;
}

.ro-logout i {
  font-size: 13px;
}

.ro-logout span {
  font-size: 12px;
  font-weight: 850;
}

/* Reusable maker-checker inbox and task presentation. */
.workflow-inbox-panel + .workflow-inbox-panel { margin-top: 18px; }
.workflow-section-head { align-items: flex-start; display: flex; gap: 20px; justify-content: space-between; margin-bottom: 18px; }
.workflow-section-head h2 { margin: 3px 0 4px; }
.workflow-section-head p { color: #64748b; margin: 0; }
.workflow-eyebrow { color: #2f6fd6; font-size: 11px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.workflow-count-chip, .workflow-status-pill { border-radius: 999px; display: inline-flex; font-size: 11px; font-weight: 900; padding: 6px 10px; white-space: nowrap; }
.workflow-count-chip, .status-pending { background: #fff4d6; color: #945c00; }
.status-approved { background: #dcfce7; color: #166534; }
.status-rejected, .status-cancelled { background: #fee2e2; color: #991b1b; }
.workflow-task-list { border: 1px solid #dbe4ef; border-radius: 14px; overflow: hidden; }
.workflow-task-row { align-items: center; background: #fff; color: #26374a !important; display: grid; gap: 14px; grid-template-columns: 38px minmax(0, 1fr) auto 12px; padding: 14px 16px; text-decoration: none !important; }
.workflow-task-row + .workflow-task-row { border-top: 1px solid #e4eaf1; }
.workflow-task-row:hover { background: #f7faff; }
.workflow-task-icon { align-items: center; background: #eaf2ff; border-radius: 10px; color: #2f6fd6; display: inline-flex; height: 38px; justify-content: center; width: 38px; }
.workflow-task-main { display: flex; flex-direction: column; min-width: 0; }
.workflow-task-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workflow-task-main small { color: #64748b; margin-top: 3px; }
.workflow-empty { align-items: center; color: #64748b; display: flex; gap: 10px; justify-content: center; min-height: 100px; padding: 20px; }
.workflow-empty i { color: #26936d; font-size: 24px; }
.workflow-detail-panel { max-width: 1180px; margin-inline: auto; }
.workflow-metrics { margin: 8px 0 18px; }
.workflow-address { background: #f8fafc; border: 1px solid #e0e7ef; border-radius: 12px; margin: 14px 0; padding: 12px 14px; }
.workflow-address small { color: #64748b; font-weight: 850; text-transform: uppercase; }
.workflow-address p { margin: 5px 0 0; }
.workflow-action-box { background: #f7faff; border: 1px solid #cbdcf7; border-radius: 14px; margin-top: 22px; padding: 16px; }
.workflow-action-box label { display: block; font-weight: 850; margin-bottom: 7px; }
.workflow-action-box textarea { width: 100%; }
.workflow-action-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.workflow-action-buttons form { margin: 0; }
button.workflow-reject-button { background: linear-gradient(180deg,#f15c64,#cf3946) !important; border-color: #b92f3a !important; }
.workflow-status-banner { align-items: center; border: 1px solid; border-radius: 12px; display: flex; gap: 12px; margin: 0 0 18px; padding: 12px 14px; }
.workflow-status-banner > i { font-size: 21px; }
.workflow-status-banner > div { display: flex; flex-direction: column; }
.workflow-status-pending { background: #fffaf0; border-color: #efd38a; color: #795400; }
.workflow-status-approved { background: #f0fdf4; border-color: #86d5a2; color: #166534; }
.workflow-status-rejected { background: #fff5f5; border-color: #efaaaa; color: #991b1b; }
.workflow-waiting { background: #fff4d6; color: #945c00; }
.staff-approver-badge { color: #2f80ed; display: inline-flex; margin-left: 4px; vertical-align: middle; }

@media (max-width: 700px) {
  .ro-inbox-link span { display: none; }
  .workflow-section-head { align-items: stretch; flex-direction: column; gap: 10px; }
  .workflow-task-row { grid-template-columns: 34px minmax(0,1fr) 10px; }
  .workflow-task-row .workflow-status-pill { grid-column: 2; justify-self: start; }
}

.content {
  max-width: 1520px;
  padding: 28px 34px 34px !important;
}

.page-titlebar {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  margin: 0 0 18px !important;
  padding: 0 !important;
  position: static !important;
}

.page-titlebar h1 {
  color: #1f3433 !important;
  font-size: 28px !important;
  font-weight: 900 !important;
}

.page-home-button {
  background: rgba(255,255,255,.92) !important;
  border: 1px solid rgba(49, 91, 88, .20) !important;
  box-shadow: 0 2px 6px rgba(37, 58, 57, .10) !important;
  color: #213735 !important;
}

.ro-home-page .content {
  max-width: 1040px;
  min-height: calc(100vh - 42px);
  padding-top: 54px !important;
}

.ro-home-hero {
  margin: 0 auto 42px;
  text-align: center;
}

.ro-home-hero h1 {
  color: #203735;
  font-size: 32px;
  font-weight: 900;
  margin: 0 0 8px;
}

.ro-home-hero p {
  color: #647b7b;
  font-size: 16px;
  font-weight: 500;
  margin: 0;
}

.ro-home-grid {
  display: grid;
  gap: 38px 54px;
  grid-template-columns: repeat(5, minmax(116px, 1fr));
}

.ro-home-app {
  align-items: center;
  color: #203735 !important;
  display: grid;
  gap: 10px;
  justify-items: center;
  min-width: 0;
  text-align: center;
  text-decoration: none !important;
}

.ro-home-app:hover {
  color: #203735 !important;
  text-decoration: none !important;
}

.ro-home-icon {
  align-items: center;
  background: var(--home-accent);
  border-radius: 24px;
  box-shadow: 0 18px 34px rgba(30, 48, 51, .18);
  color: #fff;
  display: inline-flex;
  font-size: 42px;
  height: 114px;
  justify-content: center;
  transition: transform .15s ease, box-shadow .15s ease;
  width: 114px;
}

/* Dashboard launcher icons always use white on their colored tile. This must
   outrank the global semantic Font Awesome colors used on ordinary controls. */
main .ro-home-app .ro-home-icon i {
  color: #fff !important;
}

.birthday-alert {
  align-items: center;
  background: linear-gradient(100deg, #fff4c8, #ffe39a 48%, #fff4c8);
  border: 1px solid #e8b83e;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(129, 87, 5, .13);
  color: #002060;
  display: flex;
  gap: 12px;
  margin: 0 0 22px;
  overflow: hidden;
  padding: 10px 14px;
}

.birthday-alert-icon {
  align-items: center;
  background: #002060;
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex: 0 0 40px;
  height: 40px;
  justify-content: center;
  position: relative;
  z-index: 1;
  animation: birthday-pulse 1.4s ease-in-out infinite;
}

main .birthday-alert-icon i { color: #fff !important; }

.birthday-marquee { overflow: hidden; width: 100%; }
.birthday-marquee-track {
  align-items: center;
  animation: birthday-scroll 24s linear infinite;
  display: flex;
  gap: 28px;
  min-width: max-content;
  padding-left: 100%;
  white-space: nowrap;
}
.birthday-alert:hover .birthday-marquee-track { animation-play-state: paused; }
.birthday-wish { color: #002060; font-size: 15px; font-weight: 650; }
.birthday-wish strong { color: #8b4300; font-weight: 900; }
.birthday-wish small { color: #002060; font-size: .85em; }
.birthday-separator { color: #b06d00; font-size: 18px; }

@keyframes birthday-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}
@keyframes birthday-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 32, 96, .35); transform: scale(1); }
  50% { box-shadow: 0 0 0 8px rgba(0, 32, 96, 0); transform: scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  .birthday-marquee-track, .birthday-alert-icon { animation: none; }
  .birthday-marquee-track { min-width: 0; padding-left: 0; white-space: normal; }
}

.ro-home-app:hover .ro-home-icon {
  box-shadow: 0 22px 42px rgba(30, 48, 51, .22);
  transform: translateY(-3px);
}

.ro-home-app strong {
  color: #203735;
  display: block;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.15;
}

.ro-home-app small {
  color: #647b7b;
  display: block;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.28;
  max-width: 160px;
}

.app-blue { --home-accent: linear-gradient(135deg, #2f80ed, #5fb1ff); }
.app-green { --home-accent: linear-gradient(135deg, #58c76a, #7adb86); }
.app-teal { --home-accent: linear-gradient(135deg, #347f50, #5fa06e); }
.app-orange { --home-accent: linear-gradient(135deg, #d44d3f, #eb745d); }
.app-purple { --home-accent: linear-gradient(135deg, #a84fe0, #d767e3); }
.app-red { --home-accent: linear-gradient(135deg, #cc3d57, #e96b76); }
.app-slate { --home-accent: linear-gradient(135deg, #8f9096, #b6b6bb); }
.app-pink { --home-accent: linear-gradient(135deg, #d34a87, #ed7ab1); }
.app-indigo { --home-accent: linear-gradient(135deg, #5967d9, #8192ff); }
.app-cyan { --home-accent: linear-gradient(135deg, #0098a6, #38c9cf); }

.panel,
.analytics-tile,
.analytics-total-card,
.bld-sales-card {
  background: rgba(255,255,255,.82) !important;
  border: 1px solid rgba(42, 72, 70, .14) !important;
  box-shadow: 0 2px 7px rgba(28, 48, 48, .08) !important;
}

@media (max-width: 1180px) {
  .ro-home-grid {
    grid-template-columns: repeat(4, minmax(116px, 1fr));
  }

  .ro-top-links {
    justify-content: flex-start;
    overflow-x: auto;
  }
}

@media (max-width: 860px) {
  .ro-app-bar {
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 54px;
    padding: 8px 14px;
    position: static;
  }

  .ro-user-banner { padding: 7px 14px; }

  .ro-top-links {
    order: 3;
    width: 100%;
  }

  .ro-user-tools {
    margin-left: auto;
  }

  .content {
    padding: 18px 14px 24px !important;
  }

  .ro-home-page .content {
    min-height: auto;
    padding-top: 34px !important;
  }

  .ro-home-grid {
    gap: 28px 22px;
    grid-template-columns: repeat(2, minmax(126px, 1fr));
  }

  .ro-home-icon {
    border-radius: 20px;
    font-size: 34px;
    height: 92px;
    width: 92px;
  }
}

/* Grouped app home and metric-card polish */
.ro-home-page .content {
  max-width: 1320px;
}

.ro-home-hero {
  margin-bottom: 26px;
}

.ro-home-sections {
  display: grid;
  gap: 18px;
}

.ro-app-section {
  background: rgba(255, 255, 255, .88);
  border: 1px solid #dfe5ea;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(31, 41, 55, .06);
  padding: 18px 24px 22px;
}

.ro-section-head {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.ro-section-head span {
  color: #667085;
  display: block;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .04em;
  line-height: 1;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.ro-section-head h2 {
  color: #243b3a;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.1;
  margin: 0;
}

.ro-section-head small {
  color: #667085;
  font-size: 13px;
  font-weight: 600;
  padding-top: 3px;
  text-align: right;
}

.ro-section-grid {
  display: grid;
  gap: 16px 22px;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
}

.ro-section-grid .ro-home-app {
  border-radius: 8px;
  gap: 8px;
  min-height: 142px;
  padding: 8px 6px;
}

.ro-section-grid .ro-home-app:hover {
  background: #f7fafc;
}

.ro-section-grid .ro-home-icon {
  border-radius: 18px;
  font-size: 28px;
  height: 78px;
  width: 78px;
}

.ro-section-grid .ro-home-app strong {
  font-size: 13.5px;
}

.ro-section-grid .ro-home-app small {
  font-size: 11.5px;
  max-width: 136px;
}

.analytics-filter-panel,
.analytics-hero,
.analytics-total-card,
.analytics-tile,
.activity-total-card,
.bld-leaderboard-head,
.bld-sales-card,
.panel {
  background: rgba(255,255,255,.92) !important;
  border: 1px solid #dfe5ea !important;
  border-radius: 8px !important;
  box-shadow: 0 1px 3px rgba(31, 41, 55, .06) !important;
}

.analytics-total-card,
.analytics-tile {
  border-top: 1px solid #dfe5ea !important;
}

.analytics-tile .tile-head,
.analytics-total-card .tile-head {
  margin-bottom: 8px;
}

.tile-kicker {
  color: #667085 !important;
  font-size: 11px !important;
  font-weight: 850 !important;
  letter-spacing: .04em !important;
}

.analytics-tile .tile-head h2,
.analytics-total-card .tile-head h2 {
  color: #26374a !important;
  font-size: 24px !important;
  font-weight: 850 !important;
}

.analytics-tile .tile-head i,
.analytics-total-card .tile-head i {
  background: color-mix(in srgb, var(--tile-accent, #2f6fd6) 12%, #fff) !important;
  border-radius: 8px !important;
  color: var(--tile-accent, #2f6fd6) !important;
}

.collapsed-metrics {
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
}

.collapsed-metrics > div,
.tile-metrics > div {
  background: #f9fafb !important;
  border: 1px solid #dfe5ea !important;
  border-radius: 8px !important;
}

.collapsed-metrics strong,
.tile-metrics strong {
  color: var(--tile-accent, #2f6fd6) !important;
  font-size: 20px !important;
}

.analytics-tile .collapsed-metrics,
.analytics-tile .collapsible-body .tile-metrics {
  grid-template-columns: 1fr !important;
}

.analytics-tile .collapsed-metrics > div,
.analytics-tile .collapsible-body .tile-metrics > div,
.analytics-total-card .collapsed-metrics > div,
.analytics-total-card .collapsible-body .tile-metrics > div {
  padding: 10px !important;
}

.analytics-tile .collapsed-metrics strong,
.analytics-tile .tile-metrics strong,
.analytics-total-card .collapsed-metrics strong,
.analytics-total-card .tile-metrics strong {
  font-size: 23px !important;
  line-height: 1.05 !important;
  margin: 2px 0 4px !important;
}

.analytics-tile .collapsed-metrics span,
.analytics-tile .tile-metrics span,
.analytics-total-card .collapsed-metrics span,
.analytics-total-card .tile-metrics span {
  color: #667085 !important;
  font-size: 12px !important;
  font-weight: 850 !important;
}

.analytics-tile .collapsed-metrics small,
.analytics-tile .tile-metrics small,
.analytics-total-card .collapsed-metrics small,
.analytics-total-card .tile-metrics small {
  color: #6b7280 !important;
  font-size: 12.5px !important;
  font-weight: 850 !important;
  line-height: 1.28 !important;
}

.analytics-tile .collapsible-body {
  margin-top: 12px;
  padding-top: 18px;
}

.analytics-tile .expand-hint,
.analytics-total-card .expand-hint {
  color: #2b2f38;
  font-size: 12px;
  font-weight: 900;
}

.progress-track {
  background: #e9edf2 !important;
  height: 6px !important;
}

.progress-track span {
  background: #2f6fd6 !important;
}

.tile-green .progress-track span,
.app-green .progress-track span { background: #4caf66 !important; }
.tile-amber .progress-track span,
.app-orange .progress-track span { background: #f5a33b !important; }
.tile-pink .progress-track span,
.app-pink .progress-track span { background: #d65387 !important; }
.tile-violet .progress-track span,
.app-purple .progress-track span { background: #9b5bd8 !important; }
.tile-cyan .progress-track span,
.app-cyan .progress-track span { background: #22a6b3 !important; }

@media (max-width: 860px) {
  .ro-app-section {
    padding: 14px;
  }

  .ro-section-head {
    display: block;
  }

  .ro-section-head small {
    display: block;
    margin-top: 5px;
    text-align: left;
  }

  .ro-section-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Compact analytics cards and BLD-wise sales cards */
.analytics-grid {
  gap: 12px !important;
  grid-template-columns: repeat(auto-fit, minmax(286px, 1fr)) !important;
}

.analytics-tile,
.analytics-total-card {
  border-radius: 8px !important;
  padding: 12px !important;
}

.analytics-tile .tile-head,
.analytics-total-card .tile-head {
  align-items: flex-start;
  margin-bottom: 7px;
}

.analytics-tile .tile-head h2,
.analytics-total-card .tile-head h2 {
  font-size: 22px !important;
  line-height: 1.05 !important;
  margin-top: 3px !important;
}

.analytics-tile .tile-head i,
.analytics-total-card .tile-head i {
  height: 36px !important;
  width: 36px !important;
}

.analytics-tile .collapsed-metrics,
.analytics-tile .collapsible-body .tile-metrics {
  gap: 8px !important;
  margin: 8px 0 !important;
}

.analytics-tile .collapsed-metrics > div,
.analytics-tile .collapsible-body .tile-metrics > div,
.analytics-total-card .collapsed-metrics > div,
.analytics-total-card .collapsible-body .tile-metrics > div {
  border-radius: 8px !important;
  padding: 9px 11px !important;
}

.analytics-tile .collapsed-metrics span,
.analytics-tile .tile-metrics span,
.analytics-total-card .collapsed-metrics span,
.analytics-total-card .tile-metrics span {
  font-size: 11.5px !important;
}

.analytics-tile .collapsed-metrics strong,
.analytics-tile .tile-metrics strong,
.analytics-total-card .collapsed-metrics strong,
.analytics-total-card .tile-metrics strong {
  font-size: 21px !important;
  line-height: 1 !important;
}

.analytics-tile .collapsed-metrics small,
.analytics-tile .tile-metrics small,
.analytics-total-card .collapsed-metrics small,
.analytics-total-card .tile-metrics small {
  font-size: 11.5px !important;
}

.analytics-progress + .analytics-progress {
  margin-top: 7px !important;
}

.progress-label {
  font-size: 11.5px !important;
  margin-bottom: 4px !important;
}

.progress-track {
  height: 6px !important;
}

.expand-hint {
  font-size: 11.5px !important;
  margin-top: 8px !important;
}

.bld-leaderboard-head {
  padding: 12px !important;
}

.bld-leaderboard-head h2 {
  font-size: 18px !important;
}

.bld-sales-list.bld-leaderboard {
  display: grid !important;
  gap: 12px !important;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.bld-sales-card {
  border: 1px solid #dfe5ea !important;
  border-left: 1px solid #dfe5ea !important;
  border-radius: 8px !important;
  box-shadow: 0 1px 3px rgba(31, 41, 55, .06) !important;
}

.bld-sales-card summary {
  padding: 12px !important;
}

.bld-summary-main {
  align-items: start !important;
  gap: 8px !important;
  grid-template-columns: 28px 34px minmax(0, 1fr) !important;
}

.leaderboard-rank {
  border-radius: 7px !important;
  font-size: 11px !important;
  height: 28px !important;
  width: 28px !important;
}

.bld-avatar {
  border-radius: 9px !important;
  border-width: 0 !important;
  box-shadow: none !important;
  font-size: 13px !important;
  height: 34px !important;
  width: 34px !important;
}

.bld-summary-main h2 {
  color: #26374a !important;
  font-size: 15px !important;
  line-height: 1.1 !important;
  margin: 1px 0 2px !important;
}

.bld-summary-main small,
.bld-total-number span,
.bld-total-number small,
.bld-compare-grid span,
.bld-compare-grid small,
.bld-bar-row span,
.bld-segment-chip small {
  font-size: 11px !important;
  line-height: 1.25 !important;
}

.bld-total-number {
  grid-column: 1 / -1;
  min-width: 0 !important;
  padding: 9px 11px !important;
  text-align: left !important;
}

.bld-total-number strong {
  font-size: 21px !important;
  line-height: 1 !important;
}

.bld-compare-grid {
  gap: 8px !important;
  grid-template-columns: 1fr !important;
  margin: 8px 0 !important;
}

.bld-compare-grid > div {
  background: #f9fafb !important;
  border: 1px solid #dfe5ea !important;
  border-radius: 8px !important;
  padding: 9px 11px !important;
}

.bld-compare-grid strong {
  color: var(--tile-accent, #2f6fd6) !important;
  font-size: 20px !important;
  line-height: 1 !important;
}

.bld-bars {
  display: grid;
  gap: 7px;
  margin: 8px 0;
}

.bld-bar-row {
  display: grid;
  gap: 5px;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
}

.bld-bar-row strong {
  font-size: 11px !important;
}

.bld-bar-track {
  height: 6px !important;
}

.bld-segment-breakdown {
  border-top: 1px solid #dfe5ea;
  margin: 0 12px 12px;
  padding-top: 10px;
}

.bld-segment-breakdown h3 {
  color: #26374a;
  font-size: 13px !important;
  margin-bottom: 8px !important;
}

.bld-segment-grid {
  gap: 8px !important;
  grid-template-columns: 1fr !important;
}

.bld-segment-chip {
  background: #f9fafb !important;
  border: 1px solid #dfe5ea !important;
  border-radius: 8px !important;
  padding: 8px 10px !important;
}

@media (max-width: 720px) {
  .analytics-grid,
  .bld-sales-list.bld-leaderboard {
    grid-template-columns: 1fr !important;
  }
}

/* App-wide link treatment: use colour, background and focus outlines for
   interaction feedback without adding underlines on hover/focus. */
html body a,
html body a:hover,
html body a:focus,
html body a:focus-visible,
html body a:active {
  text-decoration: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   MODERN ANALYTICS DASHBOARD ENHANCEMENTS  (appended → wins the cascade)
   Re-skins Sales Analytics + Activity Dashboard with a vibrant, layered
   "glass + gradient" aesthetic. Markup is untouched — every rule keys off
   the analytics-specific classes that only exist on those two pages.
═══════════════════════════════════════════════════════════════════════ */

/* Each card derives a smooth accent gradient from its solid --tile-accent
   (set per tone in app.css: tile-blue/green/amber/pink/violet/cyan, the
   green total card, and the blue/gold/silver/bronze leaderboard ranks). */
.analytics-tile,
.analytics-total-card,
.bld-sales-card {
  /* Derive a gradient + glow from each card's own --tile-accent (set per
     tone in app.css). Must NOT redefine --tile-accent here or the tone
     colors would be flattened to the fallback. */
  --tile-grad: linear-gradient(135deg,
      var(--tile-accent, #2f6fd6),
      color-mix(in srgb, var(--tile-accent, #2f6fd6) 55%, #ffffff));
  --tile-glow: color-mix(in srgb, var(--tile-accent, #2f6fd6) 38%, transparent);
}

/* ── Hero → immersive gradient banner ──────────────────────────────── */
.analytics-hero {
  position: relative;
  overflow: hidden;
  border: none !important;
  border-radius: 18px !important;
  background: linear-gradient(120deg, #4f46e5 0%, #2f6fd6 46%, #0ea5e9 100%) !important;
  box-shadow: 0 16px 38px rgba(47, 111, 214, .30) !important;
  color: #fff !important;
}
.analytics-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 86% -30%, rgba(255, 255, 255, .28), transparent 46%),
    radial-gradient(circle at 4% 130%, rgba(255, 255, 255, .14), transparent 42%);
  pointer-events: none;
}
.analytics-hero > * { position: relative; z-index: 1; }
.analytics-hero h2 { color: #fff !important; letter-spacing: -.02em; }
.analytics-hero p { color: rgba(255, 255, 255, .86) !important; }
.analytics-hero .eyebrow { color: rgba(255, 255, 255, .82) !important; }
.analytics-code-box {
  background: rgba(255, 255, 255, .15) !important;
  border: 1px solid rgba(255, 255, 255, .30) !important;
  border-radius: 14px !important;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.analytics-code-box span { color: rgba(255, 255, 255, .80) !important; }
.analytics-code-box strong { color: #fff !important; }

/* ── KPI tiles → glass card, gradient accent rail, hover lift ──────── */
.analytics-tile,
.analytics-total-card {
  position: relative;
  border: 1px solid rgba(31, 41, 55, .08) !important;
  border-radius: 16px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(255, 255, 255, .92)) !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 26px rgba(16, 24, 40, .07) !important;
  transition: transform .2s ease, box-shadow .2s ease;
}
.analytics-tile::before,
.analytics-total-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--tile-grad);
  z-index: 2;
}
.analytics-tile:hover,
.analytics-total-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 2px 4px rgba(16, 24, 40, .05), 0 18px 40px rgba(16, 24, 40, .13) !important;
}

/* Icon chip → gradient fill, soft colored glow */
.analytics-tile .tile-head i,
.analytics-total-card .tile-head i {
  background: var(--tile-grad) !important;
  color: #fff !important;
  height: 40px !important;
  width: 40px !important;
  border-radius: 12px !important;
  box-shadow: 0 6px 15px var(--tile-glow);
}
.analytics-tile .tile-head h2,
.analytics-total-card .tile-head h2 { letter-spacing: -.02em; }

/* Metric chips → faint tonal tint, crisp numbers */
.analytics-tile .collapsed-metrics > div,
.analytics-tile .collapsible-body .tile-metrics > div,
.analytics-total-card .collapsed-metrics > div,
.analytics-total-card .collapsible-body .tile-metrics > div {
  background: color-mix(in srgb, var(--tile-accent) 5%, #f8fafc) !important;
  border: 1px solid color-mix(in srgb, var(--tile-accent) 13%, #e8edf2) !important;
  border-radius: 12px !important;
}
.collapsed-metrics strong,
.tile-metrics strong,
.bld-total-number strong,
.bld-compare-grid strong {
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

/* ── Progress bars → rounded gradient fill that grows on load ──────── */
.analytics-tile .progress-track,
.analytics-total-card .progress-track,
.bld-segment-chip .progress-track {
  background: rgba(16, 24, 40, .08) !important;
  height: 9px !important;
  border-radius: 999px !important;
}
.analytics-tile .progress-track span,
.analytics-total-card .progress-track span,
.bld-segment-chip .progress-track span {
  background: var(--tile-grad) !important;
  border-radius: 999px !important;
  box-shadow: 0 1px 4px var(--tile-glow);
  transform-origin: left center;
  animation: roBarGrow .9s cubic-bezier(.22, 1, .36, 1) both;
}
.bld-bar-track {
  background: rgba(16, 24, 40, .08) !important;
  height: 9px !important;
  border-radius: 999px !important;
}
.bld-bar-track span {
  border-radius: 999px !important;
  transform-origin: left center;
  animation: roBarGrow .9s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes roBarGrow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@media (prefers-reduced-motion: reduce) {
  .analytics-tile .progress-track span,
  .analytics-total-card .progress-track span,
  .bld-segment-chip .progress-track span,
  .bld-bar-track span { animation: none; }
}

/* ── Tab switcher → frosted pill with gradient active state ────────── */
.analytics-tab-switcher {
  background: rgba(255, 255, 255, .72) !important;
  border: 1px solid rgba(31, 41, 55, .08) !important;
  border-radius: 14px !important;
  box-shadow: 0 4px 14px rgba(16, 24, 40, .06) !important;
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
}
.analytics-tab-switcher label {
  border-radius: 10px !important;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
#tab-segment-sales:checked ~ .analytics-tab-switcher label[for="tab-segment-sales"],
#tab-bld-sales:checked ~ .analytics-tab-switcher label[for="tab-bld-sales"] {
  background: linear-gradient(135deg, #2f6fd6, #0ea5e9) !important;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(47, 111, 214, .30) !important;
}

/* ── Filter panel apply button → gradient call-to-action ───────────── */
.analytics-filter-form button {
  background: linear-gradient(135deg, #2f6fd6, #0ea5e9) !important;
  border: none !important;
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(47, 111, 214, .26) !important;
}
.analytics-filter-form button:hover {
  filter: brightness(1.05);
  box-shadow: 0 9px 22px rgba(47, 111, 214, .34) !important;
}

/* ── BLD leaderboard → medal accents, gradient avatars + rank pills ── */
.leaderboard-card.rank-1 { --tile-accent: #e0a106; }
.leaderboard-card.rank-2 { --tile-accent: #8a94a6; }
.leaderboard-card.rank-3 { --tile-accent: #c2772f; }

.bld-sales-card {
  position: relative;
  border: 1px solid rgba(31, 41, 55, .08) !important;
  border-left: 1px solid rgba(31, 41, 55, .08) !important;
  border-radius: 16px !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 26px rgba(16, 24, 40, .07) !important;
  transition: transform .2s ease, box-shadow .2s ease;
}
.bld-sales-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--tile-grad);
  z-index: 2;
}
.bld-sales-card:hover,
.bld-sales-card[open] {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(16, 24, 40, .05), 0 16px 36px rgba(16, 24, 40, .12) !important;
}
.leaderboard-rank {
  background: var(--tile-grad) !important;
  border: none !important;
  color: #fff !important;
  box-shadow: 0 5px 12px var(--tile-glow);
}
.leaderboard-rank span,
.leaderboard-rank i { color: #fff !important; }
.bld-avatar {
  background: var(--tile-grad) !important;
  box-shadow: 0 5px 12px var(--tile-glow) !important;
}
.bld-total-number {
  background: color-mix(in srgb, var(--tile-accent) 8%, #f8fafc) !important;
  border: 1px solid color-mix(in srgb, var(--tile-accent) 16%, #e8edf2) !important;
  border-radius: 12px !important;
}
.bld-total-number strong { color: var(--tile-accent) !important; }
.bld-compare-grid > div,
.bld-segment-chip {
  border-radius: 12px !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   COMPARATIVE BLD LEADERBOARD  (hover/focus to reveal the full breakdown)
   Vertical ranked list; each row's current-vs-historical bars share one
   board-wide scale so BLDs are directly comparable. The detail panel
   (month / historical figures + per-segment performance) expands smoothly
   on hover — and on keyboard focus / tap for touch + a11y.
═══════════════════════════════════════════════════════════════════════ */

/* Single-column ranked list = a true leaderboard */
.bld-sales-list.bld-leaderboard {
  grid-template-columns: 1fr !important;
  gap: 10px !important;
}

.bld-sales-card {
  cursor: pointer;
  outline: none;
}
.bld-sales-card:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tile-accent, #2f6fd6) 38%, transparent),
              0 16px 36px rgba(16, 24, 40, .13) !important;
}

.bld-summary { padding: 12px 14px; }

/* Always-visible comparative row: rank · avatar · name · current total */
.bld-summary-main {
  align-items: center !important;
  gap: 10px !important;
  grid-template-columns: 34px 40px minmax(0, 1fr) auto !important;
}
.bld-identity { min-width: 0; }
.bld-identity h2 {
  color: #26374a !important;
  font-size: 15px !important;
  line-height: 1.15 !important;
  margin: 1px 0 2px !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bld-total-number {
  grid-column: auto !important;
  min-width: 124px !important;
  text-align: right !important;
}

/* Comparative bars stay visible — they are the leaderboard's "compare" view */
.bld-bars-compare { margin: 10px 0 8px !important; }
.bld-bar-row {
  grid-template-columns: 70px minmax(0, 1fr) auto !important;
  gap: 8px !important;
}
.bld-bars-compare .bld-bar-track { height: 10px !important; }

/* Hover hint — fades out as the panel opens */
.bld-hover-hint {
  align-items: center;
  color: var(--mac-text-tertiary, #94a0ad);
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  gap: 6px;
  margin-top: 2px;
  transition: opacity .2s ease;
}
.bld-hover-hint i { transition: transform .25s ease; }
.bld-sales-card:hover .bld-hover-hint,
.bld-sales-card:focus-within .bld-hover-hint { opacity: 0; }

/* Collapsible detail panel — revealed on hover / focus / tap */
.bld-details {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height .35s cubic-bezier(.22, 1, .36, 1), opacity .25s ease;
}
.bld-sales-card:hover .bld-details,
.bld-sales-card:focus-within .bld-details {
  max-height: 1000px;
  opacity: 1;
}

/* Detail content laid out wide (full-width row gives us the room) */
.bld-details .bld-compare-grid {
  border-top: 1px solid #e9edf2;
  gap: 10px !important;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
  margin: 0 !important;
  padding: 12px 14px 0 !important;
}
.bld-details .bld-segment-breakdown {
  border-top: 1px solid #e9edf2;
  margin: 12px 0 0 !important;
  padding: 12px 14px 14px !important;
}
.bld-details .bld-segment-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important;
}

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

@media (max-width: 640px) {
  .bld-summary-main {
    grid-template-columns: 30px 36px minmax(0, 1fr) !important;
  }
  .bld-total-number {
    grid-column: 1 / -1 !important;
    text-align: left !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   SEGMENT-WISE SALES TILES — 3 compact sections, no expand
   Each section (This Month · Cumulative · Full Year) packs its label+value
   on one row, a single sub line, and the bar + % inline — small fonts,
   horizontal layout, so the card stays short.
═══════════════════════════════════════════════════════════════════════ */
.analytics-tile.segment-tile,
.analytics-tile.activity-tile,
.analytics-total-card.total-compact {
  display: flex;
  flex-direction: column;
}
.analytics-total-card.total-compact { overflow: hidden; }
.analytics-tile.segment-tile .tile-head,
.analytics-tile.activity-tile .tile-head,
.analytics-total-card.total-compact .tile-head {
  margin-bottom: 8px !important;
}
.analytics-tile.segment-tile .tile-head h2,
.analytics-tile.activity-tile .tile-head h2,
.analytics-total-card.total-compact .tile-head h2 {
  font-size: 18px !important;
}

/* Total Sales card is full-width → lay its 3 sections in a row */
.analytics-total-card.total-compact .tile-sections {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 720px) {
  .analytics-total-card.total-compact .tile-sections {
    grid-template-columns: 1fr;
  }
}

.tile-sections {
  display: grid;
  gap: 6px;
}

.tile-section {
  background: color-mix(in srgb, var(--tile-accent, #2f6fd6) 5%, #f8fafc);
  border: 1px solid color-mix(in srgb, var(--tile-accent, #2f6fd6) 12%, #e8edf2);
  border-radius: 10px;
  padding: 7px 9px;
}

/* Row 1 — label left, value right, on a single line */
.section-top {
  align-items: baseline;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}
.section-label {
  color: #667085;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.section-value {
  color: var(--tile-accent, #2f6fd6);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1.1;
  white-space: nowrap;
}

/* Row 2 — single muted sub line */
.section-sub {
  color: #6b7280;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.2;
  margin: 1px 0 5px;
}

/* Row 3 — bar + percent on one horizontal line */
.section-bar {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
}
.section-bar .progress-track {
  height: 7px !important;
  margin: 0 !important;
}
.section-pct {
  color: var(--tile-accent, #2f6fd6);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  min-width: 32px;
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════════════════
   MONTH-WISE SALES — 3rd tab + interactive Apr→Mar line chart
═══════════════════════════════════════════════════════════════════════ */
/* Wire the new tab into the existing radio-driven switcher */
#tab-month-sales:checked ~ .analytics-tab-panels .month-sales-panel { display: block; }
#tab-month-sales:checked ~ .analytics-tab-switcher label[for="tab-month-sales"] {
  background: linear-gradient(135deg, #2f6fd6, #0ea5e9) !important;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(47, 111, 214, .30) !important;
}

.month-chart-head {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 12px;
}
.month-chart-head h2 { font-size: 18px; font-weight: 900; margin: 2px 0 3px; }
.month-chart-head p { color: #667085; font-size: 12px; margin: 0; max-width: 640px; }
.month-chart-legend {
  align-items: center;
  color: #667085;
  display: flex;
  font-size: 12px;
  font-weight: 800;
  gap: 16px;
}
.month-chart-legend span { align-items: center; display: inline-flex; gap: 7px; }
.legend-swatch { border-radius: 2px; display: inline-block; height: 4px; width: 20px; }
.legend-swatch.current { background: #2f6fd6; }
.legend-swatch.historical { background: #ff9f0a; }

.month-chart { position: relative; width: 100%; }
.month-chart-svg { display: block; height: auto; overflow: visible; width: 100%; }
.mc-grid { stroke: #eef1f5; stroke-width: 1; }
.mc-axis-label { fill: #aab2bd; font-size: 10.5px; font-weight: 600; }

/* Area fills fade up */
.mc-area { opacity: 0; animation: mcFade .9s ease .15s forwards; }

/* Historical: thin dashed amber, fades in */
.mc-line-historical {
  fill: none; stroke: #f6a821; stroke-width: 2; stroke-dasharray: 5 5;
  stroke-linecap: round; stroke-linejoin: round;
  opacity: 0; animation: mcFade .8s ease .3s forwards;
}
/* Current: gradient stroke + soft glow, draws itself in */
.mc-line-current {
  fill: none; stroke: url(#mcCurStroke); stroke-width: 3;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1600; stroke-dashoffset: 1600;
  animation: mcDraw 1.15s cubic-bezier(.4, 0, .2, 1) forwards;
}
/* Dots: white core, colored ring, pop in, grow on hover */
.mc-dot {
  cursor: pointer; fill: #fff; stroke-width: 2.5;
  opacity: 0; animation: mcFade .4s ease forwards;
  transition: stroke-width .12s ease;
}
.mc-dot.current { stroke: #2f6fd6; }
.mc-dot.historical { stroke: #f6a821; }
.mc-dot:hover { r: 6; stroke-width: 3.5; }
.mc-hit { cursor: pointer; fill: transparent; }
.mc-hit:hover { fill: rgba(47, 111, 214, .05); }

@keyframes mcDraw { to { stroke-dashoffset: 0; } }
@keyframes mcFade { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .mc-area, .mc-line-historical, .mc-dot { animation: none; opacity: 1; }
  .mc-line-current { animation: none; stroke-dashoffset: 0; }
}

.month-tooltip {
  background: #fff;
  border: 1px solid #dfe5ea;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(16, 24, 40, .16);
  display: none;
  font-size: 12px;
  max-width: 290px;
  min-width: 210px;
  padding: 10px 12px;
  position: absolute;
  z-index: 6;
}
.month-tooltip.show { display: block; }
.month-tooltip .mt-head {
  align-items: center;
  display: flex;
  font-size: 14px;
  font-weight: 900;
  justify-content: space-between;
}
.month-tooltip .mt-close { color: #94a0ad; cursor: pointer; font-size: 18px; line-height: 1; padding: 0 2px; }
.month-tooltip .mt-totals { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; margin: 8px 0; }
.month-tooltip .mt-totals span {
  color: #667085; display: block; font-size: 10.5px; font-weight: 800; text-transform: uppercase;
}
.month-tooltip .mt-totals b { font-size: 15px; }
.month-tooltip .mt-totals div:first-child b { color: #2f6fd6; }
.month-tooltip .mt-totals div:last-child b { color: #d98324; }
.month-tooltip .mt-seg-title {
  color: #667085; font-size: 10.5px; font-weight: 800; margin-bottom: 4px; text-transform: uppercase;
}
.month-tooltip table.mt-seg { border-collapse: collapse; width: 100%; }
.month-tooltip .mt-seg th {
  color: #94a0ad; font-size: 10px; font-weight: 800; padding: 2px 4px; text-align: right; text-transform: uppercase;
}
.month-tooltip .mt-seg th:first-child { text-align: left; }
.month-tooltip .mt-seg td { border-top: 1px solid #f0f2f5; font-size: 11.5px; padding: 2px 4px; text-align: right; }
.month-tooltip .mt-seg td:first-child { font-weight: 700; text-align: left; }
.month-tooltip .mt-empty { color: #94a0ad; text-align: center !important; }

/* ── Daily update CRUD list helpers ─────────────────────────────────── */
.form-head-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.form-head-row h2 { margin: 0 !important; }
.muted-count { color: var(--mac-text-secondary, #8a8a8e); font-size: 12px; font-weight: 600; }
.row-actions { align-items: center; display: flex; gap: 6px; }
.row-actions .inline-form { margin: 0; }
.cell-clip {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
tr.row-active td {
  background: color-mix(in srgb, var(--mac-accent, #2f6fd6) 8%, transparent) !important;
}

/* ── User management ─────────────────────────────────────────────────── */
.access-fieldset {
  border: 1px solid var(--mac-divider, #dfe5ea);
  border-radius: 10px;
  margin: 6px 0 14px;
  padding: 10px 14px 14px;
}
.access-fieldset legend {
  color: #667085;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  padding: 0 6px;
  text-transform: uppercase;
}
.access-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.access-check {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-weight: 700;
  gap: 8px;
}
.access-check input {
  min-height: 0 !important;
  width: auto !important;
}
.status-off {
  background: rgba(255, 59, 48, .12) !important;
  color: #b42318 !important;
}

/* ── Lube report: per-activity summary cards ─────────────────────────── */
.activity-card-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.activity-summary-card {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.92));
  border: 1px solid rgba(31, 41, 55, .08);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 22px rgba(16,24,40,.06);
  padding: 12px 14px;
}
.activity-summary-card .asc-head {
  align-items: flex-start;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 10px;
}
.activity-summary-card .asc-head h3 {
  font-size: 15px;
  font-weight: 900;
  line-height: 1.15;
  margin: 0;
}
.asc-source {
  background: color-mix(in srgb, #2f6fd6 12%, #fff);
  border-radius: 999px;
  color: #2f6fd6;
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  text-transform: uppercase;
  white-space: nowrap;
}
.asc-metrics {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
}
.asc-metrics > div {
  background: #f8fafc;
  border: 1px solid #e8edf2;
  border-radius: 10px;
  padding: 7px 8px;
  text-align: center;
}
.asc-metrics span {
  color: #667085;
  display: block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.asc-metrics strong {
  color: #26374a;
  display: block;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  line-height: 1.1;
}
.asc-metrics small {
  color: #94a0ad;
  font-size: 10px;
  font-weight: 700;
}

.highlight-list { list-style: none; margin: 12px 0 0; padding: 0; }
.highlight-list li {
  align-items: center;
  border-top: 1px solid var(--mac-divider, #e8edf2);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 8px 0;
}
.highlight-list li span { flex: 1; }
.highlight-list .inline-form { margin: 0; }

tr.total-row td {
  background: #eef2f7 !important;
  border-top: 2px solid #c7d0db !important;
  font-weight: 900 !important;
}

/* RO MIS master table/forms: compact macOS panel finish */
.content {
  background:
    radial-gradient(circle at 10% 0%, rgba(47, 111, 214, .08), transparent 28%),
    linear-gradient(180deg, #f7f9fb 0%, #eef2f7 100%) !important;
}
.panel {
  background: rgba(255, 255, 255, .88) !important;
  border: 1.5px solid rgba(148, 163, 184, .34) !important;
  border-radius: 18px !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 18px 42px rgba(31, 41, 55, .08) !important;
  margin-bottom: 14px !important;
  padding: 14px 16px !important;
}
.panel.narrow,
.form-panel {
  max-width: 1080px !important;
}
.panel h2,
.form-head-row h2 {
  color: #1f2937 !important;
  font-size: 18px !important;
  font-weight: 900 !important;
  letter-spacing: 0 !important;
}
.panel form p {
  margin: 0 0 11px !important;
}
.panel label,
.form-panel label {
  color: #374151 !important;
  display: block !important;
  font-size: 12px !important;
  font-weight: 850 !important;
  margin-bottom: 5px !important;
}
.panel input:not([type="checkbox"]):not([type="radio"]),
.panel select,
.panel textarea,
.form-panel input:not([type="checkbox"]):not([type="radio"]),
.form-panel select,
.form-panel textarea {
  background: linear-gradient(180deg, #fff, #f8fafc) !important;
  border: 1.5px solid #cfd8e3 !important;
  border-radius: 12px !important;
  color: #1f2937 !important;
  font-size: 13px !important;
  min-height: 38px !important;
  padding: 8px 11px !important;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease !important;
}
.panel textarea,
.form-panel textarea {
  min-height: 92px !important;
}
.panel select[multiple],
.form-panel select[multiple],
.district-filter-target {
  min-height: 220px !important;
  padding: 8px !important;
}
.panel input:focus,
.panel select:focus,
.panel textarea:focus,
.form-panel input:focus,
.form-panel select:focus,
.form-panel textarea:focus {
  background: #fff !important;
  border-color: #2f80ed !important;
  /* Crisp glowing border rather than a large soft fill. */
  box-shadow: 0 0 0 1.5px #2f80ed, 0 0 6px 1px rgba(47, 128, 237, .35) !important;
  outline: none !important;
}
.toolbar,
.form-actions,
.bulk-actions,
.row-actions,
.actions {
  align-items: center !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 9px !important;
}
button,
.button,
.ro-logout,
.adm-btn-edit,
.adm-btn-delete,
.adm-btn-landing {
  align-items: center !important;
  -webkit-tap-highlight-color: transparent;
  border-radius: 9px !important;
  display: inline-flex !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  gap: 7px !important;
  line-height: 1.1 !important;
  min-height: 32px !important;
  padding: 6px 12px !important;
  text-decoration: none !important;
  transition: box-shadow .15s ease, transform .1s ease, filter .15s ease !important;
}
button,
.button:not(.secondary) {
  background: linear-gradient(180deg, #3f86f6, #2f6fd6) !important;
  border: 1px solid rgba(37, 92, 190, .55) !important;
  color: #fff !important;
  box-shadow: 0 2px 6px rgba(47, 111, 214, .26) !important;
}
button:hover,
.button:not(.secondary):hover { filter: brightness(1.04) !important; box-shadow: 0 4px 12px rgba(47, 111, 214, .30) !important; }
.button.secondary,
button.secondary,
.ro-logout {
  background: #fff !important;
  border: 1px solid rgba(100, 116, 139, .28) !important;
  color: #26374a !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .07) !important;
}

/* Confined focus/active feedback: a border glow ring, not a big filled highlight. */
a, button, summary, .crud-action, .adm-btn-edit, .adm-btn-delete, .adm-btn-landing,
input, select, textarea, label, .lb-remove, .lbu-remove {
  -webkit-tap-highlight-color: transparent;
}
.button:focus-visible,
button:focus-visible,
.ro-user-menu > summary:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(47, 111, 214, .38) !important;
}
/* Clicking an action icon shows a tight glowing border, not a large filled area. */
.crud-action:focus,
.adm-btn-edit:focus,
.adm-btn-delete:focus,
.row-actions a:focus {
  outline: 2px solid rgba(47, 111, 214, .9) !important;
  outline-offset: 1px !important;
  box-shadow: 0 0 7px 1px rgba(47, 111, 214, .4) !important;
}
.button:active,
button:active,
.crud-action:active { transform: translateY(1px) scale(.99) !important; }

/* Contact links + WhatsApp quick button (phone/email in tables and cards). */
.contact-phone { align-items: center; display: inline-flex; gap: 7px; }
.wa-btn {
  align-items: center; background: #25d366 !important; border: 0 !important; border-radius: 6px;
  box-shadow: 0 1px 3px rgba(37, 211, 102, .4) !important; color: #fff !important; display: inline-flex;
  flex: 0 0 auto; height: 20px; justify-content: center; text-decoration: none !important; width: 20px;
}
.wa-btn i { color: #fff !important; font-size: 12px; }
.wa-btn:hover { filter: brightness(1.06); }
.wa-btn:focus { outline: none !important; box-shadow: 0 0 0 2px rgba(37, 211, 102, .95), 0 0 7px 1px rgba(37, 211, 102, .5) !important; }
.actions a {
  align-items: center !important;
  display: inline-flex !important;
  gap: 6px !important;
  margin-right: 8px !important;
  white-space: nowrap !important;
}
.panel table {
  border-radius: 14px !important;
}
/* Tables scroll horizontally on narrow screens instead of overflowing the page. */
.table-wrap {
  border-radius: 14px !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch;
}
.panel table {
  border: 1px solid #dfe5ec !important;
  font-size: 12px !important;
}
.panel th {
  background: #f2f5f9 !important;
  color: #667085 !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  letter-spacing: .03em !important;
  padding: 10px 12px !important;
  text-transform: uppercase !important;
}
.panel td {
  border-top: 1px solid #e7edf4 !important;
  color: #273447 !important;
  padding: 9px 12px !important;
  vertical-align: middle !important;
}
.bulk-panel {
  align-items: center !important;
  display: flex !important;
  gap: 14px !important;
  justify-content: space-between !important;
}
.bulk-panel p {
  color: #667085 !important;
  font-size: 12px !important;
  margin: 2px 0 0 !important;
}
.geo-lookup-button {
  margin-top: 8px !important;
}

/* Centered compact forms with smart two-column rows */
.panel.narrow,
.form-panel {
  margin-left: auto !important;
  margin-right: auto !important;
  width: min(1040px, calc(100vw - 34px)) !important;
}
.panel.narrow > form,
.form-panel > form {
  column-gap: 16px !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(240px, 1fr)) !important;
  row-gap: 10px !important;
}
.panel.narrow > form > p,
.form-panel > form > p {
  margin: 0 !important;
}
.panel.narrow > form > p:has(textarea),
.panel.narrow > form > p:has(select[multiple]),
.panel.narrow > form > p:has(input[type="file"]),
.form-panel > form > p:has(textarea),
.form-panel > form > p:has(select[multiple]),
.form-panel > form > p:has(input[type="file"]),
.panel.narrow > form > .form-actions,
.form-panel > form > .form-actions,
.panel.narrow > form > .access-fieldset,
.form-panel > form > .access-fieldset,
.panel.narrow > form > .text-muted,
.form-panel > form > .text-muted {
  grid-column: 1 / -1 !important;
}
.panel.narrow > form > p:has(input[type="checkbox"]),
.form-panel > form > p:has(input[type="checkbox"]) {
  align-items: center !important;
  display: flex !important;
  gap: 9px !important;
}
.panel.narrow > form > p:has(input[type="checkbox"]) label,
.form-panel > form > p:has(input[type="checkbox"]) label {
  margin: 0 !important;
  order: 2 !important;
}
.panel.narrow > form > p:has(input[type="checkbox"]) input,
.form-panel > form > p:has(input[type="checkbox"]) input {
  order: 1 !important;
}

.date-picker-wrap {
  align-items: stretch !important;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(247,249,252,.96)) !important;
  border: 1.5px solid #cfd8e3 !important;
  border-radius: 13px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 2px 8px rgba(15, 23, 42, .05) !important;
  display: grid !important;
  grid-template-columns: 1fr 42px !important;
  overflow: hidden !important;
  width: 100% !important;
}
.date-picker-wrap:focus-within {
  border-color: #2f80ed !important;
  box-shadow: 0 0 0 4px rgba(47, 128, 237, .14), inset 0 1px 0 rgba(255,255,255,.75) !important;
}
.date-picker-wrap .date-input {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  min-height: 38px !important;
}
.date-picker-button {
  background: linear-gradient(180deg, #ffffff, #eef3f8) !important;
  border: 0 !important;
  border-left: 1px solid #dce3eb !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #425466 !important;
  justify-content: center !important;
  min-height: 38px !important;
  padding: 0 !important;
}
.date-picker-button:hover {
  background: linear-gradient(180deg, #f8fbff, #e7eff8) !important;
  color: #2f6fd6 !important;
}
.native-date-input {
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  position: absolute !important;
  width: 1px !important;
}

.login-page .login-brand-block h1 {
  letter-spacing: 0 !important;
}
.login-page .login-card {
  border: 1.5px solid rgba(148, 163, 184, .36) !important;
  border-radius: 24px !important;
  box-shadow: 0 22px 58px rgba(15, 23, 42, .14) !important;
}

@media (max-width: 760px) {
  .panel.narrow > form,
  .form-panel > form {
    grid-template-columns: 1fr !important;
  }
}

html,
body,
button,
input,
select,
textarea {
  font-family: "Aptos", "Inter", "SF Pro Text", "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif !important;
}

/* Forced password change */
.password-change-panel {
  border-radius: 20px !important;
  margin: 0 auto !important;
  max-width: 980px !important;
  overflow: hidden !important;
  padding: 0 !important;
  width: min(980px, calc(100vw - 36px)) !important;
}

.password-card-head {
  align-items: center !important;
  background:
    linear-gradient(135deg, rgba(47, 111, 214, .12), rgba(35, 174, 137, .10)),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,250,252,.95)) !important;
  border-bottom: 1px solid rgba(148, 163, 184, .24) !important;
  display: flex !important;
  gap: 18px !important;
  justify-content: space-between !important;
  padding: 22px 24px !important;
}

.password-kicker {
  align-items: center !important;
  color: #2f6fd6 !important;
  display: inline-flex !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  gap: 8px !important;
  margin-bottom: 8px !important;
  text-transform: uppercase !important;
}

.password-card-head h2 {
  color: #17212f !important;
  font-size: 24px !important;
  line-height: 1.15 !important;
  margin: 0 !important;
}

.password-card-head p {
  color: #667085 !important;
  font-size: 14px !important;
  margin: 7px 0 0 !important;
}

.password-lock-badge {
  align-items: center !important;
  background: linear-gradient(180deg, #22c58b, #159a72) !important;
  border: 1px solid rgba(21, 154, 114, .34) !important;
  border-radius: 16px !important;
  box-shadow: 0 14px 28px rgba(21, 154, 114, .22) !important;
  color: #fff !important;
  display: flex !important;
  flex: 0 0 auto !important;
  font-size: 24px !important;
  height: 58px !important;
  justify-content: center !important;
  width: 58px !important;
}

.password-change-panel > .password-change-form,
.password-change-panel.form-panel > form,
.password-change-panel > form {
  display: block !important;
  padding: 22px 24px 24px !important;
}

.password-form-grid {
  display: grid !important;
  gap: 22px !important;
  grid-template-columns: minmax(300px, 1.1fr) minmax(280px, .9fr) !important;
}

.password-fields {
  display: grid !important;
  gap: 16px !important;
}

.password-field-block label {
  color: #273447 !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  margin-bottom: 8px !important;
}

.password-input-shell {
  align-items: center !important;
  background: #fff !important;
  border: 1.5px solid #cfd8e3 !important;
  border-radius: 14px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 2px 8px rgba(15, 23, 42, .05) !important;
  display: grid !important;
  grid-template-columns: 1fr 42px !important;
  overflow: hidden !important;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease !important;
}

.password-input-shell:focus-within {
  border-color: #2f80ed !important;
  box-shadow: 0 0 0 4px rgba(47, 128, 237, .14), 0 4px 16px rgba(47, 128, 237, .08) !important;
}

.password-field-block.has-success .password-input-shell {
  border-color: #22a06b !important;
  box-shadow: 0 0 0 4px rgba(34, 160, 107, .12) !important;
}

.password-field-block.has-error .password-input-shell {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, .12) !important;
}

.password-input-shell input {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-size: 15px !important;
  min-height: 46px !important;
  padding: 10px 12px !important;
}

.password-input-shell input:focus {
  border: 0 !important;
  box-shadow: none !important;
}

.password-toggle {
  background: transparent !important;
  border: 0 !important;
  border-left: 1px solid #e4eaf1 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #526173 !important;
  height: 46px !important;
  min-height: 46px !important;
  padding: 0 !important;
}

.password-toggle:hover {
  background: #f2f7ff !important;
  color: #2f6fd6 !important;
  transform: none !important;
}

.password-meter {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 14px !important;
  padding: 12px !important;
}

.password-meter-top {
  align-items: center !important;
  display: flex !important;
  justify-content: space-between !important;
  margin-bottom: 8px !important;
}

.password-meter-top span {
  color: #64748b !important;
  font-size: 12px !important;
  font-weight: 800 !important;
}

.password-meter-top strong {
  color: #17212f !important;
  font-size: 12px !important;
  font-weight: 900 !important;
}

.password-meter-track {
  background: #e6edf5 !important;
  border-radius: 999px !important;
  height: 9px !important;
  overflow: hidden !important;
}

.password-meter-track span {
  background: #94a3b8 !important;
  border-radius: inherit !important;
  display: block !important;
  height: 100% !important;
  transition: width .2s ease, background .2s ease !important;
  width: 0;
}

.password-meter-track span.is-danger { background: #ef4444 !important; }
.password-meter-track span.is-warning { background: #f59e0b !important; }
.password-meter-track span.is-info { background: #3b82f6 !important; }
.password-meter-track span.is-good { background: #10b981 !important; }
.password-meter-track span.is-strong { background: linear-gradient(90deg, #10b981, #22c55e) !important; }

.password-rules-panel {
  background: linear-gradient(180deg, #ffffff, #f8fafc) !important;
  border: 1px solid #dfe7f0 !important;
  border-radius: 16px !important;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .06) !important;
  padding: 16px !important;
}

.password-rules-title {
  align-items: center !important;
  color: #17212f !important;
  display: flex !important;
  font-size: 14px !important;
  font-weight: 900 !important;
  gap: 9px !important;
  margin-bottom: 12px !important;
}

.password-rules-title i {
  color: #2f6fd6 !important;
}

.password-rule-list {
  display: grid !important;
  gap: 9px !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.password-rule-list li {
  align-items: center !important;
  background: #f8fafc !important;
  border: 1px solid #e3eaf2 !important;
  border-radius: 12px !important;
  color: #64748b !important;
  display: flex !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  gap: 9px !important;
  padding: 9px 10px !important;
  transition: background .16s ease, border-color .16s ease, color .16s ease !important;
}

.password-rule-list li i {
  color: #cbd5e1 !important;
  font-size: 13px !important;
}

.password-rule-list li.is-valid {
  background: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
  color: #047857 !important;
}

.password-rule-list li.is-valid i {
  color: #10b981 !important;
}

.password-rule-list li.is-invalid {
  color: #667085 !important;
}

.password-match-hint,
.password-submit-note {
  align-items: center !important;
  color: #667085 !important;
  display: inline-flex !important;
  font-size: 12px !important;
  font-weight: 750 !important;
  gap: 7px !important;
  margin-top: 8px !important;
}

.password-match-hint.is-valid { color: #047857 !important; }
.password-match-hint.is-invalid { color: #dc2626 !important; }

.password-alert {
  background: #fff1f2 !important;
  border: 1px solid #fecdd3 !important;
  border-radius: 14px !important;
  color: #be123c !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  margin-bottom: 16px !important;
  padding: 11px 12px !important;
}

.password-submit-row {
  align-items: center !important;
  border-top: 1px solid #e6edf5 !important;
  display: flex !important;
  gap: 12px !important;
  justify-content: space-between !important;
  margin-top: 22px !important;
  padding-top: 18px !important;
}

.password-submit-row button:disabled {
  background: linear-gradient(180deg, #cbd5e1, #94a3b8) !important;
  border-color: #cbd5e1 !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  opacity: .78 !important;
  transform: none !important;
}

.manager-verified-badge {
  align-items: center !important;
  background: #ecfdf5 !important;
  border: 1px solid #a7f3d0 !important;
  border-radius: 999px !important;
  color: #047857 !important;
  display: inline-flex !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  gap: 5px !important;
  margin-left: 7px !important;
  padding: 4px 8px !important;
  white-space: nowrap !important;
}

.manager-verified-badge i {
  color: #10b981 !important;
}

.sales-area-detail-hero {
  align-items: center !important;
  background: linear-gradient(135deg, color-mix(in srgb, var(--sales-area-color) 16%, #ffffff), #ffffff) !important;
  border: 1px solid color-mix(in srgb, var(--sales-area-color) 34%, #dbe3ed) !important;
  border-radius: 16px !important;
  display: flex !important;
  gap: 16px !important;
  justify-content: space-between !important;
  margin: 14px 0 !important;
  padding: 18px !important;
}

.sales-area-detail-hero h2 {
  color: #111827 !important;
  font-size: 24px !important;
  font-weight: 950 !important;
  margin: 4px 0 !important;
}

.sales-area-detail-hero p {
  color: #536174 !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  margin: 0 !important;
}

.sales-area-color-dot {
  background: var(--sales-area-color) !important;
  border: 3px solid #fff !important;
  border-radius: 999px !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .18) !important;
  display: inline-block !important;
  height: 18px !important;
  width: 18px !important;
}

.sales-area-color-strip {
  align-items: center !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

.sales-area-color-chip {
  align-items: center !important;
  background: color-mix(in srgb, var(--sales-area-color) 14%, #ffffff) !important;
  border: 1px solid color-mix(in srgb, var(--sales-area-color) 42%, #d9e2ee) !important;
  border-radius: 999px !important;
  color: #1f2937 !important;
  display: inline-flex !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  gap: 7px !important;
  padding: 7px 11px !important;
}

.sales-area-color-chip i {
  background: var(--sales-area-color) !important;
  border: 2px solid #fff !important;
  border-radius: 999px !important;
  box-shadow: 0 3px 8px rgba(15, 23, 42, .18) !important;
  display: inline-block !important;
  height: 13px !important;
  width: 13px !important;
}

.sales-area-base-card,
.detail-metric-grid > div {
  background: rgba(255, 255, 255, .82) !important;
  border: 1px solid rgba(148, 163, 184, .26) !important;
  border-radius: 12px !important;
  padding: 12px 14px !important;
}

.sales-area-base-card small,
.detail-metric-grid small {
  color: #64748b !important;
  display: block !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
}

.sales-area-base-card strong,
.detail-metric-grid strong {
  color: #17212f !important;
  font-size: 16px !important;
  font-weight: 950 !important;
}

.detail-metric-grid {
  display: grid !important;
  gap: 10px !important;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  margin: 0 0 14px !important;
}

.detail-chip-section h2 {
  color: #17212f !important;
  font-size: 15px !important;
  font-weight: 950 !important;
}

.detail-chip-list {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin-bottom: 14px !important;
}

.detail-chip {
  background: #f8fafc !important;
  border: 1px solid #dbe3ed !important;
  border-radius: 999px !important;
  color: #26374a !important;
  font-size: 12px !important;
  font-weight: 850 !important;
  padding: 7px 10px !important;
}

.detail-chip.is-base {
  background: color-mix(in srgb, var(--sales-area-color) 20%, #ffffff) !important;
  border-color: var(--sales-area-color) !important;
}

.numeric-input,
#id_initial_target_kl_per_month,
#id_monthly_plan_count,
#id_q1_plan_count,
#id_q2_plan_count,
#id_q3_plan_count,
#id_q4_plan_count,
#id_annual_plan_count,
#id_opening_qty,
#id_quantity {
  text-align: right !important;
}

.table-thumb {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  border: 1px solid #d8e0eb;
  object-fit: cover;
  background: #f4f7fb;
  box-shadow: 0 6px 18px rgba(25, 36, 52, 0.10);
}

.pop-slip-form,
.pop-slip-view,
.pop-inventory-summary {
  display: grid !important;
  gap: 14px !important;
}

.pop-slip-header,
.pop-slip-lines {
  border-radius: 14px !important;
}

.pop-slip-title span,
.pop-lines-head span,
.pop-slip-view-head span,
.pop-inventory-summary span {
  color: #64748b !important;
  display: block !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
}

.pop-slip-title h2,
.pop-lines-head h2,
.pop-slip-view-head h2,
.pop-inventory-summary h2 {
  color: #17212f !important;
  font-size: 22px !important;
  font-weight: 950 !important;
  margin: 2px 0 0 !important;
}

.pop-slip-grid {
  display: grid !important;
  gap: 12px 16px !important;
  /* Compact, left-packed fields instead of a few very wide stretched columns. */
  grid-template-columns: repeat(auto-fill, minmax(230px, 320px)) !important;
  margin-top: 14px !important;
}

.pop-slip-field {
  min-width: 0 !important;
}

.pop-ro-address {
  align-items: baseline;
  background: #f4f8ff;
  border: 1px solid #dbe7fb;
  border-radius: 10px;
  display: flex;
  gap: 10px;
  margin-top: 14px;
  padding: 9px 13px;
}
.pop-ro-address-label { color: #5a6b82; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.pop-ro-address-value { color: #17233a; font-weight: 700; }

.pop-slip-field label {
  color: #374151 !important;
  display: block !important;
  font-size: 12px !important;
  font-weight: 850 !important;
  margin-bottom: 5px !important;
}

.pop-lines-head,
.pop-slip-view-head {
  align-items: center !important;
  display: flex !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin-bottom: 12px !important;
}

.pop-line-table {
  width: 100% !important;
}

.pop-line-table th:nth-child(2),
.pop-line-table td:nth-child(2) {
  text-align: right !important;
  width: 150px !important;
}

.pop-line-table th:last-child,
.pop-line-table td:last-child {
  text-align: center !important;
  width: 72px !important;
}

.unit-pill {
  background: #eef6ff !important;
  border: 1px solid #cfe2ff !important;
  border-radius: 999px !important;
  color: #1f67c1 !important;
  display: inline-flex !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  padding: 5px 8px !important;
}

.delete-holder {
  display: none !important;
}

.icon-button {
  align-items: center !important;
  background: #fff !important;
  border: 1px solid #d8e0eb !important;
  border-radius: 9px !important;
  color: #64748b !important;
  display: inline-flex !important;
  height: 34px !important;
  justify-content: center !important;
  padding: 0 !important;
  width: 34px !important;
}

.icon-button:hover {
  background: #fee2e2 !important;
  border-color: #fecaca !important;
  color: #dc2626 !important;
}

.field-error,
.form-errors {
  color: #dc2626 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
}

.pop-receiver-address,
.pop-slip-footer {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 12px 14px !important;
}

.pop-receiver-address small {
  color: #64748b !important;
  display: block !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
}

.pop-receiver-address p {
  margin: 4px 0 0 !important;
}

.pop-slip-footer {
  display: grid !important;
  gap: 7px !important;
}

.pop-inventory-summary {
  align-items: start !important;
  grid-template-columns: minmax(220px, 1fr) auto !important;
}

.pop-inventory-summary .detail-metric-grid {
  grid-column: 1 / -1 !important;
  margin-top: 0 !important;
}

.pop-inventory-photo {
  width: 88px !important;
  height: 88px !important;
  border: 1px solid #d8e0eb !important;
  border-radius: 12px !important;
  object-fit: cover !important;
}

@media (max-width: 760px) {
  .pop-slip-grid {
    grid-template-columns: 1fr !important;
  }
  .pop-lines-head,
  .pop-slip-view-head {
    align-items: stretch !important;
    flex-direction: column !important;
  }
}

.district-map-selector {
  background: linear-gradient(180deg, #ffffff, #f8fafc) !important;
  border: 1.5px solid #dce6f1 !important;
  border-radius: 16px !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .07) !important;
  display: grid !important;
  gap: 12px !important;
  padding: 14px !important;
  width: 100% !important;
}

.panel.district-map-panel {
  max-width: none !important;
  width: min(1500px, calc(100vw - 34px)) !important;
}

.panel.narrow > form > p.district-map-field-row,
.form-panel > form > p.district-map-field-row {
  display: block !important;
  grid-column: 1 / -1 !important;
}

.panel.narrow > form > .district-map-selector,
.form-panel > form > .district-map-selector {
  grid-column: 1 / -1 !important;
}

.district-map-header,
.district-map-footer {
  align-items: center !important;
  display: flex !important;
  gap: 12px !important;
  justify-content: space-between !important;
}

.district-map-header-actions {
  align-items: center !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  justify-content: flex-end !important;
}

.district-map-header-actions .button {
  min-height: 38px !important;
  padding: 8px 12px !important;
  white-space: nowrap !important;
}

.district-map-header strong {
  color: #17212f !important;
  display: block !important;
  font-size: 15px !important;
  font-weight: 950 !important;
}

.district-map-header small,
.district-map-footer span {
  color: #667085 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
}

.district-map-selected-menu {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

.district-map-selected-chip {
  align-items: center !important;
  background: rgba(255, 234, 0, .22) !important;
  border: 1px solid rgba(183, 121, 0, .28) !important;
  border-radius: 999px !important;
  color: #713f12 !important;
  display: inline-flex !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  gap: 6px !important;
  padding: 6px 10px !important;
}

.district-map-selected-chip.is-base {
  background: rgba(255, 79, 175, .18) !important;
  border-color: rgba(190, 24, 93, .32) !important;
  color: #831843 !important;
}

.district-map-mode[aria-pressed="true"] {
  background: linear-gradient(180deg, #22c55e, #16a34a) !important;
  border-color: rgba(22, 163, 74, .42) !important;
  color: #fff !important;
}

.district-map-body {
  display: grid !important;
  gap: 14px !important;
  grid-template-columns: minmax(0, 1fr) 42px !important;
}

.district-map-viewport {
  border: 1px solid #d8e3ef !important;
  border-radius: 14px !important;
  min-height: 650px !important;
  overflow: auto !important;
  position: relative !important;
  width: 100% !important;
}

.district-map-selector svg {
  background:
    linear-gradient(180deg, #f8fafc, #eef2f7) !important;
  border: 0 !important;
  border-radius: 0 !important;
  display: block !important;
  height: 650px !important;
  min-height: 650px !important;
  transition: width .16s ease, height .16s ease, min-height .16s ease !important;
  width: 100% !important;
}

.district-map-zoom {
  align-items: center !important;
  align-self: center !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  display: grid !important;
  gap: 6px !important;
  justify-items: center !important;
  justify-self: center !important;
  padding: 0 !important;
}

.district-map-zoom button {
  border-radius: 999px !important;
  font-size: 11px !important;
  height: 24px !important;
  justify-content: center !important;
  min-height: 24px !important;
  padding: 0 !important;
  width: 24px !important;
}

.district-map-zoom input[type="range"] {
  --zoom-fill: 50%;
  appearance: none !important;
  background: linear-gradient(to top, #2f6fd6 0 var(--zoom-fill), #d6dee9 var(--zoom-fill) 100%) !important;
  border-radius: 999px !important;
  height: 170px !important;
  outline: none !important;
  padding: 0 !important;
  width: 5px !important;
  writing-mode: vertical-lr !important;
}

.panel .district-map-zoom input[type="range"],
.form-panel .district-map-zoom input[type="range"] {
  background: linear-gradient(to top, #2f6fd6 0 var(--zoom-fill), #d6dee9 var(--zoom-fill) 100%) !important;
  border: 0 !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  min-height: 170px !important;
  min-width: 5px !important;
  padding: 0 !important;
}

.district-map-zoom input[type="range"]::-webkit-slider-runnable-track {
  background: transparent !important;
  border: 0 !important;
  border-radius: 999px !important;
  height: 170px !important;
  width: 5px !important;
}

.district-map-zoom input[type="range"]::-webkit-slider-thumb {
  appearance: none !important;
  background: #2f6fd6 !important;
  border: 2px solid #ffffff !important;
  border-radius: 999px !important;
  box-shadow: 0 4px 10px rgba(47, 111, 214, .28) !important;
  height: 16px !important;
  margin-left: -5.5px !important;
  width: 16px !important;
}

.district-map-zoom input[type="range"]::-moz-range-track {
  background: transparent !important;
  border: 0 !important;
}

.district-map-zoom input[type="range"]::-moz-range-thumb {
  background: #2f6fd6 !important;
  border: 2px solid #ffffff !important;
  border-radius: 999px !important;
  height: 16px !important;
  width: 16px !important;
}

.district-map-node {
  cursor: pointer !important;
  outline: none !important;
}

.district-map-node rect,
.district-map-node path {
  fill: #e5e7eb !important;
  stroke: rgba(71, 85, 105, .42) !important;
  stroke-width: .65 !important;
  transition: fill .16s ease, stroke .16s ease, filter .16s ease, transform .16s ease !important;
}

.district-map-node path {
  fill-opacity: .98 !important;
  vector-effect: non-scaling-stroke !important;
}

.district-map-node text {
  fill: #17212f !important;
  font-size: 17px !important;
  font-weight: 850 !important;
  pointer-events: none !important;
}

.district-map-shape text {
  fill: #0f172a !important;
  font-size: 7px !important;
  font-weight: 850 !important;
  paint-order: stroke !important;
  stroke: rgba(255,255,255,.82) !important;
  stroke-width: 2px !important;
}

.district-map-node .district-map-pin {
  display: none !important;
  fill: #f59e0b !important;
  font-size: 18px !important;
}

.district-map-shape .district-map-pin {
  font-size: 15px !important;
  stroke: rgba(255,255,255,.9) !important;
  stroke-width: 2px !important;
}

.district-map-node:hover rect,
.district-map-node:focus rect,
.district-map-node:hover path,
.district-map-node:focus path {
  filter: drop-shadow(0 8px 10px rgba(47, 111, 214, .18)) !important;
  stroke: #2f6fd6 !important;
}

.district-map-node.is-selected rect,
.district-map-node.is-selected path {
  fill: #ffea00 !important;
  fill-opacity: 1 !important;
  stroke: #b77900 !important;
  stroke-width: 1.15 !important;
}

.district-map-node.is-selected text {
  fill: #713f12 !important;
}

.district-map-node.is-base rect,
.district-map-node.is-base path {
  fill: #ff4faf !important;
  fill-opacity: 1 !important;
  stroke: #be185d !important;
  stroke-width: 1.35 !important;
}

.district-map-node.is-base text {
  fill: #831843 !important;
}

.district-map-node.is-base .district-map-pin {
  display: block !important;
}

.district-map-node.is-claimed {
  cursor: not-allowed !important;
}

.district-map-node.is-claimed rect,
.district-map-node.is-claimed path {
  fill: var(--district-owner-fill, #94a3b8) !important;
  fill-opacity: .72 !important;
  stroke: rgba(15, 23, 42, .42) !important;
}

.district-map-node.is-claimed text {
  fill: #111827 !important;
}

.district-map-fallback {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 14px !important;
  padding: 12px !important;
}

.district-map-fallback strong {
  color: #273447 !important;
  display: block !important;
  font-size: 12px !important;
  font-weight: 950 !important;
  margin-bottom: 9px !important;
}

.district-map-fallback-list {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

.district-map-fallback-chip {
  background: #f8fafc !important;
  border: 1px solid #dbe3ed !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  color: #334155 !important;
  font-size: 12px !important;
  min-height: 30px !important;
  padding: 6px 10px !important;
}

.district-map-fallback-chip.is-selected,
.district-map-fallback-chip.is-base {
  background: #fde047 !important;
  border-color: #ca8a04 !important;
  color: #713f12 !important;
}

.district-map-fallback-chip.is-base {
  background: #f9a8d4 !important;
  border-color: #db2777 !important;
  color: #831843 !important;
}

.district-map-fallback-chip.is-claimed {
  background: var(--district-owner-fill, #94a3b8) !important;
  border-color: rgba(15, 23, 42, .22) !important;
  color: #111827 !important;
  cursor: not-allowed !important;
  opacity: .72 !important;
}

.district-map-source {
  display: none !important;
}

.district-map-base-row {
  display: none !important;
}

.district-map-original-option.is-map-selected-option {
  background: rgba(255, 234, 0, .18) !important;
}

.district-map-base-badge {
  color: #be185d !important;
  font-size: 14px !important;
  font-weight: 950 !important;
  margin-left: auto !important;
}

@media (max-width: 900px) {
  .district-map-header {
    align-items: flex-start !important;
    flex-direction: column !important;
  }

  .district-map-header-actions {
    justify-content: flex-start !important;
    width: 100% !important;
  }

  .district-map-body {
    grid-template-columns: 1fr !important;
  }

  .district-map-zoom {
    align-items: center !important;
    display: flex !important;
    justify-content: center !important;
  }

  .district-map-zoom input[type="range"] {
    appearance: auto !important;
    height: auto !important;
    width: min(220px, 60vw) !important;
    writing-mode: horizontal-tb !important;
  }

  .district-map-selector svg {
    min-height: 430px !important;
  }
}

@media (max-width: 520px) {
  .district-map-header-actions .button {
    flex: 1 1 calc(50% - 8px) !important;
    justify-content: center !important;
    min-width: 0 !important;
  }

  .district-map-footer {
    align-items: flex-start !important;
    flex-direction: column !important;
  }
}

@media (max-width: 760px) {
  .password-card-head {
    align-items: flex-start !important;
    padding: 18px !important;
  }

  .password-lock-badge {
    height: 48px !important;
    width: 48px !important;
  }

  .password-change-panel > .password-change-form,
  .password-change-panel.form-panel > form,
  .password-change-panel > form {
    padding: 18px !important;
  }

  .password-form-grid {
    grid-template-columns: 1fr !important;
  }

  .password-submit-row {
    align-items: stretch !important;
    flex-direction: column !important;
  }
}
.panel a,
.actions a,
.toolbar a,
.bulk-actions a,
.form-actions a {
  text-decoration: none !important;
}
.panel a:hover,
.actions a:hover,
.toolbar a:hover,
.bulk-actions a:hover,
.form-actions a:hover {
  text-decoration: none !important;
}
.crud-action {
  align-items: center !important;
  border: 1px solid rgba(148, 163, 184, .34) !important;
  border-radius: 999px !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05) !important;
  display: inline-flex !important;
  font-size: 12px !important;
  font-weight: 850 !important;
  gap: 6px !important;
  line-height: 1 !important;
  margin: 2px 4px 2px 0 !important;
  min-height: 30px !important;
  padding: 8px 10px !important;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease !important;
}
.crud-action:hover {
  box-shadow: 0 7px 18px rgba(15, 23, 42, .12) !important;
  transform: translateY(-1px) !important;
}
.crud-view {
  background: #eef6ff !important;
  color: #1f67c1 !important;
}
.crud-edit {
  background: #eefaf3 !important;
  color: #15803d !important;
}
.crud-delete {
  background: #fff1f2 !important;
  color: #be123c !important;
}
.searchable-select-wrap {
  display: grid !important;
  gap: 7px !important;
}
.select-search-input,
.checkbox-search-input {
  background: linear-gradient(180deg, #ffffff, #f8fafc) !important;
  border: 1.5px solid #cfd8e3 !important;
  border-radius: 12px !important;
  color: #1f2937 !important;
  font-size: 12px !important;
  min-height: 36px !important;
  padding: 8px 11px !important;
}
.select-search-input:focus,
.checkbox-search-input:focus {
  border-color: #2f80ed !important;
  box-shadow: 0 0 0 4px rgba(47, 128, 237, .12) !important;
  outline: none !important;
}
.checkbox-multiselect-panel,
.panel #id_territory_districts,
.panel #id_districts:not(select),
.panel #id_state:not(select) {
  background: rgba(248, 250, 252, .9) !important;
  border: 1.5px solid #dbe3ec !important;
  border-radius: 14px !important;
  display: grid !important;
  gap: 6px !important;
  max-height: 260px !important;
  min-height: 170px !important;
  overflow: auto !important;
  padding: 9px !important;
}
.checkbox-multiselect-panel > div {
  display: contents !important;
}
.checkbox-multiselect-panel label,
.panel #id_territory_districts label,
.panel #id_districts:not(select) label,
.panel #id_state:not(select) label,
.checkbox-option {
  align-items: center !important;
  background: #fff !important;
  border: 1px solid #e4eaf1 !important;
  border-radius: 10px !important;
  color: #344054 !important;
  cursor: pointer !important;
  display: flex !important;
  font-size: 12px !important;
  font-weight: 750 !important;
  gap: 8px !important;
  margin: 0 !important;
  min-height: 34px !important;
  padding: 7px 9px !important;
}
.checkbox-multiselect-panel label:hover,
.panel #id_territory_districts label:hover,
.panel #id_districts:not(select) label:hover,
.panel #id_state:not(select) label:hover,
.checkbox-option:hover {
  border-color: rgba(47, 128, 237, .42) !important;
  box-shadow: 0 4px 12px rgba(47, 128, 237, .10) !important;
}
.checkbox-multiselect-panel input[type="checkbox"],
.panel #id_territory_districts input[type="checkbox"],
.panel #id_districts:not(select) input[type="checkbox"],
.panel #id_state:not(select) input[type="checkbox"] {
  accent-color: #2f80ed !important;
  flex: 0 0 auto !important;
  height: 15px !important;
  margin: 0 !important;
  min-height: 0 !important;
  width: 15px !important;
}

/* Compact searchable dropdowns for RO/Sales Area territory controls */
.select-dropdown,
.checkbox-dropdown {
  position: relative !important;
  width: 100% !important;
}
.panel select.native-select-hidden,
.form-panel select.native-select-hidden {
  border: 0 !important;
  height: 1px !important;
  min-height: 1px !important;
  opacity: 0 !important;
  padding: 0 !important;
  pointer-events: none !important;
  position: absolute !important;
  width: 1px !important;
}
.select-dropdown-button,
.checkbox-dropdown-button {
  align-items: center !important;
  background: linear-gradient(180deg, #ffffff, #f8fafc) !important;
  border: 1.5px solid #cfd8e3 !important;
  border-radius: 13px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 2px 8px rgba(15, 23, 42, .05) !important;
  color: #273447 !important;
  display: inline-flex !important;
  font-size: 13px !important;
  font-weight: 750 !important;
  justify-content: space-between !important;
  min-height: 38px !important;
  padding: 8px 11px !important;
  text-align: left !important;
  width: 100% !important;
}
.select-dropdown-button span,
.checkbox-dropdown-button span {
  display: block !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
.select-dropdown-button i,
.checkbox-dropdown-button i {
  color: #667085 !important;
  flex: 0 0 auto !important;
  font-size: 11px !important;
  margin-left: 8px !important;
}
.select-dropdown.open .select-dropdown-button,
.checkbox-dropdown.open .checkbox-dropdown-button {
  background: #fff !important;
  border-color: #2f80ed !important;
  box-shadow: 0 0 0 4px rgba(47, 128, 237, .14), inset 0 1px 0 rgba(255,255,255,.75) !important;
}
.select-dropdown-menu,
.checkbox-dropdown-menu {
  background: rgba(255, 255, 255, .98) !important;
  border: 1.5px solid rgba(207, 216, 227, .92) !important;
  border-radius: 15px !important;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .16), 0 2px 8px rgba(15, 23, 42, .08) !important;
  display: none !important;
  left: 0 !important;
  padding: 9px !important;
  position: absolute !important;
  right: 0 !important;
  top: calc(100% + 6px) !important;
  z-index: 120 !important;
}
.select-dropdown.open .select-dropdown-menu,
.checkbox-dropdown.open .checkbox-dropdown-menu {
  display: block !important;
}
.select-dropdown [hidden],
.checkbox-dropdown [hidden] {
  display: none !important;
}
.select-dropdown .select-dropdown-option[hidden],
.checkbox-dropdown .checkbox-multiselect-panel label[hidden],
.checkbox-dropdown #id_territory_districts label[hidden],
.checkbox-dropdown #id_districts:not(select) label[hidden],
.checkbox-dropdown #id_state:not(select) label[hidden] {
  display: none !important;
}
.panel .dropdown-search-input,
.form-panel .dropdown-search-input {
  background: linear-gradient(180deg, #ffffff, #f8fafc) !important;
  border: 1.5px solid #cfd8e3 !important;
  border-radius: 11px !important;
  box-shadow: none !important;
  color: #1f2937 !important;
  font-size: 12px !important;
  min-height: 34px !important;
  padding: 7px 10px !important;
  width: 100% !important;
}
.panel .dropdown-search-input:focus,
.form-panel .dropdown-search-input:focus {
  border-color: #2f80ed !important;
  box-shadow: 0 0 0 3px rgba(47, 128, 237, .12) !important;
  outline: none !important;
}
.select-dropdown-options {
  display: grid !important;
  gap: 5px !important;
  margin-top: 7px !important;
  max-height: 220px !important;
  overflow: auto !important;
}
.select-dropdown-option {
  background: #fff !important;
  border: 1px solid #e4eaf1 !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  color: #344054 !important;
  cursor: pointer !important;
  display: block !important;
  font-size: 12px !important;
  font-weight: 750 !important;
  justify-content: flex-start !important;
  min-height: 32px !important;
  padding: 7px 9px !important;
  text-align: left !important;
  width: 100% !important;
}
.select-dropdown-option:hover {
  background: #eef6ff !important;
  border-color: rgba(47, 128, 237, .42) !important;
  color: #1f67c1 !important;
}
.select-dropdown-option.is-selected {
  background: transparent !important;
  border-color: #2f80ed !important;
  box-shadow: 0 0 0 1.5px rgba(47, 128, 237, .5) inset !important;
  color: #1f67c1 !important;
}
.select-dropdown-option.is-empty {
  color: #667085 !important;
}
.dropdown-empty-message {
  color: #667085 !important;
  font-size: 12px !important;
  font-weight: 750 !important;
  padding: 10px 8px 4px !important;
  text-align: center !important;
}
.checkbox-dropdown-button {
  align-items: flex-start !important;
  min-height: 40px !important;
}
.checkbox-dropdown-button .checkbox-dropdown-summary {
  align-items: center !important;
  display: flex !important;
  flex: 1 1 auto !important;
  flex-wrap: wrap !important;
  gap: 5px !important;
  max-height: 82px !important;
  min-width: 0 !important;
  overflow: auto !important;
  white-space: normal !important;
}
.checkbox-dropdown-button .checkbox-dropdown-placeholder {
  color: #667085 !important;
  display: inline-flex !important;
  font-size: 13px !important;
  font-weight: 750 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
.checkbox-dropdown-button .checkbox-dropdown-tag {
  align-items: center !important;
  background: linear-gradient(180deg, #eef6ff, #dcecff) !important;
  border: 1px solid rgba(47, 128, 237, .22) !important;
  border-radius: 999px !important;
  color: #1f67c1 !important;
  display: inline-flex !important;
  font-size: 11px !important;
  font-weight: 850 !important;
  line-height: 1 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  padding: 5px 8px !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
.checkbox-dropdown-button .checkbox-dropdown-tag.is-muted {
  background: #eef2f7 !important;
  border-color: #dbe3ec !important;
  color: #667085 !important;
}
.checkbox-dropdown .checkbox-multiselect-panel,
.checkbox-dropdown #id_territory_districts,
.checkbox-dropdown #id_districts:not(select),
.checkbox-dropdown #id_state:not(select) {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  display: grid !important;
  gap: 5px !important;
  margin-top: 7px !important;
  max-height: 220px !important;
  min-height: 0 !important;
  overflow: auto !important;
  padding: 0 !important;
}
.checkbox-dropdown .checkbox-multiselect-panel > div {
  display: contents !important;
}
.checkbox-dropdown .checkbox-multiselect-panel label,
.checkbox-dropdown #id_territory_districts label,
.checkbox-dropdown #id_districts:not(select) label,
.checkbox-dropdown #id_state:not(select) label {
  margin: 0 !important;
  min-height: 32px !important;
  order: initial !important;
}
.checkbox-dropdown .checkbox-multiselect-panel input[type="checkbox"],
.checkbox-dropdown #id_territory_districts input[type="checkbox"],
.checkbox-dropdown #id_districts:not(select) input[type="checkbox"],
.checkbox-dropdown #id_state:not(select) input[type="checkbox"] {
  order: initial !important;
}
.panel.narrow > form > p:has(.checkbox-dropdown),
.form-panel > form > p:has(.checkbox-dropdown) {
  align-items: stretch !important;
  display: block !important;
}
.panel.narrow > form > p:has(.checkbox-dropdown) > label,
.form-panel > form > p:has(.checkbox-dropdown) > label {
  margin-bottom: 5px !important;
}

/* Keep Bootstrap validation visible above the compact macOS form theme. */
form.needs-validation.was-validated :invalid:not(form),
form .is-invalid {
  background: #fff5f5 !important;
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, .14) !important;
}
form .is-invalid:focus,
form.needs-validation.was-validated :invalid:not(form):focus {
  border-color: #b42318 !important;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, .22) !important;
}
form .invalid-feedback {
  color: #b42318 !important;
  display: block !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  margin-top: 5px !important;
}
form .invalid-feedback::before { content: "! "; font-weight: 900; }
form .lb-picker summary.is-invalid {
  background: #fff5f5 !important;
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, .14) !important;
}

/* Lube Buddy performance: bordered Done / Target cells with completion fill. */
.lb-activity-table {
  border: 1px solid #cbd8e8 !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}
.lb-activity-table th,
.lb-activity-table td {
  border-bottom: 1px solid #d9e2ef !important;
  border-right: 1px solid #d9e2ef !important;
  min-width: 145px;
  vertical-align: middle !important;
}
.lb-activity-table th:last-child,
.lb-activity-table td:last-child { border-right: 0 !important; }
.lb-activity-table tbody tr:last-child td { border-bottom: 0 !important; }
.lb-progress-cell { background: #fbfdff !important; }
.lb-target-progress {
  background: #e6edf5;
  border: 1px solid #c4d1df;
  border-radius: 999px;
  height: 8px;
  margin-top: 7px;
  overflow: hidden;
  width: 100%;
}
.lb-target-progress span {
  background: linear-gradient(90deg, #2f80ed, #34b47c);
  display: block;
  height: 100%;
  min-width: 0;
}
.lb-progress-cell > small { color: #58708a; display: block; margin-top: 4px; }
.lb-total-row td { background: #eef6ff !important; border-top: 2px solid #2f80ed !important; }
.station-lube-buddy-badge { color: #167454; font-weight: 800; }

/* File Note uses explicit grid markup because a checkbox multi-select cannot
   safely live inside Django's form.as_p paragraph wrapper. */
.file-note-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
  grid-column: 1 / -1;
  width: 100%;
}
.file-note-form-panel,
.lube-buddy-form-panel,
.bld-form-panel {
  width: min(1400px, calc(100vw - 34px)) !important;
}
.file-note-form-panel > form > .file-note-form-grid {
  grid-column: 1 / -1 !important;
}
.file-note-field { min-width: 0; }
.file-note-field > label { display: block; margin-bottom: 6px; }
.file-note-field .checkbox-dropdown { width: 100%; }
.file-note-other-usage,
.file-note-full { grid-column: 1 / -1; }
.file-note-other-toggle { display: flex; align-items: center; gap: 8px; padding-top: 28px; }
.file-note-other-toggle > label { margin: 0; }

/* BLD / ILD uses explicit field wrappers. Django's CheckboxSelectMultiple
   renders a block <div>, which is invalid inside form.as_p's <p> and caused
   Area of Operation to be moved beneath the Sales Area column by the browser. */
.bld-form-panel > form > .bld-form-grid {
  grid-column: 1 / -1 !important;
}
.bld-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
  width: 100%;
}
.bld-form-field {
  min-width: 0;
}
.bld-form-field > label {
  display: block;
  margin-bottom: 6px;
}
.bld-form-field > input:not([type="checkbox"]):not([type="radio"]),
.bld-form-field > select,
.bld-form-field > textarea,
.bld-form-field > .select-dropdown,
.bld-form-field > .checkbox-dropdown {
  width: 100%;
}
.bld-form-field-full {
  grid-column: 1 / -1;
}
.bld-form-field[data-bld-field="is_active"] {
  align-items: center;
  display: flex;
  gap: 8px;
}
.bld-form-field[data-bld-field="is_active"] > label {
  margin: 0;
  order: 2;
}
@media (max-width: 760px) {
  .file-note-form-grid,
  .bld-form-grid { grid-template-columns: 1fr; }
  .file-note-other-usage,
  .file-note-full,
  .bld-form-field-full { grid-column: auto; }
}

/* Compact gear menu for dense master-table actions. */
td.actions { overflow: visible !important; position: relative; white-space: normal; }
.record-actions-menu { display: inline-block; position: relative; }
.record-actions-menu > summary {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  box-shadow: none;
  color: #2f80ed;
  cursor: pointer;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  list-style: none;
  transition: transform .18s ease, box-shadow .18s ease;
  width: 36px;
}
.record-actions-menu > summary::-webkit-details-marker { display: none; }
/* 3D black gear, no background chip. */
.record-actions-menu > summary .fa-gear {
  color: #1b1b1b !important;
  font-size: 1.45rem;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .7), 0 2px 2px rgba(0, 0, 0, .4), 0 3px 5px rgba(0, 0, 0, .22);
}
.record-actions-menu > summary:hover { background: transparent; transform: rotate(16deg) scale(1.06); }
.record-actions-menu[open] > summary .fa-gear { animation: record-gear-spin .9s ease-in-out; }
@keyframes record-gear-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.record-actions-dropdown {
  background: #fff;
  border: 1px solid #d5dfec;
  border-radius: 14px;
  box-shadow: 0 16px 38px rgba(24, 43, 72, .24);
  /* A symbolic 2-column grid of icon controls. */
  display: grid;
  grid-template-columns: repeat(2, minmax(80px, 1fr));
  gap: 6px;
  min-width: 196px;
  padding: 8px;
  /* Fixed positioning; JS in model_list.html portals this to <body> and sets
     the coordinates, so it escapes the table's `overflow:hidden` clip AND the
     `.panel` backdrop-filter containing block (which otherwise offsets fixed). */
  position: fixed;
  z-index: 1200;
}
.record-actions-dropdown .inline-form { display: block !important; margin: 0 !important; }
/* Override the pill-shaped base .crud-action (!important) with a small, tidy tile. */
.record-actions-dropdown .crud-action,
.record-actions-dropdown .inline-form .crud-action {
  box-sizing: border-box;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  width: 100% !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 6px 5px !important;
  border-radius: 10px !important;
  text-align: center;
  font-size: .66rem !important;
  line-height: 1.05 !important;
}
.record-actions-dropdown .crud-action i { font-size: .88rem !important; margin: 0 !important; }

/* Sales analytics refresh: comparison lanes, click-driven BLD details and a lighter chart. */
.segment-performance-board {
  overflow: hidden;
  padding: 0 !important;
}
.segment-board-head {
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(47, 111, 214, .055), rgba(14, 165, 233, .025));
  border-bottom: 1px solid #e9eef5;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 18px 20px;
}
.segment-board-head h2 { color: #243247; font-size: 19px; margin: 3px 0 4px; }
.segment-board-head p { color: #697586; font-size: 12px; margin: 0; }
.segment-board-key {
  align-items: center;
  color: #667085;
  display: flex;
  flex-wrap: wrap;
  font-size: 11px;
  font-weight: 800;
  gap: 14px;
}
.segment-board-key span { align-items: center; display: inline-flex; gap: 6px; white-space: nowrap; }
.period-dot { background: #3b82f6; border-radius: 50%; height: 7px; width: 7px; }
.period-dot.cumulative { background: #16a37a; }
.period-dot.benchmark { background: #a0aec0; }
.period-dot.aop { background: #8b5cf6; }
.segment-lanes { display: grid; }
.segment-lane {
  --tile-accent: #3b82f6;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #edf1f6;
  display: grid;
  gap: 0;
  grid-template-columns: minmax(180px, 1.15fr) repeat(3, minmax(170px, 1fr));
  min-height: 104px;
  position: relative;
  transition: background-color .18s ease, transform .18s ease;
}
.segment-lane:last-child { border-bottom: 0; }
.segment-lane::before {
  background: var(--tile-accent);
  content: "";
  inset: 15px auto 15px 0;
  position: absolute;
  width: 3px;
}
.segment-lane:hover { background: color-mix(in srgb, var(--tile-accent) 3%, #fff); }
.segment-lane-identity {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: 0;
  padding: 17px 18px;
}
.segment-mark {
  align-items: center;
  background: color-mix(in srgb, var(--tile-accent) 12%, #fff);
  border: 1px solid color-mix(in srgb, var(--tile-accent) 22%, #fff);
  border-radius: 13px;
  color: var(--tile-accent);
  display: inline-flex;
  flex: 0 0 42px;
  font-size: 16px;
  font-weight: 900;
  height: 42px;
  justify-content: center;
}
.segment-lane-identity h3 {
  color: #26374a;
  font-size: 16px;
  margin: 3px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.segment-metric {
  border-left: 1px solid #edf1f6;
  display: grid;
  gap: 4px 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 14px 16px;
}
.segment-metric-label {
  color: #778296;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.segment-metric > strong {
  color: #29384c;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  grid-column: 1 / -1;
  letter-spacing: -.03em;
}
.segment-metric > strong small { color: #8b96a8; font-size: 10px; letter-spacing: .02em; }
.segment-context {
  color: #818c9d;
  font-size: 10px;
  font-weight: 700;
  grid-column: 1 / -1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.segment-meter { background: #edf1f5; border-radius: 999px; height: 5px; overflow: hidden; }
.segment-meter span { background: var(--tile-accent); border-radius: inherit; display: block; height: 100%; min-width: 2px; }
.segment-metric > b { color: var(--tile-accent); font-size: 10px; }
.cumulative-metric .segment-meter span { background: linear-gradient(90deg, var(--tile-accent), #4fd1a5); }
.benchmark-metric .segment-meter span { background: #aab4c2; }
.benchmark-metric > b { color: #788496; }
.segment-aop-progress {
  border-top: 1px dashed #dfe4ec;
  display: grid;
  gap: 5px 8px;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 5px;
  padding-top: 8px;
}
.segment-aop-progress > div:first-child {
  align-items: center;
  display: flex;
  grid-column: 1 / -1;
  justify-content: space-between;
}
.segment-aop-progress > div:first-child span {
  color: #7656c7;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.segment-aop-progress > div:first-child strong { color: #6547b5; font-size: 10px; }
.segment-aop-progress .segment-meter.aop span { background: linear-gradient(90deg, #8b5cf6, #c084fc); }
.segment-aop-progress > b { color: #7656c7; font-size: 10px; }
.segment-board-empty { color: #7b8798; padding: 28px; text-align: center; }

/* The BLD row is now a deliberate click target; hover never opens details. */
.bld-sales-card { cursor: default !important; overflow: visible !important; }
.bld-card-trigger {
  border-radius: inherit;
  cursor: pointer;
  display: block;
  outline: none;
  position: relative;
}
.bld-card-trigger:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tile-accent, #2f6fd6) 35%, transparent);
}
.bld-card-trigger:hover { background: color-mix(in srgb, var(--tile-accent, #2f6fd6) 3%, transparent); }
.bld-hover-hint { opacity: 1 !important; }
.bld-sales-card:hover .bld-hover-hint,
.bld-sales-card:focus-within .bld-hover-hint { opacity: 1 !important; }
.bld-details,
.bld-sales-card:hover .bld-details,
.bld-sales-card:focus-within .bld-details {
  background: #fff;
  border: 1px solid #dce4ee;
  border-radius: 18px;
  box-shadow: 0 28px 70px rgba(20, 34, 54, .24), 0 0 0 100vmax rgba(17, 29, 46, .20);
  left: 50%;
  max-height: min(78vh, 720px) !important;
  max-width: min(760px, calc(100vw - 32px));
  opacity: 0 !important;
  overflow: auto !important;
  pointer-events: none;
  position: fixed;
  top: 50%;
  transform: translate(-50%, calc(-50% + 12px)) scale(.98);
  transition: opacity .18s ease, transform .22s cubic-bezier(.22, 1, .36, 1), visibility .18s;
  visibility: hidden;
  width: 760px;
  z-index: 1000;
}
.bld-sales-card.is-open .bld-details {
  opacity: 1 !important;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
  visibility: visible;
}
.bld-sales-card.is-open { transform: none !important; z-index: 30; }
.bld-details-inner { background: #fff; border-radius: inherit; overflow: hidden; }
.bld-detail-head {
  align-items: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tile-accent) 9%, #fff), #fff);
  border-bottom: 1px solid #e8edf3;
  display: flex;
  justify-content: space-between;
  padding: 16px 18px;
}
.bld-detail-head h3 { color: #243247; font-size: 17px; margin: 3px 0 0; }
.bld-detail-close {
  align-items: center;
  background: #fff;
  border: 1px solid #dfe6ee;
  border-radius: 10px;
  color: #6f7b8d;
  cursor: pointer;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}
.bld-detail-close:hover { background: #f3f6fa; color: #27364a; }
.bld-details .bld-compare-grid { border-top: 0 !important; padding-top: 14px !important; }

/* Month chart: fine strokes, quiet fills and smaller data points. */
.mc-line-current {
  filter: none !important;
  stroke-width: 1.65 !important;
}
.mc-line-historical {
  stroke-dasharray: 4 6 !important;
  stroke-width: 1.35 !important;
}
.mc-area-cur { opacity: .45; }
.mc-area-hist { opacity: .35; }
.mc-dot { stroke-width: 1.6 !important; }
.mc-dot:hover { r: 5; stroke-width: 2.2 !important; }
.mc-grid { stroke: #edf1f6 !important; stroke-width: .75 !important; }
.month-chart-card { border-radius: 18px !important; padding: 20px !important; }
.month-tooltip {
  border: 1px solid rgba(45, 61, 82, .12) !important;
  border-radius: 15px !important;
  box-shadow: 0 20px 48px rgba(26, 42, 65, .18) !important;
  padding: 13px 14px !important;
}

@media (max-width: 980px) {
  .segment-lane { grid-template-columns: minmax(170px, .9fr) repeat(3, minmax(145px, 1fr)); }
  .segment-metric { padding: 13px 12px; }
}
@media (max-width: 760px) {
  .segment-board-head { flex-direction: column; }
  .segment-lane { grid-template-columns: 1fr; padding: 5px 0; }
  .segment-lane-identity { padding-bottom: 10px; }
  .segment-metric { border-left: 0; border-top: 1px solid #edf1f6; margin: 0 14px; padding: 12px 4px; }
  .bld-details { max-width: calc(100vw - 20px); width: calc(100vw - 20px); }
}

@media (prefers-reduced-motion: reduce) {
  .bld-details { transition: none !important; }
}

/* Activity dashboard: one scan-friendly performance board instead of card stacks. */
.activity-pulse-hero {
  background:
    radial-gradient(circle at 88% 10%, rgba(14, 165, 233, .11), transparent 30%),
    linear-gradient(135deg, #ffffff, #f7fbff) !important;
  border-top: 3px solid #2f80ed !important;
}
.activity-pulse-hero h2 { color: #223047 !important; }
.activity-pulse-hero p { color: #66758a !important; }
.activity-performance-board { overflow: hidden; padding: 0 !important; }
.activity-board-head {
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(47, 128, 237, .06), rgba(34, 197, 154, .035));
  border-bottom: 1px solid #e8eef5;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 18px 20px;
}
.activity-board-head h2 { color: #243247; font-size: 19px; margin: 3px 0 4px; }
.activity-board-head p { color: #697689; font-size: 12px; margin: 0; }
.activity-board-key {
  align-items: center;
  color: #677488;
  display: flex;
  flex-wrap: wrap;
  font-size: 11px;
  font-weight: 800;
  gap: 14px;
}
.activity-board-key span { align-items: center; display: inline-flex; gap: 6px; white-space: nowrap; }
.activity-key-dot { background: #3b82f6; border-radius: 50%; height: 7px; width: 7px; }
.activity-key-dot.year { background: #20a47b; }
.activity-key-dot.all-time { background: #a8b2c1; }
.activity-performance-rows { display: grid; }
.activity-performance-row {
  --tile-accent: #3b82f6;
  align-items: stretch;
  background: #fff;
  border-bottom: 1px solid #ebf0f6;
  display: grid;
  grid-template-columns: minmax(240px, 1.15fr) repeat(2, minmax(220px, 1fr));
  min-height: 108px;
  position: relative;
  transition: background-color .18s ease;
}
.activity-performance-row:last-child { border-bottom: 0; }
.activity-performance-row::before {
  background: var(--tile-accent);
  content: "";
  inset: 16px auto 16px 0;
  position: absolute;
  width: 3px;
}
.activity-performance-row:hover { background: color-mix(in srgb, var(--tile-accent) 3%, #fff); }
.activity-row-identity {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: 0;
  padding: 18px 20px;
}
.activity-row-icon {
  align-items: center;
  background: color-mix(in srgb, var(--tile-accent) 11%, #fff);
  border: 1px solid color-mix(in srgb, var(--tile-accent) 20%, #fff);
  border-radius: 14px;
  color: var(--tile-accent);
  display: inline-flex;
  flex: 0 0 44px;
  height: 44px;
  justify-content: center;
}
.activity-row-identity h3 {
  color: #27364a;
  font-size: 15px;
  line-height: 1.2;
  margin: 4px 0 0;
}
.activity-row-metric {
  border-left: 1px solid #edf1f6;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 15px 17px;
}
.activity-row-metric > span {
  color: #778397;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.activity-row-metric > strong {
  color: #29384c;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  letter-spacing: -.03em;
  margin: 5px 0 7px;
}
.activity-row-metric > strong small { color: #8b96a7; font-size: 10px; letter-spacing: .01em; }
.activity-row-progress { background: #edf1f5; border-radius: 999px; height: 5px; overflow: hidden; }
.activity-row-progress i {
  background: linear-gradient(90deg, var(--tile-accent), color-mix(in srgb, var(--tile-accent) 55%, #57d5b0));
  border-radius: inherit;
  display: block;
  height: 100%;
  min-width: 2px;
}
.activity-row-progress.is-neutral { background: #edf1f5; }
.activity-row-progress.is-neutral i { background: #c9d1dc; min-width: 0; width: 0; }
.activity-row-metric > b.aop-status { color: #748094; }
.activity-row-metric > b { color: var(--tile-accent); font-size: 10px; margin-top: 5px; }
.activity-row-metric.year .activity-row-progress i { background: linear-gradient(90deg, #20a47b, #70cfac); }
.activity-row-metric.year > b { color: #178662; }
.activity-row-metric.all-time { background: rgba(247, 249, 252, .68); }
.activity-row-metric.all-time > strong { margin-bottom: 2px; }
.activity-row-metric.all-time > small { color: #8a95a5; font-size: 10px; font-weight: 700; }
.activity-board-empty { color: #7c8797; padding: 30px; text-align: center; }

@media (max-width: 980px) {
  .activity-performance-row { grid-template-columns: minmax(190px, 1fr) repeat(2, minmax(165px, 1fr)); }
  .activity-row-metric { padding: 14px 12px; }
}

/* Master-table action menus stay legible and behave as one active popover. */
.record-actions-menu > summary {
  background: transparent !important;
  border: 0 !important;
  color: #1b1b1b !important;
}
/* 3D black gear with no background chip. */
.record-actions-menu > summary .fa-gear {
  color: #1b1b1b !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .7), 0 2px 2px rgba(0, 0, 0, .4), 0 3px 5px rgba(0, 0, 0, .22);
}
.record-actions-menu[open] > summary,
.record-actions-menu > summary:focus {
  background: transparent !important;
  border-color: transparent !important;
  border-radius: 50% !important;
  outline: 2px solid rgba(47, 111, 214, .9) !important;
  outline-offset: 2px !important;
}
.record-actions-dropdown { background: #fff !important; color: #27364a !important; }
.record-actions-dropdown .crud-action,
.record-actions-dropdown .crud-action i { color: inherit !important; }
.record-actions-dropdown .crud-view { background: #eef6ff !important; color: #1f67c1 !important; }
.record-actions-dropdown .crud-edit { background: #eefaf3 !important; color: #15803d !important; }
.record-actions-dropdown .crud-delete { background: #fff1f2 !important; color: #be123c !important; }
@media (max-width: 760px) {
  .activity-board-head { flex-direction: column; }
  .activity-performance-row { grid-template-columns: 1fr; padding: 5px 0; }
  .activity-row-identity { padding-bottom: 12px; }
  .activity-row-metric { border-left: 0; border-top: 1px solid #edf1f6; margin: 0 14px; padding: 12px 4px; }
  .activity-row-metric.all-time { background: transparent; }
}

/* Contrast guard: pale activity hero + solid-blue Mac primary controls. */
.activity-pulse-hero .analytics-code-box {
  background: linear-gradient(135deg, #3b82f6, #2563d9) !important;
  border: 1px solid rgba(37, 99, 217, .55) !important;
  box-shadow: 0 10px 24px rgba(37, 99, 217, .20) !important;
}
.activity-pulse-hero .analytics-code-box span { color: rgba(255, 255, 255, .82) !important; }
.activity-pulse-hero .analytics-code-box strong { color: #fff !important; }
.theme-current-chip { color: #fff !important; }

main :is(
  button[type="submit"]:not(.secondary):not(.crud-action):not(.adm-btn-edit):not(.adm-btn-delete):not(.adm-btn-landing):not(.ro-logout),
  button.is-active,
  .button:not(.secondary),
  .btn-primary,
  .btn-success,
  .btn-danger,
  .theme-chip.is-active,
  .analytics-tab-switcher a.is-active,
  #tab-segment-sales:checked ~ .analytics-tab-switcher label[for="tab-segment-sales"],
  #tab-bld-sales:checked ~ .analytics-tab-switcher label[for="tab-bld-sales"],
  #tab-month-sales:checked ~ .analytics-tab-switcher label[for="tab-month-sales"],
  .page-item.active .page-link
) {
  color: #fff !important;
}
main :is(
  button[type="submit"]:not(.secondary):not(.crud-action):not(.adm-btn-edit):not(.adm-btn-delete):not(.adm-btn-landing):not(.ro-logout),
  button.is-active,
  .button:not(.secondary),
  .btn-primary,
  .btn-success,
  .btn-danger,
  .theme-chip.is-active,
  .analytics-tab-switcher a.is-active,
  #tab-segment-sales:checked ~ .analytics-tab-switcher label[for="tab-segment-sales"],
  #tab-bld-sales:checked ~ .analytics-tab-switcher label[for="tab-bld-sales"],
  #tab-month-sales:checked ~ .analytics-tab-switcher label[for="tab-month-sales"],
  .page-item.active .page-link
) :is(i, span, strong, b, small) {
  color: inherit !important;
}

/* Compressed master imagery shown as compact dashboard and list thumbnails. */
.segment-packshot,
.activity-master-thumb {
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--tile-accent, #3b82f6) 20%, #e6ebf2);
  border-radius: 14px;
  box-shadow: 0 5px 14px rgba(30, 48, 72, .10);
  display: block;
  flex: 0 0 44px;
  height: 44px;
  width: 44px;
}
.segment-packshot { object-fit: contain; padding: 4px; }
.activity-master-thumb { object-fit: cover; }
.master-image-thumb {
  background: #fff;
  border: 1px solid #dce4ed;
  border-radius: 10px !important;
  height: 46px !important;
  object-fit: contain;
  padding: 3px;
  width: 46px !important;
}
.master-detail-image {
  background: #fff;
  border: 1px solid #dce4ed;
  border-radius: 14px;
  display: block;
  max-height: 220px;
  max-width: min(100%, 320px);
  object-fit: contain;
  padding: 6px;
}

/* Segment dashboard: compact card grid with larger packshots and AOP rings. */
.segment-board-head { padding: 14px 16px !important; }
.segment-lanes {
  background: #f6f8fb;
  display: grid !important;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  padding: 12px;
}
.segment-lane {
  align-content: start;
  align-items: stretch;
  background: #fff !important;
  border: 1px solid #e1e7ef !important;
  border-radius: 16px;
  box-shadow: 0 7px 20px rgba(27, 44, 68, .07);
  display: grid !important;
  gap: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  min-height: 0 !important;
  overflow: hidden;
  padding: 0 !important;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.segment-lane::before {
  height: 3px;
  inset: 0 0 auto 0 !important;
  width: auto !important;
}
.segment-lane:hover {
  border-color: color-mix(in srgb, var(--tile-accent) 22%, #e1e7ef) !important;
  box-shadow: 0 12px 28px rgba(27, 44, 68, .11);
  transform: translateY(-2px);
}
.segment-lane-identity {
  gap: 14px;
  grid-column: 1 / -1;
  min-height: 92px;
  padding: 12px 14px !important;
}
.segment-lane-identity h3 { font-size: 17px; }
.segment-packshot,
.segment-lane .segment-mark {
  border-radius: 16px;
  flex: 0 0 72px;
  height: 72px;
  width: 72px;
}
.segment-packshot { padding: 5px; }
.segment-lane .segment-mark { font-size: 22px; }
.segment-metric {
  border-left: 0 !important;
  border-top: 1px solid #edf1f6;
  gap: 3px 6px;
  margin: 0 !important;
  min-width: 0;
  padding: 10px !important;
}
.segment-metric + .segment-metric { border-left: 1px solid #edf1f6 !important; }
.segment-metric > strong { font-size: 16px; }
.segment-context { font-size: 9px; }
.segment-meter { height: 4px; }
.segment-aop-ring-card {
  align-items: center;
  background: linear-gradient(135deg, #faf8ff, #f5f0ff);
  border-top: 1px solid #e8defa;
  display: flex;
  gap: 12px;
  grid-column: 1 / -1;
  padding: 10px 14px;
}
.segment-aop-ring-card > div:last-child { min-width: 0; }
.segment-aop-ring-card > div:last-child > strong {
  color: #5636a5;
  display: block;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.segment-aop-ring-card > div:last-child > strong small { color: #8069b9; font-size: 10px; }
.segment-aop-ring-card p { color: #8979ad; font-size: 9px; font-weight: 700; margin: 2px 0 0; }
.segment-aop-ring {
  align-items: center;
  background: conic-gradient(#8b5cf6 var(--aop-progress), #e6def7 0);
  border-radius: 50%;
  display: inline-flex;
  flex: 0 0 60px;
  height: 60px;
  justify-content: center;
  position: relative;
  width: 60px;
}
.segment-aop-ring::before {
  background: #fff;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(117, 86, 199, .08);
  content: "";
  inset: 7px;
  position: absolute;
}
.segment-aop-ring > span {
  color: #6744b8;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  position: relative;
  z-index: 1;
}
.segment-aop-ring > span small { font-size: 8px; }

@media (max-width: 420px) {
  .segment-lanes { grid-template-columns: 1fr; padding: 8px; }
  .segment-lane-identity { min-height: 84px; }
  .segment-packshot,
  .segment-lane .segment-mark { flex-basis: 64px; height: 64px; width: 64px; }
  .segment-metric { padding: 8px 7px !important; }
  .segment-context { white-space: normal; }
}

/* BLD leaderboard: compact cards, cumulative ring and full-FY history track. */
.bld-leaderboard-head { margin-bottom: 12px !important; padding: 14px 16px !important; }
.bld-sales-list.bld-leaderboard {
  display: grid !important;
  gap: 12px !important;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr)) !important;
}
.bld-sales-card {
  align-self: start;
  border-radius: 16px !important;
  min-width: 0;
}
.bld-summary { padding: 12px !important; }
.bld-summary-main {
  gap: 8px !important;
  grid-template-columns: 32px 40px minmax(0, 1fr) auto 56px !important;
}
.bld-total-number { min-width: 104px !important; padding: 7px 9px !important; }
.bld-total-number strong { font-size: 17px !important; }
.bld-achievement-ring {
  align-items: center;
  background: conic-gradient(var(--tile-accent, #2f6fd6) var(--bld-progress), #e8edf3 0);
  border-radius: 50%;
  display: inline-flex;
  height: 54px;
  justify-content: center;
  position: relative;
  width: 54px;
}
.bld-achievement-ring::before {
  background: #fff;
  border-radius: 50%;
  content: "";
  inset: 6px;
  position: absolute;
}
.bld-achievement-ring > span {
  color: var(--tile-accent, #2f6fd6);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  position: relative;
  z-index: 1;
}
.bld-achievement-ring > span small { font-size: 7px; }
.bld-bars-compare { margin: 9px 0 7px !important; }
.bld-bars-compare .bld-bar-track { height: 7px !important; }
.bld-summary > .analytics-progress { display: none; }
.bld-full-year-progress {
  background: #f7f9fc;
  border: 1px solid #e6ebf1;
  border-radius: 10px;
  margin-top: 8px;
  padding: 8px 9px;
}
.bld-full-year-progress .progress-label { align-items: center; display: flex; justify-content: space-between; }
.bld-full-year-progress .progress-label > span {
  color: #657287;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.bld-full-year-progress .progress-label strong { color: #344257; font-size: 11px; }
.bld-full-year-progress .progress-label strong small { color: #8b96a5; font-size: 8px; }
.bld-full-year-progress .progress-track { height: 5px !important; margin: 5px 0 3px !important; }
.bld-full-year-progress .progress-track span { background: linear-gradient(90deg, #8b5cf6, #c084fc) !important; }
.bld-full-year-progress > small { color: #7c8797; display: block; font-size: 8px; font-weight: 700; }
.bld-hover-hint { margin: 7px 2px 0; }
.bld-details .bld-compare-grid { grid-template-columns: repeat(4, minmax(130px, 1fr)) !important; }

/* Activity performance: responsive cards with monthly line + FY donut. */
.activity-performance-board { background: #f6f8fb !important; }
.activity-performance-rows {
  display: grid !important;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  padding: 12px;
}
.activity-performance-row {
  align-content: start;
  background: #fff !important;
  border: 1px solid #e1e7ef !important;
  border-radius: 16px;
  box-shadow: 0 7px 20px rgba(27, 44, 68, .07);
  display: grid !important;
  grid-template-columns: 1fr !important;
  min-height: 0 !important;
  overflow: hidden;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.activity-performance-row::before { height: 3px; inset: 0 0 auto 0 !important; width: auto !important; }
.activity-performance-row:hover {
  border-color: color-mix(in srgb, var(--tile-accent) 22%, #e1e7ef) !important;
  box-shadow: 0 12px 28px rgba(27, 44, 68, .11);
  transform: translateY(-2px);
}
.activity-row-identity { min-height: 82px; padding: 12px 14px !important; }
.activity-master-thumb,
.activity-row-icon { flex: 0 0 58px; height: 58px; width: 58px; }
.activity-row-identity h3 { font-size: 16px; }
.activity-row-metric {
  border-left: 0 !important;
  border-top: 1px solid #edf1f6;
  margin: 0 !important;
  padding: 11px 14px !important;
}
.activity-row-metric.month > strong { font-size: 18px; margin: 4px 0 6px; }
.activity-year-ring-layout { align-items: center; display: flex; gap: 12px; margin-top: 6px; }
.activity-year-ring-layout > div:last-child { display: grid; gap: 3px; min-width: 0; }
.activity-year-ring-layout strong { color: #29384c; font-size: 17px; font-variant-numeric: tabular-nums; }
.activity-year-ring-layout strong small { color: #8b96a7; font-size: 9px; }
.activity-year-ring-layout b { color: #178662; font-size: 10px; }
.activity-year-ring {
  align-items: center;
  background: conic-gradient(#20a47b var(--activity-progress), #dfeee9 0);
  border-radius: 50%;
  display: inline-flex;
  flex: 0 0 62px;
  height: 62px;
  justify-content: center;
  position: relative;
  width: 62px;
}
.activity-year-ring::before { background: #fff; border-radius: 50%; content: ""; inset: 7px; position: absolute; }
.activity-year-ring > span { color: #178662; font-size: 14px; font-weight: 900; position: relative; z-index: 1; }
.activity-year-ring > span small { font-size: 8px; }
.activity-year-ring.is-neutral { background: #e8edf3; }
.activity-year-ring.is-neutral > span { color: #8a95a5; }

@media (max-width: 720px) {
  .bld-sales-list.bld-leaderboard { grid-template-columns: 1fr !important; }
  .bld-summary-main { grid-template-columns: 30px 38px minmax(0, 1fr) 52px !important; }
  .bld-total-number { grid-column: 1 / -1 !important; grid-row: 2; text-align: left !important; }
  .bld-achievement-ring { grid-column: 4; grid-row: 1; }
  .bld-details .bld-compare-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)) !important; }
}

/* Complete activity record */
.activity-record-detail { display: grid; gap: 16px; }
.activity-record-hero {
  align-items: center;
  background: linear-gradient(125deg, #ffffff 0%, #f4f8ff 68%, #eaf2ff 100%);
  border: 1px solid #dce5f2;
  border-top: 3px solid #3f7ff3;
  border-radius: 20px;
  box-shadow: 0 14px 34px rgba(35, 55, 86, .09);
  display: grid;
  gap: 15px;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  padding: 20px;
}
.activity-record-icon {
  align-items: center;
  background: linear-gradient(145deg, #4b8cff, #316ddd);
  border-radius: 17px;
  box-shadow: 0 8px 18px rgba(55, 117, 231, .25);
  color: #fff;
  display: flex;
  font-size: 22px;
  height: 58px;
  justify-content: center;
  width: 58px;
}
.activity-record-heading span { color: #718097; font-size: 10px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.activity-record-heading h2 { color: #243247; font-size: 24px; margin: 3px 0 5px; }
.activity-record-heading p { color: #66748a; font-size: 13px; margin: 0; }
.activity-record-heading p i { color: #3f7ff3; margin-right: 4px; }
.activity-record-heading p b { color: #a5b0c0; margin: 0 5px; }
.activity-record-back { white-space: nowrap; }
.activity-detail-sections { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.activity-detail-section {
  background: #fff;
  border: 1px solid #e1e7f0;
  border-radius: 18px;
  box-shadow: 0 9px 24px rgba(38, 56, 82, .065);
  overflow: hidden;
}
.activity-detail-section > header {
  align-items: center;
  background: #f7f9fc;
  border-bottom: 1px solid #e9edf3;
  display: flex;
  gap: 9px;
  padding: 13px 16px;
}
.activity-detail-section > header > i { color: #3f7ff3; font-size: 14px; }
.activity-detail-section > header h3 { color: #2a394f; font-size: 14px; margin: 0; }
.activity-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.activity-detail-item { border-bottom: 1px solid #edf1f6; min-width: 0; padding: 13px 16px; }
.activity-detail-item:nth-child(odd) { border-right: 1px solid #edf1f6; }
.activity-detail-item:nth-last-child(-n+2) { border-bottom: 0; }
.activity-detail-item dt { color: #7a879a; font-size: 9px; font-weight: 900; letter-spacing: .06em; margin-bottom: 5px; text-transform: uppercase; }
.activity-detail-item dd { color: #26364b; font-size: 13px; font-weight: 750; line-height: 1.45; margin: 0; overflow-wrap: anywhere; }
.activity-documents-section { padding-bottom: 16px; }
.activity-report-link {
  align-items: center;
  background: #f3f7ff;
  border: 1px solid #d7e4fb;
  border-radius: 13px;
  color: #2c6dd8;
  display: flex;
  gap: 12px;
  margin: 16px 16px 0;
  padding: 12px 14px;
  text-decoration: none;
}
.activity-report-link > i:first-child { font-size: 22px; }
.activity-report-link > i:last-child { margin-left: auto; }
.activity-report-link span { display: grid; gap: 2px; }
.activity-report-link strong { color: #2b3b52; font-size: 13px; }
.activity-report-link small { color: #7d8a9d; font-size: 10px; }
.activity-empty-state { align-items: center; color: #8a96a7; display: flex; font-size: 12px; gap: 8px; margin: 16px; }
.activity-record-detail .activity-gallery { grid-template-columns: repeat(auto-fill, minmax(145px, 190px)); margin: 16px; }
.activity-record-detail .activity-gallery a { background: #f6f8fb; border: 1px solid #e1e7f0; color: #65748a; text-decoration: none; }
.activity-record-detail .activity-gallery img { aspect-ratio: 4 / 3; }
.activity-record-detail .activity-gallery a span { display: block; font-size: 10px; font-weight: 800; padding: 8px 10px; }
.activity-record-detail .activity-gallery .activity-empty-state { grid-column: 1 / -1; margin: 0; }

@media (max-width: 900px) {
  .activity-detail-sections { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .activity-record-hero { grid-template-columns: 48px minmax(0, 1fr); padding: 16px; }
  .activity-record-icon { border-radius: 14px; font-size: 18px; height: 48px; width: 48px; }
  .activity-record-back { grid-column: 1 / -1; justify-content: center; }
  .activity-detail-grid { grid-template-columns: 1fr; }
  .activity-detail-item, .activity-detail-item:nth-child(odd), .activity-detail-item:nth-last-child(-n+2) { border-bottom: 1px solid #edf1f6; border-right: 0; }
  .activity-detail-item:last-child { border-bottom: 0; }
}

/* User-level page access controls */
.access-detail-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 16px 0; }
.access-detail-fieldset { margin: 0; }
.access-detail-fieldset > ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; list-style: none; margin: 12px 0 0; padding: 0; }
.access-detail-fieldset > ul label { align-items: center; display: flex; gap: 8px; }
.access-detail-fieldset input[type="checkbox"] { height: 16px; width: 16px; }
/* Permission list stays visible but greyed until the section toggle is enabled. */
[data-officer-access-detail].is-access-locked { opacity: .5; }
[data-officer-access-detail].is-access-locked::after {
  content: "Turn on the toggle above to grant these pages.";
  color: #8794a7; display: block; font-size: 11px; font-style: italic; margin-top: 8px;
}
@media (max-width: 760px) { .access-detail-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .access-detail-fieldset > ul { grid-template-columns: 1fr; } }
.officer-form-grid { display: grid; gap: 14px 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.officer-form-field { min-width: 0; }
.officer-form-field > label { display: block; margin-bottom: 6px; }
.officer-form-field > small { color: #6f7d91; display: block; margin-top: 5px; }
.officer-access-control { border-top: 1px solid #dfe6ef; margin-top: 22px; padding-top: 18px; }
.officer-access-heading { align-items: center; display: flex; gap: 12px; }
.officer-access-heading > span { align-items: center; background: #eaf2ff; border-radius: 12px; color: #3474df; display: flex; height: 42px; justify-content: center; width: 42px; }
.officer-access-heading h3 { color: #27374d; font-size: 16px; margin: 0 0 3px; }
.officer-access-heading p { color: #718096; font-size: 11px; margin: 0; }
.officer-access-control .access-detail-fieldset legend { align-items: center; display: flex; gap: 7px; }
.officer-access-control [data-officer-access-detail] > ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 14px; list-style: none; margin: 12px 0 0; padding: 0; }
.officer-access-control [data-officer-access-detail] > ul li { min-width: 0; }
.officer-access-control [data-officer-access-detail] > ul label { align-items: flex-start; display: flex; gap: 8px; line-height: 1.3; }
.officer-newsletter-access { align-self: start; }
@media (max-width: 760px) { .officer-form-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .officer-access-control [data-officer-access-detail] > ul { grid-template-columns: 1fr; } }
/* Product Category master entry point: only the two business segments are
   offered until the user deliberately enters one of them. */
.category-type-landing{max-width:980px;margin:28px auto;padding:30px}
.category-type-heading{text-align:center;margin-bottom:24px}
.category-type-heading h2{margin:6px 0;color:#002060;font-size:clamp(26px,3vw,38px)}
.category-type-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px}
.category-type-card{position:relative;display:grid;grid-template-columns:auto 1fr auto;grid-template-rows:auto auto;align-items:center;gap:4px 16px;min-height:150px;padding:28px;border:1px solid #c8d7ef;border-radius:22px;background:linear-gradient(145deg,#fff,#eef5ff);color:#002060;text-decoration:none;box-shadow:0 14px 32px rgba(0,32,96,.10);transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
.category-type-card:hover,.category-type-card:focus-visible{transform:translateY(-3px);border-color:#3b82f6;box-shadow:0 18px 38px rgba(0,32,96,.16)}
.category-type-card>span{grid-row:1/3;display:grid;place-items:center;width:54px;height:54px;border-radius:16px;background:#002060;color:#fff;font-size:24px;font-weight:900}
.category-type-card strong{font-size:24px}.category-type-card small{color:#31527d}.category-type-card>i{grid-column:3;grid-row:1/3;font-size:20px}
.category-master-sections{display:flex;align-items:center;gap:18px;flex-wrap:wrap}.category-master-sections .section-label{margin-left:auto}
@media(max-width:700px){.category-type-grid{grid-template-columns:1fr}.category-type-landing{padding:18px}.category-type-card{min-height:125px;padding:20px}}
.bld-document-section {
  margin: 1.25rem 0;
  padding: 1.25rem;
  border: 1px solid var(--border-color, #d8e0eb);
  border-radius: 18px;
  background: #f8fbff;
}

.bld-document-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.bld-document-heading h2,
.bld-document-heading p {
  margin: 0;
}

.bld-document-heading p {
  color: #002060;
  font-size: 0.9rem;
}

.bld-document-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.bld-document-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  padding: 1rem;
  border: 1px solid #cedaeb;
  border-radius: 14px;
  background: #fff;
}

.bld-document-card.is-empty {
  background: #f3f6fa;
}

.bld-document-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 12px;
  background: #e8f0ff;
  color: #1f64d8;
  font-size: 1.2rem;
}

.bld-document-copy {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.bld-document-copy small {
  color: #002060;
  font-weight: 700;
}

.bld-document-open {
  width: fit-content;
  margin-top: 0.35rem;
}

@media (max-width: 720px) {
  .bld-document-heading {
    align-items: start;
    flex-direction: column;
  }

  .bld-document-grid {
    grid-template-columns: 1fr;
  }
}
