/* ============================================================
   SISTEMA PROCESO DE COMPRA
   Plataformas de Calidad y Desarrollo Organizacional
   Colores: Navy #1B2A4A | Rojo #C8312B
   ============================================================ */

/* ── RESET Y BASE ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --navy:        #1B2A4A;
    --navy-dark:   #0F1D35;
    --navy-light:  #243459;
    --red:         #C8312B;
    --red-dark:    #A01F1A;
    --red-light:   #E04540;
    --white:       #FFFFFF;
    --gray-50:     #F8FAFC;
    --gray-100:    #F1F5F9;
    --gray-200:    #E2E8F0;
    --gray-300:    #CBD5E1;
    --gray-400:    #94A3B8;
    --gray-500:    #64748B;
    --gray-600:    #475569;
    --gray-700:    #334155;
    --gray-800:    #1E293B;
    --success:     #16A34A;
    --success-bg:  #F0FDF4;
    --warning:     #D97706;
    --warning-bg:  #FFFBEB;
    --danger:      #DC2626;
    --danger-bg:   #FEF2F2;
    --info:        #2563EB;
    --info-bg:     #EFF6FF;
    --sidebar-w:   260px;
    --header-h:    64px;
    --radius:      8px;
    --radius-lg:   12px;
    --shadow-sm:   0 1px 3px rgba(0,0,0,0.08);
    --shadow:      0 4px 16px rgba(0,0,0,0.10);
    --shadow-lg:   0 8px 32px rgba(0,0,0,0.14);
    --transition:  all 0.2s ease;
}

html { scroll-behavior: smooth; }

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray-700);
    background: var(--gray-100);
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ── PANTALLA DE LOGIN ── */
.auth-body {
    min-height: 100vh;
    background: var(--navy-dark);
}

.auth-screen {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    isolation: isolate;
    display: grid;
    grid-template-rows: auto 1fr auto;
    color: var(--white);
}

.auth-backdrop,
.auth-shade {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.auth-backdrop {
    z-index: -3;
    background-image: url('../img/login-bg.jpg');
    background-size: cover;
    background-position: center center;
    transform: scale(1.01);
}

.auth-shade {
    z-index: -2;
    background:
        radial-gradient(circle at 73% 50%, rgba(27,42,74,0.08) 0%, rgba(15,29,53,0.30) 42%, rgba(7,18,36,0.62) 100%),
        linear-gradient(90deg, rgba(7,18,36,0.52) 0%, rgba(15,29,53,0.18) 48%, rgba(15,29,53,0.42) 100%);
}

.auth-topbar {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 26px 48px 12px;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.auth-brand > img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    padding: 4px;
    border-radius: 50%;
    background: rgba(255,255,255,0.94);
    box-shadow: 0 8px 24px rgba(0,0,0,0.20);
}

.auth-brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.auth-brand-copy strong {
    color: var(--white);
    font-size: 21px;
    font-weight: 750;
    letter-spacing: -0.02em;
}

.auth-brand-copy strong span { color: var(--red-light); }

.auth-brand-copy small {
    margin-top: 5px;
    color: rgba(255,255,255,0.70);
    font-size: 12px;
    letter-spacing: 0.04em;
}

.auth-stage {
    position: relative;
    z-index: 2;
    width: min(1440px, 100%);
    margin: 0 auto;
    padding: 16px 56px 30px;
    display: grid;
    grid-template-columns: minmax(300px, 0.9fr) minmax(470px, 0.75fr);
    gap: clamp(40px, 7vw, 120px);
    align-items: center;
}

.auth-message {
    max-width: 460px;
    align-self: center;
    padding-bottom: 6vh;
    text-shadow: 0 4px 18px rgba(0,0,0,0.30);
    animation: authFadeIn 0.7s ease both;
}

.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: rgba(255,255,255,0.72);
}

.auth-kicker::before {
    content: '';
    width: 34px;
    height: 2px;
    border-radius: 999px;
    background: var(--red-light);
}

.auth-message h1 {
    font-size: clamp(42px, 4.8vw, 72px);
    line-height: 0.98;
    font-weight: 800;
    letter-spacing: -0.045em;
    color: var(--white);
}

.auth-message h1 span { color: var(--red-light); }

.auth-message-text {
    max-width: 390px;
    margin-top: 22px;
    font-size: 16px;
    line-height: 1.65;
    color: rgba(255,255,255,0.78);
}

