/* Chợ Sỉ Buôn - giao diện mobile-first, chạm là chạy */
:root {
  --pri: #0a7d5f;
  --pri-d: #07624a;
  --pri-l: #e3f4ee;
  --acc: #f26b1d;
  --acc-d: #d85a10;
  --red: #dc2626;
  --red-l: #fdecec;
  --amber: #b45309;
  --amber-l: #fef3c7;
  --blue: #1d64d8;
  --blue-l: #e6effd;
  --bg: #f2f4f5;
  --card: #ffffff;
  --text: #16201c;
  --muted: #66736e;
  --line: #e3e8e6;
  --input: #f6f8f7;
  --shadow: 0 1px 2px rgba(16, 24, 20, 0.06), 0 2px 8px rgba(16, 24, 20, 0.05);
  --radius: 14px;
  --nav-h: 62px;
  --bar-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --pri: #22b58a;
    --pri-d: #1a9a75;
    --pri-l: #12352b;
    --acc: #fb8a45;
    --acc-d: #f26b1d;
    --red: #f87171;
    --red-l: #3a1d1d;
    --amber: #fbbf24;
    --amber-l: #3a2e12;
    --blue: #6aa2ff;
    --blue-l: #1a2a45;
    --bg: #0f1413;
    --card: #182120;
    --text: #e8eeec;
    --muted: #93a19b;
    --line: #26312e;
    --input: #1f2a28;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font: 15px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  overscroll-behavior-y: contain;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--pri); text-decoration: none; }
img { max-width: 100%; display: block; }
svg { width: 20px; height: 20px; flex: none; vertical-align: -4px; }
svg.xs { width: 14px; height: 14px; vertical-align: -2px; }
.num, .money { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.b { font-weight: 600; }
.right { text-align: right; }
.red { color: var(--red); }
.green { color: var(--pri); }
.orange { color: var(--acc); }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.row.top { align-items: flex-start; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stack > * + * { margin-top: 10px; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }
.p { padding: 14px; }

/* ---------- Khung ứng dụng ---------- */
#app { min-height: 100%; }
.shell { min-height: 100vh; padding-bottom: calc(var(--nav-h) + var(--safe-b)); }
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--bar-h); display: flex; align-items: center; gap: 6px; padding: 0 8px;
  background: var(--pri); color: #fff;
  padding-top: env(safe-area-inset-top, 0);
}
.topbar h1 { font-size: 17px; font-weight: 650; margin: 0 4px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .ibtn { color: #fff; }
.ibtn {
  width: 42px; height: 42px; border: 0; background: transparent; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none;
}
.ibtn:active { background: rgba(127, 127, 127, 0.18); }
.ibtn svg { width: 22px; height: 22px; }
.view { padding: 12px; max-width: 980px; margin: 0 auto; }
.view.flush { padding: 0; }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: flex; background: var(--card); border-top: 1px solid var(--line);
}
.bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font-size: 11.5px; font-weight: 500;
}
.bottomnav a svg { width: 24px; height: 24px; }
.bottomnav a.on { color: var(--pri); }
.bottomnav a.sell { position: relative; }
.bottomnav a.sell span.sellbtn {
  width: 54px; height: 54px; margin-top: -22px; border-radius: 18px; background: var(--acc); color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(242, 107, 29, 0.45);
}
.bottomnav a.sell span.sellbtn svg { width: 28px; height: 28px; }

/* Máy tính: thanh điều hướng bên trái */
.sidenav { display: none; }
@media (min-width: 1024px) {
  .shell { padding-bottom: 0; padding-left: 232px; }
  .bottomnav { display: none; }
  .sidenav {
    display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0; width: 232px; z-index: 25;
    background: var(--card); border-right: 1px solid var(--line); padding: 12px 10px; overflow-y: auto;
  }
  .sidenav .brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px; font-weight: 700; font-size: 17px; }
  .sidenav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text); font-weight: 500; }
  .sidenav a svg { width: 20px; height: 20px; color: var(--muted); }
  .sidenav a.on { background: var(--pri-l); color: var(--pri); }
  .sidenav a.on svg { color: var(--pri); }
  .sidenav .sell-btn { background: var(--acc); color: #fff; justify-content: center; margin: 4px 0 12px; font-weight: 650; }
  .sidenav .sell-btn svg { color: #fff; }
  .topbar .only-mobile { display: none; }
  .view { padding: 18px; }
}

/* ---------- Thẻ, danh sách ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.card-h { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 4px; font-weight: 650; }
.card-b { padding: 10px 14px 14px; }
.list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line);
  cursor: pointer; min-height: 60px; background: var(--card); width: 100%; text-align: left; border-left: 0; border-right: 0; border-top: 0;
}
.item:last-child { border-bottom: 0; }
a.item, button.item { color: var(--text); }
.item:active { background: var(--input); }
.item .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .s { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .v { text-align: right; flex: none; }
.thumb {
  width: 48px; height: 48px; border-radius: 10px; background: var(--input); flex: none; object-fit: cover;
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 700; font-size: 16px;
}
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--pri-l); color: var(--pri); display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.empty svg { width: 48px; height: 48px; opacity: 0.4; margin-bottom: 8px; }
.loader { padding: 18px; text-align: center; color: var(--muted); }
.spin { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--pri); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.section-t { font-size: 13px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; margin: 18px 4px 8px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--input); color: var(--muted); white-space: nowrap; }
.badge.green { background: var(--pri-l); color: var(--pri); }
.badge.red { background: var(--red-l); color: var(--red); }
.badge.amber { background: var(--amber-l); color: var(--amber); }
.badge.blue { background: var(--blue-l); color: var(--blue); }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; }
.kpi .l { font-size: 12.5px; color: var(--muted); }
.kpi .n { font-size: 20px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi.hero { grid-column: 1 / -1; background: linear-gradient(135deg, var(--pri), var(--pri-d)); color: #fff; }
.kpi.hero .l { color: rgba(255, 255, 255, 0.85); }
.kpi.hero .n { font-size: 28px; }
@media (min-width: 700px) { .kpi.hero { grid-column: span 2; } }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.quick a, .quick button {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 12px; border: 0;
  background: transparent; color: var(--text); font-size: 12.5px; text-align: center; cursor: pointer;
}
.quick a:active, .quick button:active { background: var(--input); }
.quick .ic { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: var(--pri-l); color: var(--pri); }
.quick .ic svg { width: 24px; height: 24px; }
.quick .ic.o { background: #fdeadf; color: var(--acc); }
.quick .ic.b { background: var(--blue-l); color: var(--blue); }
.quick .ic.a { background: var(--amber-l); color: var(--amber); }
@media (prefers-color-scheme: dark) { .quick .ic.o { background: #3a2415; } }

.chart { display: flex; align-items: flex-end; gap: 3px; height: 130px; padding-top: 8px; }
.chart .bar { flex: 1; background: var(--pri); opacity: 0.85; border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.chart .bar.today { background: var(--acc); opacity: 1; }
.chart-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text);
  font-weight: 600; cursor: pointer; white-space: nowrap; user-select: none;
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 20px; height: 20px; }
.btn.pri { background: var(--pri); border-color: var(--pri); color: #fff; }
.btn.acc { background: var(--acc); border-color: var(--acc); color: #fff; }
.btn.danger { color: var(--red); border-color: var(--red-l); background: var(--red-l); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--pri); }
.btn.sm { height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn.lg { height: 54px; font-size: 17px; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }
.btns { display: flex; gap: 10px; }
.btns > .btn { flex: 1; }

.fab {
  position: fixed; right: 16px; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); z-index: 25;
  width: 56px; height: 56px; border-radius: 18px; border: 0; background: var(--pri); color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(10, 125, 95, 0.4); cursor: pointer;
}
.fab svg { width: 28px; height: 28px; }
@media (min-width: 1024px) { .fab { bottom: 24px; right: 24px; } }

/* ---------- Tìm kiếm, bộ lọc ---------- */
.searchbar { position: sticky; top: var(--bar-h); z-index: 15; background: var(--bg); padding: 10px 12px 8px; margin: -12px -12px 8px; }
@media (min-width: 1024px) { .searchbar { margin: -18px -18px 10px; padding: 12px 18px 10px; } }
.search {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 6px 0 12px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line);
}
.search svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search input { flex: 1; border: 0; background: transparent; outline: 0; height: 100%; min-width: 0; font-size: 16px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; color: var(--text);
}
.chip.on { background: var(--pri); border-color: var(--pri); color: #fff; }
.summary { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); padding: 4px 4px 8px; }

