/* ==========================================================================
   AirsoftPACA v2 — design system « carte d'état-major »
   Mobile-first, sans framework, sans étape de build.
   ========================================================================== */

:root {
    color-scheme: dark;

    /* Terrain */
    --ground: #151913;
    --ground-2: #1a1f17;
    --panel: #212820;
    --panel-2: #29312a;
    --line: #353e31;
    --line-2: #465141;

    /* Encre */
    --text: #e7e2d4;
    --text-2: #bdb8a8;
    --muted: #9a9b8b;

    /* Matos */
    --coyote: #c9ae7c;
    --coyote-2: #a88f60;
    --blaze: #ff6b1a;
    --blaze-hover: #ff8745;
    --blaze-ink: #1c0e05;
    --foliage: #93b561;
    --warn: #e8b54a;
    --danger: #e0584b;
    --info: #86aacb;

    /* Formes */
    --radius-s: 4px;
    --radius: 8px;
    --radius-l: 14px;
    --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 14px 30px -20px rgba(0, 0, 0, .8);
    --container: 1200px;
    --topbar: 64px;

    /* Typo */
    --font: 'Saira', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-display: 'Saira Stencil One', 'Saira', Impact, 'Arial Narrow', sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar) + 16px); }
body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--ground);
    color: var(--text);
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(201, 174, 124, .03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(201, 174, 124, .03) 1px, transparent 1px);
    background-size: 96px 96px;
}
img, svg, video { max-width: 100%; }
img { height: auto; }
main { flex: 1 0 auto; }

