/* ==========================================================================
   Admin - Mairie de Champs (63440)
   PYRTECH INFORMATIQUE (c) 2026
   v20 — Theme « Papeterie & Terroir » : papier chaud, bleu ardoise + ocre
         d'Auvergne, serif Fraunces (titres) + Public Sans (corps).
         Polices self-hostees (RGPD + CSP font-src 'self').
   ========================================================================== */

/* ---------- POLICES SELF-HOSTEES (woff2, subsets latin + latin-ext) ---------- */
@font-face {
    font-family: 'Fraunces';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/fraunces-v38-latin_latin-ext-regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Fraunces';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/fraunces-v38-latin_latin-ext-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Public Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/public-sans-v21-latin_latin-ext-regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Public Sans';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/public-sans-v21-latin_latin-ext-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Public Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/public-sans-v21-latin_latin-ext-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Public Sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/public-sans-v21-latin_latin-ext-700.woff2') format('woff2');
}

/* ---------- PALETTE TERROIR ---------- */
:root {
    --paper: #F4EFE3;       /* fond panel */
    --paper2: #FCFAF3;      /* cartes / surfaces */
    --ink: #23211B;         /* texte */
    --ink2: #736B59;        /* texte doux */
    --slate: #24435B;       /* bleu ardoise */
    --slate-d: #162C3D;     /* bleu ardoise fonce (header) */
    --ocre: #BE7327;        /* accent */
    --ocre-l: #E4B36A;      /* ocre clair */
    --sage: #5C7359;        /* vert */
    --line: #E7DECB;        /* bordures */
    --danger: #A23E2C;      /* terracotta danger */
    --serif: 'Fraunces', Georgia, serif;
    --sans: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --sh-sm: 0 1px 2px rgba(35,33,27,.06);
    --sh: 0 10px 30px -12px rgba(22,44,61,.28);
}

/* Police corps appliquee a tout l'espace admin */
.page-admin {
    font-family: var(--sans);
    color: var(--ink);
}

/* ---------- TOPO BACKGROUND (courbes de niveau, login) ---------- */
@keyframes adminBg {
    0%   { background-position: 0% 50%; }
    25%  { background-position: 50% 100%; }
    50%  { background-position: 100% 50%; }
    75%  { background-position: 50% 0%; }
    100% { background-position: 0% 50%; }
}

/* ---------- LOGIN ---------- */
.admin-login[hidden] {
    display: none;
}

.admin-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: var(--paper);
    padding: 1rem;
}

/* Courbes de niveau topographiques en filigrane */
.admin-login::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .5;
    pointer-events: none;
    background:
        repeating-radial-gradient(circle at 78% 22%, transparent 0 26px, rgba(36,67,91,.06) 26px 27px),
        repeating-radial-gradient(circle at 14% 88%, transparent 0 30px, rgba(190,115,39,.06) 30px 31px);
}

.admin-login::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(120% 80% at 50% 40%, transparent 50%, rgba(35,33,27,.05));
}

.login-card {
    position: relative;
    background: var(--paper2);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--sh);
    overflow: hidden;
}

/* Filet degrade slate -> ocre en haut de la carte */
.login-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--slate), var(--ocre));
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-family: var(--serif);
    font-weight: 600;
    letter-spacing: -0.5px;
    font-size: 1.9rem;
    color: var(--slate-d);
    margin-top: 0.75rem;
}

.login-header p {
    font-size: 1rem;
    color: var(--ink2);
}

.login-card .form-group {
    margin-bottom: 1.25rem;
}

.login-card label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.35rem;
}

.login-card input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--line);
    border-radius: 8px;
    font-size: 1.1rem;
    font-family: var(--sans);
    background: #fff;
    color: var(--ink);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-card input:focus {
    outline: none;
    border-color: var(--ocre);
    box-shadow: 0 0 0 3px rgba(190,115,39,0.16);
}

