/* ═══════════════════════════════════════════════════════════════════════════
   LEAKSCAN — Portail v13.1 : identité « Nuit & Or »
   Toutes les règles sont limitées à #mainPage et aux fenêtres modales :
   la page de connexion (#loginPage) n'est pas touchée.
   ═══════════════════════════════════════════════════════════════════════════ */

#mainPage, .modal {
    /* Identité */
    --c-night:  #0a1f20;
    --c-deep:   #0f3536;
    --c-green:  #15504d;
    --c-green2: #1b625e;
    --c-teal:   #1f8079;
    --c-aqua:   #3fb0a5;
    --c-gold:   #c9a95c;
    --c-gold2:  #e7d3a0;
    --c-gold3:  #9a7a32;
    /* Surfaces */
    --c-ivory:  #f6f4ee;
    --c-card:   #ffffff;
    --c-soft:   #faf8f3;
    --c-line:   #ebe6da;
    --c-line2:  #f2eee5;
    /* Texte */
    --c-ink:    #0f2425;
    --c-text:   #2a3a39;
    --c-mute:   #7a8684;
    /* États */
    --c-red:    #c8452f;  --c-red2:  #fbe9e4;
    --c-orange: #dd8530;  --c-orange2: #fcefdf;
    --c-yellow: #c9a12e;  --c-yellow2: #faf2d8;
    --c-ok:     #3f8a5a;  --c-ok2:   #e6f2ea;
    /* Compatibilité v13.0 */
    --c-mint:   #e3f1ee;  --c-mint2: #f0f7f5; --c-cream: var(--c-ivory);
    --r-xl: 20px; --r-lg: 16px; --r-md: 11px;
    --sh-1: 0 1px 2px rgba(15,36,37,.04), 0 6px 20px rgba(15,36,37,.05);
    --sh-2: 0 18px 44px rgba(10,31,32,.18);
    --sh-in: inset 0 1px 0 rgba(255,255,255,.06);
}

/* ── Logo (vectoriel) ──────────────────────────────────────────────────── */
.ls-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ls-brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; }
.ls-mark { width: 36px; height: 45px; flex-shrink: 0; filter: drop-shadow(0 2px 6px rgba(201,169,94,.25)); }
.ls-word {
    font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 1.25rem; letter-spacing: .2em;
    background: linear-gradient(180deg, #f3e3b4 0%, #d8bc76 45%, #a8873b 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .1em;
}
.ls-brand-sub { display: block; font: 600 .56rem 'Inter', sans-serif; letter-spacing: .28em; color: rgba(231,211,160,.55); margin-top: .1rem; text-transform: uppercase; }

/* ── Coque ─────────────────────────────────────────────────────────────── */
#mainPage { background: var(--c-ivory); color: var(--c-text); }
#mainPage .content-inner { max-width: 1320px; padding: 0 2.25rem 3rem; }

#mainPage .sidebar {
    width: 264px;
    background:
        radial-gradient(140% 50% at 0% 0%, rgba(31,128,121,.28) 0%, transparent 55%),
        radial-gradient(120% 35% at 100% 100%, rgba(201,169,94,.12) 0%, transparent 60%),
        linear-gradient(180deg, #0b2425 0%, #0a1f20 100%);
    border-right: 1px solid rgba(231,211,160,.08);
}
#mainPage .sidebar-logo { padding: 1.4rem 1.35rem 1.2rem; border-bottom: 1px solid rgba(255,255,255,.06); }
#mainPage .sidebar-context {
    margin: .9rem .9rem .2rem; padding: .75rem .9rem; border: 1px solid rgba(231,211,160,.12);
    border-radius: 12px; background: rgba(255,255,255,.03);
}
#mainPage .sidebar-ctx-label { color: var(--c-gold); letter-spacing: .2em; font-size: .56rem; }
#mainPage .sidebar-ctx-value { font-size: .86rem; color: #fff; font-weight: 600; }
#mainPage .sidebar-nav { padding: .6rem .8rem 1rem; }
#mainPage .nav-section-label {
    display: block; font-size: .58rem; letter-spacing: .22em; color: rgba(231,211,160,.42);
    padding: 1rem .75rem .45rem; margin: 0; font-weight: 600; text-transform: uppercase;
}
#mainPage .nav-item {
    position: relative; border-radius: 10px; padding: .62rem .8rem; margin-bottom: 2px;
    color: rgba(255,255,255,.62); font-weight: 500; font-size: .86rem;
}
#mainPage .nav-item svg { width: 17px; height: 17px; opacity: .85; }
#mainPage .nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
#mainPage .nav-item.active { background: rgba(255,255,255,.08); color: #fff; box-shadow: var(--sh-in); font-weight: 600; }
#mainPage .nav-item.active svg { color: var(--c-gold); opacity: 1; }
#mainPage .nav-item.active::before {
    content: ''; position: absolute; left: -.8rem; top: 18%; bottom: 18%; width: 3px;
    border-radius: 0 3px 3px 0; background: linear-gradient(180deg, var(--c-gold2), var(--c-gold));
}
#mainPage #adminMessagesBadge, #mainPage #clientMessagesBadge {
    flex: 0 0 auto; background: var(--c-gold) !important; color: var(--c-night) !important;
}
#mainPage .sidebar-divider { background: rgba(255,255,255,.06); }
#mainPage .sidebar-user { display: flex; align-items: center; gap: .65rem; background: rgba(255,255,255,.04); border-radius: 12px; padding: .65rem .7rem; }
#mainPage .sidebar-user > div:last-child { min-width: 0; }
#mainPage .sidebar-action { border-radius: 8px; }

