/* ==========================================================================
   Home Asistencias - Mobile-First Responsive System Design & CSS Variables
   Optimizado para Smartphones y Dispositivos Móviles
   ========================================================================== */

:root {
    /* Colors - Light Theme */
    --bg-body: #f4f6f9;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-header: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-sidebar: #64748b;
    --text-sidebar-active: #2563eb;
    --bg-sidebar-active: #eff6ff;
    --text-brand: #0f172a;
    --border-color: #e2e8f0;
    --border-sidebar: #e2e8f0;
    
    /* Primary Brand Colors */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    
    /* Status Badges & Buttons */
    --success: #10b981;
    --success-hover: #059669;
    --success-light: #ecfdf5;
    
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-light: #fef2f2;
    
    --warning: #f59e0b;
    --warning-hover: #d97706;
    --warning-light: #fffbe6;
    
    --info: #06b6d4;
    --info-hover: #0891b2;
    --info-light: #ecfeff;
    
    /* Box Shadows & Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    /* Colors - Dark Theme */
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar: #1e293b;
    --bg-header: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-sidebar: #94a3b8;
    --text-sidebar-active: #38bdf8;
    --bg-sidebar-active: rgba(56, 189, 248, 0.12);
    --text-brand: #ffffff;
    --border-color: #334155;
    --border-sidebar: #334155;
    
    --primary-light: rgba(37, 99, 235, 0.15);
    --success-light: rgba(16, 185, 129, 0.15);
    --danger-light: rgba(239, 68, 68, 0.15);
    --warning-light: rgba(245, 158, 11, 0.15);
    --info-light: rgba(6, 182, 212, 0.15);
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Layout App Container */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar Backdrop Overlay for Mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    display: block;
}

/* Sidebar */
.app-sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.3s ease, left 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
    border-right: 1px solid var(--border-sidebar);
    z-index: 999;
}

.sidebar-header {
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-sidebar);
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
}

.brand-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-brand);
    letter-spacing: -0.3px;
    white-space: nowrap;
}

.header-sidebar-toggle {
    display: inline-flex;
}

.mobile-close-btn {
    display: none;
}

.sidebar-menu {
    padding: 16px 12px;
    list-style: none;
    flex-grow: 1;
    overflow-y: auto;
}

.menu-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 12px 12px 6px 12px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.menu-item {
    margin-bottom: 4px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: var(--text-sidebar);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.menu-link:hover, .menu-link.active {
    background-color: var(--bg-sidebar-active);
    color: var(--text-sidebar-active);
    font-weight: 600;
}

.menu-link i {
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* SIDEBAR COLAPSADO / OCULTO EN ESCRITORIO (Solo muestra Iconos) */
.app-sidebar.collapsed {
    width: 72px;
}

.app-sidebar.collapsed .brand-info,
.app-sidebar.collapsed .menu-label,
.app-sidebar.collapsed .menu-link span {
    display: none !important;
}

.app-sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 16px 8px;
}

.app-sidebar.collapsed .brand-wrapper {
    gap: 0;
}

.app-sidebar.collapsed .menu-link {
    justify-content: center;
    padding: 12px 0;
    border-radius: var(--radius-md);
}

.app-sidebar.collapsed .menu-link i {
    font-size: 1.5rem;
}

/* Main Content Area */
.app-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    min-width: 0;
}

/* Header Navbar */
.app-header {
    height: 64px;
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.6rem;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
}

