/* ═══════════════════════════════════════════════════════════════════════════
   theme.css — Shared design tokens for Ecosistema VIDA UG
   Palette: deep purple #2B063D + orange #FF5A1F on warm cream #FBF7F5
   All pages must link this file BEFORE any page-specific CSS.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* ── Brand colors ── */
  --c-orange:          #FF5A1F;
  --c-orange-mid:      #F15A24;
  --c-orange-hover:    #E84B10;
  --c-orange-light:    #FFF1EB;
  --c-orange-glow:     rgba(255, 90, 31, 0.35);
  --c-purple:          #2B063D;
  --c-purple-bold:     #3A0A4F;

  /* ── Semantic text ── */
  --c-title:           #2D073F;
  --c-label:           #3A0A4F;
  --c-subtitle:        #6F6B6B;
  --c-gray:            #777;

  /* ── Inputs ── */
  --c-input-bg:        #FBF7F6;
  --c-input-border:    #E8DDD9;
  --c-placeholder:     #A0A0A0;

  /* ── Backgrounds ── */
  --bg-warm-white:     #FBF7F5;
  --bg-pale-pink:      #F8EDEA;
  --bg-soft-gray:      #F4F1F0;

  /* ── Surfaces ── */
  --c-separator:       #CFC7C4;
  --shadow-card:       0 18px 45px -12px rgba(43, 6, 61, 0.10), 0 4px 14px rgba(60, 30, 20, 0.05);
  --shadow-card-lg:    0 24px 60px -16px rgba(43, 6, 61, 0.20), 0 6px 18px rgba(60, 30, 20, 0.07);

  /* ── Radii ── */
  --radius-card:       18px;
  --radius-input:      10px;
  --radius-btn:        10px;

  /* ── Sidebar (admin pages) ── */
  --c-sidebar:         #ffffff;
}

/* ── Body warm-cream base ── */
body {
  font-family: 'Public Sans', sans-serif;
  background: var(--bg-warm-white);
}

/* ── White card component ── */
.card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

/* ── Material Symbols baseline ── */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ══════════════════════════════════════════════════════════════════════════
   GLOBAL FIELD LAYER — single source of truth for all form controls.
   Applied after Tailwind forms plugin normalization. Uses !important where
   needed to override utility classes that pages may still carry.
   Login (.login-input) inherits these tokens but keeps its own overrides.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Base: text inputs, select, textarea ── */
input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="radio"]):not([type="checkbox"]),
select,
textarea {
  background-color: var(--c-input-bg) !important;
  border: 1px solid var(--c-input-border) !important;
  border-radius: var(--radius-input) !important;
  min-height: 44px;
  font-size: 15px !important;
  color: #0f172a !important;
  caret-color: var(--c-orange);
  -webkit-text-fill-color: #0f172a;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s !important;
  box-shadow: none !important;
  outline: none !important;
}

/* ── Focus: orange border + warm ring, white bg ── */
input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="radio"]):not([type="checkbox"]):focus,
select:focus,
textarea:focus {
  border-color: var(--c-orange) !important;
  box-shadow: 0 0 0 3px rgba(241, 90, 36, 0.18) !important;
  background-color: #fff !important;
  outline: none !important;
}

/* ── Disabled / readonly ── */
input:disabled,
select:disabled,
textarea:disabled,
input[readonly],
textarea[readonly] {
  background-color: #f1f5f9 !important;  /* slate-100 */
  color: #94a3b8 !important;             /* slate-400 */
  -webkit-text-fill-color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none !important;
}

/* ── Placeholder ── */
input::placeholder,
textarea::placeholder {
  color: var(--c-placeholder) !important;
  opacity: 1;
  -webkit-text-fill-color: var(--c-placeholder);
}

/* ── Checkboxes and radios: orange accent ── */
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--c-orange);
  color: var(--c-orange) !important;        /* @tailwindcss/forms uses color for checked state */
  min-height: unset;
  font-size: unset !important;
  border: 1px solid var(--c-input-border) !important;
  background-color: #fff !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
}
input[type="checkbox"]:focus,
input[type="radio"]:focus {
  box-shadow: 0 0 0 3px rgba(241, 90, 36, 0.18) !important;
  border-color: var(--c-orange) !important;
  outline: none !important;
  background-color: #fff !important;
}
input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background-color: var(--c-orange) !important;
  border-color: var(--c-orange) !important;
}

/* ── Touch-friendly radios/checkboxes inside capture forms ──
   Scoped to <form> so admin table/list checkboxes keep their compact size.
   22px control + a 40px-tall label so the whole label is an easy tap target. */
form input[type="checkbox"],
form input[type="radio"] {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px;
  border-radius: 6px;
  cursor: pointer;
}
form input[type="radio"] { border-radius: 50%; }
form label:has(> input[type="checkbox"]),
form label:has(> input[type="radio"]) {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
}
form label:has(> input[type="checkbox"]) > span,
form label:has(> input[type="radio"]) > span {
  font-size: var(--text-body);
  color: var(--c-label);
}

/* ── File inputs: preserve orange file:// button, don't let height rules break them ── */
input[type="file"] {
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  min-height: unset;
  font-size: 14px !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a;
}
input[type="file"]:focus {
  box-shadow: none !important;
  border: none !important;
  background-color: transparent !important;
}

