/* ============================================
   ERP SISTEMA - ESTILOS GLOBALES DE MÓDULOS
   ============================================ */

   :root {
    --primary: #1c2732;
    --primary-dark: #1a252f;
    --secondary: #3498db;
    --light: #ecf0f1;
    --dark: #1c2732;
    --danger: #e74c3c;
    --success: #27ae60;
    --warning: #f39c12;
    --info: #3498db;
    --bg-body: #f8f9fa;
    --bg-card: white;
    --text-color: #333;
    --border: #ddd;
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
}

.dark-mode {
    --bg-body: #121212;
    --bg-card: #1e1e1e;
    --text-color: #f0f0f0;
    --border: #444;
    --primary: #1c2732;
    --primary-dark: #1a252f;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-color);
    display: flex;
    min-height: 100vh;
    transition: background-color 0.3s;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--primary);
    color: white;
    height: 100vh;
    position: fixed;
    transition: all 0.3s ease;
    z-index: 100;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    background: var(--primary-dark);
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
    border-bottom: 1px solid #34495e;
    transition: all 0.3s;
}

.sidebar-header span {
    white-space: nowrap;
    overflow: hidden;
}

.nav-links {
    list-style: none;
    padding: 15px 0;
    flex: 1;
}

.nav-links li {
    padding: 0 15px;
}

.nav-links a {
    color: #bdc3c7;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    margin: 5px 0;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--secondary);
    color: white;
    transform: translateX(4px);
}

.nav-links i {
    margin-right: 15px;
    font-size: 1.1rem;
    min-width: 24px;
    text-align: center;
}

/* ============================================
   MENÚ MÓVIL
   ============================================ */
.menu-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    display: none;
    margin-right: 15px;
    z-index: 101;
}

/* ============================================
   CONTENIDO PRINCIPAL
   ============================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: var(--bg-card);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 90;
}

.topbar h2 {
    color: var(--dark);
    font-size: 1.4rem;
    font-weight: 600;
}

.topbar h2 .modulo-breadcrumb {
    color: var(--secondary);
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
}

.logout-btn {
    background: var(--danger);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logout-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

.theme-toggle {
    background: #555;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.clock {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
    background: var(--bg-body);
    padding: 6px 12px;
    border-radius: 6px;
    min-width: 180px;
    text-align: center;
}

/* ============================================
   DASHBOARD / CONTENEDORES
   ============================================ */
.dashboard-container {
    padding: 30px;
    flex: 1;
}

.card {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-bottom: 25px;
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-3px);
}

/* ============================================
   FORMULARIOS
   ============================================ */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    color: var(--text-color);
    opacity: 0.8;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* ============================================
   BOTONES
   ============================================ */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-primary { background: var(--secondary); color: white; }
