@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

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

:root,
[data-theme="light"] {
    /* ── Mode Clair (Doux, raffiné, sobre) ── */
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #EFF6FF;
    --primary-gradient: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    --secondary: #0F172A;
    --accent: #0284C7;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --purple: #8B5CF6;
    --bg: #F8FAFC;
    --card: #FFFFFF;
    --text: #334155;
    --text-dark: #0F172A;
    --text-muted: #64748B;
    --border: #E2E8F0;
    --sidebar-bg: linear-gradient(180deg, #1E293B 0%, #0F172A 100%);
    --sidebar-active-bg: #FFFFFF;
    --sidebar-active-color: #2563EB;
    --sidebar-w: 250px;
    --radius: 16px;
    --shadow: 0 4px 20px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.1);
    --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --pill-bg: #F1F5F9;
    --pill-border: #E2E8F0;
    --pill-active-bg: #2563EB;
    --pill-active-color: #FFFFFF;
    --gauge-bg: #E2E8F0;
    --input-bg: #FFFFFF;
    --topbar-bg: rgba(248, 250, 252, 0.92);
}

/* ── Mode Sombre (Dark Mode — Contrastes nets & lisibilité parfaite) ── */
[data-theme="dark"] {
    --primary: #3B82F6;
    --primary-dark: #60A5FA;
    --primary-light: rgba(59, 130, 246, 0.2);
    --primary-gradient: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
    --secondary: #090D16;
    --accent: #38BDF8;
    --success: #34D399;
    --warning: #FBBF24;
    --danger: #F87171;
    --purple: #A78BFA;
    --bg: #0B0F19;
    --card: #1E293B;
    --text: #E2E8F0;
    --text-dark: #F8FAFC;
    --text-muted: #94A3B8;
    --border: #334155;
    --sidebar-bg: linear-gradient(180deg, #090D16 0%, #030508 100%);
    --sidebar-active-bg: #2563EB;
    --sidebar-active-color: #FFFFFF;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.5);
    --pill-bg: #1E293B;
    --pill-border: #334155;
    --pill-active-bg: #3B82F6;
    --pill-active-color: #FFFFFF;
    --gauge-bg: #334155;
    --input-bg: #0F172A;
    --topbar-bg: rgba(11, 15, 25, 0.92);
}

body {
    font-family: var(--font-family);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    line-height: 1.5;
    letter-spacing: -0.011em;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6, .card-title, .modal-title, .navbar-title {
    font-family: var(--font-family);
    letter-spacing: -0.022em;
    color: var(--text-dark);
}

button, input, select, textarea {
    font-family: var(--font-family);
}

/* ===== LAYOUT ===== */
.app-wrapper { display: flex; min-height: 100vh; position: relative; }

/* ===== SIDEBAR & OVERLAY ===== */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform .3s cubic-bezier(0.4, 0, 0.2, 1), background .3s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
}
.sidebar-brand {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #FFFFFF;
}
.sidebar-brand i { 
    font-size: 1.6rem; 
    color: #FFFFFF; 
    background: rgba(255, 255, 255, 0.15); 
    width: 40px; height: 40px; 
    border-radius: 12px; 
    display: flex; align-items: center; justify-content: center;
}
.sidebar-brand small { font-size: .75rem; font-weight: 500; color: rgba(255, 255, 255, 0.7); display: block; margin-top: 1px; }
.sidebar-nav { flex: 1; padding: 10px 0; overflow-y: auto; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    margin: 4px 12px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: all .2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: .88rem;
    font-weight: 600;
    border-radius: 12px;
}
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.nav-item.active { 
    color: var(--sidebar-active-color) !important; 
    background: var(--sidebar-active-bg) !important; 
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}
.nav-item.active i { color: var(--sidebar-active-color) !important; }
.nav-item i { width: 20px; text-align: center; font-size: 1rem; }
.nav-category-header {
    padding: 16px 20px 6px 20px;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255, 255, 255, 0.45);
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-category-header:not(:first-child) {
    margin-top: 8px;
    border-top: 1px solid rgba(255,255,255,.08);
    padding-top: 16px;
}
.sidebar-footer { padding: 16px 20px; color: rgba(255,255,255,.5); font-size: .75rem; border-top: 1px solid rgba(255,255,255,.08); }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 90;
    transition: opacity .3s;
}
.sidebar-overlay.active { display: block; }

