/* =========================================================================
   DRH-MESFPT — back-office design system (framework-free)
   ========================================================================= */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;450;500;600;700;800&display=swap");

*,
*::before,
*::after {
    box-sizing: border-box;
}
* {
    margin: 0;
}

:root {
    color-scheme: light;

    /* Surfaces */
    --bg: #eef1f6;
    --surface: #ffffff;
    --surface-2: #f7f8fb;
    --surface-3: #f0f2f7;
    --border: #e6e8ef;
    --border-strong: #d3d7e3;
    --topbar-bg: rgba(255, 255, 255, 0.82);
    --field-border-hover: #bcc1d0;

    /* Texte */
    --text: #14161d;
    --text-soft: #4a4f5e;
    --text-muted: #868b9c;

    /* Texte des pastilles « soft » (badges, stats, chips) — éclairci en sombre */
    --fg-on-soft-primary: var(--primary);
    --fg-on-soft-success: var(--success);
    --fg-on-soft-warning: var(--warning);
    --fg-on-soft-danger: var(--danger);
    --fg-on-soft-info: var(--info);
    --fg-on-soft-gold: var(--gold);
    --fg-on-soft-teal: var(--teal);
    --fg-on-soft-red: var(--brand-red);

    /* Marque — couleurs du logo DRH-MESFPT (vert ministère, rouge, or) */
    --primary: #137a33;
    --primary-600: #178a3a;
    --primary-hover: #0f6128;
    --primary-soft: #e4f4e8;
    --primary-ring: rgba(23, 138, 58, 0.24);

    --gold: #b7791f;
    --gold-soft: #fbf0d9;
    --brand-red: #c8281c;
    --brand-red-soft: #fbe7e5;
    --teal: #167a6b;
    --teal-soft: #e0f2ef;

    --success: #157a3a;
    --success-soft: #e4f4e8;
    --warning: #92590a;
    --warning-soft: #fbefda;
    --danger: #c1261b;
    --danger-soft: #fbe7e5;
    --info: #146a7d;
    --info-soft: #e0f1f4;

    /* Sidebar — suit le thème (valeurs sombres dans :root[data-theme="dark"]) */
    --nav-bg: #ffffff;
    --nav-bg-2: #f8f9fc;
    --nav-border: #e6e8ef;
    --nav-scrollbar: #d3d7e3;
    --nav-text: #565b6b;
    --nav-text-hover: #14161d;
    --nav-heading: #9aa0ae;
    --nav-hover: #f0f2f7;
    --nav-wordmark: #14161d;
    --nav-accent: var(--primary-600);
    --nav-user-name: #14161d;
    --nav-user-role: #9aa0ae;
    --nav-glow: rgba(19, 122, 51, 0.07);
    --nav-logo-shadow: rgba(20, 22, 33, 0.16);

    --radius: 14px;
    --radius-md: 11px;
    --radius-sm: 9px;

    --shadow-xs: 0 1px 2px rgba(20, 22, 33, 0.05);
    --shadow-sm:
        0 1px 2px rgba(20, 22, 33, 0.06), 0 4px 12px -2px rgba(20, 22, 33, 0.07);
    --shadow-md:
        0 4px 12px -2px rgba(20, 22, 33, 0.1),
        0 12px 32px -8px rgba(20, 22, 33, 0.14);
    --shadow-lg: 0 24px 64px -12px rgba(20, 22, 33, 0.28);

    --font:
        "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    --ease: cubic-bezier(0.32, 0.72, 0, 1);
}

/* ---------------------------------------------------------- dark theme --- *
   `data-theme` est posé sur <html> AVANT le rendu (script inline du <head>) :
   préférence stockée si présente, sinon `prefers-color-scheme`. Le bouton du
   topbar bascule et persiste dans localStorage. La barre latérale reste sombre
   dans les deux modes (choix de design).                                       */