.mobile-menu-btn:hover {
    background-color: var(--primary-light);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-icon {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background-color: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

/* Page Body Content */
.content-wrapper {
    padding: 24px;
    flex-grow: 1;
    padding-bottom: 90px;
}

.page-header {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
}

.page-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Cards & Widgets */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 20px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 600;
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-icon.primary { background-color: var(--primary-light); color: var(--primary); }
.stat-icon.success { background-color: var(--success-light); color: var(--success); }
.stat-icon.warning { background-color: var(--warning-light); color: var(--warning); }
.stat-icon.danger { background-color: var(--danger-light); color: var(--danger); }

.stat-value {
    font-size: 1.35rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Data Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.table th {
    background-color: var(--bg-body);
    color: var(--text-muted);
    font-weight: 600;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
}

.table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: var(--primary-light);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success { background-color: var(--success-light); color: var(--success); }
.badge-danger { background-color: var(--danger-light); color: var(--danger); }
.badge-warning { background-color: var(--warning-light); color: var(--warning); }
.badge-info { background-color: var(--info-light); color: var(--info); }

/* Buttons & Inputs */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    min-height: 44px;
}

.btn-primary { background-color: var(--primary); color: #ffffff; }
.btn-primary:hover { background-color: var(--primary-hover); }

.btn-success { background-color: var(--success); color: #ffffff; }
.btn-success:hover { background-color: var(--success-hover); }

.btn-danger { background-color: var(--danger); color: #ffffff; }
.btn-danger:hover { background-color: var(--danger-hover); }

.btn-secondary { background-color: transparent; border-color: var(--border-color); color: var(--text-main); }
.btn-secondary:hover { background-color: var(--bg-body); }

.btn-info {
    background-color: #e0f2fe;
    color: #0284c7;
    border-color: #bae6fd;
}
.btn-info:hover {
    background-color: #bae6fd;
    color: #0369a1;
    border-color: #7dd3fc;
}

[data-theme="dark"] .btn-info {
    background-color: rgba(2, 132, 199, 0.2);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.3);
}
[data-theme="dark"] .btn-info:hover {
    background-color: rgba(2, 132, 199, 0.35);
    color: #7dd3fc;
    border-color: rgba(56, 189, 248, 0.5);
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.form-control, .form-select {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-card);
    color: var(--text-main);
    min-height: 44px;
    transition: border-color 0.2s ease, background-color 0.3s ease, color 0.3s ease;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Fast Attendance Custom Component */
.attendance-actions-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    background-color: var(--bg-body);
    padding: 14px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
    align-items: center;
    justify-content: space-between;
}

.attendance-toggle-btn {
    border: 2px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-muted);
    border-radius: var(--radius-md);
    width: 46px;
    height: 46px;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.attendance-toggle-btn.presente.active {
    background-color: var(--success);
    color: #ffffff;
    border-color: var(--success);
    box-shadow: 0 0 0 3px var(--success-light);
}

.attendance-toggle-btn.falta.active {
    background-color: var(--danger);
    color: #ffffff;
    border-color: var(--danger);
    box-shadow: 0 0 0 3px var(--danger-light);
}

.attendance-toggle-btn.retardo.active {
    background-color: var(--warning);
    color: #ffffff;
    border-color: var(--warning);
    box-shadow: 0 0 0 3px var(--warning-light);
}

.attendance-toggle-btn.justificado.active {
    background-color: var(--info);
    color: #ffffff;
    border-color: var(--info);
    box-shadow: 0 0 0 3px var(--info-light);
}

/* Compact Layout for Attendance Roster */
.desktop-table-view.card {
    padding: 4px 8px;
    margin-bottom: 8px;
}

.desktop-table-view .table th {
    padding: 5px 8px;
    font-size: 0.7rem;
}

.desktop-table-view .table td {
    padding: 2px 6px;
    font-size: 0.82rem;
}

.desktop-table-view .attendance-toggle-btn {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
}

.desktop-table-view .form-control {
    min-height: 26px;
    height: 26px;
    padding: 2px 6px;
    font-size: 0.8rem;
}

/* Mobile Student Attendance Card */
.student-card-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.student-attendance-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.2s ease, background-color 0.3s ease;
}

.student-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.student-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-main);
    line-height: 1.3;
}

.student-code {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: monospace;
}

.student-buttons-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.student-buttons-row .attendance-toggle-btn {
    width: 100%;
    height: 38px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
}

.student-buttons-row .attendance-toggle-btn i {
    font-size: 1.15rem;
}

.attendance-toggle-btn.nota {
    background-color: var(--bg-body);
    border-color: var(--border-color);
    color: var(--text-muted);
}

.attendance-toggle-btn.nota:hover {
    background-color: var(--bg-card-hover);
    color: var(--primary);
    border-color: var(--primary);
}

.attendance-toggle-btn.nota.has-note {
    background-color: var(--primary-light, rgba(37, 99, 235, 0.12));
    border-color: var(--primary);
    color: var(--primary);
    position: relative;
    font-weight: 800;
}

.attendance-toggle-btn.nota.has-note::after {
    content: '';
    position: absolute;
    top: 3px;
    right: 3px;
    width: 7px;
    height: 7px;
    background-color: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--bg-card);
}

/* Sticky Mobile Save Footer Bar (Oculto en escritorio, visible solo en pantallas móviles < 769px) */
.sticky-mobile-save-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 10px 14px;
    z-index: 90;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* Modal Visor PDF (Ancho 95% y Alto 95%) */
.pdf-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.pdf-modal-overlay.active {
    display: flex;
}