/* ===== MAIN ===== */
.main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; width: calc(100% - var(--sidebar-w)); }
.top-bar {
    background: var(--topbar-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky; top: 0; z-index: 50;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.page-title { font-size: 1.3rem; font-weight: 800; color: var(--text-dark); flex: 1; letter-spacing: -0.03em; }
.top-bar-right { color: var(--text-muted); font-size: .9rem; }
.sidebar-toggle { background: none; border: none; cursor: pointer; font-size: 1.2rem; color: var(--text-muted); display: none; }
.content-area { padding: 24px; flex: 1; }

/* ===== CARDS ===== */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 22px;
    transition: transform .2s, box-shadow .2s, background-color 0.3s ease, border-color 0.3s ease;
}
.card-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; color: var(--text-dark); }
.card-title i { color: var(--primary); }

/* ===== PAGE BANNER (UNIFIED ELEGANT BANNER) ===== */
.page-banner {
    background: linear-gradient(135deg, #1E3A8A 0%, #2563EB 100%);
    color: #FFFFFF !important;
    padding: 20px 24px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.18);
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .page-banner {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    border-color: #334155;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}
.page-banner h2, .page-banner h2 i {
    color: #FFFFFF !important;
}
.page-banner p {
    color: rgba(255, 255, 255, 0.88) !important;
}

/* Banner Action Buttons */
.btn-banner-primary {
    background: #FFFFFF !important;
    color: #1E3A8A !important;
    font-weight: 700 !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
    transition: all 0.2s ease !important;
}
.btn-banner-primary i {
    color: #1E3A8A !important;
}
.btn-banner-primary:hover {
    background: #F8FAFC !important;
    transform: translateY(-1px);
}

.btn-banner-secondary {
    background: rgba(255, 255, 255, 0.16) !important;
    color: #FFFFFF !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
}
.btn-banner-secondary i {
    color: #FFFFFF !important;
}
.btn-banner-secondary:hover {
    background: rgba(255, 255, 255, 0.28) !important;
}

/* ===== STAT CARDS ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 28px; }
.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: #dcfce7; color: var(--success); }
.stat-icon.orange { background: #fef3c7; color: var(--warning); }
.stat-icon.cyan { background: #cffafe; color: var(--accent); }
.stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1; color: var(--text-dark); }
.stat-label { font-size: .8rem; color: var(--text-muted); margin-top: 4px; }

/* ===== GRID LAYOUTS ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* ===== TABLES ===== */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th {
    background: var(--bg);
    padding: 11px 14px;
    text-align: left;
    font-weight: 700;
    color: var(--text-muted);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 2px solid var(--border);
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }

/* ===== BADGES ===== */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge-blue { background: var(--primary-light); color: var(--primary); }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-orange { background: #fef3c7; color: #b45309; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-purple { background: #f3e8ff; color: #6d28d9; }
.badge-gray { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: 6px; color: var(--text-dark); }
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: .9rem;
    transition: border-color .2s, box-shadow .2s;
    background: var(--input-bg);
    color: var(--text-dark);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.form-control:disabled { background: var(--bg); color: var(--text-muted); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all .2s;
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--bg); }
.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-icon { padding: 8px; border-radius: 6px; }

/* ===== UPLOAD ZONE ===== */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    background: #fafbfc;
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--primary); background: var(--primary-light); }
.upload-zone i { font-size: 2.5rem; color: var(--primary); margin-bottom: 12px; display: block; }
.upload-zone p { color: var(--text-muted); font-size: .9rem; }
.upload-zone strong { color: var(--text); }
#fileInput { display: none; }

/* ===== ALERTS ===== */
.alert { padding: 14px 16px; border-radius: 8px; margin-bottom: 16px; display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: var(--primary-light); color: #1e40af; border: 1px solid #bfdbfe; }

/* ===== PROGRESS BAR ===== */
.progress { background: var(--bg); border-radius: 999px; height: 8px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); border-radius: 999px; transition: width .4s; }

/* ===== CHART AREA ===== */
.chart-container { position: relative; height: 280px; }

/* ===== EMPLOYEE CARDS ===== */
.emp-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .8rem; color: #fff;
    background-color: #2563eb;
    line-height: 1;
    flex-shrink: 0;
}

/* ===== PAGINATION ===== */
.pagination { display: flex; gap: 4px; align-items: center; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.page-btn { padding: 6px 11px; border-radius: 6px; border: 1px solid var(--border); background: var(--card); cursor: pointer; font-size: .85rem; transition: all .2s; text-decoration: none; color: var(--text); }
.page-btn:hover { background: var(--bg); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ===== FILTER BAR ===== */
.filter-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.filter-bar .form-control { max-width: 200px; }

/* ===== TIMELINE ===== */
.timeline { display: flex; flex-direction: column; gap: 6px; }
.timeline-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--bg); border-radius: 8px; font-size: .85rem; }
.timeline-time { font-weight: 600; color: var(--primary); min-width: 70px; }
.timeline-device { color: var(--text-muted); }