:root[data-theme="dark"] {
    color-scheme: dark;

    --bg: #0e0f14;
    --surface: #16171e;
    --surface-2: #1b1d26;
    --surface-3: #23252f;
    --border: #2a2c37;
    --border-strong: #383b48;
    --topbar-bg: rgba(22, 23, 30, 0.82);
    --field-border-hover: #4a4e5e;

    --text: #e7e8ee;
    --text-soft: #b2b6c2;
    --text-muted: #7f8494;

    --nav-bg: #101116;
    --nav-bg-2: #16181f;
    --nav-border: #23252f;
    --nav-scrollbar: #33353f;
    --nav-text: #9498a8;
    --nav-text-hover: #dfe1e8;
    --nav-heading: #565964;
    --nav-hover: #23252f;
    --nav-wordmark: #f1f2f5;
    --nav-accent: #4ecb6f;
    --nav-user-name: #eceef3;
    --nav-user-role: #63666f;
    --nav-glow: rgba(255, 255, 255, 0.1);
    --nav-logo-shadow: rgba(0, 0, 0, 0.55);

    --fg-on-soft-primary: #4fd88a;
    --fg-on-soft-success: #55d98d;
    --fg-on-soft-warning: #e6b15a;
    --fg-on-soft-danger: #f2837a;
    --fg-on-soft-info: #5cc3da;
    --fg-on-soft-gold: #e0b060;
    --fg-on-soft-teal: #48c3b0;
    --fg-on-soft-red: #f2837a;

    --primary-soft: #123020;
    --gold-soft: #33280f;
    --brand-red-soft: #3a1512;
    --teal-soft: #0f2b27;
    --success-soft: #123020;
    --warning-soft: #33280f;
    --danger-soft: #3a1512;
    --info-soft: #0f2831;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-sm:
        0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 12px -2px rgba(0, 0, 0, 0.45);
    --shadow-md:
        0 4px 12px -2px rgba(0, 0, 0, 0.5), 0 12px 32px -8px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 24px 64px -12px rgba(0, 0, 0, 0.7);
}

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

body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-feature-settings: "cv05", "ss01";
}

a {
    color: var(--primary-600);
    text-decoration: none;
    transition: color 0.12s var(--ease);
}
a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
    text-underline-offset: 2px;
}
svg {
    display: block;
    flex: none;
}
.icon {
    width: 18px;
    height: 18px;
    stroke-width: 1.85;
}
.icon-sm {
    width: 15px;
    height: 15px;
    stroke-width: 2;
}
h1,
h2,
h3 {
    letter-spacing: -0.014em;
}

/* ---------------------------------------------------------------- layout -- */

.layout {
    display: grid;
    grid-template-columns: 256px minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
}
.scrim {
    display: none;
}

.sidebar {
    background: linear-gradient(180deg, var(--nav-bg-2), var(--nav-bg) 240px);
    color: var(--nav-text);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    /* `100dvh` (hauteur de viewport *dynamique*) au lieu de `100vh` sur
       mobile : `100vh` est calculé sur le plus grand viewport possible
       (barre d'adresse rétractée), donc plus haut que ce qui est réellement
       visible tant que la barre d'adresse est affichée. La sidebar (surtout
       en overlay `position:fixed`, voir @media 960px) débordait alors sous
       le bas d'écran visible, emportant avec elle son pied — avatar, nom,
       rôle, bouton « Se déconnecter » — invisible et inatteignable (rien à
       faire défiler : son propre contenu tient déjà dans les 100vh gonflés). */
    height: 100dvh;
    overflow-y: auto;
    border-right: 1px solid var(--nav-border);
}
.sidebar::-webkit-scrollbar {
    width: 6px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: var(--nav-scrollbar);
    border-radius: 3px;
}

.sidebar__brand {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 22px 18px 18px;
    border-bottom: 1px solid var(--nav-border);
}
.sidebar__brand::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 116px;
    height: 116px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--nav-glow), transparent 68%);
}
.brand-logo {
    display: block;
}
.brand-logo--sidebar {
    position: relative;
    width: 84px;
    height: auto;
    filter: drop-shadow(0 4px 12px var(--nav-logo-shadow));
}
.sidebar__wordmark {
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: var(--nav-wordmark);
    text-transform: uppercase;
}
.sidebar__wordmark span {
    color: var(--nav-accent);
}

.sidebar__section {
    padding: 18px 22px 7px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--nav-heading);
}
.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 0 12px;
}
.sidebar__link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 9px;
    color: var(--nav-text);
    font-weight: 500;
    font-size: 13.5px;
    transition:
        background 0.14s var(--ease),
        color 0.14s var(--ease);
}
.sidebar__link svg {
    opacity: 0.78;
    transition: opacity 0.14s var(--ease);
}
.sidebar__link:hover {
    background: var(--nav-hover);
    color: var(--nav-text-hover);
    text-decoration: none;
}
.sidebar__link:hover svg {
    opacity: 1;
}
.sidebar__link.is-active {
    background: linear-gradient(180deg, var(--primary-600), var(--primary));
    color: #fff;
    box-shadow: 0 4px 14px -4px var(--primary-ring);
}
.sidebar__link.is-active svg {
    opacity: 1;
    color: #fff;
}