h1, h2, h3, h4 {
    margin: 0 0 .5em;
    font-family: var(--font);
    font-stretch: 78%;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: .005em;
    color: var(--text);
    text-wrap: balance;
}
h1 { font-size: clamp(2rem, 1.45rem + 2.4vw, 3rem); }
h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.9rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.25rem; }
a { color: var(--coyote); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--text); }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
strong { font-weight: 650; }
small, .small { font-size: .875rem; }
.xsmall { font-size: .8rem; }
.muted { color: var(--muted); }
.soft { color: var(--text-2); }
.num { font-variant-numeric: tabular-nums; }
.display { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; letter-spacing: .02em; line-height: .95; }
.prose { white-space: pre-line; overflow-wrap: anywhere; color: var(--text-2); }
.prose-plain { overflow-wrap: anywhere; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

:focus-visible { outline: 2px solid var(--blaze); outline-offset: 2px; border-radius: 2px; }
::selection { background: rgba(255, 107, 26, .35); color: #fff; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.hp { position: absolute !important; left: -10000px !important; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-link { position: absolute; left: 1rem; top: -60px; z-index: 100; padding: .6rem 1rem; background: var(--blaze); color: var(--blaze-ink); font-weight: 700; border-radius: var(--radius-s); }
.skip-link:focus { top: .75rem; }

.icon { flex: none; vertical-align: middle; }

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

/* ---------- Mise en page ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(1rem, 3.5vw, 2rem); }
.container-narrow { max-width: 760px; }
.container-tight { max-width: 520px; }
.page { padding-block: clamp(1.5rem, 4vw, 3rem) clamp(2.5rem, 6vw, 4.5rem); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: clamp(1.25rem, 3vw, 2rem); }
.page-head h1 { margin: 0; }
.page-head .lede { margin: .5rem 0 0; color: var(--text-2); max-width: 62ch; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-bottom: .75rem; font-size: .9rem; color: var(--muted); }
.breadcrumb a { color: var(--text-2); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); text-decoration: underline; }
.breadcrumb .sep { color: var(--line-2); }

.stack > * + * { margin-top: var(--stack, 1rem); }
.stack-lg { --stack: 1.75rem; }
.stack-sm { --stack: .5rem; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, .5rem); }
.cluster-lg { --gap: 1rem; }
.between { justify-content: space-between; }
.grid { display: grid; gap: var(--gap, 1rem); grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--min, 280px)), 1fr)); }
.grid-sm { --min: 200px; }
.grid-lg { --min: 340px; }
.split { display: grid; gap: 1.5rem; align-items: start; }
.split > * { min-width: 0; }
@media (min-width: 960px) {
    .split { grid-template-columns: minmax(0, 1fr) 340px; gap: 2rem; }
    .split-aside-left { grid-template-columns: 270px minmax(0, 1fr); }
    .sticky-aside { position: sticky; top: calc(var(--topbar) + 1.25rem); }
}
.section { margin-top: clamp(2.5rem, 6vw, 4rem); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 1.1rem; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 600; text-decoration: none; }
.section-head a:hover { text-decoration: underline; }

.mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.w-full { width: 100%; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.inline-form { display: inline; }
@media (max-width: 639px) { .hide-sm { display: none !important; } }
@media (min-width: 640px) { .show-sm { display: none !important; } }

/* ---------- Barre supérieure ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(21, 25, 19, .9);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: .75rem; min-height: var(--topbar); }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand img { width: 32px; height: 32px; }
.brand-name { font-family: var(--font-display); font-size: 1.3rem; letter-spacing: .03em; text-transform: uppercase; line-height: 1; }
.brand:hover { color: var(--text); }
@media (max-width: 380px) { .brand-name { font-size: 1.05rem; } }

.nav { display: none; }
.nav a {
    position: relative;
    padding: .5rem .8rem;
    border-radius: var(--radius-s);
    color: var(--text-2);
    font-weight: 550;
    text-decoration: none;
}
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: .8rem; right: .8rem; bottom: -13px; height: 2px; background: var(--blaze); }
@media (min-width: 960px) { .nav { display: flex; gap: .15rem; margin-left: 1.25rem; } }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .4rem; }
.icon-btn {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
    text-decoration: none;
}
.icon-btn:hover { background: var(--panel); color: var(--text); }
.icon-btn .count {
    position: absolute;
    top: 3px;
    right: 1px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--blaze);
    color: var(--blaze-ink);
    font-size: .72rem;
    font-weight: 800;
    line-height: 19px;
    text-align: center;
}
.nav-toggle { display: inline-grid; }
@media (min-width: 960px) { .nav-toggle { display: none; } }

/* Menu déroulant (details/summary : fonctionne sans JS) */
.menu { position: relative; }
.menu > summary {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .2rem .45rem .2rem .2rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
    list-style: none;
    color: var(--text-2);
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover, .menu[open] > summary { border-color: var(--line-2); color: var(--text); }
.menu-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
@media (max-width: 639px) { .menu-name, .menu > summary .icon { display: none; } .menu > summary { padding: .2rem; } }
.menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 50;
    min-width: 240px;
    padding: .4rem;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: 0 20px 50px -20px #000;
}
.menu-panel a, .menu-panel button {
    display: flex;
    align-items: center;
    gap: .65rem;
    width: 100%;
    padding: .6rem .7rem;
    border: 0;
    border-radius: var(--radius-s);
    background: none;
    color: var(--text-2);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.menu-panel a:hover, .menu-panel button:hover { background: var(--panel-2); color: var(--text); }
.menu-head { padding: .5rem .7rem .6rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; }
.menu-head strong { display: block; color: var(--text); }
.menu-sep { height: 1px; margin: .3rem 0; background: var(--line); }

/* Tiroir mobile */
.drawer {
    position: fixed;
    inset: var(--topbar) 0 0 0;
    z-index: 39;
    padding: 1rem clamp(1rem, 4vw, 2rem) calc(2rem + env(safe-area-inset-bottom));
    overflow-y: auto;
    background: var(--ground);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .25s ease, visibility .25s;
}
.drawer.is-open { transform: none; visibility: visible; }
.drawer nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem .25rem;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    font-size: 1.15rem;
    font-weight: 600;
    text-decoration: none;
}
.drawer nav a[aria-current="page"] { color: var(--blaze); }
.drawer .drawer-actions { display: grid; gap: .6rem; margin-top: 1.5rem; }
body.drawer-open { overflow: hidden; }
@media (min-width: 960px) { .drawer { display: none; } }

/* ---------- Panneaux ---------- */
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem 1rem;
    padding: .95rem 1.2rem;
    border-bottom: 1px solid var(--line);
}
.panel-head h2, .panel-head h3 { margin: 0; font-size: 1.15rem; }
.panel-body { padding: 1.2rem; }
.panel-foot { padding: .9rem 1.2rem; border-top: 1px solid var(--line); }
.panel-flush { padding: 0; }
.panel-danger { border-color: rgba(224, 88, 75, .4); }
.panel-danger .panel-head { border-bottom-color: rgba(224, 88, 75, .3); }
.panel-callout { border-left: 3px solid var(--blaze); }

.rows > * { border-bottom: 1px solid var(--line); }
.rows > *:last-child { border-bottom: 0; }
.row { display: flex; align-items: center; gap: .9rem; padding: .85rem 1.2rem; }
.row-link { color: inherit; text-decoration: none; transition: background .15s; }
.row-link:hover { background: var(--panel-2); color: inherit; }
.row-main { flex: 1; min-width: 0; }
.row-title { display: block; font-weight: 600; color: var(--text); }
.row-meta { display: flex; flex-wrap: wrap; gap: .15rem .9rem; font-size: .85rem; color: var(--muted); }
.row-actions { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; }
@media (max-width: 639px) {
    .row-stack-sm { flex-wrap: wrap; }
    .row-stack-sm .row-actions { width: 100%; justify-content: flex-start; }
}

.dl { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1rem; margin: 0; }
.dl dt { color: var(--muted); font-size: .9rem; }
.dl dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }

/* ---------- Boutons ---------- */
.btn {
    --bg: var(--panel-2);
    --fg: var(--text);
    --bd: var(--line-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 44px;
    padding: .55rem 1.1rem;
    border: 1px solid var(--bd);
    border-radius: var(--radius-s);
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font);
    font-size: .98rem;
    font-weight: 650;
    font-stretch: 88%;
    line-height: 1.2;
    letter-spacing: .01em;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { --bg: var(--line); color: var(--fg); }
.btn-primary { --bg: var(--blaze); --fg: var(--blaze-ink); --bd: var(--blaze); }
.btn-primary:hover { --bg: var(--blaze-hover); --bd: var(--blaze-hover); }
.btn-secondary { --bg: transparent; --fg: var(--coyote); --bd: var(--coyote-2); }
.btn-secondary:hover { --bg: rgba(201, 174, 124, .1); }
.btn-ghost { --bg: transparent; --bd: transparent; --fg: var(--text-2); }
.btn-ghost:hover { --bg: var(--panel); --fg: var(--text); }
.btn-ok { --bg: rgba(147, 181, 97, .12); --fg: #c4dd9b; --bd: rgba(147, 181, 97, .5); }
.btn-ok:hover { --bg: rgba(147, 181, 97, .22); }
.btn-danger { --bg: transparent; --fg: #f2958b; --bd: rgba(224, 88, 75, .55); }
.btn-danger:hover { --bg: rgba(224, 88, 75, .14); }
.btn-sm { min-height: 36px; padding: .35rem .75rem; font-size: .88rem; }
.btn-lg { min-height: 52px; padding: .75rem 1.5rem; font-size: 1.08rem; }
.btn-block { display: flex; width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; }
@media (max-width: 479px) { .btn-row-stack > .btn, .btn-row-stack > form, .btn-row-stack > form .btn { width: 100%; } }
.link-btn { padding: 0; border: 0; background: none; color: var(--coyote); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--text); }
.link-danger { color: #f2958b; }

/* ---------- Formulaires ---------- */
.form-grid { display: grid; gap: 1.1rem; }
@media (min-width: 640px) {
    .form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.form-grid .span-all { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.label { font-size: .93rem; font-weight: 600; color: var(--text); }
.req { color: var(--blaze); }
.input, .select, .textarea {
    width: 100%;
    min-height: 46px;
    padding: .6rem .85rem;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-s);
    background: var(--ground-2);
    color: var(--text);
    font-family: var(--font);
    font-size: 1rem; /* 16px : pas de zoom automatique sur iOS */
    line-height: 1.45;
    transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: #7c7e70; }
.input:hover, .select:hover, .textarea:hover { border-color: #56624f; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--coyote); box-shadow: 0 0 0 3px rgba(201, 174, 124, .2); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.textarea { min-height: 130px; resize: vertical; }
.select {
    appearance: none;
    padding-right: 2.4rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23c9ae7c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .8rem center;
}
.select option { background: var(--panel); color: var(--text); }
input[type="file"].input { padding: .55rem; cursor: pointer; }
input[type="file"].input::file-selector-button {
    margin-right: .8rem;
    padding: .45rem .9rem;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-s);
    background: var(--panel-2);
    color: var(--text);
    font: 600 .9rem var(--font);
    cursor: pointer;
}
input[type="datetime-local"].input, input[type="date"].input { color-scheme: dark; }
.hint { margin: 0; font-size: .86rem; color: var(--muted); }
.error { margin: 0; font-size: .88rem; color: #f2958b; }
.check { display: flex; align-items: flex-start; gap: .65rem; cursor: pointer; line-height: 1.45; }
.check input { flex: none; width: 20px; height: 20px; margin: .1rem 0 0; accent-color: var(--blaze); cursor: pointer; }
.fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.fieldset legend { margin-bottom: .75rem; padding: 0; font-weight: 700; font-stretch: 80%; font-size: 1.15rem; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .7rem; margin-top: 1.5rem; }
@media (max-width: 479px) { .form-actions > * { flex: 1 1 100%; } }
.input-group { display: flex; gap: .5rem; }
.input-group .input { flex: 1; min-width: 0; }
.search-bar { display: flex; flex-wrap: wrap; gap: .6rem; }
.search-bar .input { flex: 1 1 220px; }
.search-bar .select { flex: 0 1 200px; }

/* Choix visuels (radios en cartes) */
.choice-grid { display: grid; gap: .6rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    padding: .8rem;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    background: var(--ground-2);
    font-weight: 600;
    text-align: center;
    transition: border-color .15s, background .15s;
}
.choice input:focus-visible + span { outline: 2px solid var(--blaze); outline-offset: 2px; }
.choice input:checked + span { border-color: var(--coyote); background: rgba(201, 174, 124, .1); color: var(--text); }
.choice-positive input:checked + span { border-color: var(--foliage); background: rgba(147, 181, 97, .12); }
.choice-negative input:checked + span { border-color: var(--danger); background: rgba(224, 88, 75, .12); }
.eval-form .reasons { display: none; }
.eval-form:has(input[value="positive"]:checked) .reasons-positive,
.eval-form:has(input[value="negative"]:checked) .reasons-negative { display: flex; }
.eval-form .eval-extra { display: none; }
.eval-form:has(input[name="type"]:checked) .eval-extra { display: grid; }

/* Autocomplétion joueurs */
.autocomplete { position: relative; }
.autocomplete-list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 30;
    margin: 0;
    padding: .3rem;
    list-style: none;
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: 0 20px 40px -20px #000;
}
.autocomplete-list[hidden] { display: none; }
.autocomplete-list li { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; border-radius: var(--radius-s); cursor: pointer; }
.autocomplete-list li[aria-selected="true"], .autocomplete-list li:hover { background: var(--panel-2); }
.autocomplete-list .tag { margin-left: auto; }

/* ---------- Badges, tags ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .12rem .55rem;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: var(--ground-2);
    color: var(--text-2);
    font-size: .78rem;
    font-weight: 650;
    line-height: 1.5;
    white-space: nowrap;
}
.badge-ok { color: #c4dd9b; border-color: rgba(147, 181, 97, .45); background: rgba(147, 181, 97, .1); }
.badge-warn { color: #f3d185; border-color: rgba(232, 181, 74, .45); background: rgba(232, 181, 74, .1); }
.badge-danger { color: #f6a79e; border-color: rgba(224, 88, 75, .5); background: rgba(224, 88, 75, .1); }
.badge-info { color: #b3cde4; border-color: rgba(134, 170, 203, .45); background: rgba(134, 170, 203, .1); }
.badge-blaze { color: #ffab7c; border-color: rgba(255, 107, 26, .55); background: rgba(255, 107, 26, .1); }
.badge-coyote { color: var(--coyote); border-color: rgba(201, 174, 124, .45); background: rgba(201, 174, 124, .08); }
.tag { font-weight: 800; font-stretch: 75%; letter-spacing: .06em; color: var(--coyote); white-space: nowrap; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--blaze); }

/* ---------- Avatars ---------- */
.avatar {
    --s: 40px;
    --h: 90;
    display: inline-grid;
    place-items: center;
    flex: none;
    width: var(--s);
    height: var(--s);
    overflow: hidden;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    background: hsl(var(--h) 18% 22%);
    color: hsl(var(--h) 40% 78%);
    font-size: calc(var(--s) * .38);
    font-weight: 800;
    font-stretch: 75%;
    line-height: 1;
    object-fit: cover;
    user-select: none;
}
.avatar-xs { --s: 26px; border-radius: 6px; }
.avatar-sm { --s: 34px; }
.avatar-lg { --s: 64px; }
.avatar-xl { --s: 108px; border-radius: var(--radius-l); }
.user-chip { display: inline-flex; align-items: center; gap: .55rem; min-width: 0; color: var(--text); text-decoration: none; font-weight: 600; }
.user-chip:hover { color: var(--coyote); }
.user-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -8px; border: 2px solid var(--panel); }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ---------- Messages flash ---------- */
.toasts {
    position: fixed;
    z-index: 70;
    top: calc(var(--topbar) + 12px);
    left: 1rem;
    right: 1rem;
    display: grid;
    gap: .5rem;
    pointer-events: none;
}
@media (min-width: 640px) { .toasts { left: auto; width: 400px; } }
.alert {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .85rem 1rem;
    border: 1px solid var(--line-2);
    border-left-width: 4px;
    border-radius: var(--radius);
    background: var(--panel-2);
    color: var(--text);
    box-shadow: 0 20px 40px -24px #000;
    pointer-events: auto;
    transition: opacity .25s, transform .25s;
}
.alert p { margin: 0; }
.alert-ok { border-left-color: var(--foliage); }
.alert-error { border-left-color: var(--danger); }
.alert-info { border-left-color: var(--info); }
.alert-warn { border-left-color: var(--warn); }
.alert .alert-close { margin-left: auto; padding: 0 .2rem; border: 0; background: none; color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.alert.is-leaving { opacity: 0; transform: translateY(-6px); }
.notice { padding: .9rem 1.1rem; border: 1px solid var(--line-2); border-left: 4px solid var(--info); border-radius: var(--radius); background: var(--ground-2); color: var(--text-2); }
.notice p:last-child { margin-bottom: 0; }
.notice-warn { border-left-color: var(--warn); }
.notice-danger { border-left-color: var(--danger); }
.notice-ok { border-left-color: var(--foliage); }
.notice-blaze { border-left-color: var(--blaze); }

/* ---------- Onglets ---------- */
.tabs {
    display: flex;
    gap: .15rem;
    margin-bottom: 1.25rem;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin-bottom: -1px;
    padding: .75rem 1rem;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--text-2);
    font: 600 .98rem var(--font);
    text-decoration: none;
    cursor: pointer;
}
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs [aria-selected="true"], .tabs [aria-current="page"] { color: var(--text); border-bottom-color: var(--blaze); }
[role="tabpanel"][hidden] { display: none; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { padding: .65rem 1rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .84rem; font-weight: 600; text-align: left; white-space: nowrap; }
.table td { padding: .75rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(255, 255, 255, .015); }
@media (max-width: 759px) {
    .table-stack thead { display: none; }
    .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
    .table-stack tr { padding: .6rem 0; border-bottom: 1px solid var(--line); }
    .table-stack tr:last-child { border-bottom: 0; }
    .table-stack td { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .35rem 1rem; border: 0; text-align: right; }
    .table-stack td::before { content: attr(data-label); color: var(--muted); font-size: .85rem; text-align: left; }
    .table-stack td[data-label=""]::before { display: none; }
}

/* ---------- États vides ---------- */
.empty { padding: clamp(2rem, 6vw, 3.5rem) 1.25rem; text-align: center; color: var(--text-2); }
.empty .icon { color: var(--coyote-2); margin-bottom: .6rem; }
.empty h3 { margin-bottom: .35rem; }
.empty p { max-width: 46ch; margin: 0 auto 1rem; color: var(--muted); }

/* ---------- Hero accueil ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); background: radial-gradient(ellipse 70% 80% at 72% 35%, rgba(201, 174, 124, .07), transparent 70%), var(--ground); }
.hero-topo {
    position: absolute;
    inset: 0;
    background: url("../images/topo.svg") 65% 40% / cover no-repeat;
    -webkit-mask-image: linear-gradient(100deg, transparent 5%, rgba(0, 0, 0, .55) 40%, #000 70%);
    mask-image: linear-gradient(100deg, transparent 5%, rgba(0, 0, 0, .55) 40%, #000 70%);
    pointer-events: none;
}
.hero-inner { position: relative; display: grid; gap: 2.25rem; padding-block: clamp(2.75rem, 8vw, 6rem) clamp(2.5rem, 6vw, 4.5rem); }
@media (min-width: 960px) { .hero-inner { grid-template-columns: minmax(0, 1.25fr) minmax(0, .85fr); align-items: end; gap: 3rem; } }
.hero h1 {
    max-width: 11ch;
    margin: 0 0 1.2rem;
    font-family: var(--font-display);
    font-size: clamp(2.9rem, 1.3rem + 7vw, 6.2rem);
    font-weight: 400;
    line-height: .9;
    letter-spacing: .005em;
    text-transform: uppercase;
}
.hero .lede { max-width: 50ch; margin-bottom: 1.75rem; color: var(--text-2); font-size: clamp(1.05rem, .98rem + .35vw, 1.22rem); }
.hero-region { display: inline-flex; align-items: center; gap: .5rem; margin-bottom: 1.1rem; color: var(--coyote); font-weight: 600; }
.hero-region::before { content: ""; width: 26px; height: 2px; background: var(--blaze); }

/* Ordre de mission (prochaine partie) */
.mission {
    position: relative;
    display: block;
    padding: 1.35rem 1.35rem 1.2rem;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    background: rgba(33, 40, 32, .88);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: var(--text);
    text-decoration: none;
    box-shadow: 0 30px 60px -30px #000;
    transition: border-color .15s;
}
.mission:hover { border-color: var(--coyote-2); color: var(--text); }
.mission::before, .mission::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid var(--blaze); }
.mission::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: var(--radius); }
.mission::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: var(--radius); }
.mission-kicker { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; color: var(--coyote); font-size: .9rem; font-weight: 600; }
.mission h2 { margin: 0 0 .75rem; font-size: clamp(1.45rem, 1.2rem + 1vw, 1.9rem); }
.mission .dl { margin-bottom: 1rem; font-size: .95rem; }

/* ---------- Cartes de partie ---------- */
.event-list { display: grid; gap: .75rem; }
.event-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .9rem 1.1rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    color: inherit;
    text-decoration: none;
    transition: border-color .15s, background .15s;
}
.event-card:hover { border-color: var(--coyote-2); color: inherit; }
.event-card.is-past { opacity: .78; }
.event-card.is-cancelled .event-title { text-decoration: line-through; text-decoration-color: var(--danger); }
.event-date {
    display: grid;
    align-content: center;
    width: 66px;
    padding: .45rem 0;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-s);
    background: var(--ground-2);
    text-align: center;
    line-height: 1.1;
}
.event-date .d { font-family: var(--font-display); font-size: 1.95rem; line-height: 1; color: var(--text); }
.event-date .m { font-size: .8rem; font-weight: 700; color: var(--coyote); }
.event-date .w { font-size: .75rem; color: var(--muted); }
.event-top { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; font-size: .88rem; color: var(--muted); }
.event-title { margin: .15rem 0 .25rem; font-size: 1.22rem; }
.event-where { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .45rem; margin: 0; color: var(--text-2); font-size: .93rem; }
.event-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.1rem; margin-top: .65rem; font-size: .9rem; color: var(--text-2); }
.price { font-weight: 750; font-stretch: 82%; color: var(--text); }
.gauge { display: flex; align-items: center; gap: .6rem; min-width: 150px; }
.gauge-bar { flex: 1; height: 6px; min-width: 70px; max-width: 160px; overflow: hidden; border-radius: 3px; background: var(--ground-2); box-shadow: inset 0 0 0 1px var(--line); }
.gauge-bar span { display: block; width: var(--fill, 0%); height: 100%; background: var(--foliage); }
.gauge.is-high .gauge-bar span { background: var(--warn); }
.gauge.is-full .gauge-bar span { background: var(--danger); }
@media (min-width: 760px) {
    .event-card { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
    .event-side { text-align: right; }
}
.event-side { display: flex; flex-direction: column; gap: .35rem; }
@media (max-width: 759px) { .event-side { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: center; } }
.month-label { margin: 1.75rem 0 .75rem; color: var(--coyote); font-size: 1.05rem; font-weight: 700; font-stretch: 80%; }
.month-label:first-child { margin-top: 0; }

/* Détail de partie */
.cover { position: relative; aspect-ratio: 21 / 9; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--ground-2) url("../images/topo.svg") center / cover; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 639px) { .cover { aspect-ratio: 16 / 9; } }
.facts { display: grid; gap: .1rem; }
.fact { display: flex; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.fact:last-child { border-bottom: 0; }
.fact .icon { margin-top: .2rem; color: var(--coyote); }
.fact-label { display: block; font-size: .83rem; color: var(--muted); }
.fact-value { font-weight: 600; overflow-wrap: anywhere; }

/* ---------- Escouades ---------- */
.squad-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    color: inherit;
    text-decoration: none;
    transition: border-color .15s;
}
.squad-card:hover { border-color: var(--coyote-2); color: inherit; }
.emblem {
    display: grid;
    place-items: center;
    flex: none;
    width: 58px;
    height: 58px;
    overflow: hidden;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    background: var(--ground-2);
    color: var(--coyote);
    font-weight: 800;
    font-stretch: 70%;
    font-size: 1.05rem;
    letter-spacing: .04em;
}
.emblem img { width: 100%; height: 100%; object-fit: cover; }
.emblem-xl { width: 112px; height: 112px; font-size: 1.8rem; border-radius: var(--radius-l); }
.squad-card h3 { margin: 0 0 .2rem; font-size: 1.12rem; }
.squad-banner { position: relative; height: clamp(140px, 24vw, 260px); overflow: hidden; border-bottom: 1px solid var(--line); background: var(--ground-2) url("../images/topo.svg") 70% 40% / cover; }
.squad-banner img { width: 100%; height: 100%; object-fit: cover; }
.squad-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(21, 25, 19, .9)); }
.squad-identity { position: relative; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem 1.5rem; margin-top: -56px; }
.squad-identity .emblem-xl { border: 3px solid var(--ground); box-shadow: 0 10px 30px -10px #000; }
.squad-identity h1 { margin: 0; }
.member-list { display: grid; gap: .35rem; }
.member { display: flex; align-items: center; gap: .7rem; padding: .45rem 0; }

/* ---------- Annonces ---------- */
.listing-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    color: inherit;
    text-decoration: none;
    transition: border-color .15s;
}
.listing-card:hover { border-color: var(--coyote-2); color: inherit; }
.listing-photo { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--ground-2); }
.listing-photo img { width: 100%; height: 100%; object-fit: cover; }
.listing-photo .placeholder { display: grid; place-items: center; width: 100%; height: 100%; color: var(--line-2); }
.listing-photo .badge { position: absolute; top: .6rem; left: .6rem; }
.listing-body { display: flex; flex: 1; flex-direction: column; gap: .3rem; padding: .85rem 1rem 1rem; }
.listing-body h3 { margin: 0; font-size: 1.05rem; line-height: 1.3; }
.listing-price { font-size: 1.3rem; font-weight: 800; font-stretch: 78%; color: var(--text); }
.listing-meta { margin-top: auto; padding-top: .35rem; display: flex; flex-wrap: wrap; gap: .2rem .8rem; font-size: .84rem; color: var(--muted); }
.photo-main { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius); background: var(--ground-2); border: 1px solid var(--line); }
.photo-main img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
.thumbs { display: flex; gap: .5rem; margin-top: .6rem; overflow-x: auto; padding-bottom: .25rem; }
.thumbs button { flex: none; width: 76px; height: 58px; padding: 0; overflow: hidden; border: 2px solid transparent; border-radius: var(--radius-s); background: var(--ground-2); cursor: pointer; }
.thumbs button[aria-current="true"] { border-color: var(--coyote); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.contact-box { padding: .9rem 1rem; border: 1px dashed var(--coyote-2); border-radius: var(--radius); background: rgba(201, 174, 124, .06); font-weight: 600; overflow-wrap: anywhere; }

/* ---------- Galerie + visionneuse ---------- */
.gallery { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.gallery-item { position: relative; }
.gallery-item > a { display: block; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--ground-2); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.gallery-item > a:hover img { transform: scale(1.04); }
.gallery-item form { position: absolute; top: .35rem; right: .35rem; }
.gallery-item .icon-btn { width: 32px; height: 32px; background: rgba(21, 25, 19, .85); border-color: var(--line-2); }
.lightbox { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 3.5rem 1rem; background: rgba(9, 11, 8, .95); }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(94vw, 1500px); max-height: 82vh; max-height: 82dvh; object-fit: contain; border-radius: var(--radius-s); user-select: none; }
.lightbox .icon-btn { position: fixed; background: rgba(33, 40, 32, .9); border-color: var(--line-2); color: var(--text); }
.lb-close { top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); }
.lb-prev { left: max(10px, env(safe-area-inset-left)); top: 50%; transform: translateY(-50%); }
.lb-next { right: max(10px, env(safe-area-inset-right)); top: 50%; transform: translateY(-50%); }
.lb-count { position: fixed; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); color: var(--text-2); font-size: .9rem; }

