/* Minimal, low-colour UI: greys plus one accent. */
:root {
  --bg: #f5f6f7;
  --panel: #ffffff;
  --line: #dfe2e6;
  --line-strong: #c5cad1;
  --text: #1f2328;
  --muted: #6a7179;
  --accent: #1f4e79;
  --accent-soft: #e8eff6;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --ok: #1b6e3a;
  --warn: #8a5a00;
  --radius: 6px;
  font-size: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.4;
}
h1, h2, h3 { margin: 0; font-weight: 600; }
h2 { font-size: 18px; }
h3 { font-size: 14px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.danger-text { color: var(--danger); }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 0 16px; height: 48px;
  background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.brand { font-weight: 700; letter-spacing: .2px; white-space: nowrap; display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--text); }
.brand img { height: 30px; width: auto; }
.nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; }
.nav a {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 10px; border-radius: var(--radius); text-decoration: none; color: var(--text); white-space: nowrap;
}
.nav a:hover { background: var(--bg); }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav .sep { width: 1px; background: var(--line); margin: 8px 6px; }
.userbox { display: flex; align-items: center; gap: 8px; white-space: nowrap; }

main { padding: 16px; min-width: 0; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.page-head .grow { flex: 1; }

/* ---------- Panels & forms ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.panel + .panel { margin-top: 12px; }
.panel-title { font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }

label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
label.req::after { content: " *"; color: var(--danger); }
input, select, textarea {
  font: inherit; color: inherit; width: 100%; padding: 6px 8px; border: 1px solid var(--line-strong);
  border-radius: var(--radius); background: #fff; min-height: 32px;
}
textarea { min-height: 56px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
input.bad, select.bad { border-color: var(--danger); background: var(--danger-soft); }
input[type=checkbox] { width: auto; min-height: 0; margin: 0; }
input[readonly] { background: var(--bg); }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-size: 14px; margin: 0; cursor: pointer; }

.grid { display: grid; gap: 10px; }
.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)); }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }
.span4 { grid-column: 1 / -1; }
.row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.row > .f { flex: 1; min-width: 120px; }

button, .btn {
  font: inherit; padding: 6px 14px; min-height: 32px; border-radius: var(--radius); cursor: pointer;
  border: 1px solid var(--line-strong); background: #fff; color: var(--text); white-space: nowrap;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
button:hover { background: var(--bg); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { filter: brightness(1.1); }
button.danger { color: var(--danger); border-color: #e6b8b3; }
button.link { border: none; background: none; color: var(--accent); padding: 2px 4px; min-height: 0; }
button.sm { padding: 2px 8px; min-height: 26px; font-size: 12px; }
button:disabled { opacity: .5; cursor: not-allowed; }
kbd { font-size: 11px; border: 1px solid currentColor; border-radius: 3px; padding: 0 3px; opacity: .8; }

/* ---------- Tables ---------- */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: #fafbfc; position: sticky; top: 0; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafbfc; }
td.num, th.num { text-align: right; white-space: nowrap; }
td input { min-height: 28px; padding: 3px 6px; }
.empty { padding: 24px; text-align: center; color: var(--muted); }

.badge { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 11px; font-weight: 600;
  background: var(--bg); border: 1px solid var(--line); text-transform: uppercase; }
.badge.b2b { color: #1f4e79; }
.badge.b2c { color: #3d4a57; }
.badge.online { color: #6b3fa0; }
.badge.cancelled { color: var(--danger); }
.badge.converted { color: var(--muted); }
.badge.active { color: var(--ok); }

/* ---------- Billing screen ---------- */
.bill { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; align-items: start; }
.bill-type { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.bill-type a { padding: 6px 14px; text-decoration: none; color: var(--text); border-right: 1px solid var(--line-strong); }
.bill-type a:last-child { border-right: none; }
.bill-type a.on { background: var(--accent); color: #fff; }
.cust-chip { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--accent-soft); }
.cust-chip .grow { flex: 1; }
.entry-row { display: grid; grid-template-columns: minmax(0, 1fr) 100px 100px 80px 95px auto; gap: 8px; align-items: end; }
.lines td.item-name { min-width: 180px; }
.lines input.qty, .lines input.rate, .lines input.disc, .lines input.disc-amt { width: 76px; text-align: right; }
.lines input.qty, .lines input.disc { width: 64px; }
.lines input.free { width: 56px; text-align: right; }
.lines td.free-cell .free-tag, .free-tag { color: var(--ok, #1e7d4f); font-weight: 600; }
.lines td { padding-left: 5px; padding-right: 5px; }
.totals { position: sticky; top: 60px; }
.totals table td { border: none; padding: 3px 0; }
.totals .grand td { font-size: 20px; font-weight: 700; border-top: 1px solid var(--line); padding-top: 8px; }
.totals .actions { display: grid; gap: 8px; margin-top: 12px; }
.totals .actions button { justify-content: center; min-height: 38px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.seg button { border: none; border-radius: 0; justify-content: center; }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.notice { padding: 6px 10px; border-radius: var(--radius); background: #fff8e6; border: 1px solid #f0d9a0; color: var(--warn); font-size: 12px; }

/* Fixed bar at the bottom of the billing screen */
.bottom-bar { position: fixed; left: var(--sbw, 0px); transition: left .2s; right: 0; bottom: 0; z-index: 15; display: flex; justify-content: flex-end; align-items: center; gap: 12px;
  padding: 8px 16px; background: var(--panel); border-top: 1px solid var(--line); }
.bottom-bar button { min-height: 36px; }
main:has(.bottom-bar) { padding-bottom: 70px; }
#toasts { bottom: 64px; }

/* ---------- Typeahead ---------- */
.ta { position: relative; }
.ta-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 50; background: #fff; border: 1px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: 0 6px 18px rgba(0,0,0,.08); max-height: 320px; overflow: auto; margin-top: 2px; min-width: 320px; }
.ta-item { padding: 6px 10px; cursor: pointer; border-bottom: 1px solid var(--line); }
.ta-item:last-child { border-bottom: none; }
.ta-item.on, .ta-item:hover { background: var(--accent-soft); }
.ta-item .sub { font-size: 12px; color: var(--muted); }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(20, 24, 28, .35); display: flex; align-items: flex-start;
  justify-content: center; padding: 40px 16px; z-index: 100; overflow: auto; }
.modal { background: var(--panel); border-radius: 8px; width: 100%; max-width: 640px; box-shadow: 0 10px 30px rgba(0,0,0,.15); }
.modal.wide { max-width: 900px; }
.modal-head { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.modal-head h3 { flex: 1; font-size: 16px; }
.modal-body { padding: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.form-error { color: var(--danger); background: var(--danger-soft); padding: 6px 10px; border-radius: var(--radius); margin-bottom: 10px; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 200; }
.toast { background: var(--text); color: #fff; padding: 10px 14px; border-radius: var(--radius); max-width: 420px;
  box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.toast.err { background: var(--danger); }

/* ---------- Login ---------- */
.lg-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: #e4e8ee; }
.lg-card { width: 100%; max-width: 1000px; min-height: 600px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  background: #fff; border-radius: 32px; padding: 20px; box-shadow: 0 20px 50px rgba(28, 47, 94, .10); }
.lg-left { position: relative; border-radius: 20px; overflow: hidden; background: #4369b0; min-height: 520px; }
.lg-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lg-caption { position: absolute; left: 24px; right: 24px; bottom: 28px; color: #fff; }
.lg-cap-title { font-size: 22px; font-weight: 700; letter-spacing: .2px; }
.lg-cap-sub { font-size: 13px; opacity: .85; margin-top: 4px; }
.lg-right { display: flex; flex-direction: column; justify-content: center; padding: 24px 36px; }
.lg-logo { width: 150px; height: auto; display: block; margin: 0 auto 18px; }
.lg-title { font-size: 26px; font-weight: 700; text-align: center; color: #1c2f5e; }
.lg-sub { text-align: center; color: var(--muted); margin: 8px 0 24px; }
.lg-form { display: grid; gap: 16px; }
.lg-form label { font-size: 13px; margin-bottom: 6px; }
.lg-form input:not([type=checkbox]) { min-height: 44px; border-radius: 22px; padding: 8px 18px; border-color: #d7dce3; }
.lg-form input:focus { outline: 3px solid #e1e9f6; border-color: #4369b0; }
.lg-pass { position: relative; }
.lg-pass input { padding-right: 70px !important; }
.lg-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: none; background: none;
  color: #4369b0; font-size: 12px; font-weight: 600; min-height: 0; padding: 6px 10px; }
.lg-eye:hover { background: #eef3fa; border-radius: 16px; }
.lg-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.lg-row .check { font-size: 13px; color: var(--muted); }
.lg-forgot { color: #4369b0; text-decoration: underline; cursor: pointer; font-weight: 600; }
.lg-btn { min-height: 46px; border-radius: 23px; border: none; background: #4369b0; color: #fff; font-size: 15px;
  font-weight: 600; justify-content: center; margin-top: 4px; }
.lg-btn:hover { background: #36589a; }
.lg-btn:disabled { opacity: .7; }
.lg-help { display: none; margin-top: 14px; text-align: center; font-size: 13px; color: var(--warn);
  background: #fff8e6; border: 1px solid #f0d9a0; border-radius: 12px; padding: 8px; }
.lg-help.on { display: block; }
.lg-foot { margin-top: 28px; text-align: center; font-size: 12px; color: var(--muted); }
.lg-form .form-error { margin: 0; border-radius: 12px; }

/* gentle movement in the illustration */
.lg-fish { animation: lgSwim 14s ease-in-out infinite; }
.lg-fish.f1 { transform: translate(140px, 250px); animation-name: lgSwim1; }
.lg-fish.f2 { transform: translate(300px, 360px); animation-name: lgSwim2; animation-duration: 18s; }
.lg-fish.f3 { transform: translate(90px, 420px); animation-name: lgSwim3; animation-duration: 16s; }
@keyframes lgSwim1 { 0%, 100% { transform: translate(140px, 250px); } 50% { transform: translate(200px, 236px); } }
@keyframes lgSwim2 { 0%, 100% { transform: translate(300px, 360px); } 50% { transform: translate(250px, 372px); } }
@keyframes lgSwim3 { 0%, 100% { transform: translate(90px, 420px); } 50% { transform: translate(130px, 410px); } }
.lg-bub { animation: lgRise 7s linear infinite; }
.lg-bub.b2 { animation-delay: -2s; } .lg-bub.b3 { animation-delay: -4s; animation-duration: 9s; }
.lg-bub.b4 { animation-delay: -1s; animation-duration: 8s; } .lg-bub.b5 { animation-delay: -5s; }
@keyframes lgRise { 0% { transform: translateY(0); opacity: 0; } 10% { opacity: 1; } 90% { opacity: .8; } 100% { transform: translateY(-460px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .lg-fish, .lg-bub { animation: none; } }

@media (max-width: 820px) {
  .lg-card { grid-template-columns: 1fr; min-height: 0; border-radius: 24px; padding: 12px; }
  .lg-left { display: none; }
  .lg-right { padding: 24px 16px; }
}

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tabs button { border: none; border-bottom: 2px solid transparent; border-radius: 0; background: none; }
.tabs button.on { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }
.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 14px; min-width: 140px; }
.stat .v { font-size: 18px; font-weight: 700; }
.perm-table td, .perm-table th { text-align: center; }
.perm-table td:first-child, .perm-table th:first-child { text-align: left; }
/* rights grid: tick / restricted / cross */
.rg td { padding: 3px 6px; }
.rg-cell { width: 34px; height: 28px; padding: 0; border: 1px solid var(--line, #d9dde3); border-radius: 6px; background: #fff; font-size: 15px; line-height: 1; cursor: pointer; }
.rg-cell.rg-2 { color: #16a34a; border-color: #86efac; background: #f0fdf4; }
.rg-cell.rg-1 { color: #b45309; border-color: #fcd34d; background: #fffbeb; }
.rg-cell.rg-0 { color: #dc2626; border-color: #fecaca; background: #fff; }
.rg-cell.rg-role { box-shadow: inset 0 0 0 2px rgba(0,0,0,.06); opacity: .7; }
.rg-na { color: #94a3b8; font-size: 11px; font-weight: 600; }

@media (max-width: 1000px) {
  .bill { grid-template-columns: 1fr; }
  .totals { position: static; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entry-row { grid-template-columns: 1fr 1fr; }
  .entry-row > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .span2, .span3 { grid-column: auto; }
  .topbar { height: auto; flex-wrap: wrap; padding: 8px; }
}

/* ---------- Icons ---------- */
.ico { width: 28px; height: 28px; flex: none; }
.ico.sm { width: 16px; height: 16px; }

/* ---------- Home: navigation tiles ---------- */
.home-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 4px 0 16px; flex-wrap: wrap; }
.home-head h2 { font-size: 22px; }
.tile-group { margin-top: 18px; }
.tile-group-title { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 8px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tile { position: relative; display: flex; gap: 14px; align-items: center; padding: 16px; min-height: 84px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s; }
.tile .ico { color: var(--accent); background: var(--accent-soft); border-radius: 10px; padding: 9px; width: 46px; height: 46px; }
.tile:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(31, 78, 121, .10); transform: translateY(-1px); }
.tile:focus-visible { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
.tile-label { font-weight: 600; font-size: 15px; }
.tile-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tile-key { position: absolute; top: 8px; right: 10px; color: var(--muted); }
.tile.soon { opacity: .55; cursor: default; }
.tile.soon:hover { transform: none; box-shadow: none; border-color: var(--line); }

/* ---------- Admin dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.kpi-label { font-size: 12px; color: var(--muted); }
.kpi-value { font-size: 22px; font-weight: 700; margin: 2px 0; white-space: nowrap; }
.kpi-sub { font-size: 12px; color: var(--muted); }
.kpi.main { background: var(--accent); border-color: var(--accent); color: #fff; }
.kpi.main .kpi-label, .kpi.main .kpi-sub { color: rgba(255,255,255,.8); }
.kpi.main .ok-text { color: #b9f5cf; } .kpi.main .danger-text { color: #ffd2cc; }
.kpi.warn .kpi-value { color: var(--warn); }
.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 12px; margin-top: 12px; }
.dash-grid .panel + .panel { margin-top: 0; }
.dash-grid .span-all { grid-column: 1 / -1; }
.panel-title a { margin-left: auto; font-weight: 400; }
.bars { display: flex; gap: 8px; align-items: stretch; height: 170px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.bar-val { font-size: 10px; color: var(--muted); height: 14px; white-space: nowrap; }
.bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.bar { width: 100%; background: #b9cde3; border-radius: 4px 4px 0 0; }
.bar-col.today .bar { background: var(--accent); }
.bar-col.today .bar-day { color: var(--accent); font-weight: 700; }
.bar-day { font-size: 11px; color: var(--muted); }
.split-row { display: grid; grid-template-columns: 80px 1fr 90px; gap: 8px; align-items: center; font-size: 13px; padding: 3px 0; }
.split-bar { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.split-bar i { display: block; height: 100%; background: var(--accent); }
table.mini td { padding: 4px 6px; border-bottom: 1px solid var(--line); font-size: 13px; }
table.mini tr:last-child td { border-bottom: none; }
table.mini tbody tr:hover td { background: none; }
@media (max-width: 1200px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .dash-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .kpis { grid-template-columns: 1fr 1fr; } .dash-grid { grid-template-columns: 1fr; } }

/* ---------- App shell with left sidebar ---------- */
.shell { --sbw: 224px; display: grid; grid-template-columns: var(--sbw) minmax(0, 1fr); grid-template-rows: 52px 1fr;
  min-height: 100vh; transition: grid-template-columns .2s; }
.shell > .topbar { grid-column: 1 / -1; height: 52px; padding: 0 12px; gap: 10px; }
.topbar .grow { flex: 1; }
.nav-toggle { border: none; background: none; padding: 6px; min-height: 0; border-radius: 8px; color: var(--text); }
.nav-toggle svg { width: 22px; height: 22px; display: block; }
.nav-toggle:hover { background: var(--bg); }
.side { position: sticky; top: 52px; height: calc(100vh - 52px); overflow-y: auto; overflow-x: hidden;
  background: var(--panel); border-right: 1px solid var(--line); padding: 10px 8px 24px; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 7px 10px; margin: 1px 0; border-radius: 8px;
  color: var(--text); text-decoration: none; white-space: nowrap; font-size: 14px; }
.side-link .ico { width: 20px; height: 20px; color: var(--muted); }
.side-link:hover { background: var(--bg); }
.side-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-link.active .ico { color: var(--accent); }
.side-link.soon { opacity: .5; cursor: default; }
.side-link.soon:hover { background: none; }
.side-link .badge { font-size: 9px; padding: 0 5px; }
.side-group { margin-top: 10px; }
.side-head { display: flex; align-items: center; width: 100%; border: none; background: none; min-height: 0; padding: 6px 10px;
  font-size: 11px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: var(--muted); border-radius: 6px; }
.side-head:hover { background: var(--bg); color: var(--text); }
.side-head .side-text { flex: 1; text-align: left; }
.side-head .chev { width: 14px; height: 14px; transition: transform .15s; }
.side-group.closed .chev { transform: rotate(-90deg); }
.side-group.closed .side-items { display: none; }
.side-backdrop { display: none; }

/* fixed places in the layout grid, so the page always fills the space */
.shell > .side { grid-column: 1; grid-row: 2; }
.shell > main { grid-column: 2; grid-row: 2; }

/* sidebar: scrolling list + switch fixed at the bottom */
.side { display: flex; flex-direction: column; padding: 0; }
.side-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 8px 16px; }
.side-foot { border-top: 1px solid var(--line); padding: 10px 14px; background: var(--panel); }
.nav-burger { display: none; border: none; background: none; padding: 6px; min-height: 0; border-radius: 8px; color: var(--text); }
.nav-burger svg { width: 22px; height: 22px; display: block; }

/* switch OFF: icons only */
.shell.nav-mini { --sbw: 64px; }
.nav-mini .side-scroll { padding: 10px 8px; }
.nav-mini .side-text { display: none; }
.nav-mini .side-link { justify-content: center; padding: 9px 0; }
.nav-mini .side-head { justify-content: center; padding: 0; height: 1px; background: var(--line); margin: 8px 6px; border-radius: 0; cursor: default; }
.nav-mini .side-head .chev { display: none; }
.nav-mini .side-group.closed .side-items { display: block; }
.nav-mini .side-foot { padding: 10px 0; display: flex; justify-content: center; }
.nav-mini .sw-text { display: none; }
.nav-switch { position: relative; }

/* on/off switch at the bottom of the menu */
.nav-switch { display: inline-flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; color: var(--text); font-size: 13px; user-select: none; }
.nav-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw-track { position: relative; width: 38px; height: 22px; border-radius: 11px; background: #c5cad1; transition: background .15s; flex: none; }
.sw-knob { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.nav-switch input:checked + .sw-track { background: var(--accent); }
.nav-switch input:checked + .sw-track .sw-knob { transform: translateX(16px); }
.nav-switch input:focus-visible + .sw-track { outline: 3px solid var(--accent-soft); }
.sw-text { font-weight: 600; }

/* small screens: the menu slides over the page */
@media (max-width: 900px) {
  .shell, .shell.nav-mini { --sbw: 0px; grid-template-columns: minmax(0, 1fr); }
  .shell > main { grid-column: 1; }
  .nav-burger { display: block; }
  .side-foot { display: none !important; }
  .nav-mini .side-text { display: inline; }
  .nav-mini .side-link { justify-content: flex-start; padding: 7px 10px; }
  .nav-mini .side-head { justify-content: flex-start; height: auto; padding: 6px 10px; margin: 0; background: none; }
  .nav-mini .side-head .chev { display: block; }
  .side { position: fixed; left: 0; top: 52px; width: 240px; z-index: 40; transform: translateX(-100%); transition: transform .2s;
    box-shadow: 4px 0 16px rgba(0,0,0,.08); }
  .shell.nav-show .side { transform: none; }
  .shell.nav-show .side-backdrop { display: block; position: fixed; inset: 52px 0 0 0; background: rgba(20,24,28,.3); z-index: 35; }
}
@media (max-width: 640px) {
  .shell > .topbar { flex-wrap: nowrap; height: 52px; padding: 0 8px; }
  .shell > .topbar .userbox .muted { display: none; }
  .shell > .topbar .brand { font-size: 13px; }
}

/* ---------- Bulk Update ---------- */
.bulk-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.bulk-steps .panel + .panel { margin-top: 0; }
.step-no { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 92px; cursor: pointer;
  border: 2px dashed var(--line-strong); border-radius: 10px; background: #fafbfc; margin: 0; color: var(--text); font-size: 14px; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop input { display: none; }
.drop-main { font-weight: 600; color: var(--accent); }
.bulk-sum { display: flex; gap: 8px; flex-wrap: wrap; }
.bulk-chip { flex-direction: column; align-items: flex-start; gap: 0; min-width: 110px; padding: 6px 12px; }
.bulk-chip span { font-size: 12px; color: var(--muted); }
.bulk-chip strong { font-size: 18px; }
.bulk-chip.on { border-color: var(--accent); background: var(--accent-soft); }
.bulk-chip.error strong { color: var(--danger); } .bulk-chip.create strong { color: var(--ok); } .bulk-chip.update strong { color: var(--accent); }
.badge.res-create { color: var(--ok); } .badge.res-update { color: var(--accent); } .badge.res-error { color: var(--danger); } .badge.res-nochange { color: var(--muted); }
.bulk-help { margin-top: 12px; }
.bulk-help summary { cursor: pointer; }
.bulk-help ul { padding-left: 18px; }
.bulk-done { border-color: #b7dfc4; background: #f3fbf5; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (max-width: 900px) { .bulk-steps { grid-template-columns: 1fr; } }

/* ---------- Bulk check results ---------- */
.chk-banner { padding: 10px 14px; border-radius: 8px; margin-bottom: 10px; border: 1px solid; }
.chk-banner.ok { background: #f0faf3; border-color: #b7dfc4; color: #14532d; }
.chk-banner.warn { background: #fff8e6; border-color: #f0d9a0; color: #6b4a00; }
.chk-banner.bad { background: var(--danger-soft); border-color: #f1b8b0; color: #8a1c12; }
.bulk-chip.warning strong { color: var(--warn); } .bulk-chip.missing strong { color: var(--muted); }
.chk-table td { vertical-align: top; }
.chk-table tr.row-err td { background: #fff5f4; }
.chk-table tr.row-warn td { background: #fffbef; }
.chk-err { color: var(--danger); }
.chk-warn { color: #8a5a00; }
.chk-err div, .chk-warn div { margin: 1px 0; }
table.diff { width: auto; margin-top: 2px; border-collapse: collapse; }
table.diff td { border: none; padding: 1px 6px 1px 0; vertical-align: top; }
.diff-f { color: var(--muted); white-space: nowrap; }
.diff-old { background: #fdecea; color: #8a1c12; text-decoration: line-through; padding: 0 4px; border-radius: 3px; }
.diff-new { background: #e6f4ea; color: #14532d; font-weight: 600; padding: 0 4px; border-radius: 3px; }
.diff-arrow { color: var(--muted); }
.chk-foot { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.chk-foot .grow { flex: 1; }

/* =====================================================================
   Adaptive layout: desktop (> 1000px), tablet (761-1000px), phone (<= 760px)
   ===================================================================== */
.mobile-only { display: none !important; }
.bottom-bar.phone-bar-only { display: none; }
.mb-total { display: flex; flex-direction: column; line-height: 1.1; margin-right: auto; }
.mb-total strong { font-size: 18px; white-space: nowrap; }
.lbl-short { display: none; }
.dash-grid { grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); }
.dash-grid > .panel, .kpis > .kpi { min-width: 0; }
.dash-grid .panel { overflow-x: auto; }

/* Touch screens (tablet / phone): bigger tap targets, no keyboard hints */
@media (pointer: coarse) {
  button, .btn { min-height: 40px; }
  button.sm { min-height: 34px; padding: 4px 12px; font-size: 13px; }
  input, select { min-height: 40px; }
  .side-link { padding: 10px 12px; }
  kbd, .desktop-only, .tile-key { display: none !important; }
  .ta-item { padding: 10px 12px; }
}

/* ---------- Tablet ---------- */
@media (max-width: 1000px) {
  main { padding: 12px; }
  .bill { grid-template-columns: 1fr; }
  .totals { position: static; }
  .totals .actions { grid-template-columns: 1fr 1fr; }
  .totals .actions > div:first-child { grid-column: 1 / -1; }
  .dash-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-head .muted.small { display: none; }
  .entry-row { grid-template-columns: 1fr 1fr 1fr 1fr auto; }
  .entry-row > :first-child { grid-column: 1 / -1; }
  .lines td.item-name { min-width: 140px; }
}

/* ---------- Phone ---------- */
@media (max-width: 760px) {
  :root { font-size: 15px; }
  main { padding: 10px 10px 90px; }
  input, select, textarea { font-size: 16px; }         /* stops iPhone zooming into fields */
  .page-head { gap: 8px; }
  .page-head h2 { font-size: 17px; width: 100%; }
  .page-head .grow { display: none; }
  .page-head > .btn, .page-head > button { flex: 1 1 auto; justify-content: center; }
  .panel { padding: 10px; }
  .row > .f { min-width: calc(50% - 4px); flex: 1 1 calc(50% - 4px); }
  .row > div:not(.f) { flex: 1 1 auto; }
  .row > div:not(.f) > button { width: 100%; justify-content: center; }
  .grid.g2, .grid.g3, .grid.g4 { grid-template-columns: 1fr 1fr; }
  .grid .span2, .grid .span3, .grid .span4 { grid-column: 1 / -1; }
  .grid > div:has(> textarea) { grid-column: 1 / -1; }
  .mobile-only { display: inline-flex !important; }
  .mb-total.mobile-only { display: flex !important; }
  .desktop-only { display: none !important; }

  /* Lists become cards */
  .table-wrap:has(table.rt) { border: none; background: none; overflow: visible; max-height: none !important; }
  table.rt thead { display: none; }
  table.rt, table.rt tbody, table.rt tr { display: block; width: 100%; }
  table.rt tr { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; }
  table.rt tbody tr:hover td { background: none; }
  table.rt td { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border: none; padding: 3px 0; text-align: right; }
  table.rt td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; flex: none; padding-top: 2px; }
  table.rt td[data-label=""]::before { display: none; }
  table.rt td:empty { display: none; }
  table.rt td[data-label=""] { justify-content: flex-start; flex-wrap: wrap; gap: 6px; padding-top: 8px; }
  table.rt td.rt-full { display: block; text-align: center; }
  table.rt td:first-child { font-weight: 600; }
  table.rt td > div, table.rt td .small { text-align: right; }
  .chk-table td:last-child { display: block; text-align: left; }
  .chk-table td:last-child::before { display: block; margin-bottom: 2px; }
  .chk-table tr.row-err { border-color: #f1b8b0; } .chk-table tr.row-warn { border-color: #f0d9a0; }

  /* Billing: item entry */
  .entry-row { grid-template-columns: 1fr 1fr 1fr; }
  .entry-row > :first-child { grid-column: 1 / -1; }
  .entry-row > :last-child { grid-column: 1 / -1; }
  .entry-row > :last-child button { width: 100%; justify-content: center; }
  .cust-chip { flex-wrap: wrap; }

  /* Billing: each added item as a small card */
  .table-wrap:has(table.lines) { border: none; background: none; overflow: visible; }
  table.lines thead { display: none; }
  table.lines, table.lines tbody { display: block; }
  table.lines tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 8px; align-items: end;
    background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; }
  table.lines td { border: none; padding: 0; text-align: left; }
  table.lines td.empty { grid-column: 1 / -1; text-align: center; }
  table.lines td.ln-no, table.lines td:nth-child(3), table.lines td:nth-child(6), table.lines td:nth-child(10) { display: none; }
  table.lines td.item-name { grid-column: 1 / 4; font-weight: 600; }
  table.lines td:nth-child(12) { grid-column: 4; grid-row: 1; text-align: right; }
  table.lines td:nth-child(12) .del { font-size: 22px; padding: 0 6px; }
  table.lines td:nth-child(4)::before { content: "Qty"; }
  table.lines td:nth-child(5)::before { content: "Free"; }
  table.lines td:nth-child(7)::before { content: "Rate"; }
  table.lines td:nth-child(8)::before { content: "Disc %"; }
  table.lines td:nth-child(9)::before { content: "Disc Rs."; }
  table.lines td:nth-child(4)::before, table.lines td:nth-child(5)::before, table.lines td:nth-child(7)::before, table.lines td:nth-child(8)::before, table.lines td:nth-child(9)::before {
    display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
  table.lines td:nth-child(4), table.lines td:nth-child(5), table.lines td:nth-child(7), table.lines td:nth-child(8), table.lines td:nth-child(9) { text-align: left; }
  table.lines input.qty, table.lines input.free, table.lines input.rate, table.lines input.disc, table.lines input.disc-amt { width: 100%; text-align: left; }
  table.lines td.amt { grid-column: 1 / -1; font-weight: 700; font-size: 16px; text-align: right; white-space: nowrap; }

  /* Billing: totals panel; Save buttons live in the bottom bar on phones */
  .totals .actions > button { display: none; }
  .totals .actions > button#btnHold, .totals .actions > button.held-m { display: flex !important; }
  .bottom-bar kbd { display: none; }
  .bottom-bar #btnHeld { display: none; }
  .bottom-bar, .bottom-bar.phone-bar-only { display: flex; left: 0 !important; padding: 8px 10px; gap: 8px; }
  .bottom-bar button { padding: 6px 12px; }
  .bill-type { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); }
  .bill-type a { text-align: center; padding: 8px 4px; }

  /* Pop-ups fill the screen */
  .modal-bg { padding: 0; align-items: stretch; }
  .modal, .modal.wide { max-width: none; border-radius: 0; min-height: 100%; display: flex; flex-direction: column; }
  .modal-body { flex: 1; overflow: auto; }
  .modal-foot { position: sticky; bottom: 0; background: var(--panel); }

  /* Home, dashboard */
  .home-head h2 { font-size: 19px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tile { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; min-height: 0; }
  .tile .ico { width: 38px; height: 38px; padding: 7px; }
  .tile-desc { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi.main { grid-column: 1 / -1; }
  .kpi-value { font-size: 18px; }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .bars { height: 140px; gap: 4px; }
  .lbl-long { display: none; } .lbl-short { display: inline; }
  .mb-total strong { font-size: 16px; }
  table.mini td:nth-child(5), table.mini td:nth-child(6) { display: none; }   /* today's bills: hide status/user on phones */
  table.mini td { font-size: 12px; }
  .split-row { grid-template-columns: 70px 1fr 80px; }

  /* Bulk update, reports, stock */
  .bulk-sum { display: grid; grid-template-columns: 1fr 1fr 1fr; }
  .bulk-chip { min-width: 0; }
  .chk-foot > * { width: 100%; justify-content: center; }
  .stat-row .stat { flex: 1 1 40%; min-width: 0; }
  .tabs { overflow-x: auto; }
  .tabs button { white-space: nowrap; }
}

/* Very small phones */
@media (max-width: 380px) {
  .grid.g2, .grid.g3, .grid.g4 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr; }
  .entry-row { grid-template-columns: 1fr 1fr; }
}

/* ---------- Services (AMC) ---------- */
.amc-rem { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.rem-card { flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 12px; min-height: 0; border-radius: 10px; text-align: left; }
.rem-card strong { font-size: 22px; line-height: 1.2; }
.rem-card span { font-size: 12px; color: var(--muted); white-space: normal; }
.rem-card.bad strong { color: var(--danger); } .rem-card.warn strong { color: var(--warn); } .rem-card.zero strong { color: var(--muted); }
.rem-card.bad { border-color: #f1b8b0; } .rem-card.warn { border-color: #f0d9a0; }
.rem-card.on { background: var(--accent-soft); border-color: var(--accent); }
.amc-top { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.amc-top .panel + .panel { margin-top: 0; }
table.kv td:first-child { color: var(--muted); width: 45%; }
.badge.st-active { color: var(--ok); } .badge.st-upcoming { color: var(--accent); } .badge.st-expired { color: var(--danger); }
.badge.st-cancelled { color: var(--muted); } .badge.st-renewed { color: #6b3fa0; }
.badge.vs-pending { color: var(--accent); } .badge.vs-done { color: var(--ok); } .badge.vs-skipped { color: var(--muted); } .badge.vs-overdue { color: var(--danger); border-color: #f1b8b0; }
tr.row-late td { background: #fff7f6; }
.btn.wa { color: #128c4b; border-color: #9fd8b5; }
.btn.wa:hover { background: #effaf3; }
.btn.sm { padding: 2px 8px; min-height: 26px; font-size: 12px; }
.seg5 { display: flex; flex-wrap: wrap; gap: 6px; }
.seg5 button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.side-badge { margin-left: auto; background: var(--danger); color: #fff; border-radius: 10px; font-size: 11px; font-weight: 700; padding: 0 7px; line-height: 18px; }
.nav-mini .side-link { position: relative; }
.nav-mini .side-badge { position: absolute; top: 2px; right: 6px; padding: 0 5px; font-size: 10px; }
@media (max-width: 1000px) { .amc-rem { grid-template-columns: repeat(3, minmax(0, 1fr)); } .amc-top { grid-template-columns: 1fr 1fr; } .amc-top .panel:first-child { grid-column: 1 / -1; } }
@media (max-width: 760px) { .amc-rem { grid-template-columns: 1fr 1fr; } .amc-top { grid-template-columns: 1fr; } .rem-card strong { font-size: 19px; } }

/* ---------- Returns ---------- */
.ret-bill { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; padding: 8px 10px;
  background: var(--accent-soft); border-radius: 8px; margin-top: 10px; }
.ret-lines input.rq { width: 100px; text-align: right; }
.ret-lines tr.ret-on td { background: #f3fbf5; }
.ret-foot { display: flex; gap: 16px; align-items: flex-end; margin-top: 10px; flex-wrap: wrap; }
.ret-total { min-width: 220px; text-align: right; display: flex; flex-direction: column; }
.ret-total strong { font-size: 24px; }
@media (max-width: 760px) {
  .ret-lines thead { display: none; }
  .ret-lines, .ret-lines tbody { display: block; }
  .ret-lines tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; background: var(--panel); }
  .ret-lines td { border: none; padding: 1px 0; text-align: left !important; }
  .ret-lines td:first-child { grid-column: 1 / -1; font-weight: 600; }
  .ret-lines td:nth-child(2)::before { content: "Sold: "; color: var(--muted); }
  .ret-lines td:nth-child(3)::before { content: "Returned: "; color: var(--muted); }
  .ret-lines td:nth-child(4)::before { content: "Rate: "; color: var(--muted); }
  .ret-lines td:nth-child(5) { display: none; }
  .ret-lines td:nth-child(6)::before { content: "Can return: "; color: var(--muted); }
  .ret-lines td:nth-child(7)::before { content: "Return qty"; display: block; font-size: 11px; color: var(--muted); }
  .ret-lines input.rq { width: 100%; text-align: left; }
  .ret-lines td.rr { align-self: end; font-weight: 700; font-size: 16px; text-align: right !important; }
  .ret-total { text-align: left; width: 100%; }
}

/* ---------- Enquiries ---------- */
.badge.eq-new { color: var(--accent); font-weight: 600; } .badge.eq-follow_up { color: var(--warn); }
.badge.eq-converted { color: var(--ok); } .badge.eq-lost { color: var(--danger); } .badge.eq-cancelled { color: var(--muted); }
.rem-card.okc strong { color: var(--ok); }
td.eq-msg { min-width: 220px; max-width: 360px; white-space: normal; }
.eq-full { white-space: pre-wrap; word-break: break-word; }
.eq-timeline { margin-top: 12px; border-left: 2px solid var(--line); padding-left: 12px; display: grid; gap: 10px; }
.eq-text { white-space: pre-wrap; word-break: break-word; }
textarea.code { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; white-space: pre; }
@media (max-width: 760px) { td.eq-msg { max-width: none; min-width: 0; } }

/* ---------- Line details: brand / serial no / description (A5 bill only) ---------- */
.ent-foot { display: flex; align-items: center; gap: 10px; margin-top: 6px; min-height: 18px; }
.ent-foot #entInfo { flex: 1; }
.ent-extra { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.ent-extra textarea { min-height: 34px; }
.ln-extra { color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 2px; white-space: normal; word-break: break-word; }
.ln-extra b { font-weight: 600; }
.lines .ln-ex-btn { padding: 0; margin-top: 2px; }
@media (max-width: 760px) { .ent-extra { grid-template-columns: 1fr; } .ent-extra .span3 { grid-column: auto; } .ent-foot { flex-wrap: wrap; } }

/* ---------- Estimate / Invoice entry: grid layout ---------- */
.inv { display: grid; gap: 12px; }
.inv .panel + .panel { margin-top: 0; }
.inv-head { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.2fr) minmax(0, .85fr); gap: 12px; align-items: start; }
.inv-head .panel, .inv-foot .panel { margin: 0; }
table.kv-form { width: 100%; border-collapse: collapse; }
table.kv-form td { border: none; padding: 3px 0; vertical-align: middle; }
table.kv-form td:first-child { color: var(--muted); font-size: 12.5px; white-space: nowrap; padding-right: 10px; width: 1%; }
.inv-no { min-height: 32px; display: flex; align-items: center; gap: 6px; }
.inv-items { padding: 0; overflow: hidden; }
.inv-items > div:last-child { padding: 0 12px 12px; }
.inv-gridwrap { margin: 0; border: none; border-radius: 0; overflow-x: auto; }
table.inv-grid { width: 100%; border-collapse: collapse; min-width: 1180px; font-size: 13px; }
.inv-grid th { background: #f3f5f8; font-size: 11.5px; text-transform: uppercase; letter-spacing: .3px; color: #3a4654; font-weight: 600;
  border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 6px 6px; text-align: left; white-space: nowrap; }
.inv-grid th.sub { font-size: 10.5px; text-transform: none; color: var(--muted); font-weight: 500; padding: 3px 6px; }
.inv-grid th.c-grp { text-align: center; }
.inv-grid td { border-bottom: 1px solid var(--line); border-right: 1px solid #edf0f3; padding: 3px 4px; vertical-align: middle; }
.inv-grid td input { width: 100%; min-height: 30px; padding: 4px 6px; font-size: 13px; border-color: transparent; background: transparent; }
.inv-grid td input:hover { border-color: var(--line); }
.inv-grid td input:focus { border-color: var(--accent); background: #fff; }
.inv-grid input.num { text-align: right; }
.inv-grid input.bad { border-color: var(--danger); background: #fff5f4; }
.inv-grid .c-no { width: 34px; text-align: center; color: var(--muted); }
.inv-grid .c-item { min-width: 210px; }
.inv-grid .c-item .it-name { font-weight: 500; line-height: 1.25; }
.inv-grid .c-sn { width: 150px; } .inv-grid .c-notes { width: 130px; } .inv-grid .c-brand { width: 100px; }
.inv-grid .c-qty { width: 64px; } .inv-grid .c-rate { width: 96px; } .inv-grid .c-pct { width: 70px; } .inv-grid .c-amt { width: 86px; }
.inv-grid td.num, .inv-grid th.num { text-align: right; }
.inv-grid .num-txt { display: block; text-align: right; padding-right: 6px; }
.inv-grid tr.quick td { background: var(--accent-soft); border-bottom: 2px solid var(--accent); }
.inv-grid tr.quick td.c-no { color: var(--accent); font-size: 16px; }
.inv-grid tr.quick input { background: #fff; border-color: var(--line); min-height: 34px; }
.inv-grid tr.quick .ta-list { min-width: 480px; }
.inv-grid tr.quick input[readonly] { background: #f1f3f6; }
.inv-grid tr.quick-info td { border-bottom: 1px solid var(--line); padding-top: 4px; padding-bottom: 6px; }
.eq-ok { min-width: 38px; min-height: 34px; padding: 0 8px; background: var(--accent); border-color: var(--accent); color: #fff; font-size: 17px; font-weight: 700; border-radius: 6px; }
.eq-ok:hover { filter: brightness(1.1); }
.inv-grid tfoot td { background: #f8f9fb; font-size: 13px; padding: 7px 6px; border-bottom: none; }
.inv-grid tbody#lineBody tr:hover td { background: #fafbfd; }
.inv-grid .del { font-size: 18px; padding: 0 6px; }
.inv-foot { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr) 300px; gap: 12px; align-items: start; }
.inv-foot textarea { width: 100%; }
.inv-foot .totals { position: static; }
.seg.seg3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1250px) {
  .inv-head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .inv-head .inv-meta { grid-column: 1 / -1; }
  .inv-head .inv-meta table.kv-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 16px; }
  .inv-head .inv-meta table.kv-form tbody { display: contents; }
  .inv-head .inv-meta table.kv-form tr { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; }
  .inv-foot { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .inv-foot .totals { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .inv-head, .inv-foot { grid-template-columns: 1fr; }
  .inv-head .inv-meta table.kv-form { grid-template-columns: 1fr; }
  .inv-foot .totals { grid-column: auto; }
  .inv-ref .grid.g2 { grid-template-columns: 1fr 1fr; }
  table.inv-grid { min-width: 1080px; }
}

/* ---------- Serial numbers ---------- */
.sn-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: #fafbfd; }
.sn-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sn-add { display: flex; gap: 8px; margin: 4px 0 8px; }
.sn-add textarea { flex: 1; min-height: 34px; height: 34px; resize: none; overflow: hidden; }
.sn-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; max-height: 160px; overflow: auto; }
.sn-chip { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line-strong); background: #fff; border-radius: 14px; padding: 2px 4px 2px 10px; font-size: 12.5px; }
.sn-chip button { font-size: 15px; line-height: 1; padding: 0 4px; color: var(--muted); }
.sn-chip.new { border-color: var(--accent); background: var(--accent-soft); }
.sn-chip.sold { color: var(--muted); background: #f1f2f4; padding-right: 10px; }
.sn-chip.sold small { margin-left: 4px; }
.sn-cell { display: flex; align-items: center; gap: 2px; }
.sn-cell input { flex: 1; min-width: 0; }
.sn-pick { min-height: 24px; height: 24px; min-width: 24px; padding: 0 5px; font-size: 11px; border-radius: 12px; color: var(--muted); background: #fff; flex: none; }
.sn-pick.has { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.sn-pop { position: fixed; z-index: 60; width: 280px; background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: 0 8px 28px rgba(0,0,0,.18); padding: 8px 10px; }
.sn-pop-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.sn-pop-head button { font-size: 18px; }
.sn-filter { width: 100%; margin-bottom: 6px; }
.sn-opts { max-height: 220px; overflow: auto; display: grid; gap: 2px; }
.sn-opts label { display: flex; align-items: center; gap: 8px; padding: 4px 4px; border-radius: 4px; cursor: pointer; font-size: 13px; }
.sn-opts label:hover { background: var(--accent-soft); }
.sn-opts input { width: auto; margin: 0; }
.sn-pop-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 8px; }

/* ---------- Login type: POS / Biller ---------- */
.lg-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lg-mode label { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 10px 14px; border: 1.5px solid #d7dce3; border-radius: 14px; cursor: pointer; position: relative; }
.lg-mode label b { font-size: 14px; color: #1c2f5e; }
.lg-mode label span { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.lg-mode label.on { border-color: #4369b0; background: #eef3fa; box-shadow: 0 0 0 2px #e1e9f6; }
.lg-mode label.on::after { content: '\2713'; position: absolute; top: 8px; right: 12px; color: #4369b0; font-weight: 700; }
.lg-mode input { position: absolute; opacity: 0; pointer-events: none; }
.lg-mode label:focus-within { outline: 3px solid #e1e9f6; }
.mode-badge { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--line-strong); color: var(--muted); }
.mode-badge.biller { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.login-types { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; }
.login-types > label:first-child { width: 100%; margin: 0; }

/* POS billing: item entry row wraps instead of squeezing (tablets / narrow windows) */
.entry-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.entry-row > div { flex: 0 0 92px; min-width: 0; }
.entry-row > div:first-child { flex: 1 1 240px; }
.entry-row > div:last-child { flex: 0 0 auto; }
@media (max-width: 1400px) {
  table.lines th:nth-child(6), table.lines td:nth-child(6), table.lines th:nth-child(10), table.lines td:nth-child(10) { display: none; }
}
@media (max-width: 760px) {
  .entry-row > div:not(:first-child) { flex: 1 1 28%; }
  .entry-row > div:last-child { flex: 1 1 100%; }
}
@media (max-width: 1200px) {
  .bill { grid-template-columns: 1fr; }
  .bill .totals { position: static; }
  .bill .totals .actions { grid-template-columns: 1fr 1fr; }
  .bill .totals .actions > div:first-child { grid-column: 1 / -1; }
}
.mode-switch { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 14px; overflow: hidden; }
.mode-switch button { border: none; border-radius: 0; min-height: 26px; padding: 2px 10px; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); background: #fff; }
.mode-switch button.on { background: var(--accent); color: #fff; }
.mode-switch button:not(.on):hover { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 760px) {
  .topbar .brand { min-width: 0; flex: 1 1 auto; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .topbar .grow { display: none; }
  .topbar .userbox { flex: none; }
  .mode-switch button { padding: 2px 7px; font-size: 10.5px; }
}

/* ---------- Activity log ---------- */
.act-table td { vertical-align: top; }
.act-detail { min-width: 280px; max-width: 560px; font-size: 12.5px; line-height: 1.45; }
.act-chg { display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: baseline; padding: 1px 0; }
.act-f { color: var(--muted); }
.act-f::after { content: ':'; }
.act-chg del { color: var(--danger); background: #fdf0ef; text-decoration: line-through; padding: 0 3px; border-radius: 3px; word-break: break-word; }
.act-chg ins { color: var(--ok); background: #eef8f2; text-decoration: none; padding: 0 3px; border-radius: 3px; word-break: break-word; }
.act-arrow { color: var(--muted); }
.act-rate { color: var(--warn); font-weight: 600; margin-top: 2px; }
.act-vals { display: flex; flex-wrap: wrap; gap: 2px 12px; }
.act-badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: #f1f3f6; white-space: nowrap; }
.act-badge.ok { background: #eef8f2; color: var(--ok); }
.act-badge.warn { background: #fff6e6; color: var(--warn); }
.act-badge.bad { background: #fdf0ef; color: var(--danger); }
@media (max-width: 760px) { .act-detail { min-width: 0; max-width: none; } }
.ta-item.ta-empty { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: default; }
.ta-item.ta-empty .ta-add { white-space: nowrap; }
.lg-device input { min-height: 44px; border-radius: 22px; padding: 8px 18px; }
.lg-info { border-radius: 12px; padding: 10px 14px; background: #eef3fa; color: #1c2f5e; font-size: 13px; line-height: 1.45; }
.badge.dv-pending { color: var(--warn); } .badge.dv-approved { color: var(--ok); } .badge.dv-blocked { color: var(--danger); }
.chip { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; background: #f1f3f6; margin: 1px 0; }
.dv-users { display: grid; gap: 4px; max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; }

/* ---------- Colour schemes (Settings > Appearance) ---------- */
/* Aquasstar Blue: logo blue top bar and accents */
html[data-theme="blue"] { --bg: #f3f6fb; --accent: #2f5bb7; --accent-soft: #e6edfa; --line: #dbe3ef; --line-strong: #c2cde0; --text: #17233a; --muted: #5d6b82; }
html[data-theme="blue"] .topbar { background: #2f5bb7; border-color: #2f5bb7; }
html[data-theme="blue"] .topbar .brand, html[data-theme="blue"] .topbar .userbox .muted, html[data-theme="blue"] .topbar .nav-burger { color: #fff !important; }
html[data-theme="blue"] .topbar .brand img { background: #fff; border-radius: 50%; padding: 1px 3px; }
html[data-theme="blue"] .topbar button:not(.on) { background: #fff; }
html[data-theme="blue"] .topbar .mode-switch { border-color: #fff; }
html[data-theme="blue"] .topbar .mode-switch button.on { background: #17366f; }
html[data-theme="blue"] .topbar .mode-badge { background: #fff; }
/* Ocean Navy: dark navy side menu */
html[data-theme="navy"] { --bg: #f2f4f8; --accent: #1d5fa8; --accent-soft: #e3ecf8; --text: #152236; --muted: #5f6b7d; }
html[data-theme="navy"] .side, html[data-theme="navy"] .side-foot { background: #13294b !important; border-color: #13294b !important; }
html[data-theme="navy"] .side-link { color: #d5dfee; }
html[data-theme="navy"] .side-link .ico { color: #8fa6c8; }
html[data-theme="navy"] .side-link:hover { background: #1c3962; }
html[data-theme="navy"] .side-link.active { background: #24508e; color: #fff; }
html[data-theme="navy"] .side-link.active .ico { color: #fff; }
html[data-theme="navy"] .side-link.soon { color: #6f84a6; }
html[data-theme="navy"] .side-head { color: #7f96b8; }
html[data-theme="navy"] .side-head:hover { background: #1c3962; color: #fff; }
html[data-theme="navy"] .nav-switch { color: #d5dfee; }
html[data-theme="navy"] .side-subhead { color: #d5dfee; }
html[data-theme="navy"] .side-subhead .chev { color: #8fa6c8; }
html[data-theme="navy"] .side-subhead:hover { background: #1c3962; color: #fff; }
html[data-theme="navy"] .side-subitems { border-left-color: #2a4670; }
html[data-theme="navy"] .nav-mini .side-head { background: #2a4670; }
/* theme picker */
.theme-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.theme-opt { border: 2px solid var(--line); border-radius: 10px; padding: 8px; cursor: pointer; background: var(--panel); text-align: left; display: block; min-height: 0; }
.theme-opt.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.theme-opt .tp-prev { display: grid; grid-template-columns: 26% 1fr; grid-template-rows: 14px 1fr; height: 70px; border-radius: 6px; overflow: hidden; border: 1px solid #d9dde3; margin-bottom: 6px; }
.theme-opt .tp-top { grid-column: 1 / -1; } .theme-opt .tp-main { padding: 6px; } .theme-opt .tp-btn { height: 10px; width: 60%; border-radius: 3px; }
.theme-opt b { display: block; font-size: 13px; } .theme-opt span.small { color: var(--muted); }

/* ---------- Dispatch ---------- */
.badge.ds-packed { color: var(--accent); } .badge.ds-partial { color: var(--warn); } .badge.ds-picked { color: #6b3fa0; }
.badge.ds-shipped { color: var(--ok); } .badge.ds-cancelled { color: var(--danger); }
.mono { font-family: Consolas, "Courier New", monospace; letter-spacing: .5px; }
.dsp-top { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; margin-bottom: 12px; }
.dsp-top .panel + .panel { margin-top: 0; }
.dsp-left { display: flex; flex-wrap: wrap; gap: 8px; }
.dsp-chip { border: 1px solid var(--line-strong); border-left: 4px solid var(--accent); border-radius: 6px; padding: 5px 9px; background: var(--panel);
  display: flex; flex-direction: column; min-width: 150px; }
.dsp-chip b { font-size: 13px; } .dsp-chip span { font-size: 12px; color: var(--muted); }
.dsp-chip.done { border-left-color: var(--ok); opacity: .7; }
.dsp-chip.over { border-left-color: var(--danger); opacity: 1; } .dsp-chip.over span { color: var(--danger); font-weight: 600; }
.dsp-boxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; margin: 12px 0; }
.dsp-boxes .panel + .panel { margin-top: 0; }
.dsp-box-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.dsp-box-head strong { font-size: 16px; }
.dsp-box-head .dsp-w { width: 150px; }
.dsp-items { margin-bottom: 8px; }
.dsp-items td { padding: 4px; } .dsp-items td:nth-child(2) input { width: 80px; } .dsp-items select { min-width: 160px; }
.dsp-ship { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; margin-top: 12px; }
.dsp-ship .panel + .panel { margin-top: 0; }
.dsp-photo { max-width: 100%; max-height: 320px; border: 1px solid var(--line); border-radius: 6px; display: block; }
.scan-panel { margin-bottom: 12px; }
.scan-input { font-size: 22px !important; padding: 10px 12px !important; letter-spacing: 1px; }
.scan-cam { margin-top: 10px; max-width: 420px; }
.scan-cam.hidden { display: none; }
.scan-last { margin-top: 12px; }
.scan-res { border-radius: 8px; padding: 12px 14px; border: 2px solid var(--line); }
.scan-res.ok { border-color: var(--ok); background: #e6f5ec; }
.scan-res.warn { border-color: #d39a00; background: #fff6dc; }
.scan-res.bad { border-color: var(--danger); background: #fde8e7; }
.scan-big { font-size: 22px; font-weight: 700; margin-bottom: 2px; }
@media (max-width: 900px) { .dsp-top, .dsp-ship { grid-template-columns: 1fr; } .dsp-boxes { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .dsp-box-head .dsp-w { width: 110px; } .dsp-items select { min-width: 0; width: 100%; } .scan-big { font-size: 18px; } }

/* ---------- Held bills ---------- */
.hold-count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: #d97706; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.hold-count.hidden { display: none; }
tr.hd-this td { background: var(--accent-soft, #eef3f9); }

/* ---------- Document number on the POS entry screen ---------- */
.pos-no { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin: 0 12px 0 0; white-space: nowrap; }
.pos-no input { width: 170px; min-height: 30px; padding: 3px 8px; font-weight: 600; color: var(--text, #1d2733); }
.num-set td { vertical-align: middle; }
@media (max-width: 760px) { .pos-no { width: 100%; margin: 6px 0 0; } .pos-no input { flex: 1; width: auto; } }

/* ---------- Dropdowns inside a navigation section (Settings) ---------- */
.side-subhead { display: flex; align-items: center; width: 100%; border: none; background: none; min-height: 0; padding: 6px 10px 6px 14px;
  font-size: 13px; font-weight: 600; color: var(--text); border-radius: 8px; cursor: pointer; }
.side-subhead:hover { background: var(--bg); }
.side-subhead .side-text { flex: 1; text-align: left; }
.side-subhead .chev { width: 13px; height: 13px; color: var(--muted); transition: transform .15s; }
.side-sub.closed .chev { transform: rotate(-90deg); }
.side-sub.closed .side-subitems { display: none; }
.side-subitems { margin-left: 12px; padding-left: 4px; border-left: 1px solid var(--line); }
.nav-mini .side-subhead { display: none; }
.nav-mini .side-sub.closed .side-subitems { display: block; }
.nav-mini .side-subitems { margin-left: 0; padding-left: 0; border-left: 0; }
@media (max-width: 900px) {
  .nav-mini .side-subhead { display: flex; }
  .nav-mini .side-sub.closed .side-subitems { display: none; }
  .nav-mini .side-subitems { margin-left: 12px; padding-left: 4px; border-left: 1px solid var(--line); }
}

/* ---------- Financial years / archive ---------- */
.fy-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.fy-list .panel + .panel { margin-top: 0; }
.fy-card.current { border-color: var(--accent); }
.fy-card.closed { background: var(--bg); }
.fy-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.fy-name { font-size: 18px; font-weight: 700; }
.fy-card table.kv td:first-child { width: auto; }
.badge.fy-lock { color: #6b4e00; background: #fff4d6; border-color: #f0d68a; text-transform: none; }

/* ---------- Payments / expenses ---------- */
.rp-bills { display: grid; gap: 4px; max-height: 180px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
.due-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.due-chip { border: 1px solid var(--line); border-radius: 16px; padding: 3px 10px; font-size: 12px; background: var(--bg); }
.due-chip strong { color: var(--warn); margin-left: 4px; }

/* ---------- Reports ---------- */
.rep-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; align-items: start; }
.rep-index .panel + .panel { margin-top: 0; }
.rep-link { display: block; padding: 7px 8px; border-radius: 6px; color: inherit; text-decoration: none; }
.rep-link:hover { background: var(--accent-soft); }
.rep-link b { display: block; font-size: 14px; color: var(--accent); font-weight: 600; }
.rep-link span { font-size: 12px; color: var(--muted); }
.rep-filters { margin-bottom: 12px; }
.rep-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.rep-title { font-size: 17px; font-weight: 700; }
.rep-table tfoot td { font-weight: 700; background: var(--bg); border-top: 2px solid var(--line-strong); }
.rep-table td.neg { color: var(--danger); }
.rep-table tr.b1 td { font-weight: 700; background: var(--bg); }
.rep-table tr.b2 td { font-weight: 800; font-size: 15px; background: var(--accent-soft); }
.rep-table.stmt { max-width: 720px; }
.rep-note { font-size: 12px; color: var(--muted); margin-top: 6px; padding-left: 10px; border-left: 3px solid var(--line-strong); }
.rp-bills label.check { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; }
.rp-bills label.check input { width: auto; min-height: 0; flex: none; }
@media (max-width: 760px) {
  .rep-table tfoot, .rep-table tfoot tr { display: block; width: 100%; }
  .rep-table tfoot td { display: flex; justify-content: space-between; gap: 10px; border: 0; padding: 3px 10px; }
  .rep-table tfoot td.nil { display: none; }
  .rep-table tfoot td::before { content: attr(data-l); font-weight: 400; color: var(--muted); }
  .rep-head { flex-direction: column; }
  .rep-head > div:last-child { text-align: left !important; }
}
th.sel-col, td.sel-col { width: 30px; text-align: center; padding-left: 6px; padding-right: 2px; }
td.sel-col input, th.sel-col input { width: 16px; height: 16px; min-height: 0; }
.del-list { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 13px; display: grid; gap: 4px; }

/* ---------- Bills: print / edit / more icons and pop-up menu ---------- */
td.doc-acts { width: 1%; white-space: nowrap; }
.act-icons { display: inline-flex; gap: 6px; }
.icon-btn { width: 34px; height: 32px; min-height: 0; padding: 0; display: inline-flex; align-items: center; justify-content: center; position: relative; border-radius: 7px; }
.icon-btn .ico { width: 18px; height: 18px; color: var(--text); }
.icon-btn:hover .ico { color: var(--accent); }
.icon-btn[disabled] { opacity: .35; cursor: default; }
.icon-btn .dot-due { position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: #d97706; }
.pop-menu { position: fixed; z-index: 60; min-width: 200px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 4px; display: flex; flex-direction: column; }
.pop-menu button { border: 0; background: none; text-align: left; justify-content: flex-start; padding: 8px 12px; min-height: 0; border-radius: 6px; font-size: 14px; color: var(--text); width: 100%; }
.pop-menu button:hover, .pop-menu button:focus { background: var(--accent-soft); color: var(--accent); outline: none; }
.pop-menu button.danger { color: var(--danger); }
.pop-menu button.danger:hover { background: #fde8e7; }
.pop-menu button.hl { font-weight: 600; color: var(--warn); }
.scheme-row { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.scheme-row input { width: 90px; }
input:disabled.disc, input:disabled.disc-amt, .inv-grid input:disabled { background: #f1f3f5; color: #9aa3ad; cursor: not-allowed; }
/* Bill print preview pop-up */
.print-pop { z-index: 2500; }
.print-pop-box { width: min(1000px, 96vw); height: 92vh; background: #e9edf2; border-radius: 10px; overflow: hidden; box-shadow: 0 18px 50px rgba(0,0,0,.35); }
.print-pop-box iframe { width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 760px) { .print-pop-box { width: 100vw; height: 100vh; border-radius: 0; } }
/* Bill: Dispatch From / Ship To addresses */
.inv-addr { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inv-addr .panel { margin: 0; }
.inv-addr select { margin-bottom: 6px; }
.inv-addr textarea { width: 100%; }
@media (max-width: 760px) { .inv-addr { grid-template-columns: 1fr; } }
.da-list { display: grid; gap: 8px; margin-bottom: 8px; }
.da-row { display: grid; grid-template-columns: 220px 1fr auto; gap: 8px; align-items: start; }
.da-row .da-del { font-size: 20px; padding: 0 6px; }
@media (max-width: 760px) { .da-row { grid-template-columns: 1fr auto; } .da-row .da-addr { grid-column: 1 / -1; } }
/* Booking / Parcel charges: one compact line */
.chg-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.chg-line .chg-ttl { font-weight: 600; font-size: 13px; }
.chg-line select { width: auto; min-width: 92px; padding: 3px 6px; min-height: 30px; }
.chg-line label { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: 12px; color: var(--muted); white-space: nowrap; }
.chg-line input { width: 100px; min-height: 30px; padding: 3px 6px; text-align: right; }
.chg-line input.chg-pk { width: 64px; }
.chg-line input::placeholder { color: #8a94a3; text-align: left; }   /* the heading sits inside the box until a value is typed */
.chg-line .chg-amt { font-weight: 700; white-space: nowrap; }
.bt-tbl { border-collapse: collapse; margin-bottom: 4px; width: auto !important; }
.bt-tbl th { font-size: 11px; color: var(--muted); text-align: left; padding: 2px 6px; }
.bt-tbl td { padding: 2px 6px; border: none; }
.bt-tbl input { width: 130px; }
/* customer search: "+ Add new customer" row under the results */
.ta-item.ta-addrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); background: #fafbfc; cursor: default; }
/* Customer form (one form) */
.cf .cf-sec { font-weight: 600; margin: 14px 0 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.cf .ca-list { display: grid; gap: 6px; margin-bottom: 6px; }
.cf .ca-row { display: grid; grid-template-columns: 1.1fr .7fr 2fr 1fr 1.2fr .7fr auto; gap: 6px; align-items: center; }
.cf .ca-row .ca-del { font-size: 20px; padding: 0 6px; }
@media (max-width: 900px) { .cf .ca-row { grid-template-columns: 1fr 1fr; } .cf .ca-row .ca-street { grid-column: 1 / -1; } }
/* POS: ship to / dispatch from under the customer */
.addr-pick { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; }
.addr-pick label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; color: var(--muted); }
.addr-pick select { width: auto; min-width: 180px; max-width: 320px; padding: 3px 6px; min-height: 30px; }
#stPick { margin-bottom: 6px; }
/* Data Check */
.dc-row { margin-bottom: 8px; }
.dc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dc-mark { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; }
.dc-mark.ok { background: #1e7d4f; } .dc-mark.bad { background: #b42318; }
.dc-row .table-wrap { margin-top: 8px; }
.notice.dc-allok { background: #e7f6ee; border-color: #a9dcbf; color: #1e7d4f; }

/* Share as PDF window */
.sh-box { border: 1px solid var(--line, #d9dde3); border-radius: 8px; padding: 10px 12px; margin-top: 10px; }
.sh-head { margin-bottom: 8px; }
.row-inline { display: flex; gap: 8px; align-items: center; }

/* ---------- Square / small monitors (and browser zoom): keep totals + print buttons on the RIGHT ----------
   Only phones (760px and below) put the totals under the bill. */
@media (min-width: 761px) and (max-width: 1250px) {
  .bill { grid-template-columns: minmax(0, 1fr) 260px; gap: 10px; }
  .bill .totals, .inv-foot .totals { position: sticky; top: 60px; }
  .bill .totals .actions, .inv-foot .totals .actions { grid-template-columns: 1fr; }
  .bill .totals .actions > div:first-child, .inv-foot .totals .actions > div:first-child { grid-column: auto; }
  .totals .actions button { padding-left: 8px; padding-right: 8px; }
  /* Biller layout: transport / notes stacked on the left, totals on the right */
  .inv-foot { grid-template-columns: minmax(0, 1fr) 270px; }
  .inv-foot > :not(.totals) { grid-column: 1; }
  .inv-foot .totals { grid-column: 2; grid-row: 1 / span 3; }
}
@media (min-width: 761px) and (max-width: 1000px) {
  main { padding: 10px; }
  .bill { grid-template-columns: minmax(0, 1fr) 230px; }
  .inv-foot { grid-template-columns: minmax(0, 1fr) 240px; }
  .totals { padding: 10px; }
  .totals table td { font-size: 13px; }
}
/* Biller layout header keeps its 3 columns on square monitors (1280 x 1024, or 1366 with zoom) */
@media (min-width: 1100px) and (max-width: 1250px) {
  .inv-head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, .9fr); }
  .inv-head .inv-meta { grid-column: auto; }
  .inv-head .inv-meta table.kv-form { display: table; }
  .inv-head .inv-meta table.kv-form tbody { display: table-row-group; }
  .inv-head .inv-meta table.kv-form tr { display: table-row; }
}

/* =====================================================================
   POS billing screen layouts (Settings > My Account > billing screen layout)
   classic | cashier | cards | keyboard. Wide and square monitors keep the
   totals and print buttons on the right; phones (760px and below) stack.
   ===================================================================== */
.bill[class*="pl-"] .panel + .panel { margin-top: 0; }
.pl-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pl-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pl-btns.pl-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pl-btns button { padding-left: 6px; padding-right: 6px; }
.pl-details summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.pl-details[open] summary { margin-bottom: 6px; }
.pl-bigtot { background: #16233d; color: #fff; border-radius: 10px; padding: 14px 16px; }
.pl-bt-l { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #c3cee0; font-weight: 600; }
.pl-bt-l .pl-count { text-transform: none; letter-spacing: 0; }
.pl-bt-v { font-size: 38px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.pl-bt-s { color: #c3cee0; font-size: 12.5px; }

/* 1. Classic: items left, totals + buttons right */
.bill.pl-classic { grid-template-columns: minmax(0, 1fr) 320px; }

/* 2. Cashier: big total, payment buttons, received / change */
.bill.pl-cashier { grid-template-columns: minmax(0, 1fr) 360px; }
.pl-side { display: flex; flex-direction: column; gap: 10px; align-self: start; min-width: 0; }
.pl-side .actions { display: grid; gap: 8px; }
.pl-cashier #itemSearch { min-height: 44px; font-size: 16px; }
.pl-cashier table.lines td { padding-top: 9px; padding-bottom: 9px; font-size: 14.5px; }
.pl-cashier #btnSavePrint { min-height: 56px; font-size: 17px; }
.pl-paybtns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pl-paybtns button { min-height: 42px; font-weight: 700; font-size: 14px; border-width: 1.5px; padding: 0 6px; }
.pl-paybtns button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.pl-change { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.pl-change strong { font-size: 20px; font-variant-numeric: tabular-nums; display: block; padding-bottom: 4px; }
.pl-more { display: flex; gap: 18px; flex-wrap: wrap; }
.pl-rate { padding: 8px 12px; }

/* 3. Cards on top: customer | bill details | total, items full width below */
.bill.pl-cards { display: flex; flex-direction: column; gap: 12px; }
.bill.pl-cards > * { width: 100%; box-sizing: border-box; min-width: 0; }
.pl-top { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 330px; gap: 12px; align-items: stretch; }
.pl-cards .totals.pl-totcard { position: static; display: flex; flex-direction: column; gap: 8px; }
.pl-cards .pl-bigtot { background: var(--accent-soft); color: var(--text, #1d2433); border: 1px solid #b8cbe3; }
.pl-cards .pl-bt-l, .pl-cards .pl-bt-s { color: var(--muted); }
.pl-cards .pl-bt-v { font-size: 32px; color: #16233d; }
.pl-cards .totals .actions { margin-top: auto; }
.pl-foot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* 4. Keyboard: more room for items, function-key bar at the bottom */
.bill.pl-keyboard { grid-template-columns: minmax(0, 1fr) 260px; gap: 10px; }
.pl-keyboard .panel { padding: 10px; }
.pl-keyboard .pl-col { gap: 10px; }
.pl-keyboard table.lines td { padding-top: 4px; padding-bottom: 4px; }
.pl-keyboard .totals .pl-fmt { margin-top: 10px; }
.bottom-bar.fk-bar { background: #16233d; border-top-color: #16233d; }
.fk-bar .muted { color: #c3cee0 !important; }
.fk-bar button { background: #22365a; color: #fff; border-color: #33496e; }
.fk-bar button.primary { background: #2f6db0; border-color: #2f6db0; }
.fk-bar kbd { background: #fff; color: #16233d; border-color: #fff; }
.fk-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* wide monitor */
@media (min-width: 1251px) {
  .bill[class*="pl-"] .totals .actions { grid-template-columns: 1fr; }
}
/* square monitors / browser zoom: same layouts, narrower right column */
@media (min-width: 761px) and (max-width: 1250px) {
  .bill[class*="pl-"] .totals { position: sticky; top: 60px; }
  .bill[class*="pl-"] .totals .actions { grid-template-columns: 1fr; }
  .bill[class*="pl-"] .totals .actions > div:first-child { grid-column: auto; }
  .bill.pl-classic { grid-template-columns: minmax(0, 1fr) 280px; }
  .bill.pl-cashier { grid-template-columns: minmax(0, 1fr) 310px; }
  .bill.pl-keyboard { grid-template-columns: minmax(0, 1fr) 240px; }
  .pl-top { grid-template-columns: minmax(0, 1fr) 300px; }
  .pl-top .pl-cust { grid-column: 1; grid-row: 1; }
  .pl-top .pl-billcard { grid-column: 1; grid-row: 2; }
  .pl-top .pl-totcard { grid-column: 2; grid-row: 1 / span 2; }
  .pl-bt-v { font-size: 32px; }
}
@media (min-width: 761px) and (max-width: 1000px) {
  .bill.pl-classic { grid-template-columns: minmax(0, 1fr) 250px; }
  .bill.pl-cashier { grid-template-columns: minmax(0, 1fr) 270px; }
  .bill.pl-keyboard { grid-template-columns: minmax(0, 1fr) 220px; }
  .pl-top { grid-template-columns: minmax(0, 1fr) 260px; }
  .pl-paybtns { grid-template-columns: 1fr 1fr; }
  .pl-btns.pl-3 { grid-template-columns: 1fr 1fr; }
}
/* phones: one column (the phone bar at the bottom has Save / Save & Print) */
@media (max-width: 760px) {
  .bill[class*="pl-"] { grid-template-columns: 1fr; }
  .pl-top { grid-template-columns: 1fr; }
  .pl-side { position: static; }
  .bill[class*="pl-"] .totals { position: static; }
}

/* Settings: billing screen layout picker (small pictures) */
.lay-prev { display: grid; height: 70px; gap: 3px; padding: 4px; background: #f2f4f8; border: 1px solid #d9dde3; border-radius: 6px; margin-bottom: 6px; box-sizing: border-box; }
.lay-prev i { background: #fff; border: 1px solid #d5dbe5; border-radius: 2px; }
.lay-prev i.d { background: var(--accent-soft); border-color: #9fbbe0; }
.lay-classic { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr 2fr; }
.lay-classic .a { grid-area: 1 / 1; } .lay-classic .b { grid-area: 2 / 1; } .lay-classic .c { grid-area: 3 / 1; } .lay-classic .d { grid-area: 1 / 2 / 4 / 3; }
.lay-cashier { grid-template-columns: 1.6fr 1fr; grid-template-rows: 1fr 1fr 2fr; }
.lay-cashier .a { grid-area: 1 / 1; } .lay-cashier .c { grid-area: 2 / 1 / 4 / 2; } .lay-cashier .b { grid-area: 1 / 2; } .lay-cashier .d { grid-area: 2 / 2 / 4 / 3; }
.lay-prev.lay-cashier i.d { background: #16233d; border-color: #16233d; }
.lay-pick .theme-opt span { white-space: normal; overflow: visible; text-overflow: clip; display: block; }
.lay-cards { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 2fr; }
.lay-cards .a { grid-area: 1 / 1; } .lay-cards .b { grid-area: 1 / 2; } .lay-cards .d { grid-area: 1 / 3; } .lay-cards .c { grid-area: 2 / 1 / 3 / 4; }
.lay-keyboard { grid-template-columns: 3fr 1fr; grid-template-rows: 1fr 3fr 9px; }
.lay-keyboard .a { grid-area: 1 / 1; } .lay-keyboard .c { grid-area: 2 / 1; } .lay-keyboard .d { grid-area: 1 / 2 / 3 / 3; } .lay-keyboard .b { grid-area: 3 / 1 / 4 / 3; background: #16233d; border-color: #16233d; }

/* narrower number boxes in the item list when the screen is not wide (square monitors) */
@media (min-width: 761px) and (max-width: 1400px) {
  .bill[class*="pl-"] .lines input.qty, .bill[class*="pl-"] .lines input.disc { width: 50px; }
  .bill[class*="pl-"] .lines input.free { width: 44px; }
  .bill[class*="pl-"] .lines input.rate, .bill[class*="pl-"] .lines input.disc-amt { width: 72px; }
  .bill[class*="pl-"] .lines td.item-name { min-width: 120px; }
}

/* 2. Checkout bar (as the sample): one top bar, one items box that fills the screen, one checkout line at the bottom */
.bill.pl-checkout { display: flex; flex-direction: column; gap: 10px; min-height: calc(100vh - 121px); }   /* top bar 52 + page top space 16 + bottom bar 53: the checkout line ends right on the bottom bar */
.bill.pl-checkout > * { width: 100%; box-sizing: border-box; min-width: 0; }
.pl-cohead { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; padding: 10px 12px; }
.pl-cohead h2 { margin: 0; font-size: 16px; }
.pl-coh-type .bill-type { margin: 0; }
.pl-coh-no .pos-no { margin: 0; display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.pl-coh-no .pos-no input { width: 150px; }
.pl-coh-cust { flex: 1 1 320px; min-width: 0; }
.pl-coh-cust > label { font-size: 12px; color: var(--muted); }
.pl-coh-rate { width: 120px; }
.pl-items { flex: 1; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.pl-items > .panel { border: 0; border-radius: 0; border-bottom: 1px solid var(--line); background: #fbfcfd; }
.pl-items > .table-wrap { flex: 1; border: 0; border-radius: 0; margin: 0; }
.pl-itemfoot { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 8px 12px; border-top: 1px solid var(--line); }
.pl-itemfoot .chg-box { border: 0; padding: 0; background: none; margin: 0; }
.pl-itemfoot .pl-notes { flex: 1 1 140px; min-width: 120px; max-width: 360px; }
.pl-itemfoot .pl-notes label { display: none; }   /* "Notes" shown inside the box */
@media (min-width: 901px) { .pl-itemfoot { flex-wrap: nowrap; } }
.pl-itemfoot .pl-notes > div { display: flex; align-items: center; gap: 8px; }
.pl-itemfoot .pl-notes label { margin: 0; white-space: nowrap; }
.pl-cobar { position: sticky; bottom: var(--bbh, 53px); margin-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-color: #9fbbe0; box-shadow: 0 -4px 14px rgba(20, 40, 70, .08); }
.pl-chips { display: flex; }
.pl-chips > div { display: flex; flex-direction: column; padding: 0 12px; border-right: 1px solid var(--line); }
.pl-chips > div:first-child { padding-left: 0; }
.pl-chips > div:last-child { border-right: 0; }
.pl-chips span, .pl-cototal span { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.pl-chips b { font-size: 15px; font-variant-numeric: tabular-nums; }
.pl-cobar .seg.pl-paybtns-seg { display: flex; }
.pl-paybtns-seg button { padding: 0 12px; white-space: nowrap; }
.pl-paybtns-seg button.on { background: var(--accent-soft); color: var(--accent); }
.pl-grow { flex: 1; }
.pl-cototal { display: flex; flex-direction: column; align-items: flex-end; }
.pl-cototal .pl-bt-v { font-size: 26px; line-height: 1.1; color: #16233d; white-space: nowrap; }
.pl-cobar .pl-fmt label { display: none; }
.pl-cobar .pl-fmt .seg { min-width: 0; }
.pl-cobar .pl-fmt .seg button { padding: 0 10px; white-space: nowrap; }
.pl-cobar #btnSavePrint { min-height: 46px; font-size: 16px; padding: 0 20px; }
.pl-coacts { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.pl-cobar button:not(#btnSavePrint) kbd { display: none; }
.pl-chips > div { padding: 0 10px; }
@media (max-width: 1500px) { .pl-paybtns-seg button { padding: 0 9px; } .pl-cototal .pl-bt-v { font-size: 22px; } }
.pl-moremenu { position: relative; }
.pl-moremenu summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--panel); font-weight: 600; }
.pl-moremenu summary::-webkit-details-marker { display: none; }
.pl-menu { position: absolute; right: 0; bottom: calc(100% + 6px); display: flex; flex-direction: column; gap: 6px; padding: 8px; min-width: 200px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15); z-index: 20; }
/* the checkout line sits right on top of the bottom bar (no gap) */
@media (min-width: 761px) { main:has(.bill.pl-checkout) { padding-bottom: var(--bbh, 53px); } }
@media (max-width: 760px) { .pl-cobar { position: static; } .pl-chips { flex-wrap: wrap; row-gap: 6px; } .bill.pl-checkout { min-height: 0; } }
.lay-checkout { grid-template-columns: 1fr; grid-template-rows: 1fr 3fr 1fr; }
.lay-checkout .a { grid-area: 1 / 1; } .lay-checkout .c { grid-area: 2 / 1; } .lay-checkout .b { display: none; } .lay-checkout .d { grid-area: 3 / 1; }

/* ---------- Tablets held upright (761 - 900px): one column, totals and buttons under the items ---------- */
@media (min-width: 761px) and (max-width: 900px) {
  .bill[class*="pl-"] { grid-template-columns: 1fr !important; }
  .bill[class*="pl-"] .totals, .pl-side { position: static !important; }
  .bill[class*="pl-"] .totals .actions, .pl-side .actions { grid-template-columns: 1fr !important; }
  .bill[class*="pl-"] .pl-btns { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pl-top { grid-template-columns: 1fr 1fr !important; }
  .pl-top .pl-totcard { grid-column: 1 / -1 !important; grid-row: auto !important; }
  .pl-top .pl-cust, .pl-top .pl-billcard { grid-row: auto !important; grid-column: auto !important; }
}
/* phones: the total at the bottom never gets cut; keyboard layout uses the phone buttons */
@media (max-width: 760px) {
  .mb-total { flex-shrink: 0; }
  .bottom-bar button { padding: 6px 10px; }
  .fk-acts { display: none; }
}
@media (max-width: 400px) {
  .mb-total strong { font-size: 15px; }
  .bottom-bar { gap: 6px; }
}

/* E-way bill window */
.ewb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ewb-grid fieldset, .modal fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 12px; margin: 0 0 10px; min-width: 0; }
.modal legend { font-weight: 600; font-size: 13px; padding: 0 4px; }
.ewb-addr { min-height: 18px; margin-bottom: 6px; white-space: pre-line; }
.ewb-done { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; padding: 12px; border: 1px solid #b8cbe3; background: var(--accent-soft); border-radius: 8px; margin-bottom: 10px; }
.ewb-done .lbl { display: block; font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.ewb-done strong { font-size: 17px; }
.ewb-badge { background: #e8f4ec; color: #1e7d4f; border-color: #a9d5b8; }
@media (max-width: 760px) { .ewb-grid { grid-template-columns: 1fr; } }

/* customer form: salutation list in front of the name */
.sal-name { display: flex; gap: 6px; }
.sal-name select { width: 78px; flex: none; }
.sal-name input { flex: 1; min-width: 0; }

/* ---------- Billing screens (POS layouts + Biller): outlines 1px thicker, item rows in heavier text (v1.49.1) ---------- */
:is(main:has(.bill), main:has(.inv)) :is(input, select, textarea, button:not(.link), .btn, .panel, .table-wrap, .bill-type, .seg, .cust-chip, .chg-box, .pl-moremenu summary) { border-width: 2px; }
:is(main:has(.bill), main:has(.inv)) :is(th, td) { border-bottom-width: 2px; }
:is(main:has(.bill), main:has(.inv)) .inv-grid td { border-right-width: 2px; }
:is(main:has(.bill), main:has(.inv)) .bill-type a, .pl-chips > div { border-right-width: 2px; }
:is(main:has(.bill), main:has(.inv)) .pl-itemfoot { border-top-width: 2px; }
main:has(.bill) .bottom-bar, main:has(.inv) .bottom-bar { border-top-width: 2px; }
/* items added: text one step heavier */
.bill table.lines tbody td, .bill table.lines tbody td input, .bill table.lines tbody td a { font-weight: 600; }
.inv table.inv-grid tbody td, .inv table.inv-grid tbody td input { font-weight: 600; }

/* Utilities > Export Selected Items */
.ie-filters { flex-wrap: wrap; }
.ie-filters .f { min-width: 140px; }
.ie-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.ie-count { margin-left: 6px; }
.ie-cols { position: relative; }
.ie-cols summary { list-style: none; cursor: pointer; }
.ie-cols summary::-webkit-details-marker { display: none; }
.ie-colbox { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15);
  padding: 10px; width: 260px; max-height: 420px; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
#ieBody tr { cursor: pointer; }
#ieBody tr.ie-on td { background: var(--accent-soft); }

/* Settings > Company: seal / signature image */
.seal-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.seal-prev { width: 120px; height: 120px; border: 1px dashed var(--line-strong); border-radius: 8px; display: flex; align-items: center; justify-content: center; background: #fff; }
.seal-prev img { max-width: 110px; max-height: 110px; }

/* ---------- Settings > Print ---------- */
.ps-wrap { display: grid; grid-template-columns: minmax(380px, 1fr) minmax(0, 1.25fr); gap: 14px; align-items: start; }
.ps-opts { max-height: calc(100vh - 140px); overflow: auto; }
.ps-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 10px; }
.ps-tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; font-weight: 700; color: var(--muted); margin-bottom: -2px; }
.ps-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.ps-h { font-weight: 700; margin: 14px 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.ps-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.ps-save { position: sticky; bottom: -12px; background: var(--panel); padding: 10px 0 2px; margin-top: 12px; display: flex; gap: 8px; border-top: 1px solid var(--line); }
.ps-prev { position: sticky; top: 64px; }
.ps-prev-h { margin-bottom: 4px; }
.ps-frame-box { overflow: hidden; background: #e9ecef; border: 1px solid var(--line); border-radius: 8px; }
.ps-frame-box iframe { width: 840px; height: 1200px; border: 0; transform-origin: 0 0; display: block; }
.pf-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.pf-opt { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 6px; text-align: center; white-space: normal; min-height: 0; }
.pf-opt.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.pf-opt b { font-size: 12.5px; } .pf-opt span { line-height: 1.2; font-size: 11px; }
.pf-colors { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.pf-sw { width: 26px; height: 26px; min-height: 0; padding: 0; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); }
.pf-sw.on { box-shadow: 0 0 0 2px var(--text); }
.pf-custom input { width: 34px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; }
/* format thumbnails: header, two cards, table head, rows, footer */
.pf-th { width: 70px; height: 92px; background: #fff; border: 1px solid #cfd5dd; position: relative; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: min-content; gap: 3px; padding: 5px; box-sizing: border-box; }
.pf-th i { display: block; grid-column: 1 / -1; height: 4px; background: #d5dae1; }
.pf-th .h { height: 10px; } .pf-th .c { grid-column: auto; height: 12px; } .pf-th .t { height: 5px; } .pf-th .f { margin-top: 6px; height: 9px; }
.pf-boxed { border: 1px solid #555; } .pf-boxed i { background: none; border: 1px solid #777; }
.pf-classic .h { background: none; border-bottom: 2px solid #1f4e79; } .pf-classic .c { background: none; border: 1px solid #777; } .pf-classic .t { background: #1f4e79; }
.pf-modern .h { background: #1f4e79; height: 14px; margin: -5px -5px 0; } .pf-modern .c { background: #dbe6f1; border-radius: 2px; } .pf-modern .t { background: none; border-bottom: 2px solid #1f4e79; } .pf-modern .f { border-top: 2px solid #1f4e79; background: none; }
.pf-simple i { background: none; border-bottom: 1px solid #999; } .pf-simple .h { width: 60%; margin: 0 auto; border-bottom: 2px solid #333; }
.pf-elegant { border-left: 6px solid #1f4e79; } .pf-elegant .c { background: none; border-top: 2px solid #1f4e79; } .pf-elegant .t { background: none; border-top: 1px solid #1f4e79; border-bottom: 1px solid #1f4e79; }
@media (max-width: 1100px) { .ps-wrap { grid-template-columns: 1fr; } .ps-prev { position: static; } .ps-opts { max-height: none; } }
.pf-standard, .pf-detailed, .pf-corporate { border: 1px solid #555; }
.pf-standard .h, .pf-detailed .h { height: 5px; background: none; border-bottom: 1px solid #555; width: 50%; margin: 0 auto; }
.pf-standard .c, .pf-detailed .c { background: none; border: 1px solid #777; }
.pf-standard .r:nth-of-type(5) { width: 55%; margin-left: auto; }
.pf-detailed .t { background: #c9d3de; } .pf-detailed .f { background: none; border: 1px solid #777; }
.pf-corporate { border: 0; } .pf-corporate .h { background: #fff; border-bottom: 2px solid #1f4e79; height: 12px; } .pf-corporate .c { background: none; border: 1px solid #777; } .pf-corporate .t { background: #555; }

/* ---------- Payment-In / Payment-Out ---------- */
.pay3 { display: grid; grid-template-columns: 1.1fr 1fr 1.2fr; gap: 14px 18px; }
.pay3 > div { display: flex; flex-direction: column; gap: 8px; }
.pay-c3 { border-left: 1px solid var(--line); padding-left: 16px; }
.pf-party { padding: 6px 0; }
.pf-kv { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 8px; }
.pf-kv > span:first-child { color: var(--muted); font-size: 13px; }
.pf-total b { font-size: 20px; color: var(--accent); text-align: right; }
.pf-adv { background: var(--accent-soft); border-radius: 6px; padding: 8px 10px; font-size: 13px; }
.pf-adv.none { background: #fdf2f2; }
.pf-photo { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pf-photo img { max-height: 56px; border-radius: 4px; border: 1px solid var(--line); vertical-align: middle; }
.rp-bills { display: flex; flex-direction: column; gap: 4px; max-height: 170px; overflow: auto; }
.pay-cards { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.pay-card { background: #f7f2fb; border: 1px solid #e6d9f2; border-radius: 8px; padding: 10px 14px; min-width: 240px; }
.pay-card.adv { background: #eef5fd; border-color: #cfe0f5; }
.pay-card .lb { font-size: 12px; color: var(--muted); }
.pay-card .big { font-size: 22px; font-weight: 700; margin: 2px 0; }
.adv-text { color: #1d5fa8; }
@media (max-width: 900px) { .pay3 { grid-template-columns: 1fr; } .pay-c3 { border-left: 0; padding-left: 0; } }

/* ---------- Purchase Entry (read supplier bill, preview, add to stock) ---------- */
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.pu-wrap { display: grid; grid-template-columns: minmax(240px, 0.55fr) minmax(0, 1.9fr); gap: 12px; margin-top: 12px; align-items: start; }
.pu-wrap.nodoc { grid-template-columns: 1fr; }
.pu-doc { position: sticky; top: 64px; max-height: calc(100vh - 80px); display: flex; flex-direction: column; }
.pu-pages { overflow: auto; flex: 1; width: 100%; }
.pu-doc .pu-pages { max-height: calc(100vh - 140px); }
.pu-pages img { width: 100%; display: block; border: 1px solid var(--line); margin-bottom: 8px; background: #fff; }
.pu-table td { vertical-align: top; }
.pu-table input.pu-n { width: 58px; text-align: right; padding: 4px 5px; } .pu-table input.pu-n.w { width: 80px; } .pu-table input.pu-n.s { width: 48px; }
.pu-table td, .pu-table th { padding-left: 4px; padding-right: 4px; }
.pu-item { min-width: 220px; }
.pu-bt { font-size: 11px; color: var(--muted); font-family: Consolas, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px; margin-bottom: 3px; }
.pu-pick input { width: 100%; }
.pu-st { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 3px; }
.pu-st select { font-size: 12px; padding: 2px 4px; min-height: 0; height: 24px; max-width: 220px; }
.pu-chip { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 10px; }
.pu-chip.ok { background: #e3f5ea; color: #16723a; } .pu-chip.warn { background: #fff3d6; color: #8a5a00; } .pu-chip.bad { background: #fde4e1; color: #b42318; } .pu-chip.info { background: #e3ecf7; color: #1f4e79; }
tr.pu-missing td { background: #fff8f7; }
.pu-pp { min-width: 120px; }
.pu-totals { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; padding: 10px 12px; margin-top: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.pu-gt { font-size: 18px; font-weight: 700; }
.pu-raw pre { max-height: 260px; overflow: auto; background: #f7f8fa; padding: 8px; font-size: 11px; white-space: pre; }
.pu-save { margin-top: 12px; display: flex; justify-content: flex-end; }
.pu-save button { min-height: 44px; padding: 0 22px; font-size: 15px; }
.pu-tot { margin-top: 8px; }
.pu-pdf { width: 100%; height: 75vh; border: 0; }
@media (max-width: 1100px) { .pu-wrap { grid-template-columns: 1fr; } .pu-doc { position: static; max-height: none; } .pu-doc .pu-pages { max-height: 60vh; } }
/* Upload Quotation: sheet preview */
.qi-sheet table { border-collapse: collapse; font-size: 11px; background: #fff; }
.qi-sheet td { border: 1px solid #dde2ea; padding: 2px 5px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.bottom-bar .bb-left { margin-right: auto; }
/* Booking / parcel box: plain number boxes (no up / down arrows) */
.chg-line input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.chg-line input[type=number]::-webkit-outer-spin-button, .chg-line input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- Checkout layout: header on one line on all desktop screens; checkout bar on one line up to 1500 px (1024 x 768, 1280, 1366 ...) ---------- */
@media (min-width: 901px) {
  .pl-cohead { flex-wrap: nowrap; gap: 8px; padding: 6px 10px; align-items: flex-end; }
  .pl-cohead .bill-type a { padding: 5px 9px; font-size: 13px; }
  .pl-coh-no .pos-no { font-size: 11px; }
  .pl-coh-no .pos-no input { width: 126px; font-size: 12.5px; padding: 3px 5px; }
  .pl-coh-cust > label { font-size: 11px; }
  .pl-coh-rate { width: 84px; flex: none; }
  .pl-coh-rate label { font-size: 11px; }
  .pl-coh-rate select { padding: 3px 4px; min-height: 30px; font-size: 13px; }
  /* customer: name and phone in a slim box, Ship to / Dispatch from beside it */
  .pl-coh-cust #custBox { display: flex; gap: 8px; align-items: flex-end; min-width: 0; }
  .pl-coh-cust .cust-chip { flex: 1 1 auto; min-width: 0; padding: 2px 8px; gap: 6px; flex-wrap: nowrap; }
  .pl-coh-cust .cust-chip .grow { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; line-height: 1.25; }
  .pl-coh-cust .cust-chip .grow > div { overflow: hidden; text-overflow: ellipsis; }
  .pl-coh-cust .cust-chip .grow > div:nth-child(3) { display: none; }   /* address line: shown on the bill */
  .pl-coh-cust .cust-chip .small { font-size: 11px; }
  .pl-coh-cust .cust-chip button.sm { padding: 1px 6px; min-height: 22px; font-size: 11px; }
  .pl-coh-cust .addr-pick { flex: none; flex-wrap: nowrap; margin: 0; gap: 6px; }
  .pl-coh-cust .addr-pick label { flex-direction: column; align-items: flex-start; gap: 0; font-size: 11px; }
  .pl-coh-cust .addr-pick select { min-width: 0; width: 110px; font-size: 12px; min-height: 28px; padding: 2px 4px; }
  .pl-coh-cust .cust-search input, .pl-coh-cust #custSearch { min-height: 32px; }
}
@media (min-width: 901px) and (max-width: 1500px) {
  /* checkout bar */
  .pl-cobar { flex-wrap: wrap; gap: 6px; padding: 6px 8px; }   /* one line; only a very large (crore) total wraps instead of running off the screen */
  .pl-chips { display: grid; grid-template-columns: auto auto; gap: 1px 6px; flex: none; }
  .pl-chips > div, .pl-chips > div:first-child { flex-direction: row; align-items: baseline; gap: 4px; padding: 0; border-right: 0 !important; white-space: nowrap; }
  .pl-chips span { font-size: 9px; letter-spacing: 0; }
  .pl-chips b { font-size: 11.5px; }
  .pl-cobar .seg.pl-paybtns-seg { display: flex; flex: none; }
  .pl-paybtns-seg button { padding: 0 4px; font-size: 11.5px; min-height: 30px; white-space: nowrap; flex: none; }
  .pl-grow { display: none; }
  .pl-cototal { flex: 1 0 auto; text-align: right; white-space: nowrap; }
  .pl-cototal span { font-size: 9.5px; }
  .pl-cototal .pl-bt-v { font-size: 16px; }
  .pl-coacts { gap: 4px; flex: none; }
  .pl-cobar .pl-coacts button, .pl-cobar .pl-moremenu summary { padding: 0 6px; font-size: 12px; min-height: 32px; }
  .pl-cobar .pl-fmt .seg button { padding: 0 5px; }
  .pl-cobar #btnSavePrint { min-height: 38px; font-size: 13.5px; padding: 0 8px; white-space: nowrap; }
  .pl-cobar #btnSavePrint kbd { display: none; }
}
.pl-itemfoot .pl-notes input { flex: 1; min-width: 0; }

/* v1.57: items sold in parts / bundles */
.kit-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: #fafbfd; }
.part-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.part-row .p-name { flex: 1; max-width: 320px; }
.part-row .p-pct { width: 80px; }
.kit-tbl { margin: 6px 0; }
.kit-tbl .c-qty { width: 90px; }
.ta-host { position: relative; max-width: 420px; }
select.ln-part { width: auto; min-width: 0; padding: 1px 4px; height: auto; font-size: 12px; margin-top: 2px; }
.ln-incl { font-style: italic; }

/* v1.57.1: item form in sections, keyboard friendly */
.itf { display: flex; flex-direction: column; gap: 10px; }
.itf-sec { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px 12px; background: var(--panel); }
.itf-h { font-weight: 600; font-size: 13px; margin-bottom: 8px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.itf-id { margin-left: auto; font-weight: 400; font-size: 12px; color: var(--muted); }
.itf-id b { color: var(--text, #222); }
.itf-checks { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding-bottom: 6px; }
.itf-checks .check, .itf-tabs .check { margin: 0; white-space: nowrap; }
.itf-tabs { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 6px; }
.itf-sub { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.itf-sub .kit-tbl { width: 100%; }
.itf-sec.sn-box { background: var(--panel); }
.itf-sec.sn-box .itf-h { margin-bottom: 0; }
.itf textarea { resize: vertical; min-height: 40px; }
.itf input:focus, .itf select:focus, .itf textarea:focus { outline: 2px solid var(--accent, #1f4e79); outline-offset: 0; }
.itf-keys { text-align: right; }
.itf-keys kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 3px; padding: 0 4px; font-size: 11px; background: #fff; }
.itf-scheme { gap: 4px; }
.itf-scheme input { width: 0; flex: 1; min-width: 40px; }
/* item form: body scrolls, Save always in view */
.modal-bg:has(.itf) { padding-top: 16px; padding-bottom: 16px; }
.modal:has(.itf) { max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal:has(.itf) .modal-body { overflow: auto; flex: 1; min-height: 0; padding: 12px 16px; }
@media (max-width: 900px) { .modal:has(.itf) { max-height: none; } .modal:has(.itf) .modal-foot::before { display: none; } }
.modal:has(.itf) .modal-foot::before { content: "Enter: next box  ·  Shift+Enter: back  ·  Ctrl+S: save  ·  Esc: close"; margin-right: auto; align-self: center; font-size: 12px; color: var(--muted); }
.open-tag { color: #8a5a00; }

/* v1.59: Biller - more room for items */
.inv-addr { gap: 8px; }
.inv-addr .panel { padding: 7px 9px; }
.inv-addr .panel-title { margin-bottom: 4px; font-size: 12.5px; }
.inv-addr select, .inv-addr textarea { font-size: 12.5px; }
.inv-addr select { min-height: 27px; height: 27px; padding: 2px 6px; margin-bottom: 4px; }
.inv-addr textarea { min-height: 44px; }
.inv:has(.inv-top) { gap: 8px; }
/* item grid: tighter rows, and a tall item area */
.inv:has(.inv-top) .inv-grid td input { min-height: 26px; padding: 2px 5px; font-size: 12.5px; }
.inv:has(.inv-top) .inv-grid tr.quick input { min-height: 28px; }
.inv:has(.inv-top) .inv-grid th { padding-top: 4px; padding-bottom: 4px; }
.inv:has(.inv-top) .inv-grid td { padding: 2px 3px; }
.inv:has(.inv-top) .inv-grid { font-size: 12.5px; }
@media (min-width: 900px) {
  .inv:has(.inv-top) .inv-gridwrap { min-height: max(240px, calc(100vh - 400px)); }
}
/* item grid fits the screen width (no sideways scroll at 1366) */
@media (min-width: 900px) {
  .inv:has(.inv-top) table.inv-grid { min-width: 0; table-layout: fixed; }
  .inv:has(.inv-top) .inv-grid th { font-size: 10.5px; letter-spacing: 0; padding-left: 3px; padding-right: 3px; }
  .inv:has(.inv-top) .inv-grid th.sub { font-size: 10px; padding: 2px 3px; }
  .inv:has(.inv-top) .inv-grid col.k-no { width: 26px; }
  .inv:has(.inv-top) .inv-grid col.k-hsn { width: 58px; }
  .inv:has(.inv-top) .inv-grid col.k-sn { width: 100px; }
  .inv:has(.inv-top) .inv-grid col.k-notes { width: 88px; }
  .inv:has(.inv-top) .inv-grid col.k-brand { width: 72px; }
  .inv:has(.inv-top) .inv-grid col.k-mrp { width: 66px; }
  .inv:has(.inv-top) .inv-grid col.k-qty { width: 48px; }
  .inv:has(.inv-top) .inv-grid col.k-free { width: 44px; }
  .inv:has(.inv-top) .inv-grid col.k-unit { width: 42px; }
  .inv:has(.inv-top) .inv-grid col.k-rate { width: 80px; }
  .inv:has(.inv-top) .inv-grid col.k-pct { width: 46px; }
  .inv:has(.inv-top) .inv-grid col.k-amt { width: 64px; }
  .inv:has(.inv-top) .inv-grid col.k-tpct { width: 38px; }
  .inv:has(.inv-top) .inv-grid col.k-tax { width: 66px; }
  .inv:has(.inv-top) .inv-grid col.k-total { width: 90px; }
  .inv:has(.inv-top) .inv-grid col.k-del { width: 26px; }
  .inv:has(.inv-top) .inv-grid .c-item .it-name { white-space: normal; }
  .inv:has(.inv-top) .sn-cell button { width: 22px; height: 22px; min-height: 0; }
}
@media (min-width: 900px) {
  .inv:has(.inv-top) .inv-grid .eq-ok { width: 22px; min-width: 0; height: 26px; min-height: 0; padding: 0; font-size: 13px; }
  .inv:has(.inv-top) .inv-grid td:last-child { padding-left: 1px; padding-right: 1px; }
}

/* v1.60: Biller top band - flat, outlined boxes with the label on the border (fits ~17% of the screen) */
.inv-headsel { display: inline-flex; gap: 10px; align-items: center; margin-left: 6px; }
.inv-headsel label { display: inline-flex; align-items: center; gap: 5px; margin: 0; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.inv-headsel select { width: auto; min-height: 28px; height: 28px; padding: 2px 6px; font-size: 12.5px; }
.inv-top { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr) minmax(0, .72fr); gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 12px 8px; }
.inv-top .fl { position: relative; min-width: 0; }
.inv-top .fl-l { position: absolute; top: -7px; left: 7px; padding: 0 4px; background: var(--panel); font-size: 10.5px; line-height: 13px; color: var(--muted); z-index: 1; pointer-events: none; white-space: nowrap; max-width: calc(100% - 14px); overflow: hidden; text-overflow: ellipsis; }
.inv-top .fl-l.req::after { content: " *"; color: var(--danger); }
.inv-top input, .inv-top select { min-height: 30px; height: 30px; padding: 4px 8px; font-size: 12.5px; }
.inv-top .fl input, .inv-top .fl-btn, .inv-top .fl-val { padding-top: 6px; }
.it-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.it-info { display: flex; gap: 8px; font-size: 10.5px; color: var(--danger); min-height: 14px; margin: 1px 0 6px 4px; white-space: nowrap; }
.it-info span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.it-info .link { margin-left: auto; font-size: 10.5px; padding: 0; flex: none; }
.inv-top .fl-val { display: flex; align-items: center; gap: 6px; height: 30px; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 4px 8px; font-size: 12.5px; background: #fff; white-space: nowrap; overflow: hidden; }
.inv-top .fl-val strong { overflow: hidden; text-overflow: ellipsis; }
.inv-top .fl-val .muted { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.inv-top .fl-val .badge { flex: none; }
.inv-top .fl-val .link { margin-left: auto; flex: none; }
.inv-top #custBox .cust-chip { padding: 3px 6px; gap: 6px; font-size: 11.5px; line-height: 1.25; min-height: 30px; }
.inv-top #custBox .cust-chip .small { font-size: 10.5px; }
.inv-top #custBox .cust-chip button { padding: 1px 6px; min-height: 0; font-size: 11px; }
.inv-top .fl-area .fl-text { height: 56px; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 8px 8px 3px; font-size: 11.5px; line-height: 1.35; color: #4a5562; white-space: pre-line; overflow: hidden; background: #fbfcfd; }
.inv-top .fl-acts { position: absolute; right: 4px; bottom: -16px; display: flex; gap: 10px; }
.inv-top .fl-acts .link { font-size: 10.5px; padding: 0; }
.inv-top .fl-acts .link.muted { color: var(--muted); }
.it-mid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px 8px; align-content: start; padding-top: 2px; }
.it-mid .sp2 { grid-column: span 2; }
.inv-top .fl-btn { width: 100%; height: 30px; min-height: 30px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; font-size: 12px; text-align: left; padding: 4px 8px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.inv-top .fl-btn:hover { border-color: var(--accent); }
.it-right { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 8px; align-items: center; align-content: start; }
.it-right > label { margin: 0; font-size: 11.5px; color: var(--muted); text-align: right; white-space: nowrap; }
.it-right input, .it-right select { height: 25px; min-height: 25px; padding: 1px 6px; border-color: transparent; border-bottom: 1px solid var(--line); border-radius: 0; background-color: transparent; font-size: 12.5px; }
.it-right input:hover, .it-right select:hover { border-bottom-color: var(--line-strong); }
.it-right input:focus, .it-right select:focus { border-color: var(--accent); border-radius: var(--radius); background: #fff; }
.it-right #docNo { font-weight: 600; }
@media (max-width: 1100px) {
  .inv-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .inv-top .it-right { grid-column: 1 / -1; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .inv-top { grid-template-columns: 1fr; }
  .it-mid { grid-template-columns: 1fr 1fr; }
  .it-mid .sp2 { grid-column: 1 / -1; }
  .inv-top .it-right { grid-template-columns: auto minmax(0, 1fr); }
  .inv-headsel { width: 100%; margin: 0; }
}

/* v1.60.1: Biller totals - short and compact; transport / notes boxes smaller */
.inv:has(.inv-top) .inv-foot { gap: 8px; }
.inv:has(.inv-top) .inv-foot .panel { padding: 8px 10px; }
.inv:has(.inv-top) .inv-foot .panel-title { margin-bottom: 4px; font-size: 12.5px; }
.inv:has(.inv-top) .inv-foot label { font-size: 10.5px; margin-bottom: 1px; }
.inv:has(.inv-top) .inv-foot input, .inv:has(.inv-top) .inv-foot select { min-height: 28px; height: 28px; padding: 2px 7px; font-size: 12.5px; }
.inv:has(.inv-top) .inv-foot .grid { gap: 5px 8px; }
.inv:has(.inv-top) .inv-foot textarea { font-size: 12.5px; min-height: 48px; }
.inv:has(.inv-top) .inv-foot .totals table td { padding: 0; font-size: 12px; line-height: 1.55; }
.inv:has(.inv-top) .inv-foot .totals .grand td { font-size: 16px; padding-top: 4px; line-height: 1.3; }
.inv:has(.inv-top) .inv-foot .totals tr:last-child td { font-size: 10.5px; padding-top: 1px; }
.inv:has(.inv-top) .inv-foot .totals .actions { grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 6px; }
.inv:has(.inv-top) .inv-foot .totals .actions > div:first-child { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.inv:has(.inv-top) .inv-foot .totals .actions > div:first-child label { margin: 0; white-space: nowrap; }
.inv:has(.inv-top) .inv-foot .totals .actions > div:first-child .seg { flex: 1; }
.inv:has(.inv-top) .inv-foot .totals .seg button { min-height: 26px; height: 26px; padding: 0 4px; font-size: 12px; }
.inv:has(.inv-top) .inv-foot .totals .actions button { min-height: 30px; height: 30px; padding: 0 6px; font-size: 12px; white-space: nowrap; }
.inv:has(.inv-top) .inv-foot .totals .actions button kbd { font-size: 9.5px; padding: 0 3px; }
.inv:has(.inv-top) .inv-foot .totals .actions #btnSavePrint { grid-column: 1 / -1; height: 34px; font-size: 13px; }
.inv:has(.inv-top) .inv-foot .totals .actions #btnClear { grid-column: 1 / -1; }
@media (min-width: 1251px) { .inv:has(.inv-top) .inv-foot { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr) 270px; } }

/* v1.61: Edit Party - billing / shipping addresses picked, added, edited on the bill */
.pa .fl { position: relative; min-width: 0; }
.pa .fl-l { position: absolute; top: -7px; left: 7px; padding: 0 4px; background: var(--panel); font-size: 10.5px; line-height: 13px; color: var(--muted); z-index: 1; pointer-events: none; white-space: nowrap; }
.pa input, .pa select { min-height: 32px; padding-top: 7px; font-size: 13px; }
.pa input[readonly], .pa select:disabled { background: #f4f6f8; color: #5b6673; }
.pa-top { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 12px; padding-top: 6px; }
.pa-print { margin: 8px 0 12px; }
.pa-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.pa-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pa-h { font-weight: 600; }
.pa-add { align-self: flex-start; padding: 0; font-weight: 500; }
.pa-card { position: relative; border: 1px solid var(--line-strong); border-radius: 6px; padding: 9px 30px 9px 11px; font-size: 12.5px; line-height: 1.4; cursor: pointer; background: #fff; min-height: 64px; }
.pa-card:hover { border-color: var(--accent); }
.pa-card.on { background: var(--accent-soft); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.pa-card:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.pa-tag { position: absolute; top: 7px; right: 30px; font-size: 10px; line-height: 15px; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 0 6px; background: #fff; }
.pa-card:has(.pa-tag) { padding-right: 70px; }
.pa-menu { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; min-height: 0; padding: 0; border: none; background: transparent; font-size: 16px; line-height: 1; cursor: pointer; color: var(--text); }
.pa-pop { position: absolute; top: 26px; right: 6px; z-index: 5; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.12); display: flex; flex-direction: column; padding: 4px; min-width: 90px; }
.pa-pop button { border: none; background: none; text-align: left; padding: 5px 10px; min-height: 0; font-size: 12.5px; cursor: pointer; }
.pa-pop button:hover { background: var(--accent-soft); }
.pa-form { display: flex; flex-direction: column; gap: 14px; border: 1px dashed var(--accent); border-radius: 6px; padding: 14px 10px 10px; background: #fbfdff; }
.pa-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pa-btns { display: flex; justify-content: flex-end; gap: 8px; }
.pa-note { margin-top: -2px; }
@media (max-width: 760px) { .pa-top, .pa-cols { grid-template-columns: 1fr; } }
.it-left { padding-bottom: 12px; }

/* v1.62: Dispatch from list in the head row; calendar button on every date box */
.inv-headsel #dfSel { max-width: 210px; }
