/* ========================================
   Bee & Honey HR System
   Brand Design System
   ======================================== */

:root {
    /* Brand Colors */
    --gold: #F7C049;
    --gold-light: #fcd97a;
    --gold-dark: #d4a030;
    --black: #040404;
    --black-light: #1a1a2e;
    --red: #B9110E;
    --red-light: #e5342f;
    --cream: #F8F2DC;
    --cream-dark: #e8dfc0;
    --gray: #797575;
    --gray-light: #b0adad;
    --gray-dark: #4a4747;

    /* Semantic Colors */
    --bg-primary: #0a0a1a;
    --bg-secondary: #12122a;
    --bg-card: rgba(18, 18, 42, 0.85);
    --bg-card-hover: rgba(24, 24, 54, 0.95);
    --text-primary: #f0ece0;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;
    --border-color: rgba(247, 192, 73, 0.15);
    --border-hover: rgba(247, 192, 73, 0.35);

    /* Status Colors */
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.12);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.12);

    /* Layout */
    --sidebar-w: 260px;
    --topbar-h: 64px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.45);
    --shadow-gold: 0 0 30px rgba(247, 192, 73, 0.15);

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --input-bg: rgba(255, 255, 255, 0.06);
}

/* Dark theme select fix — option text invisible on white dropdown */
:root select,
:root select option {
    background: #1a1a2e;
    color: #f0ece0;
}

/* ========== Light Theme ========== */
[data-theme="light"] {
    --bg-primary: #f5f2e9;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.96);
    --bg-card-hover: #ffffff;
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --border-color: rgba(0, 0, 0, 0.12);
    --border-hover: rgba(184, 134, 11, 0.5);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-gold: 0 0 20px rgba(184, 134, 11, 0.1);
    --gold: #8b6914;
    --gold-light: #b8860b;
    --gold-dark: #6b4f0e;
    --success: #15803d;
    --success-bg: rgba(21, 128, 61, 0.08);
    --warning: #92400e;
    --warning-bg: rgba(146, 64, 14, 0.08);
    --danger: #b91c1c;
    --danger-bg: rgba(185, 28, 28, 0.06);
    --info: #1d4ed8;
    --info-bg: rgba(29, 78, 216, 0.06);
    --input-bg: #f9f7f2;
}

[data-theme="light"] body::before {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(184, 134, 11, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(185, 17, 14, 0.02) 0%, transparent 50%);
}

[data-theme="light"] .form-group input,
[data-theme="light"] .form-group select,
[data-theme="light"] .form-group textarea,
[data-theme="light"] .month-selector select {
    background: var(--input-bg);
    color: var(--text-primary);
    border-color: #d1d5db;
}

[data-theme="light"] .data-table th {
    background: #f3edd8;
    color: #6b4f0e;
}

[data-theme="light"] .data-table tbody tr:hover {
    background: rgba(184, 134, 11, 0.05);
}

[data-theme="light"] .kpi-card {
    border-color: #e5e2d9;
}

[data-theme="light"] .kpi-value {
    color: #8b6914;
}

[data-theme="light"] .kpi-absences .kpi-value {
    color: #b91c1c;
}

[data-theme="light"] .kpi-late .kpi-value {
    color: #92400e;
}

[data-theme="light"] .kpi-early .kpi-value {
    color: #1d4ed8;
}

[data-theme="light"] .kpi-missing .kpi-value {
    color: #6b7280;
}

[data-theme="light"] .kpi-missions .kpi-value {
    color: #15803d;
}

[data-theme="light"] select,
[data-theme="light"] select option {
    background: #fff;
    color: #111827;
}

/* ========== Reset & Base ========== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

html,
body {
    font-family: 'Cairo', 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    max-width: 100vw;
    direction: rtl;
}

body {
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(247, 192, 73, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(185, 17, 14, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    transition: background 0.4s var(--ease);
}

body,
.sidebar,
.topbar,
.card,
.kpi-card,
.modal-content,
.login-card {
    transition: background 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease);
}

/* ========== Theme Toggle ========== */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 1.15rem;
    transition: all 0.3s var(--ease);
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: rgba(247, 192, 73, 0.15);
    border-color: var(--gold);
}