.auth-card-wrap {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.auth-card {
    position: relative;
    width: min(100%, 570px);
    padding: 38px 42px 34px;
    border: 1px solid rgba(255,255,255,0.30);
    border-radius: 26px;
    background: linear-gradient(145deg, rgba(246,249,255,0.78), rgba(218,226,239,0.58));
    box-shadow:
        0 30px 80px rgba(5,16,34,0.42),
        inset 0 1px 0 rgba(255,255,255,0.72);
    backdrop-filter: blur(20px) saturate(125%);
    -webkit-backdrop-filter: blur(20px) saturate(125%);
    color: var(--navy-dark);
    animation: authSlideUp 0.7s ease 0.12s both;
}

.auth-card::before {
    content: '';
    position: absolute;
    inset: 12px;
    border: 1px solid rgba(255,255,255,0.20);
    border-radius: 18px;
    pointer-events: none;
}

.auth-logo {
    position: relative;
    z-index: 1;
    text-align: center;
    margin-bottom: 14px;
}

.auth-logo img {
    height: 105px;
    width: auto;
    max-width: 160px;
    margin: 0 auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(15,29,53,0.18));
}

.auth-card h2 {
    position: relative;
    z-index: 1;
    margin-top: 4px;
    font-size: 34px;
    font-weight: 800;
    text-align: center;
    color: var(--navy-dark);
    letter-spacing: -0.03em;
}

.auth-subtitulo {
    position: relative;
    z-index: 1;
    margin-top: 5px;
    text-align: center;
    font-size: 14px;
    color: var(--gray-600);
}

.auth-divider {
    position: relative;
    z-index: 1;
    display: block;
    width: 58px;
    height: 3px;
    margin: 18px auto 28px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--red), transparent);
}

.auth-card form,
.auth-card .alert {
    position: relative;
    z-index: 1;
}

.auth-card .form-group { margin-bottom: 18px; }

.auth-card .form-group label {
    color: var(--navy-dark);
    font-size: 13.5px;
    margin-bottom: 8px;
}

.auth-card .form-control {
    min-height: 58px;
    padding: 14px 48px 14px 48px;
    border: 1px solid rgba(100,116,139,0.42);
    border-radius: 11px;
    background: rgba(255,255,255,0.18);
    color: var(--navy-dark);
    font-size: 14px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.36);
}

.auth-card .form-control::placeholder { color: rgba(71,85,105,0.72); }

.auth-card .form-control:focus {
    border-color: rgba(200,49,43,0.82);
    background: rgba(255,255,255,0.38);
    box-shadow: 0 0 0 4px rgba(200,49,43,0.10);
}

.input-icon-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-group .input-icon {
    position: absolute;
    left: 16px;
    z-index: 2;
    color: var(--navy-light);
    pointer-events: none;
}

.input-icon-group .btn-eye {
    position: absolute;
    right: 12px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--navy-light);
    cursor: pointer;
    transition: var(--transition);
}

.input-icon-group .btn-eye:hover {
    color: var(--red);
    background: rgba(255,255,255,0.32);
}

.auth-forgot {
    margin: -2px 0 24px;
    text-align: right;
}

.auth-forgot a {
    font-size: 13px;
    font-weight: 650;
    color: var(--red-dark);
}

.auth-forgot a:hover {
    color: var(--red);
    text-decoration: underline;
}

