/* Everyday Hardware — styled after the Hubware dashboard staff already use */
:root {
  --blue: #0a16b5; --blue-d: #08109a; --navy-btn: #0d1aa8;
  --side: #212529; --side-ink: rgba(255,255,255,.55); --side-hi: #fff; --side-head: rgba(255,255,255,.3);
  --bg: #fff; --ink: #212529; --muted: #6c757d; --line: #dee2e6; --stripe: #f2f2f2; --head: #f8f9fa;
  --green: #28a745; --teal: #17a589; --cyan: #17a2b8; --sky: #007bff; --yellow: #ffc107; --red: #dc3545; --orange: #fd7e14;
  --font: "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 13px/1.5 var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--sky); text-decoration: none; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); } .small { font-size: 11.5px; } .hide { display: none !important; } .b { font-weight: 700; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .sp { flex: 1; }

/* ---------- top bar & sidebar ---------- */
.topbar { position: fixed; top: 0; left: 0; right: 0; height: 56px; background: var(--blue); color: #fff; display: flex; align-items: center; z-index: 30; padding-right: 18px; }
.topbar .logo { width: 225px; display: flex; align-items: center; gap: 8px; padding-left: 14px; font-weight: 800; letter-spacing: 1px; line-height: 1; }
.topbar .logo .mark { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fff; display: grid; place-items: center; font-size: 13px; overflow: hidden; background: #fff1; }
.topbar .logo .mark img { width: 100%; height: 100%; object-fit: cover; }
.topbar .logo .t1 { font-size: 17px; } .topbar .logo .t2 { font-size: 9.5px; font-weight: 600; letter-spacing: .6px; display: block; margin-top: 2px; }
.topbar .burger { background: none; border: 0; color: rgba(255,255,255,.7); cursor: pointer; padding: 6px 10px; }
.topbar .burger svg { width: 20px; height: 20px; display: block; }
.topbar .who { position: relative; }
.topbar .who > button { background: none; border: 0; color: rgba(255,255,255,.75); cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 15px; }
.topbar .who > button:hover { color: #fff; }
.topbar .who svg { width: 18px; height: 18px; }
.dropdown { position: absolute; right: 0; top: 36px; background: #fff; color: var(--ink); border: 1px solid rgba(0,0,0,.15); border-radius: 4px; min-width: 180px; box-shadow: 0 6px 16px rgba(0,0,0,.15); padding: 6px 0; z-index: 40; }
.dropdown a, .dropdown button { display: block; width: 100%; text-align: left; padding: 7px 18px; color: var(--ink); background: none; border: 0; cursor: pointer; }
.dropdown a:hover, .dropdown button:hover { background: #f1f1f1; }
.dropdown hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.side { position: fixed; top: 56px; bottom: 0; left: 0; width: 225px; background: var(--side); overflow-y: auto; z-index: 20; display: flex; flex-direction: column; transition: margin .2s; }
.side .head { font-size: 10.5px; font-weight: 800; text-transform: uppercase; color: var(--side-head); padding: 22px 16px 8px; letter-spacing: .4px; }
.side a.l { display: flex; align-items: center; gap: 8px; padding: 10px 16px; color: var(--side-ink); font-weight: 600; cursor: pointer; }
.side a.l:hover, .side a.l.on { color: var(--side-hi); }
.side a.l svg { width: 14px; height: 14px; flex: none; opacity: .6; }
.side a.l .chev { margin-left: auto; transition: transform .15s; }
.side .grp.open > a.l .chev { transform: rotate(90deg); }
.side .sub { display: none; padding: 0 0 6px 38px; }
.side .grp.open .sub { display: block; }
.side .sub a { display: block; padding: 6px 0; color: var(--side-ink); font-weight: 600; }
.side .sub a:hover, .side .sub a.on { color: #fff; }
.side .foot { margin-top: auto; padding: 12px 16px; background: #343a40; color: var(--side-ink); font-size: 11.5px; text-align: center; }
.main { margin-left: 225px; padding: 56px 0 0; min-height: 100vh; transition: margin .2s; }
body.collapsed .side { margin-left: -225px; } body.collapsed .main { margin-left: 0; }
.page { padding: 22px 24px 50px; }
.page-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-title h1 { font-size: 24px; font-weight: 500; margin: 0; }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid transparent; border-radius: 4px; padding: 6px 12px; cursor: pointer; font-weight: 600; font-size: 12px; white-space: nowrap; background: #e9ecef; color: var(--ink); line-height: 1.4; }
.btn:hover { filter: brightness(.94); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 13px; height: 13px; }
.btn.navy { background: var(--navy-btn); color: #fff; } .btn.teal { background: var(--teal); color: #fff; } .btn.green { background: var(--green); color: #fff; }
.btn.red { background: var(--red); color: #fff; } .btn.yellow { background: var(--yellow); color: #212529; } .btn.gray { background: #6c757d; color: #fff; }
.btn.outline { background: #fff; border-color: #ced4da; }
.btn.lg { padding: 11px 18px; font-size: 15px; } .btn.sm { padding: 3px 8px; font-size: 11.5px; }
.inp, select.inp, textarea.inp { width: 100%; border: 1px solid #ced4da; border-radius: 4px; padding: 6px 10px; background: #fff; font-size: 12px; outline: none; min-height: 32px; }
.inp:focus { border-color: #8088f0; box-shadow: 0 0 0 3px rgba(10,22,181,.15); }
.inp[readonly], .inp:disabled { background: #e9ecef; }
label.f { display: block; margin-bottom: 12px; } label.f > span { display: block; font-size: 11.5px; font-weight: 700; margin-bottom: 4px; }
.filter { margin-bottom: 14px; }
.filter .ttl { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.filter .ttl h4 { margin: 0; font-size: 13px; font-weight: 600; flex: 1; }
.filter .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.filter .grid label { font-size: 11px; font-weight: 700; display: block; }
.filter .grid label .inp { margin-top: 4px; font-weight: 400; }
.form-grid { display: grid; grid-template-columns: 150px 1fr 150px 1fr; gap: 10px 16px; align-items: center; margin-bottom: 18px; max-width: 1200px; }
.form-grid > label { font-weight: 600; }
.switch { position: relative; display: inline-block; width: 34px; height: 18px; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: #ced4da; border-radius: 18px; cursor: pointer; transition: .15s; }
.switch i::before { content: ""; position: absolute; width: 14px; height: 14px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + i { background: var(--navy-btn); } .switch input:checked + i::before { transform: translateX(16px); }

/* ---------- badges ---------- */
.badge { display: inline-block; padding: 3px 7px; border-radius: 4px; font-size: 10.5px; font-weight: 800; color: #fff; white-space: nowrap; line-height: 1.2; }
.bg-green { background: var(--green); } .bg-red { background: var(--red); } .bg-yellow { background: var(--yellow); color: #212529; } .bg-orange { background: var(--orange); }
.bg-sky { background: var(--sky); } .bg-cyan { background: var(--cyan); } .bg-gray { background: #6c757d; } .bg-navy { background: var(--navy-btn); } .bg-teal { background: var(--teal); }

/* ---------- tables ---------- */
.dt-top, .dt-bot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.dt-top select { width: auto; min-height: 26px; padding: 2px 6px; display: inline-block; }
.dt-top .search { margin-left: auto; } .dt-top .search input { width: 200px; display: inline-block; min-height: 26px; padding: 3px 6px; margin-left: 6px; }
.tw { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 12px; }
table.t th { text-align: left; font-weight: 700; padding: 8px 8px; border: 1px solid var(--line); border-bottom-width: 2px; background: #fff; vertical-align: bottom; }
table.t td { padding: 7px 8px; border: 1px solid var(--line); vertical-align: middle; }
table.t tbody tr:nth-child(odd) td { background: var(--stripe); }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: #e8eaff; }
table.t th.num, table.t td.num { text-align: right; }
table.t td .inp { min-height: 26px; padding: 3px 6px; }
.empty { text-align: center; color: var(--muted); padding: 22px; }
.pager { margin-left: auto; display: flex; gap: 0; }
.pager button { border: 1px solid var(--line); background: #fff; padding: 5px 11px; cursor: pointer; margin-left: -1px; color: var(--ink); }
.pager button.on { background: #e9ecef; font-weight: 700; } .pager button:disabled { color: #aaa; cursor: default; }
.card { border: 1px solid rgba(0,0,0,.125); border-radius: 4px; background: #fff; }
.card > .hd { padding: 10px 14px; font-weight: 700; background: rgba(0,0,0,.03); border-bottom: 1px solid rgba(0,0,0,.125); display: flex; align-items: center; gap: 8px; }
.card > .bd { padding: 12px 14px; }
.totals-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); border: 1px solid var(--line); margin-bottom: 12px; }
.totals-bar > div { padding: 6px 8px; border-right: 1px solid var(--line); }
.totals-bar .l { font-size: 11px; font-weight: 700; } .totals-bar .v { font-size: 16px; padding: 6px 0 2px; font-variant-numeric: tabular-nums; }

/* ---------- dashboard ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 24px; }
.tile { border-radius: 4px; color: #fff; overflow: hidden; }
.tile .top { display: flex; align-items: center; justify-content: space-between; padding: 24px 22px; font-size: 18px; }
.tile .top b { background: rgba(0,0,0,.15); padding: 4px 9px; border-radius: 4px; font-size: 19px; }
.tile a { display: flex; justify-content: space-between; padding: 12px 22px; color: #fff; border-top: 1px solid rgba(0,0,0,.12); font-size: 13px; }
.tile.green { background: var(--green); } .tile.blue { background: var(--sky); } .tile.yellow { background: var(--yellow); } .tile.red { background: var(--red); }
.dash2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }
.pos-search { position: relative; }
.pos-search .inp { font-size: 15px; padding: 10px 12px; min-height: 44px; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid #ced4da; border-top: 0; max-height: 360px; overflow-y: auto; z-index: 15; box-shadow: 0 8px 18px rgba(0,0,0,.12); }
.suggest div { padding: 7px 12px; cursor: pointer; display: grid; grid-template-columns: 1fr auto auto; gap: 12px; border-bottom: 1px solid #f0f0f0; }
.suggest div.on, .suggest div:hover { background: #e8eaff; }
.suggest .st { color: var(--muted); font-size: 11px; min-width: 70px; text-align: right; }
.pos-side .card { margin-bottom: 12px; }
.seg { display: flex; border: 1px solid #ced4da; border-radius: 4px; overflow: hidden; }
.seg button { flex: 1; border: 0; background: #fff; padding: 8px; cursor: pointer; font-weight: 700; font-size: 12px; }
.seg button.on { background: var(--navy-btn); color: #fff; }
.paygrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.paygrid button { border: 1px solid #ced4da; background: #fff; border-radius: 4px; padding: 9px 4px; cursor: pointer; font-weight: 700; font-size: 11.5px; }
.paygrid button.on { background: var(--navy-btn); border-color: var(--navy-btn); color: #fff; }
.sum .ln { display: flex; justify-content: space-between; padding: 3px 0; }
.sum .grand { font-size: 24px; font-weight: 800; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }
.change-box { text-align: center; font-size: 17px; font-weight: 800; padding: 8px; border-radius: 4px; background: #d4edda; color: #155724; margin-top: 8px; }
.change-box.neg { background: #f8d7da; color: #721c24; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 6px; }
.kbd { font-family: var(--mono); background: #eee; border: 1px solid #ccc; border-radius: 3px; padding: 0 4px; font-size: 10.5px; }

/* ---------- order details / modal ---------- */
.ov { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: flex-start; justify-content: center; z-index: 50; padding: 30px 14px; overflow-y: auto; }
.modal { background: #fff; border-radius: 5px; width: 100%; max-width: 520px; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.modal.wide { max-width: 1100px; } .modal.mid { max-width: 780px; }
.modal .hd { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal .hd h3 { margin: 0; font-size: 18px; font-weight: 500; flex: 1; }
.modal .hd .x { background: none; border: 0; font-size: 26px; cursor: pointer; line-height: 1; font-weight: 700; }
.modal .bd { padding: 16px 18px; }
.modal .ft { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.kv { width: 100%; border-collapse: collapse; font-size: 11.5px; margin-bottom: 14px; }
.kv td { border: 1px solid var(--line); padding: 6px 8px; }
.kv td.k { font-weight: 700; width: 11%; }
#toast-root { position: fixed; top: 66px; right: 18px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #155724; color: #fff; padding: 10px 16px; border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,.2); max-width: 380px; font-weight: 600; }
.toast.err { background: var(--red); }

/* ---------- login ---------- */
.login { min-height: 100vh; background: linear-gradient(90deg, #11185e 0%, #0a16b5 45%, #0a3fd6 100%); display: flex; flex-direction: column; align-items: center; padding-top: 70px; }
.login .brand { color: #fff; font-weight: 800; letter-spacing: 1.5px; font-size: 18px; margin-bottom: 30px; }
.login .brand span { font-weight: 400; }
.login .box { background: #fff; border-radius: 5px; padding: 30px 34px; width: 100%; max-width: 380px; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.login label.f > span::after { content: " *"; color: var(--red); }
.login .err { background: #f8d7da; color: #721c24; padding: 8px 10px; border-radius: 4px; margin-bottom: 10px; }

/* ---------- receipt / print ---------- */
.receipt { font-family: var(--mono); font-size: 12px; width: 300px; margin: 0 auto; color: #000; background: #fff; }
.receipt .c { text-align: center; } .receipt hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
.receipt table { width: 100%; border-collapse: collapse; } .receipt td { padding: 1px 0; vertical-align: top; } .receipt .r { text-align: right; }
#print-root { display: none; }
@media print {
  /* margin 0 makes the browser leave out its own header and footer (page title, web address, date, page numbers);
     the 4mm white space is put back as padding on #print-root, so the layout is unchanged */
  @page { margin: 0; }
  html, body { margin: 0 !important; padding: 0 !important; background: #fff !important; }
  body * { visibility: hidden !important; }
  #print-root, #print-root * { visibility: visible !important; }
  #print-root { display: block; position: absolute; left: 0; top: 0; width: 100%; padding: 4mm; box-sizing: border-box; }
  #print-root .a4doc { padding: 6mm 8mm; }
  #print-root .receipt { width: 72mm; margin: 0; }
  #print-root .a4 { font: 11px/1.4 var(--font); }
  #print-root table.t th, #print-root table.t td { padding: 3px 5px; }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .tiles { grid-template-columns: 1fr 1fr; } .dash2 { grid-template-columns: 1fr; } .pos { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .side { margin-left: -225px; box-shadow: none; } body.menu-open .side { margin-left: 0; box-shadow: 0 0 0 100vmax rgba(0,0,0,.4); }
  .main { margin-left: 0 !important; } .topbar .logo { width: auto; } .topbar .logo .t2 { display: none; }
  .topbar .who .nm { display: none; } .tiles { grid-template-columns: 1fr; gap: 14px; } .page { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; } .dt-top .search { margin-left: 0; }
}

/* ---------- POS screen (pos.hubware.ph layout) ---------- */
body.posmode .side { display: none; } body.posmode .main { margin-left: 0 !important; } body.posmode .burger { display: none; } body.posmode .page { padding: 0 0 30px; }
.posbar { display: flex; gap: 18px; align-items: center; background: #e9ecef; padding: 7px 10px; font-size: 13px; flex-wrap: wrap; }
.posbar a { color: var(--ink); display: inline-flex; gap: 5px; align-items: center; } .posbar a svg { width: 14px; height: 14px; color: var(--sky); }
.poshead { display: grid; grid-template-columns: 1fr 1fr 460px; gap: 30px; padding: 16px 10px 12px; }
.pcol { display: grid; grid-template-columns: 110px 1fr; gap: 14px 12px; align-items: start; align-content: start; }
.pcol > label { font-weight: 800; font-size: 15px; padding-top: 7px; }
.poshead .inp { font-size: 15px; min-height: 40px; }
.ptot { display: grid; grid-template-columns: 1fr 1.4fr; gap: 9px 14px; align-items: center; align-content: start; }
.ptot > label { font-weight: 800; font-size: 17px; color: #1b1f6b; padding-left: 20px; }
.ptot .inp { min-height: 34px; border-color: #333; }
.plogo { grid-column: 1 / -1; text-align: center; min-height: 52px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.plogo img { max-height: 70px; max-width: 100%; }
.pbtns { grid-column: 1 / -1; display: flex; gap: 14px; padding-left: 20px; margin-top: 18px; }
.pbtns .btn { flex: 1; background: #5aa9ff; color: #fff; padding: 11px; font-size: 13.5px; font-weight: 600; }
.pbtns .btn:not(:disabled) { background: var(--sky); }
.pentry th, .pitems th { border: 0; border-bottom: 2px solid var(--line); font-size: 15px; }
.pentry td { border: 0; padding: 4px 2px; background: #fff !important; } .pentry .inp { min-height: 40px; text-align: center; font-size: 14px; } .pentry #pq { text-align: left; }
.pentry .inp[readonly] { background: #e9ecef; }
.pitems td { font-size: 13px; }
.tw { padding: 0 10px; } body:not(.posmode) .tw { padding: 0; }
/* printed S.O / S.I */
.lxdoc { font-family: "Courier New", Courier, monospace; font-size: 12px; width: 9.2in; color: #000; }
.a4doc { font: 12px/1.45 var(--font); color: #000; }
.lxdoc table, .a4doc table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.lxdoc .di th, .lxdoc .di td { border-bottom: 1px dashed #000; padding: 2px 4px; text-align: left; }
.a4doc .di th, .a4doc .di td { border: 1px solid #999; padding: 4px 6px; text-align: left; }
.lxdoc .r, .a4doc .r { text-align: right !important; } .lxdoc .dh td, .a4doc .dh td { padding: 2px 0; width: 50%; }
.lxdoc .dt, .a4doc .dt { width: 40%; margin-left: 60%; } .sig { display: flex; justify-content: space-between; margin-top: 30px; gap: 30px; }
@media (max-width: 1200px) { .poshead { grid-template-columns: 1fr 1fr; } .ptot { grid-column: 1 / -1; max-width: 520px; } }
@media (max-width: 760px) { .poshead { grid-template-columns: 1fr; } .pcol { grid-template-columns: 90px 1fr; } }
.topbar .today { margin-right: 20px; font-size: 15px; } @media (max-width: 760px) { .topbar .today { display: none; } }
.topbar .logo { white-space: nowrap; width: auto; min-width: 225px; padding-right: 12px; }
table.t th svg { width: 14px; height: 14px; }
.suggest div.sg8 { grid-template-columns: 70px 110px 1.6fr 1fr 70px 80px 90px 90px; font-size: 12px; align-items: center; }
@media (max-width: 900px) { .suggest div.sg8 { grid-template-columns: 1fr 1fr 70px; } .suggest div.sg8 span:nth-child(1), .suggest div.sg8 span:nth-child(2), .suggest div.sg8 span:nth-child(5), .suggest div.sg8 span:nth-child(8) { display: none; } }
.tw:has(.pos-search) { overflow: visible; }
.pentry .suggest { width: min(1000px, calc(100vw - 30px)); }

/* Manage Store: Banks + Data tools */
.store-sec { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 22px; max-width: 1100px; }
.store-sec h2 { font-size: 18px; font-weight: 500; margin: 0; }
.store-sw { display: flex; align-items: center; gap: 6px; margin-right: 14px; color: #fff; }
.store-sw svg { width: 18px; height: 18px; }
.store-sw select { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 4px; padding: 5px 8px; font: inherit; font-size: 13px; max-width: 260px; }
.store-sw select option { color: #212529; }
@media (max-width: 760px) { .store-sw select { max-width: 130px; } .topbar .today { display: none; } }
.data-tbl td { vertical-align: middle; }
.data-tbl .row.nowrap { flex-wrap: nowrap; gap: 6px; }
.data-tbl .all-row td { border-top: 2px solid var(--line); }
.gd-box { border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; margin-top: 16px; }
.gd-box h3 { font-size: 16px; font-weight: 600; }
.gd-steps li { margin: 4px 0; }
.gd-steps code.sel { user-select: all; background: #f1f3f5; padding: 2px 6px; border-radius: 4px; word-break: break-all; }
.tbl-wrap { overflow-x: auto; }

/* HQ top-bar buttons (Hubware "All Partner Orders / All Partner Sales Summary") */
.hq-btns { display: flex; gap: 8px; margin-right: 14px; }
.hq-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--sky); color: #fff; border-radius: 4px; padding: 6px 10px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.hq-btn:hover { background: #0069d9; color: #fff; }
.hq-btn svg { width: 15px; height: 15px; }
.notif { background: var(--red); color: #fff; border-radius: 10px; min-width: 20px; padding: 1px 6px; font-size: 11px; text-align: center; }
@media (max-width: 1250px) { .hq-btn .tx { display: none; } .hq-btn svg { width: 17px; height: 17px; } }
@media (max-width: 760px) { .hq-btns { display: none; } }

/* Order Metrics */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.metrics .m { border: 1px solid var(--line); border-left: 4px solid var(--sky); border-radius: 4px; padding: 10px 12px; }
.metrics .m .l { font-size: 12px; font-weight: 700; color: var(--muted); }
.metrics .m .v { font-size: 22px; font-weight: 800; padding: 4px 0 2px; font-variant-numeric: tabular-nums; }
.metrics .m .s { font-size: 11.5px; color: var(--muted); }
.mt-h { font-size: 16px; font-weight: 600; margin: 4px 0 8px; }

/* POS delivery coverage note */
.cov { min-height: 22px; margin: -4px 0 10px; font-size: 13px; }
.cov svg { width: 15px; height: 15px; vertical-align: -3px; }
.cov .in { color: var(--teal); } .cov .out { color: var(--red); font-weight: 700; }

/* Help */
.help { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; max-width: 1100px; }
.help-toc { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 4px; align-self: start; position: sticky; top: 72px; }
.help-toc a { padding: 7px 12px; border-top: 1px solid var(--line); color: var(--ink); font-size: 13.5px; }
.help-toc a:first-child { border-top: 0; } .help-toc a:hover { background: var(--head); color: var(--sky); }
.help-body details { border: 1px solid var(--line); border-radius: 4px; margin-bottom: 8px; scroll-margin-top: 72px; }
.help-body summary { cursor: pointer; padding: 10px 14px; font-weight: 700; background: var(--head); }
.help-body p { margin: 0; padding: 12px 14px; line-height: 1.55; }
@media (max-width: 760px) { .help { grid-template-columns: 1fr; } .help-toc { position: static; } }

/* ---- Nov 8 (2): sorting, Excel, approvals, payments, end of day, stock count, labels, photos ---- */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; } th.sortable:hover { text-decoration: underline; } th.sortable.on { background: #e8eefc; }
.sarr { font-size: 10px; }
.dt-top .btn.sm { margin-left: 10px; }
tr.tfoot td { background: #f4f6fa; border-top: 2px solid var(--line); }
.recon { margin: -6px 0 10px; font-size: 13px; } .recon .ok { color: var(--green); } .recon .bad { color: var(--red); font-weight: 700; }
.appr { background: #fff7e0; border: 1px solid #f0d58a; border-radius: 4px; padding: 6px 12px; margin-bottom: 12px; } .appr ul { margin: 6px 0; padding-left: 18px; }
.paybox { background: #f6f9ff; border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; margin-bottom: 12px; } .paybox .bal { margin: 6px 0; font-size: 15px; }
.eodsum { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 10px 0; font-size: 15px; }
.eodcard { margin-bottom: 16px; } .eodcard .hd { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
td.neg, .num.neg { color: var(--red); }
.change-box.neg { background: var(--red); }
.suggest img.thumb { width: 28px; height: 28px; object-fit: cover; border-radius: 3px; vertical-align: middle; margin-right: 6px; }
.photo-box { width: 140px; height: 140px; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; background: #fff; } .photo-box img { max-width: 100%; max-height: 100%; }
td.nowrap, .nowrap { white-space: nowrap; }
/* barcode labels */
.lblsheet { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; } .lblsheet .lbl { height: 34mm; padding: 2mm 3mm; border: 1px dashed #ccc; overflow: hidden; text-align: center; page-break-inside: avoid; }
.lblroll .lbl { width: 48mm; height: 28mm; padding: 1mm 2mm; text-align: center; overflow: hidden; page-break-after: always; }
.lbl .ln { font: 700 9px/1.15 var(--font); max-height: 21px; overflow: hidden; } .lbl svg.bc { width: 100%; height: 13mm; display: block; margin: 1mm 0 0; } .lbl .lc { font: 9px var(--mono); } .lbl .lp { font: 800 12px var(--font); }
@media print { #print-root .lblroll .lbl { width: 48mm; } #print-root .lblsheet { width: 200mm; } }
/* phones: keep the page inside the screen */
@media (max-width: 760px) {
  .topbar .logo .t1 { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: middle; }
  .topbar .logo { min-width: 0; }
  .page { padding: 12px !important; } .page-title { flex-wrap: wrap; gap: 8px; }
  .dash2 .card, .card { min-width: 0; } .dash2 .tw, .card .tw { overflow-x: auto; }
  .tiles { grid-template-columns: 1fr !important; }
  .posbar { flex-wrap: wrap; } .totals-bar { flex-wrap: wrap; }
  .modal { width: calc(100vw - 16px) !important; max-width: none !important; } .row[style*="nowrap"] { flex-wrap: wrap !important; }
  .dt-top { flex-wrap: wrap; gap: 6px; } .dt-top .search { margin-left: 0; }
}
html, body { max-width: 100%; overflow-x: hidden; }

/* Cash Register link */
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }
b.red { color: var(--red); }
.crtag { display: inline-flex; align-items: center; padding: 0 10px; font-weight: 700; color: #fff; background: var(--orange, #fd7e14); border-radius: 4px; }

/* ===================== phones and small tablets (all mobile browsers) ===================== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img, svg, video, canvas { max-width: 100%; }
@media (max-width: 760px) {
  /* type 16px in fields so iPhone Safari does not zoom in, and give fingers room */
  .inp, input, select, textarea { font-size: 16px !important; }
  .inp, select.inp { min-height: 42px; }
  .btn { min-height: 40px; }
  .btn.sm { min-height: 36px; }
  .page-title h1 { font-size: 22px; }
  .page-title .sp { display: none; }
  .form-grid { grid-template-columns: 1fr !important; gap: 4px 0 !important; }
  .form-grid > label { margin-top: 8px; }
  /* tables become cards: one card per row, each value with its column name */
  .tw { overflow-x: visible; }
  table.t.lbl { border: 0; background: transparent; }
  table.t.lbl thead { display: none; }
  table.t.lbl, table.t.lbl > tbody, table.t.lbl > tfoot, table.t.lbl > tbody > tr, table.t.lbl > tfoot > tr { display: block; width: 100% !important; }
  table.t.lbl > tbody > tr, table.t.lbl > tfoot > tr { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 10px; padding: 6px 12px; background: #fff !important; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
  table.t.lbl > tfoot > tr { background: #f1f3f5 !important; font-weight: 700; }
  table.t.lbl > tbody > tr > td, table.t.lbl > tfoot > tr > td { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100% !important; border: 0 !important; border-bottom: 1px dashed #e3e6ea !important; padding: 6px 0 !important; text-align: right !important; background: transparent !important; white-space: normal; overflow-wrap: anywhere; min-width: 0; flex-wrap: wrap; row-gap: 4px; }
  table.t.lbl > tbody > tr > td:last-child, table.t.lbl > tfoot > tr > td:last-child { border-bottom: 0 !important; }
  table.t.lbl > tbody > tr > td::before, table.t.lbl > tfoot > tr > td::before { content: attr(data-label); flex: 0 0 42%; text-align: left; font-weight: 700; font-size: 13px; color: #555; white-space: normal; }
  table.t.lbl > tbody > tr > td[data-label=""]::before, table.t.lbl > tfoot > tr > td[data-label=""]::before { display: none; }
  table.t.lbl > tbody > tr > td[data-label=""], table.t.lbl > tbody > tr > td[colspan] { justify-content: flex-end; }
  table.t.lbl > tbody > tr > td[colspan] { justify-content: center; text-align: center !important; }
  table.t.lbl > tbody > tr > td[colspan]::before { display: none; }
  table.t.lbl > tfoot > tr > td:empty { display: none; }
  table.t.lbl td .inp, table.t.lbl td select, table.t.lbl td input:not([type=checkbox]):not([type=radio]) { max-width: 60%; flex: 1 1 auto; text-align: right; }
  table.t.lbl td > .badge + .badge { margin-left: 4px; }
  /* the sale entry row on the Point of Sale screen: product search takes the full width */
  table.t.pentry.lbl > tbody > tr > td:first-child { display: block; }
  table.t.pentry.lbl > tbody > tr > td:first-child::before { display: block; margin-bottom: 4px; }
  table.t.pentry.lbl > tbody > tr > td:first-child .inp { max-width: none; width: 100%; text-align: left; }
  /* label / value tables (order details) stack in two columns */
  table.kv, table.kv > tbody { display: block; width: 100%; }
  table.kv tr { display: grid; grid-template-columns: minmax(96px, 40%) 1fr; }
  table.kv td, table.kv td.k { display: block; width: auto !important; min-width: 0; border: 0 !important; border-bottom: 1px solid #eef0f2 !important; padding: 6px 4px !important; overflow-wrap: anywhere; font-size: 14px; }
  /* windows: full screen width, buttons wrap, the first box is not focused (no keyboard popping up) */
  .ov { padding: 8px 6px; }
  .modal .hd { padding: 12px 14px; } .modal .bd { padding: 12px 14px; } 
  .modal .ft { flex-wrap: wrap; padding: 10px 12px; }
  .modal .ft > .btn, .modal .ft > button, .modal .ft > select { flex: 1 1 auto; }
  .modal .ft > .sp, .modal .ft > div.sp { display: none; }
  /* lists: search box and pager fit the screen */
  .dt-top { align-items: center; }
  .dt-top .search { flex: 1 1 100%; display: flex; align-items: center; gap: 6px; }
  .dt-top .search .inp { flex: 1 1 0; width: auto !important; min-width: 0; max-width: none; margin: 0; }
  .dt-top .search { min-width: 0; max-width: 100%; margin-left: 0 !important; }
  .pager { flex-wrap: wrap; } .pager button { min-height: 38px; min-width: 38px; }
  .dt-bot, .dt-foot { flex-wrap: wrap; gap: 8px; }
  .totals-bar > div { flex: 1 1 45%; min-width: 0; }
  .paybox { overflow-wrap: anywhere; }
  .posbar { gap: 10px; } .pbtns { padding-left: 0; flex-wrap: wrap; } .pbtns .btn { flex: 1 1 140px; }
  .ptot > label { padding-left: 0; }
}
@media (max-width: 380px) {
  .totals-bar > div { flex-basis: 100%; }
  table.t.lbl > tbody > tr > td::before { flex-basis: 46%; }
}
@media (max-width: 760px) {
  .filter .ttl { flex-wrap: wrap; gap: 8px; } .filter .ttl h4 { flex: 1 1 100%; margin: 0; }
  .filter .ttl .btn { flex: 1 1 auto; }
  .login { padding: 40px 12px 24px; width: 100%; box-sizing: border-box; }
  .login .brand { text-align: center; font-size: 16px; }
  .login .box { padding: 22px 18px; }
}
@media (max-width: 760px) {
  /* Point of Sale on a phone: customer, then the product entry and the cart, then payment details and totals */
  body.posmode #page { display: flex; flex-direction: column; }
  body.posmode .poshead { display: contents; }
  body.posmode .posbar { order: 0; }
  body.posmode .pcol.p1 { order: 1; padding: 14px 10px 4px; }
  body.posmode .posentry { order: 2; margin-top: 8px; }
  body.posmode .positems { order: 3; }
  body.posmode .pcol.p2 { order: 4; padding: 14px 10px 4px; border-top: 1px solid var(--line); margin-top: 6px; }
  body.posmode .ptot { order: 5; padding: 10px 10px 20px; }
  .pentry .suggest { width: auto; left: 0; right: 0; }
  .suggest { max-width: calc(100vw - 20px); }
}
.tw { -webkit-overflow-scrolling: touch; } .tw.posentry { overflow: visible; }   /* older phone browsers without :has() */
@media (max-width: 760px) {
  /* top bar on phones: menu button first and always visible, then the logo, store picker and account */
  .topbar { padding-right: 6px; gap: 2px; }
  .topbar .burger { order: -1; flex: none; color: #fff; padding: 10px 10px 10px 12px; }
  .topbar .burger svg { width: 24px; height: 24px; }
  .topbar .logo { flex: 1 1 auto; min-width: 0 !important; width: auto !important; padding-left: 0; padding-right: 4px; overflow: hidden; }
  .topbar .logo .mark { flex: none; width: 32px; height: 32px; }
  .topbar .logo > span:last-child { min-width: 0; overflow: hidden; }
  .topbar .logo .t1 { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 15px; letter-spacing: .5px; }
  .topbar > .sp { display: none; }
  .store-sw { flex: 0 1 auto; min-width: 0; margin-right: 4px; }
  .store-sw svg { display: none; }
  .store-sw select { max-width: 120px; font-size: 14px !important; padding: 4px 6px; min-height: 34px; }
  .topbar .who { flex: none; }
}
@media (max-width: 400px) { .store-sw select { max-width: 96px; } .topbar .logo .t1 { font-size: 13px; } }
.pentry td.padd { width: 1%; white-space: nowrap; } .pentry #padd { min-height: 40px; padding: 0 14px; }
@media (max-width: 760px) { table.t.pentry.lbl > tbody > tr > td.padd { display: block; width: 100% !important; padding-top: 10px !important; } .pentry #padd { width: 100%; min-height: 48px; font-size: 17px; justify-content: center; } }
.newver { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 2000; background: #fff; border: 2px solid var(--blue); border-radius: 10px; padding: 10px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; width: max-content; max-width: calc(100vw - 20px); font-size: 15px; }
/* tablets and phones held sideways (761-1100 px): the top bar keeps everything on one line */
@media (min-width: 761px) and (max-width: 1100px) {
  .topbar .today { display: none; }
  .topbar .logo { min-width: 0 !important; flex: 0 1 auto; overflow: hidden; }
  .topbar .logo > span:last-child { min-width: 0; overflow: hidden; }
  .topbar .logo .t1 { display: block; overflow: hidden; text-overflow: ellipsis; max-width: 32vw; }
  .topbar .burger { flex: none; }
  .store-sw { flex: 0 1 auto; min-width: 0; }
  .store-sw select { max-width: 220px; }
  .topbar .who .nm { display: none; }
}

/* Purchasing: label / value list on the PO page */
.pkv > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.pkv > div:last-child { border-bottom: 0; }
.pkv span { color: #6c757d; } .pkv b { text-align: right; font-weight: 600; }
#grid td input[type=radio] { width: 18px; height: 18px; flex: 0 0 auto; }
@media (max-width: 760px) { #csup, #sup { max-width: 100%; min-width: 0; } }
.trail{display:inline-flex;flex-wrap:wrap;align-items:center;gap:3px}.trail .tsep{color:#9aa3ad;font-size:11px}
.qbar { margin: 8px 10px 0; padding: 9px 12px; border-radius: 4px; font-size: 14px; } .qbar.quote { background: #fff3cd; border: 1px solid #f0c36d; color: #7a5200; } .qbar.fromq { background: #e7f5ff; border: 1px solid #9fd2f5; color: #0b4f7c; } .qbar a { margin-left: 10px; font-weight: 700; text-decoration: underline; } .pbtns .btn.qbtn { background: #f0ad4e; border-color: #f0ad4e; color: #fff; }
.hdoc { font: 11px/1.25 "Courier New", Courier, monospace; color: #000; width: 8.5in; padding: .2in .3in .15in; box-sizing: border-box; } .hdoc table { width: 100%; border-collapse: collapse; } .hdoc td, .hdoc th { padding: 1px 3px; vertical-align: top; text-align: left; } .hdoc .r { text-align: right !important; } .hdoc .big { font-size: 13px; } .hdoc .hh td { padding: 0 0 3px; } .hdoc .hi { border-top: 1px solid #000; border-bottom: 1px solid #000; margin: 2px 0 3px; } .hdoc .hl th { border-bottom: 1px dashed #000; font-weight: 700; } .hdoc .hl thead { display: table-header-group; } .hdoc .hl tr { page-break-inside: avoid; } .hdoc .cd { font-size: 9.5px; } .hdoc .hf { border-top: 1px dashed #000; margin-top: 3px; page-break-inside: avoid; } .hdoc .hf .sg { width: 60%; padding-top: 4px; } .hdoc .hf .tt { width: 40%; } .hdoc .tt td { padding: 0 3px; } .hdoc .gt td { font-weight: 700; font-size: 13px; border-top: 1px solid #000; } .hdoc .sm { font-size: 9.5px; } .hdoc .ft { text-align: center; font-size: 9.5px; margin-top: 2px; }
.hsearch { display: flex; gap: 12px; align-items: center; max-width: 1100px; } .hsearch .inp { max-width: 520px; font-size: 15px; } .help-toc { max-height: calc(100vh - 90px); overflow: auto; } .help-toc .tg { padding: 8px 12px 4px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #6b7280); border-top: 1px solid var(--line); background: var(--head); } .help-toc .tg:first-child { border-top: 0; } .help-body .hgrp { margin: 18px 0 8px; font-size: 16px; } .help-body .hwn { margin: 0; padding: 10px 14px 10px 32px; line-height: 1.55; } .help-body mark { background: #ffe58a; padding: 0 1px; border-radius: 2px; } .flowwrap { overflow-x: auto; padding: 12px; } .flowsvg { width: 100%; min-width: 760px; height: auto; font-family: inherit; } .flowsvg .fa { fill: none; stroke: #607d8b; stroke-width: 1.6; marker-end: url(#ah); } .flowsvg .fr { fill: #fff; font-size: 12px; font-weight: 700; } .flowsvg .ft { fill: #1f2937; font-size: 12.5px; } .flowsvg .fn { fill: #6b7280; font-size: 11px; font-style: italic; }
