/* Stock Management System — standalone styles.
   Design tokens ported from the prototype's theme.css (light/dark palettes,
   Khmer font switch, card shadows, entrance animations). Components are
   hand-written CSS replicating the prototype's Tailwind layout:
     phone  : top bar + bottom tab bar + floating add button
     tablet : 76px icon rail (≥768px)
     desktop: 256px labelled sidebar (≥1024px) */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Khmer:wght@400;500;600;700;800&display=swap');

/* Plus Jakarta Sans — self-hosted, Latin subset only. The unicode-range is
   deliberate: Khmer glyphs never match these faces and fall through to
   Noto Sans Khmer next in the stacks. */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/jakarta-latin-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/jakarta-latin-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/jakarta-latin-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/jakarta-latin-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/fonts/jakarta-latin-800.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --font-display: "Plus Jakarta Sans", "Noto Sans Khmer", system-ui, sans-serif;
  --font-sans: "Plus Jakarta Sans", "Noto Sans Khmer", system-ui, sans-serif;
  color-scheme: light;
  /* "XYZ" reference palette: soft grey-green canvas, pure white cards,
     vivid teal-green accent, deep green for dark tiles/accents. */
  --bg: #eff1ec;
  --surface: #ffffff;
  --surface-2: #edf0e9;
  --surface-3: #dde3d8;
  --text: #152219;
  --dim: #5d6d63;
  --border: #e8ebe2;
  --accent: #10a96f;
  --accent-strong: #0a3d2c;
  --accent-soft: #e1f5eb;
  --accent-ink: #ffffff;
  --warn: #b45309;
  --warn-bg: #fdf0dc;
  --warn-ico: #e07f13;
  --danger: #bc3f0e;
  --danger-bg: #fdeaea;
  --danger-ico: #c2410c;
  --ok: #0e9f6e;
  --ok-bg: #e2f5ec;
  --shadow-card: 0 1px 2px rgba(21, 34, 25, 0.03), 0 16px 34px -30px rgba(21, 34, 25, 0.16);
  --shadow-pop: 0 18px 44px -16px rgba(10, 30, 20, 0.35);
}

:root[data-lang="km"] {
  /* Jakarta stays first even in Khmer mode: its latin-only unicode-range
     means Khmer glyphs fall through to Noto Sans Khmer automatically,
     while Latin text and numerals get the premium face in both modes. */
  --font-display: "Plus Jakarta Sans", "Noto Sans Khmer", system-ui, sans-serif;
  --font-sans: "Plus Jakarta Sans", "Noto Sans Khmer", system-ui, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  /* Dark twin of the reference palette: deep green-charcoal surfaces,
     same vivid teal accent lifted brighter for dark backgrounds. */
  --bg: #0b100e;
  --surface: #151f1a;
  --surface-2: #1e2a24;
  --surface-3: #2b3a32;
  --text: #edf4ef;
  --dim: #a9bcb0;
  --border: #27362e;
  --accent: #2bc98d;
  --accent-strong: #8ff0c3;
  --accent-soft: #123528;
  --accent-ink: #05231a;
  --warn: #f2b544;
  --warn-bg: #3a2f10;
  --warn-ico: #e07f13;
  --danger: #f28b74;
  --danger-bg: #3c211a;
  --danger-ico: #b93a17;
  --ok: #4ecf83;
  --ok-bg: #123524;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 34px -30px rgba(0, 0, 0, 0.55);
  --shadow-pop: 0 18px 44px -16px rgba(0, 0, 0, 0.75);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    color-scheme: dark;
    --bg: #0b100e;
    --surface: #151f1a;
    --surface-2: #1e2a24;
    --surface-3: #2b3a32;
    --text: #edf4ef;
    --dim: #a9bcb0;
    --border: #27362e;
    --accent: #2bc98d;
    --accent-strong: #8ff0c3;
    --accent-soft: #123528;
    --accent-ink: #05231a;
    --warn: #f2b544;
    --warn-bg: #3a2f10;
    --warn-ico: #e07f13;
    --danger: #f28b74;
    --danger-bg: #3c211a;
    --danger-ico: #b93a17;
    --ok: #4ecf83;
    --ok-bg: #123524;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 34px -30px rgba(0, 0, 0, 0.55);
    --shadow-pop: 0 18px 44px -16px rgba(0, 0, 0, 0.75);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.25s ease, color 0.25s ease;
  font-size: 16px;
  line-height: 1.5;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-display); margin: 0; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* ------------------------------ animations ------------------------------- */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.anim-backdrop { animation: fade-in 0.18s ease both; }
.anim-sheet { animation: sheet-up 0.26s cubic-bezier(0.32, 0.72, 0.24, 1) both; }
.anim-view { animation: view-in 0.22s ease both; }
@media (prefers-reduced-motion: reduce) {
  .anim-backdrop, .anim-sheet, .anim-view { animation: none; }
  body { transition: none; }
}
.nice-scroll { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.nice-scroll::-webkit-scrollbar { width: 5px; height: 5px; }
.nice-scroll::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; }
input[type="checkbox"], input[type="radio"], select { accent-color: var(--accent); }

