/* =====================================================================
   MAGIC COPIEUR — Gestion de stock · feuille de style
   Mobile d'abord · tablette · ordinateur (barre latérale) · mode sombre
   ===================================================================== */
:root {
  /* Couleur principale (thème) : redéfinie par [data-accent] */
  --acc: #1565d8; --acc-1: #1d74ee; --acc-2: #0b46b5; --acc-3: #0a2f7a; --acc-n: #0f2a6b; --acc-dk: #4d94ff; --acc-tint: #e8f1ff; --accent-rgb: 21, 101, 216;
  --blue: var(--acc);
  --blue-1: var(--acc-1);
  --blue-2: var(--acc-2);
  --blue-3: var(--acc-3);
  --navy: var(--acc-n);
  --orange: #f57c00;
  --orange-2: #ff9a1f;
  --green: #16a34a;
  --green-2: #22c55e;
  --purple: #7c3aed;
  --purple-2: #a855f7;
  --red: #e11d48;
  --amber: #d97706;
  --teal: #0d9488;
  --pink: #db2777;

  --bg: #f2f5fb;
  --bg-2: #e8eef9;
  --card: #ffffff;
  --card-2: #f7f9fd;
  --ink: #0f1f45;
  --ink-2: #334166;
  --muted: #6b7a99;
  --line: #e3e9f4;
  --line-2: #d3dcec;
  --shadow: 0 1px 2px rgba(15, 42, 107, .05), 0 6px 18px -8px rgba(15, 42, 107, .16);
  --shadow-lg: 0 18px 40px -18px rgba(15, 42, 107, .35);
  --ring: 0 0 0 3px rgba(var(--accent-rgb), .22);

  --tint-blue: var(--acc-tint);
  --tint-green: #e7f8ee;
  --tint-orange: #fff1e3;
  --tint-red: #ffe9ee;
  --tint-purple: #f1eaff;
  --tint-amber: #fff6df;
  --tint-teal: #e2f7f4;

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --hdr: 64px;
  --nav: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: 'Poppins', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1222; --bg-2: #0f182d; --card: #131d35; --card-2: #182443; --ink: #e8eefc; --ink-2: #c3cde6;
    --muted: #8a97b6; --line: #22304f; --line-2: #2c3b5e; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 20px -10px rgba(0,0,0,.6);
    --blue: var(--acc-dk); --tint-blue: rgba(var(--accent-rgb), .2); --tint-green: rgba(22,163,74,.18); --tint-orange: rgba(245,124,0,.18);
    --tint-red: rgba(225,29,72,.18); --tint-purple: rgba(124,58,237,.2); --tint-amber: rgba(217,119,6,.2); --tint-teal: rgba(13,148,136,.2);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1222; --bg-2: #0f182d; --card: #131d35; --card-2: #182443; --ink: #e8eefc; --ink-2: #c3cde6;
  --muted: #8a97b6; --line: #22304f; --line-2: #2c3b5e; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 20px -10px rgba(0,0,0,.6);
  --blue: var(--acc-dk); --tint-blue: rgba(var(--accent-rgb), .2); --tint-green: rgba(22,163,74,.18); --tint-orange: rgba(245,124,0,.18);
  --tint-red: rgba(225,29,72,.18); --tint-purple: rgba(124,58,237,.2); --tint-amber: rgba(217,119,6,.2); --tint-teal: rgba(13,148,136,.2);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; min-height: 100vh; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
.svg-i { width: 1.25em; height: 1.25em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ------------------------------------------------------------------ Splash */
#splash { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: linear-gradient(160deg, #fff, #eaf2ff); transition: opacity .4s; }
#splash.out { opacity: 0; pointer-events: none; }
#splash .sp-in { text-align: center; animation: pop .6s cubic-bezier(.2, .9, .3, 1.3) both; }
#splash img { width: 132px; height: 132px; margin: 0 auto 12px; border-radius: 50%; box-shadow: 0 12px 34px -12px rgba(245, 124, 0, .7); }
#splash .bar { width: 120px; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 18px auto 0; }
#splash .bar i { display: block; width: 40%; height: 100%; background: linear-gradient(90deg, var(--blue), var(--orange)); border-radius: 4px; animation: load 1s ease-in-out infinite; }
@keyframes load { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

/* ------------------------------------------------------------------ Marque */
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: 40px; height: 40px; border-radius: 50%; object-fit: contain; }
.brand .bt { font-weight: 800; font-size: 19px; letter-spacing: -.02em; line-height: 1; }
.brand .bs { font-size: 11.5px; opacity: .85; margin-top: 2px; }
.wordmark { font-weight: 900; letter-spacing: -.03em; line-height: .92; }
.wordmark .w1 { color: var(--navy); }
.wordmark .w2 { color: var(--orange); }
:root[data-theme="dark"] .wordmark .w1 { color: #dbe6ff; }

/* ------------------------------------------------------------------ Connexion */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr; background: var(--card); }
.login-hero { position: relative; padding: 34px 22px 8px; text-align: center; background: linear-gradient(180deg, #fff 0%, #eef4ff 100%); overflow: hidden; }
:root[data-theme="dark"] .login-hero { background: linear-gradient(180deg, #131d35, #0f182d); }
.login-hero .logo-row { display: flex; align-items: center; justify-content: center; gap: 12px; animation: up .6s both; }
.login-hero .logo-row img { width: 118px; height: 118px; border-radius: 50%; box-shadow: 0 14px 34px -14px rgba(245, 124, 0, .75); animation: logoSpin 1s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes logoSpin { from { transform: rotate(-200deg) scale(.4); opacity: 0; } }
.login-hero .wordmark { font-size: 38px; text-align: left; }
.login-hero .tag { margin: 12px auto 4px; max-width: 320px; font-weight: 600; font-size: 14.5px; color: var(--ink-2); animation: up .6s .1s both; }
.login-hero .hero-img { margin: 10px auto 0; max-width: 380px; width: 100%; border-radius: 18px; mix-blend-mode: multiply; animation: up .7s .15s both; }
:root[data-theme="dark"] .login-hero .hero-img { mix-blend-mode: normal; border-radius: 18px; }
.login-acts { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 400px; margin: 14px auto 0; animation: up .6s .2s both; }
.login-acts div { display: grid; justify-items: center; align-content: start; gap: 5px; font-size: 12px; line-height: 1.3; color: var(--ink-2); padding: 4px; }
.login-acts div + div { border-left: 1px solid var(--line); }
.login-acts .svg-i { width: 30px; height: 30px; color: var(--blue); }
.login-card { position: relative; z-index: 2; margin: 16px; padding: 22px 18px 18px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-lg); border: 1px solid var(--line); max-width: 420px; width: calc(100% - 32px); justify-self: center; animation: up .6s .25s both; }
.login-card h1 { text-align: center; font-size: 22px; color: var(--navy); }
:root[data-theme="dark"] .login-card h1 { color: #fff; }
.login-card .sub { text-align: center; color: var(--blue); font-size: 12.5px; margin: 4px 0 18px; }
.login-foot { position: relative; text-align: center; color: #fff; padding: 46px 0 18px; margin-top: -30px; background: linear-gradient(170deg, transparent 0 34%, var(--blue) 34.5%, var(--blue-3)); }
.login-foot b { display: block; font-size: 15px; letter-spacing: .02em; }
.login-foot small { opacity: .7; font-size: 10.5px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 14px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
@media (min-width: 900px) {
  .login { grid-template-columns: 1.1fr 1fr; }
  .login-hero { display: flex; flex-direction: column; justify-content: center; padding: 40px; }
  .login-hero .hero-img { max-width: 520px; }
  .login-right { display: flex; flex-direction: column; justify-content: center; background: linear-gradient(160deg, var(--bg), var(--bg-2)); }
  .login-foot { margin-top: 0; background: none; color: var(--muted); padding: 10px; }
}

/* ------------------------------------------------------------------ Champs */
.field { position: relative; margin-bottom: 12px; }
.field > label, .lbl { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin: 0 0 5px 2px; }
.input, .select, .textarea {
  width: 100%; height: 48px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card);
  transition: border-color .15s, box-shadow .15s; outline: none; font-size: 14px;
}
.textarea { height: auto; min-height: 86px; padding: 12px 14px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7a99' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--blue); box-shadow: var(--ring); }
.input.err, .select.err { border-color: var(--red); }
.ic-field { position: relative; }
.ic-field > .svg-i:first-child { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.ic-field .input { padding-left: 44px; }
.ic-field .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center; color: var(--muted); border-radius: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; user-select: none; white-space: nowrap; }
.check input { width: 20px; height: 20px; accent-color: var(--blue); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); transition: .2s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }

/* ------------------------------------------------------------------ Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: 12px;
  font-weight: 600; font-size: 14.5px; transition: transform .12s, box-shadow .15s, background .15s, opacity .15s; white-space: nowrap; user-select: none;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--blue-1), var(--blue-2)); box-shadow: 0 8px 18px -8px rgba(var(--accent-rgb), .7); }
.btn-primary:hover { box-shadow: 0 10px 22px -8px rgba(var(--accent-rgb), .9); }
.btn-orange { color: #fff; background: linear-gradient(135deg, var(--orange-2), var(--orange)); box-shadow: 0 8px 18px -8px rgba(245, 124, 0, .7); }
.btn-green { color: #fff; background: linear-gradient(135deg, var(--green-2), var(--green)); box-shadow: 0 8px 18px -8px rgba(22, 163, 74, .7); }
.btn-red { color: #fff; background: linear-gradient(135deg, #f43f5e, var(--red)); }
.btn-outline { color: var(--blue); background: var(--card); border: 1.5px solid var(--line-2); }
.btn-outline:hover { border-color: var(--blue); }
.btn-ghost { color: var(--ink-2); background: var(--card-2); }
.btn-block { width: 100%; }
.btn-lg { height: 54px; font-size: 16px; border-radius: 14px; }
.btn-sm { height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn .spin { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: rot .7s linear infinite; }
.btn-outline .spin, .btn-ghost .spin { border-color: var(--line-2); border-top-color: var(--blue); }
@keyframes rot { to { transform: rotate(360deg); } }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; position: relative; transition: background .15s, transform .12s; }
.icon-btn:active { transform: scale(.92); }
.icon-btn .svg-i { width: 22px; height: 22px; }
.badge-dot { position: absolute; top: 5px; right: 5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--orange); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--blue); animation: pop .4s both; }

/* ------------------------------------------------------------------ Structure */
#app { min-height: 100vh; }
.shell { min-height: 100vh; display: flex; }
.sidebar { display: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; color: #fff; padding: calc(env(safe-area-inset-top, 0px)) 0 0;
  background: linear-gradient(120deg, var(--blue-1) 0%, var(--blue-2) 55%, var(--blue-3) 100%);
  box-shadow: 0 6px 18px -10px rgba(0, 0, 0, .35);
}
.topbar-in { height: var(--hdr); display: flex; align-items: center; gap: 6px; padding: 0 8px; }
.topbar .icon-btn:hover { background: rgba(255,255,255,.12); }
.topbar .brand { flex: 1; justify-content: center; }
.topbar .brand img { filter: drop-shadow(0 2px 8px rgba(0,0,0,.35)); }
.topbar .page-title { flex: 1; font-size: 18.5px; font-weight: 700; padding-left: 4px; }
.topbar .t-actions { display: flex; gap: 2px; }
.succ-bar { display: flex; gap: 8px; overflow-x: auto; padding: 0 12px 12px; scrollbar-width: none; }
.succ-bar::-webkit-scrollbar { display: none; }
.succ-chip { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 13px; border-radius: 99px; font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,.9); background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); transition: .2s; }
.succ-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c, #fff); box-shadow: 0 0 0 2px rgba(255,255,255,.5); }
.succ-chip.on { background: #fff; color: var(--blue-2); border-color: #fff; box-shadow: 0 6px 14px -6px rgba(0,0,0,.4); }
.succ-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; padding: 3px 10px; border-radius: 99px; background: rgba(255,255,255,.16); margin-top: 3px; }

.content { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 14px 14px calc(var(--nav) + var(--safe-b) + 26px); }
.page { animation: pageIn .35s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Barre de navigation basse */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--nav) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--card); border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px -16px rgba(15, 42, 107, .35);
}
.bn-item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 500; color: var(--muted); transition: color .2s; }
.bn-item .svg-i { width: 24px; height: 24px; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.bn-item.on { color: var(--blue); font-weight: 700; }
.bn-item.on .svg-i { transform: translateY(-2px) scale(1.08); }
.bn-item.on::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 4px 4px; background: linear-gradient(90deg, var(--blue), var(--orange)); animation: grow .3s both; }
@keyframes grow { from { transform: scaleX(0); } }

/* Tiroir de menu */
.drawer-bg { position: fixed; inset: 0; z-index: 60; background: rgba(8, 18, 45, .5); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .25s; }
.drawer-bg.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; z-index: 61; top: 0; bottom: 0; left: 0; width: min(320px, 86vw); background: var(--card); transform: translateX(-102%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.drawer.on { transform: none; }
.drawer-head { padding: calc(22px + env(safe-area-inset-top, 0px)) 18px 18px; color: #fff; background: linear-gradient(135deg, var(--blue), var(--blue-3)); position: relative; overflow: hidden; }
.drawer-head::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 180px; height: 180px; border-radius: 50%; border: 28px solid rgba(245, 124, 0, .55); }
.avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 17px; color: var(--blue-2); background: #fff; flex: none; }
.avatar.sm { width: 36px; height: 36px; font-size: 14px; }
.drawer-head .u-name { font-weight: 700; font-size: 16px; margin-top: 10px; position: relative; z-index: 1; }
.drawer-head .u-role { font-size: 12px; opacity: .85; position: relative; z-index: 1; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 10px 20px; }
.nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; margin: 16px 10px 6px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--ink-2); font-weight: 500; transition: background .15s, color .15s; }
.nav-link .svg-i { width: 21px; height: 21px; color: var(--muted); }
.nav-link:hover { background: var(--card-2); }
.nav-link.on { background: var(--tint-blue); color: var(--blue); font-weight: 700; }
.nav-link.on .svg-i { color: var(--blue); }
.nav-link .cnt { margin-left: auto; font-size: 11px; font-weight: 700; color: #fff; background: var(--orange); border-radius: 99px; padding: 1px 8px; }

/* Ordinateur : barre latérale fixe */
@media (min-width: 1024px) {
  .sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; width: 264px; flex: none; background: var(--card); border-right: 1px solid var(--line); }
  .sidebar .sb-brand { padding: 18px 18px 10px; }
  .sidebar .sb-brand img { width: 46px; height: 46px; }
  .sidebar .sb-brand .bt { color: var(--navy); font-size: 18px; }
  .sidebar .sb-brand .bt b { color: var(--orange); font-weight: 800; }
  :root[data-theme="dark"] .sidebar .sb-brand .bt { color: #fff; }
  .sidebar .sb-brand .bs { color: var(--muted); }
  .sidebar .drawer-body { padding-top: 0; }
  .sidebar .sb-user { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); }
  .bottom-nav, .topbar .menu-btn { display: none; }
  .topbar .brand { justify-content: flex-start; }
  .topbar .brand.home-brand { display: none; }
  .topbar-in { padding: 0 20px; height: 62px; }
  .succ-bar { padding: 0 20px 12px; }
  .content { padding: 22px 26px 40px; }
  .fab { bottom: 28px !important; right: 28px !important; }
}

/* ------------------------------------------------------------------ Cartes & sections */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid var(--line); }
.card-pad { padding: 16px; }
.sec { margin: 22px 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sec h2 { font-size: 18px; font-weight: 700; color: var(--navy); }
:root[data-theme="dark"] .sec h2 { color: #fff; }
.sec .more { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 600; color: var(--blue); }
.sec .more .svg-i { width: 16px; height: 16px; }
.page > .sec:first-child { margin-top: 4px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { font-size: 22px; font-weight: 800; color: var(--navy); }
:root[data-theme="dark"] .page-head h1 { color: #fff; }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

/* Carrousel */
.carousel { position: relative; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-lg); background: var(--card); aspect-ratio: 400 / 176; max-height: 300px; width: 100%; }
.car-track { display: flex; height: 100%; transition: transform .6s cubic-bezier(.65, 0, .35, 1); }
.car-slide { flex: 0 0 100%; height: 100%; position: relative; overflow: hidden; }
.car-slide > img { width: 100%; height: 100%; object-fit: cover; }
.car-dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 6px; z-index: 2; }
.car-dots button { width: 8px; height: 8px; border-radius: 99px; background: rgba(var(--accent-rgb), .35); transition: width .3s, background .3s; }
.car-dots button.on { width: 22px; background: var(--blue); }
.car-close { position: absolute; top: 6px; right: 6px; z-index: 3; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.9); color: var(--navy); }
.slide-g { height: 100%; padding: 18px 20px; display: flex; flex-direction: column; justify-content: center; color: #fff; position: relative; }
.slide-g h3 { font-size: clamp(19px, 5vw, 30px); font-weight: 800; line-height: 1.05; max-width: 70%; position: relative; z-index: 1; }
.slide-g p { margin: 8px 0 0; font-size: clamp(12px, 3.2vw, 15px); opacity: .92; max-width: 62%; position: relative; z-index: 1; }
.slide-g .s-ic { position: absolute; right: -10px; bottom: -14px; width: 46%; max-width: 230px; opacity: .95; }
.slide-g .s-ic .svg-i { width: 100%; height: auto; stroke-width: 1.2; opacity: .3; }
.slide-g img.s-photo { position: absolute; right: 0; top: 0; height: 100%; width: 46%; object-fit: cover; -webkit-mask-image: linear-gradient(90deg, transparent, #000 40%); mask-image: linear-gradient(90deg, transparent, #000 40%); }
.slide-g .chip-row { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; position: relative; z-index: 1; }
.slide-g .chip-row span { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: rgba(255,255,255,.2); backdrop-filter: blur(4px); }
.slide-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; max-width: 64%; position: relative; z-index: 1; }
.slide-stats b { display: block; font-size: clamp(16px, 4.6vw, 24px); font-weight: 800; }
.slide-stats small { font-size: 11px; opacity: .85; }

/* Tuiles KPI (maquette : Produits / Entrées / Sorties / Stock actuel) */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.kpi { text-align: center; padding: 12px 6px 11px; border-radius: var(--r); background: var(--tint); border: 1px solid color-mix(in srgb, var(--c) 14%, transparent); position: relative; overflow: hidden; transition: transform .2s; animation: up .45s both; }
.kpi:active { transform: scale(.96); }
.kpi .k-ic { width: 40px; height: 40px; margin: 0 auto 6px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(135deg, var(--c2), var(--c)); box-shadow: 0 6px 12px -6px var(--c); }
.kpi .k-ic .svg-i { width: 22px; height: 22px; }
.kpi .k-l { font-size: 11.5px; color: var(--ink-2); font-weight: 500; }
.kpi .k-v { font-size: 20px; font-weight: 800; color: var(--c); line-height: 1.15; }
.k-blue { --c: var(--blue); --c2: #4c94ff; --tint: var(--tint-blue); }
.k-green { --c: var(--green); --c2: #4ade80; --tint: var(--tint-green); }
.k-orange { --c: var(--orange); --c2: #ffb347; --tint: var(--tint-orange); }
.k-red { --c: var(--red); --c2: #fb7185; --tint: var(--tint-red); }
.k-purple { --c: var(--purple); --c2: #c084fc; --tint: var(--tint-purple); }
.k-teal { --c: var(--teal); --c2: #2dd4bf; --tint: var(--tint-teal); }
.k-amber { --c: var(--amber); --c2: #fbbf24; --tint: var(--tint-amber); }

/* Statistiques larges (CA, bénéfice…) */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { padding: 14px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); position: relative; overflow: hidden; animation: up .45s both; }
.stat::after { content: ""; position: absolute; right: -24px; top: -24px; width: 80px; height: 80px; border-radius: 50%; background: var(--tint); }
.stat .s-top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 500; position: relative; z-index: 1; }
.stat .s-top .svg-i { width: 18px; height: 18px; color: var(--c); }
.stat .s-v { font-size: 19px; font-weight: 800; margin-top: 6px; position: relative; z-index: 1; }
.stat .s-v small { font-size: 11px; font-weight: 600; color: var(--muted); }
.stat .s-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; position: relative; z-index: 1; }
.stat.hero { color: #fff; border: 0; background: linear-gradient(135deg, var(--c2), var(--c)); }
.stat.hero::after { background: rgba(255,255,255,.14); }
.stat.hero .s-top, .stat.hero .s-sub, .stat.hero .s-v small { color: rgba(255,255,255,.88); }
.stat.hero .s-top .svg-i { color: #fff; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }

/* Accès rapide (tuiles pleines colorées) */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.q-tile { aspect-ratio: 1 / 1; max-height: 120px; border-radius: var(--r); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 11.5px; font-weight: 600; text-align: center; padding: 6px; background: linear-gradient(145deg, var(--c2), var(--c)); box-shadow: 0 10px 18px -10px var(--c); transition: transform .18s, box-shadow .18s; position: relative; overflow: hidden; animation: up .45s both; }
.q-tile::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 80% 0, rgba(255,255,255,.35), transparent 50%); }
.q-tile .svg-i { width: 34px; height: 34px; stroke-width: 1.8; position: relative; }
.q-tile span { position: relative; line-height: 1.15; }
.q-tile:hover { transform: translateY(-3px); box-shadow: 0 16px 24px -12px var(--c); }
.q-tile:active { transform: scale(.95); }

/* Nos services (cartes photo) */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.svc { border-radius: var(--r); overflow: hidden; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .2s; animation: up .45s both; }
.svc:hover { transform: translateY(-3px); }
.svc img { width: 100%; aspect-ratio: 122 / 67; object-fit: cover; }
.svc div { padding: 8px 6px 10px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--navy); line-height: 1.25; }
:root[data-theme="dark"] .svc div { color: #fff; }
.svc.off { filter: grayscale(1); opacity: .55; }
.svc.off div::after { content: "Non exercé ici"; display: block; font-size: 10.5px; font-weight: 500; color: var(--muted); }

/* Fonctionnalités principales (grille d'icônes) */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.feat { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px 4px 10px; border-radius: var(--r); background: var(--tint); text-align: center; font-size: 11px; font-weight: 500; color: var(--ink-2); line-height: 1.2; min-height: 84px; transition: transform .18s, box-shadow .18s; animation: up .45s both; }
.feat .svg-i { width: 30px; height: 30px; color: var(--c); stroke-width: 2; }
.feat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.feat:active { transform: scale(.95); }
@media (min-width: 720px) { .features { grid-template-columns: repeat(8, 1fr); } .quick { grid-template-columns: repeat(4, 1fr); max-width: 760px; } }

/* Onglets (filtres de type) */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; height: 36px; padding: 0 15px; border-radius: 99px; font-size: 13px; font-weight: 500; color: var(--ink-2); background: var(--card); border: 1px solid var(--line); transition: .2s; display: inline-flex; align-items: center; gap: 6px; }
.tab .c { font-size: 11px; font-weight: 700; color: var(--muted); }
.tab.on { color: #fff; background: linear-gradient(135deg, var(--blue-1), var(--blue-2)); border-color: transparent; box-shadow: 0 6px 14px -8px rgba(var(--accent-rgb), .8); font-weight: 600; }
.tab.on .c { color: rgba(255,255,255,.8); }
.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); gap: 2px; }
.seg button { height: 32px; padding: 0 12px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--muted); transition: .2s; }
.seg button.on { background: var(--card); color: var(--blue); box-shadow: var(--shadow); }

/* Recherche */
.search-row { display: flex; gap: 10px; margin: 12px 0; }
.search { position: relative; flex: 1; }
.search .svg-i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; height: 48px; border-radius: 14px; border: 1px solid var(--line); background: var(--card-2); padding: 0 14px 0 44px; outline: none; transition: .15s; }
.search input:focus { border-color: var(--blue); background: var(--card); box-shadow: var(--ring); }
.sq-btn { width: 48px; height: 48px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--card-2); border: 1px solid var(--line); color: var(--navy); position: relative; }
:root[data-theme="dark"] .sq-btn { color: #fff; }
.sq-btn.on { background: var(--tint-blue); color: var(--blue); border-color: var(--blue); }

/* Liste produits (maquette : écran « Produits en stock ») */
.plist { display: grid; gap: 10px; }
@media (min-width: 760px) { .plist { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) { .plist { grid-template-columns: repeat(3, 1fr); } }
.pcard { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s; animation: up .4s both; position: relative; }
.pcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.pcard:active { transform: scale(.985); }
.pthumb { width: 96px; height: 84px; flex: none; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, var(--card-2), var(--bg-2)); display: grid; place-items: center; color: var(--muted); }
.pthumb img { width: 100%; height: 100%; object-fit: cover; }
.pthumb .svg-i { width: 34px; height: 34px; stroke-width: 1.5; opacity: .6; }
.pthumb.sm { width: 52px; height: 52px; border-radius: 10px; }
.pthumb.sm .svg-i { width: 24px; height: 24px; }
.pinfo { flex: 1; min-width: 0; display: grid; gap: 5px; }
.pinfo .pn { font-weight: 600; font-size: 14.5px; color: var(--navy); line-height: 1.25; }
:root[data-theme="dark"] .pinfo .pn { color: #fff; }
.pinfo .pm { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pprice { font-weight: 700; color: var(--blue); white-space: nowrap; font-size: 14.5px; }
.pcard .chev { color: var(--muted); }

/* Pastilles */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 8px; font-size: 11.5px; font-weight: 600; white-space: nowrap; width: fit-content; }
.chip .svg-i { width: 13px; height: 13px; }
.c-blue { background: var(--tint-blue); color: var(--blue); }
.c-green { background: var(--tint-green); color: var(--green); }
.c-orange { background: var(--tint-orange); color: var(--orange); }
.c-red { background: var(--tint-red); color: var(--red); }
.c-purple { background: var(--tint-purple); color: var(--purple); }
.c-amber { background: var(--tint-amber); color: var(--amber); }
.c-teal { background: var(--tint-teal); color: var(--teal); }
.c-gray { background: var(--card-2); color: var(--muted); border: 1px solid var(--line); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--c, var(--blue)); flex: none; }

/* Listes génériques */
.list { display: grid; gap: 8px; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .15s; animation: up .35s both; color: inherit; }
a.li:hover, button.li:hover { transform: translateY(-1px); }
.li-ic { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--tint, var(--tint-blue)); color: var(--c, var(--blue)); }
.li-ic .svg-i { width: 21px; height: 21px; }
.li-main { flex: 1; min-width: 0; text-align: left; }
.li-t { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.li-s { font-size: 12px; color: var(--muted); margin-top: 1px; }
.li-r { text-align: right; flex: none; }
.li-r b { display: block; font-size: 14px; }
.list-flat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.list-flat .li { border: 0; border-radius: 0; box-shadow: none; animation: none; }
.list-flat .li + .li { border-top: 1px solid var(--line); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--muted); }
.kv b { text-align: right; }

/* Tableaux */
.table-wrap { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 11px 12px; background: var(--card-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: var(--card-2); }
.tbl .r { text-align: right; }
.tbl tfoot td { font-weight: 700; background: var(--card-2); border-top: 1px solid var(--line-2); }

/* Bouton flottant */
.fab { position: fixed; right: 18px; bottom: calc(var(--nav) + var(--safe-b) + 16px); z-index: 35; width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--blue-1), var(--blue-2)); box-shadow: 0 14px 26px -10px rgba(var(--accent-rgb), .9); transition: transform .2s; animation: pop .5s .2s both; }
.fab .svg-i { width: 30px; height: 30px; stroke-width: 2.4; }
.fab:hover { transform: rotate(90deg) scale(1.05); }
.fab::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--blue); animation: ping 2.4s 1s infinite; }
@keyframes ping { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(1.5); opacity: 0; } }