.sidebar__foot {
    margin-top: auto;
    padding: 12px 14px 16px;
    border-top: 1px solid var(--nav-border);
}
.sidebar__user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
    margin-bottom: 6px;
    border-radius: 9px;
    color: inherit;
    transition: background 0.14s var(--ease);
}
.sidebar__user:hover {
    background: var(--nav-hover);
    text-decoration: none;
}
.sidebar__user:hover b {
    color: var(--nav-text-hover);
}
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex: none;
    background: linear-gradient(140deg, #1ea84a, #0f6128);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 12.5px;
    font-weight: 700;
}
.avatar--round {
    border-radius: 50%;
}
.sidebar__user div {
    min-width: 0;
}
.sidebar__user b {
    display: block;
    color: var(--nav-user-name);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar__user small {
    color: var(--nav-user-role);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Bouton de déconnexion — suit le thème de la sidebar, lisible au survol.
   Sélecteur à 2 classes pour l'emporter sur `.btn--ghost:hover`.               */
.sidebar__foot .sidebar__logout {
    width: 100%;
    color: var(--nav-text);
    border-color: transparent;
    background: color-mix(in srgb, var(--nav-text) 9%, transparent);
}
.sidebar__foot .sidebar__logout:hover {
    background: var(--nav-hover);
    color: var(--nav-text-hover);
}
.sidebar__foot .sidebar__logout:focus-visible {
    outline: 2px solid var(--nav-accent);
    outline-offset: 2px;
}

/* -------------------------------------------------------------- main col -- */

.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 66px;
    padding: 12px 32px;
    background: var(--topbar-bg);
    backdrop-filter: saturate(1.6) blur(10px);
    border-bottom: 1px solid var(--border);
}
.topbar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: linear-gradient(
        90deg,
        var(--primary) 0 33.33%,
        #efb700 33.33% 66.66%,
        var(--brand-red) 66.66%
    );
    opacity: 0.9;
}
/* Conteneur titre + fil d'ariane : doit pouvoir rétrécir sous sa largeur de
   contenu (override le `min-width:auto` par défaut d'un enfant flex) pour ne
   jamais forcer le topbar à déborder sur un écran étroit — le texte est
   tronqué proprement (…) plutôt que de casser la ligne ou pousser les
   actions (recherche/cloche/thème) hors champ.                               */
.topbar__heading {
    min-width: 0;
}
.topbar__title,
.topbar__crumb {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.topbar__title {
    font-size: 16px;
    font-weight: 680;
    letter-spacing: -0.015em;
}
.topbar__crumb {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 1px;
}
.topbar__spacer {
    flex: 1;
}
.topbar__actions {
    display: flex;
    align-items: center;
    gap: 9px;
}
/* Recherche rapide d'agent : remplacée par une icône seule sur mobile (lien
   vers la liste des agents, qui porte déjà la même recherche + des filtres)
   — le champ texte n'a pas la place à côté de la cloche/du thème sur un
   téléphone, voir .topbar-search @media plus bas. */
.topbar-search-mobile {
    display: none;
}

.hamburger {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-soft);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* -------------------------------------------------------- theme toggle -- */
.theme-toggle {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-soft);
    cursor: pointer;
    transition:
        background 0.12s var(--ease),
        color 0.12s var(--ease),
        border-color 0.12s var(--ease);
}
.theme-toggle:hover {
    background: var(--surface-2);
    color: var(--text);
}
.theme-toggle:focus-visible {
    outline: 2px solid var(--primary-600);
    outline-offset: 2px;
}
.theme-toggle .icon {
    width: 17px;
    height: 17px;
}
.theme-toggle__moon {
    display: none;
}
:root[data-theme="dark"] .theme-toggle__sun {
    display: none;
}
:root[data-theme="dark"] .theme-toggle__moon {
    display: block;
}

/* ---------------------------------------------------- topbar search -- */
.topbar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-soft);
}
.topbar-search__icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}
/* L'icône est le bouton d'envoi du formulaire — reset complet pour qu'elle
   reste visuellement identique à une simple icône décorative. */
.topbar-search__submit {
    display: inline-flex;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    flex-shrink: 0;
}
.topbar-search input {
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 13px;
    color: var(--text);
    width: 170px;
    outline: none;
}
.topbar-search input::placeholder {
    color: var(--text-muted);
}
@media (max-width: 760px) {
    .topbar-search input {
        width: 110px;
    }
}

/* -------------------------------------------------------- notifications -- */
.notif-dropdown {
    position: relative;
}
.notif-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--surface);
}
.notif-panel {
    position: absolute;
    z-index: 40;
    right: 0;
    top: calc(100% + 8px);
    width: 320px;
    max-width: calc(100vw - 32px);
    max-height: 380px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 12px;
}
.notif-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.notif-panel__all {
    display: block;
    text-align: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--primary-600);
    text-decoration: none;
}
.notif-panel__all:hover {
    text-decoration: underline;
}

