@import url('fonts.css');

/* =================================================================
   DESIGN TOKENS
   ================================================================= */
:root {
    /* Charte Municipass : le back-office est le produit Municipass (identique pour
       toutes les communes) — navy #0f2747 + vert #12a150, comme municipass.fr et le Hub.
       L'identité de la commune reste réservée au SITE PUBLIC (thème/carrosserie). */
    --green: #12a150;
    --green-light: #3fd07f;
    --green-dark: #0e7d3f;
    --green-soft: #e9f7ee;
    --blue: #1c3a63;
    --blue-dark: #0f2747;
    --orange: #E85A2C;
    --red: #E94B4B;
    --grey: #6b7280;
    /* --grey-2 remonté de #9ca3af (2.5:1, sous le seuil RGAA) à #6b7280 (4.8:1) :
       il sert à du TEXTE informatif (.muted, .hint, .report-*…). Le gris très clair
       d'origine est conservé dans --grey-3, RÉSERVÉ au décoratif/placeholder (exempté). */
    --grey-2: #6b7280;
    --grey-3: #9ca3af;
    --grey-light: #f3f4f6;
    --border: #e6e8ec;
    /* Canvas neutre (style « SaaS clair ») : cartes blanches sur gris froid très
       léger, l'accent vert/bleu reste réservé aux actions. */
    --bg: #f5f6f8;
    --card: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 14px rgba(30, 92, 139, 0.08);
    --shadow-lg: 0 12px 30px rgba(30, 92, 139, 0.15);
    --radius-sm: 0.4rem;
    --radius-md: 0.6rem;
    --radius-lg: 0.85rem;
    --radius-xl: 1.25rem;
}

/* =================================================================
   RESET / BASE
   ================================================================= */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    color: var(--blue-dark);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

/* =================================================================
   LOGIN — refonte premium
   ================================================================= */
.login-page {
    /* Conteneur scrollable : pas de min-height: 100vh + grid (qui bloquait
       le scroll dans certains navigateurs avec `place-items: center`). On garde
       un centrage horizontal simple via flex column + align-items: center, et
       le contenu reste libre de dépasser → scroll naturel de la page. */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(2rem, 8vh, 6rem) 1rem 3rem;
    min-height: 100vh;
    background:
        radial-gradient(ellipse 800px 600px at 20% -10%, rgba(18, 161, 80, 0.18) 0%, transparent 60%),
        radial-gradient(ellipse 700px 500px at 110% 110%, rgba(30, 92, 139, 0.16) 0%, transparent 55%),
        linear-gradient(180deg, #f8fbf5 0%, #f0f7ee 100%);
    background-attachment: fixed;
    position: relative;
}
.login-card {
    background: var(--card);
    padding: 2.75rem 2.5rem 2.25rem;
    border-radius: 20px;
    box-shadow:
        0 40px 80px -20px rgba(30, 92, 139, 0.25),
        0 12px 30px -10px rgba(30, 92, 139, 0.12),
        0 0 0 1px rgba(30, 92, 139, 0.04);
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}
.login-card .login-logo {
    display: block;
    margin: 0 auto 1.5rem;
    max-width: 200px;
    height: auto;
}
.login-card h1 {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-align: center;
    color: var(--blue-dark);
}
.accent { color: var(--green); }
.login-card .lead {
    margin: 0 0 2rem;
    color: var(--grey);
    font-size: 0.92rem;
    text-align: center;
}
.login-card label {
    display: block;
    margin-bottom: 1rem;
}
.login-card label span {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--blue-dark);
}
.login-card input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 0.98rem;
    font-family: inherit;
    color: var(--blue-dark);
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}
.login-card input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(18, 161, 80, 0.14);
}
.login-card button {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 6px 18px -6px rgba(14, 125, 63, 0.45);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
    margin-top: 0.5rem;
}
.login-card button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px -6px rgba(14, 125, 63, 0.55);
    filter: brightness(1.05);
}
.login-card button:active { transform: translateY(0); }
.login-back-site {
    display: inline-flex; align-items: center; gap: 0.35rem;
    margin-top: 1.5rem;
    color: var(--grey);
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 0.15s;
}
.login-back-site:hover { color: var(--blue-dark); }
.login-foot {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.88rem;
}
.login-foot a { color: var(--blue-dark); text-decoration: none; font-weight: 500; }
.login-foot a:hover { text-decoration: underline; }

/* =================================================================
   ADMIN SHELL (sidebar + content)
   ================================================================= */
.admin {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}
.sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #fafcf8 100%);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 1px 0 0 rgba(15, 30, 60, 0.02);
}

/* === En-tête de marque : logo + sous-titre === */
.sidebar .brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.4rem 1rem 1.1rem;
    text-decoration: none;
    border-bottom: 1px solid rgba(15, 30, 60, 0.06);
}
/* En-tête admin : nom de la solution (« Portail citoyen ») + badge « Administration », aux couleurs Municipass. */
.sidebar .brand-product {
    font-weight: 800; font-size: 1.12rem; letter-spacing: -0.02em; color: var(--blue-dark);
}
.sidebar .brand-subtitle {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--green-dark);
    background: var(--green-soft, #f4f9ee);
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
}

/* === Bouton "Voir le site public" === */
.sidebar-site-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin: 0.85rem 1rem 0.4rem;
    padding: 0.6rem 0.85rem;
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: #fff;
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 4px 12px -3px rgba(14, 125, 63, 0.4);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.sidebar-site-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px -3px rgba(14, 125, 63, 0.55);
    filter: brightness(1.05);
}
.sidebar-site-link svg { flex-shrink: 0; }

.sidebar-nav {
    padding: 0.6rem 0 0.4rem;
    flex: 1;
    overflow-y: auto;
}

/* ===== Groupes pliables (details/summary) ===== */
.sidebar-group { margin: 0; }
.sidebar-group summary::-webkit-details-marker { display: none; }
.sidebar-group summary::marker { content: ''; }
.sidebar-group-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    list-style: none;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.11em;
    color: var(--grey-2);
    padding: 1rem 1.25rem 0.4rem;
    user-select: none;
    transition: color 0.15s;
}
.sidebar-group-label:hover { color: var(--blue-dark); }
.sidebar-group-chevron {
    flex-shrink: 0;
    opacity: 0.5;
    transition: transform 0.2s ease, opacity 0.15s;
    transform: rotate(-90deg);
}
.sidebar-group[open] .sidebar-group-chevron {
    transform: rotate(0);
    opacity: 0.75;
}
.sidebar-group-label:hover .sidebar-group-chevron { opacity: 1; }

.sidebar-group-items {
    display: flex;
    flex-direction: column;
    padding: 0.05rem 0.5rem 0.25rem;
}
.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.85rem;
    margin: 0.06rem 0;
    color: var(--grey);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}
