/* PORTAL ADMINISTRADOR */


:root {
    --letras: #132635;
    --letras-2: #4B6274;
    --papel: #F5F8F7;
    --carta: #FFFFFF;
    --linea: #E1E9E7;
    --deep: #0f5c2d;
    --deep-2: #164C71;
    --verde: #86C11E;
    --verde-2: #DFEFC5;
    --amarillo-p: #F8C301;
    --amarillo-2: #FCF0DC;
    --rojo: #C4534A;
    --rojo-2: #FBEAE8;
    --radius: 10px;
    --shadow: 0 4px 14px rgba(19, 38, 53, 0.06);
    --green: #86C11E;
    --green-dark: #0f5c2d;
    --border-light: #E1E9E7;
    --yellow-light: #FCF0DC;
    --red-light: #FBEAE8;
    --green-light:#DFEFC5;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}
body {
    margin: 0;
    min-height: 100vh;
    background: #ffffff;
    color: var(--letras);
    font-family: 'Inter', sans-serif;
}
.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 20px;
}
.navbar { 
    min-height: 64px;
    width: 100vw;
    margin-top: -20px;
    margin-left: calc((100% - 100vw) / 2);
    margin-bottom: 20px;
    background: var(--amarillo-2);
    border: none;
    border-bottom: 3px solid var(--amarillo-p);
    border-radius: 0;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 26px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.nav-brand { 
    color: var(--letras);
    font-family: "Sora", sans-serif;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}
.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}
.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 13px;
    color: var(--letras-2);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}
.nav-link:hover {
    color: var(--deep);
    background: #DFEFC5;
}
.nav-link.active {
    color: var(--deep);
    background: #DFEFC5;;
}
/*.nav-user {*/
/*    gap: 12px;*/
/*    color: var(--letras-2);*/
/*    font-size: 12px;*/
    
