/* ==========================================================================
   Observatoire INOHA — Espace d'administration
   Design system unique pour toutes les pages admin.
   ========================================================================== */

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../vendor/inter/InterVariable.woff2") format("woff2");
}

:root {
    /* Couleurs de marque */
    --primary-900: #063d27;
    --primary-800: #0a5235;
    --primary-700: #0b6b43;
    --primary-600: #0f7b4b;
    --primary-500: #16935b;
    --primary-100: #dcf1e5;
    --primary-50: #eef8f2;

    /* Surfaces */
    --bg: #f3f5f4;
    --surface: #ffffff;
    --surface-2: #f8faf9;
    --surface-3: #eff3f1;
    --border: #e1e7e4;
    --border-strong: #cbd5d0;

    /* Texte */
    --text: #13221c;
    --text-2: #3b4a44;
    --muted: #66766f;
    --muted-2: #8a9892;

    /* États */
    --danger: #c62828;
    --danger-50: #fdecec;
    --warning: #b45309;
    --warning-50: #fff4e0;
    --info: #1d64b0;
    --info-50: #e8f1fb;
    --success: #0f7b4b;
    --success-50: #e7f6ee;

    /* Indicateurs épidémiologiques (identiques partout) */
    --c-cas: #d9480f;
    --c-deces: #a61e1e;
    --c-gueris: #2b8a3e;
    --c-letalite: #5f3dc4;
    --c-suspects: #b7791f;
    --c-probables: #1971c2;
    --c-alertes: #0b7285;
    --c-contacts: #495057;

    /* Barre latérale */
    --sidebar-bg: #0b2219;
    --sidebar-bg-2: #0f2c21;
    --sidebar-text: #c5d6ce;
    --sidebar-muted: #7f978c;
    --sidebar-active: #16935b;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(16, 34, 27, .06);
    --shadow: 0 1px 3px rgba(16, 34, 27, .07), 0 6px 18px rgba(16, 34, 27, .05);
    --shadow-lg: 0 12px 40px rgba(16, 34, 27, .16);
    --sidebar-w: 268px;
    --topbar-h: 64px;
    --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

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

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

body.adm {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "cv11", "ss01";
}

body.adm.is-locked {
    overflow: hidden;
}

.adm a {
    color: var(--primary-600);
    text-decoration: none;
}

.adm a:hover {
    color: var(--primary-800);
}

.adm img {
    max-width: 100%;
}

.adm h1,
.adm h2,
.adm h3,
.adm h4 {
    margin: 0;
    color: var(--text);
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1.25;
}

.adm p {
    margin: 0;
}

.adm small {
    font-size: 12px;
}

.num {
    font-variant-numeric: tabular-nums;
}

.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;
}

/* ==========================================================================
   Structure : barre latérale + zone principale
   ========================================================================== */

.app {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
    color: var(--sidebar-text);
    z-index: 60;
}

.sidebar-brand {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    padding: 18px 16px 14px;
}

.sidebar-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 10px;
    background: #fff;
    border-radius: 10px;
    flex: 1 1 100%;
    min-width: 0;
    order: 1;
}

.sidebar-logos img {
    height: 32px;
    width: auto;
    max-width: 48%;
    object-fit: contain;
    display: block;
}

.sidebar-brand-text {
    min-width: 0;
    order: 2;
    flex: 1;
    padding: 0 4px;
}

.sidebar-brand-text strong {
    display: block;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

.sidebar-brand-text span {
    display: block;
    color: var(--sidebar-muted);
    font-size: 11.5px;
    margin-top: 2px;
}

.sidebar-close {
    display: none;
    order: 3;
    margin-left: auto;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 6px 12px 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .15) transparent;
}

.nav-group + .nav-group {
    margin-top: 14px;
}

.nav-group-title {
    padding: 8px 12px 6px;
    color: var(--sidebar-muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 9px;
    color: var(--sidebar-text) !important;
    font-size: 13.5px;
    font-weight: 500;
    transition: background-color .15s ease, color .15s ease;
}

.nav-link i {
    width: 18px;
    text-align: center;
    font-size: 15px;
    color: var(--sidebar-muted);
    transition: color .15s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff !important;
}

.nav-link:hover i {
    color: #fff;
}

.nav-link.is-active {
    background: rgba(22, 147, 91, .18);
    color: #fff !important;
    font-weight: 600;
}

.nav-link.is-active::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: #34c47c;
}

.nav-link.is-active i {
    color: #5fd99a;
}

