@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Exo+2:wght@300;400;500;600&display=swap');

/* Refuerza el bloqueo de zoom del viewport: evita el gesto de pellizco en
   navegadores que respetan touch-action (Chrome/Edge Android). iOS Safari
   moderno ignora "user-scalable=no" por accesibilidad y puede seguir
   permitiendo el pellizco pese a esto. */
html, body { touch-action: pan-x pan-y; }

/* Quita las flechitas de incremento/decremento de todos los inputs numéricos del sitio. */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] {
    -moz-appearance: textfield;
}

:root {
    --bg-primary: #f0f2f7;
    --bg-secondary: #e4e8f0;
    --bg-card: #ffffff;
    --bg-card-hover: #f8faff;
    --border: #d0d7e8;
    --accent: #138a72;
    --accent2: #27ae60;
    --danger: #dc2626;
    --success: #059669;
    --warning: #d97706;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --nav-height: 60px;
    --shadow: 0 4px 16px rgba(0,0,0,0.09);
    --shadow-card: 0 1px 4px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);
}

:root[data-theme="dark"] {
    --bg-primary: #0b1220;
    --bg-secondary: #111827;
    --bg-card: #1a2233;
    --bg-card-hover: #212b40;
    --border: #2e3a52;
    --accent: #2ecc9a;
    --accent2: #4ade80;
    --danger: #f87171;
    --success: #34d399;
    --warning: #fbbf24;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --shadow: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-card: 0 1px 4px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.25);
}
:root[data-theme="dark"] .btn-secondary { background: var(--bg-card); color: var(--text-secondary); border-color: var(--border); }
:root[data-theme="dark"] .form-control { background: var(--bg-card); border-color: var(--border); color: var(--text-primary); }
:root[data-theme="dark"] .login-box { background: var(--bg-card); }

/* ── Tintes usados en paneles/badges (definidos aquí para que los estilos
   inline de las páginas puedan usar var(...) y adaptarse al tema) ── */
