/* =====================================================================
   YANDI · Console d'administration
   Identité : rouge et vert du logo, Sora (titres, chiffres) + Plus Jakarta Sans (texte)
   ===================================================================== */
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 400; font-display: swap; src: url('../fonts/plus-jakarta-sans-400.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 500; font-display: swap; src: url('../fonts/plus-jakarta-sans-500.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 600; font-display: swap; src: url('../fonts/plus-jakarta-sans-600.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 700; font-display: swap; src: url('../fonts/plus-jakarta-sans-700.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 800; font-display: swap; src: url('../fonts/plus-jakarta-sans-800.woff2') format('woff2'); }
@font-face { font-family: 'Sora'; font-weight: 700; font-display: swap; src: url('../fonts/sora-700.woff2') format('woff2'); }
@font-face { font-family: 'Sora'; font-weight: 800; font-display: swap; src: url('../fonts/sora-800.woff2') format('woff2'); }

:root {
    /* Marque */
    --red: #D9161B;
    --red-dark: #A80F14;
    --red-soft: #FDECEC;
    --red-ink: #9B1216;
    --green: #0E6030;
    --green-2: #167A3E;
    --green-dark: #08391D;
    --green-deep: #052814;
    --green-soft: #E6F3EA;
    --green-ink: #0B4F27;
    /* Neutres légèrement teintés de vert */
    --bg: #F3F6F4;
    --card: #FFFFFF;
    --ink: #0F1E16;
    --ink-2: #2B3A31;
    --muted: #5E6E65;
    --line: #E1E8E3;
    --line-2: #EEF2EF;
    --amber: #8A5A00;
    --amber-soft: #FFF3D6;
    --blue: #1D4F91;
    --blue-soft: #E8EFFA;
    /* Formes */
    --radius: 16px;
    --radius-sm: 10px;
    --sidebar: 268px;
    --shadow-sm: 0 1px 2px rgba(15, 30, 22, .05);
    --shadow: 0 1px 2px rgba(15, 30, 22, .04), 0 10px 30px -14px rgba(15, 30, 22, .16);
    --shadow-lg: 0 24px 60px -24px rgba(5, 40, 20, .35);
    --ring: 0 0 0 4px rgba(14, 96, 48, .14);
    --display: 'Sora', 'Plus Jakarta Sans', system-ui, sans-serif;
    --text: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--text);
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
::selection { background: rgba(14, 96, 48, .18); }
a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green-dark); }
h1, h2, h3 { font-family: var(--display); color: var(--ink); }
h1 { font-size: 26px; font-weight: 800; margin: 0; letter-spacing: -0.02em; line-height: 1.2; }
h2 { font-size: 16.5px; font-weight: 700; margin: 0 0 12px; letter-spacing: -0.01em; }
h3 { font-size: 14.5px; font-weight: 700; margin: 0 0 8px; }
p { margin: 0 0 12px; }
small, .muted { color: var(--muted); }
code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 12.5px; background: var(--line-2); padding: 2px 7px; border-radius: 6px; color: var(--ink-2); }
strong { font-weight: 700; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* ---------------------------------------------------------------- Mise en page */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    display: flex; flex-direction: column; gap: 6px;
    padding: 20px 14px 16px;
    color: #DCEBE1;
    background:
        radial-gradient(120% 60% at 0% 0%, rgba(22, 122, 62, .55) 0%, transparent 60%),
        radial-gradient(90% 50% at 100% 100%, rgba(217, 22, 27, .16) 0%, transparent 60%),
        linear-gradient(180deg, var(--green-dark) 0%, var(--green-deep) 100%);
    scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 14px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-logo { width: 38px; height: auto; flex: none; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .25)); }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: .01em; line-height: 1; }