.login-error {
    background: #fbeeea;
    color: var(--danger);
    padding: 0.625rem 1rem;
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.login-btn {
    width: 100%;
    padding: 0.875rem;
    font-size: 1.1rem;
    border-radius: 8px;
    cursor: pointer;
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ---------- PASSWORD EYE TOGGLE ---------- */
.pwd-group {
    position: relative;
}
.pwd-group input {
    padding-right: 2.75rem;
}
.pwd-eye {
    position: absolute;
    right: 0.6rem;
    bottom: 0.55rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0.2rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.pwd-eye:hover {
    opacity: 1;
}
.pwd-eye-dark {
    color: var(--ink2);
    opacity: 0.7;
}
.pwd-eye-dark:hover {
    opacity: 1;
}

/* ---------- ADMIN PANEL ---------- */
.admin-panel {
    min-height: 100vh;
    background: var(--paper);
    color: var(--ink);
}

.admin-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--slate-d);
    color: var(--paper);
    padding: 0 1.5rem;
    height: 60px;
    border-bottom: 3px solid var(--ocre);
    box-shadow: 0 2px 8px rgba(22,44,61,0.18);
}

/* Courbes de niveau subtiles dans le header */
.admin-header::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .4;
    pointer-events: none;
    background: repeating-radial-gradient(circle at 92% -10%, transparent 0 22px, rgba(228,179,106,.08) 22px 23px);
}

.admin-header-inner {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    font-size: 1.4rem;
    color: var(--paper);
    font-family: var(--serif);
    letter-spacing: -0.3px;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    position: absolute;
    right: 0;
}

#admin-username {
    font-size: 1rem;
    opacity: 0.95;
    margin-right: 0.5rem;
    color: var(--paper);
}

.btn-admin-sm {
    font-family: var(--sans);
    background: transparent;
    color: var(--paper);
    border: 1px solid rgba(244,239,227,0.32);
    padding: 0.5rem 1rem;
    border-radius: 9px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.18s, border-color 0.18s;
}

.btn-admin-sm:hover {
    background: rgba(244,239,227,0.12);
    border-color: rgba(244,239,227,0.5);
    color: var(--paper);
}

/* Bouton Deconnexion = accent ocre */
.btn-danger {
    background: var(--ocre);
    border-color: transparent;
    color: #fff;
}

.btn-danger:hover {
    background: #a8631f;
    border-color: transparent;
    color: #fff;
}

/* ---------- MAIN ---------- */
.admin-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.admin-toolbar h2 {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1.75rem;
    letter-spacing: -0.4px;
    color: var(--slate-d);
    padding-left: 14px;
    border-left: 4px solid var(--ocre);
}

/* ---------- TABS ---------- */
.admin-tabs {
    display: flex;
    /* wrap : les 11 onglets restent TOUS visibles quelle que soit la largeur
       (avant : overflow-x auto = Logs/Compte coupes hors ecran sans scrollbar) */
    flex-wrap: wrap;
    gap: 2px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 2rem;
    background: var(--paper2);
    border-radius: 8px 8px 0 0;
    padding: 0 0.5rem;
}

.admin-tab {
    padding: 1rem 1rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    font-family: var(--sans);
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--ink2);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.admin-tab:hover {
    color: var(--slate);
}

.admin-tab.active {
    color: var(--slate-d);
    border-bottom-color: var(--ocre);
}

.admin-tab-content[hidden] {
    display: none;
}

/* ---------- PAST EVENTS (admin) ---------- */
.event-past {
    opacity: 0.5;
}

.event-past:hover {
    opacity: 0.8;
}

/* ---------- ARTICLES LIST ---------- */
.articles-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.articles-loading {
    text-align: center;
    padding: 2rem;
    color: var(--ink2);
    font-size: 1.1rem;
}

.article-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--paper2);
    border-radius: 11px;
    box-shadow: var(--sh-sm);
    border: 1px solid var(--line);
    border-left: 3px solid var(--ocre);
    transition: box-shadow 0.18s, transform 0.18s;
}

.article-row:hover {
    box-shadow: var(--sh);
    transform: translateX(2px);
}