#app {
    position: relative;
    z-index: 1;
}

a {
    color: var(--gold);
    text-decoration: none;
}

a:hover {
    color: var(--gold-light);
}

/* ========== Glassmorphism Card ========== */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

/* ========== Login ========== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-primary);
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-lg), var(--shadow-gold);
    animation: fadeInUp 0.6s var(--ease);
}

.login-logo {
    margin-bottom: 1.5rem;
}

.login-logo img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--gold);
    box-shadow: 0 0 25px rgba(247, 192, 73, 0.3);
}

.login-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--gold);
    margin-bottom: 0.3rem;
}

.login-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-style: italic;
}

/* ========== Form Elements ========== */
.form-group {
    margin-bottom: 1.2rem;
    text-align: right;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s var(--ease);
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(247, 192, 73, 0.15);
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.4rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s var(--ease);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--black);
    box-shadow: 0 2px 12px rgba(247, 192, 73, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(247, 192, 73, 0.5);
}

.btn-secondary {
    background: rgba(247, 192, 73, 0.12);
    color: var(--gold);
    border: 1px solid rgba(247, 192, 73, 0.2);
}

.btn-secondary:hover {
    background: rgba(247, 192, 73, 0.2);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.8rem 2rem;
    font-size: 1rem;
}

.btn-full {
    width: 100%;
}

/* ========== Alerts ========== */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-top: 1rem;
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

/* ========== Main Layout ========== */
#main-layout {
    display: flex;
    min-height: 100vh;
}

/* ========== Sidebar ========== */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.35s var(--ease);
}

.sidebar-header {
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gold);
}

.sidebar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold);
}

.sidebar-nav {
    flex: 1;
    padding: 0.8rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.75rem 1.2rem;
    color: var(--text-secondary);
    border-radius: 0;
    transition: all 0.2s var(--ease);
    border-right: 3px solid transparent;
    font-size: 0.95rem;
}

.nav-item:hover {
    background: rgba(247, 192, 73, 0.06);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(247, 192, 73, 0.1);
    color: var(--gold);
    border-right-color: var(--gold);
}

.nav-icon {
    font-size: 1.15rem;
}

.sidebar-footer {
    padding: 1rem 1.2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.user-name {
    color: var(--text-secondary);
}

/* ========== Main Content ========== */
.main-content {
    flex: 1;
    margin-right: var(--sidebar-w);
    min-height: 100vh;
}

.topbar {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    flex: 1;
}

.topbar-title h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.menu-toggle {
    display: none;
    font-size: 1.3rem;
}

.month-selector {
    display: flex;
    gap: 0.5rem;
}

.month-selector select {
    padding: 0.4rem 0.7rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Cairo', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
}

.month-selector select:focus {
    border-color: var(--gold);
}

.content-area {
    padding: 1.5rem;
}

/* ========== Cards ========== */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: border-color 0.3s var(--ease);
}

.card:hover {
    border-color: var(--border-hover);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.card-body {
    padding: 1.2rem;
}

/* ========== KPI Cards ========== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    text-align: center;
    transition: all 0.3s var(--ease);
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--gold-dark));
    opacity: 0;
    transition: opacity 0.3s var(--ease);
}

.kpi-card:hover::before {
    opacity: 1;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-icon {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gold);
    line-height: 1.1;
}

.kpi-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.4rem;
}

.kpi-absences .kpi-value {
    color: var(--danger);
}

.kpi-late .kpi-value {
    color: var(--warning);
}

.kpi-early .kpi-value {
    color: var(--info);
}

.kpi-missing .kpi-value {
    color: var(--gray-light);
}

.kpi-missions .kpi-value {
    color: var(--success);
}

/* ========== Tables ========== */
.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table th,
.data-table td {
    padding: 0.7rem 0.8rem;
    text-align: right;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: rgba(247, 192, 73, 0.06);
    color: var(--gold);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    position: sticky;
    top: 0;
}

.data-table tbody tr {
    transition: background 0.2s var(--ease);
}

.data-table tbody tr:hover {
    background: rgba(247, 192, 73, 0.04);
}

.data-table.compact td,
.data-table.compact th {
    padding: 0.5rem 0.6rem;
    font-size: 0.8rem;
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
}

.badge-absent {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-holiday {
    background: var(--info-bg);
    color: var(--info);
}

.badge-dayoff {
    background: rgba(120, 120, 150, 0.12);
    color: var(--gray-light);
}

.badge-present {
    background: var(--success-bg);
    color: var(--success);
}

.badge-late {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-missing {
    background: var(--warning-bg);
    color: var(--warning);
}

/* ========== Empty State ========== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.8rem;
    opacity: 0.5;
}

/* ========== Import Wizard ========== */
.import-wizard {
    padding: 1.5rem;
}

.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s var(--ease);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--gold);
    background: rgba(247, 192, 73, 0.04);
}

.upload-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.8rem;
}

