/* Variables CSS - Colores Corporativos */
:root {
    --primary-blue: #0d47a1;
    --dark-blue: #01579b;
    --medium-blue: #0277bd;
    --light-blue: #0288d1;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --transition-speed: 0.3s;
    /* Paleta de colores basada en tu ejemplo */
    --bg-sidebar: #1a2a3a;      /* Azul marino profesional */
    --bg-submenu: #e9ecef;      /* Gris claro para el desplegable */
    --text-main: #ffffff;
    --text-submenu: #333333;    /* Texto oscuro para que resalte en el gris */
    --hover-submenu: #dee2e6;
    /* Colores modernos para el sidebar */
    --sidebar-bg: #1e293b;        /* Slate 800 - Más moderno que el negro */
    --sidebar-hover: #334155;     /* Slate 700 */
    --accent-color: #38bdf8;      /* Un azul cyan vibrante para resaltar */
    --text-muted: #94a3b8;
    --text-color: #e0e1dd;
}

/* Reset y Estilos Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* ========== PÁGINA DE LOGIN ========== */
.login-page {
    background: var(--primary-blue);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-box {
    background: white;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: var(--primary-blue);
    font-size: 28px;
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.login-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: var(--dark-blue);
}

/* Mensajes Flash */
.messages {
    margin-bottom: 20px;
}

.alert {
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ========== ESTRUCTURA PRINCIPAL ========== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ========== SIDEBAR ========== */
/* Sidebar Principal (Azul Marino Profesional) */
#sidebar,
.sidebar {
    min-width: 260px;
    max-width: 260px;
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--text-main);
    transition: all 0.3s;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 10px rgba(0,0,0,0.1);
}

#sidebar.active,
.sidebar.collapsed {
    margin-left: calc(-1 * var(--sidebar-width));
    width: var(--sidebar-width);
}

.sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
    padding: 0.75rem 1rem !important; /* Más a la izquierda para que entre en una línea */
    align-items: flex-start; /* Si el texto salta de línea, se alinea con el texto superior */
}

.sidebar-header .logo-wrapper {
    flex-shrink: 0;
    margin-right: 0.5rem;
}

.logo-icon {
    font-size: 1.5rem;
    color: var(--accent-color);
}

