/* ═══════════════════════════════════════════════════════════
   PAIE GREY CORNER — Design System
   Logiciel de paie professionnel pour PME marocaines
   ═══════════════════════════════════════════════════════════ */

/* ─── CSS VARIABLES ───────────────────────────────────────── */
:root {
    /* Couleurs principales */
    --bg-primary: #0f0f1a;
    --bg-surface: #1a1a2e;
    --bg-elevated: #16213e;
    --bg-card: rgba(26, 26, 46, 0.8);
    --bg-card-hover: rgba(26, 26, 46, 0.95);

    /* Accent */
    --accent: #6c5ce7;
    --accent-light: #a29bfe;
    --accent-gradient: linear-gradient(135deg, #6c5ce7, #a29bfe);
    --accent-glow: 0 0 20px rgba(108, 92, 231, 0.3);
    --accent-border: rgba(108, 92, 231, 0.25);

    /* Sémantiques */
    --success: #00cec9;
    --success-bg: rgba(0, 206, 201, 0.15);
    --warning: #fdcb6e;
    --warning-bg: rgba(253, 203, 110, 0.15);
    --danger: #ff7675;
    --danger-bg: rgba(255, 118, 117, 0.15);
    --info: #74b9ff;
    --info-bg: rgba(116, 185, 255, 0.15);

    /* Texte */
    --text-primary: #ffffff;
    --text-secondary: #b2bec3;
    --text-muted: #636e72;

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 70px;
    --bottom-nav-height: 64px;
    --border-radius: 16px;
    --border-radius-sm: 10px;
    --border-radius-xs: 6px;

    /* Espacement */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Glassmorphism */
    --glass-bg: rgba(26, 26, 46, 0.7);
    --glass-border: 1px solid rgba(108, 92, 231, 0.2);
    --glass-blur: blur(20px);

    /* Transitions */
    --transition: all 0.3s ease;
    --transition-fast: all 0.15s ease;
}

/* ─── RESET & BASE ────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(108, 92, 231, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(108, 92, 231, 0.5);
}

/* ─── SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: var(--glass-border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: var(--space-xl);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: var(--accent-gradient);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.logo-icon svg {
    width: 22px;
    height: 22px;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Navigation sidebar */
.sidebar-nav {
    flex: 1;
    padding: var(--space-lg) var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 0.85rem var(--space-lg);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: rgba(108, 92, 231, 0.1);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent-light);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent-gradient);
    border-radius: 0 3px 3px 0;
}

/* Sidebar footer */
.sidebar-footer {
    padding: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.month-selector {
    margin-bottom: var(--space-md);
}

.month-selector label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.select-month {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: var(--bg-elevated);
    border: 1px solid rgba(108, 92, 231, 0.2);
    border-radius: var(--border-radius-xs);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b2bec3' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    padding-right: 2rem;
}

.select-month:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.select-month option {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.sidebar-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-muted);
    font-size: 0.75rem;
}

.sidebar-info svg {
    width: 14px;
    height: 14px;
}

/* Overlay sidebar mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* ─── MAIN CONTENT ────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ─── HEADER ──────────────────────────────────────────────── */
.header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: rgba(15, 15, 26, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.hamburger {
    display: none;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--border-radius-xs);
    transition: var(--transition);
    align-items: center;
    justify-content: center;
}

.hamburger:hover {
    background: rgba(108, 92, 231, 0.1);
    color: var(--text-primary);
}

.hamburger svg {
    width: 22px;
    height: 22px;
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.header-month-badge,
.header-file-badge {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.4rem 0.8rem;
    background: rgba(108, 92, 231, 0.12);
    border: 1px solid rgba(108, 92, 231, 0.2);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--accent-light);
    font-weight: 500;
}

.header-month-badge svg,
.header-file-badge svg {
    width: 14px;
    height: 14px;
}

