/* =====================================================================
   Garmin Explorer — Feuille de style compilée
   Thème sombre premium · glassmorphism · responsive
   (Source Tailwind : src/css/input.css — voir README pour rebuild)
   ===================================================================== */

:root {
    --bg: #0b1120;
    --bg-2: #0f172a;
    --bg-3: #131c30;
    --surface: rgba(255, 255, 255, 0.055);
    --surface-2: rgba(255, 255, 255, 0.09);
    --border: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.18);
    --text: #eaf1fb;
    --muted: #93a4bd;
    --muted-2: #6b7c96;
    --accent: #34d399;
    --accent-2: #38bdf8;
    --danger: #fb7185;
    --warning: #fbbf24;
    --radius: 18px;
    --radius-sm: 12px;
    --radius-lg: 26px;
    --shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.55);
    --shadow-sm: 0 8px 24px -8px rgba(0, 0, 0, 0.5);
    --glass-blur: saturate(160%) blur(18px);
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Sora', var(--font);
    --nav-h: 64px;
}

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

html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html.is-mapview, html.is-mapview body { height: 100%; overflow: hidden; }

body {
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(1200px 800px at 80% -10%, rgba(56, 189, 248, 0.10), transparent 60%),
        radial-gradient(1000px 700px at -10% 20%, rgba(52, 211, 153, 0.08), transparent 55%),
        var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
ul, ol { margin: 0; padding: 0; list-style: none; }

::selection { background: rgba(52, 211, 153, 0.3); }

.skip-link {
    position: absolute; left: -999px; top: 0; z-index: 1000;
    background: var(--accent); color: #042018; padding: 10px 16px; border-radius: 0 0 10px 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

/* --------------------------- Glass ---------------------------------- */
.glass {
    background: var(--surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
}

/* --------------------------- Boutons -------------------------------- */
.btn {
    --bh: 44px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: var(--bh); padding: 0 18px; border-radius: 999px;
    border: 1px solid transparent; font-weight: 600; font-size: 0.95rem;
    color: var(--text); background: var(--surface-2); transition: all 0.18s ease;
    white-space: nowrap;
}
.btn svg { flex: none; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #04241b; border: none;
    box-shadow: 0 8px 24px -6px rgba(52, 211, 153, 0.5);
}
.btn--primary:hover { box-shadow: 0 12px 30px -6px rgba(52, 211, 153, 0.6); }
.btn--ghost { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn--danger { background: rgba(251, 113, 133, 0.15); color: #fecdd3; border: 1px solid rgba(251, 113, 133, 0.35); }
.btn--danger:hover { background: rgba(251, 113, 133, 0.25); }
.btn--sm { --bh: 36px; padding: 0 14px; font-size: 0.86rem; }
.btn--xs { --bh: 30px; padding: 0 10px; font-size: 0.78rem; }
.btn--block { width: 100%; }

/* --------------------------- Badges / chips ------------------------- */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 11px; border-radius: 999px; font-size: 0.76rem; font-weight: 600;
    background: var(--surface-2); border: 1px solid var(--border);
}
.badge--type { color: var(--type-color, var(--accent)); border-color: color-mix(in srgb, var(--type-color, var(--accent)) 40%, transparent); background: color-mix(in srgb, var(--type-color, var(--accent)) 16%, transparent); }
.badge--diff { color: var(--diff-color, var(--warning)); border-color: color-mix(in srgb, var(--diff-color, var(--warning)) 40%, transparent); background: color-mix(in srgb, var(--diff-color, var(--warning)) 14%, transparent); }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* --------------------------- Top nav -------------------------------- */
.topnav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 500;
    height: var(--nav-h);
    border-left: none; border-right: none; border-top: none;
}
.topnav__inner {
    max-width: 1320px; margin: 0 auto; height: 100%;
    display: flex; align-items: center; gap: 20px; padding: 0 20px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.12rem; letter-spacing: -0.02em; }
.brand__mark {
    display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #04241b;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 6px 18px -4px rgba(52, 211, 153, 0.5);
}
.topnav__links { display: flex; gap: 4px; margin-left: 14px; }
.navlink { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; transition: 0.15s; }
.navlink:hover { color: var(--text); background: var(--surface); }
.navlink.is-active { color: var(--text); background: var(--surface-2); }
.topnav__actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topnav__burger { display: none; flex-direction: column; gap: 4px; background: none; border: none; padding: 8px; }
.topnav__burger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: 0.2s; }
.topnav__mobile { display: none; flex-direction: column; padding: 8px 20px 16px; gap: 4px; }
.topnav__mobile a { padding: 12px 14px; border-radius: 12px; color: var(--muted); }
.topnav__mobile a.is-active, .topnav__mobile a:hover { background: var(--surface); color: var(--text); }

/* --------------------------- Main / containers ---------------------- */
.main { padding-top: var(--nav-h); }
body.page-map .main { padding-top: 0; }
.container { max-width: 1100px; margin: 0 auto; padding: calc(var(--nav-h) + 32px) 20px 80px; }
.container--wide { max-width: 1320px; }

.pagehead { margin-bottom: 28px; }
.pagehead__title { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.pagehead__sub { color: var(--muted); margin: 8px 0 0; font-size: 1.05rem; }

/* =====================================================================
   CARTE D'ACCUEIL (page-map)
   ===================================================================== */
.mapview { position: fixed; inset: 0; }
.mapview__canvas { position: absolute; inset: 0; background: var(--bg-2); }
.maplibregl-map { font-family: var(--font); }
.maplibregl-ctrl-group { background: var(--surface-2) !important; backdrop-filter: var(--glass-blur); border: 1px solid var(--border) !important; }
.maplibregl-ctrl-group button { filter: invert(1) hue-rotate(180deg); }

.mapnotice {
    position: absolute; top: calc(var(--nav-h) + 14px); left: 50%; transform: translateX(-50%);
    z-index: 30; max-width: 560px; padding: 12px 18px; border-radius: 14px; font-size: 0.88rem; color: var(--muted);
    box-shadow: var(--shadow-sm); animation: fadeDown 0.5s ease;
}
.mapnotice code { color: var(--accent); background: rgba(52,211,153,0.12); padding: 1px 6px; border-radius: 6px; }

/* Panneau latéral */
.mapview__panel {
    position: absolute; top: calc(var(--nav-h) + 14px); left: 14px; bottom: 14px; z-index: 40;
    width: 380px; max-width: calc(100vw - 28px);
    border-radius: var(--radius-lg); box-shadow: var(--shadow);
    display: flex; flex-direction: column; overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.mapview__panel.is-collapsed { transform: translateX(calc(-100% - 20px)); }
.mapview__panel-toggle {
    position: absolute; top: 16px; right: 14px; z-index: 5;
    width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}
.mapview__panel.is-collapsed .mapview__panel-toggle { transform: rotate(180deg); right: -48px; background: var(--surface-2); }

.hero { padding: 26px 24px 14px; }
.hero__title { font-size: 2rem; line-height: 1.05; background: linear-gradient(120deg, #fff, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__sub { color: var(--muted); margin: 8px 0 18px; font-size: 0.92rem; }
.hero__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hero__stats div { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px; text-align: center; }
.hero__stats strong { display: block; font-family: var(--font-display); font-size: 1.15rem; }
.hero__stats span { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

.mapview__results { flex: 1; display: flex; flex-direction: column; min-height: 0; border-top: 1px solid var(--border); margin-top: 8px; }
.mapview__results-head { padding: 12px 24px; font-size: 0.82rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.mapview__results-head [data-results-count] { color: var(--accent); font-weight: 700; }
.mapview__list { flex: 1; overflow-y: auto; padding: 0 14px 14px; display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin; }
.listitem {
    display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center;
    padding: 10px; border-radius: 14px; background: var(--surface); border: 1px solid transparent; transition: 0.15s; cursor: pointer;
}
.listitem:hover, .listitem.is-active { background: var(--surface-2); border-color: var(--border-strong); }
.listitem__thumb { width: 56px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--bg-3); }
.listitem__body { min-width: 0; }
.listitem__name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.listitem__meta { font-size: 0.76rem; color: var(--muted); display: flex; gap: 8px; }
.listitem__type { width: 8px; height: 8px; border-radius: 50%; }

/* Contrôles carte */
.mapctl { position: absolute; right: 14px; top: calc(var(--nav-h) + 14px); z-index: 40; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.mapctl__group { display: flex; background: var(--surface-2); backdrop-filter: var(--glass-blur); border: 1px solid var(--border); border-radius: 999px; padding: 4px; box-shadow: var(--shadow-sm); }
.mapctl__btn { border: none; background: transparent; color: var(--muted); padding: 7px 16px; border-radius: 999px; font-weight: 600; font-size: 0.82rem; transition: 0.15s; }
.mapctl__btn.is-active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #04241b; }
.mapctl__icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); backdrop-filter: var(--glass-blur); border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow-sm); }
.mapctl__icon.is-active { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

/* Légende */
.maplegend { position: absolute; right: 14px; bottom: 14px; z-index: 40; border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow-sm); max-width: 200px; }
.maplegend__head { background: none; border: none; color: var(--text); font-weight: 700; font-family: var(--font-display); font-size: 0.9rem; padding: 0 0 8px; width: 100%; text-align: left; }
.maplegend__list { display: grid; gap: 6px; font-size: 0.8rem; color: var(--muted); }
.maplegend__list li { display: flex; align-items: center; gap: 8px; }
.maplegend.is-collapsed .maplegend__list { display: none; }

/* Popup MapLibre */
.maplibregl-popup-content { background: transparent !important; padding: 0 !important; box-shadow: none !important; }
.maplibregl-popup-tip { display: none; }
.maplibregl-popup-close-button { color: var(--text); font-size: 18px; padding: 6px 10px; }
.trackpop {
    background: var(--bg-3); border: 1px solid var(--border-strong); border-radius: 16px; padding: 16px; width: 250px;
    box-shadow: var(--shadow); backdrop-filter: var(--glass-blur);
}
.trackpop__type { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); font-weight: 700; }
.trackpop__title { font-size: 1rem; margin: 4px 0 10px; }
.trackpop__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 0.82rem; color: var(--muted); margin-bottom: 12px; }
.trackpop__link { width: 100%; }

/* =====================================================================
   CARTES (cards) & grilles
   ===================================================================== */
.cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.cardgrid--compact { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; transition: 0.2s; display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.card__media { position: relative; aspect-ratio: 16 / 10; background: var(--bg-3); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__media .badge { position: absolute; backdrop-filter: var(--glass-blur); }
.card__media .badge--type { top: 10px; left: 10px; }
.card__media .badge--diff { top: 10px; right: 10px; }
.card__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.card__title { font-size: 1.02rem; }
.card__meta { display: flex; gap: 10px; font-size: 0.78rem; color: var(--muted); flex-wrap: wrap; }
.card__stats { display: flex; gap: 16px; margin-top: 2px; }
.card__stats li { display: flex; flex-direction: column; }
.card__stats strong { font-family: var(--font-display); font-size: 0.98rem; }
.card__stats span { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.empty { color: var(--muted); padding: 40px; text-align: center; grid-column: 1 / -1; }

/* =====================================================================
   FILTRES
   ===================================================================== */
.filters { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.filters__row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.field { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0 12px; height: 42px; }
.field--search { flex: 1; min-width: 160px; }
.field__icon { color: var(--muted); display: grid; place-items: center; }
.field input, .field select { background: none; border: none; color: var(--text); width: 100%; font-size: 0.9rem; outline: none; }
.field--select { padding-right: 6px; }
.field--select select { cursor: pointer; }
select option { background: var(--bg-2); color: var(--text); }

.filters__advanced { display: flex; flex-direction: column; gap: 16px; padding-top: 6px; border-top: 1px solid var(--border); }
.filters__group { display: flex; flex-direction: column; gap: 8px; }
.filters__legend { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--border); font-size: 0.8rem; color: var(--muted); transition: 0.15s; cursor: pointer; user-select: none;
}
.chip span em { font-style: normal; opacity: 0.6; font-size: 0.7rem; }
.chip:hover span { border-color: var(--border-strong); color: var(--text); }
.chip input:checked + span {
    color: var(--chip-color, var(--accent));
    border-color: color-mix(in srgb, var(--chip-color, var(--accent)) 55%, transparent);
    background: color-mix(in srgb, var(--chip-color, var(--accent)) 18%, transparent);
}
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.filters__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.field--inline { display: flex; flex-direction: column; gap: 5px; font-size: 0.74rem; color: var(--muted); }
.field--inline input, .field--inline select { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; color: var(--text); font-size: 0.85rem; outline: none; }
.field--inline input:focus, .field--inline select:focus, .field input:focus { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }

/* =====================================================================
   FICHE ACTIVITÉ
   ===================================================================== */
.activity__mapwrap { position: relative; height: 56vh; min-height: 380px; background: var(--bg-2); }
.activity__map { position: absolute; inset: 0; }
.activity__mapctl { position: absolute; right: 16px; top: 16px; z-index: 10; display: flex; gap: 8px; background: var(--surface-2); backdrop-filter: var(--glass-blur); border: 1px solid var(--border); border-radius: 999px; padding: 4px; box-shadow: var(--shadow-sm); }
.activity__back { position: absolute; left: 16px; top: 16px; z-index: 10; padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: 0.86rem; box-shadow: var(--shadow-sm); }
.activity__container { max-width: 1000px; margin: 0 auto; padding: 32px 20px 80px; }
.activity__head { margin-bottom: 26px; }
.activity__badges { display: flex; gap: 8px; margin-bottom: 12px; }
.activity__title { font-size: clamp(1.8rem, 4.5vw, 3rem); }
.activity__sub { color: var(--muted); display: flex; gap: 16px; flex-wrap: wrap; margin: 10px 0 0; font-size: 0.96rem; }
.activity__actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }

.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 30px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.stat__label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.stat__value { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 22px; }
.panel--full { grid-column: 1 / -1; }
.panel__title { font-size: 1.2rem; margin-bottom: 16px; }
.panel__intro { color: var(--muted); margin: -8px 0 18px; }
.panel__headrow { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.panel__headrow .panel__title { margin-bottom: 0; }
.prose { color: var(--muted); line-height: 1.7; }

.elevation { position: relative; }
.elevation__readout { position: absolute; top: 0; right: 0; display: flex; gap: 14px; font-size: 0.82rem; background: var(--surface-2); padding: 6px 12px; border-radius: 10px; border: 1px solid var(--border); }
.elevation__readout span { color: var(--accent); font-weight: 600; }

.taglist { display: flex; flex-wrap: wrap; gap: 8px; }
.tagpill { padding: 7px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 0.85rem; color: var(--muted); transition: 0.15s; }
.tagpill:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

/* Galerie + lightbox */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.gallery__item { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--bg-3); }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: 0.3s; }
.gallery__item:hover img { transform: scale(1.06); }
.lightbox { position: fixed; inset: 0; z-index: 900; background: rgba(5, 9, 18, 0.92); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; padding: 30px; }
.lightbox[hidden] { display: none; }
.lightbox__figure { margin: 0; max-width: 90vw; max-height: 88vh; text-align: center; }
.lightbox__figure img { max-width: 90vw; max-height: 80vh; border-radius: 14px; box-shadow: var(--shadow); }
.lightbox__figure figcaption { color: var(--muted); margin-top: 12px; }
.lightbox__close { position: absolute; top: 20px; right: 24px; width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: 1.1rem; }
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 50px; height: 50px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: 1.6rem; }
.lightbox__nav--prev { left: 20px; }
.lightbox__nav--next { right: 20px; }

/* =====================================================================
   STATS
   ===================================================================== */
.bigstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 32px; }
.bigstat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; text-align: center; }
.bigstat__value { display: block; font-family: var(--font-display); font-size: 2rem; font-weight: 800; background: linear-gradient(120deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bigstat__label { color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; }
.chartgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; margin-bottom: 22px; }
.chartgrid .panel { margin-bottom: 0; }
.toplist { display: flex; flex-direction: column; gap: 8px; counter-reset: top; }
.toplist li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.toplist li:last-child { border-bottom: none; }
.toplist a { font-weight: 500; }
.toplist a:hover { color: var(--accent); }
.toplist span { color: var(--muted); font-family: var(--font-display); }

/* =====================================================================
   RECHERCHE
   ===================================================================== */
.searchpanel { border-radius: var(--radius); margin-bottom: 20px; }
.searchpanel .filters { padding: 8px 12px 16px; }
.searchmeta { display: flex; align-items: center; gap: 12px; color: var(--muted); margin-bottom: 18px; font-size: 0.9rem; }
.searchmeta [data-results-count] { color: var(--accent); font-weight: 700; }
.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 32px; }
.pagination__btn { min-width: 40px; height: 40px; padding: 0 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.pagination__btn:hover { color: var(--text); border-color: var(--border-strong); }
.pagination__btn.is-active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #04241b; border: none; }

/* =====================================================================
   AUTH
   ===================================================================== */
.minimal { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.authcard { width: 100%; max-width: 420px; border-radius: var(--radius-lg); padding: 34px; box-shadow: var(--shadow); }
.authcard__brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; margin-bottom: 22px; }
.authcard__title { font-size: 1.5rem; margin-bottom: 6px; }
.authcard__intro, .authcard__back { color: var(--muted); }
.authcard__intro { margin-bottom: 20px; }
.authform { display: flex; flex-direction: column; gap: 16px; margin: 20px 0; }
.formfield { display: flex; flex-direction: column; gap: 7px; }
.formfield span { font-size: 0.82rem; color: var(--muted); font-weight: 500; }
.formfield input, .formfield select, .formfield textarea, .editform input, .editform select, .editform textarea {
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; color: var(--text); font-size: 0.95rem; outline: none; font-family: inherit; transition: 0.15s;
}
.formfield input:focus, .formfield textarea:focus, .editform input:focus, .editform textarea:focus, .editform select:focus { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12); }
.authcard__back { display: inline-block; margin-top: 8px; font-size: 0.88rem; }
.formcheck { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.formcheck input { width: 18px; height: 18px; accent-color: var(--accent); }

/* =====================================================================
   ALERTES / TOASTS / LOADER
   ===================================================================== */
.alert { padding: 14px 16px; border-radius: 12px; margin-bottom: 18px; font-size: 0.9rem; }
.alert p { margin: 2px 0; }
.alert--error { background: rgba(251, 113, 133, 0.12); border: 1px solid rgba(251, 113, 133, 0.3); color: #fecdd3; }
.alert--success { background: rgba(52, 211, 153, 0.12); border: 1px solid rgba(52, 211, 153, 0.3); color: #bbf7e0; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 800; padding: 14px 22px; border-radius: 14px; box-shadow: var(--shadow); font-weight: 600; animation: fadeUp 0.4s ease; }
.toast--success { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #04241b; }
.loader { display: flex; gap: 6px; justify-content: center; padding: 30px; }
.loader span { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: bounce 1.2s infinite ease-in-out; }
.loader span:nth-child(2) { animation-delay: 0.15s; }
.loader span:nth-child(3) { animation-delay: 0.3s; }
.loader--inline { padding: 0; display: inline-flex; }
.loader--inline span { width: 7px; height: 7px; }

@keyframes bounce { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; } 40% { transform: scale(1); opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes fadeDown { from { opacity: 0; transform: translate(-50%, -12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* =====================================================================
   ADMINISTRATION
   ===================================================================== */
.adminshell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.adminside { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 18px; border-radius: 0; border-top: none; border-bottom: none; border-left: none; }
.adminside__brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; margin-bottom: 26px; }
.adminnav { display: flex; flex-direction: column; gap: 4px; }
.adminnav a { padding: 11px 14px; border-radius: 12px; color: var(--muted); font-weight: 500; transition: 0.15s; }
.adminnav a:hover { background: var(--surface); color: var(--text); }
.adminnav a.is-active { background: var(--surface-2); color: var(--text); }
.adminside__bottom { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.admincontent { display: flex; flex-direction: column; min-width: 0; }
.adminbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; padding: 16px 28px; border-radius: 0; border-left: none; border-right: none; border-top: none; }
.adminbar__title { font-size: 1.2rem; }
.adminbar__user { color: var(--muted); font-size: 0.9rem; }
.adminmain { padding: 28px; }
.adminquick { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.bigstats--admin .bigstat__value { font-size: 1.7rem; }

.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table__empty { color: var(--muted); text-align: center; padding: 26px; }
.table__thumb img { border-radius: 6px; object-fit: cover; }
.table__actions { display: flex; gap: 6px; justify-content: flex-end; }
.table--activities td a:hover { color: var(--accent); }
.ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { padding: 3px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 600; text-transform: capitalize; background: var(--surface-2); }
.pill--done { background: rgba(52, 211, 153, 0.16); color: #bbf7e0; }
.pill--error { background: rgba(251, 113, 133, 0.16); color: #fecdd3; }
.pill--processing { background: rgba(56, 189, 248, 0.16); color: #bae6fd; }
.adminlist { display: flex; flex-direction: column; gap: 6px; }
.adminlist li { display: flex; flex-direction: column; padding: 9px 0; border-bottom: 1px solid var(--border); }
.adminlist li:last-child { border-bottom: none; }
.adminlist span { font-size: 0.78rem; color: var(--muted); }
.inlinesearch { display: flex; gap: 8px; }
.inlinesearch input { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; color: var(--text); outline: none; }

/* Dropzone import */
.dropzone__type { margin-bottom: 16px; }
.dropzone__type label { display: flex; flex-direction: column; gap: 6px; font-size: 0.8rem; color: var(--muted); max-width: 300px; }
.dropzone__type select { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; color: var(--text); }
.dropzone__area { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 44px; text-align: center; color: var(--muted); transition: 0.2s; cursor: pointer; }
.dropzone__area:hover, .dropzone__area.is-drag { border-color: var(--accent); background: rgba(52, 211, 153, 0.06); color: var(--text); }
.dropzone__area svg { color: var(--accent); margin-bottom: 10px; }
.dropzone__area p { margin: 4px 0; font-size: 1.05rem; }
.dropzone__progress { margin-top: 18px; }
.progressbar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progressbar span { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.3s; }
.dropzone__progress span[data-progress-label] { display: inline-block; margin-top: 8px; font-size: 0.84rem; color: var(--muted); }
.dropzone__results { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; }
.importrow { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--surface); font-size: 0.86rem; }
.importrow__status { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.importrow--imported .importrow__status { background: var(--accent); }
.importrow--skipped .importrow__status { background: var(--warning); }
.importrow--error .importrow__status { background: var(--danger); }
.importrow__name { font-weight: 600; }
.importrow__msg { color: var(--muted); margin-left: auto; }
.importrow a { color: var(--accent); }

/* Édition + photos */
.editlayout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; align-items: start; }
.editlayout .panel { margin-bottom: 0; }
.editform { display: flex; flex-direction: column; gap: 16px; }
.formrow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.editform__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.photodrop__area { border: 2px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 24px; text-align: center; color: var(--muted); cursor: pointer; transition: 0.2s; }
.photodrop__area:hover, .photodrop__area.is-drag { border-color: var(--accent); color: var(--text); background: rgba(52,211,153,0.05); }
.photogrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin-top: 14px; }
.photogrid__item { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--bg-3); }
.photogrid__item img { width: 100%; height: 100%; object-fit: cover; }
.photogrid__del { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,0.6); border: none; color: #fff; font-size: 0.8rem; opacity: 0; transition: 0.15s; }
.photogrid__item:hover .photogrid__del { opacity: 1; }
.metabox { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 18px; }
.metabox h3 { font-size: 0.92rem; margin-bottom: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.metabox dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 0.88rem; }
.metabox dt { color: var(--muted); }
.metabox dd { margin: 0; text-align: right; }

/* =====================================================================
   ERREURS
   ===================================================================== */
.errorpage { text-align: center; max-width: 440px; }
.errorpage__code { font-family: var(--font-display); font-size: 5rem; font-weight: 800; background: linear-gradient(120deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
.errorpage__title { font-size: 1.6rem; margin: 8px 0; }
.errorpage__msg { color: var(--muted); margin-bottom: 24px; }

/* =====================================================================
   PIED DE PAGE
   ===================================================================== */
.sitefooter { border-top: 1px solid var(--border); margin-top: 40px; background: rgba(0,0,0,0.2); }
.sitefooter__inner { max-width: 1320px; margin: 0 auto; padding: 32px 20px; display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; }
.sitefooter__brand { display: flex; flex-direction: column; }
.sitefooter__brand strong { font-family: var(--font-display); }
.sitefooter__brand span { color: var(--muted); font-size: 0.85rem; }
.sitefooter__links { display: flex; gap: 18px; }
.sitefooter__links a { color: var(--muted); font-size: 0.9rem; }
.sitefooter__links a:hover { color: var(--text); }
.sitefooter__meta { color: var(--muted-2); font-size: 0.8rem; width: 100%; text-align: center; padding-top: 8px; border-top: 1px solid var(--border); }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1024px) {
    .editlayout { grid-template-columns: 1fr; }
    .chartgrid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    .topnav__links { display: none; }
    .topnav__burger { display: flex; }
    .topnav.is-open .topnav__mobile { display: flex; }
    .adminshell { grid-template-columns: 1fr; }
    .adminside { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; }
    .adminnav { flex-direction: row; flex-wrap: wrap; }
    .adminside__bottom { margin: 0 0 0 auto; flex-direction: row; }
    .mapview__panel { top: auto; bottom: 0; left: 0; right: 0; width: 100%; max-width: none; height: 62vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
    .mapview__panel.is-collapsed { transform: translateY(calc(100% - 60px)); }
    .mapview__panel.is-collapsed .mapview__panel-toggle { transform: rotate(-90deg); right: 14px; top: 14px; }
    .mapview__panel-toggle { transform: rotate(90deg); }
    .mapctl { top: calc(var(--nav-h) + 12px); }
    .maplegend { bottom: calc(62vh + 12px); }
}

@media (max-width: 560px) {
    .container { padding-left: 14px; padding-right: 14px; }
    .activity__container { padding-left: 14px; padding-right: 14px; }
    .formrow { grid-template-columns: 1fr; }
    .hero__title { font-size: 1.6rem; }
    .activity__actions .btn { flex: 1; }
    .sitefooter__inner { flex-direction: column; align-items: flex-start; }
}

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