/* ============================================================
   Maestriard — App Panel Design System
   Dark Mode Premium | Consistent with Landing Page
   v2.0.0
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,opsz,wght@0,8..18,400;0,8..18,500;0,8..18,600;0,8..18,700;0,8..18,800;0,8..18,900;1,8..18,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Tokens v2.4.0 ──────────────────────────────────────── */
:root {
  /* Brand Colors */
  --c-primary:        #113b6d;   /* Azul Marca Principal */
  --c-primary-dim:    #09254a;   /* Azul Marca Oscuro */
  --c-primary-mid:    #113b6d;
  --c-primary-glow:   rgba(17,59,109,0.25);
  --c-accent:         #113b6d;
  --c-accent-dim:     #09254a;
  --c-accent-glow:    rgba(17,59,109,0.2);
  --c-green:          #10b981;
  --c-amber:          #f59e0b;
  --c-red:            #ef4444;
  --c-pink:           #113b6d;

  /* Backgrounds */
  --c-bg:             #FFFFFF;   /* Fondo general blanco */
  --c-bg-2:           #F4F6F9;   /* Fondo secundario gris casi blanco */
  --c-surface:        #FFFFFF;   /* Tarjetas blancas */
  --c-surface-2:      #F8FAFC;
  --c-glass:          #FFFFFF;
  --c-glass-2:        #F1F5F9;

  /* Borders */
  --c-border:         #E2E8F0;
  --c-border-2:       #CBD5E1;
  --gradient-border:  linear-gradient(135deg, #113b6d, #09254a);
  --gradient-border-glow: 0 0 0 1px rgba(17,59,109,0.15);

  /* Text */
  --c-text:           #0F172A;
  --c-text-2:         #334155;
  --c-text-muted:     #64748B;
  --c-text-light:     #94A3B8;

  /* Status */
  --c-success:        #10b981;
  --c-success-bg:     rgba(16,185,129,0.12);
  --c-warning:        #f59e0b;
  --c-warning-bg:     rgba(245,158,11,0.12);
  --c-danger:         #BD2426;
  --c-danger-bg:      rgba(189,36,38,0.12);

  /* Sidebar */
  --sidebar-w:        260px;
  --sidebar-bg:       linear-gradient(180deg, #0D2C54 0%, #060f1e 100%);
  --sidebar-border:   rgba(255,255,255,0.07);
  --sidebar-text:     rgba(255,255,255,0.72);
  --sidebar-active-bg:rgba(189,36,38,0.22);
  --sidebar-hover-bg: rgba(255,255,255,0.07);

  /* Layout */
  --topbar-h:         64px;

  /* Shadows */
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.35);
  --shadow-md:  0 6px 20px rgba(0,0,0,0.4);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.45);
  --shadow-xl:  0 24px 70px rgba(0,0,0,0.55);
  --glow-primary: 0 0 30px rgba(26,74,128,0.4);
  --glow-accent:  0 0 30px rgba(189,36,38,0.45);

  /* Radii */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   16px;
  --r-xl:   20px;
  --r-full: 9999px;

  /* Transitions */
  --t-fast: .15s ease;
  --t-base: .25s ease;
  --t-slow: .4s cubic-bezier(.16,1,.3,1);
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Source Sans 3', sans-serif;
  background: #FFFFFF !important;
  color: var(--c-text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ── App Layout ──────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--t-base);
  /* Borde derecho degradado vibrante */
  border-right: none;
  box-shadow: 4px 0 0 0 transparent, inset -1px 0 0 rgba(255,255,255,0.07);
}
.sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, transparent 0%, #113b6d 30%, #09254a 70%, transparent 100%);
  opacity: 0.6;
}

