/*
 * Argaschool — variante de démonstration anthracite.
 * Les variables sont déclarées dans la même feuille que leurs alias afin
 * qu'un chargement partiel des ressources ne puisse jamais casser le rendu.
 */
:root {
    --ui-color-scheme: dark;
    color-scheme: var(--ui-color-scheme);

    --ui-color-brand: #15191b;
    --ui-color-brand-soft: #20272a;
    --ui-color-primary: #6d9f9d;
    --ui-color-primary-hover: #82b4b1;
    --ui-color-primary-soft: #304240;
    --ui-color-primary-subtle: #293735;

    --ui-color-canvas: #191d1f;
    --ui-color-surface: #252a2d;
    --ui-color-surface-soft: #2b3033;
    --ui-color-surface-subtle: #202426;
    --ui-color-surface-muted: #32383b;

    --ui-color-text: #f0ede6;
    --ui-color-text-strong: #fffaf2;
    --ui-color-text-soft: #d0cbc1;
    --ui-color-text-muted: #a9a49b;
    --ui-color-text-on-brand: #f7f3eb;
    --ui-color-text-on-brand-muted: #bfcac7;
    --ui-color-border: #3d4548;
    --ui-color-border-strong: #566064;

    --ui-color-danger: #d4747d;
    --ui-color-danger-soft: #3b282c;
    --ui-color-success: #79b88d;
    --ui-color-success-soft: #24382b;
    --ui-color-warning: #d5a85e;
    --ui-color-warning-soft: #3c3222;
    --ui-focus-ring: rgba(130, 180, 177, 0.28);

    --ui-shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.28);
    --ui-shadow-default: 0 12px 34px rgba(0, 0, 0, 0.38);
    --ui-radius-small: 9px;
    --ui-radius-control: 10px;
    --ui-radius-card: 18px;
    --ui-control-height: 42px;
    --ui-transition-fast: 120ms ease;
    --ui-transition-default: 180ms ease;

    /* Boutons et liens communs */
    --ui-button-primary-background: #3f7778;
    --ui-button-primary-border: #3f7778;
    --ui-button-primary-text: var(--ui-color-text-on-brand);
    --ui-button-primary-hover-background: #386a6b;
    --ui-button-secondary-background: var(--ui-color-primary-subtle);
    --ui-button-secondary-border: var(--ui-color-border-strong);
    --ui-button-secondary-text: var(--ui-color-primary-hover);
    --ui-button-quiet-text: var(--ui-color-primary-hover);
    --ui-button-danger-background: #9b4652;
    --ui-button-danger-border: #9b4652;
    --ui-button-danger-text: var(--ui-color-text-on-brand);
    --ui-button-danger-hover-background: #873d47;
    --ui-button-transition: 140ms ease;
    --ui-link-color: var(--ui-color-primary-hover);
    --ui-link-hover-color: var(--ui-color-primary);

    /* Champs et contrôles de formulaire communs */
    --ui-form-control-background: var(--ui-color-surface-soft);
    --ui-form-control-border: var(--ui-color-border-strong);
    --ui-form-control-text: var(--ui-color-text);
    --ui-form-placeholder: #8f999a;
    --ui-form-disabled-background: var(--ui-color-surface-muted);
    --ui-form-disabled-text: var(--ui-color-text-muted);
    --ui-form-control-transition: 150ms ease;
    --ui-form-choice-size: 18px;
    --ui-form-file-button-height: 32px;
    --ui-form-file-button-radius: 8px;

    /* Cartes communes */
    --ui-card-background: var(--ui-color-surface);
    --ui-card-border: var(--ui-color-border);
    --ui-card-radius: var(--ui-radius-card);
    --ui-card-shadow: var(--ui-shadow-soft);

    /* Tableaux communs */
    --ui-table-background: var(--ui-color-surface);
    --ui-table-border: var(--ui-color-border);
    --ui-table-header-background: var(--ui-color-surface-muted);
    --ui-table-header-text: var(--ui-color-text-soft);
    --ui-table-row-alt-background: var(--ui-color-surface-soft);
    --ui-table-row-hover-background: #333d3d;
    --ui-table-radius: 13px;

    /* Fenêtres modales communes */
    --ui-modal-backdrop: rgba(5, 8, 9, 0.76);
    --ui-modal-background: var(--ui-color-surface);
    --ui-modal-border: #4a5357;
    --ui-modal-radius: 20px;
    --ui-modal-shadow: 0 28px 70px rgba(0, 0, 0, 0.5);

    /* Compatibilité visuelle des anciens formulaires */
    --ui-legacy-button-background: #303638;
    --ui-legacy-button-background-soft: #3a4245;
    --ui-legacy-button-text: #f0ede6;
    --ui-legacy-button-radius: 5px;
    --ui-legacy-field-background: #2b3033;
    --ui-legacy-field-border: #566064;
    --ui-legacy-field-text: #f0ede6;
    --ui-legacy-field-radius: 3px;
    --ui-legacy-field-shadow: 2px 2px 2px 0 rgba(0, 0, 0, 0.32) inset;
    --ui-legacy-field-text-shadow: none;
    --ui-legacy-field-transition: 200ms cubic-bezier(0.42, 0, 0.58, 1);
}