.content {
    padding: 26px 32px 56px;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
}
.page-head {
    margin-bottom: 20px;
    /* Les en-têtes de page (recherche + filtres + boutons d'action, voir
       drh/{agents,affectations,avancements,documents,audit-logs}/index)
       sont posés en `display:flex` inline par chaque page ; ce sélecteur
       n'a d'effet que là où c'est le cas, et fait passer champs/boutons à
       la ligne plutôt que de les écraser sur un écran étroit. `form` couvre
       le cas où le formulaire de recherche est l'enfant direct (pas
       lui-même `.page-head`). */
    flex-wrap: wrap;
}
.page-head form {
    flex-wrap: wrap;
}
.page-head h1 {
    font-size: 21px;
    font-weight: 720;
}
.page-head p {
    color: var(--text-muted);
    margin-top: 3px;
}
.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.stack > * + * {
    margin-top: 18px;
}

/* --------------------------------------------------------------- cards --- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}
.card + .card {
    margin-top: 18px;
}
.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    row-gap: 8px;
    gap: 12px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 640;
    font-size: 13.5px;
    letter-spacing: -0.005em;
}
.card__header .hint {
    font-weight: 400;
    color: var(--text-muted);
}
.card__body {
    padding: 20px;
}
.card__body--tight {
    padding: 0;
}
.card__foot {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.detail {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 11px 18px;
}
.detail dt {
    color: var(--text-muted);
    font-weight: 500;
}
.detail dd {
    color: var(--text);
}

/* --------------------------------------------------------------- stats --- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.stat-grid + .stat-grid {
    margin-top: 16px;
}
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 17px 18px;
    box-shadow: var(--shadow-xs);
    display: flex;
    flex-direction: column;
    gap: 3px;
    transition:
        box-shadow 0.18s var(--ease),
        transform 0.18s var(--ease);
}
.stat:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}
.stat__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.stat__chip {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--fg-on-soft-primary);
}
.stat__chip.i-warning {
    background: var(--warning-soft);
    color: var(--fg-on-soft-warning);
}
.stat__chip.i-info {
    background: var(--info-soft);
    color: var(--fg-on-soft-info);
}
.stat__chip.i-success {
    background: var(--success-soft);
    color: var(--fg-on-soft-success);
}
.stat__chip.i-danger {
    background: var(--danger-soft);
    color: var(--fg-on-soft-danger);
}
.stat__chip.i-green {
    background: var(--primary-soft);
    color: var(--fg-on-soft-primary);
}
.stat__chip.i-gold {
    background: var(--gold-soft);
    color: var(--fg-on-soft-gold);
}
.stat__chip.i-teal {
    background: var(--teal-soft);
    color: var(--fg-on-soft-teal);
}
.stat__chip.i-red {
    background: var(--brand-red-soft);
    color: var(--fg-on-soft-red);
}
.stat__label {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.stat__value {
    font-size: 27px;
    font-weight: 760;
    letter-spacing: -0.03em;
    line-height: 1.1;
}
.stat__foot {
    font-size: 12px;
    color: var(--text-muted);
}
.stat--mini {
    padding: 14px 16px;
}
.stat--mini .stat__value {
    font-size: 22px;
}
.stat--accent {
    border-left: 3px solid var(--accent, var(--primary));
}
.stat.i-warning {
    --accent: var(--gold);
}
.stat.i-info {
    --accent: var(--teal);
}
.stat.i-success {
    --accent: var(--primary);
}
.stat.i-danger {
    --accent: var(--brand-red);
}

/* --------------------------------------------------------------- table --- */

