/* ============================================================
   Fiche Horaire — feuille de style
   Refonte 2026. L'ancienne version est dans _ancien_design/.

   Tout part des variables ci-dessous. Si tu ajoutes un ecran,
   n'ecris jamais une couleur en dur : prends une variable.
   ============================================================ */

:root {
    /* --- Texte (chaud, plus vivant que du gris-bleu froid) --- */
    --encre: #211A12;         /* texte principal        ~15:1 sur --fond */
    --texte-2: #6B5F4E;       /* texte secondaire        ~5.7:1 sur --fond */
    --texte-3: #7A6E5C;       /* texte tertiaire         ~4.5:1 — plancher AA */

    /* --- Marine (couleur d'identite) : un vert sapin profond, plus
       chaleureux et moins "logiciel de compta" qu'un bleu marine --- */
    --marine-900: #14342D;
    --marine-700: #1F5045;
    --marine-500: #2E7D66;
    --marine-050: #E9F3EE;

    /* --- Ambre (accent) : terracotta chaud --- */
    --ambre-600: #A8521F;     /* ambre lisible sur fond clair */
    --ambre-500: #D2762E;     /* aplats, mise en avant */
    --ambre-050: #FBEEE0;

    /* --- Surfaces (fond creme plutot que gris-bleu froid) --- */
    --fond: #F7F4EE;
    --surface: #FFFFFF;
    --surface-2: #F3EFE7;
    --bordure: #E4DCC9;
    --bordure-forte: #D2C7AD;

    /* --- Etats --- */
    --succes: #14672F;
    --succes-fond: #E3F4E8;
    --succes-bordure: #BEE3CA;
    --alerte: #9B2226;
    --alerte-fond: #FBE8E8;
    --alerte-bordure: #F0D5D5;
    --attention: #8A5A00;
    --attention-fond: #FDF6EC;
    --attention-bordure: #F0DCBE;

    /* --- Formes --- */
    --r-xs: 6px;
    --r-sm: 8px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-pilule: 999px;

    --ombre-1: 0 1px 2px rgba(14, 42, 69, 0.05);
    --ombre-2: 0 8px 22px -12px rgba(14, 42, 69, 0.45);
    --ombre-ambre: 0 8px 22px -10px rgba(178, 94, 39, 0.7);

    /* --- Typographie --- */
    --police: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --police-chiffres: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

    /* --- Hauteur de la barre d'onglets mobile --- */
    --h-onglets: 64px;

    /* ------------------------------------------------------------
       Anciens noms de variables, conserves pour que les gabarits
       pas encore repris continuent de fonctionner. Ne pas les
       utiliser dans du code neuf.
       ------------------------------------------------------------ */
    --navy: var(--marine-900);
    --navy-dark: #0F2620;
    --navy-light: var(--marine-050);
    --accent: var(--ambre-500);
    --accent-dark: var(--ambre-600);
    --accent-light: var(--ambre-050);
    --bg: var(--fond);
    --text: var(--encre);
    --text-muted: var(--texte-2);
    --border: var(--bordure);
    --danger: var(--alerte);
    --danger-dark: #7C1B1E;
    --succes-bg: var(--succes-fond);
    --succes-text: var(--succes);
    --erreur-bg: var(--alerte-fond);
    --erreur-text: var(--alerte);
    --radius: var(--r-lg);
    --radius-sm: var(--r-md);
    --shadow: var(--ombre-1);
    --shadow-hover: var(--ombre-2);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--police);
    background:
        radial-gradient(900px 500px at 100% -80px, rgba(46, 125, 102, 0.07), transparent 60%),
        radial-gradient(700px 420px at -10% 10%, rgba(210, 118, 46, 0.06), transparent 55%),
        var(--fond);
    background-attachment: fixed;
    color: var(--encre);
    margin: 0;
    padding: 0;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Les chiffres d'heures : chasse fixe, colonnes alignees. */