/* Feuille modale (bas d'écran sur mobile, centrée sur ordinateur) */
.sheet-bg { position: fixed; inset: 0; z-index: 80; background: rgba(8, 18, 45, .55); backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s both; }
.sheet { width: 100%; max-width: 560px; max-height: 92vh; display: flex; flex-direction: column; background: var(--card); border-radius: 24px 24px 0 0; box-shadow: var(--shadow-lg); animation: sheetUp .32s cubic-bezier(.2, .9, .3, 1) both; padding-bottom: var(--safe-b); }
.sheet.wide { max-width: 760px; }
.sheet-h { display: flex; align-items: center; gap: 10px; padding: 16px 16px 10px; position: relative; }
.sheet-h::before { content: ""; position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--line-2); }
.sheet-h h3 { flex: 1; font-size: 17px; font-weight: 700; }
.sheet-b { padding: 4px 16px 16px; overflow-y: auto; flex: 1; }
.sheet-f { padding: 12px 16px 16px; display: flex; gap: 10px; border-top: 1px solid var(--line); }
.sheet-f .btn { flex: 1; }
.sheet-bg.closing { animation: fadeOut .2s both; }
.sheet-bg.closing .sheet { animation: sheetDown .22s both; }
@media (min-width: 720px) {
  .sheet-bg { align-items: center; padding: 20px; }
  .sheet { border-radius: 22px; animation-name: popIn; }
  .sheet-bg.closing .sheet { animation-name: popOut; }
  .sheet-h::before { display: none; }
}
@keyframes sheetUp { from { transform: translateY(100%); } }
@keyframes sheetDown { to { transform: translateY(100%); } }
@keyframes popIn { from { transform: scale(.94); opacity: 0; } }
@keyframes popOut { to { transform: scale(.94); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes up { from { opacity: 0; transform: translateY(12px); } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } }

/* Notifications toast */
#toasts { position: fixed; z-index: 120; left: 50%; top: calc(12px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100% - 24px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-lg); animation: toastIn .35s cubic-bezier(.2, .9, .3, 1.2) both; pointer-events: auto; }
:root[data-theme="dark"] .toast { background: #26385f; }
.toast .svg-i { width: 20px; height: 20px; flex: none; }
.toast.ok .svg-i { color: #4ade80; }
.toast.err { background: #b4123a; }
.toast.out { animation: toastOut .3s both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-12px); } }

/* Squelettes de chargement */
.sk { position: relative; overflow: hidden; background: var(--card-2); border-radius: 12px; }
.sk::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); animation: shim 1.2s infinite; }
:root[data-theme="dark"] .sk::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); }
@keyframes shim { to { transform: translateX(100%); } }