/* ---------- Forum ---------- */
.forum-cat { display: grid; grid-template-columns: 6px minmax(0, 1fr); gap: 1rem; padding: 1rem 1.2rem; color: inherit; text-decoration: none; }
.forum-cat:hover { background: var(--panel-2); color: inherit; }
.forum-cat .bar { border-radius: 3px; background: var(--c, var(--coyote)); }
.forum-cat h3 { margin: 0 0 .15rem; font-size: 1.12rem; }
.forum-cat p { margin: 0; color: var(--text-2); font-size: .93rem; }
.forum-cat-meta { display: flex; flex-wrap: wrap; gap: .2rem 1rem; margin-top: .45rem; font-size: .84rem; color: var(--muted); }
@media (min-width: 760px) {
    .forum-cat { grid-template-columns: 6px minmax(0, 1fr) 260px; align-items: center; }
    .forum-cat-last { font-size: .88rem; color: var(--muted); }
}
.forum-cat-last { grid-column: 2 / -1; }
@media (min-width: 760px) { .forum-cat-last { grid-column: auto; } }
.thread-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .35rem .9rem; align-items: center; padding: .9rem 1.2rem; color: inherit; text-decoration: none; }
.thread-row:hover { background: var(--panel-2); color: inherit; }
.thread-row .row-title { font-size: 1.02rem; }
.thread-stats { grid-column: 2; display: flex; gap: 1rem; font-size: .85rem; color: var(--muted); }
@media (min-width: 760px) {
    .thread-row { grid-template-columns: auto minmax(0, 1fr) 150px 180px; }
    .thread-stats { grid-column: auto; flex-direction: column; gap: 0; text-align: right; }
}
.thread-last { grid-column: 2; font-size: .85rem; color: var(--muted); }
@media (min-width: 760px) { .thread-last { grid-column: auto; } }
.post { display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.post-author { display: flex; align-items: center; gap: .75rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--line); background: var(--ground-2); }
.post-author .who { min-width: 0; }
.post-body { min-width: 0; padding: 1.1rem 1.25rem; }
.post-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; margin-bottom: .75rem; font-size: .85rem; color: var(--muted); }
.post-text { white-space: pre-line; overflow-wrap: anywhere; color: var(--text); }
.post-actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 1rem; font-size: .9rem; }
.post.is-op { border-color: var(--line-2); }
@media (min-width: 760px) {
    .post { grid-template-columns: 190px minmax(0, 1fr); }
    .post-author { flex-direction: column; align-items: flex-start; border-bottom: 0; border-right: 1px solid var(--line); }
}