/* ─── PAGES ───────────────────────────────────────────────── */
.page {
    display: none;
    padding: var(--space-xl);
    flex: 1;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

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

/* ─── EMPTY STATE ─────────────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-2xl) var(--space-xl);
    min-height: 50vh;
}

.empty-icon {
    width: 80px;
    height: 80px;
    background: rgba(108, 92, 231, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-lg);
    color: var(--accent-light);
}

.empty-icon svg {
    width: 36px;
    height: 36px;
}

.empty-state h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: var(--space-xl);
    max-width: 400px;
}

/* ─── BOUTONS ─────────────────────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.75rem 1.5rem;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.35);
}

.btn-primary svg {
    width: 18px;
    height: 18px;
}

/* ─── KPI CARDS GRID ──────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.kpi-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: var(--border-radius);
    padding: var(--space-lg);
    transition: var(--transition);
    animation: fadeInUp 0.5s ease both;
    cursor: default;
}

.kpi-card:hover {
    transform: translateY(-4px);
    border-color: rgba(108, 92, 231, 0.4);
    box-shadow: var(--accent-glow);
    background: var(--bg-card-hover);
}

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

.kpi-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.kpi-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    color: white;
}

.kpi-card-icon svg {
    width: 22px;
    height: 22px;
}

.kpi-card-title {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-card-value {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: var(--space-xs);
    line-height: 1.2;
}

.kpi-card-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: var(--space-sm);
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
}

.kpi-card-trend.up {
    color: var(--success);
    background: var(--success-bg);
}

.kpi-card-trend.down {
    color: var(--danger);
    background: var(--danger-bg);
}

/* ─── CHARTS ──────────────────────────────────────────────── */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

.chart-container {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: var(--border-radius);
    padding: var(--space-lg);
    animation: fadeInUp 0.5s ease both;
}

.chart-container.chart-full {
    grid-column: span 2;
}

.chart-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
}

.chart-title svg {
    width: 18px;
    height: 18px;
    color: var(--accent-light);
}

.chart-wrapper {
    position: relative;
    height: 280px;
}

.chart-wrapper-lg {
    height: 320px;
}

/* ─── IMPORT ZONE ─────────────────────────────────────────── */
.import-container {
    max-width: 700px;
    margin: 0 auto;
}

.import-zone {
    border: 2px dashed rgba(108, 92, 231, 0.35);
    border-radius: var(--border-radius);
    padding: var(--space-2xl);
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    background: rgba(108, 92, 231, 0.03);
}

.import-zone:hover,
.import-zone.dragover {
    border-color: var(--accent);
    background: rgba(108, 92, 231, 0.08);
    box-shadow: var(--accent-glow);
}

.import-zone.dragover {
    transform: scale(1.01);
}

.import-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.import-icon {
    width: 72px;
    height: 72px;
    background: rgba(108, 92, 231, 0.12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-light);
    margin-bottom: var(--space-sm);
}

.import-icon svg {
    width: 32px;
    height: 32px;
}

.import-zone h2 {
    font-size: 1.2rem;
    font-weight: 700;
}

.import-zone p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.import-zone p strong {
    color: var(--accent-light);
}

.import-separator {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.btn-browse {
    cursor: pointer;
}

/* Import result */
.import-result {
    margin-top: var(--space-xl);
}

.import-result-card {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    background: var(--bg-card);
    border: var(--glass-border);
    border-radius: var(--border-radius);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.import-result-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.import-result-icon.success {
    background: var(--success-bg);
    color: var(--success);
}

.import-result-icon svg {
    width: 26px;
    height: 26px;
}

.import-result-info h3 {
    font-size: 1rem;
    font-weight: 600;
}

.import-result-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: var(--space-xs);
}

/* Grille de feuilles */
.sheet-selector h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
}

.sheet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--space-sm);
}

.sheet-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.7rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--border-radius-xs);
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.sheet-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.sheet-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    background: rgba(108, 92, 231, 0.1);
}

.sheet-btn.active {
    border-color: var(--accent);
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent-light);
}

/* ─── EMPLOYEE TABLE ──────────────────────────────────────── */
.toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.search-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-wrapper svg {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-wrapper input {
    width: 100%;
    padding: 0.65rem 0.8rem 0.65rem 2.5rem;
    background: var(--bg-elevated);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-xs);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition);
}

