@font-face{font-family:'Tajawal';font-style:normal;font-weight:400;font-display:swap;src:url('../fonts/tajawal-400-arabic.woff2') format('woff2');unicode-range:U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;}
@font-face{font-family:'Tajawal';font-style:normal;font-weight:400;font-display:swap;src:url('../fonts/tajawal-400-latin.woff2') format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'Tajawal';font-style:normal;font-weight:500;font-display:swap;src:url('../fonts/tajawal-500-arabic.woff2') format('woff2');unicode-range:U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;}
@font-face{font-family:'Tajawal';font-style:normal;font-weight:500;font-display:swap;src:url('../fonts/tajawal-500-latin.woff2') format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'Tajawal';font-style:normal;font-weight:700;font-display:swap;src:url('../fonts/tajawal-700-arabic.woff2') format('woff2');unicode-range:U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;}
@font-face{font-family:'Tajawal';font-style:normal;font-weight:700;font-display:swap;src:url('../fonts/tajawal-700-latin.woff2') format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'Tajawal';font-style:normal;font-weight:800;font-display:swap;src:url('../fonts/tajawal-800-arabic.woff2') format('woff2');unicode-range:U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;}
@font-face{font-family:'Tajawal';font-style:normal;font-weight:800;font-display:swap;src:url('../fonts/tajawal-800-latin.woff2') format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
/* Adapta 360 ERP - Web Port (P0) - responsive RTL design system.
   Fixed rules from the original: Primary #0078D4, background #F3F3F3, full Arabic RTL. */
:root {
  --primary: #0078D4;
  --primary-hover: #106EBE;
  --primary-active: #005A9E;
  --bg: #F3F3F3;
  --surface: #FFFFFF;
  --surface-2: #F9F9F9;
  --text: #1B1B1B;
  --text-2: #605E5C;
  --border: #E1DFDD;
  --danger: #D13438;
  --success: #107C10;
  --warning: #CA5010;
  --radius: 10px;
  --shadow: 0 1.6px 3.6px rgba(0,0,0,.08), 0 .3px .9px rgba(0,0,0,.06);
  --shadow-lg: 0 6.4px 14.4px rgba(0,0,0,.13), 0 1.2px 3.6px rgba(0,0,0,.1);
  --topbar-h: 56px;
}
[data-theme="dark"] {
  --bg: #1B1A19;
  --surface: #292827;
  --surface-2: #323130;
  --text: #F3F2F1;
  --text-2: #C8C6C4;
  --border: #484644;
  --shadow: 0 1.6px 3.6px rgba(0,0,0,.35), 0 .3px .9px rgba(0,0,0,.3);
  --shadow-lg: 0 6.4px 14.4px rgba(0,0,0,.45), 0 1.2px 3.6px rgba(0,0,0,.35);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Tajawal", sans-serif;
  background: var(--bg); color: var(--text);
  overflow: hidden;
}
button { font-family: "Tajawal", sans-serif; cursor: pointer; }
input, select, textarea { font-family: "Tajawal", sans-serif; font-size: 15px; }

#app-shell {
  display: grid; height: 100vh; height: 100dvh;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-columns: 240px 1fr;
  grid-template-areas: "top top" "side main";
}

/* ===== Top bar ===== */
#topbar {
  grid-area: top; display: flex; align-items: center; gap: 12px;
  background: var(--primary); color: #fff; padding: 0 14px;
  box-shadow: var(--shadow); z-index: 30;
}
#nav-toggle { display: none; background: none; border: none; color: #fff; font-size: 22px; padding: 8px; }
.brand { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: .2px; }
.brand-sub { font-size: 10px; opacity: .85; letter-spacing: 1px; }
.topbar-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 12px; font-size: 13px; }
#theme-toggle { background: rgba(255,255,255,.15); border: none; color: #fff; border-radius: 8px; padding: 7px 10px; font-size: 15px; }

/* ===== Sidebar (desktop) ===== */
#sidebar {
  grid-area: side; background: var(--surface); border-inline-end: 1px solid var(--border);
  padding: 12px 8px; overflow-y: auto; z-index: 20;
}
#sidebar .nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 12px; margin-bottom: 4px; border: none; border-radius: 8px;
  background: none; color: var(--text); font-size: 14.5px; text-align: start;
  transition: background .12s;
}
#sidebar .nav-item:hover { background: var(--surface-2); }
#sidebar .nav-item.active { background: rgba(0,120,212,.12); color: var(--primary); font-weight: 600; box-shadow: inset 3px 0 0 var(--primary); }
#sidebar .nav-icon { font-size: 17px; width: 24px; text-align: center; }
#bottomnav { display: none; }

/* ===== Main ===== */
#screen { grid-area: main; overflow-y: auto; padding: 18px; -webkit-overflow-scrolling: touch; }
.screen-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.screen-sub { color: var(--text-2); font-size: 13px; margin-bottom: 16px; }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }

/* ===== Controls ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 42px; padding: 9px 18px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface); color: var(--text);
  font-size: 14.5px; font-weight: 600; transition: all .12s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: none; color: var(--primary); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-lg { min-height: 52px; font-size: 16px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field input, .field select, .field textarea {
  min-height: 44px; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface); color: var(--text);
}
.field input:focus, .field select:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary); }

/* ===== Tables (scroll sideways on phone; no function dropped) ===== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; background: var(--surface); }
th { position: sticky; top: 0; background: var(--surface-2); font-weight: 700; text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-2); }

/* ===== POS layout ===== */
.pos-grid { display: grid; grid-template-columns: 1fr 400px; gap: 16px; align-items: start; }
.pos-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; margin-top: 12px; }
.pos-product {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  padding: 12px 10px; text-align: center; min-height: 86px;
  display: flex; flex-direction: column; justify-content: center; gap: 5px;
  transition: all .12s;
}
.pos-product:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.pos-product:active { transform: scale(.97); }
.pos-product .p-name { font-weight: 600; font-size: 13.5px; }
.pos-product .p-price { color: var(--primary); font-weight: 700; font-size: 14px; }
.pos-product .p-stock { color: var(--text-2); font-size: 11.5px; }
.pos-product.out { opacity: .45; }
.cart-line { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); }
.cart-line .qty-ctl { display: flex; align-items: center; gap: 6px; }
.cart-line .qty-ctl button { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font-size: 17px; color: var(--text); }
.cart-line .qty-ctl input { width: 56px; height: 34px; text-align: center; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.totals-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14.5px; }
.totals-row.grand { font-size: 19px; font-weight: 800; color: var(--primary); border-top: 2px solid var(--border); padding-top: 10px; margin-top: 6px; }
.pay-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.kbd-hint { font-size: 11px; color: var(--text-2); margin-top: 8px; }

/* ===== Modal (full-screen sheet on phone) ===== */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.42); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 18px;
  animation: fadeIn .15s;
}
.modal {
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px; max-height: calc(100vh - 36px); max-height: calc(100dvh - 36px);
  display: flex; flex-direction: column; animation: slideUp .18s;
}
.modal.wide { max-width: 760px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 16px; }
.modal-close { background: none; border: none; font-size: 20px; color: var(--text-2); padding: 4px 8px; }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-footer { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); }
.modal-footer .btn { flex: 1; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes slideUp { from { transform: translateY(14px); opacity: 0; } }

/* ===== Toast ===== */
#toast-root { position: fixed; bottom: 18px; inset-inline: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 200; pointer-events: none; }
.toast {
  background: #323130; color: #fff; padding: 11px 20px; border-radius: 9px;
  box-shadow: var(--shadow-lg); font-size: 14px; max-width: min(92vw, 480px);
  animation: slideUp .2s;
}
.toast.ok { background: var(--success); }
.toast.err { background: var(--danger); }
.toast.warn { background: var(--warning); }

/* ===== Badges & misc ===== */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge.ok { background: rgba(16,124,16,.14); color: var(--success); }
.badge.err { background: rgba(209,52,56,.14); color: var(--danger); }
.badge.warn { background: rgba(202,80,16,.15); color: var(--warning); }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; border-inline-start: 4px solid var(--primary); }
.kpi .k-label { font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; }
.kpi .k-value { font-size: 20px; font-weight: 800; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 9px; padding: 9px 16px; font-size: 14px; font-weight: 600; }
.tabs button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.empty-state { text-align: center; color: var(--text-2); padding: 40px 16px; font-size: 14.5px; }
.search-bar { position: relative; }
.search-bar input { width: 100%; min-height: 48px; border-radius: 10px; }
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: end; }
.filter-row .field { margin-bottom: 0; min-width: 140px; flex: 1; }
.substitute-note { font-size: 12px; color: var(--warning); margin-top: 6px; }

/* ===== Print substitute (documented browser substitute for thermal printing) ===== */
.print-only { display: none; }
@media print {
  body > #app-shell, #modal-root, #toast-root { display: none !important; }
  body { overflow: visible; background: #fff; }
  .print-only { display: block !important; color: #000; font-size: 13px; padding: 8px; }
  .print-only h2 { font-size: 17px; margin-bottom: 4px; }
  .print-only table { min-width: 0; font-size: 12.5px; }
}

/* ===== Phone ===== */
@media (max-width: 900px) {
  #app-shell { grid-template-columns: 1fr; grid-template-rows: var(--topbar-h) 1fr auto; grid-template-areas: "top" "main" "bottom"; }
  #nav-toggle { display: block; }
  .brand-sub { display: none; }
  #sidebar {
    position: fixed; inset-block: var(--topbar-h) 0; inset-inline-start: 0; width: 260px;
    transform: translateX(105%); transition: transform .2s; box-shadow: var(--shadow-lg);
  }
  /* RTL: sidebar sits at inline-start (right side) — translateX(105%) hides it off the right edge */
  #sidebar.open { transform: translateX(0); }
  #bottomnav {
    grid-area: bottom; display: flex; background: var(--surface);
    border-top: 1px solid var(--border); box-shadow: 0 -2px 8px rgba(0,0,0,.06);
    padding-bottom: env(safe-area-inset-bottom); z-index: 25;
  }
  #bottomnav .nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 8px 2px 7px; background: none; border: none; color: var(--text-2); font-size: 10.5px;
  }
  #bottomnav .nav-item .nav-icon { font-size: 19px; }
  #bottomnav .nav-item.active { color: var(--primary); font-weight: 700; }
  #screen { padding: 12px; }
  /* Toasts pin above the bottom navigation instead of covering it */
  #toast-root { bottom: calc(64px + env(safe-area-inset-bottom)); }
  .pos-grid { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 0; align-items: stretch; }
  .modal { max-width: none; max-height: none; height: 100%; border-radius: 0; }
  .btn { min-height: 46px; }
  #store-name { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
