/* ============================================================
   NefroSys — Theme overlay (3 modos)
   No modifica style.css. Sobreescribe las variables --c-* globales.
   data-theme="light"  → tema actual pulido (default)
   data-theme="dark"   → modo oscuro clínico
   data-theme="tablet" → alto contraste pie de máquina
   ============================================================ */

/* ---------- LIGHT (refinado del default) ---------- */
:root,
html[data-theme="light"] {
  --c-primary:       #0b4a6f;
  --c-primary-soft:  #eef4fb;
  --c-border:        #d0d7de;
  --c-text:          #1f2328;
  --c-muted:         #656d76;
  --c-bg:            #f6f8fa;
  --c-surface:       #ffffff;
  --c-ok:            #2ea043;
  --c-ok-bg:         #e6f5ea;
  --c-warn:          #bf8700;
  --c-warn-bg:       #fff8c5;
  --c-crit:          #cf222e;
  --c-crit-bg:       #ffebe9;
  --c-info:          #0969da;
  --c-info-bg:       #ddf4ff;
}

/* ---------- DARK (clinical dark) ---------- */
html[data-theme="dark"] {
  --c-primary:       #3FB1A8;
  --c-primary-soft:  #18302e;
  --c-border:        #1F2A33;
  --c-text:          #E6EDF3;
  --c-muted:         #8B96A3;
  --c-bg:            #0B1014;
  --c-surface:       #11181F;
  --c-ok:            #34C387;
  --c-ok-bg:         #0E2A1E;
  --c-warn:          #E0A93B;
  --c-warn-bg:       #2A2010;
  --c-crit:          #FF6B6B;
  --c-crit-bg:       #2A1313;
  --c-info:          #60A5FA;
  --c-info-bg:       #0F1E33;
  color-scheme: dark;
}
html[data-theme="dark"] body { background: var(--c-bg); color: var(--c-text); }
html[data-theme="dark"] .clinical-body,
html[data-theme="dark"] .dashboard-body { background: var(--c-bg); color: var(--c-text); }
html[data-theme="dark"] header.topbar { background: #0E1620; box-shadow: 0 1px 0 var(--c-border); }
html[data-theme="dark"] header.topbar .topbar-logo {
  background: rgba(255,255,255,0.04);
  box-shadow: 0 1px 0 rgba(255,255,255,0.04);
  filter: brightness(1.1);
}
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: var(--c-surface);
  color: var(--c-text);
  border-color: var(--c-border);
}
html[data-theme="dark"] table { color: var(--c-text); }
html[data-theme="dark"] th,
html[data-theme="dark"] td { border-color: var(--c-border); }
html[data-theme="dark"] thead { background: rgba(63,177,168,0.08); }
html[data-theme="dark"] tr:hover td { background: rgba(63,177,168,0.05); }

