:root {
    --brand: #292150;       /* indigo logo */
    --brand-2: #392f6b;     /* survol sidebar */
    --primary: #6d4ade;     /* violet / mauve accent */
    --primary-d: #5a39c4;
    --primary-tint: #efeafd;
    --teal: #0fb6a1;        /* couleur secondaire */
    --teal-d: #0c9486;
    --teal-tint: #e2f7f3;
    --amber: #9a6700;       /* « à payer » */
    --amber-tint: #fff4e0;
    --ink: #1e2430;
    --muted: #6b7280;
    --line: #e8e9f1;
    --bg: #f4f4fb;
    --card: #ffffff;
    --danger: #e0473c;
    --danger-tint: #fdecea;
    --ok: #0c9486;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(41,33,80,.04), 0 6px 20px rgba(41,33,80,.06);
    --shadow-sm: 0 1px 3px rgba(41,33,80,.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--brand); }

/* =================== Sidebar layout =================== */
body.has-sidebar { display: flex; min-height: 100vh; }

.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: linear-gradient(165deg, var(--brand) 0%, #3a2f6b 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
}
.side-brand { padding: 6px 10px 22px; }
.side-logo { width: 130px; height: auto; display: block; }
.side-sub { display: block; margin-top: 6px; font-size: 12px; color: rgba(255,255,255,.55); letter-spacing: .02em; padding-left: 2px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a {
    display: flex; align-items: center; gap: 11px;
    padding: 11px 13px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,.72);
    font-weight: 500; font-size: 14.5px;
    transition: background .15s, color .15s;
}
.side-nav a:hover { background: var(--brand-2); color: #fff; text-decoration: none; }
.side-nav a.on { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.ico { width: 18px; height: 18px; flex-shrink: 0; }
.side-nav .ico { opacity: .9; }

/* Groupe « Paramètres » dépliable */
.side-parent {
    display: flex; align-items: center; gap: 11px; width: 100%;
    padding: 11px 13px; border: none; background: none; box-shadow: none;
    border-radius: var(--radius-sm); color: rgba(255,255,255,.72);
    font-weight: 500; font-size: 14.5px; cursor: pointer; text-align: left;
}
.side-parent:hover { background: var(--brand-2); color: #fff; }
.side-parent .chev { margin-left: auto; display: inline-flex; transition: transform .2s; }
.side-parent .chev .ico { width: 15px; height: 15px; }
.side-group.open .side-parent .chev { transform: rotate(180deg); }
.side-subnav { display: none; flex-direction: column; gap: 2px; margin: 2px 0 4px 12px;
    padding-left: 10px; border-left: 1px solid rgba(255,255,255,.14); }
.side-group.open .side-subnav { display: flex; }
.side-subnav a {
    display: flex; align-items: center; gap: 9px; padding: 8px 11px;
    border-radius: var(--radius-sm); color: rgba(255,255,255,.66);
    font-size: 13px; font-weight: 500; transition: background .15s, color .15s;
}
.side-subnav a:hover { background: var(--brand-2); color: #fff; text-decoration: none; }
.side-subnav a.on { background: var(--primary); color: #fff; }
.side-subnav .ico { width: 16px; height: 16px; }

/* Barre mobile + burger (cachés sur bureau) */
.mobile-bar { display: none; }
.burger, .side-close { background: none; border: none; box-shadow: none; padding: 6px; cursor: pointer; color: #fff; }
.burger:hover, .side-close:hover { background: rgba(255,255,255,.12); }
.burger .ico, .side-close .ico { width: 24px; height: 24px; }
.side-close { display: none; }
.scrim { display: none; }

.side-user { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); }
.side-user-mail { font-size: 12.5px; color: rgba(255,255,255,.6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 8px; }
.side-account { display: block; color: rgba(255,255,255,.85); font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.side-account:hover, .side-account.on { color: #fff; }
.side-logout { color: rgba(255,255,255,.85); font-size: 13px; font-weight: 500; }
.side-logout:hover { color: #fff; }

.content { flex: 1; min-width: 0; padding: 34px 40px; max-width: 1120px; }

/* =================== Auth pages =================== */
body.auth-bg {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(150deg, #292150 0%, #4a3a8f 55%, #6d4ade 120%);
    padding: 24px;
}
.auth-wrap { display: flex; flex-direction: column; align-items: center; gap: 22px; width: 100%; max-width: 380px; }
.auth-logo { width: 150px; filter: brightness(0) invert(1); opacity: .96; }
.auth-foot { color: rgba(255,255,255,.7); font-size: 13px; margin: 0; }

/* =================== Headings / page head =================== */
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; font-weight: 500; margin-bottom: 12px; }
.back-link:hover { color: var(--primary-d); text-decoration: none; }
.back-link .ico { width: 16px; height: 16px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; margin: 0; font-weight: 800; letter-spacing: -.02em; }
.head-actions { display: flex; gap: 12px; align-items: center; }
.cout-toggle { display: flex; align-items: center; }
.cout-toggle .check { flex-direction: row; align-items: center; gap: 7px; margin: 0; font-size: 13.5px; font-weight: 500; color: var(--ink); white-space: nowrap; }
h2 { font-size: 16px; margin: 26px 0 12px; font-weight: 700; }
h3.sub { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 12px; font-weight: 700; }

/* =================== Cards & forms =================== */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px;
    box-shadow: var(--shadow);
}
.card.auth { width: 100%; padding: 30px; }
.card.auth h1 { margin: 0 0 18px; font-size: 22px; }

.form label, .filters label { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 500; color: var(--muted); margin-bottom: 16px; }
.form input, .form select, .filters select, .filters input {
    font: inherit; font-size: 14.5px; color: var(--ink); width: 100%;
    padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.filters select, .filters input { width: auto; }
.filters .year-select { width: 104px; } /* largeur figée : pas de variation 2026 / Toutes */
.filters select:disabled { color: var(--muted); opacity: .55; background: var(--bg); cursor: not-allowed; }
.auth-form { margin-top: 4px; }
.auth-form button { width: 100%; margin-top: 6px; padding: 11px; }
.form input:focus, .form select:focus, .filters select:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint);
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
/* Grille de taux : autant de colonnes que la largeur le permet (≈150px/champ) */
.grid-taux { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 22px; }

/* Champ de pourcentage : input + suffixe « % » dans un cadre unique */
.pct-input { display: flex; align-items: stretch; max-width: 150px; border: 1px solid var(--line);
    border-radius: var(--radius-sm); background: #fff; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.pct-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint); }
.form .pct-input input { border: none; border-radius: 0; background: transparent; text-align: right;
    font-variant-numeric: tabular-nums; padding-right: 6px; }
.form .pct-input input:focus { box-shadow: none; }
.pct-suffix { display: flex; align-items: center; padding: 0 11px 0 8px; background: #faf9fe;
    border-left: 1px solid var(--line); color: var(--muted); font-size: 13.5px; font-weight: 600; }
.check { flex-direction: row !important; align-items: center; gap: 9px; font-weight: 500; color: var(--ink); }
.form-actions { display: flex; gap: 10px; margin-top: 14px; align-items: center; }
.form-actions label.inline { flex-direction: row; align-items: center; gap: 9px; margin-bottom: 0; color: var(--muted); font-weight: 600; }

.year-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 4px; flex-wrap: wrap; }
.year-bar h2 { margin: 0; }
.year-bar label.inline { flex-direction: row; align-items: center; gap: 9px; margin-bottom: 0; color: var(--muted); font-weight: 600; }
.year-bar select { width: auto; padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; font-weight: 600; }

/* =================== Buttons =================== */
button, .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-size: 14.5px; cursor: pointer;
    background: var(--primary); color: #fff; border: 1px solid var(--primary);
    padding: 10px 18px; border-radius: var(--radius-sm); font-weight: 600;
    transition: background .15s, border-color .15s, transform .05s; box-shadow: var(--shadow-sm);
}
button:hover, .btn:hover { background: var(--primary-d); border-color: var(--primary-d); text-decoration: none; }
button:active, .btn:active { transform: translateY(1px); }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); font-weight: 500; box-shadow: none; }
.btn.ghost:hover { background: var(--primary-tint); border-color: var(--primary-tint); color: var(--primary-d); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: #c63b31; border-color: #c63b31; }
.btn.icon-only { padding: 9px 11px; }
.btn.icon-only .ico { width: 17px; height: 17px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.add-row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.add-row label { flex: 1; min-width: 160px; margin-bottom: 0; }
.add-row button { white-space: nowrap; }

/* Lignes de prestation (fiche) */
.ligne-row { display: flex; gap: 10px; align-items: center; margin-bottom: 9px; }
.ligne-row .l-unite { flex: 0 0 170px; width: auto; }
.ligne-row .l-qte { flex: 0 0 90px; width: auto; }
.ligne-row .l-taux-choix { flex: 0 0 180px; width: auto; }
.ligne-row .l-taux-manuel { flex: 0 0 90px; width: auto; }
.ligne-row .l-sub { flex: 1; font-size: 13px; min-width: 110px; }
.ligne-row .l-del { flex: 0 0 auto; padding: 8px 12px; line-height: 1; }
.lignes-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 4px; }
.total-h { font-size: 14px; color: var(--muted); }
.total-h strong { color: var(--brand); font-size: 15px; }
@media (max-width: 800px) {
    .ligne-row { flex-wrap: wrap; }
    .ligne-row .l-unite, .ligne-row .l-qte { flex: 1 1 40%; }
}

/* =================== Messages =================== */
.err { background: var(--danger-tint); color: var(--danger); padding: 11px 15px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; }
.ok  { background: var(--teal-tint); color: var(--ok); padding: 11px 15px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; }

/* Toast flottant (messages de succès) — disparaît après 3 s via JS */
.flash {
    position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
    z-index: 200; margin: 0; box-shadow: var(--shadow);
    border: 1px solid var(--teal); animation: flash-in .22s ease-out;
}
.flash.flash-out { opacity: 0; transition: opacity .4s ease; }
@keyframes flash-in { from { opacity: 0; transform: translateX(-50%) translateY(-10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@media print { .flash { display: none; } }
.muted { color: var(--muted); }
.small { font-size: 12.8px; }

/* Utilitaires d'espacement / disposition (remplacent les styles inline) */
.mt-0 { margin-top: 0; }
.mt-18 { margin-top: 18px; }
.mt-22 { margin-top: 22px; }
.mb-0 { margin-bottom: 0; }
.mb-16 { margin-bottom: 16px; }
.mb-22 { margin-bottom: 22px; }
.d-inline { display: inline; }
button:disabled, .btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }
button:disabled:hover, .btn:disabled:hover { background: var(--primary); border-color: var(--primary); }
.btn.ghost:disabled:hover { background: #fff; }

/* Formulaire « Date de paiement » de la fiche */
.paiement-form { display: flex; align-items: center; width: 100%; gap: 12px; flex-wrap: nowrap; }
.paiement-left { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; }
.paiement-left h2 { margin: 0; white-space: nowrap; }
.paiement-date { width: 160px; flex: 0 0 160px; }
.paiement-left p { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.paiement-form > button { flex: 0 0 auto; }
.paiement-date { width: 150px; }
.paid-check { color: var(--teal); font-weight: 700; }
.center { text-align: center; }
.mail-sent { display: inline-flex; align-items: center; gap: 4px; color: var(--teal-d); font-weight: 600; font-size: 13px; }
.mail-sent .ico { width: 16px; height: 16px; }
.tag-warn { display: inline-block; background: #fff4e0; color: #9a6700; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }

/* =================== Filters =================== */
.filters { display: flex; gap: 16px; align-items: flex-end; margin-bottom: 22px; flex-wrap: wrap; background: var(--card); padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.filters label { margin-bottom: 0; }

/* =================== Tables =================== */
.list { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.list th, .list td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.list thead th { background: #faf9fe; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.list tbody tr { transition: background .12s; }
.list tbody tr:hover { background: #faf9fe; }
.list tr.row-link { cursor: pointer; }
.list tr.row-link:hover { background: var(--primary-tint); }
.list tbody tr:last-child td { border-bottom: none; }
.list .num { text-align: right; font-variant-numeric: tabular-nums; }
.list .strong { font-weight: 700; color: var(--teal-d); }
.list td.col-brut { color: var(--primary); font-weight: 700; }   /* brut en mauve */
.list td.col-cout { color: var(--ink); font-weight: 700; }        /* coût employeur en gras noir */
.list .actions { text-align: right; }
.list tr.inactif td { opacity: .5; }
.badge { font-size: 11px; background: var(--primary-tint); color: var(--primary-d); padding: 2px 9px; border-radius: 20px; margin-left: 6px; font-weight: 600; }
.badge.ok-badge { background: var(--teal-tint); color: var(--teal-d); margin-left: 0; }
.badge.warn-badge { background: #fff4e0; color: #9a6700; margin-left: 0; }
.table-scroll { overflow-x: auto; border-radius: var(--radius); }
.resume tfoot td { background: #faf9fe; border-top: 2px solid var(--line); font-weight: 700; color: var(--brand); }
.list .reste-du { color: #9a6700; }
.resume .col-brut { color: var(--primary); font-weight: 700; }
.resume .col-cout { font-weight: 700; }
.resume .col-petit { font-size: 11px; color: var(--muted); }
.resume tfoot .col-petit { color: var(--brand); }
.resume tfoot td.col-cout { color: var(--ink); } /* total coût employeur en noir */
.list td.net-apayer { color: var(--amber); }      /* net en jaune quand à payer */
.list .apayer-row td { background: var(--amber-tint); } /* ligne « Total à verser » sur fond jaune */

/* Mini-fiches dans la liste employés */
.mini-fiches { display: flex; flex-direction: column; gap: 3px; }
.mini-fiche { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; }
.mini-fiche .mf-mois { font-weight: 600; color: var(--ink); min-width: 56px; }
.mini-fiche .mf-mont { color: var(--muted); font-variant-numeric: tabular-nums; }
.resume .total-row td { background: var(--primary-tint); }

.danger-zone { margin-top: 26px; }

/* Options de la fiche (paiement / affichage) */
.options-fiche { display: flex; gap: 36px; flex-wrap: wrap; }
.opt-block { flex: 1; min-width: 280px; }
.opt-block h2 { margin-top: 0; }
.inline-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.inline-form label.inline { flex-direction: column; gap: 5px; margin-bottom: 0; }
.inline-form label.check { flex-direction: row; align-items: flex-start; gap: 9px; color: var(--ink); font-weight: 500; }
.inline-form .badge { align-self: center; }

/* =================== Payslip =================== */
.payslip { max-width: 720px; }
.ps-head { margin-bottom: 12px; }
.ps-logo { height: 38px; width: auto; }
.ps-title { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--brand); padding-bottom: 7px; margin-bottom: 13px; }
.ps-title h2 { margin: 0; font-size: 19px; }
.ps-period { font-weight: 600; color: var(--ink); }
.ps-apayer { color: #9a6700; font-weight: 600; }
.ps-paiement { margin: -6px 0 18px; text-align: right; font-weight: 600; color: var(--teal-d); }
.ps-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 13px; }
.ps-parties h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 3px; }
.ps-parties p { margin: 0; }
.ps-refs { width: 100%; border-collapse: collapse; margin-bottom: 13px; font-size: 13.5px; }
.ps-refs td { padding: 4px 8px; border-bottom: 1px solid var(--line); }
.ps-refs td:nth-child(odd) { color: var(--muted); width: 22%; }
.ps-table { width: 100%; border-collapse: collapse; margin-bottom: 11px; }
.ps-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--brand); padding: 5px 8px; }
.ps-table td { padding: 4.5px 8px; border-bottom: 1px solid var(--line); }
.ps-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.ps-table tr.ps-sub td { color: var(--muted); font-size: .92em; padding-top: 3px; padding-bottom: 3px; }
.ps-seuil { font-weight: 400; font-size: 11.5px; margin-top: 2px; }
.ps-table tr.total td { font-weight: 700; border-top: 1px solid var(--brand); border-bottom: none; }
.ps-table tr.brut-line td { background: var(--primary-tint); color: var(--brand); border-top: none; padding-top: 8px; padding-bottom: 8px; }
.ps-table.net { margin-top: -2px; margin-bottom: 14px; }
.ps-table .grand-total td { font-size: 16px; font-weight: 800; background: var(--teal-tint); color: var(--teal-d); padding: 10px 10px; border: none; }
.ps-table .grand-total.apayer td { background: var(--amber-tint); color: var(--amber); } /* à payer → jaune */

/* =================== Print =================== */
.print-toolbar { padding: 13px 18px; background: var(--brand); color: #fff; display: flex; gap: 16px; align-items: center; }
.print-toolbar a { color: rgba(255,255,255,.9); }
.print-toolbar button { background: var(--primary); border-color: var(--primary); }
.sheet { max-width: 820px; margin: 26px auto; background: #fff; padding: 44px; box-shadow: 0 4px 24px rgba(0,0,0,.18); border-radius: 6px; }
body.print-page { background: #e9e9f2; }

@media print {
    .print-toolbar { display: none; }
    body.print-page { background: #fff; }
    .sheet { box-shadow: none; margin: 0; max-width: none; padding: 0; border-radius: 0; }
    @page { margin: 12mm; }

    /* Compression pour tenir sur une seule page A4 */
    .payslip { font-size: 11px; max-width: none; }
    .ps-title { margin-bottom: 9px; padding-bottom: 5px; }
    .ps-title h2 { font-size: 16px; }
    .ps-parties { margin-bottom: 9px; gap: 14px; }
    .ps-refs { margin-bottom: 9px; font-size: 11px; }
    .ps-refs td { padding: 2.5px 7px; }
    .ps-table { margin-bottom: 7px; page-break-inside: avoid; }
    .ps-table th { padding: 3px 7px; font-size: 10px; }
    .ps-table td { padding: 3px 7px; }
    .ps-table.net { margin-bottom: 9px; }
    .ps-table .grand-total td { font-size: 14px; padding: 7px 9px; }

    /* Certificat : compression pour tenir sur une page A4 */
    .cert { font-size: 11px; }
    .cert-table th, .cert-table td { padding: 2.5px 8px; }
    .cert-top { margin-bottom: 10px; }
    .cert-id, .cert-checks { margin-bottom: 8px; }
    .cert-foot { margin-top: 16px; }
}

/* =================== Certificat de salaire (Formulaire 11) =================== */
/* Police standard exigée par le guide AFC (Arial / Helvetica / Verdana). */
.cert { font-family: Arial, Helvetica, Verdana, sans-serif; color: #111; }
.cert-top { display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--brand); padding-bottom: 12px; margin-bottom: 18px; }
.cert-logo { height: 34px; width: auto; }
.cert-title { text-align: right; }
.cert-title h2 { margin: 0; font-size: 20px; color: var(--brand); }
.cert-ref { font-size: 12px; color: var(--muted); }
.cert-lbl { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.cert-id { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 14px; }
.cert-id-block { line-height: 1.5; }
.cert-id-meta { text-align: right; display: grid; gap: 8px; }
.cert-id-meta .cert-lbl { margin-bottom: 0; }
.cert-checks { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; font-size: 12.5px; }
.cert-check { display: flex; align-items: center; gap: 8px; color: #333; }
.cert-check .box { width: 13px; height: 13px; border: 1.5px solid #888; border-radius: 2px; flex: 0 0 auto; }
.cert-table { width: 100%; border-collapse: collapse; }
.cert-table th { text-align: left; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1.5px solid var(--line); padding: 6px 9px; }
.cert-table td { padding: 5px 9px; border-bottom: 1px solid #f0eef7; vertical-align: top; }
.cert-table .n { width: 42px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cert-table .op { width: 22px; text-align: center; color: var(--muted); }
.cert-table .amt { width: 130px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cert-table .hint { color: var(--muted); font-weight: 400; }
.cert-table tr.sub .n, .cert-table tr.sub td:nth-child(2) { padding-left: 16px; color: #555; font-size: 12.5px; }
.cert-table tr.tot td { font-weight: 800; background: var(--primary-tint); color: var(--brand); border-bottom: none; }
.cert-note { font-size: 11.5px; color: var(--muted); margin: 14px 0 0; line-height: 1.5; }
.cert-foot { display: flex; gap: 28px; margin-top: 28px; }
.cert-foot .cert-sign { flex: 1; line-height: 1.5; }
.cert-line { display: block; border-bottom: 1px solid #999; height: 26px; }

/* =================== Logos employeur =================== */
/* Aperçus dans le formulaire employeur */
.logo-preview { display: inline-flex; align-items: center; padding: 8px 10px; border-radius: var(--radius-sm); margin: 4px 0; }
.logo-preview img { max-height: 40px; max-width: 200px; width: auto; display: block; }
.logo-preview.clair { background: #fff; border: 1px solid var(--line); }
.logo-preview.sombre { background: var(--brand); }
/* Repli texte quand aucun logo n'est configuré */
.side-name { color: #fff; font-weight: 800; font-size: 19px; }
.mbar-name { color: #fff; font-weight: 800; font-size: 17px; }
.auth-name { color: var(--brand); font-weight: 800; font-size: 24px; margin-bottom: 6px; }

/* =================== Abbr =================== */
abbr {
    border-bottom: 1px dotted #666;
    text-decoration: none;
    cursor: help;
    display: inline;
    white-space: nowrap;
}

/* =================== Responsive : tiroir + burger =================== */
@media (max-width: 800px) {
    .side-brand { juistify-content: space-between; display: flex; align-items: center; }
    .side-close { display: inline-flex; }

    /* Barre supérieure fixe avec logo + burger */
    .mobile-bar {
        display: flex; align-items: center; justify-content: space-between;
        background: var(--brand); padding: 10px 16px;
        position: sticky; top: 0; z-index: 30;
    }
    .mbar-logo { width: 104px; height: auto; }

    /* La sidebar devient un tiroir hors écran */
    body.has-sidebar { flex-direction: column; }
    .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; height: 100vh; width: 264px;
        transform: translateX(-100%); transition: transform .25s ease; z-index: 50;
    }
    body.nav-open .sidebar { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.35); }

    .scrim { display: block; position: fixed; inset: 0; background: rgba(20,16,40,.5);
        opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 40; }
    body.nav-open .scrim { opacity: 1; pointer-events: auto; }

    .content { padding: 22px 18px; max-width: none; }
    .grid2, .grid3 { grid-template-columns: 1fr; }
    .page-head h1 { font-size: 21px; }
}
