/* -------------------------------------------------------------------------- */
/* Variables                                                                  */
/* -------------------------------------------------------------------------- */
:root {
    --color-primary-dark: #0A1D37; /* Azul Marino Oscuro */
    --color-accent-start: #C4006B; /* Fucsia Intenso */
    --color-accent-end: #FF3888;   /* Rosa Eléctrico */
    --color-text-light: #FFFFFF;
    --color-keypad-bg: #1E293B;  /* Azul oscuro para botones del teclado */
    --color-sidebar-bg: #111827;  /* Gris oscuro para el menú */
    --color-sens-tag: #3B82F6; /* Azul para SENS */
    --color-academia-tag: #8B5CF6; /* Morado para Academia */
}

/* -------------------------------------------------------------------------- */
/* Estilos Base                                                               */
/* -------------------------------------------------------------------------- */
.dashboard-body {
    font-family: 'Poppins', sans-serif;
    color: var(--color-text-light);
    background-color: var(--color-primary-dark);
    padding-top: 60px; 
    padding-bottom: 60px;
}

.auth-body {
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    background-color: var(--color-primary-dark);
    background-image: radial-gradient(circle at 50% 15%, 
        rgba(255, 51, 136, 0.5) 0%,
        rgba(196, 0, 107, 0.2) 40%, 
        var(--color-primary-dark) 80%
    );
    background-repeat: no-repeat;
}

button {
    cursor: pointer;
    background: none;
    border: none;
    color: inherit;
    padding: 0;
    font: inherit;
}

/* -------------------------------------------------------------------------- */
/* Sistema de Menús y Navegación                                              */
/* -------------------------------------------------------------------------- */
.sidebar-menu {
    background-color: var(--color-sidebar-bg);
    color: white;
    width: 16rem;
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
}
.sidebar-menu.open { 
    transform: translateX(0); 
}
.sidebar-link { 
    display: flex; 
    align-items: center; 
    padding: 0.75rem 1rem; 
    color: #D1D5DB; 
    border-radius: 0.375rem; 
    transition: background-color 0.2s, color 0.2s; 
    text-decoration: none; 
}
.sidebar-link:hover { 
    background-color: #374151; 
    color: white; 
}
.sidebar-link.active { 
    background-image: linear-gradient(to right, var(--color-accent-start), var(--color-accent-end)); 
    color: white; 
    font-weight: 600; 
}
.sidebar-link i { 
    width: 20px; 
    margin-right: 0.75rem; 
    text-align: center; 
}

.debt-total-badge {
    background-color: #F97316;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 9999px;
    margin-left: 8px;
    vertical-align: middle;
}

/* --- Navbars --- */
.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background-image: linear-gradient(90deg, var(--color-accent-start) 0%, var(--color-primary-dark) 100%);
}

.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    justify-items: center;
    align-items: center;
    padding: 0.5rem 0;
    background-image: linear-gradient(-90deg, var(--color-accent-start) 0%, var(--color-primary-dark) 100%);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
}
.mobile-bottom-nav.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}
.mobile-bottom-nav.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.bottom-nav-link { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    color: rgba(255, 255, 255, 0.6); 
    transition: color 0.2s; 
    text-decoration: none; 
    border: none; 
    background: none; 
    cursor: pointer; 
    width: 100%;
    padding: 0.25rem 0;
}
.bottom-nav-link:hover { 
    color: rgba(255, 255, 255, 0.8); 
}
.bottom-nav-link.active { 
    color: var(--color-text-light); 
    font-weight: 600; 
}

/* -------------------------------------------------------------------------- */
/* Componentes                                                                */
/* -------------------------------------------------------------------------- */
.floating-action-button { 
    position: fixed; 
    bottom: 5.5rem; 
    right: 1.5rem; 
    width: 3.5rem; 
    height: 3.5rem; 
    border-radius: 50%; 
    background-image: linear-gradient(to right, var(--color-accent-start), var(--color-accent-end)); 
    color: white; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 1.5rem; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.3); 
    z-index: 30; 
    transition: transform 0.2s; 
}
.floating-action-button:hover { 
    transform: scale(1.05); 
}
.floating-action-button > i {
    pointer-events: none;
}