.brand-name .wm-r { color: #FF3A3F; }
.brand-name .wm-g { color: #fff; }
.brand-sub { display: block; margin-top: 5px; font-family: var(--text); font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #8FB59D; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; color: #7FA48D; padding: 16px 12px 6px; }
.nav a {
    position: relative; display: flex; align-items: center; gap: 11px;
    color: #D3E4D9; text-decoration: none; padding: 9px 12px; border-radius: 11px;
    font-weight: 600; font-size: 14px; transition: background .15s, color .15s;
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.active { background: #fff; color: var(--green-dark); box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .45); }
.nav a.active svg { opacity: 1; color: var(--green); }
.nav a.active::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--red); }
.nav a.nav-recette { background: rgba(255, 196, 0, .12); color: #FFE3A3; border: 1px dashed rgba(255, 196, 0, .35); margin-bottom: 6px; }
.nav a.nav-recette.active { background: #FFF6DC; color: #6B4700; border-style: solid; }
.nav-count {
    margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px;
    display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 800;
    background: var(--red); color: #fff; box-shadow: 0 0 0 3px rgba(217, 22, 27, .18);
}
.nav a.active .nav-count { box-shadow: none; }

.sidebar-foot {
    margin-top: auto; display: flex; align-items: center; gap: 10px;
    padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08);
    font-size: 12.5px; color: #A9C4B3;
}
.avatar {
    width: 36px; height: 36px; border-radius: 11px; flex: none; display: grid; place-items: center;
    font-family: var(--display); font-weight: 800; font-size: 14px; color: #fff;
    background: linear-gradient(135deg, var(--red) 0%, #F0484C 100%);
}
.sidebar-foot .who { min-width: 0; flex: 1; }
.sidebar-foot strong { display: block; color: #fff; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot form { margin: 0; }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 0; background: transparent; color: #A9C4B3; cursor: pointer; }
.icon-button:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.icon-button svg { width: 18px; height: 18px; }
.link-button { background: none; border: 0; padding: 0; color: var(--green); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Barre supérieure */
.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 16px; padding: 14px 36px;
    background: rgba(243, 246, 244, .82); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.search { position: relative; flex: 1; max-width: 520px; }
.search svg { position: absolute; left: 14px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input[type=search] {
    width: 100%; height: 42px; padding: 0 14px 0 42px; border-radius: 12px;
    border: 1px solid var(--line); background: #fff; font: inherit; color: var(--ink); box-shadow: var(--shadow-sm);
}
.search input[type=search]:focus { outline: none; border-color: var(--green); box-shadow: var(--ring); }
.topbar-meta { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 600; }
.env-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: #FFF3D6; color: #7A4F00; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.env-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #F0A500; box-shadow: 0 0 0 3px rgba(240, 165, 0, .25); }
.menu-toggle { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.content { padding: 8px 36px 56px; min-width: 0; animation: rise .35s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 10px 0 22px; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 760px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

/* ---------------------------------------------------------------- Cartes */
.card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 20px 22px; box-shadow: var(--shadow);
}
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line-2); }
.card-head h2 { margin: 0; }
.grid > .card:has(> .stat-value) { position: relative; overflow: hidden; }
.grid > .card:has(> .stat-value)::after {
    content: ''; position: absolute; right: -28px; top: -28px; width: 96px; height: 96px; border-radius: 50%;
    background: radial-gradient(circle, rgba(14, 96, 48, .10), transparent 70%);
}
.grid > .card:has(> .stat-value):nth-child(4n+2)::after { background: radial-gradient(circle, rgba(217, 22, 27, .09), transparent 70%); }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 700; letter-spacing: .01em; }
.stat-value { font-family: var(--display); font-size: 30px; font-weight: 800; margin-top: 6px; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--ink); }
.stat-note { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ---------------------------------------------------------------- Tableaux */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { text-align: left; padding: 13px 18px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 800; background: #F8FAF9; white-space: nowrap; }
td { color: var(--ink-2); }
td a { font-weight: 700; text-decoration: none; }
td:first-child a, td:first-child strong { white-space: nowrap; }
td a:hover { text-decoration: underline; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #F7FBF8; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty::before {
    content: ''; display: block; width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 14px; background: var(--green-soft)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230E6030' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-6l-2 3h-4l-2-3H2'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E") center / 22px no-repeat;
}

/* ---------------------------------------------------------------- Badges */
.badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px;
    font-size: 12px; font-weight: 700; background: var(--line-2); color: var(--muted); white-space: nowrap; line-height: 1.5;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.badge-green { background: var(--green-soft); color: var(--green-ink); }
.badge-red { background: var(--red-soft); color: var(--red-ink); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badges { display: flex; flex-wrap: wrap; gap: 5px; }

/* ---------------------------------------------------------------- Formulaires */
label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 6px; color: var(--ink-2); }
.field { margin-bottom: 16px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=datetime-local], input[type=url], input[type=search], input:not([type]), select, textarea {
    width: 100%; min-height: 44px; padding: 9px 13px; border: 1px solid #D5DED8; border-radius: 11px;
    font: inherit; color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 90px; resize: vertical; }
select {
    appearance: none; -webkit-appearance: none; padding-right: 38px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235E6E65' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 12px center / 16px no-repeat;
}
input:hover, select:hover, textarea:hover { border-color: #BFCBC3; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: var(--ring); }
input[type=file] { font: inherit; font-size: 13px; }
.check { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--green); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 16px 22px; border-bottom: 1px solid var(--line-2); background: #FBFCFB; }
.filters .field { margin: 0; min-width: 160px; flex: 1; }
.filters .field-grow { flex: 2; min-width: 220px; }
.inline-form { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; flex: 1; min-width: 140px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
    border-radius: 12px; border: 1px solid transparent; color: #fff; font: inherit; font-weight: 700; font-size: 14px;
    text-decoration: none; cursor: pointer; white-space: nowrap; letter-spacing: .005em;
    background: linear-gradient(180deg, var(--green-2) 0%, var(--green) 100%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 8px 18px -10px rgba(14, 96, 48, .7);
    transition: transform .12s, box-shadow .15s, background .15s, filter .15s;
}
.btn:hover { color: #fff; filter: brightness(1.06); box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 12px 22px -10px rgba(14, 96, 48, .75); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }
.btn-ghost { background: #fff; color: var(--green-ink); border-color: #D5DED8; box-shadow: var(--shadow-sm); }
.btn-ghost:hover { background: var(--green-soft); color: var(--green-dark); border-color: #BCD8C5; filter: none; box-shadow: var(--shadow-sm); }
.btn-danger { background: #fff; color: var(--red); border-color: #F2C2C3; box-shadow: var(--shadow-sm); }
.btn-danger:hover { background: var(--red); color: #fff; border-color: var(--red); filter: none; box-shadow: 0 10px 20px -10px rgba(217, 22, 27, .7); }
.btn-accent { background: linear-gradient(180deg, #E8282D 0%, var(--red) 100%); box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 8px 18px -10px rgba(217, 22, 27, .8); }
.btn-sm { min-height: 36px; padding: 0 13px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }

/* ---------------------------------------------------------------- Messages */
.alert { display: flex; gap: 10px; padding: 13px 16px; border-radius: 13px; margin-bottom: 18px; font-weight: 600; border: 1px solid transparent; animation: rise .3s ease-out both; }
.alert::before { content: ''; flex: none; width: 20px; height: 20px; margin-top: 1px; background: currentColor; -webkit-mask: var(--alert-icon) center / contain no-repeat; mask: var(--alert-icon) center / contain no-repeat; }
.alert-ok { background: var(--green-soft); color: var(--green-ink); border-color: #CDE6D5; --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m8 12 3 3 5-6'/%3E%3C/svg%3E"); }
.alert-error { background: var(--red-soft); color: var(--red-ink); border-color: #F6CFD0; --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 7v6M12 17h.01'/%3E%3C/svg%3E"); }
.alert-warn { background: var(--amber-soft); color: var(--amber); border-color: #F3DFA8; --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 6 9-6'/%3E%3C/svg%3E"); }
.recette-code { font-family: Sora, var(--font, sans-serif); font-size: 1.25em; letter-spacing: .18em; color: var(--ink, #0F1E16); }
.alert ul { margin: 0; padding-left: 18px; }
.error { color: var(--red); font-size: 12.5px; font-weight: 600; margin-top: 5px; }

/* ---------------------------------------------------------------- Référentiel */
.tree-region { border-top: 1px solid var(--line-2); padding: 18px 22px; }
.tree-region:first-of-type { border-top: 0; }
.tree-city { margin: 12px 0 0 16px; padding-left: 14px; border-left: 2px solid var(--line); }
.zone-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.zone-row:last-child { border-bottom: 0; }
details > summary { cursor: pointer; color: var(--green); font-weight: 700; font-size: 13.5px; margin-top: 8px; }
details[open] > summary { margin-bottom: 8px; }

.diff { font-size: 12.5px; color: var(--muted); }
.diff strong { color: var(--ink); font-weight: 600; }
.pagination { display: flex; gap: 6px; flex-wrap: wrap; padding: 14px 22px; border-top: 1px solid var(--line-2); }
.pagination a, .pagination span { min-width: 36px; text-align: center; padding: 7px 11px; border-radius: 10px; border: 1px solid var(--line); text-decoration: none; font-size: 13px; font-weight: 700; background: #fff; color: var(--ink-2); }
.pagination a:hover { border-color: var(--green); color: var(--green); }
.pagination .current { background: var(--green); color: #fff; border-color: var(--green); }
.pagination .disabled { color: #C3CEC7; }

/* ---------------------------------------------------------------- Onglets, dossiers */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 22px 0; }
.tabs a { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; text-decoration: none; font-size: 13.5px; font-weight: 700; color: var(--ink-2); transition: all .15s; }
.tabs a:hover { border-color: #BCD8C5; color: var(--green); }
.tabs a.active { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 8px 16px -10px rgba(14, 96, 48, .8); }
.tabs a span { color: var(--muted); font-weight: 600; margin-left: 4px; }
.tabs a.active span { color: #CFE8D7; }
.progress { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; min-width: 80px; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--green-2), var(--green)); }
.doc-section { border-top: 1px solid var(--line-2); padding: 16px 22px; }
.doc-section:first-of-type { border-top: 0; }
.doc-section h3 { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.doc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 11px; margin: 0 -11px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.doc-row:hover { background: var(--bg); color: var(--ink); }
.doc-row.selected { background: var(--green-soft); box-shadow: inset 3px 0 0 var(--green); }
.doc-row small { display: block; }
.viewer { background: #16241C; border-radius: 12px; min-height: 280px; display: grid; place-items: center; overflow: hidden; }
.viewer img { max-width: 100%; max-height: 520px; display: block; }
.viewer iframe { width: 100%; height: 520px; border: 0; background: #fff; }
.reasons { margin: 0; padding-left: 18px; color: var(--red-ink); }
.reasons li { margin-bottom: 4px; }
.kv { display: grid; grid-template-columns: 38% 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; font-weight: 600; color: var(--ink); }

/* ---------------------------------------------------------------- Connexion */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: #fff; }
.auth-hero {
    position: relative; overflow: hidden; color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between;
    background:
        radial-gradient(90% 70% at 10% 0%, rgba(22, 122, 62, .9) 0%, transparent 60%),
        radial-gradient(70% 60% at 100% 100%, rgba(217, 22, 27, .35) 0%, transparent 65%),
        linear-gradient(160deg, var(--green-dark), var(--green-deep));
}
.auth-hero::after {
    content: ''; position: absolute; inset: 0; opacity: .5; pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, .12) 1px, transparent 1px); background-size: 22px 22px;
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 40%, transparent); mask-image: linear-gradient(180deg, transparent, #000 40%, transparent);
}
.auth-hero > * { position: relative; z-index: 1; }
.auth-hero .brand { padding: 0; }
.auth-hero .brand-logo { width: 46px; }
.auth-hero .brand-name { font-size: 30px; }
.hero-stage { display: grid; place-items: center; padding: 20px 0; }
.hero-stage .ym { width: 170px; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .35)); }
.hero-copy h2 { color: #fff; font-size: 30px; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 12px; max-width: 460px; }
.hero-copy h2 em { font-style: normal; color: #FF5257; }
.hero-copy p { color: #B8D2C2; max-width: 440px; margin: 0; }
.hero-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.hero-tags span { padding: 7px 12px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); font-size: 12px; font-weight: 700; letter-spacing: .06em; color: #DCEBE1; }
.auth-side { display: grid; place-items: center; padding: 40px 24px; background: linear-gradient(180deg, #fff, var(--bg)); }
.auth-card { width: 100%; max-width: 410px; }
.auth-card h1 { font-size: 28px; margin-bottom: 8px; }
.auth-card > p.muted { margin-bottom: 26px; }
.auth-card .btn { min-height: 50px; font-size: 15px; margin-top: 6px; }
.auth-card input { min-height: 50px; }
.auth-foot { margin-top: 26px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.auth-foot svg { width: 16px; height: 16px; color: var(--green); }
.auth-mobile-brand { display: none; }
.code-input { font-family: var(--display); font-size: 28px !important; letter-spacing: .45em; text-align: center; font-weight: 800; padding-left: .45em !important; }

/* ---------------------------------------------------------------- Pictogramme animé et loader */
.ym .ym-shadow { transform-box: fill-box; transform-origin: center; }
.ym .ym-pin { transform-box: view-box; transform-origin: 60px 140px; }
.ym .ym-b { transform-box: fill-box; transform-origin: bottom; }
.ym-anim .ym-pin { animation: ym-drop .9s cubic-bezier(.2, .9, .25, 1.2) both, ym-hop 2.4s ease-in-out 1.4s infinite; }
.ym-anim .ym-shadow { animation: ym-shadow-in .9s ease-out both, ym-shadow 2.4s ease-in-out 1.4s infinite; }
.ym-anim .ym-b { animation: ym-rise .55s cubic-bezier(.2, .8, .3, 1.15) both; }
.ym-anim .ym-b:nth-child(1) { animation-delay: .55s; } .ym-anim .ym-b:nth-child(2) { animation-delay: .62s; }
.ym-anim .ym-b:nth-child(3) { animation-delay: .69s; } .ym-anim .ym-b:nth-child(4) { animation-delay: .76s; }
.ym-anim .ym-b:nth-child(5) { animation-delay: .83s; } .ym-anim .ym-b:nth-child(6) { animation-delay: .90s; }
.ym-anim .ym-b:nth-child(7) { animation-delay: .97s; } .ym-anim .ym-b:nth-child(8) { animation-delay: 1.04s; }
.ym-anim .ym-road-mask { stroke-dasharray: 90; stroke-dashoffset: 90; animation: ym-road .8s ease-out .9s forwards; }
.ym-loop .ym-road-mask { animation: ym-road .8s ease-out .9s forwards, ym-road-loop 2.4s ease-in-out 1.7s infinite; }
@keyframes ym-drop { 0% { transform: translateY(-46px) scale(.9); opacity: 0; } 60% { transform: translateY(4px) scale(1.02, .97); opacity: 1; } 100% { transform: none; } }
@keyframes ym-hop { 0%, 55%, 100% { transform: none; } 70% { transform: translateY(-9px); } 85% { transform: translateY(1px) scale(1.01, .99); } }
@keyframes ym-shadow-in { from { transform: scaleX(.3); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ym-shadow { 0%, 55%, 100% { transform: none; opacity: 1; } 70% { transform: scaleX(.72); opacity: .55; } }
@keyframes ym-rise { from { transform: scaleY(0); } to { transform: none; } }
@keyframes ym-road { to { stroke-dashoffset: 0; } }
@keyframes ym-road-loop { 0%, 40% { stroke-dashoffset: 0; } 70% { stroke-dashoffset: -90; } 70.01% { stroke-dashoffset: 90; } 100% { stroke-dashoffset: 0; } }

.loader {
    position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; align-content: center; gap: 18px;
    background: radial-gradient(60% 50% at 50% 40%, #fff 0%, rgba(243, 246, 244, .96) 70%);
    opacity: 0; visibility: hidden; pointer-events: none;
}
/* N'apparaît qu'au-delà de 250 ms : une page rapide ne clignote pas. */
.loader.on { visibility: visible; pointer-events: auto; animation: loader-in .2s ease .25s both; }
@keyframes loader-in { from { opacity: 0; } to { opacity: 1; } }
.loader .ym { width: 92px; }
.loader-word { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: .02em; }
.loader-word .wm-r { color: var(--red); } .loader-word .wm-g { color: var(--green); }
.loader-bar { width: 120px; height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
.loader-bar i { display: block; width: 40%; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--red), var(--green)); animation: bar 1.1s ease-in-out infinite; }
@keyframes bar { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 1180px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3-1 { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
    .auth { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
    .auth-mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; text-decoration: none; }
    .auth-mobile-brand .brand-name .wm-g { color: var(--green); }
    .auth-mobile-brand .brand-name .wm-r { color: var(--red); }
    .auth-mobile-brand .brand-sub { color: var(--muted); }
}
@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; inset: 0 auto 0 0; width: min(86vw, 300px); z-index: 50; transform: translateX(-102%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
    .shell.nav-open .sidebar { transform: none; }
    .shell.nav-open::after { content: ''; position: fixed; inset: 0; z-index: 40; background: rgba(5, 40, 20, .45); }
    .menu-toggle { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; flex: none; }
    .menu-toggle svg { width: 20px; height: 20px; }
    .topbar { padding: 12px 16px; }
    .topbar-meta .today { display: none; }
    .content { padding: 4px 16px 40px; }
    .grid-2, .grid-4 { grid-template-columns: 1fr; }
    th, td { padding: 11px 13px; }
    h1 { font-size: 22px; }
}

/* ---------------------------------------------------------------- Bandeau d'accueil */
.hero-band {
    position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 24px;
    margin: 10px 0 22px; padding: 28px 32px; border-radius: 22px; color: #fff; box-shadow: var(--shadow-lg);
    background:
        radial-gradient(80% 120% at 100% 0%, rgba(217, 22, 27, .38) 0%, transparent 55%),
        radial-gradient(70% 90% at 0% 100%, rgba(22, 122, 62, .9) 0%, transparent 60%),
        linear-gradient(135deg, var(--green-dark), var(--green-deep));
}
.hero-band::after {
    content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .45;
    background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1px); background-size: 20px 20px;
    -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000); mask-image: linear-gradient(90deg, transparent 30%, #000);
}
.hero-band > * { position: relative; z-index: 1; }
.hero-band h1 { color: #fff; font-size: 30px; margin: 6px 0 8px; }
.hero-band p { color: #BFD7C7; margin: 0; max-width: 620px; }
.eyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #8FC2A1; }
.hero-band-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.btn-light { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .25); box-shadow: none; }
.btn-light:hover { background: rgba(255, 255, 255, .18); filter: none; box-shadow: none; }
.hero-band-art .ym { width: 120px; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .35)); }
a.card { text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s, border-color .15s; }
a.card:hover { transform: translateY(-2px); border-color: #C8DCCD; box-shadow: 0 1px 2px rgba(15, 30, 22, .04), 0 18px 36px -18px rgba(15, 30, 22, .28); color: inherit; }
@media (max-width: 900px) { .hero-band { padding: 22px; } .hero-band-art { display: none; } .hero-band h1 { font-size: 24px; } }
