@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Space+Grotesk:wght@600;700&display=swap');

:root {
    --bg: #F7FAFC;
    --card: #ffffff;
    --ink: #1a202c;
    --muted: #718096;
    --line: #E2E8F0;
    --primary: #2B6CB0;
    --primary-dark: #1B2A4A;
    --accent: #3B82F6;
    --accent-light: #60A5FA;
    --light-bg: #EBF4FF;
    --success: #38A169;
    --danger: #E53E3E;
    --warn: #D69E2E;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(20, 30, 50, .08), 0 8px 24px rgba(20, 30, 50, .06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Manrope", "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
    display: flex; align-items: center; gap: 24px;
    background: rgba(255, 255, 255, .92); border-bottom: 1px solid var(--line);
    backdrop-filter: blur(8px);
    padding: 0 24px; height: 64px; position: sticky; top: 0; z-index: 20;
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.brand-mark {
    width: 30px; height: 30px; border-radius: 9px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff; font-size: .9rem;
}
.brand-text { font-family: "Space Grotesk", "Manrope", sans-serif; }
.brand:hover { text-decoration: none; }
.topnav { display: flex; gap: 18px; }
.topnav a {
    color: #516078; font-weight: 600; padding: 7px 10px;
    border-radius: 8px; transition: .15s;
}
.topnav a:hover { color: var(--ink); background: var(--light-bg); text-decoration: none; }
.topnav a.active { color: var(--primary); background: var(--light-bg); }
.nav-badge {
    display: inline-block; min-width: 18px; padding: 1px 6px; margin-left: 4px;
    font-size: .72rem; font-weight: 700; line-height: 1.4; text-align: center;
    color: #fff; background: var(--danger); border-radius: 999px; vertical-align: middle;
}
.topuser { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user-id { display: flex; flex-direction: column; align-items: flex-end; gap: 0; }
.user-name { font-weight: 600; }
.user-company { color: var(--muted); font-size: .85rem; }
.btn-logout { font-size: .83rem; color: var(--muted); border: 1px solid var(--line); padding: 6px 12px; border-radius: 8px; }
.btn-logout:hover { color: var(--danger); border-color: var(--danger); text-decoration: none; }

/* ── Layout ─────────────────────────────────────────────── */
.container { max-width: 1080px; margin: 0 auto; padding: 28px 24px 80px; }
.container--wide { max-width: none; }
.footer {
    text-align: center; color: var(--muted); font-size: .82rem; padding: 22px;
    display: flex; justify-content: center; gap: 8px; flex-wrap: wrap;
}
.footer-sep { opacity: .45; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.text-right { text-align: right; }

/* ── Page légale / RGPD ─────────────────────────────────── */
.footer-link { color: var(--muted); text-decoration: none; }
.footer-link:hover { color: var(--primary); text-decoration: underline; }
.legal-wrap { max-width: 860px; margin: 0 auto; padding: 28px 20px 60px; }
.legal-back { display: inline-block; margin-bottom: 18px; color: var(--muted); text-decoration: none; font-size: .9rem; }
.legal-back:hover { color: var(--primary); }
.legal-head h1 { font-size: 1.55rem; line-height: 1.3; margin: 0 0 10px; }
.legal-head .muted { font-size: .9rem; }
.legal-toc { background: var(--light-bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 22px; margin: 22px 0 28px; }
.legal-toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 28px; }
.legal-toc li { margin: 4px 0; font-size: .9rem; }
.legal-toc a { color: var(--ink); text-decoration: none; }
.legal-toc a:hover { color: var(--primary); text-decoration: underline; }
.legal-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 26px; margin: 0 0 18px; }
.legal-card h2 { font-size: 1.12rem; margin: 0 0 12px; }
.legal-card p { margin: 0 0 12px; line-height: 1.6; }
.legal-card ul { margin: 0 0 12px; padding-left: 22px; line-height: 1.6; }
.legal-card li { margin: 5px 0; }
.legal-card a { color: var(--primary); }
.legal-card--accent { border-left: 4px solid var(--danger); }
@media (max-width: 640px) { .legal-toc ol { columns: 1; } }
.page-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.card.mb { margin-bottom: 18px; }
.inline-add { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.inline-add input { flex: 1; }

/* ── Boutons ────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px; border: 1px solid var(--line); background: var(--card);
    color: var(--ink); padding: 9px 16px; border-radius: 9px;
    font-size: .92rem; font-weight: 600; cursor: pointer; transition: .15s;
}
.btn:hover { text-decoration: none; border-color: #cfd6e4; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-ghost { color: var(--danger); border-color: transparent; }
.btn-danger-ghost:hover { border-color: var(--danger); }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-icon { gap: 5px; padding: 6px 10px; }
.btn-icon svg { display: block; }
.btn-icon-lbl { font-size: .82rem; font-weight: 600; }
@media (max-width: 720px) { .btn-icon-lbl { display: none; } }
.btn-row { display: flex; gap: 12px; }
.inline { display: inline; }

/* ── Auth ───────────────────────────────────────────────── */
.auth-wrap {
    min-height: 100vh; display: grid; place-items: center; padding: 24px;
    background:
        radial-gradient(circle at 15% 20%, rgba(43, 108, 176, .16) 0, transparent 30%),
        radial-gradient(circle at 85% 8%, rgba(59, 130, 246, .14) 0, transparent 28%),
        var(--bg);
}
.auth-card {
    background: var(--card); width: 100%; max-width: 430px; padding: 36px;
    border-radius: 18px; box-shadow: 0 12px 36px rgba(20, 30, 50, .12);
    border: 1px solid #dfe5f2;
}
.auth-logo { font-size: 1.6rem; font-weight: 800; text-align: center; }
.auth-logo { display: block; color: var(--ink); text-decoration: none; }
.auth-logo:hover { text-decoration: none; color: var(--primary); }
.auth-subtitle { text-align: center; color: var(--muted); margin: 4px 0 24px; }
.auth-form label, .form label { display: block; margin-bottom: 14px; }
.auth-form label span, .form label span { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; color: var(--muted); }
input[type=email], input[type=password], input[type=text], input[type=number],
input[type=tel], input[type=time], input[type=date], select, textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line);
    border-radius: 9px; font-size: .95rem; background: #fff; color: var(--ink);
}
textarea { font-family: inherit; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(43,108,176,.15); }
.auth-back { margin: 16px 0 0; text-align: center; font-size: .88rem; }
.store-banner {
    margin-top: 22px; padding: 14px 16px; text-align: center;
    background: linear-gradient(135deg, rgba(43,108,176,.08), rgba(59,130,246,.12));
    border: 1px solid rgba(43,108,176,.25); border-radius: 12px;
}
.store-banner p { margin: 6px 0 10px; font-size: .88rem; color: var(--muted); }
.store-banner-new {
    display: inline-block; background: var(--primary); color: #fff;
    font-size: .7rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
    padding: 2px 8px; border-radius: 999px;
}
.store-badge {
    display: inline-block; background: #1c2333; color: #fff !important;
    font-weight: 600; font-size: .88rem;
    padding: 9px 16px; border-radius: 9px; text-decoration: none;
}
.store-badge:hover { background: #2b3548; text-decoration: none; }
code { background: #eef1f7; padding: 1px 6px; border-radius: 5px; font-size: .85em; }

/* ── Alerts ─────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: .92rem; }
.alert-error { background: #fdecec; color: #a11; border: 1px solid #f6c9c9; }
.alert-success { background: #e8f7f0; color: #0a7a52; border: 1px solid #b8e6d2; }
.alert-warn { background: #fff6e6; color: #9a6b00; border: 1px solid #f3dba6; }

/* ── Badges & tags ──────────────────────────────────────── */
.badge { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.badge-draft { background: #eef1f7; color: #5a6478; }
.badge-submitted { background: #fff1d6; color: #9a6b00; }
.badge-validated { background: #dcf5e9; color: #0a7a52; }
.badge-refused { background: #fde0e0; color: #b32020; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 7px; font-size: .8rem; font-weight: 600; }
.tag-work { background: #e6efff; color: #2b51c4; }
.tag-absence { background: #fdeede; color: #a96a17; }

/* ── Toolbar / mois ─────────────────────────────────────── */
.ts-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 16px; flex-wrap: wrap; }
.ts-nav { display: flex; align-items: center; gap: 14px; }
.ts-month { margin: 0; font-size: 1.4rem; text-transform: capitalize; }
.back-link { display: inline-block; margin-bottom: 16px; font-size: .9rem; }

/* ── Résumé ─────────────────────────────────────────────── */
.ts-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat-value { display: block; font-size: 1.6rem; font-weight: 800; }
.stat-label { color: var(--muted); font-size: .82rem; }

/* ── Calendrier ─────────────────────────────────────────── */
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr) .8fr; gap: 8px; margin-bottom: 8px; }
.cal-weekdays span { text-align: center; font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.cal-weekdays .cal-total-head { color: var(--primary); }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr) .8fr; gap: 8px; }
.calendar[aria-busy=true] { opacity: .5; }
.cal-cell {
    background: var(--card); border: 1px solid var(--line); border-radius: 10px;
    min-height: 92px; padding: 8px; cursor: pointer; transition: .12s; position: relative;
    display: flex; flex-direction: column;
}
.cal-cell:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.cal-cell.is-empty { background: transparent; border: none; cursor: default; }
.cal-cell.is-weekend { background: #f0f2f8; }
.cal-cell.is-today { border-color: var(--primary); border-width: 2px; }
/* Feuille verrouillée (validée / soumise) : calendrier clairement grisé. */
.cal-cell.locked {
    cursor: not-allowed;
    background: #eceff4;
    border-color: #dde3ec;
    filter: grayscale(1);
    opacity: .6;
}
.cal-cell.locked:hover { border-color: #dde3ec; box-shadow: none; }
.cal-cell.locked.is-today { border-color: #dde3ec; border-width: 1px; }
.cal-day { font-weight: 700; font-size: .9rem; }
.cal-cell.is-today .cal-day { color: var(--primary); }
.cal-entry { margin-top: auto; font-size: .78rem; }
.cal-entry .hours { font-weight: 800; font-size: .95rem; }
.cal-cell.type-work { border-left: 3px solid var(--primary); }
.cal-cell.type-absence { border-left: 3px solid var(--warn); background: #fffaf2; }
.cal-cell.is-holiday { background: #eef4ff; }
.cal-holiday {
    display: block; margin-top: 2px; padding: 1px 6px; border-radius: 6px;
    background: var(--primary); color: #fff; font-size: .66rem; font-weight: 700;
    line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-cell.cal-total {
    background: #fafbfe; border-style: dashed; cursor: default;
    align-items: center; justify-content: center; text-align: center;
}
.cal-cell.cal-total:hover { border-color: var(--line); box-shadow: none; }
.cal-total-label { font-size: .66rem; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.cal-total-value { font-size: 1rem; font-weight: 800; color: var(--primary); margin-top: 2px; }
.calendar-static .cal-cell { cursor: default; }
.calendar-static .cal-cell:not(.cal-total):hover { border-color: var(--line); box-shadow: none; }
.cal-note { position: absolute; top: 6px; right: 8px; font-size: .8rem; color: var(--muted); }
.cal-note-text {
    margin-top: 4px; padding: 2px 6px; border-radius: 6px;
    background: #fff6d9; color: #7a5b00; border: 1px solid #f2dfa0;
    font-size: .68rem; line-height: 1.3; font-weight: 600; cursor: help;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.detail-block { margin-top: 18px; }
.detail-block > summary { cursor: pointer; font-weight: 700; padding: 8px 0; color: var(--primary); }
.tag-holiday { background: var(--primary); color: #fff; }
.ts-actions { margin-top: 24px; display: flex; justify-content: flex-end; }
.ts-toolbar-actions { display: flex; align-items: center; gap: 12px; }
.ts-toolbar-actions.mb { margin: 12px 0 4px; }
.ts-subactions { display: flex; justify-content: flex-end; margin: -6px 0 16px; }
.leave-range { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── Tables ─────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { background: #fafbfe; font-size: .8rem; text-transform: uppercase; color: var(--muted); letter-spacing: .03em; }
.table tr:last-child td { border-bottom: none; }
.table .empty { text-align: center; color: var(--muted); padding: 30px; }
.row-inactive { opacity: .55; }
.table-days td { padding: 8px 16px; }
.table-days .is-weekend { background: #fafbfe; }
.table-days .dow { color: var(--muted); font-weight: 600; margin-right: 4px; }

/* ── Colonnes (salariés) ────────────────────────────────── */
.cols { display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 16px; font-size: 1.1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.review-card { margin-top: 22px; max-width: 560px; }
.hint { color: var(--muted); font-size: .85rem; }

/* ── Modal ──────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(20,28,45,.45); }
.modal-card { position: relative; background: var(--card); width: 100%; max-width: 440px; border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 1.1rem; }
.modal-x { border: none; background: none; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted); }
.modal-body { padding: 22px; }
.modal-foot { display: flex; align-items: center; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); }
.modal-foot .spacer { flex: 1; }
.seg { display: flex; gap: 8px; background: #eef1f7; padding: 4px; border-radius: 10px; margin-bottom: 18px; }
.seg-opt { flex: 1; text-align: center; padding: 8px; border-radius: 7px; cursor: pointer; font-weight: 600; font-size: .9rem; }
.seg-opt input { display: none; }
.seg-opt:has(input:checked) { background: #fff; box-shadow: var(--shadow); color: var(--primary); }
.modal-body label { display: block; margin-bottom: 14px; }
.modal-body label span { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; color: var(--muted); }
.modal-body label input, .modal-body label select { width: 100%; }
#seg-add { margin-bottom: 18px; }
#work-fields .hint { margin: 4px 0 0; }

/* ── Sélecteur de jours (planning par défaut) ───────────────── */
.sched-days { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.sched-day { flex: 1 1 0; min-width: 42px; margin: 0; cursor: pointer; }
.sched-day input { position: absolute; opacity: 0; pointer-events: none; }
.sched-day span {
    display: block; text-align: center; padding: 9px 4px;
    border: 1px solid var(--line); border-radius: 9px;
    font-size: .82rem; font-weight: 700; color: var(--muted);
    background: #fff; transition: .12s; user-select: none;
}
.sched-day:hover span { border-color: var(--primary); }
.sched-day input:checked + span {
    background: var(--primary); border-color: var(--primary); color: #fff;
    box-shadow: 0 2px 8px rgba(43, 108, 176, .25);
}
.sched-day input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ── Plages horaires multiples ──────────────────────────────── */
.sched-plages { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.sched-plage { grid-template-columns: 1fr 1fr auto; align-items: end; }
.sched-plage [data-plage-del] { height: 38px; }

/* ── Date d'effet d'un changement de planning + note d'aide ── */
.sched-effective {
    margin: 14px 0 2px; padding: 14px 16px;
    background: var(--light-bg); border: 1px solid #cfe0f5;
    border-radius: var(--radius);
}
.sched-effective-label {
    display: flex; align-items: center; gap: 8px; margin: 0 0 10px;
    font-size: .85rem; font-weight: 700; color: var(--ink);
}
.sched-effective-label svg { flex: none; color: var(--primary); }
.sched-effective-input {
    background: #fff;
    /* hérite du style input global (padding, bordure, focus) */
}
.sched-effective-input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .55; transition: .12s; }
.sched-effective-input:hover::-webkit-calendar-picker-indicator { opacity: 1; }
.sched-effective .field-note { margin: 10px 0 0; background: #fff; }
.field-note {
    display: flex; align-items: flex-start; gap: 8px;
    margin: 8px 0 2px; padding: 10px 12px;
    font-size: .8rem; line-height: 1.45; color: var(--muted);
    background: #f5f8fc; border: 1px solid var(--line); border-radius: 10px;
}
.field-note svg { flex: none; margin-top: 1px; color: var(--primary); opacity: .85; }

/* ── Case à cocher simple (ligne label + checkbox) ──────────── */
.check-row {
    display: flex; align-items: center; gap: 10px; margin: 0;
    cursor: pointer; font-size: .9rem; line-height: 1.35;
}
.check-row input[type="checkbox"] {
    flex: 0 0 auto; width: 17px; height: 17px; margin: 0; cursor: pointer;
    accent-color: var(--primary);
}
/* ════════════════════════════════════════════════════════════════
   SUPER-ADMIN PAGE
════════════════════════════════════════════════════════════════ */

/* ── En-tête ──────────────────────────────────────────────────── */
.sa-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}
.sa-title {
    margin: 0;
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-size: 1.6rem;
}
.sa-subtitle { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.sa-new-btn  { flex-shrink: 0; gap: 6px; }

/* ── KPIs ─────────────────────────────────────────────────────── */
.sa-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 28px;
}
.sa-kpi {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px 22px;
    box-shadow: var(--shadow);
}
.sa-kpi-btn {
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.sa-kpi-btn:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(43, 108, 176, .14);
}
.sa-kpi-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.sa-kpi-archived .sa-kpi-val { color: var(--muted); }
.sa-kpi-val {
    display: block;
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}
.sa-kpi-lbl {
    display: block;
    margin-top: 4px;
    font-size: .82rem;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ── État vide ────────────────────────────────────────────────── */
.sa-empty {
    text-align: center;
    padding: 60px 24px;
    background: var(--card);
    border: 2px dashed var(--line);
    border-radius: 20px;
}
.sa-empty-icon { font-size: 3rem; margin-bottom: 12px; }
.sa-empty p    { color: var(--muted); margin: 0 0 18px; }

/* ── Liste des sociétés ───────────────────────────────────────── */
.sa-companies { display: flex; flex-direction: column; gap: 18px; }

.sa-company-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

/* En-tête de la carte société */
.sa-company-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
    background: #fafbfe;
    border-radius: 18px 18px 0 0;
}
.sa-company-avatar {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent-light));
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-family: "Space Grotesk", sans-serif;
}
.sa-company-info { flex: 1; min-width: 0; }
.sa-company-name {
    margin: 0;
    font-size: 1.1rem;
    font-family: "Space Grotesk", "Manrope", sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sa-company-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }

.sa-tag {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: .73rem;
    font-weight: 700;
    background: #eef1f7;
    color: #4a5568;
}
.sa-tag-legal { background: var(--light-bg); color: var(--primary-dark); }
.sa-tag-test { background: #fef3c7; color: #92400e; }
.sa-invite-btn { flex-shrink: 0; }

/* Actions de l'en-tête société : bouton principal + menu */
.sa-company-cta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.sa-menu { position: relative; }
.sa-menu > summary { list-style: none; padding: 8px 10px; }
.sa-menu > summary::-webkit-details-marker { display: none; }
.sa-menu > summary::marker { content: ''; }
.sa-menu[open] { z-index: 60; }
.sa-menu[open] > summary { border-color: #cfd6e4; background: var(--light-bg); color: var(--primary); }
.sa-menu-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 232px;
    background: #1e293b;
    border: 1px solid #0f172a;
    border-radius: 12px;
    box-shadow: 0 18px 44px rgba(8, 12, 24, .45);
    padding: 6px;
    z-index: 200;
    isolation: isolate;
    animation: saMenuIn .14s ease;
}
@keyframes saMenuIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.sa-menu-panel form { margin: 0; }
.sa-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 9px 12px;
    border-radius: 8px;
    font: inherit;
    font-size: .88rem;
    font-weight: 600;
    color: #f1f5f9;
    cursor: pointer;
    transition: background .12s;
}
.sa-menu-item svg { color: #94a3b8; flex-shrink: 0; }
.sa-menu-item:hover { background: rgba(255, 255, 255, .1); }
.sa-menu-item:hover svg { color: #fff; }
.sa-menu-item-danger { color: #fca5a5; }
.sa-menu-item-danger svg { color: #fca5a5; }
.sa-menu-item-danger:hover { background: rgba(220, 60, 60, .25); }
.sa-menu-sep { height: 1px; background: rgba(255,255,255,.14); margin: 6px 4px; }

/* Méta chips légales / adresse */
.sa-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 24px;
    border-bottom: 1px solid var(--line);
    background: #f8fbff;
}
.sa-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: .78rem;
    font-weight: 600;
}
.sa-meta-legal  { background: var(--light-bg); color: var(--primary-dark); }
.sa-meta-addr   { background: #e0f2fe; color: #0369a1; }
.sa-meta-contact { background: #dcfce7; color: #166534; }

/* Liste des admins */
.sa-admins { padding: 8px 0; }
.sa-no-admin {
    padding: 16px 24px;
    color: var(--muted);
    font-size: .88rem;
    font-style: italic;
}
.sa-admin-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--line);
    transition: background .12s;
}
.sa-admin-row:last-child { border-bottom: none; }
.sa-admin-row:hover { background: #fafbfe; }
.sa-admin-disabled { opacity: .55; }

.sa-admin-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--light-bg);
    color: var(--primary);
    font-size: .8rem;
    font-weight: 800;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.sa-admin-info  { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sa-admin-name  { font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-admin-multi { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: .68rem; font-weight: 700; color: #4338ca; background: #e0e7ff; vertical-align: middle; }
.sa-admin-email { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-admin-status { flex-shrink: 0; }
.sa-admin-actions { flex-shrink: 0; display: flex; align-items: center; gap: 8px; }

/* ── Organigramme des salariés rattachés ──────────────────────── */
.sa-org {
    border-top: 1px solid var(--line);
    background: #fafbff;
    border-radius: 0 0 18px 18px;
}
.sa-org-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px 8px;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--primary);
}
.sa-org-head svg { color: var(--secondary); }
.sa-org-count {
    background: var(--light-bg);
    color: var(--primary-dark);
    font-size: .72rem;
    font-weight: 800;
    padding: 1px 8px;
    border-radius: 10px;
}
.sa-org-sort {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--muted);
}
.sa-org-sort a {
    color: var(--muted);
    text-decoration: none;
    padding: 1px 7px;
    border-radius: 10px;
}
.sa-org-sort a:hover { color: var(--primary-dark); }
.sa-org-sort a.is-active {
    background: var(--light-bg);
    color: var(--primary-dark);
    font-weight: 800;
}
.sa-org-list {
    padding: 0 24px 12px;
    margin-left: 18px;
    border-left: 2px solid var(--line);
}
.sa-org-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 0 9px 22px;
}
.sa-org-connector {
    position: absolute;
    left: 0;
    top: 50%;
    width: 16px;
    height: 2px;
    background: var(--line);
}
.sa-org-avatar {
    width: 30px;
    height: 30px;
    font-size: .72rem;
    background: #fff;
    border: 1.5px solid var(--line);
    color: var(--secondary);
}
.sa-org-hours {
    flex-shrink: 0;
    font-size: .78rem;
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
}
.sa-org-metric {
    flex-shrink: 0;
    font-size: .78rem;
    font-weight: 700;
    color: var(--primary-dark);
    white-space: nowrap;
}

/* Colonnes alignées de la liste des salariés : les blocs de droite ont une
   largeur FIXE pour que les valeurs tombent les unes sous les autres d'une
   ligne à l'autre (le bloc nom/e-mail, en flex:1, absorbe le reste). */
.sa-org-row .sa-org-hours   { width: 74px;  text-align: right; }
.sa-org-row .sa-admin-status { width: 132px; display: flex; justify-content: flex-start; }

/* Dernières feuilles (validée par le salarié / validée par l'admin) :
   bloc placé dans la zone d'actions, entre « Voir la feuille » et le menu. */
.sa-org-lastsheets {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1px;
    width: 172px;
    margin: 0 6px 0 14px; /* respire entre « Voir la feuille » et le menu « ⋯ » */
    font-size: .72rem;
    line-height: 1.35;
    color: var(--muted);
    white-space: nowrap;
}
.sa-org-lastsheets strong { color: var(--primary-dark); font-weight: 700; }
.sa-org-lastsheets em { font-style: italic; }
.sa-lastsheets-tick {
    display: inline-block;
    width: 14px;
    color: var(--success);
    font-weight: 800;
}
.sa-lastsheets-tick-none { color: var(--muted); font-weight: 600; }
/* Feuille transmise par le salarié, pas encore validée par l'admin :
   le mois ressort en rouge, le reste de la ligne ne bouge pas. */
.sa-lastsheets-pending { color: var(--danger, #e53e3e); font-weight: 700; }
.sa-lastsheets-by {
    position: relative;
    display: inline-block;
    padding: 0 5px;
    border-radius: 8px;
    background: var(--primary-soft, #eef2ff);
    color: var(--primary-dark);
    font-weight: 700;
    font-size: .66rem;
    letter-spacing: .3px;
    cursor: default;
}
/* Bulle « nom et prénom » au survol (ou au focus clavier) des initiales. */
.sa-lastsheets-by::after {
    content: attr(data-name);
    position: absolute;
    bottom: calc(100% + 7px);
    left: 50%;
    transform: translateX(-50%) translateY(3px);
    padding: 5px 10px;
    border-radius: 8px;
    background: var(--primary-dark, #1e293b);
    color: #fff;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: 0;
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .25);
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s ease, transform .12s ease;
    z-index: 30;
}
/* petite flèche sous la bulle */
.sa-lastsheets-by::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--primary-dark, #1e293b);
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s ease;
    z-index: 30;
}
.sa-lastsheets-by:hover::after,
.sa-lastsheets-by:focus-visible::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.sa-lastsheets-by:hover::before,
.sa-lastsheets-by:focus-visible::before { opacity: 1; }
.sa-org-actions { flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
.sa-org-actions .btn { white-space: nowrap; }
@media (max-width: 640px) {
    .sa-org-row { flex-wrap: wrap; }
    .sa-org-actions { width: 100%; }
    .sa-org-actions .btn { width: 100%; }
    .sa-org-row .sa-org-hours,
    .sa-org-row .sa-admin-status,
    .sa-org-lastsheets { width: auto; text-align: left; }
}

/* ── Drawers ──────────────────────────────────────────────────── */
.sa-drawer {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
}
.sa-drawer.is-open { display: block; }

.sa-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(2px);
    animation: fadeIn .2s ease;
}

.sa-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 460px;
    background: var(--card);
    box-shadow: -8px 0 40px rgba(0,0,0,.15);
    display: flex;
    flex-direction: column;
    animation: slideInRight .22s ease;
    overflow: hidden;
}

@keyframes fadeIn      { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInRight {
    from { transform: translateX(40px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

.sa-drawer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}
.sa-drawer-head h2 { margin: 0; font-size: 1.15rem; }
.sa-drawer-sub { margin: 3px 0 0; color: var(--primary); font-size: .85rem; font-weight: 600; }
.sa-drawer-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    line-height: 1;
    flex-shrink: 0;
}
.sa-drawer-close:hover { background: var(--bg); color: var(--ink); }

.sa-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}
.sa-drawer-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 18px;
    margin-top: 4px;
    border-top: 1px solid var(--line);
}

/* ── Panneau d'invitation admin (ancien details) ────────────── */
.invite-details { display: none; }  /* obsolète, remplacé par drawers */

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 640px) {
    .sa-kpis           { grid-template-columns: 1fr 1fr; }
    .sa-company-header { flex-wrap: wrap; }
    .sa-admin-row      { flex-wrap: wrap; }
    .sa-drawer-panel   { max-width: 100%; }
}

/* ── Admin dashboard page ───────────────────────────────────── */
.pd-page { display: flex; flex-direction: column; gap: 18px; }
.pd-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; flex-wrap: wrap;
    /* Reste visible sous la topbar (64px) au défilement : sur les listes
       longues, « Ajouter un salarié » et la navigation de période
       disparaissaient dès qu'on consultait les salariés. */
    position: sticky; top: 64px; z-index: 15;
    background: var(--bg);
    padding: 10px 0;
    margin: -10px 0 0;
}
.pd-period { display: flex; align-items: center; gap: 12px; }
.pd-title {
    margin: 0;
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-size: 1.5rem;
    text-transform: capitalize;
}
.pd-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pd-company {
    font-size: .84rem; font-weight: 700; color: #155e75;
    background: #ecfeff; border: 1px solid #bae6fd;
    border-radius: 999px; padding: 5px 11px;
}

.pd-kpis {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.pd-kpi {
    background: var(--card); border: 1px solid var(--line);
    border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow);
}
.pd-kpi-val {
    display: block; font-size: 1.45rem; font-weight: 800;
    font-family: "Space Grotesk", "Manrope", sans-serif;
}
.pd-kpi-lbl {
    display: block; margin-top: 2px; font-size: .74rem; color: var(--muted);
    text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
}

.pd-empty {
    background: var(--card); border: 2px dashed var(--line);
    border-radius: 16px; padding: 34px; text-align: center; color: var(--muted);
}

.pd-list { padding: 10px 0; }
.pd-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 98px 90px 110px 130px auto;
    gap: 10px; align-items: center;
    padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.pd-row:last-child { border-bottom: none; }
.pd-row:hover { background: #fafbff; }
.pd-row-link { cursor: pointer; transition: background .12s ease; }
.pd-user { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pd-user-name { font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-user-email { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-pill {
    display: inline-block; font-size: .76rem; font-weight: 700;
    padding: 3px 8px; border-radius: 999px;
    background: var(--light-bg); color: var(--primary-dark); width: fit-content;
}
.pd-stat { font-size: .82rem; color: #334155; }
.pd-status { justify-self: start; }
.pd-row-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* ── Admin timesheet detail page ─────────────────────────────── */
.at-page { display: flex; flex-direction: column; gap: 0; }
.at-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap;
    background: #f8fafc; border: 1px solid var(--line);
    border-radius: 14px; padding: 14px 16px; margin-bottom: 14px;
}
.at-head-left { display: flex; align-items: center; gap: 14px; }
.at-head-title { display: flex; flex-direction: column; gap: 2px; }
.at-head-title .ts-month { margin: 0; }
.at-head-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.at-actions { margin-top: 0; margin-bottom: 10px; }
.at-detail {
    background: var(--card); border: 1px solid var(--line);
    border-radius: 14px; padding: 0 16px 16px; box-shadow: var(--shadow);
}
.at-detail > summary { padding-top: 14px; }
.at-review-card { border-top: 3px solid var(--primary); }

/* ── Admin timesheet — édition pro (refonte) ─────────────────── */
.at2-page { display: flex; flex-direction: column; gap: 16px; }
.at2-back { align-self: flex-start; font-size: .9rem; font-weight: 600; }

.at2-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 18px; flex-wrap: wrap;
    background: linear-gradient(135deg, #1B2A4A, #2B6CB0);
    color: #fff; border-radius: 16px; padding: 20px 24px;
    box-shadow: 0 10px 30px rgba(27, 42, 74, .22);
}
.at2-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.at2-avatar {
    width: 52px; height: 52px; flex-shrink: 0;
    border-radius: 14px; display: grid; place-items: center;
    background: rgba(255, 255, 255, .16); color: #fff;
    font-family: "Space Grotesk", sans-serif; font-weight: 800; font-size: 1.1rem;
    border: 1px solid rgba(255, 255, 255, .25);
}
.at2-id-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.at2-name { margin: 0; font-size: 1.45rem; font-family: "Space Grotesk", "Manrope", sans-serif; }
.at2-email { font-size: .86rem; color: rgba(255, 255, 255, .82); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.at2-head-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.at2-head-right .badge { box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.at2-month-nav {
    display: flex; align-items: center; gap: 6px;
    background: rgba(255, 255, 255, .14); border-radius: 10px; padding: 4px 6px;
}
.at2-month-nav .btn { background: transparent; border-color: transparent; color: #fff; }
.at2-month-nav .btn:hover { background: rgba(255, 255, 255, .18); border-color: transparent; }
.at2-month { font-weight: 700; font-size: .95rem; text-transform: capitalize; padding: 0 6px; min-width: 110px; text-align: center; }

.at2-editbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; flex-wrap: wrap;
    background: var(--light-bg); border: 1px solid #cfe0f5;
    border-radius: 12px; padding: 12px 16px;
}
.at2-editbar-info { display: flex; align-items: center; gap: 12px; }
.at2-editbar.is-locked { background: #fff7ed; border-color: #f0d3a8; }
.at2-editbar.is-locked .at2-pencil { background: var(--warn, #c47d18); }
.at2-pencil {
    width: 34px; height: 34px; flex-shrink: 0;
    border-radius: 10px; display: grid; place-items: center;
    background: var(--primary); color: #fff; font-size: 1rem;
}
.at2-editbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.at2-summary { margin-bottom: 4px; }

.at2-decision { border-top: 3px solid var(--primary); }
.at2-decision-head { margin-bottom: 16px; }
.at2-decision-head h2 { margin: 0 0 4px; font-size: 1.15rem; }
.at2-decision-head p { margin: 0; }

.at2-notify {
    display: flex; align-items: flex-start; gap: 12px;
    background: #f8fafc; border: 1px solid var(--line);
    border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; cursor: pointer;
    transition: .15s;
}
.at2-notify:hover { border-color: var(--primary); }
.at2-notify input[type="checkbox"] {
    width: 20px; height: 20px; margin: 2px 0 0; flex-shrink: 0;
    accent-color: var(--primary); cursor: pointer;
}
.at2-notify-text { display: flex; flex-direction: column; gap: 2px; }

.at2-decision-actions { display: flex; gap: 12px; flex-wrap: wrap; }

@media (max-width: 640px) {
    .at2-header { padding: 16px 18px; }
    .at2-name { font-size: 1.2rem; }
    .at2-head-right { align-items: flex-start; width: 100%; }
    .at2-decision-actions .btn { flex: 1; }
}

/* ── Employee timesheet page ─────────────────────────────────── */
.ts-pro-head {
    background: #f8fafc; border: 1px solid var(--line);
    border-radius: 14px; padding: 12px 14px;
}
.ts-pro-submit {
    margin-top: 18px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
}

/* ── Error page ──────────────────────────────────────────────── */
.error-page { display: grid; place-items: center; min-height: 70vh; }
.error-card {
    background: var(--card); border: 1px solid var(--line); border-radius: 18px;
    padding: 32px 34px; text-align: center; max-width: 420px; box-shadow: var(--shadow);
}
.error-chip {
    display: inline-block; margin-bottom: 8px;
    padding: 4px 10px; border-radius: 999px;
    background: #fee2e2; color: #b91c1c; font-size: .75rem; font-weight: 700;
}

@media (max-width: 980px) {
    .pd-kpis { grid-template-columns: 1fr 1fr; }
    .pd-row {
        grid-template-columns: minmax(170px, 1fr) 90px 100px auto;
        grid-template-areas:
            "user status actions actions"
            "pill stat1 stat2 stat2";
        row-gap: 6px;
    }
    .pd-user { grid-area: user; }
    .pd-pill { grid-area: pill; }
    .pd-stat:nth-of-type(1) { grid-area: stat1; }
    .pd-stat:nth-of-type(2) { grid-area: stat2; }
    .pd-status { grid-area: status; }
    .pd-row-actions { grid-area: actions; }
}

@media (max-width: 640px) {
    .pd-kpis { grid-template-columns: 1fr; }
}

/* ── Admin salariés page ─────────────────────────────────────── */
.ae-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}
.ae-title {
    margin: 0;
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-size: 1.55rem;
}
.ae-subtitle { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.ae-new-btn  { flex-shrink: 0; gap: 6px; }

.ae-kpis {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}
.ae-kpi {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 20px;
    box-shadow: var(--shadow);
}
.ae-kpi-val {
    display: block;
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-size: 1.9rem;
    font-weight: 800;
    color: #0f766e;
    line-height: 1;
}
.ae-kpi-lbl {
    display: block;
    margin-top: 5px;
    font-size: .8rem;
    color: var(--muted);
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}


.ae-empty {
    text-align: center;
    padding: 58px 24px;
    background: var(--card);
    border: 2px dashed var(--line);
    border-radius: 20px;
}
.ae-empty-icon { font-size: 2.7rem; margin-bottom: 12px; }
.ae-empty p { margin: 0 0 16px; color: var(--muted); }

.ae-list {
    padding: 8px 0;
    border-radius: 18px;
}
.ae-row {
    display: grid;
    grid-template-columns: 42px minmax(210px, 1fr) 95px 160px 170px 220px;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--line);
}
.ae-row:last-child { border-bottom: none; }
.ae-row:hover { background: #f8fafc; }
.ae-row-off { opacity: .58; }

.ae-avatar {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, #0891b2, #0e7490);
    color: #ecfeff;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: .78rem;
    font-family: "Space Grotesk", sans-serif;
}
.ae-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ae-name {
    font-size: .92rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ae-email {
    font-size: .79rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ae-contract {
    font-size: .82rem;
    font-weight: 700;
    color: #155e75;
    background: #ecfeff;
    border: 1px solid #bae6fd;
    border-radius: 999px;
    padding: 4px 10px;
    width: fit-content;
}
.ae-contact {
    font-size: .8rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ae-status {
    justify-self: start;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ae-actions {
    justify-self: end;
}

@media (max-width: 980px) {
    .ae-row {
        grid-template-columns: 42px minmax(170px, 1fr) 110px 220px;
        grid-template-areas:
            "avatar main status actions"
            "avatar contract contact actions";
        row-gap: 6px;
    }
    .ae-avatar { grid-area: avatar; }
    .ae-main { grid-area: main; }
    .ae-status { grid-area: status; }
    .ae-actions { grid-area: actions; }
    .ae-contract { grid-area: contract; }
    .ae-contact { grid-area: contact; }
}

@media (max-width: 640px) {
    .ae-header { flex-wrap: wrap; }
    .ae-kpis { grid-template-columns: 1fr 1fr; }
    .ae-row {
        grid-template-columns: 1fr;
        grid-template-areas:
            "main"
            "contract"
            "contact"
            "status"
            "actions";
        padding-left: 16px;
    }
    .ae-avatar { display: none; }
    .ae-actions { justify-self: start; }
}

/* ── Super-admin : méta société (legacy, inutilisé) ─────────── */
.company-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-bottom: 14px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: .82rem;
}
.company-meta-item { color: var(--muted); font-weight: 600; }
.company-meta-addr { color: var(--ink); }

/* ── Formulaire : titre de section ──────────────────────────── */
.form-section-title {
    margin: 18px 0 8px;
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    padding-bottom: 5px;
}
.form-section-title:first-child { margin-top: 0; }
label .req { color: var(--danger); font-style: normal; margin-left: 2px; }
/* ── Divers ─────────────────────────────────────────────── */
.error-page { text-align: center; padding-top: 80px; }
.error-page h1 { font-size: 4rem; margin: 0; }

/* ── Landing page ───────────────────────────────────────── */
.home-landing {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    padding: 44px;
    background: linear-gradient(135deg, #f8fbff 0%, #eef7f3 45%, #f8f4eb 100%);
    border: 1px solid #d9e6df;
    box-shadow: 0 20px 40px rgba(8, 37, 24, .08);
}

.home-hero-bg {
    position: absolute;
    inset: auto -80px -120px auto;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #66c79a 0%, #24967a 50%, rgba(36, 150, 122, 0) 72%);
    opacity: .22;
    pointer-events: none;
}

.home-hero {
    position: relative;
    z-index: 1;
    animation: fadeUp .6s ease-out;
}

.home-kicker {
    display: inline-block;
    margin: 0 0 14px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #daeee5;
    color: #1d5e4b;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.home-hero h1 {
    margin: 0;
    max-width: 760px;
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1.1;
    color: #113629;
}

.home-lead {
    margin: 16px 0 0;
    max-width: 680px;
    font-size: 1.05rem;
    color: #365045;
}

.home-cta-row {
    margin-top: 28px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.home-metrics {
    margin-top: 30px;
    display: grid;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    gap: 12px;
}

.metric {
    padding: 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .75);
    border: 1px solid #dce9e2;
    backdrop-filter: blur(2px);
}

.metric-value {
    display: block;
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #114434;
}

.metric-label {
    color: #4a665b;
    font-size: .86rem;
    font-weight: 600;
}

.home-features {
    position: relative;
    z-index: 1;
    margin-top: 34px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.feature-card {
    background: #ffffff;
    border: 1px solid #dce9e2;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 8px 20px rgba(16, 58, 43, .06);
    animation: fadeUp .7s ease-out;
}

.feature-card h2 {
    margin: 0;
    font-size: 1.02rem;
    color: #12392d;
}

.feature-card p {
    margin: 8px 0 0;
    font-size: .92rem;
    color: #476156;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 760px) {
    .cols { grid-template-columns: 1fr; }
    .ts-summary { grid-template-columns: 1fr; }
    .cal-cell { min-height: 70px; }
    .topnav { display: none; }

    .home-landing { padding: 24px; border-radius: 16px; }
    .home-metrics { grid-template-columns: 1fr; }
    .home-features { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════════
   LANDING PAGE — sections complètes
════════════════════════════════════════════════════════════════ */

/* ── Hero ─────────────────────────────────────────────────────── */
.lp-hero {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    padding: 56px 52px 48px;
    background: linear-gradient(140deg, #0f1f2e 0%, #0d2235 55%, #0a1c2e 100%);
    border: 1px solid #1e3a52;
    box-shadow: 0 24px 48px rgba(0, 0, 0, .28);
    margin-bottom: 0;
}

.lp-hero-glow {
    position: absolute;
    top: -120px;
    right: -80px;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, #2B6CB0 0%, rgba(43,108,176,0) 70%);
    opacity: .18;
    pointer-events: none;
}

.lp-hero-inner {
    position: relative;
    z-index: 1;
    animation: fadeUp .55s ease-out;
}

.lp-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(43, 108, 176, .18);
    border: 1px solid rgba(59, 130, 246, .35);
    color: #90cdf4;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.lp-kicker-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}

.lp-hero h1 {
    margin: 0;
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-size: clamp(1.9rem, 4.5vw, 3.2rem);
    line-height: 1.1;
    color: #f1f5f9;
}

.lp-title-accent {
    background: linear-gradient(90deg, var(--accent-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lp-lead {
    margin: 18px 0 0;
    max-width: 640px;
    font-size: 1.05rem;
    color: #94a3b8;
    line-height: 1.65;
}

.lp-cta-row {
    margin-top: 28px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.lp-cta-row .btn-ghost {
    color: #cbd5e1;
    border-color: rgba(255, 255, 255, .25);
    background: rgba(255, 255, 255, .07);
}

.lp-cta-row .btn-ghost:hover {
    color: #f1f5f9;
    border-color: rgba(255, 255, 255, .5);
    background: rgba(255, 255, 255, .12);
    text-decoration: none;
}

.lp-btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
}

.lp-metrics {
    list-style: none;
    margin: 32px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(140px, 1fr));
    gap: 12px;
}

.lp-metric {
    padding: 14px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
}

.lp-metric-val {
    display: block;
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #e2e8f0;
}

.lp-metric-lbl {
    font-size: .82rem;
    color: #64748b;
    font-weight: 600;
}

/* ── Sections génériques ──────────────────────────────────────── */
.lp-section {
    margin-top: 56px;
}

.lp-section-alt {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow);
}

.lp-section-head {
    text-align: center;
    margin-bottom: 36px;
}

.lp-section-head h2 {
    margin: 0;
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--ink);
}

.lp-section-head p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: .97rem;
}

/* ── Cartes rôles ─────────────────────────────────────────────── */
.lp-roles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.lp-role-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 28px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform .2s, box-shadow .2s;
}

.lp-role-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(20, 30, 50, .12);
}

.lp-role-employee { border-top: 4px solid var(--primary); }
.lp-role-admin    { border-top: 4px solid var(--success); }
.lp-role-super    { border-top: 4px solid var(--warn); }

.lp-role-icon {
    font-size: 2rem;
    line-height: 1;
}

.lp-role-card h3 {
    margin: 0;
    font-size: 1.25rem;
    font-family: "Space Grotesk", "Manrope", sans-serif;
}

.lp-role-tagline {
    margin: 0;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 600;
}

.lp-role-list {
    margin: 4px 0 0;
    padding-left: 18px;
    color: var(--ink);
    font-size: .88rem;
    line-height: 1.75;
    flex: 1;
}

.lp-role-workflow {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.lp-wf-step {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: .75rem;
    font-weight: 700;
    background: #eef1f7;
    color: #3d4a6b;
}

.lp-wf-end {
    background: #dcf5e9;
    color: #0a7a52;
}

.lp-wf-arrow {
    color: var(--muted);
    font-size: .85rem;
}

.lp-role-btn {
    margin-top: 8px;
    width: 100%;
    justify-content: center;
}

/* ── Étapes du circuit ────────────────────────────────────────── */
.lp-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.lp-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px 20px;
    max-width: 200px;
    flex: 1 1 160px;
}

.lp-step strong {
    display: block;
    margin-bottom: 4px;
    font-size: .95rem;
}

.lp-step p {
    margin: 0;
    font-size: .82rem;
    color: var(--muted);
    line-height: 1.55;
}

.lp-step-num {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    font-size: .85rem;
    display: grid;
    place-items: center;
}

.lp-step-pending { background: var(--warn); }
.lp-step-ok      { background: var(--success); }
.lp-step-ko      { background: var(--danger); }

.lp-step-sep {
    font-size: 1.4rem;
    color: var(--line);
    font-weight: 700;
    flex-shrink: 0;
}

/* ── Features grid ────────────────────────────────────────────── */
.lp-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.lp-feat {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 22px;
    box-shadow: var(--shadow);
    transition: transform .2s;
}

.lp-feat:hover { transform: translateY(-3px); }

.lp-feat-icon {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.lp-feat h4 {
    margin: 0 0 6px;
    font-size: 1rem;
    color: var(--ink);
}

.lp-feat p {
    margin: 0;
    font-size: .87rem;
    color: var(--muted);
    line-height: 1.6;
}

/* ── CTA final ────────────────────────────────────────────────── */
.lp-cta-final {
    text-align: center;
    background: linear-gradient(135deg, #1B2A4A 0%, #2B6CB0 100%);
    border-radius: 24px;
    padding: 52px 40px;
    color: #fff;
    box-shadow: 0 16px 40px rgba(43, 108, 176, .3);
    margin-bottom: 8px;
}

.lp-cta-final h2 {
    margin: 0;
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    color: #fff;
}

.lp-cta-final p {
    margin: 12px 0 28px;
    color: #bcd6f3;
    font-size: 1rem;
}

.lp-cta-final .btn-primary {
    background: #fff;
    color: var(--primary);
    border-color: #fff;
    font-size: 1rem;
    padding: 13px 28px;
}

/* ── Modales-listes (super-admin) ─────────────────────────────── */
.sa-list-modal { max-width: 540px; }
.sa-list-modal .modal-body { max-height: 65vh; overflow-y: auto; padding: 12px 16px; }
.sa-list { list-style: none; margin: 0; padding: 0; }
.sa-list-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 8px; border-bottom: 1px solid var(--line);
}
.sa-list-item:last-child { border-bottom: none; }
.sa-list-avatar {
    width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
    display: grid; place-items: center;
    background: var(--light-bg); color: var(--primary);
    font-weight: 800; font-size: .82rem;
    font-family: "Space Grotesk", sans-serif;
}
.sa-list-avatar-muted { background: #eef1f7; color: var(--muted); }
.sa-list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sa-list-name { font-weight: 700; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-list-sub { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-list-archived { color: var(--warn); font-style: normal; font-weight: 600; }
.sa-list-meta { flex-shrink: 0; font-size: .8rem; color: var(--muted); }


.lp-cta-final .btn-primary:hover {
    background: var(--light-bg);
    border-color: var(--light-bg);
}

/* ── Responsive landing ───────────────────────────────────────── */
@media (max-width: 900px) {
    .lp-roles-grid     { grid-template-columns: 1fr; }
    .lp-features-grid  { grid-template-columns: 1fr 1fr; }
    .lp-steps          { flex-direction: column; align-items: stretch; }
    .lp-step-sep       { display: none; }
    .lp-step           { max-width: 100%; }
}

@media (max-width: 640px) {
    .lp-hero           { padding: 32px 24px; border-radius: 16px; }
    .lp-section-alt    { padding: 24px 20px; }
    .lp-metrics        { grid-template-columns: 1fr 1fr; }
    .lp-features-grid  { grid-template-columns: 1fr; }
    .lp-cta-final      { padding: 36px 24px; border-radius: 16px; }
}

/* ── Plages horaires multiples (modale de saisie) ── */
.seg-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.seg-row { display: flex; align-items: center; gap: 8px; }
.seg-row input[type="time"] { flex: 1; }
.seg-row .seg-del { padding: 4px 10px; }
.seg-list:empty { margin: 0; }

/* ── Sélecteur de rôle (barre supérieure) ── */
.role-switch { margin-right: 12px; }
.role-switch select { padding: 6px 10px; border-radius: 8px; border: 1px solid #cbd5e0; background: #fff; }

/* ── Sélecteur de société active (admin multi-sociétés) ── */
.company-switch { margin-right: 12px; }
.company-switch select { padding: 6px 10px; border-radius: 8px; border: 1px solid #cbd5e0; background: #fff; max-width: 220px; }

/* ── Bannière application mobile (page d'accueil) ── */
.lp-app {
    background: linear-gradient(120deg, var(--primary-dark) 0%, var(--primary) 55%, var(--accent) 100%);
    border-radius: 22px;
    margin: 8px auto 40px;
    max-width: 1080px;
    overflow: hidden;
    position: relative;
}
.lp-app::after {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at 85% 15%, rgba(255,255,255,.14), transparent 45%);
    pointer-events: none;
}
.lp-app-inner {
    display: flex; align-items: center; gap: 32px;
    padding: 38px 44px;
    position: relative; z-index: 1;
}
.lp-app-text { flex: 1; min-width: 0; }
.lp-app-kicker {
    display: inline-block;
    background: rgba(255,255,255,.16); color: #fff;
    font-size: .78rem; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
    padding: 4px 12px; border-radius: 999px; margin: 0 0 12px;
}
.lp-app h2 { color: #fff; font-size: 1.7rem; margin: 0 0 10px; }
.lp-app-lead { color: rgba(255,255,255,.85); font-size: .98rem; line-height: 1.6; margin: 0 0 22px; max-width: 480px; }
.lp-app-badge {
    display: inline-flex; align-items: center; gap: 12px;
    background: #0d1220; color: #fff !important;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 14px; padding: 10px 20px;
    text-decoration: none !important;
    transition: transform .15s, box-shadow .15s;
}
.lp-app-badge:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.3); }
.lp-app-badge small { display: block; font-size: .68rem; opacity: .75; letter-spacing: .4px; }
.lp-app-badge strong { display: block; font-size: 1.1rem; line-height: 1.1; }

.lp-app-visual { flex-shrink: 0; }
.lp-app-phone {
    width: 190px; background: #0d1220;
    border-radius: 26px; padding: 10px;
    box-shadow: 0 24px 48px rgba(0,0,0,.35);
    transform: rotate(4deg);
    position: relative;
}
.lp-app-notch {
    width: 64px; height: 5px; background: rgba(255,255,255,.25);
    border-radius: 3px; margin: 2px auto 8px;
}
.lp-app-screen { background: #f6f8fc; border-radius: 16px; overflow: hidden; }
.lp-app-appbar {
    background: var(--primary); color: #fff;
    font-size: .8rem; font-weight: 700; padding: 10px 12px;
}
.lp-app-row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: .76rem; color: #1f2430;
    padding: 8px 12px; border-bottom: 1px solid #e8ecf4;
}
.lp-app-row b { color: var(--primary); }
.lp-app-row-off b { color: #b4552d; }
.lp-app-valid {
    text-align: center; font-size: .74rem; font-weight: 700; color: #2f7d5d;
    background: #deefe6; margin: 10px; padding: 7px; border-radius: 9px;
}

@media (max-width: 760px) {
    .lp-app { border-radius: 0; margin: 0 0 32px; }
    .lp-app-inner { flex-direction: column; padding: 30px 22px; text-align: center; }
    .lp-app-lead { max-width: none; }
    .lp-app-phone { transform: rotate(0deg); }
}
