/* =============================================
   POINTAGE SF - Feuille de style principale
   Couleurs : StayHere.ma (Navy #1B2A4A · Or #C9A84C)
   ============================================= */

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

:root {
    /* ── Brand StayHere ── */
    --sh-navy:        #1B2A4A;
    --sh-navy-dark:   #111D34;
    --sh-navy-light:  #243460;
    --sh-gold:        #C9A84C;
    --sh-gold-dark:   #a8872e;
    --sh-gold-light:  #F5EDD6;
    --sh-cream:       #FBF8F2;

    /* ── Aliases applicatifs ── */
    --primary:        var(--sh-gold);
    --primary-dark:   var(--sh-gold-dark);
    --primary-light:  var(--sh-gold-light);
    --secondary:      #5f6368;
    --success:        #34a853;
    --warning:        #f59e0b;
    --danger:         #ea4335;
    --sidebar-bg:     var(--sh-navy);
    --sidebar-text:   #94a3b8;
    --sidebar-active: #f1f5f9;
    --bg:             #f8f9fc;
    --card-bg:        #ffffff;
    --border:         #e2e8f0;
    --text:           #1e293b;
    --text-muted:     #64748b;
    --shadow:         0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md:      0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --radius:         8px;
    --sidebar-w:      260px;
    --topbar-h:       64px;
    --font:           'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

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

/* ---- SIDEBAR ---- */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sh-navy);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform .25s ease;
    overflow-y: auto;
    border-right: 1px solid rgba(255,255,255,.06);
}

.sidebar-header {
    padding: 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

/* ── Logo StayHere ── */
.sidebar-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    gap: 8px;
}

.sidebar-logo-img {
    height: 38px;
    width: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 24px; }
.logo-text { font-size: 16px; font-weight: 800; color: #f1f5f9; letter-spacing: -.3px; }

.sidebar-toggle { background: none; border: none; color: var(--sidebar-text); cursor: pointer; font-size: 18px; display: none; }

.sidebar-user {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: 8px;
}

.user-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--sh-gold);
    color: var(--sh-navy);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 13px;
    flex-shrink: 0;
}

.user-name { color: #f1f5f9; font-weight: 600; font-size: 13px; }
.user-role { color: var(--sidebar-text); font-size: 11px; margin-top: 1px; }

.sidebar-nav { flex: 1; padding: 4px 8px; }

.nav-section {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--sidebar-text);
    padding: 16px 8px 6px;
    opacity: .6;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all .15s;
    font-size: 13.5px;
    margin-bottom: 2px;
    cursor: pointer;
}

.nav-item:hover { background: rgba(201,168,76,.12); color: var(--sh-gold); }
.nav-item.active { background: var(--sh-gold); color: var(--sh-navy); font-weight: 700; }
.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }

/* ---- SUBMENU STYLES ---- */
.nav-parent {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    margin-bottom: 4px;
}

.nav-parent > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: var(--radius);
    color: var(--sidebar-text);
    transition: all .15s;
    font-size: 13.5px;
}

.nav-parent > div:first-child:hover {
    background: rgba(201,168,76,.12);
    color: var(--sh-gold);
}

.nav-arrow {
    font-size: 11px;
    transition: transform .2s;
    color: var(--sidebar-text);
    margin-left: 8px;
}

.nav-parent.expanded .nav-arrow {
    transform: rotate(90deg);
}

.nav-submenu {
    display: none;
    background: rgba(0,0,0,.15);
    border-radius: 6px;
    margin: 4px 8px 0 8px;
    padding: 6px 0;
    overflow: hidden;
}

.nav-submenu.show {
    display: block;
}

.nav-subitem {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px 9px 32px !important;
    margin-bottom: 0 !important;
    font-size: 12.5px;
    border-radius: 4px;
    border-left: 3px solid transparent;
    transition: all .15s;
    color: var(--sidebar-text);
}

.nav-subitem:hover {
    background: rgba(201,168,76,.25) !important;
    border-left-color: var(--sh-gold) !important;
    color: var(--sh-gold) !important;
}

.nav-subitem.active {
    background: rgba(201,168,76,.30) !important;
    border-left-color: var(--sh-gold) !important;
    color: var(--sh-gold) !important;
    font-weight: 600;
}