/* ===== HEURE SUMMARY ===== */
.hours-display { font-size: 2rem; font-weight: 700; color: var(--primary); }
.hours-sub { font-size: .8rem; color: var(--text-muted); }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state i { font-size: 3rem; margin-bottom: 12px; display: block; opacity: .3; }

/* ===== MODAL ===== */
.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.6); backdrop-filter: blur(3px); z-index: 300; align-items: center; justify-content: center; }
.modal-backdrop.show { display: flex; }
.modal { background: var(--card); border-radius: var(--radius); width: 100%; max-width: 520px; box-shadow: var(--shadow-lg); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-title { font-weight: 600; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 1.1rem; color: var(--text-muted); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ===== RESPONSIVE UNIFIÉ ET OPTIMISÉ POUR TOUS LES ÉCRANS ===== */

/* 1. Écrans Tablettes & Mobiles (< 1024px) */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1000;
        width: 260px;
        box-shadow: 4px 0 24px rgba(0,0,0,0.25);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.3rem;
        width: 40px;
        height: 40px;
        border-radius: 8px;
        background: #f1f5f9;
        color: #0f172a;
    }
    .top-bar {
        padding: 10px 16px;
        gap: 12px;
    }
    .grid-3 {
        grid-template-columns: 1fr !important;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    #ai-chat-window {
        width: calc(100vw - 32px);
        max-width: 360px;
        right: 0;
        bottom: 80px;
    }
}

/* 2. Écrans Smart-Tablettes & Grands Smartphones (< 768px) */
@media (max-width: 768px) {
    .content-area {
        padding: 14px 10px;
    }
    .card {
        padding: 14px;
        border-radius: 10px;
    }
    .grid-2 {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    .page-title {
        font-size: 1.05rem;
    }
    .top-bar-right {
        font-size: 0.8rem;
    }

    /* Prévenir le zoom automatique iOS Safari lors du focus */
    .form-control, select, textarea {
        font-size: 16px !important;
    }

    /* Touch target 44px sur mobile */
    .btn, .btn-sm {
        min-height: 40px;
        padding: 8px 14px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .btn-icon.btn-sm {
        min-width: 38px;
        min-height: 38px;
        padding: 0;
    }

    /* Tableaux défilables proprement */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        border: 1px solid #cbd5e1;
    }
    .data-table th, .data-table td {
        padding: 10px 12px;
        font-size: 0.84rem;
        white-space: nowrap;
    }

    /* Modal adaptatif */
    .modal {
        max-width: 95%;
        max-height: 90vh;
        margin: 8px;
        display: flex;
        flex-direction: column;
    }
    .modal-body {
        padding: 16px;
        overflow-y: auto;
        max-height: calc(88vh - 120px);
    }
    .modal-footer {
        padding: 12px 16px;
        flex-direction: column-reverse;
        gap: 8px;
    }
    .modal-footer button {
        width: 100%;
        justify-content: center;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .filter-bar .form-control, .filter-bar select, .filter-bar button {
        width: 100% !important;
        max-width: 100% !important;
    }

    .d-flex.justify-between {
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* 3. Petit Smartphone (< 480px) */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .stat-card {
        padding: 12px 14px;
    }
    .stat-value {
        font-size: 1.35rem;
    }
    .top-bar-right .date-now {
        display: none;
    }
    .hours-display {
        font-size: 1.4rem;
    }
    .card-title {
        font-size: 0.95rem;
    }
}

/* ===== TIME GROUPS (DASHBOARD) ===== */
.time-group-col {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
}
.time-group-col:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.group-header {
    font-weight: 700;
    font-size: 0.95rem;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
}
.group-header.less-than-8 {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}
.group-header.exactly-8 {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}
.group-header.more-than-8 {
    background: linear-gradient(135deg, #10b981, #059669);
}
.group-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}
.group-list::-webkit-scrollbar {
    width: 6px;
}
.group-list::-webkit-scrollbar-track {
    background: transparent;
}
.group-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
.group-item {
    background: #fff;
    border-radius: 8px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}
.group-item:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}
.group-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.group-item-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #0f172a;
}
.group-item-code {
    font-size: 0.72rem;
    color: #64748b;
}

/* ===== GLOBAL UTILITIES & FLEXBOX ===== */
.d-flex { display: flex !important; }
.flex-column { flex-direction: column !important; }
.align-center { align-items: center !important; }
.justify-between { justify-content: space-between !important; }
.justify-center { justify-content: center !important; }
.w-full { width: 100% !important; }
.gap-1 { gap: 4px !important; }
.gap-2 { gap: 8px !important; }
.gap-3 { gap: 12px !important; }
.gap-4 { gap: 16px !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }

/* ===== CONTACT EMPLOYE MODAL & CARDS ===== */
.contact-card-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}
.contact-card-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
}
.contact-card-btn.disabled {
    opacity: 0.55;
    pointer-events: none;
    background: #f1f5f9;
    border-color: #e2e8f0;
}
.contact-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.contact-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.contact-card-arrow {
    color: #94a3b8;
    font-size: 0.85rem;
    transition: transform 0.2s ease, color 0.2s ease;
}
.contact-card-btn:hover .contact-card-arrow {
    transform: translateX(3px);
    color: #475569;
}
.emp-clickable {
    cursor: pointer;
    transition: color 0.15s ease, opacity 0.15s ease;
}
.emp-clickable:hover {
    color: #4E60FF !important;
}