/* État vide */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .e-ic { width: 76px; height: 76px; margin: 0 auto 12px; border-radius: 24px; display: grid; place-items: center; background: var(--tint-blue); color: var(--blue); animation: pop .5s both; }
.empty .e-ic .svg-i { width: 36px; height: 36px; }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* Graphiques */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart-box { width: 100%; }
.chart text { font-family: var(--font); fill: var(--muted); font-size: 10px; }
.chart .grid line { stroke: var(--line); stroke-dasharray: 3 4; }
.chart .area { animation: fade .8s both; }
.chart .line { stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: draw 1.4s .1s ease-out forwards; }
.chart .bar { transform-box: fill-box; transform-origin: bottom; animation: barUp .7s cubic-bezier(.2, .8, .2, 1) both; }
.chart .pt { opacity: 0; animation: fade .3s 1.2s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes barUp { from { transform: scaleY(0); } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.donut-wrap { display: flex; align-items: center; gap: 16px; }
.donut-wrap svg { width: 132px; height: 132px; flex: none; }
.donut-wrap .seg-arc { animation: fade .6s both; }
.bars-h { display: grid; gap: 10px; }
.bar-h .bh-top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 4px; gap: 10px; }
.bar-h .bh-track { height: 9px; border-radius: 9px; background: var(--card-2); overflow: hidden; }
.bar-h .bh-fill { height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--c2, var(--c)), var(--c)); transform-origin: left; animation: growX .9s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes growX { from { transform: scaleX(0); } }