/* ── Input text fix (autofill tint override) ── */
input:not([type="file"]):not([type="radio"]):not([type="checkbox"]),
select,
textarea {
  caret-color: var(--c-orange);
}

/* ── Input-group prefix/suffix spans (e.g. $, +52, unit labels) ── */
/* These sit adjacent to a field and should share the same border/radius family. */
.input-prefix,
.input-suffix {
  display: inline-flex;
  align-items: center;
  padding: 0 0.75rem;
  background-color: #f1f5f9;           /* slate-100 — neutral, not conflicting */
  border: 1px solid var(--c-input-border);
  color: #475569;                       /* slate-600 */
  font-size: 14px;
  font-weight: 600;
  min-height: 44px;
  white-space: nowrap;
}
.input-prefix { border-right: none; border-radius: var(--radius-input) 0 0 var(--radius-input); }
.input-suffix { border-left: none;  border-radius: 0 var(--radius-input) var(--radius-input) 0; }

/* Fields inside an input-group — override independent radius on left/right ends */
.input-group-start { border-radius: 0 var(--radius-input) var(--radius-input) 0 !important; }
.input-group-end   { border-radius: var(--radius-input) 0 0 var(--radius-input) !important; }

/* ── Admin sidebar nav links (light sidebar) ── */
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
}
.nav-link:hover {
  color: var(--c-orange);
  background-color: #FFF1EB;
}
.nav-link.active {
  background-color: #FFF1EB;
  color: var(--c-orange);
}
.nav-link .material-symbols-outlined {
  color: inherit;
}

/* ── Entrance animation (canonical rise-in) ── */
.rise { animation: rise-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both; }
.rise-1 { animation-delay: 0.04s; }
.rise-2 { animation-delay: 0.10s; }
.rise-3 { animation-delay: 0.16s; }
.rise-4 { animation-delay: 0.22s; }

@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .rise, .rise-1, .rise-2, .rise-3, .rise-4 {
    animation: none;
  }
}

/* ── Orange CTA button ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(90deg, #FF4B0B, #FF681F);
  color: #fff;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-btn);
  box-shadow: 0 4px 14px rgba(255, 90, 31, 0.25);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.2s;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(255, 90, 31, 0.32);
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Orange divider accent ── */
.divider-orange {
  width: 40px;
  height: 2px;
  border-radius: 1px;
  background: var(--c-orange);
  margin: 0 auto;
}

/* ── Toast animations (shared by form pages) ── */
@keyframes toastIn {
  0%   { transform: scale(0.8) translateY(-20px); opacity: 0; }
  60%  { transform: scale(1.05) translateY(0);    opacity: 1; }
  100% { transform: scale(1)    translateY(0);    opacity: 1; }
}
@keyframes toastOut {
  0%   { transform: scale(1);   opacity: 1; }
  100% { transform: scale(0.9); opacity: 0; }
}
.success-toast         { animation: toastIn  0.4s ease-out forwards; }
.success-toast.hiding  { animation: toastOut 0.3s ease-in  forwards; }

/* ── Section divider (form pages) ── */
.section-divider {
  border-top: 2px solid #e2e8f0;
  margin-top: 3rem;
  padding-top: 3rem;
}

/* ══════════════════════════════════════════════════════════════════════════
   SHARED CHROME COMPONENTS — used by all pages except login
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Page warm background with radial glow ── */
.page-bg::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at -5% 10%, rgba(255,255,255,0.70) 0%, rgba(255,255,255,0.25) 35%, transparent 60%),
    radial-gradient(ellipse at 102% 60%, rgba(255,200,170,0.30) 0%, rgba(255,225,210,0.12) 40%, transparent 65%),
    radial-gradient(ellipse at -4% 92%, rgba(255,170,130,0.25) 0%, rgba(255,210,190,0.10) 38%, transparent 62%),
    linear-gradient(165deg, #FBF7F5 0%, #F9F0EC 50%, #FBF7F5 100%);
}

/* ── Floating top bar ── */
.topbar {
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: var(--radius-card);
  box-shadow: 0 4px 20px -4px rgba(43,6,61,0.10), 0 1px 6px rgba(60,30,20,0.04);
}

/* ── Topbar icon badge ── */
.topbar-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #FFF1EB;
  border: 1px solid rgba(255,90,31,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Step pill bar (Región → Captura / Estudio → Técnica → Gestión) ── */
.step-bar {
  background: rgba(255,255,255,0.88);
  border-bottom: 1px solid rgba(226,232,240,0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.step-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  background: transparent;
  transition: all 0.15s;
}
.step-pill.active {
  background: var(--c-orange-light);
  color: var(--c-orange-hover);
  box-shadow: inset 0 0 0 1.5px rgba(255, 90, 31, 0.35);
}
/* Completed step (multi-step capture flow) */
.step-pill.done {
  color: var(--c-success);
}
.step-pill.done .step-pill-num {
  background: var(--c-success);
  color: #fff;
}
.step-pill-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  background: #e2e8f0;
  color: #64748b;
}
.step-pill.active .step-pill-num {
  background: var(--c-orange);
  color: #fff;
}

/* ── Section heading inside a card ── */
.section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-title);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1.5px solid #e2e8f0;
}
.section-heading .material-symbols-outlined {
  color: var(--c-orange);
  font-size: 20px;
}

