/* =====================================================================
   e-Mairie Sénégal — Feuille de style principale (responsive, sans dépendance)
   ===================================================================== */
:root {
    --primary: #0b6b3a;
    --primary-dark: #084d2a;
    --primary-soft: #e7f3ec;
    --accent: #f2b705;
    --danger: #c8102e;
    --warning: #d97706;
    --info: #2563eb;
    --success: #15803d;
    --bg: #f3f5f4;
    --surface: #ffffff;
    --surface-2: #f8faf9;
    --border: #e2e8e5;
    --text: #1b2620;
    --muted: #64746b;
    --sidebar-w: 264px;
    --topbar-h: 62px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(16, 40, 28, .06), 0 4px 16px rgba(16, 40, 28, .06);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .6em; color: var(--text); }
h1 { font-size: 1.6rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.1rem; } h4 { font-size: 1rem; }
p { margin: 0 0 1em; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 4px; font-size: .9em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.2rem 0; }
.ic { width: 18px; height: 18px; flex-shrink: 0; vertical-align: -3px; }
.muted { color: var(--muted); }
.small, small { font-size: .85em; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.text-right { text-align: right; } .text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.req { color: var(--danger); }
.flex { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.grow { flex: 1; }

/* ------------------------------------------------------------- Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .6rem 1.05rem; border-radius: var(--radius-sm);
    border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; text-decoration: none !important;
    background: var(--surface); color: var(--text); border-color: var(--border); transition: background .15s, box-shadow .15s, transform .05s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: #2a2000; border-color: var(--accent); }
.btn-accent:hover { filter: brightness(.95); background: var(--accent); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #a20d25; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #116632; }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-soft); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { padding: .35rem .7rem; font-size: .82rem; }
.btn-lg { padding: .85rem 1.4rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-group { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ------------------------------------------------------------- Alertes */
.alert { display: flex; gap: .7rem; align-items: flex-start; padding: .85rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; border: 1px solid; font-size: .93rem; }
.alert span { flex: 1; }
.alert-success { background: #ecfdf3; border-color: #a7e3bf; color: #11532c; }
.alert-error { background: #fef1f2; border-color: #f7b9c1; color: #8a1023; }
.alert-warning { background: #fff8eb; border-color: #f6d79b; color: #7a4a05; }
.alert-info { background: #eef4ff; border-color: #bcd0fb; color: #1d3f91; }
.alert-close { background: none; border: 0; font-size: 1.3rem; line-height: 1; cursor: pointer; color: inherit; opacity: .6; }

/* ------------------------------------------------------------- Badges */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.badge-gray { background: #eef1ef; color: #4b5a52; }
.badge-blue { background: #e6efff; color: #1d4ed8; }
.badge-indigo { background: #eceafd; color: #4338ca; }
.badge-purple { background: #f3e8ff; color: #7e22ce; }
.badge-teal { background: #e0f5f3; color: #0f766e; }
.badge-green { background: #e3f6ea; color: #15803d; }
.badge-orange { background: #fff1de; color: #b45309; }
.badge-red { background: #fde8eb; color: #b91c1c; }
.badge-dark { background: #1f2a24; color: #fff; }
.badge-gold { background: #fff6d6; color: #8a6400; }

/* ------------------------------------------------------------- Cartes */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1.25rem; }
.card-header { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; padding: 1rem 1.2rem; border-bottom: 1px solid var(--border); }
.card-header h2, .card-header h3 { margin: 0; font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; }
.card-body { padding: 1.2rem; }
.card-footer { padding: .9rem 1.2rem; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.card-soft { background: var(--surface-2); border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: .9rem 1rem; }

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid > * { min-width: 0; }
.main, .content { min-width: 0; }
.chart-cols { overflow-x: auto; }
.chart-col { min-width: 18px; }

/* Statistiques */
.stat { display: flex; gap: .9rem; align-items: center; padding: 1.1rem 1.2rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); }
a.stat:hover { text-decoration: none; border-color: var(--primary); }
.stat-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.stat-icon .ic { width: 22px; height: 22px; }
.stat-value { font-size: 1.55rem; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: .83rem; color: var(--muted); }
.stat.orange .stat-icon { background: #fff1de; color: #b45309; }
.stat.purple .stat-icon { background: #f3e8ff; color: #7e22ce; }
.stat.blue .stat-icon { background: #e6efff; color: #1d4ed8; }
.stat.red .stat-icon { background: #fde8eb; color: #b91c1c; }
.stat.teal .stat-icon { background: #e0f5f3; color: #0f766e; }

/* ------------------------------------------------------------- Tableaux */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: .7rem .85rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); font-weight: 700; white-space: nowrap; }
.table tbody tr:hover { background: #fafcfb; }
.table .actions { white-space: nowrap; text-align: right; }
.table .empty { text-align: center; color: var(--muted); padding: 2rem; }
.table-kv th { width: 38%; text-transform: none; letter-spacing: 0; font-size: .86rem; background: transparent; }

/* ------------------------------------------------------------- Formulaires */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.1rem; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.col-full { grid-column: 1 / -1; }
.form-group { margin-bottom: 1rem; display: flex; flex-direction: column; }
label { font-weight: 600; font-size: .87rem; margin-bottom: .35rem; color: #33443a; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=time],
input[type=datetime-local], input[type=search], input[type=url], input[type=color], input[type=file], select, textarea {
    width: 100%; font: inherit; font-size: .95rem; padding: .62rem .8rem; border: 1px solid #cfd8d3; border-radius: var(--radius-sm); background: #fff; color: var(--text);
    transition: border-color .15s, box-shadow .15s; min-height: 42px; }
input[type=color] { padding: .2rem; height: 42px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(11, 107, 58, .15); }
textarea { resize: vertical; min-height: 90px; }
textarea.code { font-family: Consolas, "Courier New", monospace; font-size: .85rem; min-height: 280px; }
.help { color: var(--muted); font-size: .8rem; margin-top: .3rem; }
.check { display: flex; align-items: center; gap: .55rem; font-weight: 500; cursor: pointer; margin-bottom: .8rem; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.form-actions { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; padding-top: .5rem; }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; }
.filters .form-group { margin: 0; min-width: 150px; flex: 1; }
.filters .btn { min-height: 42px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem 1.1rem .2rem; margin: 0 0 1.2rem; }
legend { font-weight: 700; padding: 0 .4rem; color: var(--primary); }

/* Onglets */
.tabs { display: flex; gap: .3rem; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 1.2rem; scrollbar-width: thin; }
.tabs a, .tabs button { padding: .7rem 1rem; border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; text-decoration: none; display: inline-flex; gap: .4rem; align-items: center; }
.tabs a.active, .tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.count { background: var(--danger); color: #fff; border-radius: 999px; font-size: .7rem; padding: .05rem .45rem; font-weight: 700; }
.tabs .count { background: #e5ebe8; color: var(--text); }
.tabs a.active .count { background: var(--primary); color: #fff; }

/* Pagination */
.pagination { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; padding: 1rem 1.2rem; }
.pagination a, .pagination span.current { min-width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 .6rem; color: var(--text); background: #fff; }
.pagination span.current { background: var(--primary); color: #fff; border-color: var(--primary); }
.pg-info { margin-left: auto; color: var(--muted); font-size: .85rem; }

/* =====================================================================
   BACK-OFFICE : barre latérale fixe + barre supérieure
   ===================================================================== */
.app { min-height: 100vh; }
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w); background: #0d2a1b; color: #d7e6dd; display: flex; flex-direction: column; z-index: 50; transition: transform .25s ease; }
body.sidebar-open .sidebar { box-shadow: 0 0 40px rgba(0,0,0,.3); }
.sidebar-close { display: none; position: absolute; top: 12px; right: 10px; z-index: 2; width: 38px; height: 38px; border-radius: 10px; border: 0; background: rgba(255,255,255,.1); color: #fff; cursor: pointer; place-items: center; }
.sidebar-close .ic { width: 20px; height: 20px; }
.sidebar-brand { display: flex; align-items: center; gap: .75rem; padding: 0 1.1rem; height: var(--topbar-h); border-bottom: 1px solid rgba(255,255,255,.08); color: #fff; text-decoration: none !important; flex-shrink: 0; }
.sidebar-brand img { width: 38px; height: 38px; object-fit: contain; border-radius: 8px; background: #fff; padding: 2px; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #0d2a1b; background: linear-gradient(135deg, var(--accent), #ffd84d); flex-shrink: 0; }
.sidebar-brand strong { display: block; font-size: .95rem; line-height: 1.2; }
.sidebar-brand small { color: #9fbcab; font-size: .74rem; }
.sidebar-nav { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: .8rem .7rem 1.5rem; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: #7f9d8b; padding: 1rem .7rem .4rem; font-weight: 700; }
.nav-link { display: flex; align-items: center; gap: .7rem; padding: .58rem .75rem; border-radius: 9px; color: #d0e0d6; font-size: .9rem; font-weight: 500; text-decoration: none !important; margin-bottom: 2px; }
.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-link.active { background: var(--primary); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav-link .ic { width: 18px; height: 18px; opacity: .9; }
.nav-link .count { margin-left: auto; }
.sidebar-footer { padding: .9rem 1rem; border-top: 1px solid rgba(255,255,255,.08); font-size: .78rem; color: #84a392; flex-shrink: 0; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 40; height: var(--topbar-h); background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .8rem; padding: 0 1.4rem; }
.menu-toggle { display: none; background: none; border: 0; padding: .4rem; cursor: pointer; color: var(--text); }
.menu-toggle .ic { width: 24px; height: 24px; }
.top-search { flex: 1; max-width: 420px; position: relative; }
.top-search input { padding-left: 2.3rem; background: var(--surface-2); min-height: 40px; }
.top-search .ic { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.icon-btn { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: var(--text); background: transparent; border: 1px solid transparent; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); text-decoration: none; }
.icon-btn .dot { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.user-chip { display: flex; align-items: center; gap: .6rem; padding: .25rem .5rem .25rem .25rem; border-radius: 999px; color: var(--text); }
.user-chip:hover { background: var(--surface-2); text-decoration: none; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; font-weight: 700; font-size: .85rem; flex-shrink: 0; }
.user-chip .u-name { font-weight: 600; font-size: .88rem; line-height: 1.15; }
.user-chip .u-role { font-size: .74rem; color: var(--muted); }
.content { padding: 1.5rem 1.6rem 2.5rem; flex: 1; width: 100%; max-width: 1400px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.3rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 1.45rem; }
.page-head p { margin: .25rem 0 0; color: var(--muted); }
.breadcrumb { font-size: .82rem; color: var(--muted); margin-bottom: .3rem; }
.app-footer { padding: 1rem 1.6rem; color: var(--muted); font-size: .8rem; border-top: 1px solid var(--border); background: var(--surface); }
.overlay { display: none; position: fixed; inset: 0; background: rgba(5, 20, 12, .45); z-index: 45; }

/* Frise de suivi */
.timeline-steps { display: flex; gap: 0; overflow-x: auto; padding: .4rem 0 .6rem; }
.tstep { flex: 1; min-width: 92px; text-align: center; position: relative; font-size: .76rem; color: var(--muted); }
.tstep::before { content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 3px; background: var(--border); z-index: 0; }
.tstep:first-child::before { display: none; }
.tstep .dotn { width: 32px; height: 32px; border-radius: 50%; margin: 0 auto .4rem; display: grid; place-items: center; background: #fff; border: 2px solid var(--border); font-weight: 700; position: relative; z-index: 1; color: var(--muted); }
.tstep.done .dotn { background: var(--primary); border-color: var(--primary); color: #fff; }
.tstep.done::before, .tstep.current::before { background: var(--primary); }
.tstep.current .dotn { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.tstep.done, .tstep.current { color: var(--text); font-weight: 600; }

.history { list-style: none; margin: 0; padding: 0; }
.history li { position: relative; padding: 0 0 1rem 1.6rem; border-left: 2px solid var(--border); margin-left: .4rem; }
.history li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--primary); }
.history li:last-child { border-left-color: transparent; }
.history .h-title { font-weight: 600; font-size: .9rem; }
.history .h-meta { font-size: .78rem; color: var(--muted); }
.history .h-comment { font-size: .85rem; background: var(--surface-2); border-radius: 6px; padding: .4rem .6rem; margin-top: .3rem; }

/* Bloc date de retrait (citoyen) */
.pickup { display: flex; gap: 1rem; align-items: center; padding: 1.2rem; border-radius: var(--radius); background: linear-gradient(135deg, var(--primary), #13894e); color: #fff; margin-bottom: 1.25rem; }
.pickup .pk-date { background: #fff; color: var(--primary); border-radius: 12px; text-align: center; padding: .5rem .9rem; min-width: 84px; }
.pickup .pk-day { font-size: 1.9rem; font-weight: 800; line-height: 1; }
.pickup .pk-month { font-size: .75rem; text-transform: uppercase; font-weight: 700; }
.pickup h3 { color: #fff; margin: 0 0 .2rem; }
.pickup p { margin: 0; opacity: .95; font-size: .9rem; }

/* Cartes de choix (types de documents, paiement) */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.choice { display: block; border: 2px solid var(--border); border-radius: var(--radius); padding: 1.1rem; background: #fff; cursor: pointer; color: var(--text); position: relative; transition: border-color .15s, box-shadow .15s; }
.choice:hover { border-color: var(--primary); text-decoration: none; box-shadow: var(--shadow); }
.choice input { position: absolute; opacity: 0; }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.choice h4 { margin: .4rem 0 .3rem; }
.choice .price { font-weight: 800; color: var(--primary); }
.pay-logo { height: 44px; display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.1rem; }
.pay-logo .pl { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-size: .9rem; }
.pl-wave { background: #1dc3f0; } .pl-om { background: #ff7900; } .pl-visa { background: #1a1f71; }

.notif-item { display: flex; gap: .8rem; padding: .9rem 1.2rem; border-bottom: 1px solid var(--border); color: var(--text); }
.notif-item.unread { background: #f4faf6; }
.notif-item:hover { text-decoration: none; background: var(--surface-2); }

/* Barres (rapports) */
.bars { display: flex; flex-direction: column; gap: .6rem; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 1.2fr) 3fr auto; gap: .7rem; align-items: center; font-size: .86rem; }
.bar-track { height: 12px; background: #edf1ef; border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--primary); border-radius: 6px; }
.chart-cols { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: .5rem; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: .68rem; color: var(--muted); gap: 4px; }
.chart-col .cbar { width: 100%; max-width: 38px; background: linear-gradient(180deg, #19a05a, var(--primary)); border-radius: 6px 6px 2px 2px; min-height: 2px; }

/* Éditeur de champs */
.field-row { display: grid; grid-template-columns: 1.1fr 1.6fr 1fr 1.3fr auto auto; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.field-row input, .field-row select { min-height: 36px; padding: .4rem .55rem; font-size: .85rem; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip { background: var(--primary-soft); color: var(--primary-dark); border: 0; border-radius: 6px; padding: .2rem .5rem; font-size: .78rem; cursor: pointer; font-family: Consolas, monospace; }
.chip:hover { background: #d3eadc; }

.doc-preview { border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; padding: 1.5rem; max-height: 720px; overflow: auto; }
.file-list { list-style: none; padding: 0; margin: 0; }
.file-list li { display: flex; gap: .6rem; align-items: center; padding: .55rem 0; border-bottom: 1px dashed var(--border); font-size: .9rem; }
.thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--surface-2); }

/* =====================================================================
   AUTHENTIFICATION
   ===================================================================== */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(1200px 600px at 10% -10%, #d9efe2, transparent), radial-gradient(900px 500px at 110% 110%, #fff3c9, transparent), var(--bg); }
.auth-card { width: 100%; max-width: 440px; background: #fff; border-radius: 18px; box-shadow: 0 20px 60px rgba(13, 42, 27, .12); padding: 2rem; border: 1px solid var(--border); }
.auth-card.wide { max-width: 680px; }
.auth-brand { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.5rem; }
.auth-brand img { width: 48px; height: 48px; object-fit: contain; }
.auth-brand strong { display: block; font-size: 1.05rem; }
.auth-brand small { color: var(--muted); }
.auth-card h1 { font-size: 1.35rem; margin-bottom: .3rem; }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; font-size: .88rem; }
.flag-bar { height: 5px; border-radius: 3px; background: linear-gradient(90deg, #00853F 33.3%, #FDEF42 33.3% 66.6%, #E31B23 66.6%); margin-bottom: 1.4rem; }

/* =====================================================================
   PORTAIL PUBLIC
   ===================================================================== */
.pub-header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; }
.pub-header .flag-bar { margin: 0; border-radius: 0; height: 4px; }
.pub-nav { max-width: 1200px; margin: 0 auto; padding: 0 1.2rem; height: 68px; display: flex; align-items: center; gap: 1rem; }
.pub-brand { display: flex; align-items: center; gap: .7rem; color: var(--text); text-decoration: none !important; }
.pub-brand img { width: 44px; height: 44px; object-fit: contain; }
.pub-brand strong { display: block; font-size: 1rem; line-height: 1.15; }
.pub-brand small { color: var(--muted); font-size: .75rem; }
.pub-menu { display: flex; gap: .2rem; margin-left: auto; align-items: center; }
.pub-menu a { padding: .5rem .75rem; border-radius: 8px; color: #34453b; font-weight: 600; font-size: .9rem; text-decoration: none; }
.pub-menu a:hover, .pub-menu a.active { background: var(--primary-soft); color: var(--primary); }
.pub-menu .btn { margin-left: .4rem; color: #fff; }
.pub-menu .btn:hover { color: #fff; background: var(--primary-dark); }
.pub-toggle { display: none; margin-left: auto; background: none; border: 0; cursor: pointer; padding: .4rem; }
.pub-toggle .ic { width: 26px; height: 26px; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.2rem; }
.section { padding: 3.2rem 0; }
.section-alt { background: #fff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.section-head h2 { font-size: 1.6rem; margin: 0; }
.section-head p { margin: .3rem 0 0; color: var(--muted); }
.eyebrow { display: inline-block; font-size: .76rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--primary); margin-bottom: .4rem; }

.hero { position: relative; overflow: hidden; color: #fff; background: linear-gradient(120deg, rgba(6, 46, 25, .93), rgba(11, 107, 58, .82)), var(--hero-img, none) center/cover no-repeat, #0b4d2b; }
.hero::after { content: ""; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(242, 183, 5, .12); }
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.3fr 1fr; gap: 2.5rem; padding: 4.2rem 1.2rem 4.5rem; max-width: 1200px; margin: 0 auto; align-items: center; }
.hero h1 { color: #fff; font-size: clamp(1.8rem, 4vw, 2.7rem); margin-bottom: .8rem; letter-spacing: -.01em; }
.hero p.lead { font-size: 1.08rem; opacity: .93; max-width: 560px; }
.hero .btn-group { margin-top: 1.4rem; }
.hero .btn-outline { color: #fff; border-color: rgba(255,255,255,.7); }
.hero .btn-outline:hover { background: rgba(255,255,255,.1); }
.hero-card { background: rgba(255,255,255,.97); color: var(--text); border-radius: 16px; padding: 1.4rem; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.hero-card h3 { display: flex; gap: .5rem; align-items: center; }
.hero-badges { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1.3rem; }
.hero-badges span { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); padding: .35rem .7rem; border-radius: 999px; font-size: .82rem; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; counter-reset: st; }
.step { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem; position: relative; }
.step::before { counter-increment: st; content: counter(st); position: absolute; top: -14px; left: 1.2rem; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #2a2000; font-weight: 800; display: grid; place-items: center; }
.step h4 { margin-top: .5rem; }
.step p { color: var(--muted); font-size: .9rem; margin: 0; }

.service-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; display: flex; flex-direction: column; gap: .4rem; transition: box-shadow .15s, transform .15s; }
.service-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.service-card .cat { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.service-card h4 { margin: 0; }
.service-card .meta { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: .7rem; font-size: .85rem; }

.post-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; color: var(--text); transition: box-shadow .15s, transform .15s; }
.post-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.post-img { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--primary-soft), #fff6d6); display: grid; place-items: center; color: var(--primary); overflow: hidden; }
.post-img img { width: 100%; height: 100%; object-fit: cover; }
.post-img .ic { width: 42px; height: 42px; opacity: .55; }
.post-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.post-body h3 { font-size: 1.02rem; margin: 0; }
.post-body p { color: var(--muted); font-size: .9rem; margin: 0; }
.post-meta { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.post-feature { display: grid; grid-template-columns: 1.2fr 1fr; }
.post-feature .post-img { aspect-ratio: auto; min-height: 280px; }
.post-feature .post-body { padding: 1.6rem; justify-content: center; }
.post-feature h3 { font-size: 1.35rem; }

.opp-item { display: flex; gap: 1rem; align-items: flex-start; padding: 1rem 1.1rem; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); }
.opp-item:hover { border-color: var(--primary); text-decoration: none; }
.opp-icon { width: 46px; height: 46px; border-radius: 12px; background: #fff6d6; color: #8a6400; display: grid; place-items: center; flex-shrink: 0; }
.opp-item h4 { margin: 0 0 .2rem; font-size: .98rem; }

.ad-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.ad-card { position: relative; border-radius: var(--radius); overflow: hidden; min-height: 160px; background: linear-gradient(135deg, #1b2b22, #2d4a39); color: #fff; display: flex; align-items: flex-end; }
.ad-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.ad-card .ad-body { position: relative; padding: 1.1rem; }
.ad-card h4 { color: #fff; margin: 0 0 .2rem; }
.ad-card p { margin: 0; font-size: .86rem; opacity: .9; }
.ad-tag { position: absolute; top: .7rem; left: .7rem; background: var(--accent); color: #2a2000; font-size: .68rem; font-weight: 800; padding: .15rem .5rem; border-radius: 4px; text-transform: uppercase; z-index: 1; }

.article { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; }
.article-cover { border-radius: var(--radius); margin-bottom: 1.5rem; width: 100%; max-height: 440px; object-fit: cover; }
.article-content { font-size: 1.02rem; line-height: 1.75; }

.pub-footer { background: #0d2a1b; color: #b9cfc2; padding: 3rem 0 1.5rem; margin-top: 2rem; }
.pub-footer h4 { color: #fff; }
.pub-footer a { color: #d5e7dc; }
.pub-footer .grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
.pub-footer .copy { border-top: 1px solid rgba(255,255,255,.1); margin-top: 2rem; padding-top: 1.2rem; font-size: .82rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; font-size: .9rem; }

.verify-ok { border: 2px solid var(--success); background: #f0fbf4; border-radius: var(--radius); padding: 1.4rem; }
.verify-ko { border: 2px solid var(--danger); background: #fef3f4; border-radius: var(--radius); padding: 1.4rem; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pub-footer .grid { grid-template-columns: 1fr 1fr; }
    .steps { grid-template-columns: repeat(2, 1fr); row-gap: 1.6rem; }
}
@media (max-width: 992px) {
    .grid-main, .grid-3 { grid-template-columns: minmax(0, 1fr); }
    .hero-inner { grid-template-columns: 1fr; padding: 3rem 1.2rem; }
    .post-feature { grid-template-columns: 1fr; }
    .post-feature .post-img { min-height: 200px; }
    .pub-toggle { display: inline-flex; }
    .pub-menu { display: none; position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: #fff; padding: .8rem 1rem 1.2rem; border-bottom: 1px solid var(--border); box-shadow: 0 12px 30px rgba(0,0,0,.08); }
    .pub-menu.open { display: flex; }
    .pub-menu .btn { margin: .4rem 0 0; }
    .field-row { grid-template-columns: 1fr 1fr; }
}
/* Téléphones : la barre latérale devient un menu coulissant */
@media (max-width: 767px) {
    .sidebar { width: min(86vw, 300px); transform: translateX(-100%); }
    body.sidebar-open { overflow: hidden; }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .overlay { display: block; }
    .sidebar-close { display: grid; }
    .sidebar-brand { padding-right: 56px; }
    .main { margin-left: 0; }
    .menu-toggle { display: inline-flex; }
}
/* Tablettes : barre latérale fixe un peu plus étroite */
@media (min-width: 768px) and (max-width: 1100px) {
    :root { --sidebar-w: 232px; }
    .top-search { max-width: 260px; }
    .user-chip .u-txt { display: none; }
}

@media (max-width: 680px) {
    body { font-size: 14.5px; }
    .content { padding: 1rem .9rem 2rem; }
    .topbar { padding: 0 .8rem; gap: .4rem; }
    .top-search { display: none; }
    .user-chip .u-txt { display: none; }
    .grid-2, .grid-4, .form-grid, .form-grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
    .card-header .btn-group, .page-head .btn-group { width: 100%; }
    .chart-col { font-size: 0; }
    .chart-col strong { font-size: .7rem; }
    .filters .form-group { min-width: 100%; }
    .notif-item { flex-wrap: wrap; }
    html, body { overflow-x: hidden; }
    .card-body { padding: 1rem; }
    .page-head h1 { font-size: 1.25rem; }
    .stat { padding: .9rem; }
    .stat-value { font-size: 1.3rem; }
    .pub-footer .grid, .steps { grid-template-columns: 1fr; }
    .section { padding: 2.2rem 0; }
    .article { padding: 1.2rem; }
    .pickup { flex-direction: column; text-align: center; }
    .auth-card { padding: 1.4rem; }
    .bar-row { grid-template-columns: 1fr 2fr auto; }
    .form-actions .btn { flex: 1; }
    /* Tableaux en cartes sur téléphone */
    .table.responsive thead { display: none; }
    .table.responsive tr { display: block; border-bottom: 1px solid var(--border); padding: .6rem .3rem; }
    .table.responsive td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .3rem .6rem; text-align: right; }
    .table.responsive td::before { content: attr(data-label); font-weight: 600; color: var(--muted); text-align: left; font-size: .8rem; }
    .table.responsive td.actions { justify-content: flex-end; }
    .table.responsive td.actions::before { content: none; }
}

@media print {
    .sidebar, .topbar, .app-footer, .no-print, .pub-header, .pub-footer { display: none !important; }
    .main { margin: 0; }
    body { background: #fff; }
}
