/* ===== Base ===== */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    background: #f2f4f8;
    color: #1f2733;
}

h1 { font-size: 1.5rem; margin: 1rem 0; }
h2 { font-size: 1.1rem; margin: 0 0 .8rem; color: #33415c; }

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: #7a8699; }

/* ===== Barre du haut ===== */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1d3557;
    color: #fff;
    padding: .6rem 1.2rem;
}
.topbar-title { font-weight: 700; font-size: 1.1rem; }
.topbar-nav { display: flex; align-items: center; gap: 1rem; }
.topbar-nav a { color: #cfe0ff; }
.topbar-user { color: #9fb4d8; font-size: .9rem; }

/* Drapeaux de langue dans l'entête */
.lang-switch { display: flex; align-items: center; gap: .2rem; margin: 0; }
.lang-flag {
    background: none;
    border: 2px solid transparent;
    border-radius: 6px;
    font-size: 1.25rem;
    line-height: 1;
    padding: .15rem .25rem;
    cursor: pointer;
    opacity: .4;
    transition: opacity .1s, border-color .1s, background .1s;
}
.lang-flag { opacity: 1; background: #fff; border-color: #fff; }
.lang-flag:hover { background: #f1f5f9; }
.lang-actif { background: #fde047; border-color: #fde047; } /* langue active : fond JAUNE */
.lang-actif:hover { background: #fde047; }

.container { max-width: 1000px; margin: 0 auto; padding: 0 1.2rem 3rem; }

/* ===== Cartes / sections ===== */
.card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.2rem;
    margin-bottom: 1.2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

/* ===== Menu de la page support ===== */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
    margin-top: 1.5rem;
}
.menu-card {
    display: block;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.8rem 1.2rem;
    text-align: center;
    color: inherit;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    transition: transform .1s, box-shadow .1s;
}
.menu-card:hover {
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.menu-card-btn { font-family: inherit; font-size: inherit; cursor: pointer; width: 100%; }
.menu-card-alerte { border: 2px solid #f59e0b; background: #fffbeb; }
.menu-card-alerte .menu-label { color: #b45309; }
.menu-card { position: relative; }
.badge-pastille {
    position: absolute;
    top: 10px;
    right: 10px;
    min-width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 .45rem;
    background: #dc2626;
    color: #fff;
    border-radius: 999px;
    font-size: .95rem;
    font-weight: 700;
    box-shadow: 0 2px 5px rgba(0,0,0,.25);
}
.menu-icon { font-size: 2.4rem; }
.menu-label { font-weight: 700; font-size: 1.2rem; margin-top: .5rem; color: #1d3557; }
.menu-desc { color: #7a8699; font-size: .9rem; margin-top: .3rem; }

/* ===== Comptage du jour ===== */
.menu-card-action .menu-label { font-size: 1.5rem; }
.menu-card-action .menu-icon { font-size: 3.2rem; }

.totaux {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: .6rem;
    margin-bottom: .8rem;
}
.total-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: .5rem .8rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.total-label { font-size: .75rem; text-transform: uppercase; color: #64748b; font-weight: 600; }
.total-value { font-size: 1.3rem; font-weight: 700; color: #1d3557; margin-top: .1rem; }
.total-card-fdc { background: #fffbeb; border-color: #fde68a; }
.total-card-fdc .total-label { color: #b45309; }
.total-card-fdc .total-value { color: #92400e; }
.fdc-report {
    display: block;
    font-size: .95rem;
    font-weight: 700;
    color: #b45309;
    line-height: 1.1;
}
.total-card-grand { background: #1d3557; border-color: #1d3557; }
.total-card-grand .total-label { color: #9fb4d8; }
.total-card-grand .total-value { color: #fff; font-size: 1.5rem; }

/* Page comptage : utilise toute la hauteur de l'écran, quelle que soit la résolution */
body.comptage-page { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
body.comptage-page .container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    padding-bottom: .8rem;
}
body.comptage-page h1 { display: none; }
.back-link { margin: .5rem 0; font-size: .9rem; }

/* Bouton RETOUR */
.btn-retour {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin: .6rem 0;
    padding: .55rem 1.2rem;
    border-radius: 8px;
    background: #1d3557;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .05em;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
    transition: background .1s, transform .05s;
}
.btn-retour:hover { background: #2b4a7a; text-decoration: none; transform: translateX(-2px); }
body.comptage-page .btn-retour { padding: .35rem .9rem; margin: .35rem 0; font-size: .9rem; }

.bills-grid {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
    gap: .7rem;
}
.bill-cell {
    position: relative;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}
.bill-note {
    height: 85%;
    max-width: calc(100% - 5.5rem);
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    transition: transform .06s, filter .06s;
}
.bill-note img {
    height: 100%;
    width: auto;
    max-width: 100%;
    display: block;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
    user-select: none;
}
.bill-note:hover { filter: brightness(1.06); }
.bill-note:active { transform: scale(.98); }
/* Colonne à droite du billet : compteur (grand) + bouton clavier en dessous */
.bill-droite {
    display: flex;
    flex-direction: column;
    align-items: stretch; /* le bouton calculette prend la largeur du compteur */
    gap: .45rem;
}
.bill-saisir {
    border: none;
    background: none;
    font-size: 2.8rem;
    padding: 0;
    line-height: 1;
    text-align: center;
    width: 100%;
    cursor: pointer;
    transition: transform .08s;
}
.bill-saisir:hover { transform: scale(1.15); }

.bill-count {
    min-width: 4.6rem;
    padding: .4rem .8rem;
    font-size: 2.3rem;
    font-weight: 700;
    background: #fff;
    border: 2px solid #cbd5e1;
    border-radius: 12px;
    color: #1f2733;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
    flex-shrink: 0;
}
.bill-count:hover { background: #fee2e2; border-color: #dc2626; color: #dc2626; }
.monnaie-tile {
    /* Même gabarit que les billets : 85 % de la hauteur de la case, format 2:1 */
    height: 85%;
    aspect-ratio: 2 / 1;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    /* Photo : Santeri Viinamäki, CC BY-SA 4.0, Wikimedia Commons
       ("Different 1€ and 2€ euro coins") */
    background: url('img/monnaie.jpg') center/cover no-repeat;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
    transition: filter .06s, transform .06s;
}
.count-ghost { visibility: hidden; pointer-events: none; }

/* Bouton OK de fin de comptage */
.ok-btn {
    border: none;
    border-radius: 10px;
    background: #16a34a;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0 1.5rem;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
    transition: background .1s, transform .05s;
}
.ok-btn:hover { background: #15803d; }
.ok-btn:active { transform: scale(.97); }

/* Fenêtre de confirmation + billets à enlever */
.modal-text { text-align: center; color: #33415c; margin: 0 0 1.2rem; line-height: 1.5; }
.modal.modal-retrait { max-width: 440px; }
.retrait-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    margin-bottom: .7rem;
}
.retrait-row img {
    height: 56px;
    width: auto;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.retrait-x {
    font-size: 2.4rem;
    font-weight: 800;
    color: #dc2626;
    white-space: nowrap;
}
.retrait-aucun { text-align: center; color: #64748b; font-size: 1.1rem; }
.code-input {
    display: block;
    width: 10rem;
    margin: 0 auto .6rem;
    padding: .6rem;
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: .3rem;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
}
.code-input:focus { outline: 3px solid #93b4f5; border-color: #2563eb; }
.modal-error { text-align: center; color: #dc2626; font-weight: 600; margin: 0 0 .8rem; }
/* Fenêtre de choix du tiroir (tiroir partagé) : jusqu'à 3 colonnes */
.modal.modal-tiroirs { max-width: min(92vw, 880px); width: auto; min-width: 340px; }
.tiroir-liste {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: .7rem;
    margin-bottom: .4rem;
}
.tiroir-liste form { margin: 0; height: 100%; }
.tiroir-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    height: 100%;
    padding: .9rem 1.1rem;
    border: none;
    border-radius: 12px;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
    font-size: 1.15rem;
    transition: background .1s, transform .05s;
}
.tiroir-btn:hover { background: #1d4ed8; }
.tiroir-btn:active { transform: scale(.98); }
.tiroir-nom { font-weight: 700; }
.tiroir-fdc { font-weight: 600; opacity: .9; }
.tiroir-utilise {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
}
.tiroir-note { font-size: .85rem; font-style: italic; }
.imp-tiroir { font-size: 19px; font-weight: 700; text-align: center; margin: 0 0 36px; }

.bloque-choix { margin-top: 1rem; }
.bloque-choix .btn { margin-bottom: .6rem; text-align: center; }
.bloque-choix .btn:last-child { margin-bottom: 0; }

/* Import de rapports PDF */
#fichiers { margin: .5rem 0 1rem; font-size: 1rem; }
.import-ligne {
    padding: .5rem .8rem;
    border-radius: 8px;
    background: #f1f5f9;
    margin-bottom: .4rem;
    font-size: .95rem;
}
.import-ok { background: #dcfce7; color: #166534; }
.import-erreur { background: #fee2e2; color: #991b1b; }
/* Bouton TRAITER : même gabarit que le bouton RETOUR, sur la même ligne */
.btn-traiter {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin: .6rem 0 .6rem .8rem;
    padding: .55rem 1.2rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .05em;
    border-radius: 8px;
    vertical-align: top;
}

/* Tables compactes : chaque cellule reste sur UNE seule ligne */
.table-nowrap th, .table-nowrap td { white-space: nowrap; }
.col-fichier {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Fenêtre interne de visualisation d'un PDF */
.modal.modal-pdf {
    max-width: 90vw;
    width: 90vw;
    height: 90vh;
    display: flex;
    flex-direction: column;
}
.modal-pdf .modal-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#pdf-frame {
    flex: 1;
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: #f1f5f9;
}
.modal-pdf .modal-actions { flex: 0 0 auto; }

/* Page DATA (admin) */
.cashier-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.cashier-pill {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .9rem;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #1f2733;
    font-weight: 600;
}
.cashier-pill:hover { background: #eff6ff; border-color: #2563eb; text-decoration: none; }
.cashier-actif { background: #2563eb; border-color: #2563eb; color: #fff; }
.cashier-actif:hover { background: #1d4ed8; }
.cashier-num {
    background: rgba(0,0,0,.12);
    border-radius: 999px;
    padding: .05rem .5rem;
    font-size: .85rem;
}
.cashier-actif .cashier-num { background: rgba(255,255,255,.25); }
.data-titre { font-size: 1rem; color: #1d3557; margin: 1.2rem 0 .5rem; }
.data-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0 1.5rem;
}
.retrait-info {
    background: #f1f5f9;
    border-radius: 10px;
    padding: .8rem;
    text-align: center;
    color: #33415c;
    margin: 1rem 0;
    line-height: 1.6;
}
.monnaie-tile:hover { filter: brightness(1.08); }
.monnaie-tile:active { transform: scale(.98); }
.monnaie-label {
    background: rgba(15, 118, 110, .88);
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    padding: .35rem 1rem;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,.3);
    white-space: nowrap;
}
.monnaie-tile { position: relative; }
/* Montant de monnaie saisi : cadre blanc posé sur la photo */
.monnaie-badge {
    position: absolute;
    right: 8px;
    bottom: 6px;
    background: #fff;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    color: #1d3557;
    font-size: 1.15rem;
    font-weight: 700;
    padding: .15rem .55rem;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
    white-space: nowrap;
}
.monnaie-badge[hidden] { display: none; }

/* ===== Page magasin (support) ===== */
.shop-head { display: flex; align-items: center; gap: 1.2rem; }
.shop-head-code {
    background: #1d3557;
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: .2rem;
    border-radius: 12px;
    padding: .8rem 1.1rem;
}
.shop-head-nom { font-size: 1.5rem; font-weight: 700; color: #1d3557; }
.shop-head-infos { color: #64748b; margin-top: .2rem; }

.add-user-btn { font-size: 1.15rem; font-weight: 700; padding: .8rem 1.6rem; margin-bottom: 1.2rem; }
.modal.modal-wide { max-width: 640px; }

.fdc-form { display: flex; align-items: center; gap: .3rem; margin: 0; font-weight: 600; }
.fdc-input {
    width: 90px !important;
    display: inline-block !important;
    margin: 0 !important;
    text-align: right;
    font-weight: 600;
}
.row-hold td { opacity: .55; }
.row-hold .actions { opacity: 1; }
.badge-hold { background: #fee2e2; color: #b91c1c; margin-left: .5rem; }
.btn-hold { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
.btn-hold:hover { background: #fde68a; }
.btn-hold-on { background: #b45309; border-color: #b45309; color: #fff; }
.btn-hold-on:hover { background: #92400e; }

/* ===== Page comptages (admin) ===== */
.date-nav {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
}
.date-nav input[type=date] {
    width: auto;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    padding: .45rem .7rem;
}
.date-jour { font-size: 1.15rem; font-weight: 700; color: #1d3557; margin-left: .5rem; }

.detail-table { margin-bottom: .5rem; }
.detail-table td, .detail-table th { padding: .35rem .6rem; }
/* Colonnes Compté / Enlevé : chiffres centrés */
.detail-table th:nth-child(2), .detail-table td:nth-child(2),
.detail-table th:nth-child(3), .detail-table td:nth-child(3) { text-align: center; }
.detail-img { height: 22px; width: auto; border-radius: 3px; vertical-align: middle; margin-right: .4rem; }
.detail-retrait { color: #dc2626; font-size: 1.1rem; }
/* Boutons-icônes sobres dans des cadres (œil = détail, poubelle = supprimer) */
.btn-icone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
    transition: background .1s, border-color .1s, color .1s;
}
.btn-icone svg { width: 18px; height: 18px; }
.btn-oeil:hover { color: #2563eb; border-color: #2563eb; background: #eff6ff; }
.btn-poubelle:hover { color: #dc2626; border-color: #dc2626; background: #fee2e2; }
.btn-pdf:hover { color: #7c3aed; border-color: #7c3aed; background: #f3e8ff; }

/* Différence cash rapport / prélevé */
.diff-rouge { color: #dc2626; font-weight: 700; }
.diff-verte { color: #16a34a; font-weight: 700; }

/* Cadre « Différence du jour » */
.carte-diff { text-align: center; padding: .9rem 1.2rem; }
.carte-diff-label {
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .08em;
    color: #64748b;
    text-transform: uppercase;
}
.carte-diff-valeur { font-size: 1.9rem; font-weight: 800; margin-top: .2rem; }

/* Colonnes d'icônes : une icône par colonne, centrée */
th.col-ico, td.col-ico { width: 44px; text-align: center; padding-left: .25rem; padding-right: .25rem; }

/* Fenêtre « Que voulez-vous faire ? » : boutons avant/après travail */
.modal.modal-mode { max-width: 460px; }
.modal-mode .modal-title { margin-bottom: 1.4rem; font-size: 1.35rem; }
.modal-mode form { margin: 0 0 1.2rem; }
.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .55rem;
    width: 100%;
    padding: 1.5rem 1rem;
    border: none;
    border-radius: 16px;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,.18);
    transition: transform .08s, box-shadow .08s, filter .08s;
}
.mode-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,.25); filter: brightness(1.06); }
.mode-btn:active { transform: scale(.98); }
.mode-ico { font-size: 2.8rem; line-height: 1; }
.mode-txt { font-size: 1.15rem; font-weight: 800; letter-spacing: .04em; }
.mode-avant { background: linear-gradient(135deg, #f59e0b, #ea580c); }
.mode-apres { background: linear-gradient(135deg, #3b5bdb, #1d3557); }
.mode-sortir { margin-top: .4rem; text-align: center; }

/* Mode inventaire (comptage avant travail) */
.bandeau-inventaire {
    background: #f59e0b;
    color: #fff;
    text-align: center;
    font-weight: 800;
    letter-spacing: .06em;
    border-radius: 8px;
    padding: .35rem .8rem;
    margin-bottom: .5rem;
}
.inv-ecart { display: block; font-size: 1.25rem; margin-top: .4rem; }
.inv-alerte {
    color: #dc2626;
    font-weight: 800;
    text-align: center;
    font-size: 1.05rem;
    line-height: 1.5;
    margin: 0 0 1rem;
}

/* Document imprimé INVENTAIRE : layout volontairement différent (pointillés) */
.inv-cadre { border: 4px dashed #000; border-radius: 14px; padding: 24px; }
.inv-titre {
    font-size: 32px;
    font-weight: 800;
    text-align: center;
    letter-spacing: .12em;
    text-transform: uppercase;
    text-decoration: underline;
}
.inv-sous { font-size: 17px; text-align: center; margin-top: 10px; }
.inv-boxes { display: flex; gap: 20px; margin: 28px 0 32px; }
.inv-box {
    flex: 1;
    border: 2px dashed #000;
    border-radius: 10px;
    padding: 14px 8px;
    text-align: center;
}
.inv-box-titre { font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.inv-box-valeur { font-size: 26px; font-weight: 800; margin-top: 8px; }
.inv-ko .inv-box-valeur { text-decoration: underline; }

/* Rapport de tiroir sans comptage : ligne rouge */
tr.ligne-rouge td { background: #fee2e2; }
tr.ligne-rouge:hover td { background: #fecaca; }

.detail-lines { margin: .8rem 0; }
.detail-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .4rem .6rem;
    border-bottom: 1px solid #e8edf3;
    font-size: 1.02rem;
}
.detail-line:nth-child(odd) { background: #f8fafc; }
.detail-line strong { color: #1d3557; }

/* ===== Fenêtre maison (modal) + clavier numérique ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
}
.modal-overlay[hidden] { display: none; }
.modal {
    background: #fff;
    border-radius: 14px;
    padding: 1.6rem;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 10px 40px rgba(0,0,0,.4);
}
.modal-title { margin: 0 0 .8rem; font-size: 1.2rem; font-weight: 700; color: #1d3557; text-align: center; }
.keypad-display {
    background: #f1f5f9;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    font-size: 2.2rem;
    font-weight: 700;
    text-align: right;
    padding: .6rem 1rem;
    margin-bottom: 1rem;
    color: #1d3557;
    min-height: 3.4rem;
}
.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .6rem;
    margin-bottom: 1rem;
}
.keypad button {
    font-size: 1.8rem;
    font-weight: 700;
    padding: .9rem;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #1f2733;
    cursor: pointer;
}
.keypad button:hover { background: #f1f5f9; }
.keypad button:active { background: #e2e8f0; }

/* GRAND clavier de saisie du nombre de billets */
.modal.modal-nombre { max-width: 440px; width: 440px; }
.keypad-display-grand { font-size: 3rem; padding: .8rem 1.2rem; }
.keypad-grand { gap: .8rem; }
.keypad-grand button { font-size: 2.4rem; padding: 1.25rem; }
.nombre-billet { height: 1.6em; vertical-align: middle; border-radius: 3px; margin-right: .3rem; }
.modal-actions { display: flex; gap: .8rem; }
.modal-actions[hidden] { display: none; }
.modal-actions .btn { flex: 1; }
/* Fenêtres à formulaire (tiroir, code, ...) : champs et boutons aérés */
.modal form > label { margin-bottom: 1rem; }
.modal form > .modal-actions { margin-top: 1.4rem; }

/* ===== Formulaires ===== */
label { display: block; font-size: .9rem; font-weight: 600; color: #33415c; }
label small { font-weight: 400; color: #7a8699; }

input[type=text], input[type=password], input[type=number],
input[type=tel], input[type=date], select {
    display: block;
    width: 100%;
    margin-top: .3rem;
    padding: .5rem .6rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: .95rem;
    background: #fff;
}
input:focus, select:focus { outline: 2px solid #93b4f5; border-color: #2563eb; }

.form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}
.form-inline label { flex: 1 1 180px; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    align-items: end;
}

.form-actions { display: flex; gap: .5rem; }
.form-full { grid-column: 1 / -1; }
#fdc-champ[hidden], #tiroir-champ[hidden] { display: none; }
.badge-partage { background: #e0e7ff; color: #4338ca; }
.ico-tiroir { width: 1.5em; height: .95em; vertical-align: -.1em; display: inline-block; }
.menu-icon .ico-tiroir { width: 3.6rem; height: 2.3rem; color: #1d3557; }

/* ===== Boutons ===== */
.btn {
    display: inline-block;
    padding: .5rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #1f2733;
    font-size: .95rem;
    cursor: pointer;
}
.btn:hover { background: #f1f5f9; text-decoration: none; }
.btn-primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-danger { background: #dc2626; border-color: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-small { padding: .25rem .6rem; font-size: .85rem; }
.btn-block { width: 100%; }

/* ===== Tableaux ===== */
table { width: 100%; border-collapse: collapse; }
th, td { padding: .55rem .6rem; text-align: left; border-bottom: 1px solid #e8edf3; }
th { background: #f8fafc; font-size: .85rem; text-transform: uppercase; color: #64748b; }
tr:hover td { background: #f8fafc; }

.actions { display: flex; gap: .4rem; align-items: center; }
.actions form { margin: 0; display: inline; }

/* ===== Badges ===== */
.badge {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge-support { background: #ede9fe; color: #6d28d9; }
.badge-administrateur { background: #fef3c7; color: #b45309; }
.badge-user { background: #dbeafe; color: #1d4ed8; }
.badge-download { background: #ccfbf1; color: #0f766e; }
.badge-role { display: inline-block; width: 92px; text-align: center; }
.badge-traite { background: #dcfce7; color: #166534; }
.badge-attente { background: #fef3c7; color: #b45309; }
.badge-erreur { background: #fee2e2; color: #991b1b; }

/* ===== Messages flash ===== */
.flash {
    padding: .7rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: .95rem;
}
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.flash-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* ===== Bannière magasin lié (pages support) ===== */
.shop-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: #0f766e;
    color: #fff;
    padding: 1rem 1.5rem;
    font-size: 1.3rem;
}
.shop-banner strong { font-size: 1.6rem; letter-spacing: .03em; }
.shop-banner form { margin: 0; }
.shop-banner .btn-danger { font-size: 1.05rem; font-weight: 700; padding: .6rem 1.4rem; }
.shop-banner-none { background: #b45309; }

/* Bannière de simulation (support) */
.sim-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: #9333ea;
    color: #fff;
    padding: .7rem 1.5rem;
    font-size: 1.15rem;
}
.sim-banner form { margin: 0; }

/* ===== Écran de liaison poste <-> magasin ===== */
.link-box {
    background: #fff;
    border-radius: 14px;
    padding: 2.5rem;
    width: 100%;
    max-width: 460px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,.3);
}
.link-box h1 { margin: 0; }
.link-title { font-size: 1.5rem; font-weight: 700; color: #1d3557; margin: 1.2rem 0 .2rem; }
.link-subtitle { color: #7a8699; margin: 0 0 1.4rem; font-size: 1.05rem; }
.shop-confirm-btn {
    display: block;
    width: 100%;
    margin: 0 0 1rem;
    padding: 1.1rem;
    background: #2563eb;
    border: none;
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    transition: background .1s, transform .1s;
}
.shop-confirm-btn:hover { background: #1d4ed8; transform: translateY(-1px); }
.shop-confirm-code {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: .5rem;
}
.shop-confirm-nom { display: block; font-size: 1.15rem; margin-top: .2rem; opacity: .9; }
.btn-big { font-size: 1.2rem; padding: .8rem; }
.link-support { margin-top: 1.4rem; font-size: .9rem; }
.link-support a { color: #7a8699; }
.btn-link {
    background: none;
    border: none;
    padding: 0;
    color: #7a8699;
    font-size: .9rem;
    text-decoration: underline;
    cursor: pointer;
}
.btn-link:hover { color: #33415c; }

/* Mode « comptage sans login » : gros boutons de logins en colonnes
   (le nombre de colonnes s'adapte à la largeur de la fenêtre, jusqu'à 7) */
.login-directe {
    width: 96vw;
    max-width: min(96vw, 1500px);
    position: relative; /* ancre de l'icône clé */
}
/* Horloge de l'écran de choix du login (heure serveur/internet) */
.horloge-login {
    position: absolute;
    top: 1.1rem;
    left: 1.2rem;
    font-size: 1.55rem;
    font-weight: 800;
    color: #1d3557;
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
    user-select: none;       /* appui long (5 s) = bascule soucoupe/fusée */
    -webkit-user-select: none;
    touch-action: none;
}

/* Icône clé en haut à droite : connexion avec mot de passe */
.btn-mdp {
    position: absolute;
    top: .9rem;
    right: .9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    color: #33415c;
    background: #fff;
    transition: background .12s, border-color .12s, transform .08s;
}
.btn-mdp svg { width: 1.5rem; height: 1.5rem; }
.btn-mdp:hover { background: #eef2f7; border-color: #94a3b8; transform: scale(1.06); }

/* ===== Animation de fond de l'écran de choix du login : bulles douces ===== */
.fond-anim {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none; /* ne gêne jamais les clics */
    z-index: 0;
}
.fond-anim span {
    position: absolute;
    bottom: -220px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 32%, rgba(255,255,255,.14), rgba(255,255,255,.03) 70%);
    animation: bulle-monte linear infinite;
}
.fond-anim span:nth-child(1) { left: 8%;  width: 150px; height: 150px; animation-duration: 26s; }
.fond-anim span:nth-child(2) { left: 24%; width: 70px;  height: 70px;  animation-duration: 19s; animation-delay: -7s; }
.fond-anim span:nth-child(3) { left: 41%; width: 110px; height: 110px; animation-duration: 31s; animation-delay: -14s; }
.fond-anim span:nth-child(4) { left: 58%; width: 55px;  height: 55px;  animation-duration: 17s; animation-delay: -3s; }
.fond-anim span:nth-child(5) { left: 71%; width: 130px; height: 130px; animation-duration: 28s; animation-delay: -19s; }
.fond-anim span:nth-child(6) { left: 85%; width: 85px;  height: 85px;  animation-duration: 22s; animation-delay: -10s; }
.fond-anim span:nth-child(7) { left: 93%; width: 45px;  height: 45px;  animation-duration: 15s; animation-delay: -5s; }
@keyframes bulle-monte {
    0%   { transform: translateY(0) scale(1); opacity: 0; }
    8%   { opacity: 1; }
    92%  { opacity: 1; }
    100% { transform: translateY(calc(-100vh - 260px)) scale(1.12); opacity: 0; }
}
/* La carte des logins reste au-dessus des bulles */
.login-directe { z-index: 1; }
.login-users {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: .8rem;
    margin-top: 1.2rem;
}
.login-users form { margin: 0; height: 100%; }
.login-user-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    width: 100%;
    height: 100%;
    min-height: 5rem;
    padding: 1rem;
    border: 1px solid #d3d9e0;
    border-radius: 12px;
    background: #eef0f3; /* fond légèrement gris, écriture noire */
    color: #111827;
    cursor: pointer;
    transition: background .1s, transform .05s;
}
.login-user-btn:hover { background: #e1e5ea; }
.login-user-btn:active { transform: scale(.98); }
/* Les états orange/vert gardent leur écriture blanche */
.login-user-btn.login-fait-avant, .login-user-btn.login-fait-apres { color: #fff; border: none; }
/* Orange : comptage avant travail (inventaire) déjà fait aujourd'hui */
.login-user-btn.login-fait-avant { background: #ea8c00; }
.login-user-btn.login-fait-avant:hover { background: #c77700; }
/* Vert : comptage après travail déjà fait aujourd'hui */
.login-user-btn.login-fait-apres { background: #16a34a; }
.login-user-btn.login-fait-apres:hover { background: #12833c; }
.login-user-login { font-size: 1.6rem; font-weight: 700; }
.login-user-prenom { font-size: 1.05rem; opacity: .85; }
.login-user-heure { font-size: .95rem; opacity: .9; margin-top: .15rem; }

/* ===== Petit ouvrier animé (js/ouvrier.js, option Animation) ===== */
.o-zone { position: relative; }
#ouvrier {
    position: absolute;
    width: 20px;
    height: 26px;
    z-index: 6;
    pointer-events: none;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,.35));
}
#o-svg { display: block; }
/* articulations : hanches et épaules */
#o-jav, #o-jbg { transform-origin: 10px 16.5px; transform-box: view-box; }
#o-bav, #o-bbg { transform-origin: 10px 9.6px; transform-box: view-box; }
/* pioche : tenue inclinée sur l'épaule, pivote avec le bras avant */
#o-outil { transform-origin: 11px 15px; transform-box: view-box; transform: rotate(-38deg); }

/* Marche : jambes et bras en balancier opposé */
.o-marche #o-jav { animation: o-pas .44s ease-in-out infinite alternate; }
.o-marche #o-jbg { animation: o-pas .44s ease-in-out infinite alternate-reverse; }
.o-marche #o-bav { animation: o-bras .44s ease-in-out infinite alternate-reverse; }
.o-marche #o-bbg { animation: o-bras .44s ease-in-out infinite alternate; }
@keyframes o-pas  { from { transform: rotate(26deg); } to { transform: rotate(-26deg); } }
@keyframes o-bras { from { transform: rotate(18deg); } to { transform: rotate(-18deg); } }

/* Coup de pioche : le bras avant (et l'outil) se lève puis frappe, le corps suit */
.o-pioche #o-bav { animation: o-coup .56s cubic-bezier(.5, 0, .8, 1) infinite; }
.o-pioche #o-corps { animation: o-buste .56s cubic-bezier(.5, 0, .8, 1) infinite; }
.o-pioche #o-bbg { transform: rotate(-30deg); }
@keyframes o-coup {
    0%   { transform: rotate(0deg); }
    38%  { transform: rotate(-118deg); } /* pioche levée derrière la tête */
    62%  { transform: rotate(52deg); }   /* frappe ! */
    78%  { transform: rotate(52deg); }
    100% { transform: rotate(0deg); }
}
@keyframes o-buste {
    0%   { transform: translateY(0); }
    38%  { transform: translateY(-1.4px); }
    62%  { transform: translateY(1.2px); }
    100% { transform: translateY(0); }
}

/* Escalade : quatre membres en petits mouvements alternés rapides */
.o-grimpe #o-jav { animation: o-agrippe .3s ease-in-out infinite alternate; }
.o-grimpe #o-jbg { animation: o-agrippe .3s ease-in-out infinite alternate-reverse; }
.o-grimpe #o-bav { animation: o-agrippe-bras .3s ease-in-out infinite alternate-reverse; }
.o-grimpe #o-bbg { animation: o-agrippe-bras .3s ease-in-out infinite alternate; }
@keyframes o-agrippe      { from { transform: rotate(30deg); } to { transform: rotate(-8deg); } }
@keyframes o-agrippe-bras { from { transform: rotate(-42deg); } to { transform: rotate(-4deg); } }

/* Rappel : bras en l'air sur la corde, léger balancement du corps */
.o-rappel #o-bav { transform: rotate(-165deg); }
.o-rappel #o-bbg { transform: rotate(-160deg); }
.o-rappel #o-jav { transform: rotate(14deg); }
.o-rappel #o-jbg { transform: rotate(-10deg); }
.o-rappel #o-svg { animation: o-balance .9s ease-in-out infinite alternate; }
@keyframes o-balance { from { rotate: -6deg; } to { rotate: 6deg; } }

/* Élan / réception : petite flexion des genoux */
.o-elan #o-svg { transform-origin: 10px 24px; }
.o-elan #o-jav { transform: rotate(20deg); }
.o-elan #o-jbg { transform: rotate(-20deg); }
.o-elan #o-corps { transform: translateY(1.6px); }

/* Saut : jambes repliées, bras en arrière */
.o-saut #o-jav { transform: rotate(46deg); }
.o-saut #o-jbg { transform: rotate(-40deg); }
.o-saut #o-bav { transform: rotate(-130deg); }
.o-saut #o-bbg { transform: rotate(28deg); }

/* Jetpack : fusée dorsale visible seulement quand il la porte, flamme en vol */
#o-jetpack { display: none; }
.o-jetpack-on #o-jetpack { display: block; }
#o-flamme { opacity: 0; transform-origin: 5.2px 17px; transform-box: view-box; }
.o-vol #o-flamme { opacity: 1; animation: o-flamme .11s linear infinite alternate; }
@keyframes o-flamme {
    from { transform: scaleY(.7) scaleX(.85); }
    to   { transform: scaleY(1.3) scaleX(1.1); }
}
/* posture de vol : jambes fléchies, bras agrippés aux sangles */
.o-vol #o-jav { transform: rotate(24deg); }
.o-vol #o-jbg { transform: rotate(-16deg); }
.o-vol #o-bav { transform: rotate(-26deg); }
.o-vol #o-bbg { transform: rotate(-20deg); }

/* Poussière expulsée au décollage / à l'atterrissage */
.o-poussiere {
    position: absolute;
    border-radius: 50%;
    background: #d6d3d1;
    opacity: .9;
    z-index: 5;
    pointer-events: none;
    animation: o-pouss .9s ease-out forwards;
}
@keyframes o-pouss {
    from { transform: translate(0, 0) scale(1); opacity: .9; }
    to   { transform: translate(var(--dx, 10px), var(--dy, -8px)) scale(2.8); opacity: 0; }
}

/* Traînée de fumée laissée pendant le vol (s'estompe doucement) */
.o-trainee {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, #d6d3d1 0%, rgba(214, 211, 209, 0) 72%);
    z-index: 4;
    pointer-events: none;
    animation: o-trainee 2s ease-out forwards;
}
@keyframes o-trainee {
    0%   { transform: translate(0, 0) scale(.8); opacity: .8; }
    35%  { opacity: .5; }
    100% { transform: translate(0, var(--dy, -10px)) scale(3); opacity: 0; }
}

/* Soucoupe volante */
#o-soucoupe {
    position: absolute;
    width: 48px;
    height: 32px;
    z-index: 6;
    pointer-events: none;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.35));
}
#s-svg { display: block; }
#s-pilote { display: none; }              /* le pilote n'apparaît qu'à bord */
.s-pilote-on #s-pilote { display: block; }
.s-vol #s-svg { animation: s-flotte .5s ease-in-out infinite alternate; }
@keyframes s-flotte { from { translate: 0 -1.2px; } to { translate: 0 1.2px; } }
/* Fusée (façon Tintin) : flamme au culot visible en vol, la flamme dépasse du viewBox */
#s-svg { overflow: visible; }
#s-flamme-v { opacity: 0; transform-origin: 15px 49.5px; transform-box: view-box; }
.s-vol #s-flamme-v { opacity: 1; animation: o-flamme .1s linear infinite alternate; }

/* Sélecteur du véhicule d'animation (paramètres) */
.select-vehicule { margin-top: .5rem; max-width: 240px; }

/* Train d'atterrissage : rétracté dans la coque, se déploie à l'approche */
#s-train {
    transform: translateY(-11px);
    opacity: 0;
    transition: transform .6s ease, opacity .45s ease;
}
.s-train-sorti #s-train { transform: translateY(0); opacity: 1; }

/* Porte de la soucoupe : coulisse LENTEMENT dans la coque */
#s-ouverture { opacity: 0; transition: opacity .8s ease; }
#s-porte { transition: transform .8s ease, opacity .8s ease; }
.s-porte-ouverte #s-ouverture { opacity: 1; }
.s-porte-ouverte #s-porte { transform: translateY(-5px); opacity: 0; }

/* L'ouvrier entre/sort de la soucoupe en fondu (piloté en JS, sans hâte) */
.o-entre { opacity: 0; transform: scale(.7); transform-origin: 50% 100%; }

/* petites lampes sous la coque : clignotent en permanence, plus vite en vol */
#o-soucoupe circle[fill="#fde047"], #o-soucoupe circle[fill="#fb923c"] {
    animation: s-lumiere .9s linear infinite alternate;
}
#o-soucoupe circle[fill="#fb923c"] { animation-delay: .45s; }
.s-vol circle[fill="#fde047"], .s-vol circle[fill="#fb923c"] { animation-duration: .4s; }
@keyframes s-lumiere { from { opacity: 1; } to { opacity: .2; } }

/* Repos : il s'éponge le front */
.o-repos #o-bav { animation: o-front 1.1s ease-in-out infinite; }
@keyframes o-front {
    0%, 100% { transform: rotate(0deg); }
    45%, 65% { transform: rotate(-140deg); }
}

/* Échelle : deux montants + barreaux */
#o-echelle {
    position: absolute;
    width: 11px;
    z-index: 5;
    pointer-events: none;
    border-left: 2px solid #b45309;
    border-right: 2px solid #b45309;
    background: repeating-linear-gradient(to bottom, transparent 0 5px, #b45309 5px 7px);
    border-radius: 2px;
    transform-origin: 50% 100%; /* penchée depuis son pied (légère diagonale) */
}

/* Corde de rappel */
#o-corde {
    position: absolute;
    width: 2px;
    z-index: 5;
    pointer-events: none;
    background: #a16207;
    border-radius: 1px;
    transform-origin: 50% 0; /* se balance autour de son point d'ancrage */
}
#o-corde::after { /* petit nœud au point d'ancrage */
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    width: 6px;
    height: 4px;
    border-radius: 50%;
    background: #854d0e;
}

/* La case vibre sous les coups de pioche */
.login-user-btn.o-vibre { animation: o-vibre .2s linear; }
@keyframes o-vibre {
    20% { transform: translate(-1.5px, 1px) rotate(-.35deg); }
    45% { transform: translate(1.5px, -1px) rotate(.35deg); }
    70% { transform: translate(-1px, .5px); }
    100% { transform: translate(0, 0); }
}

/* Étincelles des coups de pioche */
.o-etincelle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #fbbf24;
    z-index: 7;
    pointer-events: none;
    animation: o-etin .45s ease-out forwards;
}
@keyframes o-etin {
    from { transform: translate(0, 0); opacity: 1; }
    to   { transform: translate(var(--dx, 6px), var(--dy, -8px)); opacity: 0; }
}

/* Page paramètres */
.param-case {
    display: flex;
    align-items: flex-start;
    gap: .8rem;
    font-weight: 400;
    cursor: pointer;
}
.param-case input[type=checkbox] {
    flex: 0 0 1.4rem;   /* largeur fixe : la case ne se comprime pas quand le texte est long */
    width: 1.4rem;
    height: 1.4rem;
    margin-top: .2rem;
    cursor: pointer;
}
/* Nom de tiroir cliquable (tiroirs.php : contenu du tiroir) */
.tiroir-nom-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: #2563eb;
    cursor: pointer;
}
.tiroir-nom-btn:hover { text-decoration: underline; }

.bloque-form { margin: 0; }
.bloque-case { width: 1.3rem; height: 1.3rem; cursor: pointer; }
/* Case de 6 caractères maximum (+ padding et bordures) —
   sélecteur complet pour battre le input[type=number] { width:100% } générique */
input[type=number].report-input {
    display: inline-block; /* la règle générale met les inputs en block → € rejeté en dessous */
    width: calc(6ch + 1rem);
    margin-top: 0;
    padding: .3rem .4rem;
    text-align: right;
    vertical-align: middle;
}
.report-cell { white-space: nowrap; } /* le € reste à côté de la case, jamais en dessous */

/* Historique 5 jours d'un tiroir (clic sur son nom dans comptages.php) */
.hist-table th, .hist-table td { text-align: center; }
.hist-table td:first-child, .hist-table th:first-child { text-align: left; }

/* Crayon « changer le tiroir » (comptages.php) + fenêtre de choix */
.btn-crayon:hover { color: #0d9488; border-color: #0d9488; background: #e6faf7; }
.chg-tiroirs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: .5rem;
    margin: 1rem 0;
}
.chg-tiroir-btn { line-height: 1.25; }
.chg-tiroir-actuel { opacity: .45; }
.chg-utilise { color: #b45309; font-weight: 400; }

/* ===== Tableau de bord du manager (admin.php) ===== */
.dash-entete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
}
.dash-bonjour { margin: 0; font-size: 1.15rem; }
.dash-sous { margin: .2rem 0 0; color: #64748b; }
.btn-outils { font-size: 1.05rem; padding: .7rem 1.6rem; border-radius: 12px; }
.dash-actions { display: flex; align-items: center; gap: .8rem; }

/* Bouton ? d'aide (mode d'emploi), en haut à droite */
.aide-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%;
    background: #fff; color: #2563eb; border: 2px solid #2563eb;
    font-size: 1.3rem; font-weight: 800; text-decoration: none;
    line-height: 1; flex: none;
}
.aide-btn:hover { background: #2563eb; color: #fff; }

/* ===== Page Mode d'emploi ===== */
.aide { max-width: 900px; }
.aide-intro {
    font-size: 1.05rem; color: #334155; background: #f8fafc;
    border-left: 4px solid #2563eb; padding: 1rem 1.2rem; border-radius: 10px;
}
.aide-sec {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 16px;
    padding: 1.4rem 1.6rem; margin: 1.2rem 0;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .05);
}
.aide-sec h2 {
    display: flex; align-items: center; gap: .7rem;
    font-size: 1.35rem; margin: 0 0 1rem; color: #0f172a;
}
.aide-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff;
    font-size: 1.15rem; font-weight: 800; flex: none;
}
.aide-sec h3 { font-size: 1.1rem; margin: 1.2rem 0 .6rem; color: #0f172a; }
.aide-sec p { line-height: 1.6; color: #334155; }

.aide-url {
    font-family: Consolas, monospace; font-size: 1.05rem; font-weight: 700;
    color: #1d4ed8; background: #eff6ff; border: 1px solid #bfdbfe;
    padding: .6rem 1rem; border-radius: 10px; display: inline-block;
}
.aide-etapes { line-height: 1.7; color: #334155; padding-left: 1.2rem; }
.aide-etapes > li { margin-bottom: .6rem; }
.aide-code {
    font-family: Consolas, monospace; font-size: .9rem;
    background: #0f172a; color: #e2e8f0; padding: .8rem 1rem;
    border-radius: 8px; margin: .5rem 0; overflow-x: auto; white-space: pre;
}
.aide-touche {
    display: inline-block; font-family: Consolas, monospace; font-weight: 700;
    background: #f1f5f9; border: 1px solid #cbd5e1; border-bottom-width: 2px;
    border-radius: 6px; padding: .05rem .5rem; font-size: .85rem;
}
.aide-note {
    background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px;
    padding: .9rem 1.1rem; margin-top: 1rem; color: #713f12; line-height: 1.6;
}
.aide-note ul { margin: .5rem 0 0; padding-left: 1.2rem; }
.aide-note li { margin-bottom: .35rem; }

.aide-badges { line-height: 2.2; color: #334155; margin: .6rem 0; }
.aide-badge {
    display: inline-block; padding: .12rem .7rem; border-radius: 999px;
    font-weight: 700; font-size: .85rem; margin-right: .4rem; min-width: 92px; text-align: center;
}

.aide-cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin: 1rem 0; }
.aide-carte { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 1rem 1.1rem; }
.aide-carte-titre { font-weight: 800; margin-bottom: .4rem; color: #0f172a; }
.aide-carte p { margin: 0; font-size: .95rem; }
.carte-inv { background: #fff7ed; border-color: #fed7aa; }
.carte-cpt { background: #eff6ff; border-color: #bfdbfe; }

.aide-distinction {
    margin-top: 1.4rem; padding-top: .4rem; border-top: 2px dashed #e2e8f0;
}

.aide-option { margin: .9rem 0; padding-left: .2rem; }
.aide-option-t { font-weight: 800; color: #0f172a; margin-bottom: .15rem; }
.aide-option p { margin: 0; }

.aide-outils { display: grid; gap: .7rem; margin: 1rem 0; }
.aide-outil {
    display: flex; gap: .9rem; align-items: flex-start;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: .8rem 1rem;
}
.aide-outil > span { font-size: 1.5rem; flex: none; }
.aide-outil div { line-height: 1.5; font-size: .95rem; color: #334155; }

/* Mini-aperçu des boutons de login */
.aide-mock { margin: 1.2rem 0; }
.aide-mock-legende { color: #64748b; margin-bottom: .5rem; font-size: .9rem; }
.aide-mock-boutons { display: flex; gap: .8rem; flex-wrap: wrap; }
.mock-login {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: #e2e8f0; color: #0f172a; font-weight: 800; font-size: 1.1rem;
    border-radius: 12px; padding: .8rem 1.4rem; min-width: 120px;
}
.mock-login small { font-weight: 500; font-size: .7rem; color: #475569; margin-top: .25rem; }
.mock-avant { background: #ffedd5; }
.mock-avant small { color: #9a3412; }
.mock-apres { background: #dcfce7; }
.mock-apres small { color: #166534; }

.aide-fin { text-align: center; color: #64748b; margin: 1.5rem 0; }

/* Modal de téléchargement (Paramètres) */
.telech-choix { display: flex; flex-direction: column; gap: .7rem; margin: 1rem 0; }
.telech-choix .btn { width: 100%; }
.telech-aide { font-size: .85rem; color: #64748b; }

.dash-alerte {
    display: block;
    background: linear-gradient(90deg, #fff7ed, #ffedd5);
    border: 1px solid #fdba74;
    color: #9a3412;
    font-weight: 600;
    padding: .8rem 1.2rem;
    border-radius: 12px;
    margin-bottom: 1.2rem;
    text-decoration: none;
}
.dash-alerte:hover { background: #ffedd5; }
.dash-alerte-btn {
    float: right;
    background: #ea580c;
    color: #fff;
    padding: .35rem 1.4rem;
    margin-top: -.25rem;
}
.dash-alerte-btn:hover { background: #c2410c; }

.dash-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
    margin-bottom: 1.4rem;
}
.kpi {
    border-radius: 14px;
    padding: 1.1rem 1.2rem;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .08);
}
.kpi-vert { background: linear-gradient(135deg, #16a34a, #15803d); }
.kpi-rouge { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.kpi-bleu { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.kpi-neutre { background: linear-gradient(135deg, #64748b, #475569); }
.kpi-label {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: rgba(255, 255, 255, .85);
}
.kpi-valeur { font-size: 1.9rem; font-weight: 800; margin: .25rem 0; color: #fff; }
.kpi-detail { font-size: .82rem; color: rgba(255, 255, 255, .75); }

.dash-card { border-radius: 14px; box-shadow: 0 2px 10px rgba(15, 23, 42, .06); }
.dash-card-titre {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.dash-card-titre h2 { margin: 0 0 .6rem; }
.dash-table td, .dash-table th { padding: .55rem .7rem; }
.ligne-attention td { background: #fefce8; } /* écart repéré : fond jaune pâle */

.dash-graphe { width: 100%; height: auto; display: block; }
.dash-graphe-date { font-size: 11px; fill: #94a3b8; }
.dash-graphe-val { font-size: 10px; font-weight: 700; }
.dash-total { font-size: 1.15rem; font-weight: 800; }

/* Barre de progression d'upload (download.php) */
.barre-upload {
    height: 9px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
    margin-top: .4rem;
}
.barre-upload-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    border-radius: 5px;
    transition: width .15s linear;
}

/* Journal électronique (journal.php) */
.ligne-ticket { cursor: pointer; }
.ligne-ticket:hover td { background: #eef2f7; }
.th-tri { color: inherit; text-decoration: none; }
.th-tri:hover { text-decoration: underline; }
.modal.modal-ticket { max-width: 480px; width: 480px; max-height: 90vh; display: flex; flex-direction: column; }
.ticket-contenu {
    flex: 1 1 auto;
    overflow: auto;
    background: #fffef5;
    border: 1px solid #e2e0d0;
    border-radius: 8px;
    padding: 1rem;
    margin: 0 0 1rem;
    font-family: 'Courier New', monospace;
    font-size: .78rem;
    line-height: 1.25;
    white-space: pre;
}
.modal-ticket .modal-actions { flex: 0 0 auto; }

/* Page annulations */
.periode-nav { display: flex; gap: .6rem; margin-bottom: 1rem; }
.lien-caissier { color: #2563eb; text-decoration: none; }
.lien-caissier:hover { text-decoration: underline; }
.detail-annul { white-space: normal; font-size: .85rem; color: #475569; }
.cashier-login { font-size: .82rem; color: #2563eb; font-weight: 600; }
.cell-annul { white-space: nowrap; }
.cell-annul .btn-icone { margin-left: .5rem; vertical-align: middle; }
.btn-tannul:hover { color: #0d9488; border-color: #0d9488; background: #e6faf7; }
/* Inventaires : icône billets rouge = différence sur les billets comptés */
.btn-billets-diff { color: #dc2626; border-color: #fca5a5; background: #fef2f2; }
.btn-billets-diff:hover { border-color: #dc2626; background: #fee2e2; }
#tannul-liste { max-height: 60vh; overflow: auto; display: flex; flex-direction: column; gap: .45rem; margin-bottom: 1rem; }
.tannul-ticket-btn { text-align: left; }
/* Zone canvas de la fenêtre PDF (annulations.php : rendu pdf.js + cadre rouge) */
.pdf-canvas-zone {
    flex: 1 1 auto;
    overflow: auto;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: #f1f5f9;
    text-align: center;
}
.detail-sous-titre { font-weight: normal; font-size: .82rem; color: #64748b; }
#form-reports { margin-top: 1rem; text-align: right; }

/* Rappel du magasin lié sur le formulaire de connexion */
.login-shop {
    text-align: center;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    padding: .7rem;
    font-size: 1.25rem;
    margin: 1rem 0 .4rem;
}
.login-shop strong { font-size: 1.5rem; }
.login-shop-none { background: #fef3c7; color: #92400e; border-color: #fde68a; font-size: 1rem; }

/* ===== Document imprimable du comptage ===== */
#zone-impression { display: none; color: #000; }
.imp-magasin {
    font-size: 38px;
    font-weight: 800;
    text-align: center;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-top: 14px;
}
.imp-date { font-size: 23px; font-weight: 700; text-align: center; margin-top: 14px; }
.imp-employe { font-size: 17px; text-align: center; margin: 12px 0 14px; }
.imp-cadres { display: flex; gap: 28px; margin-bottom: 34px; }
.imp-cadre {
    flex: 1;
    border: 3px solid #000;
    border-radius: 14px;
    padding: 20px 12px;
    text-align: center;
}
.imp-cadre-titre { font-size: 16px; font-weight: 700; letter-spacing: .1em; }
.imp-cadre-valeur { font-size: 32px; font-weight: 800; margin-top: 10px; }
.imp-reste {
    font-size: 27px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 40px;
}
.imp-grille {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 44px;
}
.imp-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #999;
}
.imp-row img { height: 62px; width: auto; border-radius: 4px; }
.imp-x { flex: 1; font-size: 27px; font-weight: 800; }
.imp-montant { font-size: 18px; font-weight: 700; text-align: right; }

@media print {
    body.impression .topbar { display: none !important; }
    body.impression .container > *:not(#zone-impression) { display: none !important; }
    body.impression #zone-impression { display: block !important; }
    body.impression.comptage-page {
        height: auto !important;
        overflow: visible !important;
        display: block !important;
    }
    body.impression.comptage-page .container {
        display: block !important;
        height: auto !important;
        max-width: none;
    }
}

/* ===== Page de connexion ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1d3557 0%, #2b4a7a 100%);
}
.login-box {
    background: #fff;
    border-radius: 12px;
    padding: 2.2rem;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 10px 40px rgba(0,0,0,.3);
}
.login-box h1 { text-align: center; margin: 0; }
.login-subtitle { text-align: center; color: #7a8699; margin: .3rem 0 1.4rem; }
.login-box label { margin-bottom: 1rem; }
.login-box .btn-block { margin-top: .5rem; padding: .65rem; }