.v13-avatar {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
    font: 600 .78rem 'Inter', sans-serif; color: var(--c-night);
    background: linear-gradient(135deg, var(--c-gold2), var(--c-gold));
    box-shadow: 0 0 0 2px rgba(255,255,255,.08);
}

/* Barre d'en-tête (ordinateur) */
.v13-topbar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    height: 68px; margin: 0 -2.25rem 1.5rem; padding: 0 5.5rem 0 2.25rem;
    background: rgba(246,244,238,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--c-line);
}
.v13-crumb { font: 600 .98rem 'Inter', sans-serif; color: var(--c-ink); }
.v13-crumb small { display: block; font-weight: 500; font-size: .74rem; color: var(--c-mute); margin-top: .05rem; }
.v13-top-right { display: flex; align-items: center; gap: .7rem; }
.v13-org {
    display: inline-flex; align-items: center; gap: .45rem; font: 600 .76rem 'Inter', sans-serif; color: var(--c-green);
    background: var(--c-card); border: 1px solid var(--c-line); padding: .42rem .75rem; border-radius: 999px;
}
.v13-org::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c-aqua); box-shadow: 0 0 0 3px rgba(63,176,165,.18); }
#mainPage .notif-bell {
    top: 14px; right: 1.6rem; width: 40px; height: 40px; border-radius: 12px; z-index: 30;
    background: var(--c-card); border: 1px solid var(--c-line); box-shadow: none; color: var(--c-green);
}
#mainPage .notif-bell:hover { border-color: var(--c-gold); transform: none; }

#mainPage .page-header { margin-bottom: 1.5rem; }
#mainPage .page-header h1 { font-size: 1.9rem; color: var(--c-ink); font-weight: 500; letter-spacing: -.02em; }
#mainPage .page-header p { color: var(--c-mute); }
#mainPage .section-marker { color: var(--c-gold3); }
#mainPage .section-marker::before { background: var(--c-gold); }