.sidebar-link:hover {
    background: rgba(15, 30, 60, 0.04);
    color: var(--blue-dark);
}
.sidebar-link.is-active {
    background: linear-gradient(90deg, rgba(18, 161, 80, 0.14) 0%, rgba(18, 161, 80, 0.04) 100%);
    color: var(--blue-dark);
    font-weight: 600;
}
.sidebar-link.is-active::before {
    content: "";
    position: absolute;
    left: -0.5rem;
    top: 6px; bottom: 6px;
    width: 3px;
    background: var(--green);
    border-radius: 0 3px 3px 0;
}
.sidebar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    font-size: 1rem;
    flex-shrink: 0;
    opacity: 0.8;
}
.sidebar-link.is-active .sidebar-icon { opacity: 1; }
.sidebar-label { flex: 1; }

/* === Recherche rapide dans la sidebar === */
.sidebar-search { position: relative; padding: 0.5rem 1rem 0.35rem; }
.sidebar-search .sidebar-search-ico { position: absolute; left: 1.65rem; top: 50%; transform: translateY(-50%); color: var(--grey-3); display: flex; pointer-events: none; }
.sidebar-search input {
    width: 100%;
    padding: 0.5rem 0.7rem 0.5rem 2.1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font: inherit; font-size: 0.85rem;
    background: #fff; color: var(--blue-dark);
}
.sidebar-search input::placeholder { color: var(--grey-3); }
.sidebar-search input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(18,161,80,.15); }
.sidebar-link.search-hidden,
.sidebar-group.search-hidden { display: none !important; }
/* Pendant une recherche : déplie visuellement tous les groupes sans toucher leur état mémorisé. */
.sidebar-searching .sidebar-group:not([open]) > .sidebar-group-items { display: flex !important; }
.sidebar-searching .sidebar-group-chevron { opacity: 0; }

/* === Footer sidebar : utilisateur + déconnexion === */
.sidebar-footer {
    padding: 0.9rem 1rem 1.25rem;
    border-top: 1px solid rgba(15, 30, 60, 0.06);
    background: rgba(247, 251, 243, 0.5);
}
.sidebar-switch-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 0.75rem;
    margin-bottom: 0.85rem;
    background: rgba(30, 92, 139, 0.06);
    color: var(--blue-dark);
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-switch-link:hover { background: var(--blue-dark); color: #fff; }
.user-card {
    margin-bottom: 0.65rem;
    padding: 0.65rem 0.85rem;
    background: #fff;
    border: 1px solid rgba(15, 30, 60, 0.06);
    border-radius: 10px;
}
.user-name { font-weight: 600; font-size: 0.9rem; color: var(--blue-dark); line-height: 1.2; }
.user-role { font-size: 0.74rem; color: var(--green-dark); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; margin-top: 0.15rem; }
.btn-logout {
    width: 100%;
    padding: 0.55rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--grey);
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s;
}
.btn-logout:hover { background: var(--red); border-color: var(--red); color: white; }

.content { background: var(--bg); }
.content-header {
    background: var(--card);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
}
.content-header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.content-body {
    padding: 2rem;
    max-width: 1400px;
}

/* =================================================================
   FLASH MESSAGES
   ================================================================= */
.flash {
    padding: 0.85rem 1.2rem;
    border-radius: var(--radius-md);
    margin: 0 0 1.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}
.flash-success { background: rgba(18, 161, 80, 0.15); color: var(--green-dark); border: 1px solid rgba(18, 161, 80, 0.3); }
.flash-error   { background: rgba(233, 75, 75, 0.1);  color: var(--red); border: 1px solid rgba(233, 75, 75, 0.3); }
.flash-info    { background: rgba(28, 58, 99, 0.12); color: var(--blue-dark); border: 1px solid rgba(28, 58, 99, 0.3); }

/* =================================================================
   COMPONENTS — BUTTONS
   ================================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    line-height: 1.2;
    white-space: nowrap;
}
.btn-primary {
    background: var(--green);
    color: white;
    box-shadow: 0 2px 8px rgba(18, 161, 80, 0.25);
}
.btn-primary:hover {
    background: var(--green-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(18, 161, 80, 0.35);
}
.btn-ghost {
    background: var(--card);
    color: var(--blue-dark);
    border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg); border-color: var(--blue); }
.btn-danger {
    background: var(--card);
    color: var(--red);
    border-color: rgba(233, 75, 75, 0.3);
}
.btn-danger:hover { background: var(--red); color: white; border-color: var(--red); }
.btn-block { width: 100%; }
.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.85rem; }

/* =================================================================
   COMPONENTS — CARDS, BADGES, FIELDS
   ================================================================= */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}
.card-compact { padding: 1.25rem; }
.card-title {
    margin: 0 0 1rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--grey);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.badge-published { background: rgba(18, 161, 80, 0.15); color: var(--green-dark); }
.badge-draft     { background: rgba(107, 114, 128, 0.15); color: var(--grey); }
.badge-info      { background: rgba(28, 58, 99, 0.15); color: var(--blue-dark); }

.field { margin-bottom: 1.25rem; }
.field:last-child { margin-bottom: 0; }
.field label,
.field .grp-label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--blue-dark);
    margin-bottom: 0.4rem;
}
.field label .muted { color: var(--grey-2); font-weight: 400; font-size: 0.85em; }
.field input[type="text"],
.field input[type="email"],
.field input[type="number"],
.field input[type="password"],
.field input[type="url"],
.field input[type="tel"],
.field input[type="date"],
.field input[type="datetime-local"],
.field textarea,
.field select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    background: white;
    color: var(--blue-dark);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(18, 161, 80, 0.15);
}
.field textarea { resize: vertical; min-height: 60px; line-height: 1.5; }
.hint {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.78rem;
    color: var(--grey-2);
    line-height: 1.4;
}
.hint a { color: var(--blue-dark); }
.hint code { background: var(--grey-light); padding: 0.05rem 0.3rem; border-radius: var(--radius-sm); font-size: 0.92em; }
.muted { color: var(--grey-2); font-weight: 400; }

/* Slug input with prefix */
.input-prefix {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: white;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.input-prefix:focus-within {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(18, 161, 80, 0.15);
}
.input-prefix .prefix {
    padding: 0.65rem 0.85rem;
    background: var(--bg);
    color: var(--grey);
    font-family: ui-monospace, SFMono-Regular, monospace;
    border-right: 1px solid var(--border);
    user-select: none;
}
.input-prefix input {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    flex: 1;
}

/* Collapsible section */
details.collapse {
    margin-top: 1.5rem;
    background: var(--bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
}
details.collapse > summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--blue-dark);
    font-size: 0.92rem;
    padding: 0.85rem 1.25rem;
    list-style: none;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
details.collapse > summary::before {
    content: '▸';
    color: var(--green);
    font-size: 0.8em;
    transition: transform 0.15s;
}
details.collapse[open] > summary::before { transform: rotate(90deg); }
details.collapse[open] > summary { border-bottom: 1px solid var(--border); }
details.collapse > summary::-webkit-details-marker { display: none; }
details.collapse .body { padding: 1.25rem; background: white; }

/* =================================================================
   PAGE TOOLBAR (top of admin pages)
   ================================================================= */
.toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.toolbar .spacer { flex: 1; }

/* =================================================================
   DASHBOARD
   ================================================================= */
.welcome { margin-bottom: 1.5rem; color: var(--grey); }
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.metric-card { padding: 1.25rem 1.5rem; }
.metric-card h3 {
    margin: 0 0 0.4rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--grey);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.metric-card .metric {
    margin: 0 0 0.4rem;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--blue-dark);
    letter-spacing: -0.03em;
    line-height: 1;
}
.metric-card .hint { margin: 0; font-size: 0.82rem; color: var(--grey-2); }