body.app-shell,
body.login-shell {
    /* Alias de compatibilité : les composants existants gardent leurs noms
       actuels tandis que leurs valeurs proviennent du socle commun. */
    --shell-navy: var(--ui-color-brand);
    --shell-navy-soft: var(--ui-color-brand-soft);
    --shell-teal: var(--ui-color-primary);
    --shell-teal-dark: var(--ui-color-primary-hover);
    --shell-mint: var(--ui-color-primary-soft);
    --shell-mint-soft: var(--ui-color-primary-subtle);
    --shell-canvas: var(--ui-color-canvas);
    --shell-surface: var(--ui-color-surface);
    --shell-surface-soft: var(--ui-color-surface-soft);
    --shell-surface-muted: var(--ui-color-surface-muted);
    --shell-line: var(--ui-color-border);
    --shell-line-strong: var(--ui-color-border-strong);
    --shell-text: var(--ui-color-text);
    --shell-text-soft: var(--ui-color-text-soft);
    --shell-muted: var(--ui-color-text-muted);
    --shell-danger: var(--ui-color-danger);
    --shell-danger-soft: var(--ui-color-danger-soft);
    --shell-success: var(--ui-color-success);
    --shell-success-soft: var(--ui-color-success-soft);
    --shell-warning: var(--ui-color-warning);
    --shell-warning-soft: var(--ui-color-warning-soft);
    --shell-focus: var(--ui-focus-ring);
    --shell-shadow-soft: var(--ui-shadow-soft);
    --shell-shadow: var(--ui-shadow-default);
    --shell-page-max: min(100%, max(1180px, 78vw));
    --shell-wide-page-max: min(100%, max(1280px, 82vw));
    --shell-tool-max: min(100%, max(1120px, 78vw));
    --hb_color: var(--shell-navy);
    --gd_color: var(--shell-surface);
    --centre_color: var(--shell-canvas);
    --text_color: var(--shell-text);
    --hb_text_color: var(--ui-color-text-on-brand-muted);
    min-height: 100%;
    background: var(--shell-canvas);
    color: var(--shell-text);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Quand les deux panneaux latéraux sont repliés, le contenu de premier niveau
   utilise toute la largeur du centre. Le padding de #centre conserve une marge
   confortable avec les bords de la fenêtre. */
body.app-shell.is-menu-collapsed.is-situation-collapsed {
    --shell-page-max: 100%;
    --shell-wide-page-max: 100%;
    --shell-tool-max: 100%;
}

body.app-shell *,
body.login-shell * {
    box-sizing: border-box;
    color: inherit;
    font-family: inherit;
}

body.app-shell button,
body.login-shell button,
body.app-shell input,
body.login-shell input,
body.app-shell select,
body.login-shell select,
body.app-shell textarea,
body.login-shell textarea {
    font: inherit;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.topbar {
    flex: 0 0 84px;
    width: 100%;
    min-height: 84px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 22px;
    margin: 0;
    background: linear-gradient(115deg, var(--shell-navy), #1d3641 72%, #244751);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(12, 28, 34, 0.18);
    color: #f5fbfb;
    z-index: 1000;
}

body.app-shell.is-maintenance .topbar {
    background: linear-gradient(115deg, #7e2731, #a33d48 72%, #6e242d);
}

.brand-area,
.topbar-actions,
.brand,
.user-button {
    display: flex;
    align-items: center;
}

.brand-area {
    min-width: 0;
    gap: 12px;
}

.brand {
    gap: 12px;
    min-width: 0;
    text-decoration: none;
    color: #f5fbfb;
}

.topbar .brand img {
    width: 54px;
    height: 54px;
    object-fit: contain;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.brand span {
    display: grid;
    gap: 1px;
}

.brand strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.55rem;
    line-height: 1;
    letter-spacing: -0.02em;
    color: #b7dadd;
}

.brand small,
.user-identity small {
    font-size: 0.73rem;
    letter-spacing: 0.06em;
    color: rgba(235, 247, 247, 0.66);
}

.topbar-actions {
    justify-content: flex-end;
    gap: 8px;
}

.topbar .icon-button,
.topbar .user-button {
    position: relative;
    border: 1px solid transparent;
    background: transparent;
    box-shadow: none;
    text-shadow: none;
    color: #edf7f6;
    cursor: pointer;
    margin: 0;
    padding: 0;
    top: auto;
}

.topbar .icon-button {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    text-decoration: none;
}

.topbar .icon-button:hover,
.topbar .icon-button:focus-visible,
.topbar .user-button:hover,
.topbar .user-button:focus-visible {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.14);
    outline: none;
    color: var(--ui-color-text-on-brand);
}

.menu-toggle span {
    font-size: 1.65rem;
    line-height: 1;
}

.topbar .icon-button img,
.topbar .logout-button img,
.topbar #bell {
    width: 23px;
    height: 23px;
    object-fit: contain;
    border: 0;
    border-radius: 0;
}

.notification-area {
    position: relative;
}

body.app-shell #notifs {
    top: 52px;
    right: 0;
    width: min(340px, calc(100vw - 32px));
    padding: 16px;
    border: 1px solid var(--shell-line);
    border-radius: 14px;
    background: var(--shell-surface);
    box-shadow: var(--shell-shadow);
    color: var(--shell-text);
}

.topbar .user-button {
    gap: 10px;
    padding: 5px 7px 5px 12px;
    border-radius: 14px;
}

.user-identity {
    display: grid;
    gap: 1px;
    text-align: right;
}

.user-identity strong {
    color: #f7fbfb;
    font-size: 0.92rem;
    font-weight: 650;
}

.topbar .user-button > img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border: 2px solid rgba(185, 220, 221, 0.65);
    border-radius: 50%;
}