/* ---------- Profil ---------- */
.profile-head { display: grid; gap: 1.25rem; align-items: center; }
@media (min-width: 760px) { .profile-head { grid-template-columns: auto minmax(0, 1fr) auto; } }
.profile-head h1 { margin: 0 0 .3rem; }
.trust { --tc: var(--muted); display: inline-flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.trust-1 { --tc: var(--danger); } .trust-2 { --tc: #f0904a; } .trust-3 { --tc: var(--warn); } .trust-4 { --tc: #b9cf6e; } .trust-5 { --tc: var(--foliage); }
.stars { display: inline-flex; gap: 2px; color: var(--line-2); }
.stars svg { width: 17px; height: 17px; fill: currentColor; }
.stars .on { color: var(--tc); }
.stars .half { color: var(--tc); opacity: .45; }
.trust-score { font-weight: 800; color: var(--tc); font-variant-numeric: tabular-nums; }
.trust-label { color: var(--tc); font-weight: 600; }
.stat-line { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.stat-line div { display: flex; flex-direction: column; }
.stat-line strong { font-size: 1.3rem; font-stretch: 78%; }
.stat-line span { font-size: .85rem; color: var(--muted); }

/* ---------- Notifications ---------- */
.notif { display: flex; gap: .9rem; align-items: flex-start; padding: .95rem 1.2rem; color: inherit; text-decoration: none; }
.notif:hover { background: var(--panel-2); color: inherit; }
.notif .icon { margin-top: .15rem; color: var(--muted); }
.notif.is-unread { background: rgba(255, 107, 26, .045); }
.notif.is-unread .icon { color: var(--blaze); }
.notif-title { display: block; font-weight: 650; color: var(--text); }
.notif-body { display: block; color: var(--text-2); font-size: .94rem; }
.notif-time { display: block; margin-top: .15rem; font-size: .8rem; color: var(--muted); }

/* ---------- Règlement ---------- */
.rules-toc { display: grid; gap: .1rem; margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.rules-toc a { display: flex; gap: .6rem; padding: .45rem .6rem; border-radius: var(--radius-s); color: var(--text-2); text-decoration: none; }
.rules-toc a:hover { background: var(--panel-2); color: var(--text); }
.rules-toc a::before { counter-increment: toc; content: counter(toc); min-width: 1.4rem; color: var(--coyote); font-weight: 700; font-variant-numeric: tabular-nums; }
.rules-section { counter-reset: rule; }
.rules-section + .rules-section { margin-top: 1.5rem; }
.rules-section h2 { display: flex; align-items: baseline; gap: .7rem; }
.rules-section h2 .num { color: var(--blaze); font-family: var(--font-display); font-weight: 400; }
.rule { padding: .9rem 0; border-top: 1px solid var(--line); }
.rule h3 { margin: 0 0 .3rem; font-size: 1.08rem; }
.rule p { margin: 0; white-space: pre-line; color: var(--text-2); }

/* ---------- Administration ---------- */
.admin-nav { display: flex; gap: .15rem; overflow-x: auto; margin-bottom: 1.5rem; padding-bottom: .25rem; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.admin-nav a { flex: none; display: inline-flex; align-items: center; gap: .45rem; padding: .65rem .9rem; border-bottom: 2px solid transparent; color: var(--text-2); font-weight: 600; text-decoration: none; margin-bottom: -1px; }
.admin-nav a:hover { color: var(--text); }
.admin-nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--blaze); }
.stats { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.stat { padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.stat strong { display: block; font-size: 1.9rem; font-stretch: 75%; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .9rem; }
.stat.is-alert { border-color: rgba(255, 107, 26, .5); }
.stat.is-alert strong { color: var(--blaze); }
.toggle-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; padding: .9rem 1.2rem; }
.state { display: inline-flex; align-items: center; gap: .45rem; font-weight: 650; }
.state::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--foliage); }
.state.is-off::before { background: var(--danger); }
.code { padding: .1rem .35rem; border-radius: 3px; background: var(--ground-2); font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: .88em; }

/* ---------- Authentification ---------- */
.auth-shell { display: grid; min-height: calc(100vh - var(--topbar)); min-height: calc(100dvh - var(--topbar)); }
@media (min-width: 960px) { .auth-shell { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.auth-visual { position: relative; display: none; overflow: hidden; border-right: 1px solid var(--line); background: var(--ground-2) url("../images/topo.svg") 70% 45% / cover no-repeat; }
.auth-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(21, 25, 19, .95), rgba(21, 25, 19, .15) 60%); }
.auth-visual .inner { position: absolute; left: clamp(2rem, 5vw, 4rem); right: 2rem; bottom: clamp(2rem, 6vw, 4rem); z-index: 1; }
.auth-visual .display { font-size: clamp(2.8rem, 4.5vw, 4.4rem); margin: 0 0 .75rem; }
.auth-visual p { max-width: 42ch; margin: 0; color: var(--text-2); }
@media (min-width: 960px) { .auth-visual { display: block; } }
.auth-main { display: grid; place-items: center; padding: clamp(1.5rem, 5vw, 3rem) clamp(1rem, 4vw, 2rem); }
.auth-card { width: 100%; max-width: 440px; }
.auth-card h1 { font-size: clamp(1.8rem, 1.5rem + 1.2vw, 2.3rem); }
.auth-alt { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--text-2); text-align: center; }

/* ---------- Pagination ---------- */
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4rem; margin-top: 1.75rem; }
.page-numbers { display: flex; flex-wrap: wrap; gap: .3rem; }
.page-link { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-width: 42px; height: 42px; padding: 0 .8rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel); color: var(--text-2); font-weight: 600; text-decoration: none; }
.page-link:hover { border-color: var(--line-2); color: var(--text); }
.page-link.is-current { border-color: var(--blaze); background: rgba(255, 107, 26, .12); color: var(--text); }
.page-link.is-disabled { opacity: .45; }
.page-link.is-dots { border-color: transparent; background: none; }
@media (max-width: 479px) { .page-numbers .page-link:not(.is-current) { display: none; } }

