/* ===========================
   ESTILOS GENERALES
   =========================== */

body {
    font-family: 'Inter', sans-serif;
    background: #f5f7fa;
    margin: 0;
}


/* ===========================
   HEADER
   =========================== */

.main-header {
    background: #1a73e8;
    color: #fff;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo {
    height: 40px;
}

.search-box {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 8px;
}

.search-box input {
    background: none;
    border: none;
    color: #fff;
    outline: none;
}

.user-box {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.user-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.user-name {
    font-weight: 600;
}


/* ===========================
   SIDEBAR
   =========================== */

.sidebar {
    background: #fff;
    padding: 20px;
}

.compose {
    width: 100%;
    background: #1a73e8;
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
}

.menu {
    margin-top: 20px;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 10px;
}

.menu-link {
    display: block;
    padding: 10px;
    text-decoration: none;
    color: #333;
    border-radius: 6px;
}

.menu-link.active,
.menu-link:hover {
    background: rgba(26, 115, 232, 0.15);
}


/* ===========================
   MAIN
   =========================== */

.main {
    padding: 20px;
}


/* ===========================
   ICONOS / CARPETAS
   =========================== */

.icono-carpeta {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background-color: #f1f1f1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 22px;
    color: #555;
}

.icono-carpeta:hover {
    background-color: #e2e6ea;
    transform: scale(1.05);
}

.icono-carpeta.activo {
    background-color: #0d6efd;
    color: #fff;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.3);
}


/* ===========================
   NOTIFICACIONES
   =========================== */

#notifBtn:hover i {
    opacity: 0.85;
}

.notif-item {
    font-size: 14px;
    padding: 10px;
}

.notif-item small {
    color: #6b7280;
}


/* ===========================
   MODALES (BASE ÚNICA)
   =========================== */

.modal {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.55);
}


/* Modal visible */

.modal.show {
    display: flex;
}


/* ===========================
   Z-INDEX CORRECTO
   =========================== */

#modalExpediente {
    z-index: 1000;
}

#modalActuaciones {
    z-index: 1100;
}

#modalDetalles {
    z-index: 1200;
}

#modalPerfil {
    z-index: 1300;
}

#modalNotificaciones {
    z-index: 1400;
}


/* ===========================
   CONTENIDO DEL MODAL
   =========================== */

.modal-panel {
    position: relative;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}


/* Modal específico de actuaciones */

#modalActuaciones .modal-panel {
    max-width: 500px;
}

.icono-carpeta {
    font-size: 1.6rem;
    cursor: pointer;
    opacity: 0.4;
    transition: 0.2s;
}

.icono-carpeta.activo {
    opacity: 1;
    color: #0d6efd;
}

.icono-carpeta:hover {
    opacity: 0.8;
}

.icono-carpeta.disabled {
    pointer-events: none;
    opacity: 0.3;
}

#modalDetalles {
    z-index: 1000;
}

#modalActuaciones {
    z-index: 1100;
}

.sidebar-clock {
    margin-top: auto;
    padding: 15px;
    font-size: 14px;
    text-align: center;
    color: #555;
    border-top: 1px solid #e0e0e0;
}

.clock-date {
    font-weight: 600;
}

.clock-time {
    font-size: 18px;
    margin-top: 4px;
}


/* ===========================
   NOTIFICACIONES - COLORES
   =========================== */

.notif-item {
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
}

.notif-item.leida {
    opacity: 0.6;
}

.notif-roja {
    border-left: 5px solid #dc3545;
}

.notif-amarilla {
    border-left: 5px solid #ffc107;
}

.notif-verde {
    border-left: 5px solid #28a745;
}


/* ======================================
   NOTIFICACIÓN DE CUMPLEAÑOS
====================================== */

.alert-cumpleanios {
    background: linear-gradient(135deg, #7b2cbf, #3a86ff);
    color: #ffffff;
    border: none;
    border-left: 6px solid #ffd60a;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
    transition: .25s ease;
}

.alert-cumpleanios:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .20);
}

.alert-cumpleanios .fw-bold {
    color: #ffffff;
    font-size: 16px;
    margin-bottom: 4px;
}

.alert-cumpleanios small {
    color: rgba(255, 255, 255, .85)!important;
}

.alert-cumpleanios .form-check-input {
    border: 2px solid #ffffff;
}

.alert-cumpleanios .form-check-input:checked {
    background-color: #ffd60a;
    border-color: #ffd60a;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

.notif-pulse {
    animation: pulse 0.4s ease;
}

.notif-item.leida {
    opacity: 0.6;
}

.tachada {
    text-decoration: line-through;
    opacity: 0.6;
}

.resaltado-expediente {
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    display: inline-block;
}

.btn-link {
    display: block;
    margin-bottom: 10px;
}

.input-password-container {
    position: relative;
    display: flex;
    align-items: center;
}

.input-password-container input {
    width: 100%;
    padding-right: 40px;
}

.toggle-password {
    position: absolute;
    right: 10px;
    cursor: pointer;
    color: #888;
}

.toggle-password:hover {
    color: #000;
}


/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 992px) {
    /* HEADER */
    .main-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .user-box {
        width: 100%;
        justify-content: space-between;
    }
    /* SIDEBAR */
    .sidebar {
        padding: 10px;
    }
    /* MAIN */
    .main {
        padding: 10px;
    }
    /* TABLAS */
    .table {
        font-size: 14px;
    }
    /* MODALES */
    .modal-panel {
        width: 95%;
        max-width: 95%;
        padding: 15px;
    }
    /* BOTONES */
    .modal-actions {
        flex-direction: column;
    }
    .modal-actions button {
        width: 100%;
    }
    /* INPUTS */
    input,
    select,
    textarea {
        font-size: 16px;
    }
}


/* ===========================
   MÓVIL PEQUEÑO
   =========================== */

@media (max-width: 576px) {
    .header-logo {
        height: 30px;
    }
    .user-name {
        font-size: 14px;
    }
    .system-title {
        font-size: 14px;
    }
    .compose {
        font-size: 14px;
        padding: 8px;
    }
    .menu-link {
        font-size: 14px;
        padding: 8px;
    }
    .modal-panel {
        border-radius: 8px;
        padding: 12px;
    }
    .clock-time {
        font-size: 16px;
    }
}


/* ===========================
   FORZAR SIDEBAR ARRIBA EN MOVIL
   =========================== */

@media (max-width: 992px) {
    .sidebar {
        order: -1;
    }
}

.table-responsive {
    overflow-x: auto;
}


/* ===========================
   FIX LAYOUT MOVIL COMPLETO
   =========================== */

@media (max-width: 992px) {
    .app .row {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        order: -1;
    }
    .main {
        width: 100%;
    }
}


/* ===========================
   COMPACTAR SIDEBAR EN MOVIL
   =========================== */

@media (max-width: 992px) {
    .sidebar {
        padding: 10px;
    }
    .menu {
        display: flex;
        overflow-x: auto;
        gap: 8px;
        margin-top: 10px;
    }
    .menu-link {
        white-space: nowrap;
        background: #f1f3f5;
        padding: 6px 10px;
        border-radius: 20px;
        font-size: 13px;
    }
    .section-title {
        margin-bottom: 5px;
    }
    .sidebar-clock {
        display: none;
    }
}


/* ==========================================
   SWEETALERT ENCIMA DE TODOS LOS MODALES
========================================== */

.swal2-container {
    z-index: 999999 !important;
}

.swal2-popup {
    z-index: 1000000 !important;
}