/* =================================================================
   LIST OF ITEMS (pages, menus, etc.)
   ================================================================= */
.list-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.list-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.12s;
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: var(--bg); }
.list-row .icon-wrap {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: grid;
    place-items: center;
    background: rgba(18, 161, 80, 0.12);
    color: var(--green-dark);
}
.list-row .icon-wrap.is-blue { background: rgba(28, 58, 99, 0.12); color: var(--blue-dark); }
.list-row .icon-wrap.is-grey { background: rgba(107, 114, 128, 0.12); color: var(--grey); }
.list-row .info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.list-row .info-title {
    font-weight: 600;
    color: var(--blue-dark);
    text-decoration: none;
    font-size: 0.97rem;
}
.list-row a.info-title:hover { color: var(--green-dark); }
.list-row .info-meta {
    font-size: 0.78rem;
    color: var(--grey-2);
    font-family: ui-monospace, SFMono-Regular, monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.list-row .actions {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}
.list-row .actions form { display: inline; margin: 0; }
.list-row .actions .btn { padding: 0.4rem 0.75rem; font-size: 0.82rem; }

.empty {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--grey-2);
}
.empty p { margin: 0 0 1rem; font-size: 1rem; }

/* Indented child rows (page tree) */
.list-row[data-depth="1"] .info-title::before,
.list-row[data-depth="2"] .info-title::before,
.list-row[data-depth="3"] .info-title::before { content: '↳ '; color: var(--grey-3); margin-right: 0.25rem; }

/* =================================================================
   FORM LAYOUT (2 columns — main + side)
   ================================================================= */
.form-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    align-items: start;
}
.form-main { min-width: 0; }
.form-side { position: sticky; top: 1rem; }

/* =================================================================
   MENU BUILDER (constructeur de menus)
   ================================================================= */
.menu-builder { max-width: 1400px; }

/* Aperçu live */
.mb-preview {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.mb-preview-label {
    font-size: 0.72rem;
    color: var(--grey);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.mb-preview-label::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--green);
    border-radius: 50%;
    animation: mb-pulse 2s infinite;
}
@keyframes mb-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(18, 161, 80, 0.6); }
    70%  { box-shadow: 0 0 0 8px rgba(18, 161, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(18, 161, 80, 0); }
}
.mb-preview-frame {
    background: linear-gradient(180deg, #ffffff, #f9fbf6);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.25rem;
}
.mp-bar { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.mp-brand-name { font-weight: 700; font-size: 1rem; color: var(--blue-dark); letter-spacing: -0.01em; }
.mp-nav { flex: 1; min-width: 0; }
.mp-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.15rem; flex-wrap: wrap; }
.mp-item { position: relative; }
.mp-link { display: inline-block; padding: 0.4rem 0.85rem; color: var(--blue-dark); font-weight: 600; font-size: 0.9rem; border-radius: var(--radius-sm); cursor: default; }
.mp-section { color: var(--grey); font-style: italic; }
.mp-caret { color: var(--green); font-size: 0.7em; }
.mp-sub { display: none; list-style: none; margin: 0; padding: 0.4rem 0; }

/* Astuce */
.mb-tip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 1.25rem;
    padding: 0.7rem 1rem;
    background: rgba(28, 58, 99, 0.06);
    border-left: 3px solid var(--blue);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: #364e69;
    font-size: 0.88rem;
    line-height: 1.4;
}
.mb-tip strong { color: var(--blue-dark); }

/* Statut sauvegarde */
.mb-status {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    transition: all 0.2s;
}
.mb-status:empty { padding: 0; }
.mb-status.saving { background: rgba(28, 58, 99, 0.15); color: var(--blue-dark); }
.mb-status.ok     { background: rgba(18, 161, 80, 0.15); color: var(--green-dark); }
.mb-status.error  { background: rgba(233, 75, 75, 0.15); color: var(--red); }

/* Layout */
.mb-body { display: grid; grid-template-columns: 1fr; gap: 1.25rem; align-items: start; }
.mb-body.has-form { grid-template-columns: 1fr 420px; }
.mb-list-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0.5rem; }

/* Arborescence */
.mb-tree, .mb-subtree { list-style: none; margin: 0; padding: 0; }
.mb-subtree { margin: 0.4rem 0 0.4rem 1.5rem; padding-left: 1rem; border-left: 2px dashed var(--border); min-height: 8px; }
.mb-item { margin-bottom: 0.4rem; }
.mb-item:last-child { margin-bottom: 0; }

.mb-row { display: flex; align-items: center; gap: 0.4rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); transition: all 0.15s; overflow: hidden; }
.mb-row:hover { border-color: var(--green); box-shadow: 0 4px 14px rgba(18, 161, 80, 0.12); }

.mb-drag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
    align-self: stretch;
    color: var(--grey-2);
    cursor: grab;
    user-select: none;
    flex-shrink: 0;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.02));
    border-right: 1px solid var(--border);
    transition: background 0.15s, color 0.15s;
}
.mb-drag:hover { background: var(--bg); color: var(--blue-dark); }
.mb-drag:active { cursor: grabbing; }

.mb-clickable { display: flex; align-items: center; gap: 0.85rem; flex: 1; min-width: 0; padding: 0.65rem 0.85rem; text-decoration: none; color: inherit; transition: background 0.12s; }
.mb-clickable:hover { background: var(--bg); }

.mb-icon { flex-shrink: 0; width: 32px; height: 32px; border-radius: var(--radius-md); display: grid; place-items: center; }
.mb-icon-page     { background: rgba(18, 161, 80, 0.15); color: var(--green-dark); }
.mb-icon-external { background: rgba(28, 58, 99, 0.15); color: var(--blue-dark); }
.mb-icon-section  { background: rgba(107, 114, 128, 0.15); color: var(--grey); }
.mb-icon-broken   { background: rgba(233, 75, 75, 0.15); color: var(--red); }

.mb-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; flex: 1; }
.mb-label { font-weight: 600; color: var(--blue-dark); font-size: 0.95rem; line-height: 1.2; }
.mb-link { color: var(--grey-2); font-size: 0.78rem; font-family: ui-monospace, SFMono-Regular, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mb-actions { display: flex; align-items: center; gap: 0.3rem; padding: 0.4rem 0.55rem 0.4rem 0; flex-shrink: 0; }
.mb-actions form { display: inline-flex; margin: 0; }
.mb-actions .btn { padding: 0.4rem 0.7rem; font-size: 0.8rem; }

/* États SortableJS */
.mb-ghost > .mb-row { border-style: dashed; border-color: var(--green); background: rgba(18, 161, 80, 0.06); opacity: 0.7; }
.mb-chosen > .mb-row { background: rgba(18, 161, 80, 0.04); }
.mb-drag-active > .mb-row { box-shadow: 0 14px 35px rgba(30, 92, 139, 0.22); border-color: var(--green); }

/* Panneau formulaire */
.mb-form-panel { position: sticky; top: 1rem; }
.mb-form-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); }
.mb-form-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; background: var(--bg); border-bottom: 1px solid var(--border); }
.mb-form-head h3 { margin: 0; font-size: 0.95rem; font-weight: 700; color: var(--blue-dark); }
.mb-close { width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--radius-sm); color: var(--grey); text-decoration: none; transition: all 0.15s; }
.mb-close:hover { background: var(--red); color: white; }