.brand-text {
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(45deg, #ffffff, #a5a5a5);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    min-width: 0; /* Permite que el texto pueda envolver en flex */
}

.sidebar-header h2,
.sidebar-header h3 {
    font-size: 20px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    margin: 0;
}

.sidebar.collapsed .sidebar-header h2,
.sidebar.collapsed .sidebar-header h3 {
    opacity: 0;
    width: 0;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 24px;
    height: 24px;
    padding: 0;
}

.sidebar-toggle span {
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: all 0.3s;
}

/* Navegación */
.sidebar-nav,
.sidebar .components {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar .components {
    padding: 10px 0;
}

.sidebar .list-unstyled {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Lista principal del sidebar: permite scroll para que el pie no se oculte */
.sidebar > .list-unstyled {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.sidebar .list-unstyled p {
    color: #fff;
    padding: 10px 20px;
}

.nav-item {
    margin-bottom: 0;
}

/* Encabezados de Menú (RRHH / Administración) */
#sidebar .nav-item > a,
.sidebar .nav-item > a,
.nav-item > a {
    color: var(--text-muted);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    border-radius: 8px;
    margin: 4px 12px;
    text-decoration: none;
    font-weight: 500;
}

.nav-item a:hover, .nav-item a.active {
    background-color: var(--sidebar-hover);
    color: #fff;
}

/* Estado Activo: La opción seleccionada */
.nav-item a.active, 
.nav-item a:active {
    background-color: rgba(255, 255, 255, 0.1) !important; /* Fondo ligeramente más claro */
    color: var(--accent-color) !important; /* Usamos el verde/celeste brillante */
    border-left: 4px solid var(--accent-color); /* Una línea vertical que resalta */
    font-weight: 600;
}

/* Para los sub-items seleccionados */
.collapse.list-unstyled li a.active {
    color: #fff !important;
    background-color: transparent !important;
    border-left: none; /* No saturar con líneas en el submenú */
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5); /* Brillo sutil en el texto */
}

.nav-item a i {
    width: 25px; /* Ancho fijo para iconos */
    font-size: 1.1rem;
    color: var(--accent-color); /* Los iconos le dan el color */
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.1em;
    transition: all 0.3s;
    white-space: nowrap;
    border-left: 4px solid transparent;
}

.sidebar .nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
    border-left: 4px solid var(--accent-color);
}

.sidebar .nav-link i {
    font-size: 18px;
    margin-right: 15px;
    min-width: 24px;
    text-align: center;
}

/* QUITAMOS LÍNEAS Y BORDES */
#sidebar ul li a, 
#sidebar ul.collapse li a,
.sidebar ul li a,
.sidebar ul.collapse li a {
    border: none !important;
    text-decoration: none !important;
}

/* Submenús - elementos anidados */
/* EL DESPLEGABLE (Gris claro como tu ejemplo) */
#sidebar .collapse,
.sidebar .collapse {
    background: var(--bg-submenu) !important;
}

.sidebar .collapse li {
    list-style: none;
}

/* Links dentro del gris (Texto oscuro y limpio) */
#sidebar .collapse li a,
.sidebar .collapse li a {
    color: var(--text-submenu) !important;
    padding: 10px 10px 10px 45px !important; /* Sangría a la derecha */
    font-weight: 500;
    display: block;
}

/* Efecto Hover en submenús */
#sidebar .collapse li a:hover,
.sidebar .collapse li a:hover {
    background: var(--hover-submenu) !important;
    color: var(--text-submenu) !important;
}

/* --- RESET DE ESTADOS --- */
/* Eliminamos el color azul/celeste y el fondo gris al hacer clic */
.nav-item a.dropdown-toggle, 
.nav-item a.dropdown-toggle:focus, 
.nav-item a.dropdown-toggle:active {
    color: var(--text-main) !important;
    background-color: transparent !important;
    text-decoration: none;
    box-shadow: none !important;
    outline: none !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* --- SUBMENÚ ELEGANTE --- */
/* En lugar de gris sólido (#e9ecef), usamos un tono más oscuro que el sidebar */
.collapse.list-unstyled {
    background-color: rgba(0, 0, 0, 0.2) !important; 
    transition: all 0.3s ease-in-out;
}

.collapse.list-unstyled li a {
    color: rgba(255, 255, 255, 0.7) !important; /* Blanco suavizado */
    font-size: 0.9rem;
    padding-left: 55px !important; /* Más indentación para jerarquía visual */
}

.collapse.list-unstyled li a:hover {
    color: var(--accent-color) !important; 
    background-color: rgba(255, 255, 255, 0.05) !important;
}

.sidebar .collapse .nav-link {
    padding-left: 45px !important;
    padding-right: 20px;
    font-size: 0.95rem;
    color: var(--text-submenu) !important;
}

.sidebar .collapse .nav-link i {
    font-size: 16px;
    margin-right: 12px;
    min-width: 18px;
    text-align: center;
}

/* Submenús */
.sidebar .dropdown-toggle {
    position: relative;
}

/* Iconos */
.fas {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Footer del Sidebar */
.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 10px;
    margin-top: auto; /* Empuja el footer al fondo si el sidebar es flex */
}

.nav-link-static {
    padding: 12px 20px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    opacity: 0.8;
}

.logout-link {
    color: #ff4d4d !important; /* Rojo suave para indicar salida */
    transition: all 0.3s ease;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    text-decoration: none;
    font-size: 0.9rem;
}

.logout-link:hover {
    background-color: rgba(255, 77, 77, 0.1) !important;
    color: #ff7676 !important;
}

/* Alineación de iconos del footer */
.sidebar-footer i {
    width: 25px;
    font-size: 1.1rem;
    margin-right: 10px;
}

/* Estados colapsados del sidebar */
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .nav-link i {
    display: none;
}

.sidebar.collapsed .user-name {
    opacity: 0;
    height: 0;
    margin: 0;
    overflow: hidden;
}

.sidebar.collapsed .logout-link {
    opacity: 0;
    height: 0;
    overflow: hidden;
}

/* ========== CONTENIDO PRINCIPAL ========== */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    transition: margin-left var(--transition-speed), width var(--transition-speed);
    flex: 1;
    display: flex;
    flex-direction: column;
}

#sidebar.active ~ .main-content,
.sidebar.collapsed ~ .main-content {
    margin-left: 0;
    width: 100%;
}

/* Barra superior con toggle del sidebar */
.main-content-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.sidebar-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.sidebar-toggle-btn:hover {
    background: #f1f5f9;
    color: var(--accent-color);
}

.sidebar-toggle-btn i {
    font-size: 1.25rem;
}

.main-content-header-title {
    font-weight: 600;
    color: #334155;
    font-size: 1rem;
}

/* Botón cerrar dentro del sidebar (visible en móvil) */
.sidebar-close-btn {
    margin-left: auto;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: rgba(255,255,255,0.1);
    color: var(--text-color);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.sidebar-close-btn:hover {
    background: var(--sidebar-hover);
}

/* Backdrop para cerrar sidebar en móvil */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.sidebar-backdrop.is-visible {
    display: block;
    opacity: 1;
}

.content-wrapper {
    padding: 30px;
    flex: 1;
}

/* ========== DASHBOARD ========== */
.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    color: var(--primary-blue);
    font-size: 32px;
    margin-bottom: 5px;
}

.page-header p {
    color: #666;
    font-size: 16px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.dashboard-card {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.dashboard-card h3 {
    color: var(--primary-blue);
    margin-bottom: 10px;
    font-size: 20px;
}

.dashboard-card p {
    color: #666;
    font-size: 14px;
}

/* ========== DATOS PERSONALES (estilo referencia) ========== */
.datos-personales-card {
    border: 1px solid #ddd !important;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
}

.datos-personales-valor {
    color: #006d7a;
}

.datos-personales-foto {
    width: 150px;
    height: 150px;
    border: 1px solid #ddd !important;
}

.datos-personales-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.datos-personales-direccion {
    background: #e9ecef;
    border-top: 1px solid #dee2e6;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 767px) {
    .sidebar {
        width: var(--sidebar-width);
        z-index: 1001;
        box-shadow: 4px 0 20px rgba(0,0,0,0.2);
    }
    
    .sidebar.collapsed {
        margin-left: calc(-1 * var(--sidebar-width));
        transform: translateX(-100%);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .sidebar.collapsed ~ .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .content-wrapper {
        padding: 16px;
    }
    
    .main-content-header {
        padding: 10px 16px;
    }
}

/* Estilo de la flecha indicadora */
.dropdown-toggle::after {
    display: inline-block;
    margin-left: auto; /* La empuja a la derecha del todo */
    transition: transform 0.3s ease; /* Aquí ocurre la magia del giro */
}

/* Cuando el menú se expande, la flecha gira 180 grados */
.dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

/* Mejora de Inputs y Formulario */
.form-card-header {
    background: var(--sidebar-bg); /* Azul slate del sidebar */
    color: white;
    border-bottom: 3px solid var(--accent-color);
}

.custom-form-label {
    font-weight: 700;
    color: #64748b; /* Slate 500 */
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.form-control, .form-select {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    transition: all 0.3s ease;
    background-color: #f8fafc;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
    background-color: #fff;
}

/* Encabezado de formulario con personalidad */
.form-header-gradient {
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, #2d3e50 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px 12px 0 0;
    border-bottom: 3px solid var(--accent-color);
}

/* Cuerpo del formulario con un tono de fondo muy suave */
.form-body-custom {
    background-color: #fcfcfd;
    padding: 2rem;
}

/* Etiquetas modernas para formularios */
.custom-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    display: block;
}

/* Estilo para inputs de solo lectura (Situación) */
.form-control[readonly] {
    background-color: #f1f5f9;
    color: #64748b;
    border-style: dashed;
}

/* Diseño de la Grilla de Historial */
.table-custom-container {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.table-header-custom {
    background-color: var(--sidebar-bg) !important;
}

/* Botón Guardar con degradado */
.btn-save-custom {
    background: linear-gradient(135deg, var(--accent-color) 0%, #0ea5e9 100%);
    color: white;
    border: none;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    transition: transform 0.2s;
}

.btn-save-custom:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.4);
    color: white;
}

/* Personalización de Flatpickr para que combine con tu Sidebar */
.flatpickr-calendar {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    border: 1px solid #e2e8f0 !important;
}

.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange {
    background: var(--sidebar-bg) !important; /* El color Slate oscuro */
    border-color: var(--sidebar-bg) !important;
}

.flatpickr-day:hover {
    background: var(--accent-color) !important;
    color: white !important;
}

.flatpickr-months .flatpickr-month {
    background: var(--sidebar-bg) !important;
    color: white !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: var(--sidebar-bg) !important;
}

/* Efecto hover suave en las tarjetas */
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
}

/* ================= LOGIN MODERN STYLE ================= */
.login-page {
    background: radial-gradient(circle at top right, #1e293b, #0f172a);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
}

.login-card {
    background: #ffffff;
    width: 100%;
    max-width: 420px;
    padding: 3rem 2.5rem;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.login-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.brand-logo {
    width: 60px;
    height: 60px;
    background: var(--accent-color);
    color: white;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 1rem;
    box-shadow: 0 10px 15px -3px rgba(56, 189, 248, 0.3);
}

.login-brand h2 {
    color: #1e293b;
    font-weight: 800;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.login-brand span { color: var(--accent-color); }

.login-brand p { color: #64748b; font-size: 0.9rem; }

/* Formulario */
.input-group-custom { margin-bottom: 1.5rem; }

.input-group-custom label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

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

.input-wrapper i:not(.fa-eye):not(.fa-eye-slash) {
    position: absolute;
    left: 15px;
    color: #94a3b8;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #f1f5f9;
    border-radius: 12px;
    background: #f8fafc;
    transition: all 0.3s ease;
}

.input-wrapper input:focus {
    border-color: var(--accent-color);
    background: white;
    outline: none;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.1);
}

.toggle-password {
    position: absolute;
    right: 15px;
    border: none;
    background: none;
    color: #94a3b8;
    cursor: pointer;
}

/* Botón con Spinner */
.btn-login {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: var(--sidebar-bg);
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-login:hover {
    background: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

.login-alert {
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

.login-footer {
    text-align: center;
    margin-top: 2rem;
    color: #94a3b8;
    font-size: 0.75rem;
}

/* Estilos para el Reporte de Envíos */
.filter-card {
    background: #ffffff;
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.table-main-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Custom Checkbox */
.form-check-input:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

/* Checkboxes en tablas de Reportes (Solicitudes por Aprobar, Envío de Documentos): borde azul siempre visible */
.table-main-container .form-check-input {
    border-color: #0ea5e9;
    border-width: 2px;
}
.table-main-container .form-check-input:checked {
    background-color: #bae6fd;
    border-color: #0ea5e9;
}
.table-main-container .form-check-input:checked:hover {
    background-color: #7dd3fc;
    border-color: #0ea5e9;
}

/* Botón Enviar Refinado */
.btn-action-send {
    background: var(--sidebar-bg);
    color: white;
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.btn-action-send:hover {
    background: var(--sidebar-hover);
    color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-action-send:disabled {
    background: #cbd5e1;
}

/* Estilo de celdas */
.table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    padding: 1rem !important;
}

.table td {
    padding: 0.85rem 1rem !important;
    vertical-align: middle;
    color: #475569;
}

/* Reducir espacio entre filas en la tabla de envío de documentos */
.table-main-container .table tbody tr {
    padding: 0.4rem 0 !important;
}

.table-main-container .table td {
    padding: 0.6rem 1rem !important;
}

/* Vacaciones por Aprobar: filas compactas y fuente pequeña para ver más registros sin scroll */
.solicitudes-aprobar-page .table-main-container {
    margin-top: 0;
}
/* Título de la página: mantener tamaño de fuente inicial */
.solicitudes-aprobar-page .d-flex.justify-content-between h3 {
    font-size: 1.25rem !important;
}
.solicitudes-aprobar-page .table-solicitudes-compact {
    font-size: 0.8rem;
}
.solicitudes-aprobar-page .table-solicitudes-compact thead th {
    font-size: 0.7rem;
    padding: 0.35rem 0.5rem !important;
    white-space: nowrap;
}
.solicitudes-aprobar-page .table-solicitudes-compact tbody td {
    padding: 0.3rem 0.5rem !important;
    font-size: 0.8rem;
    white-space: nowrap;
    vertical-align: middle;
}
.solicitudes-aprobar-page .table-solicitudes-compact tbody tr {
    padding: 0 !important;
}
.solicitudes-aprobar-page .table-solicitudes-compact .badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
}
.solicitudes-aprobar-page .filter-card .card-body {
    padding: 0.35rem 0.5rem !important;
}
.solicitudes-aprobar-page .filter-card .form-control-sm,
.solicitudes-aprobar-page .filter-card .btn-sm {
    font-size: 0.8rem;
}

/* ================= SOLICITUDES COMPACTAS (Solicitud de Vacaciones) ================= */

/* Cabecera de Tabla Distinguida */
.table-header-custom th {
    background-color: #1e293b !important;
    color: #ffffff !important;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-bottom: 0;
    padding: 12px;
}

/* Formulario Compacto */
.form-floating-custom > .form-control {
    height: calc(2.5rem + 2px);
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}
.form-label-small {
    font-size: 0.8rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 4px;
}

/* Ajuste para móviles: Botón full-width al final */
@media (max-width: 768px) {
    .btn-mobile-full {
        width: 100%;
        margin-top: 10px;
        padding: 12px;
    }
}

/* ================= HISTÓRICO COMPACTO (Resumen / Histórico de Ausencias) ================= */

/* Cabecera con relleno y color Slate (Azul Grisáceo) */
.table-header-soft th {
    background-color: #334155 !important;
    color: #ffffff !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    padding: 12px 10px;
    border: none;
}

/* Reducir altura de filas y tamaño de letra en cuerpo */
.table-compact td {
    padding: 10px 10px;
    font-size: 0.9rem;
    color: #475569;
}

/* Tarjetas sin padding excesivo para aprovechar espacio móvil */
.card-body.p-0 {
    padding: 0 !important;
}

/* Botón de vista previa (Ojo) */
.btn-preview {
    background-color: #f1f5f9;
    color: #64748b;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-preview:hover {
    background-color: var(--accent-color);
    color: white;
    transform: scale(1.1);
}

/* Envío de Documentos: exportar a Excel (esquina inferior derecha) */
.envio-excel-export {
    margin-top: 1rem;
    text-align: right;
}
.btn-excel-export {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #217346;
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
}
.btn-excel-export:hover {
    background: #185c32;
    color: #fff !important;
    transform: translateY(-1px);
}
.btn-excel-export .excel-logo {
    font-size: 1.4rem;
    color: #a4d792;
}

/* Documentos Personales: filtro tipo documento con nombre completo visible */
.documentos-tipodoc-select {
    min-width: 260px;
    max-width: 100%;
}

/* Documentos Personales: botón descarga en móvil (redondo, compacto) */
@media (max-width: 768px) {
    .btn-icon-mobile {
        width: 36px;
        height: 36px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        font-size: 1rem;
    }
}

/* Ajuste para el iframe del PDF */
.pdf-viewer-container {
    height: 70vh;
    width: 100%;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

/* DOCUMENTOS PERSONALES - MODERN LOOK */
.doc-card-header {
    background: #ffffff;
    border-left: 5px solid var(--accent-color);
    padding: 1.25rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.table-docs {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.table-docs thead {
    background-color: #f8fafc;
}

.table-docs th {
    color: #475569;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
}

/* Icono de PDF Moderno */
.pdf-icon-wrapper {
    width: 35px;
    height: 35px;
    background: #fff1f2;
    color: #e11d48;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1.1rem;
}

/* Botón de descarga estilizado */
.btn-download-modern {
    background-color: #f1f5f9;
    color: #1e293b;
    border: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-download-modern:hover {
    background-color: var(--sidebar-bg);
    color: white;
    transform: translateY(-2px);
}

.status-download {
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}

/* RESUMEN DE AUSENCIAS - REFINADO */
.section-header-modern {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 2rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f1f5f9;
}

.section-header-modern i {
    color: var(--accent-color);
    font-size: 1.25rem;
}

.section-header-modern h5 {
    margin: 0;
    font-weight: 700;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Badges de estado modernos */
.badge-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    text-transform: uppercase;
}

.bg-success-subtle { background-color: #dcfce7 !important; color: #166534 !important; }
.bg-warning-subtle { background-color: #fef3c7 !important; color: #92400e !important; }

/* ================= SIDEBAR - SUBMENÚS (NUEVA ESTRUCTURA) ================= */
/* Eliminar puntos y sangría por defecto de las listas */
.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Ajuste del enlace principal (Padre) - más a la izquierda para una sola línea */
.sidebar .nav-link {
    display: flex;
    align-items: flex-start; /* Si el texto salta de línea, alineado con la primera línea */
    padding: 10px 12px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s;
    border-radius: 8px;
    margin: 4px 8px;
}

.sidebar .nav-link i:first-child {
    flex-shrink: 0;
    margin-right: 0.5rem;
    margin-top: 0.15em; /* Alineación óptica con la primera línea de texto */
}

.sidebar .nav-link span {
    min-width: 0; /* Permite envolver; la segunda línea queda alineada con la primera */
}

/* ================= SIDEBAR - SUBMENÚS REFINADOS ================= */

/* Contenedor del submenú: menos margen izquierdo para ganar espacio */
.sidebar .submenu-container {
    list-style: none;
    padding: 4px 0;
    margin: 4px 8px 8px 8px; /* Alineado más a la izquierda, menos espacio sobrante */
    background-color: rgba(224, 242, 254, 0.95);
    border-radius: 10px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #bae6fd;
}

/* Enlaces de los submenús: una sola línea, sin ajuste de texto */
.sidebar .sub-nav-link {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    color: #0369a1;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 6px;
    margin: 1px 4px;
    white-space: nowrap;
}

/* Hover: Un celeste un poco más intenso al pasar el mouse */
.sidebar .sub-nav-link:hover {
    background-color: #bae6fd;
    color: #0c4a6e;
    transform: translateX(3px);
}

/* Cuando la opción está seleccionada (Activa) */
.sidebar .sub-nav-link.active {
    background-color: var(--accent-color);
    color: white !important;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Iconos dentro del submenú: menos margen para acercar el texto */
.sidebar .sub-nav-link i {
    font-size: 0.75rem;
    margin-right: 8px;
    opacity: 0.8;
    flex-shrink: 0;
}

/* Ocultar bullets de Bootstrap si se están usando clases como 'nav' */
.nav {
    --bs-nav-link-padding-x: 0;
}

/* ========== PERFIL COMPACTO (Datos Personales) ========== */
.profile-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
}

.profile-cover {
    height: 100px;
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, #334155 100%);
}

.profile-avatar-container {
    width: 120px;
    height: 120px;
    margin: -60px auto 10px;
    border-radius: 50%;
    border: 4px solid white;
    overflow: hidden;
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-color);
    color: white;
    font-size: 2.5rem;
    font-weight: bold;
}

/* Tarjetas de Datos Compactas */
.info-card {
    background: white;
    border-radius: 12px;
    height: 100%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    transition: transform 0.2s;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.info-header {
    padding: 12px 20px;
    border-bottom: 1px solid #f1f5f9;
    background-color: rgba(248, 250, 252, 0.5);
}

.info-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 700;
    margin-bottom: 2px;
}

.info-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Ajustes Mobile - Perfil */
@media (max-width: 768px) {
    .profile-cover { height: 80px; }
    .profile-avatar-container { width: 100px; height: 100px; margin-top: -50px; }
}

/* Pequeño ajuste para los enlaces del footer del login */
.login-footer a {
    transition: color 0.3s;
}
.login-footer a:hover {
    color: var(--primary-blue) !important;
    text-decoration: underline !important;
}

/* Generar Boletas - Master-Detail visor */
.fila-trabajador:hover {
    background-color: rgba(0,0,0,0.02);
}
.bg-success-soft {
    background-color: #e8f5e9 !important;
    color: #1b5e20 !important;
}