/*}*/
/*.nav-user strong {*/
/*    color: var(--letras);*/
/*    font-weight: 700;*/
/*}*/
.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--letras);
    white-space: nowrap;
}
/* Avatar */
.avatar {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--amarillo-p);
    color: var(--letras);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Sora", sans-serif;
    font-size: 13px;
    font-weight: 700;
}
.nav-user-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
}
.nav-user-name {
    color: var(--letras);
    font-size: 13px;
    font-weight: 600;
}
.nav-user-role {
    margin-top: 2px;
    color: var(--letras-2);
    font-size: 11.5px;
    font-weight: 400;
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 11px;
    background: var(--verde);
    color: var(--papel);
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}
.btn-logout:hover {
    background: var(--deep);
}
/*  MÉTRICAS  */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}
.stat-card {
    position: relative;
    min-height: 92px;
    background: var(--papel);
    border: 1px solid var(--verde);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 14px 15px;
    overflow: hidden;
    text-decoration: none;
}
a.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
/* Resaltado de la tarjeta seleccionada */
a.stat-card.active {
    border: 2px solid #4f46e5;
    background-color: #f4f3ff;
}
.stat-label {
    margin-bottom: 6px;
    color: var(--letras-2);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    line-height: 1.3;
}
.stat-number {
    color: var(--letras);
    font-family: 'Sora', sans-serif;
    font-size: 23px;
    font-weight: 500;
    line-height: 1.15;
}
.card {
    background: var(--papel);
    border: 1px solid var(--verde);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin: 0 0 20px;
}
.card h2 { 
    margin: 0 0 22px; 
    padding: 18px 20px 15px; 
    color: var(--deep); 
    font-family: "Sora", sans-serif; 
    font-size: 18px; 
    font-weight: 700; 
    border-bottom: 1px solid var(--linea); 
}
.card form {
    padding: 0 20px 20px;
}
.alert {
    padding: 12px 14px;
    margin-bottom: 20px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid transparent;
}
.alert.success {
    background: var(--green-light);
    color: var(--deep);
    border-color: #d8ebbb;
}
.alert.error {
    background: var(--rojo-2); 
    color: var(--rojo);
    border-color: #f2cccc;
}
.form-group { 
    display: flex; 
    flex-direction: column; 
    margin-bottom: 16px; 
}
.form-group label { 
    margin-bottom: 6px; 
    color: var(--letras); 
    font-size: 11px; 
    font-weight: 700; 
}
.form-group input, 
.form-group select { 
    width: 100%; 
    min-height: 40px; 
    padding: 9px 12px; 
    background: #fff; 
    color: var(--letras); 
    border: 1px solid var(--linea); 
    border-radius: 6px; 
    outline: none; 
    font-family: "Inter", sans-serif; 
    font-size: 13px; 
    transition: 
        border-color 0.2s ease, 
        box-shadow 0.2s ease, 
        background-color 0.2s ease; 
}
.form-group input:hover,
.form-group select:hover {
    border-color: #c8d7cf;
}
.form-group input:focus,
.form-group select:focus {
    border-color: var(--verde);
    box-shadow:
        0 0 0 3px rgba(134, 193, 30, 0.14);
}
button[type="submit"] {
    min-height: 40px;
    padding: 0 16px;
    background: var(--verde);
    color: #fff;
    border: 1px solid transparent;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: .15s ease;
}
button[type="submit"]:hover {
    background: var(--deep);
}
button[type="submit"]:active {
    transform: translateY(1px);
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
    border: none;
    border-radius: 0;
    overflow: visible;
}
thead th {
    padding: 14px 15px;
    background: #f8f9f6;
    border-bottom: 1px solid #dedede;
    color: #777;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: .05em;
}
tbody td {
    padding: 13px 15px;
    color: var(--letras);
    font-size: 12px;
    border-bottom: 1px solid #eeeeee;
}
tbody tr {
    background: #fff;
}
tbody tr:hover {
    background: #fcfdf9;
}
tbody tr:last-child td {
    border-bottom: none;
}
tbody tr {
    background: #ffffff;
    transition: background-color 0.15s ease;
}
tbody tr:hover {
    background: #f8faf9;
}
tbody td:first-child {
    color: var(--letras-2);
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
}
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.badge-admin {
    background: var(--verde-2);
    color: var(--deep);
}
.badge:not(.badge-admin) {
    background: var(--linea);
    color: var(--letras-2);
}
.btn-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 11px;
    background: var(--green-light);
    color: var(--deep);
    border: 1px solid transparent;
    border-radius: 8px;
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}
.btn-edit:hover {
    background: var(--verde);
    color: #ffffff;
}
/*  PAGINACIÓN*/
.paginacion {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 20px 20px 22px;
    border-top: 1px solid var(--linea);
    background: var(--papel);
}
.paginacion-link {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--linea);
    border-radius: 7px;
    background: #ffffff;
    color: var(--letras-2);
    text-decoration: none;
    font-family: "Inter", sans-serif;
    font-size: 11px;
    font-weight: 600;
    transition:
    background-color .2s ease,
    color .2s ease,
    border-color .2s ease;
}
.paginacion-link:hover {
    background: var(--verde-2);
    border-color: var(--verde);
    color: var(--deep);
}
.paginacion-link.active {
    background: var(--verde);
    border-color: var(--verde);
    color: #ffffff;
    font-weight: 700;
}
.paginacion-link.disabled {
    pointer-events: none;
    opacity: .4;
    background: #f5f6f5;
    color: var(--letras-2);
}

/* **********RESPOSNIVE********** */

@media (max-width: 900px) {
    .navbar {
        flex-wrap: wrap;
    }
    .nav-links {
        order: 3;
        flex-basis: 100%;
    }
    .nav-user {
        margin-left: auto;
    }
    .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    body {
        padding: 16px;
    }
    .navbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
        padding: 14px;
        margin-top: -16px;
    }
    .nav-brand {
        width: 100%;
    }
    .nav-links {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .nav-link {
        width: 100%;
    }
    .nav-user {
        width: 100%;
        justify-content: space-between;
        padding-top: 12px;
        border-top: 1px solid var(--linea);
    }
    .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .card {
        padding: 18px;
    }
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    thead,
    tbody {
        width: max-content;
        min-width: 100%;
    }
    button[type="submit"] {
        width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
     .navbar {
        margin-top: -10px;
    }
    .nav-user {
        align-items: flex-start;
        flex-direction: column;
    }
    .btn-logout {
        width: 100%;
    }
    .card {
        padding: 15px;
    }
    .stat-card {
        padding: 18px;
    }
}