/* Mabelia admin */
:root {
  --ink: #0d0b0a;
  --ink-2: #1a1715;
  --ink-3: #26211d;
  --ivory: #f6f2eb;
  --paper: #fbf9f5;
  --card: #fffdf9;
  --stone: #e9e2d6;
  --stone-2: #f1ece3;
  --line: rgba(13, 11, 10, .1);
  --line-2: rgba(13, 11, 10, .18);
  --muted: #7b7268;
  --gold: #c6a56b;
  --gold-2: #e7d3a6;
  --gold-3: #9c7b42;
  --gold-grad: linear-gradient(135deg, #f1dfb4 0%, #c6a56b 45%, #9c7b42 100%);
  --sale: #8e2a2a;
  --ok: #3f6b4e;
  --warn: #a8742a;
  --info: #3d5a7a;
  --serif: "Bodoni Moda", "Didot", "Times New Roman", serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --r: 18px;
  --r-sm: 12px;
  --side-w: 248px;
  --gut: clamp(16px, 3.4vw, 48px);
  --shadow: 0 1px 2px rgba(40, 28, 15, .04), 0 12px 32px -18px rgba(40, 28, 15, .22);
  --shadow-lg: 0 40px 90px -30px rgba(13, 11, 10, .45);
  --bar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 14px/1.55 var(--sans); -webkit-font-smoothing: antialiased; min-height: 100vh; }
body.booting { background: var(--ink); }
body.lock { overflow: hidden; }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
::selection { background: var(--gold-2); color: var(--ink); }
svg { flex: none; }
.muted { color: var(--muted); }
.serif { font-family: var(--serif); }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 22px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; position: relative; overflow: hidden; isolation: isolate; white-space: nowrap; transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .25s, color .25s, border-color .25s, opacity .25s; }
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.5) 50%, transparent 70%); transform: translateX(-120%); transition: transform .9s var(--ease); }
.btn:hover::before { transform: translateX(120%); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.btn-gold { background: var(--gold-grad); color: var(--ink); box-shadow: 0 10px 30px -12px rgba(198, 165, 107, .8); }
.btn-dark { background: var(--ink); color: var(--ivory); box-shadow: 0 12px 28px -14px rgba(13, 11, 10, .7); }
.btn-dark:hover { background: var(--ink-3); }
.btn-line { border: 1px solid var(--line-2); background: var(--card); }
.btn-line:hover { border-color: var(--ink); }
.btn-ghost { color: var(--muted); padding: 0 14px; }
.btn-ghost:hover { color: var(--ink); background: var(--stone-2); }
.btn-danger { color: var(--sale); border: 1px solid rgba(142, 42, 42, .3); background: transparent; }
.btn-danger:hover { background: var(--sale); color: #fff; border-color: var(--sale); }
.btn-danger-solid { background: var(--sale); color: #fff; }
.btn-sm { height: 36px; padding: 0 16px; font-size: 10.5px; }
.btn-wide { width: 100%; }
.btn[disabled], .btn.busy { opacity: .5; pointer-events: none; }
.btn.busy::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 50%; position: relative; transition: background .25s, color .25s, transform .25s var(--ease); flex: none; }
.icon-btn:hover { background: rgba(127, 127, 127, .14); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.sm svg { width: 16px; height: 16px; }
.icon-btn.danger:hover { color: var(--sale); background: rgba(142, 42, 42, .08); }

/* ---------- login ---------- */
.login { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden; background: radial-gradient(120% 80% at 70% 30%, #2a221c 0%, #0d0b0a 62%); color: var(--ivory); }
.login::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .08; mix-blend-mode: overlay; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.login-glow { position: absolute; width: 80vmax; height: 80vmax; right: -30vmax; top: -30vmax; border-radius: 50%; background: radial-gradient(circle, rgba(198, 165, 107, .26), transparent 60%); filter: blur(30px); animation: breathe 10s ease-in-out infinite; pointer-events: none; }
@keyframes breathe { 50% { transform: scale(1.1) translate(-4%, 5%); opacity: .7; } }
.login-card { position: relative; z-index: 2; width: min(420px, 100%); padding: clamp(28px, 6vw, 48px); border-radius: 28px; background: linear-gradient(160deg, rgba(38, 33, 29, .78), rgba(13, 11, 10, .82)); border: 1px solid rgba(198, 165, 107, .22); box-shadow: 0 50px 120px -40px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .06); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); animation: rise .9s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } }
.login-brand { font-family: var(--serif); font-size: 22px; letter-spacing: .42em; padding-left: .42em; text-align: center; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 28px; }
.eyebrow { font-size: 10.5px; letter-spacing: .3em; text-transform: uppercase; font-weight: 600; color: var(--gold); margin: 0 0 10px; }
.login .eyebrow { text-align: center; }
.login-title { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 8vw, 44px); line-height: 1; margin: 0 0 32px; text-align: center; letter-spacing: -.01em; }
.login-title em { font-style: italic; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em; }
.login .btn { height: 52px; margin-top: 6px; }
.login-err { min-height: 22px; margin: 8px 0 6px; color: #f0a9a0; font-size: 13px; }
.login-card.shake { animation: shake .45s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.login-back { display: block; text-align: center; margin-top: 22px; font-size: 12px; letter-spacing: .12em; color: rgba(246, 242, 235, .5); transition: color .3s; }
.login-back:hover { color: var(--gold-2); }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 48px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: inherit; opacity: .6; }
.pw-eye:hover { opacity: 1; }
.pw-eye svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }

/* ---------- fields ---------- */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span, .label { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.field > span em { font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 400; opacity: .8; }
.input, .field input, .field select, .field textarea { width: 100%; height: 46px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--card); outline: none; transition: border-color .25s, box-shadow .25s, background .25s; font-size: 14px; }
.field textarea { height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; line-height: 1.55; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(198, 165, 107, .18); }
.field-dark > span { color: rgba(246, 242, 235, .55); }
.field-dark input { background: rgba(255, 255, 255, .04); border-color: rgba(246, 242, 235, .16); color: var(--ivory); height: 52px; font-size: 16px; }
.field-dark input:focus { background: rgba(255, 255, 255, .07); }
.field > .hint, .field .hint { font-size: 12px; color: var(--muted); letter-spacing: 0; text-transform: none; font-weight: 400; }
.field.invalid input { border-color: var(--sale); }
select.input, .field select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237b7268' stroke-width='1.4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; cursor: pointer; }
.prefix { position: relative; display: block; }
.prefix i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); pointer-events: none; }
.prefix input { padding-left: 32px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 18px; }

/* switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 13px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i { width: 40px; height: 24px; border-radius: 12px; background: var(--stone); position: relative; transition: background .3s var(--ease); flex: none; box-shadow: inset 0 0 0 1px var(--line); }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .35s var(--ease); }
.switch input:checked + i { background: var(--ink); }
.switch input:checked + i::after { transform: translateX(16px); background: var(--gold-2); }
.switch input:focus-visible + i { outline: 2px solid var(--gold); outline-offset: 2px; }

/* segmented */
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--stone-2); border: 1px solid var(--line); gap: 2px; flex-wrap: wrap; }
.seg button { height: 34px; padding: 0 16px; border-radius: 999px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--muted); transition: background .3s var(--ease), color .3s, box-shadow .3s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--ivory); box-shadow: 0 6px 16px -8px rgba(0,0,0,.5); }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; animation: fade .6s var(--ease) both; }
@keyframes fade { from { opacity: 0; } }
.side { position: sticky; top: 0; height: 100vh; background: var(--ink); color: var(--ivory); display: flex; flex-direction: column; padding: 28px 18px 22px; overflow: hidden; z-index: 20; }
.side::before { content: ""; position: absolute; width: 360px; height: 360px; left: -180px; top: -180px; border-radius: 50%; background: radial-gradient(circle, rgba(198, 165, 107, .2), transparent 65%); pointer-events: none; }
.side-brand { position: relative; padding: 0 12px 30px; display: block; }
.brand { font-family: var(--serif); font-size: 22px; letter-spacing: .38em; font-weight: 500; }
.side-brand .brand { display: block; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.side-sub { display: block; font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: rgba(246, 242, 235, .4); margin-top: 6px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; position: relative; }
.side-nav a, .side-link { display: flex; align-items: center; gap: 14px; height: 46px; padding: 0 14px; border-radius: 14px; color: rgba(246, 242, 235, .62); font-size: 13.5px; font-weight: 500; letter-spacing: .02em; transition: background .3s var(--ease), color .3s; position: relative; width: 100%; text-align: left; }
.side-nav a svg, .side-link svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.side-nav a:hover, .side-link:hover { color: var(--ivory); background: rgba(246, 242, 235, .06); }
.side-nav a.on { color: var(--ink); background: var(--gold-grad); box-shadow: 0 10px 26px -12px rgba(198, 165, 107, .8); }
.nav-count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--gold); color: var(--ink); font-size: 11px; display: grid; place-items: center; font-weight: 700; }
.side-nav a.on .nav-count { background: var(--ink); color: var(--gold-2); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: 18px; border-top: 1px solid rgba(246, 242, 235, .08); position: relative; }
.mtop { display: none; }
.main { min-width: 0; padding: clamp(24px, 4vw, 48px) var(--gut) 80px; outline: none; }
.view { max-width: 1320px; margin: 0 auto; animation: viewIn .55s var(--ease) both; }
.view.swap { animation: none; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } }

/* page head */
.phead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 28px; }
.phead h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 4.2vw, 50px); line-height: 1; margin: 0; letter-spacing: -.02em; }
.phead h1 em { font-style: italic; color: var(--gold-3); }
.phead p { margin: 8px 0 0; color: var(--muted); }
.phead-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 22px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-head h2 { font-family: var(--serif); font-weight: 400; font-size: 22px; margin: 0; letter-spacing: -.01em; }
.card-head a { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; color: var(--gold-3); }
.card-head a:hover { color: var(--ink); }

/* ---------- dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.kpi { position: relative; overflow: hidden; }
.kpi .label { display: block; margin-bottom: 14px; }
.kpi-val { font-family: var(--serif); font-size: clamp(28px, 3vw, 38px); line-height: 1; letter-spacing: -.02em; }
.kpi-sub { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.kpi.hero { background: var(--ink); color: var(--ivory); border-color: var(--ink); }
.kpi.hero::before { content: ""; position: absolute; width: 260px; height: 260px; right: -120px; top: -140px; border-radius: 50%; background: radial-gradient(circle, rgba(198, 165, 107, .35), transparent 65%); }
.kpi.hero .label { color: var(--gold); }
.kpi.hero .kpi-val { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kpi.hero .kpi-sub { color: rgba(246, 242, 235, .55); }
.dash { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 18px; }
.dash > .span2 { grid-column: 1 / -1; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .bar { fill: url(#gbar); transition: opacity .25s; }
.chart .bar-bg { fill: transparent; }
.chart g.col:hover .bar { opacity: .75; }
.chart g.col:hover .bar-bg { fill: rgba(198, 165, 107, .08); }
.chart .grid-l { stroke: var(--line); stroke-dasharray: 2 4; }
.chart text { font-size: 10px; fill: var(--muted); font-family: var(--sans); }
.chart .tip { opacity: 0; transition: opacity .2s; pointer-events: none; }
.chart g.col:hover .tip { opacity: 1; }
.chart .tip rect { fill: var(--ink); }
.chart .tip text { fill: var(--ivory); font-size: 11px; font-weight: 600; }
.chart-sum { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: 8px; }
.chart-sum b { display: block; font-family: var(--serif); font-weight: 400; font-size: 24px; }
.chart-sum span { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); min-width: 0; }
.li:first-child { border-top: 0; padding-top: 2px; }
a.li, button.li { width: 100%; text-align: left; transition: background .25s; border-radius: 10px; }
a.li:hover, button.li:hover { background: var(--stone-2); }
.li-main { flex: 1; min-width: 0; }
.li-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-end { text-align: right; flex: none; }
.rank { width: 26px; font-family: var(--serif); font-style: italic; color: var(--gold-3); font-size: 18px; flex: none; text-align: center; }
.thumb { width: 44px; height: 58px; border-radius: 9px; background: var(--stone); object-fit: cover; flex: none; overflow: hidden; }
.thumb.sm { width: 36px; height: 46px; border-radius: 7px; }
.thumb.empty { display: grid; place-items: center; color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 12px; }
.empty-note { padding: 26px 0; text-align: center; color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 18px; }
.stock-pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.stock-pill.out { background: var(--ink); color: var(--ivory); }
.stock-pill.low { background: rgba(168, 116, 42, .14); color: var(--warn); }

/* status badges */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 999px; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.s-new { background: rgba(198, 165, 107, .18); color: var(--gold-3); border-color: rgba(198, 165, 107, .35); }
.badge.s-paid { background: rgba(61, 90, 122, .1); color: var(--info); }
.badge.s-shipped { background: rgba(110, 80, 140, .1); color: #6a4f8a; }
.badge.s-delivered { background: rgba(63, 107, 78, .12); color: var(--ok); }
.badge.s-cancelled { background: rgba(13, 11, 10, .06); color: var(--muted); text-decoration: line-through; }
.badge.s-draft { background: var(--stone-2); color: var(--muted); border-color: var(--line); }
.badge.s-active { background: rgba(63, 107, 78, .12); color: var(--ok); }
.tagchip { display: inline-block; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--gold-3); background: rgba(198, 165, 107, .14); padding: 2px 8px; border-radius: 6px; vertical-align: 2px; margin-left: 6px; }

