/* ============================================================
   STYLE.CSS — Panel Central MCP — Monarca Computer S.A.S
   Variables CSS: /api/config/css (render-blocking, sin FOUC)
   ============================================================ */

/* ── Variables fallback ────────────────────────────────────── */
:root {
  --primary:       #1a3a5c;
  --primary-hover: #2563eb;
  --accent:        #f59e0b;
  --bg:            #f0f4f8;
  --surface:       #ffffff;
  --border:        #e2e8f0;
  --text:          #1e293b;
  --text-muted:    #64748b;
  --success:       #16a34a;
  --danger:        #dc2626;
  --warning:       #d97706;
  --radius:        10px;
  --sidebar-w:     240px;
  --font-body:     'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-heading:  'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-size:     14px;
}

/* ── Dark mode ─────────────────────────────────────────────── */
html[data-dark] {
  --bg:         #0f172a;
  --surface:    #1e293b;
  --border:     #334155;
  --text:       #e2e8f0;
  --text-muted: #94a3b8;
}
html[data-dark] .alert-success { background:rgba(22,163,74,0.15);  color:#86efac; }
html[data-dark] .alert-danger  { background:rgba(220,38,38,0.15);  color:#fca5a5; }
html[data-dark] .alert-warning { background:rgba(217,119,6,0.15);  color:#fcd34d; }
html[data-dark] .alert-info    { background:rgba(37,99,235,0.15);  color:#93c5fd; }
html[data-dark] .badge-success  { background:rgba(22,163,74,0.2);  }
html[data-dark] .badge-danger   { background:rgba(220,38,38,0.2);  }
html[data-dark] .badge-warning  { background:rgba(217,119,6,0.2);  }
html[data-dark] .badge-primary  { background:rgba(37,99,235,0.2);  }
html[data-dark] .badge-muted    { background:rgba(255,255,255,0.1);}
html[data-dark] .badge-activo   { background:rgba(22,163,74,0.2);  }
html[data-dark] .badge-inactivo { background:rgba(255,255,255,0.08);}
html[data-dark] .card          { box-shadow:0 1px 6px rgba(0,0,0,0.4); }
html[data-dark] .module-card   { box-shadow:0 2px 10px rgba(0,0,0,0.4);}
html[data-dark] .modal         { box-shadow:0 8px 32px rgba(0,0,0,0.6);}
html[data-dark] .login-card    { box-shadow:0 8px 32px rgba(0,0,0,0.6);}
html[data-dark] ::-webkit-scrollbar-track { background:#1e293b; }
html[data-dark] ::-webkit-scrollbar-thumb { background:#475569; }

/* ── Animaciones ───────────────────────────────────────────── */
@keyframes toastIn  { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
@keyframes modalIn  { from{opacity:0;transform:scale(0.95)}    to{opacity:1;transform:scale(1)}    }
@keyframes cardUp   { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }

/* ── Reset ─────────────────────────────────────────────────── */
*,*::before,*::after { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family:            var(--font-body);
  font-size:              var(--font-size);
  background:             var(--bg);
  color:                  var(--text);
  min-height:             100vh;
  line-height:            1.5;
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4,h5,h6 { font-family:var(--font-heading); line-height:1.2; color:var(--text); }
a { color:var(--primary); text-decoration:none; }
a:hover { color:var(--primary-hover); }

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

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width:var(--sidebar-w); background:var(--primary); color:#fff;
  display:flex; flex-direction:column;
  position:fixed; top:0; left:0; height:100vh;
  z-index:200; transition:transform 0.25s ease;
  overflow-y:auto; flex-shrink:0;
}
.sidebar-brand {
  padding:20px 20px 16px; border-bottom:1px solid rgba(255,255,255,0.1);
  display:flex; align-items:center; gap:12px;
}
.sidebar-brand img {
  width:40px; height:40px; object-fit:contain;
  border-radius:8px; background:rgba(255,255,255,0.12); padding:4px;
}
.brand-text { flex:1; }
.brand-name { font-size:0.82rem; font-weight:700; color:#fff; display:block; }
.brand-sub  { font-size:0.62rem; color:rgba(255,255,255,0.45); }
.brand-accent { color:var(--accent); }

.sidebar-nav { padding:12px 0; flex:1; }

.nav-section-label {
  font-size:0.58rem; font-weight:700; letter-spacing:0.14em;
  text-transform:uppercase; color:rgba(255,255,255,0.35);
  padding:16px 20px 6px;
}

.nav-link {
  display:flex; align-items:center; gap:10px;
  padding:9px 20px; color:rgba(255,255,255,0.72); font-size:0.82rem;
  font-weight:500; transition:background 0.15s,color 0.15s;
  cursor:pointer; text-decoration:none;
}
.nav-link:hover,.nav-link.active {
  background:rgba(255,255,255,0.1); color:#fff;
}
.nav-link .nav-icon { font-size:1rem; flex-shrink:0; opacity:0.8; width:20px; text-align:center; }
.nav-link.active .nav-icon { opacity:1; }

.sidebar-footer {
  padding:14px 20px; border-top:1px solid rgba(255,255,255,0.1);
  font-size:0.7rem; color:rgba(255,255,255,0.35);
}

/* ── Overlay móvil ─────────────────────────────────────────── */
.sidebar-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.45); z-index:150; }
.sidebar-overlay.show { display:block; }

/* ── Contenido principal ───────────────────────────────────── */
.main-content { flex:1; margin-left:var(--sidebar-w); display:flex; flex-direction:column; min-height:100vh; }

/* ── Topbar ────────────────────────────────────────────────── */
.topbar {
  background:var(--surface); border-bottom:1px solid var(--border);
  padding:0 28px; height:56px;
  display:flex; align-items:center; justify-content:space-between;
  position:sticky; top:0; z-index:100;
  box-shadow:0 1px 3px rgba(0,0,0,0.04);
}
.topbar-left  { display:flex; align-items:center; gap:14px; }
.topbar-title { font-size:0.92rem; font-weight:700; color:var(--text); }
.hamburger-btn {
  display:none; background:none; border:none; cursor:pointer;
  font-size:1.3rem; color:var(--text); padding:4px;
}
.topbar-right { display:flex; align-items:center; gap:12px; }

.user-chip {
  display:flex; align-items:center; gap:8px; font-size:0.78rem;
  color:var(--text-muted); background:var(--bg); border:1px solid var(--border);
  padding:6px 14px; border-radius:20px;
}
.user-chip strong { color:var(--text); }
.user-chip .user-avatar {
  width:26px; height:26px; border-radius:50%;
  background:var(--primary); color:#fff;
  display:flex; align-items:center; justify-content:center;
  font-size:0.7rem; font-weight:700;
}

/* ── Dark toggle ───────────────────────────────────────────── */
.dark-toggle {
  background:none; border:1px solid var(--border); border-radius:20px;
  padding:5px 12px; cursor:pointer; font-size:0.75rem;
  color:var(--text-muted); display:flex; align-items:center; gap:5px;
  transition:background 0.15s,color 0.15s; white-space:nowrap;
}
.dark-toggle:hover { background:var(--border); color:var(--text); }

/* ── Notificaciones campana ────────────────────────────────── */
.notif-wrap     { position:relative; }
.notif-btn      { background:none; border:1px solid var(--border); border-radius:20px;
                  padding:5px 12px; cursor:pointer; font-size:0.85rem; position:relative;
                  color:var(--text-muted); transition:background .15s; white-space:nowrap; }
.notif-btn:hover { background:var(--border); }
.notif-badge    { position:absolute; top:-5px; right:-5px; background:#dc2626; color:#fff;
                  font-size:10px; font-weight:700; min-width:17px; height:17px; border-radius:20px;
                  padding:0 4px; display:flex; align-items:center; justify-content:center; line-height:1; }
.notif-dropdown { position:absolute; top:calc(100% + 8px); right:0; width:340px; max-height:420px;
                  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
                  box-shadow:0 8px 32px rgba(0,0,0,0.15); z-index:500; display:none; flex-direction:column;
                  overflow:hidden; }
.notif-dropdown.show { display:flex; }
.notif-header   { display:flex; align-items:center; justify-content:space-between;
                  padding:10px 14px; border-bottom:1px solid var(--border);
                  font-size:13px; font-weight:700; color:var(--text); flex-shrink:0; }
.notif-lista    { overflow-y:auto; flex:1; }
.notif-item     { display:flex; gap:10px; align-items:flex-start; padding:10px 14px;
                  cursor:pointer; border-bottom:1px solid var(--border); transition:background .1s; }
.notif-item:hover { background:var(--bg); }
.notif-item.no-leida { background:#eff6ff; }
html[data-dark] .notif-item.no-leida { background:rgba(37,99,235,0.12); }
.notif-icono    { font-size:1.2rem; flex-shrink:0; margin-top:1px; }
.notif-texto    { flex:1; min-width:0; }
.notif-titulo   { font-size:13px; font-weight:600; color:var(--text); line-height:1.3; }
.notif-cuerpo   { font-size:12px; color:var(--text-muted); margin-top:2px; }
.notif-fecha    { font-size:11px; color:var(--text-muted); margin-top:3px; }

/* ── Notas cuaderno (topbar) ───────────────────────────────── */
.notas-wrap       { position:relative; }
.notas-btn        { background:none; border:1px solid var(--border); border-radius:20px;
                    padding:5px 12px; cursor:pointer; font-size:0.85rem; position:relative;
                    color:var(--text-muted); transition:background .15s; white-space:nowrap; }
.notas-btn:hover  { background:var(--border); }
.notas-badge      { position:absolute; top:-5px; right:-5px; background:#f59e0b; color:#fff;
                    font-size:10px; font-weight:700; min-width:17px; height:17px; border-radius:20px;
                    padding:0 4px; display:flex; align-items:center; justify-content:center; line-height:1; }
.notas-panel      { position:absolute; top:calc(100% + 8px); right:0; width:380px;
                    background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
                    box-shadow:0 8px 32px rgba(0,0,0,0.15); z-index:500; display:none; flex-direction:column;
                    max-height:520px; overflow:hidden; }
.notas-panel.show { display:flex; }
.notas-panel-hdr  { display:flex; align-items:center; justify-content:space-between;
                    padding:10px 14px; border-bottom:1px solid var(--border);
                    font-size:13px; font-weight:700; color:var(--text); flex-shrink:0; }
.notas-lista      { overflow-y:auto; flex:1; }
.nota-item        { display:flex; gap:10px; align-items:flex-start; padding:10px 14px;
                    border-bottom:1px solid var(--border); transition:background .1s; }
.nota-item:hover  { background:var(--bg); }
.nota-tipo-icon   { font-size:1.1rem; flex-shrink:0; margin-top:2px; }
.nota-texto       { flex:1; min-width:0; }
.nota-titulo-txt  { font-size:13px; font-weight:600; color:var(--text); line-height:1.3;
                    white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.nota-meta        { font-size:11px; color:var(--text-muted); margin-top:2px; display:flex; gap:6px; }
.nota-add-form    { padding:10px 14px; border-top:1px solid var(--border); flex-shrink:0;
                    display:flex; flex-direction:column; gap:6px; background:var(--bg); }
.nota-add-row     { display:flex; gap:6px; }
.nota-tipo-sel    { font-size:11px; padding:4px 6px; border:1px solid var(--border);
                    border-radius:6px; background:var(--surface); color:var(--text); cursor:pointer; }
.nota-prio-sel    { font-size:11px; padding:4px 6px; border:1px solid var(--border);
                    border-radius:6px; background:var(--surface); color:var(--text); cursor:pointer; flex:1; }
.nota-titulo-in   { font-size:12px; padding:6px 10px; border:1px solid var(--border);
                    border-radius:6px; background:var(--surface); color:var(--text);
                    width:100%; outline:none; }
.nota-titulo-in:focus { border-color:var(--primary); }
.nota-cont-in     { font-size:12px; padding:6px 10px; border:1px solid var(--border);
                    border-radius:6px; background:var(--surface); color:var(--text);
                    width:100%; outline:none; resize:vertical; min-height:56px; line-height:1.4; }
.nota-cont-in:focus { border-color:var(--primary); }
.nota-mod-chip    { font-size:10px; background:#eff6ff; color:#1d4ed8; padding:1px 6px;
                    border-radius:8px; font-weight:600; }
/* Prioridad */
.nota-prio-alta   { background:#fef2f2; color:#b91c1c; padding:1px 6px; border-radius:8px; font-size:10px; font-weight:700; }
.nota-prio-media  { background:#fef9c3; color:#854d0e; padding:1px 6px; border-radius:8px; font-size:10px; font-weight:700; }
.nota-prio-baja   { background:#f0fdf4; color:#15803d; padding:1px 6px; border-radius:8px; font-size:10px; font-weight:700; }
/* Estado */
.nota-est-abierta    { color:#dc2626; }
.nota-est-en_progreso{ color:#d97706; }
.nota-est-resuelta   { color:#16a34a; }

/* ── Page content ──────────────────────────────────────────── */
.page-content { padding:28px; flex:1; }

.page-header { margin-bottom:24px; }
.page-header h1 { font-size:1.18rem; font-weight:700; }
.page-header p  { font-size:0.78rem; color:var(--text-muted); margin-top:4px; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); padding:20px 24px;
  box-shadow:0 1px 4px rgba(0,0,0,0.04);
}
.card-title {
  font-size:0.75rem; font-weight:700; text-transform:uppercase;
  letter-spacing:0.08em; color:var(--text-muted);
  margin-bottom:14px; padding-bottom:10px; border-bottom:1px solid var(--border);
}

/* ── Welcome Banner ────────────────────────────────────────── */
.welcome-banner {
  background:linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  border-radius:var(--radius); padding:28px 32px; color:#fff; margin-bottom:28px;
  display:flex; align-items:center; justify-content:space-between; gap:20px;
}
.welcome-banner h2 { font-size:1.15rem; font-weight:700; margin-bottom:5px; }
.welcome-banner p  { font-size:0.78rem; opacity:0.8; }
.welcome-banner .welcome-date {
  font-size:0.7rem; opacity:0.6; margin-top:4px; display:block;
}
.welcome-icon { font-size:3rem; opacity:0.6; flex-shrink:0; }

/* ── Stats Row ─────────────────────────────────────────────── */
.stats-row {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr));
  gap:14px; margin-bottom:28px;
}
.stat-card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); padding:18px 20px;
  display:flex; flex-direction:column; align-items:flex-start; gap:4px;
  transition:box-shadow 0.2s;
}
.stat-card:hover { box-shadow:0 4px 16px rgba(0,0,0,0.08); }
.stat-icon  { font-size:1.4rem; margin-bottom:4px; }
.stat-value { font-size:1.6rem; font-weight:800; color:var(--primary); line-height:1; }
.stat-label { font-size:0.68rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.08em; }

/* ── Module Launcher Grid ──────────────────────────────────── */
.modules-section-title {
  font-size:0.7rem; font-weight:700; letter-spacing:0.12em;
  text-transform:uppercase; color:var(--text-muted); margin-bottom:18px;
}

.modules-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(190px,1fr));
  gap:16px;
}

.module-card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); overflow:hidden;
  box-shadow:0 2px 8px rgba(0,0,0,0.04);
  transition:transform 0.2s ease, box-shadow 0.2s ease;
  display:flex; flex-direction:column;
  text-decoration:none; color:inherit;
  animation:cardUp 0.3s ease both;
  min-height:210px;
}
.module-card:hover:not(.pendiente) {
  transform:translateY(-5px);
  box-shadow:0 10px 28px rgba(0,0,0,0.12);
}
.module-card.pendiente { opacity:0.55; }

.module-card-header {
  height:84px; display:flex; align-items:center; justify-content:center;
  font-size:2.4rem; position:relative; overflow:hidden; flex-shrink:0;
}
.module-card-header::after {
  content:''; position:absolute; inset:0;
  background:rgba(255,255,255,0.08);
}

.module-card-body {
  padding:14px 16px; flex:1; display:flex; flex-direction:column; gap:5px; min-height:0;
}
.module-card-name { font-size:0.84rem; font-weight:700; color:var(--text); }
.module-card-desc {
  font-size:0.7rem; color:var(--text-muted); line-height:1.5;
  overflow:hidden; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical;
}

.module-card-footer {
  padding:10px 16px; border-top:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between; flex-shrink:0;
}
.module-card-footer .btn { font-size:0.7rem; padding:4px 12px; }
.module-card-ver { font-size:0.6rem; color:var(--text-muted); }

/* ── Botones ────────────────────────────────────────────────── */
.btn {
  display:inline-flex; align-items:center; gap:6px;
  padding:8px 18px; border-radius:var(--radius);
  font-size:0.78rem; font-weight:600; border:none;
  cursor:pointer; transition:background 0.15s,box-shadow 0.15s;
  text-decoration:none; white-space:nowrap;
}
.btn:disabled { opacity:0.5; cursor:not-allowed; }
.btn-primary  { background:var(--primary); color:#fff; }
.btn-primary:hover:not(:disabled) { background:var(--primary-hover); }
.btn-secondary { background:var(--bg); color:var(--text); border:1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background:var(--border); }
.btn-success  { background:var(--success); color:#fff; }
.btn-danger   { background:var(--danger);  color:#fff; }
.btn-warning  { background:var(--warning); color:#fff; }
.btn-sm  { padding:4px 10px; font-size:0.72rem; }
.btn-lg  { padding:11px 24px; font-size:0.9rem; }
.btn-full { width:100%; justify-content:center; }
.btn-group { display:flex; gap:6px; align-items:center; flex-wrap:nowrap; }

/* ── Formularios ────────────────────────────────────────────── */
.form-group   { margin-bottom:16px; }
.form-label   { display:block; font-size:0.75rem; font-weight:600; color:var(--text); margin-bottom:5px; }
.form-label .required { color:var(--danger); margin-left:2px; }
.form-control {
  width:100%; padding:9px 13px; border:1px solid var(--border);
  border-radius:var(--radius); font-size:0.82rem; color:var(--text);
  background:var(--surface); transition:border-color 0.15s,box-shadow 0.15s;
  font-family:var(--font-body);
}
.form-control:focus {
  outline:none; border-color:var(--primary);
  box-shadow:0 0 0 3px rgba(26,58,92,0.1);
}
.form-control::placeholder { color:var(--text-muted); }
select.form-control   { cursor:pointer; }
textarea.form-control { resize:vertical; min-height:80px; }
.form-hint { font-size:0.68rem; color:var(--text-muted); margin-top:4px; }

/* ── Tablas ─────────────────────────────────────────────────── */
.table-wrap   { overflow-x:auto; }
table         { width:100%; border-collapse:collapse; font-size:0.78rem; }
thead tr      { background:var(--primary); }
thead th      { color:#fff; font-weight:600; font-size:0.72rem; text-align:left; padding:10px 14px; white-space:nowrap; }
tbody tr      { border-bottom:1px solid var(--border); transition:background 0.12s; }
tbody tr:hover{ background:var(--bg); }
tbody tr:last-child { border-bottom:none; }
td            { padding:9px 14px; vertical-align:middle; color:var(--text); }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display:inline-flex; align-items:center; gap:4px;
  padding:2px 9px; border-radius:20px; font-size:0.62rem;
  font-weight:700; white-space:nowrap;
}
.badge-success  { background:rgba(22,163,74,0.1);  color:var(--success); }
.badge-danger   { background:rgba(220,38,38,0.1);  color:var(--danger);  }
.badge-warning  { background:rgba(217,119,6,0.1);  color:var(--warning); }
.badge-primary  { background:rgba(26,58,92,0.1);   color:var(--primary); }
.badge-muted    { background:rgba(0,0,0,0.06);     color:var(--text-muted); }
.badge-activo   { background:rgba(22,163,74,0.1);  color:var(--success); }
.badge-inactivo { background:rgba(0,0,0,0.06);     color:var(--text-muted); }

/* ── Bar Actions (barra de filtros/búsqueda sobre tablas) ─────── */
.bar-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:14px; }
.bar-actions input[type=search],
.bar-actions select { padding:7px 10px; border:1px solid var(--border); border-radius:6px; background:var(--surface); color:var(--text); font-size:13px; }
.bar-actions input[type=search] { min-width:220px; }
.bar-actions select { min-width:140px; }

/* ── Alertas ────────────────────────────────────────────────── */
.alert {
  display:flex; gap:9px; align-items:flex-start;
  padding:11px 14px; border-radius:var(--radius);
  font-size:0.78rem; line-height:1.6; margin-bottom:14px;
}
.alert-success { background:rgba(22,163,74,0.08);  border:1px solid rgba(22,163,74,0.3);  color:#14532d; }
.alert-danger  { background:rgba(220,38,38,0.08);  border:1px solid rgba(220,38,38,0.3);  color:#7f1d1d; }
.alert-warning { background:rgba(217,119,6,0.08);  border:1px solid rgba(217,119,6,0.3);  color:#78350f; }
.alert-info    { background:rgba(26,58,92,0.06);   border:1px solid rgba(26,58,92,0.2);   color:var(--primary); }

/* ── Tabs ───────────────────────────────────────────────────── */
.tabs { display:flex; gap:0; flex-wrap:nowrap; border-bottom:2px solid var(--border); margin-bottom:24px; overflow:visible; }
.tab-btn {
  padding:10px 20px; background:none; border:none; cursor:pointer;
  font-size:0.8rem; font-weight:600; color:var(--text-muted);
  border-bottom:2px solid transparent; margin-bottom:-2px;
  transition:color 0.15s,border-color 0.15s; white-space:nowrap;
}
.tab-btn.active { color:var(--primary); border-bottom-color:var(--primary); }
.tab-btn:hover:not(.active) { color:var(--text); }
.tab-pane { display:none; }
.tab-pane.active { display:block; }

/* ── Tab overflow — dropdown "Más ▾" ───────────────────────── */
.tab-more-wrapper { position:relative; display:inline-flex; }
.tab-more-trigger::after { content:' ▾'; font-size:.72em; opacity:.75; }
.tab-more-dropdown {
  display:none; position:absolute; top:calc(100% + 4px); right:0;
  background:var(--surface); border:1px solid var(--border);
  border-radius:8px; box-shadow:0 6px 20px rgba(0,0,0,.14);
  z-index:250; min-width:200px; padding:4px 0;
}
.tab-more-wrapper.open .tab-more-dropdown { display:block; }
.tab-more-dropdown .tab-btn {
  display:block; width:100%; text-align:left;
  border:none; border-bottom:none; border-radius:0;
  padding:9px 16px; font-size:13px;
  background:none; color:var(--text); cursor:pointer; white-space:nowrap;
}
.tab-more-dropdown .tab-btn:hover { background:var(--bg); }
.tab-more-dropdown .tab-btn.active { color:var(--primary); font-weight:600; background:var(--bg); }
.tab-more-dropdown .sub-tab-btn {
  display:block; width:100%; text-align:left;
  border:none; border-bottom:none; border-radius:0;
  padding:9px 16px; font-size:13px;
  background:none; color:var(--text); cursor:pointer; white-space:nowrap;
}
.tab-more-dropdown .sub-tab-btn:hover { background:var(--bg); }
.tab-more-dropdown .sub-tab-btn.active { color:var(--primary); font-weight:600; background:var(--bg); }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  display:none; position:fixed; inset:0;
  background:rgba(0,0,0,0.48); z-index:300;
  align-items:center; justify-content:center; padding:16px;
}
.modal-overlay.show { display:flex; }
.modal {
  background:var(--surface); border-radius:var(--radius);
  width:100%; max-width:520px;
  max-height:90vh;
  display:flex; flex-direction:column;
  box-shadow:0 8px 32px rgba(0,0,0,0.2);
  animation:modalIn 0.2s ease;
}
.modal-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 20px; border-bottom:1px solid var(--border);
  flex-shrink:0;
}
.modal-title { font-size:0.92rem; font-weight:700; }
.modal-close { background:none; border:none; font-size:1.2rem; cursor:pointer; color:var(--text-muted); }
.modal-body   { padding:20px; overflow-y:auto; flex:1; }
.modal-footer { padding:14px 20px; border-top:1px solid var(--border); display:flex; justify-content:flex-end; gap:10px; flex-shrink:0; }

/* ── Card con header/body (usado en modales y paneles internos) ── */
.card-header {
  padding:14px 20px; border-bottom:1px solid var(--border);
  font-weight:600; font-size:0.88rem; display:flex;
  align-items:center; justify-content:space-between;
}
.card-body { padding:20px; }

/* ── Toggle / checkbox label ────────────────────────────────── */
.toggle-label {
  display:flex; align-items:center; gap:8px;
  font-size:0.88rem; cursor:pointer; user-select:none;
}
.toggle-label input[type=checkbox] { width:16px; height:16px; cursor:pointer; }

/* ── Utilidades ─────────────────────────────────────────────── */
.text-muted   { color:var(--text-muted); }
.text-success { color:var(--success); }
.text-danger  { color:var(--danger); }
.text-primary { color:var(--primary); }
.fw-bold { font-weight:700; }
.mt-1 { margin-top:8px; }  .mt-2 { margin-top:16px; }
.mb-1 { margin-bottom:8px; }.mb-2 { margin-bottom:16px; }
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.grid-3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:16px; }

/* ── Login ──────────────────────────────────────────────────── */
.login-page {
  min-height:100vh;
  background:linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  display:flex; align-items:center; justify-content:center; padding:20px;
}
.login-card {
  background:var(--surface); border-radius:var(--radius);
  width:100%; max-width:380px;
  box-shadow:0 8px 40px rgba(0,0,0,0.25); padding:40px 36px 30px;
}
.login-logo-wrap { text-align:center; margin-bottom:22px; }
.login-logo-wrap img { max-height:64px; max-width:200px; object-fit:contain; }
.login-title { font-size:1.05rem; font-weight:700; color:var(--text); text-align:center; margin-bottom:4px; }
.login-sub   { font-size:0.72rem; color:var(--text-muted); text-align:center; margin-bottom:24px; }
.btn-login   { background:var(--primary); color:#fff; border-radius:var(--radius); }
.btn-login:hover { background:var(--primary-hover); }
.login-footer { text-align:center; margin-top:18px; font-size:0.7rem; color:var(--text-muted); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width:1024px) {
  .modules-grid { grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); }
}

@media (max-width:768px) {
  .sidebar { transform:translateX(-100%); }
  .sidebar.open { transform:translateX(0); }
  .main-content { margin-left:0; }
  .hamburger-btn { display:block; }
  .grid-2,.grid-3 { grid-template-columns:1fr; }
  .page-content { padding:16px; }
  .topbar { padding:0 16px; }
  .welcome-banner { flex-direction:column; padding:20px; }
  .welcome-icon { display:none; }
  .stats-row { grid-template-columns:1fr 1fr; }
  .modules-grid { grid-template-columns:1fr 1fr; gap:12px; }
}

@media (max-width:400px) {
  .modules-grid { grid-template-columns:1fr; }
  .stats-row { grid-template-columns:1fr; }
}