/* ===== PILL CATEGORY CARDS (MYHOME DASHBOARD STYLE) ===== */
.pill-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.pill-card {
    background: #E8ECFF;
    border: 1px solid #DDE3FF;
    border-radius: 20px;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
}
.pill-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(78, 96, 255, 0.15);
}
.pill-card.active {
    background: #4E60FF !important;
    border-color: #4E60FF !important;
    color: #FFFFFF !important;
    box-shadow: 0 10px 28px rgba(78, 96, 255, 0.3) !important;
}
.pill-card.active .pill-icon {
    background: rgba(255, 255, 255, 0.22) !important;
    color: #FFFFFF !important;
}
.pill-card.active .pill-title,
.pill-card.active .pill-value {
    color: #FFFFFF !important;
}
.pill-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #FFFFFF;
    color: #4E60FF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(78, 96, 255, 0.08);
}
.pill-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #676C90;
    margin-bottom: 2px;
}
.pill-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1E2248;
}

/* ===== CIRCULAR GAUGE RINGS ===== */
.gauges-container {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 20px;
    flex-wrap: wrap;
    padding: 12px 0;
}
.gauge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.gauge-ring-wrapper {
    position: relative;
    width: 110px;
    height: 110px;
    margin-bottom: 10px;
}
.gauge-ring-wrapper svg {
    transform: rotate(-90deg);
    width: 110px;
    height: 110px;
}
.gauge-ring-bg {
    stroke: #E8ECFF;
    stroke-width: 9;
    fill: none;
}
.gauge-ring-fill {
    stroke: #4E60FF;
    stroke-width: 9;
    stroke-linecap: round;
    fill: none;
    transition: stroke-dashoffset 0.8s ease;
}
.gauge-percent {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
    color: #1E2248;
}
.gauge-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1E2248;
    margin-bottom: 2px;
}
.gauge-subtext {
    font-size: 0.78rem;
    color: #676C90;
}

/* ===== TOGGLE SWITCHES ===== */
.switch-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.switch-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #E2E7F8;
    transition: .3s;
    border-radius: 30px;
}
.switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
input:checked + .switch-slider {
    background-color: #4E60FF;
}
input:checked + .switch-slider:before {
    transform: translateX(20px);
}

/* ===== OPTIMISATIONS RESPONSIVE MOBILE AVANCÉES ===== */
@media (max-width: 768px) {
    /* Touch Target & Safari Zoom Fix */
    input[type="text"], input[type="number"], input[type="email"], input[type="tel"], input[type="url"], input[type="password"], select, textarea {
        font-size: 16px !important;
        min-height: 44px;
    }

    /* Modals Plein Écran Mobile */
    .modal-dialog, .modal {
        width: 95vw !important;
        max-width: 95vw !important;
        margin: 10px auto !important;
        border-radius: 16px !important;
    }
    .modal-body {
        padding: 16px !important;
        max-height: 75vh !important;
        overflow-y: auto;
    }

    /* Grilles et Mises en Page POS & Cartes */
    .pos-grid, .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    /* Boutons de Bannière & Actions */
    .page-banner .d-flex {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .page-banner .btn {
        width: 100% !important;
        justify-content: center !important;
        margin-bottom: 6px;
    }

    /* Tableaux Défilables Tactiles */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
        margin-bottom: 16px;
    }

    /* Boutons d'actions dans les tableaux */
    .table-action-btns {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }
    .table-action-btns .btn {
        flex: 1 1 100%;
        min-height: 38px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    .main-content {
        padding: 10px 8px !important;
    }
    .top-bar {
        padding: 10px 12px !important;
    }
    .top-bar-right .date-now {
        display: none !important;
    }
    .header-card, .page-banner {
        padding: 16px 14px !important;
        border-radius: 14px !important;
    }
    .header-card h1 {
        font-size: 1.25rem !important;
    }
    .header-card p {
        font-size: 0.8rem !important;
    }
}