/* ── Secondary button (white + orange border) ── */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #fff;
  color: var(--c-orange);
  font-weight: 700;
  border: 2px solid rgba(255,90,31,0.60);
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-secondary:hover {
  background: #FFF1EB;
  border-color: var(--c-orange);
}
.btn-secondary:active { transform: scale(0.98); }
.btn-secondary:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Input orange-focus override ── */
.input-field {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-input);
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.input-field:focus {
  outline: none;
  border-color: var(--c-orange);
  box-shadow: 0 0 0 3px rgba(255,90,31,0.15);
}

/* ── Shared light footer ── */
.page-footer {
  background: rgba(255,255,255,0.80);
  border-top: 1px solid rgba(226,232,240,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ══════════════════════════════════════════════════════════════════════════
   GLOBAL ANIMATION LAYER — tasteful motion, all pages
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Card hover lift ── */
.card {
  transition: box-shadow 0.2s ease-out, transform 0.2s ease-out;
}
.card:hover {
  box-shadow: var(--shadow-card-lg);
  transform: translateY(-2px);
}

/* ── Button press scale ── */
.btn-primary:active { transform: scale(0.98); }
.btn-primary:hover  { box-shadow: 0 8px 20px rgba(255, 90, 31, 0.32); }

/* ── Table / list row hover ── */
tr, li {
  transition: background-color 0.15s ease-out;
}

/* ── Modal fade-in backdrop + scale-up content ── */
@keyframes modal-backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes modal-content-in {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);   }
}
.modal-animate-in {
  animation: modal-backdrop-in 0.2s ease-out both;
}
.modal-animate-in > * {
  animation: modal-content-in 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── Step pill smooth color transition ── */
.step-pill {
  transition: background-color 0.2s ease-out, color 0.2s ease-out;
}

/* ── Nav link smooth transition (already has transition:all 0.2s) ── */

/* ── Reduced motion: disable all animations ── */
@media (prefers-reduced-motion: reduce) {
  .card:hover { transform: none; }
  .modal-animate-in,
  .modal-animate-in > * { animation: none; }
}

/* ── Heatmap tooltip ── */
.heatmap-tooltip {
  background: var(--c-purple);
  color: #fff;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  position: absolute;
  z-index: 50;
  transform: translate(-50%, -100%);
  margin-top: -6px;
}
.heatmap-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -4px;
  border: 4px solid transparent;
  border-top-color: var(--c-purple);
}

/* Forced-colors (High Contrast Mode) fallback: box-shadow focus rings are not
   rendered there, so restore a real outline for keyboard navigation. */
