/* Lavage4you — charte du papier à en-tête : bleu ciel #5B97D7, logo blanc, bulles. */
:root {
    --l4y-brand: #5b97d7;      /* bleu du papier à en-tête */
    --l4y-brand-pale: #eaf2fb;
    --l4y-navy: #17406f;       /* bleu profond de la même famille (menu, titres) */
    --l4y-navy-2: #1f5290;
    --l4y-blue: #2f74c0;       /* boutons et liens : assez foncé pour un texte blanc lisible */
    --l4y-bg: #f3f7fc;
    --l4y-text: #1d2a44;
    --l4y-muted: #6b7a99;
    --l4y-border: #e3e8f2;
    --l4y-sidebar-w: 260px;
}

/* Boutons et couleurs Bootstrap alignés sur la charte. */
:root {
    --bs-primary: #2f74c0; --bs-primary-rgb: 47, 116, 192;
    --bs-link-color: #2f74c0; --bs-link-color-rgb: 47, 116, 192;
    --bs-link-hover-color: #245d9c; --bs-link-hover-color-rgb: 36, 93, 156;
}
.btn-primary {
    --bs-btn-bg: #2f74c0; --bs-btn-border-color: #2f74c0;
    --bs-btn-hover-bg: #245d9c; --bs-btn-hover-border-color: #245d9c;
    --bs-btn-active-bg: #1f5290; --bs-btn-active-border-color: #1f5290;
    --bs-btn-disabled-bg: #2f74c0; --bs-btn-disabled-border-color: #2f74c0;
}
.btn-outline-primary {
    --bs-btn-color: #2f74c0; --bs-btn-border-color: #2f74c0;
    --bs-btn-hover-bg: #2f74c0; --bs-btn-hover-border-color: #2f74c0;
    --bs-btn-active-bg: #245d9c; --bs-btn-active-border-color: #245d9c;
}
.nav-pills { --bs-nav-pills-link-active-bg: #2f74c0; }
.form-control:focus, .form-select:focus { border-color: #8fb8e6; box-shadow: 0 0 0 .2rem rgba(91, 151, 215, .25); }
.form-check-input:checked { background-color: #2f74c0; border-color: #2f74c0; }
.progress-bar { background-color: var(--l4y-brand); }

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--l4y-bg);
    color: var(--l4y-text);
    font-size: .925rem;
}

/* ---------- Menu latéral ---------- */
.l4y-sidebar {
    position: fixed; inset: 0 auto 0 0;
    width: var(--l4y-sidebar-w);
    background: var(--l4y-navy);
    color: #d3e2f4;
    overflow-y: auto;
    z-index: 1030;
    transition: transform .2s ease;
}
.l4y-brand {
    display: block; text-align: center;
    padding: 1.2rem 1.25rem; margin-bottom: 1rem;
    background: var(--l4y-brand); text-decoration: none;
}
.l4y-brand img { display: block; width: 100%; max-width: 200px; height: auto; margin: 0 auto; }
.l4y-brand small {
    display: block; margin-top: .35rem;
    font-size: .6rem; font-weight: 700; letter-spacing: .14em; color: #fff; text-transform: uppercase;
}

.l4y-user {
    display: flex; align-items: center; gap: .75rem;
    margin: 0 1rem 1rem; padding: .85rem;
    background: var(--l4y-navy-2); border-radius: .75rem;
}
.l4y-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    display: grid; place-items: center;
    background: #fff; color: var(--l4y-navy); font-weight: 700;
}
.l4y-user .nom { color: #fff; font-weight: 600; line-height: 1.2; }
.l4y-user .role { font-size: .75rem; color: #b4cdea; }
.l4y-user .enligne { font-size: .7rem; color: #4ade80; }

.l4y-section {
    padding: 1rem 1.5rem .35rem;
    font-size: .68rem; font-weight: 600; letter-spacing: .1em;
    text-transform: uppercase; color: #8fb3dc;
}
.l4y-nav a, .l4y-nav span.l4y-soon {
    display: flex; align-items: center; gap: .7rem;
    margin: .1rem .75rem; padding: .55rem .75rem;
    border-radius: .5rem; color: #d3e2f4; text-decoration: none;
}
.l4y-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.l4y-nav a.active { background: var(--l4y-brand); color: #fff; font-weight: 600; }
.l4y-nav span.l4y-soon { opacity: .5; cursor: not-allowed; }
.l4y-nav .badge-soon {
    margin-left: auto; font-size: .6rem; font-weight: 600;
    padding: .15rem .4rem; border-radius: .3rem; background: rgba(255,255,255,.12);
}
.l4y-logout {
    display: flex; align-items: center; gap: .7rem; width: calc(100% - 1.5rem);
    margin: 1rem .75rem 1.5rem; padding: .55rem .75rem;
    border: 0; border-radius: .5rem; background: transparent; color: #d3e2f4; text-align: left;
}
.l4y-logout:hover { background: rgba(255,255,255,.07); color: #fff; }

/* ---------- Contenu ---------- */
.l4y-main { margin-left: var(--l4y-sidebar-w); min-height: 100vh; }
.l4y-topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 1.1rem 1.75rem; background: #fff; border-bottom: 3px solid var(--l4y-brand);
}
.l4y-topbar h1 { font-size: 1.3rem; font-weight: 700; margin: 0; color: var(--l4y-navy); }
.l4y-topbar .sous-titre { color: var(--l4y-blue); font-size: .85rem; }
.l4y-topbar .date { color: var(--l4y-muted); font-size: .85rem; white-space: nowrap; }
.l4y-content { padding: 1.5rem 1.75rem 2.5rem; }

.l4y-card {
    background: #fff; border: 1px solid var(--l4y-border);
    border-radius: .85rem; padding: 1.15rem 1.25rem;
    box-shadow: 0 1px 2px rgba(16, 35, 80, .04);
}
.l4y-card-title {
    font-size: .78rem; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; color: var(--l4y-navy); margin-bottom: .9rem;
}

/* Indicateurs (KPI) */
.l4y-kpi { display: flex; align-items: center; gap: .9rem; }
.l4y-kpi .icone {
    width: 46px; height: 46px; flex: none; border-radius: .7rem;
    display: grid; place-items: center; font-size: 1.3rem; color: #fff;
}
.l4y-kpi .libelle { font-size: .75rem; color: var(--l4y-muted); line-height: 1.2; }
.l4y-kpi .valeur { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.bg-l4y-blue { background: var(--l4y-blue); }
.bg-l4y-orange { background: #f59e0b; }
.bg-l4y-purple { background: #7c3aed; }
.bg-l4y-red { background: #ef4444; }
.bg-l4y-green { background: #16a34a; }
.bg-l4y-teal { background: #0d9488; }
.bg-l4y-navy { background: var(--l4y-navy-2); }

.l4y-empty {
    text-align: center; color: var(--l4y-muted);
    padding: 2rem 1rem; border: 1px dashed var(--l4y-border); border-radius: .75rem;
}
.l4y-empty i { font-size: 1.8rem; display: block; margin-bottom: .4rem; color: #b5c1da; }

.table-l4y th {
    font-size: .7rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--l4y-muted); font-weight: 600; background: var(--l4y-brand-pale);
}

/* ---------- Connexion ---------- */
.l4y-login {
    min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
    background: var(--l4y-brand) url('../images/bulles.png') center / cover no-repeat;
}
.l4y-login .l4y-card { width: 100%; max-width: 420px; padding: 0; overflow: hidden; box-shadow: 0 20px 50px rgba(16, 50, 100, .25); }
.l4y-login .bandeau { background: var(--l4y-brand); padding: 1.6rem 2rem 1.3rem; text-align: center; }
.l4y-login .bandeau img { width: 100%; max-width: 260px; height: auto; }
.l4y-login .bandeau small { display: block; margin-top: .45rem; color: #fff; font-size: .68rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.l4y-login .corps { padding: 1.75rem 2rem 2rem; }

/* ---------- Mobile ---------- */
.l4y-burger { display: none; }
@media (max-width: 991.98px) {
    .l4y-sidebar { transform: translateX(-100%); }
    .l4y-sidebar.ouvert { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
    .l4y-main { margin-left: 0; }
    .l4y-burger { display: inline-flex; }
    .l4y-topbar, .l4y-content { padding-left: 1rem; padding-right: 1rem; }
}

/* Onglets de fiche (prestataire…) */
.l4y-onglets .nav-link { color: var(--l4y-text); border-radius: .6rem; padding: .55rem 1rem; }
.l4y-onglets .nav-link.active { background: var(--l4y-blue); color: #fff; }
.l4y-onglets .nav-link.disabled { color: #a9b4cc; }

/* Écran de saisie d'un bon (calqué sur le bon papier) */
.l4y-bon thead th { background: var(--l4y-navy); color: #fff; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: .55rem .5rem; }
.l4y-bon thead th:nth-child(n+2):nth-child(-n+4) { width: 74px; text-align: center; }
.l4y-bon thead th:last-child { width: 90px; }
.l4y-bon td { padding: .2rem .5rem; }
.l4y-bon .l4y-bon-cat td { background: #e8f0fe; color: var(--l4y-navy); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: .35rem .5rem; }
.l4y-bon input.form-control-sm { text-align: center; padding: .15rem .25rem; }
.l4y-bon .l4y-autre input[name$="[libelle]"] { text-align: left; }
.l4y-bon tr.l4y-saisie td:first-child { font-weight: 600; color: var(--l4y-blue); }
.l4y-bon .montant { font-variant-numeric: tabular-nums; font-size: .85rem; }
@media (min-width: 992px) { .l4y-totaux { position: sticky; bottom: 1rem; } }

/* Grille « Articles lavés » : première colonne fixe, défilement horizontal des jours */
.l4y-grille table { font-size: .8rem; }
.l4y-grille thead th { background: var(--l4y-navy); color: #fff; font-weight: 600; white-space: nowrap; }
.l4y-grille td, .l4y-grille th { padding: .25rem .4rem; min-width: 2rem; }
.l4y-grille .col-article { position: sticky; left: 0; z-index: 1; background: #fff; min-width: 11rem; white-space: nowrap; }
.l4y-grille thead .col-article { background: var(--l4y-navy); }
.l4y-grille .l4y-grille-cat td { background: #e8f0fe; color: var(--l4y-navy); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.l4y-grille tfoot td { background: #f4f6fa; }
.l4y-grille tfoot .col-article { background: #f4f6fa; }

/* Graphique « pièces par jour » (statistiques du contrôle) */
.l4y-graph { width: 100%; height: auto; display: block; }
.l4y-graph .grille { stroke: var(--l4y-border); stroke-width: 1; }
.l4y-graph .axe { fill: var(--l4y-muted); font-size: 11px; }
.l4y-graph .valeur { fill: var(--l4y-blue); }
.l4y-graph .cible { fill: transparent; }
.l4y-graph .barre:hover .cible { fill: #eef3fd; }
.l4y-graph .barre:hover .valeur { fill: var(--l4y-navy-2); }
.l4y-part { height: .5rem; background: #eef1f7; border-radius: 1rem; overflow: hidden; }
.l4y-part span { display: block; height: 100%; background: var(--l4y-blue); border-radius: 1rem; }

/* Cloche d'alerte de la direction (linge prêt en attente). */
.l4y-cloche { position: relative; font-size: 1.25rem; color: var(--l4y-muted); text-decoration: none; line-height: 1; }
.l4y-cloche.active { color: #dc3545; }
.l4y-cloche .badge { position: absolute; top: -.45rem; right: -.7rem; font-size: .65rem; }

/* Impression (factures) : seule la page utile est imprimée. */
@media print {
    .l4y-sidebar, .l4y-topbar, .alert, .d-print-none { display: none !important; }
    .l4y-main { margin-left: 0 !important; }
    .l4y-content { padding: 0 !important; }
    .l4y-card { box-shadow: none !important; border: 0 !important; padding: 0 !important; }
    body { background: #fff !important; }
    .l4y-facture { max-width: none !important; }
    .l4y-facture .bande { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    @page { size: A4; margin: 10mm; }
}
.l4y-facture { max-width: 900px; }
.l4y-facture .bande { background: var(--l4y-brand); color: #fff; border-radius: .5rem; }
.l4y-facture .bande-haut { display: flex; align-items: center; justify-content: center; gap: 1.5rem; padding: 1rem 1.25rem; }
.l4y-facture .bande-haut .icone { width: 70px; height: auto; }
.l4y-facture .bande-haut .icone.miroir { transform: scaleX(-1); }
.l4y-facture .bande-haut .logo { width: 230px; height: auto; display: block; margin: 0 auto; }
.l4y-facture .bande-haut small { display: block; text-align: center; margin-top: .3rem; font-size: .6rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.l4y-facture .bande-bas { padding: .7rem 1rem; font-size: .72rem; text-align: center; line-height: 1.6; }
.l4y-facture .bande-bas strong { font-weight: 700; }
.l4y-facture .titre-facture { color: var(--l4y-navy); }
.l4y-facture thead th { background: var(--l4y-brand-pale) !important; color: var(--l4y-navy); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.l4y-facture table td, .l4y-facture table th { padding: .45rem .6rem; }
.l4y-facture .totaux td { padding: .3rem .6rem; }