.article-status {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.article-status.published {
    background: #15803d;
}

.article-status.draft {
    background: #b3aa93;
}

/* ---------- BADGE STATUT MEMBRE (actif / inactif) — lisibilite renforcee 24/05 ---------- */
.membre-statut {
    align-self: center;
    flex-shrink: 0;
    padding: 0.32rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.membre-statut.is-actif {
    background: #15803d;
    color: #ffffff;
}
.membre-statut.is-inactif {
    background: #e5e7eb;
    color: #6b7280;
    border: 1px solid #d1d5db;
}
.membre-row-inactif {
    opacity: 0.72;
}

.article-info {
    flex: 1;
    min-width: 0;
}

.article-info h4 {
    font-size: 1.15rem;
    color: var(--ink);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

.article-meta {
    font-size: 0.95rem;
    color: var(--ink2);
}

.article-actions {
    display: flex;
    gap: 0.6rem;
    flex-shrink: 0;
}

.btn-edit, .btn-delete {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 2px solid;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-edit:active, .btn-delete:active {
    transform: scale(0.97);
}

.btn-edit {
    background: var(--slate-d);
    color: #ffffff;
    border-color: var(--slate-d);
}

.btn-edit:hover {
    background: var(--ocre);
    border-color: var(--ocre);
}

.btn-delete {
    background: #ffffff;
    color: var(--danger);
    border-color: var(--danger);
}

.btn-delete:hover {
    background: #fbeeea;
}

.articles-empty {
    text-align: center;
    padding: 3rem;
    color: var(--ink2);
    font-size: 1.1rem;
}

/* ---------- ADMIN MODAL ---------- */
.admin-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.admin-modal[hidden] {
    display: none;
}

.admin-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
}

.admin-modal-content {
    position: relative;
    background: var(--paper2);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 14px;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--sh);
}

.admin-modal-large {
    max-width: 720px;
}

.admin-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--line);
}

.admin-modal-header h3 {
    font-family: var(--serif);
    font-size: 1.4rem;
    color: var(--slate-d);
    font-weight: 600;
    letter-spacing: -0.3px;
}

.admin-modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 50%;
    font-size: 1.4rem;
    color: var(--ink2);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.admin-modal-close:hover {
    background: var(--line);
    color: var(--ink);
}

/* Form inside modal */
.admin-modal-content form {
    padding: 1.5rem;
}

.admin-modal-content .form-group {
    margin-bottom: 1.25rem;
}

.admin-modal-content label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.35rem;
}

.admin-modal-content input[type="text"],
.admin-modal-content input[type="date"],
.admin-modal-content textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--line);
    border-radius: 8px;
    font-size: 1.05rem;
    font-family: inherit;
    background: #ffffff;
    color: var(--ink);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.admin-modal-content input:focus,
.admin-modal-content textarea:focus {
    outline: none;
    border-color: var(--ocre);
    box-shadow: 0 0 0 3px rgba(190,115,39,0.16);
}

.admin-modal-content textarea {
    resize: vertical;
    min-height: 150px;
}

.form-group-inline {
    display: flex;
    align-items: center;
}

.form-counter {
    font-size: 0.9rem;
    color: var(--ink2);
    text-align: right;
    margin-top: 0.25rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 0.75rem;
}

.btn-outline-admin {
    background: var(--paper);
    color: var(--ink);
    border: 2px solid var(--line);
    padding: 0.625rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.btn-outline-admin:hover {
    background: var(--line);
    border-color: var(--ink2);
}

/* ---------- COMPTES-RENDUS ADMIN ---------- */
.cr-upload-label {
    display: inline-block;
    cursor: pointer;
}

.event-file-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--paper);
    border-radius: 6px;
    font-size: 1rem;
    color: var(--ink);
    border: 1px solid var(--line);
}
.event-file-preview span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.btn-remove-file {
    background: var(--danger);
    color: #fff;
    border: none;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-remove-file:hover { background: #872f20; }

.cr-upload-info {
    font-size: 0.95rem;
    color: var(--ink2);
    margin-bottom: 1rem;
    margin-top: -0.75rem;
}

.cr-upload-progress {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--ink);
}

.cr-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--line);
    border-radius: 4px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.cr-progress-fill {
    height: 100%;
    background: var(--ocre);
    border-radius: 4px;
    transition: width 0.3s;
    width: 0%;
}

/* ---------- GUIDE ---------- */
.guide-content {
    padding: 1.75rem 2rem;
    font-size: 1.1rem;
    color: var(--ink);
    line-height: 1.75;
}

.guide-content h4 {
    font-family: var(--serif);
    font-size: 1.4rem;
    color: var(--slate-d);
    margin-top: 2.25rem;
    margin-bottom: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 0.9rem;
    background: var(--paper2);
    border-left: 5px solid var(--ocre);
    border-radius: 0 8px 8px 0;
}

.guide-content h4:first-child {
    margin-top: 0;
}

.guide-content p {
    font-size: 1.1rem;
    color: var(--ink);
    margin-bottom: 0.75rem;
    line-height: 1.75;
}