.sidebar-footer { padding: 8px; border-top: 1px solid rgba(255,255,255,.08); }
.logout-btn { color: #fca5a5 !important; }
.logout-btn:hover { background: rgba(239,68,68,.15) !important; }

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

.top-bar {
    height: var(--topbar-h);
    background: var(--card-bg);
    border-bottom: 2px solid var(--sh-gold);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow);
}

.top-bar-left { display: flex; align-items: center; gap: 12px; }
.mobile-menu-btn { display: none; background: none; border: none; font-size: 20px; cursor: pointer; }
.page-title { font-size: 18px; font-weight: 700; color: var(--text); }
.current-date { font-size: 13px; color: var(--text-muted); }

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

/* ---- CARDS ---- */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.card-title { font-size: 15px; font-weight: 700; color: var(--text); }
.card-body { padding: 20px; }

/* ---- STATS ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: box-shadow .2s;
}

.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-icon { font-size: 28px; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }

.stat-card.blue  { border-left: 4px solid var(--primary); }
.stat-card.green { border-left: 4px solid var(--success); }
.stat-card.yellow{ border-left: 4px solid var(--warning); }
.stat-card.red   { border-left: 4px solid var(--danger); }
.stat-card.gray  { border-left: 4px solid var(--secondary); }
.stat-card.purple{ border-left: 4px solid #7c3aed; }

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all .15s;
    white-space: nowrap;
    font-family: var(--font);
}

.btn-primary { background: var(--sh-gold); color: var(--sh-navy); font-weight: 700; }
.btn-primary:hover { background: var(--sh-gold-dark); color: #fff; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #2d9147; }
.btn-danger  { background: var(--danger); color: white; }
.btn-danger:hover  { background: #c62828; }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #d1d9e0; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 6px 8px; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 5px; }

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 13.5px;
    font-family: var(--font);
    color: var(--text);
    background: white;
    transition: border .15s, box-shadow .15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--sh-gold);
    box-shadow: 0 0 0 3px rgba(201,168,76,.18);
}

.form-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

/* ---- TABLE ---- */
.table-wrapper { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
    padding: 10px 12px;
    background: var(--bg);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .6px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    text-align: left;
}
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
tbody tr:hover { background: var(--sh-gold-light); }
tbody tr:last-child td { border-bottom: none; }

/* ---- GRILLE POINTAGE ---- */
.pointage-grid-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pointage-grid { border-collapse: collapse; font-size: 11.5px; min-width: 100%; }

.pointage-grid th, .pointage-grid td {
    border: 1px solid var(--border);
    padding: 0;
    text-align: center;
    white-space: nowrap;
}

.pointage-grid thead th {
    background: var(--sh-navy);
    color: white;
    padding: 6px 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .3px;
    min-width: 32px;
    text-transform: none;
}