/* Login dark — mantiene fondo + mascota pero adapta panel form */
html[data-theme="dark"] .login-body { background: #0B1014; }
html[data-theme="dark"] .login-body-split { background: #0B1014; }
html[data-theme="dark"] .login-panel-split,
html[data-theme="dark"] .login-card {
  background: #11181F !important;
  color: var(--c-text);
  border-color: var(--c-border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(63,177,168,0.15);
}
html[data-theme="dark"] .login-form-title,
html[data-theme="dark"] .login-system-name { color: var(--c-text) !important; }
html[data-theme="dark"] .login-sub,
html[data-theme="dark"] .login-system-tag,
html[data-theme="dark"] .login-remember-note,
html[data-theme="dark"] .login-footer { color: var(--c-muted) !important; }
html[data-theme="dark"] .field-label { color: var(--c-text) !important; font-weight: 600; }
html[data-theme="dark"] .field-wrap {
  background: #0B1014 !important;
  border: 1px solid var(--c-border) !important;
}
html[data-theme="dark"] .field-wrap input {
  background: transparent !important;
  color: var(--c-text) !important;
  caret-color: var(--c-primary);
}
html[data-theme="dark"] .field-wrap input::placeholder { color: #6B7785 !important; }
html[data-theme="dark"] .field-wrap:focus-within {
  border-color: var(--c-primary) !important;
  box-shadow: 0 0 0 3px rgba(63,177,168,0.15);
}
html[data-theme="dark"] .field-ico,
html[data-theme="dark"] .field-toggle { color: var(--c-muted); }
html[data-theme="dark"] .login-system-logo-wrap { background: rgba(63,177,168,0.08); border-radius: 12px; padding: 8px; }
html[data-theme="dark"] .btn-primary {
  background: var(--c-primary) !important;
  color: #06121A !important;
  border: none !important;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(63,177,168,0.25);
}
html[data-theme="dark"] .btn-primary:hover { filter: brightness(1.1); }
html[data-theme="dark"] .login-error {
  background: var(--c-crit-bg) !important;
  color: var(--c-crit) !important;
  border-color: rgba(255,107,107,0.3) !important;
}
html[data-theme="dark"] .caps-warning {
  background: var(--c-warn-bg) !important;
  color: var(--c-warn) !important;
  border-color: rgba(224,169,59,0.3) !important;
}

/* Cards / surfaces genéricos */
html[data-theme="dark"] .dash-hero,
html[data-theme="dark"] [class*="-card"]:not(.login-card),
html[data-theme="dark"] [class*="card-"]:not(.login-card) {
  background: var(--c-surface);
  border-color: var(--c-border);
  color: var(--c-text);
}
html[data-theme="dark"] .dash-section-title { color: var(--c-text); }

/* ---------- TABLET HC (alto contraste, hit-targets grandes) ---------- */
html[data-theme="tablet"] {
  --c-primary:       #0b4a6f;
  --c-primary-soft:  #eaf3fb;
  --c-border:        #94a3b8;
  --c-text:          #0F172A;
  --c-muted:         #334155;
  --c-bg:            #F2F5F8;
  --c-surface:       #FFFFFF;
  --c-ok:            #15803D;
  --c-ok-bg:         #DCFCE7;
  --c-warn:          #B45309;
  --c-warn-bg:       #FEF3C7;
  --c-crit:          #B91C1C;
  --c-crit-bg:       #FEE2E2;
  --c-info:          #1D4ED8;
  --c-info-bg:       #DBEAFE;
  font-size: 16px;
}
html[data-theme="tablet"] body { font-size: 16px; }
html[data-theme="tablet"] button,
html[data-theme="tablet"] .btn,
html[data-theme="tablet"] input,
html[data-theme="tablet"] select {
  min-height: 48px;
  font-size: 16px;
}
html[data-theme="tablet"] .field-wrap { min-height: 52px; }
html[data-theme="tablet"] th, html[data-theme="tablet"] td { padding: 12px 14px; }
html[data-theme="tablet"] header.topbar { padding: 14px 24px; }

/* ============================================================
   FLOATING THEME SWITCH (inyectado por theme-switch.js)
   ============================================================ */
.ns-theme-switch {
  position: fixed;
  top: 14px; right: 14px;
  z-index: 9999;
  display: flex; gap: 2px; padding: 5px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25), 0 2px 6px rgba(0,0,0,0.12);
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
}
html[data-theme="dark"] .ns-theme-switch {
  background: color-mix(in oklab, #11181F 85%, transparent);
}
.ns-theme-switch button {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--c-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.12s, color 0.12s;
  font-family: inherit;
}
.ns-theme-switch button:hover:not(.on) {
  color: var(--c-text);
  background: var(--c-primary-soft);
}
.ns-theme-switch button.on {
  background: var(--c-primary);
  color: #ffffff;
}
html[data-theme="dark"] .ns-theme-switch button.on {
  background: var(--c-primary);
  color: #06121A;
}
.ns-theme-switch svg {
  width: 13px; height: 13px;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.ns-theme-switch .ns-theme-meta {
  display: flex; align-items: center;
  padding: 0 12px; margin-left: 4px;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--c-muted);
  border-left: 1px solid var(--c-border);
}
.ns-theme-switch .ns-theme-meta-reason {
  margin-left: 6px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  opacity: 0.7;
}

/* Print: hide switch */
@media print { .ns-theme-switch { display: none !important; } }

/* ============================================================
   INGRESO DE PESO — rediseño dark + tablet (vista turno)
   ============================================================ */
html[data-theme="dark"] .peso-body,
html[data-theme="tablet"] .peso-body {
  background: var(--c-bg) !important;
}

/* Topbar con acento verde-cyan en dark */
html[data-theme="dark"] .peso-body header.topbar {
  background: linear-gradient(180deg, #0E1620 0%, #0B1014 100%) !important;
  border-bottom: 1px solid var(--c-border);
  box-shadow: 0 1px 0 rgba(63,177,168,0.08);
}
html[data-theme="dark"] .peso-body header.topbar h1 {
  color: var(--c-text);
  font-weight: 600;
  letter-spacing: 0.01em;
}
html[data-theme="dark"] .peso-body .topbar-sep { background: rgba(63,177,168,0.2); }

/* Layout main */
html[data-theme="dark"] .peso-main,
html[data-theme="tablet"] .peso-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Cards generales del flujo de peso */
html[data-theme="dark"] .peso-card {
  background: var(--c-surface) !important;
  border: 1px solid var(--c-border) !important;
  border-radius: 14px !important;
  padding: 24px 28px !important;
  box-shadow: 0 8px 28px rgba(0,0,0,0.35), 0 0 0 1px rgba(63,177,168,0.04) !important;
  color: var(--c-text);
}
html[data-theme="tablet"] .peso-card {
  border-radius: 14px !important;
  padding: 28px !important;
  border: 2px solid var(--c-border) !important;
  background: #fff !important;
}

/* Hero */
html[data-theme="dark"] .peso-card-hero,
html[data-theme="tablet"] .peso-card-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-left: 4px solid var(--c-primary) !important;
  padding-left: 24px !important;
}
html[data-theme="dark"] .peso-card-hero h2,
html[data-theme="tablet"] .peso-card-hero h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: -0.01em;
}
html[data-theme="dark"] .peso-card-hero p,
html[data-theme="tablet"] .peso-card-hero p {
  margin: 0;
  color: var(--c-muted);
  font-size: 14px;
  line-height: 1.55;
  max-width: 60ch;
}
html[data-theme="tablet"] .peso-card-hero h2 { font-size: 26px; }
html[data-theme="tablet"] .peso-card-hero p { font-size: 16px; }

html[data-theme="dark"] .peso-card-hero .btn {
  background: rgba(63,177,168,0.1) !important;
  color: var(--c-primary) !important;
  border: 1px solid rgba(63,177,168,0.3) !important;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
html[data-theme="dark"] .peso-card-hero .btn:hover {
  background: rgba(63,177,168,0.18) !important;
}

/* Search card */
html[data-theme="dark"] .peso-search-card,
html[data-theme="tablet"] .peso-search-card {
  display: flex; flex-direction: column; gap: 14px;
}
html[data-theme="dark"] .peso-date-row label,
html[data-theme="dark"] .peso-search-label,
html[data-theme="dark"] .peso-form label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-muted);
}
html[data-theme="tablet"] .peso-date-row label,
html[data-theme="tablet"] .peso-search-label,
html[data-theme="tablet"] .peso-form label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-text);
}