.auth-submit {
    min-height: 60px;
    border-radius: 10px;
    justify-content: space-between;
    padding-inline: 24px;
    background: linear-gradient(135deg, var(--navy-dark), #08295A);
    box-shadow: 0 14px 30px rgba(15,29,53,0.30);
}

.auth-submit svg { color: var(--red-light); }

.auth-submit:hover {
    background: linear-gradient(135deg, #09172D, #0A316B);
    transform: translateY(-1px);
    box-shadow: 0 18px 34px rgba(15,29,53,0.36);
}

.auth-footer {
    position: relative;
    z-index: 2;
    padding: 12px 24px 24px;
    text-align: center;
    font-size: 12px;
    color: rgba(255,255,255,0.74);
    text-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

/* Modal de recuperación de contraseña */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    z-index: 300;
    padding: 20px;
    background: rgba(7,18,36,0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-overlay.active { display: flex; }

.modal-box {
    position: relative;
    width: 100%;
    max-width: 400px;
    padding: 34px 30px 30px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.55);
    border-radius: 18px;
    background: rgba(255,255,255,0.94);
    box-shadow: var(--shadow-lg);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 15px;
    border: 0;
    background: transparent;
    color: var(--gray-400);
    font-size: 22px;
    cursor: pointer;
}

.modal-close:hover { color: var(--navy); }

.modal-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(200,49,43,0.09);
    color: var(--red);
}

.modal-box h3 {
    margin-bottom: 10px;
    color: var(--navy-dark);
    font-size: 18px;
}

.modal-box p {
    margin-bottom: 8px;
    color: var(--gray-600);
    font-size: 13.5px;
    line-height: 1.6;
}

.modal-contacto {
    margin-bottom: 20px !important;
    color: var(--navy) !important;
}

.modal-box .btn { width: 100%; }

@keyframes authFadeIn {
    from { opacity: 0; transform: translateX(-14px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes authSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.985); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.btn-spinner {
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: authSpin 0.6s linear infinite;
}

@keyframes authSpin { to { transform: rotate(360deg); } }

.btn:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}

@media (max-width: 1050px) {
    .auth-stage {
        grid-template-columns: 0.75fr minmax(440px, 0.9fr);
        gap: 34px;
        padding-inline: 34px;
    }

    .auth-message h1 { font-size: 48px; }
}

@media (max-width: 820px) {
    .auth-backdrop { background-position: 35% center; }

    .auth-shade {
        background: linear-gradient(180deg, rgba(7,18,36,0.50), rgba(7,18,36,0.74));
    }

    .auth-topbar { padding: 20px 22px 8px; }
    .auth-brand-copy strong { font-size: 18px; }
    .auth-brand-copy small { display: none; }

    .auth-stage {
        display: flex;
        justify-content: center;
        padding: 20px 18px 28px;
    }

    .auth-message { display: none; }
    .auth-card-wrap { width: 100%; justify-content: center; }
    .auth-card { width: min(100%, 520px); }
}

@media (max-width: 560px) {
    .auth-topbar { justify-content: center; }
    .auth-brand > img { width: 44px; height: 44px; }
    .auth-brand-copy strong { font-size: 17px; }

    .auth-stage {
        align-items: flex-start;
        padding-top: 10px;
    }

    .auth-card {
        padding: 30px 22px 26px;
        border-radius: 20px;
        background: rgba(239,244,252,0.88);
    }

    .auth-logo img { height: 86px; }
    .auth-card h2 { font-size: 29px; }
    .auth-card .form-control { min-height: 54px; }
    .auth-footer { padding-bottom: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-message,
    .auth-card,
    .btn-spinner {
        animation: none;
    }
}

/* ── FORMULARIOS ── */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    color: var(--gray-800);
    background: var(--white);
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(27, 42, 74, 0.08);
}

.form-control::placeholder { color: var(--gray-400); }

/* ── FILTROS RESPONSIVOS (reemplaza los grid-template-columns en línea) ── */
.filtros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
}

/* ── BOTONES ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--navy);
    color: var(--white);
    width: 100%;
    padding: 12px;
    font-size: 15px;
}

.btn-primary:hover {
    background: var(--navy-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(27,42,74,0.3);
}

.btn-danger {
    background: var(--red);
    color: var(--white);
}

.btn-danger:hover { background: var(--red-dark); }

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

.btn-secondary:hover { background: var(--gray-200); }

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* ── BOTÓN HAMBURGUESA (menú móvil/tablet) ── */
.btn-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--navy);
    cursor: pointer;
    padding: 6px;
    margin-right: 4px;
    flex-shrink: 0;
}

.btn-menu-toggle svg { width: 24px; height: 24px; }

/* ── ALERTAS ── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #FECACA;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid #BBF7D0;
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid #FDE68A;
}

/* ── LAYOUT PRINCIPAL ── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--navy);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand img {
    height: 40px;
    width: 40px;
    object-fit: contain;
    border-radius: 8px;
    background: white;
    padding: 4px;
}

.sidebar-brand-text h2 {
    font-size: 13px;
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
}

.sidebar-brand-text p {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
}

.sidebar-section {
    margin-bottom: 8px;
}

.sidebar-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.35);
    padding: 8px 20px 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: rgba(255,255,255,0.65);
    font-size: 13.5px;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    color: var(--white);
    background: rgba(255,255,255,0.06);
}

.sidebar-link.active {
    color: var(--white);
    background: rgba(200,49,43,0.18);
    border-left-color: var(--red);
}

.sidebar-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.8;
}

.sidebar-link.active svg { opacity: 1; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.sidebar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--white);
    flex-shrink: 0;
}

.sidebar-user-info h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--white);
    line-height: 1.2;
}

.sidebar-user-info p {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    text-transform: capitalize;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.65);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    text-decoration: none;
}

.btn-logout:hover {
    background: rgba(200,49,43,0.2);
    color: var(--white);
    border-color: rgba(200,49,43,0.4);
}

/* ── OVERLAY (fondo oscuro al abrir el menú en tablet/móvil) ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 29, 53, 0.5);
    z-index: 99;
}

.sidebar-overlay.active { display: block; }

/* ── CONTENIDO PRINCIPAL ── */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