.table-wrap {
    width: 100%;
    overflow-x: auto;
}
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
table.data thead th {
    background: var(--surface-2);
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 11px 18px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
table.data tbody td {
    padding: 13px 18px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
table.data tbody tr:last-child td {
    border-bottom: 0;
}
table.data tbody tr {
    transition: background 0.1s var(--ease);
}
table.data tbody tr:hover {
    background: var(--surface-2);
}
table.data a {
    font-weight: 550;
}
table.data .muted {
    color: var(--text-muted);
    font-size: 12px;
}
table.data .actions {
    text-align: right;
    white-space: nowrap;
}
table.data .cell-nowrap {
    white-space: nowrap;
}
.empty {
    text-align: center;
    color: var(--text-muted);
    padding: 48px 20px;
    font-size: 13px;
}

/* -------------------------------------------------------------- badges --- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.55;
    white-space: nowrap;
    background: var(--surface-3);
    color: var(--text-soft);
}
.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.badge--neutral {
    background: var(--surface-3);
    color: var(--text-soft);
}
.badge--warning {
    background: var(--warning-soft);
    color: var(--fg-on-soft-warning);
}
.badge--info {
    background: var(--info-soft);
    color: var(--fg-on-soft-info);
}
.badge--success {
    background: var(--success-soft);
    color: var(--fg-on-soft-success);
}
.badge--danger {
    background: var(--danger-soft);
    color: var(--fg-on-soft-danger);
}
.badge--plain::before {
    display: none;
}

/* ------------------------------------------------------------- buttons --- */

.btn {
    --btn-bg: var(--surface);
    --btn-fg: var(--text);
    --btn-bd: var(--border-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 15px;
    border-radius: 10px;
    font: inherit;
    font-weight: 600;
    font-size: 13px;
    line-height: 1;
    background: var(--btn-bg);
    color: var(--btn-fg);
    border: 1px solid var(--btn-bd);
    cursor: pointer;
    transition:
        transform 0.12s var(--ease),
        box-shadow 0.15s var(--ease),
        background 0.15s var(--ease),
        border-color 0.15s var(--ease);
    white-space: nowrap;
}
.btn:hover {
    text-decoration: none;
    /* On modifie la variable, pas `background` : sinon le survol écrase la
       couleur pleine des variantes (danger / success) → texte blanc illisible. */
    --btn-bg: var(--surface-2);
    /* Un `.btn` rendu en `<a>` (ex. "Nouvel agent", le bouton "Retour" des
       pages d'erreur) hérite sinon de la règle générique `a:hover` (couleur
       + soulignement) — plus spécifique que `.btn { color: var(--btn-fg) }`
       seul, donc gagnante au survol : le texte d'un `.btn--primary` virait
       au vert (`--primary-hover`), quasi invisible sur le dégradé vert du
       fond. Réaffirmé ici à spécificité supérieure à `a:hover` (2 classes
       contre 1 élément + 1 pseudo-classe). */
    color: var(--btn-fg);
}
.btn:active {
    transform: translateY(1px);
}
.btn:focus-visible {
    outline: 2px solid var(--primary-600);
    outline-offset: 2px;
}
.btn--primary {
    --btn-fg: #fff;
    --btn-bd: transparent;
    background: linear-gradient(180deg, var(--primary-600), var(--primary));
    box-shadow:
        0 1px 2px rgba(20, 22, 33, 0.14),
        0 8px 20px -8px var(--primary-ring);
}
.btn--primary:hover {
    background: linear-gradient(180deg, var(--primary), var(--primary-hover));
}
.btn--danger {
    --btn-bg: var(--danger);
    --btn-fg: #fff;
    --btn-bd: transparent;
}
.btn--danger:hover {
    --btn-bg: color-mix(in srgb, var(--danger) 85%, #000);
}
.btn--success {
    --btn-bg: var(--success);
    --btn-fg: #fff;
    --btn-bd: transparent;
}
.btn--success:hover {
    --btn-bg: color-mix(in srgb, var(--success) 85%, #000);
}
.btn--ghost {
    --btn-bg: transparent;
    --btn-bd: transparent;
    color: var(--text-soft);
}
.btn--ghost:hover {
    background: var(--surface-3);
}
.btn--sm {
    padding: 7px 11px;
    font-size: 12.5px;
}
.btn--block {
    width: 100%;
    padding: 11px;
    font-size: 13.5px;
}
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-soft);
    cursor: pointer;
    transition:
        background 0.12s var(--ease),
        color 0.12s var(--ease),
        border-color 0.12s var(--ease);
}
.icon-btn:hover {
    background: var(--surface-2);
    color: var(--text);
    text-decoration: none;
}
.icon-btn--danger:hover {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 35%, transparent);
}

/* Bulle "Copié ✓" (`[data-copy]`, `app.js`) — élément à part, jamais le
   contenu du bouton (qui peut être une icône SVG sans texte) : ni écrasée,
   ni tronquée par une boîte de bouton trop petite. */
.copied-tip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-bottom: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--text);
    color: var(--surface);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    z-index: 20;
    opacity: 0;
    transform: translate(-50%, 4px);
    transition: opacity 0.15s var(--ease), transform 0.15s var(--ease);
}
.copied-tip.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* --------------------------------------------------------------- forms --- */

.field {
    margin-bottom: 15px;
}
.field:last-child {
    margin-bottom: 0;
}
.field > label {
    display: block;
    margin-bottom: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-soft);
}
.field .req {
    color: var(--danger);
}
.field .hint,
.hint {
    font-size: 12px;
    color: var(--text-muted);
}
.field .hint {
    margin-top: 5px;
    display: block;
}

.input,
.select,
.textarea {
    width: 100%;
    padding: 10px 12px;
    font: inherit;
    font-size: 13.5px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    outline: none;
    transition:
        border-color 0.14s var(--ease),
        box-shadow 0.14s var(--ease),
        background 0.14s var(--ease);
}
.input::placeholder,
.textarea::placeholder {
    color: var(--text-muted);
}
.input:hover,
.select:hover,
.textarea:hover {
    border-color: var(--field-border-hover);
}
.input:focus,
.select:focus,
.textarea:focus {
    border-color: var(--primary-600);
    box-shadow: 0 0 0 4px var(--primary-ring);
    background: var(--surface);
}
.textarea {
    resize: vertical;
    min-height: 74px;
    line-height: 1.5;
}
.select {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23868b9c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    padding-right: 34px;
}
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 16px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px 14px;
}

