/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ================= DISEÑO DEL LOGIN ================= */
.login-body {
    background-color: #f4f6f9;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-container {
    background: #ffffff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h2 {
    color: #1a365d; /* Azul corporativo oscuro */
    font-size: 24px;
}

.login-header p {
    color: #718096;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #4a5568;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 15px;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background-color: #2b6cb0;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-primary:hover {
    background-color: #1a365d;
}

.error-text {
    color: #e53e3e;
    font-size: 13px;
    margin-top: 10px;
    text-align: center;
}

/* ================= DISEÑO DEL DASHBOARD ================= */
.dashboard-body {
    display: flex;
    height: 100vh;
    background-color: #f4f6f9;
}

.sidebar {
    width: 250px;
    background-color: #1a365d;
    color: white;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #2b6cb0;
}

.user-role {
    font-size: 12px;
    color: #a0aec0;
}

.sidebar-nav {
    flex-grow: 1;
    padding: 20px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-title {
    padding: 10px 20px;
    font-size: 11px;
    text-transform: uppercase;
    color: #a0aec0;
    font-weight: bold;
    letter-spacing: 1px;
}

.sidebar-nav a {
    display: block;
    padding: 12px 20px;
    color: #e2e8f0;
    text-decoration: none;
    transition: background 0.2s;
}

.sidebar-nav a:hover {
    background-color: #2b6cb0;
    border-left: 4px solid #63b3ed;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #2b6cb0;
}

.btn-logout {
    width: 100%;
    padding: 8px;
    background: transparent;
    color: #fc8181;
    border: 1px solid #fc8181;
    border-radius: 4px;
    cursor: pointer;
}

.btn-logout:hover {
    background: #fc8181;
    color: #1a365d;
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.content-area {
    padding: 30px;
    overflow-y: auto;
}

.welcome-card {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* =========================================
   ESTILOS PARA FORMULARIOS INTERNOS
   ========================================= */
.form-container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

.form-container h3 {
    color: #1a365d;
    margin-bottom: 5px;
}

.form-container p {
    color: #718096;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-container select,
.form-container textarea,
.form-container input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e0;
    border-radius: 5px;
    font-family: inherit;
    margin-top: 5px;
}

.form-container textarea {
    resize: vertical;
}

/* =========================================
   ESTILOS PARA TABLA DINÁMICA DE REQUERIMIENTOS
   ========================================= */
.table-responsive {
    overflow-x: auto;
    margin-top: 20px;
    border: 1px solid #cbd5e0;
    border-radius: 5px;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
}

.items-table th, .items-table td {
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    padding: 8px;
    text-align: left;
}

.items-table th {
    background-color: #f7fafc;
    font-size: 0.85rem;
    color: #4a5568;
    text-transform: uppercase;
}

.items-table input, .items-table select {
    width: 100%;
    border: 1px solid transparent; /* Invisible hasta que haces clic */
    background: transparent;
    padding: 6px;
    font-size: 0.9rem;
}

.items-table input:focus, .items-table select:focus {
    border-bottom: 2px solid #2b6cb0;
    outline: none;
}

.btn-add-item {
    background-color: #edf2f7;
    color: #2b6cb0;
    border: 1px dashed #2b6cb0;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    font-weight: bold;
    width: 100%;
    transition: 0.3s;
}

.btn-add-item:hover {
    background-color: #e2e8f0;
}

.btn-remove-item {
    background-color: #fc8181;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.btn-remove-item:hover {
    background-color: #e53e3e;
}

/* =========================================
   VENTANA EMERGENTE PROFESIONAL (MODAL)
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Fondo oscuro semitransparente */
    backdrop-filter: blur(3px); /* Efecto moderno de desenfoque */
    display: none; /* Oculto por defecto */
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-box {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-align: center;
    max-width: 600px;
    width: 90%;
    animation: modalFadeIn 0.3s ease-out; /* Animación de entrada */
    position: relative	
}

@keyframes modalFadeIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-icon {
    font-size: 50px;
    margin-bottom: 10px;
}

.modal-title {
    color: #1a365d;
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.modal-text {
    color: #4a5568;
    margin-bottom: 25px;
    line-height: 1.5;
}

.btn-modal {
    background-color: #2b6cb0;
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
    width: 100%;
    font-weight: bold;
}

.btn-modal:hover {
    background-color: #1a365d;
}

/* =========================================
   ESTILOS PARA ETIQUETAS DE ESTADO (BADGES)
   ========================================= */
.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    display: inline-block;
    text-align: center;
}

.badge-pendiente {
    background-color: #fefcbf;
    color: #b7791f;
    border: 1px solid #f6e05e;
}

.badge-aprobado {
    background-color: #c6f6d5;
    color: #22543d;
    border: 1px solid #68d391;
}

.badge-rechazado {
    background-color: #fed7d7;
    color: #822727;
    border: 1px solid #fc8181;
}

/* =========================================
   BOTÓN DE ACCIÓN PARA TABLAS
   ========================================= */
.btn-accion {
    background-color: #edf2f7;
    color: #2b6cb0;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    transition: 0.3s;
}

.btn-accion:hover {
    background-color: #e2e8f0;
    color: #1a365d;
}

/* =========================================
   BOTONES DE VISACIÓN (APROBAR / RECHAZAR)
   ========================================= */
.btn-aprobar {
    background-color: #48bb78;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    transition: 0.3s;
    margin-right: 5px;
}

.btn-aprobar:hover {
    background-color: #2f855a;
}

.btn-rechazar {
    background-color: #f56565;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    transition: 0.3s;
}

.btn-rechazar:hover {
    background-color: #c53030;
}

/* =========================================
   BOTÓN CANCELAR PARA MODALES
   ========================================= */
.btn-cancelar {
    background-color: #e2e8f0;
    color: #4a5568;
    border: none;
    padding: 10px 30px;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
    font-weight: bold;
}

.btn-cancelar:hover {
    background-color: #cbd5e0;
}

/* =========================================
   BOTÓN DE COMPRAS (LOGÍSTICA)
   ========================================= */
.btn-comprar {
    background-color: #dd6b20;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    transition: 0.3s;
}

.btn-comprar:hover {
    background-color: #c05621;
}

/* =========================================
   ESTILOS PARA ATENCIÓN PARCIAL
   ========================================= */
.badge-parcial {
    background-color: #ebf8ff;
    color: #2b6cb0;
    border: 1px solid #90cdf4;
}

.input-parcial {
    width: 60px;
    padding: 5px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
    color: #2b6cb0;
}

.input-parcial:focus {
    border-color: #dd6b20;
    outline: none;
}

/* =========================================
   ESTILOS PARA DESPACHO Y GUÍAS
   ========================================= */
.btn-despacho {
    background-color: #319795;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

.btn-despacho:hover {
    background-color: #285e61;
}

.despacho-header {
    background-color: #ebf8ff;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #90cdf4;
    margin-bottom: 15px;
}

/* =========================================
   BOTÓN "X" PARA CERRAR MODALES
   ========================================= */
.close-modal-x {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.8rem;
    color: #a0aec0;
    cursor: pointer;
    transition: color 0.2s ease-in-out;
    line-height: 1;
    font-weight: bold;
}

.close-modal-x:hover {
    color: #4a5568;
}

/* =========================================
   ESTILO PARA FILTRO DE ALMACÉN
   ========================================= */
.badge-almacen {
    background-color: #faf5ff;
    color: #553c9a;
    border: 1px solid #d6bcfa;
}

/* =========================================
   ESTILOS PARA EXPORTACIÓN A PDF / IMPRESIÓN
   ========================================= */
.btn-imprimir {
    background-color: #4a5568;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 15px;
    transition: 0.3s;
}

.btn-imprimir:hover {
    background-color: #2d3748;
}

/* Encabezado formal de CRAVES (Oculto en pantalla, visible en PDF) */
.header-documento {
    display: none;
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #2b6cb0;
    padding-bottom: 10px;
}

@media print {
    /* Ocultar elementos innecesarios */
    .sidebar, .topbar, .btn-imprimir, .close-modal-x, .btn-modal, .btn-cancelar, .btn-comprar, .btn-despacho {
        display: none !important;
    }
    
    /* Expandir el contenido para la hoja A4 */
    body, .dashboard-body {
        background-color: white;
        margin: 0;
        padding: 0;
    }
    
    .modal-overlay {
        position: absolute;
        background: none;
        align-items: flex-start;
        padding: 0;
    }
    
    .modal-box {
        box-shadow: none;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 20px;
    }

    /* Mostrar el encabezado formal */
    .header-documento {
        display: block;
    }

    /* Ajustar colores para que salgan bien en el papel */
    .badge {
        border: 1px solid #000;
        color: #000 !important;
        background: transparent !important;
    }
    
    table th {
        background-color: #edf2f7 !important;
        color: black;
        border: 1px solid #cbd5e0;
    }
    
    table td {
        border: 1px solid #cbd5e0;
    }
    
    /* =======================================================
   ESTILOS PARA REPORTES OPERATIVOS (ESTILO EXCEL)
   ======================================================= */
.reporte-excel-container {
    max-width: 100%;
    overflow-x: auto;
    background: #fff;
    border: 1px solid #cbd5e0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.table-excel {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Arial', sans-serif;
    font-size: 0.75rem;
    white-space: nowrap;
}

.table-excel th, .table-excel td {
    border: 1px solid #a0aec0;
    padding: 4px 6px;
    text-align: center;
}

/* Encabezados oscuros principales */
.table-excel .header-dark {
    background-color: #4a5568;
    color: white;
    font-weight: bold;
}

/* Columna congelada (Apellidos y Nombres) */
.table-excel th.col-sticky, 
.table-excel td.col-sticky {
    position: sticky;
    left: 0;
    background-color: #f7fafc;
    z-index: 2;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    text-align: left;
    min-width: 250px;
}

.table-excel th.col-sticky {
    background-color: #4a5568;
    color: white;
}

/* Estilos de letras del Tareo */
.text-asistencia { color: #3182ce; font-weight: bold; } /* X azul */
.text-descanso { color: #e53e3e; font-weight: bold; } /* DL rojo */
.text-guardia { background-color: #2d3748; color: white; font-weight: bold; text-align: center; letter-spacing: 2px;
}
}