/* 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 {
  @page { margin: 4mm; }
  body * { visibility: hidden !important; }
  #print-root, #print-root * { visibility: visible !important; }
  #print-root { display: block; position: absolute; left: 0; top: 0; width: 100%; }
  #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; }