/* ---------- toolbar ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.search { position: relative; flex: 1 1 260px; min-width: 0; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; fill: none; stroke: var(--muted); stroke-width: 1.6; pointer-events: none; }
.search input { padding-left: 42px; border-radius: 999px; }
.toolbar select.input { width: auto; flex: 0 1 auto; border-radius: 999px; min-width: 0; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 4px; margin-bottom: 14px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; transition: .3s var(--ease); background: var(--card); display: inline-flex; align-items: center; gap: 8px; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--ivory); border-color: var(--ink); }
.chip small { font-size: 10px; opacity: .6; letter-spacing: 0; }
.count-line { font-size: 12px; color: var(--muted); margin: -6px 0 12px; }

/* ---------- product table ---------- */
.ptable { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.prow { display: grid; grid-template-columns: 60px minmax(0, 2.4fr) minmax(0, 1fr) minmax(0, .9fr) 120px 92px 52px 104px; gap: 14px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); transition: background .25s; }
.prow:first-child { border-top: 0; }
.prow.head { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; color: var(--muted); background: var(--stone-2); padding-top: 12px; padding-bottom: 12px; }
.prow:not(.head):hover { background: #fdf9f2; }
.prow.is-draft .p-thumb img { filter: grayscale(.7); opacity: .7; }
.p-thumb { width: 48px; height: 64px; border-radius: 9px; overflow: hidden; background: var(--stone); cursor: pointer; display: block; transition: transform .3s var(--ease), box-shadow .3s; }
.p-thumb:hover { transform: scale(1.06); box-shadow: 0 10px 20px -10px rgba(0,0,0,.4); }
.p-thumb img { width: 100%; height: 100%; object-fit: cover; }
.p-name { min-width: 0; text-align: left; }
.p-name b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-name b:hover { color: var(--gold-3); }
.p-name small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-cat { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-price { font-family: var(--serif); font-size: 16px; white-space: nowrap; }
.p-price s { display: block; font-family: var(--sans); font-size: 11px; color: var(--muted); }
.stepper { display: inline-flex; align-items: center; height: 36px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--card); overflow: hidden; transition: border-color .25s, box-shadow .25s; }
.stepper:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(198, 165, 107, .18); }
.stepper button { width: 30px; height: 100%; color: var(--muted); font-size: 16px; line-height: 1; }
.stepper button:hover { color: var(--ink); background: var(--stone-2); }
.stepper input { width: 40px; height: 100%; border: 0; text-align: center; background: transparent; outline: none; font-weight: 600; -moz-appearance: textfield; appearance: textfield; padding: 0; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper.low { border-color: rgba(168, 116, 42, .5); }
.stepper.out { border-color: var(--ink); }
.stepper.saving { opacity: .6; }
.stepper.saved { border-color: var(--ok); }
.star { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--line-2); transition: color .25s, transform .35s var(--ease), background .25s; }
.star svg { width: 19px; height: 19px; fill: currentColor; }
.star:hover { background: var(--stone-2); color: var(--gold); }
.star[aria-pressed="true"] { color: var(--gold); }
.star[aria-pressed="true"]:active { transform: scale(1.3); }
.p-actions { display: flex; justify-content: flex-end; gap: 0; }
.p-label { display: none; }
.cat-in { display: none; }
.mono { font-variant-numeric: tabular-nums; }