html[data-theme="dark"] .peso-body input[type="text"],
html[data-theme="dark"] .peso-body input[type="number"],
html[data-theme="dark"] .peso-body input[type="search"],
html[data-theme="dark"] .peso-body input[type="date"] {
  background: #0B1014 !important;
  color: var(--c-text) !important;
  border: 1px solid var(--c-border) !important;
  border-radius: 10px !important;
  padding: 12px 14px !important;
  font-size: 15px !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  font-weight: 500 !important;
  font-family: inherit;
  transition: border-color 0.12s, box-shadow 0.12s;
}
html[data-theme="dark"] .peso-body input:focus {
  border-color: var(--c-primary) !important;
  box-shadow: 0 0 0 3px rgba(63,177,168,0.18) !important;
  outline: none !important;
}
html[data-theme="dark"] .peso-body input::placeholder { color: #6B7785 !important; }
html[data-theme="dark"] .peso-body input[readonly] {
  background: rgba(63,177,168,0.04) !important;
  color: var(--c-primary) !important;
  font-weight: 600 !important;
  font-variant-numeric: tabular-nums;
}

html[data-theme="tablet"] .peso-body input[type="text"],
html[data-theme="tablet"] .peso-body input[type="number"],
html[data-theme="tablet"] .peso-body input[type="search"],
html[data-theme="tablet"] .peso-body input[type="date"] {
  background: #fff !important;
  color: var(--c-text) !important;
  border: 2px solid #94a3b8 !important;
  border-radius: 12px !important;
  padding: 16px 18px !important;
  font-size: 18px !important;
  font-weight: 600 !important;
  min-height: 56px !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}
html[data-theme="tablet"] .peso-body input:focus {
  border-color: var(--c-primary) !important;
  box-shadow: 0 0 0 4px rgba(11,74,111,0.15) !important;
  outline: none !important;
}
html[data-theme="tablet"] .peso-body input[readonly] {
  background: #eef4fb !important;
  color: var(--c-primary) !important;
  font-weight: 700 !important;
}

/* Search results dropdown */
html[data-theme="dark"] .peso-results {
  background: #0E1620 !important;
  border: 1px solid var(--c-border) !important;
  border-radius: 10px !important;
  margin-top: 4px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5) !important;
  color: var(--c-text);
  max-height: 280px;
  overflow-y: auto;
}
html[data-theme="dark"] .peso-results > * {
  border-bottom: 1px solid var(--c-border);
  padding: 12px 14px;
}
html[data-theme="dark"] .peso-results > *:hover {
  background: rgba(63,177,168,0.08);
  cursor: pointer;
}