.mb-form-body { padding: 1.25rem; }
.mb-form-body code { background: var(--grey-light); padding: 0.05rem 0.3rem; border-radius: var(--radius-sm); font-size: 0.92em; }

/* Cartes radio "type" */
.mb-types { display: flex; flex-direction: column; gap: 0.5rem; }
.mb-type {
    display: flex;
    gap: 0.7rem;
    padding: 0.85rem 1rem;
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.12s;
}
.mb-type:hover { background: var(--bg); }
.mb-type:has(input:checked) { border-color: var(--green); background: rgba(18, 161, 80, 0.06); }
.mb-type input { margin-top: 0.15rem; flex-shrink: 0; accent-color: var(--green); width: 18px; height: 18px; }
.mb-type-content { flex: 1; }
.mb-type strong { display: block; font-size: 0.93rem; color: var(--blue-dark); line-height: 1.25; margin-bottom: 0.15rem; }
.mb-type small { display: block; font-size: 0.8rem; color: var(--grey); line-height: 1.4; }

.mb-form-actions { display: flex; flex-direction: column; gap: 0.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }

@media (max-width: 1100px) {
    .mb-body.has-form { grid-template-columns: 1fr; }
    .mb-form-panel { position: static; }
}
@media (max-width: 700px) {
    .mb-row { flex-wrap: wrap; }
    .mb-clickable { flex: 1 1 100%; }
    .mb-actions { width: 100%; padding: 0.4rem 0.6rem; flex-wrap: wrap; gap: 0.35rem; border-top: 1px solid var(--border); background: var(--bg); }
    .mb-actions .btn { flex: 1; min-width: 30%; }
}

/* =================================================================
   FOCUS STATES
   ================================================================= */
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* =================================================================
   RESPONSIVE
   ================================================================= */
@media (max-width: 1100px) {
    .form-layout { grid-template-columns: 1fr; }
    .form-side { position: static; }
}

/* Grilles de formulaire utilitaires (collapse en colonne unique sur mobile) */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.form-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 720px) {
    .form-grid-2,
    .form-grid-3,
    .form-grid-4 { grid-template-columns: 1fr; gap: 0.6rem; }
}

/* =================================================================
   CONFORT TACTILE (mobile / tablette)
   Cibles ≥ 44px sur les contrôles PRINCIPAUX (boutons d'action, liens
   de navigation, champs de saisie). On ne touche PAS aux petits
   boutons-icônes des lignes (actions, suppression) qui restent compacts.
   ================================================================= */
@media (max-width: 900px) {
    .btn,
    .sidebar-link,
    .sidebar-site-link { min-height: 44px; }
    .btn { display: inline-flex; align-items: center; justify-content: center; }
    input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]),
    select,
    textarea {
        min-height: 44px;
        font-size: 16px; /* empêche le zoom automatique d'iOS au focus */
    }
    textarea { min-height: 96px; }
}

/* Tableau de données standard (listes admin) — chrome canonique, promu depuis
   les démarches pour être réutilisable partout (RDV, blocages…). */
.dem-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.dem-table th, .dem-table td { padding: .7rem .9rem; border-bottom: 1px solid var(--border); text-align: left; font-size: .92rem; vertical-align: middle; }
.dem-table th { background: var(--bg); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--grey); }
.dem-table tr:last-child td { border-bottom: 0; }
.dem-table a.row-link, a.row-link { color: var(--blue-dark); text-decoration: none; font-weight: 600; }
.dem-empty { padding: 2rem; text-align: center; color: var(--grey); }

/* =================================================================
   TABLEAUX RESPONSIFS — réorganisés en CARTES sur mobile (≤ 700px)
   Adoption par un tableau : <table class="… rtable"> + data-label="Colonne"
   sur chaque <td> à étiqueter. La 1re cellule sert de titre de carte ;
   la dernière (sans data-label) sert de zone d'action. Bien plus lisible
   pour un agent sur téléphone qu'un défilement horizontal.
   ================================================================= */
@media (max-width: 700px) {
    table.rtable,
    table.rtable tbody,
    table.rtable tr,
    table.rtable td { display: block; width: auto; }
    /* Annule le min-width: 600px du mode « défilement » (sinon la page déborde). */
    table.rtable { border: 0; background: transparent; overflow: visible; min-width: 0 !important; }
    table.rtable thead { position: absolute; left: -9999px; top: -9999px; } /* en-têtes repris via data-label */
    table.rtable tr {
        background: var(--card);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-sm);
        margin-bottom: 0.7rem;
        padding: 0.7rem 0.9rem;
    }
    /* Chaque cellule : libellé en petit au-dessus, valeur en dessous (passe à la
       ligne quoi qu'il arrive — emails longs compris). Pas de flex/grid à % qui
       déborde. */
    table.rtable td {
        border: 0 !important;
        padding: 0.3rem 0;
        white-space: normal !important;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
    table.rtable td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.68rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--grey-2);
        font-weight: 700;
        margin-bottom: 0.1rem;
    }
    table.rtable td:not([data-label])::before { content: none; }
    /* 1re cellule = titre de la carte */
    table.rtable td:first-child {
        font-size: 1.02rem;
        font-weight: 700;
        padding-bottom: 0.5rem;
        margin-bottom: 0.4rem;
        border-bottom: 1px solid var(--grey-light) !important;
    }
    /* dernière cellule = action, en évidence */
    table.rtable td:last-child {
        padding-top: 0.6rem;
        text-align: left !important;
        font-weight: 600;
    }
}

/* =================================================================
   MOBILE ADMIN — sidebar slide-in + topbar burger
   ================================================================= */
.admin-mobile-bar,
.admin-backdrop,
.sidebar-close,
.admin-mobile-home,
.admin-mobile-brand,
.admin-burger {
    display: none;
}

