/* style.css - VERSIÓN FINAL CON CORRECCIÓN BÚSQUEDA */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #02188b;
    --primary-hover: #1e3a8a;
    --primary-light: #eff6ff;
    --accent-orange: #f59e0b;
    --accent-purple: #7c3aed;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --success: #10b981;
    --danger: #ef4444;
    --sidebar-width: 270px;
    --header-height: 80px;
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-card: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', system-ui, -apple-system, sans-serif; }
body { background-color: var(--bg-body); color: var(--text-main); line-height: 1.5; -webkit-font-smoothing: antialiased; }
.container { display: flex; min-height: 100vh; }

#sidebar { width: var(--sidebar-width); background: var(--primary-color); display: flex; flex-direction: column; position: fixed; height: 100vh; transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1); z-index: 1000; color: white; box-shadow: 4px 0 20px rgba(2, 24, 139, 0.15); }
#sidebar.collapsed { width: 88px; }
#sidebar.collapsed .logo span, #sidebar.collapsed .menu-text, #sidebar.collapsed .user-info { opacity: 0; pointer-events: none; display: none; }
#sidebar.collapsed .sidebar-header { justify-content: center; padding: 0; }
#sidebar.collapsed .close-sidebar-mobile { display: none; }
.sidebar-header { height: var(--header-height); display: flex; align-items: center; padding: 0 30px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.logo { font-size: 1.15rem; font-weight: 700; color: white; display: flex; align-items: center; gap: 12px; letter-spacing: -0.5px; }
.logo i { font-size: 1.6rem; color: var(--accent-orange); filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.4)); }
.menu { list-style: none; padding: 25px 0; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.menu li a { display: flex; align-items: center; padding: 14px 30px; color: rgba(255, 255, 255, 0.75); text-decoration: none; transition: all 0.3s ease; font-weight: 500; font-size: 0.95rem; gap: 16px; border-left: 4px solid transparent; }
.menu li a:hover { background: rgba(255, 255, 255, 0.08); color: white; padding-left: 34px; }
.menu li a.active { background: linear-gradient(90deg, rgba(255,255,255,0.1) 0%, transparent 100%); color: white; border-left: 4px solid var(--accent-orange); }
.menu li a i { width: 24px; text-align: center; font-size: 1.1rem; }
.user-profile { padding: 25px 30px; border-top: 1px solid rgba(255, 255, 255, 0.08); display: flex; align-items: center; gap: 15px; background: rgba(0,0,0,0.1); }
.avatar { width: 44px; height: 44px; background: white; color: var(--primary-color); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1rem; box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
.user-info { display: flex; flex-direction: column; } .user-name { font-weight: 600; font-size: 0.95rem; color: white; } .user-info small { color: #94a3b8; font-size: 0.8rem; }

.main-content { flex: 1; margin-left: var(--sidebar-width); padding: 35px 45px; transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column; min-height: 100vh; width: calc(100% - var(--sidebar-width)); }
#sidebar.collapsed + .main-content { margin-left: 88px; width: calc(100% - 88px); }

.top-bar { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; margin-bottom: 40px; gap: 20px; }
#toggleSidebarBtn { justify-self: start; background: none; border: none; font-size: 1.4rem; color: var(--text-muted); cursor: pointer; transition: color 0.2s; padding: 5px; }
#toggleSidebarBtn:hover { color: var(--primary-color); }
.top-bar h1 { justify-self: start; font-size: 2rem; color: var(--text-main); font-weight: 700; letter-spacing: -0.5px; margin: 0; text-align: left; }
.date-display { justify-self: end; color: var(--text-muted); font-weight: 500; background: var(--bg-card); padding: 10px 20px; border-radius: 30px; border: 1px solid #e2e8f0; font-size: 0.9rem; display: flex; align-items: center; gap: 8px; white-space: nowrap; }

.dashboard-grid { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 25px; margin-bottom: 35px; }
.stat-card { background: var(--bg-card); padding: 30px 25px; border-radius: var(--radius); box-shadow: var(--shadow-card); border: 1px solid rgba(0,0,0,0.02); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 15px; transition: transform 0.3s ease; }
.stat-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.08); }
.stat-icon { width: 64px; height: 64px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 1.6rem; color: white; flex-shrink: 0; box-shadow: 0 8px 15px rgba(0,0,0,0.1); margin-bottom: 5px; }
.stat-info p { font-size: 2.5rem; font-weight: 800; color: var(--text-main); line-height: 1; letter-spacing: -1px; }
.stat-info h3 { font-size: 0.9rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.card-blue .stat-icon { background: linear-gradient(145deg, #4f46e5, var(--primary-color)); }
.card-green .stat-icon { background: linear-gradient(145deg, #34d399, #059669); }
.card-orange .stat-icon { background: linear-gradient(145deg, #fbbf24, #d97706); }

.controls-panel { width: 100%; background: var(--bg-card); padding: 25px; border-radius: var(--radius); box-shadow: var(--shadow-soft); border: 1px solid #f1f5f9; display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 20px; margin-bottom: 25px; }
input, select, textarea { font-family: 'Inter', sans-serif; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 0.95rem; color: var(--text-main); background-color: #f8fafc; outline: none; transition: 0.2s; }
input:focus, select:focus, textarea:focus { border-color: var(--primary-color); background-color: #fff; box-shadow: 0 0 0 3px rgba(2, 24, 139, 0.1); }
.controls-panel input, .controls-panel select { padding: 0 12px; height: 42px; width: auto; }
.search-box { position: relative; flex: 1; min-width: 280px; } 
.search-box i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 1rem; z-index: 10; pointer-events: none; } 
/* CORRECCIÓN: Agregar padding-right para la X */
.search-box input { width: 100%; padding-left: 45px !important; padding-right: 40px !important; height: 42px; }

/* NUEVO: ESTILOS BOTÓN BORRAR BÚSQUEDA */
#clearSearchBtn { 
    pointer-events: auto !important; 
    right: 15px; 
    left: auto !important; 
    cursor: pointer; 
    padding: 5px; 
    transition: all 0.2s ease;
}
#clearSearchBtn:hover { 
    color: var(--danger); 
    transform: translateY(-50%) scale(1.1); 
}

.filters-group { display: flex; gap: 15px; flex-wrap: wrap; } .filter-item { display: flex; flex-direction: column; gap: 6px; } 
.filter-item label { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; } .filter-item select { min-width: 160px; cursor: pointer; }
.btn-primary { background: var(--primary-color); color: white; border: none; padding: 0 24px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 0.95rem; display: flex; align-items: center; gap: 10px; height: 42px; transition: all 0.2s; } 
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }

.table-container { width: 100%; background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow-card); overflow-x: auto; border: 1px solid #f1f5f9; }
table { width: 100%; min-width: 1000px; border-collapse: collapse; table-layout: fixed; }
thead { background: #f8fafc; border-bottom: 2px solid #e2e8f0; }
th { padding: 18px 20px; text-align: left; font-weight: 600; color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; position: sticky; top: 0; z-index: 10; background: #f8fafc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
th.sortable { cursor: pointer; } th.sortable:hover { color: var(--primary-color); }
td { padding: 16px 20px; border-bottom: 1px solid #f1f5f9; color: var(--text-main); font-size: 0.9rem; vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.name-wrapper { display: flex; align-items: center; gap: 12px; }
.action-btn { width: 32px; height: 32px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); margin-right: 4px; cursor: pointer; transition: all 0.2s; } .action-btn:hover { background: var(--primary-light); color: var(--primary-color); }

.pagination-container { display: flex; justify-content: center; align-items: center; margin-top: 25px; margin-bottom: 20px; gap: 8px; width: 100%; }
.page-btn { background: white; border: 1px solid #e2e8f0; color: var(--text-main); min-width: 38px; height: 38px; border-radius: 8px; cursor: pointer; font-weight: 600; display: flex; align-items: center; justify-content: center; transition: all 0.2s; } 
.page-btn:hover:not(:disabled) { border-color: var(--primary-color); color: var(--primary-color); } .page-btn.active { background: var(--primary-color); color: white; border-color: var(--primary-color); }
.main-footer { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; width: 100%; margin-top: auto; padding: 30px 0 10px 0; border-top: 1px solid #e2e8f0; color: var(--text-muted); font-size: 0.9rem; }
.footer-left { justify-self: start; display: flex; gap: 10px; font-weight: 500; } .footer-center { justify-self: center; text-align: center; } .footer-right { justify-self: end; display: flex; align-items: center; gap: 8px; font-size: 0.8rem; background: #f1f5f9; padding: 5px 12px; border-radius: 20px; }
.system-name { color: var(--primary-color); font-weight: 700; } .slogan { font-weight: 700; font-style: italic; background: linear-gradient(90deg, var(--primary-color), var(--accent-purple)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; } .heartbeat { color: var(--accent-orange) !important; -webkit-text-fill-color: var(--accent-orange); animation: beat 1.5s infinite; } @keyframes beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.2); } }
.status-dot { width: 10px; height: 10px; background-color: var(--success); border-radius: 50%; box-shadow: 0 0 0 2px #bbf7d0; display: inline-block; }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(8px); display: none; justify-content: center; align-items: center; z-index: 2000; opacity: 0; transition: opacity 0.3s ease; }
.modal-overlay.active { display: flex; opacity: 1; }
.modal-container { background: #ffffff; width: 95%; max-width: 680px; border-radius: 24px; box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.3); display: flex; flex-direction: column; max-height: 90vh; transform: scale(0.95) translateY(10px); transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); border: 1px solid rgba(255, 255, 255, 0.5); overflow: hidden; }
.modal-overlay.active .modal-container { transform: scale(1) translateY(0); }
.modal-header { padding: 25px 35px; background: #fff; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #f1f5f9; }
.modal-header h2 { font-size: 1.4rem; font-weight: 700; color: var(--text-main); letter-spacing: -0.5px; margin: 0; }
.modal-header h2 i { margin-right: 12px; color: var(--primary-color); opacity: 0.8; }
.close-modal { background: #f8fafc; border: 1px solid #e2e8f0; width: 36px; height: 36px; border-radius: 50%; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; }
.close-modal:hover { background: #fee2e2; color: #ef4444; border-color: #fecaca; transform: rotate(90deg); }
.modal-body { padding: 35px; overflow-y: auto; background: #ffffff; }
.modal-body::-webkit-scrollbar { width: 6px; } .modal-body::-webkit-scrollbar-track { background: transparent; } .modal-body::-webkit-scrollbar-thumb { background-color: #cbd5e1; border-radius: 10px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; } .form-group.full-width { grid-column: span 2; }
.form-group label { display: block; margin-bottom: 8px; font-size: 0.75rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; }
.modal-body input:not([type="checkbox"]), .modal-body select, .modal-body textarea { width: 100%; background-color: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px 16px; font-size: 0.95rem; height: auto; color: #1e293b; transition: all 0.3s ease; }
.modal-body input:focus, .modal-body select:focus, .modal-body textarea:focus { background-color: #ffffff; border-color: var(--primary-color); box-shadow: 0 0 0 4px rgba(2, 24, 139, 0.08); transform: translateY(-1px); }
textarea { resize: vertical; min-height: 80px; }
.checkbox-group { background: #f0fdf4; border: 1px solid #bbf7d0; padding: 16px; border-radius: 12px; display: flex; align-items: center; gap: 12px; cursor: pointer; transition: 0.2s; } .checkbox-group:hover { background: #dcfce7; }
.checkbox-group input { width: 20px; height: 20px; accent-color: var(--success); } .checkbox-group label { margin: 0; text-transform: none; color: #166534; font-size: 0.9rem; cursor: pointer;}
.modal-footer { padding: 25px 35px; background: #fff; border-top: 1px solid #f1f5f9; display: flex; justify-content: flex-end; gap: 12px; }
.btn-cancel { background: #fff; color: #64748b; border: 1px solid #cbd5e1; padding: 12px 24px; border-radius: 10px; font-weight: 600; cursor: pointer; transition: all 0.2s; } .btn-cancel:hover { background: #f1f5f9; color: #334155; }
.btn-save { background: linear-gradient(135deg, var(--primary-color), #2563eb); color: white; border: none; padding: 12px 30px; border-radius: 10px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3); transition: all 0.2s; } .btn-save:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(37, 99, 235, 0.4); }

.config-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.config-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 25px; text-align: center; transition: all 0.3s ease; position: relative; overflow: hidden; }
.config-card:hover { border-color: var(--primary-color); box-shadow: 0 10px 30px -10px rgba(0,0,0,0.1); transform: translateY(-3px); }
.config-icon-circle { width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 15px auto; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.config-card h4 { font-size: 1.1rem; margin-bottom: 8px; font-weight: 700; color: #1e293b; } .config-card p { font-size: 0.85rem; color: #64748b; margin-bottom: 20px; line-height: 1.4; }
.card-safe .config-icon-circle { background: #eff6ff; color: #2563eb; } .btn-action-safe { background: #2563eb; color: white; width: 100%; padding: 10px; border-radius: 8px; border: none; font-weight: 600; cursor: pointer; }
.card-excel .config-icon-circle { background: #f0fdf4; color: #16a34a; } .btn-action-excel { background: #16a34a; color: white; border: none; padding: 10px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.card-warning .config-icon-circle { background: #fffbeb; color: #d97706; } .btn-action-warning { background: #fff; border: 2px solid #d97706; color: #d97706; width: 100%; padding: 10px; border-radius: 8px; font-weight: 700; cursor: pointer; } .btn-action-warning:hover { background: #d97706; color: white; }
.card-danger { border-color: #fecaca; background: #fffafa; } .card-danger .config-icon-circle { background: #fee2e2; color: #dc2626; } .btn-action-danger { background: #dc2626; color: white; width: 100%; padding: 10px; border-radius: 8px; border: none; font-weight: 600; cursor: pointer; box-shadow: 0 4px 10px rgba(220, 38, 38, 0.2); } .btn-action-danger:hover { background: #b91c1c; }
.card-excel .config-icon-circle { background: #f0fdf4; color: #16a34a; } .btn-action-excel { background: #16a34a; color: white; border: none; padding: 10px; border-radius: 8px; cursor: pointer; font-weight: 600; }

.print-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px; padding: 10px 0; }
.print-option { display: flex; align-items: center; background: #f8fafc; border: 1px solid #e2e8f0; padding: 12px; border-radius: 8px; cursor: pointer; transition: all 0.2s; }
.print-option:hover { background: #eff6ff; border-color: var(--primary-color); }
.print-option input { margin-right: 10px; width: 18px; height: 18px; cursor: pointer; }
.print-option label { cursor: pointer; font-size: 0.9rem; font-weight: 500; color: var(--text-main); user-select: none; }
.print-actions-top { display: flex; justify-content: space-between; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid #eee; }
.link-action { color: var(--primary-color); text-decoration: underline; cursor: pointer; font-size: 0.85rem; font-weight: 600; }

.tabs-header { display: flex; border-bottom: 1px solid #e2e8f0; margin-bottom: 25px; }
.tab-link { flex: 1; padding: 15px; background: none; border: none; border-bottom: 3px solid transparent; font-size: 0.95rem; font-weight: 600; color: #94a3b8; cursor: pointer; transition: all 0.3s ease; text-transform: uppercase; letter-spacing: 0.5px; }
.tab-link:hover { color: var(--primary-color); background-color: #f8fafc; } .tab-link.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }
.tab-content { display: none; animation: fadeInTab 0.3s ease-out; } .tab-content.active { display: block; }
@keyframes fadeInTab { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.user-form-panel { background: #f8fafc; padding: 25px; border-radius: 16px; border: 1px solid #e2e8f0; max-width: 400px; margin: 0 auto; }
.user-list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 15px; max-height: 400px; overflow-y: auto; padding: 5px; }
.user-card-item { display: flex; align-items: center; background: #fff; border: 1px solid #e2e8f0; padding: 15px; border-radius: 12px; transition: all 0.2s; box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
.user-card-item:hover { border-color: var(--primary-color); box-shadow: 0 5px 15px rgba(0,0,0,0.08); transform: translateY(-2px); }
.user-avatar-small { width: 42px; height: 42px; background: #eff6ff; color: var(--primary-color); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1rem; margin-right: 15px; }
.user-details h5 { margin: 0; font-size: 1rem; color: var(--text-main); font-weight: 600; }
.role-badge { font-size: 0.7rem; padding: 3px 8px; border-radius: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.role-admin { background: #fee2e2; color: #991b1b; } .role-oficina { background: #dbeafe; color: #1e40af; }
.btn-delete-user { background: none; border: none; color: #cbd5e1; cursor: pointer; font-size: 1.1rem; padding: 5px; transition: color 0.2s; } .btn-delete-user:hover { color: var(--danger); }

.sidebar-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 2000; display: none; backdrop-filter: blur(2px); }
.sidebar-overlay.active { display: block; }
.close-sidebar-mobile { display: none; background: none; border: none; color: rgba(255,255,255,0.7); font-size: 1.5rem; cursor: pointer; margin-left: auto; }
@media (max-width: 992px) {
    #sidebar { transform: translateX(-100%); position: fixed; z-index: 3000 !important; box-shadow: 10px 0 30px rgba(0,0,0,0.5); height: 100vh; overflow-y: auto; }
    #sidebar.mobile-active { transform: translateX(0) !important; }
    .close-sidebar-mobile { display: block; }
    .main-content { margin-left: 0 !important; width: 100% !important; padding: 20px 15px; }
    .top-bar { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }
    #toggleSidebarBtn { margin-left: -5px; } .top-bar h1 { width: 100%; text-align: left; } .date-display { width: 100%; justify-content: center; background: #e2e8f0; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .controls-panel { flex-direction: column; align-items: stretch; }
    .controls-panel select, .controls-panel input { width: 100%; } 
    .filters-group { flex-direction: column; }
    .main-footer { display: flex; flex-direction: column; text-align: center; gap: 15px; }
    .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; } table { min-width: 900px; }
    .form-grid { grid-template-columns: 1fr; } .form-group.full-width { grid-column: span 1; }
    .config-grid { grid-template-columns: 1fr; }
    .modal-container { width: 95%; max-height: 90vh; }
    .modal-footer { flex-direction: column-reverse; } .btn-save, .btn-cancel { width: 100%; padding: 15px; }
}

/* --- ESTILOS MODAL DETALLES --- */
.detail-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 12px 15px;
    border-radius: 10px;
}

.detail-box label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.detail-box p {
    margin: 0;
    font-size: 1rem;
    color: var(--text-main);
    font-weight: 500;
}

/* Efecto hover en el avatar de la tabla */
.avatar-trigger {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.avatar-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 3px rgba(2, 24, 139, 0.2);
}
/* --- ESTILOS MODAL DETALLES PREMIUM --- */

/* Banner de Días Restantes */
.countdown-banner {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: var(--primary-color);
    padding: 15px;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
/* Variaciones del banner (se aplicarán con JS) */
.countdown-ok { background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%); color: #047857; } /* Verde: Falta tiempo */
.countdown-warn { background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); color: #b45309; } /* Amarillo: Hoy o < 7 días */
.countdown-danger { background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%); color: #b91c1c; } /* Rojo: Vencido */
.countdown-neutral { background: #f8fafc; color: #64748b; } /* Gris: Social/Egresado */

/* Grid de Información Limpia */
.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px; /* Espaciado generoso */
}

.info-group {
    display: flex;
    flex-direction: column;
}

.info-group.full {
    grid-column: span 2;
}

.info-group label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #94a3b8; /* Gris suave para etiquetas */
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-group label i {
    color: #cbd5e1; /* Iconos sutiles */
    font-size: 0.9rem;
}

.info-group p {
    font-size: 1rem;
    color: #1e293b; /* Texto oscuro y legible */
    font-weight: 500;
    margin: 0;
}

/* Línea separadora sutil */
.separator-line {
    grid-column: span 2;
    height: 1px;
    background-color: #f1f5f9;
    margin: 5px 0;
}

/* Hover en el avatar de la tabla */
.avatar-trigger {
    cursor: pointer;
    transition: all 0.2s ease;
}
.avatar-trigger:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}
/* FORZAR MAYÚSCULAS EN FORMULARIOS */
#formIngreso input[type="text"],
#formIngreso textarea {
    text-transform: uppercase;
}
/* --- SWITCH DE MODO DE IMPORTACIÓN (v4.5) --- */
.import-mode-container {
    margin-top: 15px;
    padding: 10px;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
}

.switch-wrapper {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.switch-wrapper input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

/* Cuando está activado (Modo Reemplazar - Rojo) */
input:checked + .slider {
    background-color: var(--danger);
}

input:checked + .slider:before {
    transform: translateX(18px);
}

/* Textos del modo */
.mode-label {
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    text-align: left;
}
.mode-label small {
    font-weight: 400;
    color: #64748b;
    font-size: 0.75rem;
}
/* --- FIN ESTILOS SWITCH DE MODO DE IMPORTACIÓN --- */


/* --- ESTILOS ADICIONALES PARA v4.6 --- */
/* --- PANEL DE CONFIGURACIÓN PREMIUM (v5.0) --- */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); /* Tarjetas más anchas */
    gap: 25px;
    padding: 10px;
}

.config-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.config-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
}

/* Bordes superiores de color */
.card-safe { border-top: 5px solid #3b82f6; }    /* Azul: Backup */
.card-excel { border-top: 5px solid #10b981; }   /* Verde: Excel */
.card-warn { border-top: 5px solid #f59e0b; }    /* Naranja: Restaurar */
.card-danger { border-top: 5px solid #ef4444; }  /* Rojo: Reset */

.card-header {
    padding: 25px 25px 15px 25px;
    text-align: center;
}

.icon-box {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 15px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    transition: 0.3s;
}

/* Colores de íconos */
.card-safe .icon-box { background: #eff6ff; color: #3b82f6; }
.card-excel .icon-box { background: #ecfdf5; color: #10b981; }
.card-warn .icon-box { background: #fffbeb; color: #f59e0b; }
.card-danger .icon-box { background: #fef2f2; color: #ef4444; }

.config-card h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

.config-card p {
    margin: 0;
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.5;
}

/* Área de acciones (Botones) */
.card-actions {
    background: #f8fafc;
    padding: 20px 25px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-config {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.2s;
}

.btn-blue { background: #3b82f6; color: white; } .btn-blue:hover { background: #2563eb; }
.btn-green { background: #10b981; color: white; } .btn-green:hover { background: #059669; }
.btn-orange { background: #fff; border: 1px solid #f59e0b; color: #f59e0b; } .btn-orange:hover { background: #fffbeb; }
.btn-red { background: #fee2e2; color: #ef4444; } .btn-red:hover { background: #ef4444; color: white; }
.btn-outline { background: white; border: 1px solid #cbd5e1; color: #475569; } .btn-outline:hover { background: #f1f5f9; border-color: #94a3b8; }

/* btn excel */
/* Nuevo botón para exportar */
.btn-purple { 
    background: #8b5cf6; 
    color: white; 
} 
.btn-purple:hover { 
    background: #7c3aed; 
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* --- SWITCH IMPORTACIÓN (Style iOS) --- */
.import-options {
    margin-bottom: 15px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.import-text {
    text-align: left;
    display: flex;
    flex-direction: column;
}
.import-text strong { font-size: 0.85rem; color: #1e293b; }
.import-text span { font-size: 0.75rem; color: #64748b; }

.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #cbd5e1; transition: .4s; border-radius: 34px; }
.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); }
input:checked + .slider { background-color: #ef4444; } /* Rojo al reemplazar */
input:checked + .slider:before { transform: translateX(20px); }

/* Input File invisible pero funcional */
.file-btn-wrapper { position: relative; width: 100%; overflow: hidden; }
.file-btn-wrapper input[type=file] { font-size: 100px; position: absolute; left: 0; top: 0; opacity: 0; cursor: pointer; height: 100%; width: 100%; }

/* --- FIN ESTILOS ADICIONALES v4.6 --- */

/* LOGIN */
/* =========================================
   ESTILOS DE PANTALLA DE LOGIN (v5.0)
   ========================================= */

/* Fondo general exclusivo para el body del login */
body.login-page {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e3a8a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Efecto de fondo (Círculos decorativos) */
body.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    top: -100px;
    right: -100px;
    z-index: 0;
}
body.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(245, 158, 11, 0.05); /* Naranja muy suave */
    border-radius: 50%;
    bottom: -50px;
    left: -50px;
    z-index: 0;
}

.login-card {
    background: #ffffff;
    width: 100%;
    max-width: 420px;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 1;
    text-align: center;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.login-logo {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    font-size: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px auto;
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.3);
}

.login-header h1 {
    font-size: 1.5rem;
    color: var(--text-main);
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 5px;
}

.login-form .input-group {
    margin-bottom: 20px;
    text-align: left;
}

.login-form label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.1rem;
    transition: 0.3s;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 15px 12px 45px; /* Espacio para icono */
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    color: #1e293b;
    transition: 0.3s;
    background: #f8fafc;
}

.input-wrapper input:focus {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(2, 24, 139, 0.1);
    outline: none;
}

.input-wrapper input:focus + i {
    color: var(--primary-color);
}

.btn-login {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-top: 10px;
}

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

.login-footer {
    margin-top: 25px;
    font-size: 0.85rem;
    color: #94a3b8;
}

.error-message {
    background: #fef2f2;
    color: #ef4444;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #fecaca;
    display: none; /* Oculto por defecto */
}