.upload-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 1rem;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    border-radius: 3px;
    transition: width 0.4s var(--ease);
}

.import-info {
    background: rgba(247, 192, 73, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.info-grid {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    gap: 0.5rem;
}

.info-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.info-value {
    color: var(--gold);
    font-weight: 600;
    font-size: 0.85rem;
}

.mapping-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.import-actions {
    display: flex;
    justify-content: flex-start;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.import-success {
    text-align: center;
    padding: 2rem;
}

.success-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
}

/* ========== Settings ========== */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1rem;
}

.checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.checkbox-item input[type="checkbox"] {
    accent-color: var(--gold);
    width: 16px;
    height: 16px;
}

.holidays-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 40px;
}

.holiday-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    background: rgba(247, 192, 73, 0.1);
    border: 1px solid rgba(247, 192, 73, 0.2);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--gold);
}

.holiday-tag button {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
}

/* ========== Modal ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 98vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.3s var(--ease);
    box-shadow: var(--shadow-lg);
}

.modal-content .data-table th,
.modal-content .data-table td {
    padding: 0.4rem 0.5rem;
    font-size: 0.78rem;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    color: var(--gold);
    font-size: 1.1rem;
}

.modal-close {
    font-size: 1.3rem;
}

.modal-body {
    padding: 1.2rem 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.emp-summary-cards {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}

.mini-kpi {
    flex: 1;
    min-width: 100px;
    text-align: center;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.mini-val {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gold);
}

.mini-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ========== Toast ========== */
.toast-container {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    animation: slideDown 0.4s var(--ease);
    box-shadow: var(--shadow-md);
    min-width: 260px;
    text-align: center;
}

.toast-success {
    background: #166534;
    color: #bbf7d0;
}

.toast-error {
    background: #991b1b;
    color: #fecaca;
}

.toast-info {
    background: #1e3a5f;
    color: #bfdbfe;
}

/* ========== DataTable Controls ========== */
.dt-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1.2rem;
    gap: 1rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color);
}

.dt-search {
    position: relative;
    flex: 1;
    max-width: 320px;
}

.dt-search input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.2rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Cairo', sans-serif;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.3s var(--ease);
}

.dt-search input:focus {
    border-color: var(--gold);
}

.dt-search::before {
    content: '🔍';
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    pointer-events: none;
}

.dt-page-size {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.dt-page-size select {
    padding: 0.35rem 0.5rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Cairo', sans-serif;
    font-size: 0.82rem;
    cursor: pointer;
    outline: none;
}

/* Pagination */
.dt-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1.2rem;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dt-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.dt-pages {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.dt-pages button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-family: 'Cairo', sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s var(--ease);
}

.dt-pages button:hover:not(:disabled) {
    background: rgba(247, 192, 73, 0.12);
    border-color: var(--gold);
    color: var(--gold);
}

.dt-pages button.active {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--black);
    border-color: var(--gold);
    font-weight: 700;
}

.dt-pages button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ========== Utilities ========== */
.hidden {
    display: none !important;
}

.mt-md {
    margin-top: 1rem;
}

.mt-lg {
    margin-top: 1.5rem;
}

.page {
    min-height: 100vh;
}

.content-page {
    display: block;
}

/* ========== Animations ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px) translateX(50%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0) translateX(50%);
    }
}

/* ========== Sidebar Overlay (mobile) ========== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}

/* ========== Responsive — Tablet (≤ 1024px) ========== */
@media (max-width: 1024px) {
    :root {
        --sidebar-w: 200px;
    }

    .sidebar-brand {
        font-size: 0.95rem;
    }

    .nav-item {
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
    }

    .kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem 0.5rem;
        font-size: 0.8rem;
    }

    .content-area {
        padding: 1rem;
    }
}