.search-wrapper input::placeholder {
    color: var(--text-muted);
}

.search-wrapper input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.filter-select {
    padding: 0.65rem 2rem 0.65rem 0.8rem;
    background: var(--bg-elevated);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-xs);
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b2bec3' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
}

.filter-select:focus {
    border-color: var(--accent);
}

.filter-select option {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--border-radius);
    border: var(--glass-border);
}

.employee-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.employee-table thead th {
    position: sticky;
    top: 0;
    background: var(--bg-elevated);
    padding: 0.85rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: var(--transition-fast);
}

.employee-table thead th:hover {
    color: var(--accent-light);
}

.employee-table thead th .sort-arrow {
    margin-left: 0.3rem;
    font-size: 0.7rem;
}

.employee-table tbody tr {
    transition: var(--transition-fast);
}

.employee-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.employee-table tbody tr:hover {
    background: rgba(108, 92, 231, 0.08);
}

.employee-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    white-space: nowrap;
    color: var(--text-secondary);
}

.employee-table tbody td:first-child,
.employee-table tbody td:nth-child(2) {
    color: var(--text-primary);
    font-weight: 500;
}

.employee-table .amount {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    color: var(--text-primary);
}

/* ─── BADGES ──────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.badge-tahfiz { background: rgba(108,92,231,0.15); color: #a29bfe; }
.badge-anapec { background: rgba(116,185,255,0.15); color: #74b9ff; }
.badge-cdi { background: rgba(0,206,201,0.15); color: #00cec9; }
.badge-essai { background: rgba(253,203,110,0.15); color: #fdcb6e; }
.badge-stage { background: rgba(250,177,160,0.15); color: #fab1a0; }
.badge-sans-contrat { background: rgba(255,118,117,0.15); color: #ff7675; }
.badge-temporaire { background: rgba(99,110,114,0.2); color: #b2bec3; }

.badge-ok { background: var(--success-bg); color: var(--success); }
.badge-pending { background: var(--danger-bg); color: var(--danger); }

/* ─── BOTTOM NAV (Mobile) ─────────────────────────────────── */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: rgba(15, 15, 26, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    padding: 0 var(--space-md);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 500;
    transition: var(--transition-fast);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--border-radius-xs);
    min-width: 64px;
}

.bottom-nav-item svg {
    width: 22px;
    height: 22px;
}

.bottom-nav-item.active {
    color: var(--accent-light);
}

.bottom-nav-item:active {
    background: rgba(108, 92, 231, 0.1);
}