@media (max-width: 900px) {
    /* La grille passe en une colonne, sidebar fixed off-canvas */
    .admin { grid-template-columns: 1fr; }

    /* Topbar fixe en haut avec burger + logo */
    .admin-mobile-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        position: sticky;
        top: 0;
        z-index: 90;
        background: #fff;
        border-bottom: 1px solid var(--border);
        padding: 0.6rem 1rem;
        height: 56px;
    }
    .admin-mobile-brand {
        font-weight: 700;
        color: var(--blue-dark);
        text-decoration: none;
        font-size: 1rem;
    }
    .admin-mobile-brand .accent { color: var(--green); }
    .admin-mobile-home {
        display: inline-grid; place-items: center;
        width: 36px; height: 36px;
        border-radius: 8px;
        background: var(--bg);
        color: var(--blue-dark);
        text-decoration: none;
        font-weight: 700;
    }

    /* Burger */
    .admin-burger {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 36px; height: 36px;
        background: transparent;
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: 8px;
        cursor: pointer;
    }
    .admin-burger span {
        display: block;
        height: 2px;
        background: var(--blue-dark);
        border-radius: 1px;
        transition: transform 0.2s, opacity 0.2s;
    }
    .admin-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    .admin-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
    .admin-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

    /* Sidebar devient off-canvas slide-in depuis la gauche */
    .sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: min(300px, 85vw);
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 8px 0 24px rgba(15, 30, 60, 0.18);
        overflow-y: auto;
        height: 100vh;
    }
    .sidebar.is-open { transform: translateX(0); }
    body.admin-nav-open { overflow: hidden; }

    /* Bouton close en haut de la sidebar */
    .sidebar-close {
        display: block;
        position: absolute;
        top: 0.6rem; right: 0.6rem;
        width: 40px; height: 40px;
        background: transparent;
        border: 1px solid var(--border);
        border-radius: 8px;
        font-size: 1.6rem;
        color: var(--grey);
        cursor: pointer;
        line-height: 1;
    }
    .sidebar-close:hover { background: var(--bg); color: var(--blue-dark); }

    /* Backdrop semi-transparent */
    .admin-backdrop {
        display: block;
        position: fixed; inset: 0;
        background: rgba(15, 30, 60, 0.5);
        z-index: 150;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s;
    }
    .admin-backdrop.is-open { opacity: 1; pointer-events: auto; }

    /* Reflow du contenu */
    .content-header {
        padding: 1rem 1.25rem;
        position: sticky; top: 56px;
        z-index: 5;
    }
    .content-header h1 { font-size: 1.25rem; }
    .content-body { padding: 1rem 1.25rem 2rem; }

    /* Cards / tables / listes plus aérées sur petit écran */
    .card { padding: 1rem; }
    .card-title { font-size: 1rem; }
    .list-row {
        flex-wrap: wrap;
        gap: 0.4rem;
        padding: 0.85rem;
    }
    .list-row .info { width: 100%; }
    .list-row .actions {
        width: 100%;
        padding-left: 0;
        flex-wrap: wrap;
        margin-top: 0.4rem;
    }
    .list-row .badge { margin-left: auto; }

    /* Toolbar avec filtres : empiler sur mobile */
    .toolbar form { flex-direction: column; align-items: stretch !important; }
    .toolbar form select, .toolbar form input { width: 100%; }
    .toolbar form a { align-self: center; }

    /* Tableaux : faire défiler horizontalement plutôt que casser */
    .table-wrap, .data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 600px; }

    /* Champs de formulaire : pleine largeur */
    input[type="text"], input[type="email"], input[type="password"],
    input[type="number"], input[type="date"], input[type="tel"],
    input[type="url"], select, textarea { width: 100%; box-sizing: border-box; }
}

@media (max-width: 480px) {
    .admin-mobile-bar { padding: 0.5rem 0.8rem; }
    .content-header { padding: 0.85rem 1rem; }
    .content-body { padding: 1rem 1rem 2rem; }
    .admin-mobile-brand { font-size: 0.92rem; }
}

/* ============================================
   SIGNALEMENTS — Index, Show, Categories
   ============================================ */