body.app-shell conteneur {
    flex: 1 1 auto;
    min-height: 0;
    height: calc(100dvh - 116px);
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: stretch;
    overflow: hidden;
    background: var(--shell-canvas);
}

body.app-shell #menu,
body.app-shell #situation {
    display: block;
    flex: 0 0 278px;
    width: 278px;
    min-width: 0;
    height: 100%;
    padding: 22px 16px;
    overflow-y: auto;
    background: var(--shell-surface);
    color: var(--shell-text);
    scrollbar-width: thin;
    scrollbar-color: #bdcfcd transparent;
}

body.app-shell #menu {
    border-right: 1px solid var(--shell-line);
}

body.app-shell #situation {
    flex-basis: 294px;
    width: 294px;
    border-left: 1px solid var(--shell-line);
}

.sidebar-heading {
    padding: 2px 8px 16px;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 5px;
    color: var(--shell-teal-dark);
    font-size: 0.7rem;
    font-weight: 750;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

body.app-shell .sidebar-heading h2,
body.app-shell #menu h2,
body.app-shell #situation h2 {
    margin: 0;
    padding: 0;
    color: var(--shell-text);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.55rem;
    font-weight: 700;
    text-align: left;
    text-decoration: none;
}

.deroulant {
    border-top: 1px solid var(--shell-line);
    padding: 7px 0;
}

.deroulant:last-child {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--shell-line);
}