/* ---------- Fenêtres modales ---------- */
dialog.modal {
    width: min(560px, calc(100% - 2rem));
    max-height: calc(100dvh - 2rem);
    padding: 0;
    overflow: auto;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-l);
    background: var(--panel);
    color: var(--text);
    box-shadow: 0 40px 90px -30px #000;
}
dialog.modal::backdrop { background: rgba(9, 11, 8, .72); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 1.25rem; }
.modal-body { padding: 1.25rem; }

/* ---------- Pied de page ---------- */
.footer { margin-top: auto; padding-block: 2rem calc(2rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; }
.footer nav { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; }
.footer a { color: var(--text-2); text-decoration: none; }
.footer a:hover { color: var(--text); text-decoration: underline; }

/* ---------- Page de maintenance / erreurs ---------- */
.standalone { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 2rem 1rem; background: var(--ground) url("../images/topo.svg") center / cover no-repeat; }
.standalone-card { width: 100%; max-width: 560px; padding: clamp(1.5rem, 5vw, 2.5rem); border: 1px solid var(--line-2); border-radius: var(--radius-l); background: rgba(33, 40, 32, .94); box-shadow: 0 40px 90px -30px #000; }
.standalone-card .display { margin: .5rem 0 1rem; font-size: clamp(2.4rem, 1.6rem + 4vw, 3.8rem); }
.standalone-code { color: var(--blaze); font-family: var(--font-display); font-size: 1.1rem; letter-spacing: .1em; }

/* ---------- Impression ---------- */
@media print {
    .topbar, .drawer, .footer, .toasts, .btn, form { display: none !important; }
    body { background: #fff; color: #000; }
    body::before { display: none; }
    .panel { border-color: #ccc; box-shadow: none; background: #fff; }
}

/* ---------- Aperçus d'upload ---------- */
.previews { display: flex; flex-wrap: wrap; gap: .5rem; }
.previews:empty { display: none; }
.preview-thumb { width: 88px; height: 66px; overflow: hidden; border: 1px solid var(--line-2); border-radius: var(--radius-s); background: var(--ground-2); }
.preview-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-edit { display: flex; flex-wrap: wrap; gap: .6rem; }
.photo-edit figure { position: relative; width: 110px; margin: 0; }
.photo-edit img { width: 110px; height: 82px; object-fit: cover; border: 1px solid var(--line-2); border-radius: var(--radius-s); }
.photo-edit form { position: absolute; top: 4px; right: 4px; }
.photo-edit .icon-btn { width: 30px; height: 30px; background: rgba(21, 25, 19, .88); border-color: var(--line-2); }

/* ---------- Compléments ---------- */
.h3 { font-size: 1.2rem; }
h2.h3 { display: flex; align-items: center; gap: .45rem; }
.event-where .truncate { max-width: 100%; }
dialog.modal .form-actions { flex-wrap: wrap; }

/* ---------- Bandeau de démonstration ---------- */
.demo-banner { background: repeating-linear-gradient(-45deg, rgba(255, 107, 26, .16) 0 12px, rgba(255, 107, 26, .08) 12px 24px); border-bottom: 1px solid rgba(255, 107, 26, .45); color: var(--text); font-size: .9rem; padding: .55rem 0; }
.demo-banner strong { color: var(--blaze); }