/* --- Index --- */
.status-chips { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.status-chip {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background: var(--bg);
    color: var(--grey);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all 0.15s;
}
.status-chip:hover { background: var(--card); border-color: var(--border); color: var(--blue-dark); }
.status-chip.is-active { background: var(--blue-dark); color: white; }
.status-chip .chip-count {
    background: rgba(0,0,0,0.1);
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}
.status-chip.is-active .chip-count { background: rgba(255,255,255,0.25); }
.status-chip-nouveau.is-active { background: #92400e; }
.status-chip-en_cours.is-active { background: #1e40af; }
.status-chip-resolu.is-active { background: #065f46; }
.status-chip-rejete.is-active { background: #991b1b; }

.filter-select {
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-family: inherit;
    color: var(--grey);
}

.badge-new { background: rgba(245, 158, 11, 0.15); color: #92400e; }

.report-row {
    display: flex; align-items: center; gap: 1rem;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border);
    text-decoration: none; color: inherit;
    transition: background 0.12s;
}
.report-row:last-child { border-bottom: none; }
.report-row:hover { background: var(--bg); }
.report-row-cat { flex-shrink: 0; width: 4px; height: 36px; border-radius: 2px; }
.report-row-body { flex: 1; min-width: 0; }
.report-row-top { display: flex; gap: 0.6rem; align-items: baseline; flex-wrap: wrap; margin-bottom: 0.15rem; }
.report-ref { font-family: ui-monospace, monospace; font-size: 0.78rem; color: var(--grey-2); }
.report-row-title { font-weight: 600; color: var(--blue-dark); font-size: 0.95rem; }
.report-row-meta { display: flex; gap: 0.4rem; align-items: center; font-size: 0.82rem; color: var(--grey-2); flex-wrap: wrap; }

/* --- Show --- */
.report-header {
    display: flex; align-items: center; gap: 0.8rem;
    padding: 0.7rem 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    position: sticky; top: 1rem; z-index: 10;
    backdrop-filter: blur(6px);
}
.report-header-left { display: flex; align-items: center; gap: 0.8rem; flex: 1; flex-wrap: wrap; }
.report-header-actions { display: flex; gap: 0.4rem; }
.report-header-actions form { display: inline; margin: 0; }
.report-ref-big { font-family: ui-monospace, monospace; font-size: 0.9rem; font-weight: 600; color: var(--blue-dark); }
.report-cat { font-size: 0.85rem; font-weight: 600; }

.report-title { margin: 0 0 0.3rem; font-size: 1.5rem; line-height: 1.2; }
.report-subtitle { color: var(--grey-2); font-size: 0.9rem; margin: 0 0 1.5rem; }

.report-grid { display: grid; grid-template-columns: 1fr 320px; gap: 1.25rem; align-items: flex-start; }
.report-main { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.report-side { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 5rem; }

.report-description { white-space: pre-wrap; line-height: 1.6; margin: 0; }

.photo-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
}
.photo-grid img {
    width: 100%; aspect-ratio: 1/1; object-fit: cover;
    border-radius: var(--radius-sm);
    transition: transform 0.15s;
}
.photo-grid a:hover img { transform: scale(1.02); }

.report-map { height: 320px; border-radius: var(--radius-sm); }
.report-coords { font-size: 0.82rem; margin: 0.5rem 0 0; font-family: ui-monospace, monospace; }

/* Conversation */
.conv-thread { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1rem; }
.conv-msg {
    padding: 0.8rem 1rem; border-radius: 0.7rem;
    max-width: 88%;
}
.conv-citizen { background: var(--bg); align-self: flex-start; border-top-left-radius: 0.2rem; }
.conv-admin   { background: rgba(28, 58, 99, 0.15); align-self: flex-end; border-top-right-radius: 0.2rem; }
.conv-meta {
    display: flex; gap: 0.6rem; align-items: baseline;
    font-size: 0.8rem; margin-bottom: 0.3rem;
}
.conv-meta strong { color: var(--blue-dark); }
.conv-body { white-space: pre-wrap; font-size: 0.93rem; line-height: 1.5; color: var(--text); }

.conv-form {
    border-top: 1px solid var(--border);
    padding-top: 0.9rem;
    margin-top: 0.5rem;
    display: flex; flex-direction: column; gap: 0.6rem;
}
.conv-form textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.93rem;
    resize: vertical;
    min-height: 70px;
}
.conv-form textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(28,58,99,0.15); }
.conv-form button { align-self: flex-end; }

/* Auteur */
.owner-block { display: flex; gap: 0.7rem; align-items: flex-start; }
.owner-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--green-dark));
    color: white; font-weight: 700; font-size: 0.9rem;
    display: grid; place-items: center;
    flex-shrink: 0;
    text-transform: uppercase;
}
.owner-block strong { color: var(--blue-dark); font-size: 0.92rem; display: block; margin-bottom: 0.15rem; }
.owner-block a { color: var(--blue); text-decoration: none; font-size: 0.85rem; }
.owner-block a:hover { text-decoration: underline; }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline-item {
    display: flex; gap: 0.7rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--grey);
    margin-top: 0.4rem;
    flex-shrink: 0;
}
.status-dot-nouveau  { background: #f59e0b; }
.status-dot-en_cours { background: #3b82f6; }
.status-dot-resolu   { background: #10b981; }
.status-dot-rejete   { background: #ef4444; }
.timeline-content { flex: 1; min-width: 0; }
.timeline-status { font-size: 0.88rem; }
.timeline-meta { font-size: 0.78rem; }
.timeline-note { margin: 0.3rem 0 0; font-size: 0.85rem; color: var(--text); white-space: pre-wrap; }

/* Status select avec couleur de bordure */
.status-select {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--blue-dark);
}

@media (max-width: 980px) {
    .report-grid { grid-template-columns: 1fr; }
    .report-side { position: static; }
    .report-header { position: static; }
}

/* --- Categories --- */
.cat-list { display: flex; flex-direction: column; gap: 0.6rem; }
.cat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.cat-card[open] { box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.cat-card-summary {
    display: flex; align-items: center; gap: 0.9rem;
    padding: 0.85rem 1.1rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.cat-card-summary::-webkit-details-marker { display: none; }
.cat-color-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.cat-card-name { font-weight: 600; color: var(--blue-dark); flex: 1; }
.cat-card-meta { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; }
.cat-card-toggle { color: var(--grey-2); display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.85rem; }
.cat-card-toggle .chev { display: inline-block; transition: transform 0.15s; }
.cat-card[open] .cat-card-toggle .chev { transform: rotate(180deg); }

.cat-form {
    padding: 1rem 1.1rem 1.1rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
}
.cat-form .card-title { margin-top: 0; }
.cat-form-grid {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
}
@media (max-width: 720px) { .cat-form-grid { grid-template-columns: 1fr 1fr; } }
.cat-form-actions { display: flex; align-items: center; gap: 0.5rem; margin-top: 1rem; }
.checkbox-inline {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-size: 0.92rem; color: var(--text); cursor: pointer;
}
.checkbox-inline input { width: 16px; height: 16px; accent-color: var(--green); }

.assignee-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.5rem; padding: 0.7rem;
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card);
}
.assignee-checkbox {
    display: flex; gap: 0.5rem; align-items: flex-start;
    padding: 0.45rem 0.6rem; border-radius: var(--radius-sm);
    cursor: pointer; transition: background 0.12s;
}
.assignee-checkbox:hover { background: var(--bg); }
.assignee-checkbox input { width: 16px; height: 16px; margin-top: 0.15rem; accent-color: var(--green); }
.assignee-checkbox strong { display: block; font-size: 0.88rem; color: var(--blue-dark); }
.assignee-checkbox small { font-size: 0.78rem; }

.cat-form-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius-md); margin-bottom: 1rem;
    max-height: 0; overflow: hidden;
    transition: max-height 0.3s ease;
}
.cat-form-card.is-open { max-height: 800px; }
.cat-form-card[open] { max-height: 800px; }
.cat-form-card .cat-form { border-top: none; background: var(--card); }

.cat-delete-form {
    border-top: 1px solid var(--border);
    padding: 0.8rem 1.1rem;
    background: var(--bg);
    display: flex; justify-content: flex-end;
}

/* === User form permissions === */
.user-form { max-width: 720px; }
.perm-group {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem 0.9rem;
    margin: 0 0 0.8rem;
}
.perm-group legend {
    padding: 0 0.4rem;
    font-weight: 600;
    color: var(--blue-dark);
    font-size: 0.92rem;
    display: inline-flex; align-items: center; gap: 0.6rem;
}
.perm-group-toggle {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--grey);
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    cursor: pointer;
    font-family: inherit;
}
.perm-group-toggle:hover { background: var(--bg); border-color: var(--blue); color: var(--blue-dark); }
.perm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.4rem;
    margin-top: 0.6rem;
}
.perm-checkbox {
    display: flex; gap: 0.5rem; align-items: center;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.88rem;
    transition: background 0.12s, border-color 0.12s;
}
.perm-checkbox:hover { background: var(--bg); }
.perm-checkbox input { width: 16px; height: 16px; accent-color: var(--green); }
.perm-checkbox:has(input:checked) { background: rgba(18,161,80,0.08); border-color: var(--green-light); }

/* =================================================================
   MODAL — boîte de dialogue réutilisable, finition premium
   ================================================================= */
.admin-modal {
    position: fixed; inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
        radial-gradient(circle at 30% 20%, rgba(18, 161, 80, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(30, 92, 139, 0.12) 0%, transparent 50%),
        rgba(15, 30, 60, 0.55);
    backdrop-filter: blur(6px) saturate(120%);
    -webkit-backdrop-filter: blur(6px) saturate(120%);
    z-index: 1000;
    animation: admin-modal-fade 0.18s ease;
}
.admin-modal[open], .admin-modal.is-open { display: flex; }
@keyframes admin-modal-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.admin-modal-card {
    position: relative;
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 540px;
    max-height: calc(100vh - 3rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 32px 80px -20px rgba(15, 30, 60, 0.5),
        0 12px 28px -10px rgba(15, 30, 60, 0.18),
        0 0 0 1px rgba(15, 30, 60, 0.04);
    animation: admin-modal-pop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
/* Liseré coloré subtil en haut de chaque modal pour le côté premium */
.admin-modal-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--green) 0%, var(--blue-dark) 100%);
}
@keyframes admin-modal-pop {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.admin-modal-card.is-wide  { max-width: 720px; }
.admin-modal-card.is-large { max-width: 900px; }

.admin-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem;
    padding: 1.35rem 1.6rem 1.15rem;
    background: linear-gradient(180deg, rgba(247, 251, 243, 0.7) 0%, #fff 100%);
    border-bottom: 1px solid rgba(15, 30, 60, 0.06);
}
.admin-modal-head h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--blue-dark);
    letter-spacing: -0.01em;
}
.admin-modal-close {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    background: rgba(15, 30, 60, 0.04);
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--grey);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.18s;
}
.admin-modal-close:hover {
    background: var(--red);
    color: #fff;
    transform: rotate(90deg);
}

