/* =====================================================================
   Lahiya Akoussana — feuille de style principale
   ===================================================================== */
:root {
  --green-900: #063f2e;
  --green-800: #08583f;
  --green-700: #0b6e4f;
  --green-600: #0f8a63;
  --green-100: #dff2ea;
  --green-50:  #f0f8f4;
  --orange:    #f08c00;
  --orange-100:#fff1dc;
  --red:       #d64045;
  --red-100:   #fde8e8;
  --blue:      #2563eb;
  --blue-100:  #e3ecff;
  --violet:    #7c3aed;
  --violet-100:#efe7ff;
  --amber:     #b76e00;
  --amber-100: #fff4d6;
  --ink:       #14211d;
  --ink-2:     #3d4b46;
  --muted:     #6b7a75;
  --line:      #e3e9e6;
  --bg:        #f5f8f6;
  --surface:   #ffffff;
  --radius:    16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 40, 32, .06);
  --shadow:    0 1px 2px rgba(16, 40, 32, .05), 0 8px 24px -8px rgba(16, 40, 32, .12);
  --shadow-lg: 0 24px 60px -20px rgba(6, 63, 46, .35);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Plus Jakarta Sans", var(--font);
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15.5px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--green-700); text-decoration: none; }
a:hover { color: var(--green-800); }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.85rem); }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }
small, .small { font-size: .85em; }
.muted { color: var(--muted); }
.muted-light { color: rgba(255,255,255,.72); }
.hint { color: var(--muted); font-size: .85rem; margin: .4rem 0 0; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 } .mt-1 { margin-top: .5rem } .mt-2 { margin-top: 1rem } .mt-3 { margin-top: 1.5rem } .mt-4 { margin-top: 2.5rem }
.mb-0 { margin-bottom: 0 } .mb-1 { margin-bottom: .5rem } .mb-2 { margin-bottom: 1rem } .mb-3 { margin-bottom: 1.5rem }
.flex { display: flex; gap: .75rem; 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; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 999; }
.skip-link:focus { left: 1rem; }
:focus-visible { outline: 3px solid rgba(240,140,0,.55); outline-offset: 2px; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section { padding: 64px 0; }
.section-sm { padding: 36px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.section-head p { color: var(--muted); margin: 0; max-width: 620px; }
.eyebrow { display: inline-flex; align-items: center; gap: .45rem; text-transform: uppercase; letter-spacing: .08em; font-size: .74rem; font-weight: 700; color: var(--green-700); margin-bottom: .6rem; }

/* ----- Boutons ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border: 1px solid transparent; border-radius: 999px; padding: .7rem 1.25rem; font: 600 .95rem/1.1 var(--font); cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .05s, box-shadow .15s; text-decoration: none; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: .5rem .95rem; font-size: .86rem; }
.btn-lg { padding: .95rem 1.6rem; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--green-700); color: #fff; box-shadow: 0 6px 16px -6px rgba(11,110,79,.6); }
.btn-primary:hover { background: var(--green-800); color: #fff; }
.btn-secondary { background: var(--green-50); color: var(--green-800); border-color: var(--green-100); }
.btn-secondary:hover { background: var(--green-100); color: var(--green-900); }
.btn-accent { background: var(--orange); color: #fff; }
.btn-accent:hover { background: #d97e00; color: #fff; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(20,33,29,.06); color: var(--ink); }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: #c9d4cf; color: var(--ink); }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b9343a; color: #fff; }
.btn-danger-soft { background: var(--red-100); color: #a32a2f; }
.btn-sos { background: var(--red); color: #fff; }
.btn-sos:hover { background: #b9343a; color: #fff; }
.btn-link { background: none; border: 0; color: var(--green-700); font-weight: 600; cursor: pointer; padding: 0; font: inherit; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; font-size: 1.05rem; }
.icon-btn:hover { color: var(--ink); background: var(--green-50); }
.dot-count { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: var(--red); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }

/* ----- En-tête public ----- */
.site-header { position: sticky; top: 0; z-index: 1000; background: rgba(255,255,255,.88); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); font-family: var(--font-display); font-size: 1.12rem; white-space: nowrap; }
.brand strong { color: var(--green-700); font-weight: 800; }
.brand span { font-weight: 600; }
.brand-light, .brand-light:hover { color: #fff; }
.brand-light strong { color: #8ee0bd; }
.main-nav { display: flex; gap: .2rem; margin-left: .5rem; }
.main-nav a { white-space: nowrap; color: var(--ink-2); font-weight: 500; font-size: .93rem; padding: .5rem .75rem; border-radius: 10px; }
.main-nav a:hover, .main-nav a.active { color: var(--green-800); background: var(--green-50); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.nav-toggle { display: none; }
.mobile-nav { display: none; }
.avatar-xs { width: 22px; height: 22px; font-size: .62rem; }

/* ----- Messages flash ----- */
.flash-stack { position: fixed; top: calc(var(--header-h) + 12px); right: 16px; z-index: 2000; display: grid; gap: .6rem; max-width: min(440px, calc(100% - 32px)); }
.dash .flash-stack { top: 76px; }
.flash { display: flex; gap: .7rem; align-items: flex-start; padding: .9rem 1rem; border-radius: 14px; background: #fff; box-shadow: var(--shadow-lg); border-left: 4px solid var(--green-700); animation: slideIn .25s ease; font-size: .93rem; }
.flash i { margin-top: .15rem; }
.flash span { flex: 1; }
.flash-success i { color: var(--green-700); }
.flash-error { border-left-color: var(--red); } .flash-error i { color: var(--red); }
.flash-warning { border-left-color: var(--orange); } .flash-warning i { color: var(--orange); }
.flash-info { border-left-color: var(--blue); } .flash-info i { color: var(--blue); }
.flash-close { background: none; border: 0; font-size: 1.3rem; line-height: 1; color: var(--muted); cursor: pointer; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } }

/* ----- Héros ----- */
.hero { position: relative; overflow: hidden; background: radial-gradient(1200px 500px at 85% -10%, rgba(240,140,0,.16), transparent 60%), radial-gradient(900px 600px at -10% 120%, rgba(15,138,99,.22), transparent 60%), linear-gradient(180deg, #f2faf6, #f5f8f6); padding: 64px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.25rem); letter-spacing: -.025em; margin-bottom: .45em; }
.hero h1 em { font-style: normal; color: var(--green-700); position: relative; }
.hero .lead { font-size: 1.12rem; color: var(--ink-2); max-width: 560px; }
.search-box { margin-top: 1.6rem; background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); padding: 8px; display: flex; gap: 6px; border: 1px solid var(--line); }
.search-box .search-field { flex: 1; display: flex; align-items: center; gap: .6rem; padding: 0 .9rem; }
.search-box .search-field i { color: var(--muted); }
.search-box input, .search-box select { border: 0; outline: 0; font: inherit; width: 100%; background: transparent; padding: .75rem 0; color: var(--ink); }
.search-box select { max-width: 170px; border-left: 1px solid var(--line); padding-left: .8rem; color: var(--ink-2); }
.quick-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.chip { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .85rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); font-size: .87rem; font-weight: 500; cursor: pointer; }
.chip:hover, .chip.active { border-color: var(--green-600); color: var(--green-800); background: var(--green-50); }
.chip i { color: var(--green-700); }
.hero-trust { display: flex; gap: 1.4rem; margin-top: 1.6rem; color: var(--muted); font-size: .88rem; flex-wrap: wrap; }
.hero-trust span { display: inline-flex; align-items: center; gap: .4rem; }
.hero-trust i { color: var(--green-700); }
.hero-card { background: #fff; border-radius: 24px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); overflow: hidden; }
.hero-card .map { height: 300px; border-radius: 0; }
.hero-card-body { padding: 16px 18px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #20c780; box-shadow: 0 0 0 0 rgba(32,199,128,.6); animation: pulse 1.8s infinite; display: inline-block; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(32,199,128,0); } 100% { box-shadow: 0 0 0 0 rgba(32,199,128,0); } }

/* ----- Cartes / grilles ----- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-body { padding: 22px; }
.card-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; font-size: 1.05rem; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--line); background: #fbfcfc; border-radius: 0 0 var(--radius) var(--radius); }
.grid { display: grid; gap: 20px; }
.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, 1fr) 360px; align-items: start; }

.service-card { padding: 24px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); transition: transform .2s, box-shadow .2s; display: block; color: var(--ink); }
.service-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--ink); }
.service-card .ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.25rem; margin-bottom: 14px; background: var(--green-50); color: var(--green-700); }
.service-card h3 { margin-bottom: .3rem; }
.service-card p { color: var(--muted); font-size: .92rem; margin: 0; }
.ico-orange { background: var(--orange-100) !important; color: var(--orange) !important; }
.ico-red { background: var(--red-100) !important; color: var(--red) !important; }
.ico-blue { background: var(--blue-100) !important; color: var(--blue) !important; }
.ico-violet { background: var(--violet-100) !important; color: var(--violet) !important; }

/* Liste de structures */
.place-list { display: grid; gap: 12px; }
.place { display: flex; gap: 14px; padding: 16px; border-radius: 14px; background: #fff; border: 1px solid var(--line); align-items: flex-start; transition: border-color .15s, box-shadow .15s; color: var(--ink); }
.place:hover { border-color: #c5d6ce; box-shadow: var(--shadow); color: var(--ink); }
.place-ico { flex: 0 0 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-size: 1.1rem; }
.place-body { flex: 1; min-width: 0; }
.place-body h3 { font-size: 1rem; margin: 0 0 .15rem; }
.place-meta { display: flex; flex-wrap: wrap; gap: .3rem .9rem; color: var(--muted); font-size: .85rem; }
.place-meta i { width: 14px; text-align: center; }
.place-side { text-align: right; display: grid; gap: .35rem; justify-items: end; }
.distance { font-weight: 700; color: var(--green-800); font-size: .95rem; white-space: nowrap; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.badge-green { background: var(--green-100); color: var(--green-800); }
.badge-red { background: var(--red-100); color: #a32a2f; }
.badge-amber { background: var(--amber-100); color: var(--amber); }
.badge-blue { background: var(--blue-100); color: #1d4ed8; }
.badge-violet { background: var(--violet-100); color: var(--violet); }
.badge-gray { background: #eef1f0; color: #56635f; }
.badge-garde { background: #13203a; color: #ffd27a; }
.badge-open { background: var(--green-100); color: var(--green-800); }
.badge-closed { background: #f1f1f1; color: #6b6b6b; }
.stars { color: #f5a524; font-size: .8rem; letter-spacing: 1px; }

/* ----- Carte (Leaflet) ----- */
.map { width: 100%; height: 420px; border-radius: var(--radius); background: #e6efe9; z-index: 1; }
.map-full { height: calc(100vh - var(--header-h)); border-radius: 0; }
.map-picker { height: 320px; border-radius: 12px; border: 1px solid var(--line); }
.map-layout { display: grid; grid-template-columns: 400px 1fr; height: calc(100vh - var(--header-h)); }
.map-side { background: #fff; border-right: 1px solid var(--line); overflow: auto; padding: 18px; }
.map-side .chip { font-size: .82rem; }
.map-main { position: relative; }
.map-main .map { height: 100%; border-radius: 0; }
.map-locate { position: absolute; right: 14px; bottom: 26px; z-index: 500; }
.leaflet-popup-content-wrapper { border-radius: 14px; }
.leaflet-popup-content { margin: 14px 16px; font-family: var(--font); }
.popup h4 { margin: 0 0 .2rem; font-size: .98rem; }
.popup .flex { margin-top: .5rem; gap: .4rem; }
.marker-pin { width: 34px; height: 34px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: grid; place-items: center; border: 3px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,.25); }
.marker-pin i { transform: rotate(45deg); color: #fff; font-size: 13px; }
.marker-garde { box-shadow: 0 0 0 4px rgba(255,210,122,.9), 0 4px 10px rgba(0,0,0,.25); }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: #2563eb; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(37,99,235,.25); }
.loc-picker .loc-tools { display: flex; align-items: center; gap: .75rem; margin-bottom: .6rem; flex-wrap: wrap; }
.loc-status { font-size: .85rem; color: var(--muted); }
.loc-status.ok { color: var(--green-700); font-weight: 600; }
.loc-status.warn { color: var(--amber); font-weight: 600; }
.geo-banner { display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; border-radius: 14px; background: var(--blue-100); color: #1e3a8a; font-size: .9rem; margin-bottom: 1rem; flex-wrap: wrap; }
.geo-banner.ok { background: var(--green-50); color: var(--green-800); }

/* ----- Formulaires ----- */
.form { display: grid; gap: 16px; }
.form-row { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-row-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.field { display: grid; gap: 6px; }
.field > label, .label { font-weight: 600; font-size: .88rem; color: var(--ink-2); }
.req { color: var(--red); }
.input, .field input[type=text], .field input[type=email], .field input[type=tel], .field input[type=password], .field input[type=number], .field input[type=date], .field input[type=time], .field input[type=datetime-local], .field input[type=url], .field input[type=search], .field select, .field textarea, select.input, textarea.input {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #d5dfda; border-radius: 12px; padding: .72rem .9rem; transition: border-color .15s, box-shadow .15s; }
.field textarea, textarea.input { min-height: 110px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--green-600); box-shadow: 0 0 0 4px rgba(15,138,99,.14); }
.field input[type=file] { font: inherit; font-size: .9rem; padding: .6rem; border: 1px dashed #c4d2cb; border-radius: 12px; background: var(--green-50); width: 100%; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .92rem; cursor: pointer; }
.check input { margin-top: .25rem; width: 18px; height: 18px; accent-color: var(--green-700); flex: none; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-icon input { padding-left: 2.6rem !important; }
.pwd-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); cursor: pointer; padding: .4rem; }
.switch { position: relative; display: inline-flex; align-items: center; gap: .65rem; cursor: pointer; font-weight: 500; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 46px; height: 26px; border-radius: 99px; background: #cfd8d4; position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + .track { background: var(--green-600); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 3px solid rgba(240,140,0,.55); }
fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin: 0; }
legend { font-weight: 700; padding: 0 .4rem; font-family: var(--font-display); }

/* Authentification */
.auth-wrap { min-height: calc(100vh - var(--header-h)); display: grid; grid-template-columns: 1fr 1fr; }
.auth-aside { background: linear-gradient(160deg, var(--green-800), var(--green-900)); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.auth-aside::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, rgba(240,140,0,.35), transparent 70%); }
.auth-aside h2 { color: #fff; font-size: 2rem; }
.auth-aside ul { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .9rem; }
.auth-aside li { display: flex; gap: .7rem; align-items: flex-start; color: rgba(255,255,255,.85); }
.auth-aside li i { color: #8ee0bd; margin-top: .25rem; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 520px; }
.auth-card.wide { max-width: 760px; }
.role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.role-grid-5 { grid-template-columns: repeat(5, 1fr); }
.role-option { position: relative; }
.role-option input { position: absolute; opacity: 0; }
.role-option label { display: grid; gap: .3rem; justify-items: center; text-align: center; padding: 14px 8px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--ink-2); height: 100%; }
.role-option label i { font-size: 1.3rem; color: var(--green-700); }
.role-option input:checked + label { border-color: var(--green-600); background: var(--green-50); color: var(--green-900); box-shadow: 0 0 0 3px rgba(15,138,99,.15); }
.role-option input:focus-visible + label { outline: 3px solid rgba(240,140,0,.55); }
.notice { display: flex; gap: .8rem; padding: 14px 16px; border-radius: 14px; background: var(--amber-100); color: #6f4300; font-size: .9rem; align-items: flex-start; }
.notice i { margin-top: .2rem; }
.notice-info { background: var(--blue-100); color: #1e3a8a; }
.notice-green { background: var(--green-50); color: var(--green-900); }
.notice-red { background: var(--red-100); color: #8f1f24; }

/* ----- Tableaux ----- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; padding: .8rem 1rem; border-bottom: 1px solid var(--line); background: #fbfcfc; white-space: nowrap; }
.table td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fafcfb; }
.table .actions { display: flex; gap: .4rem; justify-content: flex-end; flex-wrap: wrap; }
.cell-user { display: flex; align-items: center; gap: .7rem; }
.cell-user small { display: block; color: var(--muted); }

/* ----- Divers ----- */
.avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar-lg { width: 88px; height: 88px; font-size: 1.6rem; }
.avatar-initials { display: inline-grid; place-items: center; background: linear-gradient(135deg, var(--green-600), var(--green-800)); color: #fff; font-weight: 700; font-size: .9rem; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty > i { font-size: 2.4rem; color: #b9cbc3; margin-bottom: 12px; }
.empty h3 { color: var(--ink-2); }
.pagination { display: flex; gap: .35rem; justify-content: center; margin-top: 1.4rem; flex-wrap: wrap; }
.pagination a { min-width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-weight: 600; }
.pagination a.active { background: var(--green-700); color: #fff; border-color: var(--green-700); }
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); margin-bottom: 1.2rem; overflow-x: auto; }
.tabs a { padding: .7rem 1rem; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; font-size: .93rem; }
.tabs a.active, .tabs a:hover { color: var(--green-800); border-color: var(--green-700); }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: .55rem 1rem; font-size: .93rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.divider { height: 1px; background: var(--line); margin: 1.2rem 0; }
.price { font-weight: 700; color: var(--ink); white-space: nowrap; }
.tag-rx { display: inline-flex; gap: .3rem; align-items: center; font-size: .72rem; font-weight: 700; color: #a32a2f; background: var(--red-100); padding: .15rem .5rem; border-radius: 6px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 28px 1fr; gap: .7rem; padding-bottom: 1rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 13px; top: 26px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .tl-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #eef1f0; color: #9aa7a2; font-size: .75rem; }
.timeline li.done .tl-dot { background: var(--green-700); color: #fff; }
.timeline li.current .tl-dot { background: var(--orange); color: #fff; box-shadow: 0 0 0 5px var(--orange-100); }
.timeline strong { display: block; font-size: .93rem; }
.timeline small { color: var(--muted); }
.code-big { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.6rem; letter-spacing: .3em; font-weight: 800; color: var(--green-800); background: var(--green-50); padding: .4rem .8rem; border-radius: 10px; display: inline-block; }
.profile-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.cover { background: linear-gradient(135deg, var(--green-700), var(--green-900)); color: #fff; padding: 40px 0 34px; }
.cover h1, .cover h2 { color: #fff; margin-bottom: .3rem; }
.cover .place-meta { color: rgba(255,255,255,.82); }
.cover .badge-green { background: rgba(255,255,255,.16); color: #fff; }
.pub-card { display: grid; grid-template-rows: auto 1fr; overflow: hidden; }
.pub-card img { aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.pub-card .card-body p { color: var(--ink-2); font-size: .93rem; }
.cta-band { background: linear-gradient(135deg, var(--green-800), var(--green-900)); color: #fff; border-radius: 24px; padding: 40px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: center; }
.cta-band h2 { color: #fff; }
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.step { position: relative; padding: 22px; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); }
.step::before { counter-increment: step; content: counter(step); width: 32px; height: 32px; border-radius: 50%; background: var(--green-700); color: #fff; display: grid; place-items: center; font-weight: 700; margin-bottom: 12px; font-family: var(--font-display); }
.step p { color: var(--muted); font-size: .9rem; margin: 0; }
.sos-hero { background: linear-gradient(135deg, #b42a30, #7e1418); color: #fff; padding: 48px 0; }
.sos-hero h1 { color: #fff; }
.sos-numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 1.5rem; }
.sos-number { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); border-radius: 16px; padding: 18px; color: #fff; display: flex; align-items: center; gap: 14px; }
.sos-number:hover { background: rgba(255,255,255,.2); color: #fff; }
.sos-number strong { font-size: 1.8rem; font-family: var(--font-display); display: block; line-height: 1; }
.sos-number i { font-size: 1.5rem; }
.product-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.product-row:last-child { border-bottom: 0; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; background: #fff; }
.qty button { width: 34px; height: 34px; border: 0; background: transparent; cursor: pointer; font-size: 1rem; color: var(--ink-2); }
.qty input { width: 42px; text-align: center; border: 0; font: inherit; font-weight: 600; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.cart-bar { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 14px 0; z-index: 50; box-shadow: 0 -10px 30px -18px rgba(0,0,0,.25); }
.slots { display: flex; flex-wrap: wrap; gap: .45rem; }
.slot { position: relative; }
.slot input { position: absolute; opacity: 0; }
.slot label { display: inline-block; padding: .45rem .8rem; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; font-size: .88rem; }
.slot input:checked + label { background: var(--green-700); color: #fff; border-color: var(--green-700); }
.slot input:disabled + label { opacity: .4; text-decoration: line-through; cursor: not-allowed; }
.day-tabs { display: flex; gap: .45rem; overflow-x: auto; padding-bottom: .4rem; }
.day-tab { flex: none; text-align: center; padding: .55rem .8rem; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; min-width: 74px; font-size: .82rem; color: var(--ink-2); }
.day-tab strong { display: block; font-size: 1.05rem; color: var(--ink); }
.day-tab.active { border-color: var(--green-600); background: var(--green-50); }
.day-tab.disabled { opacity: .45; }

/* ----- Pied de page public ----- */
.site-footer { background: #0b1f19; color: #fff; padding: 56px 0 24px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.site-footer h4 { color: #fff; font-size: .95rem; margin-bottom: .9rem; }
.site-footer a:not(.brand):not(.btn) { display: block; color: rgba(255,255,255,.7); font-size: .92rem; padding: .22rem 0; }
.site-footer a:not(.brand):hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(255,255,255,.1); margin-top: 32px; padding-top: 20px; color: rgba(255,255,255,.55); font-size: .85rem; gap: 1rem; flex-wrap: wrap; }
.tabbar { display: none; }

/* =====================================================================
   Espaces privés
   ===================================================================== */
body.dash { background: #f3f6f5; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; background: #0b1f19; color: #fff; display: flex; flex-direction: column; padding: 20px 14px; overflow-y: auto; z-index: 1100; }
.sidebar .brand { padding: 4px 10px 18px; }
.sidebar-user { display: flex; gap: .75rem; align-items: center; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.06); margin-bottom: 14px; }
.sidebar-user strong { display: block; font-size: .92rem; line-height: 1.25; }
.sidebar-user small { color: rgba(255,255,255,.6); font-size: .78rem; }
.side-nav { display: grid; gap: 2px; }
.side-nav a, .side-logout { display: flex; align-items: center; gap: .8rem; padding: .66rem .8rem; border-radius: 11px; color: rgba(255,255,255,.72); font-size: .92rem; font-weight: 500; background: none; border: 0; width: 100%; cursor: pointer; font-family: inherit; text-align: left; }
.side-nav a i, .side-logout i { width: 18px; text-align: center; color: rgba(255,255,255,.5); }
.side-nav a:hover, .side-logout:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-nav a.active { background: var(--green-700); color: #fff; }
.side-nav a.active i { color: #fff; }
.side-sep { height: 1px; background: rgba(255,255,255,.1); margin: 10px 6px; }
.pill-count { margin-left: auto; background: var(--orange); color: #fff; font-style: normal; font-size: .7rem; font-weight: 700; padding: .1rem .45rem; border-radius: 99px; }
.dash-main { margin-left: 270px; min-height: 100vh; display: flex; flex-direction: column; }
.dash-top { position: sticky; top: 0; z-index: 900; height: 66px; display: flex; align-items: center; gap: 1rem; padding: 0 28px; background: rgba(243,246,245,.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.dash-top h1 { font-size: 1.25rem; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-top-actions { display: flex; gap: .5rem; align-items: center; }
.menu-btn { display: none; }
.dash-content { padding: 28px; flex: 1; max-width: 1400px; width: 100%; }
.sidebar-backdrop { display: none; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { display: flex; gap: 14px; align-items: center; padding: 18px; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); color: var(--ink); }
a.stat-card:hover { box-shadow: var(--shadow); color: var(--ink); }
.stat-card strong { display: block; font-size: 1.5rem; font-family: var(--font-display); line-height: 1.1; }
.stat-card span:not(.stat-icon) { color: var(--muted); font-size: .86rem; }
.stat-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 1.15rem; flex: none; }
.tone-green .stat-icon { background: var(--green-50); color: var(--green-700); }
.tone-orange .stat-icon { background: var(--orange-100); color: var(--orange); }
.tone-blue .stat-icon { background: var(--blue-100); color: var(--blue); }
.tone-red .stat-icon { background: var(--red-100); color: var(--red); }
.tone-violet .stat-icon { background: var(--violet-100); color: var(--violet); }
.welcome { background: linear-gradient(120deg, var(--green-700), var(--green-900)); color: #fff; border-radius: 20px; padding: 26px 28px; margin-bottom: 24px; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; position: relative; overflow: hidden; }
.welcome h2 { color: #fff; margin: 0 0 .2rem; }
.welcome p { margin: 0; color: rgba(255,255,255,.8); }
.welcome .btn-secondary { background: #fff; border-color: #fff; }
.list-clean { list-style: none; padding: 0; margin: 0; }
.list-row { display: flex; gap: 12px; align-items: center; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow small { display: block; color: var(--muted); }
.date-box { flex: none; width: 52px; text-align: center; border-radius: 12px; background: var(--green-50); color: var(--green-800); padding: 6px 0; line-height: 1.1; }
.date-box strong { display: block; font-size: 1.2rem; font-family: var(--font-display); }
.date-box small { font-size: .7rem; text-transform: uppercase; font-weight: 700; }

/* Messagerie */
.chat { display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - 66px - 56px); min-height: 480px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.chat-list { border-right: 1px solid var(--line); overflow-y: auto; }
.chat-list a { display: flex; gap: .7rem; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--ink); align-items: center; }
.chat-list a.active, .chat-list a:hover { background: var(--green-50); }
.chat-list .grow { min-width: 0; }
.chat-list small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-main { display: flex; flex-direction: column; min-width: 0; }
.chat-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; gap: .7rem; align-items: center; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 8px; background: #f7faf9; }
.msg { max-width: 72%; padding: .6rem .9rem; border-radius: 16px; background: #fff; border: 1px solid var(--line); font-size: .93rem; white-space: pre-wrap; word-wrap: break-word; }
.msg time { display: block; font-size: .7rem; color: var(--muted); margin-top: .2rem; }
.msg.me { align-self: flex-end; background: var(--green-700); color: #fff; border-color: var(--green-700); border-bottom-right-radius: 4px; }
.msg.me time { color: rgba(255,255,255,.7); }
.msg:not(.me) { border-bottom-left-radius: 4px; }
.chat-form { display: flex; gap: .6rem; padding: 12px; border-top: 1px solid var(--line); }
.chat-form textarea { flex: 1; resize: none; min-height: 46px; max-height: 140px; border-radius: 14px; border: 1px solid #d5dfda; padding: .7rem .9rem; font: inherit; }

/* Vidéo */
.video-room { display: grid; grid-template-columns: 1fr 340px; gap: 16px; }
.video-stage { position: relative; background: #0b1512; border-radius: 20px; overflow: hidden; aspect-ratio: 16/10; }
.video-stage video { width: 100%; height: 100%; object-fit: cover; background: #0b1512; }
.video-self { position: absolute; right: 14px; bottom: 76px; width: 26%; max-width: 220px; aspect-ratio: 4/3; border-radius: 14px; overflow: hidden; border: 2px solid rgba(255,255,255,.7); background: #13221d; }
.video-self video { transform: scaleX(-1); }
.video-status { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #fff; text-align: center; }
.video-status i { font-size: 2.2rem; opacity: .7; margin-bottom: .6rem; }
.video-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: .7rem; justify-content: center; padding: 14px; background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.video-bar button { width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.18); color: #fff; font-size: 1.05rem; cursor: pointer; }
.video-bar button.off { background: #fff; color: var(--ink); }
.video-bar button.hang { background: var(--red); }
.jitsi-frame { width: 100%; height: 70vh; border: 0; border-radius: 20px; }

/* Impression d'ordonnance */
.rx-sheet { background: #fff; max-width: 800px; margin: 0 auto; padding: 40px; border: 1px solid var(--line); border-radius: 12px; }
.rx-head { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 2px solid var(--green-700); padding-bottom: 14px; margin-bottom: 18px; }
.rx-lines { list-style: none; padding: 0; counter-reset: rx; }
.rx-lines li { padding: 10px 0 10px 36px; border-bottom: 1px dashed var(--line); position: relative; }
.rx-lines li::before { counter-increment: rx; content: counter(rx); position: absolute; left: 0; top: 10px; width: 24px; height: 24px; border-radius: 50%; background: var(--green-50); color: var(--green-800); display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.rx-foot { display: flex; justify-content: space-between; align-items: end; margin-top: 24px; gap: 1rem; }
.qr { width: 120px; height: 120px; }
.qr canvas, .qr img { width: 120px !important; height: 120px !important; }

@media print {
  .site-header, .site-footer, .tabbar, .sidebar, .dash-top, .no-print, .flash-stack { display: none !important; }
  .dash-main { margin: 0; }
  .dash-content { padding: 0; }
  body { background: #fff; }
  .rx-sheet { border: 0; }
}

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 1150px) {
  .main-nav { display: none; }
  .nav-toggle { display: inline-grid; }
  .mobile-nav.open { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; padding: 10px 20px 16px; border-top: 1px solid var(--line); background: #fff; }
  .mobile-nav a { display: flex; gap: .6rem; align-items: center; padding: .7rem .8rem; border-radius: 10px; color: var(--ink-2); font-weight: 500; }
  .mobile-nav a i { color: var(--green-700); width: 18px; }
}
@media (max-width: 1100px) {
  .mobile-nav.open { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; padding: 10px 20px 16px; border-top: 1px solid var(--line); background: #fff; }
  .mobile-nav a { display: flex; gap: .6rem; align-items: center; padding: .7rem .8rem; border-radius: 10px; color: var(--ink-2); font-weight: 500; }
  .mobile-nav a i { color: var(--green-700); width: 18px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-wrap { grid-template-columns: 1fr !important; }
  .role-grid-5 { grid-template-columns: repeat(3, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .cta-band { grid-template-columns: 1fr; padding: 28px; }
  .map-layout { grid-template-columns: 1fr; grid-template-rows: 50vh auto; height: auto; }
  .map-layout .map-main { order: -1; height: 50vh; }
  .map-side { border-right: 0; }
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1050; }
  .dash-main { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .dash-content { padding: 18px 16px 40px; }
  .dash-top { padding: 0 16px; }
  .video-room { grid-template-columns: 1fr; }
  .chat { grid-template-columns: 1fr; height: auto; }
  .chat.has-active .chat-list { display: none; }
  .chat:not(.has-active) .chat-main { display: none; }
  .chat-msgs { height: 60vh; }
}
@media (max-width: 640px) {
  body.public { padding-bottom: 68px; }
  .container { padding: 0 16px; }
  .section { padding: 44px 0; }
  .hide-sm { display: none !important; }
  .header-inner { gap: .6rem; }
  .brand span { font-size: 1rem; }
  .grid-2, .grid-3, .grid-4, .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .role-grid, .role-grid-5 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .sos-numbers { grid-template-columns: 1fr; }
  .search-box { flex-direction: column; border-radius: 18px; }
  .search-box select { max-width: none; border-left: 0; border-top: 1px solid var(--line); }
  .search-box .btn { width: 100%; }
  .place { flex-wrap: wrap; }
  .place-side { width: 100%; justify-items: start; text-align: left; grid-auto-flow: column; justify-content: space-between; align-items: center; }
  .kv { grid-template-columns: 1fr; gap: .1rem; }
  .kv dd { margin-bottom: .6rem; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; font-size: .68rem; color: var(--muted); font-weight: 600; padding: 4px 0; }
  .tabbar a i { font-size: 1.15rem; }
  .table-responsive thead { display: none; }
  .table-responsive tr { display: block; border-bottom: 1px solid var(--line); padding: .6rem 0; }
  .table-responsive td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .35rem 1rem; text-align: right; }
  .table-responsive td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; font-weight: 600; text-align: left; }
  .table-responsive td.actions { justify-content: flex-end; }
  .table-responsive td.actions::before { content: none; }
  .product-row { grid-template-columns: 1fr auto; }
  .product-row .price { grid-column: 1; }
  .msg { max-width: 88%; }
  .rx-sheet { padding: 20px; }
  .flash-stack { top: auto; bottom: 80px; right: 12px; left: 12px; max-width: none; }
  .dash .flash-stack { bottom: 16px; }
}
