/* OSHA Shop Manager - app styles */
:root {
  --bg: #f3f4f6;
  --card: #ffffff;
  --ink: #14181f;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-2: #d1d5db;
  --brand: #0f172a;
  --brand-2: #1c2536;
  --accent: #e8a33d;
  --accent-soft: #fdf3e2;
  --ok: #0f766e;
  --ok-soft: #e6f5f2;
  --warn: #b45309;
  --warn-soft: #fdf1e3;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 10px 26px rgba(16, 24, 40, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 10px; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.spacer { flex: 1; }
.link { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 13px; }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }
.danger-text { color: var(--danger); }
.mono { font-family: var(--mono); font-size: 12px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; background: transparent; color: var(--ink);
  padding: 9px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 13.5px;
  white-space: nowrap; transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); }
.btn-ghost { border-color: var(--line-2); background: #fff; }
.btn-ghost:hover { background: #f9fafb; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #9a1c12; }
.btn-sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }
.btn-big { padding: 14px 18px; font-size: 15.5px; flex: 1; }
.btn-block { width: 100%; padding: 12px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: #f3f4f6; color: var(--ink); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.ic { width: 18px; height: 18px; flex: none; }

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1000px 600px at 20% -10%, #23304a 0%, var(--brand) 55%, #0a0f18 100%);
}
.login-card {
  width: 100%; max-width: 380px; background: var(--card); border-radius: 20px;
  padding: 30px 26px 22px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.login-brand { text-align: center; margin-bottom: 22px; }
.login-brand h1 { font-size: 24px; letter-spacing: .04em; }
.login-brand p { color: var(--muted); margin: 4px 0 0; font-size: 13px; }
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 12px; background: var(--brand); color: var(--accent);
  font-weight: 800; letter-spacing: .06em; font-size: 13px; overflow: hidden;
}
.logo-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.logo-mark.big { width: 64px; height: 64px; font-size: 18px; border-radius: 18px; margin-bottom: 12px; }
.logo-mark.small { width: 30px; height: 30px; font-size: 9px; border-radius: 9px; }
.login-card .field { margin-bottom: 12px; }
.login-error { color: var(--danger); font-size: 13px; min-height: 18px; margin: 2px 0 8px; }
.login-hint { margin: 14px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
.login-foot { margin: 6px 0 0; font-size: 11px; color: var(--muted); text-align: center; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--brand); color: #cbd5e1; display: flex; flex-direction: column;
  padding: 18px 12px; position: sticky; top: 0; height: 100vh;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.side-shop b { display: block; color: #fff; font-size: 14px; }
.side-shop small { color: #94a3b8; font-size: 11px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px;
  color: #cbd5e1; text-decoration: none; font-size: 13.5px; font-weight: 500;
}
.nav-item .ic { opacity: .8; }
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item.active { background: rgba(232, 163, 61, .16); color: #fff; }
.nav-item.active .ic { color: var(--accent); opacity: 1; }
.side-foot { border-top: 1px solid rgba(255, 255, 255, .09); padding-top: 12px; margin-top: 8px; }
.side-user { display: flex; align-items: center; gap: 9px; padding: 4px 8px 10px; }
.side-user .ic { color: var(--accent); }
.side-user b { display: block; color: #fff; font-size: 13px; }
.side-user small { color: #94a3b8; font-size: 11px; }
.side-logout {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px;
  background: transparent; border: 0; color: #94a3b8; cursor: pointer; border-radius: 8px; font-size: 13px;
}
.side-logout:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: 12px 22px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.menu-btn { display: none; }
.mobile-brand { display: none; align-items: center; gap: 8px; }
.top-spacer { flex: 1; }
.sync-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 12px; cursor: pointer;
}
.sync-pill .ic { width: 14px; height: 14px; }
.sync-pill.ok { color: var(--ok); border-color: #bfe3dd; background: var(--ok-soft); }
.sync-pill.syncing { color: var(--accent); border-color: #f3d9ae; background: var(--accent-soft); }
.sync-pill.error { color: var(--danger); border-color: #f3c9c4; background: var(--danger-soft); }
.top-user { text-align: right; }
.top-user b { display: block; font-size: 13px; }
.top-user small { color: var(--muted); font-size: 11px; }
.view { padding: 22px; max-width: 1400px; width: 100%; margin: 0 auto; }
.bottom-nav { display: none; }
.scrim { display: none; }

/* ---------- page bits ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 3px 0 0; font-size: 13px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-actions { display: flex; gap: 8px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi-grid.small { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 15px; box-shadow: var(--shadow); }
.kpi-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.kpi-value { font-size: 19.5px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi-value small { white-space: nowrap; }
.kpi-value small { font-size: 11px; color: var(--muted); font-weight: 600; }
.kpi-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.kpi.good .kpi-value { color: var(--ok); }
.kpi.warn .kpi-value { color: var(--warn); }
.grid-2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; }
.grid-2 > .card { margin-bottom: 16px; }
#dashChart { width: 100%; display: block; }

/* ---------- tables ---------- */
.dt-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.dt-search { position: relative; flex: 1; min-width: 200px; }
.dt-search .ic { position: absolute; left: 10px; top: 10px; color: var(--muted); width: 16px; height: 16px; }
.dt-search .input { padding-left: 34px; }
.dt-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.dt-actions { display: flex; gap: 8px; }
.dt-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 650; padding: 9px 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap; background: #fbfbfc;
}
.tbl th.num { text-align: right; }
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th .sort-ind { display: inline-block; width: 0; height: 0; margin-left: 5px; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--line-2); vertical-align: middle; }
.tbl td { padding: 10px; border-bottom: 1px solid #f1f2f4; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: #fbfbfc; }
.tbl.compact th, .tbl.compact td { padding: 7px 8px; }
.tbl .empty-row td, .empty { text-align: center; color: var(--muted); padding: 26px 10px; }
.actions-col { text-align: right; white-space: nowrap; }
.dt-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 12.5px; }
.pager { display: flex; align-items: center; gap: 8px; }
.page-num { color: var(--muted); font-size: 12px; }
.dt-range { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.dt-range .field.inline { margin: 0; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 4px; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 600; }
.field > span em { color: var(--danger); font-style: normal; }
.field.span-2 { grid-column: span 2; }
.field.inline { flex-direction: row; align-items: center; gap: 7px; }
.field.inline > span { white-space: nowrap; }
.field.check { flex-direction: row; align-items: center; gap: 8px; grid-column: span 2; }
.field.check span { color: var(--ink); font-size: 13px; }
.input {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 9px;
  background: #fff; outline: none; font-size: 13.5px; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232, 163, 61, .18); }
.input[readonly] { background: #f9fafb; color: var(--muted); }
.input.small { padding: 6px 9px; font-size: 12.5px; width: auto; }
.input.tiny { padding: 4px 7px; font-size: 12.5px; width: 72px; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7280'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
textarea.input { resize: vertical; }
.hint { color: var(--muted); font-size: 11.5px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.row-gap { display: flex; gap: 12px; align-items: center; margin-top: 10px; flex-wrap: wrap; }

/* ---------- badges, tabs ---------- */
.badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; background: #f3f4f6; color: var(--muted); font-size: 11.5px; font-weight: 650; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 9px 13px; background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--muted); cursor: pointer; font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- mini lists ---------- */
.mini-list { display: flex; flex-direction: column; }
.mini-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f1f2f4; }
.mini-row:last-child { border-bottom: 0; }
.mini-row b { display: block; font-size: 13px; }
.mini-row small { color: var(--muted); font-size: 11.5px; }
.matrix-block { margin-bottom: 16px; }
.matrix-block h4 { font-size: 13px; margin-bottom: 6px; }
.matrix .zero { color: #b6bac1; }

/* ---------- modal ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 100; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 520px; max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 30px 70px rgba(0, 0, 0, .35); }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 13px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.confirm-text { font-size: 14px; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.detail-total { font-size: 22px; font-weight: 700; }
.detail-total small { font-size: 11px; color: var(--muted); }
.detail-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin-top: 12px; max-width: 420px; margin-left: auto; }
.detail-totals > div { display: flex; justify-content: space-between; padding: 3px 0; font-size: 13px; }
.detail-totals .grand { grid-column: span 2; border-top: 1px solid var(--line); padding-top: 8px; font-size: 15px; }
.small-note { font-size: 11.5px; margin-top: 10px; }
.pick-list { display: flex; flex-direction: column; max-height: 52vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid #f1f2f4; background: #fff; width: 100%; text-align: left; border-left: 0; border-right: 0; border-top: 0; cursor: default; }
.pick-row:last-child { border-bottom: 0; }
.pick-btn { cursor: pointer; }
.pick-btn:hover { background: #fbfbfc; }
.pick-main { flex: 1; display: flex; flex-direction: column; }
.pick-main b { font-size: 13px; }
.pick-main small { color: var(--muted); font-size: 11.5px; }
.chev { color: var(--muted); }
.copy-row { display: flex; gap: 8px; }
.copy-row .input { flex: 1; }
.steps { margin: 6px 0 14px; padding-left: 20px; font-size: 13px; color: #374151; }
.steps li { margin-bottom: 5px; }
.ticks { margin: 8px 0; padding-left: 18px; }
.ticks li { margin-bottom: 4px; }
.logo-row { display: flex; gap: 16px; align-items: center; margin-top: 14px; }
.logo-preview { width: 84px; height: 84px; border: 1px dashed var(--line-2); border-radius: 12px; display: grid; place-items: center; color: var(--muted); font-size: 11px; overflow: hidden; background: #fafafa; }
.logo-preview img { max-width: 100%; max-height: 100%; }

.pur-foot { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 12px 0; }
.pur-foot .field { margin: 0; }
.pur-total { margin-left: auto; font-size: 14px; font-weight: 600; }
.line-table select.input { min-width: 220px; }

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #111827; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); animation: toastIn .18s ease; max-width: 90vw; }
.toast.success { background: #0f766e; }
.toast.error { background: #b42318; }
.toast.out { opacity: 0; transition: opacity .4s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: 1fr 408px; gap: 16px; align-items: start; }
.pos-left { min-width: 0; }
.pos-top { display: flex; gap: 10px; margin-bottom: 12px; }
.scan-box { position: relative; flex: 1; display: flex; align-items: center; background: #fff; border: 1px solid var(--line-2); border-radius: 12px; padding: 0 8px 0 12px; box-shadow: var(--shadow); }
.scan-box .ic { color: var(--muted); }
.scan-box .ic { margin-right: 6px; flex: none; }
.scan-box .input { border: 0; box-shadow: none; padding: 13px 8px; font-size: 15px; background: transparent; }
.scan-box .input:focus { box-shadow: none; }
.chips { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 12.5px; white-space: nowrap; color: var(--muted); font-weight: 600; }
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.prod { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; min-height: 98px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.prod:hover { border-color: var(--accent); }
.prod.out { opacity: .55; }
.prod-name { font-weight: 650; font-size: 13px; line-height: 1.25; }
.prod-meta { color: var(--muted); font-size: 11.5px; }
.prod-foot { margin-top: auto; display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.prod-foot b { font-size: 14px; }
.prod-foot small { color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.pos-cart { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; position: sticky; top: 74px; display: flex; flex-direction: column; max-height: calc(100vh - 96px); }
.cart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cart-cust { display: flex; gap: 6px; margin-bottom: 10px; }
.cart-cust .input { flex: 1; }
.cart-lines { flex: 1; overflow-y: auto; min-height: 90px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px 0; }
.cart-line { display: grid; grid-template-columns: minmax(0, 1fr) auto 62px 58px 26px; align-items: center; gap: 5px; padding: 7px 0; border-bottom: 1px solid #f4f4f6; }
.cart-line:last-child { border-bottom: 0; }
.cl-main b { font-size: 12.5px; display: block; line-height: 1.2; }
.cl-main small { color: var(--muted); font-size: 10.5px; }
.qty { display: flex; align-items: center; gap: 4px; }
.qty button { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; font-size: 14px; line-height: 1; }
.qty span { min-width: 20px; text-align: center; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.price-input { width: 66px; padding: 5px 6px; border: 1px solid var(--line-2); border-radius: 6px; font-size: 12px; text-align: right; }
.cl-total { text-align: right; font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.cart-totals { padding: 10px 0; }
.tot-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 3px 0; font-size: 13px; }
.tot-row.grand { font-size: 17px; font-weight: 700; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.tot-row.discount { flex-wrap: wrap; }
.tot-row.discount .input { width: 90px; text-align: right; }
.quick-disc { display: flex; gap: 4px; }
.quick-disc button { padding: 3px 7px; border-radius: 6px; border: 1px solid var(--line); background: #fff; font-size: 11px; cursor: pointer; color: var(--muted); }
.pay-box { border-top: 1px solid var(--line); padding-top: 10px; }
.methods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.method { padding: 8px 4px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--muted); }
.method.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.paid-row { display: flex; align-items: center; gap: 8px; }
.paid-row label { font-size: 12px; color: var(--muted); font-weight: 600; }
.paid-row .input { flex: 1; text-align: right; }
.change { font-size: 12px; color: var(--ok); min-width: 82px; text-align: right; }
.credit-box { margin-top: 8px; }
.cart-actions { display: flex; gap: 8px; margin-top: 10px; }
.cart-fab { display: none; }
.sale-done { text-align: center; padding: 6px 4px 2px; }
.done-check { width: 54px; height: 54px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; margin: 0 auto 10px; }
.done-check .ic { width: 28px; height: 28px; }
.done-total { font-size: 28px; font-weight: 750; margin: 6px 0 4px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .pos { grid-template-columns: 1fr; }
  .pos-cart {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 60;
    border-radius: 18px 18px 0 0; max-height: 88vh; transform: translateY(105%);
    transition: transform .22s ease; padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }
  .pos.cart-open .pos-cart { transform: translateY(0); }
  .cart-fab {
    display: block; position: fixed; left: 14px; right: 14px; bottom: calc(68px + env(safe-area-inset-bottom));
    z-index: 55; padding: 13px; border-radius: 12px; border: 0; background: var(--brand); color: #fff;
    font-weight: 700; font-size: 14.5px; box-shadow: 0 10px 24px rgba(0, 0, 0, .25);
  }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 254px; z-index: 90;
    transform: translateX(-102%); transition: transform .2s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .scrim.show { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 80; }
  .menu-btn { display: inline-flex; }
  .mobile-brand { display: flex; }
  .top-user { display: none; }
  .view { padding: 14px 14px 96px; }
  .topbar { padding: 10px 14px; }
  .page-head { margin-bottom: 14px; }
  .page-head h1 { font-size: 19px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .kpi-value { font-size: 18px; }
  .card { padding: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: span 1; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    backdrop-filter: blur(10px);
  }
  .bn-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 0; color: var(--muted); text-decoration: none; font-size: 10px; font-weight: 600; }
  .bn-item .ic { width: 20px; height: 20px; }
  .bn-item.active { color: var(--ink); }
  .bn-item.active .ic { color: var(--accent); }
  .pos { padding-bottom: 30px; }
  .prod-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .modal-wrap { padding: 0; align-items: flex-end; }
  .modal { max-width: none; border-radius: 18px 18px 0 0; max-height: 94vh; }
  .modal.wide { max-width: none; }
  .detail-totals { grid-template-columns: 1fr; }
  .detail-totals .grand { grid-column: span 1; }
  .dt-range .spacer { display: none; }
}
@media (max-width: 420px) {
  .cart-line { grid-template-columns: 1fr auto 58px 28px; }
  .cart-line .price-input { display: none; }
  .methods { grid-template-columns: repeat(2, 1fr); }
}

/* ---------------- RTL (Arabic interface) ---------------- */
[dir="rtl"] .sidebar { border-right: 0; border-left: 1px solid rgba(255, 255, 255, .07); }
[dir="rtl"] .dt-search .ic { left: auto; right: 10px; }
[dir="rtl"] .dt-search .input { padding-left: 12px; padding-right: 34px; }
[dir="rtl"] select.input { background-position: left 10px center; padding-right: 10px; padding-left: 28px; }
[dir="rtl"] .tbl th { text-align: right; }
[dir="rtl"] .tbl th .sort-ind { margin-left: 0; margin-right: 5px; }
[dir="rtl"] .steps, [dir="rtl"] .ticks { padding-left: 0; padding-right: 20px; }
[dir="rtl"] .detail-totals { margin-left: 0; margin-right: auto; }
[dir="rtl"] .pur-total { margin-left: 0; margin-right: auto; }
[dir="rtl"] .scan-box .ic { margin-right: 0; margin-left: 6px; }
[dir="rtl"] .pick-row, [dir="rtl"] .prod { text-align: right; }
[dir="rtl"] .side-brand, [dir="rtl"] .side-user, [dir="rtl"] .top-user { text-align: right; }
[dir="rtl"] .nav-item .ic, [dir="rtl"] .bn-item .ic { margin-right: 0; margin-left: 10px; }
[dir="rtl"] .side-logout .ic, [dir="rtl"] .logout .ic { margin-right: 0; margin-left: 8px; }
[dir="rtl"] .login-hint, [dir="rtl"] .login-foot { text-align: center; }
@media (max-width: 860px) {
  [dir="rtl"] .sidebar { left: auto; right: 0; transform: translateX(100%); }
  [dir="rtl"] .sidebar.open { transform: translateX(0); }
}
.lang-btn {
  height: 34px; min-width: 40px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font: 700 13px/1 system-ui, sans-serif; cursor: pointer;
}
.lang-btn:hover { border-color: var(--line-2); }
.login-lang { display: flex; justify-content: flex-end; margin-bottom: -8px; }

/* brand wordmark */
.brand-wordmark { height: 30px; width: auto; max-width: 150px; object-fit: contain; display: block; }
.brand-wordmark.small { height: 26px; }
.login-wordmark { height: 54px; margin: 0 auto 6px; }
.brand-text { display: block; font: 800 20px/1.1 system-ui, sans-serif; letter-spacing: 1.5px; color: inherit; }
.brand-text-lg { font-size: 34px; margin: 0 auto 6px; letter-spacing: 2px; color: var(--ink); }
.side-brand .brand-text { color: #fff; }
.side-brand { align-items: flex-start; flex-direction: column; gap: 4px; }
.side-brand .side-shop small { display: block; margin-top: 2px; }