.pointage-grid .th-info { min-width: 140px; text-align: left; padding: 6px 8px; }
.pointage-grid .th-recap { background: #1a3a5c; min-width: 36px; }

.pointage-grid .td-info { text-align: left; padding: 4px 8px; background: #fafbfc; font-weight: 500; position: sticky; left: 0; z-index: 2; }
.pointage-grid .td-nom  { min-width: 120px; font-weight: 600; }
.pointage-grid .td-num  { min-width: 60px; color: var(--text-muted); font-size: 11px; }
.pointage-grid .td-poste { min-width: 80px; font-size: 11px; }
.pointage-grid .td-affec { min-width: 80px; font-size: 11px; color: var(--text-muted); }

.pointage-grid .td-recap {
    background: #eef2ff;
    font-weight: 700;
    font-size: 12px;
    padding: 4px 6px;
    color: #1a3a5c;
}

.pointage-grid .cell-input {
    width: 30px; height: 32px;
    border: none; outline: none;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font);
    text-transform: uppercase;
    cursor: pointer;
    background: transparent;
    width: 100%;
    padding: 0;
}

.pointage-grid .day-cell {
    min-width: 32px;
    max-width: 40px;
    cursor: pointer;
    transition: filter .1s;
}

.pointage-grid .day-cell:hover { filter: brightness(.92); }
.pointage-grid .weekend { background: #f1f5f9 !important; }
.pointage-grid .th-weekend { background: #334155 !important; }

/* Code colors */
.code-1    { background: #dcfce7; color: #166534; }
.code-M, .code-m, .code-MALADIE { background: #fef9c3; color: #854d0e; }
.code-C, .code-c { background: #dbeafe; color: #1e40af; }
.code-R, .code-r, .code-RECUP, .code-RC { background: #ede9fe; color: #5b21b6; }
.code-D, .code-d { background: #fee2e2; color: #991b1b; }
.code-A, .code-a { background: #fecaca; color: #991b1b; }
.code-OFF, .code-off { background: #f1f5f9; color: #64748b; }
.code-AT { background: #fde8d8; color: #9a3412; }
.code-F   { background: #e5e7eb; color: #374151; }
.code-MAP { background: #fef3c7; color: #92400e; }
.code-DS  { background: #fce7f3; color: #9d174d; font-weight: 800; }

/* ---- LEGEND ---- */
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.legend-item {
    display: flex; align-items: center; gap: 5px;
    font-size: 11px; font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}

/* ---- ALERTS ---- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
    font-size: 13.5px;
}

.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-danger   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning  { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.alert-info     { background: var(--primary-light); color: #1e40af; border: 1px solid #93c5fd; }
.alert-close { background: none; border: none; font-size: 18px; cursor: pointer; color: inherit; opacity: .6; }

/* ---- BADGE ---- */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-secondary { background: #e2e8f0; color: #475569; }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }

/* ---- MISC ---- */
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.font-bold { font-weight: 700; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab {
    padding: 8px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all .15s;
    font-family: var(--font);
    text-decoration: none;
}
.tab.active, .tab:hover { color: var(--sh-gold); border-color: var(--sh-gold); }

/* Login page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(150deg, var(--sh-navy-dark) 0%, var(--sh-navy) 55%, var(--sh-navy-light) 100%);
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
    border-top: 4px solid var(--sh-gold);
}

.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .icon { font-size: 56px; display: block; margin-bottom: 8px; }
.login-logo h1 { font-size: 22px; font-weight: 800; color: var(--text); }
.login-logo p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    padding: 20px;
    opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    transform: translateY(-20px);
    transition: transform .2s;
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-muted); padding: 0; line-height: 1; }
.modal-body  { padding: 20px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* Context menu for pointage cells */
.ctx-menu {
    position: fixed;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    z-index: 500;
    min-width: 160px;
    overflow: hidden;
    display: none;
}
.ctx-menu.show { display: block; }
.ctx-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
    margin: 2px;
    transition: background .1s;
}
.ctx-item:hover { background: var(--bg); }
.ctx-swatch { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }

/* ====================================================
   RESPONSIVE — Téléphone & iPad
   ≤ 1024px = tablette  |  ≤ 768px = mobile  |  ≤ 480px = petit mobile
   ==================================================== */

/* ── Overlay sidebar ────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 99;
    -webkit-tap-highlight-color: transparent;
}

/* ── iPad / tablette (≤ 1024px) ─────────────────── */
@media (max-width: 1024px) {

    :root { --sidebar-w: 230px; }

    .content-body { padding: 16px; }

    .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }

    .grid-2 { grid-template-columns: 1fr 1fr; gap: 14px; }
    .grid-3 { grid-template-columns: 1fr 1fr; gap: 14px; }

    /* Charts : 2 col → 1 col */
    #chartsGrid {
        grid-template-columns: 1fr !important;
    }
    #chartsGrid > div {
        grid-column: 1 !important;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }
    .page-header > div:last-child {
        width: 100%;
        flex-wrap: wrap;
    }
}

/* ── Mobile (≤ 768px) ───────────────────────────── */
@media (max-width: 768px) {

    /* Sidebar slide-in */
    .sidebar {
        transform: translateX(-100%);
        z-index: 200;
        width: 82vw;
        max-width: 300px;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .sidebar-toggle { display: block; }

    /* Burger visible */
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 38px; height: 38px;
        border-radius: 8px;
        color: var(--text);
        font-size: 20px;
    }

    /* Contenu pleine largeur */
    .main-content { margin-left: 0; }

    /* Padding compact */
    .content-body { padding: 10px; }

    /* Topbar compacte */
    .top-bar { padding: 0 10px; height: 54px; }
    .page-title { font-size: 15px; }
    .current-date { display: none; }

    /* Stats 2 colonnes */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
    .stat-card { padding: 12px; }
    .stat-value { font-size: 22px; }
    .stat-icon  { font-size: 22px; }
    .stat-label { font-size: 11px; }

    /* Toutes grilles → 1 col */
    .grid-2, .grid-3 { grid-template-columns: 1fr !important; gap: 10px; }

    /* Formulaires 1 col */
    .form-row { grid-template-columns: 1fr !important; gap: 0; }
    .form-group { margin-bottom: 12px; }
    .form-control { font-size: 16px; } /* évite zoom iOS */

    /* Cards */
    .card { border-radius: 8px; }
    .card-header {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .card-title { font-size: 14px; }
    .card-body  { padding: 12px; }

    /* Boutons touch-friendly */
    .btn { padding: 9px 14px; font-size: 13px; touch-action: manipulation; }
    .btn-sm { padding: 6px 10px; font-size: 11.5px; }

    /* Tableaux */
    .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    tbody td { padding: 8px 10px; font-size: 13px; }
    thead th { padding: 8px 10px; font-size: 11px; white-space: nowrap; }

    /* En-têtes de page */
    .page-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px;
    }
    .page-header h1, .page-title { font-size: 15px !important; }
    .page-subtitle { font-size: 12px; }
    .page-header > div:last-child {
        width: 100%;
        flex-wrap: wrap;
        gap: 6px;
    }

    /* Modals → bottom sheet */
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
    .modal {
        max-width: 100% !important;
        max-height: 95dvh;
        border-radius: 18px 18px 0 0;
        overflow-y: auto;
    }
    .modal-header { padding: 14px 16px 10px; }
    .modal-body   { padding: 14px 16px; }
    .modal-footer { padding: 12px 16px; }

    /* Login */
    .login-wrapper { padding: 12px; }
    .login-card { padding: 22px 16px; border-radius: 14px; }
    .login-logo .icon { font-size: 44px; }
    .login-logo h1 { font-size: 18px; }

    /* Rapport — mini stats */
    .stat-mini { padding: 7px 9px; min-width: 50px; }
    .stat-mini .val { font-size: 17px; }
    .stat-mini .lbl { font-size: 9px; }

    /* Rapport — légende */
    .legend { gap: 5px; }
    .legend-item { font-size: 10px; padding: 2px 5px; }

    /* Rapport — toolbar */
    .toolbar-card .card-body > div {
        flex-direction: column !important;
        gap: 10px;
    }
    .toolbar-card select,
    .toolbar-card .form-control { width: 100% !important; font-size: 15px; }

    /* Grille pointage : col nom sticky */
    .pointage-grid-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .pointage-grid { font-size: 11px; }
    .pointage-grid .td-info { position: sticky; left: 0; z-index: 3; background: #fafbfc; }

    /* Charts empilés */
    #chartsGrid {
        grid-template-columns: 1fr !important;
        padding: 10px !important;
        gap: 10px !important;
    }
    #chartsGrid > div { grid-column: 1 !important; }

    /* Stock — cartes */
    .stock-grid { grid-template-columns: 1fr !important; }

    /* Caisse info bar */
    #caisseInfo { font-size: 12px !important; padding: 6px 10px !important; }

    /* Achats — filtres inline */
    .page-header form { width: 100%; }
    .page-header select,
    .page-header input { min-width: 0 !important; width: 100% !important; }

    /* Flex wrappers */
    .flex.gap-2, .flex.gap-3 { flex-wrap: wrap; }
    .justify-between { flex-wrap: wrap; gap: 8px; }

    /* Tabs scrollables */
    .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
    .tab  { white-space: nowrap; flex-shrink: 0; }

    /* Badges inline */
    .badge { font-size: 10px; padding: 2px 6px; }

    /* Alertes */
    .alert { font-size: 13px; padding: 10px 12px; flex-wrap: wrap; gap: 8px; }
}

/* ── Petit mobile (≤ 480px) ─────────────────────── */
@media (max-width: 480px) {

    .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-value { font-size: 20px; }

    .btn { padding: 8px 12px; font-size: 12.5px; }
    .btn-sm { padding: 5px 8px; font-size: 11px; }

    .content-body { padding: 8px; }

    .card-header { padding: 8px 10px; }
    .card-body   { padding: 10px; }

    .modal-body { padding: 10px 12px; }
    .modal-header { padding: 12px 12px 8px; }
    .modal-footer { padding: 10px 12px; }

    .top-bar { height: 50px; }
    .page-title { font-size: 14px !important; }

    /* Tables actions serrées */
    tbody td { padding: 6px 8px; }
    .flex.gap-2 { gap: 4px; }
}