.nav-link .nav-badge {
    margin-left: auto;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-user-info {
    min-width: 0;
    flex: 1;
}

.sidebar-user-info strong {
    display: block;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-info span {
    display: block;
    color: var(--sidebar-muted);
    font-size: 11.5px;
}

.sidebar-logout {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: var(--sidebar-text) !important;
    background: rgba(255, 255, 255, .06);
}

.sidebar-logout:hover {
    background: rgba(220, 38, 38, .25);
    color: #fff !important;
}

.avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--primary-600);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.avatar-sm {
    width: 30px;
    height: 30px;
    font-size: 11.5px;
}

.sidebar-backdrop {
    display: none;
}

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

/* Barre supérieure */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 28px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(160%) blur(8px);
    -webkit-backdrop-filter: saturate(160%) blur(8px);
    border-bottom: 1px solid var(--border);
}

.topbar-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-size: 16px;
    cursor: pointer;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--muted);
    font-size: 13px;
}

.breadcrumb a {
    color: var(--muted);
}

.breadcrumb a:hover {
    color: var(--text);
}

.breadcrumb i {
    font-size: 10px;
    color: var(--muted-2);
}

.breadcrumb strong {
    color: var(--text);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pheno-switch {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 6px 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}

.pheno-switch i {
    color: var(--primary-600);
    font-size: 14px;
}

.adm .pheno-switch select {
    height: 34px;
    min-height: 0;
    border: 0;
    box-shadow: none;
    background-color: transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    padding: 0 26px 0 4px;
    background-position: right 6px center;
    max-width: 230px;
    cursor: pointer;
    outline: none;
}

.topbar-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-2) !important;
    font-size: 13px;
    font-weight: 600;
}

.topbar-link:hover {
    border-color: var(--border-strong);
    color: var(--text) !important;
}

.content {
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
    padding: 26px 28px 40px;
}

.app-footer {
    margin-top: auto;
    padding: 18px 28px 22px;
    color: var(--muted-2);
    font-size: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    justify-content: space-between;
}

/* En-tête de page */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px 24px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.page-header-main {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
}

.page-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--primary-50);
    color: var(--primary-600);
    font-size: 18px;
    border: 1px solid var(--primary-100);
}

.page-title {
    font-size: 22px !important;
    font-weight: 700 !important;
}

.page-subtitle {
    margin-top: 4px !important;
    color: var(--muted);
    font-size: 13.5px;
    max-width: 760px;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* ==========================================================================
   Composants
   ========================================================================== */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

:not(.grid):not(.stack) > .card + .card {
    margin-top: 20px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    flex-wrap: wrap;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.card-header.no-border {
    border-bottom: 0;
    padding-bottom: 4px;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px !important;
    font-weight: 650 !important;
}

.card-title i {
    color: var(--primary-600);
    font-size: 14px;
}

.card-subtitle {
    margin-top: 2px !important;
    color: var(--muted);
    font-size: 12.5px;
}

.card-body {
    padding: 20px;
}

.card-body.tight {
    padding: 0;
}

.card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.card-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* Grilles */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-main-side {
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
}

.grid-form-list {
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    align-items: start;
}

.grid-form-list-wide {
    grid-template-columns: minmax(360px, 520px) minmax(0, 1fr);
    align-items: start;
}

.stack {
    display: grid;
    gap: 20px;
}

.section {
    margin-bottom: 20px;
}

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.mb-2 { margin-bottom: 16px !important; }
.text-muted { color: var(--muted) !important; }
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.nowrap { white-space: nowrap; }
.w-100 { width: 100%; }

/* Indicateurs clés */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.kpi {
    --kpi: var(--primary-600);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    min-width: 0;
}

.kpi::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--kpi);
}

.kpi-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.kpi-label {
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
}

.kpi-icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: var(--kpi);
    background: color-mix(in srgb, var(--kpi) 11%, #fff);
    font-size: 14px;
}

.kpi-value {
    font-size: 26px;
    font-weight: 750;
    letter-spacing: -.02em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    overflow-wrap: anywhere;
}

.kpi-value small {
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
}

.kpi-foot {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    min-height: 18px;
}

.kpi-delta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 7px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 11.5px;
    background: var(--surface-3);
    color: var(--text-2);
}

.kpi-delta.up { background: var(--danger-50); color: var(--danger); }
.kpi-delta.down { background: var(--success-50); color: var(--success); }

.kpi.k-cas { --kpi: var(--c-cas); }
.kpi.k-deces { --kpi: var(--c-deces); }
.kpi.k-gueris { --kpi: var(--c-gueris); }
.kpi.k-letalite { --kpi: var(--c-letalite); }
.kpi.k-suspects { --kpi: var(--c-suspects); }
.kpi.k-probables { --kpi: var(--c-probables); }
.kpi.k-alertes { --kpi: var(--c-alertes); }
.kpi.k-neutral { --kpi: #5c6b65; }
.kpi.k-info { --kpi: var(--info); }

.kpi-spark {
    height: 34px;
    margin-top: -2px;
}

.kpi-spark svg {
    width: 100%;
    height: 34px;
    display: block;
}

/* Mise en avant (ex. province la plus touchée) */
.highlight {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}

.highlight-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--c-cas);
}

