/* HelaSpeed — les couleurs de l'agence arrivent par --c1 / --c2 (dégradé) */
:root {
    --c1: #12A150;
    --c2: #0B1F14;
    --degrade: linear-gradient(135deg, var(--c1), var(--c2));
    --fond: #F3F5F4;
    --carte: #FFFFFF;
    --texte: #16211B;
    --doux: #5E6B64;
    --bord: #E2E7E4;
    --rouge: #C8372D;
    --vert: #138A4B;
    --orange: #C77700;
    --rayon: 16px;
    --ombre: 0 8px 24px rgba(16, 33, 27, .08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--fond);
    color: var(--texte);
    font-size: 15px;
    line-height: 1.5;
}
a { color: var(--c1); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 18px; font-weight: 800; }
h3 { font-size: 15px; font-weight: 700; }

/* ---------- barre du haut ---------- */
.entete {
    background: var(--degrade);
    color: #fff;
    position: relative;
    overflow: hidden;
}
.entete::after { /* traits de vitesse */
    content: "";
    position: absolute; inset: 0;
    background: repeating-linear-gradient(115deg, transparent 0 38px, rgba(255,255,255,.06) 38px 40px);
    pointer-events: none;
}
.entete .interieur {
    max-width: 1120px; margin: 0 auto; padding: 14px 16px;
    display: flex; align-items: center; gap: 12px; position: relative; z-index: 1;
}
.marque { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.marque img { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; background: #fff; }
.marque .pastille {
    width: 40px; height: 40px; border-radius: 12px; flex: 0 0 40px;
    background: rgba(255,255,255,.18); display: grid; place-items: center; font-weight: 800; font-size: 18px;
}
.marque strong { font-size: 18px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.marque small { display: block; font-size: 11px; opacity: .8; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.entete .droite { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.entete .qui { text-align: right; font-size: 13px; line-height: 1.2; }
.entete .qui span { display: block; opacity: .8; font-size: 11px; }
.entete form { margin: 0; }
.bouton-clair {
    background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.3);
    border-radius: 10px; padding: 7px 12px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.bouton-clair:hover { background: rgba(255,255,255,.26); }

/* ---------- page ---------- */
.page { max-width: 1120px; margin: 0 auto; padding: 22px 16px 60px; }
.titre-page { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.titre-page p { margin: 0; color: var(--doux); }
.titre-page .actions { margin-left: auto; }

.carte {
    background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon);
    box-shadow: var(--ombre); padding: 18px; margin-bottom: 18px;
}
.carte > h2 { display: flex; align-items: center; gap: 8px; }
.carte .aide { color: var(--doux); font-size: 13px; margin: -4px 0 12px; }

.grille { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.deux { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); align-items: start; }

/* ---------- formulaires ---------- */
label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 5px; }
.champ { margin-bottom: 14px; }
.champ .note { font-size: 12px; color: var(--doux); margin-top: 4px; }
input[type=text], input[type=password], input[type=tel], input[type=number], input[type=email], select {
    width: 100%; font: inherit; color: var(--texte); background: #fff;
    border: 1px solid var(--bord); border-radius: 12px; padding: 11px 12px; outline: none;
}
input:focus, select:focus { border-color: var(--c1); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c1) 20%, transparent); }
input[type=color] { width: 54px; height: 44px; padding: 3px; border: 1px solid var(--bord); border-radius: 12px; background: #fff; cursor: pointer; }
.case { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.case input { width: 18px; height: 18px; accent-color: var(--c1); }
.ligne { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.ligne > .pousse { flex: 0 0 auto; align-self: flex-end; }
.ligne > .champ { flex: 1 1 140px; }
.ligne > .champ.etroit { flex: 0 1 120px; }

.bouton {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: var(--degrade); color: #fff; border: 0; border-radius: 12px;
    padding: 11px 18px; font: inherit; font-weight: 800; cursor: pointer; text-decoration: none;
    box-shadow: 0 6px 16px color-mix(in srgb, var(--c1) 35%, transparent);
}
.bouton:hover { filter: brightness(1.07); }
.bouton.secondaire { background: #fff; color: var(--texte); border: 1px solid var(--bord); box-shadow: none; }
.bouton.petit { padding: 6px 10px; font-size: 13px; border-radius: 10px; }
.bouton.danger { background: #fff; color: var(--rouge); border: 1px solid var(--bord); box-shadow: none; }
.bouton.plein { width: 100%; }

/* ---------- messages ---------- */
.message { border-radius: 12px; padding: 11px 14px; margin-bottom: 16px; font-weight: 600; }
.message.succes { background: #E3F6EC; color: var(--vert); }
.message.erreur { background: #FDEEEC; color: var(--rouge); }
.erreurs { margin: 0 0 12px; padding: 10px 14px 10px 30px; background: #FDEEEC; color: var(--rouge); border-radius: 12px; font-size: 13px; font-weight: 600; }

/* ---------- listes ---------- */
.liste { list-style: none; margin: 0 0 14px; padding: 0; }
.liste li {
    display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--bord);
}
.liste li:last-child { border-bottom: 0; }
.liste .principal { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.liste .principal small { display: block; color: var(--doux); }
.liste form { margin: 0; }
.vide { color: var(--doux); font-style: italic; margin: 0 0 12px; }
.etiquette { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: #EEF1EF; color: var(--doux); }
.etiquette.on { background: #E3F6EC; color: var(--vert); }
.etiquette.off { background: #FDEEEC; color: var(--rouge); }
.inactif { opacity: .55; }

/* ---------- carte d'agence (propriétaire) ---------- */
.agence {
    background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon);
    box-shadow: var(--ombre); overflow: hidden; display: flex; flex-direction: column;
}
.agence .bandeau { height: 78px; position: relative; }
.agence .bandeau::after {
    content: ""; position: absolute; inset: 0;
    background: repeating-linear-gradient(115deg, transparent 0 30px, rgba(255,255,255,.07) 30px 32px);
}
.agence .logo {
    width: 58px; height: 58px; border-radius: 16px; border: 3px solid #fff; background: #fff;
    margin: -32px 0 0 16px; position: relative; z-index: 1; object-fit: cover;
    display: grid; place-items: center; font-weight: 800; font-size: 22px; color: #fff;
}
.agence .corps { padding: 8px 16px 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.agence .adresse { font-size: 13px; color: var(--doux); overflow-wrap: anywhere; }
.agence .chiffres { display: flex; gap: 14px; font-size: 13px; color: var(--doux); margin: 4px 0 10px; flex-wrap: wrap; }
.agence .chiffres b { color: var(--texte); }
.agence .corps .bouton { margin-top: auto; }

/* aperçu du dégradé pendant le réglage */
.apercu {
    border-radius: var(--rayon); color: #fff; padding: 18px; display: flex; align-items: center; gap: 12px;
    margin-bottom: 14px; position: relative; overflow: hidden;
}
.apercu::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, transparent 0 38px, rgba(255,255,255,.07) 38px 40px); }
.apercu > * { position: relative; z-index: 1; }
.apercu img, .apercu .pastille { width: 48px; height: 48px; border-radius: 14px; background: #fff; object-fit: cover; }
.apercu .pastille { background: rgba(255,255,255,.2); display: grid; place-items: center; font-weight: 800; font-size: 20px; }
.apercu strong { font-size: 20px; font-weight: 800; display: block; }
.apercu small { opacity: .85; }

/* ---------- connexion ---------- */
.ecran-connexion {
    min-height: 100vh; background: var(--degrade); display: grid; place-items: center; padding: 24px 16px;
    position: relative; overflow: hidden;
}
.ecran-connexion::before {
    content: ""; position: absolute; inset: 0;
    background: repeating-linear-gradient(115deg, transparent 0 46px, rgba(255,255,255,.06) 46px 49px);
}
.boite-connexion {
    position: relative; width: 100%; max-width: 400px; background: #fff; border-radius: 22px;
    padding: 28px 24px; box-shadow: 0 24px 60px rgba(0,0,0,.25);
}
.boite-connexion .tete { text-align: center; margin-bottom: 20px; }
.boite-connexion .tete img, .boite-connexion .tete .pastille {
    width: 68px; height: 68px; border-radius: 20px; margin: 0 auto 10px; display: grid; place-items: center;
    object-fit: cover; background: var(--degrade); color: #fff; font-weight: 800; font-size: 28px;
}
.boite-connexion .tete p { color: var(--doux); margin: 0; font-size: 13px; }
.signature { position: relative; text-align: center; color: rgba(255,255,255,.75); font-size: 12px; margin-top: 16px; }

/* ---------- accueil agence ---------- */
.tuiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); margin-bottom: 18px; }
.tuile {
    border-radius: var(--rayon); padding: 18px; color: #fff; background: var(--degrade); min-height: 110px;
    display: flex; flex-direction: column; justify-content: space-between; text-decoration: none; position: relative; overflow: hidden;
}
.tuile::after { content: ""; position: absolute; right: -30px; bottom: -30px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255,255,255,.1); }
.tuile strong { font-size: 17px; }
.tuile span { opacity: .85; font-size: 13px; }
.tuile.bientot { background: #fff; color: var(--doux); border: 1px dashed var(--bord); }

@media (max-width: 560px) {
    h1 { font-size: 22px; }
    .entete .qui { display: none; }
    .titre-page .actions { margin-left: 0; width: 100%; }
    .titre-page .actions .bouton { width: 100%; }
}

/* ---------- menu ---------- */
.entete a.qui { color: #fff; text-decoration: none; }
.menu {
    max-width: 1120px; margin: 0 auto; padding: 0 12px; display: flex; gap: 4px; overflow-x: auto;
    position: relative; z-index: 1; scrollbar-width: none;
}
.menu::-webkit-scrollbar { display: none; }
.menu a {
    color: rgba(255,255,255,.82); text-decoration: none; font-weight: 700; font-size: 14px; white-space: nowrap;
    padding: 10px 12px; border-bottom: 3px solid transparent;
}
.menu a:hover { color: #fff; }
.menu a.actif { color: #fff; border-bottom-color: #fff; }

/* ---------- tableaux ---------- */
.tableau { width: 100%; border-collapse: collapse; font-size: 14px; }
.tableau th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); padding: 8px 10px; border-bottom: 2px solid var(--bord); white-space: nowrap; }
.tableau td { padding: 10px; border-bottom: 1px solid var(--bord); vertical-align: top; }
.tableau tr:hover td { background: #FAFBFA; }
.tableau .nombre { text-align: right; white-space: nowrap; }
.tableau a.code { font-weight: 800; text-decoration: none; letter-spacing: .03em; white-space: nowrap; }
.defile { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
.statut { display: inline-block; font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.statut.en_cours { background: #FFF3DC; color: var(--orange); }
.statut.paye { background: #E3F6EC; color: var(--vert); }
.statut.annule { background: #FDEEEC; color: var(--rouge); }
.onglets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.onglets a { text-decoration: none; color: var(--texte); background: #fff; border: 1px solid var(--bord); border-radius: 99px; padding: 6px 12px; font-weight: 700; font-size: 13px; }
.onglets a.actif { background: var(--degrade); color: #fff; border-color: transparent; }
.onglets a span { opacity: .7; margin-left: 4px; }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 11px; border: 1px solid var(--bord); border-radius: 10px; text-decoration: none; font-weight: 700; font-size: 13px; background: #fff; color: var(--texte); }
.pagination .courant { background: var(--degrade); color: #fff; border-color: transparent; }
.pagination .off { opacity: .45; }

/* ---------- fiche du transfert (reçu) ---------- */
.recu { max-width: 560px; }
.recu .tete-recu {
    background: var(--degrade); color: #fff; border-radius: var(--rayon) var(--rayon) 0 0; margin: -18px -18px 16px; padding: 18px;
    display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; position: relative; overflow: hidden;
}
.recu .tete-recu::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, transparent 0 34px, rgba(255,255,255,.07) 34px 36px); }
.recu .tete-recu > * { position: relative; z-index: 1; }
.recu .code-retrait { font-size: 30px; font-weight: 800; letter-spacing: .08em; line-height: 1.1; }
.recu .tete-recu small { opacity: .85; font-weight: 600; }
.recu .montant { font-size: 28px; font-weight: 800; margin: 0 0 4px; }
.lignes { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 12px 0; font-size: 14px; }
.lignes dt { color: var(--doux); }
.lignes dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.separe { border: 0; border-top: 1px dashed var(--bord); margin: 14px 0; }
.chercher { display: flex; gap: 8px; }
.chercher input { flex: 1; }
.total { font-size: 22px; font-weight: 800; }
.calcul { background: #F6F8F7; border: 1px solid var(--bord); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.calcul .lignes { margin: 0; }

@media print {
    .entete, .menu, .pas-imprime, .message { display: none !important; }
    body { background: #fff; }
    .page { padding: 0; }
    .carte { box-shadow: none; border: 0; }
    .recu .tete-recu { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- caisse et rapports ---------- */
.periode { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.periode .onglets { margin: 0; }
.periode .dates { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.periode .dates label { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; }
.periode input[type=date] { font: inherit; padding: 7px 9px; border: 1px solid var(--bord); border-radius: 10px; background: #fff; }
.negatif, .tableau td.negatif { color: var(--rouge); font-weight: 800; }
.tableau td.entree { color: var(--vert); font-weight: 700; }
.tableau td.sortie { color: var(--rouge); font-weight: 700; }
.tableau tfoot th { border-top: 2px solid var(--bord); border-bottom: 0; color: var(--texte); font-size: 14px; text-transform: none; letter-spacing: 0; }
.tableau tr.inactif td { opacity: .6; }
.tuile.alerte { background: linear-gradient(135deg, #C0392B, #7B1E14); }
.resume-periode { display: grid; gap: 8px; margin-bottom: 14px; }
.resume-periode > div { display: flex; flex-wrap: wrap; gap: 6px 16px; background: #F6F8F7; border: 1px solid var(--bord); border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.resume-periode .entree { color: var(--vert); font-weight: 700; }
.resume-periode .sortie { color: var(--rouge); font-weight: 700; }
.chiffres-devise .lignes { margin: 0; }
.chiffres-devise dd.fort { font-size: 18px; font-weight: 800; color: var(--c1); }
.chiffres-devise dt small { font-weight: 400; }
@media print {
    .tuile { -webkit-print-color-adjust: exact; print-color-adjust: exact; min-height: 0; }
    .defile { overflow: visible; margin: 0; padding: 0; }
    .tableau { font-size: 11px; }
}