.card-actions {
    display: flex;
    background-color: rgba(0,0,0,0.2);
}
.action-btn {
    flex: 1;
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    transition: background-color 0.2s, color 0.2s;
    color: #D1D5DB;
}
.action-btn:first-child {
    border-right: 1px solid rgba(255,255,255,0.1);
}
.btn-edit:hover {
    background-color: var(--color-sens-tag); /* Azul */
    color: white;
}
.btn-delete:hover {
    background-color: #EF4444; /* Rojo */
    color: white;
}

/* -------------------------------------------------------------------------- */
/* Componentes de Filtro (CORREGIDO)                                          */
/* -------------------------------------------------------------------------- */
.filter-btn {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-weight: 600;
    color: var(--color-text-light);
    background-color: var(--color-keypad-bg);
    transition: all 0.2s;
    border: 1px solid transparent;
}
.filter-btn:hover {
    background-color: #334155;
}
.filter-btn.active {
    background-image: linear-gradient(to right, var(--color-accent-start), var(--color-accent-end));
    color: white;
    border-color: transparent;
}
/* CORRECCIÓN: Anula el degradado para los filtros de nivel con colores específicos */
.filter-btn.active.level-principiante,
.filter-btn.active.level-intermedio,
.filter-btn.active.level-avanzado {
    background-image: none;
}


/* -------------------------------------------------------------------------- */
/* Sistema de Modales                                                         */
/* -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--color-sidebar-bg);
    border-radius: 0.75rem;
    width: 100%;
    max-width: 28rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.visible .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.modal-body {
    overflow-y: auto;
    padding: 1.5rem;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.modal-body::-webkit-scrollbar {
    display: none;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

/* --- Popover Menu (Lista de Usuarios) --- */
.popover-menu {
    position: absolute;
    z-index: 40;
    background-color: var(--color-sidebar-bg);
    border-radius: 0.5rem;
    border: 1px solid #374151;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    width: 180px;
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95) translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.popover-menu.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}
.popover-menu .action-button {
    width: 100%;
    padding: 0.75rem;
    text-align: left;
}


/* -------------------------------------------------------------------------- */
/* Formularios                                                                */
/* -------------------------------------------------------------------------- */
.modal-label, .form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #9CA3AF;
}

.modal-input, .form-input {
    width: 100%;
    background-color: var(--color-keypad-bg);
    border: 1px solid #374151;
    border-radius: 0.375rem;
    padding: 0.75rem;
    color: white;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-input:focus, .form-input:focus {
    border-color: var(--color-accent-end);
    box-shadow: 0 0 0 2px rgba(255, 56, 136, 0.5);
}

.keypad-ok {
    background-image: linear-gradient(to right, var(--color-accent-start), var(--color-accent-end));
    color: var(--color-text-light);
    transition: opacity 0.2s;
    height: 100%;
    border-radius: 9999px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}
.keypad-ok:hover {
    opacity: 0.9;
}

/* -------------------------------------------------------------------------- */
/* Alertas                                                                    */
/* -------------------------------------------------------------------------- */
#custom-alert-container { 
    position: fixed; 
    bottom: 80px; 
    left: 50%; 
    transform: translateX(-50%); 
    z-index: 100; 
}
.custom-alert { 
    background-color: #111827; 
    color: white; 
    padding: 1rem 1.5rem; 
    border-radius: 0.5rem; 
    border: 1px solid var(--color-accent-end); 
    box-shadow: 0 4px 15px rgba(0,0,0,0.5); 
    animation: fadeInOut 3s ease-in-out forwards; 
}
@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(20px); }
    15% { opacity: 1; transform: translateY(0); }
    85% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(20px); }
}