/* ── HEADER ── */
.top-header {
    height: var(--header-h);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.top-header h1 {
    flex: 1;
    font-size: 18px;
    font-weight: 700;
    color: var(--navy);
}

.top-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

/* ── PÁGINA ── */
.page-content {
    padding: 28px;
    flex: 1;
    min-width: 0;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--navy);
}

.page-header p {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 2px;
}

/* ── TARJETAS DE ESTADÍSTICAS ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.navy { background: rgba(27,42,74,0.08); color: var(--navy); }
.stat-icon.red   { background: rgba(200,49,43,0.08); color: var(--red); }
.stat-icon.green { background: rgba(22,163,74,0.08); color: var(--success); }
.stat-icon.amber { background: rgba(217,119,6,0.08); color: var(--warning); }

.stat-icon svg { width: 24px; height: 24px; }

.stat-info h3 {
    font-size: 26px;
    font-weight: 700;
    color: var(--navy);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-info p {
    font-size: 13px;
    color: var(--gray-500);
}

/* ── TARJETAS GENERALES ── */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--navy);
}

.card-body { padding: 24px; }

/* ── TABLAS ── */
.table-wrapper {
    overflow-x: auto;
    max-width: 100%;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.table th {
    background: var(--gray-50);
    color: var(--gray-600);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }

.table tbody tr:hover { background: var(--gray-50); }

/* ── BADGES / ETIQUETAS ── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success  { background: var(--success-bg); color: var(--success); }
.badge-danger   { background: var(--danger-bg);  color: var(--danger); }
.badge-warning  { background: var(--warning-bg); color: var(--warning); }
.badge-info     { background: var(--info-bg);    color: var(--info); }
.badge-navy     { background: rgba(27,42,74,0.08); color: var(--navy); }
.badge-gray     { background: var(--gray-100);   color: var(--gray-600); }

/* ── UTILIDADES ── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--gray-400); font-size: 13px; }
.mt-4  { margin-top: 16px; }
.mb-4  { margin-bottom: 16px; }
.gap-2 { gap: 8px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-100 { width: 100%; }

/* ============================================================
   RESPONSIVE
   Breakpoint principal en 1024px porque las TABLETAS
   (el dispositivo prioritario del proyecto) miden entre
   768px (vertical) y 1180px (horizontal) — 768px se quedaba
   corto y dejaba tablets usando el layout de escritorio completo.
   ============================================================ */
@media (max-width: 1024px) {
    .btn-menu-toggle { display: flex; }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 200;
        box-shadow: var(--shadow-lg);
    }

    .sidebar.sidebar-open { transform: translateX(0); }

    .main-content { margin-left: 0; }

    .page-content { padding: 18px; }

    .top-header { padding: 0 18px; }
}

@media (max-width: 640px) {
    .stats-grid { grid-template-columns: 1fr; }
    .page-content { padding: 14px; }
    .top-header { padding: 0 14px; }
    .auth-card { padding: 32px 24px; }
}
/* ============================================================
   NOTIFICACIONES
   ============================================================ */

.notif-wrapper {
    position: relative;
}

.btn-notif {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--gray-600);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.btn-notif:hover {
    background: var(--gray-100);
    color: var(--navy);
}

.notif-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--red);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

.notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 200;
}

.notif-dropdown.active { display: block; }

.notif-header {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--navy);
    border-bottom: 1px solid var(--gray-200);
}

.notif-empty {
    padding: 20px 16px;
    font-size: 13px;
    color: var(--gray-400);
    text-align: center;
}

.notif-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--gray-100);
    text-decoration: none;
    color: var(--gray-700);
}

.notif-item:last-child { border-bottom: none; }

.notif-item:hover { background: var(--gray-50); }

.notif-item.no-leida {
    background: rgba(200, 49, 43, 0.05);
    border-left: 3px solid var(--red);
}

.notif-mensaje {
    font-size: 13px;
    line-height: 1.4;
}