/* Help text */
html[data-theme="dark"] .peso-help {
  font-size: 12px;
  color: var(--c-muted);
  padding: 10px 14px;
  background: rgba(96,165,250,0.06);
  border-left: 3px solid var(--c-info);
  border-radius: 6px;
  margin-top: 4px;
}
html[data-theme="tablet"] .peso-help {
  font-size: 14px;
  padding: 14px 18px;
  background: var(--c-info-bg);
  color: var(--c-info);
  border-left: 4px solid var(--c-info);
  border-radius: 8px;
  font-weight: 600;
}

/* Selected patient header */
html[data-theme="dark"] .peso-selected {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(63,177,168,0.08);
  border: 1px solid rgba(63,177,168,0.25);
  border-radius: 10px;
  margin-bottom: 18px;
  color: var(--c-text);
  font-weight: 600;
}

/* Form grid */
html[data-theme="dark"] .peso-grid,
html[data-theme="tablet"] .peso-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
  gap: 16px !important;
  margin-bottom: 20px;
}
html[data-theme="tablet"] .peso-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
  gap: 18px !important;
}

/* Action buttons */
html[data-theme="dark"] .peso-actions,
html[data-theme="tablet"] .peso-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 18px;
  border-top: 1px solid var(--c-border);
}
html[data-theme="dark"] .peso-actions .btn {
  padding: 12px 20px !important;
  border-radius: 10px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  border: 1px solid var(--c-border) !important;
  background: transparent !important;
  color: var(--c-text) !important;
  cursor: pointer;
}
html[data-theme="dark"] .peso-actions .btn:hover {
  background: rgba(255,255,255,0.04) !important;
}
html[data-theme="dark"] .peso-actions .btn-primary {
  background: var(--c-primary) !important;
  color: #06121A !important;
  border-color: var(--c-primary) !important;
  font-weight: 700 !important;
  box-shadow: 0 6px 20px rgba(63,177,168,0.25);
}
html[data-theme="dark"] .peso-actions .btn-primary:hover {
  filter: brightness(1.1);
}