/* Multi-sélecteur avec recherche + puces (style Select2, vanilla) */
.tagselect {
    position: relative;
}
.tagselect__control {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 5px 8px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    cursor: text;
    transition:
        border-color 0.14s var(--ease),
        box-shadow 0.14s var(--ease);
}
.tagselect.is-open .tagselect__control,
.tagselect__control:focus-within {
    border-color: var(--primary-600);
    box-shadow: 0 0 0 4px var(--primary-ring);
}
.tagselect__chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 5px 3px 9px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--fg-on-soft-primary);
    background: var(--primary-soft);
    border: 1px solid color-mix(in srgb, var(--primary) 32%, transparent);
    border-radius: 7px;
    line-height: 1.5;
}
.tagselect__chip small {
    font-weight: 500;
    color: var(--text-muted);
}
.tagselect__x {
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 16px;
    border: 0;
    border-radius: 5px;
    cursor: pointer;
    padding: 0;
    color: var(--fg-on-soft-primary);
    background: transparent;
    font-size: 13px;
    line-height: 1;
}
.tagselect__x:hover {
    background: color-mix(in srgb, var(--primary) 18%, transparent);
}
.tagselect__input {
    flex: 1 1 90px;
    min-width: 90px;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 13.5px;
    color: var(--text);
    padding: 4px 2px;
}
.tagselect__menu {
    position: absolute;
    z-index: 40;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    max-height: 240px;
    overflow-y: auto;
    margin: 0;
    padding: 4px;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}
.tagselect__opt {
    padding: 8px 10px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
.tagselect__opt small {
    color: var(--text-muted);
}
.tagselect__opt.is-active,
.tagselect__opt:hover {
    background: var(--primary-soft);
    color: var(--fg-on-soft-primary);
}
.tagselect__empty {
    padding: 8px 10px;
    color: var(--text-muted);
    font-size: 13px;
}
.tagselect__opt--create {
    font-style: italic;
    border-bottom: 1px solid var(--border);
    border-radius: 7px 7px 0 0;
}
.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    color: var(--text-soft);
    cursor: pointer;
}
.checkbox input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-600);
}

/* Formulaire sur 2 colonnes (form + aide) */
.form-2col {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 22px;
    align-items: start;
}
.form-aside {
    position: sticky;
    top: 82px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.aside-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-xs);
}
.aside-panel h4 {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.aside-panel p {
    font-size: 12.5px;
    color: var(--text-soft);
}

/* Barre d'action collante en bas de formulaire */
.form-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin-top: 20px;
    padding: 14px 0;
    display: flex;
    gap: 10px;
    align-items: center;
    background: linear-gradient(to top, var(--bg) 62%, transparent);
}

/* En-tête identité (agent) */
.identity-head {
    display: flex;
    align-items: center;
    /* Sur `drh/agents/show`, un 3ᵉ enfant porte les boutons Retour/Modifier
       (`.identity-head__actions`, `margin-left:auto`) : avatar + nom +
       badges + ces boutons ne tiennent jamais sur une seule ligne non
       coupable sur un téléphone (boutons en `white-space:nowrap`) — sans
       `flex-wrap`, ça déborde purement et simplement. */
    flex-wrap: wrap;
    gap: 16px;
    padding: 18px 20px;
    margin-bottom: 18px;
    background: linear-gradient(
        120deg,
        var(--primary-soft),
        var(--surface) 70%
    );
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.identity-head .avatar {
    width: 52px;
    height: 52px;
    font-size: 17px;
    border-radius: 13px;
}
.identity-head__body {
    min-width: 0;
}
.identity-head h1 {
    font-size: 19px;
    font-weight: 720;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.identity-head__actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}
.identity-head .meta {
    color: var(--text-muted);
    font-size: 12.5px;
    margin-top: 2px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* --------------------------------------------------------------- alerts -- */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    margin-bottom: 18px;
    font-size: 13px;
    box-shadow: var(--shadow-xs);
}
.alert svg {
    margin-top: 1px;
}
.alert__body {
    flex: 1;
}
.alert__body ul {
    margin: 0;
    padding-left: 18px;
}
.alert--success {
    background: var(--success-soft);
    border-color: color-mix(in srgb, var(--success) 35%, transparent);
    color: var(--fg-on-soft-success);
}
.alert--danger {
    background: var(--danger-soft);
    border-color: color-mix(in srgb, var(--danger) 35%, transparent);
    color: var(--fg-on-soft-danger);
}
.alert--warning {
    background: var(--warning-soft);
    border-color: color-mix(in srgb, var(--warning) 35%, transparent);
    color: var(--fg-on-soft-warning);
}
.alert__close {
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
    opacity: 0.55;
    padding: 2px;
}
.alert__close:hover {
    opacity: 1;
}

/* --------------------------------------------------------------- filters - */

.filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.pill {
    padding: 7px 13px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-soft);
    cursor: pointer;
    transition: all 0.12s var(--ease);
}
.pill:hover {
    background: var(--surface-2);
    text-decoration: none;
    color: var(--text);
}
.pill.is-active {
    background: linear-gradient(180deg, var(--primary-600), var(--primary));
    border-color: transparent;
    color: #fff;
}