/* ---------- orders ---------- */
.otable { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.orow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr) minmax(0, 1.1fr) 70px minmax(0, .9fr) 162px; gap: 14px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); width: 100%; text-align: left; transition: background .25s; }
.orow:first-child { border-top: 0; }
.orow.head { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; color: var(--muted); background: var(--stone-2); cursor: default; }
button.orow:hover { background: #fdf9f2; }
button.orow.sel { background: rgba(198, 165, 107, .1); }
.o-id { font-weight: 700; letter-spacing: .04em; font-size: 13px; }
.o-date { display: block; font-size: 12px; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.o-cust { min-width: 0; }
.o-cust b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-cust small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.o-total { font-family: var(--serif); font-size: 16px; white-space: nowrap; }
.o-city { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-st { text-align: right; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.cancelled .o-total { color: var(--muted); text-decoration: line-through; }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(13, 11, 10, .45); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); opacity: 0; transition: opacity .45s var(--ease); }
.scrim.on { opacity: 1; }
.drawer { position: fixed; z-index: 60; top: 0; right: 0; bottom: 0; width: min(680px, 100vw); background: var(--paper); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; transform: translateX(104%); transition: transform .55s var(--ease); }
.drawer.on { transform: none; }
.drawer.wide { width: min(760px, 100vw); }
.d-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px 18px 28px; border-bottom: 1px solid var(--line); background: var(--paper); flex: none; }
.d-head h2 { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.01em; }
.d-head .eyebrow { margin: 0 0 2px; }
.d-head-t { flex: 1; min-width: 0; }
.d-body { flex: 1; overflow-y: auto; padding: 26px 28px 40px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.d-foot { flex: none; display: flex; gap: 10px; align-items: center; padding: 14px 22px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); background: rgba(251, 249, 245, .92); backdrop-filter: blur(10px); flex-wrap: wrap; }
.d-foot .grow { flex: 1; }
.dirty-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--warn); font-weight: 600; opacity: 0; transition: opacity .3s; }
.dirty-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.dirty .dirty-dot { opacity: 1; }
.section-t { font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; font-weight: 700; color: var(--gold-3); margin: 30px 0 14px; display: flex; align-items: center; gap: 12px; }
.section-t::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.section-t:first-child { margin-top: 0; }
.toggles { display: flex; gap: 18px 28px; flex-wrap: wrap; align-items: center; }

