/* ============================================================
   L'Atelier de la Pudeur — Design system
   ============================================================ */
@font-face { font-family: 'Playfair'; src: url('../vendor/fonts/playfair-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Playfair'; src: url('../vendor/fonts/playfair-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Jakarta'; src: url('../vendor/fonts/jakarta-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Jakarta'; src: url('../vendor/fonts/jakarta-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Jakarta'; src: url('../vendor/fonts/jakarta-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Jakarta'; src: url('../vendor/fonts/jakarta-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --bg: #f7f4f0;
  --card: #ffffff;
  --line: #ece5dd;
  --line-2: #f3eee8;
  --ink: #2a2521;
  --ink-2: #4c4540;
  --muted: #8d837a;
  --side: #2e2b28;
  --side-2: #3b3734;
  --side-ink: #d9d3cd;
  --accent: #b4532a;
  --accent-d: #973f1c;
  --accent-soft: #f9ebe3;
  --green: #1d8a59;
  --green-soft: #e2f4ea;
  --amber: #b97b0c;
  --amber-soft: #fdf2d9;
  --red: #c23b2c;
  --red-soft: #fce6e2;
  --blue: #4767a0;
  --blue-soft: #e6edf9;
  --gold: #8a6d1d;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(42, 37, 33, .04), 0 4px 16px rgba(42, 37, 33, .04);
  --shadow-lg: 0 20px 60px rgba(42, 37, 33, .18);
  --serif: 'Playfair', Georgia, 'Times New Roman', serif;
  --sans: 'Jakarta', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --side-w: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--sans); font-size: 14px; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-d); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
.serif { font-family: var(--serif); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.xs { font-size: 11px; }
.bold { font-weight: 700; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-amber { color: var(--amber); }
.text-accent { color: var(--accent); }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; }
.mono { font-family: Consolas, 'SF Mono', monospace; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--side-w); background: var(--side); color: var(--side-ink);
  position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 40;
  transition: transform .25s ease;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 18px; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand-logo { width: 38px; height: 38px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; font-family: var(--serif); font-size: 17px; font-weight: 600; flex-shrink: 0; }
.brand-name { font-family: var(--serif); font-size: 16px; color: #fff; line-height: 1.15; }
.brand-sub { font-size: 11px; color: #a49c94; display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.brand-sub::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.side-cta { margin: 18px 16px 10px; }
.side-cta .btn { width: 100%; justify-content: center; padding: 11px; }
.side-label { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #8a827b; padding: 14px 22px 6px; }
.nav { list-style: none; margin: 0; padding: 0 10px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 2px 0;
  color: var(--side-ink); border-radius: 8px; font-size: 13px; font-weight: 500; position: relative;
}
.nav a i { font-size: 16px; opacity: .85; width: 18px; text-align: center; }
.nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav a.active { background: var(--side-2); color: #fff; }
.nav a.active::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav a.active i { color: var(--accent); opacity: 1; }
.nav .dot-live { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: #e3b23c; }
.side-bottom { margin-top: auto; padding: 10px 10px 18px; border-top: 1px solid rgba(255,255,255,.06); }
.session-box { margin: 4px 6px 10px; background: var(--side-2); border-radius: 10px; padding: 10px 12px; font-size: 12px; display: flex; align-items: center; gap: 10px; }
.session-box .live { margin-left: auto; font-size: 9px; font-weight: 700; letter-spacing: .08em; background: rgba(255,255,255,.1); padding: 2px 6px; border-radius: 4px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #3ccf8e; box-shadow: 0 0 0 0 rgba(60,207,142,.6); animation: pulse 2s infinite; flex-shrink: 0; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(60,207,142,0); } 100% { box-shadow: 0 0 0 0 rgba(60,207,142,0); } }

.main { flex: 1; margin-left: var(--side-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; background: rgba(247,244,240,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 12px 28px; min-height: 66px;
}
.topbar { height: 66px; }
.topbar .shop { font-weight: 700; font-size: 14px; line-height: 1.25; max-width: 180px; min-width: 0; }
.topbar .shop, .topbar .shop small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .shop small { display: block; font-weight: 500; color: var(--muted); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.burger { display: none; background: none; border: 0; font-size: 22px; color: var(--ink); cursor: pointer; padding: 4px; }
.search-box { position: relative; flex: 0 1 300px; }
.search-box input { width: 100%; padding: 9px 46px 9px 36px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font: inherit; font-size: 13px; outline: none; transition: border .15s, box-shadow .15s; }
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 10px; background: var(--line-2); border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; color: var(--muted); font-weight: 600; }
.period-tabs { display: flex; gap: 2px; }
.period-tabs button { background: none; border: 0; font: inherit; font-size: 13px; color: var(--ink-2); padding: 8px 10px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.period-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 9px; border: 1px solid transparent; background: none; color: var(--ink-2); font-size: 17px; cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: #fff; border-color: var(--line); }
.icon-btn .badge-dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); border: 2px solid var(--bg); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.user-chip:hover { background: #fff; border-color: var(--line); }
.user-chip .who { line-height: 1.2; font-size: 12px; }
.user-chip .who b { display: block; font-size: 13px; }
.user-chip .who span { color: var(--muted); font-size: 11px; }
.content { padding: 26px 28px 40px; flex: 1; }
.footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 28px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.footer .sync { color: var(--green); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.overlay { display: none; position: fixed; inset: 0; background: rgba(30,26,23,.4); z-index: 35; }

/* ---------- Page header ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.eyebrow .sep { color: var(--muted); font-weight: 500; text-transform: none; letter-spacing: 0; }
.page-title { font-family: var(--serif); font-size: 32px; font-weight: 500; line-height: 1.15; letter-spacing: -.01em; }
.page-sub { color: var(--muted); margin-top: 6px; font-size: 13px; max-width: 560px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 13px; font-weight: 600; padding: 10px 16px; border-radius: 9px; border: 1px solid transparent; cursor: pointer; transition: all .15s; white-space: nowrap; line-height: 1.2; text-decoration: none; }
.btn i { font-size: 15px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(180,83,42,.25); }
.btn-primary:hover { background: var(--accent-d); color: #fff; }
.btn-outline { background: #fff; color: var(--ink); border-color: #d9d0c6; }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: none; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-soft:hover { background: #f3dacd; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #a32e21; color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 7px; }
.btn-lg { padding: 14px 22px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-alert { background: #fff; border-color: #ecc5bb; color: var(--red); font-size: 12px; padding: 7px 12px; }
.btn-alert:hover { background: var(--red-soft); color: var(--red); }
.count-badge { background: var(--red); color: #fff; font-size: 10px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: inline-grid; place-items: center; padding: 0 5px; }
.act { width: 28px; height: 28px; border-radius: 7px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; display: inline-grid; place-items: center; }
.act:hover { background: var(--line-2); color: var(--accent); }
.act.danger:hover { background: var(--red-soft); color: var(--red); }

/* ---------- Cards / KPIs ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px 14px; }
.card-title { font-size: 16px; font-weight: 600; font-family: var(--serif); }
.card-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.kpi { padding: 18px 18px 14px; position: relative; overflow: hidden; }
.kpi .label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kpi .value { font-family: var(--serif); font-size: 28px; font-weight: 500; margin: 10px 0 4px; line-height: 1; }
.kpi .value small { font-family: var(--sans); font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.kpi .ico { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; font-size: 17px; background: var(--accent-soft); color: var(--accent); }
.kpi .foot { border-top: 1px dashed var(--line); margin-top: 12px; padding-top: 10px; font-size: 11px; color: var(--muted); display: flex; gap: 10px; justify-content: space-between; align-items: center; }
.kpi.warn .label { color: var(--amber); } .kpi.warn .ico { background: var(--amber-soft); color: var(--amber); } .kpi.warn .value { color: var(--amber); }
.kpi.danger { border-color: #f1d0c9; } .kpi.danger .label { color: var(--red); } .kpi.danger .ico { background: var(--red-soft); color: var(--red); } .kpi.danger .value { color: var(--red); }
.kpi.blue .ico { background: var(--blue-soft); color: var(--blue); }
.kpi.green .ico { background: var(--green-soft); color: var(--green); }
.trend-up { color: var(--green); font-weight: 600; }
.trend-down { color: var(--red); font-weight: 600; }
.kpi-skel .value { background: var(--line-2); color: transparent; border-radius: 6px; width: 60%; }

/* ---------- Pills / tags ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 20px; white-space: nowrap; border: 1px solid transparent; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.no-dot::before { display: none; }
.pill-green { background: var(--green-soft); color: var(--green); border-color: #c4e6d3; }
.pill-amber { background: var(--amber-soft); color: var(--amber); border-color: #f2dfae; }
.pill-red { background: var(--red-soft); color: var(--red); border-color: #f2c7c0; }
.pill-blue { background: var(--blue-soft); color: var(--blue); border-color: #cbd8f0; }
.pill-gray { background: #f1eeea; color: var(--ink-2); border-color: #e4ded7; }
.pill-accent { background: var(--accent-soft); color: var(--accent); border-color: #f0cfbf; }
.tag { display: inline-block; font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 5px; background: var(--line-2); color: var(--ink-2); }
.tag.accent { color: var(--accent); background: var(--accent-soft); }
.sku { font-family: Consolas, monospace; font-size: 10px; background: #f1eeea; color: var(--ink-2); padding: 2px 6px; border-radius: 4px; }

/* ---------- Tabs / chips / toolbar ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.tab { font: inherit; font-size: 12px; font-weight: 600; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; white-space: nowrap; transition: all .15s; }
.tab:hover { border-color: #d6c9bc; }
.tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.tab .n { opacity: .65; font-weight: 500; margin-left: 2px; }
.chip { font: inherit; font-size: 12px; font-weight: 600; padding: 7px 14px; border-radius: 20px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; padding: 3px; background: #fff; gap: 2px; }
.seg button { font: inherit; font-size: 12px; font-weight: 600; border: 0; background: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; color: var(--ink-2); white-space: nowrap; }
.seg button.active { background: var(--ink); color: #fff; }
.seg.status button[data-v="faible"].active { background: var(--amber); }
.seg.status button[data-v="rupture"].active { background: var(--red); }
.seg.status button[data-v="disponible"].active { background: var(--green); }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-top: 1px solid var(--line-2); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 11px; color: var(--muted); }
.input, .select, textarea.input {
  font: inherit; font-size: 13px; padding: 10px 12px; border: 1px solid #ddd4ca; border-radius: 9px; background: #fff; color: var(--ink); outline: none; width: 100%;
  transition: border .15s, box-shadow .15s;
}
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='%238d837a' d='M1.6 4.6 8 11l6.4-6.4' stroke='%238d837a' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; cursor: pointer; }
.select-sm { padding: 7px 30px 7px 10px; font-size: 12px; width: auto; }
.input-sm { padding: 7px 10px; font-size: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.input-group { position: relative; }
.input-group .suffix { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--muted); font-weight: 600; }
.input-search { position: relative; }
.input-search i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-search .input { padding-left: 34px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.upload-zone { border: 1.5px dashed #d8cdc1; border-radius: 10px; padding: 14px; display: flex; gap: 14px; align-items: center; cursor: pointer; background: #fcfaf8; }
.upload-zone:hover { border-color: var(--accent); }
.upload-zone .preview { width: 64px; height: 64px; border-radius: 9px; overflow: hidden; flex-shrink: 0; }
.upload-zone .preview .thumb.lg { height: 64px; font-size: 24px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 12px 12px; background: #faf8f5; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-size: 13px; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #fcfaf7; }
.table tr.row-danger { background: #fff8f6; }
.table tr.row-danger:hover { background: #fdf1ed; }
.table .num { text-align: right; white-space: nowrap; }
.table .price b { font-weight: 700; }
.table td .sub { font-size: 11px; color: var(--muted); margin-top: 3px; }
.table-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; font-size: 12px; color: var(--muted); }
.prod-cell { display: flex; gap: 12px; align-items: center; min-width: 230px; }
.prod-cell .name { font-weight: 600; font-size: 13px; line-height: 1.3; }
.prod-cell .meta { display: flex; gap: 6px; align-items: center; margin-top: 5px; flex-wrap: wrap; }
.thumb { width: 46px; height: 46px; border-radius: 9px; flex-shrink: 0; overflow: hidden; display: grid; place-items: center; color: #fff; font-size: 19px; position: relative; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.lg { width: 100%; height: 110px; border-radius: 9px; font-size: 34px; }
.thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(140deg, rgba(255,255,255,.18), transparent 50%, rgba(0,0,0,.18)); pointer-events: none; }
.gauge { display: flex; flex-direction: column; gap: 6px; min-width: 110px; }
.gauge .top { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; }
.gauge .top b { font-size: 13px; }
.bar { height: 5px; background: #eee8e1; border-radius: 4px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 4px; background: var(--green); transition: width .5s ease; }
.bar.amber > span { background: var(--amber); }
.bar.red > span { background: var(--red); }
.bar.accent > span { background: var(--accent); }
.bar.thick { height: 7px; }
.cell-chk { width: 36px; }
.cell-chk input { accent-color: var(--accent); width: 15px; height: 15px; }

.pagination { display: flex; gap: 4px; align-items: center; }
.pagination button { min-width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--ink-2); padding: 0 8px; }
.pagination button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination button:disabled { opacity: .4; cursor: default; }
.pagination .gap { padding: 0 4px; color: var(--muted); }

.empty-state { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty-state i { font-size: 34px; color: #cdbfb2; display: block; margin-bottom: 10px; }
.empty-state.big { padding: 90px 20px; }
.empty-state.big h2 { font-family: var(--serif); color: var(--ink); font-size: 26px; margin-bottom: 8px; }
.empty-state.big p { margin-bottom: 20px; }

/* ---------- Grid layouts ---------- */
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.prod-cell { min-width: 210px; }
.col-articles { max-width: 190px; }
.seller { display: flex; align-items: center; gap: 10px; min-width: 0; }
.seller .who { min-width: 0; }
.seller .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stack { display: flex; flex-direction: column; gap: 20px; }

/* ---------- Dashboard ---------- */
.chart-box { position: relative; height: 290px; padding: 0 20px 10px; }
.chart-note { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--line-2); margin: 0 20px; padding: 14px 0 16px; font-size: 12px; color: var(--muted); }
.legend { display: flex; gap: 16px; font-size: 11px; font-weight: 600; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.cat-list { padding: 0 20px 6px; }
.cat-row { margin-bottom: 15px; }
.cat-row .top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 7px; }
.cat-row .top span { display: flex; align-items: center; gap: 8px; }
.cat-row .top i { width: 8px; height: 8px; border-radius: 50%; }
.crit-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.crit-item.zero { border-color: #f0c2b9; background: #fffaf8; }
.crit-item .name { font-weight: 600; font-size: 13px; }
.crit-item .badge { font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 6px; background: var(--amber-soft); color: var(--amber); text-align: center; white-space: nowrap; }
.crit-item.zero .badge { background: var(--red); color: #fff; }
.crit-item.zero .name { color: var(--red); }
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feat { display: flex; gap: 14px; padding: 14px; align-items: center; }
.feat .thumb { width: 70px; height: 70px; border-radius: 10px; font-size: 26px; }
.feat .kind { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.feat .title { font-weight: 600; margin: 3px 0; }
.mode-tag { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 6px; display: inline-block; }
.mode-especes { background: var(--amber-soft); color: var(--amber); }
.mode-wave { background: #e2f1fb; color: #1d7fbf; }
.mode-orange { background: #fdebd9; color: #d46b08; }
.mode-mtn { background: #fff4c2; color: #8a6a00; }
.mode-moov { background: #dfeafa; color: #0a5aa6; }
.mode-carte { background: var(--blue-soft); color: var(--blue); }

/* ---------- Caisse (POS) ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 0; margin: -26px -28px -40px; min-height: calc(100vh - 66px); }
.pos-catalog { padding: 22px 24px; min-width: 0; }
.pos-cart { background: #fff; border-left: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 66px; height: calc(100vh - 66px); }
.pos-search { display: flex; gap: 10px; margin-bottom: 14px; }
.pos-search .input-search { flex: 1; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 14px; margin-top: 16px; }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; cursor: pointer; transition: all .15s; display: flex; flex-direction: column; position: relative; user-select: none; }
.pcard:hover { border-color: var(--accent); box-shadow: 0 6px 20px rgba(180,83,42,.12); transform: translateY(-2px); }
.pcard.out { opacity: .5; cursor: not-allowed; }
.pcard.out:hover { transform: none; box-shadow: none; border-color: var(--line); }
.pcard .stockb { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 5px; background: var(--green-soft); color: var(--green); z-index: 2; white-space: nowrap; }
.pcard .stockb.low { background: var(--amber-soft); color: var(--amber); }
.pcard .stockb.zero { background: var(--red-soft); color: var(--red); }
.pcard .skub { position: absolute; top: 16px; left: 16px; font-size: 9px; background: rgba(255,255,255,.92); padding: 2px 5px; border-radius: 4px; font-family: Consolas, monospace; z-index: 2; display: none; }
.pcard .cat { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); margin-top: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .nm { font-weight: 600; font-size: 13px; margin: 3px 0 2px; line-height: 1.3; height: 34px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pcard .sp { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .pr { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.pcard .pr b { color: var(--accent); font-size: 15px; }
.pcard .pr b small { font-size: 10px; color: var(--muted); font-weight: 500; }
.pcard .add { width: 28px; height: 28px; border-radius: 7px; background: var(--line-2); border: 0; display: grid; place-items: center; color: var(--ink); font-size: 15px; }
.pcard:hover .add { background: var(--accent); color: #fff; }
.cart-head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.cart-head h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.cart-items { flex: 1; overflow-y: auto; padding: 12px 14px; background: #fcfaf8; min-height: 90px; }
.citem { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; animation: pop .2s ease; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.citem .r1 { display: flex; justify-content: space-between; gap: 8px; }
.citem .nm { font-weight: 600; font-size: 13px; line-height: 1.3; }
.citem .pu { font-size: 11px; color: var(--accent); font-weight: 600; margin-top: 2px; }
.citem .r2 { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.qty button { width: 28px; height: 28px; border: 0; background: #fff; cursor: pointer; font-size: 14px; color: var(--ink); }
.qty button:hover { background: var(--line-2); }
.qty input { width: 36px; height: 28px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; font: inherit; font-weight: 600; font-size: 13px; outline: none; }
.cart-sum { padding: 12px 18px; border-top: 1px solid var(--line); }
.sum-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); padding: 3px 0; }
.net { background: var(--ink); color: #fff; border-radius: 10px; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; margin: 10px 0 12px; }
.net .l { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.net .l small { display: block; font-weight: 400; letter-spacing: 0; text-transform: none; color: #b8afa7; font-size: 11px; margin-top: 2px; }
.net .v { font-family: var(--serif); font-size: 26px; }
.net .v small { font-family: var(--sans); font-size: 11px; color: #cfc6be; }
.pay-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 6px 0 10px; }
.pay-modes button { font: inherit; font-size: 11px; font-weight: 600; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 9px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ink-2); }
.pay-modes button i { font-size: 17px; color: var(--accent); }
.pay-modes button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cash-box { background: #faf7f3; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.cash-box .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; }
.cash-box .input { width: 130px; text-align: right; font-weight: 700; padding: 7px 10px; }
.change { font-weight: 700; font-size: 18px; color: var(--green); }
.change.neg { color: var(--red); }
.quick-cash { display: flex; gap: 5px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.quick-cash button { font-family: Consolas, monospace; font-size: 11px; border: 1px solid var(--line); background: #fff; border-radius: 5px; padding: 4px 7px; cursor: pointer; }
.quick-cash button.exact { background: var(--accent); color: #fff; border-color: var(--accent); }
.disc-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; margin-bottom: 8px; }
.disc-btns { display: flex; gap: 4px; }
.disc-btns button { font: inherit; font-size: 11px; font-weight: 600; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 4px 8px; cursor: pointer; }
.disc-btns button.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.disc-btns button:disabled { opacity: .35; cursor: not-allowed; }
.cart-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }

/* ---------- Approvisionnements ---------- */
.alert-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.alert-card .k { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.alert-card.r .k { color: var(--red); } .alert-card.c .k { color: var(--amber); } .alert-card.f .k { color: var(--blue); }
.alert-card.r { border-left: 3px solid var(--red); } .alert-card.c { border-left: 3px solid var(--amber); } .alert-card.f { border-left: 3px solid var(--blue); }
.contact { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.contact:last-child { border-bottom: 0; }
.protocol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.protocol .step { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: #fcfaf8; }
.protocol .step h4 { font-size: 13px; display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.protocol .step .n { width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 11px; }
.protocol .step p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.line-items .li { display: grid; grid-template-columns: 1fr 90px 120px 34px; gap: 8px; margin-bottom: 8px; align-items: center; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 12px; }
.timeline li:last-child { border-bottom: 0; }

/* ---------- Users ---------- */
.roles-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.role-card { padding: 16px; display: flex; flex-direction: column; }
.role-card.root { border-color: #ecc3b2; box-shadow: 0 0 0 1px #f3d6ca, var(--shadow); }
.role-card .lvl { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 5px; display: inline-block; }
.role-card h3 { font-family: var(--serif); font-size: 18px; margin: 12px 0 2px; }
.role-card .who { font-size: 11px; color: var(--accent); font-weight: 600; }
.role-card p { font-size: 12px; color: var(--muted); line-height: 1.55; flex: 1; }
.role-card .foot { border-top: 1px solid var(--line-2); padding-top: 10px; display: flex; justify-content: space-between; font-size: 11px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff; flex-shrink: 0; background: var(--accent); }
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.audit-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.audit-item:last-child { border-bottom: 0; }
.audit-item .ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; font-size: 14px; }
.audit-item .t { font-size: 12px; font-weight: 600; }
.audit-item .d { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.lvl-info .ic { background: var(--blue-soft); color: var(--blue); }
.lvl-succes .ic { background: var(--green-soft); color: var(--green); }
.lvl-alerte .ic { background: var(--amber-soft); color: var(--amber); }
.lvl-danger .ic { background: var(--red-soft); color: var(--red); }
.privacy { background: #f3efea; border: 1px solid var(--line); }

/* ---------- Interrupteur ---------- */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; cursor: pointer; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #ddd3c9; border-radius: 22px; transition: .2s; }
.switch span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::before { transform: translateX(18px); }
.switch input:disabled + span { opacity: .5; cursor: not-allowed; }
.nav .nav-badge { margin-left: auto; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px; }
.perm-group td { background: #faf8f5; font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 8px 12px !important; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(30, 26, 23, .45); backdrop-filter: blur(2px); display: none; align-items: flex-start; justify-content: center; z-index: 100; padding: 50px 16px; overflow-y: auto; }
.modal-bg.open { display: flex; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; box-shadow: var(--shadow-lg); animation: rise .2s ease; }
.modal.lg { max-width: 780px; }
.modal.sm { max-width: 420px; }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { padding: 20px 22px 14px; display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { font-family: var(--serif); font-size: 21px; font-weight: 500; }
.modal-head .x { background: none; border: 0; font-size: 22px; color: var(--muted); cursor: pointer; line-height: 1; padding: 2px; }
.modal-body { padding: 20px 22px 8px; }
.modal-foot { padding: 14px 22px 20px; display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Dropdown ---------- */
.dd { position: relative; }
.dd-menu { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); min-width: 220px; z-index: 50; display: none; overflow: hidden; }
.dd.open .dd-menu { display: block; animation: rise .15s ease; }
.dd-menu.wide { width: 340px; }
.dd-menu .dd-head { padding: 12px 14px; border-bottom: 1px solid var(--line-2); font-weight: 700; font-size: 13px; display: flex; justify-content: space-between; }
.dd-menu .dd-list { max-height: 340px; overflow-y: auto; }
.dd-menu a.dd-item, .dd-menu .dd-item { display: flex; gap: 10px; align-items: center; padding: 10px 14px; color: var(--ink); font-size: 13px; border-bottom: 1px solid var(--line-2); }
.dd-menu a.dd-item:hover { background: #faf7f3; }
.dd-menu .dd-foot { padding: 10px 14px; text-align: center; font-size: 12px; font-weight: 600; }

/* ---------- Toast ---------- */
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13px; display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 380px; animation: rise .2s ease; }
.toast i { font-size: 17px; }
.toast.success i { color: #5ad69c; }
.toast.error { background: #7d2419; }
.toast.error i { color: #ffb3a8; }
.toast.warn i { color: #f5c76a; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: var(--side); color: #fff; padding: 50px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art::before { content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(180,83,42,.45), transparent 70%); right: -160px; top: -120px; }
.login-art::after { content: ''; position: absolute; width: 380px; height: 380px; border-radius: 50%; border: 1px solid rgba(255,255,255,.08); left: -100px; bottom: -120px; }
.login-art h1 { font-family: var(--serif); font-weight: 500; font-size: 46px; line-height: 1.1; position: relative; }
.login-art p { color: #b8afa7; max-width: 420px; line-height: 1.7; position: relative; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-form .box { width: 100%; max-width: 380px; }
.login-form h2 { font-family: var(--serif); font-size: 30px; font-weight: 500; margin-bottom: 6px; }
.demo { background: #fff; border: 1px dashed #dccfc2; border-radius: 10px; padding: 12px 14px; font-size: 12px; color: var(--muted); margin-top: 20px; line-height: 1.7; }
.demo a { cursor: pointer; }
.err { background: var(--red-soft); color: var(--red); padding: 10px 12px; border-radius: 9px; font-size: 13px; margin-bottom: 14px; display: flex; gap: 8px; align-items: center; }

.spinner { width: 18px; height: 18px; border: 2px solid rgba(0,0,0,.1); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-row td { text-align: center; padding: 40px !important; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .grid-main { grid-template-columns: minmax(0, 1fr) !important; }
  .roles-grid { grid-template-columns: repeat(2, 1fr); }
  .pos { grid-template-columns: minmax(0, 1fr) 360px; }
  .period-tabs { display: none; }
}
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .sidebar.open ~ .overlay { display: block; }
  .main { margin-left: 0; }
  .burger { display: block; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feat-grid, .protocol { grid-template-columns: minmax(0, 1fr); }
  .pos { grid-template-columns: minmax(0, 1fr); margin: -20px -16px -40px; }
  .page-head > * { max-width: 100%; }
  .seg { max-width: 100%; overflow-x: auto; }
  .pos-cart { position: static; height: auto; border-left: 0; border-top: 1px solid var(--line); }
  .user-chip .who { display: none; }
}
@media (max-width: 720px) {
  .topbar { padding: 10px 16px; gap: 8px; }
  .topbar .shop, .search-box { display: none; }
  .content { padding: 20px 16px 30px; }
  .page-title { font-size: 26px; }
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .roles-grid, .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .pos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos-search { flex-direction: column; }
  .pos-search form.input-search { flex: 1 1 auto !important; }
  .chart-box { height: 230px; }
  .legend { display: none; }
  .btn-alert span.lbl, .top-actions .btn-primary span.lbl { display: none; }
  .login-page { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .line-items .li { grid-template-columns: 1fr 70px 34px; }
  .line-items .li .lp { display: none; }
}

/* ---------- Print ---------- */
@media print {
  .sidebar, .topbar, .footer, .page-actions, .toolbar, .act, .pagination, .no-print { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; }
  .card { box-shadow: none; }
  body { background: #fff; }
}