.guide-content strong {
    color: var(--slate);
    font-weight: 700;
}

.guide-content em {
    color: var(--ocre);
    font-style: normal;
    font-weight: 600;
}

.guide-content ol, .guide-content ul {
    margin: 0.75rem 0 1rem 1.75rem;
    font-size: 1.1rem;
    color: var(--ink);
    line-height: 1.85;
}

.guide-content li {
    margin-bottom: 0.4rem;
}

.guide-content ol {
    list-style: decimal;
}

.guide-content ul {
    list-style: disc;
}

/* Encadres "Astuce / Note / Important" : bien visibles pour la secretaire */
.guide-content .guide-note {
    background: var(--paper2);
    border: 1px solid var(--line);
    border-left: 5px solid var(--ocre);
    border-radius: 0 8px 8px 0;
    padding: 0.85rem 1.1rem;
    margin: 1rem 0 1.25rem;
}

.guide-content .guide-note strong {
    color: var(--ocre);
}

/* ---------- ADMIN PANEL GLOBAL FORM STYLES ---------- */
.admin-tab-content label {
    color: var(--ink);
    font-size: 1rem;
    font-weight: 600;
}

.admin-tab-content input[type="text"],
.admin-tab-content input[type="date"],
.admin-tab-content input[type="email"],
.admin-tab-content textarea {
    background: #ffffff;
    color: var(--ink);
    border: 2px solid var(--line);
    font-size: 1.05rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.admin-tab-content input:focus,
.admin-tab-content textarea:focus {
    border-color: var(--ocre);
    box-shadow: 0 0 0 3px rgba(190,115,39,0.16);
    outline: none;
}

.admin-tab-content p {
    color: var(--ink2);
    font-size: 1.05rem;
}

/* ---------- STATS DASHBOARD ---------- */
.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
}

.stat-card {
    position: relative;
    overflow: hidden;
    background: #ffffff;
    border-radius: 14px;
    padding: 1.75rem;
    text-align: center;
    box-shadow: var(--sh-sm);
    border: 1px solid var(--line);
    transition: transform 0.2s, box-shadow 0.2s;
}

/* Trait de couleur en haut de chaque carte (sourd, varie par position) */
.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--cl, var(--slate));
}

.stat-card:nth-child(1) { --cl: #24435B; }   /* slate */
.stat-card:nth-child(2) { --cl: #BE7327; }   /* ocre */
.stat-card:nth-child(3) { --cl: #5C7359; }   /* sage */
.stat-card:nth-child(4) { --cl: #9C5B3B; }   /* terracotta */
.stat-card:nth-child(5) { --cl: #6A557A; }   /* prune */

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--sh);
}

.stat-number {
    font-family: var(--serif);
    font-size: 2.5rem;
    font-weight: 600;
    line-height: 1;
    color: var(--slate-d);
}

.stat-label {
    font-size: 1.05rem;
    color: var(--ink2);
    margin-top: 0.5rem;
    font-weight: 500;
}

/* ---------- RESERVATIONS ---------- */
.resa-filters select {
    padding: 0.6rem 1rem !important;
    border-radius: 8px !important;
    border: 2px solid var(--line) !important;
    font-size: 1.05rem !important;
    background: #ffffff !important;
    color: var(--ink) !important;
}

/* Reservation cards (generated by JS) */
.resa-card {
    background: var(--paper2);
    border: 1px solid var(--line);
    border-left: 3px solid var(--ocre);
    border-radius: 11px;
    padding: 1.25rem 1.5rem;
    box-shadow: var(--sh-sm);
}

.resa-card h4 {
    color: var(--ink);
    font-size: 1.15rem;
}

.resa-card p, .resa-card span {
    color: var(--ink);
    font-size: 1rem;
}

/* ---------- CMS FORMS (Infos + Conseil) ---------- */
.cms-form .form-group {
    margin-bottom: 1.25rem;
}

.cms-form label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.35rem;
}

.cms-form input[type="text"],
.cms-form input[type="email"],
.cms-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--line);
    border-radius: 8px;
    font-size: 1.05rem;
    font-family: inherit;
    background: #ffffff;
    color: var(--ink);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cms-form input:focus,
.cms-form textarea:focus {
    outline: none;
    border-color: var(--ocre);
    box-shadow: 0 0 0 3px rgba(190,115,39,0.16);
}

.cms-form textarea {
    resize: vertical;
}

.cms-fieldset {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: var(--paper2);
}

.cms-fieldset legend {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--slate-d);
    padding: 0 0.5rem;
}