/* Inline SVG icons (no emoji font dependency) */
.nav-icon { display: inline-flex; align-items: center; justify-content: center; }
.nav-icon svg { width: 19px; height: 19px; }
#bottomnav .nav-icon svg { width: 21px; height: 21px; }
#theme-toggle svg { width: 18px; height: 18px; display: block; }
.ic { display: inline-flex; vertical-align: -3px; }
.ic svg { width: 17px; height: 17px; }
.search-bar { position: relative; }
.search-bar .search-ic { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--text-2); pointer-events: none; }
.search-bar input { padding-inline-start: 38px; }

/* ---- Activation screen: YAMO TECH identity (navy #0B1F44, cyan #00D4FF, teal #14B8A6; Tajawal; offline) ---- */
#activation-overlay { position: fixed; inset: 0; z-index: 200; overflow: auto; background: #0B1F44; color: #fff; display: flex; align-items: center; justify-content: center; padding: 20px; }
#activation-overlay .ac-wrap { width: 100%; max-width: 980px; display: grid; grid-template-columns: 1fr 1.05fr; gap: 20px; align-items: stretch; }
#activation-overlay .ac-brand { background: linear-gradient(160deg, #0F2A5C 0%, #0B1F44 60%); border: 1px solid rgba(0,212,255,.25); border-radius: 18px; padding: 22px; }
#activation-overlay .ac-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
#activation-overlay .ac-head img { width: 52px; height: 52px; border-radius: 14px; }
#activation-overlay .ac-title { font-size: 22px; font-weight: 800; letter-spacing: .5px; }
#activation-overlay .ac-sub { font-size: 13px; color: #9FB4D6; margin-bottom: 16px; line-height: 1.7; }
#activation-overlay .ac-list { display: flex; flex-direction: column; gap: 10px; }
#activation-overlay .ac-item { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); border-radius: 14px; padding: 10px 12px; }
#activation-overlay .ac-item.me { border-color: rgba(0,212,255,.55); background: rgba(0,212,255,.08); }
#activation-overlay .ac-item img, #activation-overlay .ac-item .ac-mono { width: 44px; height: 44px; border-radius: 12px; flex: none; }
#activation-overlay .ac-mono { display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px; color: #0B1F44; background: linear-gradient(135deg, #00D4FF, #14B8A6); }
#activation-overlay .ac-item b { display: block; font-size: 15px; font-weight: 700; }
#activation-overlay .ac-item span { display: block; font-size: 12.5px; color: #9FB4D6; line-height: 1.6; }
#activation-overlay .ac-foot { margin-top: 14px; font-size: 12px; color: #6F86AD; text-align: center; }
#activation-overlay .card { background: #fff; color: #1b2433; border-radius: 18px; padding: 22px; align-self: center; }
#activation-overlay .card h2 { font-size: 20px; font-weight: 800; color: #0B1F44; }
#activation-overlay .btn.primary { background: linear-gradient(90deg, #00D4FF, #14B8A6); color: #0B1F44; border: 0; font-weight: 800; }
#activation-overlay .btn.primary:disabled { opacity: .6; }
#activation-overlay #ac-err:empty { min-height: 20px; }
@media (max-width: 760px) {
  #activation-overlay { align-items: flex-start; padding: 14px; }
  #activation-overlay .ac-wrap { grid-template-columns: 1fr; }
  #activation-overlay .card { order: -1; }
}
#activation-overlay .ac-link { display: flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 8px; border: 1px solid rgba(0,212,255,.5); border-radius: 12px; color: #00D4FF; font-weight: 700; font-size: 13.5px; text-decoration: none; }
#activation-overlay .ac-link:hover, #activation-overlay .ac-link:focus-visible { background: rgba(0,212,255,.1); outline: none; }

/* Standing rule (Bahaa): text in every button, field, input, tab and chip is centered inside it. */
button, .btn, .tabs button, .badge, .chip, .nav-item { display: inline-flex; align-items: center; justify-content: center; text-align: center; line-height: 1.35; }
.nav-item { justify-content: flex-start; }
.tabs button { min-height: 40px; }
.badge { padding: 4px 10px; min-height: 22px; }
input:not([type=checkbox]):not([type=radio]), select { line-height: 1.35; }
.field input:not([type=checkbox]):not([type=radio]), .field select { height: 44px; padding-top: 0; padding-bottom: 0; display: flex; align-items: center; }
input[type=date] { padding-top: 0; padding-bottom: 0; }

/* Bahaa standing rule: text centered inside every field/input/select (placeholders too). */
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { text-align: center; text-align-last: center; }
input::placeholder, textarea::placeholder { text-align: center; }

/* Report center: grouped, bordered chips (no loose floating text) */
.rc-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin-bottom: 12px; }
.rc-grp { border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px 10px; background: var(--surface-2); }
.rc-grp-t { font-size: 12.5px; font-weight: 700; color: var(--text-2); text-align: center; margin-bottom: 6px; }
.rc-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.rc-k, .rc-p, #rc-csv, #rc-pr { border: 1px solid var(--border) !important; background: var(--surface) !important; border-radius: 10px; min-height: 36px; padding: 4px 12px; font-size: 14px; }
.rc-k.active, .rc-p.active { background: var(--primary) !important; color: #fff !important; border-color: var(--primary) !important; }
.rc-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; justify-content: center; border-top: 1px solid var(--border); padding-top: 12px; }
.rc-bar .field { margin: 0; min-width: 130px; }

/* Bahaa rule: no floating text buttons. Every ghost/text button is a glass tile with a frame, same on all screens; text centered. */
.btn.ghost, .rc-k, .rc-p, #rc-csv, #rc-pr {
  background: linear-gradient(135deg, rgba(255,255,255,.78), rgba(0,120,212,.10)) !important;
  -webkit-backdrop-filter: blur(10px) saturate(1.4); backdrop-filter: blur(10px) saturate(1.4);
  border: 1px solid rgba(0,120,212,.30) !important; border-radius: 12px !important;
  box-shadow: 0 2px 8px rgba(16,40,80,.08), inset 0 1px 0 rgba(255,255,255,.7);
  color: var(--primary); min-height: 36px; padding: 6px 14px; text-align: center; justify-content: center;
}
.btn.ghost:hover, .rc-k:hover, .rc-p:hover { box-shadow: 0 4px 12px rgba(0,120,212,.18), inset 0 1px 0 rgba(255,255,255,.8); border-color: var(--primary) !important; }
.btn.ghost.active, .rc-k.active, .rc-p.active { background: var(--primary) !important; color: #fff !important; border-color: var(--primary) !important; box-shadow: 0 3px 10px rgba(0,120,212,.35); }
[data-theme="dark"] .btn.ghost, [data-theme="dark"] .rc-k, [data-theme="dark"] .rc-p, [data-theme="dark"] #rc-csv, [data-theme="dark"] #rc-pr { background: linear-gradient(135deg, rgba(60,60,62,.75), rgba(0,120,212,.18)) !important; border-color: rgba(120,180,255,.35) !important; box-shadow: 0 2px 8px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.08); }
td .btn.ghost { min-height: 30px; padding: 3px 10px; font-size: 13.5px; }
td .btn.ghost[data-del], td .btn.ghost[style*="danger"] { border-color: rgba(200,40,40,.4) !important; }
.tabs button { background: linear-gradient(135deg, rgba(255,255,255,.78), rgba(0,120,212,.10)); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(0,120,212,.30); border-radius: 12px; min-height: 36px; padding: 6px 14px; text-align: center; }
.tabs button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.lg-ref { display: inline-flex; align-items: center; justify-content: center; padding: 2px 10px; border: 1px solid rgba(0,120,212,.30); border-radius: 10px; background: linear-gradient(135deg, rgba(255,255,255,.78), rgba(0,120,212,.10)); }

/* Report center v3: each button a glass tile sized exactly to its text, laid out in an even flowing row */
.rc-groups { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 12px; }
.rc-grp { display: contents; border: 0; padding: 0; background: none; }
.rc-grp-t { display: none; }
.rc-chips { display: contents; }
.rc-k, .rc-p, #rc-csv, #rc-pr, #rc-go { width: auto; flex: 0 0 auto; padding: 6px 14px; }
.rc-bar { gap: 8px; justify-content: center; align-items: end; }
/* all secondary buttons share the glass tile style */
.btn:not(.primary):not(.danger):not(.ghost) { background: linear-gradient(135deg, rgba(255,255,255,.78), rgba(0,120,212,.10)); -webkit-backdrop-filter: blur(10px) saturate(1.4); backdrop-filter: blur(10px) saturate(1.4); border: 1px solid rgba(0,120,212,.30); border-radius: 12px; box-shadow: 0 2px 8px rgba(16,40,80,.08), inset 0 1px 0 rgba(255,255,255,.7); }
.btn:not(.primary):not(.danger):not(.ghost):hover { border-color: var(--primary); }
[data-theme="dark"] .btn:not(.primary):not(.danger):not(.ghost) { background: linear-gradient(135deg, rgba(60,60,62,.75), rgba(0,120,212,.18)); border-color: rgba(120,180,255,.35); }

/* Date picker (glass) */
.dp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; min-width: 170px; padding: 6px 14px; border-radius: 12px; font: inherit; font-weight: 600; color: var(--text); cursor: pointer;
  background: linear-gradient(135deg, rgba(255,255,255,.80), rgba(0,120,212,.12)); border: 1px solid rgba(0,120,212,.32); -webkit-backdrop-filter: blur(10px) saturate(1.4); backdrop-filter: blur(10px) saturate(1.4); box-shadow: 0 2px 8px rgba(16,40,80,.08), inset 0 1px 0 rgba(255,255,255,.7); text-align: center; }