body.app-shell .menu-section-toggle,
body.app-shell .menu-link {
    width: 100%;
    display: flex;
    align-items: center;
    border: 0;
    box-shadow: none;
    text-shadow: none;
    cursor: pointer;
    position: static;
    top: auto;
}

body.app-shell .menu-section-toggle {
    justify-content: flex-start;
    gap: 10px;
    min-height: 48px;
    margin: 0;
    padding: 7px 8px;
    border-radius: 11px;
    background: transparent;
    color: var(--shell-text);
    font-weight: 720;
    text-align: left;
}

body.app-shell .menu-section-toggle:hover,
body.app-shell .menu-section-toggle:focus-visible,
body.app-shell .menu-section-toggle[aria-expanded="true"] {
    background: var(--shell-mint-soft);
    color: var(--shell-teal-dark);
    outline: none;
}

.menu-section-icon {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--shell-mint);
    color: var(--shell-teal-dark);
    font-size: 0.78rem;
    font-weight: 800;
}

.menu-section-label {
    flex: 1;
}

.menu-chevron {
    font-size: 1.15rem;
    transition: transform 180ms ease;
}

.menu-section-toggle[aria-expanded="true"] .menu-chevron {
    transform: rotate(180deg);
}

body.app-shell .sous {
    display: none;
    padding: 3px 4px 8px 48px;
    text-align: left;
}

body.app-shell .menu-link {
    justify-content: space-between;
    gap: 10px;
    min-height: 36px;
    margin: 2px 0;
    padding: 7px 8px;
    border-radius: 8px;
    background: transparent;
    color: var(--shell-muted);
    font-size: 0.86rem;
    text-align: left;
}

body.app-shell .menu-link:hover,
body.app-shell .menu-link:focus-visible {
    background: var(--ui-color-surface-muted);
    color: var(--ui-color-primary-hover);
    outline: none;
}

.menu-empty {
    padding: 8px;
    color: var(--shell-muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

body.app-shell #centre {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    height: 100%;
    padding: 30px clamp(20px, 3vw, 48px) 42px;
    overflow: auto;
    background:
        radial-gradient(circle at 92% 5%, rgba(47, 126, 131, 0.09), transparent 25%),
        var(--shell-canvas);
    color: var(--shell-text);
}

.welcome {
    max-width: var(--shell-page-max);
    min-height: 126px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 0 auto 24px;
    padding: 24px 28px;
    overflow: hidden;
    border: 1px solid var(--ui-color-border-strong);
    border-radius: 20px;
    background: linear-gradient(
        125deg,
        var(--ui-color-surface) 0%,
        var(--ui-color-surface-soft) 68%,
        color-mix(in srgb, var(--ui-color-primary) 14%, var(--ui-color-surface-soft)) 100%
    );
    box-shadow: var(--ui-shadow-soft);
}

.welcome h1 {
    margin: 0 0 7px;
    color: var(--shell-text);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.65rem, 2.3vw, 2.25rem);
    line-height: 1.08;
    text-align: left;
}

.welcome p {
    color: var(--shell-muted);
    line-height: 1.45;
}

.topbar-update { position: relative; }