.chiffres, .total-jour, .total-semaine .boite, #total-semaine,
.heures-affichees, .semaine-date-badge {
    font-family: var(--police-chiffres);
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   1. Barre de navigation — ordinateur
   ============================================================ */

.nav-bar {
    background: linear-gradient(105deg, var(--marine-900) 0%, #1B463D 60%, #204F45 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 24px;
    height: 58px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.1px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 9px;
}
.nav-brand svg { flex-shrink: 0; }

.nav-links { display: flex; gap: 3px; flex-wrap: wrap; }

.nav-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 7px 13px;
    border-radius: var(--r-sm);
    font-size: 13.5px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.25;
}
.nav-links a .sub-langue { font-size: 9.5px; font-weight: 400; opacity: 0.7; }
.nav-links a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav-links a.actif { background: var(--ambre-500); color: #fff; font-weight: 600; }
.nav-links a.actif .sub-langue { opacity: 0.9; }
.nav-links a.deco { color: rgba(255, 255, 255, 0.6); }
.nav-links a.deco:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

/* ============================================================
   2. Menu deroulant — telephone
   Rendu par base.html, masque sur grand ecran. Remplace l'ancienne
   barre d'onglets fixe en bas (limitee a 4-5 icones).
   ============================================================ */

.menu-mobile-bouton {
    display: none;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: none;
    padding: 9px 14px;
    border-radius: var(--r-pilule);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
}
.menu-mobile-bouton:hover { background: rgba(255, 255, 255, 0.2); }
.menu-mobile-bouton svg { flex-shrink: 0; }

.menu-mobile-panneau {
    display: none;
    position: fixed;
    top: 58px;
    right: 12px;
    left: 12px;
    z-index: 200;
    background: var(--surface);
    border: 1px solid var(--bordure);
    border-radius: var(--r-lg);
    box-shadow: var(--ombre-2);
    padding: 8px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.16s ease, transform 0.16s ease;
}
.menu-mobile-panneau.ouvert {
    display: block;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    opacity: 1;
    transform: translateY(0);
}
.menu-mobile-panneau a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--r-md);
    text-decoration: none;
    color: var(--encre);
    font-size: 14.5px;
    font-weight: 500;
    min-height: 44px;
}
.menu-mobile-panneau a .sub-langue { display: block; font-size: 11.5px; font-weight: 400; color: var(--texte-3); }
.menu-mobile-panneau a svg { stroke: var(--texte-2); flex-shrink: 0; }
.menu-mobile-panneau a:hover { background: var(--surface-2); }
.menu-mobile-panneau a.actif { background: var(--marine-050); color: var(--marine-900); font-weight: 600; }
.menu-mobile-panneau a.actif svg { stroke: var(--marine-900); }
.menu-mobile-panneau a.deco { border-top: 1px solid var(--bordure); margin-top: 6px; padding-top: 12px; color: var(--texte-2); }

/* ============================================================
   3. Mise en page
   ============================================================ */

.contenu {
    max-width: 1160px;
    margin: 28px auto;
    padding: 0 24px;
}

.page {
    max-width: 460px;
    margin: 40px auto;
    background: var(--surface);
    padding: 28px;
    border-radius: var(--r-lg);
    box-shadow: var(--ombre-1);
    border: 1px solid var(--bordure);
}

.carte {
    background: var(--surface);
    border-radius: 18px;
    padding: 26px 28px;
    box-shadow: 0 1px 2px rgba(20, 52, 45, 0.04), 0 12px 28px -18px rgba(20, 52, 45, 0.22);
    border: 1px solid var(--bordure);
    margin-bottom: 20px;
}

h1 {
    font-size: 24px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--encre);
    letter-spacing: -0.5px;
}

h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.2px; }
h3 { font-size: 15px; font-weight: 600; }

.sous-titre {
    margin-top: -14px;
    margin-bottom: 20px;
    font-size: 13.5px;
    color: var(--texte-2);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.topbar a { color: var(--ambre-600); font-size: 13px; font-weight: 600; text-decoration: none; }
.topbar a:hover { text-decoration: underline; }

/* ============================================================
   4. Formulaires
   ============================================================ */

label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    margin-top: 16px;
    font-size: 12.5px;
    color: var(--encre);
}

