/* QR VIIM FAANGRÉ · interface agent et administration */
:root {
  --green: #0b7d46; --green-700: #086437; --green-50: #e9f6ee; --green-100: #cfeedc;
  --red: #e3252c; --red-50: #fdecec; --yellow: #fcd116; --yellow-50: #fff8d6;
  --ink: #0b1d15; --text: #1b2a23; --muted: #66756d; --line: #e4ebe7;
  --bg: #f3f6f4; --card: #fff; --radius: 16px;
  --shadow: 0 1px 2px rgba(11,29,21,.05), 0 8px 24px -12px rgba(11,29,21,.12);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--text); background: var(--bg); }
a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; color: var(--ink); letter-spacing: -.02em; }
h1 { font-size: 26px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
p { margin: 0; }
.muted { color: var(--muted); } .small { font-size: 13px; } .mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* --- mise en page ------------------------------------------------------ */
.shell { display: grid; grid-template-columns: 268px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 16px;
  color: #cfe3d8; background: radial-gradient(120% 80% at 0% 0%, #0f4a2e 0%, #082a1a 45%, #051a10 100%); }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--red), #b3151c); box-shadow: 0 6px 16px -4px rgba(227,37,44,.6); }
.brand-mark .icon { width: 24px; height: 24px; }
.brand b { display: block; font-size: 15px; letter-spacing: .02em; line-height: 1.15; }
.brand small { color: #8db5a0; font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.nav-label { margin: 18px 10px 6px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #6f9783; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: #cfe3d8; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; color: #fff; }
.nav a.active { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 var(--yellow); }
.nav .cta { margin: 6px 0 10px; justify-content: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, #12a35d, var(--green));
  box-shadow: 0 8px 18px -8px rgba(18,163,93,.8); }
.nav .cta:hover { filter: brightness(1.08); }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.07); }
.me .avatar { background: var(--yellow); color: #3a3000; }
.me b { display: block; color: #fff; font-size: 14px; line-height: 1.2; } .me small { color: #8db5a0; }
.me form { margin-left: auto; }
.me button { background: none; border: 0; color: #8db5a0; cursor: pointer; padding: 6px; border-radius: 8px; }
.me button:hover { color: #fff; background: rgba(255,255,255,.1); }
.main { min-width: 0; padding: 28px clamp(16px, 3.2vw, 44px) 56px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { color: var(--muted); margin-top: 4px; }
.btn.menu-btn { display: none; }
.stripe { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--red) 0 33%, var(--yellow) 33% 66%, var(--green) 66%); margin-bottom: 18px; max-width: 72px; }

/* --- composants -------------------------------------------------------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card + .card { margin-top: 18px; }
.grid > .card, .handover > .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.grid { display: grid; gap: 18px; } .g2 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); } .g-main { grid-template-columns: 1.6fr 1fr; }
.stack > * + * { margin-top: 18px; }
.row { display: flex; align-items: center; gap: 12px; } .row.wrap { flex-wrap: wrap; } .spread { justify-content: space-between; }
.stat { display: flex; align-items: center; gap: 16px; padding: 20px; }
.stat .ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--green-50); color: var(--green); }
.stat .ico.red { background: var(--red-50); color: var(--red); } .stat .ico.yellow { background: var(--yellow-50); color: #8a6d00; }
.stat b { display: block; font-size: 28px; line-height: 1.1; color: var(--ink); letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 13px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--green-100); color: var(--green-700); flex: none; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; transition: .15s; }
.btn:hover { background: #f7faf8; text-decoration: none; border-color: #cfdad4; }
.btn.primary { background: linear-gradient(135deg, #12a35d, var(--green)); color: #fff; border-color: transparent; box-shadow: 0 8px 18px -8px rgba(11,125,70,.8); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--red); border-color: #f4c7c9; } .btn.danger:hover { background: var(--red-50); }
.btn.danger.solid { background: var(--red); color: #fff; border-color: transparent; }
.btn.lg { padding: 14px 24px; font-size: 16px; border-radius: 14px; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-weight: 600; font-size: 13px; color: var(--ink); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid #d5dfd9; background: #fff; font: inherit; color: var(--ink); transition: .15s; }
.input:focus { outline: 0; border-color: var(--green); box-shadow: 0 0 0 4px rgba(11,125,70,.14); }
.input.invalid { border-color: var(--red); box-shadow: 0 0 0 4px rgba(227,37,44,.1); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; } .form-grid .full { grid-column: 1 / -1; }
.opt { font-weight: 400; color: var(--muted); }
.search { display: flex; gap: 10px; flex: 1; max-width: 520px; }
.search .input { padding-left: 42px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2366756d' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 14px center no-repeat; }

.alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--red-50); color: #8f1419; border: 1px solid #f6c5c7; }
.alert ul { margin: 4px 0 0; padding-left: 18px; } .alert.ok { background: var(--green-50); color: var(--green-700); border-color: var(--green-100); }
.alert.info { background: var(--yellow-50); color: #6b5600; border-color: #f2e08a; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: #eef2ef; color: #4b5a52; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.active { background: var(--green-50); color: var(--green-700); } .badge.disabled { background: #fff1d6; color: #8a5a00; }
.badge.replaced { background: #eef0f2; color: #5c6670; } .badge.inactive { background: var(--red-50); color: #b3151c; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 12px 10px; font-weight: 600; }
td { padding: 14px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: #f8fbf9; }
.table-wrap { overflow-x: auto; margin: 0 -12px; }
.who { display: flex; align-items: center; gap: 12px; } .who b { display: block; color: var(--ink); } .who span { font-size: 13px; color: var(--muted); }
.empty { text-align: center; padding: 44px 16px; color: var(--muted); }
.empty .icon { width: 40px; height: 40px; color: #b7c5bd; margin-bottom: 8px; }
dl.facts { display: grid; grid-template-columns: 150px 1fr; gap: 12px 16px; margin: 0; } dl.facts dt { color: var(--muted); } dl.facts dd { margin: 0; color: var(--ink); font-weight: 500; }

/* --- assistant d'enregistrement --------------------------------------- */
.stepper { display: flex; gap: 8px; margin-bottom: 22px; counter-reset: s; }
.stepper li { list-style: none; flex: 1; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 14px; }
.stepper li::before { counter-increment: s; content: counter(s); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #eef2ef; font-size: 13px; flex: none; }
.stepper li.current { color: var(--ink); border-color: var(--green); box-shadow: 0 0 0 4px rgba(11,125,70,.1); }
.stepper li.current::before { background: var(--green); color: #fff; }
.stepper li.done { color: var(--green-700); } .stepper li.done::before { content: "✓"; background: var(--green-100); color: var(--green-700); }
.stepper { padding: 0; margin-left: 0; }
.wizard-step { display: none; } .wizard-step.current { display: block; animation: rise .25s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.wizard-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.contact { display: grid; grid-template-columns: 1.2fr 1fr 1.1fr auto; gap: 12px; align-items: end; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fafcfb; }
.contact .input { height: 46px; padding-top: 0; padding-bottom: 0; }
.contact + .contact { margin-top: 12px; }
.contact .rm { height: 46px; width: 46px; padding: 0; }
.recap { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.recap .box { padding: 16px; border-radius: 14px; background: #f7faf8; border: 1px solid var(--line); } .recap h3 { margin-bottom: 10px; }
.recap .full { grid-column: 1 / -1; }
.recap li { margin: 4px 0; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 14px; background: var(--yellow-50); border: 1px solid #f2e08a; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--green); flex: none; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice { position: relative; } .choice input { position: absolute; opacity: 0; }
.choice span { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 14px; border: 2px solid var(--line); font-weight: 700; color: var(--ink); cursor: pointer; background: #fff; }
.choice input:checked + span { border-color: var(--green); background: var(--green-50); } .choice input:focus-visible + span { box-shadow: 0 0 0 4px rgba(11,125,70,.2); }
.price { font-size: 34px; font-weight: 800; color: var(--ink); letter-spacing: -.03em; }

/* --- photo ------------------------------------------------------------- */
.photo-field { display: flex; align-items: center; gap: 22px; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.photo-field .field { flex: 1; }
.photo-frame { position: relative; flex: none; padding: 12px; }
.photo-frame i { position: absolute; width: 30px; height: 30px; border: 0 solid var(--green); pointer-events: none; z-index: 1; }
.photo-frame .tl { top: 0; left: 0; border-width: 4px 0 0 4px; border-top-left-radius: 12px; }
.photo-frame .tr { top: 0; right: 0; border-width: 4px 4px 0 0; border-top-right-radius: 12px; }
.photo-frame .bl { bottom: 0; left: 0; border-width: 0 0 4px 4px; border-bottom-left-radius: 12px; }
.photo-frame .br { bottom: 0; right: 0; border-width: 0 4px 4px 0; border-bottom-right-radius: 12px; }
.photo-preview { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; width: 160px; height: 200px; overflow: hidden; text-align: center; padding: 12px; cursor: pointer;
  border-radius: 8px; background: #f2f7f4; color: var(--muted); font-size: 13px; line-height: 1.3; transition: .2s; }
.photo-preview:hover { background: var(--green-50); color: var(--green-700); }
.photo-preview .sil { width: 78px; height: 94px; fill: #c3d3ca; } .photo-preview:hover .sil { fill: #9fcdb3; }
.photo-preview:has(img) { padding: 0; background: #000; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
img.avatar.photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.recap-photo { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; margin-bottom: 10px; }
input[type=file].input { padding: 9px 12px; }

/* --- opérateurs Mobile Money ------------------------------------------ */
.providers { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.provider { position: relative; } .provider input { position: absolute; opacity: 0; }
.provider span { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 10px; border-radius: 14px; border: 2px solid var(--line); background: #fff; cursor: pointer; text-align: center; transition: .15s; }
.provider span:hover { border-color: #b9ccc1; transform: translateY(-1px); }
.provider img { border-radius: 10px; display: block; box-shadow: 0 4px 10px -4px rgba(0,0,0,.3); }
.provider b { font-size: 13px; color: var(--ink); }
.provider input:checked + span { border-color: var(--green); background: var(--green-50); box-shadow: 0 0 0 4px rgba(11,125,70,.12); }
.provider input:checked + span::after { content: "✓"; position: absolute; top: 8px; right: 10px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: #fff; font-size: 13px; font-weight: 700; }
.provider input:focus-visible + span { box-shadow: 0 0 0 4px rgba(11,125,70,.25); }

/* --- graphique --------------------------------------------------------- */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 190px; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.bar i { width: 100%; max-width: 34px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, #12a35d, var(--green-700)); min-height: 2px; }
.bar i.zero { background: #dfe8e3; } .bar b { font-size: 12px; color: var(--ink); } .bar span { font-size: 11px; color: var(--muted); }
.rank { counter-reset: r; } .rank li { list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.rank li:first-child { border-top: 0; } .rank li::before { counter-increment: r; content: counter(r); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--green-50); color: var(--green-700); font-weight: 700; font-size: 13px; }
.rank { padding: 0; margin: 0; } .rank .n { margin-left: auto; font-weight: 800; color: var(--ink); }

/* --- remise : autocollant et reçu -------------------------------------- */
.handover { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.preview { display: grid; place-items: center; padding: 28px; background: repeating-conic-gradient(#eef2ef 0 25%, #f7faf8 0 50%) 0 0 / 22px 22px; border-radius: 14px; }
.sticker { width: 56mm; background: #fff; border-radius: 4mm; border: .3mm solid #111; overflow: hidden; text-align: center; color: #111; font-family: var(--font); }
.sticker .top { background: var(--red); color: #fff; font-weight: 800; font-size: 3.4mm; letter-spacing: .06em; padding: 2mm 0; text-transform: uppercase; }
.sticker .qr { width: 42mm; height: 42mm; margin: 2.2mm auto 0; } .sticker .qr svg { width: 100%; height: 100%; display: block; }
.sticker .bot { padding: 0 2mm 2.4mm; } .sticker .bot b { display: block; font-size: 3.1mm; } .sticker .bot small { display: block; font-size: 2.5mm; color: #444; }
.sticker .id { font: 700 2.6mm ui-monospace, Menlo, monospace; margin-top: .6mm; letter-spacing: .08em; }
.receipt { width: 80mm; background: #fff; padding: 6mm 5mm; border: 1px dashed #b9c6bf; color: #111; font-size: 3.3mm; line-height: 1.45; }
.receipt h4 { margin: 0 0 1mm; font-size: 4.2mm; text-align: center; } .receipt .c { text-align: center; }
.receipt hr { border: 0; border-top: .3mm dashed #888; margin: 3mm 0; }
.receipt .line { display: flex; justify-content: space-between; gap: 3mm; }
.receipt .code { font: 800 6.4mm ui-monospace, Menlo, monospace; letter-spacing: .12em; text-align: center; padding: 3mm 0; margin: 2mm 0; border: .5mm solid #111; border-radius: 2mm; }

/* --- connexion --------------------------------------------------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art { position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(90% 70% at 0% 0%, #12623b 0%, #082a1a 55%, #04160d 100%); }
.auth-art::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(252,209,22,.28), transparent 65%); }
.auth-art h1 { color: #fff; font-size: 40px; line-height: 1.1; max-width: 460px; } .auth-art p { color: #a9cbb9; max-width: 440px; margin-top: 14px; font-size: 16px; }
.auth-art .brand { padding: 0; }
.auth-form { display: grid; place-items: center; padding: 32px; } .auth-box { width: 100%; max-width: 400px; }
.auth-box.wide { max-width: 520px; } .auth-box .contact { grid-template-columns: 1fr; } .auth-box .contact .rm { width: 100%; }
.auth-box h2 { font-size: 26px; margin-bottom: 6px; }
.pill-list { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; } .pill-list span { padding: 8px 14px; border-radius: 99px; background: rgba(255,255,255,.1); font-size: 13px; }

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: 280px; transform: translateX(-100%); transition: .25s; }
  body.menu-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }
  .btn.menu-btn { display: inline-flex; margin-bottom: 14px; }
  .g4 { grid-template-columns: repeat(2, 1fr); } .g-main, .g3, .handover { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; } .auth-art { display: none; }
}
@media (max-width: 640px) {
  .photo-field { flex-direction: column; align-items: stretch; } .photo-frame { align-self: center; }
  .g2, .g4, .form-grid, .recap, .choices { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; } .contact .rm { width: 100%; }
  .stepper li { font-size: 0; padding: 10px; justify-content: center; } .stepper li::before { font-size: 13px; }
  dl.facts { grid-template-columns: 1fr; gap: 2px 0; } dl.facts dd { margin-bottom: 10px; }
  h1 { font-size: 22px; }
}

/* --- impression -------------------------------------------------------- */
@media print {
  @page { margin: 6mm; }
  body { background: #fff; }
  .sidebar, .menu-btn, .no-print, .page-head, .stepper, .alert { display: none !important; }
  .shell { display: block; } .main { padding: 0; } .card { border: 0; box-shadow: none; padding: 0; }
  .handover { display: block; } .preview { background: none; padding: 0; display: block; }
  .receipt { border: 0; }
  body[data-print="sticker"] .receipt-block, body[data-print="receipt"] .sticker-block { display: none !important; }
  body[data-print="sticker"] .sticker-block h2, body[data-print="receipt"] .receipt-block h2 { display: none; }
  .sticker, .receipt { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
