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

:root {
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-bg: #eef2ff;
    --success: #10b981;
    --success-bg: #d1fae5;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    --info: #06b6d4;
    --info-bg: #cffafe;
    --purple: #8b5cf6;
    --purple-bg: #ede9fe;
    --dark: #0f172a;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --sidebar-width: 260px;
    --header-h: 56px;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.08);
    --transition: 0.25s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #fff;
    color: var(--gray-700);
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
}

/* DashBoard Transition  */
a .dash-stat {
    transition: opacity 0.15s;
}
a .dash-stat:hover {
    opacity: 0.88;
}

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-400); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-500); border: 2px solid transparent; background-clip: padding-box; }

.wrapper { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0f172a 0%, #1a1f37 100%);
    color: #fff;
    position: fixed; top: 0; left: 0;
    height: 100vh; z-index: 1000;
    overflow-y: auto;
    transition: var(--transition);
    display: flex; flex-direction: column;
}

.sidebar-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.brand-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 17px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(79,70,229,0.3);
}

.brand-text { flex: 1; min-width: 0; }
.brand-text h5 { font-size: 15px; font-weight: 700; color: #fff; margin: 0; line-height: 1.2; }
.brand-text small { font-size: 10px; color: var(--gray-400); letter-spacing: 0.3px; }

.sidebar-close {
    background: rgba(255,255,255,0.06); border: none;
    color: var(--gray-400); font-size: 13px;
    cursor: pointer; padding: 5px 7px;
    border-radius: 6px; display: none;
}

.sidebar-user {
    padding: 14px 20px;
    display: flex; align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.user-avatar {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; color: #fff;
    flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: #fff; line-height: 1.2; }
.user-role { font-size: 11px; color: var(--gray-400); margin-top: 1px; text-transform: capitalize; }

.sidebar-nav { padding: 8px 0; flex: 1; }
.sidebar-nav li a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 20px;
    color: var(--gray-400);
    text-decoration: none; font-size: 13px; font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    margin: 1px 8px;
    border-radius: 8px;
}

.sidebar-nav li a i {
    width: 20px; text-align: center; font-size: 14px;
    flex-shrink: 0;
}

.sidebar-nav li a:hover {
    background: rgba(255,255,255,0.06);
    color: #e2e8f0;
    border-left-color: var(--primary-light);
}

.sidebar-nav li a.active {
    background: linear-gradient(135deg, rgba(79,70,229,0.15), rgba(124,58,237,0.08));
    color: #fff;
    border-left-color: var(--primary-light);
    font-weight: 600;
}

.sidebar-nav .dropdown-toggle {
    display: flex; align-items: center;
    justify-content: space-between;
}

.sidebar-nav .dropdown-toggle::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 11px;
    transition: var(--transition);
    opacity: 0.5;
}

.sidebar-nav .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
    opacity: 1;
}

.submenu { background: rgba(0,0,0,0.12); margin: 0 8px; border-radius: 8px; overflow: hidden; }
.submenu li a {
    padding-left: 43px;
    font-size: 12.5px;
    padding-top: 7px; padding-bottom: 7px;
    border-left: none; margin: 0;
    border-radius: 0;
}
.submenu li a:hover { border-left: none; background: rgba(255,255,255,0.04); }
.submenu li a i { font-size: 11px; width: 16px; }
.submenu li a.active { border-left: none; background: rgba(79,70,229,0.15); }

/* ===== SIDEBAR OVERLAY ===== */
.sidebar-overlay {
    display: none;
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
    backdrop-filter: blur(2px);
}

/* ===== CONTENT ===== */
#content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex; flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    transition: var(--transition);
}

/* Top bar */
.top-bar {
    height: var(--header-h);
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    gap: 12px;
    position: sticky; top: 0; z-index: 100;
    flex-shrink: 0;
}

.toggle-btn {
    background: none; border: none;
    font-size: 18px; color: var(--gray-500);
    cursor: pointer; padding: 6px 8px;
    border-radius: 8px;
    transition: var(--transition);
}
.toggle-btn:hover { background: var(--gray-100); color: var(--dark); }

.top-bar-right {
    display: flex; align-items: center;
    gap: 10px;
}

.user-badge {
    font-size: 13px; color: var(--gray-600);
    font-weight: 500;
    padding: 6px 14px;
    background: var(--gray-50);
    border-radius: 8px;
    border: 1px solid var(--gray-100);
}

.content-inner {
    padding: 24px;
    flex: 1;
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex; justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap; gap: 10px;
}

