/* Espace boutique — Jasmin Médical Store (couleurs du site : turquoise, rose promo) */
:root {
  --brand: #0c8b83; --brand-d: #017371; --brand-dd: #0c2a29; --brand-l: #e5f3f2;
  --promo: #d6124f; --promo-l: #ffe8ee;
  --ink: #102120; --ink-2: #3f5653; --muted: #6b8380; --line: #e2ece9; --line-2: #f0f5f4;
  --bg: #f6f9f8; --card: #fff; --ok: #1c7a45; --err: #c8322b; --warn: #a15c00;
  --r: 14px; --r-s: 9px; --shadow: 0 1px 2px rgba(12, 42, 41, .04), 0 6px 20px -8px rgba(12, 42, 41, .14);
  --side: 236px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--brand-d); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ic { width: 18px; height: 18px; flex: none; }
h1 { font-size: 26px; font-weight: 600; margin: 0 0 4px; letter-spacing: -.015em; }
.muted { color: var(--muted); } .small { font-size: 13px; } .strong { font-weight: 600; color: var(--ink); }
.right { text-align: right; }

/* ---------- layout ---------- */
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 20px 14px; z-index: 30; }
.brand { display: flex; flex-direction: column; gap: 8px; padding: 16px 14px 14px; margin: 0 0 22px; border-radius: 14px; background: var(--brand-dd); text-decoration: none !important; }
.brand img { width: 138px; height: auto; display: block; }
.brand span { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #9fd8d2; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a, .side nav .soon, .side-foot a, .side-foot button, .side-foot .who { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); font: inherit; font-weight: 500; background: none; border: 0; width: 100%; text-decoration: none; }
.side nav a, .side-foot a, .side-foot button { cursor: pointer; }
.side nav a:hover, .side-foot a:hover, .side-foot button:hover { background: var(--line-2); color: var(--ink); }
.side nav a.on { background: var(--brand-l); color: var(--brand-d); }
.side nav a.on .ic { color: var(--brand); }
.side nav .soon { color: #9fb2af; cursor: default; }
.side nav .soon em { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 600; background: var(--line-2); color: var(--muted); padding: 2px 7px; border-radius: 6px; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.side-foot .who { color: var(--muted); font-size: 14px; }
.side-foot form { margin: 0; }
.main { margin-left: var(--side); padding: 32px 40px 80px; max-width: 1480px; }
.burger { display: none; }
@media (max-width: 900px) {
  .side { transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .nav-open .side { transform: none; }
  .burger { display: grid; place-items: center; position: fixed; top: 12px; left: 12px; z-index: 31; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
  .main { margin-left: 0; padding: 70px 16px 60px; }
}

/* ---------- head / toolbar ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 0; }
.toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.filters-r { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters-r select { width: auto; margin: 0; padding: 9px 12px; max-width: 260px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); font-size: 14px; font-weight: 500; text-decoration: none !important; }
.chip b { font-weight: 600; color: var(--muted); margin-left: 4px; font-variant-numeric: tabular-nums; }
.chip.on { background: var(--brand-dd); border-color: var(--brand-dd); color: #fff; } .chip.on b { color: #fff; opacity: .75; }
.search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; min-width: 260px; flex: 1 1 260px; max-width: 420px; margin: 0; }
.search .ic { width: 17px; color: var(--muted); }
.toolbar .search input[type=search]:not([type=checkbox]) { border: 0; outline: 0; padding: 9px 0; font: inherit; width: 100%; background: transparent; margin: 0; box-shadow: none; border-radius: 0; }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-l); }
.count { margin: 0 0 8px; }

/* ---------- table ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); }
.table-card { padding: 0; overflow: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #fafcfb; white-space: nowrap; }
.table th.right { text-align: right; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #f8fbfa; }
.products .th { width: 72px; padding-right: 0; }
.products .th img, .noimg { width: 56px; height: 56px; object-fit: cover; border-radius: 9px; display: block; background: var(--line-2); }
.noimg { display: grid; place-items: center; color: #c3d0ce; border: 1px dashed #cfdcd9; }
.products .name { min-width: 220px; }
.products .var { color: var(--brand-d); }
.price { white-space: nowrap; font-variant-numeric: tabular-nums; }
.price-sale { color: var(--promo); font-weight: 600; }
.promo-tag { display: inline-flex; align-items: center; gap: 4px; color: var(--promo); background: var(--promo-l); font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; }
.promo-tag .ic { width: 13px; height: 13px; }
.until { color: var(--promo); }
.pill { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.st-publish { background: #e3f4ea; color: var(--ok); }
.st-draft { background: #eef2f1; color: #5b6b68; }
.st-in { background: var(--brand-l); color: var(--brand-d); }
.st-low { background: #fff1d6; color: var(--warn); }
.st-out { background: #fde7e5; color: var(--err); }
.st-back { background: #ece8fb; color: #5b45b0; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; color: var(--muted); }
.icon-btn:hover { background: var(--brand-l); color: var(--brand-d); }
.empty { text-align: center; padding: 70px 20px; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: var(--r); }
.empty .ic { width: 38px; height: 38px; color: #c3d0ce; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; }

/* phones: each product becomes a card */
@media (max-width: 760px) {
  .table thead { display: none; }
  .products tbody tr { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
  .products td { padding: 0; border: 0; }
  .products .th { grid-row: span 4; width: auto; }
  .products .name { min-width: 0; grid-column: 2 / 4; }
  .products td:nth-child(3), .products td:nth-child(4) { display: none; }
  .products .price { grid-column: 2; text-align: left; }
  .products td:nth-child(6), .products td:nth-child(7) { grid-column: 2; }
  .products td:last-child { grid-column: 3; grid-row: 2 / 4; align-self: center; }
  .search { min-width: 0; max-width: none; }
  .filters-r select { flex: 1 1 140px; max-width: none; }
}

/* ---------- forms / buttons ---------- */
label { display: block; font-size: 14px; font-weight: 500; color: var(--ink-2); margin-bottom: 16px; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit; color: var(--ink); background: #fff; border: 1px solid #d3dfdc; border-radius: var(--r-s); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-l); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--line-2); }
.btn .ic { width: 16px; height: 16px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; } .btn.primary:hover { background: var(--brand-d); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); } .btn.ghost:hover { color: var(--ink); background: var(--line-2); }
.btn.small { padding: 7px 12px; font-size: 14px; }
.btn.block { width: 100%; margin-top: 6px; padding: 12px; }
.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.alert.err { background: #fdecea; color: #8f1d17; }

/* ---------- toasts ---------- */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--brand-dd); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: 0 10px 30px -8px rgba(0,0,0,.35); font-size: 14px; max-width: 400px; animation: tin .25s ease; transition: opacity .4s, transform .4s; }
.toast.ok::before { content: "✓  "; color: #7ee2c8; font-weight: 700; }
.toast.err { background: var(--err); }
.toast.out { opacity: 0; transform: translateY(-6px); }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- login ---------- */
.login-page .main { margin: 0; max-width: none; min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1100px 560px at 15% -10%, #d3ece9 0, transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 20px; padding: 36px 32px; box-shadow: 0 30px 60px -30px rgba(12, 42, 41, .3); border: 1px solid var(--line); }
.login-card { overflow: hidden; }
.login-brand { margin: -36px -32px 26px; padding: 24px; background: var(--brand-dd); display: grid; place-items: center; }
.login-brand img { width: 170px; height: auto; display: block; }
.login-card h1 { font-size: 22px; } .login-card > p { margin: 0 0 22px; font-size: 14px; }
.login-card .forgot { margin: 16px 0 0; text-align: center; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