.dp-btn:hover { border-color: var(--primary); box-shadow: 0 4px 12px rgba(0,120,212,.18); }
.dp-ic { display: inline-flex; color: var(--primary); } .dp-empty .dp-text { color: var(--text-2); font-weight: 500; }
.dp-pop { position: fixed; z-index: 10000; width: 300px; padding: 12px; border-radius: 18px; color: var(--text);
  background: linear-gradient(145deg, rgba(255,255,255,.88), rgba(220,236,252,.78)); border: 1px solid rgba(0,120,212,.30); -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6); box-shadow: 0 18px 48px rgba(10,30,70,.28), inset 0 1px 0 rgba(255,255,255,.8); }
.dp-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.dp-title { display: flex; gap: 6px; flex: 1; justify-content: center; }
.dp-title select { min-height: 34px; padding: 2px 8px; border-radius: 10px; border: 1px solid rgba(0,120,212,.28); background: rgba(255,255,255,.7); color: var(--text); font: inherit; font-weight: 700; text-align: center; text-align-last: center; }
.dp-nav { width: 34px; height: 34px; border-radius: 10px; border: 1px solid rgba(0,120,212,.28); background: rgba(255,255,255,.7); color: var(--primary); font-size: 20px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dp-w { font-size: 11.5px; font-weight: 700; color: var(--text-2); text-align: center; padding: 4px 0; }
.dp-c { height: 36px; border-radius: 10px; }
.dp-d { border: 1px solid transparent; background: transparent; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.dp-d:hover:not(:disabled) { background: rgba(0,120,212,.14); border-color: rgba(0,120,212,.35); }
.dp-d:disabled { opacity: .35; cursor: not-allowed; }
.dp-today { border-color: var(--primary); color: var(--primary); }
.dp-sel, .dp-sel:hover { background: var(--primary) !important; color: #fff !important; border-color: var(--primary) !important; box-shadow: 0 3px 10px rgba(0,120,212,.4); }
.dp-foot { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
.dp-act { min-height: 34px; padding: 4px 18px; border-radius: 12px; border: 1px solid rgba(0,120,212,.32); background: linear-gradient(135deg, rgba(255,255,255,.8), rgba(0,120,212,.12)); color: var(--primary); font: inherit; font-weight: 700; cursor: pointer; text-align: center; }
[data-theme="dark"] .dp-pop { background: linear-gradient(145deg, rgba(50,49,48,.92), rgba(20,50,90,.85)); }
[data-theme="dark"] .dp-btn, [data-theme="dark"] .dp-act, [data-theme="dark"] .dp-nav, [data-theme="dark"] .dp-title select { background: rgba(60,60,62,.75); }

/* uniform control height in rows mixing date buttons, selects and buttons */
.dp-btn { min-height: 42px; box-sizing: border-box; }
.rc-bar { align-items: flex-end; row-gap: 12px; }
.rc-bar .rc-p, .rc-bar .btn, .rc-bar .dp-btn, .rc-bar .field select, .rc-bar .field input { height: 40px; min-height: 40px; box-sizing: border-box; padding-top: 0; padding-bottom: 0; }
.rc-bar .field { margin-bottom: 0; }
.rc-bar .field label { height: 18px; }

.brand-logo{display:block;margin:0 auto 6px;border-radius:12px}.brand-logo-ondark{display:none}[data-theme="dark"] .brand-logo-ondark{display:block}[data-theme="dark"] .brand-logo-onlight{display:none}

.inv-box{margin-top:12px;border:1px solid var(--border,#d7dee8);border-radius:12px;padding:8px 10px;background:rgba(127,127,127,.05)}
.inv-title{font-weight:700;margin-bottom:6px;text-align:center}
.inv-items{max-height:260px;min-height:120px;overflow-y:auto;display:flex;flex-direction:column;gap:4px;padding-inline-start:2px}
.inv-row{display:grid;grid-template-columns:28px 1fr auto auto;gap:10px;align-items:center;padding:6px 8px;border-radius:8px;background:rgba(127,127,127,.08)}
.inv-n{opacity:.6;text-align:center}.inv-q{font-weight:600}.inv-t{font-weight:700;min-width:80px;text-align:end}
#cart-lines .cart-line{background:rgba(127,127,127,.06);border-radius:8px;padding:6px 8px}

.lg-stage{display:flex;align-items:center;justify-content:center;gap:18px;width:100%;max-width:1040px}
.lg-mid{display:flex;flex-direction:column;align-items:center;gap:14px;width:100%;max-width:380px}
.lg-side{display:flex;flex-direction:column;gap:14px;width:230px}
.lg-top,.lg-bot{width:100%}
.lg-ad{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:14px;background:var(--surface,#fff);border:1px solid var(--border,#d7dee8);box-shadow:0 2px 10px rgba(0,0,0,.06)}
.lg-ad img{width:44px;height:44px;border-radius:10px;flex:none}
.lg-ad div{display:flex;flex-direction:column;text-align:start;min-width:0}
.lg-ad b{font-size:14px}.lg-ad span{font-size:12px;color:var(--text-2)}
@media(max-width:900px){.lg-side{display:none}}
@media(max-height:620px){.lg-top,.lg-bot{display:none}}
.btn,button.btn{display:inline-flex;align-items:center;justify-content:center;text-align:center;line-height:1.3}
svg.ic-lg{width:26px;height:26px;vertical-align:-5px;margin-inline-start:6px}
svg.ic{width:17px;height:17px;vertical-align:-3px;margin-inline-end:4px}

.cl-grid{display:grid;grid-template-columns:30px 110px 1fr 138px 90px 56px;gap:8px;align-items:center}
.cl-head{font-weight:700;font-size:12.5px;color:var(--text-2);padding:4px 8px;border-bottom:1px solid var(--border,#d7dee8);margin-bottom:4px;text-align:center}
.cl-head span:nth-child(3){text-align:start}
.cl-n,.cl-bc,.cl-tot{text-align:center}.cl-bc{font-size:12px;direction:ltr;overflow:hidden;text-overflow:ellipsis}
.cl-name{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cl-tot{font-weight:700}
.cl-grid .qty-ctl{justify-self:center}
.cl-grid{grid-template-columns:22px 78px minmax(90px,1fr) 112px 66px 44px;gap:6px}
.cl-grid .qty-ctl{gap:3px}
.cl-grid .qty-ctl button{width:28px;height:30px;font-size:15px;padding:0}
.cl-grid .qty-ctl input{width:42px;height:30px;padding:0}
.cl-name{white-space:normal;line-height:1.25;font-size:13.5px}
.cl-grid [data-rm]{padding:2px 4px !important;min-height:26px !important;font-size:12px}
.cl-head{font-size:12px}
.cl-grid{grid-template-columns:22px 78px minmax(80px,1fr) 112px 84px 44px}
.cl-head span{white-space:nowrap;text-align:center}.cl-head span:nth-child(3){text-align:start}
.cl-head{padding-left:25px}

/* POS redesign: categories, large product grid, ticket panel, numpad, big pay buttons */
.pos-v3{grid-template-columns:1fr 540px;align-items:stretch}
.pos-cats{display:flex;gap:8px;overflow-x:auto;padding:12px 2px 4px;scrollbar-width:thin}
.cat-chip{flex:none;min-height:40px;padding:0 18px;border-radius:999px;border:1px solid var(--border);background:var(--surface);color:var(--text);font-weight:600;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
.cat-chip.on{background:var(--primary);border-color:var(--primary);color:#fff}
.pos-products{grid-template-columns:repeat(auto-fill,minmax(125px,1fr));gap:12px;max-height:calc(100vh - 330px);overflow-y:auto;padding:4px 2px}
.pos-product{min-height:104px;border-radius:14px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;text-align:center}
.pos-product .p-name{font-size:15px}.pos-product .p-price{font-size:16px}
.inv-box{margin-top:0;margin-bottom:10px}
.inv-items{max-height:230px}
#cart-lines .cart-line.sel{outline:2px solid var(--primary);background:rgba(0,120,215,.10)}
.numpad{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:10px;direction:ltr}
.np-modes{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:8px;direction:rtl}
.np-mode{min-height:36px;border-radius:10px;border:1px solid var(--border);background:var(--surface);color:var(--text);font-weight:700;display:inline-flex;align-items:center;justify-content:center}
.np-mode.on{background:var(--primary);color:#fff;border-color:var(--primary)}
.np-key{min-height:46px;border-radius:10px;border:1px solid var(--border);background:var(--surface);color:var(--text);font-size:19px;font-weight:700;display:inline-flex;align-items:center;justify-content:center}
.np-key:active{transform:scale(.96)}
#pay-cash{grid-column:1/-1;min-height:64px;font-size:22px}
@media(max-width:1100px){.pos-v3{grid-template-columns:1fr}.pos-products{max-height:none}}
.pos-v3 > .card:last-child .field{margin-top:4px !important}
.pos-v3 > .card:last-child .field label{margin-bottom:2px}
.pos-v3 .kbd-hint{display:none}
.inv-items{max-height:200px}
.pos-v3 .pay-actions .btn-lg{min-height:50px}
.np-key{min-height:40px !important}.np-mode{min-height:32px !important}.numpad{margin-top:12px;gap:6px}
.btn-trash{display:inline-flex;align-items:center;justify-content:center;width:36px;min-width:36px;height:34px;min-height:34px !important;padding:0 !important;color:#d92d20 !important;border:1px solid #f1b5b0 !important;background:#fff5f4 !important;border-radius:9px}.btn-trash:hover{background:#fee4e2 !important}.cl-grid .btn-trash{width:32px;min-width:32px;height:30px;min-height:30px !important}

/* POS compact fit: numpad + pay visible without scrolling */
.pos-bottom{display:grid;grid-template-columns:1fr 236px;gap:10px;margin-top:8px;align-items:start}
.pos-pay .pay-actions{grid-template-columns:1fr 1fr;gap:6px;margin-top:6px}
.pos-pay .pay-actions .btn-lg{min-height:38px;font-size:13px;padding:0 6px}
.pos-pay #pay-cash{min-height:54px;font-size:20px}
.pos-bottom .numpad{margin-top:0;grid-template-columns:repeat(3,1fr)}
.pos-bottom .np-key{min-height:36px !important;font-size:17px}
.pos-bottom .np-mode{min-height:30px !important}
.pos-v3 .screen-title,.screen-title{margin-bottom:0}
.inv-items{max-height:calc(100vh - 640px);min-height:96px}
.pos-v3 .totals-row{padding:3px 0}.pos-v3 .totals-row.grand{padding-top:6px;margin-top:2px}
.pos-v3 > .card:last-child{padding:12px}
.pos-v3 .kbd-hint{display:none}

.pos-v3 > .card:last-child{display:grid;grid-template-columns:1fr 120px;column-gap:10px;align-content:start}
.pos-v3 > .card:last-child > *{grid-column:1/-1}
.pos-v3 > .card:last-child > .field{grid-column:auto}
#pos-cust-info{font-size:11.5px;margin-top:2px !important}
.inv-items{max-height:calc(100vh - 600px);min-height:90px}
#screen:has(.pos-v3) .screen-title{display:inline-block}
#screen:has(.pos-v3) .screen-sub + div{display:inline-flex !important;margin:0 24px 0 0 !important;vertical-align:middle;align-items:center}
#screen:has(.pos-v3) .screen-sub + div .field{display:flex;flex-direction:row;align-items:center;gap:8px;min-width:0 !important}
#screen:has(.pos-v3) .screen-sub + div .field label{margin:0;white-space:nowrap}
#screen:has(.pos-v3) .screen-sub + div select{min-height:36px}
.pos-bottom .np-key{min-height:32px !important}
.inv-items{min-height:70px}

/* collapsible sidebar */
.side-collapse{display:flex;align-items:center;justify-content:center;width:100%;min-height:34px;margin-bottom:6px;border:1px solid var(--border);border-radius:9px;background:var(--surface-2,#f3f5f8);color:var(--text);cursor:pointer}
.side-collapse svg{transition:transform .2s}
body.side-collapsed .side-collapse svg{transform:rotate(180deg)}
#app-shell{transition:grid-template-columns .2s}
body.side-collapsed #app-shell{grid-template-columns:68px 1fr}
body.side-collapsed #sidebar{padding:12px 6px;overflow-x:hidden}
body.side-collapsed #sidebar .nav-item{justify-content:center;padding-inline:0}
body.side-collapsed #sidebar .nav-item > span:not(.nav-icon){display:none}
body.side-collapsed #sidebar .nav-icon{width:auto}
@media(max-width:900px){body.side-collapsed #app-shell{grid-template-columns:1fr}body.side-collapsed #sidebar{width:68px}}

/* POS v3: invoice takes the larger part, numpad+pay under the products, no page scroll */
.pos-v3{grid-template-columns:minmax(400px,.78fr) 1.22fr;height:calc(100vh - 128px);min-height:560px;align-items:stretch}
.pos-v3 > .card{display:flex;flex-direction:column;min-height:0;overflow:hidden}
.pos-v3 > .card:first-child{padding:12px}
.pos-products{flex:1 1 auto;min-height:92px;max-height:none;grid-template-columns:repeat(auto-fill,minmax(118px,1fr));gap:8px;align-content:start;overflow-y:auto}
.pos-product{min-height:78px;padding:6px}
.pos-product .p-name{font-size:14px}.pos-product .p-price{font-size:15px}
.pos-v3 > .card:first-child .pos-bottom{flex:none;display:grid;grid-template-columns:1fr 200px;margin-top:8px}
.pos-bottom .np-key{min-height:34px !important}
.pos-v3 > .card:last-child{display:grid;grid-template-columns:1fr 130px;grid-template-rows:auto minmax(0,1fr) auto auto auto;padding:14px}
.pos-v3 > .card:last-child .inv-box{display:flex;flex-direction:column;min-height:0;margin-bottom:8px}
.pos-v3 .inv-items{flex:1 1 auto;max-height:none;min-height:0;gap:6px}
.pos-v3 .inv-box .cl-head{font-size:13.5px;padding:6px 8px}
.pos-v3 .cl-grid{grid-template-columns:30px 84px minmax(90px,1fr) 176px 92px 52px;gap:8px}
.pos-v3 .cart-line.cl-grid{padding:8px 10px;min-height:62px;border-radius:12px}
.pos-v3 .cl-name{font-size:16px}.pos-v3 .cl-bc{font-size:12.5px}.pos-v3 .cl-tot{font-size:17px}.pos-v3 .cl-n{font-size:15px}
.pos-v3 .cl-grid .qty-ctl{gap:6px}
.pos-v3 .cl-grid .qty-ctl button{width:44px;height:44px;font-size:22px;border-radius:12px}
.pos-v3 .cl-grid .qty-ctl input{width:56px;height:44px;font-size:17px;font-weight:700;border-radius:12px}
.pos-v3 .cl-grid .btn-trash{width:46px;min-width:46px;height:44px;min-height:44px !important;border-radius:12px}
.pos-v3 .cl-grid .btn-trash svg{width:22px;height:22px}
@media(max-width:1100px){.pos-v3{grid-template-columns:1fr;height:auto}.pos-v3 > .card{overflow:visible}}
.pos-v3 .cl-grid{grid-template-columns:24px 72px minmax(70px,1fr) 148px 78px 44px;gap:6px}
.pos-v3 .cl-grid .qty-ctl button{width:40px;height:42px}
.pos-v3 .cl-grid .qty-ctl input{width:48px;height:42px}
.pos-v3 .cl-grid .btn-trash{width:42px;min-width:42px;height:42px;min-height:42px !important}
.pos-v3 .inv-items{overflow-x:hidden}
.pos-v3 .cl-name{font-size:15px}.pos-v3 .cl-tot{font-size:16px}
.pos-v3{grid-template-columns:minmax(380px,.7fr) 1.3fr}

.paid-row{display:grid;grid-template-columns:130px 1fr auto;gap:8px;align-items:end;margin:6px 0 2px}
.paid-in label{display:block;font-size:12px;font-weight:700;color:var(--text-2);margin-bottom:2px}
.paid-in input{width:100%;min-height:40px;text-align:center;font-weight:700;font-size:16px}
.paid-chips{display:flex;gap:6px;justify-content:center}
.chip-btn{min-height:40px;padding:0 12px;border-radius:10px;border:1px solid var(--border);background:var(--surface);color:var(--text);font-weight:700;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
.chip-btn:active{transform:scale(.96)}
.paid-change{display:flex;flex-direction:column;align-items:center;font-size:12px;color:var(--text-2)}
.paid-change b{font-size:17px;color:#067647}.paid-change b.short{color:#d92d20}
.np-modes{gap:6px !important}

.cl-unit{display:block;font-size:11px;font-weight:500;color:var(--text-2);margin-top:1px}
.totals-row .cl-unit{display:inline;margin-inline-start:8px}
.undo-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 12px;margin-top:6px;border-radius:12px;background:#fff7e6;border:1px solid #f5d28a;color:#7a4b00;font-weight:600}
.undo-bar .btn{min-height:34px;padding:0 16px}

.stk-badge{display:inline-block;margin-top:2px;padding:1px 8px;border-radius:999px;font-size:11px;font-weight:700}
.stk-badge.low{background:#fff4e0;color:#b54708}.stk-badge.out{background:#fee4e2;color:#b42318}
.cl-over{display:block;font-size:11px;font-weight:700;color:#b42318}

/* purchases layout */
.pur-v2{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:14px;align-items:start;margin-bottom:14px}
.pur-v2 .card{min-width:0}
.pur-pay3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.pur-v2 .field input,.pur-v2 .field select{width:100%;min-width:0;box-sizing:border-box;text-align:center}
@media(max-width:900px){.pur-v2{grid-template-columns:1fr}}

/* uniform natural buttons */
.btn:not(.primary):not(.danger):not(.ghost),.btn.ghost,[data-theme="dark"] .btn:not(.primary):not(.danger):not(.ghost),[data-theme="dark"] .btn.ghost{background:var(--surface);-webkit-backdrop-filter:none;backdrop-filter:none;border:1px solid var(--border);border-radius:10px;box-shadow:none}
.btn:not(.primary):not(.danger):not(.ghost):hover,.btn.ghost:hover{background:var(--surface-2)}
/* ledgers: clean header, no nested card */
.ledger-pick{max-width:460px;margin-bottom:14px}
.ledger-pick select{width:100%;box-sizing:border-box;text-align:center;text-align-last:center}
#lg-st .card,#lg-sst .card{box-shadow:none;border:0;padding:0;background:transparent}

/* summary cards */
.sum-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(125px,1fr));gap:12px;margin-bottom:14px}
.sum-card{background:var(--surface-2,#f7f7f7);border:1px solid var(--border);border-radius:12px;padding:12px 14px;text-align:center;display:flex;flex-direction:column;gap:6px;align-items:center;justify-content:center}
.sum-l{font-size:13px;color:var(--text-2);font-weight:600}
.sum-v{font-size:20px;font-weight:800;color:var(--text)}
.sum-card.bad{border-color:rgba(209,52,56,.35)}.sum-card.bad .sum-v{color:var(--danger)}
/* natural flat controls everywhere (Bahaa 21:47: no glass) */
.btn.ghost,.rc-k,.rc-p,#rc-csv,#rc-pr,.tabs button,.lg-ref,.dp-btn,.dp-act,[data-theme="dark"] .btn.ghost,[data-theme="dark"] .rc-k,[data-theme="dark"] .rc-p,[data-theme="dark"] #rc-csv,[data-theme="dark"] #rc-pr{background:var(--surface) !important;-webkit-backdrop-filter:none !important;backdrop-filter:none !important;box-shadow:none !important;border:1px solid var(--border) !important;border-radius:10px !important}
.tabs button.active{background:var(--primary) !important;border-color:var(--primary) !important;color:#fff !important}
.btn.ghost:hover,.tabs button:hover:not(.active){background:var(--surface-2) !important}
.btn.ghost.danger,.btn.danger.ghost{color:var(--danger)}

/* header logo */
#topbar .brand{flex-direction:row;align-items:center;gap:10px}
#topbar .brand-text{display:flex;flex-direction:column;line-height:1.15}
#topbar .brand-mark{width:38px;height:38px;border-radius:10px;display:block;object-fit:cover;background:#fff}
/* batchN: selects inside tables follow the field style */
td select{height:38px;min-width:190px;padding:0 10px;border:1px solid var(--border);border-radius:10px;background:var(--surface,#fff);color:var(--text);font:inherit;text-align:center;text-align-last:center}
.screen-title{margin-bottom:10px}
.screen-title + .card, .screen-title + .card-warn{margin-top:10px}
td input[type=number]:not(.pos-qty){height:36px;width:84px;padding:0 8px;border:1px solid var(--border);border-radius:10px;background:var(--surface,#fff);color:var(--text);font:inherit;text-align:center}
/* dashboard v2 */
.dl-range{display:flex;gap:8px;margin:0 0 12px;flex-wrap:wrap}
.dl-row{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}
.dl-card{cursor:default}.dl-card[data-go]{cursor:pointer}.dl-card[data-go]:hover{border-color:var(--primary)}
.dl-d{font-size:12px;font-weight:600}.dl-g{color:var(--success)}.dl-b{color:var(--danger)}.dl-n{color:var(--text-2)}
.dl-sec,.dl-ct{font-weight:700;font-size:15px;margin:10px 0 8px}
.dl-ch{margin-top:12px}.dl-ch .dl-ct{margin-top:0}
.dl-svg{width:100%;height:auto;direction:ltr;display:block}.dl-svg .ct{font-size:11px;fill:var(--text-2);font-family:inherit}
.dl-lg{display:flex;gap:16px;margin-bottom:6px;font-size:12px;color:var(--text-2)}.dl-lg i,.dl-leg i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-inline-end:6px}
.dl-two{display:grid;grid-template-columns:1fr 1fr;gap:12px}.dl-three{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
@media(max-width:900px){.dl-two,.dl-three{grid-template-columns:1fr}}
.dl-bars{display:flex;flex-direction:column;gap:9px}.dl-br{display:grid;grid-template-columns:34% 1fr auto;gap:10px;align-items:center;font-size:13px}
.dl-bn{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-bt{height:12px;background:#ececec;border-radius:6px;overflow:hidden}.dl-bf{height:100%;background:var(--primary);border-radius:6px}.dl-bv{font-weight:700;min-width:60px;text-align:left}
.dl-donut{display:flex;gap:18px;align-items:center;justify-content:center;flex-wrap:wrap}.dl-leg{display:flex;flex-direction:column;gap:7px;font-size:13px}.dl-leg div{display:flex;align-items:center}.dl-leg b{margin-inline-start:10px}
.dl-list>div{display:flex;justify-content:space-between;padding:8px 0;border-bottom:1px solid var(--border);font-size:13px}.dl-list>div:last-child{border:0}
.dl-r4{grid-template-columns:repeat(4,1fr)}.dl-r3{grid-template-columns:repeat(3,1fr)}
@media(max-width:900px){.dl-r4,.dl-r3{grid-template-columns:repeat(2,1fr)}}
.dl-card{border-top:4px solid var(--ac,var(--primary));position:relative}
.dl-sp{width:100%;max-width:130px;height:28px;margin-top:2px}
.dl-ins{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px;margin-bottom:12px}
.dl-in{display:flex;gap:10px;align-items:center;background:var(--surface,#fff);border:1px solid var(--border);border-radius:12px;padding:10px 14px}
.dl-ii{width:38px;height:38px;border-radius:10px;background:#e8f1fb;display:flex;align-items:center;justify-content:center;font-size:19px}
.dl-in:nth-child(2) .dl-ii{background:#fdf0e6}.dl-in:nth-child(3) .dl-ii{background:#e8f4e8}.dl-in:nth-child(4) .dl-ii{background:#f1ebf8}
.dl-heat{display:grid;grid-template-columns:repeat(18,1fr);gap:4px;direction:ltr}
.dl-hc{height:38px;border-radius:6px;display:flex;align-items:flex-end;justify-content:center;font-size:10px;padding-bottom:3px;color:#333}
.dl-hc span{background:rgba(255,255,255,.7);border-radius:4px;padding:0 3px}
.dl-ii{width:6px!important;height:38px!important;border-radius:3px!important;background:#0078D4!important;font-size:0!important}.dl-in:nth-child(2) .dl-ii{background:#CA5010!important}.dl-in:nth-child(3) .dl-ii{background:#107C10!important}.dl-in:nth-child(4) .dl-ii{background:#0F766E!important}
.dl-heat{grid-template-columns:repeat(9,1fr)!important;gap:6px!important}
.dl-hc{height:62px!important;flex-direction:column;align-items:center!important;justify-content:center!important;padding:0!important;gap:2px}
.dl-hc small{font-size:11px;opacity:.85}.dl-hc b{font-size:14px}.dl-hc span{display:none}
@media(max-width:700px){.dl-heat{grid-template-columns:repeat(3,1fr)!important}}
.dl-stack{display:flex;height:14px;border-radius:7px;overflow:hidden;margin-bottom:10px;direction:rtl}
.dl-dot{display:inline-block;width:10px;height:10px;border-radius:3px;margin-inline-end:8px}
.dl-list em{font-style:normal;color:var(--text-2);font-weight:600;margin-inline-start:6px}
.dl-two>*,.dl-three>*,.dl-row>*,.dl-ins>*,.dl-r4>*,.dl-r3>*{min-width:0}
.dl-two svg,.dl-three svg,.dl-card svg,.dl-ct~* svg{max-width:100%;height:auto}
@media(max-width:700px){.dl-ins{grid-template-columns:1fr 1fr}.dl-r4,.dl-r3{grid-template-columns:1fr 1fr}.dl-row{grid-template-columns:1fr 1fr}#screen,main{overflow-x:hidden}}
#screen{min-width:0;max-width:100vw;box-sizing:border-box}
@media(max-width:900px){#app-shell{grid-template-columns:minmax(0,1fr)!important}}
.dl-wd{display:flex;flex-direction:column;gap:9px}.dl-wr{display:grid;grid-template-columns:74px 1fr auto;gap:10px;align-items:center}.dl-wn{font-weight:600;white-space:nowrap;text-align:start}.dl-wr .dl-bt{height:14px}.dl-wr .dl-bv{text-align:end}
.rc-bar2{border-top:1px solid var(--border);margin-top:12px;padding-top:12px;display:flex;flex-direction:column;gap:12px}
.rc-pr-row,.rc-acts{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-start}
.rc-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.rc-fields .field{margin:0;max-width:none!important}.rc-fields .field input,.rc-fields .field select{width:100%;box-sizing:border-box;text-align:center;text-align-last:center}
@media(max-width:700px){.rc-fields{grid-template-columns:1fr 1fr}}
.rc-fields .field label{display:block;text-align:center;margin-bottom:6px}.rc-fields .field{display:flex;flex-direction:column}
.dl-grid{stroke:var(--border,#e5e5e5)}
[data-theme="dark"] .dl-grid{stroke:rgba(255,255,255,.12)}
[data-theme="dark"] .dl-bt{background:rgba(255,255,255,.12)}
[data-theme="dark"] .dl-donut text,[data-theme="dark"] .dl-svg text,[data-theme="dark"] .dl-donut .ct{fill:#e8e8e8}
[data-theme="dark"] .dl-hc{color:#fff!important}
.bal-bar{align-items:end}.bal-bar .btn{width:100%;height:44px;margin:0}
td .btn,td .btn-trash{vertical-align:middle;margin-block:0}
td .btn-trash{height:36px;min-height:36px!important;box-sizing:border-box}
td .btn:not(.btn-trash){min-height:36px;box-sizing:border-box}
.card>.sum-row:last-child,#in-kpi .sum-row,#rp-kpi .sum-row{margin-bottom:0}
.card[data-k] .btn.primary{margin-bottom:12px;height:44px;box-sizing:border-box}

/* ===== Batch I20: deeper cyan/teal primary + soft gradients (no glass, no purple/pink) ===== */
body { background: linear-gradient(160deg, #F6F8FA 0%, #EAEFF4 100%) fixed; }
#topbar { background: linear-gradient(90deg, #0B3F73 0%, #0A5C9E 55%, #0A6E9C 100%); }
.btn.primary { background: linear-gradient(180deg, #0B7FB8 0%, #0A5E94 100%); border-color: #0A5E94; color: #fff; }
.btn.primary:hover { background: linear-gradient(180deg, #0A74A9 0%, #08507F 100%); }
#activation-overlay .btn.primary { background: linear-gradient(90deg, #0E7490, #0F766E); color: #fff; border: 0; }
#activation-overlay .ac-mono { background: linear-gradient(135deg, #0E7490, #0F766E); color: #fff; }
.card { background: linear-gradient(180deg, #FFFFFF 0%, #FAFBFC 100%); }
[data-theme="dark"] body { background: linear-gradient(160deg, #1b1b1c 0%, #121214 100%) fixed; }
[data-theme="dark"] .card { background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%); }
@media (max-width: 900px) { .pos-grid.pos-v3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) { .pos-grid.pos-v3 > * { min-width: 0; } .pos-v3 .table-wrap, .pos-v3 .cart-wrap, .pos-v3 [id^="cart"] { overflow-x: auto; max-width: 100%; } .pos-v3 table { min-width: 0; font-size: 12.5px; } }
@media (max-width: 600px) { .pos-v3 .inv-box .cl-grid { grid-template-columns: 18px minmax(60px,1fr) 100px 58px 30px; gap: 4px; } .pos-v3 .inv-box .cl-grid > :nth-child(2) { display: none; } .pos-v3 .inv-box .cl-grid .qty-ctl button { width: 24px; } }
@media (max-width: 600px) { .pos-v3 .inv-box .cl-grid .qty-ctl input { width: 34px; height: 36px; } .pos-v3 .inv-box .cl-grid .qty-ctl button { width: 26px; height: 36px; } .pos-v3 .inv-box .cl-grid .btn-trash { width: 30px; min-width: 30px; height: 36px; min-height: 36px !important; } .pos-v3 .inv-box .cl-grid { grid-template-columns: 18px minmax(50px,1fr) 100px 52px 30px; } .pos-v3 > .card:last-child { grid-template-columns: minmax(0,1fr) 100px; } .pos-v3 .cl-tot { font-size: 13px; } }
@media (max-width: 600px) { .pos-v3 > .card:last-child { grid-template-columns: minmax(0,1fr); } .pos-v3 > .card:last-child > .field { grid-column: 1 / -1; } .pos-v3 .paid-change { display: flex; justify-content: space-between; gap: 8px; align-items: center; } .pos-v3 .pos-bottom, .pos-v3 .pay-row { min-width: 0; } }
@media (max-width: 600px) { .paid-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr); } .paid-row .paid-chips { grid-column: 1 / -1; order: 3; flex-wrap: wrap; } .paid-row .paid-change { order: 2; flex-direction: column; } }
/* rows that bottom-align fields with an action button: the field keeps its 12px bottom margin, so the button gets the same margin to sit level with the inputs */
[style*="align-items:end"] > .btn:not([style*="margin-bottom"]), [style*="align-items:flex-end"] > .btn:not([style*="margin-bottom"]) { margin-bottom: 12px; min-height: 44px; box-sizing: border-box; }
/* checkboxes and radios follow the app teal instead of the native blue */
input[type="checkbox"], input[type="radio"] { accent-color: #0F766E; width: 18px; height: 18px; }
/* dark mode: active chips keep the primary fill, and every input follows the dark surface (the POS search and payment inputs were white) */
[data-theme="dark"] .rc-k.active, [data-theme="dark"] .rc-p.active, [data-theme="dark"] .btn.ghost.active { background: var(--primary) !important; color: #fff !important; border-color: var(--primary) !important; }
[data-theme="dark"] input:not([type=checkbox]):not([type=radio]):not([type=range]), [data-theme="dark"] select, [data-theme="dark"] textarea { background-color: var(--surface-2); color: var(--text); border-color: var(--border); }
[data-theme="dark"] input::placeholder { color: var(--muted, #9a9a9a); }
/* dark mode: native scrollbars and form controls go dark, status colors get readable on dark surfaces */
[data-theme="dark"] { color-scheme: dark; }
[data-theme="dark"] .badge.ok { background: rgba(80,200,120,.18); color: #6fe39a; }
[data-theme="dark"] .badge.err { background: rgba(255,99,99,.18); color: #ff8a8a; }
[data-theme="dark"] .badge.warn { background: rgba(255,170,70,.18); color: #ffb866; }
/* dashboard sparkline keeps a fixed height on wide cards (it scaled with the card width and left a tall empty block) */
.dl-card > svg { height: 34px; max-height: 34px; width: 100%; }
/* v94: slim visible scrollbar for the side menu; "More" tab on phone */
#sidebar { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
#bottomnav .nav-item { min-width: 0; }
#bottomnav .nav-item span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; text-align: center; }
#btn-resume:disabled, #btn-resume[disabled] { opacity: .8; color: var(--text); }
@media (max-width: 900px) { html, body { overflow-x: hidden; max-width: 100%; } #screen { overflow-x: hidden; } }

/* v107: activation screen theme + toggle, password eye */
#activation-overlay .card { position: relative; }
#activation-overlay .ac-theme { position: absolute; top: 12px; left: 12px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); }
#activation-overlay .ac-theme svg { width: 20px; height: 20px; display: block; }
#activation-overlay .ac-theme:focus-visible { outline: 2px solid #0E7490; outline-offset: 2px; }
[data-theme="dark"] #activation-overlay .card { background: #14233A; color: #E6EEF8; }
[data-theme="dark"] #activation-overlay .card h2 { color: #E6EEF8; }
[data-theme="dark"] #activation-overlay .card input, [data-theme="dark"] #activation-overlay .card textarea { background: #0B1830; color: #E6EEF8; border-color: #2B4468; }
[data-theme="dark"] #activation-overlay .card .btn:not(.primary):not(#ac-wa) { background: #1B3050; color: #E6EEF8; border-color: #2B4468; }
[data-theme="dark"] #activation-overlay .card label { color: #C9D6E8; }
html:not([data-theme="dark"]) #activation-overlay { background: #E8F1F4; }
.pw-wrap { position: relative; display: block; }
.pw-wrap > input { width: 100%; padding-inline-start: 50px; }
.pw-eye { position: absolute; inset-inline-start: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; background: transparent; color: var(--text-2); border-radius: 8px; }
.pw-eye:hover { background: var(--surface-2); color: var(--text); }
.pw-eye:focus-visible { outline: 2px solid #0E7490; outline-offset: 1px; }
.pw-eye svg { width: 20px; height: 20px; display: block; }
/* v107: product tiles and invoice lines never cut names */
.pos-product { justify-content: flex-start; overflow: hidden; height: auto; align-self: stretch; }
.pos-product .p-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; line-height: 1.3; max-width: 100%; }
.pos-product .p-price, .pos-product .p-stock { margin-top: auto; }
.pos-product .p-name + .p-price { margin-top: auto; }
.cl-name { overflow-wrap: anywhere; overflow: visible; }
.modal td:first-child, .modal-body td:first-child { white-space: normal; overflow-wrap: anywhere; min-width: 120px; }
@media (max-width: 600px) {
  .cl-head { display: none; }
  .cl-grid { grid-template-columns: 24px minmax(0, 1fr) auto 44px; grid-template-areas: "n name name rm" "n qty tot tot"; gap: 8px 8px; align-items: center; padding: 8px 6px; }
  .cl-grid .cl-n { grid-area: n; align-self: start; padding-top: 4px; }
  .cl-grid .cl-bc { display: none; }
  .cl-grid .cl-name { grid-area: name; min-width: 0; font-size: 14px; }
  .cl-grid [data-rm] { grid-area: rm; align-self: start; }
  .cl-grid .qty-ctl { grid-area: qty; justify-self: start; }
  .cl-grid .cl-tot { grid-area: tot; text-align: end; font-size: 15px; }
}

#activation-overlay .card textarea { display: block; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; line-height: 1.5; }
#activation-overlay .card h2, #activation-overlay .card > p { padding-inline-start: 0; }
@media (max-width: 600px) { #activation-overlay .card h2 { margin-inline-end: 0; } }
#theme-toggle { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }

/* v111: POS layout v4 - top half: customer/discount/net (right) + payment & numpad (left); bottom half: invoice */
.pos-v4 { display: grid; grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr); gap: 10px; height: calc(100vh - 128px); min-height: 620px; align-items: stretch; }
.pos-v4 > .card, .pos-v4 .pos-top > .card { min-height: 0; overflow: hidden; padding: 10px 12px; }
.pos-v4 .pos-find { display: grid; grid-template-columns: minmax(220px, 340px) minmax(0, 1fr); grid-template-areas: "s c" "p p"; gap: 6px 10px; align-items: center; }
.pos-v4 .pos-find .search-bar { grid-area: s; margin: 0; }
.pos-v4 .pos-find .pos-cats { grid-area: c; margin: 0; min-width: 0; overflow-x: auto; white-space: nowrap; display: flex; gap: 6px; }
.pos-v4 .pos-find .pos-products { grid-area: p; display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; max-height: none; min-height: 0; margin: 0; padding: 2px 2px 6px; }
.pos-v4 .pos-find .pos-product { flex: 0 0 132px; min-height: 76px; height: auto; padding: 6px; }
.pos-v4 .pos-find .pos-product .p-name { font-size: 13.5px; -webkit-line-clamp: 2; line-clamp: 2; }
.pos-v4 .pos-top { display: grid; grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr); gap: 10px; min-height: 0; }
.pos-v4 .pos-sum { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.pos-v4 .pos-sum .field { margin: 0; }
.pos-v4 .pos-sum .field label { margin-bottom: 2px; }
.pos-v4 .pos-sum .totals-row { padding: 3px 0; }
.pos-v4 .pos-sum .totals-row.grand { padding-top: 6px; margin-top: 2px; font-size: 22px; }
.pos-v4 .paid-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; margin: 4px 0; }
.pos-v4 #btn-denoms { min-height: 40px; margin-top: auto; }
.pos-v4 .pos-act { display: grid; grid-template-columns: minmax(0, 1fr) 232px; gap: 10px; align-items: start; overflow-y: auto; }
.pos-v4 .pos-act .pay-actions { grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 0; }
.pos-v4 .pos-act .pay-actions-2 { margin-top: 6px; grid-template-columns: 1fr 1fr; }
.pos-v4 .pos-act .btn-lg { min-height: 40px; font-size: 13.5px; padding: 0 6px; }
.pos-v4 .pos-act #pay-cash { min-height: 52px; font-size: 20px; }
.pos-v4 .pos-act .numpad { margin-top: 0; gap: 6px; }
.pos-v4 .pos-act .np-key { min-height: 38px !important; font-size: 17px; }
.pos-v4 .pos-act .np-mode { min-height: 30px !important; }
.pos-v4 .pos-inv { display: flex; flex-direction: column; }
.pos-v4 .pos-inv .inv-box { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; margin: 0 0 6px; }
.pos-v4 .inv-items { flex: 1 1 auto; max-height: none; min-height: 0; gap: 6px; overflow-y: auto; overflow-x: hidden; }
.pos-v4 .inv-box .cl-head { font-size: 13.5px; padding: 6px 8px; }
.pos-v4 .cl-grid { grid-template-columns: 30px 110px minmax(120px, 1fr) 160px 100px 48px; gap: 8px; }
.pos-v4 .cart-line.cl-grid { padding: 6px 10px; min-height: 56px; border-radius: 12px; }
.pos-v4 .cl-name { font-size: 15px; } .pos-v4 .cl-tot { font-size: 16px; }
.pos-v4 .cl-grid .qty-ctl button { width: 40px; height: 40px; font-size: 20px; border-radius: 10px; }
.pos-v4 .cl-grid .qty-ctl input { width: 52px; height: 40px; font-size: 16px; font-weight: 700; border-radius: 10px; }
.pos-v4 .cl-grid .btn-trash { width: 42px; min-width: 42px; height: 40px; min-height: 40px !important; border-radius: 10px; }
.pos-v4 .kbd-hint { display: block; font-size: 11px; margin-top: 0; }
#screen:has(.pos-v4) .screen-title { display: inline-block; }
#screen:has(.pos-v4) .screen-sub + div { display: inline-flex !important; margin: 0 24px 0 0 !important; vertical-align: middle; align-items: center; }
#screen:has(.pos-v4) .screen-sub + div .field { display: flex; flex-direction: row; align-items: center; gap: 8px; min-width: 0 !important; }
#screen:has(.pos-v4) .screen-sub + div .field label { margin: 0; white-space: nowrap; }
@media (max-width: 1100px) {
  .pos-v4 { height: auto; grid-template-rows: none; }
  .pos-v4 .pos-top { grid-template-columns: 1fr; }
  .pos-v4 .pos-act { grid-template-columns: 1fr; }
  .pos-v4 .pos-act .numpad { max-width: 360px; justify-self: center; width: 100%; }
  .pos-v4 > .card, .pos-v4 .pos-top > .card { overflow: visible; }
  .pos-v4 .inv-items { max-height: 380px; }
  .pos-v4 .pos-find { grid-template-columns: 1fr; grid-template-areas: "s" "c" "p"; }
  .pos-v4 .cl-grid { grid-template-columns: 24px 72px minmax(70px, 1fr) 148px 78px 44px; gap: 6px; }
}
/* held invoice list: visible selection */
.held-row { cursor: pointer; }
.held-row:focus-visible { outline: 2px solid #0E7490; outline-offset: -2px; }
.held-radio { width: 36px; text-align: center; }
.held-dot { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--text-2); border-radius: 50%; vertical-align: middle; box-sizing: border-box; }
tr.held-row.sel td { background: rgba(14, 116, 144, .16); border-bottom-color: #0E7490; font-weight: 700; }
tr.held-row.sel .held-dot { border-color: #0E7490; background: radial-gradient(circle, #0E7490 0 45%, transparent 50%); }
.dn-row { display: grid; grid-template-columns: 90px 1fr 100px; gap: 10px; align-items: center; margin-bottom: 6px; }
.dn-row label { font-weight: 700; }
.dn-row input { text-align: center; min-height: 40px; }
.dn-sub { text-align: end; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  .pos-v4 .cl-grid { grid-template-columns: 24px minmax(0, 1fr) auto 44px; }
  .pos-v4 .cart-line.cl-grid { min-height: 0; }
  .pos-v4 .cl-grid .qty-ctl button { width: 38px; height: 38px; }
  .pos-v4 .cl-grid .qty-ctl input { width: 46px; height: 38px; }
  .pos-v4 .pos-find .pos-product { flex-basis: 120px; }
}

/* v111b: compact so top half fits without clipping */
.pos-v4 { grid-template-rows: auto auto minmax(190px, 1fr); height: calc(100vh - 112px); min-height: 600px; gap: 8px; }
.pos-v4 > .card, .pos-v4 .pos-top > .card { padding: 8px 10px; }
.pos-v4 .pos-find .pos-product { flex: 0 0 124px; min-height: 58px; padding: 4px 6px; gap: 2px; }
.pos-v4 .pos-find .pos-product .p-stock { display: none; }
.pos-v4 .pos-find .pos-product .p-price { font-size: 14px; }
.pos-v4 .pos-find .pos-product .p-name { font-size: 13px; }
.pos-v4 .pos-top { align-items: stretch; }
.pos-v4 .pos-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; align-content: start; overflow: visible; }
.pos-v4 .pos-sum > .field:first-child { grid-column: 1 / -1; }
.pos-v4 .pos-sum > .totals-row, .pos-v4 .pos-sum > .totals-row.grand { grid-column: 1 / -1; }
.pos-v4 .pos-sum .paid-row { display: contents; }
.pos-v4 .pos-sum .paid-in { order: 0; }
.pos-v4 .pos-sum .paid-in input, .pos-v4 .pos-sum .field input { min-height: 38px; }
.pos-v4 .pos-sum .paid-change { align-self: end; display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 10px; background: var(--surface-2); min-height: 38px; }
.pos-v4 #btn-denoms { margin-top: 0; min-height: 38px; align-self: end; }
.pos-v4 .pos-sum .totals-row.grand { font-size: 20px; }
.pos-v4 .pos-act .pay-actions-2 { grid-template-columns: 1fr 1fr 1fr; }
.pos-v4 .pos-act .btn-lg { min-height: 36px; font-size: 13px; }
.pos-v4 .pos-act #pay-cash { min-height: 46px; }
.pos-v4 .pos-act .np-key { min-height: 34px !important; }
@media (max-width: 1100px) { .pos-v4 { grid-template-rows: none; height: auto; } .pos-v4 .pos-sum { grid-template-columns: 1fr 1fr; } }
/* v111c: final fit - top half 252px, invoice takes the rest (bottom half) */
.pos-v4 { grid-template-rows: auto 252px minmax(170px, 1fr); height: calc(100vh - 118px); min-height: 560px; }
.pos-v4 .pos-find { padding: 6px 10px; row-gap: 4px; }
.pos-v4 .pos-find .pos-product { min-height: 52px; }
.pos-v4 .pos-sum { grid-template-columns: 1fr 1fr; gap: 4px 10px; padding: 8px 10px; align-content: start; }
.pos-v4 .pos-sum > .field:first-child { order: 0; grid-column: 1 / -1; }
.pos-v4 .pos-sum > .field:first-child > div[style] select, .pos-v4 .pos-sum > .field:first-child .btn { min-height: 36px; }
.pos-v4 #pos-cust-info { font-size: 11px; margin-top: 2px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-v4 .pos-sum > .field:nth-child(2) { order: 1; grid-column: 1; }
.pos-v4 .pos-sum .paid-in { order: 2; grid-column: 2; }
.pos-v4 .pos-sum > .totals-row:nth-child(3) { order: 3; grid-column: 1; align-self: end; font-size: 14px; }
.pos-v4 .pos-sum > .totals-row.grand { order: 4; grid-column: 2; border-top: 0; margin: 0; padding: 0; font-size: 20px; align-self: end; }
.pos-v4 .pos-sum > #t-taxrow { order: 5; grid-column: 1 / -1; }
.pos-v4 .pos-sum .paid-change { order: 6; grid-column: 1; }
.pos-v4 #btn-denoms { order: 7; grid-column: 2; }
.pos-v4 .pos-sum .field label, .pos-v4 .paid-in label { font-size: 12px; margin-bottom: 1px; }
.pos-v4 .pos-sum .field input, .pos-v4 .pos-sum .paid-in input { min-height: 36px; padding-block: 4px; }
.pos-v4 .pos-act { padding: 8px 10px; }
.pos-v4 .pos-act #pay-cash { min-height: 44px; }
.pos-v4 .pos-act .btn-lg { min-height: 34px; }
.pos-v4 .pos-act .np-key { min-height: 33px !important; }
.pos-v4 .pos-act .pay-actions-2 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 1100px) { .pos-v4 { grid-template-rows: none; height: auto; } .pos-v4 .pos-top { grid-template-rows: none; } }
.pos-v4 { grid-template-rows: auto 300px minmax(150px, 1fr); }
.pos-v4 .pos-sum { overflow: auto; }
.pos-v4 .pos-sum .paid-change { min-height: 40px; }

.pos-product:focus-visible, .pos-product:focus { outline: 3px solid #0e9aa7; outline-offset: 2px; box-shadow: 0 0 0 5px rgba(14,154,167,.25); transform: translateY(-1px); }
#lic-card #lic-code-box { margin-top: 8px; padding: 10px; border-radius: 10px; border: 1px solid var(--border,#cfd8e6); font-family: monospace; direction: ltr; text-align: center; word-break: break-all; user-select: all; font-size: 13px; }

.numpad .np-fns { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.numpad .np-fn { min-height: 34px; display: flex; align-items: center; justify-content: center; text-align: center; border-radius: 10px; font-weight: 700; cursor: pointer; font-family: inherit; border: 1px solid var(--border,#cfd8e6); background: var(--surface,#fff); }
.numpad .np-clear { color: #c62828; }
.numpad .np-ok { background: #0e9aa7; color: #fff; border-color: #0e9aa7; }

/* v112: layouts. prodbox is transparent in v4 and classic */
.pos-v4 .pos-prodbox { display: contents; }
/* ---- v5: search on top, then products | customer | payment, invoice below ---- */
.pos-v5 { display: grid; direction: rtl; grid-template-columns: 1.25fr 1fr 1fr; grid-template-areas: "srch srch srch" "prod cust pay" "inv inv inv"; grid-template-rows: auto minmax(300px, 46vh) minmax(170px, 1fr); gap: 10px; align-items: stretch; height: calc(100vh - 118px); min-height: 640px; }
.pos-v5 .pos-find, .pos-v5 .pos-top { display: contents; }
.pos-v5 .search-bar { grid-area: srch; }
.pos-v5 .pos-prodbox { grid-area: prod; display: flex; flex-direction: column; min-height: 0; background: var(--card,#fff); border: 1px solid var(--border,#d7dee8); border-radius: 14px; padding: 8px; }
.pos-v5 .pos-prodbox .pos-products { flex: 1 1 auto; min-height: 0; overflow-y: auto; max-height: none; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; align-content: start; margin-top: 8px; }
.pos-v5 .pos-prodbox .pos-product { min-height: 66px; padding: 4px 6px; gap: 2px; }
.pos-v5 .pos-prodbox .p-name { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pos-v5 .pos-prodbox .p-price { font-size: 14px; }
.pos-v5 .pos-prodbox .p-stock { display: none; }
.pos-v5 .pos-sum { grid-area: cust; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; min-height: 0; padding: 10px; }
.pos-v5 .pos-sum .paid-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; }
.pos-v5 .pos-sum .paid-change { min-height: 40px; display: flex; flex-direction: column; justify-content: center; text-align: center; border-radius: 10px; background: var(--surface-2, rgba(127,127,127,.08)); padding: 2px 6px; }
.pos-v5 #btn-denoms { min-height: 40px; }
.pos-v5 .pos-act { grid-area: pay; overflow-y: auto; min-height: 0; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.pos-v5 .pos-act .pay-actions { grid-template-columns: 1fr 1fr; gap: 6px; }
.pos-v5 .pos-act .pay-actions-2 { grid-template-columns: 1fr 1fr 1fr; }
.pos-v5 .pos-act .btn-lg { min-height: 32px; font-size: 12.5px; padding: 2px 4px; }
.pos-v5 .pos-act #pay-cash { min-height: 38px; font-size: 14px; }
.pos-v5 .pos-act .numpad { gap: 4px; }
.pos-v5 .pos-act .np-key { min-height: 28px !important; font-size: 14px; padding: 0; }
.pos-v5 .pos-act .np-mode { min-height: 28px; font-size: 12px; padding: 0 4px; }
.pos-v5 .pos-act .np-fn { min-height: 28px; }
.pos-v5 .pos-inv { grid-area: inv; min-height: 0; display: flex; flex-direction: column; }
.pos-v5 .pos-inv .inv-box { flex: 1 1 auto; min-height: 0; overflow: auto; }
/* ---- classic (pre-v111 arrangement): products + payment on one side, invoice with customer below it on the other ---- */
.pos-cl { display: grid; direction: rtl; grid-template-columns: minmax(0, 1fr) 420px; grid-template-areas: "find inv" "act sum"; gap: 12px; align-items: start; }
.pos-cl .pos-top { display: contents; }
.pos-cl .pos-find { grid-area: find; }
.pos-cl .pos-prodbox { display: block; }
.pos-cl .pos-products { max-height: calc(100vh - 470px); min-height: 120px; overflow-y: auto; }
.pos-cl .pos-act { grid-area: act; }
.pos-cl .pos-inv { grid-area: inv; }
.pos-cl .pos-sum { grid-area: sum; }
.pos-cl .pos-act .numpad { margin-top: 8px; }
.pos-cl .pos-act .pay-actions { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .pos-v5, .pos-cl { display: flex; flex-direction: column; height: auto; } .pos-v5 .pos-prodbox .pos-products { max-height: 320px; } .pos-v5 .pos-find, .pos-v5 .pos-top { display: contents; } }
.pos-v5 { grid-template-rows: auto 450px minmax(230px, auto); height: auto; min-height: 0; }
.pos-v5 .pos-sum, .pos-v5 .pos-act { overflow: visible; }
.pos-v5 .pos-sum .field:first-child > div { flex-wrap: nowrap; }
.pos-v5 #pos-cust-add { white-space: nowrap; padding-inline: 8px; min-height: 44px; }
.pos-v5 #pos-cust-info { font-size: 11px; }
.pos-v5 .pos-sum .paid-row { grid-template-columns: 1fr; }
.pos-v5 .pos-act .np-key { min-height: 34px !important; }
.pos-v5 .pos-prodbox .pos-products { overflow-y: auto; }
#pos-layout { margin-inline-start: auto; }
.pos-v5 { grid-template-rows: auto 480px minmax(230px, auto); } .pos-v5 .pos-prodbox .pos-products { align-content: start; }
.pos-cl { grid-template-columns: minmax(0, 1fr) 560px; } .pos-cl .pos-inv .inv-box { overflow-x: auto; }

/* v112b: denominations inputs and paid input match the discount field */
.dn-row.field { margin: 0 0 6px; }
.dn-row.field label { margin: 0; }
.dn-row.field input, #discount, #pos-paid { box-sizing: border-box; width: 100%; min-height: 44px !important; padding: 6px 12px !important; border-radius: 10px; text-align: center; font-family: inherit; font-size: 15px !important; font-weight: 600 !important; }
.pos-grid .paid-in label, .pos-grid .field > label { font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 2px; display: block; }
.pos-grid .paid-in { margin: 0; }
/* v113: pressed feel, dark-safe surfaces, denoms button under paid */
.pos-v5 .pos-prodbox { background: var(--surface); border-color: var(--border); }
.np-key, .np-fn, .np-mode, .pos-product, .cat-chip, .pos-grid .btn, #btn-denoms { transition: transform .08s ease, box-shadow .08s ease, background-color .08s ease, filter .08s ease; -webkit-tap-highlight-color: transparent; }
.np-key:active, .np-fn:active, .np-mode:active, .pos-product:active, .cat-chip:active, .pos-grid .btn:active, #btn-denoms:active, .np-key.pressed, .np-fn.pressed { transform: translateY(2px) scale(.96); box-shadow: inset 0 3px 8px rgba(0,0,0,.28) !important; filter: brightness(.9); }
[data-theme="dark"] .np-key:active, [data-theme="dark"] .np-fn:active, [data-theme="dark"] .pos-product:active, [data-theme="dark"] .pos-grid .btn:active { filter: brightness(1.3); box-shadow: inset 0 3px 8px rgba(0,0,0,.6) !important; }
.pos-v5 .pos-sum { justify-content: flex-start; }
.pos-v5 .pos-sum .paid-row { order: 5; margin-top: 0; }
.pos-v5 #btn-denoms { order: 6; margin-top: 2px; }
.pos-v5 .pos-sum #pos-cust-info:empty { display: none; }
.pos-v5 .pos-sum .field { margin: 0; }
[data-theme="dark"] .pos-product:focus, [data-theme="dark"] .pos-product:focus-visible { outline-color: #4dd0e1; background: rgba(77,208,225,.14); }
[data-theme="dark"] .np-mode.on, [data-theme="dark"] .cat-chip.on { color: #fff; }
[data-theme="dark"] .np-clear { color: #ff8a80; }
[data-theme="dark"] .numpad .np-fn:not(.np-ok) { background: var(--surface-2); color: var(--text); }
[data-theme="dark"] #cart-lines .cart-line.sel { background: rgba(0,120,215,.28); }
[data-theme="dark"] tr.held-row.sel td { background: rgba(34,211,238,.18); color: #fff; }
#ret-body > .screen-title { display: none; }

/* v116: one unified field system for the whole app (radius token + focus state, light and dark) */
:root { --field-radius: 12px; --field-ring: 0 0 0 3px rgba(14, 154, 167, .28); --field-focus: #0E9AA7; }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]):not([type=hidden]):not([type=button]):not([type=submit]),
select,
textarea { border-radius: var(--field-radius); border: 1px solid var(--border); background-color: var(--surface); color: var(--text); font-family: inherit; transition: border-color .12s ease, box-shadow .12s ease; }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]):not([type=hidden]):not([type=button]):not([type=submit]),
select { text-align: center; text-align-last: center; }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]):not([type=hidden]):not([type=button]):not([type=submit]):focus,
select:focus,
textarea:focus { outline: none; border-color: var(--field-focus); box-shadow: var(--field-ring); }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]):not([type=hidden]):not([type=button]):not([type=submit]):disabled,
select:disabled,
textarea:disabled { opacity: .6; cursor: not-allowed; }
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea { color-scheme: dark; }
[data-theme="dark"] input::placeholder, [data-theme="dark"] textarea::placeholder { color: rgba(255,255,255,.45); }
.pw-wrap input { padding-inline-end: 44px; }
/* v117: neighbouring panels share one height (no margin eating the stretch) */
.pur-v2, .pos-bottom, .pos-cl { align-items: stretch; }
.pur-v2 > .card, .pos-v5 > .card, .pos-v5 .pos-top > .card, .pos-cl > .card, .pos-cl .pos-top > .card, .pos-v4 .pos-top > .card, .pos-bottom > * { margin-bottom: 0; }
.pur-v2 > .card { height: 100%; box-sizing: border-box; }
.pos-v5 .pos-sum, .pos-v5 .pos-act, .pos-v5 .pos-prodbox { box-sizing: border-box; height: 100%; margin: 0; }
.pos-v5 .pos-sum, .pos-v5 .pos-act { overflow-y: auto; }
.pos-v5 .pos-act { justify-content: space-between; }
.pos-cl .pos-act, .pos-cl .pos-sum, .pos-cl .pos-find, .pos-cl .pos-inv { height: 100%; box-sizing: border-box; }
.row-eq, .cards-eq { display: flex; gap: 12px; align-items: stretch; } .row-eq > .card, .cards-eq > .card { margin-bottom: 0; }

/* ===== Thermal receipt (matches original ReceiptPrinterService) ===== */
.rcpt-doc { font-family: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif; direction: rtl; background: #fff; color: #000; box-sizing: border-box; }
.rcpt-doc.p80 { width: 300px; padding: 12px 8px 14px; }
.rcpt-doc.p58 { width: 210px; padding: 8px 4px 10px; }
.rcpt-doc .rc-head { background: #000; color: #fff; font-size: 17px; font-weight: 900; text-align: center; padding: 7px 0; border-radius: 6px; margin-bottom: 4px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rcpt-doc .rc-tx { margin: 1.5px 0; line-height: 1.25; }
.rcpt-doc .rc-row { display: grid; grid-template-columns: 1fr 1.6fr; margin: 1px 0; font-size: 10.5px; font-weight: 600; }
.rcpt-doc .rc-row.b { font-weight: 700; }
.rcpt-doc .rc-row .v { text-align: left; font-weight: 400; }
.rcpt-doc .rc-row.b .v { font-weight: 700; }
.rcpt-doc .rc-dash { border-top: 1px dashed #000; margin: 4px 0; }
.rcpt-doc .rc-solid { border-top: 1px solid #000; margin: 3px 0; }
.rcpt-doc .rc-it { display: grid; grid-template-columns: 2.2fr .8fr 1fr 1.2fr; font-size: 10px; margin: 1.5px 0; gap: 2px; }
.rcpt-doc .rc-it.h { font-size: 10.5px; font-weight: 700; }
.rcpt-doc .rc-it .n { text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.rcpt-doc .rc-it.h .n { font-weight: 700; }
.rcpt-doc .rc-it .c { text-align: center; }
.rcpt-doc .rc-it .l { text-align: left; font-weight: 700; }
.rcpt-doc .rc-box { border: 1.5px solid #000; border-radius: 4px; padding: 5px 8px; margin: 4px 0 6px; display: flex; justify-content: center; align-items: center; gap: 16px; }
.rcpt-doc .rc-box .t { font-size: 12.5px; font-weight: 700; }
.rcpt-doc .rc-box .n { font-size: 15px; font-weight: 900; }
@media print { .print-only.rcpt-doc { padding: 12px 8px 14px; font-size: 10px; } .print-only.rcpt-doc.p58 { padding: 8px 4px 10px; } .print-only.rcpt-doc.p80 { width: 300px; } .print-only.rcpt-doc.p58 { width: 210px; } }
@media print { .print-only.lbl-doc { padding: 0; } }