/* photos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px; }
.ph { position: relative; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; background: var(--stone); box-shadow: 0 8px 20px -14px rgba(0, 0, 0, .5); transition: transform .3s var(--ease), box-shadow .3s, opacity .3s; cursor: grab; touch-action: manipulation; }
.ph img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.ph.dragging { opacity: .35; transform: scale(.96); }
.ph.drop-before { box-shadow: -4px 0 0 0 var(--gold), 0 8px 20px -14px rgba(0,0,0,.5); }
.ph.drop-after { box-shadow: 4px 0 0 0 var(--gold), 0 8px 20px -14px rgba(0,0,0,.5); }
.ph-main { position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 999px; background: var(--gold-grad); color: var(--ink); font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.ph-tools { position: absolute; left: 6px; right: 6px; bottom: 6px; display: flex; justify-content: space-between; gap: 4px; }
.ph-tools button { width: 30px; height: 30px; border-radius: 50%; background: rgba(13, 11, 10, .72); color: var(--ivory); display: grid; place-items: center; backdrop-filter: blur(6px); transition: background .25s, transform .25s var(--ease); }
.ph-tools button:hover { background: var(--ink); transform: scale(1.08); }
.ph-tools button.rm:hover { background: var(--sale); }
.ph-tools button[disabled] { opacity: .3; pointer-events: none; }
.ph-tools svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ph.up { cursor: default; }
.ph.up img { filter: blur(2px) brightness(.8); }
.ph-prog { position: absolute; inset: auto 10px 12px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.ph-prog i { position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--p, 0)); background: var(--gold-grad); transition: transform .2s; }
.ph-pct { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.ph.err { outline: 2px solid var(--sale); }
.ph.err .ph-pct { color: #fff; font-size: 11px; padding: 10px; text-align: center; background: rgba(142, 42, 42, .6); }
.drop { aspect-ratio: 3 / 4; border-radius: 14px; border: 1.5px dashed var(--line-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 10px; color: var(--muted); font-size: 12px; cursor: pointer; transition: border-color .3s, background .3s, color .3s; position: relative; }
.drop svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.drop:hover, .drop.over, .photos-wrap.over .drop { border-color: var(--gold); background: rgba(198, 165, 107, .08); color: var(--gold-3); }
.drop b { color: var(--ink); font-weight: 600; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photos-wrap { border-radius: 18px; transition: background .3s, box-shadow .3s; }
.photos-wrap.over { background: rgba(198, 165, 107, .06); box-shadow: 0 0 0 2px rgba(198, 165, 107, .5); }
.photos-hint { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* chip input */
.chipin { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 46px; padding: 6px 8px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--card); cursor: text; transition: border-color .25s, box-shadow .25s; }
.chipin:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(198, 165, 107, .18); }
.chipin .c { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 6px 0 12px; border-radius: 999px; background: var(--ink); color: var(--ivory); font-size: 12px; font-weight: 600; letter-spacing: .04em; animation: pop .3s var(--ease); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.chipin .c button { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: rgba(246, 242, 235, .6); font-size: 14px; line-height: 1; }
.chipin .c button:hover { color: #fff; background: rgba(255,255,255,.15); }
.chipin input { flex: 1; min-width: 80px; border: 0 !important; outline: none; height: 32px !important; padding: 0 6px !important; background: transparent !important; box-shadow: none !important; }
.size-presets { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.size-presets button { height: 28px; padding: 0 10px; border-radius: 999px; border: 1px dashed var(--line-2); font-size: 11px; color: var(--muted); font-weight: 600; transition: .25s; }
.size-presets button:hover { border-color: var(--gold); color: var(--ink); border-style: solid; }

/* order detail */
.od-status { display: flex; flex-direction: column; gap: 12px; }
.od-status .seg { align-self: flex-start; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.notice svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; margin-top: 1px; }
.notice.warn { background: rgba(168, 116, 42, .1); color: #7d5520; }
.notice.dark { background: var(--ink); color: var(--ivory); }
.notice.info { background: var(--stone-2); color: var(--ink-3); }
.kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px 14px; font-size: 14px; }
.kv dt { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding-top: 2px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv a { border-bottom: 1px solid var(--line-2); }
.kv a:hover { border-color: var(--gold); color: var(--gold-3); }
.quote { margin: 0; padding: 14px 16px; border-left: 2px solid var(--gold); background: var(--stone-2); border-radius: 0 12px 12px 0; font-family: var(--serif); font-style: italic; font-size: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.items .li { padding: 12px 0; }
.totals { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.totals div { display: flex; justify-content: space-between; color: var(--muted); }
.totals .grand { color: var(--ink); font-family: var(--serif); font-size: 22px; padding-top: 8px; margin-top: 4px; border-top: 1px solid var(--line); }

/* settings */
.settings { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.settings .card { padding: 26px; }
.settings form .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; align-items: center; }
.settings .section-t:first-of-type { margin-top: 4px; }
.settings-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.settings .actions .grow { flex: 1; }

/* multi-currency */
.base-eq { display: block; font-family: var(--sans); font-size: 11.5px; color: var(--muted); font-weight: 400; letter-spacing: 0; white-space: nowrap; }
.li-end .base-eq { margin: 1px 0 3px; }
.cancelled .o-total .base-eq { text-decoration: none; }
.totals .base-row { font-size: 12.5px; gap: 12px; }
.totals .base-row span:first-child { min-width: 0; }
.aed-hint { margin-top: 1px; }
.aed-card .switch { align-items: flex-start; font-size: 13.5px; line-height: 1.45; }
.aed-card .switch span { padding-top: 2px; }
.aed-body { margin: 20px 0 22px; transition: opacity .3s; }
.aed-off .aed-body { opacity: .5; }
.affix { position: relative; display: block; }
.affix i { position: absolute; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); pointer-events: none; font-size: 13px; white-space: nowrap; }
.affix .pre { left: 14px; }
.affix .suf { right: 14px; }
.affix input { padding-left: 76px; padding-right: 52px; -moz-appearance: textfield; }
.affix input::-webkit-inner-spin-button, .affix input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.aed-preview { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 16px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--stone-2); border: 1px solid var(--line); font-size: 13px; }
.aed-preview p { margin: 0; font-family: var(--serif); font-size: 15px; font-variant-numeric: tabular-nums; }
.aed-preview p span { white-space: nowrap; }
.aed-preview p small { font-family: var(--sans); font-size: 12px; color: var(--muted); }
.aed-preview p.warn { font-family: inherit; font-size: 13px; color: var(--warn); }
.aed-preview a { font-size: 12.5px; font-weight: 600; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.aed-preview a:hover { color: var(--gold-3); border-color: var(--gold); }
.aed-geo-hint { margin: 6px 0 0 50px; font-size: 12px; color: var(--muted); line-height: 1.5; }

/* payments */
.badge.s-pending_payment { background: rgba(168, 116, 42, .12); color: #8a5f22; border: 1px dashed rgba(168, 116, 42, .45); }
.badge.pay-paid { background: rgba(63, 107, 78, .12); color: var(--ok); }
.badge.pay-unpaid { background: rgba(168, 116, 42, .12); color: #8a5f22; }
.badge.pay-refunded { background: rgba(142, 42, 42, .08); color: var(--sale); }
.badge.pay-expired, .badge.pay-unknown { background: rgba(13, 11, 10, .06); color: var(--muted); }
.kpi-await { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; font-weight: 600; color: #8a5f22; border-bottom: 1px dashed rgba(168, 116, 42, .45); }
.kpi-await::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.kpi-await:hover { color: var(--ink); }
.od-pay-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.od-pay-note { margin-top: 14px; }
.modal-check { margin: -6px 0 24px; }
.pay-loading { margin: 0; font-size: 13px; }
.pay-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.pay-head h2 { font-weight: 400; font-size: 24px; margin: 0 0 4px; }
.pay-head p { margin: 0; font-size: 13px; }
.pay-pill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 14px; border-radius: 999px; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; white-space: nowrap; }
.pay-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pay-pill.off { background: var(--stone-2); color: var(--muted); border: 1px solid var(--line); }
.pay-pill.test { background: rgba(61, 90, 122, .1); color: var(--info); }
.pay-pill.live { background: var(--ink); color: var(--gold-2); }
.pay-kv { margin-bottom: 16px; }
.pay-card code, .pay-card .hint code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .92em; background: var(--stone-2); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.pay-fields { margin-top: 20px; }
.pay-card .hint b { font-weight: 600; color: var(--ink-3); }
.pay-hook { display: flex; flex-direction: column; gap: 8px; margin-top: -6px; padding: 14px; border-radius: var(--r-sm); background: var(--stone-2); border: 1px solid var(--line); }
.pay-hook .hint { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.copybox { display: flex; gap: 8px; margin-bottom: 6px; }
.copybox .input { flex: 1; min-width: 0; height: 40px; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12.5px; background: var(--card); }
.copybox .btn { height: 40px; flex: none; }
.pay-events { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pay-events code { display: inline-block; background: var(--card) !important; border: 1px solid var(--line); padding: 3px 8px !important; font-size: 11.5px !important; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(13, 11, 10, .5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .3s var(--ease); }
.modal.on { opacity: 1; }
.modal-card { width: min(440px, 100%); background: var(--paper); border-radius: 22px; padding: 28px; box-shadow: var(--shadow-lg); transform: translateY(12px) scale(.97); transition: transform .4s var(--ease); }
.modal.on .modal-card { transform: none; }
.modal-card h3 { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 0 0 10px; line-height: 1.15; }
.modal-card p { margin: 0 0 24px; color: var(--muted); overflow-wrap: anywhere; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 90; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: min(380px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 14px; background: var(--ink); color: var(--ivory); font-size: 13.5px; box-shadow: 0 20px 50px -18px rgba(0, 0, 0, .6); animation: toastIn .45s var(--ease) both; }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; }
.toast.err::before { background: #e0705f; }
.toast.out { animation: toastOut .35s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* skeleton */
.skel { border-radius: var(--r); background: linear-gradient(100deg, var(--stone-2) 30%, #f8f4ee 50%, var(--stone-2) 70%); background-size: 300% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prow { grid-template-columns: 56px minmax(0, 2fr) minmax(0, .9fr) 112px 84px 48px 100px; }
  .prow .p-cat { display: none; }
  .cat-in { display: inline; }
  .settings { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; top: auto; left: 0; right: 0; bottom: 0; height: calc(var(--bar-h) + var(--safe-b)); padding: 0 6px var(--safe-b); flex-direction: row; border-top: 1px solid rgba(198, 165, 107, .2); box-shadow: 0 -12px 40px -20px rgba(0,0,0,.6); }
  .side::before, .side-brand, .side-foot { display: none; }
  .side-nav { flex-direction: row; flex: 1; justify-content: space-around; align-items: center; gap: 2px; }
  .side-nav a { flex: 1; flex-direction: column; justify-content: center; gap: 3px; height: 54px; padding: 0 4px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; border-radius: 14px; max-width: 120px; }
  .side-nav a svg { width: 21px; height: 21px; }
  .side-nav a.on { background: transparent; color: var(--gold-2); box-shadow: none; }
  .side-nav a.on::after { content: ""; position: absolute; top: 3px; width: 22px; height: 2px; border-radius: 1px; background: var(--gold-grad); }
  .nav-count { position: absolute; top: 4px; left: calc(50% + 6px); margin: 0; min-width: 17px; height: 17px; font-size: 9.5px; padding: 0 4px; }
  .side-nav a.on .nav-count { background: var(--gold); color: var(--ink); }
  .mtop { display: flex; position: sticky; top: 0; z-index: 25; height: 58px; align-items: center; justify-content: space-between; padding: 0 8px 0 var(--gut); background: rgba(13, 11, 10, .94); color: var(--ivory); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
  .mtop .brand { font-size: 18px; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .mtop-actions { display: flex; gap: 2px; }
  .main { padding-bottom: calc(var(--bar-h) + var(--safe-b) + 40px); }
  .dash { grid-template-columns: minmax(0, 1fr); }
  .toasts { bottom: calc(var(--bar-h) + var(--safe-b) + 14px); right: 16px; left: 16px; align-items: stretch; }
  .toast { max-width: none; }
}
@media (max-width: 760px) {
  body { font-size: 14px; }
  .phead { margin-bottom: 20px; align-items: flex-start; }
  .phead-actions { width: 100%; }
  .phead-actions .btn { flex: 1; }
  .kpis { gap: 12px; }
  .card { padding: 18px; }
  .kpi .label { margin-bottom: 10px; }
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .grid2.keep { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar select.input { flex: 1 1 calc(50% - 5px); }

  /* products become cards */
  .ptable { background: transparent; border: 0; box-shadow: none; overflow: visible; display: grid; gap: 12px; }
  .prow.head { display: none; }
  .prow { grid-template-columns: 64px minmax(0, 1fr) auto; grid-template-areas: "img name name" "img price star" "stock stock status" "acts acts acts"; gap: 8px 12px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
  .prow:first-child { border-top: 1px solid var(--line); }
  .prow > .p-thumb { grid-area: img; width: 64px; height: 84px; }
  .prow > .p-name { grid-area: name; align-self: end; }
  .prow > .p-price { grid-area: price; align-self: start; }
  .prow > .p-price s { display: inline; margin-left: 6px; }
  .prow > .p-star { grid-area: star; justify-self: end; align-self: start; margin-top: -6px; }
  .prow > .p-stock { grid-area: stock; display: flex; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
  .prow > .p-status { grid-area: status; justify-self: end; display: flex; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); margin-left: -12px; padding-left: 12px; }
  .prow > .p-actions { grid-area: acts; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 6px; margin: 0 -4px -6px; }
  .p-label { display: inline; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
  .prow .p-cat { display: none; }

  /* orders become cards */
  .otable { background: transparent; border: 0; box-shadow: none; overflow: visible; display: grid; gap: 10px; }
  .orow.head { display: none; }
  .orow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "id st" "cust total" "meta meta"; gap: 6px 12px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
  .orow:first-child { border-top: 1px solid var(--line); }
  .orow > .o-id { grid-area: id; }
  .orow > .o-st { grid-area: st; }
  .orow > .o-cust { grid-area: cust; }
  .orow > .o-total { grid-area: total; text-align: right; align-self: end; font-size: 18px; }
  .orow > .o-city { grid-area: meta; font-size: 12px; }
  .orow > .o-items { display: none; }

  /* drawer full screen, rises from bottom */
  .drawer, .drawer.wide { width: 100vw; top: 0; transform: translateY(104%); }
  .drawer.on { transform: none; }
  .d-head { padding: 12px 10px 12px 16px; padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
  .d-head h2 { font-size: 22px; }
  .d-body { padding: 20px 16px 32px; }
  .d-foot { padding: 10px 12px calc(10px + var(--safe-b)); gap: 8px; }
  .d-foot .btn { height: 42px; padding: 0 16px; }
  .d-foot .btn-ghost { padding: 0 10px; }
  .photos { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv dd { margin-bottom: 10px; }
  .settings .actions { flex-wrap: wrap; }
  .od-pay-actions .btn { flex: 1; }
  .seg button { padding: 0 12px; }
  .modal { align-items: end; padding: 12px 12px calc(12px + var(--safe-b)); }
  .modal-card { padding: 24px 20px; }
  .modal-actions .btn { flex: 1; }
  .chart-sum { gap: 18px; }
}
@media (max-width: 400px) {
  .kpi-val { font-size: 26px; }
  .kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .d-foot .hide-xs { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
