:root {
  --bg: #f2f5f9; --panel: #fff; --panel-2: #f7f9fc; --line: #dde4ed; --text: #182433; --muted: #66768a;
  --primary: #0b5cad; --primary-d: #084a8c; --primary-l: #e6f0fb;
  --ok: #0e8a5f; --ok-l: #e3f6ee; --warn: #b86e00; --warn-l: #fff3dc; --bad: #c2392b; --bad-l: #fdeceb;
  --nav: #10243b; --radius: 10px; --shadow: 0 1px 2px rgba(16, 36, 59, .08), 0 4px 14px rgba(16, 36, 59, .06);
  font-family: 'Segoe UI', Tahoma, 'Noto Sans Arabic', system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body, #app { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.4; overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h2, h3 { margin: 0; }
h2 { font-size: 22px; } h3 { font-size: 16px; margin-bottom: 10px; }
.muted { color: var(--muted); } .sm { font-size: 13px; } .b { font-weight: 700; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--ok); } .neg { color: var(--bad); }
.empty { padding: 22px; text-align: center; color: var(--muted); }
.msg { margin: 0; font-size: 16px; }

/* ---------- shell ---------- */
.shell { display: flex; flex-direction: column; height: 100%; }
.topbar { display: flex; align-items: center; gap: 14px; height: 58px; padding: 0 14px; background: var(--nav); color: #fff; flex: none; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; letter-spacing: .5px; }
.logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #0e8a5f, #0b5cad); color: #fff; font-weight: 800; font-size: 15px; }
.nav { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav-btn { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; color: #c9d6e6; font-weight: 600; font-size: 14px; white-space: nowrap; flex: none; }
.nav-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-btn.on { background: #fff; color: var(--nav); }
.nav-btn .ic { font-size: 16px; }
.badge { min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
.top-right { display: flex; align-items: center; gap: 8px; flex: none; }
@media (max-width: 1500px) { .user .uname { display: none; } .brand-name { display: none; } .nav-btn { padding: 8px 7px; } } /* narrower windows: the logo alone, so every menu icon stays in reach */
.brand-name { white-space: nowrap; }
.top-right .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .25); background: transparent; }
.user { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.avatar { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--primary-l); color: var(--primary); font-weight: 800; }
.avatar.sm { width: 28px; height: 28px; font-size: 13px; }
.shift-pill { padding: 6px 12px; border-radius: 20px; border: 0; font-weight: 700; font-size: 13px; }
.shift-pill.open { background: var(--ok-l); color: var(--ok); }
.shift-pill.closed { background: var(--bad-l); color: var(--bad); }
.xbrl-page .warn-card { border-color: #f0c98a; background: #fffaf0; }
.xbrl-list { margin: 6px 0 10px; padding-inline-start: 20px; display: grid; gap: 4px; }
.xbrl-tbl .sub-head th { background: var(--panel-2); text-align: start; font-size: 13px; color: var(--muted); }
.year-sel { width: auto; min-width: 200px; }
/* needed items: green = low, orange = mid, red = high */
.need-add { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: flex-end; }
.need-add .field { margin-bottom: 4px; } .need-add .grow { flex: 1; min-width: 240px; }
.prio-seg { display: inline-flex; gap: 6px; }
.prio-btn { min-height: 40px; padding: 8px 16px; border-radius: 20px; border: 2px solid var(--line); background: #fff; color: var(--muted); font-weight: 700; }
.prio-btn.low.on { background: #e3f6ee; border-color: #1fa971; color: #0b7a52; }
.prio-btn.mid.on { background: #fff0d9; border-color: #f08a00; color: #a85a00; }
.prio-btn.high.on { background: #fdeceb; border-color: #d63c2f; color: #b3261a; }
.need-list { display: grid; gap: 8px; }
.need-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-inline-start: 6px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.need-row.prio-low { border-inline-start-color: #1fa971; }
.need-row.prio-mid { border-inline-start-color: #f08a00; }
.need-row.prio-high { border-inline-start-color: #d63c2f; }
.need-row.done { opacity: .55; }
.need-row.done .need-name { text-decoration: line-through; }
.need-main { flex: 1; min-width: 0; }
.need-name { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.need-check { width: 24px; height: 24px; cursor: pointer; flex: none; }
.need-mark { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; color: var(--muted); font-weight: 800; }
.prio-pill { flex: none; min-width: 74px; text-align: center; padding: 3px 12px; border-radius: 14px; font-size: 13px; font-weight: 800; }
.prio-pill.low { background: #e3f6ee; color: #0b7a52; }
.prio-pill.mid { background: #fff0d9; color: #a85a00; }
.prio-pill.high { background: #fdeceb; color: #b3261a; }
.serial-area { width: 100%; font-family: Consolas, 'Courier New', monospace; resize: vertical; }
.serial-count { margin-top: 8px; font-weight: 700; color: var(--muted); }
.serial-list { max-height: 300px; overflow: auto; margin-top: 10px; display: grid; gap: 4px; }
.serial-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-align: start; cursor: pointer; font-family: Consolas, 'Courier New', monospace; }
.serial-row.on { background: var(--primary-l); border-color: var(--primary); }
.serial-row .serial-tick { font-size: 18px; line-height: 1; }
.serial-chips { color: var(--muted); font-size: 12px; direction: ltr; text-align: start; word-break: break-all; }
.sn-badge { display: inline-block; margin-inline-start: 6px; padding: 1px 6px; border-radius: 6px; background: var(--primary-l); color: var(--primary); font-size: 11px; font-weight: 800; }
.view { flex: 1; min-height: 0; overflow: auto; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 9px; border: 1px solid var(--line); background: #fff; font-weight: 600; min-height: 40px; }
.btn:hover:not(:disabled) { background: var(--panel-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--primary-d); }
.btn.danger { background: #fff; border-color: #efb8b2; color: var(--bad); }
.btn.danger:hover:not(:disabled) { background: var(--bad-l); }
.btn.sm { padding: 5px 11px; min-height: 32px; font-size: 13px; }
.btn.lg { padding: 13px 24px; min-height: 52px; font-size: 17px; }
.icon-btn { border: 0; background: transparent; width: 34px; height: 34px; border-radius: 8px; color: var(--muted); font-size: 15px; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn.danger:hover { background: var(--bad-l); color: var(--bad); }
.link { border: 0; background: none; padding: 0; color: var(--primary); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.input { width: 100%; padding: 9px 12px; min-height: 40px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.input:focus, .qty:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary); }
.input.money { font-variant-numeric: tabular-nums; text-align: end; direction: ltr; }
.input.lg { font-size: 22px; min-height: 52px; }
textarea.input { resize: vertical; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field .lbl { font-size: 13px; font-weight: 600; color: var(--muted); }
.field .hint, .hint { font-size: 12px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 12px; cursor: pointer; }
.check input { width: 18px; height: 18px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: #e7edf5; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 8px; font-weight: 600; color: var(--muted); }
.seg button.on { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.chip { flex: none; border: 1px solid var(--line); background: #fff; padding: 7px 15px; border-radius: 20px; font-weight: 600; }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 12px; background: #e9eef5; color: #435469; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.ok, .pill.st-completed, .pill.st-delivered { background: var(--ok-l); color: var(--ok); }
.pill.warn, .pill.st-new { background: var(--warn-l); color: var(--warn); }
.pill.st-out { background: var(--primary-l); color: var(--primary); }
.pill.st-cancelled, .pill.st-refunded { background: var(--bad-l); color: var(--bad); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row-gap { display: flex; align-items: center; gap: 8px; } .row-gap.wrap { flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; } .span2 { grid-column: span 2; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card-soft { background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
.card-soft.warn { background: var(--warn-l); border-color: #f0d49a; }
.center-card { max-width: 440px; margin: 48px auto; text-align: center; }
.center-card .field { text-align: start; }

/* ---------- pages / tables ---------- */
.page { padding: 18px 22px 28px; max-width: 1400px; margin: 0 auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .input { width: auto; min-width: 150px; } .toolbar input[type=search] { min-width: 260px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .grid2 > .card { margin-bottom: 0; } .grid2 { margin-bottom: 14px; }
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { position: sticky; top: 0; background: var(--panel-2); text-align: start; font-size: 12.5px; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tbl th.num { text-align: end; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid #edf1f6; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--primary-l); }
.tbl tr.dim td { opacity: .55; }
.tbl.compact td, .tbl.compact th { padding: 6px 8px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 12px 0 14px; }
.kpi { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; display: flex; flex-direction: column; gap: 3px; }
.kpi span { font-size: 12.5px; color: var(--muted); font-weight: 600; } .kpi b { font-size: 19px; font-variant-numeric: tabular-nums; }
.kpi.strong { background: var(--primary); border-color: var(--primary); } .kpi.strong span, .kpi.strong b { color: #fff; }
.kpi.pos b { color: var(--ok); } .kpi.warn { background: var(--warn-l); border-color: #f0d49a; }
.reports .kpis { margin-top: 0; } .reports .card { margin-bottom: 14px; } .reports .grid2 > .card { margin-bottom: 0; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 100px; align-items: center; gap: 10px; margin: 9px 0; }
.bar-t { height: 14px; background: #e9eef5; border-radius: 7px; overflow: hidden; } .bar-f { height: 100%; border-radius: 7px; background: var(--primary); }
.bar-f.m-cash { background: #0e8a5f; } .bar-f.m-knet { background: #0b5cad; } .bar-f.m-card { background: #7a4fc4; } .bar-f.m-link { background: #d08a00; } .bar-f.m-taly { background: #e5484d; } .bar-f.m-deema { background: #0e9aa7; } .bar-f.m-tabby { background: #2fa36b; }
.bar-v { text-align: end; font-variant-numeric: tabular-nums; }
.daybars { display: flex; align-items: stretch; gap: 8px; height: 210px; overflow-x: auto; padding-bottom: 4px; }
.daybar { display: flex; flex-direction: column; align-items: center; min-width: 54px; flex: 1; max-width: 90px; }
.daybar .v { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; } .daybar .d { font-size: 12px; color: var(--muted); direction: ltr; }
.daybar .ba { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.daybar .b { width: 64%; background: var(--primary); border-radius: 6px 6px 0 0; }

/* ---------- login ---------- */
.login { height: 100%; display: grid; place-items: center; background: radial-gradient(circle at 20% 10%, #16406a 0, var(--nav) 60%); }
.login-box { position: relative; width: min(420px, 94vw); background: #fff; border-radius: 18px; padding: 28px 28px 24px; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.login-box .lang { position: absolute; top: 14px; inset-inline-end: 16px; }
.brand-lg { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 26px; font-weight: 800; margin-bottom: 16px; }
.brand-lg .logo { width: 46px; height: 46px; font-size: 20px; }
.users { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 10px; }
.user-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.user-tile:hover { border-color: var(--primary); background: var(--primary-l); }
.who { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 14px; }
.dots { display: flex; justify-content: center; gap: 12px; height: 22px; } .dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #b5c2d3; } .dot.on { background: var(--primary); border-color: var(--primary); }
.err { min-height: 22px; color: var(--bad); font-weight: 600; margin: 6px 0; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; direction: ltr; }
.key { height: 62px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); font-size: 24px; font-weight: 600; }
.key:hover { background: var(--primary-l); } .key.ok { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- sale screen ---------- */
.sale { display: grid; grid-template-columns: minmax(0, 1fr) 430px; height: 100%; }
.pos-left { display: flex; flex-direction: column; min-width: 0; padding: 14px 16px 0; }
.pos-tools { margin-bottom: 10px; } .search { font-size: 17px; min-height: 48px; }
.grid { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-auto-rows: 106px; gap: 10px; padding: 2px 2px 16px; align-content: start; }
.pcard { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 2px; text-align: start; padding: 10px 12px; border: 1px solid var(--line); background: #fff; border-radius: 11px; box-shadow: var(--shadow); }
.pcard:hover { border-color: var(--primary); } .pcard:active { transform: scale(.98); }
.pcard.out { background: #f4f4f4; }
.pname { font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pprice { font-weight: 800; color: var(--primary); font-size: 16px; font-variant-numeric: tabular-nums; }
.pstock { font-size: 11.5px; color: var(--muted); } .pstock.warn { color: var(--warn); font-weight: 700; } .pstock.bad { color: var(--bad); font-weight: 700; }
.pos-right { display: flex; flex-direction: column; min-height: 0; background: #fff; border-inline-start: 1px solid var(--line); padding: 12px 14px 14px; gap: 8px; }
.cart-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cust { display: flex; flex-direction: column; gap: 8px; }
.results { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.result { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; text-align: start; padding: 9px 12px; border: 0; border-bottom: 1px solid #edf1f6; background: #fff; }
.result:hover { background: var(--primary-l); } .result:last-child { border-bottom: 0; }
.list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.fee-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 600; } .fee-row .input { width: 130px; }
.cart-lines { flex: 1; min-height: 80px; overflow: auto; border-block: 1px solid var(--line); }
.line { display: grid; grid-template-columns: 1fr auto 78px 32px; align-items: center; gap: 8px; padding: 8px 2px; border-bottom: 1px solid #edf1f6; }
.line-name { font-weight: 600; line-height: 1.25; }
.stepper { display: flex; align-items: center; gap: 3px; }
.step { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); font-size: 18px; line-height: 1; }
.qty { width: 50px; height: 32px; text-align: center; border: 1px solid var(--line); border-radius: 8px; font-variant-numeric: tabular-nums; }
.line-total { text-align: end; font-weight: 700; font-variant-numeric: tabular-nums; }
.cart-totals { display: flex; flex-direction: column; gap: 3px; }
.trow { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.trow.grand { font-size: 24px; font-weight: 800; padding-top: 6px; margin-top: 3px; border-top: 2px solid var(--text); }
.pay-btn { width: 100%; min-height: 60px; font-size: 20px; font-weight: 800; border-radius: 12px; border: 0; background: var(--ok); color: #fff; }
.pay-btn:hover:not(:disabled) { background: #0b7250; } .pay-btn:disabled { background: #b8c4d2; cursor: not-allowed; }

/* ---------- delivery board ---------- */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.col { background: #e9eef5; border-radius: var(--radius); padding: 10px; }
.col-head { display: flex; align-items: center; justify-content: space-between; font-weight: 800; padding: 2px 4px 10px; }
.count { background: #fff; border-radius: 12px; padding: 1px 10px; font-size: 13px; }
.col-body { display: flex; flex-direction: column; gap: 10px; }
.dcard { display: flex; flex-direction: column; gap: 6px; background: #fff; border-radius: 10px; padding: 12px; box-shadow: var(--shadow); border-inline-start: 4px solid var(--warn); }
.dcard.st-out { border-inline-start-color: var(--primary); } .dcard.st-delivered { border-inline-start-color: var(--ok); } .dcard.st-cancelled, .dcard.st-refunded { border-inline-start-color: var(--bad); }
.dcard .items { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ---------- modal / toast ---------- */
.backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(12, 24, 40, .5); }
.modal { width: min(600px, 100%); max-height: 92vh; display: flex; flex-direction: column; background: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.modal.wide { width: min(780px, 100%); } .modal.small { width: min(420px, 100%); } .modal.pay-modal { width: min(560px, 100%); }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-h h3 { margin: 0; font-size: 18px; }
.modal-b { padding: 18px; overflow: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--panel-2); border-radius: 0 0 14px 14px; flex-wrap: wrap; }
#toasts { position: fixed; z-index: 100; bottom: 22px; inset-inline: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { padding: 11px 18px; border-radius: 10px; background: #1f2d3f; color: #fff; font-weight: 600; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); max-width: 80vw; }
.toast.ok { background: var(--ok); } .toast.error { background: var(--bad); } .toast.warn { background: var(--warn); }

/* ---------- payment & success & detail ---------- */
.pay-due { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 16px; margin-bottom: 12px; background: var(--primary-l); border-radius: 11px; color: var(--primary-d); }
.pay-due b { font-size: 32px; font-variant-numeric: tabular-nums; }
.pay-row { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 8px; margin-bottom: 8px; }
.pay-row .ref { grid-column: 2 / span 2; min-height: 34px; font-size: 13px; }
.pay-name { display: flex; align-items: center; gap: 7px; font-weight: 700; }
.pay .chips { margin: -2px 0 10px; padding-inline-start: 124px; }
.pay-status { margin-top: 10px; padding: 10px 14px; background: var(--panel-2); border-radius: 10px; border: 1px solid var(--line); }
.pay-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 3px 0; font-variant-numeric: tabular-nums; }
.pay-line b { white-space: nowrap; }
.pay-line.big b { font-size: 24px; } .pay-err { color: var(--bad); font-weight: 600; margin-top: 4px; }
.success { text-align: center; }
.tick { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 8px; border-radius: 50%; background: var(--ok-l); color: var(--ok); font-size: 34px; font-weight: 800; }
.big-amt { font-size: 34px; font-weight: 800; margin: 6px 0; font-variant-numeric: tabular-nums; }
.change { font-size: 24px; color: var(--ok); }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; gap: 10px; } .tags { display: flex; gap: 6px; }
.detail .card-soft { margin-bottom: 12px; }
.totals { margin-top: 12px; margin-inline-start: auto; width: min(320px, 100%); }
.kv { display: flex; justify-content: space-between; padding: 3px 0; font-variant-numeric: tabular-nums; } .kv.grand { font-size: 20px; border-top: 2px solid var(--text); margin-top: 4px; padding-top: 6px; } .kv.warn { color: var(--warn); }

/* ---------- shops, labels, accounts, purchasing ---------- */
.store-ctl { display: flex; align-items: center; gap: 6px; color: #fff; }
.store-select { background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .3); border-radius: 9px; padding: 6px 8px; font-weight: 700; min-height: 34px; max-width: 170px; }
.store-select option { color: #182433; }
.store-chip { padding: 6px 12px; border-radius: 20px; background: rgba(255, 255, 255, .12); font-weight: 700; font-size: 13px; white-space: nowrap; }
.nav.many .nav-btn:not(.on) > span:not(.ic):not(.badge) { display: none; }
.nav.many .nav-btn { padding: 8px 11px; }
.result.on { background: var(--primary-l); }
.picker { position: relative; }
.picker .results { margin-top: 6px; max-height: 260px; overflow: auto; }
.qty.wide { width: 64px; }
.input.sm-in { width: 100px; min-height: 34px; padding: 5px 8px; }
.range { width: 100%; accent-color: var(--primary); }
.stock-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.table-wrap.flat { border: 0; box-shadow: none; }
.table-wrap.tall { max-height: 52vh; }
.labels-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 14px; align-items: start; }
.labels-grid .card { margin-bottom: 14px; }
.label-frame { width: 100%; height: 340px; border: 1px solid var(--line); border-radius: 9px; background: #dfe6ee; margin-top: 8px; }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-bottom: 4px; }
.acc-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.acc-card.dim { opacity: .6; }
.acc-bal { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; margin: 4px 0 6px; }
.modal.tall-modal .modal-b { max-height: 70vh; }
.purch-modal .modal-b { max-height: 70vh; }

/* ---------- financial liabilities ---------- */
.lb-page { max-width: 1500px; }
.lb-months { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 5px; box-shadow: var(--shadow); }
.lb-month { min-width: 150px; text-align: center; font-weight: 800; font-size: 17px; }
.lb-nav { width: 38px; height: 38px; border: 0; border-radius: 10px; background: var(--panel-2); font-size: 22px; line-height: 1; color: var(--text); }
.lb-nav:hover { background: var(--primary-l); color: var(--primary); }
.lb-summary { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.lb-kpi { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px 22px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.lb-kpi > span { color: var(--muted); font-weight: 600; font-size: 14px; }
.lb-kpi > b { font-size: 30px; font-weight: 800; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.lb-kpi.dark { background: linear-gradient(135deg, #0f2742, #1f4a7d); color: #fff; border: 0; }
.lb-kpi.dark > span { color: #b9cbe3; } .lb-kpi.dark small { color: #b9cbe3; }
.lb-kbar { height: 8px; border-radius: 6px; background: rgba(255, 255, 255, .18); overflow: hidden; margin-top: 4px; }
.lb-kbar i { display: block; height: 100%; background: #34d399; border-radius: 6px; }
.good { color: var(--ok); } .warnc { color: var(--warn); } .lb-kpi.dark .good { color: #6ee7b7; }
.lb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(460px, 1fr)); gap: 20px; align-items: start; }
.lb-card { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 24px; box-shadow: 0 6px 24px rgba(16, 36, 59, .07); }
.lb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.lb-branch { font-size: 21px; font-weight: 800; }
.lb-big { font-size: 44px; font-weight: 800; letter-spacing: -1.5px; line-height: 1.1; margin: 8px 0 14px; font-variant-numeric: tabular-nums; }
.lb-unit { font-size: 18px; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.lb-bar { height: 12px; border-radius: 8px; background: #eef2f7; overflow: hidden; display: flex; gap: 2px; margin: 6px 0; }
.lb-bar.prog { height: 10px; }
.lb-seg { height: 100%; min-width: 3px; border-radius: 3px; }
.lb-bar.prog .lb-seg { min-width: 0; }
.lb-progtxt { display: flex; justify-content: space-between; font-weight: 700; font-size: 14px; margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.lb-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.lb-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lb-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.lb-empty { text-align: center; padding: 26px 12px; margin-top: 10px; border: 2px dashed var(--line); border-radius: 16px; }
.lb-group { margin-top: 16px; }
.lb-gtitle { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--c); padding: 0 12px 6px; }
.lb-line { display: flex; align-items: center; gap: 14px; padding: 11px 12px; border-radius: 14px; cursor: pointer; transition: background .12s; }
.lb-line:hover { background: var(--panel-2); }
.lb-ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 21px; flex: none; background: color-mix(in srgb, var(--c) 14%, white); }
.lb-main { flex: 1; min-width: 0; }
.lb-name { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-sub { font-size: 13px; color: var(--muted); min-height: 18px; }
.lb-due.overdue { color: var(--bad); font-weight: 700; } .lb-due.soon, .lb-due.today { color: var(--warn); font-weight: 700; }
.lb-amt { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 84px; text-align: end; }
.lb-paid { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 96px; }
.lb-pill { display: inline-block; padding: 4px 10px; border-radius: 12px; font-size: 12.5px; font-weight: 800; }
.lb-pill.paid { background: var(--ok-l); color: var(--ok); }
.lb-line.paid .lb-name, .lb-line.paid .lb-amt { opacity: .6; }
.lb-line.overdue { background: #fff7f6; }
.lb-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.lb-foot > div { display: flex; flex-direction: column; gap: 3px; }
.lb-foot span { font-size: 13px; color: var(--muted); font-weight: 600; } .lb-foot b { font-size: 21px; font-variant-numeric: tabular-nums; }
.lb-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.lb-cat { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: #fff; font-weight: 600; text-align: start; }
.lb-cat span { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, white); }
.lb-cat.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 8%, white); }
.lb-lbl { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.lb-note { text-align: center; margin-top: 22px; }
@media (max-width: 1180px) { .lb-summary { grid-template-columns: 1fr; } .lb-grid { grid-template-columns: 1fr; } }

/* ---------- walk-in customer fields ---------- */
.walkin { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.walkin-title { font-weight: 700; font-size: 13px; color: var(--muted); }
.walkin .input { min-height: 38px; }
.walkin .input.bad { border-color: var(--bad); background: var(--bad-l); }
.walkin-note { min-height: 16px; color: var(--ok); }

/* ---------- phone flags, price edit, invoice preview ---------- */
.flag { display: inline-block; width: 24px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .18); vertical-align: middle; object-fit: cover; }
.flag.dim { opacity: .55; }
.flag-slot { display: inline-flex; align-items: center; justify-content: center; width: 30px; flex: none; }
.phone-field { display: flex; align-items: center; gap: 6px; direction: ltr; width: 100%; }
.phone-field .input { flex: 1; min-width: 0; }
.input.bad { border-color: var(--warn); background: var(--warn-l); }
.phone-view { display: inline-flex; align-items: center; gap: 6px; }
.price-btn { font-variant-numeric: tabular-nums; font-weight: 700; }
.price-btn.edited { color: var(--warn); }
.was { color: var(--muted); font-size: 12px; }
.center-text { text-align: center; }
.preview-modal { width: min(560px, 100%); }
.preview-modal .modal-b { background: #dfe6ee; max-height: 74vh; }
.preview-body { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.preview-body .seg { align-self: center; }
.invoice-paper { zoom: 1.35; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); margin: 4px 0; }
.invoice-frame { display: block; border: 0; background: #fff; min-height: 120px; }

/* ---------- payment links ---------- */
.msg { white-space: pre-line; }
.center { justify-content: center; }
.pill.st-pending, .pill.lk-pending { background: var(--warn-l); color: var(--warn); }
.pill.lk-paid { background: var(--ok-l); color: var(--ok); }
.pill.lk-failed, .pill.lk-cancelled { background: var(--bad-l); color: var(--bad); }
.pill.lk-expired { background: #ececec; color: #666; }
.badge.attn { background: #d97706; }
.kpi.bad { background: var(--bad-l); border-color: #efb8b2; } .kpi.bad b { color: var(--bad); }
.tbl tr.row-bad td { background: #fff4f2; }
.live { font-size: 13px; font-weight: 700; color: var(--muted); } .live.on { color: var(--ok); }
.tap-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.link-modal { width: min(460px, 100%); }
.link-body { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.link-amt { display: flex; flex-direction: column; } .link-amt b { font-size: 32px; font-variant-numeric: tabular-nums; }
.qr { width: 210px; height: 210px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; image-rendering: pixelated; }
.link-url { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--muted); direction: ltr; }
.link-status { min-height: 48px; width: 100%; }
.link-state { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; font-size: 18px; padding: 10px; border-radius: 10px; background: var(--warn-l); color: var(--warn); }
.link-state.ok { background: var(--ok-l); color: var(--ok); font-size: 22px; } .link-state.bad { background: var(--bad-l); color: var(--bad); }
.spinner { width: 16px; height: 16px; border: 3px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; display: inline-block; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
  .labels-grid { grid-template-columns: 1fr; }
  .sale { grid-template-columns: minmax(0, 1fr) 360px; }
  .board { grid-template-columns: 1fr; } .grid2 { grid-template-columns: 1fr; }
  .nav-btn span:not(.ic):not(.badge) { display: none; }
}

/* no connection to the server (online mode): the start page, and the cover shown while the program is open */
.offline-page { display: grid; place-items: center; min-height: 100vh; background: var(--bg, #f4f6f8); }
.offline-box { text-align: center; max-width: 440px; padding: 28px; }
.offline-box h1 { margin: 8px 0; font-size: 26px; }
.offline-ic { font-size: 54px; }
.net-cover { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: rgba(15, 26, 44, .82); }
.net-cover[hidden] { display: none; }
.net-cover .offline-box { background: var(--panel, #fff); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }