* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    background-color: #26272b;
    color: #ffffff;
}

/* ==========================================
   ELEMENTOS REUTILIZABLES
   ========================================== */
.etiqueta {
    display: block;
    font-size: 11px;
    font-weight: bold;
    color: #aaaaaa;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.campo {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    background-color: #1a1b1e;
    border: 1px solid #3d4046;
    border-radius: 6px;
    color: #ffffff;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.campo::placeholder {
    color: #555861;
}

.campo:focus {
    border-color: #6a6e77;
}

/* ==========================================
   BOTÓN AZUL ÍNDIGO VIBRANTE (DISEÑO PREMIUM)
   ========================================== */
.boton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 22px;
    
    /* Gradiente Azul Neón / Índigo */
    background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    
    /* Bordes y bisel superior de luz */
    border: 1px solid #2563eb;
    border-top-color: #60a5fa;
    border-radius: 8px;
    
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.4px;
    cursor: pointer;
    text-decoration: none;
    outline: none;
    
    /* Sombra proyectada con halo ambiental azul */
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.boton:hover {
    background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
    border-color: #3b82f6;
    border-top-color: #93c5fd;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transform: translateY(-2px) scale(1.01);
    color: #ffffff;
}

.boton:active {
    background: linear-gradient(180deg, #1d4ed8 0%, #1e40af 100%);
    border-color: #1e40af;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4), inset 0 1px 2px rgba(0, 0, 0, 0.4);
    transform: translateY(1px) scale(0.99);
}

/* LOGO EN FONDO CLARO PARA DIBUJAR CONTRASTE */
.logo {
    background-color: rgba(240, 242, 245, 0.9);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo img {
    max-width: 100%;
    height: auto;
    max-height: 50px;
    object-fit: contain;
}

/* ==========================================
   PÁGINA DE LOGIN
   ========================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: radial-gradient(circle, #3d4046 0%, #212225 70%, #17181a 100%);
}

.caja {
    background-color: #313338;
    width: 100%;
    max-width: 380px;
    padding: 30px 25px;
    border-radius: 12px;
    border: 1px solid #3d4046;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
    text-align: center;
}

.subtitulo {
    font-size: 13px;
    color: #a0a5ad;
    margin-bottom: 22px;
}

.caja form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}

.caja .boton {
    width: 100%;
    margin-top: 8px;
    height: 42px;
}

/* ==========================================
   PÁGINA DE DASHBOARD (.desboar)
   ========================================== */
.desboar {
    display: flex;
    min-height: 100vh;
}

/* Overlay para cerrar sidebar en movil */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 999;
}

.sidebar-overlay.activo {
    display: block;
}

/* Sidebar lateral */
aside {
    width: 230px;
    background-color: #1a1b1e;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #33353a;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.aside-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.aside-header .logo {
    flex: 1;
    margin-bottom: 0;
}

.btn-cerrar-sidebar {
    display: none;
    background: none;
    border: none;
    color: #a0a5ad;
    font-size: 28px;
    cursor: pointer;
    padding-left: 10px;
    line-height: 1;
}

.btn-cerrar-sidebar:hover {
    color: #ffffff;
}

aside nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

aside nav a {
    display: block;
    padding: 11px 16px;
    color: #a0a5ad;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13.5px;
    font-weight: bold;
    transition: background-color 0.2s, color 0.2s;
}

aside nav a:hover, aside nav a.activo {
    background-color: #2d3036;
    color: #ffffff;
}

/* Submenús en aside */
.grupo-menu {
    user-select: none;
}

.grupo-menu summary {
    padding: 11px 16px;
    color: #a0a5ad;
    font-size: 13.5px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s, color 0.2s;
}

.grupo-menu summary::after {
    content: '›';
    font-size: 14px;
    transition: transform 0.2s ease;
}

.grupo-menu[open] summary::after {
    transform: rotate(90deg);
}

.grupo-menu summary:hover, 
.grupo-menu[open] summary {
    background-color: #2d3036;
    color: #ffffff;
}

.submenu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 12px;
    margin-top: 4px;
}

.submenu a {
    padding: 8px 12px !important;
    font-size: 12.5px !important;
    color: #8a8f99 !important;
    border-left: 2px solid #33353a;
    border-radius: 0 4px 4px 0 !important;
}

.submenu a:hover {
    color: #ffffff !important;
    border-left-color: #3b82f6;
    background-color: rgba(255, 255, 255, 0.03) !important;
}

/* Panel Principal */
main {
    flex: 1;
    padding: 25px;
    background-color: #26272b;
    min-width: 0;
}

.main-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 18px;
}

.main-header h1 {
    font-size: 22px;
    font-weight: bold;
}

/* Botón Hamburguesa Móvil */
.btn-toggle-sidebar {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 36px;
    height: 36px;
    padding: 6px;
    background-color: #1a1b1e;
    border: 1px solid #3d4046;
    border-radius: 6px;
    cursor: pointer;
}

.btn-toggle-sidebar span {
    width: 100%;
    height: 2px;
    background-color: #ffffff;
    border-radius: 2px;
}