/* Horaires editor grid */
.horaires-grid-editor {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hge-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto auto;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink2);
    padding: 0 0.25rem;
}

.hge-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto auto;
    gap: 0.5rem;
    align-items: center;
}

.hge-row input[type="text"] {
    padding: 0.6rem 0.75rem;
    font-size: 1rem;
}

.hge-check {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.9rem;
    color: var(--ink2);
    white-space: nowrap;
    cursor: pointer;
}

/* Conseillers editor */
.conseillers-editor {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.conseiller-row {
    display: grid;
    grid-template-columns: 1fr 0.7fr 1.3fr 1fr auto;
    gap: 0.6rem;
    align-items: center;
    background: var(--paper);
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.conseiller-row input[type="text"],
.conseiller-row input[type="number"] {
    padding: 0.6rem 0.75rem;
    font-size: 1rem;
}

.btn-delete-conseiller {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: var(--danger);
    border: 2px solid var(--danger);
    border-radius: 6px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-delete-conseiller:hover {
    background: #fbeeea;
}

/* ---------- CHECKBOX LABEL ---------- */
.checkbox-label {
    font-size: 1.05rem;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--ocre);
}

/* ---------- INLINE STYLES OVERRIDE (fond sombre dans HTML) ---------- */
.admin-tab-content [style*="color:#666"] {
    color: var(--ink2) !important;
    font-size: 1.05rem !important;
}

/* Override dark backgrounds in compte tab inline styles */
#tab-compte [style*="background:#1e293b"] {
    background: var(--paper2) !important;
    border: 1px solid var(--line) !important;
}
#tab-compte [style*="color:#e2e8f0"] {
    color: var(--ink) !important;
}
#tab-compte [style*="color:#94a3b8"] {
    color: var(--ink2) !important;
}
#tab-compte input[type="password"] {
    background: #ffffff;
    color: var(--ink);
    border: 2px solid var(--line);
    padding: 0.75rem 1rem;
    font-size: 1.05rem;
}
#tab-compte input[type="password"]:focus {
    border-color: var(--ocre);
    box-shadow: 0 0 0 3px rgba(190,115,39,0.16);
    outline: none;
}
#tab-compte label {
    color: var(--ink) !important;
    font-size: 1rem !important;
}

/* ---------- WYSIWYG EDITOR ---------- */
.wysiwyg-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    padding: 0.4rem 0.5rem;
    background: var(--paper);
    border: 2px solid var(--line);
    border-bottom: 1px solid var(--line);
    border-radius: 8px 8px 0 0;
    align-items: center;
}
.wysiwyg-toolbar button {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0.35rem 0.6rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--ink);
    min-width: 32px;
    text-align: center;
    line-height: 1.2;
    transition: background 0.15s, border-color 0.15s;
}
.wysiwyg-toolbar button:hover {
    background: var(--paper);
    border-color: var(--ocre-l);
}
.wysiwyg-toolbar button.tb-active {
    background: var(--slate-d);
    color: #fff;
    border-color: var(--slate-d);
}
.toolbar-sep {
    width: 1px;
    height: 24px;
    background: var(--line);
    margin: 0 4px;
    flex-shrink: 0;
}
.color-indicator {
    display: inline-block;
    width: 14px;
    height: 3px;
    background: #e53e3e;
    margin-left: 2px;
    vertical-align: middle;
    border-radius: 1px;
}
.color-picker-hidden {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.wysiwyg-editor {
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    border: 2px solid var(--line);
    border-top: none;
    border-radius: 0 0 8px 8px;
    background: #fff;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--ink);
    outline: none;
    word-wrap: break-word;
}
.wysiwyg-editor:focus {
    border-color: var(--ocre);
    box-shadow: 0 0 0 3px rgba(190,115,39,0.15);
}
.wysiwyg-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--ink2);
    pointer-events: none;
    font-style: italic;
}
.wysiwyg-editor h3 { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; margin: 0.5rem 0; color: var(--slate-d); }
.wysiwyg-editor ul, .wysiwyg-editor ol { margin: 0.5rem 0; padding-left: 1.5rem; }
.wysiwyg-editor a { color: var(--slate); text-decoration: underline; }