/* ── Héros ─────────────────────────────────────────────────────────────── */
.v13-hero {
    position: relative; overflow: hidden; isolation: isolate;
    display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap;
    padding: 2rem 2.2rem; margin-bottom: 1.4rem; border-radius: var(--r-xl); color: #fff;
    background:
        radial-gradient(60% 140% at 100% 0%, rgba(201,169,94,.22) 0%, transparent 60%),
        radial-gradient(50% 120% at 0% 100%, rgba(63,176,165,.18) 0%, transparent 60%),
        linear-gradient(120deg, #0a1f20 0%, #0f3536 45%, #15504d 100%);
    box-shadow: var(--sh-2);
}
.v13-hero::after {
    content: ''; position: absolute; left: 2.2rem; right: 2.2rem; bottom: 0; height: 2px;
    background: linear-gradient(90deg, transparent, rgba(231,211,160,.7), transparent);
}
.v13-hero-net { position: absolute; inset: 0; z-index: -1; opacity: .35; pointer-events: none; }
.v13-hero-net svg { width: 100%; height: 100%; }
.v13-hero-mark {
    position: absolute; right: -10px; top: -26px; width: 230px; height: 290px; z-index: -1; opacity: .09; pointer-events: none;
}
.v13-eyebrow {
    display: inline-flex; align-items: center; gap: .55rem; font-size: .64rem; font-weight: 600;
    letter-spacing: .2em; text-transform: uppercase; color: var(--c-gold2);
    background: rgba(231,211,160,.08); border: 1px solid rgba(231,211,160,.2); padding: .32rem .75rem; border-radius: 999px;
}
.v13-live { width: 8px; height: 8px; border-radius: 50%; background: #5fd3c4; position: relative; }
.v13-live::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #5fd3c4; animation: v13pulse 2.4s ease-out infinite; }
@keyframes v13pulse { 0% { transform: scale(.5); opacity: .9; } 100% { transform: scale(2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .v13-live::after { animation: none; } }
.v13-hero h1 {
    font-family: 'Fraunces', Georgia, serif; font-weight: 500; font-size: clamp(1.7rem, 3vw, 2.45rem);
    letter-spacing: -.02em; line-height: 1.1; margin: .85rem 0 .4rem; color: #fff;
}
.v13-hero p { color: rgba(255,255,255,.72); font-size: .92rem; max-width: 36rem; }
.v13-hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: .9rem; }
.v13-hero-facts { display: flex; gap: .7rem; }
.v13-fact {
    text-align: left; min-width: 150px; padding: .75rem 1rem; border-radius: 14px;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); backdrop-filter: blur(6px);
}
.v13-fact b { display: block; font-family: 'Fraunces', Georgia, serif; font-size: 1.5rem; font-weight: 500; color: #fff; line-height: 1.1; }
.v13-fact span { font-size: .7rem; color: rgba(255,255,255,.62); }
.v13-hero-actions { display: flex; gap: .55rem; flex-wrap: wrap; justify-content: flex-end; }
.v13-btn-light, .v13-btn-glass {
    display: inline-flex; align-items: center; gap: .5rem; font: 600 .84rem 'Inter', sans-serif;
    padding: .66rem 1.05rem; border-radius: 11px; cursor: pointer; border: 1px solid transparent;
    text-decoration: none; transition: transform .15s, box-shadow .15s, background .15s;
}
.v13-btn-light { background: linear-gradient(180deg, #f3e3b4, var(--c-gold)); color: var(--c-night); box-shadow: 0 6px 18px rgba(201,169,94,.3); }
.v13-btn-light:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(201,169,94,.38); }
.v13-btn-glass { background: rgba(255,255,255,.07); color: #fff; border-color: rgba(255,255,255,.2); }
.v13-btn-glass:hover { background: rgba(255,255,255,.14); }

/* ── Indicateurs ───────────────────────────────────────────────────────── */
.v13-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.v13-kpi {
    position: relative; overflow: hidden; text-align: left; font: inherit; color: inherit;
    background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--r-lg);
    padding: 1.15rem 1.2rem 1rem; box-shadow: var(--sh-1); cursor: default;
    transition: transform .18s, box-shadow .18s, border-color .18s;
    display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch;
}
.v13-kpi::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--k, var(--c-teal)); opacity: .9; }
button.v13-kpi { cursor: pointer; }
button.v13-kpi:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(15,36,37,.10); border-color: #e0d8c5; }
.v13-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.v13-kpi-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; color: #fff; }
.v13-kpi-ico.i-teal { background: linear-gradient(135deg, #3fb0a5, #15504d); box-shadow: 0 6px 14px rgba(31,128,121,.28); }
.v13-kpi-ico.i-gold { background: linear-gradient(135deg, #e7d3a0, #b08f43); box-shadow: 0 6px 14px rgba(201,169,94,.30); color: #3c2f10; }
.v13-kpi-ico.i-red  { background: linear-gradient(135deg, #e9775f, #b13a26); box-shadow: 0 6px 14px rgba(200,69,47,.25); }
.v13-kpi-ico.i-ink  { background: linear-gradient(135deg, #3c5a59, #0f2425); box-shadow: 0 6px 14px rgba(15,36,37,.22); }
.v13-kpi-tag { font-size: .62rem; font-weight: 600; color: var(--c-mute); letter-spacing: .12em; text-transform: uppercase; }
.v13-kpi-val {
    font-family: 'Fraunces', Georgia, serif; font-size: 2.55rem; font-weight: 500; line-height: 1;
    color: var(--c-ink); margin: .85rem 0 .3rem; font-variant-numeric: tabular-nums; letter-spacing: -.03em;
}
.v13-kpi-lab { font-size: .84rem; font-weight: 600; color: var(--c-ink); }
.v13-kpi-sub { font-size: .72rem; color: var(--c-mute); margin-top: .12rem; min-height: 1em; }
.v13-delta {
    display: inline-flex; align-items: center; gap: .25rem; margin-top: .55rem; align-self: flex-start;
    font: 600 .7rem 'Inter', sans-serif; padding: .2rem .55rem; border-radius: 999px; background: var(--c-soft); color: var(--c-mute);
    border: 1px solid var(--c-line2);
}
.v13-delta.up   { background: #e8f5f2; color: #17716b; border-color: #d3ebe6; }
.v13-delta.down { background: #fbf3e2; color: #8a6a23; border-color: #f1e3c2; }
.v13-delta:empty { display: none; }
.v13-spark { height: 34px; margin-top: .6rem; }
.v13-levels { margin-top: auto; padding-top: .7rem; display: grid; gap: .4rem; }
.v13-levels-bar { display: flex; height: 8px; border-radius: 6px; overflow: hidden; background: var(--c-line2); }
.v13-levels-bar span { display: block; height: 100%; }
.v13-levels-leg { display: flex; flex-wrap: wrap; gap: .35rem .7rem; font-size: .68rem; color: var(--c-mute); }
.v13-levels-leg i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: .3rem; }
.v13-levels-leg b { color: var(--c-ink); font-weight: 600; }
.v13-spark svg { width: 100%; height: 100%; display: block; }

/* ── Cartes et grilles ─────────────────────────────────────────────────── */
.v13-card {
    background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--r-lg);
    box-shadow: var(--sh-1); padding: 1.3rem 1.4rem; min-width: 0;
}
.v13-card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.v13-card-t { font-family: 'Fraunces', Georgia, serif; font-size: 1.14rem; font-weight: 500; color: var(--c-ink); letter-spacing: -.01em; }
.v13-card-s { font-size: .74rem; color: var(--c-mute); margin-top: .18rem; }
.v13-link {
    background: var(--c-soft); border: 1px solid var(--c-line2); padding: .35rem .7rem; border-radius: 999px; cursor: pointer;
    white-space: nowrap; font: 600 .72rem 'Inter', sans-serif; color: var(--c-green); transition: all .15s;
}
.v13-link:hover { background: var(--c-green); border-color: var(--c-green); color: #fff; }
.v13-grid-21 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; margin-bottom: 1.4rem; }
.v13-stack { display: grid; gap: 1rem; align-content: start; min-width: 0; }
.v13-grid-11 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.v13-legend { display: flex; gap: .9rem; flex-wrap: wrap; font-size: .72rem; color: var(--c-mute); font-weight: 500; }
.v13-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.v13-chart { width: 100%; }
.v13-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.v13-chart text { font-family: 'Inter', sans-serif; }
.v13-chart rect.bar { transition: opacity .15s; }
.v13-chart svg:hover rect.bar { opacity: .55; }
.v13-chart svg rect.bar:hover { opacity: 1; }
.v13-note { font-size: .7rem; color: var(--c-mute); margin-top: .6rem; }
.v13-empty { padding: 1.6rem .5rem; text-align: center; font-size: .82rem; color: var(--c-mute); }

/* Anneau */
.v13-donut-wrap { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.v13-donut { width: 156px; height: 156px; flex-shrink: 0; }
.v13-donut-list { flex: 1; min-width: 150px; display: grid; gap: .5rem; }
.v13-donut-row { display: grid; grid-template-columns: 10px 1fr auto 2.6rem; align-items: center; gap: .55rem; font-size: .8rem; color: var(--c-text); }
.v13-donut-row i { width: 10px; height: 10px; border-radius: 3px; }
.v13-donut-row b { font-variant-numeric: tabular-nums; color: var(--c-ink); }
.v13-donut-row small { color: var(--c-mute); text-align: right; }

/* Barres horizontales */
.v13-hbars { display: grid; gap: .8rem; }
.v13-hbar-top { display: flex; justify-content: space-between; font-size: .82rem; margin-bottom: .32rem; color: var(--c-text); font-weight: 500; }
.v13-hbar-top b { font-variant-numeric: tabular-nums; color: var(--c-ink); }
.v13-hbar-track { height: 9px; border-radius: 6px; background: var(--c-line2); overflow: hidden; display: flex; }
.v13-hbar-track span { display: block; height: 100%; }
.v13-hbar-track span:first-child { border-radius: 6px 0 0 6px; }

/* Fil d'activité */
.v13-feed { display: grid; grid-template-columns: minmax(0, 1fr); }
.v13-feed-item { display: flex; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid var(--c-line2); min-width: 0; align-items: center; }
.v13-feed-item:last-child { border-bottom: 0; }
.v13-feed-dot { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.v13-feed-main { flex: 1; min-width: 0; }
.v13-feed-t { font-size: .85rem; font-weight: 600; color: var(--c-ink); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.v13-feed-s { font-size: .72rem; color: var(--c-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: .1rem; }
.v13-feed-when { font-size: .68rem; color: var(--c-mute); white-space: nowrap; background: var(--c-soft); border: 1px solid var(--c-line2); padding: .15rem .5rem; border-radius: 999px; }

/* Zones prioritaires */
.v13-zone { display: flex; gap: .75rem; align-items: center; padding: .7rem .1rem; border-bottom: 1px solid var(--c-line2); }
.v13-zone:last-child { border-bottom: 0; }
.v13-zone-bar { width: 4px; align-self: stretch; border-radius: 4px; flex-shrink: 0; }
.v13-zone-t { font-size: .86rem; font-weight: 600; color: var(--c-ink); }
.v13-zone-s { font-size: .72rem; color: var(--c-mute); }

/* Pastilles */
.v13-pill {
    display: inline-flex; align-items: center; gap: .3rem; font-size: .64rem; font-weight: 600;
    letter-spacing: .07em; text-transform: uppercase; padding: .2rem .55rem; border-radius: 999px; white-space: nowrap;
}
.v13-pill.p-fuite    { background: #e3f1ee; color: #146a64; }
.v13-pill.p-anomalie { background: #f7eed6; color: #7b6020; }
.v13-pill.p-critique { background: var(--c-red2); color: var(--c-red); }
.v13-pill.p-eleve    { background: var(--c-orange2); color: #a95f17; }
.v13-pill.p-modere   { background: var(--c-yellow2); color: #8a6a12; }
.v13-pill.p-faible   { background: var(--c-ok2); color: var(--c-ok); }
.v13-pill.p-commune  { background: var(--c-soft); border: 1px solid var(--c-line); color: var(--c-text); text-transform: none; letter-spacing: 0; font-size: .72rem; }

/* ── Liste des fuites et anomalies ─────────────────────────────────────── */
.v13-toolbar {
    position: sticky; top: 68px; z-index: 6; margin: 0 -.25rem 1rem; padding: .75rem .25rem;
    display: flex; flex-wrap: wrap; gap: .55rem; align-items: center;
    background: rgba(246,244,238,.94); backdrop-filter: blur(8px);
}
.v13-search { position: relative; flex: 1 1 220px; min-width: 0; }
.v13-search svg { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--c-mute); pointer-events: none; }
.v13-search input, .v13-select {
    width: 100%; height: 42px; border: 1px solid var(--c-line); border-radius: var(--r-md);
    background: var(--c-card); font: 500 .86rem 'Inter', sans-serif; color: var(--c-text);
}
.v13-search input { padding: 0 .9rem 0 2.4rem; }
.v13-select { width: auto; max-width: 190px; padding: 0 2rem 0 .8rem; appearance: none; cursor: pointer;
    background: var(--c-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a8684' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right .7rem center; }
.v13-search input:focus, .v13-select:focus { outline: none; border-color: var(--c-teal); box-shadow: 0 0 0 3px rgba(31,128,121,.14); }
.v13-seg { display: inline-flex; background: #ece7db; border-radius: var(--r-md); padding: 3px; gap: 2px; }
.v13-seg button {
    border: 0; background: transparent; border-radius: 8px; padding: .52rem .85rem; cursor: pointer;
    font: 600 .8rem 'Inter', sans-serif; color: var(--c-mute); white-space: nowrap;
}
.v13-seg button.active { background: var(--c-card); color: var(--c-ink); box-shadow: 0 1px 3px rgba(15,36,37,.12); }
.v13-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem; height: 42px; padding: 0 1rem;
    border-radius: var(--r-md); border: 1px solid var(--c-line); background: var(--c-card); color: var(--c-ink);
    font: 600 .82rem 'Inter', sans-serif; cursor: pointer; white-space: nowrap; text-decoration: none;
    transition: background .15s, border-color .15s, transform .15s, box-shadow .15s;
}
.v13-btn:hover { border-color: var(--c-teal); background: var(--c-mint2); }
.v13-btn.b-dark { background: linear-gradient(180deg, #1b625e, #0f3536); border-color: #0f3536; color: #fff; box-shadow: 0 4px 12px rgba(15,53,54,.22); }
.v13-btn.b-dark:hover { background: linear-gradient(180deg, #1f8079, #15504d); }
.v13-btn.b-gold { background: linear-gradient(180deg, #f6eccd, #ead9a6); border-color: #e1cd92; color: #5d4a14; }
.v13-btn.b-gold:hover { background: linear-gradient(180deg, #f3e3b4, var(--c-gold)); }
.v13-btn:focus-visible, .v13-seg button:focus-visible, .v13-link:focus-visible,
.v13-kpi:focus-visible, .v13-bnav button:focus-visible, .v13-icon-btn:focus-visible { outline: 2px solid var(--c-gold); outline-offset: 2px; }

.v13-summary { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.v13-chip {
    display: inline-flex; align-items: baseline; gap: .4rem; padding: .45rem .85rem; border-radius: 999px;
    background: var(--c-card); border: 1px solid var(--c-line); font-size: .78rem; color: var(--c-mute);
}
.v13-chip b { font-family: 'Fraunces', Georgia, serif; font-size: 1.05rem; color: var(--c-ink); font-weight: 600; }

.v13-table-wrap { background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; }
.v13-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.v13-table th {
    text-align: left; padding: .8rem 1rem; font-size: .64rem; letter-spacing: .12em; text-transform: uppercase;
    color: var(--c-mute); font-weight: 600; background: var(--c-soft); border-bottom: 1px solid var(--c-line); white-space: nowrap;
}
.v13-table th button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: .3rem; }
.v13-table th button:focus-visible { outline: 2px solid var(--c-gold); outline-offset: 2px; }
.v13-table td { padding: .8rem 1rem; border-bottom: 1px solid var(--c-line2); vertical-align: top; color: var(--c-text); }
.v13-table tr:last-child td { border-bottom: 0; }
.v13-table tbody tr { transition: background .12s; }
.v13-table tbody tr:hover { background: #fbfaf6; }
.v13-addr { font-weight: 600; color: var(--c-ink); }
.v13-desc { font-size: .76rem; color: var(--c-mute); margin-top: .15rem; white-space: pre-wrap; word-break: break-word; }
.v13-date { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--c-text); }
.v13-actions { white-space: nowrap; text-align: right; }
.v13-icon-btn {
    display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--c-line);
    background: var(--c-card); color: var(--c-green); cursor: pointer; text-decoration: none; margin-left: .25rem; vertical-align: middle;
    transition: all .15s;
}
.v13-icon-btn:hover { background: var(--c-green); border-color: var(--c-green); color: #fff; }
.v13-icon-btn.danger { color: var(--c-red); }
.v13-icon-btn.danger:hover { background: var(--c-red); border-color: var(--c-red); color: #fff; }

.v13-cards { display: none; gap: .75rem; }
.v13-item {
    position: relative; background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--r-lg); box-shadow: var(--sh-1);
    padding: 1rem 1rem 1rem 1.15rem; overflow: hidden;
}
.v13-item::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, var(--c-aqua), var(--c-teal)); }
.v13-item.t-anomalie::before { background: linear-gradient(180deg, var(--c-gold2), var(--c-gold)); }
.v13-item-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.v13-item-meta { font-size: .74rem; color: var(--c-mute); margin-top: .35rem; }
.v13-item-actions { display: flex; gap: .5rem; margin-top: .8rem; }
.v13-item-actions .v13-btn { flex: 1; height: 46px; }
.v13-more { display: flex; justify-content: center; margin-top: 1rem; }

/* ── Navigation basse (téléphone) ──────────────────────────────────────── */
.v13-bnav { display: none; }

/* ── Éléments existants harmonisés ─────────────────────────────────────── */
#mainPage .card { border-radius: var(--r-lg); border-color: var(--c-line); box-shadow: var(--sh-1); background: var(--c-card); }
#mainPage .table-wrap { border-radius: var(--r-lg); border-color: var(--c-line); background: var(--c-card); box-shadow: var(--sh-1); }
#mainPage .table-wrap thead { background: var(--c-soft); border-bottom: 1px solid var(--c-line); }
#mainPage .table-wrap th { color: var(--c-mute); font-weight: 600; letter-spacing: .12em; }
#mainPage .table-wrap td { border-top-color: var(--c-line2); }
#mainPage .table-wrap tbody tr:hover { background: #fbfaf6; }
#mainPage .rfilters { border-radius: var(--r-lg); border-color: var(--c-line); background: var(--c-card); }
#mainPage .kpi-card { border-left: 0; border-radius: var(--r-lg); position: relative; }
#mainPage .kpi-card::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--c-teal); }
#mainPage .kpi-icon { border-radius: 12px; background: linear-gradient(135deg, #3fb0a5, #15504d); }
#mainPage .kpi-icon.danger { background: linear-gradient(135deg, #e9775f, #b13a26); }
#mainPage .kpi-icon.success { background: linear-gradient(135deg, #e7d3a0, #b08f43); color: #3c2f10; }
#mainPage .kpi-value { color: var(--c-ink); font-size: 2.3rem; }
#mainPage .btn-primary { background: linear-gradient(180deg, #1b625e, #0f3536); border-color: #0f3536; border-radius: 10px; box-shadow: 0 4px 12px rgba(15,53,54,.2); }
#mainPage .btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #1f8079, #15504d); }
#mainPage .btn-secondary { border-radius: 10px; color: var(--c-green); border-color: var(--c-line); }
#mainPage .btn-secondary:hover:not(:disabled) { background: var(--c-green); border-color: var(--c-green); color: #fff; }
#mainPage .rtab.active { color: var(--c-green); border-bottom-color: var(--c-gold); }
#mainPage .rtab.active .rtab-count { background: var(--c-green); }
#mainPage details.month-group { border-radius: var(--r-lg); border-color: var(--c-line); background: var(--c-card); }
#mainPage details.month-group > summary { background: var(--c-soft); }
#mainPage .badge-navy { background: #e3f1ee; color: #146a64; border-color: #c7e3dd; }
#mainPage .badge-new { background: linear-gradient(180deg, #e7d3a0, var(--c-gold)); color: var(--c-night); }
.modal .modal-box { border-radius: 18px; }
.modal .btn-primary { background: linear-gradient(180deg, #1b625e, #0f3536); border-radius: 10px; }

.v13-toast {
    position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%) translateY(20px); z-index: 2000;
    background: #0a1f20; color: #fff; padding: .75rem 1.15rem; border-radius: 12px; font: 500 .85rem 'Inter', sans-serif;
    box-shadow: 0 12px 32px rgba(0,0,0,.28); border: 1px solid rgba(231,211,160,.2); opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none;
}
.v13-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
    .v13-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
    #mainPage .content-inner { padding: 1rem .9rem 6.5rem; }
    .v13-topbar { display: none; }
    #mainPage .mobile-topbar {
        height: 58px; background: linear-gradient(180deg, #0b2425, #0a1f20); border-bottom: 1px solid rgba(231,211,160,.12);
    }
    #mainPage .mobile-topbar .ls-mark { width: 22px; height: 28px; }
    #mainPage .mobile-topbar .ls-word { font-size: .95rem; }
    #mainPage .mobile-menu-btn, #mainPage .notif-bell-mobile { border-radius: 10px; width: 38px; height: 38px; }
    .v13-grid-21, .v13-grid-11 { grid-template-columns: 1fr; }
    .v13-hero { padding: 1.4rem 1.25rem 1.5rem; border-radius: 18px; align-items: flex-start; }
    .v13-hero-mark { width: 150px; height: 190px; right: -20px; top: -10px; }
    .v13-hero-side { align-items: stretch; width: 100%; }
    .v13-hero-facts { width: 100%; }
    .v13-fact { flex: 1; min-width: 0; }
    .v13-hero-actions { justify-content: stretch; width: 100%; }
    .v13-hero-actions > * { flex: 1; justify-content: center; min-height: 46px; }
    .v13-toolbar { top: 58px; }
    #mainPage .notif-bell { display: none; }

    .v13-bnav {
        display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: .6rem; right: .6rem; bottom: calc(.6rem + env(safe-area-inset-bottom)); z-index: 45;
        background: rgba(10,31,32,.96); backdrop-filter: blur(12px); padding: .3rem .2rem; border-radius: 18px;
        box-shadow: 0 12px 30px rgba(0,0,0,.28); border: 1px solid rgba(231,211,160,.14);
    }
    .v13-bnav button {
        position: relative; border: 0; background: transparent; color: rgba(255,255,255,.58); cursor: pointer;
        display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .45rem .1rem; min-height: 54px;
        font: 600 .62rem 'Inter', sans-serif; border-radius: 13px;
    }
    .v13-bnav button.active { color: #fff; background: rgba(255,255,255,.08); }
    .v13-bnav button.active svg { color: var(--c-gold); }
    .v13-bnav .v13-bnav-badge {
        position: absolute; top: .3rem; left: 56%; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
        background: var(--c-gold); color: var(--c-night); font-size: .6rem; display: grid; place-items: center;
    }
}
@media (max-width: 760px) {
    .v13-kpis { gap: .65rem; }
    .v13-kpi { padding: .95rem .9rem .85rem; }
    .v13-kpi-val { font-size: 2rem; margin-top: .6rem; }
    .v13-kpi-ico { width: 36px; height: 36px; border-radius: 10px; }
    .v13-kpi-tag { display: none; }
    .v13-table-wrap { display: none; }
    .v13-cards { display: grid; }
    .v13-toolbar .v13-select { flex: 1 1 45%; max-width: none; }
    .v13-toolbar .v13-seg { flex: 1 1 100%; }
    .v13-toolbar .v13-seg button { flex: 1; }
    .v13-toolbar .v13-btn { flex: 1 1 45%; }
    .v13-donut { width: 132px; height: 132px; }
    .v13-summary .c-cat { display: none; }
    .v13-card-h { flex-wrap: wrap; }
    .v13-card-h > .v13-legend { width: 100%; }
    .v13-fact b { font-size: 1.25rem; }
    #mainPage .page-header h1 { font-size: 1.5rem; }
}
@media print {
    .v13-bnav, .v13-toolbar, .v13-topbar, .sidebar, .mobile-topbar, .notif-bell { display: none !important; }
}

/* ═══ v14 : profils, écran terrain, signalements, carte plein écran ═══════ */
#mainPage .v13-nav-badge {
    margin-left: auto; flex: 0 0 auto; min-width: 18px; padding: .08rem .45rem; border-radius: 10px; text-align: center;
    font-size: .68rem; font-weight: 600; background: var(--c-gold); color: var(--c-night);
}
.v13-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.v13-fige { overflow: hidden; }

/* Écran terrain */
.v13-hero-terrain { padding: 1.6rem 1.8rem; }
.v13-hero-terrain h1 { margin-bottom: .2rem; }
.v13-tuiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.v13-tuile {
    position: relative; overflow: hidden; text-align: left; cursor: pointer; font: inherit;
    display: flex; flex-direction: column; gap: .35rem; min-height: 132px; padding: 1.2rem 1.15rem;
    border-radius: var(--r-lg); border: 1px solid var(--c-line); background: var(--c-card); box-shadow: var(--sh-1);
    transition: transform .15s, box-shadow .15s;
}
.v13-tuile:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(15,36,37,.10); }
.v13-tuile:focus-visible { outline: 2px solid var(--c-gold); outline-offset: 2px; }
.v13-tuile svg { width: 42px; height: 42px; padding: 9px; border-radius: 12px; color: #fff; margin-bottom: .35rem; box-sizing: border-box; }
.v13-tuile b { font: 600 1rem 'Inter', sans-serif; color: var(--c-ink); }
.v13-tuile span { font-size: .76rem; color: var(--c-mute); }
.v13-tuile.t-carte { background: linear-gradient(135deg, #0a1f20, #15504d); border-color: #0f3536; }
.v13-tuile.t-carte b { color: #fff; } .v13-tuile.t-carte span { color: rgba(255,255,255,.7); }
.v13-tuile.t-carte svg { background: linear-gradient(180deg, #f3e3b4, var(--c-gold)); color: var(--c-night); }
.v13-tuile.t-fuite svg { background: linear-gradient(135deg, #3fb0a5, #15504d); }
.v13-tuile.t-anomalie svg { background: linear-gradient(135deg, #e7d3a0, #b08f43); color: #3c2f10; }
.v13-tuile.t-zone svg { background: linear-gradient(135deg, #e9775f, #b13a26); }

/* Signalements */
.v13-sig-cta { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.v13-sig-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: .9rem; }
.v13-sig { display: flex; flex-direction: column; }
.v13-sig-corps { display: flex; gap: .85rem; align-items: flex-start; }
.v13-sig-photo { flex-shrink: 0; width: 84px; height: 84px; border-radius: 12px; overflow: hidden; border: 1px solid var(--c-line); background: var(--c-soft); }
.v13-sig-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.v13-sig .v13-item-actions { margin-top: auto; padding-top: .8rem; flex-wrap: wrap; }
.v13-sig .v13-item-actions .v13-btn { flex: 1 1 auto; height: 42px; }

/* Formulaire de signalement */
.modal .v13-sig-box { max-width: 520px; }
.modal .v13-seg { display: inline-flex; background: #ece7db; border-radius: 11px; padding: 3px; gap: 2px; }
.modal .v13-seg button { border: 0; background: transparent; border-radius: 8px; padding: .52rem .85rem; cursor: pointer; font: 600 .82rem 'Inter', sans-serif; color: #7a8684; }
.modal .v13-seg button.active { background: #fff; color: #0f2425; box-shadow: 0 1px 3px rgba(15,36,37,.12); }
.modal .v13-seg-big { display: flex; width: 100%; margin-bottom: 1.1rem; }
.modal .v13-seg-big button { flex: 1; padding: .8rem; font-size: .92rem; }
.modal .v13-gps, .modal .v13-photo-drop {
    display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; min-height: 46px; margin-top: .55rem;
    border-radius: 11px; border: 1px dashed #cfc6b0; background: #faf8f3; color: #15504d; font: 600 .86rem 'Inter', sans-serif; cursor: pointer;
}
.modal .v13-gps:hover, .modal .v13-photo-drop:hover { border-color: #1f8079; background: #f0f7f5; }
.modal .v13-photo-drop { min-height: 54px; margin-top: 0; }
#sigPhotoApercu img { margin-top: .6rem; max-width: 100%; max-height: 180px; border-radius: 12px; border: 1px solid #ebe6da; object-fit: cover; }
.modal .v13-sig-box .input-field { min-height: 46px; font-size: 1rem; }

/* Carte de vulnérabilité plein écran */
.v13-carte { position: fixed; inset: 0; z-index: 1500; display: flex; flex-direction: column; background: #0a1f20; }
.v13-carte.hidden { display: none !important; }
.v13-carte-barre {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: calc(.6rem + env(safe-area-inset-top)) 1rem .6rem; color: #fff; border-bottom: 1px solid rgba(231,211,160,.15);
}
.v13-carte-titre { font: 600 1rem 'Fraunces', Georgia, serif; color: #f3e3b4; }
.v13-carte-sous { font-size: .74rem; color: rgba(255,255,255,.65); text-transform: none; }
.v13-carte-fermer {
    width: 44px; height: 44px; border-radius: 12px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06);
    color: #fff; display: grid; place-items: center; cursor: pointer; flex-shrink: 0;
}
.v13-carte-fermer:focus-visible { outline: 2px solid #c9a95c; outline-offset: 2px; }
.v13-carte iframe { flex: 1; width: 100%; border: 0; background: #fff; }

/* Bouton central « Signaler » de la barre basse */
@media (max-width: 1023px) {
    .v13-bnav button.v13-bnav-cta { color: var(--c-night); }
    .v13-bnav button.v13-bnav-cta svg {
        width: 40px; height: 40px; padding: 9px; margin-top: -18px; border-radius: 14px; box-sizing: border-box;
        background: linear-gradient(180deg, #f3e3b4, var(--c-gold)); color: var(--c-night) !important; box-shadow: 0 8px 18px rgba(201,169,94,.4);
    }
    .v13-bnav button.v13-bnav-cta span { color: #f3e3b4; }
    .v13-tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
    .v13-tuile { min-height: 128px; padding: 1rem; }
    .v13-sig-grille { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .v13-sig-cta .v13-btn { flex: 1 1 100%; height: 48px; }
    .v13-tuile b { font-size: .92rem; }
}