/* ---------------------------------------------------------- pagination --- */

.pager {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 18px;
    flex-wrap: wrap;
}
.pager a,
.pager span {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 600;
}
.pager a:hover {
    background: var(--surface-2);
    text-decoration: none;
}
.pager .is-active {
    background: var(--primary-600);
    border-color: transparent;
    color: #fff;
}
.pager .is-disabled {
    opacity: 0.4;
    pointer-events: none;
}
.pager__info {
    color: var(--text-muted);
    font-size: 12.5px;
    margin-left: auto;
}

/* --------------------------------------------------------------- modal --- */

.modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
}
.modal.is-open {
    display: block;
}
.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 17, 26, 0.48);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    animation: fade 0.18s var(--ease);
}
.modal__panel {
    position: relative;
    z-index: 1;
    width: min(560px, calc(100vw - 32px));
    max-height: calc(100vh - 64px);
    max-height: calc(100dvh - 64px);
    overflow-y: auto;
    margin: 44px auto;
    background: var(--surface);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    animation: pop 0.2s var(--ease);
}
.modal__panel--sm {
    width: min(420px, calc(100vw - 32px));
}
.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 17px 22px;
    border-bottom: 1px solid var(--border);
}
.modal__header h2 {
    font-size: 15.5px;
    font-weight: 680;
}
.modal__body {
    padding: 22px;
}
.modal__footer {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px 22px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
}

/* --------------------------------------- import Excel — barre de progression -- */
.import-progress {
    padding: 6px 0 2px;
}
.import-progress__bar {
    height: 10px;
    border-radius: 999px;
    background: var(--surface-3);
    overflow: hidden;
}
.import-progress__fill {
    height: 100%;
    width: 0%;
    background: var(--success);
    border-radius: 999px;
    transition: width 0.25s var(--ease);
}
.import-progress__label {
    margin: 10px 0 0;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}
.import-progress__label--error {
    color: var(--danger);
}
@keyframes fade {
    from {
        opacity: 0;
    }
}
@keyframes pop {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
    }
}

/* ------------------------------------------------------------- utility --- */

.stack-sm > * + * {
    margin-top: 10px;
}
.text-muted {
    color: var(--text-muted);
}
.text-danger {
    color: var(--danger);
}
.mt-0 {
    margin-top: 0;
}
.list-flush {
    list-style: none;
    padding: 0;
    margin: 0;
}
.list-flush li {
    padding: 13px 20px;
    border-bottom: 1px solid var(--border);
}
.list-flush li:last-child {
    border-bottom: 0;
}
.timeline-item b {
    font-size: 12.5px;
}
.timeline-item small {
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}
.row-error td {
    background: var(--danger-soft) !important;
}

/* --------------------------------------------------------------- login --- */

.auth {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    background: var(--surface);
}
.auth__aside {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(
            900px 500px at 50% 8%,
            rgba(255, 255, 255, 0.13),
            transparent 55%
        ),
        linear-gradient(155deg, #1a8f3d, #0f6128 52%, #0a3d1c);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding: 44px;
    text-align: center;
}
.auth__aside small {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 22px;
    padding: 0 32px;
}
.auth__aside::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 6px;
    background: linear-gradient(
        90deg,
        var(--primary) 33%,
        #efb700 33% 66%,
        var(--brand-red) 66%
    );
}
.auth__aside::after {
    content: "";
    position: absolute;
    right: -120px;
    bottom: -120px;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
}
.auth__lockup {
    display: inline-flex;
    padding: 22px 26px;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 24px 56px -18px rgba(0, 0, 0, 0.42);
}
.auth__lockup img {
    width: 190px;
    height: auto;
    display: block;
}
.auth__pitch h2 {
    font-size: 23px;
    font-weight: 740;
    line-height: 1.3;
    letter-spacing: -0.02em;
}
.auth__pitch p {
    color: rgba(255, 255, 255, 0.74);
    margin: 10px auto 0;
    font-size: 13.5px;
    max-width: 36ch;
}
.auth__aside small {
    color: rgba(255, 255, 255, 0.55);
    font-size: 11.5px;
}