/* -------------------------------- chrome --------------------------------- */
.sidebar, .rail, .topbar, .bottomnav { display: none; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(8px);
}
@media (max-width: 767.98px) { .topbar { display: block; } }
.topbar-inner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.topbar .shop-name {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--font-display); font-size: 17px; font-weight: 800;
}

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40; width: 256px;
  flex-direction: column; border-right: 1px solid var(--border); background: var(--surface);
}
@media (min-width: 1024px) { .sidebar { display: flex; } }
.sidebar-head { display: flex; align-items: center; gap: 12px; padding: 24px 20px 20px; }
.sidebar-head .shop-name {
  font-family: var(--font-display); font-size: 17px; font-weight: 800;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-head .shop-sub { font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 0 12px; display: flex; flex-direction: column; gap: 4px; }
.sidebar-foot { border-top: 1px solid var(--border); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.sidebar-foot .pref-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-foot .pref-label { font-size: 12px; font-weight: 600; color: var(--dim); }
.sidebar-foot .user-row { font-size: 13px; color: var(--dim); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.link-btn { background: none; border: none; color: var(--accent-strong); font-size: 13px; font-weight: 600; padding: 0; }

.rail {
  position: fixed; inset: 0 auto 0 0; z-index: 40; width: 76px;
  flex-direction: column; align-items: center;
  border-right: 1px solid var(--border); background: var(--surface);
}
@media (min-width: 768px) and (max-width: 1023.98px) { .rail { display: flex; } }
.rail .rail-mark { padding: 20px 0 16px; }
.rail nav { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rail-foot { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-bottom: 20px; }
.rail-lang {
  height: 40px; min-width: 48px; padding: 0 8px; border: none; border-radius: 999px;
  background: var(--surface-2); color: var(--text); font-size: 12px; font-weight: 700;
}
.rail-lang:hover { background: var(--surface-3); }

.shop-mark {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 36px; height: 36px; border-radius: 12px; font-size: 16px;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-display); font-weight: 800;
}
.shop-mark.lg { width: 44px; height: 44px; border-radius: 16px; font-size: 18px; }

.nav-btn {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 14px; border: none; border-radius: 12px; background: none;
  font-size: 15px; font-weight: 600; color: var(--dim); text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-btn:hover { background: var(--surface-2); color: var(--text); }
.nav-btn.active { background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 20px -12px var(--accent); }
.nav-btn.active:hover { background: var(--accent); color: var(--accent-ink); }
.nav-btn.active .nav-badge { background: #ffffff; color: var(--danger); }
.nav-btn .nav-badge {
  margin-left: auto; border-radius: 999px; background: var(--danger); color: #fff;
  padding: 2px 8px; font-size: 12px; font-weight: 700;
}
.nav-btn.rail-btn { width: 48px; height: 48px; justify-content: center; padding: 0; }
.nav-btn.rail-btn .nav-badge {
  position: absolute; top: -4px; right: -6px; margin: 0; min-width: 16px; height: 16px;
  padding: 0 4px; font-size: 10px; display: flex; align-items: center; justify-content: center;
}

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  backdrop-filter: blur(8px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (max-width: 767.98px) { .bottomnav { display: block; } }
.bottomnav-grid { display: grid; grid-template-columns: repeat(5, 1fr); }
.bottomnav button {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px; border: none; background: none;
  font-size: 11px; font-weight: 600; color: var(--dim);
}
.bottomnav .icon-wrap { padding: 3px 16px; border-radius: 999px; transition: background 0.15s ease; }
.bottomnav button.active { color: var(--accent-strong); }
.bottomnav button.active .icon-wrap { background: var(--accent-soft); }
.bottomnav .nav-badge {
  position: absolute; top: -6px; right: -10px; min-width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--danger); color: #fff; padding: 0 4px; font-size: 10px; font-weight: 700;
}
.icon-wrap { position: relative; display: inline-flex; }

.lang-toggle { display: flex; flex-shrink: 0; border-radius: 999px; background: var(--surface-2); padding: 4px; }
.lang-toggle button {
  border: none; background: none; border-radius: 999px; padding: 6px 12px;
  font-size: 13px; font-weight: 700; white-space: nowrap; color: var(--dim); transition: all 0.15s ease;
}
.lang-toggle button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,0.12); }

.theme-toggle {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-shrink: 0;
  width: 36px; height: 36px; border: none; border-radius: 999px;
  background: var(--surface-2); color: var(--text); transition: background 0.15s ease;
}
.theme-toggle:hover { background: var(--surface-3); }
.theme-toggle.with-label { width: auto; padding: 8px 14px; font-size: 14px; font-weight: 600; }

/* -------------------------------- layout --------------------------------- */
.content { padding-left: 0; }
@media (min-width: 768px) { .content { padding-left: 76px; } }
@media (min-width: 1024px) { .content { padding-left: 256px; } }
main.container {
  margin: 0 auto; width: 100%; max-width: 672px;
  padding: 20px 16px 128px;
}
@media (min-width: 768px) { main.container { max-width: 768px; padding: 28px 24px 128px; } }
@media (min-width: 1024px) { main.container { max-width: 1024px; padding-left: 32px; padding-right: 32px; } }
@media (min-width: 1280px) { main.container { max-width: 1152px; } }

.section-head { margin-bottom: 16px; }
.section-head h1 { font-size: 26px; line-height: 1.25; font-weight: 800; letter-spacing: -0.01em; }
@media (min-width: 768px) { .section-head h1 { font-size: 30px; } }
.section-head .sub { margin-top: 4px; font-size: 14px; color: var(--dim); }
.block-title { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.block-title-sm { font-size: 15px; font-weight: 700; }

/* --------------------------------- cards --------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow-card);
}
.card-pad { padding: 16px; }
.card-flex { display: flex; flex-direction: column; height: 100%; padding: 16px; }
.ring-danger { box-shadow: var(--shadow-card), 0 0 0 1px var(--danger); }
.ring-warn { box-shadow: var(--shadow-card), 0 0 0 1px var(--warn); }

.grid { display: grid; gap: 10px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.gap-3 { gap: 12px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 10px; } .mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; } .mt-5 { margin-top: 20px; } .mt-6 { margin-top: 28px; }
@media (min-width: 1024px) {
  .lg-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .lg-grid-3 { grid-template-columns: repeat(3, 1fr); }
  .lg-grid-4 { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 640px) {
  .sm-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .sm-grid-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1280px) {
  .xl-grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.stat-card { display: flex; flex-direction: column; padding: 18px; }
.stat-value {
  font-family: var(--font-display); font-size: 32px; line-height: 1.05; font-weight: 800;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.stat-value.danger { color: var(--danger); }
.stat-value.warn { color: var(--warn); }
.stat-value.sm { font-size: 24px; }
.stat-label { order: -1; margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--dim); }
.stat-sub { margin-top: 6px; font-size: 12px; color: var(--dim); }
.stat-label-upper { order: -1; margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--dim); }
.stat-pill {
  align-self: flex-start; margin-top: 10px; display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 700;
}
.stat-pill.warn { background: var(--warn-bg); color: var(--warn); }
.stat-pill.danger { background: var(--danger-bg); color: var(--danger); }

/* -------------------------------- buttons -------------------------------- */
.btn-primary {
  display: inline-block; border: none; border-radius: 14px; background: var(--accent);
  padding: 12px 16px; font-size: 16px; font-weight: 600; color: var(--accent-ink);
  box-shadow: 0 6px 16px -8px var(--accent); transition: all 0.15s ease;
}
.btn-primary:hover { background: var(--accent-strong); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; }
.btn-primary:disabled:active { transform: none; }
.btn-block { width: 100%; }

.btn-ghost {
  border: 1px solid var(--border); background: var(--surface); border-radius: 14px;
  padding: 8px 12px; font-size: 14px; font-weight: 600; color: var(--text); transition: all 0.15s ease;
}
.btn-ghost:hover { background: var(--surface-2); }
.btn-ghost:active { transform: scale(0.98); }

.btn-action {
  border: none; border-radius: 14px; background: var(--accent); color: var(--accent-ink);
  padding: 10px 14px; font-size: 14px; font-weight: 600; transition: all 0.15s ease;
}
.btn-action:hover { background: var(--accent-strong); }
.btn-action:active { transform: scale(0.97); }
.btn-action:disabled { opacity: 0.5; }

.btn-soft {
  border: none; border-radius: 14px; background: var(--surface-2); color: var(--text);
  padding: 10px 14px; font-size: 14px; font-weight: 600; transition: all 0.15s ease;
}
.btn-soft:active { transform: scale(0.97); }
.btn-warn-soft {
  border: none; border-radius: 12px; background: var(--warn-bg); color: var(--warn);
  padding: 10px 14px; font-size: 14px; font-weight: 600; transition: all 0.15s ease;
}
.btn-warn-soft:active { transform: scale(0.97); }
.btn-danger-outline {
  width: 100%; border: 1px solid var(--danger); background: none; border-radius: 12px;
  padding: 10px 16px; font-size: 14px; font-weight: 600; color: var(--danger); transition: all 0.15s ease;
}
.btn-danger-outline:active { transform: scale(0.98); }
.select-inline {
  border: 1px solid var(--border); background: var(--surface); border-radius: 12px;
  padding: 10px; font-size: 14px; color: var(--text);
}

.fab {
  position: fixed; right: 16px; bottom: 96px; z-index: 40;
  display: flex; align-items: center; gap: 6px; border: none; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  padding: 14px 20px; font-family: var(--font-display); font-size: 16px; font-weight: 700;
  box-shadow: var(--shadow-pop); transition: all 0.15s ease;
}
.fab:hover { background: var(--accent-strong); }
.fab:active { transform: scale(0.97); }
@media (min-width: 768px) { .fab { right: 24px; bottom: 24px; } }

/* --------------------------------- forms --------------------------------- */
.field { display: block; }
.field > .field-label {
  display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--dim);
}
.input {
  width: 100%; border: 1px solid var(--border); background: var(--surface);
  border-radius: 14px; padding: 10px 14px; font-size: 16px; color: var(--text);
  box-shadow: 0 1px 2px rgba(18, 32, 26, 0.04); outline: none; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input::placeholder { color: var(--dim); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input:disabled { opacity: 0.6; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error { font-size: 14px; font-weight: 500; color: var(--danger); }
.form-ok { font-size: 14px; font-weight: 500; color: var(--ok); }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; border-radius: 16px; background: var(--surface-2); padding: 4px; }
.seg button {
  border: none; background: none; border-radius: 12px; padding: 10px;
  font-size: 14px; font-weight: 700; color: var(--dim); transition: all 0.15s ease;
}
.seg button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,0.12); }
.seg-tabs { max-width: 448px; }
.seg-tabs button { font-family: var(--font-display); }

.fee-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fee-chips button {
  border: none; border-radius: 999px; background: var(--surface-2); color: var(--text);
  padding: 6px 12px; font-size: 12px; font-weight: 600; transition: all 0.15s ease;
}
.fee-chips button:active { transform: scale(0.97); }
.add-row-btn {
  border: none; border-radius: 12px; background: var(--surface-2); color: var(--text);
  padding: 8px 14px; font-size: 14px; font-weight: 600; transition: all 0.15s ease;
}
.add-row-btn:active { transform: scale(0.98); }
.row-remove {
  display: flex; align-items: center; flex-shrink: 0; border: none; border-radius: 12px;
  background: var(--surface-2); color: var(--danger); padding: 0 12px; transition: all 0.15s ease;
}
.row-remove:active { transform: scale(0.95); }

/* ------------------------------ search/filter ----------------------------- */
.search-wrap { position: relative; }
.search-wrap .search-icon {
  position: absolute; top: 50%; left: 14px; transform: translateY(-50%);
  color: var(--dim); pointer-events: none; display: flex;
}
.search-wrap .input { border-radius: 999px; padding: 12px 40px 12px 44px; }
.search-wrap .search-clear {
  position: absolute; top: 50%; right: 10px; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border: none; border-radius: 999px;
  background: var(--surface-2); color: var(--dim);
}
.filter-row { display: flex; gap: 8px; overflow-x: auto; margin-top: 12px; padding-bottom: 4px; }
.filter-select {
  border: none; border-radius: 999px; background: var(--surface); color: var(--text);
  padding: 8px 14px; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-card), 0 0 0 1px var(--border); outline: none;
}
.pill {
  border: none; border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 600;
  white-space: nowrap; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-card), 0 0 0 1px var(--border); transition: all 0.15s ease;
}
.pill:active { transform: scale(0.97); }
.pill.active { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.pill.active.danger { background: var(--danger); color: #fff; }
.chip-static {
  border-radius: 999px; background: var(--surface-2); color: var(--dim);
  padding: 8px 14px; font-size: 14px; white-space: nowrap;
}

/* ---------------------------------- chips --------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
  border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.chip-ok { background: var(--ok-bg); color: var(--ok); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }
.chip-danger { background: var(--danger-bg); color: var(--danger); }
.chip-neutral { background: var(--surface-2); color: var(--dim); }
.chip-accent { background: var(--accent); color: var(--accent-ink); }

/* ---------------------------------- sheets -------------------------------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(2px);
}
@media (min-width: 640px) { .sheet-backdrop { align-items: center; padding: 24px; } }
.sheet {
  width: 100%; max-width: 512px; max-height: 92dvh; overflow-y: auto;
  background: var(--surface); border-radius: 26px 26px 0 0; padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow-pop);
}
@media (min-width: 640px) { .sheet { border-radius: 26px; } }
@media (min-width: 1024px) { .sheet { max-width: 576px; } }
.sheet-grip { margin: 0 auto 16px; height: 6px; width: 40px; border-radius: 99px; background: var(--surface-3); }
@media (min-width: 640px) { .sheet-grip { display: none; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sheet-head h2 { font-size: 18px; font-weight: 700; }
.sheet-close {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 36px; height: 36px; border: none; border-radius: 999px;
  background: var(--surface-2); color: var(--text); transition: background 0.15s ease;
}
.sheet-close:hover { background: var(--surface-3); }

.confirm-bar { margin-top: 16px; border: 1px solid var(--danger); background: var(--danger-bg); border-radius: 12px; padding: 12px; }
.confirm-bar p { font-size: 14px; }
.confirm-bar .confirm-actions { display: flex; gap: 8px; margin-top: 8px; }
.confirm-bar .confirm-yes {
  flex: 1; border: none; border-radius: 12px; background: var(--danger); color: #fff;
  padding: 10px 12px; font-size: 14px; font-weight: 600; transition: all 0.15s ease;
}
.confirm-bar .confirm-no {
  flex: 1; border: none; border-radius: 12px; background: var(--surface); color: var(--text);
  padding: 10px 12px; font-size: 14px; font-weight: 600; transition: all 0.15s ease;
}
.confirm-bar button:active { transform: scale(0.98); }

/* ------------------------------- entity cards ------------------------------ */
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-title-btn { flex: 1; min-width: 0; border: none; background: none; padding: 0; text-align: left; color: var(--text); }
.card-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 600; }
.card-title .id-tag { margin-left: 6px; font-size: 12px; font-weight: 500; color: var(--dim); }
.card-sub { display: block; margin-top: 2px; font-size: 13px; color: var(--dim); }
.card-body { margin-top: 10px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.card-body .dim { color: var(--dim); }
.card-actions { margin-top: auto; padding-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.alert-strip { margin-top: 10px; border-radius: 8px; padding: 6px 10px; font-size: 12px; font-weight: 600; }
.alert-strip.danger { background: var(--danger-bg); color: var(--danger); }
.alert-strip.warn { background: var(--warn-bg); color: var(--warn); }
.await-chip {
  display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 4px 10px;
  font-size: 12px; font-weight: 600; background: var(--warn-bg); color: var(--warn);
}

/* --------------------- home: greeting + alert banners --------------------- */
.greet-hello { font-size: 14px; font-weight: 500; color: var(--dim); }
.home-head h1 { margin-top: 2px; }
.alert-stack { display: flex; flex-direction: column; gap: 10px; }
.alert-banner {
  display: flex; align-items: center; gap: 12px;
  border-radius: 18px; padding: 14px 16px;
}
.alert-banner .ab-ico {
  width: 38px; height: 38px; flex: none; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; color: #ffffff;
}
.alert-banner .ab-text { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; line-height: 1.45; }
.alert-banner .ab-btn {
  flex: none; border: none; border-radius: 10px; background: var(--surface); color: var(--text);
  padding: 8px 14px; font-size: 13px; font-weight: 700;
  box-shadow: 0 1px 2px rgba(21, 34, 25, 0.10); transition: all 0.15s ease;
}
.alert-banner .ab-btn:active { transform: scale(0.97); }
.alert-banner.danger { background: var(--danger-bg); color: var(--danger); }
.alert-banner.danger .ab-ico { background: var(--danger-ico); }
.alert-banner.warn { background: var(--warn-bg); color: var(--warn); }
.alert-banner.warn .ab-ico { background: var(--warn-ico); }
.alert-banner.info { background: var(--accent-soft); color: var(--accent-strong); }
.alert-banner.info .ab-ico { background: var(--accent); color: var(--accent-ink); }

.qty-big { text-align: right; }
.qty-big .qty-num {
  font-family: var(--font-display); font-size: 30px; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums;
}
.qty-big .qty-num.danger { color: var(--danger); }
.qty-big .qty-num.warn { color: var(--warn); }
.qty-big .qty-word { display: block; margin-top: 4px; font-size: 12px; color: var(--dim); }
.stock-flag { display: inline-block; margin-top: 10px; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; }
.stock-flag.danger { background: var(--danger-bg); color: var(--danger); }
.stock-flag.warn { background: var(--warn-bg); color: var(--warn); }

.stepper-row { display: flex; align-items: center; gap: 8px; }
.stepper-btn {
  height: 44px; flex: 1; border: none; border-radius: 12px; background: var(--surface-2);
  font-size: 20px; font-weight: 700; color: var(--text); transition: all 0.15s ease;
}
.stepper-btn:active { transform: scale(0.97); }
.stepper-btn:disabled { opacity: 0.4; }
.stepper-btn.accent { background: var(--accent); color: var(--accent-ink); }
.stepper-btn.small { flex: none; padding: 0 14px; font-size: 14px; font-weight: 600; }
.card-sub-btns { display: flex; gap: 8px; margin-top: 8px; }
.card-sub-btns .btn-ghost { flex: 1; }

/* ------------------------------- list blocks ------------------------------- */
.list-card { padding: 0 16px; }
.list-card li { padding: 14px 0; border-bottom: 1px solid var(--border); }
.list-card li:last-child { border-bottom: none; }
.row-between { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.row-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.row-amount { flex-shrink: 0; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.row-amount.warn { color: var(--warn); }
.row-sub { font-size: 13px; color: var(--dim); }
button.row-btn { display: flex; width: 100%; align-items: baseline; justify-content: space-between; gap: 8px; padding: 10px 0; border: none; background: none; text-align: left; color: var(--text); }
.divided > li + li { border-top: 1px solid var(--border); }

.movement-change { font-family: var(--font-display); font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.movement-change.pos { color: var(--ok); }
.movement-change.neg { color: var(--danger); }

.expense-del {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 32px; height: 32px; border: none; border-radius: 8px;
  background: var(--surface-2); color: var(--danger); transition: all 0.15s ease;
}
.expense-del:active { transform: scale(0.95); }

/* --------------------------------- chart ---------------------------------- */
.chart { display: flex; height: 112px; align-items: flex-end; gap: 8px; margin-top: 12px; }
.chart-col { display: flex; flex: 1; flex-direction: column; align-items: center; gap: 4px; }
.chart-val { font-size: 10px; font-weight: 600; color: var(--dim); font-variant-numeric: tabular-nums; }
.chart-bar { width: 100%; border-radius: 8px 8px 3px 3px; background: var(--accent); transition: height 0.5s ease; }
.chart-day { font-size: 10px; color: var(--dim); }

/* --------------------------------- misc ----------------------------------- */
.empty-state { padding: 56px 16px; text-align: center; }
.empty-icon {
  margin: 0 auto 16px; display: flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 24px; background: var(--accent-soft); color: var(--accent);
}
.empty-state .empty-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.empty-state .empty-body { margin: 6px auto 0; max-width: 320px; font-size: 14px; line-height: 1.6; color: var(--dim); }

.spinner {
  margin: 0 auto 16px; width: 40px; height: 40px; border-radius: 999px;
  border: 3px solid var(--surface-3); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.center-pad { padding: 96px 0; text-align: center; }
.center-pad .dim { font-size: 14px; color: var(--dim); }

.khqr-img { max-height: 256px; border-radius: 16px; border: 1px solid var(--border); object-fit: contain; }
.khqr-img.center { display: block; margin: 0 auto; max-height: 224px; }
.file-btn {
  display: inline-block; border-radius: 12px; background: var(--surface-2); color: var(--text);
  padding: 10px 16px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.15s ease;
}
.file-btn:active { transform: scale(0.98); }

.item-row { display: flex; gap: 8px; }
.item-row .grow { flex: 1; min-width: 0; }
.item-row .w-qty { width: 64px; flex-shrink: 0; }
.item-row .w-price { width: 80px; flex-shrink: 0; }
.item-col-label { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 500; color: var(--dim); }
.totals-line { font-size: 14px; color: var(--dim); }
.totals-line strong { color: var(--text); }

/* ------------------------- order form: sections -------------------------- */
.form-section {
  display: flex; flex-direction: column; gap: 12px;
  border: 1px solid var(--border); border-radius: 18px; padding: 16px;
  background: color-mix(in srgb, var(--surface-2) 38%, transparent);
}
.form-section-title {
  font-size: 15px; font-weight: 700; color: var(--dim);
}
.fee-chips-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
.fee-chips-row button { white-space: nowrap; flex-shrink: 0; }
.order-action-bar {
  position: sticky; bottom: -20px; z-index: 5;
  margin: 2px -20px -20px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border-top: 1px solid var(--border);
  box-shadow: 0 -8px 24px -16px rgba(10, 25, 20, 0.35);
}
.order-action-bar .totals-line { flex: 1; min-width: 0; font-size: 13px; line-height: 1.45; }
.order-action-bar .totals-line strong { font-size: 17px; white-space: nowrap; }
.order-action-bar .btn-primary { flex-shrink: 0; padding: 13px 22px; }

/* --------------------- order form: product picker ------------------------ */
.picker-search { position: relative; }
.picker-search .search-icon {
  position: absolute; top: 50%; left: 14px; transform: translateY(-50%);
  color: var(--dim); pointer-events: none; display: flex;
}
.picker-search .input { border-radius: 999px; padding: 12px 16px 12px 44px; }
.picker-hint { font-size: 12px; color: var(--dim); }
.picker-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 264px; overflow-y: auto; -webkit-overflow-scrolling: touch;
  margin: 0 -4px; padding: 2px 4px;
}
.picker-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 56px; padding: 9px 12px; text-align: left;
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); color: var(--text);
  box-shadow: 0 1px 2px rgba(18, 32, 26, 0.04); transition: all 0.12s ease;
}
.picker-row:active { transform: scale(0.985); background: var(--accent-soft); }
.picker-row.in-order { border-color: var(--accent); }
.picker-row.is-out { opacity: 0.55; }
.picker-row-main { flex: 1; min-width: 0; }
.picker-row-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 600; }
.picker-row-sub { display: block; margin-top: 1px; font-size: 12px; color: var(--dim); }
.picker-row-sub .warn { color: var(--warn); font-weight: 600; }
.picker-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.picker-row-price { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.picker-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700;
}
.picker-out-badge {
  display: inline-block; border-radius: 999px; padding: 2px 8px;
  background: var(--danger-bg); color: var(--danger); font-size: 11px; font-weight: 700;
}
.picker-empty { padding: 14px 8px; text-align: center; font-size: 13px; color: var(--dim); }

/* --------------------- order form: chosen items -------------------------- */
.order-items-list { display: flex; flex-direction: column; gap: 8px; }
.order-items-empty { font-size: 13px; color: var(--dim); padding: 4px 2px; }
.order-item {
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
  padding: 10px 12px; box-shadow: 0 1px 2px rgba(18, 32, 26, 0.04);
}
.oi-top { display: flex; align-items: flex-start; gap: 8px; }
.oi-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; line-height: 1.35; }
.oi-remove {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 32px; height: 32px; margin: -4px -4px 0 0; border: none; border-radius: 999px;
  background: var(--surface-2); color: var(--danger); transition: all 0.12s ease;
}
.oi-remove:active { transform: scale(0.94); }
.oi-controls { display: flex; align-items: flex-end; gap: 10px; margin-top: 8px; }
.oi-field { display: flex; flex-direction: column; }
.oi-field.grow { flex: 1; min-width: 0; }
.oi-stepper { display: flex; align-items: stretch; gap: 6px; }
.oi-step-btn {
  width: 44px; height: 44px; flex: none; border: none; border-radius: 12px;
  background: var(--surface-2); color: var(--text); font-size: 20px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; transition: all 0.12s ease;
}
.oi-step-btn:active { transform: scale(0.95); background: var(--surface-3); }
.oi-step-btn.plus { background: var(--accent); color: var(--accent-ink); }
.oi-step-btn.plus:active { background: var(--accent-strong); }
.oi-qty-input {
  width: 52px; height: 44px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); font-size: 16px; font-weight: 600;
  text-align: center; outline: none; padding: 0 4px;
}
.oi-qty-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.oi-price-input { height: 44px; }
.oi-total {
  height: 44px; display: flex; align-items: center;
  font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.oi-static { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 14px; }
.oi-static .dim { color: var(--dim); }

.settings-grid { display: grid; align-items: start; gap: 20px; }
@media (min-width: 1280px) { .settings-grid { grid-template-columns: minmax(0, 1fr) 330px; } }
.settings-form-card { padding: 20px; }
.how-list { margin-top: 10px; padding-left: 20px; list-style: disc; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.6; color: var(--dim); }
.flag-chips { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.staff-row { display: flex; flex-wrap: wrap; gap: 8px; }
@media (min-width: 640px) { .staff-row { flex-wrap: nowrap; } }
.staff-row .grow { flex: 1; min-width: 144px; }
.staff-row .w-role { width: 128px; flex-shrink: 0; }
.staff-row .w-access { width: 144px; flex-shrink: 0; }
@media (max-width: 639.98px) { .staff-row .w-role { width: 112px; } }

.more-list { display: flex; flex-direction: column; gap: 6px; }
.more-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: none; border-radius: 16px; padding: 14px 16px; font-size: 16px; font-weight: 600;
  background: color-mix(in srgb, var(--surface-2) 60%, transparent); color: var(--text); transition: all 0.15s ease;
}
.more-item.active { background: var(--accent-soft); color: var(--accent-strong); }
.more-item .grow { flex: 1; }
.more-item .chev { color: var(--dim); display: flex; }
.sheet-prefs { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.sheet-prefs .pref-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 600; }

/* --------------------------------- login ---------------------------------- */
.login-wrap {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-card { width: 100%; max-width: 400px; padding: 28px 24px; }
.login-head { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 20px; }
.login-head h1 { margin-top: 14px; font-size: 24px; font-weight: 800; }
.login-head .sub { margin-top: 4px; font-size: 14px; color: var(--dim); }
.login-prefs { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }

/* --------------------------------- admin ---------------------------------- */
/* Admin home (management) screen: a dedicated page (no shop shell) with the
   Shops & accounts cards, wrapped in a centered column for phone/desktop. */
.noshop-wrap { min-height: 100dvh; padding: 28px 16px 40px; display: flex; justify-content: center; }
.noshop-inner { width: 100%; max-width: 880px; display: flex; flex-direction: column; gap: 12px; }
.noshop-inner .login-head { margin-bottom: 4px; }
.noshop-foot { display: flex; flex-direction: column; gap: 10px; }
.noshop-foot .pref-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.noshop-foot .pref-label { font-size: 12px; font-weight: 600; color: var(--dim); }
.user-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.user-line .grow { flex: 1; min-width: 0; }
.mini-btn {
  border: none; border-radius: 10px; background: var(--surface-2); color: var(--text);
  padding: 7px 12px; font-size: 13px; font-weight: 600; transition: all 0.15s ease;
}
.mini-btn:active { transform: scale(0.97); }
.mini-btn.danger { background: var(--danger-bg); color: var(--danger); }

/* --------------------- Fast & Simple: home --------------------- */
.home-new-order {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 17px 20px; font-size: 18px; font-weight: 700; border-radius: 16px;
}
.stat-trio { display: grid; grid-template-columns: repeat(3, 1fr); padding: 20px 8px; }
.trio-item { text-align: center; padding: 0 6px; min-width: 0; }
.trio-item + .trio-item { border-left: 1px solid var(--border); }
.trio-value {
  font-family: var(--font-display); font-size: 27px; line-height: 1.1; font-weight: 800;
  font-variant-numeric: tabular-nums; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.trio-value.warn { color: var(--warn); }
.trio-label { margin-top: 5px; font-size: 13px; font-weight: 500; color: var(--dim); }

.today-row {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px;
  padding: 2px 0; border: none; background: none; text-align: left; color: var(--text);
}
.today-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.today-name { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-sub { margin-top: 1px; font-size: 13px; color: var(--dim); }
.today-side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.summary-strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 12px; padding: 20px; }
@media (min-width: 640px) { .summary-strip { grid-template-columns: repeat(4, 1fr); } }
.sum-item { min-width: 0; }
.sum-value {
  font-family: var(--font-display); font-size: 20px; line-height: 1.15; font-weight: 800;
  font-variant-numeric: tabular-nums; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sum-value.warn { color: var(--warn); }
.sum-label { margin-top: 3px; font-size: 13px; color: var(--dim); }

/* --------------------- Fast & Simple: orders -------------------- */
.card-next { width: 100%; margin-top: 14px; padding: 13px 16px; font-size: 15px; }
.card-next + .card-actions { padding-top: 10px; }

/* ------------------- Fast & Simple: quick order ------------------ */
.quick-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: min(46dvh, 380px); overflow-y: auto; -webkit-overflow-scrolling: touch;
  margin: 0 -4px; padding: 2px 4px;
}
.quick-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border: 1px solid var(--border); border-radius: 16px;
  background: var(--surface); transition: background 0.12s ease, border-color 0.12s ease;
}
.quick-row.selected { background: var(--accent-soft); border-color: var(--accent); }
.quick-row.is-out { opacity: 0.6; }
.quick-row.is-out.selected { opacity: 1; }
.quick-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.quick-row-name { font-size: 16px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-row-sub { margin-top: 2px; font-size: 13px; color: var(--dim); }
.quick-row-sub .warn { color: var(--warn); font-weight: 600; }
.quick-price-row { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.quick-price-label { font-size: 13px; color: var(--dim); white-space: nowrap; }
.quick-price-input {
  width: 84px; height: 38px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font-size: 15px; font-weight: 600;
  text-align: center; outline: none; padding: 0 6px;
}
.quick-price-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.quick-line-total { margin-left: auto; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.quick-stepper { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.quick-qty { min-width: 26px; text-align: center; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.oi-step-btn:disabled { opacity: 0.35; }
.oi-step-btn:disabled:active { transform: none; }

.quick-sub-label { font-size: 13px; font-weight: 600; color: var(--dim); }
.cust-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cust-chip {
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  padding: 9px 15px; font-size: 15px; font-weight: 600; color: var(--text);
  transition: all 0.12s ease;
}
.cust-chip:active { transform: scale(0.97); background: var(--accent-soft); border-color: var(--accent); }

.details-toggle {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
  padding: 12px 16px; font-size: 15px; font-weight: 600; color: var(--text);
  transition: background 0.15s ease;
}
.details-toggle:active { transform: scale(0.99); }
.details-toggle .dt-chev { display: flex; color: var(--dim); transition: transform 0.18s ease; }
.details-toggle.open .dt-chev { transform: rotate(90deg); }

/* --------------------- stock screen: grouped photo rows ------------------- */
.stock-actions { display: flex; gap: 10px; margin-top: 12px; }
.stock-actions > button { flex: 1; }
.stock-act {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 13px 16px; font-size: 15px; border-radius: 14px;
}

.prod-thumb {
  width: 52px; height: 52px; border-radius: 14px; overflow: hidden; flex-shrink: 0;
  background: var(--accent-soft); display: flex; align-items: center; justify-content: center;
}
.prod-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prod-thumb.letter {
  color: var(--accent-strong); font-family: var(--font-display);
  font-size: 21px; font-weight: 700;
}
.prod-thumb.sm { width: 40px; height: 40px; border-radius: 11px; }
.prod-thumb.sm.letter { font-size: 16px; }
.prod-thumb.lg { width: 72px; height: 72px; border-radius: 16px; }
.prod-thumb.lg.letter { font-size: 28px; }

.prod-list-card { padding: 4px 14px; }
.prod-list { list-style: none; margin: 0; padding: 0; }
.prod-list > li { border-bottom: 1px solid var(--border); }
.prod-list > li:last-child { border-bottom: none; }
.prod-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 0; background: none; border: none; cursor: pointer;
  text-align: left; color: var(--text); font: inherit;
}
.prod-row:active { opacity: 0.65; }
.prod-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.prod-row-name {
  font-size: 15px; font-weight: 600; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.prod-variant { color: var(--dim); font-weight: 500; }
.prod-row-sub { font-size: 12.5px; color: var(--dim); margin-top: 1px; }

.stock-section { margin-top: 22px; }
.stock-section-head { display: flex; align-items: center; gap: 8px; margin: 0 2px 10px; }
.stock-section-head h2 { font-size: 16px; font-weight: 700; }
.count-badge {
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
}
.count-badge.danger { background: var(--danger-ico); }
.count-badge.warn { background: var(--warn-ico); }
.see-all {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: var(--accent-strong); font-size: 13px; font-weight: 600; padding: 4px 2px;
}

/* ------------------------- product photo (form) --------------------------- */
.prod-photo-row { display: flex; gap: 14px; align-items: flex-start; }
.prod-photo-preview {
  width: 72px; height: 72px; border-radius: 16px; object-fit: cover;
  border: 1px solid var(--border); flex-shrink: 0;
}
.prod-photo-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

/* --------------------- sheet stock controls / buttons --------------------- */
.sheet-stock-block {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px;
  background: var(--surface-2);
}
.sheet-qty { font-size: 21px; font-weight: 800; line-height: 1.2; }
.sheet-qty .dim { font-size: 13px; font-weight: 500; color: var(--dim); }
.card-sub-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ---------------------------- product detail ------------------------------ */
.sheet-head.detail-head { justify-content: flex-start; }
.sheet-head.detail-head h2 { flex: 1; text-align: center; font-size: 16px; }
.sheet-edit-btn {
  border: none; border-radius: 999px; background: var(--surface-2); color: var(--text);
  padding: 8px 15px; font-size: 14px; font-weight: 600; cursor: pointer; flex-shrink: 0;
  transition: all 0.15s ease;
}
.sheet-edit-btn:active { transform: scale(0.96); background: var(--surface-3); }
.detail-photo {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block;
  border-radius: 18px; border: 1px solid var(--border); background: var(--accent-soft);
}
.detail-photo.letter {
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-strong); font-family: var(--font-display);
  font-size: 84px; font-weight: 700;
}
.detail-name { font-size: 24px; font-weight: 800; line-height: 1.25; margin-top: 16px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.detail-section { margin-top: 24px; }
.detail-section-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.ov-list { border-top: 1px solid var(--border); }
.ov-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.ov-label { font-size: 14px; color: var(--dim); flex-shrink: 0; }
.ov-value { font-size: 14.5px; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.detail-delete { margin-top: 28px; }