.page-header h4 {
    font-size: 20px; font-weight: 700;
    color: var(--dark); margin: 0;
}

.page-header h4 i { color: var(--primary); }

@media (max-width: 575px) {
    .page-header { flex-direction: column; align-items: stretch; }
    .page-header h4 { margin-bottom: 8px; }
    .page-header .btn { width: 100%; }
}

/* ===== DASHBOARD STATS ===== */
.dash-stat {
    border-radius: 14px;
    padding: 24px 16px 20px;
    text-align: center;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
    position: relative;
    overflow: hidden;
}
.dash-stat:hover { transform: translateY(-4px); box-shadow: 0 12px 35px rgba(0,0,0,0.1); }
.dash-stat .dash-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    margin: 0 auto 12px;
    background: rgba(255,255,255,0.75);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.dash-stat .dash-num {
    font-size: 26px; font-weight: 800;
    line-height: 1.1; letter-spacing: -0.5px;
    margin-bottom: 3px;
}
.dash-stat .dash-lbl {
    font-size: 11px; font-weight: 600;
    opacity: 0.65; text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.3;
    min-height: 29px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dash-stat.grad-blue { background: linear-gradient(135deg, #f5f7ff, #e8edff); color: #4f46e5; }
.dash-stat.grad-green { background: linear-gradient(135deg, #f2fdf7, #ddfaeb); color: #059669; }
.dash-stat.grad-orange { background: linear-gradient(135deg, #fffbf2, #fef3d5); color: #d97706; }
.dash-stat.grad-teal { background: linear-gradient(135deg, #f2fcff, #d5f5f8); color: #0891b2; }
.dash-stat.grad-rose { background: linear-gradient(135deg, #fff5f5, #fde2e4); color: #e11d48; }
.dash-stat.grad-violet { background: linear-gradient(135deg, #f8f6ff, #eeeaff); color: #7c3aed; }
.dash-stat.grad-amber { background: linear-gradient(135deg, #fff8e7, #ffedd5); color: #b45309; }
.dash-stat.grad-sky { background: linear-gradient(135deg, #f0fdff, #e0f2fe); color: #0369a1; }

/* ===== STAT CARDS (legacy) ===== */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.stat-card .stat-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    margin-bottom: 12px;
}

.stat-card .stat-number {
    font-size: 22px; font-weight: 700;
    color: var(--dark); line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 12.5px; color: var(--gray-500);
    font-weight: 500; margin-top: 2px;
}

.bg-primary-gradient { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; }
.bg-success-gradient { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }
.bg-warning-gradient { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.bg-danger-gradient { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }
.bg-info-gradient { background: linear-gradient(135deg, #06b6d4, #0891b2); color: #fff; }
.stat-card.bg-primary-gradient .stat-number,
.stat-card.bg-success-gradient .stat-number,
.stat-card.bg-warning-gradient .stat-number,
.stat-card.bg-danger-gradient .stat-number,
.stat-card.bg-info-gradient .stat-number { color: #fff; }
.stat-card.bg-primary-gradient .stat-label,
.stat-card.bg-success-gradient .stat-label,
.stat-card.bg-warning-gradient .stat-label,
.stat-card.bg-danger-gradient .stat-label,
.stat-card.bg-info-gradient .stat-label { color: rgba(255,255,255,0.8); }

/* ===== CARDS ===== */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    margin-bottom: 20px;
    background: #fff;
    border: 1px solid var(--gray-200);
    transition: box-shadow 0.2s;
}
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); }

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 20px;
    font-weight: 600;
    font-size: 14px;
    color: var(--dark);
    border-radius: 16px 16px 0 0 !important;
}

.card-header h5 { margin: 0; font-size: 14px; font-weight: 600; }
.card-body { padding: 20px; }

/* ===== TABLES ===== */
.table { margin-bottom: 0; }

.table thead th {
    background: #f5f3ff;
    border-bottom: 1.5px solid #e4d9ff;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6d28d9;
    padding: 11px 14px;
    white-space: nowrap;
}

.table tbody td {
    vertical-align: middle;
    font-size: 13px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

.table tbody tr { transition: background 0.15s; }
.table tbody tr:hover { background: #f5f3ff; }
.table-striped tbody tr:nth-of-type(odd) { background: #fafaff; }
.table-hover tbody tr:hover { background: #f5f3ff; }

.late-record { color: var(--danger) !important; font-weight: 600; }

.table-light { --bs-table-bg: #f5f3ff !important; --bs-table-color: #6d28d9 !important; }

/* ===== FILTER SECTION ===== */
.filter-section {
    background: #fff;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid var(--gray-200);
}

.filter-section .row {
    margin: 0;
}

.filter-section .row > [class*="col-"] {
    padding: 0 6px;
}

.filter-section .form-label {
    font-size: 11px;
    margin-bottom: 2px;
}

@media (max-width: 575px) {
    .filter-section { padding: 10px; }
    .filter-section .row { margin: 0; }
    .filter-section .row > [class*="col-"] { padding: 0 3px; }
    .filter-section .form-label { font-size: 10px; }
    .filter-section .form-control-sm,
    .filter-section .form-select-sm { font-size: 11px; padding: 4px 6px; }
    .filter-section .d-flex { justify-content: stretch !important; }
    .filter-section .d-flex .form-check { flex: 1; }
    .filter-section .d-flex .btn { flex: 1; font-size: 11px; padding: 4px 8px; }
}

.filter-section label {
    font-size: 12px; font-weight: 600;
    color: var(--gray-500); margin-bottom: 4px;
    text-transform: uppercase; letter-spacing: 0.3px;
}

/* ===== FORMS ===== */
.form-control, .form-select {
    border-radius: 8px;
    padding: 8px 12px;
    border: 1.5px solid var(--gray-200);
    font-size: 13px;
    transition: all 0.2s;
    background: #fff;
    height: auto;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.form-label {
    font-size: 12px; font-weight: 600;
    color: var(--gray-600); margin-bottom: 4px;
    letter-spacing: 0.2px;
}

.form-control-sm, .form-select-sm {
    padding: 5px 10px;
    font-size: 12.5px;
}

/* ===== BUTTONS ===== */
.btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 8px 18px;
    font-size: 13px;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #4338ca; box-shadow: 0 4px 12px rgba(79,70,229,0.3); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; box-shadow: 0 4px 12px rgba(16,185,129,0.3); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; box-shadow: 0 4px 12px rgba(239,68,68,0.3); }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d97706; box-shadow: 0 4px 12px rgba(245,158,11,0.3); }

.btn-info { background: var(--info); color: #fff; }
.btn-info:hover { background: #0891b2; box-shadow: 0 4px 12px rgba(6,182,212,0.3); }

.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-300); }

/* ===== BADGES ===== */
.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 11px;
}

.badge.bg-success { background: var(--success-bg) !important; color: #059669 !important; }
.badge.bg-danger { background: var(--danger-bg) !important; color: #dc2626 !important; }
.badge.bg-warning { background: var(--warning-bg) !important; color: #d97706 !important; }
.badge.bg-info { background: var(--info-bg) !important; color: #0891b2 !important; }
.badge.bg-secondary { background: var(--gray-100) !important; color: var(--gray-600) !important; }
.badge.bg-primary { background: var(--primary-bg) !important; color: var(--primary) !important; }
.badge.rounded-pill { padding: 4px 14px; font-size: 11px; }

/* ===== MODALS ===== */
.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.15);
}

.modal-header {
    background: #fff;
    border-radius: 16px 16px 0 0;
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 20px;
}

.modal-header .modal-title {
    font-weight: 700;
    font-size: 15px;
}

.modal-body { padding: 20px; }

.modal-footer {
    border-top: 1px solid var(--gray-200);
    padding: 14px 20px;
    border-radius: 0 0 16px 16px;
}

/* ===== LOGIN ===== */
.login-wrapper {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(79,70,229,0.12), transparent 70%);
    top: -150px; right: -100px;
    animation: float 8s ease-in-out infinite;
}

.login-wrapper::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124,58,237,0.08), transparent 70%);
    bottom: -100px; left: -80px;
    animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -30px); }
}

.login-box {
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    width: 420px; max-width: 100%;
    box-shadow: 0 25px 80px rgba(0,0,0,0.4);
    position: relative;
    z-index: 1;
}

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

.login-box .login-header .brand-icon {
    width: 56px; height: 56px;
    margin: 0 auto 16px;
    font-size: 24px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    box-shadow: 0 4px 15px rgba(79,70,229,0.3);
}

.login-box .login-header h3 {
    font-weight: 700; color: var(--dark);
    font-size: 24px;
}

.login-box .login-header p { color: var(--gray-500); font-size: 14px; }

.login-box .form-control { padding: 11px 14px; font-size: 14px; }

.login-box .btn { width: 100%; padding: 12px; }

/* ===== ALERTS ===== */
.alert {
    border: none;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 13px;
}

/* ===== ACTION BUTTONS ===== */
.action-btns .btn {
    margin-right: 3px;
    padding: 4px 9px;
    font-size: 11px;
}

.action-btns .btn i { font-size: 12px; }

/* ===== CHART ===== */
.chart-wrap {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 3px;
    height: 220px;
    padding-top: 16px;
}
.chart-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}
.chart-val {
    font-size: 10px; font-weight: 600;
    color: var(--gray-400);
    margin-bottom: 3px;
    opacity: 0;
    transition: 0.2s;
}
.chart-col:hover .chart-val { opacity: 1; }
.chart-bar {
    width: 65%;
    max-width: 28px;
    border-radius: 6px 6px 0 0;
    transition: all 0.2s;
    background: linear-gradient(180deg, #c4b5fd, #8b5cf6);
    min-height: 4px;
}
.chart-bar.active {
    background: linear-gradient(180deg, #a78bfa, #7c3aed);
    box-shadow: 0 0 12px rgba(139,92,246,0.3);
}
.chart-col:hover .chart-bar { opacity: 0.85; transform: scaleX(1.06); }
.chart-lbl {
    font-size: 9px; font-weight: 600;
    color: var(--gray-400);
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== SALARY SLIP ===== */
.salary-slip {
    background: #fff;
    padding: 36px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    max-width: 800px;
    margin: 0 auto;
}

.salary-slip .company-header {
    text-align: center;
    border-bottom: 2px solid var(--dark);
    padding-bottom: 14px;
    margin-bottom: 20px;
}

.salary-slip .company-header h2 {
    font-weight: 700; font-size: 22px;
    color: var(--dark);
}

.salary-slip .company-header p {
    color: var(--gray-500); font-size: 12.5px;
    margin-bottom: 2px;
}

.salary-slip table { width: 100%; border-collapse: collapse; }
.salary-slip table td, .salary-slip table th {
    padding: 8px 12px;
    border: 1px solid var(--gray-200);
    font-size: 13px;
}
.salary-slip table thead th {
    background: var(--gray-50);
    font-weight: 600;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--gray-500);
}

/* ===== DATA TABLES ===== */
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length {
    margin-bottom: 14px;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    font-size: 12.5px; color: var(--gray-500);
}

.dataTables_wrapper .dataTables_filter input {
    border-radius: 8px;
    border: 1.5px solid var(--gray-200);
    padding: 6px 12px;
    font-size: 12.5px;
    margin-left: 6px;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
    outline: none;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
    border-radius: 8px !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 8px !important;
    padding: 4px 12px !important;
}

.dataTables_wrapper .dataTables_info {
    font-size: 12.5px;
    color: var(--gray-500);
    padding-top: 8px;
}

div.dataTables_wrapper div.dataTables_paginate ul.pagination {
    justify-content: center !important;
    flex-wrap: wrap !important;
}

@media (max-width: 767px) {
    .dataTables_wrapper .dataTables_filter {
        float: none !important;
        text-align: left !important;
        margin-bottom: 8px;
    }
    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        margin-left: 0;
        margin-top: 4px;
    }
    .dataTables_wrapper .dataTables_length {
        float: none !important;
        text-align: left !important;
        margin-bottom: 8px;
    }
    .dataTables_wrapper .dataTables_info {
        float: none !important;
        text-align: center !important;
        padding-top: 4px;
        font-size: 11px;
    }
    .dataTables_wrapper .dataTables_paginate {
        float: none !important;
        text-align: center !important;
        padding-top: 8px;
    }
    .dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: 3px 8px !important;
        font-size: 11px !important;
    }
    table.dataTable > tbody > tr.child ul.dtr-details > li {
        padding: 4px 0;
    }
    table.dataTable > tbody > tr.child ul.dtr-details > li .dtr-title {
        font-size: 11px;
    }
}

@media (max-width: 575px) {
    .dataTables_wrapper .dataTables_filter input {
        font-size: 12px;
        padding: 5px 8px;
    }
    .dataTables_wrapper .dataTables_length select {
        font-size: 11px;
        padding: 2px 6px;
    }
    div.dataTables_wrapper div.dataTables_paginate ul.pagination {
        justify-content: center !important;
        flex-wrap: wrap;
    }
    div.dataTables_wrapper div.dataTables_paginate ul.pagination li.paginate_button {
        margin: 1px;
    }
}

/* ===== SELECT2 ===== */
.select2-container .select2-selection--single {
    height: 38px !important;
    border: 1.5px solid var(--gray-200) !important;
    border-radius: 8px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px !important;
    padding-left: 12px !important;
    font-size: 13px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
}

.select2-dropdown {
    border: 1px solid var(--gray-200) !important;
    border-radius: 10px !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

/* ===== DATA TABLES SCROLL ===== */
div.dataTables_wrapper div.dataTables_scrollBody {
    min-height: 200px;
}
table.dataTable#attendanceTable {
    min-width: 1260px;
}

@media (max-width: 1400px) {
    :root { --sidebar-width: 200px; }
    .sidebar { width: var(--sidebar-width); }
    #content { margin-left: var(--sidebar-width); }
    .content-inner { padding: 18px; }
    .filter-section { padding: 12px 14px; }
    .filter-section .row > [class*="col-"] { padding: 0 4px; }
    .filter-section label { font-size: 10px; }
    .table thead th, .table tbody td { padding: 8px 8px; font-size: 12px; }
}

@media (max-width: 1199px) {
    :root { --sidebar-width: 220px; }
}

@media (max-width: 991px) {
    :root { --sidebar-width: 260px; }
}

/* ===== SWEETALERT ===== */
.swal2-popup {
    border-radius: 16px !important;
    padding: 28px !important;
}
.swal2-title { font-size: 17px !important; font-weight: 700 !important; }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center; padding: 50px 20px;
    color: var(--gray-500);
}
.empty-state i { font-size: 40px; margin-bottom: 14px; opacity: 0.4; }

/* ===== SIDEBAR OVERLAY RESPONSIVE ===== */
@media (max-width: 991px) {
    .sidebar {
        left: calc(var(--sidebar-width) * -1);
    }
    .sidebar.active {
        left: 0;
        box-shadow: 0 0 50px rgba(0,0,0,0.4);
    }
    .sidebar.active ~ .sidebar-overlay {
        display: block;
    }
    .sidebar-close { display: block; }
    #content { margin-left: 0; }
    .stat-cards { grid-template-columns: repeat(2, 1fr); }
    .content-inner { padding: 16px; }
    .card-header { padding: 12px 14px; }
    .chart-wrap { height: 170px; }
    .chart-bar { width: 75%; }
}

@media (max-width: 576px) {
    .stat-cards { grid-template-columns: 1fr; gap: 12px; }
    .stat-card { padding: 16px; }
    .stat-card .stat-number { font-size: 20px; }
    .stat-card .stat-label { font-size: 11px; }
    .dash-stat { padding: 18px 12px 16px; }
    .dash-stat .dash-icon { width: 36px; height: 36px; font-size: 15px; margin-bottom: 10px; }
    .dash-stat .dash-num { font-size: 21px; }
    .dash-stat .dash-lbl { font-size: 10px; }
    .content-inner { padding: 10px; }
    .top-bar { padding: 0 10px; }
    .page-header { margin-bottom: 12px; gap: 6px; }
    .page-header h4 { font-size: 16px; }
    .table thead th, .table tbody td { padding: 5px 6px; font-size: 10.5px; }
    .card { margin-bottom: 12px; }
    .card-body { padding: 10px; }
    .card-header { padding: 10px 12px; }
    .login-box { padding: 24px 18px; }
    .user-badge { font-size: 11px; padding: 4px 8px; }
    .sidebar { width: 240px; }
    .chart-wrap { height: 140px; }
    .chart-val { font-size: 8px; }
    .chart-lbl { font-size: 8px; }
    table.dataTable > tbody > tr.child ul.dtr-details { padding: 8px 0; }
    table.dataTable > tbody > tr.child ul.dtr-details > li { padding: 4px 8px; }
    table.dataTable > tbody > tr.child ul.dtr-details > li .dtr-title { min-width: 90px; font-size: 11px; font-weight: 600; }
    .modal-dialog { margin: 8px; }
    .modal-body { padding: 12px; }
    .modal-header { padding: 12px 14px; }
    .modal-footer { padding: 10px 14px; }
    .modal-header .modal-title { font-size: 14px; }
    .action-btns .btn { padding: 3px 7px; font-size: 10px; }
    .action-btns .btn i { font-size: 10px; }
}

/* ===== PRINT / PDF EXPORT ===== */
@media print {
    .no-print, .btn-print, .btn-excel, .filter-section, .page-header, .sidebar, .topbar { display: none !important; }
    .wrapper { display: block !important; }
    .main-content { margin-left: 0 !important; padding: 0 !important; }
    .card { border: none !important; box-shadow: none !important; }
    .card-body { padding: 0 !important; }
    .d-none.d-print-table-cell { display: table-cell !important; }
    body { font-size: 9px; }
    .table { font-size: 9px; }
    .table th, .table td { padding: 3px 5px !important; white-space: nowrap; }
    .badge { font-size: 8px; }
}