.notif-fecha {
    font-size: 11px;
    color: var(--gray-400);
}

.notif-ver-todas {
    display: block;
    text-align: center;
    padding: 10px 16px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--navy);
    text-decoration: none;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.notif-ver-todas:hover {
    background: var(--gray-100);
}

@media (max-width: 640px) {
    .notif-dropdown {
        width: calc(100vw - 32px);
        right: -8px;
    }
}

/* ============================================================
   LOGIN V2 — refinamiento visual aprobado
   - Sin logotipo redundante en esquina superior
   - Sin imagen de logo superpuesta dentro de la tarjeta
   - Tarjeta más clara, limpia y protagonista
   ============================================================ */
.auth-screen {
    grid-template-rows: 1fr auto;
}

.auth-topbar,
.auth-brand,
.auth-logo {
    display: none !important;
}

.auth-backdrop {
    background-color: #0F1D35;
    background-repeat: no-repeat;
    background-size: 92% auto;
    background-position: center bottom;
    transform: none;
}

.auth-shade {
    background:
        radial-gradient(circle at 72% 48%, rgba(27,42,74,0.02) 0%, rgba(15,29,53,0.16) 44%, rgba(7,18,36,0.54) 100%),
        linear-gradient(90deg, rgba(7,18,36,0.42) 0%, rgba(15,29,53,0.10) 50%, rgba(15,29,53,0.24) 100%);
}

.auth-stage {
    min-height: calc(100vh - 62px);
    padding-top: 34px;
    padding-bottom: 24px;
    grid-template-columns: minmax(300px, 0.82fr) minmax(500px, 0.88fr);
    gap: clamp(48px, 6vw, 100px);
}

.auth-message {
    max-width: 430px;
    padding-bottom: 2vh;
}

.auth-message h1 {
    font-size: clamp(40px, 4.35vw, 66px);
}

.auth-card-wrap {
    justify-content: center;
}

.auth-card {
    width: min(100%, 590px);
    padding: 46px 48px 42px;
    border: 1px solid rgba(255,255,255,0.72);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(255,255,255,0.93), rgba(244,247,252,0.87));
    box-shadow:
        0 30px 80px rgba(5,16,34,0.38),
        0 8px 28px rgba(15,29,53,0.18),
        inset 0 1px 0 rgba(255,255,255,0.98);
    backdrop-filter: blur(18px) saturate(115%);
    -webkit-backdrop-filter: blur(18px) saturate(115%);
}

.auth-card::before {
    inset: 10px;
    border-color: rgba(27,42,74,0.07);
    border-radius: 17px;
}

.auth-system-name {
    position: relative;
    z-index: 1;
    margin: 0;
    text-align: center;
    color: var(--navy);
    font-size: 18px;
    font-weight: 750;
    letter-spacing: 0.01em;
}

.auth-system-rule {
    position: relative;
    z-index: 1;
    display: block;
    width: 46px;
    height: 3px;
    margin: 12px auto 25px;
    border-radius: 999px;
    background: var(--red);
}

.auth-card h2 {
    margin-top: 0;
    font-size: 35px;
}

.auth-subtitulo {
    margin-top: 7px;
    margin-bottom: 0;
    color: var(--gray-500);
}

.auth-divider {
    width: 52px;
    margin: 20px auto 32px;
}

.auth-card .form-group {
    margin-bottom: 22px;
}

.auth-card .form-group label {
    margin-bottom: 9px;
    color: var(--navy);
    font-weight: 700;
}

.auth-card .form-control {
    min-height: 60px;
    border: 1.5px solid var(--gray-200);
    background: rgba(255,255,255,0.96);
    box-shadow: 0 5px 18px rgba(15,29,53,0.06);
}

.auth-card .form-control:focus {
    border-color: var(--navy);
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(27,42,74,0.09), 0 7px 20px rgba(15,29,53,0.08);
}

.auth-forgot {
    margin: -4px 0 28px;
}

.auth-forgot a {
    color: var(--red);
    font-weight: 700;
}

.auth-submit {
    min-height: 60px;
    border-radius: 11px;
    box-shadow: 0 10px 24px rgba(15,29,53,0.24);
}

.auth-footer {
    padding: 4px 24px 18px;
}

@media (max-width: 1100px) {
    .auth-backdrop {
        background-size: cover;
    }

    .auth-stage {
        grid-template-columns: minmax(260px, 0.72fr) minmax(430px, 0.9fr);
        gap: 38px;
        padding-left: 34px;
        padding-right: 34px;
    }

    .auth-card {
        padding: 40px 38px 36px;
    }
}

