/* Desktop purchase desk. Phone purchase entry does not use .bse-desk. */
.bse-desk {
  --desk-ink: #1c2421;
  --desk-brass: #8a5a2a;
  --desk-paper: #fffdf9;
  --desk-well: #f3eee6;
  --desk-line: #e4d9c8;
  --desk-mute: #5e675f;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  color: var(--desk-ink);
  font-variant-numeric: tabular-nums;
}
.bse-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: .75rem 1.25rem;
  padding: .7rem .9rem .65rem;
  background: var(--desk-ink);
  color: #f6f1e8;
  border-radius: 12px;
}
.bse-kicker {
  margin: 0 0 .1rem;
  color: #d7b48a;
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.bse-bar h2 { margin: 0; color: #fff; font-size: 1.35rem; font-weight: 720; letter-spacing: -.02em; }
.bse-bar h2 span { color: #d9cfc2; font-size: .95rem; font-weight: 600; }
.bse-nav { display: flex; flex-wrap: wrap; gap: .35rem; }
.bse-nav a {
  padding: .38rem .7rem;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  color: #f6f1e8;
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
}
.bse-nav a.is-on { background: #f6f1e8; color: var(--desk-ink); border-color: #f6f1e8; }
.bse-editing { flex: 1 0 100%; margin: .15rem 0 0; color: #e7d7c4; font-size: .8rem; }
.bse-editing a { color: #f3d7a1; font-weight: 750; }
.bse-bar { flex-wrap: wrap; }
.bse-lead { margin: 0; color: var(--desk-mute); font-size: .88rem; }
.bse-lead a { font-weight: 700; }
.bse-meta { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.35fr) minmax(0, .95fr); gap: .55rem; }
.bse-panel {
  display: flex;
  flex-direction: column;
  gap: .32rem;
  min-width: 0;
  padding: .7rem .8rem .75rem;
  background: var(--desk-paper);
  border: 1px solid var(--desk-line);
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(90, 62, 28, .04);
}
.bse-field {
  display: grid;
  grid-template-columns: minmax(0, 7.4rem) minmax(0, 1fr);
  gap: .2rem .45rem;
  align-items: center;
  min-width: 0;
}
.bse-panel h3 {
  margin: 0 0 .15rem;
  padding-bottom: .35rem;
  border-bottom: 2px solid #eadcc8;
  color: var(--desk-brass);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.bse-panel > label, .bse-pair label { margin: 0; color: #3d4740; font-size: .75rem; font-weight: 700; }
.bse-panel input, .bse-dock input, .bse-dock select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 1px solid #ddd2c2;
  border-radius: 8px;
  background: #fff;
  padding: .42rem .55rem;
}
.bse-panel input:focus, .bse-dock input:focus, .bse-dock select:focus { border-color: #b8884f; outline: 2px solid rgba(184, 136, 79, .28); outline-offset: 0; }
.bse-req { color: #9a3412; }
.bse-panel-supplier .bse-field { grid-template-columns: minmax(0, 5.4rem) minmax(0, 1fr); }
.bse-context { display: flex; justify-content: space-between; gap: .45rem; min-height: 1.2rem; color: var(--desk-mute); font-size: .75rem; }
.bse-context b { color: var(--desk-ink); white-space: nowrap; }
.bse-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .45rem; }
.bse-pair > div { min-width: 0; }
.bse-pair label { display: block; margin-bottom: .18rem; }
.bse-status { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: 0 .15rem; color: var(--desk-mute); font-size: .75rem; }
.bse-lines {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: .55rem .65rem .65rem;
  background: var(--desk-paper);
  border: 1px solid var(--desk-line);
  border-radius: 12px;
}
.bse-lines-head, .bse-find { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .7rem; }
.bse-lines-head { justify-content: space-between; }
.bse-lines h3 { margin: 0; font-size: .95rem; }
.bse-count { margin-left: .35rem; color: var(--desk-mute); font-size: .75rem; font-weight: 700; }
.bse-line-tools { display: flex; align-items: center; gap: .35rem; }
.bse-desk .col-menu-btn { border-color: #ddd2c2; color: var(--desk-ink); background: #fff; }
.bse-find { margin: .45rem 0 .4rem; }
.bse-find .search-wrap { flex: 1 1 auto; min-width: 180px; }
.bse-find .search-wrap input { border-radius: 9px; background: var(--desk-well); }
.bse-modes { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .28rem .4rem; color: var(--desk-mute); font-size: .72rem; font-weight: 700; }
.bse-modes .seg { display: inline-flex; width: auto; }
.bse-modes .seg span { padding: .22rem .42rem; font-size: .72rem; }
.bse-sheet { border: 1px solid #efe6da; border-radius: 10px; background: #fff; overflow: auto; }
.bse-desk .purchase-entry-table { width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; }
.bse-desk .purchase-entry-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: .48rem .4rem;
  border: 0;
  border-bottom: 1px solid var(--desk-line);
  background: #f7f2ea;
  color: #4a4036;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .01em;
  text-transform: none;
  white-space: normal;
}
.bse-desk .purchase-entry-table td {
  height: auto;
  padding: .42rem .4rem;
  border: 0;
  border-bottom: 1px solid #f0e8dc;
  background: transparent;
  vertical-align: middle;
}
.bse-desk .purchase-entry-table tbody tr[data-i]:nth-child(even) { background: #fcfaf6; }
.bse-desk .purchase-entry-table tbody tr[data-i]:focus-within { background: #f8f1e4; }
.bse-desk .purchase-sheet-wrap { margin-top: 0; border: 0; }
.bse-desk .purchase-entry-table input[data-f],
.bse-desk #siTable input[data-f] {
  width: 100% !important;
  max-width: 100%;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  padding: .28rem .32rem;
}
.bse-desk .purchase-entry-table input[data-f]:focus { border-color: #d7b48a; background: #fff; }
.bse-desk .purchase-entry-table input[type=number] { text-align: right; }
.bse-desk .purchase-entry-table .amt, .bse-desk #siTotal { color: #7a4b16; font-weight: 750; }
.bse-desk .ps-item strong { display: block; font-weight: 680; line-height: 1.25; }
.bse-desk .ps-sku { display: block; margin-top: .12rem; color: var(--desk-mute); font-size: .7rem; font-weight: 650; }
.bse-desk .ps-num { text-align: center; color: #8a8175; font-weight: 750; white-space: nowrap; }
.bse-desk .ps-batch-fields { display: grid; gap: .15rem; }
.bse-desk .ps-upd { text-align: center; }
.bse-desk .ps-upd input { width: auto; }
.bse-desk .mode-btn, .bse-desk .cost-other, .bse-desk .sell-other, .bse-desk .ps-now, .bse-desk .batch-hint, .bse-desk .last-cost { display: none; }
.bse-desk .landed:empty { display: none; }
.bse-desk .discount-amount { display: block; text-align: right; color: var(--desk-mute); font-size: .68rem; white-space: nowrap; }
.bse-desk tfoot td { background: #fbf7f2; }
.bse-next { margin-top: .35rem; padding: .25rem .4rem; border-radius: 8px; background: var(--desk-well); }
.bse-next input { border: 0; background: transparent; }
.bse-hint { margin: .4rem .1rem 0; color: var(--desk-mute); font-size: .75rem; }
.bse-dock {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .72fr);
  gap: .55rem;
  align-items: stretch;
}
.bse-dock-main, .bse-total {
  min-width: 0;
  padding: .65rem .75rem .7rem;
  background: var(--desk-paper);
  border: 1px solid var(--desk-line);
  border-radius: 12px;
}
.bse-charges summary { cursor: pointer; font-weight: 750; }
.bse-charge-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem .55rem; margin-top: .55rem; }
.bse-charge-grid label { margin-bottom: .15rem; font-size: .75rem; }
.bse-charge-note { grid-column: 1 / -1; margin: 0; color: var(--desk-mute); font-size: .75rem; }
.bse-round { display: flex; align-items: center; gap: .55rem; max-width: 28rem; margin-top: .55rem; }
.bse-round label { margin: 0; font-size: .8rem; }
.bse-round input { width: 7.5rem; }
.bse-pay { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .8fr) minmax(0, .9fr); gap: .45rem .55rem; margin-top: .6rem; }
.bse-pay label { margin-bottom: .15rem; font-size: .75rem; }
.bse-pay-note, .bse-remarks { margin: .45rem 0 0; }
.bse-remarks { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: .45rem; align-items: center; }
.bse-remarks label { margin: 0; font-size: .8rem; }
.bse-cost-opt { display: flex; margin-top: .55rem; font-size: .82rem; }
.bse-total { display: flex; flex-direction: column; justify-content: space-between; gap: .65rem; background: #1c2421; color: #f6f1e8; border-color: #1c2421; }
.bse-total-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem .7rem; }
.bse-total-grid span, .bse-save span { display: block; color: #cbbba6; font-size: .72rem; font-weight: 700; }
.bse-total-grid b { display: block; font-size: 1rem; }
.bse-grand { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; padding-bottom: .35rem; border-bottom: 1px solid rgba(255, 255, 255, .14); }
.bse-grand span { color: #f0d7b4; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; }
.bse-grand b { color: #f3d7a1; font-size: 1.7rem; }
.bse-save { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .4rem .5rem; }
.bse-save > span { flex: 1 1 100%; }
.bse-save .btn.ok { min-width: 9rem; background: #f3d7a1; color: #1c2421; border-color: #f3d7a1; }
.bse-save .btn.ghost { color: #f6f1e8; border-color: rgba(255, 255, 255, .35); background: transparent; }
.bse-validation { margin: 0; }
@media (min-width: 1101px) and (min-height: 700px) {
  html:has(.bse-desk) { overflow: hidden; }
  body:has(.bse-desk) { overflow: hidden; }
  body:has(.bse-desk) main { overflow: hidden; padding: .45rem .7rem .3rem; }
  body:has(.bse-desk) #boAppFoot { display: none; }
  html.bse-desk-scroll:has(.bse-desk),
  html.bse-desk-scroll:has(.bse-desk) body,
  html.bse-desk-scroll:has(.bse-desk) main { overflow: auto; }
  html.bse-desk-scroll .bse-desk { height: auto; }
  .bse-desk { position: relative; height: calc(100dvh - 68px); min-height: 0; display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto; gap: .4rem; }
  .bse-keyhint { display: none; }
  .bse-lead { display: none; }
  .bse-bar { padding: .45rem .75rem; border-radius: 10px; }
  .bse-bar h2 { font-size: 1.15rem; }
  .bse-meta { gap: .4rem; }
  .bse-panel { padding: .45rem .6rem .5rem; gap: .22rem .45rem; }
  .bse-panel h3 { margin: 0; padding-bottom: .2rem; }
  .bse-panel input { min-height: 30px; padding: .2rem .45rem; }
  .bse-lines { min-height: 0; padding: .4rem .5rem .45rem; }
  .bse-sheet { flex: 1 1 auto; min-height: 0; }
  .bse-hint { display: none; }
  .bse-dock { min-height: 0; }
  .bse-validation:not([hidden]) { position: absolute; left: .6rem; right: .6rem; bottom: .45rem; z-index: 14; }
}
@media (max-width: 1100px) {
  .bse-meta, .bse-dock, .bse-pay { grid-template-columns: 1fr; }
  .bse-panel-supplier { order: -1; }
}