/* ========== Responsive — Mobile (≤ 768px) ========== */
@media (max-width: 768px) {
    :root {
        --sidebar-w: 0px;
    }

    .sidebar {
        transform: translateX(100%);
        width: 260px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-right: 0;
    }

    .menu-toggle {
        display: flex;
    }

    /* Topbar */
    .topbar {
        flex-wrap: wrap;
        height: auto;
        padding: 0.6rem 1rem;
        gap: 0.5rem;
    }

    .topbar-title h2 {
        font-size: 0.95rem;
    }

    .month-selector {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .month-selector select {
        flex: 1;
        font-size: 0.8rem;
    }

    /* KPI */
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }

    .kpi-card {
        padding: 0.8rem;
    }

    .kpi-icon {
        font-size: 1.4rem;
        margin-bottom: 0.3rem;
    }

    .kpi-value {
        font-size: 1.4rem;
    }

    .kpi-label {
        font-size: 0.7rem;
    }

    /* Tables — horizontal scroll */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: calc(100vw - 2rem);
    }

    .data-table {
        min-width: 700px;
    }

    .data-table th,
    .data-table td {
        padding: 0.4rem 0.4rem;
        font-size: 0.75rem;
    }

    /* Settings */
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .info-grid {
        flex-direction: column;
        gap: 0.5rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0.8rem;
    }

    /* Modal */
    .modal {
        padding: 0;
        align-items: flex-end;
    }

    .modal-content {
        max-width: 100%;
        max-height: 95vh;
        border-radius: var(--radius-md) var(--radius-md) 0 0;
    }

    .modal-content .data-table {
        min-width: 600px;
    }

    .modal-body {
        padding: 0.8rem;
    }

    .emp-summary-cards {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .mini-kpi {
        min-width: 70px;
        padding: 0.5rem;
    }

    .mini-val {
        font-size: 1.2rem;
    }

    .mini-label {
        font-size: 0.65rem;
    }

    /* Login */
    .login-card {
        max-width: 100%;
        padding: 2rem 1.5rem;
    }

    .login-logo img {
        width: 80px;
        height: 80px;
    }

    .login-title {
        font-size: 1.3rem;
    }

    /* Buttons */
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    /* Upload zone */
    .upload-zone {
        padding: 2rem 1rem;
    }

    /* Import actions */
    .import-actions {
        flex-direction: column;
    }

    .import-actions .btn {
        width: 100%;
        text-align: center;
    }

    /* Cards */
    .card-header {
        padding: 0.8rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .card-body {
        padding: 0.8rem;
    }

    .card-actions {
        width: 100%;
    }

    .card-actions .btn {
        flex: 1;
        text-align: center;
    }

    /* DT controls */
    .dt-controls {
        flex-direction: column;
        align-items: stretch;
        padding: 0.6rem 0.8rem;
    }

    .dt-search {
        max-width: 100%;
    }

    .dt-pagination {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .dt-pages {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* ========== Responsive — Small Phone (≤ 480px) ========== */
@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }

    .kpi-card {
        padding: 0.6rem;
    }

    .kpi-value {
        font-size: 1.2rem;
    }

    .kpi-icon {
        font-size: 1.2rem;
    }

    .content-area {
        padding: 0.6rem;
    }

    .topbar-title h2 {
        font-size: 0.85rem;
    }

    .sidebar-logo {
        width: 34px;
        height: 34px;
    }

    .modal-header h3 {
        font-size: 0.9rem;
    }

    .mini-kpi {
        min-width: 60px;
        padding: 0.4rem;
    }

    .mini-val {
        font-size: 1rem;
    }

    .login-card {
        padding: 1.5rem 1rem;
    }

    .login-logo img {
        width: 65px;
        height: 65px;
    }

    .login-title {
        font-size: 1.1rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.3rem 0.3rem;
        font-size: 0.7rem;
    }

    .badge {
        padding: 0.15rem 0.4rem;
        font-size: 0.65rem;
    }
}