@media (max-width: 900px) {
    .auth-stage {
        min-height: calc(100vh - 52px);
        grid-template-columns: 1fr;
        padding: 32px 20px 20px;
    }

    .auth-message {
        display: none;
    }

    .auth-card-wrap {
        justify-content: center;
    }

    .auth-card {
        max-width: 560px;
        background: rgba(255,255,255,0.94);
    }
}

@media (max-width: 640px) {
    .auth-card {
        padding: 34px 24px 30px;
        border-radius: 19px;
    }

    .auth-card h2 {
        font-size: 30px;
    }

    .auth-system-name {
        font-size: 16px;
    }
}


/* ============================================================
   REFINAMIENTO LOGIN V3
   Mayor protagonismo del formulario y mejor integración visual.
   ============================================================ */
.auth-backdrop {
    background-position: center 48%;
    filter: saturate(0.94) brightness(0.92);
}

.auth-shade {
    background:
        radial-gradient(circle at 72% 48%, rgba(200,49,43,0.08) 0%, rgba(27,42,74,0.10) 28%, rgba(7,18,36,0.30) 62%, rgba(7,18,36,0.58) 100%),
        linear-gradient(90deg, rgba(7,18,36,0.56) 0%, rgba(15,29,53,0.20) 47%, rgba(15,29,53,0.34) 100%);
}

.auth-stage {
    min-height: calc(100vh - 62px);
    padding-top: 24px;
    padding-bottom: 42px;
    grid-template-columns: minmax(300px, 0.78fr) minmax(520px, 0.92fr);
    gap: clamp(52px, 6vw, 104px);
}

.auth-message {
    max-width: 420px;
    padding-bottom: 1vh;
}

.auth-message h1 {
    font-size: clamp(39px, 4.1vw, 62px);
    line-height: 1.01;
}

.auth-message-text {
    margin-top: 20px;
    max-width: 360px;
}

.auth-card-wrap {
    position: relative;
}

.auth-card-wrap::before {
    content: '';
    position: absolute;
    width: 92%;
    height: 82%;
    border-radius: 40px;
    background: radial-gradient(circle, rgba(200,49,43,0.18) 0%, rgba(27,42,74,0.08) 42%, transparent 72%);
    filter: blur(38px);
    opacity: 0.75;
    transform: translate(-2%, 5%);
    pointer-events: none;
}

.auth-card {
    width: min(100%, 610px);
    padding: 42px 50px 40px;
    border: 1px solid rgba(255,255,255,0.92);
    border-radius: 25px;
    background: linear-gradient(145deg, rgba(255,255,255,0.975), rgba(248,250,254,0.945));
    box-shadow:
        0 28px 70px rgba(5,16,34,0.30),
        0 10px 30px rgba(15,29,53,0.12),
        0 0 42px rgba(200,49,43,0.07),
        inset 0 1px 0 rgba(255,255,255,1);
    backdrop-filter: blur(12px) saturate(108%);
    -webkit-backdrop-filter: blur(12px) saturate(108%);
}

.auth-card::before {
    inset: 9px;
    border-color: rgba(27,42,74,0.055);
}

.auth-system-name {
    font-size: 19px;
    font-weight: 760;
}

.auth-system-rule {
    margin: 10px auto 20px;
}

.auth-card h2 {
    font-size: 34px;
    line-height: 1.1;
}

.auth-subtitulo {
    margin-top: 8px;
    font-size: 14px;
}

.auth-divider {
    width: 46px;
    margin: 17px auto 27px;
}

.auth-card .form-group {
    margin-bottom: 23px;
}

.auth-card .form-control {
    min-height: 64px;
    border-radius: 13px;
    background: #FFFFFF;
    box-shadow: 0 6px 18px rgba(15,29,53,0.055);
}

.auth-forgot {
    margin: -3px 0 27px;
}

.auth-submit {
    min-height: 64px;
    border-radius: 13px;
    padding-inline: 26px;
    box-shadow: 0 12px 28px rgba(15,29,53,0.26);
}

.auth-footer {
    padding: 0 24px 30px;
    transform: translateY(-6px);
}

@media (max-width: 1100px) {
    .auth-stage {
        grid-template-columns: minmax(250px, 0.68fr) minmax(460px, 0.92fr);
        gap: 34px;
    }

    .auth-card {
        padding: 38px 38px 36px;
    }
}