/* ---------- OVERRIDE .btn-secondary (SCOPE ADMIN UNIQUEMENT) ----------
   .btn-secondary vient de style.css (partage avec le site public, degrade taupe).
   On NE TOUCHE PAS style.css : on surcharge seulement dans l'espace admin
   pour adopter le theme Terroir (bleu ardoise -> ocre au survol). */
.admin-panel .btn-secondary,
.admin-login .btn-secondary {
    background: var(--slate-d);
    color: #fff;
    border-color: var(--slate-d);
    box-shadow: var(--sh-sm);
    transition: background 0.2s, border-color 0.2s, transform 0.1s, box-shadow 0.2s;
}
.admin-panel .btn-secondary:hover,
.admin-login .btn-secondary:hover {
    background: var(--ocre);
    border-color: var(--ocre);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(190,115,39,0.28);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
    .admin-header {
        padding: 0 1rem;
    }

    .admin-brand span {
        display: none;
    }

    .admin-user {
        gap: 0.3rem;
    }

    #admin-username {
        display: none;
    }

    .admin-main {
        padding: 1rem;
    }

    .admin-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .admin-toolbar h2 {
        font-size: 1.4rem;
    }

    .article-row {
        flex-wrap: wrap;
    }

    .article-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .admin-modal-content {
        max-height: 95vh;
    }

    .admin-tabs {
        flex-wrap: wrap;
    }

    .admin-tab {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    .hge-header,
    .hge-row {
        grid-template-columns: 1fr 1fr 1fr auto;
    }

    .hge-header span:nth-child(5),
    .hge-row .hge-check:last-child {
        display: none;
    }

    .conseiller-row {
        grid-template-columns: 1fr 1fr auto;
    }

    /* nom : pleine largeur */
    .conseiller-row input:nth-child(1) {
        grid-column: 1 / -1;
    }

    /* annee (2) + profession (3) sur une meme ligne */
    .conseiller-row input:nth-child(2) {
        grid-column: 1 / 2;
    }

    .conseiller-row input:nth-child(3) {
        grid-column: 2 / -1;
    }

    /* lieu-dit : pleine largeur */
    .conseiller-row input:nth-child(4) {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 1.5rem;
    }

    .btn-admin-sm {
        padding: 0.4rem 0.65rem;
        font-size: 0.85rem;
    }

    .admin-tab {
        padding: 0.6rem 0.75rem;
        font-size: 0.9rem;
    }
}

/* ---------- Galerie photos commerces (admin) ---------- */
.commerce-photos-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.commerce-photo-thumb {
    position: relative;
    width: 96px;
    height: 96px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(36, 67, 91, 0.25);
    background: #f4efe3;
    flex: 0 0 auto;
}
.commerce-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.commerce-photo-actions {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    gap: 2px;
    padding: 2px;
    background: rgba(22, 44, 61, 0.78);
}
.commerce-photo-actions button {
    flex: 1 1 auto;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 0.85rem;
    line-height: 1;
    padding: 3px 0;
    cursor: pointer;
    border-radius: 3px;
}
.commerce-photo-actions button:hover:not(:disabled) {
    background: rgba(190, 115, 39, 0.85);
}
.commerce-photo-actions button:disabled {
    opacity: 0.35;
    cursor: default;
}
.commerce-photo-actions .commerce-photo-del:hover:not(:disabled) {
    background: #b91c1c;
}

/* ---------- LOGO COMMERCE (apercu admin) ---------- */
.commerce-logo-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.commerce-logo-preview {
    width: 110px;
    height: 110px;
    object-fit: contain;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 6px;
    flex: 0 0 auto;
}
.commerce-logo-empty {
    color: var(--ink2);
    font-size: 0.95rem;
}

/* ---------- PHOTOS CONSEIL (apercu admin, ligne conseiller) ---------- */
.cr-photo-box {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.cr-photo-thumb {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: #ffffff;
    flex: 0 0 auto;
}
span.cr-photo-none {
    background: repeating-linear-gradient(45deg, #f3f4f6, #f3f4f6 6px, #e5e7eb 6px, #e5e7eb 12px);
}
.cr-photo-box .btn-outline-admin {
    font-size: 0.85rem;
    padding: 0.35rem 0.8rem;
}
.cr-photo-box .cr-photo-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