@media (forced-colors: active) {
  input:focus,
  select:focus,
  textarea:focus,
  button:focus-visible,
  a:focus-visible {
    outline: 2px solid Highlight !important;
    outline-offset: 2px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Dark mode — toggled by adding .dark to <html> (see assets/js/theme-toggle.js)
   Token overrides first, then targeted overrides for the Tailwind utilities
   used across the views (CDN build, no dark: variants available).
   ═══════════════════════════════════════════════════════════════════════════ */

html.dark {
  color-scheme: dark;

  --c-title:        #F2EBF8;
  --c-label:        #E5DCEE;
  --c-subtitle:     #A89FB3;
  --c-gray:         #9B93A6;

  --c-input-bg:     #241D33;
  --c-input-border: #3B3052;
  --c-placeholder:  #7C7390;

  --bg-warm-white:  #14101F;
  --bg-pale-pink:   #1A1428;
  --bg-soft-gray:   #1D1830;

  --c-separator:    #3B3052;
  --shadow-card:    0 18px 45px -12px rgba(0, 0, 0, 0.55), 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-card-lg: 0 24px 60px -16px rgba(0, 0, 0, 0.65), 0 6px 18px rgba(0, 0, 0, 0.40);

  --c-sidebar:      #1B1529;
}

html.dark body {
  background: var(--bg-warm-white);
  color: #D6D0DE;
}

/* Per-page fixed gradient layers (perfil/admin/tecnico views) */
html.dark body::before,
html.dark .page-bg::before {
  background:
    radial-gradient(ellipse at -5% 10%, rgba(83, 45, 110, 0.30) 0%, transparent 55%),
    radial-gradient(ellipse at 102% 60%, rgba(255, 90, 31, 0.10) 0%, transparent 60%),
    linear-gradient(165deg, #14101F 0%, #191229 50%, #14101F 100%) !important;
}
html.dark .bg-dots-topleft {
  background-image: radial-gradient(circle, rgba(255, 140, 100, 0.14) 1.2px, transparent 1.6px);
}

/* ── Shared components ── */
html.dark .card,
html.dark .topbar {
  background: rgba(27, 21, 41, 0.94);
  border-color: rgba(255, 255, 255, 0.07);
}
html.dark .topbar-icon {
  background: rgba(255, 90, 31, 0.12);
  border-color: rgba(255, 90, 31, 0.25);
}
html.dark .step-bar {
  background: rgba(20, 16, 31, 0.88);
  border-bottom-color: rgba(255, 255, 255, 0.07);
}
html.dark .step-pill-num { background: #2E2744; color: #A89FB3; }
html.dark .section-heading { border-bottom-color: rgba(255, 255, 255, 0.10); }
html.dark .btn-secondary { background: transparent; }
html.dark .btn-secondary:hover { background: rgba(255, 90, 31, 0.12); }
html.dark .nav-link { color: #A89FB3; }
html.dark .nav-link:hover { background: rgba(255, 90, 31, 0.10); color: #E5DCEE; }
html.dark input:disabled,
html.dark select:disabled,
html.dark textarea:disabled,
html.dark input[readonly] {
  background-color: #1D1830 !important;
  color: #7C7390 !important;
}

/* ── Tailwind utility overrides (light-hardcoded classes in views) ── */
html.dark .bg-white            { background-color: #1B1529; }
html.dark .bg-slate-50         { background-color: #201A32; }
html.dark .bg-slate-100        { background-color: #251E38; }
html.dark .bg-slate-200        { background-color: #2E2744; }
html.dark .bg-warm-bg          { background-color: #14101F; }
html.dark .bg-sidebar          { background-color: #1B1529; }
html.dark .bg-orange-50        { background-color: rgba(255, 90, 31, 0.12); }
html.dark .bg-red-50           { background-color: rgba(239, 68, 68, 0.14); }
html.dark .bg-red-100          { background-color: rgba(239, 68, 68, 0.20); }
html.dark .bg-blue-50          { background-color: rgba(59, 130, 246, 0.14); }
html.dark .bg-green-50         { background-color: rgba(34, 197, 94, 0.14); }
html.dark .bg-green-100        { background-color: rgba(34, 197, 94, 0.20); }
html.dark .bg-amber-50         { background-color: rgba(245, 158, 11, 0.14); }
html.dark .bg-amber-100        { background-color: rgba(245, 158, 11, 0.20); }
html.dark .bg-purple-50,
html.dark .bg-purple-100       { background-color: rgba(147, 51, 234, 0.16); }
html.dark .bg-orange-100       { background-color: rgba(255, 90, 31, 0.18); }

html.dark .text-slate-900      { color: #F2EBF8; }
html.dark .text-slate-800      { color: #E5DCEE; }
html.dark .text-slate-700      { color: #CFC7DB; }
html.dark .text-slate-600      { color: #B4AAC2; }
html.dark .text-slate-500      { color: #A89FB3; }
html.dark .text-slate-400      { color: #8D8499; }
html.dark .text-red-500,
html.dark .text-red-600,
html.dark .text-red-700,
html.dark .text-red-800        { color: #FCA5A5; }
html.dark .text-green-600,
html.dark .text-green-700      { color: #86EFAC; }
html.dark .text-amber-600,
html.dark .text-amber-700,
html.dark .text-amber-800,
html.dark .text-amber-900      { color: #FCD34D; }
html.dark .text-blue-600,
html.dark .text-blue-800,
html.dark .text-blue-900       { color: #BFDBFE; }

html.dark .border-slate-100    { border-color: rgba(255, 255, 255, 0.07); }
html.dark .border-slate-200    { border-color: rgba(255, 255, 255, 0.10); }
html.dark .border-slate-300    { border-color: rgba(255, 255, 255, 0.16); }
html.dark .border-orange-100   { border-color: rgba(255, 90, 31, 0.25); }
html.dark .border-red-100,
html.dark .border-red-200      { border-color: rgba(239, 68, 68, 0.35); }
html.dark .border-green-200    { border-color: rgba(34, 197, 94, 0.35); }
html.dark .border-amber-200    { border-color: rgba(245, 158, 11, 0.35); }
html.dark .border-blue-200     { border-color: rgba(59, 130, 246, 0.35); }
html.dark .border-purple-100   { border-color: rgba(147, 51, 234, 0.30); }
html.dark .divide-slate-100 > :not([hidden]) ~ :not([hidden]),
html.dark .divide-slate-50  > :not([hidden]) ~ :not([hidden]) { border-color: rgba(255, 255, 255, 0.07); }

html.dark .hover\:bg-slate-50:hover   { background-color: #251E38; }
html.dark .hover\:bg-slate-100:hover,
html.dark .hover\:bg-slate-200:hover  { background-color: #2E2744; }
html.dark .hover\:bg-orange-50:hover  { background-color: rgba(255, 90, 31, 0.14); }
html.dark .bene-row:hover             { background: #221B36; }
html.dark .captura-card:hover         { border-color: rgba(255, 255, 255, 0.20); }

/* ── Dark mode refinements (logos, inline-styled headers, tint opacities,
      select/input text, login surfaces) ── */

/* Form controls: light text always; keep the dark surface even on focus.
   -webkit-text-fill-color must be overridden too — login.css forces it to a
   near-black value, which on WebKit paints over `color` and makes typed text
   invisible on the dark input background. */
html.dark input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="radio"]):not([type="checkbox"]),
html.dark select,
html.dark textarea {
  background-color: var(--c-input-bg) !important;
  color: #E8DFEE !important;
  -webkit-text-fill-color: #E8DFEE !important;
}

/* Input prefix/suffix chips (phone "+52", money "$") hardcode a light slate-100
   background with slate-600 text — a light chip welded to a dark input. Recolor
   to match the dark input surface. */
html.dark .input-prefix,
html.dark .input-suffix {
  background-color: var(--c-input-bg);
  border-color: var(--c-input-border);
  color: #B4AAC2;
}

/* .text-primary is the deep-purple brand color (#2B063D) used for icons (stat
   cards, avatar face). Invisible on dark surfaces — lift to a light purple. */
html.dark .text-primary { color: #D8B4FE; }
html.dark select option {
  background-color: #1B1529;
  color: #E8DFEE;
}
html.dark .login-input:focus {
  background-color: var(--c-input-bg) !important;
}

/* Inline light backgrounds (admin card headers, icon chips) */
html.dark [style*="FFF9F7"],
html.dark [style*="FFF5F0"] { background: rgba(255, 90, 31, 0.07) !important; }
html.dark [style*="FFF1EB"],
html.dark [style*="FFE4D6"] { background: rgba(255, 90, 31, 0.14) !important; }

/* Tint utilities with opacity suffix (not covered by the plain overrides) */
html.dark .bg-purple-50\/70  { background-color: rgba(147, 51, 234, 0.14) !important; }
html.dark .bg-green-50\/30,
html.dark .bg-green-50\/80   { background-color: rgba(34, 197, 94, 0.12) !important; }
html.dark .bg-orange-50\/30,
html.dark .bg-orange-50\/80  { background-color: rgba(255, 90, 31, 0.12) !important; }
html.dark .bg-red-50\/70     { background-color: rgba(239, 68, 68, 0.12) !important; }
html.dark .bg-slate-50\/60   { background-color: #201A32 !important; }
html.dark .bg-white\/20,
html.dark .bg-white\/60,
html.dark .bg-white\/70      { background-color: rgba(27, 21, 41, 0.80) !important; }

/* Logos must stay on a light chip to remain legible */
html.dark .bg-white:has(> img),
html.dark [class*="bg-white"]:has(> img) {
  background-color: #F6F2FA !important;
}
html.dark .brand-header img {
  background: #F6F2FA;
  border-radius: 10px;
  padding: 6px 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

/* Login surfaces */
html.dark .login-card {
  background: rgba(27, 21, 41, 0.93);
  border-color: rgba(255, 255, 255, 0.08);
}
html.dark .login-video {
  background: #1B1529;
}
html.dark .login-footer {
  background: rgba(20, 16, 31, 0.88);
  border-top-color: rgba(255, 255, 255, 0.08);
}

/* Sidebar active/hover pill (light #FFF1EB in light mode) */
html.dark .nav-link.active,
html.dark .nav-link:hover {
  background-color: rgba(255, 90, 31, 0.14);
}

/* Login logos use mix-blend-mode: multiply to blend into the warm light
   background — on dark that drops out the multiply and leaves dark ink on a
   dark surface, so they read as muddy/invisible. Disable the blend AND seat
   each logo on a subtle light chip (same treatment as .brand-header img) so
   the brand colors stay legible. */
html.dark .logo-vida-ug,
html.dark .logo-hope-haven,
html.dark .logo-rotary {
  mix-blend-mode: normal;
  background: #F6F2FA;
  border-radius: 10px;
  padding: 8px 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

/* Login footer: NEUXORA + links hardcode var(--c-purple-bold) (#3A0A4F), which
   is a brand token NOT remapped in dark, so it reads as near-black on the dark
   footer. Lighten the text only; hover keeps the orange accent. */
html.dark .login-footer .footer-neuxora strong,
html.dark .login-footer .footer-links a { color: #E5DCEE; }
html.dark .login-footer .footer-links a:hover { color: var(--c-orange); }

/* Status badges (técnico list) use light pastel chips with dark ink — fine on
   cream, muddy on dark. Re-tint to the dark palette. */
html.dark .badge-sin_iniciar { background: #2E2744; color: #B4AAC2; }
html.dark .badge-en_proceso  { background: rgba(147, 51, 234, 0.18); color: #D8B4FE; }
html.dark .badge-finalizado  { background: rgba(34, 197, 94, 0.20); color: #86EFAC; }

/* ═══════════════════════════════════════════════════════════════════════════
   Delight micro-animations (profiles, panels)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Icon chips and avatars pop in on page load */
@keyframes sr-chip-pop {
  0%   { transform: scale(0.4); opacity: 0; }
  70%  { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.topbar-icon,
#profile-avatar,
#header-avatar {
  animation: sr-chip-pop 0.5s cubic-bezier(0.22, 1.4, 0.36, 1) 0.15s both;
}

/* Topbar icon and avatars wiggle on hover */
@keyframes sr-icon-wiggle {
  0%   { transform: rotate(0); }
  30%  { transform: rotate(-10deg) scale(1.1); }
  60%  { transform: rotate(8deg) scale(1.06); }
  100% { transform: rotate(0) scale(1); }
}
.topbar-icon:hover,
#profile-avatar:hover,
#header-avatar:hover {
  animation: sr-icon-wiggle 0.5s ease-in-out 1;
}

/* Sidebar / nav icons nudge forward on hover */
.nav-link .material-symbols-outlined {
  transition: transform 0.18s ease;
}
.nav-link:hover .material-symbols-outlined {
  transform: translateX(3px) scale(1.12);
}

/* Live status dot: soft green pulse (e.g. "Perfil activo") */
@keyframes sr-dot-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
  70%  { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
.status-dot {
  animation: sr-dot-pulse 2s ease-out infinite;
}

/* Stat numbers get a tiny celebratory pop when the count-up lands */
@keyframes sr-stat-pop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.sr-stat-pop {
  display: inline-block;
  animation: sr-stat-pop 0.35s cubic-bezier(0.22, 1.2, 0.36, 1) 1;
}

@media (prefers-reduced-motion: reduce) {
  .topbar-icon,
  #profile-avatar,
  #header-avatar,
  .topbar-icon:hover,
  #profile-avatar:hover,
  #header-avatar:hover,
  .status-dot,
  .sr-stat-pop {
    animation: none;
  }
  .nav-link:hover .material-symbols-outlined {
    transform: none;
  }
}

/* ── Thinking spark (Claude Code-style loading indicator) ── */
.sr-thinking {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 500;
}
.sr-spark {
  color: var(--c-orange);
  display: inline-block;
  width: 1.2em;
  text-align: center;
  animation: sr-spark-pulse 1.2s ease-in-out infinite;
}
@keyframes sr-spark-pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.92); }
  50%      { opacity: 1;    transform: scale(1.1); }
}
@media (prefers-reduced-motion: reduce) {
  .sr-spark { animation: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   FASE 0 — UNIFIED FOUNDATIONS
   Type scale, semantic color scale, button hierarchy, Badge, stat-card and
   micro-interaction primitives. Additive: pages opt in by using these classes.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* ── Type scale (single ramp, all modules) ── */
  --text-page:   clamp(1.5rem, 1.15rem + 1.4vw, 1.875rem); /* page title  24→30 */
  --text-h2:     1.25rem;    /* section title            20 */
  --text-h3:     1.0625rem;  /* card title               17 */
  --text-body:   0.9375rem;  /* body (matches inputs)    15 */
  --text-sm:     0.8125rem;  /* secondary / table        13 */
  --text-xs:     0.6875rem;  /* caption / eyebrow        11 */

  /* ── Semantic status scale (AA ink on its own bg) ── */
  --c-success:    #15803D;  --c-success-bg: #DCFCE7;
  --c-warning:    #B45309;  --c-warning-bg: #FEF3C7;
  --c-danger:     #B91C1C;  --c-danger-bg:  #FEE2E2;
  --c-info:       #1D4ED8;  --c-info-bg:    #DBEAFE;
  --c-neutral:    #475569;  --c-neutral-bg: #F1F5F9;
  --c-role:       #7E22CE;  --c-role-bg:    rgba(147, 51, 234, 0.12);

  /* ── Spacing rhythm ── */
  --space-card:   1.25rem;   /* canonical inner card padding */
}

/* ── Type scale utilities ── */
.t-page-title    { font-size: var(--text-page); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; color: var(--c-title); }
.t-section-title { font-size: var(--text-h2);   font-weight: 700; line-height: 1.25; color: var(--c-title); }
.t-card-title    { font-size: var(--text-h3);   font-weight: 700; line-height: 1.3;  color: var(--c-title); }
.t-subtitle      { font-size: var(--text-body); font-weight: 400; line-height: 1.5;  color: var(--c-subtitle); }
.t-body          { font-size: var(--text-body); line-height: 1.6; color: #334155; }
.t-label         { font-size: var(--text-sm);   font-weight: 600; letter-spacing: 0.01em; color: var(--c-label); }
.t-caption       { font-size: var(--text-xs);   font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-gray); }

/* ── Tertiary / ghost button (third level under primary + secondary) ── */
.btn-tertiary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--c-label);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, transform 0.15s;
}
.btn-tertiary:hover  { background: rgba(43, 6, 61, 0.06); color: var(--c-title); }
.btn-tertiary:active { transform: scale(0.98); }
.btn-tertiary:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Square icon-action button (toolbars, table row actions) ── */
.btn-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 12px;
  border: 1px solid var(--c-separator);
  background: transparent;
  color: var(--c-gray);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.btn-icon:hover  { transform: translateY(-1px); }
.btn-icon:active { transform: scale(0.95); }
.btn-icon:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-icon .material-symbols-outlined { font-size: 20px; }

/* ── Badge — one component, variants by category (estado / rol / organización) ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge .material-symbols-outlined { font-size: 13px; }
.badge--lg { padding: 6px 14px; font-size: var(--text-sm); }
.badge--lg .material-symbols-outlined { font-size: 16px; }
.badge--neutral { background: var(--c-neutral-bg); color: var(--c-neutral); }
.badge--success { background: var(--c-success-bg); color: var(--c-success); }
.badge--warning { background: var(--c-warning-bg); color: var(--c-warning); }
.badge--danger  { background: var(--c-danger-bg);  color: var(--c-danger); }
.badge--info    { background: var(--c-info-bg);    color: var(--c-info); }
.badge--brand   { background: var(--c-orange-light); color: var(--c-orange-hover); }
.badge--role    { background: var(--c-role-bg);    color: var(--c-role); }       /* rol */
.badge--outline { background: transparent; border: 1px solid var(--c-separator); color: var(--c-label); } /* organización */

/* ── Stat card — uniform metric tile (perfil, organización, admin) ── */
.stat-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--space-card);
  transition: box-shadow 0.2s ease-out, transform 0.2s ease-out;
}
.stat-card:hover { box-shadow: var(--shadow-card-lg); transform: translateY(-2px); }
.stat-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-orange-light);
  color: var(--c-orange);
}
.stat-card__icon .material-symbols-outlined { font-size: 22px; }
.stat-card__body  { display: flex; flex-direction: column; line-height: 1.1; }
.stat-card__value { font-size: 1.5rem; font-weight: 800; color: var(--c-title); letter-spacing: -0.01em; }
.stat-card__label { font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--c-gray); margin-top: 2px; }
.stat-card--success .stat-card__icon { background: var(--c-success-bg); color: var(--c-success); }
.stat-card--warning .stat-card__icon { background: var(--c-warning-bg); color: var(--c-warning); }
.stat-card--info    .stat-card__icon { background: var(--c-info-bg);    color: var(--c-info); }
.stat-card--danger  .stat-card__icon { background: var(--c-danger-bg);  color: var(--c-danger); }

/* ── Interactive surface (clickable cards / rows) ── */
.interactive { cursor: pointer; transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.15s ease; }
.interactive:hover { transform: translateY(-2px); }

/* ── Skeleton loader ── */
.skeleton {
  position: relative;
  overflow: hidden;
  background: #ECE6E3;
  border-radius: 8px;
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: sr-shimmer 1.3s infinite;
}
@keyframes sr-shimmer { 100% { transform: translateX(100%); } }

/* ── Success check pop ── */
@keyframes sr-check-pop {
  0%   { transform: scale(0); }
  60%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}
.sr-check { display: inline-block; animation: sr-check-pop 0.4s cubic-bezier(0.22, 1.4, 0.36, 1) both; }

/* ── Tabs (modal detail, org panels) — underline-active, reusable ── */
.modal-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1.5px solid #e2e8f0;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 5;
  overflow-x: auto;
}
.modal-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 11px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-gray);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.modal-tab .material-symbols-outlined { font-size: 16px; }
.modal-tab:hover { color: var(--c-title); }
.modal-tab.active { color: var(--c-orange-hover); border-bottom-color: var(--c-orange); }

/* Detail modal (técnico): 4 tabs must fit the narrow modal without horizontal
   scroll — equal-width, icon-over-label, compact. Scoped so page tabs (org)
   keep their horizontal icon+label layout. */
#modal-content .modal-tabs { gap: 0; overflow-x: visible; }
#modal-content .modal-tab {
  flex: 1 1 0;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
  padding: 8px 4px;
  font-size: 11px;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
}

/* ── Scroll-more indicator (bottom fade + bouncing chevron) ── */
.modal-scroll-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 44px;
  pointer-events: none;
  border-radius: 0 0 1rem 1rem;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.96) 15%, rgba(255, 255, 255, 0));
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 5px;
}
.modal-scroll-hint::after {
  content: '\e5cf'; /* expand_more codepoint — robust vs. CSS-content ligatures */
  font-family: 'Material Symbols Outlined';
  font-size: 20px;
  color: var(--c-gray);
  animation: sr-bounce 1.4s ease-in-out infinite;
}
@keyframes sr-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }

html.dark .modal-tabs { background: #1B1529; border-bottom-color: rgba(255, 255, 255, 0.10); }
html.dark .modal-tab.active { color: #FFB088; }
html.dark .modal-scroll-hint { background: linear-gradient(to top, rgba(27, 21, 41, 0.96) 15%, rgba(27, 21, 41, 0)); }

@media (prefers-reduced-motion: reduce) { .modal-scroll-hint::after { animation: none; } }

/* ── Searchable select (combobox) — see assets/js/sr-select.js ── */
.sr-select { position: relative; }
.sr-select__native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  opacity: 0 !important;
  pointer-events: none;
}
.sr-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  text-align: left;
  background: var(--c-input-bg);
  border: 1px solid var(--c-input-border);
  border-radius: var(--radius-input);
  color: #0f172a;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.sr-select__trigger:hover { border-color: var(--c-orange); }
.sr-select__trigger--disabled,
.sr-select__trigger:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}
.sr-select__trigger--disabled:hover { border-color: var(--c-input-border); }
.sr-select__trigger[aria-expanded="true"] {
  border-color: var(--c-orange);
  box-shadow: 0 0 0 3px rgba(241, 90, 36, 0.18);
}
.sr-select__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-body); }
.sr-select__placeholder { color: var(--c-placeholder); }
.sr-select__caret { font-size: 20px; color: var(--c-gray); flex-shrink: 0; }
.sr-select__pop {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid var(--c-input-border);
  border-radius: var(--radius-input);
  box-shadow: var(--shadow-card);
  padding: 6px;
  max-height: 280px;
  display: flex;
  flex-direction: column;
  animation: fade-in 0.12s ease-out;
}
.sr-select__search { width: 100%; margin-bottom: 6px; }
.sr-select__list { overflow-y: auto; }
.sr-select__opt {
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: var(--text-body);
  color: var(--c-label);
}
.sr-select__opt:hover,
.sr-select__opt.active { background: var(--c-orange-light); color: var(--c-orange-hover); }
.sr-select__opt[aria-selected="true"] { font-weight: 700; color: var(--c-orange-hover); }
.sr-select__empty { padding: 12px; text-align: center; color: var(--c-gray); font-size: var(--text-sm); }

html.dark .sr-select__trigger { background: var(--c-input-bg); color: #E8DFEE; }
html.dark .sr-select__pop { background: #1B1529; border-color: var(--c-input-border); }
html.dark .sr-select__opt { color: #C9C2D6; }
@media (prefers-reduced-motion: reduce) { .sr-select__pop { animation: none; } }

/* ── Collapsible section (optional form content) — see assets/js/sr-collapse.js ── */
.sr-collapse {
  border: 1px solid var(--c-separator);
  border-radius: var(--radius-input);
  overflow: hidden;
}
.sr-collapse__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-soft-gray);
  border: none;
  cursor: pointer;
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--c-label);
  transition: background-color 0.15s;
}
.sr-collapse__head:hover { background: var(--c-orange-light); }
.sr-collapse__chevron { color: var(--c-gray); transition: transform 0.25s ease; flex-shrink: 0; }
.sr-collapse.open .sr-collapse__chevron { transform: rotate(180deg); }
.sr-collapse__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}
.sr-collapse.open .sr-collapse__body { grid-template-rows: 1fr; }
.sr-collapse__inner { overflow: hidden; }
.sr-collapse__inner > * { padding: 14px; }

html.dark .sr-collapse { border-color: rgba(255, 255, 255, 0.10); }
html.dark .sr-collapse__head { background: rgba(255, 255, 255, 0.04); }
html.dark .sr-collapse__head:hover { background: rgba(255, 90, 31, 0.12); }
@media (prefers-reduced-motion: reduce) {
  .sr-collapse__body { transition: none; }
  .sr-collapse__chevron { transition: none; }
}

/* ── Responsive captures table: stack rows as cards below md (no horizontal
   scroll), keeping the status visible. Columns: 1 Beneficiario · 2 CURP ·
   3 Fecha · 4 Capturista · 5 Estatus · 6 Acciones. ── */
@media (max-width: 767px) {
  .bene-table { min-width: 0 !important; }
  .bene-table thead { display: none; }
  .bene-table tbody tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #eef0f3;
  }
  .bene-table tbody td { padding: 0 !important; white-space: normal !important; }
  .bene-table tbody td:nth-child(1) { flex: 1 1 100%; }      /* beneficiario */
  .bene-table tbody td:nth-child(2),                          /* curp */
  .bene-table tbody td:nth-child(3) { flex: 0 0 auto; font-size: 12px; }  /* fecha */
  .bene-table tbody td:nth-child(4) { display: none; }        /* capturista (own list) */
  .bene-table tbody td:nth-child(5) { flex: 0 0 auto; }       /* estatus */
  .bene-table tbody td:nth-child(6) { flex: 1 1 auto; text-align: right; }  /* acciones */
}
html.dark .bene-table tbody tr { border-bottom-color: rgba(255,255,255,0.07); }

/* ── Dark-mode treatment for Fase 0 components ── */
html.dark {
  --c-success-bg: rgba(34, 197, 94, 0.18);  --c-success: #86EFAC;
  --c-warning-bg: rgba(245, 158, 11, 0.18); --c-warning: #FCD34D;
  --c-danger-bg:  rgba(239, 68, 68, 0.18);  --c-danger:  #FCA5A5;
  --c-info-bg:    rgba(59, 130, 246, 0.18); --c-info:    #BFDBFE;
  --c-neutral-bg: #2E2744;                  --c-neutral: #B4AAC2;
  --c-role-bg:    rgba(147, 51, 234, 0.20); --c-role:    #D8B4FE;
}
html.dark .t-body { color: #C9C2D6; }
html.dark .btn-tertiary:hover { background: rgba(255, 255, 255, 0.07); color: var(--c-title); }
html.dark .btn-icon { border-color: rgba(255, 255, 255, 0.12); color: #A89FB3; }
html.dark .badge--outline { border-color: rgba(255, 255, 255, 0.16); color: var(--c-label); }
html.dark .stat-card { background: rgba(27, 21, 41, 0.94); border-color: rgba(255, 255, 255, 0.07); }
html.dark .stat-card__icon { background: rgba(255, 90, 31, 0.14); color: #FFB088; }
html.dark .skeleton { background: #2A2340; }
html.dark .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent); }

@media (prefers-reduced-motion: reduce) {
  .stat-card:hover, .interactive:hover { transform: none; }
  .skeleton::after { animation: none; }
  .sr-check { animation: none; }
}