@media (max-width: 900px) {
    .auth-stage {
        min-height: calc(100vh - 44px);
        padding-top: 28px;
        padding-bottom: 26px;
    }

    .auth-card {
        max-width: 580px;
        background: rgba(255,255,255,0.97);
    }

    .auth-footer {
        padding-bottom: 22px;
        transform: none;
    }
}

@media (max-width: 640px) {
    .auth-card {
        padding: 32px 23px 29px;
    }

    .auth-card .form-control,
    .auth-submit {
        min-height: 58px;
    }
}

/* ============================================================
   LOGIN V4 — VIDRIO SATINADO ENTERPRISE
   Refinamiento web nativo inspirado en el mockup aprobado.
   ============================================================ */
.auth-screen::before,
.auth-screen::after {
    content: '';
    position: fixed;
    pointer-events: none;
    z-index: -1;
    border-radius: 50%;
    filter: blur(70px);
}

.auth-screen::before {
    width: 460px;
    height: 460px;
    right: 7vw;
    top: 14vh;
    background: rgba(83, 116, 176, 0.22);
}

.auth-screen::after {
    width: 360px;
    height: 360px;
    right: 34vw;
    bottom: -13vh;
    background: rgba(200, 49, 43, 0.14);
}

.auth-backdrop {
    background-position: center 52%;
    filter: saturate(1.04) contrast(1.03) brightness(0.90);
    transform: scale(1.015);
}

.auth-shade {
    background:
        radial-gradient(circle at 76% 47%, rgba(118,151,207,0.10) 0%, rgba(15,29,53,0.08) 31%, transparent 53%),
        radial-gradient(circle at 49% 76%, rgba(200,49,43,0.10) 0%, transparent 32%),
        linear-gradient(90deg, rgba(5,14,30,0.53) 0%, rgba(8,21,43,0.18) 47%, rgba(7,18,36,0.30) 100%),
        linear-gradient(180deg, rgba(4,13,28,0.10) 0%, rgba(4,13,28,0.03) 55%, rgba(4,13,28,0.40) 100%);
}

.auth-stage {
    min-height: calc(100vh - 54px);
    padding: 32px 64px 46px;
    grid-template-columns: minmax(320px, 0.82fr) minmax(510px, 0.9fr);
    gap: clamp(52px, 7vw, 118px);
}

.auth-message {
    max-width: 430px;
    transform: translateY(-1vh);
}

.auth-message h1 {
    font-size: clamp(43px, 4.45vw, 67px);
    text-shadow: 0 10px 35px rgba(0,0,0,0.28);
}

.auth-message-text {
    color: rgba(255,255,255,0.82);
    text-shadow: 0 4px 18px rgba(0,0,0,0.28);
}

.auth-card-wrap::before {
    width: 108%;
    height: 96%;
    left: -5%;
    top: 3%;
    background:
        radial-gradient(circle at 42% 54%, rgba(200,49,43,0.20) 0%, transparent 43%),
        radial-gradient(circle at 66% 38%, rgba(117,151,210,0.25) 0%, transparent 52%);
    filter: blur(52px);
    opacity: 0.92;
}

.auth-card {
    width: min(100%, 590px);
    padding: 40px 46px 38px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.68);
    border-radius: 28px;
    background:
        linear-gradient(145deg, rgba(245,248,253,0.86), rgba(217,226,241,0.72));
    box-shadow:
        0 38px 95px rgba(3,12,29,0.46),
        0 12px 35px rgba(4,15,34,0.20),
        0 0 0 1px rgba(255,255,255,0.13),
        inset 0 1px 0 rgba(255,255,255,0.92),
        inset 0 -1px 0 rgba(27,42,74,0.06);
    backdrop-filter: blur(28px) saturate(132%);
    -webkit-backdrop-filter: blur(28px) saturate(132%);
}

.auth-card::before {
    inset: 10px;
    border-radius: 19px;
    border: 1px solid rgba(255,255,255,0.32);
}

.auth-card::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 14% 86%, rgba(200,49,43,0.10), transparent 31%),
        linear-gradient(115deg, rgba(255,255,255,0.28) 0%, transparent 24%, transparent 72%, rgba(255,255,255,0.10) 100%);
}

.auth-system-name,
.auth-system-rule,
.auth-card h2,
.auth-subtitulo,
.auth-divider,
.auth-card form,
.auth-card .alert {
    position: relative;
    z-index: 2;
}