.topbar-update > summary {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border: 1px solid color-mix(in srgb, #d18a27 45%, var(--shell-line));
    border-radius: 11px;
    background: color-mix(in srgb, #d18a27 10%, transparent);
    color: color-mix(in srgb, #d18a27 64%, var(--topbar-text));
    font-size: 0.78rem;
    font-weight: 760;
    cursor: pointer;
    list-style: none;
}

.topbar-update > summary::-webkit-details-marker { display: none; }

.topbar-update > summary:hover,
.topbar-update > summary:focus-visible,
.topbar-update[open] > summary {
    border-color: #d18a27;
    background: color-mix(in srgb, #d18a27 18%, transparent);
    outline: none;
}

.topbar-update-icon {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: color-mix(in srgb, #d18a27 24%, transparent);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.9rem;
    font-weight: 800;
}

.topbar-update-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 1200;
    width: min(410px, calc(100vw - 28px));
    padding: 17px;
    box-sizing: border-box;
    border: 1px solid color-mix(in srgb, #d18a27 46%, var(--shell-line));
    border-top: 4px solid #d18a27;
    border-radius: 14px;
    background: var(--shell-surface);
    box-shadow: 0 16px 38px rgba(10, 22, 28, 0.24);
    color: var(--shell-text);
}

.topbar-update-panel strong {
    display: block;
    margin-bottom: 7px;
    line-height: 1.35;
}

.topbar-update-panel p {
    margin: 0 0 14px;
    color: var(--shell-muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

body.app-shell .topbar-update-support {
    min-height: 38px;
    margin: 0;
    padding: 8px 13px;
    border: 1px solid color-mix(in srgb, #d18a27 62%, var(--shell-line));
    border-radius: 9px;
    background: color-mix(in srgb, #d18a27 18%, var(--shell-surface));
    color: color-mix(in srgb, #d18a27 76%, var(--shell-text));
    font-weight: 760;
}

body.app-shell .topbar-update-support:hover,
body.app-shell .topbar-update-support:focus-visible {
    border-color: #d18a27;
    background: color-mix(in srgb, #d18a27 28%, var(--shell-surface));
    outline: none;
}

body.app-shell #accueil {
    width: 100%;
    max-width: var(--shell-page-max);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
    gap: 17px;
    justify-content: stretch;
    margin: 0 auto;
}

body.app-shell .module-browser {
    width: 100%;
    max-width: var(--shell-page-max);
    display: grid;
    gap: 12px;
    margin: 0 auto;
}

body.app-shell .module-search {
    width: 100%;
    min-height: 44px;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 0 13px;
    border: 1px solid var(--shell-line);
    border-radius: 15px;
    background: var(--shell-surface);
    box-shadow: 0 4px 14px rgba(23, 42, 51, 0.04);
    color: var(--shell-muted);
}

body.app-shell .module-search:focus-within {
    border-color: var(--shell-teal);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--shell-teal) 18%, transparent);
}

body.app-shell .module-search-icon {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
}

body.app-shell .module-search-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.8;
}

body.app-shell .module-search input {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--shell-text);
    font: inherit;
}

body.app-shell .module-search input::placeholder { color: var(--shell-muted); }

body.app-shell .module-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

body.app-shell #centre .module-browser .module-filters button.module-filter {
    min-height: 40px;
    padding: 8px 15px;
    border: 1px solid color-mix(in srgb, var(--module-category, var(--shell-teal)) 56%, var(--shell-line));
    border-radius: 11px;
    background: color-mix(in srgb, var(--module-category, var(--shell-teal)) 10%, var(--shell-surface));
    color: color-mix(in srgb, var(--module-category, var(--shell-teal)) 72%, var(--shell-text));
    box-shadow: none;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 750;
    text-shadow: none;
    cursor: pointer;
}

body.app-shell #centre .module-browser .module-filters button.module-filter:hover,
body.app-shell #centre .module-browser .module-filters button.module-filter:focus-visible {
    border-color: var(--module-category, var(--shell-teal));
    background: color-mix(in srgb, var(--module-category, var(--shell-teal)) 18%, var(--shell-surface));
    color: color-mix(in srgb, var(--module-category, var(--shell-teal)) 78%, var(--shell-text));
    outline: none;
}

body.app-shell #centre .module-browser .module-filters button.module-filter.is-active {
    border-color: var(--module-category, var(--shell-teal));
    background: color-mix(in srgb, var(--module-category, var(--shell-teal)) 23%, var(--shell-surface));
    color: color-mix(in srgb, var(--module-category, var(--shell-teal)) 82%, var(--shell-text));
    box-shadow:
        0 0 0 2px color-mix(in srgb, var(--module-category, var(--shell-teal)) 18%, transparent),
        0 3px 9px color-mix(in srgb, var(--module-category, var(--shell-teal)) 15%, transparent);
}

:root[data-theme="anthracite"] body.app-shell #centre .module-browser .module-filters button.module-filter {
    background: color-mix(in srgb, var(--module-category, var(--shell-teal)) 14%, var(--shell-surface));
    color: color-mix(in srgb, var(--module-category, var(--shell-teal)) 62%, #fff);
}

:root[data-theme="anthracite"] body.app-shell #centre .module-browser .module-filters button.module-filter:hover,
:root[data-theme="anthracite"] body.app-shell #centre .module-browser .module-filters button.module-filter:focus-visible {
    background: color-mix(in srgb, var(--module-category, var(--shell-teal)) 22%, var(--shell-surface));
    color: color-mix(in srgb, var(--module-category, var(--shell-teal)) 70%, #fff);
}

:root[data-theme="anthracite"] body.app-shell #centre .module-browser .module-filters button.module-filter.is-active {
    background: color-mix(in srgb, var(--module-category, var(--shell-teal)) 28%, var(--shell-surface));
    color: color-mix(in srgb, var(--module-category, var(--shell-teal)) 74%, #fff);
}

body.app-shell .module-browser-empty {
    margin: 8px 0;
    padding: 22px;
    border: 1px dashed var(--shell-line);
    border-radius: 15px;
    color: var(--shell-muted);
    text-align: center;
}

body.app-shell #accueil [data-module-card][hidden],
body.app-shell .module-browser-empty[hidden] {
    display: none;
}

body.app-shell #accueil .module {
    width: 100%;
    min-width: 0;
    min-height: 178px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    gap: 10px;
    position: static;
    top: auto;
    margin: 0;
    padding: 13px;
    border: 1px solid var(--shell-line);
    border-top: 4px solid var(--module-category, var(--shell-teal));
    border-radius: 17px;
    background: var(--shell-surface);
    box-shadow: 0 6px 18px rgba(23, 42, 51, 0.05);
    color: var(--shell-text);
    text-shadow: none;
    text-align: left;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

body.app-shell #accueil .module:hover,
body.app-shell #accueil .module:focus-visible {
    transform: translateY(-3px);
    border-color: #a9cecd;
    box-shadow: 0 14px 30px rgba(23, 42, 51, 0.11);
    outline: none;
}

.module-icon {
    min-height: 94px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: linear-gradient(
        145deg,
        color-mix(in srgb, var(--module-category, var(--shell-teal)) 10%, var(--shell-surface)),
        color-mix(in srgb, var(--module-category, var(--shell-teal)) 24%, var(--shell-surface))
    );
}

:root[data-theme="anthracite"] body.app-shell #accueil .module-icon {
    border: 1px solid color-mix(in srgb, var(--module-category, var(--shell-teal)) 42%, var(--shell-line));
    background: linear-gradient(
        145deg,
        color-mix(in srgb, var(--module-category, var(--shell-teal)) 24%, #a9c8c5),
        color-mix(in srgb, var(--module-category, var(--shell-teal)) 45%, #779f9c)
    );
}

body.app-shell #accueil .module img {
    max-width: 70px;
    max-height: 70px;
    object-fit: contain;
    filter: contrast(0.88);
    transition: transform 180ms ease;
}

:root[data-theme="anthracite"] body.app-shell #accueil .module img {
    filter: contrast(1.08);
}

body.app-shell #accueil .module:hover img {
    transform: scale(1.06);
}