input[type="text"], input[type="password"], input[type="file"],
input[type="number"], input[type="time"], input[type="date"],
select, textarea {
    width: 100%;
    min-height: 46px;
    padding: 10px 13px;
    border: 1px solid var(--bordure-forte);
    border-radius: var(--r-md);
    font-size: 15px;
    font-family: inherit;
    background: var(--surface);
    color: var(--encre);
    transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { min-height: 90px; line-height: 1.5; }

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--marine-500);
    box-shadow: 0 0 0 3px var(--marine-050);
}

input[type="time"] { font-family: var(--police-chiffres); }

/* ============================================================
   5. Boutons
   ============================================================ */

button, .btn {
    margin-top: 20px;
    background: linear-gradient(155deg, #1A4A3F, var(--marine-900) 65%);
    color: #fff;
    border: none;
    padding: 12px 20px;
    min-height: 46px;
    border-radius: var(--r-md);
    font-size: 15px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 1px 1px rgba(20, 52, 45, 0.1), 0 8px 16px -10px rgba(20, 52, 45, 0.55);
    transition: background 0.15s, transform 0.08s, box-shadow 0.15s;
}
button:hover, .btn:hover { background: linear-gradient(155deg, #1F5445, var(--navy-dark) 65%); }
button:active, .btn:active { transform: translateY(1px); box-shadow: 0 1px 1px rgba(20, 52, 45, 0.1); }
button:focus-visible, .btn:focus-visible,
a:focus-visible, input:focus-visible, select:focus-visible {
    outline: 2px solid var(--marine-500);
    outline-offset: 2px;
}
button:disabled { background: #EDF1F6; color: #A3AEBA; cursor: default; }
button:disabled:hover { background: #EDF1F6; }

button.secondaire, .btn.secondaire {
    background: var(--surface);
    color: var(--marine-700);
    border: 1px solid var(--bordure-forte);
}
button.secondaire:hover, .btn.secondaire:hover { background: var(--marine-050); }

button.ambre, .btn.ambre { background: linear-gradient(155deg, #E08A47, var(--ambre-500) 65%); box-shadow: var(--ombre-ambre); }
button.ambre:hover, .btn.ambre:hover { background: linear-gradient(155deg, var(--ambre-500), var(--ambre-600) 65%); }

.danger { background: var(--alerte); }
.danger:hover { background: #7C1B1E; }

a.bouton-mini, .bouton-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    background: var(--surface);
    color: var(--marine-700);
    border: 1px solid var(--bordure-forte);
    text-decoration: none;
    padding: 6px 13px;
    border-radius: var(--r-sm);
    font-size: 13px;
    font-weight: 600;
    margin-top: 0;
    cursor: pointer;
}
a.bouton-mini:hover, .bouton-mini:hover { background: var(--marine-050); }

button.lien-texte {
    background: none;
    border: none;
    color: var(--alerte);
    text-decoration: underline;
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    margin: 0;
    min-height: 0;
    font-weight: 500;
    display: inline;
}
button.lien-texte:hover { background: none; color: #7C1B1E; }

.lien-discret {
    display: inline-block;
    margin-top: 24px;
    font-size: 12.5px;
    color: var(--texte-3);
    text-decoration: none;
}
.lien-discret:hover { text-decoration: underline; }

/* ============================================================
   6. Messages
   ============================================================ */

.flash {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 16px;
    border-radius: var(--r-md);
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
}
.flash.succes { background: var(--succes-fond); color: var(--succes); border-color: var(--succes-bordure); }
.flash.erreur { background: var(--alerte-fond); color: var(--alerte); border-color: var(--alerte-bordure); }

.avis-signature {
    margin-top: 18px;
    padding: 13px 15px;
    background: var(--attention-fond);
    border: 1px solid var(--attention-bordure);
    border-radius: var(--r-md);
    font-size: 12.5px;
    line-height: 1.55;
    color: #6B4E14;
}
.avis-signature p { margin: 4px 0; }

.encart-info {
    display: flex;
    gap: 10px;
    padding: 13px 15px;
    background: var(--marine-050);
    border-radius: var(--r-md);
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--marine-700);
}

/* ============================================================
   7. Tableaux
   ============================================================ */

table.liste {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 14px;
}
table.liste th, table.liste td {
    text-align: left;
    padding: 11px 12px;
    border-bottom: 1px solid #EDF1F6;
}
table.liste th {
    background: var(--surface-2);
    color: var(--texte-2);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    border-bottom: 1px solid var(--bordure);
    white-space: nowrap;
}
table.liste th:first-child { border-top-left-radius: var(--r-sm); }
table.liste th:last-child { border-top-right-radius: var(--r-sm); }
table.liste tr:hover td { background: var(--surface-2); }
table.liste td.actions { white-space: nowrap; }

/* Pastilles de statut */
.pastille {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--r-pilule);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
}
.pastille::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.pastille.ok { background: var(--succes-fond); color: var(--succes); }
.pastille.info { background: var(--marine-050); color: var(--marine-700); }
.pastille.manque { background: var(--alerte-fond); color: var(--alerte); }

.badge-rendu { color: var(--succes); font-weight: 600; }
.badge-manquant { color: var(--alerte); font-weight: 600; }

.semaine-date-badge {
    display: inline-block;
    font-size: 12px;
    color: var(--marine-700);
    background: var(--marine-050);
    padding: 5px 12px;
    border-radius: var(--r-pilule);
    font-weight: 600;
    white-space: nowrap;
}

/* ============================================================
   8. Onglets (suivi)
   ============================================================ */

.onglets-suivi {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--bordure);
    overflow-x: auto;
}
.onglet-suivi {
    padding: 10px 15px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--texte-2);
    cursor: pointer;
    border: none;
    background: none;
    margin-top: 0;
    min-height: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    border-radius: 0;
    white-space: nowrap;
}
.onglet-suivi.actif { color: var(--encre); border-bottom-color: var(--ambre-500); }
.onglet-suivi:hover { background: var(--surface-2); color: var(--encre); }
.panneau-suivi { display: none; }
.panneau-suivi.actif { display: block; }

/* ============================================================
   9. Page d'accueil — tuiles
   ============================================================ */

.accueil-tuiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 8px;
}
.tuile {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--surface);
    border-radius: var(--r-lg);
    padding: 18px 20px;
    min-height: 92px;
    text-decoration: none;
    color: var(--encre);
    box-shadow: var(--ombre-1);
    border: 1px solid var(--bordure);
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.tuile:hover {
    transform: translateY(-2px);
    box-shadow: var(--ombre-2);
    border-color: var(--bordure-forte);
}
.tuile .icone {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 13px;
    background: linear-gradient(150deg, var(--ambre-050), #F6D9B8);
    box-shadow: inset 0 0 0 1px rgba(178, 82, 31, 0.12);
    font-size: 22px;
}
.tuile .icone.marine { background: linear-gradient(150deg, var(--marine-050), #CFE6DC); box-shadow: inset 0 0 0 1px rgba(20, 52, 45, 0.14); }
.tuile .texte-tuile { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tuile .titre-tuile { font-weight: 600; color: var(--encre); font-size: 16px; }
.tuile .desc-tuile { font-size: 12.5px; color: var(--texte-2); line-height: 1.45; }
.tuile .desc-tuile .es { color: var(--texte-3); }

/* ============================================================
   10. Ma semaine — une carte par jour
   Les classes .code-locked / .extras / .heures-affichees /
   .total-jour et les attributs data-jour sont le contrat avec
   ma_semaine.js. Ne pas les renommer.
   ============================================================ */

.entete-employe {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.identite { display: flex; align-items: center; gap: 12px; }
.identite .rond {
    width: 40px; height: 40px; border-radius: 999px;
    background: var(--marine-050); color: var(--marine-700);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.identite .nom { font-size: 16px; font-weight: 600; }
.identite .meta { font-size: 12.5px; color: var(--texte-2); }

.barre-semaine {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 18px;
}
.barre-semaine label { margin: 0 0 6px; }
.barre-semaine select, .barre-semaine input[type="text"] { width: auto; min-width: 200px; }

.bandeau-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--bordure);
    border-radius: var(--r-lg);
    padding: 15px 18px;
    margin-bottom: 16px;
}
.bandeau-total .libelle { font-size: 11.5px; font-weight: 700; color: var(--texte-2); text-transform: uppercase; letter-spacing: 0.7px; }
.bandeau-total .libelle-es { font-size: 12.5px; color: var(--texte-3); font-weight: 400; text-transform: none; letter-spacing: 0; }
.bandeau-total .valeur {
    font-family: var(--police-chiffres);
    font-variant-numeric: tabular-nums;
    font-size: 30px;
    font-weight: 600;
    color: var(--marine-900);
    letter-spacing: -1px;
}

/* Le tableau de la semaine : une colonne par jour, du lundi au
   dimanche. Sur telephone il defile lateralement et la colonne des
   libelles reste collee a gauche. */
.cadre-fiche {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--bordure);
    border-radius: var(--r-md);
    background: var(--surface);
    margin-bottom: 20px;
}

table.fiche {
    width: 100%;
    min-width: 780px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    table-layout: fixed;
}

table.fiche th, table.fiche td {
    border-right: 1px solid var(--bordure);
    border-bottom: 1px solid var(--bordure);
    padding: 9px 7px;
    text-align: center;
    vertical-align: top;
}
table.fiche th:last-child, table.fiche td:last-child { border-right: none; }
table.fiche tr:last-child td { border-bottom: none; }

table.fiche thead th {
    background: var(--marine-900);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    padding: 11px 7px;
    border-right-color: rgba(255, 255, 255, 0.16);
    border-bottom: none;
}
/* Colonne des libelles, collee a gauche pendant le defilement. */
table.fiche th.coin, table.fiche td.label {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 152px;
    text-align: left;
}
table.fiche th.coin { background: var(--marine-900); }
table.fiche td.label {
    background: var(--surface-2);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--texte-2);
    vertical-align: middle;
}
table.fiche td.label .es {
    display: block;
    font-weight: 400;
    font-size: 10.5px;
    text-transform: none;
    letter-spacing: 0;
    color: var(--texte-3);
    margin-top: 2px;
}

/* Samedi et dimanche, teintes pour se reperer. */
table.fiche th.fin-semaine { color: #F3C9A6; }
table.fiche td.fin-semaine { background: #FBFCFD; }

table.fiche td.heures-affichees {
    font-size: 11.5px;
    color: var(--texte-2);
    vertical-align: middle;
}
table.fiche td.total-jour {
    font-size: 16px;
    font-weight: 600;
    color: var(--marine-900);
    vertical-align: middle;
}
table.fiche td.total-jour.vide { color: var(--texte-3); font-weight: 500; }

/* Le code du jour, pose par la direction. Non modifiable ici. */
.code-locked {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 5px 12px;
    border-radius: var(--r-xs);
    background: var(--marine-050);
    color: var(--marine-700);
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.3px;
    min-height: 28px;
}
.code-locked.demande { background: var(--alerte-fond); color: var(--alerte); }

/* Heures calculees */
.heures-affichees {
    font-size: 12.5px;
    color: var(--texte-2);
    min-height: 18px;
}

/* Les champs generes par ma_semaine.js, a l'interieur d'une case. */
.extras { display: flex; flex-direction: column; gap: 9px; margin-top: 9px; text-align: left; }
.extras:empty { display: none; }
.extra-bloc { display: flex; flex-direction: column; gap: 5px; }
.extra-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--texte-2);
    margin: 0;
    line-height: 1.3;
}
.fin-input, .debut-input {
    width: 100%;
    min-height: 40px;
    font-size: 14px;
    padding: 7px 9px;
    margin: 0;
}
.choix-btn {
    min-height: 40px;
    padding: 8px 14px;
    margin: 0 6px 0 0;
    font-size: 13.5px;
    font-weight: 600;
    font-family: var(--police-chiffres);
    border: 1px solid var(--bordure-forte);
    background: var(--surface);
    color: var(--marine-700);
    border-radius: var(--r-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}
.choix-btn:hover { background: var(--marine-050); }
.choix-btn.actif { background: var(--marine-900); border-color: var(--marine-900); color: #fff; }

.actions-fiche {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}
.actions-fiche button { margin-top: 0; width: 100%; }
.ligne-brouillon {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.ligne-brouillon button { flex-grow: 1; }
#statut-brouillon {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--succes);
    white-space: nowrap;
}

/* Bouton de pointage rapide */
.bouton-pointer-rapide {
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100%;
    min-height: 62px;
    padding: 12px 15px;
    background: var(--ambre-500);
    border-radius: var(--r-lg);
    box-shadow: var(--ombre-ambre);
    color: #fff;
    text-decoration: none;
    margin-bottom: 16px;
}
.bouton-pointer-rapide:hover { background: var(--ambre-600); }
.bouton-pointer-rapide .lib { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; }
.bouton-pointer-rapide .fr { font-size: 15.5px; font-weight: 600; }
.bouton-pointer-rapide .es { font-size: 12.5px; color: rgba(255, 255, 255, 0.86); }

/* ============================================================
   11. Ecran de pointage
   ============================================================ */

.wrap-pointage { max-width: 440px; margin: 0 auto; }

.carte-pointage {
    background: var(--surface);
    border: 1px solid var(--bordure);
    border-radius: var(--r-lg);
    padding: 24px 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}
.jour-pointage { font-size: 12px; font-weight: 700; color: var(--texte-2); text-transform: uppercase; letter-spacing: 0.8px; }
.jour-pointage .es { display: block; font-size: 12.5px; font-weight: 400; color: var(--texte-3); text-transform: none; letter-spacing: 0; margin-top: 3px; }

.code-pointage {
    width: 100%;
    background: var(--marine-050);
    border-radius: var(--r-md);
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.code-pointage .etiquette { font-size: 11px; font-weight: 700; color: var(--marine-700); text-transform: uppercase; letter-spacing: 0.8px; }
.code-pointage .valeur { font-size: 28px; font-weight: 700; color: var(--marine-900); letter-spacing: -0.5px; }

.heures-pointage {
    font-family: var(--police-chiffres);
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    color: var(--texte-2);
    min-height: 20px;
}

.bouton-pointer {
    width: 100%;
    min-height: 92px;
    margin-top: 4px;
    font-size: 19px;
    font-weight: 700;
    color: #fff;
    background: var(--ambre-500);
    border: none;
    border-radius: var(--r-lg);
    cursor: pointer;
    box-shadow: var(--ombre-ambre);
    flex-direction: column;
    gap: 5px;
}
.bouton-pointer .es { font-size: 13px; font-weight: 400; color: rgba(255, 255, 255, 0.88); }
.bouton-pointer:hover { background: var(--ambre-600); }
.bouton-pointer:active { transform: translateY(1px); }
.bouton-pointer:disabled { background: #EDF1F6; color: #A3AEBA; box-shadow: none; }
.bouton-pointer:disabled .es { color: #A3AEBA; }

.confirmation {
    font-size: 13.5px;
    color: var(--succes);
    font-weight: 600;
    min-height: 18px;
}
.sous-texte { font-size: 12.5px; color: var(--texte-2); line-height: 1.55; margin: 0; }
.lien-retour {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 46px;
    margin-top: 6px;
    background: var(--surface);
    border: 1px solid var(--bordure-forte);
    border-radius: var(--r-md);
    color: var(--marine-700);
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
}
.lien-retour:hover { background: var(--marine-050); }

/* ============================================================
   12. Divers repris de l'ancienne feuille
   ============================================================ */

.services-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 6px 0 4px; }
.service-chip {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 7px 14px;
    border: 1px solid var(--bordure-forte);
    border-radius: var(--r-pilule);
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    background: var(--surface);
    color: var(--encre);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.service-chip input { display: none; }
.service-chip.selectionne { background: var(--marine-900); border-color: var(--marine-900); color: #fff; font-weight: 600; }
.service-chip:hover { border-color: var(--marine-500); }

.bloc-secondaire {
    margin-bottom: 20px;
    padding: 15px 17px;
    background: var(--surface-2);
    border: 1px solid var(--bordure);
    border-radius: var(--r-md);
}
.bloc-secondaire h3 { margin: 0 0 8px; font-size: 14px; color: var(--encre); }

.zone-danger {
    margin-top: 28px;
    padding: 15px 17px;
    background: var(--alerte-fond);
    border: 1px solid var(--alerte-bordure);
    border-radius: var(--r-md);
}
.zone-danger h3 { margin: 0 0 6px; font-size: 14px; color: var(--alerte); }
.zone-danger p { font-size: 12.5px; color: #7C1B1E; margin: 0 0 10px; line-height: 1.55; }
.zone-danger button { background: var(--alerte); }
.zone-danger button:hover { background: #7C1B1E; }

.btn-modifier-service {
    background: none;
    border: none;
    color: var(--marine-700);
    text-decoration: underline;
    cursor: pointer;
    font-size: 12.5px;
    padding: 0;
    margin: 0 0 0 8px;
    min-height: 0;
    display: inline;
    font-weight: 500;
}
.btn-modifier-service:hover { background: none; color: var(--marine-900); }

.semaine-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.semaine-bar label { margin: 0; }
.semaine-bar input[type="text"] { width: 110px; min-height: 40px; margin-top: 0; }
.semaine-bar select { width: auto; max-width: 280px; min-height: 40px; margin-top: 0; }
.semaine-bar button { margin-top: 0; min-height: 40px; padding: 8px 18px; font-size: 13.5px; }
.semaine-bar a { font-size: 13px; color: var(--ambre-600); font-weight: 600; }

.resume-suivi { font-size: 14px; margin-bottom: 16px; color: var(--texte-2); }

/* Le trombone de l'ancienne version, garde mais discret. */
.trombone-mignon {
    position: fixed;
    bottom: 10px;
    left: 14px;
    font-size: 22px;
    z-index: 50;
    opacity: 0.4;
    pointer-events: none;
    user-select: none;
}

/* ============================================================
   13. Adaptation aux petits ecrans
   ============================================================ */

@media (min-width: 720px) {
    .actions-fiche { flex-direction: row-reverse; align-items: center; justify-content: flex-end; }
    .actions-fiche button { width: auto; }
    .ligne-brouillon { flex-grow: 0; }
}

@media (max-width: 820px) {
    /* La navigation du haut devient un menu deroulant. */
    .nav-links { display: none; }
    .menu-mobile-bouton { display: flex; }
    .trombone-mignon { display: none; }

    .contenu { margin: 16px auto; padding: 0 14px; }
    .carte { padding: 18px 16px; border-radius: var(--r-md); }
    .page { margin: 18px 14px; padding: 22px 18px; max-width: none; }
    h1 { font-size: 20px; margin-bottom: 16px; }

    /* Les tableaux de gestion defilent lateralement plutot que
       de se tasser illisiblement. */
    .table-defilante, table.liste {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    table.liste th, table.liste td { padding: 10px; }

    .bandeau-total .valeur { font-size: 26px; }
    .semaine-bar select, .semaine-bar input[type="text"] { flex-grow: 1; min-width: 0; }
}

@media (max-width: 420px) {
    .tuile { padding: 15px 16px; }
}

/* ============================================================
   14. Impression
   ============================================================ */

@media print {
    .nav-bar, .menu-mobile-panneau, .trombone-mignon,
    .actions-fiche, .bouton-pointer-rapide, .flash { display: none !important; }
    body { background: #fff; padding-bottom: 0; }
    .contenu { margin: 0; padding: 0; max-width: none; }
    .carte, .page { box-shadow: none; border: none; padding: 0; }
    /* A l'impression, le tableau ne defile plus : il tient sur la page. */
    .cadre-fiche { overflow: visible; border: none; }
    table.fiche { min-width: 0; font-size: 11px; }
    table.fiche th.coin, table.fiche td.label { position: static; }
    table.fiche thead th { background: var(--marine-050) !important; color: var(--encre) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    table.fiche th, table.fiche td { border: 1px solid var(--bordure-forte); }
    .bandeau-total { break-inside: avoid; }
    a { color: #000; text-decoration: none; }
}