.auth-system-name {
    color: #152744;
    font-size: 18px;
    letter-spacing: -0.012em;
}

.auth-system-rule {
    width: 44px;
    height: 3px;
    margin: 10px auto 20px;
    background: linear-gradient(90deg, var(--red-dark), var(--red-light));
    box-shadow: 0 4px 12px rgba(200,49,43,0.20);
}

.auth-card h2 {
    margin-top: 0;
    color: #0D1D37;
    font-size: 35px;
    line-height: 1.08;
    text-shadow: 0 1px 0 rgba(255,255,255,0.70);
}

.auth-subtitulo {
    margin-top: 7px;
    color: #596A84;
}

.auth-divider {
    width: 52px;
    height: 3px;
    margin: 16px auto 27px;
    opacity: 0.92;
}

.auth-card .form-group {
    margin-bottom: 21px;
}

.auth-card .form-group label {
    margin-bottom: 8px;
    color: #172A49;
    font-weight: 750;
}

.auth-card .form-control {
    min-height: 62px;
    border: 1px solid rgba(255,255,255,0.66);
    border-radius: 13px;
    background: rgba(250,252,255,0.70);
    color: #142642;
    box-shadow:
        0 8px 22px rgba(15,29,53,0.08),
        inset 0 1px 0 rgba(255,255,255,0.90);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.auth-card .form-control:hover {
    border-color: rgba(27,42,74,0.20);
    background: rgba(255,255,255,0.82);
}

.auth-card .form-control:focus {
    border-color: rgba(200,49,43,0.78);
    background: rgba(255,255,255,0.94);
    box-shadow:
        0 0 0 4px rgba(200,49,43,0.10),
        0 10px 26px rgba(15,29,53,0.10),
        inset 3px 0 0 rgba(200,49,43,0.84);
}

.input-icon-group .input-icon,
.input-icon-group .btn-eye {
    color: #334C75;
}

.auth-forgot {
    margin: -2px 0 25px;
}

.auth-forgot a {
    color: #B32621;
    text-shadow: 0 1px 0 rgba(255,255,255,0.58);
}

.auth-forgot a:hover {
    color: #8E1D19;
}

.auth-submit {
    position: relative;
    min-height: 62px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 13px;
    background: linear-gradient(105deg, #13284A 0%, #091C3A 54%, #142C51 100%);
    box-shadow:
        0 15px 32px rgba(5,18,42,0.32),
        inset 0 1px 0 rgba(255,255,255,0.12);
}

.auth-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -35%;
    width: 28%;
    height: 100%;
    transform: skewX(-22deg);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
    transition: left 0.55s ease;
}

.auth-submit:hover {
    transform: translateY(-2px);
    background: linear-gradient(105deg, #172F57 0%, #0B2144 56%, #17345D 100%);
    box-shadow:
        0 19px 38px rgba(5,18,42,0.38),
        0 0 0 1px rgba(200,49,43,0.12),
        inset 0 1px 0 rgba(255,255,255,0.14);
}

.auth-submit:hover::before {
    left: 112%;
}

.auth-submit svg {
    color: var(--red-light);
    transition: transform 0.25s ease;
}

.auth-submit:hover svg {
    transform: translateX(4px);
}

.auth-footer {
    padding: 0 24px 25px;
    color: rgba(255,255,255,0.72);
    text-shadow: 0 2px 12px rgba(0,0,0,0.45);
}

@media (max-width: 1180px) {
    .auth-stage {
        padding-inline: 34px;
        grid-template-columns: minmax(260px, 0.66fr) minmax(460px, 0.94fr);
        gap: 34px;
    }

    .auth-card {
        padding-inline: 38px;
    }
}

@media (max-width: 900px) {
    .auth-backdrop {
        background-position: 43% center;
    }

    .auth-shade {
        background: linear-gradient(180deg, rgba(5,15,32,0.42), rgba(5,15,32,0.56));
    }

    .auth-stage {
        min-height: calc(100vh - 46px);
        padding: 30px 20px 24px;
    }

    .auth-card {
        max-width: 570px;
        background: linear-gradient(145deg, rgba(248,250,254,0.92), rgba(225,232,244,0.86));
    }
}

@media (max-width: 640px) {
    .auth-card {
        padding: 31px 22px 28px;
        border-radius: 22px;
    }

    .auth-card h2 {
        font-size: 31px;
    }

    .auth-card .form-control,
    .auth-submit {
        min-height: 57px;
    }

    .auth-system-name {
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-submit::before {
        display: none;
    }
}