.module-name {
    padding: 0 2px;
    font-size: 0.96rem;
    font-weight: 750;
    line-height: 1.25;
}

.module-action {
    display: flex;
    justify-content: space-between;
    padding: 0 2px;
    color: var(--shell-teal-dark);
    font-size: 0.76rem;
    font-weight: 700;
}

.situation-list {
    display: grid;
    gap: 0;
    margin: 0;
}

.situation-item {
    display: grid;
    gap: 5px;
    padding: 15px 8px;
    border-top: 1px solid var(--shell-line);
}

.situation-item:last-child {
    border-bottom: 1px solid var(--shell-line);
}

.situation-item dt {
    color: var(--shell-muted);
    font-size: 0.71rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.situation-item dd {
    margin: 0;
    color: var(--shell-text);
    font-size: 0.91rem;
    font-weight: 650;
    line-height: 1.4;
}

.empty-state {
    max-width: 620px;
    margin: 40px auto;
    padding: 30px;
    border: 1px dashed var(--ui-color-border-strong);
    border-radius: 18px;
    background: var(--ui-color-surface-soft);
    color: var(--ui-color-text-muted);
    text-align: center;
}

.empty-state p {
    margin-top: 7px;
    color: var(--shell-muted);
}

.page-card {
    width: 100%;
    padding: clamp(22px, 4vw, 36px);
    border: 1px solid var(--shell-line);
    border-radius: 18px;
    background: var(--shell-surface);
    box-shadow: 0 9px 25px rgba(23, 42, 51, 0.06);
}

.narrow-card {
    max-width: 720px !important;
}

.page-card h2 {
    margin: 0 0 8px;
    padding: 0 !important;
    text-align: left !important;
}

.page-intro {
    margin-bottom: 24px;
    color: var(--shell-muted);
    line-height: 1.55;
}

.page-card label,
.page-card small {
    display: block;
}

.page-card label {
    margin-top: 15px;
    font-size: 0.82rem;
    font-weight: 750;
}

.page-card small {
    margin: -4px auto 16px;
    width: 80%;
    max-width: 720px;
    color: var(--shell-muted);
    text-align: left;
}

body.app-shell #centre > div:not(#accueil):not(.error):not(.info):not(.jBox-wrapper),
body.app-shell #centre > form {
    max-width: var(--shell-page-max);
    margin-left: auto;
    margin-right: auto;
}