/* ÁREA DE BOTONES SUPERIOR (Alineados a la derecha) */
.acciones-top {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* Área de Filtros */
.filtro {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 22px;
    display: flex;
    align-items: flex-end;
    gap: 15px;
    flex-wrap: wrap;
}

.filtro-campo {
    flex: 1;
    min-width: 160px;
}

.filtro .box-btn {
    flex: 0 0 auto;
}

/* Tarjetas */
.rejilla {
    display: flex;
    gap: 18px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.tarjeta {
    flex: 1;
    min-width: 200px;
    background-color: #313338;
    padding: 18px;
    border-radius: 8px;
    border: 1px solid #3a3d43;
}

.tarjeta p {
    font-size: 22px;
    font-weight: bold;
    margin-top: 6px;
    color: #ffffff;
}

/* Tabla con Scroll e Hiperfijación de Encabezado */
.contenedor-tabla {
    max-height: 420px;
    overflow-y: auto;
    overflow-x: auto;
    border-radius: 6px;
    border: 1px solid #a0a5ad;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.contenedor-tabla::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.contenedor-tabla::-webkit-scrollbar-track {
    background: #2b2d31;
}

.contenedor-tabla::-webkit-scrollbar-thumb {
    background: #525660;
    border-radius: 4px;
}

table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    background-color: #cdd1d8;
    color: #111111;
}

table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: #2b2d31;
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
    padding: 10px 12px;
    text-align: center;
    border-bottom: 2px solid #111111;
}

table td {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    border-right: 1px solid #b0b4be;
    border-bottom: 1px solid #b0b4be;
}

table td:last-child {
    border-right: none;
}

table tbody tr:nth-child(odd) {
    background-color: #d8dce3;
}

table tbody tr:nth-child(even) {
    background-color: #becfdb;
}

table tbody tr:hover {
    background-color: #a9bac7;
}

/* ==========================================
   MODAL
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 15px;
}

.modal-overlay.activo {
    opacity: 1;
    pointer-events: auto;
}

.modal-contenedor {
    background-color: #26272b;
    border: 1px solid #3d4046;
    border-radius: 10px;
    width: 100%;
    max-width: 650px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    transform: translateY(-20px);
    transition: transform 0.25s ease;
    overflow: hidden;
}

.modal-overlay.activo .modal-contenedor {
    transform: translateY(0);
}

.modal-header {
    padding: 16px 20px;
    background-color: #1a1b1e;
    border-bottom: 1px solid #33353a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 16px;
    font-weight: bold;
    color: #ffffff;
}

.modal-cerrar {
    background: none;
    border: none;
    color: #a0a5ad;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.modal-cerrar:hover {
    color: #ffffff;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 12px 20px;
    background-color: #1a1b1e;
    border-top: 1px solid #33353a;
    display: flex;
    justify-content: flex-end;
}

/* Select2 Custom Dark */
.select2-container--default .select2-selection--single {
    background-color: #1a1b1e !important;
    border: 1px solid #3d4046 !important;
    border-radius: 6px !important;
    height: 38px !important;
    display: flex !important;
    align-items: center !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #ffffff !important;
    font-size: 13px !important;
    padding-left: 12px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
}

.select2-dropdown {
    background-color: #1a1b1e !important;
    border: 1px solid #3d4046 !important;
    color: #ffffff !important;
}

.select2-search__field {
    background-color: #26272b !important;
    border: 1px solid #3d4046 !important;
    color: #ffffff !important;
}

.select2-results__option--highlighted[aria-selected] {
    background-color: #3d4046 !important;
    color: #ffffff !important;
}

/* ==========================================
   MEDIA QUERIES (ADAPTABILIDAD RESPONSIVE)
   ========================================== */

/* Tablets (pantallas de menos de 1024px) */
@media screen and (max-width: 1024px) {
    .rejilla {
        gap: 12px;
    }
    
    .tarjeta {
        min-width: 45%;
    }
    
    .filtro-campo {
        min-width: 45%;
    }
}

/* Dispositivos Móviles y Tablets Pequeñas (menos de 768px) */
@media screen and (max-width: 768px) {
    aside {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.5);
    }

    aside.abierto {
        transform: translateX(0);
    }

    .btn-cerrar-sidebar {
        display: block;
    }

    .btn-toggle-sidebar {
        display: flex;
    }

    main {
        padding: 16px;
    }

    .acciones-top {
        justify-content: stretch;
    }

    .acciones-top .boton {
        flex: 1 1 100%;
        width: 100%;
    }

    .filtro {
        padding: 14px;
        gap: 12px;
    }

    .filtro-campo {
        min-width: 100%;
    }

    .filtro .box-btn {
        width: 100%;
    }

    .filtro .box-btn .boton {
        width: 100%;
    }

    .tarjeta {
        min-width: 100%;
    }
}

/* Teléfonos muy pequeños (menos de 480px) */
@media screen and (max-width: 480px) {
    .main-header h1 {
        font-size: 18px;
    }

    .caja {
        padding: 22px 16px;
    }
}