.highlight-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.highlight-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.highlight-meta {
    color: var(--muted);
    font-size: 12px;
}

/* Boutons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: var(--surface);
    color: var(--text) !important;
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none !important;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.btn:focus-visible,
.input:focus-visible {
    outline: 3px solid rgba(22, 147, 91, .28);
    outline-offset: 1px;
}

.btn i {
    font-size: 13px;
}

.btn-primary {
    background: var(--primary-600);
    border-color: var(--primary-600);
    color: #fff !important;
    box-shadow: 0 1px 2px rgba(6, 61, 39, .25);
}

.btn-primary:hover {
    background: var(--primary-700);
    border-color: var(--primary-700);
}

.btn-secondary {
    background: var(--surface);
    border-color: var(--border-strong);
    color: var(--text) !important;
}

.btn-secondary:hover {
    background: var(--surface-2);
    border-color: #b6c2bc;
}

.btn-ghost {
    background: transparent;
    color: var(--text-2) !important;
}

.btn-ghost:hover {
    background: var(--surface-3);
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff !important;
}

.btn-danger:hover {
    background: #a71f1f;
}

.btn-soft-danger {
    background: var(--danger-50);
    border-color: #f6cccc;
    color: var(--danger) !important;
}

.btn-soft-danger:hover {
    background: #fadcdc;
}

.btn-sm {
    height: 32px;
    padding: 0 10px;
    font-size: 12.5px;
    border-radius: 8px;
}

.btn-lg {
    height: 44px;
    padding: 0 18px;
    font-size: 14.5px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2) !important;
}

.btn-icon:hover {
    background: var(--surface-2);
    border-color: var(--border-strong);
    color: var(--text) !important;
}

.btn-icon.danger:hover {
    background: var(--danger-50);
    border-color: #f2b8b8;
    color: var(--danger) !important;
}

.btn-icon.success:hover {
    background: var(--success-50);
    border-color: #b7e2c8;
    color: var(--success) !important;
}

.btn-block {
    width: 100%;
}

.btn[disabled],
.btn.is-disabled {
    opacity: .5;
    pointer-events: none;
}

.btn-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

.actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.actions form {
    margin: 0;
    display: inline-flex;
}

/* Formulaires */
.form {
    display: grid;
    gap: 16px;
}

.form-row {
    display: grid;
    align-items: start;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-row.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-row.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.field > label,
.field-label {
    color: var(--text-2);
    font-size: 12.5px;
    font-weight: 600;
}

.field .req {
    color: var(--danger);
}

.field-hint {
    color: var(--muted);
    font-size: 12px;
}

.input,
.adm select,
.adm textarea,
.adm input[type="text"],
.adm input[type="email"],
.adm input[type="password"],
.adm input[type="number"],
.adm input[type="date"],
.adm input[type="url"],
.adm input[type="search"],
.adm input[type="file"] {
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.adm select {
    padding-right: 34px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2366766f' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.adm select[multiple] {
    background-image: none;
    padding-right: 12px;
    min-height: 140px;
}

.adm textarea {
    min-height: 110px;
    resize: vertical;
    line-height: 1.55;
}

.adm input[type="file"] {
    padding: 6px;
    font-size: 13px;
    background: var(--surface-2);
}

.adm input[type="file"]::file-selector-button {
    margin-right: 10px;
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(--border-strong);
    border-radius: 7px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-weight: 600;
    font-size: 12.5px;
    cursor: pointer;
}

.adm input:focus,
.adm select:focus,
.adm textarea:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(22, 147, 91, .16);
}

.adm input[disabled],
.adm select[disabled],
.adm textarea[disabled] {
    background: var(--surface-3);
    color: var(--muted);
    cursor: not-allowed;
}

.input-icon {
    position: relative;
}

.input-icon > i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-2);
    font-size: 13px;
    pointer-events: none;
}

.adm .input-icon > input {
    padding-left: 34px;
}

.fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin: 0;
    min-width: 0;
}

.fieldset legend,
.fieldset-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 6px;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.fieldset-title {
    padding: 0;
    margin-bottom: 12px;
}

.fieldset legend i,
.fieldset-title i {
    color: var(--primary-600);
}

.check {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
    color: var(--text-2);
    cursor: pointer;
    user-select: none;
}