body.app-shell #centre h2 {
    color: var(--shell-text);
    font-family: Georgia, "Times New Roman", serif;
}

body.app-shell #centre input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]),
body.app-shell #centre select,
body.app-shell #centre textarea,
body.login-shell input:not([type="submit"]) {
    max-width: 720px;
    border: 1px solid var(--shell-line-strong);
    border-radius: var(--ui-radius-control);
    background: var(--ui-color-surface);
    box-shadow: 0 1px 2px rgba(23, 42, 51, 0.04);
    color: var(--shell-text);
    text-shadow: none;
}

body.app-shell #centre input:focus,
body.app-shell #centre select:focus,
body.app-shell #centre textarea:focus,
body.login-shell input:focus {
    border-color: var(--shell-teal);
    box-shadow: 0 0 0 3px var(--shell-focus);
    outline: none;
}

body.app-shell #centre .module-browser label.module-search input[type="search"] {
    width: 100% !important;
    max-width: none !important;
    min-height: 42px !important;
    height: 42px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-sizing: border-box !important;
    appearance: none;
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

body.app-shell #centre .module-browser label.module-search input[type="search"]:focus {
    border: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}

body.app-shell #centre input[type="submit"],
body.app-shell #centre button:not(.module):not(.tox *) {
    border: 1px solid var(--ui-button-primary-border);
    border-radius: var(--ui-radius-control);
    background: var(--ui-button-primary-background);
    box-shadow: none;
    color: var(--ui-button-primary-text);
    text-shadow: none;
}

body.app-shell #centre input[type="submit"]:hover,
body.app-shell #centre button:not(.module):not(.tox *):hover {
    background: var(--ui-button-primary-hover-background);
    color: var(--ui-button-primary-text);
}

body.app-shell #centre table {
    overflow: hidden;
    border: 1px solid var(--shell-line);
    border-radius: 12px;
    background: var(--ui-color-surface);
}

body.app-shell #centre thead tr,
body.app-shell #centre tfoot tr {
    background: var(--ui-table-header-background);
    color: var(--ui-table-header-text);
}

body.app-shell #foot,
body.login-shell #foot {
    flex: 0 0 32px;
    width: 100%;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--shell-navy);
    color: rgba(235, 247, 247, 0.72);
    font-size: 0.75rem;
}

body.app-shell #foot a,
body.login-shell #foot a {
    color: inherit;
}

body.login-shell {
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 15% 18%, rgba(47, 126, 131, 0.15), transparent 28%),
        radial-gradient(circle at 85% 76%, rgba(47, 126, 131, 0.12), transparent 25%),
        var(--shell-canvas);
}

.login-topbar {
    justify-content: center;
    box-shadow: none;
}

body.login-shell .login-layout {
    flex: 1 1 auto;
    width: 100%;
    height: auto;
    min-height: 0;
    display: grid;
    place-items: center;
    padding: 38px 20px;
}

body.login-shell .login-layout > .core-page {
    align-self: start;
}

