/* ==========================================================================
   AVENIX COMMERCE — Design system
   Palette, typographie, composants de base
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');

:root {
  --blue: #2563EB;
  --blue-dark: #1D4ED8;
  --blue-ink: #1E3A8A;
  --navy: #101827;
  --navy-soft: #182235;
  --pale: #EFF6FF;
  --pale-strong: #DBEAFE;
  --bg: #F8FAFC;
  --white: #FFFFFF;
  --green: #16A34A;
  --green-pale: #F0FDF4;
  --orange: #F59E0B;
  --orange-pale: #FFFBEB;
  --red: #DC2626;
  --red-pale: #FEF2F2;
  --violet: #7C3AED;
  --text: #1E293B;
  --text-soft: #475569;
  --muted: #64748B;
  --muted-light: #94A3B8;
  --line: #E2E8F0;
  --line-strong: #CBD5E1;
  --surface: #FFFFFF;
  --surface-soft: #F8FAFC;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Manrope', 'DM Sans', sans-serif;
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-sm: 0 4px 14px rgba(15, 23, 42, .05);
  --shadow: 0 12px 34px rgba(15, 23, 42, .08);
  --shadow-lg: 0 24px 70px rgba(15, 23, 42, .14);
  --sidebar-w: 258px;
  --header-h: 76px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--text);
  margin: 0;
  line-height: 1.22;
  letter-spacing: -.03em;
}
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
svg.lucide { width: 18px; height: 18px; stroke-width: 1.9; flex-shrink: 0; }
::selection { background: var(--pale-strong); color: var(--blue-ink); }

:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .22);
  outline-offset: 2px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border: 3px solid var(--bg); border-radius: 20px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

.container { width: min(1240px, calc(100% - 48px)); margin-inline: auto; }
.container-narrow { width: min(880px, calc(100% - 48px)); margin-inline: auto; }
.section { padding: 76px 0; }
.section-sm { padding: 48px 0; }
.section-tint { background: var(--white); border-block: 1px solid var(--line); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
.section-heading h2 { font-size: clamp(25px, 3vw, 34px); font-weight: 800; }
.section-heading p { color: var(--muted); font-size: 14px; margin-top: 7px; max-width: 560px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--blue); font-size: 11px; font-weight: 800;
  letter-spacing: .14em; text-transform: uppercase; margin-bottom: 10px;
}
.eyebrow::before { content: ''; width: 18px; height: 2px; background: var(--blue); border-radius: 2px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.text-blue { color: var(--blue); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-orange { color: var(--orange); }
.text-center { text-align: center; }
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--white); color: var(--text);
  font-size: 13.5px; font-weight: 700; line-height: 1;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
  white-space: nowrap;
}
.btn:hover { border-color: #B6C2D3; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 8px 18px rgba(37,99,235,.18); }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); box-shadow: 0 12px 24px rgba(37,99,235,.24); }
.btn-dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-dark:hover { background: #1B2639; border-color: #1B2639; }
.btn-soft { background: var(--pale); border-color: var(--pale-strong); color: var(--blue); }
.btn-soft:hover { background: #E4EEFF; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: #F1F5F9; border-color: transparent; }
.btn-white { background: #fff; border-color: #fff; color: var(--navy); }
.btn-danger { background: var(--red-pale); border-color: #FECACA; color: var(--red); }
.btn-danger:hover { background: #FEE2E2; }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover { background: #15803D; border-color: #15803D; }
.btn-sm { min-height: 36px; padding: 0 13px; font-size: 12px; border-radius: 9px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; padding: 0; }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }
.link-arrow { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13px; color: var(--blue); }
.link-arrow svg { width: 16px; transition: transform .18s ease; }
.link-arrow:hover svg { transform: translateX(3px); }

/* ---------------- Badges & status ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 30px;
  background: #F1F5F9; color: #475569;
  font-size: 10.5px; font-weight: 800; letter-spacing: .01em; white-space: nowrap;
}
.badge svg { width: 12px; height: 12px; }
.badge-blue, .badge.info { background: var(--pale); color: var(--blue); }
.badge-green, .badge.success { background: var(--green-pale); color: #15803D; }
.badge-orange, .badge.warning { background: var(--orange-pale); color: #B45309; }
.badge-red, .badge.danger { background: var(--red-pale); color: var(--red); }
.badge-violet { background: #F5F3FF; color: #6D28D9; }
.badge-navy { background: #EEF2F7; color: var(--navy); }
.badge-dark { background: var(--navy); color: #fff; }
.badge-outline { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.dot-live { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------------- Forms ---------------- */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field label, .field-label { font-size: 11.5px; font-weight: 800; color: var(--text-soft); letter-spacing: .01em; }
.field label span { color: var(--red); }
.input, .select, .textarea,
.field input, .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 10px 13px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--white); color: var(--text); font-size: 13.5px;
  outline: none; transition: border-color .18s ease, box-shadow .18s ease;
}
.field textarea, .textarea { min-height: 100px; resize: vertical; line-height: 1.55; }
.input::placeholder, .field input::placeholder, .field textarea::placeholder { color: var(--muted-light); }
.input:focus, .select:focus, .textarea:focus,
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--blue); box-shadow: 0 0 0 4px rgba(37,99,235,.10);
}
.field-hint { font-size: 10.5px; color: var(--muted); }
.field-error { font-size: 10.5px; color: var(--red); display: none; }
.field.has-error input, .field.has-error select { border-color: var(--red); }
.field.has-error .field-error { display: block; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.field.full { grid-column: 1 / -1; }
.check {
  display: flex; align-items: flex-start; gap: 10px; font-size: 12.5px; color: var(--text-soft);
  cursor: pointer; line-height: 1.5;
}
.check input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--blue); flex-shrink: 0; }
.search-box {
  position: relative; display: flex; align-items: center;
}
.search-box svg { position: absolute; left: 13px; color: var(--muted); width: 17px; height: 17px; pointer-events: none; }
.search-box input { padding-left: 40px; }