.check input {
    width: 17px;
    height: 17px;
    accent-color: var(--primary-600);
    cursor: pointer;
    margin: 0;
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 6px;
    max-height: 220px;
    overflow: auto;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
}

.check-grid .check {
    padding: 6px 8px;
    border-radius: 7px;
    background: #fff;
    border: 1px solid var(--border);
    font-size: 13px;
}

.check-grid .check.is-hidden {
    display: none;
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.choice {
    position: relative;
    display: flex;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}

.choice input {
    margin-top: 2px;
    accent-color: var(--primary-600);
    width: 16px;
    height: 16px;
}

.choice strong {
    display: block;
    font-size: 13.5px;
}

.choice span {
    display: block;
    color: var(--muted);
    font-size: 12.5px;
    margin-top: 2px;
}

.choice:has(input:checked) {
    border-color: var(--primary-500);
    background: var(--primary-50);
    box-shadow: 0 0 0 3px rgba(22, 147, 91, .1);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding-top: 4px;
}

.is-hidden {
    display: none !important;
}

/* Barre de filtres */
.toolbar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    align-items: end;
}

.toolbar .toolbar-actions {
    display: flex;
    gap: 8px;
    align-items: end;
}

.filters-bar {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.filters-toggle-wrap {
    display: none;
}

/* Tableaux */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13.5px;
}

.table th,
.table td {
    padding: 11px 14px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}

.table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.table tbody tr:hover td {
    background: #fafcfb;
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

.table td.num,
.table th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.table td.actions-cell,
.table th.actions-cell {
    text-align: right;
    width: 1%;
    white-space: nowrap;
}

.table .cell-title {
    font-weight: 600;
    color: var(--text);
}

.table .cell-sub {
    display: block;
    color: var(--muted);
    font-size: 12.5px;
    margin-top: 2px;
}

.table .row-group td {
    background: var(--surface-3) !important;
    color: var(--text);
    font-weight: 700;
    font-size: 12.5px;
}

.table .row-subtotal td {
    background: var(--primary-50) !important;
    font-weight: 600;
}

.table .row-total td {
    background: var(--primary-800) !important;
    color: #fff;
    font-weight: 700;
}

.table.compact th,
.table.compact td {
    padding: 8px 12px;
}

.table-dense {
    font-size: 12.5px;
}

.table-dense th,
.table-dense td {
    padding: 7px 10px;
}

.thumb {
    width: 64px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
    border: 1px solid var(--border);
    background: var(--surface-3);
}

.thumb-empty {
    width: 64px;
    height: 44px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: var(--muted-2);
    background: var(--surface-3);
    border: 1px dashed var(--border-strong);
    font-size: 15px;
}

.empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--muted);
}

.empty i {
    display: block;
    margin: 0 auto 10px;
    font-size: 28px;
    color: var(--muted-2);
}

.empty strong {
    display: block;
    color: var(--text);
    font-size: 14px;
    margin-bottom: 4px;
}

/* Barre de progression */
.bar {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: var(--surface-3);
    overflow: hidden;
    min-width: 60px;
}

.bar > span {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: inherit;
    background: var(--c-cas);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--surface-3);
    color: var(--text-2);
    border: 1px solid transparent;
}

.badge i {
    font-size: 10px;
}