.admin-modal-body {
    padding: 1.5rem 1.6rem;
    overflow-y: auto;
    flex: 1;
}

/* === Form premium dans les modals === */
.admin-modal-body label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--blue-dark);
    margin-bottom: 0.45rem;
    letter-spacing: 0.005em;
}
.admin-modal-body input[type="text"],
.admin-modal-body input[type="email"],
.admin-modal-body input[type="url"],
.admin-modal-body input[type="number"],
.admin-modal-body input[type="date"],
.admin-modal-body input[type="datetime-local"],
.admin-modal-body input[type="password"],
.admin-modal-body textarea,
.admin-modal-body select {
    width: 100%;
    padding: 0.7rem 0.95rem;
    border: 1.5px solid rgba(15, 30, 60, 0.1);
    border-radius: 10px;
    font: inherit;
    font-size: 0.95rem;
    color: var(--blue-dark);
    background: #fff;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.admin-modal-body input:hover:not(:focus),
.admin-modal-body textarea:hover:not(:focus),
.admin-modal-body select:hover:not(:focus) {
    border-color: rgba(15, 30, 60, 0.2);
}
.admin-modal-body input:focus,
.admin-modal-body textarea:focus,
.admin-modal-body select:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(18, 161, 80, 0.15);
    background: #fcfffa;
}
.admin-modal-body textarea { resize: vertical; min-height: 4.5em; }
/* Select avec chevron custom (cache le natif) */
.admin-modal-body select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231E5C8B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.95rem center;
    background-size: 12px;
    padding-right: 2.5rem;
    cursor: pointer;
}
.admin-modal-body .field { margin-bottom: 1.1rem; }
.admin-modal-body .field:last-child { margin-bottom: 0; }
.admin-modal-body .hint, .admin-modal-body .mb-hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.78rem;
    color: var(--grey-2);
    line-height: 1.4;
}
.admin-modal-body .hint code, .admin-modal-body .mb-hint code {
    background: rgba(15, 30, 60, 0.06);
    padding: 0.05rem 0.35rem;
    border-radius: 4px;
    font-size: 0.92em;
    color: var(--blue-dark);
}
.admin-modal-body .input-prefix {
    display: flex;
    align-items: center;
    border: 1.5px solid rgba(15, 30, 60, 0.1);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.18s, box-shadow 0.18s;
}
.admin-modal-body .input-prefix:focus-within {
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(18, 161, 80, 0.15);
}
.admin-modal-body .input-prefix .prefix {
    padding: 0.7rem 0.85rem;
    background: rgba(15, 30, 60, 0.04);
    color: var(--grey);
    font-size: 0.9rem;
    white-space: nowrap;
    border-right: 1px solid rgba(15, 30, 60, 0.06);
}
.admin-modal-body .input-prefix input {
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    flex: 1;
}

/* Cartes-radios (le pattern utilisé dans le modal du menu) — version premium */
.admin-modal-body .mb-types {
    display: flex; flex-direction: column; gap: 0.55rem;
}
.admin-modal-body .mb-type {
    display: flex; gap: 0.85rem;
    padding: 1rem 1.15rem;
    background: #fff;
    border: 1.5px solid rgba(15, 30, 60, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.18s ease;
    position: relative;
}
.admin-modal-body .mb-type:hover {
    background: rgba(247, 251, 243, 0.5);
    border-color: rgba(18, 161, 80, 0.4);
    transform: translateY(-1px);
}
.admin-modal-body .mb-type:has(input:checked) {
    border-color: var(--green);
    background: linear-gradient(135deg, rgba(18, 161, 80, 0.06) 0%, rgba(18, 161, 80, 0.02) 100%);
    box-shadow: 0 4px 12px -4px rgba(18, 161, 80, 0.25);
}
.admin-modal-body .mb-type input {
    margin-top: 0.1rem; flex-shrink: 0;
    accent-color: var(--green);
    width: 18px; height: 18px;
}
.admin-modal-body .mb-type strong {
    display: block; font-size: 0.95rem;
    color: var(--blue-dark); line-height: 1.3;
    margin-bottom: 0.2rem; font-weight: 600;
}
.admin-modal-body .mb-type small {
    display: block; font-size: 0.83rem;
    color: var(--grey); line-height: 1.4;
}

/* Checkbox stylé */
.admin-modal-body label:has(input[type="checkbox"]) {
    display: flex; align-items: center; gap: 0.6rem;
    cursor: pointer; font-weight: 500;
    color: var(--blue-dark);
}
.admin-modal-body input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: var(--green);
    flex-shrink: 0;
    margin: 0;
}

/* === Footer premium === */
.admin-modal-foot {
    display: flex; gap: 0.7rem; justify-content: flex-end;
    padding: 1rem 1.6rem 1.2rem;
    background: linear-gradient(180deg, #fff 0%, rgba(247, 251, 243, 0.5) 100%);
    border-top: 1px solid rgba(15, 30, 60, 0.06);
}
.admin-modal-foot .btn {
    padding: 0.7rem 1.4rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.92rem;
    transition: transform 0.15s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.admin-modal-foot .btn-ghost {
    background: transparent;
    color: var(--grey);
    border: 1px solid rgba(15, 30, 60, 0.12);
}
.admin-modal-foot .btn-ghost:hover {
    background: rgba(15, 30, 60, 0.04);
    color: var(--blue-dark);
    border-color: rgba(15, 30, 60, 0.2);
}
.admin-modal-foot .btn-primary {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: #fff;
    border: none;
    box-shadow: 0 6px 16px -4px rgba(14, 125, 63, 0.4);
}
.admin-modal-foot .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -4px rgba(14, 125, 63, 0.5);
    filter: brightness(1.05);
}
.admin-modal-foot .btn-primary:active { transform: translateY(0); }

/* Quand un modal est ouvert, on bloque le scroll de la page */
body.admin-modal-open { overflow: hidden; }

/* =================================================================
   PIÈCES JOINTES (messagerie admin)
   ================================================================= */
.adm-attachments {
    display: flex; flex-wrap: wrap; gap: 0.45rem;
    margin-top: 0.6rem;
}
.adm-attach {
    display: inline-flex; align-items: center; gap: 0.55rem;
    padding: 0.45rem 0.7rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--blue-dark);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.15s;
    max-width: 100%;
}
.adm-attach:hover { background: var(--bg); border-color: var(--green); }
.adm-attach-icon { font-size: 1rem; flex-shrink: 0; }
.adm-attach-meta { display: flex; flex-direction: column; min-width: 0; }
.adm-attach-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.adm-attach-size { color: var(--grey-2); font-size: 0.72rem; }

