/* Structure de l'application : en-tête, gabarit de page, tableau de bord, connexion. */
:root {
    --sunu-ink: var(--ink);
    --sunu-muted: var(--text-2);
    --sunu-line: var(--line);
    --sunu-paper: var(--paper);
    --sunu-gold: var(--accent);
    --sunu-green: var(--emerald);
    --sunu-primary: var(--ink);
    --sunu-card-shadow: var(--shadow);
}

html { min-width: 320px; }
body { min-height: 100vh; background: var(--paper); color: var(--ink); }
.app-shell { width: min(100% - 48px, 1320px); margin: 0 auto; padding: 32px 0 64px; }
.app-shell > .container, .app-shell > .container-fluid { max-width: none; padding-left: 0; padding-right: 0; }
.app-shell > .container > .row, .app-shell > .container-fluid > .row { --bs-gutter-x: 1.25rem; }

/* ---------- En-tête ---------- */
.sunu-navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    min-height: 64px;
    padding: 0;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--line);
}
.sunu-navbar-inner { width: min(100% - 48px, 1320px); min-height: 64px; margin: 0 auto; display: flex; align-items: center; flex-wrap: wrap; }
.sunu-brand { display: inline-flex; align-items: center; gap: 10px; margin-right: 28px; padding: 0; color: var(--ink); }
.sunu-brand:hover { color: var(--ink); }
.sunu-brand-mark, .login-brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--ink); color: var(--lime); font-size: 17px; font-weight: 800; }
.sunu-brand-name { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.sunu-periode { display: flex; flex-direction: column; justify-content: center; gap: 1px; margin-right: 28px; padding-left: 18px; border-left: 1px solid var(--line); line-height: 1.2; white-space: nowrap; }
.sunu-periode-label { color: var(--text-2); font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.sunu-periode-valeur { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 14px; font-weight: 700; }
.sunu-periode-statut { display: inline-flex; align-items: center; gap: 5px; color: var(--emerald); font-size: 11.5px; font-weight: 600; }
.sunu-periode-point { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sunu-periode-vide { color: var(--text-2); font-weight: 500; }
@media (max-width: 399px) { .sunu-brand-name { display: none; } }
@media (min-width: 1200px) {
    /* Logo, période et menu complet restent sur une seule ligne */
    .sunu-navbar .navbar-collapse { flex: 1 1 0; min-width: 0; }
    .sunu-brand, .sunu-periode { margin-right: 20px; }
}
@media (min-width: 1200px) and (max-width: 1439px) {
    /* Menu complet : la place manque, on garde la période sans la mention « Ouverte » */
    .sunu-brand { margin-right: 16px; }
    .sunu-periode { margin-right: 16px; padding-left: 16px; }
    .sunu-periode-statut { display: none; }
}
.sunu-nav-links { align-items: center; gap: 2px; margin-right: auto; }
.sunu-nav-links .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 12px !important;
    border-radius: 8px;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease;
}
.sunu-nav-links .nav-link i { color: var(--text-3); font-size: 13px; }
.sunu-nav-links .nav-link:hover, .sunu-nav-links .nav-link:focus { background: var(--surface-2); color: var(--ink); }
.sunu-nav-links .nav-link.active { background: var(--ink); color: #fff; }
.sunu-nav-links .nav-link.active i { color: var(--lime); }
.sunu-nav-links .dropdown-menu { margin-top: 8px; }

.sunu-user-menu { margin-left: 16px; }
.sunu-user-trigger { display: flex; align-items: center; gap: 10px; max-width: 260px; padding: 5px 10px 5px 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); text-align: left; transition: border-color .15s ease; }
.sunu-user-trigger:hover, .sunu-user-trigger[aria-expanded="true"] { border-color: var(--line-strong); }
.sunu-user-avatar { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 800; }
.sunu-user-text { display: grid; min-width: 0; line-height: 1.2; }
.sunu-user-name { overflow: hidden; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.sunu-user-text small { overflow: hidden; color: var(--text-3); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.sunu-user-caret { color: var(--text-3); font-size: 10px; }
.sunu-nav-toggle { margin-left: auto; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); }
.sunu-nav-toggle:focus { box-shadow: 0 0 0 3px rgba(95, 125, 31, .2); }

/* ---------- Menu latéral (espace RH) ---------- */
:root { --sunu-sidebar-width: 256px; }
.sunu-sidebar { --bs-offcanvas-width: 288px; }
.sunu-sidebar-panel { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; height: 100%; background: var(--surface); border-right: 1px solid var(--line); }
.sunu-sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 14px; }
.sunu-sidebar-head .sunu-brand, .sunu-mobilebar .sunu-brand { margin: 0; text-decoration: none; }
.sunu-sidebar-periode { display: flex; flex-direction: column; gap: 2px; margin: 0 14px 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); line-height: 1.25; }
.sunu-sidebar-entreprise { color: inherit; text-decoration: none; transition: border-color .15s ease; }
.sunu-sidebar-entreprise:hover, .sunu-sidebar-entreprise:focus-visible { border-color: var(--line-strong); color: inherit; }
.sunu-sidebar-entreprise .sunu-periode-valeur { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sunu-sidebar-entreprise-periode { display: inline-flex; align-items: center; gap: 5px; color: var(--emerald); font-size: 11.5px; font-weight: 600; }
.sunu-sidebar-entreprise-periode.sunu-periode-vide { color: var(--text-2); font-weight: 500; }
.sunu-sidebar-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 10px 12px; }
.sunu-sidebar-nav ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.sunu-sidebar-groupe { margin: 14px 10px 6px; color: var(--text-3); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.sunu-sidebar-link {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-2);
    font-size: 13.5px;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}
.sunu-sidebar-link i { width: 16px; color: var(--text-3); font-size: 13px; text-align: center; }
.sunu-sidebar-link:hover, .sunu-sidebar-link:focus-visible { background: var(--surface-2); color: var(--ink); }
.sunu-sidebar-link.active { background: var(--ink); color: #fff; }
.sunu-sidebar-link.active i { color: var(--lime); }
.sunu-sidebar-user { display: grid; gap: 2px; padding: 12px 10px 14px; border-top: 1px solid var(--line); }
.sunu-sidebar-identite { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 4px 10px 8px; }
.sunu-sidebar-link-discret { padding-top: 6px; padding-bottom: 6px; font-size: 13px; font-weight: 500; }
.sunu-mobilebar { position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 16px; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--line); }
.sunu-mobilebar-periode { min-width: 0; overflow: hidden; padding-left: 12px; border-left: 1px solid var(--line); color: var(--ink); font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.sunu-mobilebar .sunu-nav-toggle { display: grid; place-items: center; flex: 0 0 40px; background: var(--surface); }
@media (min-width: 992px) {
    .sunu-sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 1030; display: flex; width: var(--sunu-sidebar-width); }
    .sunu-sidebar ~ .app-shell { width: min(100% - var(--sunu-sidebar-width) - 64px, 1320px); margin-left: calc(var(--sunu-sidebar-width) + max(32px, (100% - var(--sunu-sidebar-width) - 1320px) / 2)); margin-right: 0; }
}
@media (max-width: 399px) { .sunu-sidebar .sunu-brand-name { display: inline; } }
@media (prefers-reduced-motion: reduce) { .sunu-sidebar-link { transition: none; } }

/* ---------- Messages ---------- */
.alert { border-radius: var(--radius-sm); font-size: 14px; }

/* ---------- En-têtes de page ---------- */
.dashboard-page { display: grid; gap: 24px; }
.dashboard-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.dashboard-heading h1 { margin: 6px 0 6px; font-size: clamp(28px, 3vw, 36px); font-weight: 800; letter-spacing: -.03em; }
.dashboard-heading p { margin: 0; color: var(--text-2); font-size: 14px; }
.dashboard-heading .eyebrow { color: var(--warm); font-size: 12px; }
.eyebrow { margin: 0; color: var(--warm); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow-light { color: var(--lime); }
.dashboard-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Statistiques ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-card { display: flex; align-items: flex-start; justify-content: space-between; min-height: 140px; padding: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.stat-label { margin: 0 0 12px; color: var(--text-2); font-size: 13px; font-weight: 600; }
.stat-value { margin: 0; color: var(--ink); font-family: var(--font); font-variant-numeric: tabular-nums; font-size: clamp(26px, 2.4vw, 32px); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.stat-note { margin-top: 10px; color: var(--text-3); font-size: 12.5px; }
.stat-icon { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 15px; }
.stat-icon.gold { background: var(--warm-soft); color: var(--warm); }
.stat-icon.green { background: var(--emerald-soft); color: var(--emerald); }
.stat-icon.blue { background: var(--indigo-soft); color: var(--ink); }

/* ---------- Actions rapides ---------- */
.quick-actions { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.quick-action { display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm); transition: border-color .15s ease, box-shadow .15s ease; }
.quick-action:hover { color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow); }
.quick-action-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.quick-action strong { display: block; font-size: 14px; font-weight: 700; }
.quick-action small { display: block; margin-top: 3px; color: var(--text-2); font-size: 12.5px; }
.quick-action-arrow { margin-left: auto; color: var(--text-3); font-size: 12px; transition: transform .15s ease; }
.quick-action:hover .quick-action-arrow { transform: translateX(3px); color: var(--ink); }

/* ---------- Panneaux ---------- */
.dashboard-columns { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .95fr); gap: 16px; }
.app-panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.panel-heading p { margin: 4px 0 0; color: var(--text-2); font-size: 13px; }
.panel-body { padding: 20px; }
.panel-link { color: var(--text-2); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.panel-link:hover { color: var(--ink); }

/* ---------- Masse salariale ---------- */
.payroll-total { display: flex; align-items: baseline; gap: 8px; margin: 0 0 6px; color: var(--ink); font-family: var(--font); font-variant-numeric: tabular-nums; font-size: 32px; font-weight: 800; letter-spacing: -.03em; }
.payroll-total small { color: var(--text-2); font-family: var(--font); font-size: 13px; letter-spacing: 0; }
.payroll-caption { color: var(--text-2); font-size: 13px; }
.payroll-bars { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; height: 170px; padding-top: 18px; }
.payroll-bar-column { display: flex; flex: 1 1 0; min-width: 0; height: 100%; align-items: center; justify-content: flex-end; flex-direction: column; gap: 8px; }
.payroll-bar-track { display: flex; align-items: flex-end; width: min(100%, 28px); height: 126px; overflow: hidden; border-radius: 6px; background: var(--paper-2); }
.payroll-bar-track span { width: 100%; min-height: 3px; border-radius: 6px; background: #B7C98A; }
.payroll-bar-column.current .payroll-bar-track span { background: var(--ink); }
.payroll-bar-label { max-width: 100%; overflow: hidden; color: var(--text-3); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.payroll-bar-column.current .payroll-bar-label { color: var(--ink); font-weight: 700; }
.payroll-bar-value { display: none; }

/* ---------- Suivi de période ---------- */
.completion-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0 8px; color: var(--text-2); font-size: 13px; }
.completion-row strong { color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; }
.completion-track { height: 8px; overflow: hidden; border-radius: 999px; background: var(--paper-2); }
.completion-track span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.status-summary { display: grid; gap: 14px; margin-top: 22px; }
.status-summary-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-2); font-size: 13px; }
.status-summary-row strong { color: var(--ink); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--emerald); vertical-align: 0; }
.status-dot.amber { background: var(--amber); }
.status-dot.slate { background: var(--line-strong); }

/* ---------- Tableaux dans les panneaux ---------- */
.table-panel .panel-body { padding: 0; }
.table-panel .table { margin: 0; }
.table-panel .table th:first-child, .table-panel .table td:first-child { padding-left: 20px; }
.table-panel .table th:last-child, .table-panel .table td:last-child { padding-right: 20px; }
.table-primary-line { color: var(--ink); font-family: var(--font); font-size: 14px; font-weight: 600; }
.table-secondary-line { display: block; margin-top: 3px; color: var(--text-2); font-family: var(--font); font-size: 12.5px; }
.empty-state { padding: 32px 16px; color: var(--text-2); font-size: 14px; text-align: center; }
.empty-state i { display: block; margin-bottom: 10px; color: var(--line-strong); font-size: 22px; }
.service-list { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; }
.service-item { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.service-item i { color: var(--accent); }
.service-item strong { display: block; margin-top: 10px; overflow: hidden; color: var(--ink); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.service-item small { color: var(--text-2); font-size: 12.5px; }

/* ---------- Tableau des rubriques (RH et super admin) ---------- */
.rubrique-table td:first-child { width: 64px; }
.rubrique-name { display: block; color: var(--ink); font-size: 14px; font-weight: 600; }
.rubrique-code { display: block; margin-top: 2px; color: var(--text-3); font-family: var(--mono); font-size: 11.5px; }
.rubrique-type { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.rubrique-type .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald); }
.rubrique-type .dot.is-retenue { background: var(--red); }
/* La description du calcul passe à la ligne : sinon une longue formule élargit tout le tableau. */
.rubrique-calc { display: inline-flex; flex-wrap: wrap; align-items: center; column-gap: 6px; row-gap: 0; max-width: 300px; font-size: 13px; color: var(--text-2); }
.rubrique-calc i { color: var(--accent); font-size: 12px; }
.rubrique-calc.is-source i { color: var(--ink); }
.rubrique-calc small { flex-basis: 100%; padding-left: 18px; color: var(--text-3); font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.rubrique-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: nowrap; }
.rubrique-actions .btn { white-space: nowrap; }
.rubrique-actions .btn-icon { width: 32px; padding: 0; }
.rubrique-table tr.is-inactive td { color: var(--text-3); }
.rubrique-table tr.is-inactive .rubrique-name { color: var(--text-2); }
.rubrique-menu .dropdown-item.text-danger, .rubrique-menu .dropdown-item.text-danger i { color: var(--red) !important; }
.rubrique-menu .dropdown-item.text-danger:hover { background: var(--red-soft); }
.rubrique-menu .dropdown-item small { display: block; color: var(--text-3); font-size: 12px; }
@media (max-width: 767px) {
    .rubrique-actions .btn-label { display: none; }
}

/* ---------- Parcours de démarrage ---------- */
.onboarding-panel { margin: 0; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.onboarding-heading { margin-bottom: 18px; }
.onboarding-heading .eyebrow { margin-bottom: 8px; }
.onboarding-heading h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.onboarding-heading p:last-child { margin: 6px 0 0; color: var(--text-2); font-size: 14px; }
.onboarding-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; }
.onboarding-step { min-height: 128px; position: relative; display: flex; flex-direction: column; align-items: flex-start; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--ink); text-decoration: none; transition: border-color .15s ease, background .15s ease; }
.onboarding-step:hover { color: var(--ink); border-color: var(--line-strong); background: var(--surface); }
.onboarding-number { margin-bottom: 10px; color: var(--warm); font: 600 13px var(--mono); }
.onboarding-step strong { padding-right: 18px; font-size: 14px; font-weight: 700; line-height: 1.35; }
.onboarding-step small { margin-top: 6px; color: var(--text-2); font-size: 12.5px; line-height: 1.5; }
.onboarding-step small.is-done { display: inline-flex; align-items: center; gap: 6px; color: var(--emerald); font-weight: 700; }
.onboarding-step small.is-done::before { content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 10px; }
.onboarding-step > i { position: absolute; top: 18px; right: 16px; color: var(--text-3); font-size: 11px; }
.onboarding-next { margin-top: 14px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-radius: 12px; background: var(--ink); }
.onboarding-next-label { display: block; margin-bottom: 4px; color: var(--lime); font-size: 11.5px; font-weight: 800; letter-spacing: .08em; }
.onboarding-next-label i { margin-right: 4px; }
.onboarding-next strong { display: block; color: #fff; font-size: 15px; }
.onboarding-next p { margin: 4px 0 0; color: #C3CCD9; font-size: 13px; }
.onboarding-next p a { color: var(--lime); }
.onboarding-next .btn { flex: 0 0 auto; }
.onboarding-next .btn-primary { background: var(--lime) !important; border-color: var(--lime) !important; color: var(--ink) !important; box-shadow: none; }
.onboarding-next .btn-primary i { color: var(--ink); }
.onboarding-next .btn-primary:hover { background: #E2F88F !important; }
.onboarding-next .btn-outline-primary { background: transparent; border-color: rgba(255,255,255,.3); color: #fff; }
.onboarding-next .btn-outline-primary:hover { background: rgba(255,255,255,.08); color: #fff; }

/* ---------- Connexion ---------- */
.login-body { background: var(--paper); }
.login-body .app-shell { width: min(100% - 32px, 1120px); min-height: 100vh; display: grid; align-items: center; padding: 24px 0; }
.login-layout { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 620px; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: 0 30px 60px -24px rgba(20, 36, 59, .25); }
.login-intro { position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 40px 44px; background: var(--ink); color: #fff; }
.login-brand { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 10px; width: fit-content; color: #fff; font-size: 17px; font-weight: 800; letter-spacing: -.02em; text-decoration: none; }
.login-brand:hover { color: #fff; }
.login-brand strong { color: var(--lime); font-weight: 800; }
.login-intro .login-brand-mark { background: var(--lime); color: var(--ink); }
.login-intro-copy { position: relative; z-index: 1; max-width: 440px; margin: 48px 0 36px; }
.login-intro-copy h1 { margin: 14px 0 16px; color: #fff; font-size: clamp(32px, 3.6vw, 44px); font-weight: 800; letter-spacing: -.03em; line-height: 1.08; }
.login-intro-text { max-width: 380px; margin: 0; color: #C3CCD9; font-size: 15px; line-height: 1.7; }
.login-feature-list { position: relative; z-index: 1; display: grid; gap: 14px; color: #E6EBF2; font-size: 14px; }
.login-feature-list > div { display: flex; align-items: center; gap: 12px; }
.login-feature-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: rgba(214, 243, 106, .12); color: var(--lime); }
.login-decoration { position: absolute; width: 240px; height: 240px; border: 1px solid rgba(255,255,255,.06); border-radius: 50%; }
.login-decoration-one { top: -110px; right: -100px; box-shadow: 0 0 0 28px rgba(255,255,255,.02), 0 0 0 60px rgba(255,255,255,.015); }
.login-decoration-two { right: -120px; bottom: -150px; width: 340px; height: 340px; border-color: rgba(214,243,106,.14); }
.login-form-panel { display: flex; flex-direction: column; justify-content: center; padding: 52px clamp(32px, 5vw, 72px); }
.login-form-heading { margin-bottom: 32px; }
.login-form-heading h2 { margin: 10px 0 8px; font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.login-form-heading > p:last-child { margin: 0; color: var(--text-2); font-size: 14px; }
.login-form .form-label { margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.input-with-icon { position: relative; }
.input-with-icon > i { position: absolute; z-index: 1; top: 50%; left: 14px; color: var(--text-3); font-size: 14px; transform: translateY(-50%); }
.input-with-icon .form-control { min-height: 48px; padding: 11px 44px; font-size: 15px; }
.password-toggle { position: absolute; top: 50%; right: 8px; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--text-3); transform: translateY(-50%); }
.password-toggle:hover { background: var(--surface-2); color: var(--ink); }
.login-submit { justify-content: center; width: 100%; min-height: 48px; font-size: 15px; }
.login-submit i { margin-left: auto; }
.login-help { margin: 24px 0 0; color: var(--text-3); font-size: 12.5px; text-align: center; }
.login-help i { margin-right: 5px; color: var(--emerald); }
.signup-prompt { margin: 18px 0 0; color: var(--text-2); font-size: 14px; text-align: center; }
.signup-prompt a { color: var(--accent); font-weight: 700; text-decoration: none; }
.signup-prompt a:hover { text-decoration: underline; }

/* ---------- Adaptation ---------- */
@media (max-width: 1199.98px) {
    .sunu-navbar-inner { min-height: 60px; }
    .sunu-navbar .navbar-collapse { flex-basis: 100%; padding: 8px 0 14px; }
    .sunu-nav-links { align-items: stretch; gap: 2px; margin: 0; }
    .sunu-nav-links .nav-link { width: 100%; }
    .sunu-user-menu { margin: 10px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
    .sunu-user-trigger { max-width: none; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .quick-actions { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .service-list { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .onboarding-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 767px) {
    .app-shell, .sunu-navbar-inner { width: min(100% - 32px, 1320px); }
    .sunu-brand { margin-right: 14px; }
    .sunu-periode { margin-right: 8px; padding-left: 14px; }
    .app-shell { padding: 22px 0 44px; }
    .dashboard-heading { align-items: flex-start; flex-direction: column; gap: 16px; }
    .dashboard-actions { width: 100%; }
    .dashboard-actions .btn { flex: 1 1 auto; }
    .dashboard-columns { grid-template-columns: minmax(0,1fr); }
    .service-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .login-body .app-shell { width: min(100% - 24px, 560px); padding: 12px 0; }
    .login-layout { grid-template-columns: 1fr; min-height: 0; border-radius: 16px; }
    .login-intro { min-height: 250px; padding: 26px 24px 24px; }
    .login-intro-copy { margin: 32px 0 16px; }
    .login-intro-copy h1 { font-size: 30px; }
    .login-intro-text { font-size: 14px; }
    .login-feature-list { display: none; }
    .login-form-panel { padding: 32px 24px 28px; }
    .login-form-heading { margin-bottom: 24px; }
}
@media (max-width: 600px) {
    .onboarding-panel { padding: 18px; }
    .onboarding-grid { grid-template-columns: 1fr; }
    .onboarding-step { min-height: auto; }
    .onboarding-next { align-items: stretch; flex-direction: column; }
}
@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { min-height: 120px; padding: 15px; }
    .stat-value { font-size: 22px; }
    .stat-icon { width: 34px; height: 34px; flex-basis: 34px; font-size: 13px; }
    .quick-actions { grid-template-columns: minmax(0,1fr); gap: 8px; }
    .panel-heading, .panel-body { padding: 16px; }
    .table-panel .panel-body { padding: 0; }
    .service-list { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .quick-action, .quick-action-arrow, .onboarding-step, .sunu-nav-links .nav-link { transition: none; }
}

/* ---------- Heures supplémentaires ---------- */
.overtime-table td:first-child { width: 88px; white-space: nowrap; color: var(--ink); font-family: var(--font); font-weight: 700; }
.overtime-table td { color: var(--text-2); }
.overtime-table td:last-child { color: var(--ink); font-weight: 600; white-space: nowrap; }
.overtime-table tfoot th { padding-top: 16px; padding-bottom: 16px; border-bottom: 0; background: var(--surface-2); font-size: 14px; }
.overtime-table tfoot th:last-child { font-size: 16px; font-weight: 800; white-space: nowrap; }

/* ---------- Formulaires en sections ---------- */
.form-sections { display: grid; gap: 16px; }
.form-sections .panel-heading h2 i { margin-right: 6px; color: var(--accent); font-size: 14px; }
.form-sections .panel-body > .row:last-child > [class*="col"] > .mb-3:last-child { margin-bottom: 0 !important; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* ---------- Paramètres de paie ---------- */
.parametres-grille { display: grid; gap: 0; }
.parametres-entete, .parametres-ligne { display: grid; grid-template-columns: minmax(160px, 1fr) repeat(3, minmax(0, 1.2fr)); gap: 16px; align-items: start; }
.parametres-entete { padding-bottom: 8px; border-bottom: 1px solid var(--line); color: var(--text-3); font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.parametres-ligne { padding: 16px 0; border-bottom: 1px solid var(--line); }
.parametres-ligne:last-child { padding-bottom: 0; border-bottom: 0; }
.parametres-ligne .form-label { display: none; }
.parametres-regime { padding-top: 8px; }
.parametres-regime strong { display: block; color: var(--ink); font-size: 14px; }
.parametres-regime small { display: block; margin-top: 2px; color: var(--text-2); font-size: 12.5px; }
.form-sections .input-group .form-control { text-align: right; font-variant-numeric: tabular-nums; }
.form-sections .input-group-text { min-width: 56px; justify-content: center; color: var(--text-2); font-size: 13px; }
@media (max-width: 767px) {
    .parametres-entete { display: none; }
    .parametres-ligne { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .parametres-ligne .form-label { display: block; }
}

/* ---------- Informations de l'entreprise ---------- */
.entreprise-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.entreprise-aside { position: sticky; top: 80px; display: grid; gap: 16px; }
.logo-apercu { display: grid; place-items: center; height: 132px; padding: 12px; border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--surface-2); }
.logo-apercu img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-initiale { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 14px; background: var(--ink); color: var(--lime); font-size: 28px; font-weight: 800; }
.entete-apercu { display: grid; gap: 3px; padding: 14px 16px; border-left: 3px solid var(--ink); border-radius: 6px; background: var(--surface-2); color: var(--text-2); font-size: 12.5px; line-height: 1.45; }
.entete-apercu strong { color: var(--ink); font-size: 15px; }
.entete-apercu span:empty { display: none; }
@media (max-width: 991px) {
    .entreprise-layout { grid-template-columns: minmax(0, 1fr); }
    .entreprise-aside { position: static; }
}

/* ---------- Facturation (RH) ---------- */
.facturation-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.facturation-stats .stat-value small { color: var(--text-2); font-size: 14px; font-weight: 700; letter-spacing: 0; }
.facturation-payer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.facturation-payer > div { flex: 1 1 320px; }
.facturation-annulees summary { cursor: pointer; list-style: none; border-bottom: 0; }
.facturation-annulees summary::-webkit-details-marker { display: none; }
.facturation-annulees summary i { color: var(--text-3); font-size: 12px; transition: transform .15s ease; }
.facturation-annulees[open] summary { border-bottom: 1px solid var(--line); }
.facturation-annulees[open] summary i { transform: rotate(180deg); }
.facturation-annulees .table th:first-child, .facturation-annulees .table td:first-child { padding-left: 20px; }
@media (max-width: 767px) {
    .facturation-stats { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .facturation-stats .stat-card { min-height: 0; }
}

/* ---------- Périodes : explication quand un mois ne se rouvre plus ---------- */
/* Mention courte à côté des boutons ; « Pourquoi ? » ouvre l'explication sur sa propre ligne, sous les boutons. */
.periode-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 260px; }
.periode-refus { order: 10; line-height: 1.35; }
.periode-refus summary { cursor: pointer; white-space: nowrap; list-style: none; }
.periode-refus summary::-webkit-details-marker { display: none; }
.periode-refus-pourquoi { margin-left: 4px; color: var(--bs-link-color, #0d6efd); text-decoration: underline; }
.periode-refus[open] { flex-basis: 100%; max-width: 420px; }
.periode-refus[open] .periode-refus-pourquoi { display: none; }

/* Légende courte des états ; « Comment ça marche ? » ouvre les règles. */
.periode-legende { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; color: var(--text-2); }
.periode-aide summary { cursor: pointer; color: var(--bs-link-color, #0d6efd); text-decoration: underline; list-style: none; }
.periode-aide summary::-webkit-details-marker { display: none; }
.periode-aide[open] { flex-basis: 100%; max-width: 640px; }

/* ---------- Catalogue des rubriques : boutons collés en bas de l'écran ---------- */
.catalogue-actions { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 16px; padding: 12px 0; border-top: 1px solid var(--line); background: var(--paper); }
.catalogue-compteur { margin-right: auto; }
@media (max-width: 767px) {
    .catalogue-actions .btn { flex: 1 1 auto; }
    .catalogue-compteur { flex-basis: 100%; }
}
