/* Optiq — application styles.
   Light working surface with a deep navy rail, which stays readable under the
   bright lighting of a retail counter. */

:root {
  --navy-900:#0b1220; --navy-800:#0f172a; --navy-700:#1e293b; --navy-600:#334155;
  --bg:#f1f5f9; --surface:#ffffff; --surface-2:#f8fafc; --line:#e2e8f0; --line-2:#cbd5e1;
  --ink:#0f172a; --ink-2:#475569; --ink-3:#94a3b8;
  --brand:#0284c7; --brand-ink:#0369a1; --brand-soft:#e0f2fe;
  --ok:#059669; --ok-soft:#d1fae5;
  --warn:#d97706; --warn-soft:#fef3c7;
  --bad:#dc2626; --bad-soft:#fee2e2;
  --purple:#7c3aed; --purple-soft:#ede9fe;
  --radius:12px; --radius-sm:8px;
  --shadow:0 1px 2px rgba(15,23,42,.06), 0 4px 12px rgba(15,23,42,.05);
  --shadow-lg:0 10px 40px rgba(15,23,42,.18);
  --rail:246px;
}

* { box-sizing:border-box; }
html, body { height:100%; }
body {
  margin:0; background:var(--bg); color:var(--ink);
  font:15px/1.55 system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4 { margin:0; font-weight:650; letter-spacing:-.01em; }
a { color:var(--brand-ink); text-decoration:none; }
[hidden] { display:none !important; }

/* Base size for every inline SVG icon. Without this an icon dropped into a
   flex container (notices, banners) stretches to fill the whole box. */
.ic { width:18px; height:18px; flex:0 0 auto; }

/* ---------------------------------------------------------------- boot --- */
.boot {
  position:fixed; inset:0; background:var(--navy-800); color:#fff;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:22px; z-index:999;
}
.boot-logo { font-size:30px; font-weight:750; letter-spacing:-.03em; }
.spinner {
  width:28px; height:28px; border:3px solid rgba(255,255,255,.2);
  border-top-color:#fff; border-radius:50%; animation:spin .7s linear infinite;
}
@keyframes spin { to { transform:rotate(360deg); } }

/* --------------------------------------------------------------- shell --- */
.shell { display:flex; min-height:100vh; }

.rail {
  width:var(--rail); flex:0 0 var(--rail); background:var(--navy-800); color:#cbd5e1;
  display:flex; flex-direction:column; position:sticky; top:0; height:100vh;
}
.rail-head { padding:20px 20px 14px; border-bottom:1px solid rgba(255,255,255,.08); }
.rail-logo { color:#fff; font-size:21px; font-weight:750; letter-spacing:-.02em; }
.rail-shop { color:#94a3b8; font-size:12.5px; margin-top:3px; overflow:hidden;
  text-overflow:ellipsis; white-space:nowrap; }
.rail-nav { padding:12px 10px; overflow-y:auto; flex:1; }
.rail-nav a {
  display:flex; align-items:center; gap:11px; padding:9px 12px; border-radius:var(--radius-sm);
  color:#cbd5e1; font-size:14.5px; font-weight:500; margin-bottom:2px; cursor:pointer;
}
.rail-nav a:hover { background:rgba(255,255,255,.07); color:#fff; }
.rail-nav a.on { background:var(--brand); color:#fff; font-weight:600; }
.rail-nav a .ic { width:19px; height:19px; flex:0 0 19px; opacity:.9; }
.rail-nav a .pill {
  margin-left:auto; background:rgba(255,255,255,.16); color:#fff; font-size:11px;
  font-weight:700; padding:1px 7px; border-radius:99px; min-width:20px; text-align:center;
}
.rail-nav a.on .pill { background:rgba(255,255,255,.25); }
.rail-nav a .pill.hot { background:var(--bad); }
.rail-sep { margin:14px 12px 8px; font-size:11px; text-transform:uppercase;
  letter-spacing:.07em; color:#64748b; font-weight:700; }
.rail-foot { padding:12px; border-top:1px solid rgba(255,255,255,.08); }
.rail-user { display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:var(--radius-sm); }
.rail-user:hover { background:rgba(255,255,255,.06); }
.avatar {
  width:32px; height:32px; flex:0 0 32px; border-radius:50%; background:var(--brand);
  color:#fff; display:grid; place-items:center; font-weight:700; font-size:13px;
}
.rail-user-meta { min-width:0; flex:1; }
.rail-user-name { color:#fff; font-size:13.5px; font-weight:600;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rail-user-role { color:#94a3b8; font-size:11.5px; }

.main { flex:1; min-width:0; display:flex; flex-direction:column; }
.topbar {
  background:var(--surface); border-bottom:1px solid var(--line);
  padding:0 24px; height:60px; display:flex; align-items:center; gap:16px;
  position:sticky; top:0; z-index:20;
}
.topbar h1 { font-size:19px; }
.topbar-actions { margin-left:auto; display:flex; gap:9px; align-items:center; }
.burger { display:none; background:none; border:0; padding:6px; cursor:pointer; color:var(--ink); }
.view { padding:24px; flex:1; }

/* trial banner */
.trial {
  background:var(--warn-soft); border-bottom:1px solid #fde68a; color:#78350f;
  padding:9px 24px; font-size:13.5px; display:flex; gap:10px; align-items:center;
}
.trial.urgent { background:var(--bad-soft); border-color:#fecaca; color:#7f1d1d; }

/* --------------------------------------------------------------- cards --- */
.card {
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--radius); box-shadow:var(--shadow);
}
.card-head {
  padding:15px 18px; border-bottom:1px solid var(--line);
  display:flex; align-items:center; gap:12px;
}
.card-head h3 { font-size:15.5px; }
.card-head .sub { color:var(--ink-3); font-size:12.5px; margin-top:1px; }
.card-head .right { margin-left:auto; display:flex; gap:8px; align-items:center; }
.card-body { padding:18px; }
.card-body.tight { padding:0; }

.grid { display:grid; gap:16px; }
.g2 { grid-template-columns:repeat(2,minmax(0,1fr)); }
.g3 { grid-template-columns:repeat(3,minmax(0,1fr)); }
.g4 { grid-template-columns:repeat(4,minmax(0,1fr)); }
.stack { display:flex; flex-direction:column; gap:16px; }
.row { display:flex; gap:10px; align-items:center; }
.row.wrap { flex-wrap:wrap; }
.spacer { flex:1; }

/* ---------------------------------------------------------------- kpis --- */
.kpi {
  background:var(--surface); border:1px solid var(--line); border-radius:var(--radius);
  padding:16px 18px; box-shadow:var(--shadow);
}
.kpi-label { color:var(--ink-3); font-size:12px; font-weight:600;
  text-transform:uppercase; letter-spacing:.05em; }
.kpi-value { font-size:26px; font-weight:700; margin-top:6px; letter-spacing:-.02em; }
.kpi-foot { font-size:12.5px; color:var(--ink-2); margin-top:4px; }
.kpi.warn .kpi-value { color:var(--warn); }
.kpi.bad .kpi-value { color:var(--bad); }
.kpi.ok .kpi-value { color:var(--ok); }
.kpi.clickable { cursor:pointer; }
.kpi.clickable:hover { border-color:var(--brand); }

/* -------------------------------------------------------------- inputs --- */
label.field { display:block; margin-bottom:13px; }
label.field > span {
  display:block; font-size:12.5px; font-weight:600; color:var(--ink-2); margin-bottom:5px;
}
input[type=text],input[type=password],input[type=number],input[type=date],
input[type=search],input[type=tel],input[type=email],select,textarea {
  width:100%; padding:9px 11px; border:1px solid var(--line-2); border-radius:var(--radius-sm);
  background:var(--surface); color:var(--ink); font:inherit; font-size:14.5px;
}
input:focus,select:focus,textarea:focus {
  outline:2px solid var(--brand); outline-offset:-1px; border-color:transparent;
}
input:disabled,select:disabled { background:var(--surface-2); color:var(--ink-3); }
textarea { resize:vertical; min-height:70px; }
select { cursor:pointer; }
.hint { font-size:12.5px; color:var(--ink-3); margin-top:4px; }
.err-text { font-size:12.5px; color:var(--bad); margin-top:4px; }

.checkbox { display:flex; align-items:flex-start; gap:9px; cursor:pointer; padding:3px 0; }
.checkbox input { width:16px; height:16px; margin-top:3px; accent-color:var(--brand); cursor:pointer; }
.checkbox span { font-size:14px; }

/* ------------------------------------------------------------- buttons --- */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  padding:9px 15px; border:1px solid var(--line-2); border-radius:var(--radius-sm);
  background:var(--surface); color:var(--ink); font:inherit; font-size:14px; font-weight:600;
  cursor:pointer; white-space:nowrap;
}
.btn:hover { background:var(--surface-2); }
.btn:disabled { opacity:.5; cursor:not-allowed; }
.btn.primary { background:var(--brand); border-color:var(--brand); color:#fff; }
.btn.primary:hover { background:var(--brand-ink); }
.btn.danger { background:var(--bad); border-color:var(--bad); color:#fff; }
.btn.danger:hover { filter:brightness(.93); }
.btn.ghost { background:transparent; border-color:transparent; color:var(--ink-2); }
.btn.ghost:hover { background:var(--surface-2); color:var(--ink); }
.btn.sm { padding:5px 10px; font-size:13px; }
.btn.lg { padding:12px 20px; font-size:15.5px; }
.btn.block { width:100%; }
.btn .ic { width:16px; height:16px; }

/* --------------------------------------------------------------- chips --- */
.chips { display:flex; gap:7px; flex-wrap:wrap; }
.chip {
  padding:5px 12px; border-radius:99px; border:1px solid var(--line-2);
  background:var(--surface); font-size:13px; font-weight:500; cursor:pointer; white-space:nowrap;
}
.chip:hover { background:var(--surface-2); }
.chip.on { background:var(--navy-800); border-color:var(--navy-800); color:#fff; font-weight:600; }
.chip .n { opacity:.6; margin-left:4px; font-size:12px; }

.badge {
  display:inline-flex; align-items:center; gap:5px; padding:3px 9px; border-radius:99px;
  font-size:12px; font-weight:650; white-space:nowrap;
}
.badge.grey   { background:#f1f5f9; color:#475569; }
.badge.blue   { background:var(--brand-soft); color:var(--brand-ink); }
.badge.green  { background:var(--ok-soft); color:#065f46; }
.badge.amber  { background:var(--warn-soft); color:#92400e; }
.badge.red    { background:var(--bad-soft); color:#991b1b; }
.badge.purple { background:var(--purple-soft); color:#5b21b6; }

/* -------------------------------------------------------------- tables --- */
.table-wrap { overflow-x:auto; }
table.data { width:100%; border-collapse:collapse; font-size:14px; }
table.data th {
  text-align:left; padding:10px 14px; font-size:11.5px; font-weight:700; color:var(--ink-3);
  text-transform:uppercase; letter-spacing:.05em; border-bottom:1px solid var(--line);
  background:var(--surface-2); white-space:nowrap; position:sticky; top:0;
}
table.data td { padding:11px 14px; border-bottom:1px solid var(--line); vertical-align:middle; }
table.data tbody tr:last-child td { border-bottom:0; }
table.data tbody tr.click { cursor:pointer; }
table.data tbody tr.click:hover { background:var(--brand-soft); }
table.data .num { text-align:right; font-variant-numeric:tabular-nums; }
.muted { color:var(--ink-3); }
.strong { font-weight:650; }
.mono { font-variant-numeric:tabular-nums; }

.empty { padding:44px 20px; text-align:center; color:var(--ink-3); }
.empty h4 { font-size:15px; color:var(--ink-2); margin-bottom:5px; }
.empty p { margin:0; font-size:13.5px; }

/* --------------------------------------------------------------- modal --- */
.overlay {
  position:fixed; inset:0; background:rgba(15,23,42,.55); z-index:100;
  display:flex; align-items:center; justify-content:center; padding:20px;
  animation:fade .12s ease;
}
@keyframes fade { from { opacity:0; } }
.modal {
  background:var(--surface); border-radius:14px; box-shadow:var(--shadow-lg);
  width:100%; max-width:560px; max-height:92vh; display:flex; flex-direction:column;
  animation:pop .15s ease;
}
@keyframes pop { from { transform:translateY(8px) scale(.99); opacity:0; } }
.modal.wide { max-width:820px; }
.modal.narrow { max-width:420px; }
.modal-head {
  padding:17px 20px; border-bottom:1px solid var(--line); display:flex; align-items:center; gap:12px;
}
.modal-head h3 { font-size:16.5px; }
.modal-head .sub { font-size:12.5px; color:var(--ink-3); margin-top:2px; }
.modal-body { padding:20px; overflow-y:auto; flex:1; }
.modal-foot {
  padding:14px 20px; border-top:1px solid var(--line);
  display:flex; gap:9px; justify-content:flex-end; background:var(--surface-2);
  border-radius:0 0 14px 14px;
}
.x { background:none; border:0; font-size:22px; line-height:1; color:var(--ink-3);
  cursor:pointer; padding:2px 6px; margin-left:auto; }
.x:hover { color:var(--ink); }

/* -------------------------------------------------------------- toasts --- */
.toasts { position:fixed; bottom:20px; right:20px; z-index:200;
  display:flex; flex-direction:column; gap:9px; pointer-events:none; }
.toast {
  background:var(--navy-800); color:#fff; padding:11px 16px; border-radius:var(--radius-sm);
  box-shadow:var(--shadow-lg); font-size:14px; max-width:360px;
  animation:slide .18s ease; pointer-events:auto;
}
@keyframes slide { from { transform:translateX(16px); opacity:0; } }
.toast.ok  { background:var(--ok); }
.toast.bad { background:var(--bad); }

/* ---------------------------------------------------------------- auth --- */
.auth {
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(160deg,var(--navy-900),var(--navy-700)); padding:20px;
}
.auth-card { background:var(--surface); border-radius:16px; box-shadow:var(--shadow-lg);
  width:100%; max-width:400px; padding:32px; }
.auth-logo { font-size:27px; font-weight:750; letter-spacing:-.03em; text-align:center; }
.auth-sub { text-align:center; color:var(--ink-3); font-size:13.5px; margin:4px 0 26px; }
.auth-demo {
  margin-top:22px; padding-top:18px; border-top:1px solid var(--line);
  font-size:12.5px; color:var(--ink-3);
}
.auth-demo b { color:var(--ink-2); display:block; margin-bottom:7px; font-size:12px;
  text-transform:uppercase; letter-spacing:.05em; }
.demo-row { display:flex; justify-content:space-between; padding:3px 0; cursor:pointer; }
.demo-row:hover { color:var(--brand-ink); }
.demo-row code { background:var(--surface-2); padding:1px 6px; border-radius:4px; font-size:12px; }

/* ----------------------------------------------------------------- pos --- */
.pos { display:grid; grid-template-columns:1fr 380px; gap:16px; align-items:start; }
.pos-cart { position:sticky; top:76px; }
.cart-line {
  display:flex; gap:10px; padding:10px 0; border-bottom:1px solid var(--line); align-items:flex-start;
}
.cart-line:last-of-type { border-bottom:0; }
.cart-line-main { flex:1; min-width:0; }
.cart-line-name { font-size:13.5px; font-weight:600; }
.cart-line-meta { font-size:12px; color:var(--ink-3); margin-top:2px; }
.qty { display:flex; align-items:center; gap:0; border:1px solid var(--line-2); border-radius:6px; }
.qty button { width:24px; height:24px; border:0; background:none; cursor:pointer;
  color:var(--ink-2); font-size:15px; line-height:1; }
.qty button:hover { background:var(--surface-2); }
.qty span { min-width:26px; text-align:center; font-size:13px; font-weight:600;
  font-variant-numeric:tabular-nums; }
.totals { border-top:2px solid var(--line); margin-top:12px; padding-top:12px; }
.total-row { display:flex; justify-content:space-between; padding:3px 0; font-size:14px; }
.total-row.big { font-size:19px; font-weight:750; padding-top:9px; margin-top:7px;
  border-top:1px solid var(--line); }

.prod-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:10px; }
.prod {
  border:1px solid var(--line); border-radius:var(--radius-sm); padding:11px;
  cursor:pointer; background:var(--surface); text-align:left;
}
.prod:hover { border-color:var(--brand); background:var(--brand-soft); }
.prod-brand { font-size:11px; color:var(--ink-3); font-weight:650;
  text-transform:uppercase; letter-spacing:.04em; }
.prod-name { font-size:13.5px; font-weight:600; margin:2px 0 5px;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.prod-foot { display:flex; justify-content:space-between; align-items:center; }
.prod-price { font-weight:700; font-size:14px; }
.prod-stock { font-size:11.5px; }
.prod-stock.low { color:var(--bad); font-weight:650; }

/* ------------------------------------------------------------ job flow --- */
.flow { display:flex; gap:0; overflow-x:auto; padding:4px 0; }
.flow-step { flex:1; min-width:88px; text-align:center; position:relative; padding:0 4px; }
.flow-step::before {
  content:''; position:absolute; top:12px; left:-50%; width:100%; height:2px;
  background:var(--line-2); z-index:0;
}
.flow-step:first-child::before { display:none; }
.flow-step.done::before { background:var(--ok); }
.flow-dot {
  width:25px; height:25px; border-radius:50%; background:var(--surface);
  border:2px solid var(--line-2); margin:0 auto 6px; position:relative; z-index:1;
  display:grid; place-items:center; font-size:11px; font-weight:700; color:var(--ink-3);
}
.flow-step.done .flow-dot { background:var(--ok); border-color:var(--ok); color:#fff; }
.flow-step.now .flow-dot { background:var(--brand); border-color:var(--brand); color:#fff;
  box-shadow:0 0 0 4px var(--brand-soft); }
.flow-label { font-size:11px; color:var(--ink-3); line-height:1.3; }
.flow-step.now .flow-label { color:var(--brand-ink); font-weight:700; }
.flow-step.done .flow-label { color:var(--ink-2); }

.timeline { list-style:none; margin:0; padding:0; }
.timeline li { display:flex; gap:12px; padding-bottom:16px; position:relative; }
.timeline li::before {
  content:''; position:absolute; left:6px; top:16px; bottom:0; width:2px; background:var(--line);
}
.timeline li:last-child::before { display:none; }
.tl-dot { width:14px; height:14px; flex:0 0 14px; border-radius:50%;
  background:var(--brand); margin-top:3px; position:relative; z-index:1; }
.tl-body { flex:1; min-width:0; }
.tl-title { font-size:13.5px; font-weight:600; }
.tl-meta { font-size:12px; color:var(--ink-3); margin-top:1px; }

/* ------------------------------------------------------------------ rx --- */
table.rx { width:100%; border-collapse:collapse; font-size:14px; }
table.rx th { padding:6px 8px; font-size:11px; color:var(--ink-3); font-weight:700;
  text-transform:uppercase; letter-spacing:.05em; text-align:center; }
table.rx th:first-child { text-align:left; }
table.rx td { padding:5px 6px; text-align:center; }
table.rx td:first-child { text-align:left; font-weight:700; font-size:13px; color:var(--ink-2); }
table.rx input { text-align:center; padding:7px 4px; font-size:14px;
  font-variant-numeric:tabular-nums; }
.rx-val { font-variant-numeric:tabular-nums; font-weight:600; }

/* -------------------------------------------------------------- charts --- */
.bars { display:flex; align-items:flex-end; gap:2px; height:120px; }
.bar { flex:1; background:var(--brand-soft); border-radius:2px 2px 0 0; min-height:2px;
  position:relative; cursor:default; }
.bar:hover { background:var(--brand); }
.bar-tip {
  position:absolute; bottom:100%; left:50%; transform:translateX(-50%); margin-bottom:5px;
  background:var(--navy-800); color:#fff; font-size:11.5px; padding:3px 7px; border-radius:5px;
  white-space:nowrap; opacity:0; pointer-events:none; transition:opacity .1s;
}
.bar:hover .bar-tip { opacity:1; }
.hbar { height:7px; background:var(--line); border-radius:99px; overflow:hidden; margin-top:5px; }
.hbar > div { height:100%; background:var(--brand); border-radius:99px; }

/* ---------------------------------------------------------- perm matrix --- */
.perm-group { border:1px solid var(--line); border-radius:var(--radius-sm); margin-bottom:11px; }
.perm-group-head {
  padding:9px 13px; background:var(--surface-2); border-bottom:1px solid var(--line);
  font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.05em;
  color:var(--ink-2); border-radius:var(--radius-sm) var(--radius-sm) 0 0;
  display:flex; align-items:center; gap:8px;
}
.perm-row {
  display:flex; align-items:center; gap:10px; padding:8px 13px;
  border-bottom:1px solid var(--line); font-size:14px;
}
.perm-row:last-child { border-bottom:0; }
.perm-row input { width:16px; height:16px; accent-color:var(--brand); cursor:pointer; }
.perm-row label { flex:1; cursor:pointer; }
.perm-row .tag {
  font-size:10.5px; font-weight:700; padding:1px 6px; border-radius:4px;
  background:var(--warn-soft); color:#92400e; text-transform:uppercase; letter-spacing:.04em;
}

/* ------------------------------------------------------ customer cards --- */
.page-head { display:flex; align-items:flex-start; gap:16px; margin-bottom:18px; }
.page-head h2 { font-size:24px; letter-spacing:-.02em; }
.page-head .sub { color:var(--ink-3); font-size:14px; margin-top:2px; }
.page-head .right { margin-left:auto; display:flex; gap:9px; align-items:center; }

.search-lg { position:relative; margin-bottom:18px; }
.search-lg input {
  width:100%; padding:14px 14px 14px 44px; font-size:16px; border-radius:11px;
  border:1px solid var(--line-2); background:var(--surface);
}
.search-lg .ic {
  position:absolute; left:15px; top:50%; transform:translateY(-50%);
  width:19px; height:19px; color:var(--ink-3); pointer-events:none;
}

.cust-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:12px; }
.cust-card {
  display:flex; align-items:center; gap:13px; padding:14px 16px;
  background:var(--surface); border:1px solid var(--line); border-radius:var(--radius);
  cursor:pointer; box-shadow:var(--shadow);
}
.cust-card:hover { border-color:var(--brand); box-shadow:0 2px 10px rgba(2,132,199,.13); }
.cust-av {
  width:44px; height:44px; flex:0 0 44px; border-radius:50%;
  background:var(--brand-soft); color:var(--brand-ink);
  display:grid; place-items:center; font-weight:700; font-size:14.5px;
}
.cust-main { flex:1; min-width:0; }
.cust-name {
  font-weight:650; font-size:15px; overflow:hidden;
  text-overflow:ellipsis; white-space:nowrap;
}
.cust-phone {
  display:flex; align-items:center; gap:6px; margin-top:3px;
  color:var(--brand-ink); font-size:13.5px;
}
.cust-phone .ic { width:13px; height:13px; }
.cust-meta { font-size:12.5px; color:var(--ink-3); white-space:nowrap; align-self:flex-start; }
.cust-bal { margin-top:5px; }

/* ------------------------------------------------------- kanban board --- */
.toggle { display:flex; border:1px solid var(--line-2); border-radius:9px; overflow:hidden; }
.toggle button {
  border:0; background:var(--surface); padding:8px 11px; cursor:pointer;
  color:var(--ink-2); display:grid; place-items:center;
}
.toggle button:hover { background:var(--surface-2); }
.toggle button.on { background:var(--navy-800); color:#fff; }

.board { display:flex; gap:13px; overflow-x:auto; align-items:flex-start; padding-bottom:12px; }
.board-col { flex:0 0 288px; width:288px; }
.board-head {
  display:flex; align-items:center; gap:8px; padding:0 3px 10px;
  font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.06em;
  color:var(--ink-3);
}
.board-head .n { margin-left:auto; color:var(--ink-2); }
.board-head .late { color:var(--bad); }
.board-cards { display:flex; flex-direction:column; gap:9px; min-height:8px; }
.board-empty {
  border:1px dashed var(--line-2); border-radius:10px; padding:16px;
  text-align:center; color:var(--ink-3); font-size:12.5px;
}

.jcard {
  background:var(--surface); border:1px solid var(--line); border-radius:11px;
  padding:13px; cursor:pointer; box-shadow:var(--shadow);
}
.jcard:hover { border-color:var(--brand); }
.jcard.late { background:#fef4f4; border-color:#fecaca; }
.jcard-top { display:flex; gap:9px; align-items:baseline; }
.jcard-name {
  font-weight:650; font-size:14.5px; flex:1; min-width:0;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.jcard-no { font-size:12px; color:var(--ink-3); white-space:nowrap; }
.jcard-desc {
  font-size:13px; color:var(--ink-2); margin:6px 0 10px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.jcard-foot { display:flex; align-items:center; gap:9px; font-size:12.5px; }
.jcard-due { color:var(--ink-3); }
.jcard-late {
  display:inline-flex; align-items:center; gap:6px; color:var(--bad);
  font-weight:650; background:var(--bad-soft); padding:2px 9px; border-radius:99px;
}
.jcard-late::before {
  content:''; width:6px; height:6px; border-radius:50%; background:var(--bad); flex:0 0 6px;
}
.jcard-amt { margin-left:auto; font-weight:650; white-space:nowrap; }
.jcard-flag { margin-top:8px; }

/* -------------------------------------------------------------- search --- */
.search { position:relative; flex:1; max-width:340px; }
.search input { padding-left:34px; }
.search .ic { position:absolute; left:10px; top:50%; transform:translateY(-50%);
  width:16px; height:16px; color:var(--ink-3); pointer-events:none; }

.tabs { display:flex; gap:2px; border-bottom:1px solid var(--line); margin-bottom:18px;
  overflow-x:auto; }
.tab {
  padding:9px 15px; border:0; background:none; cursor:pointer; font:inherit; font-size:14px;
  font-weight:600; color:var(--ink-3); border-bottom:2px solid transparent; white-space:nowrap;
}
.tab:hover { color:var(--ink); }
.tab.on { color:var(--brand-ink); border-bottom-color:var(--brand); }

.kv { display:grid; grid-template-columns:auto 1fr; gap:7px 16px; font-size:14px; }
.kv dt { color:var(--ink-3); font-size:13px; }
.kv dd { margin:0; font-weight:550; }

.notice {
  padding:11px 14px; border-radius:var(--radius-sm); font-size:13.5px;
  display:flex; gap:10px; align-items:flex-start;
}
.notice.info  { background:var(--brand-soft); color:var(--brand-ink); }
.notice.warn  { background:var(--warn-soft); color:#92400e; }
.notice.bad   { background:var(--bad-soft); color:#991b1b; }
.notice.ok    { background:var(--ok-soft); color:#065f46; }

/* ------------------------------------------------------ job order form --- */
.job-form { display:flex; flex-direction:column; gap:16px; max-width:940px; }
.card.step { overflow:visible; }
.step-head {
  padding:15px 18px; border-bottom:1px solid var(--line);
  display:flex; align-items:baseline; gap:9px;
}
.step-head h3 { font-size:16px; }
.step-head .sub { color:var(--ink-3); font-size:13px; margin-top:2px; }
.step-n { font-weight:750; color:var(--ink-3); font-size:16px; }

.job-actions {
  display:flex; gap:10px; justify-content:flex-end; align-items:center;
  max-width:940px; margin-top:18px; padding-bottom:20px;
}
.job-actions .btn.lg { min-width:210px; }

/* customer picker */
.picker-results {
  border:1px solid var(--line); border-radius:var(--radius-sm);
  margin-top:10px; max-height:290px; overflow-y:auto;
}
.picker-row {
  display:flex; align-items:center; gap:11px; padding:10px 13px;
  border-bottom:1px solid var(--line); cursor:pointer;
}
.picker-row:last-child { border-bottom:0; }
.picker-row:hover { background:var(--brand-soft); }
.picker-empty { padding:16px; text-align:center; color:var(--ink-3); font-size:13.5px; }

.chosen {
  display:flex; align-items:center; gap:12px; padding:12px 14px;
  background:var(--brand-soft); border-radius:10px;
}
.newcust { margin-top:16px; padding-top:16px; border-top:1px dashed var(--line-2); }
.newcust-head {
  font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.05em;
  color:var(--ink-3); margin-bottom:10px;
}

/* prescription grid */
.rx-note {
  display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  font-size:13px; margin-bottom:14px; min-height:26px;
}
.rx-table { display:flex; flex-direction:column; gap:9px; }
.rx-head, .rx-row {
  display:grid; grid-template-columns:78px repeat(4, minmax(0,1fr)); gap:10px; align-items:center;
}
.rx-head > div {
  font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.05em;
  color:var(--ink-3); text-align:center;
}
.rx-head > div:first-child { text-align:left; }
.rx-head small { display:block; font-size:10.5px; font-weight:500; text-transform:none;
  letter-spacing:0; color:var(--line-2); margin-top:1px; }
.rx-eye strong { font-size:15px; }
.rx-eye small { display:block; font-size:11.5px; color:var(--ink-3); }

.stepper {
  display:flex; align-items:center; border:1px solid var(--line-2);
  border-radius:9px; background:var(--surface); overflow:hidden;
}
.stepper:focus-within { outline:2px solid var(--brand); outline-offset:-1px; border-color:transparent; }
.stepper button {
  width:38px; flex:0 0 38px; height:42px; border:0; background:none; cursor:pointer;
  color:var(--ink-3); font-size:17px; line-height:1;
}
.stepper button:hover { background:var(--surface-2); color:var(--ink); }
.stepper input {
  flex:1; min-width:0; border:0; text-align:center; padding:9px 2px;
  font-size:15.5px; font-variant-numeric:tabular-nums; background:none;
}
.stepper input:focus { outline:none; }
/* Hide the native spinners — the −/+ buttons are the control. */
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.stepper input[type=number] { -moz-appearance:textfield; }
.stepper.disabled { background:var(--surface-2); opacity:.55; }
.stepper.disabled button { cursor:not-allowed; }

.suffixed { position:relative; }
.suffixed input { padding-right:38px; text-align:center; }
.suffix {
  position:absolute; right:12px; top:50%; transform:translateY(-50%);
  font-size:12.5px; color:var(--ink-3); pointer-events:none;
}

/* tile pickers */
.tile-group { margin-bottom:16px; }
.tile-group:last-child { margin-bottom:0; }
.tile-label {
  font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.05em;
  color:var(--ink-3); margin-bottom:8px;
}
.tiles { display:grid; gap:10px; }
.tiles.c2 { grid-template-columns:repeat(2,minmax(0,1fr)); }
.tiles.c3 { grid-template-columns:repeat(3,minmax(0,1fr)); }
.tiles.c4 { grid-template-columns:repeat(4,minmax(0,1fr)); }
.tile {
  padding:14px 12px; border:1px solid var(--line-2); border-radius:10px;
  background:var(--surface); font:inherit; font-size:14.5px; font-weight:500;
  color:var(--ink); cursor:pointer; text-align:center;
}
.tile:hover { border-color:var(--brand); background:var(--surface-2); }
.tile.on {
  border-color:var(--brand); background:var(--brand-soft);
  color:var(--brand-ink); font-weight:650; box-shadow:0 0 0 1px var(--brand) inset;
}

.price-bar {
  display:flex; align-items:center; gap:14px; margin-top:18px;
  background:var(--navy-800); color:#fff; border-radius:10px; padding:15px 18px;
}
.price-bar > div:first-child { flex:1; min-width:0; font-size:15px; font-weight:600; }
.price-bar small { display:block; font-size:12px; color:#94a3b8; font-weight:400; margin-top:2px; }
.price-bar-amount { font-size:21px; font-weight:750; white-space:nowrap; }
.price-bar-input input {
  width:130px; text-align:right; background:rgba(255,255,255,.1);
  border-color:rgba(255,255,255,.25); color:#fff; font-size:16px; font-weight:650;
}

/* frame picker */
.frame-list {
  border:1px solid var(--line); border-radius:var(--radius-sm);
  max-height:290px; overflow-y:auto;
}
.frame-row {
  display:flex; align-items:center; gap:12px; padding:11px 14px;
  border-bottom:1px solid var(--line); cursor:pointer;
}
.frame-row:last-child { border-bottom:0; }
.frame-row:hover { background:var(--surface-2); }
.frame-row.on { background:var(--brand-soft); box-shadow:inset 3px 0 0 var(--brand); }

/* payment */
.pay-row {
  display:flex; justify-content:space-between; padding:8px 0;
  border-bottom:1px solid var(--line); font-size:14.5px;
}
.pay-total {
  display:flex; justify-content:space-between; padding:12px 0 4px;
  font-size:19px; font-weight:750;
}
.pay-balance {
  display:flex; justify-content:space-between; align-items:center;
  margin-top:14px; padding:13px 16px; border-radius:9px;
  background:var(--warn-soft); color:#92400e; font-weight:700; font-size:15.5px;
}
.pay-balance.settled { background:var(--ok-soft); color:#065f46; }

@media (max-width:760px) {
  .rx-head { display:none; }
  .rx-row { grid-template-columns:56px repeat(2,minmax(0,1fr)); gap:8px; }
  .tiles.c3, .tiles.c4 { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .job-actions { flex-direction:column-reverse; }
  .job-actions .btn { width:100%; }
}

/* --------------------------------------------- update / offline notices --- */
.update-bar, .offline-bar {
  position:fixed; left:50%; bottom:20px; transform:translateX(-50%); z-index:300;
  display:flex; align-items:center; gap:11px; max-width:calc(100vw - 32px);
  padding:11px 16px; border-radius:11px; box-shadow:var(--shadow-lg);
  font-size:14px; animation:slide .18s ease;
}
.update-bar { background:var(--navy-800); color:#fff; }
.update-bar .btn { padding:5px 11px; font-size:13px; }
.update-bar .btn.ghost { color:#cbd5e1; }
.update-bar .btn.ghost:hover { background:rgba(255,255,255,.12); color:#fff; }
.offline-bar { background:var(--warn-soft); color:#78350f; border:1px solid #fcd34d; }

@media (max-width:560px) {
  .update-bar, .offline-bar { left:16px; right:16px; transform:none; max-width:none; }
}

/* ------------------------------------------------------------ printing --- */
@media print {
  .rail, .topbar, .toasts, .trial, .no-print { display:none !important; }
  body, .view { background:#fff; padding:0; }
  .card { border:0; box-shadow:none; }
  .overlay { position:static; background:none; padding:0; }
  .modal { max-width:100%; box-shadow:none; }
  .modal-head, .modal-foot { display:none; }
}

/* ---------------------------------------------------------- responsive --- */
@media (max-width:1100px) {
  .pos { grid-template-columns:1fr; }
  .pos-cart { position:static; }
  .g4 { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:860px) {
  .rail {
    position:fixed; left:0; top:0; z-index:60; transform:translateX(-100%);
    transition:transform .2s ease; box-shadow:var(--shadow-lg);
  }
  .rail.open { transform:translateX(0); }
  .burger { display:block; }
  .view { padding:16px; }
  .topbar { padding:0 16px; }
  .g2, .g3, .g4 { grid-template-columns:1fr; }
  .scrim { position:fixed; inset:0; background:rgba(15,23,42,.5); z-index:50; }
}
@media (max-width:560px) {
  .kpi-value { font-size:22px; }
  .modal-foot { flex-direction:column-reverse; }
  .modal-foot .btn { width:100%; }
}
