/* بيع / شراء / أرجاع: the invoice editor, measured from the previous system's
 * list page (white page, 10px cards, one row per product, a bar fixed at the
 * bottom). Class names follow that system so the two stay easy to compare. */
.editor.bl_page { background: #fff; padding-bottom: 96px; display: flex; flex-direction: column; min-height: calc(100vh - 96px); }
.editor.bl_page > .bl_wrap { width: 100%; }
.bl_page .pointer { cursor: pointer; }
.bl_page .w100 { width: 100%; }
.bl_page [hidden] { display: none !important; }
.bl_wrap { max-width: 1500px; margin: 0 auto; padding: 4px 12px 24px; text-align: start; }

/* tools on the sub-tab bar */
.sl_nav_tools { display: flex; align-items: center; gap: 6px; }
.small_btn_nav { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 8px;
  border: 1px solid #e8eaed; border-radius: 10px; background: #fff; color: #6b7280; font-size: 12px; cursor: pointer;
  transition: border-color 0.15s, color 0.15s, box-shadow 0.15s; }
.small_btn_nav:hover { border-color: #d6dae1; color: #111827; box-shadow: 0 4px 14px rgba(16, 24, 40, 0.09); }
.small_btn_nav.on { background: #111827; border-color: #111827; color: #fff; }
.exchange-rate-control { padding: 1px; overflow: hidden; cursor: default; }
.exchange-rate-control:hover { box-shadow: none; }
.exchange-rate-label { display: flex; align-items: center; min-height: 28px; padding: 0 10px; border-inline-end: 1px solid #e8eaed;
  color: #9aa2ad; font-size: 11px; font-weight: 600; white-space: nowrap; }
.exchange-rate-control input { width: 90px; min-height: 28px; border: 0; padding: 0 6px; background: #fff; color: #111827;
  font: inherit; font-size: 12px; font-weight: 600; text-align: center; outline: 0; }
.cur-type-switch { display: flex; align-items: center; border: 1px solid #e8eaed; border-radius: 10px; overflow: hidden; }
.cur-type-switch button { border: 0; background: #fff; color: #6b7280; font: inherit; font-size: 11px; font-weight: 700; padding: 0 12px; min-height: 30px; cursor: pointer; }
.cur-type-switch button + button { border-inline-start: 1px solid #e8eaed; }
.cur-type-switch button:hover { background: #f5f6f8; }
.cur-type-switch button.selected_hov_btn_price { background: #111827; color: #fff; }

/* customer / supplier */
.bl_head { display: flex; align-items: center; gap: 8px; }
.bl_supplier { position: relative; flex: 1 1 0; min-width: 0; }
.bl_supplier input { width: 100%; height: 40px; border: 1px solid #e8eaed; border-radius: 10px; background: #fff; padding: 0 36px 0 40px;
  font: inherit; font-size: 13px; font-weight: 600; color: #111827; outline: 0; transition: border-color 0.15s, box-shadow 0.15s; }
[dir="ltr"] .bl_supplier input { padding: 0 40px 0 36px; }
.bl_supplier input:focus { border-color: #d6dae1; box-shadow: 0 4px 14px rgba(16, 24, 40, 0.09); }
.bl_supplier > i { position: absolute; inset-inline-start: 13px; top: 20px; transform: translateY(-50%); z-index: 1; color: #b0b5bd; font-size: 12px; pointer-events: none; }
.bl_mic { position: absolute; z-index: 1; inset-inline-end: 6px; top: 6px; width: 28px; height: 28px; border: 0; border-radius: 8px; background: none;
  color: #b0b5bd; font-size: 12px; cursor: pointer; }
.bl_mic:hover { background: #f5f6f8; color: #111827; }
.bl_supplier .pa { position: absolute; top: 46px; inset-inline: 0; z-index: 30; }
.bl_btn { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border: 1px solid #e8eaed; border-radius: 10px;
  background: #fff; color: #374151; font: inherit; font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.bl_btn:hover { border-color: #d6dae1; color: #111827; box-shadow: 0 4px 14px rgba(16, 24, 40, 0.09); }
.bl_btn i { font-size: 11px; color: #9aa2ad; }
.sl_btn_group { display: flex; gap: 6px; }
.client-search-results { max-height: 420px; display: flex; flex-direction: column; overflow: hidden; border: 1px solid #e8eaed; border-radius: 12px;
  background: #fff; box-shadow: 0 12px 30px rgba(16, 24, 40, 0.16); }
.client-search-list { overflow-y: auto; padding: 4px; }
.client-search-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 9px; cursor: pointer; }
.client-search-row:hover, .client-search-active { background: #f5f6f8; }
.client-search-avatar { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
  background: #f3f4f6; color: #6b7280; font-size: 12px; }
.client-search-active .client-search-avatar { background: #111827; color: #fff; }
.client-search-info { flex: 1 1 0; min-width: 0; }
.client-search-name { font-size: 12.5px; font-weight: 700; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-search-sub { margin-top: 1px; font-size: 11px; font-weight: 500; color: #9aa2ad; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-search-debts { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.client-search-debt { height: 20px; padding: 0 7px; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px; background: #f3f4f6;
  color: #9aa2ad; font-size: 10.5px; font-weight: 700; white-space: nowrap; }
/* the owner's rule: he owes us = green, no sign; we owe him = red with a minus */
.client-search-debt.pos { background: #e8f6ee; color: #0b7d45; }
.client-search-debt.neg { background: #fdeceb; color: #b91c1c; }
.client-search-debt small { font-size: 9.5px; font-weight: 600; opacity: 0.75; }
.client-search-empty { padding: 22px 12px; text-align: center; font-size: 12px; font-weight: 600; color: #9aa2ad; }
.client-search-empty i { display: block; margin-bottom: 8px; font-size: 20px; color: #d6dae1; }

/* quick chips */
.bl_quick { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.bl_chip { border: 1px solid #e8eaed; border-radius: 9px; background: #fff; color: #6b7280; font: inherit; font-size: 11px; font-weight: 700;
  padding: 5px 10px; white-space: nowrap; cursor: pointer; display: inline-flex; align-items: center; }
.bl_chip i { margin-inline-end: 6px; font-size: 10px; color: #9aa2ad; }
.bl_chip:hover { background: #f5f6f8; color: #111827; }
.bl_src { display: inline-flex; align-items: stretch; height: 28px; margin-inline-start: auto; border: 1px solid #e8eaed; border-radius: 9px; background: #fff; overflow: hidden; }
.bl_src span { display: flex; align-items: center; padding: 0 9px; border-inline-end: 1px solid #e8eaed; color: #9aa2ad; font-size: 11px; font-weight: 600; white-space: nowrap; }
.bl_src button { border: 0; background: none; color: #6b7280; font: inherit; font-size: 11px; font-weight: 700; padding: 0 10px; white-space: nowrap; cursor: pointer; }
.bl_src button:hover { background: #f5f6f8; color: #111827; }
.bl_src button.on { background: #111827; color: #fff; }
.bl_hint { font-size: 11px; font-weight: 500; color: #9aa2ad; }
.bl_edit { margin-bottom: 10px; padding: 9px 12px; border-radius: 10px; background: #111827; color: #fff; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; gap: 8px; }
.bl_edit .bl_chip { margin-inline-start: auto; }

/* cards */
.bl_sec { margin-top: 14px; border: 1px solid #e8eaed; border-radius: 10px; background: #fff; padding: 10px 12px 12px; }
.bl_sec_head { display: flex; align-items: center; gap: 7px; padding-bottom: 10px; }
.bl_sec_ico { width: 22px; height: 22px; flex-shrink: 0; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center;
  background: #f3f4f6; color: #6b7280; font-size: 10px; }
.bl_sec_name { font-size: 12px; font-weight: 700; color: #111827; white-space: nowrap; }
.bl_sec_sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 500; color: #9aa2ad; }
.bl_count { margin-inline-start: auto; min-width: 17px; height: 17px; padding: 0 5px; flex: 0 0 auto; border-radius: 9px; background: #111827;
  color: #fff; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.bl_count.zero { background: #f3f4f6; color: #b0b5bd; }
.bl_count.sl_count { margin-inline-start: 0; }
.sl_pro_head { flex-wrap: wrap; }
.sl_pro_tools { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.sl_ptype { display: flex; border: 1px solid #e8eaed; border-radius: 9px; overflow: hidden; }
.sl_ptype button { height: 28px; border: 0; background: #fff; color: #6b7280; font: inherit; font-size: 11px; font-weight: 700; padding: 0 11px; cursor: pointer; }
.sl_ptype button + button { border-inline-start: 1px solid #e8eaed; }
.sl_ptype button:hover { background: #f5f6f8; color: #111827; }
.sl_ptype button.selected_hov_btn_price { background: #111827; color: #fff; }
.price-mobile { display: none; height: 30px; border: 1px solid #e8eaed; border-radius: 9px; padding: 0 8px; font: inherit; font-size: 12px; }
.hist-btns { display: flex; align-items: center; gap: 2px; }
.hist-btn { border: 0; background: transparent; color: #8a8a8a; font-size: 14px; padding: 4px 7px; border-radius: 5px; cursor: pointer; }
.hist-btn:disabled { color: #c9c9c9; cursor: default; }
.hist-btn:not(:disabled):hover { color: #4e73df; background: #f0f4ff; }

/* product rows (بيع / أرجاع) */
.grid-scroll { overflow-x: auto; }
.sl_grid_box { min-width: 760px; min-height: 160px; }
.ed .mg { position: relative; display: flex; align-items: center; min-height: 42px; border-bottom: 1px solid #eef0f2; transition: background 0.12s; }
.ed .mg:hover { background: #fafbfc; }
.ed .mg.warn { background: #fff7ed; }
.ed .mg .phalf { height: 38px; min-width: 0; border: 0; background: transparent; color: #111827; font: inherit; font-size: 12.5px; text-align: center; padding: 8px; outline: 0; }
.ed .mg .phalf:focus { background: #fff; outline: 1.5px solid #111827; outline-offset: -2px; border-radius: 6px; }
.ed .mg .phalf:disabled { background: transparent; color: #9aa2ad; }
.ed .mg select.phalf { padding: 0 6px; cursor: pointer; }
.ed .mg.entry select.phalf { cursor: default; }
.ed .sl_grid_box .mg > .phalf, .ed .sl_grid_box .mg > .price-wrap { flex: 1 1 0; }
.ed .sl_grid_box .mg > .counter { flex: 0 0 auto; min-width: 24px; color: #b0b5bd; font-size: 11px; font-weight: 600; padding: 8px 2px; }
.ed .sl_grid_box .mg > .name-wrap { flex: 3 1 0; min-width: 0; position: relative; }
.ed .sl_grid_box .mg > .row-actions { flex: 0 0 64px; }
.ed .mg .name-cell { width: 100%; text-align: start; padding-inline-end: 52px; }
.ed .mg .name-cell:disabled { color: #111827; font-weight: 600; }
.ed .mg .drag-handle { color: #d6dae1; font-size: 12px; padding: 0 8px; cursor: grab; }
.ed .mg .drag-handle:hover { color: #111827; }
.ed .mg.reorder-dragging { opacity: 0.5; border: 1px dashed #c8cdd5; background: #f3f4f6; }
.ed .mg.entry .drag-handle { visibility: hidden; }
.name-ico { position: absolute; top: 50%; transform: translateY(-50%); font-size: 13px; color: #b0b5bd; cursor: pointer; z-index: 2; }
.name-ico:hover { color: #111827; }
.name-ico.pick, .name-ico.eye { inset-inline-end: 8px; }
.price-wrap { position: relative; display: flex; }
.price-wrap .price-cell { width: 100%; }
.old-price { position: absolute; top: 2px; inset-inline-start: 6px; font-size: 10px; color: #999; text-decoration: line-through; white-space: nowrap; }
.grid-row-img { width: 34px; height: 34px; border-radius: 6px; flex-shrink: 0; margin: 0 4px; border: 1px solid #eee; display: inline-flex;
  align-items: center; justify-content: center; background: #f5f5f5; color: #bbb; overflow: hidden; }
.grid-row-img img { width: 100%; height: 100%; object-fit: cover; }
.row-actions { display: flex; align-items: center; justify-content: center; gap: 6px; }
.row-note-icon { color: #b9b9b9; font-size: 14px; cursor: pointer; }
.row-note-icon:hover { color: #555; }
.row-note-icon.fas { color: #e6a700; }
.row-del { color: #c4c9d0; font-size: 14px; cursor: pointer; }
.row-del:hover { color: #e53935; }
.price-warning-icon { color: #e67e22; font-size: 14px; cursor: help; }
.ed .mg .disc { color: #e5484d; }

/* drop-down of products while typing */
.ipp-dropdown { position: fixed; width: 430px; max-width: 92vw; max-height: 320px; overflow-y: auto; z-index: 10001;
  background: #fff; border: 1px solid #e8eaed; border-radius: 10px; box-shadow: 0 12px 30px rgba(16, 24, 40, 0.16); }
.ipp-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; cursor: pointer; border-bottom: 1px solid #f5f5f5; font-size: 12px; }
.ipp-row.on { background: #e8eeff; }
.ipp-row:hover { background: #f0f4ff; }
.ipp-star { color: #f5a623; font-size: 12px; flex-shrink: 0; cursor: pointer; }
.ipp-text { flex: 1; min-width: 0; }
.ipp-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 500; color: #111827; }
.ipp-code { font-size: 10px; color: #999; }
.ipp-price { color: #555; white-space: nowrap; }
.ipp-sep { color: #bbb; margin: 0 2px; }
.ipp-qty.ok { color: #28a745; } .ipp-qty.zero { color: #999; } .ipp-qty.neg { color: #e5484d; }
.ipp-inf { color: #9aa2ad; font-size: 11px; }
.ipp-empty { padding: 18px; text-align: center; color: #9aa2ad; font-size: 12px; }
mark.pp-hl { background: #fde68a; color: inherit; padding: 0 1px; border-radius: 2px; }

/* purchase grid */
.excel-grid-cols { display: grid; grid-template-columns: 22px 28px 72px minmax(130px, 1fr) 80px 86px 96px 104px 86px 86px 74px 80px 86px 24px; }
.ed-purchase .main-grid { min-width: 1130px; }
.excel-header { background: #fafbfc; border: 1px solid #eef0f2; border-radius: 8px 8px 0 0; position: sticky; top: 0; z-index: 2; }
.excel-header > div { display: flex; align-items: center; justify-content: center; padding: 6px 4px; font-size: 11px; font-weight: 600; line-height: 1.25;
  color: #6b7280; text-align: center; border-inline-start: 1px solid #eef0f2; overflow: hidden; }
.excel-header > div:first-child { border: 0; }
.ed-purchase .mg { display: grid; border: 1px solid #eef0f2; border-top: 0; min-height: 35px; }
.ed-purchase .mg > div { display: flex; align-items: center; min-width: 0; border-inline-start: 1px solid #eef0f2; }
.ed-purchase .mg > div:first-child { border: 0; }
.ed-purchase .mg .phalf { height: 34px; width: 100%; font-size: 12px; padding: 0 4px; }
.ed-purchase .mg .drag-handle { justify-content: center; padding: 0; }
.ed-purchase .mg .counter { justify-content: center; color: #b0b5bd; font-size: 11px; font-weight: 600; }
.ed-purchase .mg .exp-date { font-size: 11px; }
.ed-purchase .mg .exp-btn { color: #9aa2ad; font-size: 11px; }
.ed-purchase .mg .del-cell { justify-content: center; color: #c4c9d0; cursor: pointer; font-size: 12px; }
.ed-purchase .mg .del-cell:hover { color: #e53935; }
.cell-dropdown-wrap { position: relative; }
.cell-search-dropdown { position: fixed; z-index: 10001; background: #fff; border: 1px solid #e8eaed; box-shadow: 0 12px 30px rgba(16, 24, 40, 0.16);
  border-radius: 10px; padding: 4px; width: 380px; max-height: 350px; overflow-y: auto; }
.sdd-item { display: flex; align-items: center; width: 100%; border-radius: 8px; padding: 6px 8px; cursor: pointer; line-height: 20px; gap: 8px; }
.sdd-item.sdd-active, .sdd-item:hover { background: #f5f6f8; }
.sdd-img { width: 32px; height: 32px; border-radius: 4px; object-fit: cover; background: #eee; flex-shrink: 0; }
.sdd-info { flex: 1; min-width: 0; }
.sdd-name { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sdd-meta { font-size: 10px; color: #888; display: flex; gap: 6px; }

/* count totals */
.bl_qty { margin-top: 10px; max-width: 360px; border: 1px solid #eef0f2; border-radius: 8px; overflow: hidden; }
.bl_qty_head { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; background: #fafbfc; font-size: 11px; font-weight: 700; color: #6b7280; }
.bl_qty table { width: 100%; border-collapse: collapse; font-size: 12px; }
.bl_qty th { padding: 6px 10px; border-top: 1px solid #eef0f2; text-align: start; font-size: 11px; font-weight: 500; color: #9aa2ad; }
.bl_qty td { padding: 6px 10px; border-top: 1px solid #eef0f2; color: #374151; }
.bl_qty td:last-child { font-weight: 700; color: #111827; }

/* bottom: payment side and the other cards */
.bl_bottom { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.bl_bottom.sl_bottom { grid-template-columns: 340px minmax(0, 1fr); }
.bl_main_col { min-width: 0; }
.bl_side { position: sticky; top: 12px; }
.bl_row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid #eef0f2; border-radius: 8px 8px 0 0; }
.bl_row label { margin: 0; font-size: 11px; font-weight: 600; color: #9aa2ad; }
.bl_round { border-radius: 0; border-top: 0; } .bl_round b { font-size: 12px; color: #5b6472; }
.sl_row_input { display: flex; align-items: center; gap: 8px; }
.sl_row_input input { width: 120px; border: 0; background: none; text-align: end; font: inherit; font-size: 13px; font-weight: 600; color: #111827; outline: 0; }
.sl_row_input i { font-size: 11px; color: #b0b5bd; }
.sl_row_input i:hover { color: #111827; }
.bl_total { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px; border: 1px solid #eef0f2; border-top: 0;
  border-radius: 0 0 8px 8px; background: #fafbfc; }
.bl_total span { font-size: 12px; font-weight: 700; color: #6b7280; }
.bl_total input { width: 160px; border: 0; background: none; text-align: end; font: inherit; font-size: 20px; font-weight: 700; color: #111827; }
.bl_total.ret { border-top: 1px solid #eef0f2; border-radius: 8px; }
.ret-amount { display: flex; align-items: baseline; gap: 6px; }
.ret-amount small { font-size: 11px; color: #9aa2ad; font-weight: 600; }
.ret-count { display: flex; justify-content: space-between; padding: 10px 10px 0; font-size: 11px; font-weight: 600; color: #9aa2ad; }
.ret-count b { color: #111827; }
.sl_profit { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 10px; border: 1px dashed #e8eaed; border-radius: 8px; }
.sl_profit > span { font-size: 11px; font-weight: 600; color: #9aa2ad; white-space: nowrap; }
.sl_profit input { flex: 1; min-width: 0; border: 0; background: none; text-align: end; font: inherit; font-size: 13px; font-weight: 700; color: #111827; }
.sl_profit i { font-size: 12px; color: #b0b5bd; }
.bl_label { margin: 14px 0 6px; font-size: 11px; font-weight: 600; color: #6b7280; }
.bl_select { width: 100%; height: 34px; border: 1px solid #e8eaed; border-radius: 8px; background-color: #fff; padding: 0 10px; font: inherit;
  font-size: 12px; font-weight: 600; color: #111827; outline: 0; }
.bl_select:focus { border-color: #d6dae1; box-shadow: 0 4px 14px rgba(16, 24, 40, 0.09); }
.bl_seg { display: flex; gap: 5px; }
.bl_seg label { flex: 1; margin: 0; position: relative; }
.bl_seg input { position: absolute; opacity: 0; pointer-events: none; }
.bl_seg span { display: block; border: 1px solid #e8eaed; border-radius: 8px; background: #fff; padding: 6px 0; text-align: center; font-size: 11px;
  font-weight: 600; color: #6b7280; cursor: pointer; }
.bl_seg input:checked + span { background: #111827; border-color: #111827; color: #fff; }
.bl_pay_btns { display: flex; gap: 6px; margin-top: 16px; }
.bl_pay_btn { flex: 1; height: 40px; border: 0; border-radius: 10px; background: #111827; color: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.bl_pay_btn:hover { background: #000; }
.bl_pay_btn i { margin-inline-end: 6px; font-size: 11px; opacity: 0.7; }
.bl_more_btn { width: 40px; height: 40px; flex: 0 0 auto; border: 1px solid #e8eaed; border-radius: 10px; background: #fff; color: #6b7280; cursor: pointer; }
.bl_more_btn:hover { border-color: #d6dae1; color: #111827; }
.pr { position: relative; }
.bl_menu { position: absolute; bottom: 48px; inset-inline-end: 0; z-index: 1000; width: 220px; padding: 5px; border: 1px solid #e8eaed; border-radius: 12px;
  background: #fff; box-shadow: 0 12px 30px rgba(16, 24, 40, 0.16); }
.bl_menu button { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; border-radius: 8px; background: none; padding: 7px 10px; text-align: start;
  font: inherit; font-size: 12px; font-weight: 600; color: #374151; cursor: pointer; }
.bl_menu button:hover { background: #f5f6f8; color: #111827; }
.bl_menu button i { width: 14px; text-align: center; font-size: 11px; color: #9aa2ad; }
.bl_menu_sep { margin: 4px 6px; border-top: 1px solid #f0f1f3; }
.bl_note { display: block; width: 100%; min-height: 70px; margin-bottom: 10px; border: 1px solid #e8eaed; border-radius: 10px; background: #fff; padding: 9px 12px;
  font: inherit; font-size: 12px; color: #111827; resize: vertical; outline: 0; }
.bl_note:focus { border-color: #d6dae1; box-shadow: 0 4px 14px rgba(16, 24, 40, 0.09); }
.bl_add { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; margin-top: 8px; border: 1px dashed #d6dae1; border-radius: 8px;
  background: none; color: #9aa2ad; font: inherit; font-size: 11px; font-weight: 600; padding: 7px; cursor: pointer; }
.bl_add:hover { background: #f7f8fa; color: #111827; }
.sl_opts { display: flex; flex-direction: column; gap: 6px; }
.sl_opt { position: relative; display: flex; align-items: center; gap: 9px; margin: 0; padding: 8px; border: 1px solid transparent; border-radius: 9px;
  background: #f7f8fa; cursor: pointer; user-select: none; }
.sl_opt:hover { background: #f0f2f5; }
.sl_opt:has(.sl_cb_input:checked) { border-color: #e8eaed; background: #fff; }
.sl_cb_input { position: absolute; opacity: 0; pointer-events: none; }
.sl_cb { width: 18px; height: 18px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid #c8cdd5;
  border-radius: 5px; background: #fff; color: transparent; font-size: 9px; }
.sl_cb_input:checked ~ .sl_cb, .sl_cb_input:checked ~ .sl_opt_ico { border-color: #111827; background: #111827; color: #fff; }
.sl_opt_ico { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 8px; display: flex; align-items: center; justify-content: center; border: 1px solid #e8eaed;
  background: #fff; color: #6b7280; font-size: 11px; }
.sl_opt_txt { flex: 1; min-width: 0; }
.sl_opt_txt b { display: block; font-size: 12px; font-weight: 700; color: #111827; }
.sl_opt_txt small { display: block; font-size: 10.5px; color: #9aa2ad; }
.sl_more_toggle { margin-top: 10px; font-size: 11px; font-weight: 700; color: #6b7280; display: inline-flex; align-items: center; gap: 4px; }
.sl_more_toggle i { font-size: 9px; }
.ed-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cost-head { display: grid; grid-template-columns: 24px minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) 24px; gap: 6px; padding: 7px 8px; margin-bottom: 6px;
  border-radius: 8px; background: #fafbfc; border: 1px solid #eef0f2; font-size: 11px; font-weight: 600; color: #6b7280; }
.cost-row { display: grid; grid-template-columns: 24px minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) 24px; gap: 6px; align-items: center; margin-bottom: 6px; }
.cost-row .counter { text-align: center; color: #b0b5bd; font-size: 11px; font-weight: 600; }
.cost-row .del-cell { color: #c4c9d0; cursor: pointer; text-align: center; }
.cost-row .del-cell:hover { color: #e53935; }
.att-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.att-row .bl_hint { margin-inline-start: 6px; }
.att-count { font-size: 11px; font-weight: 700; color: #2b74d6; }

/* the bar fixed at the bottom */
.sl_pay_bar { position: sticky; bottom: 0; z-index: 20; margin: auto -16px -96px; padding: 10px 12px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid #e8eaed; background: #fff; box-shadow: 0 -8px 24px rgba(16, 24, 40, 0.08); }
.sl_pay_btns { display: flex; gap: 6px; max-width: 700px; margin: 0 auto; }
.sl_pay_btns .inv-btn { flex: 1 1 0; height: 40px; padding: 0 10px; border: 1px solid #e8eaed; border-radius: 10px; background: #fff; color: #374151;
  font: inherit; font-size: 12px; font-weight: 700; white-space: nowrap; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.sl_pay_btns .inv-btn:hover { border-color: #d6dae1; background: #f5f6f8; }
.sl_pay_btns .inv-btn.main-btn, .sl_pay_btns .inv-btn.ret-btn { flex-grow: 1.4; border-color: #111827; background: #111827; color: #fff; font-size: 13px; }
.sl_pay_btns .inv-btn.main-btn:hover, .sl_pay_btns .inv-btn.ret-btn:hover { background: #000; }
.sl_pay_btns .inv-btn.ret-btn { flex-grow: 3; }
.sl_pay_btns .inv-btn.custom { color: #fff; }
.sl_bar_total { flex: 0 0 auto; display: flex; flex-direction: column; justify-content: center; min-width: 90px; padding-inline: 10px 4px;
  border-inline-end: 1px solid #eef0f2; line-height: 1.2; }
.sl_bar_total span { font-size: 10.5px; font-weight: 600; color: #9aa2ad; }
.sl_bar_total b { font-size: 16px; font-weight: 700; color: #111827; white-space: nowrap; }
.sl_bar_total small { font-size: 10px; font-weight: 600; color: #9aa2ad; }
.sl_more_wrap { flex: 0 0 40px; }

/* dialogs: list settings, thermal printer, custom buttons */
.sw-list { display: flex; flex-direction: column; }
.sw-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 2px; font-size: 13px; font-weight: 600; color: #111827; cursor: pointer; }
.sw-row + .sw-row { border-top: 1px solid #f0f1f3; }
.sw-input { position: absolute; opacity: 0; pointer-events: none; }
.sw { width: 34px; height: 20px; border-radius: 999px; background: #e5e7eb; position: relative; flex: 0 0 auto; transition: background 0.15s; }
.sw::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: inset-inline-start 0.15s; }
.sw-input:checked + .sw { background: #111827; }
.sw-input:checked + .sw::after { inset-inline-start: 16px; }
.pp-seg { display: flex; border: 1px solid #e8eaed; border-radius: 9px; overflow: hidden; }
.pp-seg button { border: 0; background: #fff; color: #6b7280; font: inherit; font-size: 11px; font-weight: 700; padding: 5px 10px; cursor: pointer; }
.pp-seg button + button { border-inline-start: 1px solid #e8eaed; }
.pp-seg button.on { background: #111827; color: #fff; }
.pp-body { display: flex; flex-direction: column; gap: 10px; }
.pp-drop { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px; border: 1px dashed #d6dae1; border-radius: 10px; cursor: pointer; text-align: center; }
.pp-drop b { font-size: 13px; }
.pp-img { max-width: 220px; max-height: 80px; object-fit: contain; }
.pp-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pp-kind { height: 38px; border: 1px solid #e8eaed; border-radius: 8px; background: #fff; font: inherit; font-size: 12px; font-weight: 600; color: #374151; cursor: pointer; }
.pp-kind.on { background: #3b82f6; border-color: #3b82f6; color: #fff; }
.cb-list { display: flex; flex-direction: column; gap: 8px; }
.cb-row { display: grid; grid-template-columns: minmax(0, 1.4fr) 44px minmax(0, 1fr) minmax(0, 1.2fr) 30px; gap: 6px; align-items: center; }
.cb-row input[type="color"] { width: 44px; height: 38px; border: 1px solid #e8eaed; border-radius: 8px; padding: 2px; background: #fff; }
tr.same-client td { background: #fdf6e3; }

@media (max-width: 1000px) {
  .bl_bottom, .bl_bottom.sl_bottom { grid-template-columns: minmax(0, 1fr); }
  .bl_side { position: static; }
}
@media (max-width: 860px) {
  .small_btn_nav.hide-phone { display: none; }
  .bl_wrap { padding: 8px 4px 20px; }
  .bl_btn { padding: 0 11px; }
  .bl_sec_sub { display: none; }
  .sl_ptype { display: none; }
  .price-mobile { display: block; }
  .sl_pro_tools { margin-inline-start: 0; }
  .editor-top .sl_nav_tools { flex-wrap: wrap; }
  .sl_pay_bar { margin: auto -10px -96px; }
  .ipp-dropdown { width: 92vw; }
  .ed .sl_grid_box { min-width: 640px; }
  .cb-row { grid-template-columns: 1fr 44px; }
}

/* «−  العدد  +»: one box, the buttons inside it at both ends */
.qty-step { display: flex; align-items: stretch; min-width: 0; height: 32px; margin: 0 4px; border: 1px solid #e3e6eb; border-radius: 9px;
  background: #fff; overflow: hidden; transition: border-color 0.15s, box-shadow 0.15s; }
.qty-step:hover { border-color: #cfd4dc; }
.qty-step:focus-within { border-color: #111827; box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08); }
.ed .sl_grid_box .mg > .qty-step { flex: 1.2 1 0; }
.ed-purchase .mg > div > .qty-step { width: 100%; margin: 0 3px; }
.ed .mg .qty-step .phalf { flex: 1 1 0; min-width: 30px; height: 100%; padding: 0 2px; border: 0; border-radius: 0; background: transparent;
  font-weight: 700; color: #111827; text-align: center; outline: 0; }
.ed .mg .qty-step .phalf:focus { outline: 0; background: transparent; }
.qty-btn { flex: 0 0 28px; height: 100%; border: 0; border-radius: 0; background: #f7f8fa; color: #6b7280; font-size: 9px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background 0.12s, color 0.12s; }
.qty-btn:first-child { border-inline-end: 1px solid #eef0f2; }
.qty-btn:last-child { border-inline-start: 1px solid #eef0f2; }
.qty-btn:hover { background: #111827; color: #fff; }
.qty-btn:active { background: #000; }
.qty-step.off { background: transparent; border-color: #f0f1f3; }
.qty-step.off .qty-btn { background: transparent; color: #d6dae1; cursor: default; }
.qty-step.off .phalf::placeholder { color: #9aa2ad; font-weight: 400; }
@media (max-width: 860px) {
  .qty-step { height: 38px; border-radius: 11px; }
  .qty-btn { flex-basis: 36px; font-size: 12px; }
  .ed .sl_grid_box .mg > .qty-step { flex: 0 0 136px; }
  .ed .mg .qty-step .phalf { font-size: 15px; }
  .ed .sl_grid_box { min-width: 720px; }
}