.sidebar-brand {
  padding: 22px 18px 18px;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.sidebar-logo {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, #113b6d, #09254a);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(17,59,109,0.4);
  color: #fff;
}
.sidebar-logo svg { width: 20px; height: 20px; stroke: #fff; }
.sidebar-brand-text { flex: 1; min-width: 0; }
.sidebar-brand-name {
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  letter-spacing: -0.3px;
}
.sidebar-brand-sub {
  font-size: .68rem;
  color: var(--sidebar-text);
  opacity: .6;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-section-label {
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(255,255,255,0.60);
  padding: 14px 10px 6px;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-md);
  color: var(--sidebar-text);
  font-size: .83rem;
  font-weight: 500;
  transition: all var(--t-fast);
  position: relative;
  cursor: pointer;
}
.sidebar-item:hover {
  background: var(--sidebar-hover-bg);
  color: var(--c-text);
}
.sidebar-item:hover .sidebar-icon svg { stroke: var(--c-text); }
.sidebar-item.active {
  background: var(--sidebar-active-bg);
  color: #fff;
  font-weight: 600;
}
.sidebar-item.active .sidebar-icon svg { stroke: #113b6d; }
.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 55%;
  background: linear-gradient(to bottom, #113b6d, #09254a);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 8px rgba(17,59,109,0.5);
}
.sidebar-icon {
  width: 20px; height: 20px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-icon svg { width: 16px; height: 16px; stroke: var(--sidebar-text); transition: stroke var(--t-fast); }
.sidebar-label { flex: 1; }

/* ── Sidebar Submenus ────────────────────────────────────── */
.sidebar-dropdown-toggle { width: 100%; border: none; background: transparent; text-align: left; }
.sidebar-chevron { width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; transition: transform var(--t-fast); }
.sidebar-chevron svg { width: 14px; height: 14px; stroke: var(--sidebar-text); }
.sidebar-dropdown.open .sidebar-chevron { transform: rotate(180deg); }

.sidebar-submenu {
  padding-left: 8px;
  margin-top: 2px;
  margin-bottom: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-submenu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 28px;
  border-radius: var(--r-md);
  color: var(--sidebar-text);
  font-size: .84rem;
  font-weight: 500;
  transition: all var(--t-fast);
}
.sidebar-submenu-item:hover {
  background: var(--sidebar-hover-bg);
  color: var(--c-text);
}
.sidebar-submenu-item.active {
  color: var(--c-primary);
  font-weight: 700;
  background: rgba(13, 44, 84, 0.06);
}
.sidebar-submenu-item.active .sidebar-icon svg { stroke: var(--c-primary); }
body.light-mode .sidebar-submenu-item.active { color: #1E3A8A; background: #EFF6FF; }
body.light-mode .sidebar-submenu-item.active .sidebar-icon svg { stroke: #1E3A8A; }



/* ── Sidebar Footer ──────────────────────────────────────── */
.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}
.plan-box {
  background: rgba(189,36,38,0.08);
  border: 1px solid rgba(189,36,38,0.25);
  border-radius: var(--r-md);
  padding: 12px 14px;
  box-shadow: 0 0 16px rgba(189,36,38,0.1);
}
.plan-box-label {
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(203,213,225,0.4);
  margin-bottom: 4px;
}
.plan-box-name {
  font-weight: 700;
  color: #fff;
  font-size: .82rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.plan-box-name svg { width: 14px; height: 14px; stroke: var(--c-primary); }
.plan-box-upgrade {
  margin-top: 8px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(135deg, #BD2426, #1a4a80);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  padding: 6px;
  border-radius: var(--r-sm);
  transition: opacity var(--t-fast), transform var(--t-fast);
  box-shadow: 0 0 16px rgba(189,36,38,0.4);
}
.plan-box-upgrade:hover { opacity: .88; transform: translateY(-1px); }
.plan-box-upgrade svg { width: 12px; height: 12px; stroke: #fff; }

/* ── Main Content Area ───────────────────────────────────── */
.main-area {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #FFFFFF !important;
}

/* ── App Topbar ──────────────────────────────────────────── */
.app-topbar {
  min-height: var(--topbar-h);
  height: auto;
  background: rgba(6,15,30,0.90);
  backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  border-bottom: none;
  box-shadow: 0 1px 0 0 rgba(26,74,128,0.5), 0 2px 12px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  padding: 8px 28px;
  gap: 16px;
  position: sticky;
  top: 0; z-index: 50;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.app-topbar-title {
  flex: 1 1 0%;
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 700;
  font-size: .88rem;
  line-height: 1.25;
  color: var(--c-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  min-width: 0;
  max-width: 100%;
}
.app-topbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.topbar-icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-md);
  background: var(--c-glass);
  border: 1px solid var(--c-border);
  color: var(--c-text-2);
  cursor: pointer;
  transition: all var(--t-fast);
}
.topbar-icon-btn:hover { background: var(--c-glass-2); border-color: var(--c-border-2); color: var(--c-text); }
.topbar-icon-btn svg { width: 16px; height: 16px; }

/* ── Page Content ────────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 28px 32px 85px 32px;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-title {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--c-text);
  letter-spacing: -0.5px;
}
.page-subtitle {
  font-size: .82rem;
  color: var(--c-text-muted);
  margin-top: 3px;
}

/* ── Avatar ──────────────────────────────────────────────── */
.avatar {
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent-dim));
  color: #fff;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: .78rem;
}
.avatar-sm { width: 34px; height: 34px; }
.avatar-md { width: 42px; height: 42px; font-size: .9rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.2rem; }

/* ── Buttons (Maestria Brand System — Azul & Rojo) ───────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: 9999px !important;
  font-size: .84rem;
  font-weight: 700;
  border: 1.5px solid transparent;
  transition: all var(--t-fast);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.4;
  font-family: inherit;
}
.btn svg, .btn i { flex-shrink: 0; }

.btn-primary, .btn-blue {
  background: linear-gradient(135deg, #113B6D 0%, #09254A 100%) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 9999px !important;
  box-shadow: 0 4px 14px rgba(17, 59, 109, 0.28) !important;
}
.btn-primary:hover, .btn-blue:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 18px rgba(17, 59, 109, 0.42) !important;
  filter: brightness(1.05);
}

.btn-danger, .btn-red {
  background: linear-gradient(135deg, #DC2626 0%, #991B1B 100%) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 9999px !important;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.28) !important;
}
.btn-danger:hover, .btn-red:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.42) !important;
  filter: brightness(1.05);
}

.btn-outline {
  background: transparent !important;
  border: 1.5px solid #113B6D !important;
  color: #113B6D !important;
  border-radius: 9999px !important;
}
.btn-outline:hover {
  background: rgba(17, 59, 109, 0.08) !important;
  transform: translateY(-1px) !important;
}

.btn-outline-red {
  background: transparent !important;
  border: 1.5px solid #DC2626 !important;
  color: #DC2626 !important;
  border-radius: 9999px !important;
}
.btn-outline-red:hover {
  background: rgba(220, 38, 38, 0.08) !important;
  transform: translateY(-1px) !important;
}

.btn-ghost, .btn-light {
  background: #F8FAFC !important;
  color: #1E293B !important;
  border: 1.5px solid #CBD5E1 !important;
  border-radius: 9999px !important;
}
.btn-ghost:hover, .btn-light:hover {
  background: #F1F5F9 !important;
  color: #0F172A !important;
  border-color: #94A3B8 !important;
  transform: translateY(-1px) !important;
}

.btn-accent { background: linear-gradient(135deg, #113B6D, #09254A) !important; color: #fff !important; border-radius: 9999px !important; }
.btn-accent:hover { transform: translateY(-1px) !important; filter: brightness(1.1); }
.btn-success { background: linear-gradient(135deg, #113B6D 0%, #09254A 100%) !important; color: #fff !important; border-radius: 9999px !important; }
.btn-sm       { padding: 6px 16px; font-size: .78rem; border-radius: 9999px !important; }
.btn-lg       { padding: 12px 28px; font-size: .95rem; border-radius: 9999px !important; }
.btn-icon     { width: 36px; height: 36px; padding: 0; border-radius: 9999px !important; justify-content: center; }

/* ── Gradient Border Mixin ───────────────────────────────── */
/* Usa background-clip para bordes degradados con border-radius */
.glow-card,
.card {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: var(--r-xl);
  color: #0F172A;
  overflow: hidden;
  transition: all var(--t-base);
  box-shadow: none !important;
}
.card:hover, .glow-card:hover {
  background: #FFFFFF !important;
  border-color: #CBD5E1 !important;
  box-shadow: none !important;
  transform: translateY(-2px);
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid #F1F5F9;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FFFFFF !important;
}
.card-header-icon {
  width: 34px; height: 34px; border-radius: var(--r-md);
  background: #EBF3FA;
  display: flex; align-items: center; justify-content: center;
}
.card-header-icon svg { width: 16px; height: 16px; stroke: #113b6d; }
.card-title {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: #0F172A;
  flex: 1;
}
.card-body { padding: 20px; background: #FFFFFF !important; color: #0F172A; }

/* ── Stat Cards ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: var(--r-lg);
  padding: 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: all var(--t-base);
  position: relative; overflow: hidden;
  color: #0F172A;
  box-shadow: none !important;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, #113b6d, #09254a);
  opacity: 0.85;
}
.stat-card:hover {
  background: #FFFFFF !important;
  border-color: #B2C8E4 !important;
  transform: translateY(-3px);
  box-shadow: none !important;
}
.stat-icon {
  width: 44px; height: 44px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.indigo { background: #EBF3FA !important; } .stat-icon.indigo svg { stroke: #113b6d !important; }
.stat-icon.cyan   { background: #E6EEF8 !important; } .stat-icon.cyan   svg { stroke: #09254a !important; }
.stat-icon.green  { background: #ECFDF5 !important; } .stat-icon.green  svg { stroke: #059669 !important; }
.stat-icon.amber  { background: #FEF3C7 !important; } .stat-icon.amber  svg { stroke: #D97706 !important; }
.stat-icon.red    { background: #EBF3FA !important; } .stat-icon.red    svg { stroke: #113b6d !important; }
.stat-icon.purple { background: #E6EEF8 !important; } .stat-icon.purple svg { stroke: #09254a !important; }
.stat-icon.pink   { background: #EBF3FA !important; } .stat-icon.pink   svg { stroke: #113b6d !important; }
.stat-icon.blue   { background: #EBF3FA !important; } .stat-icon.blue   svg { stroke: #113b6d !important; }
.stat-info { flex: 1; }
.stat-value {
  font-size: 1.7rem; font-weight: 800; color: #0F172A;
  line-height: 1; font-family: 'JetBrains Mono', monospace;
}
.stat-label { font-size: .78rem; color: #64748B; margin-top: 5px; font-weight: 600; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  border-radius: var(--r-full);
  font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
}
.badge-activo      { background: rgba(16,185,129,0.15);   color: #6ee7b7;  border: 1px solid rgba(16,185,129,0.25); }
.badge-inactivo    { background: rgba(239,68,68,0.12);    color: #fca5a5;  border: 1px solid rgba(239,68,68,0.25); }
.badge-info        { background: rgba(56,189,248,0.12);   color: #38bdf8;  border: 1px solid rgba(56,189,248,0.25); }
.badge-superadmin  { background: rgba(168,85,247,0.12);   color: #d8b4fe;  border: 1px solid rgba(168,85,247,0.25); }
.badge-admin       { background: rgba(99,102,241,0.12);   color: #a5b4fc;  border: 1px solid rgba(99,102,241,0.25); }
.badge-docente     { background: rgba(34,211,238,0.1);    color: #67e8f9;  border: 1px solid rgba(34,211,238,0.2); }
.badge-basico      { background: rgba(255,255,255,0.06);  color: var(--c-text-2); border: 1px solid var(--c-border); }
.badge-pro         { background: rgba(99,102,241,0.12);   color: #a5b4fc;  border: 1px solid rgba(99,102,241,0.3); }
.badge-escuela     { background: rgba(245,158,11,0.12);   color: #d97706;  border: 1px solid rgba(245,158,11,0.35); }
.badge-inicial     { background: rgba(34,211,238,0.1);    color: #67e8f9;  border: 1px solid rgba(34,211,238,0.2); }
.badge-primaria    { background: rgba(168,85,247,0.12);   color: #d8b4fe;  border: 1px solid rgba(168,85,247,0.25); }
.badge-secundaria  { background: rgba(245,158,11,0.12);   color: #d97706;  border: 1px solid rgba(245,158,11,0.35); }

/* ── Tables ──────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; padding: 11px 16px;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--c-text-muted); background: var(--c-surface-2);
  border-bottom: 1px solid var(--c-border);
}
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--c-border);
  font-size: .84rem; vertical-align: middle;
  color: var(--c-text-2);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--c-glass); }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: .8rem; font-weight: 600;
  color: var(--c-text-2); margin-bottom: 6px;
}
.form-control {
  width: 100%; padding: 10px 13px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  font-size: .875rem; color: var(--c-text);
  background: var(--c-glass);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-control:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
  background: var(--c-glass-2);
}
.form-control::placeholder { color: var(--c-text-light); }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
select option,
.form-control option,
.form-select option {
  background-color: #0d2c54 !important;
  color: #ffffff !important;
}
body.light-mode select option,
body.light-mode .form-control option,
body.light-mode .form-select option {
  background-color: #ffffff !important;
  color: #0d1b2a !important;
}
.form-hint { font-size: .74rem; color: var(--c-text-muted); margin-top: 4px; }
.form-error { font-size: .76rem; color: var(--c-red); margin-top: 4px; font-weight: 500; }

/* ── Flash Messages ──────────────────────────────────────── */
.flash {
  padding: 12px 16px; border-radius: var(--r-md); font-size: .84rem; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px; animation: slideDown .3s ease;
}
.flash svg { width: 16px; height: 16px; flex-shrink: 0; }
.flash-success { background: var(--c-success-bg); color: #6ee7b7; border-left: 3px solid var(--c-success); }
.flash-error   { background: var(--c-danger-bg);  color: #fca5a5; border-left: 3px solid var(--c-danger); }
.flash-warning { background: var(--c-warning-bg); color: #fcd34d; border-left: 3px solid var(--c-warning); }
@keyframes slideDown { from { transform: translateY(-8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.65);
  backdrop-filter: blur(6px); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity var(--t-base);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--c-surface); border: 1px solid var(--c-border-2);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl); width: 100%; max-width: 540px; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
  transform: scale(.96) translateY(12px); transition: transform var(--t-slow);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-header {
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; gap: 10px;
}
.modal-title  { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 1rem; flex: 1; }
.modal-close,
.btn-close,
.modal-close-x {
  width: 32px;
  height: 32px;
  border-radius: 50% !important;
  background: #F1F5F9 !important;
  border: 1px solid #CBD5E1 !important;
  color: #64748B !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  padding: 0 !important;
  margin: 0 !important;
  outline: none !important;
  text-decoration: none !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}
.modal-close:hover,
.btn-close:hover,
.modal-close-x:hover {
  background: #FEE2E2 !important;
  color: #DC2626 !important;
  border-color: #FCA5A5 !important;
  transform: rotate(90deg) scale(1.08) !important;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2) !important;
}
.modal-close svg,
.btn-close svg,
.modal-close-x svg { width: 14px; height: 14px; stroke-width: 2.5px; }
.modal-body   { padding: 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--c-border); display: flex; gap: 10px; justify-content: flex-end; }

/* ── Auth Pages ──────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  background: var(--c-bg);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; position: relative; overflow: hidden;
}
.auth-blob {
  position: absolute; border-radius: 50%;
  filter: blur(100px); opacity: .2; pointer-events: none;
}
.auth-blob-1 { width: 500px; height: 500px; background: var(--c-primary); top: -150px; left: -150px; animation: floatBlob 14s infinite ease-in-out alternate; }
.auth-blob-2 { width: 400px; height: 400px; background: var(--c-accent-dim); bottom: -100px; right: -100px; animation: floatBlob 11s infinite ease-in-out alternate-reverse; }
@keyframes floatBlob { 0% { transform: translate(0,0) scale(1); } 100% { transform: translate(30px,20px) scale(1.08); } }

.auth-card {
  background: rgba(255,255,255,.04);
  backdrop-filter: blur(24px);
  border: 1px solid var(--c-border-2);
  border-radius: var(--r-xl);
  padding: 44px 38px;
  width: 100%; max-width: 420px;
  position: relative; z-index: 10;
  box-shadow: 0 30px 70px rgba(0,0,0,0.5);
  animation: slideUp .7s cubic-bezier(.16,1,.3,1) forwards;
  opacity: 0; transform: translateY(30px);
}
@keyframes slideUp { to { opacity: 1; transform: translateY(0); } }

.auth-logo {
  width: 56px; height: 56px; margin: 0 auto 18px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent-dim));
  border-radius: 16px; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--glow-primary);
  animation: pulse 2.5s infinite;
}
.auth-logo svg { width: 26px; height: 26px; stroke: #fff; stroke-width: 2; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(99,102,241,.5); } 70% { box-shadow: 0 0 0 16px rgba(99,102,241,0); } 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0); } }

.auth-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 1.5rem; font-weight: 900; color: var(--c-text); text-align: center; margin-bottom: 4px; letter-spacing: -0.5px; }
.auth-subtitle { font-size: .84rem; color: var(--c-text-muted); text-align: center; margin-bottom: 26px; }
.auth-label { display: block; font-size: .8rem; font-weight: 600; color: var(--c-text-2); margin-bottom: 6px; }
.auth-input {
  width: 100%; padding: 10px 13px;
  background: var(--c-glass); border: 1.5px solid var(--c-border);
  border-radius: var(--r-md); color: var(--c-text); font-size: .875rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  margin-bottom: 12px;
}
.auth-input:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(99,102,241,.15); background: var(--c-glass-2); }
.auth-input::placeholder { color: var(--c-text-light); }
.auth-btn {
  width: 100%; padding: 12px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dim));
  border: none; border-radius: var(--r-md); color: #fff;
  font-size: .9rem; font-weight: 700; cursor: pointer;
  transition: all var(--t-fast); margin-top: 6px;
  box-shadow: var(--glow-primary);
}
.auth-btn:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 0 32px var(--c-primary-glow); }
.auth-link { display: block; text-align: center; margin-top: 18px; font-size: .83rem; color: var(--c-text-muted); }
.auth-link a { color: var(--c-accent); font-weight: 600; }
.auth-link a:hover { text-decoration: underline; }
.auth-error {
  background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.25);
  border-radius: var(--r-md); padding: 10px 13px;
  color: #fca5a5; font-size: .8rem; font-weight: 500;
  margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.auth-divider span { font-size: .73rem; color: var(--c-text-light); white-space: nowrap; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--c-border); }

/* ── Empty State ─────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state-icon {
  width: 64px; height: 64px;
  background: var(--c-glass-2); border: 1px solid var(--c-border);
  border-radius: var(--r-xl); margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
}
.empty-state-icon svg { width: 28px; height: 28px; stroke: var(--c-text-muted); }
.empty-state-title { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 1.05rem; color: var(--c-text); margin-bottom: 8px; }
.empty-state-desc { color: var(--c-text-muted); font-size: .84rem; max-width: 340px; margin: 0 auto 24px; }

/* ── Quick Access Grid ───────────────────────────────────── */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: stretch;
}
.quick-card {
  background: linear-gradient(135deg, #113b6d 0%, #09254a 100%) !important;
  border: 1px solid #09254a !important;
  border-radius: var(--r-lg);
  padding: 16px 10px !important;
  text-align: center;
  transition: all var(--t-base);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  color: #FFFFFF !important;
  box-shadow: 0 4px 14px rgba(9, 37, 74, 0.22) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 115px !important;
  height: 100% !important;
  box-sizing: border-box !important;
}
.quick-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, #113b6d, #2563eb);
  opacity: 0.8;
}
.quick-card:hover {
  background: linear-gradient(135deg, #164885 0%, #0d3263 100%) !important;
  border-color: #113b6d !important;
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(9, 37, 74, 0.35) !important;
}
.quick-card:hover::before { opacity: 1; }
.quick-card-icon {
  width: 42px; height: 42px; border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.18) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 8px;
  transition: all var(--t-fast);
  flex-shrink: 0;
}
.quick-card-icon svg { width: 20px; height: 20px; stroke: #FFFFFF !important; }
.quick-card:hover .quick-card-icon { background: rgba(255, 255, 255, 0.3) !important; }
.quick-card-label {
  font-size: .8rem;
  font-weight: 700;
  color: #FFFFFF !important;
  line-height: 1.25;
  text-align: center;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5em;
}

/* ── Breadcrumb ──────────────────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--c-text-muted); margin-bottom: 6px; }
.breadcrumb a { color: var(--c-primary); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--c-text-light); }

/* ── Utility ─────────────────────────────────────────────── */
.flex          { display: flex; }
.flex-center   { display: flex; align-items: center; }
.flex-between  { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; }  .gap-3 { gap: 12px; }  .gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }  .mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.text-sm   { font-size: .875rem; }  .text-xs { font-size: .75rem; }
.text-muted { color: var(--c-text-muted); }
.font-bold  { font-weight: 700; }
.truncate   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full     { width: 100%; }
.hidden     { display: none !important; }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #f1f5f9; border-left: 1px solid #e2e8f0; }
::-webkit-scrollbar-thumb { background-color: #113b6d; border-radius: 8px; border: 2px solid #f1f5f9; }
::-webkit-scrollbar-thumb:hover { background-color: #09254a; }

/* Scrollbar en Modo Claro */
body.light-mode ::-webkit-scrollbar-track { background: #f1f5f9; border-left: 1px solid #e2e8f0; }
body.light-mode ::-webkit-scrollbar-thumb { background-color: #113b6d; border: 2px solid #f1f5f9; }
body.light-mode ::-webkit-scrollbar-thumb:hover { background-color: #09254a; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-xl); }
  .main-area { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-content { padding: 18px 16px; }
}

/* ── Light Mode (body.light-mode) ───────────────────────── */
body.light-mode {
  /* Backgrounds */
  --c-bg:             #f0f4f8;
  --c-bg-2:           #e8edf3;
  --c-surface:        #ffffff;
  --c-surface-2:      #f4f7fb;
  --c-glass:          rgba(0,0,0,0.02);
  --c-glass-2:        rgba(0,0,0,0.04);

  /* Borders */
  --c-border:         #d1dae6;
  --c-border-2:       #bbc7d6;

  /* Text */
  --c-text:           #0d1b2a;
  --c-text-2:         #2c3e50;
  --c-text-muted:     #5a6f82;
  --c-text-light:     #8fa3b8;

  /* Shadows — light */
  --shadow-sm:  0 1px 4px rgba(13,44,84,0.07);
  --shadow-md:  0 4px 16px rgba(13,44,84,0.10);
  --shadow-lg:  0 8px 32px rgba(13,44,84,0.13);
  --shadow-xl:  0 20px 60px rgba(13,44,84,0.18);
}

/* Body background */
body.light-mode {
  background: linear-gradient(160deg, #eef2f7 0%, #e4ebf3 60%, #eef2f7 100%);
  background-attachment: fixed;
}

/* Sidebar */
body.light-mode {
  --sidebar-bg:       #ffffff;
  --sidebar-text:     #475569;
  --sidebar-border:   #e2e8f0;
  --sidebar-hover-bg: rgba(0,0,0,0.04);
  --sidebar-active-bg:rgba(189,36,38,0.1);
}
body.light-mode .sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
}
body.light-mode .sidebar-section-label {
  color: #64748b;
  font-weight: 800;
}
body.light-mode .sidebar::after {
  display: none;
}
body.light-mode .sidebar-brand-name {
  color: #0D2C54;
}
body.light-mode .sidebar-item.active {
  color: #1E3A8A;
  background: #EFF6FF;
  font-weight: 700;
}
body.light-mode .sidebar-item.active::before {
  display: none;
}
body.light-mode .sidebar-item.active .sidebar-icon svg {
  stroke: #1E3A8A;
}


body.light-mode .sidebar-logo svg {
  stroke: #0D2C54;
}
body.light-mode .plan-box {
  background: var(--c-surface-2);
  border-color: var(--c-border);
  box-shadow: none;
}
body.light-mode .plan-box-label { color: var(--c-text-muted); }
body.light-mode .plan-box-name { color: var(--c-text); }

/* Accessibility Toolbar (Solid Colors & High Contrast - Positioned at Bottom Left to avoid covering form buttons) */
.a11y-toolbar {
  background: #BD2426;
  border: 2px solid #FFFFFF;
  border-radius: var(--r-full);
  padding: 5px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--t-base);
}
.a11y-toolbar:hover {
  background: #9b1d1f;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.a11y-btn {
  background: #FFFFFF !important;
  border: 1px solid #FFFFFF !important;
  color: #BD2426 !important;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.88rem;
  transition: all var(--t-fast);
}
.a11y-btn:hover, .a11y-btn.active {
  background: #0D2C54 !important;
  color: #FFFFFF !important;
  border-color: #0D2C54 !important;
}
.a11y-btn svg {
  stroke: #BD2426 !important;
}
.a11y-btn:hover svg, .a11y-btn.active svg {
  stroke: #FFFFFF !important;
}
.a11y-sep {
  width: 2px;
  height: 18px;
  background: #FFFFFF;
}

/* Light mode solid contrast override */
body.light-mode .a11y-toolbar {
  background: #0D2C54;
  border: 2px solid #FFFFFF;
}
body.light-mode .a11y-toolbar:hover {
  background: #081B34;
}
body.light-mode .a11y-btn {
  background: #FFFFFF !important;
  border: 1px solid #FFFFFF !important;
  color: #0D2C54 !important;
}
body.light-mode .a11y-btn svg {
  stroke: #0D2C54 !important;
}
body.light-mode .a11y-btn:hover, body.light-mode .a11y-btn.active {
  background: #BD2426 !important;
  color: #FFFFFF !important;
  border-color: #BD2426 !important;
}
body.light-mode .a11y-btn:hover svg, body.light-mode .a11y-btn.active svg {
  stroke: #FFFFFF !important;
}

/* ============================================================
   GLOBAL VERTICAL SCROLLBARS — BRAND RED (#c11e2d / #BD2426)
   Aplica a todo el Panel del Maestro, Páginas, Modales y Popups
   ============================================================ */

/* Firefox Rule */
* {
  scrollbar-width: auto;
  scrollbar-color: #c11e2d rgba(0, 0, 0, 0.12);
}

/* Chrome, Edge, Safari Webkit Rule - UNIVERSAL (*) */
::-webkit-scrollbar {
  width: 16px !important;
  height: 12px !important;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.06) !important;
  border-radius: 8px !important;
}

::-webkit-scrollbar-thumb {
  background-color: #c11e2d !important;
  border-radius: 8px !important;
  border: 3px solid rgba(255, 255, 255, 0.8) !important;
  background-clip: padding-box !important;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #9b1723 !important;
}

/* Override específico para modales y contenedores internos */
.modal-body::-webkit-scrollbar,
.db-modal-body::-webkit-scrollbar,
.modal::-webkit-scrollbar,
.db-modal::-webkit-scrollbar,
.main-content::-webkit-scrollbar,
.app-main::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar,
.page-content::-webkit-scrollbar {
  width: 16px !important;
  height: 12px !important;
}

.modal-body::-webkit-scrollbar-thumb,
.db-modal-body::-webkit-scrollbar-thumb,
.modal::-webkit-scrollbar-thumb,
.db-modal::-webkit-scrollbar-thumb,
.main-content::-webkit-scrollbar-thumb,
.app-main::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb,
.page-content::-webkit-scrollbar-thumb {
  background-color: #c11e2d !important;
  border-radius: 8px !important;
  border: 3px solid rgba(255, 255, 255, 0.8) !important;
}

/* Unified Material & Option Pill Buttons System (v7.5.0) */
.mat-pill,
.db-mat-pill {
  background: #F8FAFC;
  color: #334155;
  border: 1px solid #CBD5E1;
  padding: 0.45rem 1rem;
  font-size: 0.825rem;
  font-weight: 700;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease-out;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  user-select: none;
}

.mat-pill:hover,
.db-mat-pill:hover {
  background: #EEF2FF;
  border-color: #C7D2FE;
  color: #1E3A8A;
  transform: translateY(-1px);
}

.mat-pill.active,
.db-mat-pill.active {
  background: #1E3A8A !important;
  color: #FFFFFF !important;
  border-color: #1E3A8A !important;
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.25) !important;
}

/* Topbar */
body.light-mode .app-topbar {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 1px 0 0 rgba(13,44,84,0.12), 0 2px 12px rgba(13,44,84,0.06);
}

/* Cards — tarjetas blancas limpias sin bordes rojos ni sombras */
body.light-mode .card,
body.light-mode .glow-card,
body.light-mode .stat-card {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  color: #0F172A !important;
  box-shadow: none !important;
}
body.light-mode .card:hover,
body.light-mode .glow-card:hover,
body.light-mode .stat-card:hover {
  background: #FFFFFF !important;
  border-color: #CBD5E1 !important;
  box-shadow: none !important;
}

/* Accesos Rápidos — Botones Azules con texto blanco */
body.light-mode .quick-card {
  background: linear-gradient(135deg, #113b6d 0%, #09254a 100%) !important;
  border: 1px solid #09254a !important;
  color: #FFFFFF !important;
  box-shadow: 0 4px 14px rgba(9, 37, 74, 0.22) !important;
}
body.light-mode .quick-card:hover {
  background: linear-gradient(135deg, #164885 0%, #0d3263 100%) !important;
  border-color: #113b6d !important;
  box-shadow: 0 8px 22px rgba(9, 37, 74, 0.35) !important;
}

/* Modal */
body.light-mode .modal {
  background: #FFFFFF !important;
  border: 1px solid #CBD5E1 !important;
  color: #0F172A !important;
  box-shadow: 0 20px 50px rgba(17,59,109,0.15) !important;
}

/* Tables */
body.light-mode .data-table th { background: #f4f7fb; }
body.light-mode .data-table tr:hover td { background: #eef2f7; }

/* Auth card */
body.light-mode .auth-card {
  background: rgba(255,255,255,0.95);
  border-color: rgba(13,44,84,0.12);
  box-shadow: 0 20px 50px rgba(13,44,84,0.12);
}

/* Scrollbar */
body.light-mode ::-webkit-scrollbar-thumb { background: rgba(13,44,84,0.15); }
body.light-mode ::-webkit-scrollbar-thumb:hover { background: rgba(13,44,84,0.25); }

/* ── Mobile Sidebar Drawer & Layout (<= 768px) ────────── */
#sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    width: 270px !important;
    max-width: 82vw !important;
    transform: translateX(-100%) !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    z-index: 999 !important;
    box-shadow: 0 0 50px rgba(0,0,0,0.6) !important;
    display: flex !important;
  }
  .sidebar.open {
    transform: translateX(0) !important;
  }
  .main-area {
    margin-left: 0 !important;
    width: 100% !important;
  }
  #sidebar-toggle {
    display: flex !important;
  }
  .app-topbar {
    padding: 0 14px !important;
  }
}

/* ── System-wide Mobile Responsive Panel Rules (<= 768px) ── */
@media (max-width: 768px) {
  .page-content {
    padding: 14px 10px 90px 10px !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }
  .page-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
  }
  .page-title {
    font-size: 1.2rem !important;
  }
  .page-header > div:last-child {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .page-header .btn {
    flex: 1 1 auto !important;
    justify-content: center !important;
  }

  /* Stat Grids & Quick Access Grids across all modules (2 por fila en móvil) */
  .stats-grid,
  .stat-grid,
  .quick-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  /* Table Container Scrolling */
  .card {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .card-body {
    padding: 12px !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Modals on Mobile */
  .modal {
    width: 95% !important;
    max-width: 95% !important;
    padding: 16px !important;
    margin: 10px auto !important;
    max-height: 92vh !important;
  }
}