/* ---------------- Misc base components ---------------- */
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
  background: var(--pale); color: var(--blue);
  font-weight: 800; font-size: 13px; letter-spacing: -.02em;
}
.avatar-lg { width: 62px; height: 62px; font-size: 20px; }
.avatar-sm { width: 30px; height: 30px; font-size: 10px; }
.avatar-xl { width: 88px; height: 88px; font-size: 27px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { border: 2px solid #fff; margin-left: -9px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; font-size: 12px; color: var(--muted); }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb svg { width: 13px; height: 13px; color: var(--muted-light); }

.rating { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; }
.stars { display: inline-flex; gap: 1px; color: #F59E0B; }
.stars svg { width: 13px; height: 13px; fill: #F59E0B; stroke: #F59E0B; }
.stars .off { color: #E2E8F0; fill: #E2E8F0; stroke: #E2E8F0; }
.rating span { color: var(--muted); font-weight: 500; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  padding: 12px 16px; font-size: 13px; font-weight: 700; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
  transition: color .18s ease, border-color .18s ease;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--blue); border-color: var(--blue); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.pagination button {
  min-width: 40px; height: 40px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; font-size: 12.5px; font-weight: 700; color: var(--text-soft);
  transition: .18s ease;
}
.pagination button:hover { border-color: var(--blue); color: var(--blue); }
.pagination button.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.pagination button:disabled { opacity: .4; pointer-events: none; }
.pagination svg { width: 15px; }

.empty-state { text-align: center; padding: 58px 24px; color: var(--muted); }
.empty-state .empty-icon {
  width: 64px; height: 64px; border-radius: 18px; background: var(--pale);
  color: var(--blue); display: grid; place-items: center; margin: 0 auto 16px;
}
.empty-state .empty-icon svg { width: 27px; height: 27px; }
.empty-state h3 { font-size: 17px; margin-bottom: 6px; }
.empty-state p { font-size: 13px; max-width: 360px; margin: 0 auto 18px; }

.progress-bar { height: 7px; border-radius: 20px; background: #EDF1F6; overflow: hidden; }
.progress-bar span { display: block; height: 100%; border-radius: 20px; background: var(--blue); transition: width .3s ease; }
.progress-bar.green span { background: var(--green); }
.progress-bar.orange span { background: var(--orange); }

.accordion { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.accordion + .accordion { margin-top: 10px; }
.accordion-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 20px; text-align: left; font-weight: 700; font-size: 14px; color: var(--text);
}
.accordion-head svg { width: 18px; color: var(--muted); transition: transform .2s ease; }
.accordion.open .accordion-head svg { transform: rotate(180deg); color: var(--blue); }
.accordion-body { max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.accordion.open .accordion-body { max-height: 520px; }
.accordion-body p { padding: 0 20px 20px; font-size: 13.5px; color: var(--muted); line-height: 1.7; }

/* ---------------- Toast ---------------- */
.toast-area { position: fixed; right: 24px; bottom: 24px; z-index: 200; display: grid; gap: 10px; width: min(370px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: 12px;
  background: var(--navy); color: #fff; box-shadow: var(--shadow-lg);
  font-size: 12.5px; line-height: 1.5;
  animation: toast-in .28s cubic-bezier(.2,.8,.2,1);
  border-left: 3px solid #60A5FA;
}
.toast.success { border-left-color: #4ADE80; }
.toast.error { border-left-color: #F87171; }
.toast.warning { border-left-color: #FBBF24; }
.toast svg { width: 18px; height: 18px; color: #93C5FD; flex-shrink: 0; margin-top: 1px; }
.toast.success svg { color: #86EFAC; }
.toast.error svg { color: #FCA5A5; }
.toast.warning svg { color: #FCD34D; }
.toast strong { display: block; font-size: 12.5px; }
.toast span { color: #C7D2E3; font-size: 11.5px; display: block; margin-top: 2px; }
.toast button { margin-left: auto; color: #94A3B8; padding: 0; }
.toast button:hover { color: #fff; }
.toast button svg { width: 15px; height: 15px; color: inherit; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------------- Modal ---------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 150;
  display: none; align-items: center; justify-content: center;
  padding: 24px; background: rgba(10, 18, 32, .55);
  backdrop-filter: blur(4px);
}
.modal-backdrop.open { display: flex; animation: fade-in .18s ease; }
.modal {
  width: min(600px, 100%); max-height: 90vh; overflow: auto;
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  animation: modal-in .22s cubic-bezier(.2,.8,.2,1);
}
.modal-lg { width: min(880px, 100%); }
.modal-sm { width: min(440px, 100%); }
.modal-head {
  padding: 20px 24px; border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  position: sticky; top: 0; background: #fff; z-index: 2; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.modal-head h3 { font-size: 18px; font-weight: 800; }
.modal-head p { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.modal-close { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); background: #F8FAFC; border: 1px solid var(--line); flex-shrink: 0; }
.modal-close:hover { background: #F1F5F9; color: var(--text); }
.modal-close svg { width: 16px; }
.modal-body { padding: 24px; }
.modal-foot {
  padding: 16px 24px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap;
  position: sticky; bottom: 0; background: #fff;
}
.modal-foot .spread { margin-right: auto; }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------------- Timeline ---------------- */
.timeline { position: relative; display: grid; gap: 0; }
.timeline-item { display: flex; gap: 14px; position: relative; padding-bottom: 22px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ''; position: absolute; left: 13px; top: 28px; bottom: 0; width: 1px; background: var(--line);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center;
  background: #F1F5F9; color: var(--muted); border: 1px solid var(--line); flex-shrink: 0; z-index: 1;
}
.timeline-dot svg { width: 12px; height: 12px; }
.timeline-item.done .timeline-dot { background: var(--green-pale); border-color: #BBF7D0; color: var(--green); }
.timeline-item.current .timeline-dot { background: var(--pale); border-color: #BFDBFE; color: var(--blue); box-shadow: 0 0 0 4px rgba(37,99,235,.08); }
.timeline-copy b { display: block; font-size: 12.5px; font-weight: 700; }
.timeline-copy small { display: block; font-size: 10.5px; color: var(--muted); margin-top: 3px; }

/* ---------------- Dropdown ---------------- */
.dropdown { position: relative; }
.dropdown-panel {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 80;
  min-width: 290px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 8px; display: none;
}
.dropdown.open .dropdown-panel { display: block; animation: fade-in .15s ease; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 11px; border-radius: 8px; font-size: 12.5px; color: var(--text-soft); text-align: left;
}
.dropdown-item:hover { background: #F8FAFC; color: var(--text); }
.dropdown-item svg { width: 15px; height: 15px; color: var(--muted); }
.dropdown-item.danger { color: var(--red); }
.dropdown-item.danger svg { color: var(--red); }
.dropdown-sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* ---------------- Print ---------------- */
.print-only { display: none; }
@media print {
  body { background: #fff !important; }
  .no-print, .store-header, .store-footer, .admin-sidebar, .admin-topbar, .toast-area, .modal-close, .modal-foot { display: none !important; }
  .modal-backdrop { position: static; display: block !important; padding: 0; background: #fff; }
  .modal { box-shadow: none; max-height: none; width: 100%; }
  .print-only { display: block; }
  .print-document { padding: 0 !important; }
}