:root {
    --bg-soft: #f8fafc;
    --text-faint: #94a3b8;
    --tint-green-bg: #ecfdf5;
    --tint-green-border: #bbf7d0;
    --tint-red-bg: #fef2f2;
    --tint-red-border: #fca5a5;
    --tint-yellow-bg: #fffbeb;
    --tint-yellow-border: #fde68a;
    --tint-blue-bg: #eff6ff;
    --tint-blue-border: #bfdbfe;
    --tint-indigo-bg: #eef2ff;
    --tint-indigo-border: #c7d2fe;
    --accent-purple: #7c3aed;
}
:root[data-theme="dark"] {
    --bg-soft: #212b40;
    --text-faint: #7d8ba1;
    --tint-green-bg: rgba(52,211,153,0.12);
    --tint-green-border: rgba(52,211,153,0.35);
    --tint-red-bg: rgba(248,113,113,0.12);
    --tint-red-border: rgba(248,113,113,0.35);
    --tint-yellow-bg: rgba(251,191,36,0.12);
    --tint-yellow-border: rgba(251,191,36,0.35);
    --tint-blue-bg: rgba(59,130,246,0.14);
    --tint-blue-border: rgba(59,130,246,0.4);
    --tint-indigo-bg: rgba(99,102,241,0.16);
    --tint-indigo-border: rgba(99,102,241,0.4);
    --accent-purple: #a78bfa;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Exo 2', sans-serif; background: var(--bg-primary); color: var(--text-primary); min-height: 100vh; overflow-x: hidden; }

/* ── NAVBAR (mantiene oscuro para contraste) ── */
.navbar {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--nav-height);
    background: #16321f;
    border-bottom: 1px solid #23472f;
    display: flex; align-items: center;
    padding: 0 24px; z-index: 1000; gap: 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.navbar-brand {
    font-family: 'Rajdhani', sans-serif; font-size: 15px; font-weight: 700;
    color: #60a5fa; text-decoration: none; letter-spacing: 1px; text-transform: uppercase;
    display: flex; align-items: center; gap: 10px; white-space: nowrap; margin-right: 32px;
}
.navbar-brand span { color: #4ade80; }
.nav-menu { display: flex; align-items: center; gap: 4px; flex: 1; list-style: none; }
.nav-item { position: relative; }
.nav-link {
    display: flex; align-items: center; gap: 7px;
    padding: 8px 16px; color: #94a3b8; text-decoration: none;
    font-size: 13px; font-weight: 500; letter-spacing: 0.5px; text-transform: uppercase;
    border-radius: 6px; transition: all 0.2s; white-space: nowrap; cursor: pointer; border: none; background: none;
}
.nav-link:hover, .nav-link.active { color: #f1f5f9; background: rgba(255,255,255,0.08); }
.nav-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-dropdown { position: relative; }
.nav-dropdown .dropdown-menu {
    display: none; position: absolute; top: calc(100% + 8px); left: 0; min-width: 220px;
    background: #1e293b; border: 1px solid #334155; border-radius: 10px; padding: 8px;
    z-index: 2000; box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.nav-dropdown .dropdown-menu.open { display: block; }
.dropdown-item { display: flex; align-items: center; gap: 8px; padding: 9px 14px; color: #94a3b8; text-decoration: none; font-size: 13px; border-radius: 6px; transition: all 0.2s; }
.dropdown-item:hover { background: rgba(255,255,255,0.08); color: #f1f5f9; }
.dropdown-divider { height: 1px; background: #334155; margin: 6px 0; }
.dropdown-header { padding: 6px 14px 4px; font-size: 10px; font-weight: 700; letter-spacing: 1.5px; color: #475569; text-transform: uppercase; }
.dropdown-new { display: flex; align-items: center; gap: 8px; padding: 9px 14px; color: #60a5fa; text-decoration: none; font-size: 13px; border-radius: 6px; transition: all 0.2s; font-weight: 500; }
.dropdown-new:hover { background: rgba(96,165,250,0.1); }
.navbar-user { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user-badge { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: rgba(255,255,255,0.06); border: 1px solid #334155; border-radius: 20px; font-size: 13px; color: #94a3b8; }
.user-badge .dot { width: 8px; height: 8px; background: #10b981; border-radius: 50%; box-shadow: 0 0 6px #10b981; }
.btn-logout { display: flex; align-items: center; gap: 6px; padding: 6px 14px; background: transparent; border: 1px solid #334155; color: #94a3b8; border-radius: 6px; cursor: pointer; font-size: 13px; text-decoration: none; transition: all 0.2s; }
.btn-logout:hover { border-color: #ef4444; color: #ef4444; }
.theme-toggle { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; background: rgba(255,255,255,0.06); border: 1px solid #334155; color: #94a3b8; border-radius: 6px; cursor: pointer; transition: all 0.2s; }
.theme-toggle:hover { border-color: var(--accent); color: #f1f5f9; }
.theme-toggle svg { width: 16px; height: 16px; }

/* ── MAIN CONTENT ── */
.main-content { margin-top: var(--nav-height); padding: 32px 28px; position: relative; z-index: 1; min-height: calc(100vh - var(--nav-height)); }

/* ── PAGE HEADER ── */
.page-header { margin-bottom: 28px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.page-title { font-family: 'Rajdhani', sans-serif; font-size: 28px; font-weight: 700; color: var(--text-primary); letter-spacing: 0.5px; }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.page-title-line { width: 40px; height: 3px; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 2px; margin-top: 8px; }

/* ── CARDS ── */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 24px; box-shadow: var(--shadow-card); transition: box-shadow 0.3s; }
.card:hover { box-shadow: var(--shadow); }
.card-title { font-family: 'Rajdhani', sans-serif; font-size: 15px; font-weight: 700; color: var(--text-primary); letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.card-title::before { content: ''; display: inline-block; width: 4px; height: 16px; background: linear-gradient(180deg, var(--accent), var(--accent2)); border-radius: 2px; }

/* ── STAT CARDS ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 20px 24px; position: relative; overflow: hidden; box-shadow: var(--shadow-card); transition: all 0.3s; }
.stat-card::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--accent2)); opacity: 0; transition: opacity 0.3s; }
.stat-card:hover::after { opacity: 1; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; font-weight: 600; }
.stat-value { font-family: 'Rajdhani', sans-serif; font-size: 26px; font-weight: 700; color: var(--text-primary); }
.stat-value.danger { color: var(--danger); }
.stat-value.success { color: var(--success); }
.stat-value.warning { color: var(--warning); }

/* ── TABLE ── */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead tr { background: var(--bg-soft); }
thead th { padding: 12px 16px; text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--text-muted); text-transform: uppercase; border-bottom: 2px solid var(--border); white-space: nowrap; }
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.15s; }
tbody tr:hover { background: var(--bg-soft); }
tbody td { padding: 11px 16px; color: var(--text-secondary); white-space: nowrap; }
tbody td:first-child { color: var(--text-primary); font-weight: 500; }

.pagada-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.pagada-badge.si { background: var(--tint-green-bg); color: var(--success); }
.pagada-badge.no { background: var(--tint-red-bg); color: var(--danger); }
.tna-badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; background: var(--tint-blue-bg); color: var(--accent); }
.cuotas-badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; background: var(--tint-blue-bg); color: var(--accent); }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 20px; border-radius: 8px; font-size: 13px; font-weight: 600; font-family: 'Exo 2', sans-serif; cursor: pointer; border: none; text-decoration: none; transition: all 0.2s; letter-spacing: 0.3px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(19,138,114,0.2); }
.btn-primary:hover { background: #0f6e5b; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(19,138,114,0.3); }
.btn-secondary { background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); background: var(--tint-blue-bg); }
.btn-danger { background: var(--tint-red-bg); color: var(--danger); border: 1px solid var(--tint-red-border); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-success { background: var(--tint-green-bg); color: var(--success); border: 1px solid var(--tint-green-border); }
.btn-success:hover { background: var(--success); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-icon { padding: 7px; border-radius: 6px; }

/* ── FORMS ── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 7px; }
.form-control { width: 100%; padding: 10px 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; color: var(--text-primary); font-family: 'Exo 2', sans-serif; font-size: 14px; transition: all 0.2s; outline: none; }
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(19,138,114,0.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── ALERT ── */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.alert-error { background: var(--tint-red-bg); border: 1px solid var(--tint-red-border); color: var(--danger); }
.alert-success { background: var(--tint-green-bg); border: 1px solid var(--tint-green-border); color: var(--success); }

/* ── CHART ── */
.chart-container { position: relative; height: 280px; margin-top: 10px; }

/* ── PROGRESS ── */
.progress-bar-wrap { background: var(--border); border-radius: 10px; height: 8px; overflow: hidden; margin-top: 6px; }
.progress-bar-fill { height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width 0.6s ease; }

/* ── GRID ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* ── EXCEL TABLE ── */
.excel-table-wrap { overflow-x: auto; }
.excel-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.excel-table th { background: var(--tint-indigo-bg); color: var(--accent); padding: 8px 12px; text-align: center; font-size: 11px; font-weight: 700; border: 1px solid var(--tint-indigo-border); white-space: nowrap; }
.excel-table td { padding: 7px 12px; border: 1px solid var(--border); text-align: center; color: var(--text-secondary); white-space: nowrap; }
.excel-table td:first-child { text-align: left; color: var(--text-primary); font-weight: 500; }
.excel-table .total-row td { background: var(--tint-indigo-bg); font-weight: 700; color: var(--text-primary); border-top: 2px solid var(--accent); }
.excel-table td.empty { color: var(--text-faint); }

/* ── PLAN CARD ── */
.plan-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-card); transition: all 0.3s; }
.plan-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.plan-card-header { padding: 18px 22px; background: linear-gradient(135deg, var(--tint-blue-bg), var(--bg-soft)); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.plan-card-title { font-family: 'Rajdhani', sans-serif; font-size: 18px; font-weight: 700; color: var(--text-primary); }
.plan-card-body { padding: 18px 22px; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .main-content { padding: 20px 14px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }

    /* Letra y números un poco más grandes para mobile */
    body { font-size: 15px; }
    table, td, th, .form-control, input, select, textarea, button { font-size: 15px !important; }
    .stat-value { font-size: 22px !important; }

    /* Navbar mobile */
    .nav-menu {
        display: none; flex-direction: column; gap: 2px;
        position: fixed; top: var(--nav-height); left: 0; right: 0;
        background: #0f172a; border-bottom: 1px solid #1e293b;
        padding: 12px 16px 16px; z-index: 999;
        max-height: calc(100vh - var(--nav-height)); overflow-y: auto;
    }
    .nav-menu.open { display: flex; }
    .navbar-user { display: none; }
    .nav-hamburger {
        display: flex; flex-direction: column; gap: 5px; cursor: pointer;
        margin-left: auto; background: none; border: none; padding: 6px;
    }
    .nav-hamburger span {
        display: block; width: 22px; height: 2px; background: #94a3b8; border-radius: 2px;
        transition: all 0.25s;
    }
    .nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-hamburger.open span:nth-child(2) { opacity: 0; }
    .nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
    .nav-dropdown .dropdown-menu { position: static; box-shadow: none; border: none; background: rgba(255,255,255,0.04); margin-top: 2px; }
    .nav-dropdown .dropdown-menu.open { display: block; }
}

/* ── LOGIN ── */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #16321f 0%, #0f4c3f 100%); }
.login-box { background: #fff; border-radius: 16px; padding: 44px 40px; width: 100%; max-width: 400px; text-align: center; position: relative; overflow: hidden; box-shadow: 0 24px 48px rgba(0,0,0,0.25); }
.login-box::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, #138a72, #27ae60); }
.login-logo { font-family: 'Rajdhani', sans-serif; font-size: 32px; font-weight: 700; color: #138a72; letter-spacing: 3px; margin-bottom: 6px; }
.login-logo span { color: #27ae60; }
.login-sub { color: #64748b; font-size: 13px; margin-bottom: 32px; }
.login-btn { width: 100%; padding: 13px; background: #138a72; color: #fff; border: none; border-radius: 8px; font-family: 'Exo 2', sans-serif; font-size: 15px; font-weight: 700; letter-spacing: 1px; cursor: pointer; text-transform: uppercase; transition: all 0.2s; box-shadow: 0 4px 14px rgba(19,138,114,0.3); }
.login-btn:hover { background: #0f6e5b; transform: translateY(-1px); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Pantallas grandes (2K/4K): se agranda todo para que no quede chico y ocupe el ancho. */
@media (min-width: 1900px) { html { zoom: 1.15; } .main-content { padding: 32px 44px; } }
@media (min-width: 2400px) { html { zoom: 1.3; } }

/* ── Monedi (multiusuario) ── */
.nav-marca { font-family: 'Rajdhani', sans-serif; font-size: 18px; font-weight: 700; color: #fff; text-decoration: none; margin-right: 18px; white-space: nowrap; letter-spacing: .5px; }
.nav-marca::first-letter { color: #4ade80; }
.aviso-prueba { position: fixed; top: var(--nav-height); left: 0; right: 0; z-index: 999; background: var(--tint-green-bg); border-bottom: 1px solid var(--tint-green-border); color: var(--text-primary); text-align: center; padding: 7px 16px; font-size: 13px; }
.aviso-prueba a { color: var(--accent); font-weight: 700; margin-left: 6px; }
.aviso-prueba ~ .main-content { margin-top: calc(var(--nav-height) + 36px) !important; }
.modulos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 16px 0 22px; }
.modulo-op { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card); cursor: pointer; transition: border-color .15s, background .15s; }
.modulo-op:hover { border-color: var(--accent); }
.modulo-op input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; }
.modulo-op svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--accent); margin-top: 2px; }
.modulo-op strong { display: block; color: var(--text-primary); font-size: 15px; }
.modulo-op small { color: var(--text-muted); font-size: 12.5px; line-height: 1.4; }
.modulo-op:has(input:checked) { border-color: var(--accent); background: var(--tint-green-bg); }
.login-box a { color: var(--accent); }
.login-box .msg-ok { background: #ecfdf5; border: 1px solid #bbf7d0; color: #14532d; border-radius: 8px; padding: 12px; font-size: 14px; text-align: left; margin-bottom: 14px; }
.login-box .login-alert { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; border-radius: 8px; padding: 10px 12px; font-size: 13.5px; text-align: left; margin-bottom: 14px; }
.login-box .form-group { text-align: left; margin-bottom: 14px; }
.login-box label { display: block; font-size: 13px; font-weight: 600; color: #334155; margin-bottom: 5px; }
.login-box input[type=text], .login-box input[type=email], .login-box input[type=password], .login-box input[type=tel] { width: 100%; padding: 11px 13px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 15px; font-family: 'Exo 2', sans-serif; background: #fff; color: #0f172a; }
.login-box .check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; font-size: 13px; text-align: left; margin: 6px 0 16px; }
.login-box .check input { margin-top: 2px; accent-color: #138a72; }
.login-links { margin-top: 16px; font-size: 13px; color: #64748b; display: flex; flex-direction: column; gap: 6px; }
.trampa { position: absolute; left: -9999px; }

/* ── Instalar la app (ingreso) ── */
.instalar-app { margin-top: 22px; padding: 16px; border: 1px solid #cfe3da; background: #f1f8f5; border-radius: 12px; text-align: left; }
.instalar-app[hidden], .instalar-app [hidden] { display: none !important; }
.instalar-titulo { display: flex; gap: 12px; align-items: center; }
.instalar-titulo img { border-radius: 10px; flex-shrink: 0; }
.instalar-titulo b { display: block; color: #16321f; font-size: 15px; }
.instalar-titulo small { color: #4b5d53; font-size: 12.5px; line-height: 1.35; display: block; }
.instalar-boton { width: 100%; margin-top: 12px; padding: 11px; border: 2px solid #138a72; background: #fff; color: #138a72; border-radius: 8px; font-family: 'Exo 2', sans-serif; font-size: 14px; font-weight: 700; cursor: pointer; }
.instalar-boton:hover { background: #138a72; color: #fff; }
.instalar-app ol { margin: 12px 0 0 20px; color: #334155; font-size: 13.5px; display: grid; gap: 4px; }
.instalar-app ol svg { vertical-align: -3px; color: #138a72; }
.instalar-app p { margin-top: 10px; color: #334155; font-size: 13.5px; }

/* ===== Menú lateral (estilo Fiscora) ===== */
:root { --sidebar-w: 240px; }
@media (min-width: 901px) {
    .navbar {
        right: auto; bottom: 0; width: var(--sidebar-w); height: auto;
        flex-direction: column; align-items: stretch; padding: 0;
        border-bottom: none; border-right: 1px solid #23472f;
        box-shadow: 2px 0 12px rgba(0,0,0,0.2);
    }
    .nav-marca { margin: 0; padding: 22px 20px 18px; font-size: 21px; text-align: center; border-bottom: 1px solid rgba(255,255,255,.12); }
    .nav-menu { flex-direction: column; align-items: stretch; gap: 0; padding: 12px 0; overflow-y: auto; }
    .nav-link {
        display: flex; padding: 12px 20px; border-radius: 0; border-left: 3px solid transparent;
        color: rgba(255,255,255,.75); white-space: nowrap;
    }
    .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
    .nav-link.active { background: rgba(255,255,255,.12); color: #fff; border-left-color: #4ade80; font-weight: 700; }
    .navbar-user { margin: 0; padding: 16px 20px; justify-content: center; border-top: 1px solid rgba(255,255,255,.12); }
    .main-content { margin-top: 0; margin-left: var(--sidebar-w); min-height: 100vh; }
    .aviso-prueba { top: 0; left: var(--sidebar-w); }
    .aviso-prueba ~ .main-content { margin-top: 36px !important; }
}
@media (max-width: 900px) {
    .nav-menu {
        display: flex; top: var(--nav-height); bottom: 0; right: auto; width: 260px; max-height: none;
        background: #16321f; border-right: 1px solid #23472f; border-bottom: none;
        padding: 12px 0; gap: 0; align-items: stretch; height: calc(100vh - var(--nav-height)); transform: translateX(-100%); transition: transform .25s ease;
        box-shadow: 2px 0 16px rgba(0,0,0,.35);
    }
    .nav-menu.open { transform: translateX(0); }
    .nav-menu .nav-link { padding: 13px 20px; border-radius: 0; border-left: 3px solid transparent; }
    .nav-menu .nav-link.active { border-left-color: #4ade80; background: rgba(255,255,255,.12); color: #fff; }
    .nav-menu .nav-salir { display: block; }
    .nav-fondo { position: fixed; inset: var(--nav-height) 0 0 0; background: rgba(0,0,0,.45); z-index: 998; display: none; }
    .nav-fondo.open { display: block; }
}
.nav-salir { display: none; }
.aviso-impersonar { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 1100; background: #7c3aed; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.3); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center; max-width: calc(100% - 32px); }
.aviso-impersonar a { background: #fff; color: #7c3aed; padding: 4px 10px; border-radius: 6px; font-weight: 700; text-decoration: none; }
.nav-badge { background: #e74c3c; color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; font-weight: 700; margin-left: 4px; }
.nav-marca { display: flex; align-items: center; gap: 9px; }
.nav-marca::first-letter { color: inherit; }
.nav-marca span::first-letter { color: #4ade80; }
.nav-logo { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; }
@media (min-width: 901px) { .nav-marca { justify-content: center; font-size: 24px; } .nav-logo { width: 36px; height: 36px; border-radius: 9px; } }