/* ─── MODAL ───────────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: flex-end;
    justify-content: center;
}

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

.modal {
    background: var(--bg-surface);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: sticky;
    top: 0;
    background: var(--bg-surface);
}

.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
}

.modal-close {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: rgba(255, 118, 117, 0.15);
    color: var(--danger);
}

.modal-close svg {
    width: 18px;
    height: 18px;
}

.modal-body {
    padding: var(--space-lg);
}

.modal-body .detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.modal-body .detail-label {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
}

.modal-body .detail-value {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: right;
}

/* ─── TOAST NOTIFICATIONS ─────────────────────────────────── */
.toast-container {
    position: fixed;
    top: var(--space-xl);
    right: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    z-index: 3000;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 0.85rem 1.2rem;
    background: var(--bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    font-size: 0.85rem;
    color: var(--text-primary);
    pointer-events: auto;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    max-width: 400px;
}

.toast.show {
    transform: translateX(0);
}

.toast svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.toast span {
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    display: flex;
    flex-shrink: 0;
}

.toast-close svg {
    width: 16px;
    height: 16px;
}

.toast-success { border-left: 3px solid var(--success); }
.toast-success svg:first-child { color: var(--success); }

.toast-error { border-left: 3px solid var(--danger); }
.toast-error svg:first-child { color: var(--danger); }

.toast-info { border-left: 3px solid var(--info); }
.toast-info svg:first-child { color: var(--info); }

.toast-warning { border-left: 3px solid var(--warning); }
.toast-warning svg:first-child { color: var(--warning); }

/* ─── RESPONSIVE — TABLET (768 - 1024px) ─────────────────── */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .hamburger {
        display: flex;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-container.chart-full {
        grid-column: span 1;
    }
}

/* ─── RESPONSIVE — MOBILE (<768px) ───────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding-bottom: calc(var(--bottom-nav-height) + var(--space-md));
    }

    .hamburger {
        display: flex;
    }

    .bottom-nav {
        display: flex;
    }

    /* Header */
    .header {
        padding: 0 var(--space-md);
        height: 60px;
    }

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

    .header-file-badge {
        display: none !important;
    }

    /* Pages */
    .page {
        padding: var(--space-md);
    }

    /* KPI grid */
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }

    .kpi-card {
        padding: var(--space-md);
    }

    .kpi-card-value {
        font-size: 1.3rem;
    }

    .kpi-card-title {
        font-size: 0.68rem;
    }

    .kpi-card-icon {
        width: 36px;
        height: 36px;
    }

    .kpi-card-icon svg {
        width: 18px;
        height: 18px;
    }

    /* Charts */
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-container.chart-full {
        grid-column: span 1;
    }

    .chart-wrapper {
        height: 220px;
    }

    .chart-wrapper-lg {
        height: 260px;
    }

    /* Table */
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-wrapper {
        min-width: unset;
    }

    .table-wrapper {
        border-radius: var(--border-radius-sm);
    }

    .employee-table {
        font-size: 0.78rem;
    }

    .employee-table thead th {
        padding: 0.65rem 0.75rem;
        font-size: 0.7rem;
    }

    .employee-table tbody td {
        padding: 0.6rem 0.75rem;
    }

    /* Import zone */
    .import-zone {
        padding: var(--space-xl);
    }

    .import-icon {
        width: 56px;
        height: 56px;
    }

    .import-icon svg {
        width: 24px;
        height: 24px;
    }

    .sheet-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Toast */
    .toast-container {
        top: auto;
        bottom: calc(var(--bottom-nav-height) + var(--space-md));
        right: var(--space-md);
        left: var(--space-md);
    }

    .toast {
        max-width: unset;
    }

    /* Modal — full width on mobile */
    .modal {
        max-width: 100%;
    }

    /* Empty states */
    .empty-state {
        min-height: 40vh;
        padding: var(--space-xl) var(--space-md);
    }

    .empty-icon {
        width: 64px;
        height: 64px;
    }

    .empty-icon svg {
        width: 28px;
        height: 28px;
    }

    .empty-state h2 {
        font-size: 1.1rem;
    }
}

/* ─── RESPONSIVE — SMALL MOBILE (<480px) ──────────────────── */
@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-sm);
    }

    .kpi-card {
        padding: var(--space-sm) var(--space-md);
    }

    .kpi-card-value {
        font-size: 1.1rem;
    }

    .header-month-badge span {
        display: none;
    }

    .sheet-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ─── PRINT STYLES ────────────────────────────────────────── */
@media print {
    .sidebar,
    .bottom-nav,
    .hamburger,
    .header,
    .import-zone,
    .toast-container,
    .modal-overlay {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    body {
        background: white;
        color: #1a1a2e;
    }

    .kpi-card {
        background: #f5f5f5;
        border: 1px solid #ddd;
        color: #1a1a2e;
    }

    .kpi-card-value {
        color: #1a1a2e;
    }

    .kpi-card-title {
        color: #636e72;
    }

    .employee-table thead th {
        background: #e0e0e0;
        color: #1a1a2e;
    }

    .employee-table tbody td {
        color: #333;
        border-bottom: 1px solid #eee;
    }

    .page {
        display: block !important;
        padding: 0;
    }

    .page.active {
        break-after: page;
    }
}

/* ─── UTILITY CLASSES ─────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-accent { color: var(--accent-light); }
.font-mono { font-variant-numeric: tabular-nums; }