.auth__main {
    display: grid;
    place-items: center;
    padding: 40px 24px;
}
.auth__card {
    width: min(380px, 100%);
}
.auth__card h1 {
    font-size: 21px;
    font-weight: 740;
}
.auth__card > p {
    color: var(--text-muted);
    font-size: 13px;
    margin: 4px 0 24px;
}
.auth__demo {
    margin-top: 18px;
    padding: 11px 13px;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px dashed var(--border-strong);
    font-size: 12px;
    color: var(--text-soft);
    text-align: center;
}
.auth__demo code {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 1px 6px;
    font-size: 11.5px;
}
.error-card__code {
    font-size: 64px;
    font-weight: 800;
    line-height: 1;
    color: var(--primary);
    margin: 0 0 6px;
}
.error-card__cta {
    width: 100%;
    justify-content: center;
    margin-top: 22px;
}

/* ----------------------------------------------------------- filter panel - */

/* Filtres structurés d'un en-tête de liste (drh.agents.index), déclenchés par
   un bouton dans la même barre qu'Excel/PDF/Importer (`[data-filters-toggle]`,
   app.js) — pas un `<details>` séparé avec sa propre icône, pour rester
   cohérent avec les autres actions de la page. `repeat(auto-fit, minmax(...))`
   aligne naturellement 3-4 champs par ligne sur desktop, moins sur un écran
   étroit, sans point de rupture à maintenir à la main. Visible par défaut
   (`<noscript>` dans la vue) : sans JS, le panneau reste utilisable, seul le
   bouton de bascule perd son utilité. */
.filter-panel {
    margin-top: 10px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px 14px;
    animation: fade 0.14s var(--ease);
}
/* `display: grid` ci-dessus est une règle d'auteur : elle l'emporte toujours
   sur `[hidden] { display: none }` du navigateur, quelle que soit la
   spécificité — sans cette surcharge explicite, l'attribut `hidden` (basculé
   par [data-filters-toggle], app.js) n'a visuellement aucun effet et le
   panneau reste affiché en permanence. */
.filter-panel[hidden] {
    display: none;
}
.filter-panel__actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 2px;
}
.filter-panel__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--primary-600);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
}

/* ------------------------------------------------------------ responsive - */

@media (max-width: 1100px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .form-2col {
        grid-template-columns: 1fr;
    }
    .form-aside {
        position: static;
    }
}
@media (max-width: 960px) {
    .auth {
        grid-template-columns: 1fr;
    }
    .auth__aside {
        display: none;
    }
    .layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: 256px;
        z-index: 95;
        transform: translateX(-100%);
        transition: transform 0.24s var(--ease);
        box-shadow: var(--shadow-lg);
    }
    .sidebar.is-open {
        transform: none;
    }
    .hamburger {
        display: inline-flex;
    }
    .scrim.is-open {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 17, 26, 0.45);
        z-index: 90;
    }
}
@media (max-width: 640px) {
    .content {
        padding: 18px;
    }
    .topbar {
        padding: 12px 18px;
    }
    .stat-grid {
        grid-template-columns: 1fr;
    }
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
    .detail {
        grid-template-columns: 1fr;
        gap: 2px 0;
    }
    .detail dt {
        margin-top: 8px;
    }

    /* Recherche rapide d'agent du topbar → icône seule (voir layouts/drh.blade.php) :
       le champ texte pleine largeur n'a pas la place à côté de la cloche et
       du thème sur un téléphone. */
    .topbar-search {
        display: none;
    }
    .topbar-search-mobile {
        display: inline-grid;
    }

    /* Champs de recherche/filtre d'en-tête de page (agents, affectations,
       avancements, documents, journaux d'audit) : les `max-width` fixes en
       ligne visent un confort de lecture en desktop, pas un plafond utile
       sur un écran déjà plus étroit qu'eux — sur mobile ils gardent
       simplement chacun leur ligne (permise par `.page-head { flex-wrap }`)
       pleine largeur, plus lisible et plus facile à toucher.               */
    .page-head .input,
    .page-head .select {
        max-width: none !important;
        flex: 1 1 auto;
    }

    /* Cibles tactiles : les icônes d'action de tableau (32px) et les liens
       de pagination (34px) sont sous les ~40-44px recommandés pour un doigt
       — agrandis uniquement sur téléphone, la densité desktop ne change pas. */
    .icon-btn {
        width: 38px;
        height: 38px;
    }
    .pager a,
    .pager span {
        min-width: 40px;
        height: 40px;
    }
}