.adm-attach.is-image {
    padding: 0;
    overflow: hidden;
    width: 180px;
    flex-direction: column;
    align-items: stretch;
}
.adm-attach.is-image img {
    width: 100%; max-height: 160px;
    object-fit: cover; display: block;
}
.adm-attach.is-image .adm-attach-meta { padding: 0.4rem 0.65rem; }

.adm-attach-btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    background: var(--bg);
    border: 1.5px dashed var(--border);
    border-radius: 8px;
    color: var(--blue-dark);
    font-size: 0.86rem; font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.adm-attach-btn:hover {
    background: rgba(18, 161, 80, 0.08);
    border-style: solid;
    border-color: var(--green);
}
.adm-attach-files-list {
    display: inline-block;
    margin-left: 0.6rem;
    color: var(--green-dark);
    font-size: 0.82rem;
}
.adm-reply-files { margin-top: 0.3rem; }

/* ── Centre d'aide intégré ───────────────────────────────────────────────── */
.help-intro { color: var(--grey); margin: 0.1rem 0 1.3rem; max-width: 62ch; line-height: 1.5; }
.help-search { display: flex; gap: 0.6rem; margin: 0 0 1.9rem; max-width: 640px; }
.help-search input {
    flex: 1; padding: 0.74rem 1rem; border: 1.5px solid var(--border);
    border-radius: var(--radius-md); font-size: 1rem; background: var(--card); color: inherit;
}
.help-search input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(18,161,80,.15); }
.help-clear {
    display: inline-flex; align-items: center; padding: 0 0.95rem; border: 1px solid var(--border);
    border-radius: var(--radius-md); background: var(--grey-light); color: var(--grey);
    text-decoration: none; font-size: 1.15rem; line-height: 1;
}
.help-sec { margin: 2rem 0 0.9rem; font-size: 1.1rem; font-weight: 700; color: var(--blue-dark); }
.help-sec small { font-weight: 400; font-size: 0.82rem; color: var(--grey); }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 0.85rem; }
.help-card, .help-hit {
    display: flex; gap: 0.85rem; align-items: flex-start; text-decoration: none; color: inherit;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm); transition: transform .12s ease, box-shadow .2s ease, border-color .2s ease;
}
.help-card { padding: 0.95rem 1.05rem; }
.help-hit { padding: 0.85rem 1rem; margin-bottom: 0.5rem; }
.help-card:hover, .help-hit:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--green-light); }
.help-ic {
    flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px;
    background: var(--green-soft); color: var(--green-dark);
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.1rem;
}
.help-tx { min-width: 0; }
.help-tx b { display: block; color: var(--blue-dark); font-size: 0.96rem; line-height: 1.25; margin-bottom: 0.18rem; }
.help-tx span { display: block; color: var(--grey); font-size: 0.84rem; line-height: 1.42; }
.help-empty { color: var(--grey); padding: 0.5rem 0 1rem; }

.help-doc {
    max-width: 800px; background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 1.7rem 2.1rem;
}
.help-back {
    display: inline-flex; align-items: center; gap: 0.35rem; margin-bottom: 1.2rem;
    color: var(--green-dark); text-decoration: none; font-weight: 600; font-size: 0.9rem;
}
.help-back:hover { text-decoration: underline; }
.help-article { line-height: 1.7; color: #2c3744; font-size: 0.97rem; }
.help-article > p:first-of-type { font-size: 1.06rem; color: #3a4757; }
.help-article h2 {
    display: flex; align-items: center; gap: 0.55rem;
    margin: 1.8rem 0 0.55rem; font-size: 1.16rem; font-weight: 700; color: var(--blue-dark); line-height: 1.3;
}
.help-article h2::before {
    content: ""; flex: 0 0 auto; width: 3px; height: 1.05em; border-radius: 2px; background: var(--green);
}
.help-article h3 { margin: 1.25rem 0 0.4rem; font-size: 1.02rem; color: var(--blue-dark); }
.help-article ul, .help-article ol { margin: 0.5rem 0 1.1rem 1.35rem; }
.help-article li { margin: 0.32rem 0; padding-left: 0.15rem; }
.help-article li::marker { color: var(--green-dark); }
.help-article p { margin: 0.65rem 0; }
.help-article strong { color: var(--blue-dark); }
.help-article a { color: var(--green-dark); font-weight: 500; }
.help-article code { background: var(--green-soft); color: var(--green-dark); padding: 0.12rem 0.38rem; border-radius: 5px; font-size: 0.9em; }
.help-article pre { background: var(--grey-light); padding: 0.9rem 1.1rem; border-radius: var(--radius-md); overflow: auto; }
.help-article hr { border: 0; border-top: 1px solid var(--border); margin: 1.4rem 0; }

/* Modale d'aide contextuelle (« ? Aide » sur chaque écran) : la fiche s'ouvre
   SANS quitter la page. La fiche hérite de .help-article ci-dessus ; ici seul
   l'habillage de la modale (dialog natif = focus piégé + Échap + fond). */
.help-cta { cursor: pointer; }
.help-modal { position: fixed; inset: 0; margin: auto; width: min(720px, 94vw); max-height: 88vh; max-height: 88dvh; padding: 0; border: 0; border-radius: 16px; background: #fff; color: var(--blue-dark, #0a2f57); box-shadow: 0 30px 80px -20px rgba(15,30,60,.4); overflow: hidden; }
.help-modal[open] { display: flex; flex-direction: column; animation: help-pop .3s cubic-bezier(.22,1,.36,1); }
.help-modal::backdrop { background: rgba(16,45,75,.45); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
@keyframes help-pop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.help-modal-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.25rem; border-bottom: 1px solid var(--border, #e6ebf1); flex: 0 0 auto; }
.help-modal-head::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--green, #7BB942), var(--blue-dark, #1E5C8B)); }
.help-modal-head strong { font-size: 1rem; color: var(--blue-dark, #0a2f57); }
.help-modal-x { flex-shrink: 0; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--grey-light, #eef1f5); color: var(--blue-dark, #1E5C8B); font-size: 1.3rem; line-height: 1; cursor: pointer; transition: background .2s ease, transform .2s ease; }
.help-modal-x:hover { background: var(--green-soft, rgba(123,185,66,.16)); transform: rotate(90deg); }
.help-modal-x:focus-visible { outline: 3px solid var(--green, #7BB942); outline-offset: 2px; }
.help-modal-body { padding: 1.1rem 1.4rem 1.5rem; overflow-y: auto; overscroll-behavior: contain; }
.help-modal-body .help-article > *:first-child { margin-top: 0; }
.help-modal-more { margin-top: 1.2rem; padding-top: .8rem; border-top: 1px solid var(--border, #e6ebf1); font-size: .9rem; }
.help-modal-loading, .help-modal-error { color: var(--grey, #6b7280); padding: 1rem 0; }
@media (prefers-reduced-motion: reduce) { .help-modal[open] { animation: none; } .help-modal-x:hover { transform: none; } }