/* Point de vente */
.pos { display: grid; gap: 14px; }
@media (min-width: 1024px) { .pos { grid-template-columns: 1fr 400px; align-items: start; } .pos .cart-col { position: sticky; top: 140px; } }
.pgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .pgrid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .pgrid { grid-template-columns: repeat(4, 1fr); } }
.ptile { position: relative; text-align: left; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; transition: transform .15s, border-color .15s; animation: up .35s both; display: flex; flex-direction: column; }
.ptile:active { transform: scale(.96); }
.ptile:hover { border-color: var(--blue); }
.ptile .pt-img { aspect-ratio: 4 / 3; background: linear-gradient(135deg, var(--card-2), var(--bg-2)); display: grid; place-items: center; color: var(--muted); }
.ptile .pt-img img { width: 100%; height: 100%; object-fit: cover; }
.ptile .pt-img .svg-i { width: 36px; height: 36px; stroke-width: 1.4; opacity: .55; }
.ptile .pt-b { padding: 8px 10px 10px; display: grid; gap: 3px; flex: 1; }
.ptile .pt-n { font-size: 12.5px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 31px; }
.ptile .pt-p { font-size: 13px; font-weight: 700; color: var(--blue); }
.ptile .pt-q { position: absolute; top: 8px; left: 8px; }
.ptile .in-cart { position: absolute; top: 8px; right: 8px; min-width: 26px; height: 26px; border-radius: 99px; background: var(--orange); color: #fff; font-weight: 700; font-size: 12px; display: grid; place-items: center; padding: 0 7px; animation: pop .3s both; box-shadow: 0 4px 10px -4px var(--orange); }
.ptile.dis { opacity: .5; }
.cart { padding: 14px; }
.cart-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); animation: up .25s both; }
.cart-line:last-child { border-bottom: 0; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; flex: none; }
.qty button { width: 32px; height: 32px; display: grid; place-items: center; color: var(--blue); background: var(--card-2); }
.qty button .svg-i { width: 16px; height: 16px; }
.qty input { width: 42px; height: 32px; text-align: center; border: 0; background: var(--card); outline: none; font-weight: 600; }
.total-box { margin-top: 10px; padding: 14px; border-radius: 14px; background: linear-gradient(135deg, var(--blue), var(--blue-3)); color: #fff; }
.total-box .tb-v { font-size: 26px; font-weight: 800; }
.pay-modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pay-mode { height: 58px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--ink-2); transition: .15s; }
.pay-mode i { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: #fff; font-style: normal; font-size: 10px; font-weight: 800; background: var(--c); }
.pay-mode.on { border-color: var(--blue); background: var(--tint-blue); color: var(--blue); box-shadow: var(--ring); }
.cart-bar { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav) + var(--safe-b) + 10px); z-index: 36; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 18px; color: #fff; background: linear-gradient(135deg, var(--navy), var(--blue-2)); box-shadow: var(--shadow-lg); animation: sheetUp .35s both; }
.cart-bar .cb-n { font-size: 12px; opacity: .85; }
.cart-bar .cb-t { font-size: 18px; font-weight: 800; }
@media (min-width: 1024px) { .cart-bar { display: none; } }