html[data-theme="tablet"] .peso-actions .btn {
  padding: 16px 28px !important;
  border-radius: 12px !important;
  font-size: 17px !important;
  font-weight: 700 !important;
  min-height: 56px !important;
  border: 2px solid var(--c-border) !important;
  background: #fff !important;
  color: var(--c-text) !important;
  cursor: pointer;
}
html[data-theme="tablet"] .peso-actions .btn-primary {
  background: var(--c-primary) !important;
  color: #fff !important;
  border-color: var(--c-primary) !important;
  box-shadow: 0 4px 12px rgba(11,74,111,0.25);
}

/* Responsive - hero stacks on small screens */
@media (max-width: 700px) {
  html[data-theme="dark"] .peso-card-hero,
  html[data-theme="tablet"] .peso-card-hero {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ============================================================
   CONFIGURACIÓN — Apariencia integrada al sistema real
   ============================================================ */
.config-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.config-panel {
  border: 1px solid var(--c-border, #dbe6f0);
  border-radius: 16px;
  background: var(--c-surface, #fff);
  padding: 24px 28px;
  box-shadow: 0 12px 28px rgba(16,45,80,.05);
}
.config-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--c-border, #dbe6f0);
}
.config-panel-head h2 {
  margin: 4px 0 6px;
  color: var(--c-text, #10233f);
  font-size: 24px;
  line-height: 1.1;
}
.config-panel-head p {
  margin: 0;
  color: var(--c-muted, #658095);
  max-width: 640px;
  line-height: 1.45;
}
.theme-current-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--c-primary-soft, #eef4fb);
  color: var(--c-primary, #0b4a6f);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.theme-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.theme-choice-card {
  width: 100%;
  appearance: none;
  border: 2px solid var(--c-border, #dbe6f0);
  border-radius: 16px;
  background: var(--c-surface, #fff);
  color: var(--c-text, #10233f);
  padding: 0;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(16,45,80,.045);
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.theme-choice-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--c-primary, #0b4a6f) 45%, var(--c-border, #dbe6f0));
}
.theme-choice-card.active {
  border-color: var(--c-primary, #0b4a6f);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-primary, #0b4a6f) 18%, transparent), 0 14px 32px rgba(16,45,80,.08);
}
.theme-preview {
  display: grid;
  gap: 10px;
  padding: 18px;
  min-height: 138px;
  border-bottom: 1px solid var(--c-border, #dbe6f0);
  background: #f8fbff;
}
.theme-preview i,
.theme-preview b,
.theme-preview em {
  display: block;
  border-radius: 999px;
}
.theme-preview i { width: 34px; height: 7px; background: #0b4a6f; }
.theme-preview b:nth-of-type(1) { height: 28px; background: #fff; border: 1px solid #dbe6f0; }
.theme-preview b:nth-of-type(2) { width: 82%; height: 7px; background: #10233f; }
.theme-preview b:nth-of-type(3) { width: 56%; height: 7px; background: #7b8fa3; }
.theme-preview em { justify-self: end; width: 52px; height: 20px; background: #0b4a6f; }
.theme-preview-dark { background: #0b1014; }
.theme-preview-dark i { background: #3fb1a8; }
.theme-preview-dark b:nth-of-type(1) { background: #11181f; border-color: #1f2a33; }
.theme-preview-dark b:nth-of-type(2) { background: #e6edf3; }
.theme-preview-dark b:nth-of-type(3) { background: #8b96a3; }
.theme-preview-dark em { background: #3fb1a8; }
.theme-preview-auto { background: #eef4fb; outline: 3px solid #0b4a6f; outline-offset: -5px; }
.theme-card-body {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px;
}
.theme-card-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--c-primary-soft, #eef4fb);
  color: var(--c-primary, #0b4a6f);
  font-size: 19px;
  font-weight: 800;
}
.theme-card-body strong {
  display: block;
  margin-bottom: 4px;
  color: var(--c-text, #10233f);
  font-size: 17px;
}
.theme-card-body small {
  display: block;
  color: var(--c-muted, #658095);
  font-size: 13px;
  line-height: 1.35;
}
html[data-theme="dark"] .config-panel,
html[data-theme="dark"] .theme-choice-card {
  background: var(--c-surface);
  border-color: var(--c-border);
  box-shadow: 0 12px 32px rgba(0,0,0,.28);
}
html[data-theme="dark"] .theme-choice-card.active {
  box-shadow: 0 0 0 3px rgba(63,177,168,.18), 0 16px 36px rgba(0,0,0,.32);
}
html[data-theme="dark"] .ficha-stat-card,
html[data-theme="dark"] .module-content-panel,
html[data-theme="dark"] .module-context-panel,
html[data-theme="dark"] .module-selected-patient {
  background: var(--c-surface);
  border-color: var(--c-border);
  color: var(--c-text);
}
html[data-theme="dark"] .ficha-stat-card label,
html[data-theme="dark"] .ficha-stat-card span,
html[data-theme="dark"] .section-kicker { color: var(--c-muted); }
html[data-theme="dark"] .ficha-stat-card strong,
html[data-theme="dark"] .module-selected-patient strong { color: var(--c-text); }
html[data-theme="tablet"] .config-panel { border-width: 2px; }
html[data-theme="tablet"] .theme-choice-card { border-width: 2px; }
html[data-theme="tablet"] .theme-card-body strong { font-size: 19px; }
html[data-theme="tablet"] .theme-card-body small { font-size: 15px; }
@media (max-width: 1180px) {
  .config-overview-grid,
  .theme-choice-grid { grid-template-columns: 1fr; }
  .config-panel-head { flex-direction: column; }
  .theme-current-badge { white-space: normal; }
}

/* ============================================================
   CONFIGURACIÓN — layout limpio a página completa
   ============================================================ */
.config-page .module-page-main {
  width: min(1280px, calc(100vw - 48px));
  margin: 34px auto;
  display: block;
  padding: 0;
}
.config-page .module-context-panel {
  display: none !important;
}
.config-page .module-content-panel {
  width: 100%;
  min-height: auto;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.config-page .config-overview-grid {
  margin-bottom: 20px;
}
.config-page .ficha-stat-card {
  min-height: 92px;
  padding: 18px 20px;
  border-radius: 16px;
  background: var(--c-surface, #fff);
  border: 1px solid var(--c-border, #dbe6f0);
  box-shadow: 0 8px 22px rgba(16,45,80,.045);
}
.config-page .ficha-stat-card label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-muted, #658095);
}
.config-page .ficha-stat-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 18px;
  color: var(--c-text, #10233f);
}
.config-page .ficha-stat-card span {
  display: block;
  color: var(--c-muted, #658095);
  line-height: 1.35;
}
.config-page .config-panel {
  padding: 26px 28px 30px;
  border-radius: 22px;
}
.config-page .config-panel-head {
  align-items: center;
}
.config-page .config-panel-head h2 {
  font-size: 30px;
  letter-spacing: -.02em;
}
.config-page .theme-choice-grid {
  gap: 18px;
  margin-top: 22px;
}
.config-page .theme-choice-card {
  position: relative;
  min-height: 285px;
}
.config-page .theme-preview {
  min-height: 145px;
}
.config-page .theme-card-body {
  padding: 20px;
}
.config-page .theme-card-body strong {
  font-size: 19px;
}
.config-page .theme-card-body small {
  font-size: 14px;
}
.config-page .theme-choice-card.active::after {
  content: "✓ Activo";
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--c-primary, #0b4a6f);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(11,74,111,.22);
}
@media (max-width: 900px) {
  .config-page .module-page-main {
    width: min(100% - 24px, 760px);
    margin: 20px auto;
  }
  .config-page .config-overview-grid,
  .config-page .theme-choice-grid {
    grid-template-columns: 1fr;
  }
  .config-page .config-panel-head {
    align-items: flex-start;
  }
}