.login-card {
    width: min(460px, 100%);
    margin: 0;
    padding: clamp(28px, 5vw, 44px);
    border: 1px solid var(--shell-line);
    border-radius: 22px;
    background: var(--ui-card-background);
    box-shadow: var(--shell-shadow);
    text-align: left;
}

.login-card h1 {
    margin: 0 0 10px;
    color: var(--shell-text);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.75rem, 5vw, 2.2rem);
    line-height: 1.12;
    text-align: left;
}

.login-card p {
    margin: 0 0 25px;
    color: var(--shell-muted);
    line-height: 1.5;
}

.login-card label {
    display: block;
    margin: 16px 0 6px;
    color: var(--shell-text);
    font-size: 0.82rem;
    font-weight: 720;
}

body.login-shell .login-card input:not([type="submit"]) {
    width: 100%;
    margin: 0;
    padding: 13px 14px;
    box-sizing: border-box;
}

body.login-shell .login-card input[type="submit"] {
    width: 100%;
    margin: 24px 0 0;
    padding: 13px 18px;
    border: 1px solid var(--ui-button-primary-border);
    border-radius: 10px;
    background: var(--ui-button-primary-background);
    box-shadow: none;
    color: var(--ui-button-primary-text);
    text-shadow: none;
    font-weight: 750;
}

body.login-shell .login-card input[type="submit"]:hover {
    background: var(--ui-button-primary-hover-background);
}

body.login-shell .error {
    top: 96px;
    width: min(560px, calc(100% - 32px));
    margin: 0 auto;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--ui-button-danger-background);
    color: var(--ui-button-danger-text);
    font-size: 0.95rem;
}

@media (max-width: 1220px) {
    body.app-shell #situation {
        display: none;
        position: fixed;
        top: 84px;
        right: 0;
        bottom: 32px;
        z-index: 900;
        height: auto;
        box-shadow: -18px 0 38px rgba(23, 42, 51, 0.16);
    }
}

@media (max-width: 880px) {
    .topbar {
        padding: 0 12px;
    }

    .brand small,
    .user-identity {
        display: none;
    }

    .brand strong {
        font-size: 1.25rem;
    }

    .brand img {
        width: 45px;
        height: 45px;
    }

    .topbar-update-label {
        display: none;
    }

    .topbar-update > summary {
        width: 38px;
        min-height: 38px;
        justify-content: center;
        padding: 0;
    }

    body.app-shell #menu {
        display: none;
        position: fixed;
        top: 84px;
        left: 0;
        bottom: 32px;
        z-index: 900;
        height: auto;
        box-shadow: 18px 0 38px rgba(23, 42, 51, 0.16);
    }

    body.app-shell #centre {
        padding: 20px 14px 32px;
    }

    .welcome {
        min-height: 0;
        padding: 20px;
    }

}

@media (max-width: 560px) {
    .topbar {
        flex-basis: 74px;
        min-height: 74px;
        gap: 8px;
    }

    .brand strong {
        display: none;
    }

    .topbar-actions {
        gap: 2px;
    }

    .topbar .icon-button {
        width: 38px;
        height: 38px;
    }

    .topbar .user-button {
        padding: 3px;
    }

    .topbar .user-button > img {
        width: 38px;
        height: 38px;
    }

    .topbar-update-panel {
        position: fixed;
        top: 68px;
        right: 10px;
        width: calc(100vw - 20px);
    }

    body.app-shell conteneur {
        height: calc(100dvh - 106px);
    }

    body.app-shell #menu,
    body.app-shell #situation {
        top: 74px;
        width: min(86vw, 310px);
    }

    body.app-shell #accueil {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 11px;
    }

    body.app-shell .module-search {
        min-height: 42px;
        padding: 0 11px;
    }

    body.app-shell .module-search input { height: 40px; }

    body.app-shell .module-filters {
        flex-wrap: nowrap;
        padding-bottom: 4px;
        overflow-x: auto;
    }

    body.app-shell .module-filter { white-space: nowrap; }

    body.app-shell #accueil .module {
        min-height: 158px;
        padding: 10px;
    }

    .module-icon {
        min-height: 82px;
    }

    body.app-shell #accueil .module img {
        max-width: 60px;
        max-height: 60px;
    }

    .module-name {
        font-size: 0.84rem;
    }

    .module-action {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