/* Reçu */
.receipt { max-width: 380px; margin: 0 auto; background: var(--card); border-radius: 18px; padding: 22px 18px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); position: relative; }
.receipt::after { content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px; background: radial-gradient(circle at 10px -2px, transparent 10px, var(--card) 10.5px) 0 0 / 20px 10px repeat-x; }
.rc-head { text-align: center; border-bottom: 1px dashed var(--line-2); padding-bottom: 12px; margin-bottom: 10px; }
.rc-head img { width: 54px; margin: 0 auto 6px; }
.rc-line { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 4px 0; }
.rc-tot { border-top: 1px dashed var(--line-2); margin-top: 8px; padding-top: 8px; }
.ok-badge { width: 70px; height: 70px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--green-2), var(--green)); box-shadow: 0 0 0 10px var(--tint-green); animation: pop .5s cubic-bezier(.2, .9, .3, 1.5) both; }
.ok-badge .svg-i { width: 36px; height: 36px; stroke-width: 3; }

/* Statuts d'intervention : frise */
.steps { display: flex; gap: 4px; margin: 8px 0 4px; }
.steps i { flex: 1; height: 5px; border-radius: 4px; background: var(--line); transition: background .3s; }
.steps i.on { background: linear-gradient(90deg, var(--blue), var(--c, var(--blue))); }
.kanban { display: grid; gap: 10px; }