.badge-success { background: var(--success-50); color: var(--success); border-color: #c4e7d3; }
.badge-danger { background: var(--danger-50); color: var(--danger); border-color: #f4c7c7; }
.badge-warning { background: var(--warning-50); color: var(--warning); border-color: #f6dcae; }
.badge-info { background: var(--info-50); color: var(--info); border-color: #c8dcf2; }
.badge-purple { background: #f0ebfc; color: #5f3dc4; border-color: #ddd0f7; }
.badge-neutral { background: var(--surface-3); color: var(--text-2); border-color: var(--border); }
.badge-dark { background: #24322c; color: #fff; }

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    background: currentColor;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-2);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
}

.chip i {
    color: var(--primary-600);
    font-size: 12px;
}

/* Alertes / messages */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    font-size: 13.5px;
}

.alert > i {
    margin-top: 2px;
    font-size: 15px;
}

.alert-close {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: inherit;
    opacity: .6;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}

.alert-close:hover {
    opacity: 1;
}

.alert-success { background: var(--success-50); border-color: #bfe3cf; color: #0b5f3a; }
.alert-error,
.alert-danger { background: var(--danger-50); border-color: #f2c2c2; color: #8f1d1d; }
.alert-warning { background: var(--warning-50); border-color: #f3d7a5; color: #7a4206; }
.alert-info { background: var(--info-50); border-color: #c5daf1; color: #164c86; }

/* Pagination */
.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
}

.pager-info {
    color: var(--muted);
    font-size: 12.5px;
}

.pager-info strong {
    color: var(--text);
}

.pager-links {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.pager-links a,
.pager-links span {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text-2) !important;
    font-size: 12.5px;
    font-weight: 600;
}

.pager-links a:hover {
    border-color: var(--border-strong);
    background: var(--surface-2);
}

.pager-links .is-active {
    background: var(--primary-600);
    border-color: var(--primary-600);
    color: #fff !important;
}

.pager-links .is-disabled {
    opacity: .45;
}

.pager-links .gap {
    border: 0;
    background: transparent;
}

/* Onglets */
.tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-2);
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 32px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted) !important;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.tab:hover {
    color: var(--text) !important;
}

.tab.is-active {
    background: #fff;
    color: var(--text) !important;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

/* Listes */
.list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    border-bottom: 1px solid var(--border);
}

.list-item:last-child {
    border-bottom: 0;
}

.list-rank {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: var(--surface-3);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 700;
}

.list-item:first-child .list-rank {
    background: var(--c-cas);
    color: #fff;
}

.list-main {
    flex: 1;
    min-width: 0;
}

.list-main strong {
    display: block;
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-main span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.list-value {
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.list-value small {
    display: block;
    color: var(--muted);
    font-weight: 500;
    font-size: 11.5px;
}

/* Raccourcis */
.shortcuts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.shortcut {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--text) !important;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.shortcut:hover {
    border-color: var(--primary-100);
    box-shadow: var(--shadow);
}

.shortcut-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--primary-50);
    color: var(--primary-600);
}

.shortcut-text strong {
    display: block;
    font-size: 13px;
}

.shortcut-text span {
    display: block;
    color: var(--muted);
    font-size: 11.5px;
}

/* Graphiques */
.chart-box {
    position: relative;
    width: 100%;
    height: 320px;
}

.chart-box.tall {
    height: 380px;
}

.chart-box.short {
    height: 240px;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 12.5px;
    color: var(--text-2);
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend i {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
}

/* Carte */
.map-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    min-height: 560px;
}

.map-stage {
    position: relative;
    min-height: 560px;
    background: #eef3f6;
    border-right: 1px solid var(--border);
}

.map-canvas {
    position: absolute;
    inset: 0;
}

.map-overlay {
    position: absolute;
    z-index: 5;
    pointer-events: none;
}

.map-overlay > * {
    pointer-events: auto;
}

.map-title {
    left: 14px;
    top: 14px;
    max-width: calc(100% - 80px);
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, .95);
    box-shadow: var(--shadow);
}

.map-title strong {
    display: block;
    font-size: 13px;
}

.map-title span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.map-legend {
    left: 14px;
    bottom: 14px;
    min-width: 180px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow);
    font-size: 12px;
}

.map-legend strong {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
}

.map-legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
}

.map-legend-row i {
    width: 22px;
    height: 12px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, .12);
    flex-shrink: 0;
}

.map-tooltip {
    position: absolute;
    z-index: 6;
    pointer-events: none;
    min-width: 160px;
    padding: 9px 11px;
    border-radius: 9px;
    background: #10231b;
    color: #fff;
    font-size: 12px;
    box-shadow: var(--shadow-lg);
    transform: translate(12px, 12px);
}

.map-tooltip strong {
    display: block;
    font-size: 12.5px;
    margin-bottom: 4px;
}

.map-tooltip div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #c8d8d0;
}

.map-tooltip div b {
    color: #fff;
    font-variant-numeric: tabular-nums;
}

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