.btn-secondary { background: #95a5a6; color: white; }
.btn-success { background: var(--success); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-danger { background: var(--danger); color: white; }

/* ============================================
   ALERTAS
   ============================================ */
.alert {
    padding: 12px;
    border-radius: 6px;
    margin: 15px 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error { 
    background: #fdf2f2; 
    color: var(--danger); 
    border-left: 4px solid var(--danger); 
}

.alert-success { 
    background: #f6fdf6; 
    color: var(--success); 
    border-left: 4px solid var(--success); 
}

/* ============================================
   TABLAS
   ============================================ */
table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-top: 15px; 
}

th, td { 
    padding: 12px; 
    text-align: left; 
    border-bottom: 1px solid var(--border); 
}

th { 
    background: var(--primary); 
    color: white; 
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

tr:hover { 
    background: rgba(52, 152, 219, 0.08);
    transform: translateY(-1px);
    transition: all 0.2s;
}

/* ============================================
   MODAL
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: var(--bg-card);
    margin: 10% auto;
    padding: 20px;
    border-radius: 10px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 15px;
}

.close:hover {
    color: #000;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.modal-body {
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ============================================
   OVERLAY MÓVIL
   ============================================ */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    -webkit-tap-highlight-color: transparent;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .menu-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .user-info {
        gap: 10px;
    }
    .user-info span {
        display: none;
    }
    .clock {
        min-width: 120px;
        font-size: 0.85rem;
    }
    .dashboard-container {
        padding: 20px;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .btn {
        width: 100%;
        justify-content: center;
    }
    table {
        font-size: 0.85rem;
    }
    th, td {
        padding: 10px 8px;
    }
    .btn span {
        display: none;
    }
}

@media (max-width: 480px) {
    .topbar {
        padding: 15px;
        flex-wrap: wrap;
        gap: 10px;
    }
    .logout-btn span,
    .theme-toggle span {
        display: none;
    }
    .clock {
        padding: 4px 8px;
        min-width: 100px;
        font-size: 0.8rem;
    }
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 8px;
        font-size: 0.9rem;
    }
    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    th, td {
        padding: 8px 6px;
    }
}

/* ========================================
   FOOTER - Lumio ERP
   ======================================== */
.erp-footer {
    background: linear-gradient(135deg, var(--primary-dark, #1a252f) 0%, var(--primary, #2c3e50) 100%);
    color: #bdc3c7;
    padding: 12px 30px;
    margin-top: auto;
    border-top: 3px solid var(--secondary, #3498db);
    box-shadow: 0 -4px 15px rgba(0,0,0,0.15);
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 5px;
}

.footer-brand {
    margin-bottom: 4px;
}

.brand-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #fff 0%, var(--secondary, #3498db) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.footer-info p {
    margin: 0;
    font-size: 0.9rem;
}

.copyright {
    font-weight: 500;
    color: #ecf0f1;
}

.copyright strong {
    color: var(--secondary, #3498db);
    font-weight: 700;
}

.tagline {
    font-size: 0.85rem !important;
    color: #95a5a6;
    font-style: italic;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .erp-footer {
        padding: 10px 15px;
    }
    
    .brand-name {
        font-size: 1.2rem;
    }
    
    .footer-info p {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .brand-name {
        font-size: 1.1rem;
    }
    
    .tagline {
        font-size: 0.8rem !important;
    }
}

.dark-mode .erp-footer {
    background: linear-gradient(135deg, #0d1117 0%, #1a1f2e 100%);
    border-top-color: var(--secondary, #3498db);
}

.dark-mode .brand-name {
    background: linear-gradient(135deg, #f0f0f0 0%, var(--secondary, #3498db) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dark-mode .copyright {
    color: #d0d0d0;
}

/* ========================================
   DASHBOARD - ESTILOS ESPECÍFICOS
   ======================================== */
.welcome-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 30px;
    transition: transform 0.3s;
}

.welcome-card:hover {
    transform: translateY(-3px);
}

.welcome-card h1 {
    color: var(--dark);
    margin-bottom: 15px;
    font-size: 2rem;
    font-weight: 700;
}

.welcome-card p {
    color: #6c757d;
    margin-bottom: 25px;
    line-height: 1.6;
}

.user-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.detail-box {
    background: var(--bg-body);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid var(--secondary);
    transition: all 0.3s;
}

.detail-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.detail-box strong {
    color: var(--text-color);
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-box span {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
}

/* Submenús desplegables (Sidebar) */
.submenu {
    list-style: none;
    padding-left: 0;
    margin-top: 8px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.submenu li {
    padding: 0 15px 0 40px;
}

.submenu a {
    color: #bdc3c7;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 8px 15px;
    border-radius: 6px;
    margin: 3px 0;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    white-space: normal;
    word-wrap: break-word;
    min-height: 40px;
}

.submenu a:hover {
    background: rgba(52, 152, 219, 0.2);
    color: white;
    transform: translateX(2px);
}

.submenu-arrow {
    margin-left: auto;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.menu-item.active .submenu {
    max-height: 1000px;
    padding: 10px 0;
}

.menu-item.active .submenu-arrow {
    transform: rotate(180deg);
}

.sidebar.collapsed .submenu {
    display: none !important;
}

@media (max-width: 767.98px) {
    .welcome-card {
        padding: 20px;
    }
    .welcome-card h1 {
        font-size: 1.7rem;
    }
    .user-details {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .detail-box {
        padding: 15px;
    }
    .detail-box span {
        font-size: 1rem;
    }
}

@supports (-webkit-touch-callout: none) {
    .sidebar {
        -webkit-overflow-scrolling: touch;
    }
}

/* ========================================
   MODO OSCURO - DASHBOARD ESPECÍFICO
   ======================================== */
   .dark-mode .welcome-card {
    background: var(--bg-card);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.dark-mode .welcome-card h1 {
    color: var(--text-color);
}

.dark-mode .welcome-card p {
    color: #a0aec0;
}

.dark-mode .detail-box {
    background: var(--bg-body);
    border-left-color: var(--secondary);
}

.dark-mode .detail-box strong {
    color: var(--text-color);
}

.dark-mode .detail-box span {
    color: var(--text-color);
}

.dark-mode .topbar {
    background: var(--bg-card);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.dark-mode .topbar h2 {
    color: var(--text-color);
}

.dark-mode .card {
    background: var(--bg-card);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.dark-mode .form-group input,
.dark-mode .form-group select,
.dark-mode .form-group textarea {
    background: var(--bg-card);
    color: var(--text-color);
    border-color: var(--border);
}

.dark-mode table th {
    background: var(--primary);
    color: white;
}

.dark-mode table td {
    color: var(--text-color);
    border-color: var(--border);
}

/* Forzar tamaño consistente del sidebar */
.sidebar .nav-links > li > a,
.sidebar .nav-links a {
    font-size: 0.95rem !important;
    padding: 12px 15px !important;
}

.sidebar .sidebar-header {
    font-size: 1.2rem !important;
}

.sidebar .submenu a {
    font-size: 0.9rem !important;
    padding: 8px 15px !important;
}

/* ========================================
   FIX GLOBALES DE ESTRUCTURA (Layout)
   (Soluciona el espacio en blanco del footer 
    y problemas de clic en el sidebar en todos los módulos)
   ======================================== */
   .main-content {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.dashboard-container {
    flex: 1; /* Empuja el footer hacia abajo */
}

.erp-footer {
    margin-top: auto; /* Se pega al final del contenido */
}

.sidebar {
    pointer-events: auto !important;
    z-index: 100 !important;
}

.sidebar .nav-links a {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* El overlay solo debe existir en móviles */
.sidebar-overlay {
    display: none !important;
}

@media (max-width: 992px) {
    .sidebar-overlay.active {
        display: block !important;
    }
}

/* ========================================
   CONTABILIDAD - ESTILOS ESPECÍFICOS
   ======================================== */
.tipo-activo_circulante { color: var(--success); font-weight: bold; }
.tipo-activo_diferido { color: var(--success); font-weight: bold; }
.tipo-activo_fijo { color: var(--success); font-weight: bold; }
.tipo-capital { color: var(--info); font-weight: bold; }
.tipo-cuenta_de_orden { color: var(--warning); font-weight: bold; }
.tipo-pasivo_corto_plazo { color: var(--danger); font-weight: bold; }
.tipo-pasivo_largo_plazo { color: var(--danger); font-weight: bold; }
.tipo-resultados { color: var(--success); font-weight: bold; }

.naturaleza-deudora { color: var(--success); font-weight: bold; }
.naturaleza-acreedora { color: var(--danger); font-weight: bold; }

.cuenta-final-si { color: var(--success); font-weight: bold; }
.cuenta-final-no { color: var(--danger); font-weight: bold; }

.status-activa { color: var(--success); font-weight: bold; }
.status-inactiva { color: var(--danger); font-weight: bold; }

/* ========================================
   DISPOSITIVOS BIOMÉTRICOS - ESTILOS ESPECÍFICOS
   ======================================== */
   .status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

.status-activo { background: #d4edda; color: #155724; }
.status-inactivo { background: #f8d7da; color: #721c24; }

.dark-mode .status-activo { background: rgba(39, 174, 96, 0.2); color: #27ae60; }
.dark-mode .status-inactivo { background: rgba(231, 76, 60, 0.2); color: #e74c3c; }

.info-box {
    background: #e8f4f8;
    border-left: 4px solid var(--secondary);
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    font-size: 0.9rem;
}

.dark-mode .info-box { background: rgba(52, 152, 219, 0.1); }

.config-mode-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.mode-option {
    flex: 1;
    min-width: 200px;
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.mode-option:hover {
    border-color: var(--secondary);
    background: rgba(52, 152, 219, 0.05);
}

.mode-option.active {
    border-color: var(--secondary);
    background: rgba(52, 152, 219, 0.1);
}

.mode-option i {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--secondary);
}

.mode-option h4 {
    margin: 10px 0 5px 0;
    color: var(--primary);
}

.mode-option p {
    margin: 0;
    font-size: 0.85rem;
    color: #7f8c8d;
}

.example-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 12px;
    margin: 10px 0;
    font-size: 0.9rem;
}

.example-box code {
    background: rgba(0,0,0,0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

.quick-tips {
    background: #d1ecf1;
    border: 1px solid #17a2b8;
    border-radius: 6px;
    padding: 12px;
    margin: 10px 0;
}

.quick-tips ul {
    margin: 5px 0 0 20px;
    padding: 0;
}

.quick-tips li {
    margin: 5px 0;
}

@media (max-width: 768px) {
    .config-mode-selector {
        flex-direction: column;
    }
    
    .mode-option {
        min-width: 100%;
    }
}

/* ========================================
   EMPLEADOS ASISTENCIAS - ESTILOS ESPECÍFICOS
   ======================================== */
   .filters-bar {
    background: var(--bg-card);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filters-bar .form-group {
    flex: 1;
    min-width: 200px;
    margin: 0;
}

.filters-bar label {
    font-size: 0.85rem;
    margin-bottom: 5px;
    display: block;
}

.biometric-info {
    background: #e8f4f8;
    border-left: 4px solid var(--secondary);
    padding: 12px;
    border-radius: 6px;
    margin: 15px 0;
    font-size: 0.9rem;
}

.dark-mode .biometric-info {
    background: rgba(52, 152, 219, 0.1);
}

@media (max-width: 768px) {
    .filters-bar {
        flex-direction: column;
    }
    
    .filters-bar .form-group {
        min-width: 100%;
    }
}

/* ========================================
   ASISTENCIAS DASHBOARD - ESTILOS ESPECÍFICOS
   ======================================== */
   .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid var(--secondary);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card h3 {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #7f8c8d;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

.dark-mode .stat-card .value {
    color: var(--text-color);
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Modal de Sincronización */
.sync-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.sync-modal-content {
    background-color: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.progress-container {
    width: 100%;
    background-color: var(--border);
    border-radius: 12px;
    margin: 25px 0;
    height: 28px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--secondary), #4facfe);
    transition: width 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85rem;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.sync-status {
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 10px;
}

.sync-result {
    font-weight: bold;
    margin-top: 15px;
    padding: 10px;
    border-radius: 6px;
    display: none;
}

.sync-result.success {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
    border: 1px solid #27ae60;
}

.sync-result.error {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .action-buttons {
        flex-direction: column;
    }
    .action-buttons .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   REGISTRO DE ASISTENCIAS - ESTILOS ESPECÍFICOS
   ======================================== */
   .kpi-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.kpi-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 15px;
    border-left: 4px solid var(--primary);
}

.kpi-card.warning { border-left-color: #f39c12; }
.kpi-card.danger { border-left-color: #e74c3c; }

.kpi-icon {
    width: 50px; height: 50px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: var(--primary);
}

.kpi-card.warning .kpi-icon { background: rgba(243, 156, 18, 0.1); color: #f39c12; }
.kpi-card.danger .kpi-icon { background: rgba(231, 76, 60, 0.1); color: #e74c3c; }

.kpi-info h4 { margin: 0; font-size: 0.85rem; color: #7f8c8d; text-transform: uppercase; }
.kpi-info p { margin: 5px 0 0 0; font-size: 1.8rem; font-weight: bold; color: var(--text-color); }

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-body);
    color: var(--text-color);
    font-size: 0.95rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.badge-entrada { background: #d4edda; color: #155724; padding: 4px 10px; border-radius: 12px; font-size: 0.8rem; font-weight: bold; }
.badge-salida { background: #f8d7da; color: #721c24; padding: 4px 10px; border-radius: 12px; font-size: 0.8rem; font-weight: bold; }
.badge-entrada_salida { background: #d1ecf1; color: #0c5460; padding: 4px 10px; border-radius: 12px; font-size: 0.8rem; font-weight: bold; }
.badge-incidencia { background: #fff3cd; color: #856404; padding: 4px 10px; border-radius: 12px; font-size: 0.8rem; font-weight: bold; }

.dark-mode .badge-entrada { background: rgba(39, 174, 96, 0.2); color: #27ae60; }
.dark-mode .badge-salida { background: rgba(231, 76, 60, 0.2); color: #e74c3c; }
.dark-mode .badge-entrada_salida { background: rgba(52, 152, 219, 0.2); color: #3498db; }
.dark-mode .badge-incidencia { background: rgba(243, 156, 18, 0.2); color: #f39c12; }

.btn-filter {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-filter:hover {
    background: var(--secondary);
    transform: translateY(-1px);
}

.btn-clear {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-clear:hover {
    background: #7f8c8d;
}

.table-container {
    overflow-x: auto;
    margin-top: 15px;
}

.text-muted { color: #7f8c8d; font-size: 0.85rem; }

@media (max-width: 768px) {
    .filters-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   REPORTES DE ASISTENCIAS - ESTILOS ESPECÍFICOS
   ======================================== */
   .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid var(--secondary);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-card .icon { font-size: 2.5rem; color: var(--secondary); }
.stat-card .info h3 { margin: 0; font-size: 0.9rem; color: #7f8c8d; text-transform: uppercase; }
.stat-card .info .value { font-size: 1.8rem; font-weight: bold; color: var(--primary); margin: 5px 0 0 0; }

.filters-section { background: var(--bg-card); padding: 25px; border-radius: 10px; margin-bottom: 25px; }
.filters-section h3 { margin-top: 0; margin-bottom: 20px; color: var(--primary); display: flex; align-items: center; gap: 10px; }
.filters-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 20px; }
.filters-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.export-buttons { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }

.employees-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
.employees-table th, .employees-table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); }
.employees-table th { background: var(--bg-body); font-weight: 600; color: var(--text-color); text-transform: uppercase; font-size: 0.85rem; }
.employees-table tr:hover { background: var(--bg-body); }

.badge-semanal { background: #d4edda; color: #155724; }
.badge-quincenal { background: #d1ecf1; color: #0c5460; }
.badge-operativo { background: #fff3cd; color: #856404; }
.badge-administrativo { background: #d6d8db; color: #1b1e21; }

.dark-mode .badge-semanal { background: rgba(39, 174, 96, 0.2); color: #27ae60; }
.dark-mode .badge-quincenal { background: rgba(52, 152, 219, 0.2); color: #3498db; }
.dark-mode .badge-operativo { background: rgba(243, 156, 18, 0.2); color: #f39c12; }
.dark-mode .badge-administrativo { background: rgba(189, 195, 199, 0.2); color: #bdc3c7; }

.btn-ver-pdf { background: #dc3545; color: white; padding: 6px 12px; border-radius: 6px; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; font-size: 0.85rem; transition: background 0.3s; }
.btn-ver-pdf:hover { background: #c82333; color: white; }

.results-count { background: #e3f2fd; color: #1976d2; padding: 6px 15px; border-radius: 20px; font-size: 0.9rem; font-weight: 600; }
.ubicacion-link { color: var(--secondary); text-decoration: none; font-size: 0.9rem; display: inline-flex; align-items: center; gap: 5px; }
.ubicacion-link:hover { text-decoration: underline; }

@media (max-width: 768px) {
    .filters-grid { grid-template-columns: 1fr; }
    .export-buttons { flex-direction: column; }
    .export-buttons .btn { width: 100%; justify-content: center; }
}

/* ========================================
   BENEFICIOS - ESTILOS ESPECÍFICOS
   ======================================== */
   .status-activo { color: var(--success); font-weight: bold; }
   .status-vencido { color: #f39c12; font-weight: bold; }
   .status-cancelado { color: var(--danger); font-weight: bold; }
   
   .dark-mode .status-activo { color: #27ae60; }
   .dark-mode .status-vencido { color: #f39c12; }
   .dark-mode .status-cancelado { color: #e74c3c; }

   /* ========================================
   NÓMINA - ESTILOS ESPECÍFICOS
   ======================================== */
.neto { 
    font-weight: bold; 
    color: var(--success); 
}

.dark-mode .neto {
    color: #27ae60;
}

/* ========================================
   ORGANIGRAMA - ESTILOS ESPECÍFICOS
   ======================================== */
   .org-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.organigrama-container {
    background: var(--bg-body);
    padding: 30px;
    border-radius: 12px;
    overflow-x: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-align: center;
    min-height: 300px;
}

.tree ul {
    padding-top: 20px; 
    position: relative;
    transition: all 0.5s;
    display: flex;
    justify-content: center;
}

.tree li {
    float: left; 
    text-align: center;
    list-style-type: none;
    position: relative;
    padding: 20px 10px 0 10px;
    transition: all 0.5s;
}

/* Líneas conectoras del árbol */
.tree li::before, .tree li::after {
    content: ''; 
    position: absolute; 
    top: 0; 
    right: 50%;
    border-top: 2px solid var(--border); 
    width: 50%; 
    height: 20px;
}

.tree li::after { 
    right: auto; 
    left: 50%; 
    border-left: 2px solid var(--border); 
}

.tree li:only-child::after, .tree li:only-child::before { display: none; }
.tree li:only-child { padding-top: 0; }
.tree li:first-child::before, .tree li:last-child::after { border: 0 none; }
.tree li:last-child::before { border-right: 2px solid var(--border); border-radius: 0 5px 0 0; }
.tree li:first-child::after { border-radius: 5px 0 0 0; }

.tree ul ul::before {
    content: ''; 
    position: absolute; 
    top: 0; 
    left: 50%;
    border-left: 2px solid var(--border); 
    width: 0; 
    height: 20px;
}

/* Nodo del empleado */
.tree .node {
    border: 1px solid var(--border);
    padding: 15px;
    text-decoration: none;
    color: var(--text-color);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    border-radius: 12px;
    background: var(--bg-card);
    transition: all 0.3s ease;
    min-width: 180px;
    max-width: 220px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    position: relative;
}

.tree .node:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    border-color: var(--primary);
}

.node-avatar {
    width: 50px; 
    height: 50px;
    background: linear-gradient(135deg, var(--primary), #2980b9);
    color: white;
    border-radius: 50%;
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-weight: bold; 
    font-size: 1.2rem;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.node-info strong { 
    display: block; 
    font-size: 0.95rem; 
    margin-bottom: 4px; 
    line-height: 1.3; 
}

.node-info span { 
    font-size: 0.8rem; 
    color: #7f8c8d; 
    display: block; 
    margin-bottom: 10px; 
}

.btn-edit-jefe {
    margin-top: 5px;
    padding: 6px 12px;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    color: var(--primary);
    font-size: 0.8rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-edit-jefe:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

@media (max-width: 768px) {
    .tree .node { min-width: 140px; padding: 10px; }
    .node-avatar { width: 40px; height: 40px; font-size: 1rem; }
    .btn-edit-jefe span { display: none; }
}

/* ========================================
   RELACIONES LABORALES (CONTRATOS) - ESTILOS ESPECÍFICOS
   ======================================== */
   .status-rescindido { color: var(--danger); font-weight: bold; }

   .dark-mode .status-rescindido { color: #e74c3c; }
   
   .form-group input[type="file"] {
       padding: 8px;
   }

   /* ========================================
   REPORTES RH (ANALÍTICA) - ESTILOS ESPECÍFICOS
   ======================================== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.kpi-item {
    background: var(--bg-body);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.kpi-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    border-color: var(--secondary);
}

.kpi-value {
    font-size: 2.8rem;
    font-weight: bold;
    color: var(--secondary);
    margin: 15px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.kpi-label {
    font-size: 1.2rem;
    color: var(--text-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.btn-excel { background: #28a745; color: white; }
.btn-excel:hover { background: #218838; color: white; }

.btn-pdf { background: #d9534f; color: white; }
.btn-pdf:hover { background: #c9302c; color: white; }

@media (max-width: 768px) {
    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .kpi-item { padding: 20px; }
    .kpi-value { font-size: 2.2rem; }
}

@media (max-width: 480px) {
    .kpi-value { font-size: 1.8rem; }
    .kpi-label { font-size: 1rem; }
}

/* ========================================
   SOLICITUDES - ESTILOS ESPECÍFICOS
   ======================================== */
   .status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

.status-pendiente { background: #fff3cd; color: #856404; }
.status-aprobada { background: #d4edda; color: #155724; }
.status-rechazada { background: #f8d7da; color: #721c24; }

.dark-mode .status-pendiente { background: rgba(255, 243, 205, 0.15); color: #ffc107; }
.dark-mode .status-aprobada { background: rgba(212, 237, 218, 0.15); color: #28a745; }
.dark-mode .status-rechazada { background: rgba(248, 215, 218, 0.15); color: #dc3545; }

.btn-action {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    margin: 0 3px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-edit { background: #3498db; color: white; }
.btn-edit:hover { background: #2980b9; transform: translateY(-1px); color: white; }

.btn-pdf { background: #e74c3c; color: white; }
.btn-pdf:hover { background: #c0392b; transform: translateY(-1px); color: white; }

/* ========================================
   EMPLEADOS (RH) - ESTILOS ESPECÍFICOS
   ======================================== */
   .btn-excel { background: #28a745; color: white; }
   .btn-excel:hover { background: #218838; color: white; }
   
   .btn-pdf { background: #d9534f; color: white; }
   .btn-pdf:hover { background: #c9302c; color: white; }
   
   .btn-new { 
       background: #28a745; 
       color: white; 
       text-decoration: none; 
       border-radius: 5px; 
       display: inline-flex; 
       align-items: center; 
       gap: 6px; 
       padding: 10px 15px; 
   }
   .btn-new:hover { background: #218838; color: white; }
   
   .search-box {
       margin-bottom: 20px;
       display: flex;
       gap: 10px;
       flex-wrap: wrap;
   }
   .search-box input, .search-box button, .search-box a {
       padding: 10px;
       border: 1px solid var(--border);
       border-radius: 5px;
       background: var(--bg-card);
       color: var(--text-color);
       transition: all 0.2s;
   }
   .search-box button {
       background: var(--secondary);
       color: white;
       border: none;
       cursor: pointer;
   }
   .search-box button:hover { background: #2980b9; transform: translateY(-1px); }
   .search-box a { text-decoration: none; display: inline-flex; align-items: center; }
   .search-box a:hover { background: var(--bg-body); }
   
   .jefe-info { font-size: 0.85rem; color: #7f8c8d; }

   /* ========================================
   NÓMINA Y RECIBOS - ESTILOS PROFESIONALES
   ======================================== */
.modal-large {
    max-height: 90vh;
    overflow-y: auto;
}

.section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 2px solid var(--secondary);
    padding-bottom: 5px;
    margin: 20px 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calculated-field {
    background-color: rgba(52, 152, 219, 0.05);
    border: 1px solid var(--secondary);
    font-weight: 600;
    color: var(--primary);
}

/* Estilos del Recibo en Pantalla y PDF */
.recibo-paper {
    background: white;
    color: #333;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 13px;
    line-height: 1.5;
}

.recibo-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 3px solid #1c2732;
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.recibo-logo img {
    max-height: 80px;
    max-width: 180px;
    object-fit: contain;
}

.recibo-company-info {
    text-align: right;
    font-size: 12px;
    color: #555;
}

.recibo-company-info h2 {
    margin: 0 0 5px 0;
    font-size: 18px;
    color: #1c2732;
    text-transform: uppercase;
}

.recibo-title {
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    color: #1c2732;
    margin: 20px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.recibo-data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
}

.recibo-data-item label {
    display: block;
    font-size: 11px;
    color: #7f8c8d;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 2px;
}

.recibo-data-item span {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

.tabla-nomina {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 13px;
}

.tabla-nomina th {
    background: #1c2732;
    color: white;
    padding: 10px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
}

.tabla-nomina td {
    padding: 8px 10px;
    border-bottom: 1px solid #e9ecef;
}

.tabla-nomina .monto {
    text-align: right;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.tabla-nomina .total-row {
    background: #e8f4f8;
    font-weight: bold;
    border-top: 2px solid #3498db;
}

.tabla-nomina .total-row td {
    padding: 12px 10px;
    font-size: 14px;
}

.recibo-neto {
    text-align: center;
    padding: 20px;
    background: #1c2732;
    color: white;
    border-radius: 6px;
    margin: 25px 0;
}

.recibo-neto .label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

.recibo-neto .amount {
    font-size: 28px;
    font-weight: bold;
    margin-top: 5px;
}

.recibo-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px dashed #ccc;
    text-align: center;
    font-size: 11px;
    color: #7f8c8d;
}

.firma-section {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
    padding: 0 40px;
}

.firma-box {
    text-align: center;
    width: 40%;
}

.firma-line {
    border-top: 1px solid #333;
    margin-bottom: 5px;
}

.firma-label {
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

/* Acciones flotantes para el recibo */
.recibo-actions {
    position: sticky;
    top: 80px;
    background: var(--bg-card);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
    z-index: 10;
}

@media print {
    .recibo-actions, .sidebar, .topbar, .btn {
        display: none !important;
    }
    .recibo-paper {
        box-shadow: none;
        padding: 0;
        margin: 0;
        max-width: 100%;
    }
    body {
        background: white;
    }
}

@media (max-width: 768px) {
    .recibo-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .recibo-company-info {
        text-align: center;
        margin-top: 15px;
    }
    .recibo-data-grid {
        grid-template-columns: 1fr;
    }
    .firma-section {
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }
    .firma-box {
        width: 80%;
    }
}

/* ========================================
   NÓMINA - FILTROS Y BOTONES
   ======================================== */
   .filters-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.filters-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.btn-zip { 
    background: #f1c40f; 
    color: #1c2732;
    font-weight: 600;
}
.btn-zip:hover { 
    background: #f39c12; 
    color: #1c2732;
}

@media (max-width: 768px) {
    .filters-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   PERMISOS DE USUARIOS - ESTILOS ESPECÍFICOS
   ======================================== */
   .permisos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.permiso-modulo {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.permiso-modulo h4 {
    margin: 0 0 15px 0;
    font-size: 1rem;
    color: var(--primary);
    border-bottom: 2px solid var(--border);
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.permiso-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
    padding: 5px 0;
}

.permiso-item input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
    cursor: pointer;
}

.permiso-item label {
    cursor: pointer;
    flex: 1;
}

/* Interruptor Principal de Módulo */
.modulo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(0,0,0,0.03);
    border-radius: 6px;
}

.dark-mode .modulo-header {
    background: rgba(255,255,255,0.05);
}

/* ========================================
   PERMISOS DE USUARIOS - TOGGLE SWITCHES
   ======================================== */
   .toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    gap: 8px;
    user-select: none;
    width: auto !important;
}

.toggle-switch input {
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    position: absolute !important;
}

.slider-toggle {
    position: relative;
    width: 42px !important;
    height: 22px !important;
    background-color: #ccc !important;
    border-radius: 22px !important;
    transition: .3s !important;
    flex-shrink: 0;
}

.slider-toggle:before {
    position: absolute;
    content: "" !important;
    height: 16px !important;
    width: 16px !important;
    left: 3px !important;
    bottom: 3px !important;
    background-color: white !important;
    border-radius: 50% !important;
    transition: .3s !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
}

.toggle-switch input:checked + .slider-toggle {
    background-color: var(--secondary, #3498db) !important;
}

.toggle-switch input:checked + .slider-toggle:before {
    transform: translateX(20px) !important;
}

.toggle-switch input:disabled + .slider-toggle {
    background-color: #e0e0e0 !important;
    cursor: not-allowed !important;
}

/* Estilos para la sección de permisos */
.permisos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.permiso-modulo {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.permiso-modulo h4 {
    margin: 0 0 15px 0;
    font-size: 1rem;
    color: var(--primary);
    border-bottom: 2px solid var(--border);
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.permiso-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
    padding: 5px 0;
}

.permiso-item input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
    cursor: pointer;
}

.permiso-item label {
    cursor: pointer;
    flex: 1;
}

.modulo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(0,0,0,0.03);
    border-radius: 6px;
}

.dark-mode .modulo-header {
    background: rgba(255,255,255,0.05);
}

.asistencia-remota-section {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(40, 167, 69, 0.05));
    border: 2px solid #28a745;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
}

.asistencia-remota-section h3 {
    color: #28a745;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dark-mode .asistencia-remota-section {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.15), rgba(39, 174, 96, 0.05));
}

/* ========================================
   DASHBOARD - ASISTENCIA REMOTA TOGGLE
   ======================================== */
.asistencia-toggle-container {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.asistencia-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.asistencia-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.asistencia-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.asistencia-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.asistencia-toggle input:checked + .asistencia-slider {
    background-color: #28a745;
}

.asistencia-toggle input:checked + .asistencia-slider:before {
    transform: translateX(26px);
}

.asistencia-toggle input:focus + .asistencia-slider {
    box-shadow: 0 0 1px #28a745;
}

/* ========================================
   CONFIGURACIÓN DE EMPRESAS - ESTILOS ESPECÍFICOS
   ======================================== */
   .status-badge { 
    padding: 4px 10px; 
    border-radius: 20px; 
    font-size: 0.85rem; 
    font-weight: bold; 
}
.status-activo { background: #d4edda; color: #155724; }
.status-inactivo { background: #f8d7da; color: #721c24; }
.dark-mode .status-activo { background: rgba(39, 174, 96, 0.2); color: #27ae60; }
.dark-mode .status-inactivo { background: rgba(231, 76, 60, 0.2); color: #e74c3c; }

/* === MEJORAS VISUALES PARA MÓDULOS === */
.module-section {
    border: 1px solid var(--border, #e0e0e0);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    background: var(--bg-card, #fff);
    transition: box-shadow 0.2s;
}
.module-section:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.module-header {
    font-weight: bold;
    font-size: 1.05rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary, #3498db);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-primary, #1c2732);
}
.module-header i { margin-right: 8px; color: var(--secondary, #3498db); }

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

/* ========================================
   TOGGLE SWITCHES - ESTILOS CRÍTICOS
   ======================================== */
   .toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    gap: 8px;
    user-select: none;
    width: auto !important;
}

.toggle-switch input {
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    position: absolute !important;
}

.slider {
    position: relative;
    width: 42px !important;
    height: 22px !important;
    background-color: #ccc !important;
    border-radius: 22px !important;
    transition: .3s !important;
    flex-shrink: 0;
}

.slider:before {
    position: absolute;
    content: "" !important;
    height: 16px !important;
    width: 16px !important;
    left: 3px !important;
    bottom: 3px !important;
    background-color: white !important;
    border-radius: 50% !important;
    transition: .3s !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
}

.toggle-switch input:checked + .slider {
    background-color: var(--secondary, #3498db) !important;
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(20px) !important;
}

.toggle-switch input:disabled + .slider {
    background-color: #e0e0e0 !important;
    cursor: not-allowed !important;
}

.submodule-label {
    font-size: 0.9rem;
    color: var(--text-secondary, #555);
    flex: 1;
}

/* ========================================
   DASHBOARD - ASISTENCIA REMOTA TOGGLE
   ======================================== */
   .toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    gap: 8px;
    user-select: none;
    width: auto !important;
}

.toggle-switch input {
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    position: absolute !important;
}

.slider-toggle {
    position: relative;
    width: 42px !important;
    height: 22px !important;
    background-color: #ccc !important;
    border-radius: 22px !important;
    transition: .3s !important;
    flex-shrink: 0;
    display: inline-block;
}

.slider-toggle:before {
    position: absolute;
    content: "" !important;
    height: 16px !important;
    width: 16px !important;
    left: 3px !important;
    bottom: 3px !important;
    background-color: white !important;
    border-radius: 50% !important;
    transition: .3s !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
}

.toggle-switch input:checked + .slider-toggle {
    background-color: var(--secondary, #3498db) !important;
}

.toggle-switch input:checked + .slider-toggle:before {
    transform: translateX(20px) !important;
}

.toggle-switch input:disabled + .slider-toggle {
    background-color: #e0e0e0 !important;
    cursor: not-allowed !important;
}

/* ========================================
   COMPRAS - ESTILOS ESPECÍFICOS
   ======================================== */

/* Estados de Solicitudes de Compra */
.status-borrador { background: #e9ecef; color: #495057; }
.status-en_revision { background: #fff3cd; color: #856404; }
.status-autorizada { background: #d4edda; color: #155724; }
.status-rechazada { background: #f8d7da; color: #721c24; }
.status-en_compras { background: #d1ecf1; color: #0c5460; }
.status-atendida { background: #c3e6cb; color: #155724; }
.status-cancelada { background: #f5c6cb; color: #721c24; }
.status-cerrada { background: #d6d8db; color: #1b1e21; }

.dark-mode .status-borrador { background: rgba(233, 236, 239, 0.2); color: #adb5bd; }
.dark-mode .status-en_revision { background: rgba(255, 243, 205, 0.2); color: #ffc107; }
.dark-mode .status-autorizada { background: rgba(212, 237, 218, 0.2); color: #28a745; }
.dark-mode .status-rechazada { background: rgba(248, 215, 218, 0.2); color: #dc3545; }
.dark-mode .status-en_compras { background: rgba(209, 236, 241, 0.2); color: #17a2b8; }
.dark-mode .status-atendida { background: rgba(195, 230, 203, 0.2); color: #28a745; }
.dark-mode .status-cancelada { background: rgba(245, 198, 203, 0.2); color: #dc3545; }
.dark-mode .status-cerrada { background: rgba(214, 216, 219, 0.2); color: #6c757d; }

/* Estados de Órdenes de Compra */
.status-enviada { background: #cce5ff; color: #004085; }
.status-confirmada { background: #d4edda; color: #155724; }
.status-parcialmente_recibida { background: #fff3cd; color: #856404; }
.status-recibida { background: #d1ecf1; color: #0c5460; }

.dark-mode .status-enviada { background: rgba(204, 229, 255, 0.2); color: #66b0ff; }
.dark-mode .status-confirmada { background: rgba(212, 237, 218, 0.2); color: #28a745; }
.dark-mode .status-parcialmente_recibida { background: rgba(255, 243, 205, 0.2); color: #ffc107; }
.dark-mode .status-recibida { background: rgba(209, 236, 241, 0.2); color: #17a2b8; }

/* Badges de Prioridad */
.badge-prioridad {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    display: inline-block;
}

.badge-normal { background: #e9ecef; color: #495057; }
.badge-alta { background: #fff3cd; color: #856404; }
.badge-urgente { background: #f8d7da; color: #721c24; }

.dark-mode .badge-normal { background: rgba(233, 236, 239, 0.2); color: #adb5bd; }
.dark-mode .badge-alta { background: rgba(255, 243, 205, 0.2); color: #ffc107; }
.dark-mode .badge-urgente { background: rgba(248, 215, 218, 0.2); color: #dc3545; }

/* Estados de Cotizaciones */
.status-seleccionada { background: #d4edda; color: #155724; }
.status-descartada { background: #f8d7da; color: #721c24; }

.dark-mode .status-seleccionada { background: rgba(212, 237, 218, 0.2); color: #28a745; }
.dark-mode .status-descartada { background: rgba(248, 215, 218, 0.2); color: #dc3545; }

/* Estados de Recepciones */
.status-completa { background: #d4edda; color: #155724; }
.status-parcial { background: #fff3cd; color: #856404; }
.status-con_diferencias { background: #f8d7da; color: #721c24; }

.dark-mode .status-completa { background: rgba(212, 237, 218, 0.2); color: #28a745; }
.dark-mode .status-parcial { background: rgba(255, 243, 205, 0.2); color: #ffc107; }
.dark-mode .status-con_diferencias { background: rgba(248, 215, 218, 0.2); color: #dc3545; }

/* Estados de Facturas de Proveedor */
.status-match-validado { background: #d4edda; color: #155724; }
.status-match-diferencias { background: #fff3cd; color: #856404; }
.status-pago-pendiente { background: #fff3cd; color: #856404; }
.status-pago-pagado { background: #d4edda; color: #155724; }
.status-pago-cancelado { background: #f8d7da; color: #721c24; }

.dark-mode .status-match-validado { background: rgba(212, 237, 218, 0.2); color: #28a745; }
.dark-mode .status-match-diferencias { background: rgba(255, 243, 205, 0.2); color: #ffc107; }
.dark-mode .status-pago-pendiente { background: rgba(255, 243, 205, 0.2); color: #ffc107; }
.dark-mode .status-pago-pagado { background: rgba(212, 237, 218, 0.2); color: #28a745; }
.dark-mode .status-pago-cancelado { background: rgba(248, 215, 218, 0.2); color: #dc3545; }

/* Timeline de Flujo de Compras */
.compras-timeline {
    position: relative;
    padding: 20px 0;
}

.compras-timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-left: 70px;
    margin-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 22px;
    top: 5px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--secondary);
    border: 3px solid var(--bg-card);
    box-shadow: 0 0 0 2px var(--secondary);
}

.timeline-item.completed::before {
    background: var(--success);
    box-shadow: 0 0 0 2px var(--success);
}

.timeline-item.pending::before {
    background: #ccc;
    box-shadow: 0 0 0 2px #ccc;
}

.timeline-content {
    background: var(--bg-card);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.timeline-content h4 {
    margin: 0 0 5px 0;
    color: var(--primary);
    font-size: 1rem;
}

.timeline-content p {
    margin: 0;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.timeline-date {
    font-size: 0.8rem;
    color: #95a5a6;
    margin-top: 5px;
}

/* Cards de Cotizaciones */
.cotizacion-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.cotizacion-card:hover {
    border-color: var(--secondary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.cotizacion-card.selected {
    border-color: var(--success);
    background: rgba(39, 174, 96, 0.05);
}

.cotizacion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.cotizacion-proveedor {
    font-weight: 600;
    color: var(--primary);
    font-size: 1.1rem;
}

.cotizacion-total {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--success);
}

.cotizacion-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.cotizacion-detail-item {
    display: flex;
    flex-direction: column;
}

.cotizacion-detail-item label {
    font-size: 0.8rem;
    color: #7f8c8d;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.cotizacion-detail-item span {
    font-size: 0.95rem;
    color: var(--text-color);
    font-weight: 500;
}

/* Tabla Comparativa de Proveedores */
.comparativo-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.comparativo-table th {
    background: var(--primary);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

.comparativo-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.comparativo-table tr:hover {
    background: rgba(52, 152, 219, 0.05);
}

.comparativo-table .best-price {
    background: rgba(39, 174, 96, 0.1);
    color: var(--success);
    font-weight: bold;
}

.comparativo-table .winner {
    background: rgba(39, 174, 96, 0.15);
    border-left: 4px solid var(--success);
}

/* Evaluación de Proveedores */
.evaluacion-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.evaluacion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.evaluacion-proveedor {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
}

.evaluacion-score {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary);
}

.evaluacion-criteria {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.evaluacion-criterion {
    display: flex;
    flex-direction: column;
}

.evaluacion-criterion label {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.evaluacion-criterion input[type="range"] {
    width: 100%;
    margin: 5px 0;
}

.evaluacion-criterion .score-display {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    text-align: center;
}

/* Dashboard de Compras */
.compras-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.compra-stat-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid var(--secondary);
    transition: transform 0.3s;
}

.compra-stat-card:hover {
    transform: translateY(-3px);
}

.compra-stat-card h3 {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #7f8c8d;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.compra-stat-card .value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

.compra-stat-card.urgent {
    border-left-color: var(--danger);
}

.compra-stat-card.pending {
    border-left-color: var(--warning);
}

.compra-stat-card.completed {
    border-left-color: var(--success);
}

/* Responsive */
@media (max-width: 768px) {
    .compras-timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        padding-left: 50px;
    }
    
    .timeline-item::before {
        left: 12px;
    }
    
    .cotizacion-details {
        grid-template-columns: 1fr;
    }
    
    .comparativo-table {
        font-size: 0.85rem;
    }
    
    .comparativo-table th,
    .comparativo-table td {
        padding: 8px;
    }
    
    .evaluacion-criteria {
        grid-template-columns: 1fr;
    }
    
    .compras-stats {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   COMPRAS - SOLICITUDES ESPECÍFICAS
   ======================================== */
   .producto-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 2fr auto;
    gap: 10px;
    margin-bottom: 10px;
    align-items: end;
}

@media (max-width: 768px) {
    .producto-row {
        grid-template-columns: 1fr;
    }
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}