/* Bilan par succursale (admin) */
.branch-card { border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; animation: up .4s both; }
.branch-card .bc-h { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: #fff; background: linear-gradient(120deg, color-mix(in srgb, var(--c) 82%, #fff), var(--c)); }
.branch-card .bc-h h3 { font-size: 16px; font-weight: 700; flex: 1; }
.branch-card .bc-h .bc-ca { text-align: right; }
.branch-card .bc-h .bc-ca b { display: block; font-size: 18px; }
.branch-card .bc-h .bc-ca small { opacity: .85; font-size: 11px; }
.bc-grid { display: grid; grid-template-columns: repeat(2, 1fr); }
.bc-cell { padding: 12px 16px; border-top: 1px solid var(--line); }
.bc-cell:nth-child(odd) { border-right: 1px solid var(--line); }
.bc-cell .bl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.bc-cell .bl .svg-i { width: 14px; height: 14px; color: var(--c); }
.bc-cell .bv { font-size: 16px; font-weight: 700; margin-top: 2px; }
.bc-cell .bs { font-size: 11.5px; color: var(--muted); }
.cards-3 { display: grid; gap: 14px; }
@media (min-width: 900px) { .cards-3 { grid-template-columns: repeat(3, 1fr); } }
.cols-2 { display: grid; gap: 14px; }
@media (min-width: 900px) { .cols-2 { grid-template-columns: 1fr 1fr; } .cols-2-1 { grid-template-columns: 2fr 1fr; } }

/* Bandeau hors ligne */
.offline { position: fixed; left: 0; right: 0; top: 0; z-index: 110; text-align: center; font-size: 12px; font-weight: 600; padding: 4px; color: #fff; background: var(--red); transform: translateY(-100%); transition: transform .3s; }
.offline.on { transform: none; }

/* Impression (tickets, rapports) */
#print-area { display: none; }
@media print {
  @page { margin: 8mm; }
  body { background: #fff !important; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; color: #000; font: 12px/1.4 'Segoe UI', Arial, sans-serif; }
  #print-area.ticket { width: 72mm; margin: 0 auto; }
  #print-area h2 { font-size: 15px; }
  #print-area table { width: 100%; border-collapse: collapse; }
  #print-area td, #print-area th { padding: 3px 2px; border-bottom: 1px dashed #999; text-align: left; font-size: 11px; }
  #print-area .r { text-align: right; }
  #print-area .c { text-align: center; }
  #print-area hr { border: 0; border-top: 1px dashed #000; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Petits écrans */
@media (max-width: 380px) {
  .kpi .k-v { font-size: 17px; }
  .kpi .k-ic { width: 34px; height: 34px; }
  .q-tile { font-size: 10.5px; }
  .q-tile .svg-i { width: 28px; height: 28px; }
  .feat { font-size: 10px; }
  .pthumb { width: 78px; height: 72px; }
}
.svg-i.big { width: 72px; height: 72px; stroke-width: 1.2; opacity: .45; }
.pos > div, .cols-2 > *, .cards-3 > *, .main, .content > .page { min-width: 0; }
.sheet-f .btn { min-width: 0; padding: 0 10px; }
body:has(.cart-bar) .content { padding-bottom: calc(var(--nav) + var(--safe-b) + 100px); }
@media (min-width: 1024px) { body:has(.cart-bar) .content { padding-bottom: 40px; } }
#hdr-actions { display: flex; align-items: center; gap: 2px; }
.topbar .t-actions { align-items: center; }
/* Photos détourées (PNG transparents) : affichées entières */
.pthumb img[src$=".png"], .ptile .pt-img img[src$=".png"] { object-fit: contain; padding: 4px; }
.slide-g img.s-copier { position: absolute; right: 2%; bottom: -6%; height: 112%; width: auto; filter: drop-shadow(0 14px 18px rgba(0,0,0,.35)); animation: floatIn .8s cubic-bezier(.2,.8,.2,1) both; }
@keyframes floatIn { from { opacity: 0; transform: translateX(30px) scale(.94); } }