.pdf-modal-container {
    width: 95vw;
    height: 95vh;
    max-width: 1400px;
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.pdf-modal-header {
    height: 52px;
    background-color: var(--bg-sidebar);
    color: var(--text-brand);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
}

.pdf-modal-title {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pdf-modal-body {
    flex-grow: 1;
    width: 100%;
    height: calc(100% - 52px);
    background-color: #525659;
}

.pdf-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Alert Notification */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success { background-color: var(--success-light); color: var(--success); border: 1px solid var(--success); }
.alert-danger { background-color: var(--danger-light); color: var(--danger); border: 1px solid var(--danger); }
.alert-warning { background-color: var(--warning-light); color: var(--warning); border: 1px solid var(--warning); }
.alert-info { background-color: var(--info-light); color: var(--info); border: 1px solid var(--info); }

/* Media Queries Responsivas (Optimizadas para Celulares / Smartphones / Poco X5 Pro) */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: inline-flex;
    }

    .mobile-close-btn {
        display: inline-flex;
    }

    .header-sidebar-toggle {
        display: none !important;
    }

    .app-sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        bottom: 0;
        width: 270px;
        height: 100vh;
        box-shadow: var(--shadow-lg);
    }

    .app-sidebar.active {
        left: 0;
    }

    .app-header {
        padding: 0 14px;
        height: 58px;
    }

    .user-badge div div:first-child {
        font-size: 0.82rem;
    }

    .user-badge div div:last-child {
        display: none;
    }

    .content-wrapper {
        padding: 12px;
        padding-bottom: 95px;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px;
    }

    .page-header > div {
        width: 100%;
    }

    .page-header .btn {
        width: 100%;
        justify-content: center;
    }

    .page-title {
        font-size: 1.2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    /* Formularios de filtro en tarjetas */
    .card form {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .card form > div {
        width: 100% !important;
        min-width: 100% !important;
    }

    .card form .btn {
        width: 100%;
        justify-content: center;
    }

    .desktop-table-view {
        display: none !important;
    }

    .desktop-action-buttons {
        display: none !important;
    }

    .mobile-cards-view {
        display: flex !important;
    }

    .sticky-mobile-save-bar {
        display: flex !important;
    }

    .pdf-modal-container {
        width: 98vw;
        height: 98vh;
    }

    .modal-container {
        width: 96vw !important;
        max-height: 94vh !important;
        margin: 0 auto;
    }

    .modal-footer {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .modal-footer > div {
        width: 100% !important;
    }

    .modal-footer .btn {
        width: 100% !important;
        justify-content: center !important;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) {
    .desktop-table-view {
        display: block !important;
    }

    .mobile-cards-view {
        display: none !important;
    }

    .sticky-mobile-save-bar {
        display: none !important;
    }
}

/* ==========================================
   MODAL DE IMPORTACIÓN DE ALUMNOS (PDF / OCR)
   ========================================== */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.65);
    z-index: 1500;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(4px);
    transition: opacity 0.3s ease;
}

.modal-backdrop.active {
    display: flex;
}

.modal-container {
    width: 100%;
    max-width: 960px;
    max-height: 90vh;
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-color);
    animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-body);
}

.modal-title-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-title-wrapper i {
    font-size: 1.5rem;
    color: var(--primary);
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    color: var(--danger);
    background-color: var(--danger-light);
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-body);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* PDF Dropzone */
.pdf-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 28px 20px;
    text-align: center;
    background-color: var(--bg-body);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
}

.pdf-dropzone:hover, .pdf-dropzone.dragover {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.pdf-dropzone i {
    font-size: 2.5rem;
    color: var(--primary);
}

.pdf-dropzone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Modal Interactive Preview Table */
.import-table-wrapper {
    max-height: 380px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.table-import-preview {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.table-import-preview th {
    position: sticky;
    top: 0;
    background-color: var(--bg-body);
    z-index: 5;
    padding: 10px 12px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.72rem;
}

.table-import-preview td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.cell-editable-input {
    width: 100%;
    padding: 6px 10px;
    font-size: 0.88rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background-color: transparent;
    color: var(--text-main);
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.cell-editable-input:hover {
    border-color: var(--border-color);
    background-color: var(--bg-card);
}

.cell-editable-input:focus {
    outline: none;
    border-color: var(--primary);
    background-color: var(--bg-card);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.cell-editable-input.is-invalid {
    border-color: var(--danger) !important;
    background-color: var(--danger-light) !important;
}

.action-bar-modal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