.map-side-section {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.map-side-section:last-child {
    border-bottom: 0;
}

.map-side h4 {
    font-size: 12px !important;
    color: var(--muted) !important;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 10px !important;
}

.segmented {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.segmented button {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fff;
    color: var(--text-2);
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}

.segmented button .dot {
    width: 9px;
    height: 9px;
}

.segmented button.is-active {
    border-color: var(--primary-500);
    background: var(--primary-50);
    color: var(--primary-800);
    box-shadow: 0 0 0 2px rgba(22, 147, 91, .12);
}

.map-zoom {
    right: 14px;
    top: 14px;
    display: grid;
    gap: 6px;
}

.map-zoom button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fff;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.map-zoom button:hover {
    background: var(--surface-2);
}

.map-loading {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 13px;
}

/* Aperçu image (slides, actualités) */
.preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px dashed var(--border-strong);
    border-radius: 10px;
    background: var(--surface-2);
}

.preview img {
    width: 96px;
    height: 60px;
    object-fit: cover;
    border-radius: 7px;
}

/* Glossaire */
.glossary-term {
    font-weight: 700;
    color: var(--text);
}

.glossary-def {
    color: var(--text-2);
    font-size: 13px;
    line-height: 1.55;
    max-width: 720px;
}

/* Bulletins */
.doc-icon {
    width: 40px;
    height: 48px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: #fdecec;
    color: #c62828;
    font-size: 18px;
    border: 1px solid #f4c7c7;
}

.doc-icon.none {
    background: var(--surface-3);
    color: var(--muted-2);
    border-color: var(--border);
}

.media {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.media-body {
    min-width: 0;
}

/* Phénomènes */
.pheno-swatch {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: #fff;
    font-size: 14px;
}

.color-input {
    display: flex;
    gap: 8px;
    align-items: center;
}

.color-input input[type="color"] {
    width: 46px;
    height: 40px;
    padding: 3px;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    background: #fff;
    cursor: pointer;
}

.sticky-side {
    position: sticky;
    top: 84px;
}

/* Divers */
.divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
    border: 0;
}

.kbd {
    display: inline-block;
    padding: 1px 6px;
    border: 1px solid var(--border-strong);
    border-bottom-width: 2px;
    border-radius: 5px;
    font-size: 11px;
    background: #fff;
}

.meta-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.meta-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
}

.meta-list dt {
    color: var(--muted);
}

.meta-list dd {
    margin: 0;
    font-weight: 600;
    text-align: right;
}

.callout {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--info-50);
    color: #164c86;
    font-size: 13px;
    border: 1px solid #c5daf1;
}

.callout i {
    margin-top: 2px;
}

/* ==========================================================================
   Page de connexion
   ========================================================================== */

body.auth {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(380px, 520px);
}

.auth-aside {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 48px;
    color: #d5e6dd;
    background:
        radial-gradient(1000px 500px at -10% 110%, rgba(22, 147, 91, .35), transparent 60%),
        radial-gradient(700px 400px at 110% -10%, rgba(22, 147, 91, .22), transparent 60%),
        linear-gradient(160deg, #0b2219 0%, #0e3324 100%);
    overflow: hidden;
}

.auth-aside::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: 44px 44px;
    pointer-events: none;
}

.auth-aside > * {
    position: relative;
    z-index: 1;
}

.auth-logos {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #fff;
    border-radius: 12px;
}

.auth-logos img {
    height: 40px;
    width: auto;
}

.auth-aside h1 {
    color: #fff;
    font-size: 34px;
    line-height: 1.15;
    font-weight: 750;
    letter-spacing: -.02em;
    max-width: 520px;
}

.auth-aside p {
    margin-top: 14px;
    max-width: 480px;
    color: #a9c3b7;
    font-size: 15px;
    line-height: 1.6;
}

.auth-points {
    display: grid;
    gap: 12px;
    margin-top: 28px;
    padding: 0;
    list-style: none;
}

.auth-points li {
    display: flex;
    gap: 12px;
    align-items: center;
    color: #d5e6dd;
    font-size: 14px;
}

.auth-points i {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: rgba(255, 255, 255, .08);
    color: #6fe0a5;
}

.auth-aside small {
    color: #7f978c;
    font-size: 12px;
}

.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 28px;
    background: #fff;
}

.auth-card {
    width: 100%;
    max-width: 380px;
}

.auth-card h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -.01em;
    margin: 0;
}

.auth-card .lead {
    margin: 6px 0 26px;
    color: var(--muted);
    font-size: 14px;
}

.auth-card .form {
    gap: 16px;
}

.auth-card input {
    width: 100%;
    height: 44px;
    padding: 0 12px 0 38px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    font: inherit;
    font-size: 14.5px;
    color: var(--text);
    background: #fff;
}

.auth-card input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(22, 147, 91, .16);
}

.auth-card .field label {
    color: var(--text-2);
    font-size: 13px;
    font-weight: 600;
}

.auth-card .pw-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.auth-card .pw-toggle:hover {
    background: var(--surface-3);
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
}

.auth-foot {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 12.5px;
    text-align: center;
}