/* ---------- Form ---------- */
.form { display: grid; gap: 12px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 5px 2px; }
.field .hint { font-size: 12px; color: var(--muted); margin: 4px 2px 0; }
.field .err { font-size: 12.5px; color: var(--red); margin: 4px 2px 0; }
.input, .field input, .field select, .field textarea {
  width: 100%; height: 46px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--input); outline: 0; font-size: 16px;
}
.field textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--pri); background: var(--card); }
.field.invalid input, .field.invalid select { border-color: var(--red); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; }
.switch input { appearance: none; width: 50px; height: 30px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; flex: none; transition: 0.2s; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked { background: var(--pri); }
.switch input:checked::after { left: 23px; }
.seg { display: flex; background: var(--input); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { flex: 1; height: 38px; border: 0; border-radius: 9px; background: transparent; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--pri); box-shadow: var(--shadow); }

/* ---------- Bottom sheet / modal ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(8, 12, 10, 0.45); z-index: 60; opacity: 0; transition: opacity 0.2s; }
.backdrop.show { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-height: 92vh; display: flex; flex-direction: column;
  background: var(--card); border-radius: 20px 20px 0 0; transform: translateY(100%); transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  padding-bottom: var(--safe-b);
}
.sheet.full { top: 0; max-height: none; border-radius: 0; }
.sheet.show { transform: none; }
.sheet-h { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); min-height: 56px; }
.sheet-h h3 { margin: 0; font-size: 17px; flex: 1; }
.sheet-b { overflow-y: auto; padding: 14px 16px; flex: 1; -webkit-overflow-scrolling: touch; }
.sheet-f { padding: 10px 16px 12px; border-top: 1px solid var(--line); }
.grip { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 8px auto 0; }
@media (min-width: 700px) {
  .sheet, .sheet.full { left: 50%; right: auto; top: 50%; bottom: auto; width: 560px; max-height: 88vh; border-radius: 18px;
    transform: translate(-50%, -46%) scale(0.98); opacity: 0; transition: 0.2s; }
  .sheet.show { transform: translate(-50%, -50%); opacity: 1; }
  .sheet.wide { width: 860px; }
  .grip { display: none; }
}
.menu .item { min-height: 54px; }

.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b) + 14px); z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { background: #1d2723; color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 14.5px; max-width: 92vw; box-shadow: 0 6px 20px rgba(0,0,0,.25); animation: tin 0.2s; }
.toast.err { background: var(--red); }
.toast.ok { background: var(--pri-d); }
@keyframes tin { from { transform: translateY(10px); opacity: 0; } }

/* ---------- Bán hàng (POS) ---------- */
.pos { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.pos .topbar { flex: none; }
.pos-search { padding: 10px 12px 0; background: var(--bg); flex: none; }
.pos-grid { flex: 1; overflow-y: auto; padding: 8px 12px 110px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; align-content: start; }
.pcard {
  background: var(--card); border-radius: 12px; box-shadow: var(--shadow); padding: 10px; cursor: pointer; border: 2px solid transparent;
  display: flex; flex-direction: column; gap: 6px; min-height: 96px; position: relative; text-align: left; user-select: none;
}
.pcard:active { transform: scale(0.97); }
.pcard.in { border-color: var(--pri); }
.pcard .nm { font-weight: 600; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .pr { color: var(--pri); font-weight: 700; margin-top: auto; }
.pcard .st { font-size: 12px; color: var(--muted); }
.pcard .qb { position: absolute; top: -6px; right: -6px; min-width: 26px; height: 26px; border-radius: 13px; background: var(--acc); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 6px; }
.pcard img { width: 100%; height: 90px; object-fit: cover; border-radius: 8px; }
.cartbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 40; height: 60px; border-radius: 16px;
  background: var(--acc); color: #fff; display: flex; align-items: center; padding: 0 8px 0 16px; gap: 12px; border: 0;
  box-shadow: 0 8px 22px rgba(242, 107, 29, 0.45); cursor: pointer; font-weight: 600;
}
.cartbar .cnt { background: #fff; color: var(--acc); min-width: 30px; height: 30px; border-radius: 15px; display: flex; align-items: center; justify-content: center; font-weight: 700; padding: 0 8px; }
.cartbar .tot { font-size: 19px; font-weight: 700; margin-left: auto; }
.cartbar .go { background: rgba(255,255,255,.2); height: 44px; padding: 0 14px; border-radius: 12px; display: flex; align-items: center; }
@media (min-width: 1024px) { .pos { margin-left: 0; } .cartbar { left: auto; width: 420px; right: 24px; } }

.line { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line .nm { font-weight: 600; line-height: 1.3; }
.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; height: 38px; flex: none; }
.stepper button { width: 38px; height: 38px; border: 0; background: var(--input); font-size: 20px; cursor: pointer; color: var(--text); }
.stepper input { width: 58px; height: 38px; border: 0; text-align: center; background: var(--card); outline: 0; font-weight: 600; font-size: 16px; }
.totals { display: grid; gap: 8px; }
.totals .row { justify-content: space-between; }
.totals .grand { font-size: 20px; font-weight: 700; }
.quickpay { display: flex; gap: 6px; flex-wrap: wrap; }
.quickpay button { flex: 1 0 28%; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--input); font-weight: 600; cursor: pointer; font-size: 14px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14.5px; }
.kv > :nth-child(odd) { color: var(--muted); }
.kv > :nth-child(even) { text-align: right; font-weight: 500; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.table th { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.table td.r, .table th.r { text-align: right; }
.scroll-x { overflow-x: auto; }

/* ---------- Đăng nhập ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px 18px; max-width: 440px; margin: 0 auto; }
.auth .logo { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth .logo b { font-size: 24px; }
.auth h2 { margin: 0 0 4px; font-size: 22px; }
.ind-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ind { border: 1.5px solid var(--line); background: var(--card); border-radius: 12px; padding: 10px; display: flex; gap: 8px; align-items: center; cursor: pointer; font-size: 13.5px; text-align: left; min-height: 56px; }
.ind .e { font-size: 22px; }
.ind.on { border-color: var(--pri); background: var(--pri-l); }

/* ---------- Chấm công ---------- */
.ts-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.ts-day { aspect-ratio: 1; border-radius: 9px; border: 1px solid var(--line); background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 13px; cursor: pointer; }
.ts-day.present { background: var(--pri); color: #fff; border-color: var(--pri); }
.ts-day.half { background: var(--amber-l); color: var(--amber); }
.ts-day.leave { background: var(--blue-l); color: var(--blue); }
.ts-day.absent { background: var(--red-l); color: var(--red); }

/* ---------- In hóa đơn ---------- */
.receipt { width: 76mm; margin: 0 auto; font: 12.5px/1.4 'Courier New', monospace; color: #000; background: #fff; padding: 8px; }
.receipt h2 { font-size: 15px; text-align: center; margin: 2px 0; }
.receipt .c { text-align: center; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt td { padding: 2px 0; vertical-align: top; }
.receipt hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
@media print {
  body { background: #fff; }
  .no-print, .topbar, .bottomnav, .sidenav, .toast-wrap { display: none !important; }
  .shell { padding: 0 !important; }
  .view { padding: 0; max-width: none; }
}

/* products & stock */
.stickybar { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b)); padding: 10px 12px; background: var(--bg); z-index: 20; }
.stickybar > div { max-width: 956px; margin: 0 auto; }
@media (min-width: 1024px) { .stickybar { left: 232px; bottom: 0; } }
.gallery { display: flex; gap: 4px; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--radius) var(--radius) 0 0; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery a { flex: none; width: 88%; max-width: 360px; scroll-snap-align: start; }
.gallery a:only-child { width: 100%; max-width: none; }
.gallery img { width: 100%; height: 240px; object-fit: cover; background: var(--input); }
.imgs { display: flex; gap: 8px; flex-wrap: wrap; }
.imgs .img { position: relative; width: 76px; height: 76px; border-radius: 12px; overflow: hidden; background: var(--input); border: 1px solid var(--line); flex: none; cursor: pointer; padding: 0; }
.imgs .img img { width: 100%; height: 100%; object-fit: cover; }
.imgs .img.main { border: 2px solid var(--pri); }
.imgs .img.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 12px; border-style: dashed; }
.imgs .img.add svg { width: 22px; height: 22px; }
.x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.55); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; z-index: 1; }
.x svg { width: 14px; height: 14px; }
.subrow { position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 12px; background: var(--card); }
.subrow .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.subrow .two + .two { margin-top: 8px; }
.subrow > .x { background: var(--red-l); color: var(--red); top: 6px; right: 6px; }
.subrow > .x + div { padding-right: 28px; }
.subrow .attr { display: grid; grid-template-columns: 2fr 3fr; gap: 10px; }
.inrow { display: flex; gap: 6px; }
.inrow > input, .inrow > select { flex: 1; min-width: 0; }
.btn.sq { width: 46px; padding: 0; flex: none; }
.item.warn { background: var(--amber-l); }
.qin { width: 88px; flex: none; text-align: center; font-weight: 600; }
.stepper input.qin { padding: 0 4px; border-radius: 0; height: 38px; }
/* cash staff posts reports settings */
.range-custom { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.range-custom .input { height: 40px; font-size: 15px; background: var(--card); }
.kpi .n.green { color: var(--pri); }
.kpi .n.red { color: var(--red); }
button.ts-day { padding: 0; font: inherit; color: var(--text); gap: 1px; }
button.ts-day b { font-size: 14px; }
button.ts-day span { font-size: 10.5px; line-height: 1; }
.ts-day.today { outline: 2px solid var(--acc); outline-offset: 1px; }
.ts-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.ts-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ts-legend i.ts-day { width: 14px; height: 14px; border-radius: 4px; display: inline-block; cursor: default; aspect-ratio: auto; }
.hbar { height: 5px; border-radius: 3px; background: var(--input); margin-top: 6px; overflow: hidden; }
.hbar i { display: block; height: 100%; background: var(--pri); border-radius: 3px; }
.pl-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.pl-row.sub { padding-left: 12px; color: var(--muted); }
.pl-row.sub2 { padding: 5px 0 5px 26px; font-size: 13px; color: var(--muted); border-bottom: 0; }
.pl-row.total { font-weight: 650; }
.pl-row.grand { font-size: 19px; font-weight: 700; border-bottom: 0; padding-top: 12px; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.img-tile { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--input); border: 1px dashed var(--line); display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; padding: 0; }
.img-tile.cover { aspect-ratio: 16 / 9; width: 100%; max-width: 380px; }
.img-tile img { width: 100%; height: 100%; object-fit: cover; }
.img-tile svg { width: 24px; height: 24px; }
.img-tile .x { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.55); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.img-tile .x svg { width: 16px; height: 16px; }

/* notifications */
.ibtn.bell { position: relative; }
.bell-n { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--pri); pointer-events: none; }
.item.noti { width: 100%; text-align: left; align-items: flex-start; }
.item.noti .t, .item.noti .s { white-space: normal; }
.item.noti .t { font-weight: 500; }
.item.noti.unread { background: var(--pri-l); }
.item.noti.unread .t { font-weight: 700; }
.item.noti .avatar.red { background: var(--red-l); color: var(--red); }
.item.noti .avatar.amber { background: var(--amber-l); color: var(--amber); }
.item.noti .avatar svg { width: 20px; height: 20px; }
.noti-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--pri); flex: none; margin-top: 6px; }