.auth-mobile-brand {
    display: none;
    margin-bottom: 26px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1280px) {
    .sticky-side {
        position: static;
    }

    .grid-main-side {
        grid-template-columns: minmax(0, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .grid-form-list,
    .grid-form-list-wide {
        grid-template-columns: minmax(0, 1fr);
    }

    .map-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .map-stage {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .map-side {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .map-side-section {
        border-right: 1px solid var(--border);
    }
}

@media (max-width: 1024px) {
    .app {
        grid-template-columns: minmax(0, 1fr);
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(300px, 86vw);
        transform: translateX(-102%);
        transition: transform .25s ease;
        box-shadow: var(--shadow-lg);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-close {
        display: grid;
        place-items: center;
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 55;
        background: rgba(8, 20, 15, .5);
        opacity: 0;
        pointer-events: none;
        transition: opacity .25s ease;
        display: block;
    }

    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .topbar-toggle {
        display: grid;
        place-items: center;
        flex-shrink: 0;
    }

    .topbar {
        padding: 0 18px;
    }

    .content {
        padding: 22px 18px 32px;
    }

    .app-footer {
        padding: 16px 18px 20px;
    }

    .auth-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .auth-aside {
        display: none;
    }

    .auth-mobile-brand {
        display: inline-flex;
    }
}

@media (max-width: 760px) {
    body.adm {
        font-size: 14px;
    }

    .topbar {
        gap: 10px;
        padding: 0 12px;
        height: 58px;
    }

    .breadcrumb .crumb-root,
    .breadcrumb .crumb-sep {
        display: none;
    }

    .topbar-link span {
        display: none;
    }

    .topbar-link {
        width: 38px;
        padding: 0;
        justify-content: center;
    }

    .pheno-switch {
        padding: 0 2px 0 10px;
    }

    .adm .pheno-switch select {
        max-width: 120px;
        font-size: 12.5px;
    }

    .pheno-switch > i {
        display: none;
    }

    .content {
        padding: 18px 14px 28px;
    }

    .page-header {
        margin-bottom: 18px;
    }

    .page-icon {
        width: 38px;
        height: 38px;
        font-size: 15px;
    }

    .page-title {
        font-size: 19px !important;
    }

    .page-actions {
        width: 100%;
    }

    .page-actions .btn {
        flex: 1 1 auto;
    }

    .grid-2,
    .grid-3,
    .form-row,
    .form-row.cols-3,
    .form-row.cols-4,
    .choice-grid,
    .shortcuts {
        grid-template-columns: minmax(0, 1fr);
    }

    .form-row.keep-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .kpi {
        padding: 13px 14px;
    }

    .kpi-value {
        font-size: 21px;
    }

    .kpi-icon {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }

    .card-header,
    .card-body,
    .filters-bar {
        padding-left: 14px;
        padding-right: 14px;
    }

    .card-footer,
    .pager {
        padding-left: 14px;
        padding-right: 14px;
    }

    .chart-box {
        height: 260px;
    }

    .chart-box.tall {
        height: 300px;
    }

    .map-stage,
    .map-shell {
        min-height: 420px;
    }

    .map-side {
        grid-template-columns: minmax(0, 1fr);
    }

    .map-side-section {
        border-right: 0;
    }

    .map-legend {
        left: 8px;
        bottom: 8px;
        min-width: 0;
        max-width: calc(100% - 16px);
        padding: 7px 9px;
        font-size: 10.5px;
    }

    .map-legend strong {
        font-size: 11px;
        margin-bottom: 3px;
    }

    .map-legend-row {
        padding: 0;
        gap: 6px;
    }

    .map-legend-row i {
        width: 14px;
        height: 9px;
    }

    .map-title {
        left: 8px;
        top: 8px;
        padding: 7px 9px;
        max-width: calc(100% - 60px);
    }

    .map-title strong {
        font-size: 12px;
    }

    .map-title span {
        font-size: 11px;
    }

    .map-zoom {
        right: 8px;
        top: 8px;
    }

    .toolbar {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .toolbar .toolbar-actions,
    .toolbar .span-all {
        grid-column: 1 / -1;
    }

    .toolbar .toolbar-actions .btn {
        flex: 1;
    }

    .filters-toggle-wrap {
        display: block;
        padding: 12px 14px;
        border-bottom: 1px solid var(--border);
        background: var(--surface-2);
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .filters-toggle {
        width: 100%;
    }

    form.filters-bar:not(.is-open) {
        display: none;
    }

    /* Tableaux transformés en cartes sur téléphone */
    .table-stack thead {
        display: none;
    }

    .table-stack,
    .table-stack tbody,
    .table-stack tr,
    .table-stack td {
        display: block;
        width: 100%;
    }

    .table-stack tr {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px 12px;
        padding: 14px;
        border-bottom: 1px solid var(--border);
    }

    .table-stack tbody tr:hover td {
        background: transparent;
    }

    .table-stack td {
        display: block;
        padding: 0;
        border: 0;
        text-align: left !important;
        min-width: 0;
    }

    .table-stack td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 1px;
        color: var(--muted);
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: .03em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .table-stack td:not([data-label])::before,
    .table-stack td[data-label=""]::before {
        display: none;
    }

    .table-stack td.cell-main,
    .table-stack td.cell-wide {
        grid-column: 1 / -1;
        order: -1;
        max-width: none !important;
    }

    .table-stack td.cell-main::before {
        display: none;
    }

    .table-stack td.actions-cell {
        grid-column: 1 / -1;
        display: flex;
        justify-content: flex-end;
        width: auto;
        padding-top: 4px;
        border-top: 1px dashed var(--border);
    }

    .table-stack td.actions-cell::before {
        display: none;
    }

    .table-stack .hide-sm {
        display: none !important;
    }


    .auth-main {
        align-items: flex-start;
        padding: 32px 20px;
    }
}

@media (max-width: 380px) {
    .kpi-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .adm .pheno-switch select {
        max-width: 96px;
    }
}

@media print {
    .sidebar,
    .topbar,
    .page-actions,
    .app-footer,
    .no-print {
        display: none !important;
    }

    .app {
        display: block;
    }

    .content {
        padding: 0;
        max-width: none;
    }

    .card {
        box-shadow: none;
        break-inside: avoid;
    }
}

/* ==========================================================================
   Infographie « Rapport visuel »
   ========================================================================== */

.infog-wrap {
    overflow-x: auto;
    padding-bottom: 6px;
}

.infog {
    width: 1000px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow);
    color: var(--text);
}

.infog-head {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 26px 30px;
    background: linear-gradient(135deg, #0b2219, #0f3a28);
    color: #fff;
}

.infog-logos {
    display: flex;
    gap: 8px;
    padding: 8px 10px;
    background: #fff;
    border-radius: 12px;
}

.infog-logos img {
    height: 46px;
    width: auto;
}

.infog-head-text span {
    color: #8fd9b1;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.infog-head-text h2 {
    color: #fff !important;
    font-size: 26px !important;
    margin: 4px 0 !important;
}

.infog-head-text p {
    color: #c5d6ce;
    font-size: 14px;
}

.infog-head-text strong {
    color: #fff;
}

.infog-band {
    padding: 9px 30px;
    background: var(--primary-50);
    color: var(--primary-800);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    border-top: 1px solid var(--primary-100);
    border-bottom: 1px solid var(--primary-100);
}

.infog-band.dark {
    background: #f4f1ec;
    color: #6b4a16;
    border-color: #ece3d3;
}

.infog-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    padding: 18px 30px;
}

.infog-kpi {
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    border-top: 4px solid var(--muted);
}

.infog-kpi strong {
    display: block;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}

.infog-kpi span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.infog-kpi.cas { border-top-color: var(--c-cas); }
.infog-kpi.cas strong { color: var(--c-cas); }
.infog-kpi.deces { border-top-color: var(--c-deces); }
.infog-kpi.deces strong { color: var(--c-deces); }
.infog-kpi.gueris { border-top-color: var(--c-gueris); }
.infog-kpi.gueris strong { color: var(--c-gueris); }
.infog-kpi.leta { border-top-color: var(--c-letalite); }
.infog-kpi.leta strong { color: var(--c-letalite); }

.infog-body {
    display: grid;
    grid-template-columns: 460px 1fr;
    gap: 24px;
    padding: 8px 30px 24px;
}

.infog-map {
    background: #eef3f6;
    border-radius: 14px;
    padding: 14px;
}

.infog-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-2);
}

.infog-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.infog-legend i {
    width: 22px;
    height: 10px;
    border-radius: 3px;
}

.infog-legend small {
    width: 100%;
    color: var(--muted);
}

.infog-side h3 {
    font-size: 14px !important;
    margin: 4px 0 10px !important;
    color: var(--primary-800) !important;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.infog-side table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 18px;
}

.infog-side th {
    text-align: right;
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    padding: 6px 6px;
    border-bottom: 2px solid var(--border);
}

.infog-side td {
    text-align: right;
    padding: 7px 6px;
    border-bottom: 1px solid var(--border);
    font-variant-numeric: tabular-nums;
}

.infog-side th:first-child,
.infog-side td:first-child {
    text-align: left;
    font-weight: 600;
}

.infog-side ol {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: z;
}

.infog-side li {
    counter-increment: z;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.infog-side li::before {
    content: counter(z);
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: var(--c-cas);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.infog-side li span {
    flex: 1;
}

.infog-side li em {
    color: var(--muted);
    font-style: normal;
}

.infog-foot {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 30px;
    background: #0b2219;
    color: #a9c3b7;
    font-size: 12px;
}

.infog-foot strong {
    color: #fff;
}

@media print {
    .infog-wrap {
        overflow: visible;
    }

    .infog {
        box-shadow: none;
        width: 100%;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
