/* Phase 8.7.8 — balanced 1920x1024 responsive layout, capped transactions, true paged grids. */
:root{
  --dbs-btn-font:clamp(10px,.68vw,13px);
  --dbs-small-font:clamp(9px,.62vw,12px);
  --dbs-page-gap:clamp(10px,.9vw,18px);
  --dbs-panel-pad:clamp(12px,.9vw,18px);
  --dbs-gold:#f2a31a;
  --dbs-gold-dark:#d67800;
  --dbs-border:#efbd78;
}
html,body{min-width:320px;}
.main-shell{padding:clamp(12px,1.1vw,24px)!important;}
.topbar{margin-bottom:clamp(10px,.75vw,16px)!important;}
.topbar-meta{gap:10px!important;white-space:nowrap!important;}
.chip[data-dbs-local-time]{min-width:160px;text-align:center;}
.button,button,.tab-chip,.status,input,select,textarea{
  font-size:var(--dbs-btn-font)!important;
}
.button,button,.tab-chip{
  font-weight:900!important;
  letter-spacing:.01em!important;
  line-height:1.08!important;
}
.quick-item,.product-button,.service-pick,.repair-service-pick{
  font-size:var(--dbs-btn-font)!important;
}
.quick-item strong,.quick-item span,.quick-item small,
.product-button strong,.product-button span,.product-button small,
.service-pick span,.repair-service-pick span{
  font-size:var(--dbs-small-font)!important;
  line-height:1.05!important;
}
.card,.panel,.card-lite,.nested-panel{
  border-color:var(--dbs-border)!important;
  box-shadow:0 10px 22px rgba(98,59,12,.07)!important;
}
.phase87-pos-split,
.phase872-pos-register{
  display:grid!important;
  grid-template-columns:minmax(420px,40%) minmax(620px,60%)!important;
  gap:var(--dbs-page-gap)!important;
  align-items:stretch!important;
  max-width:100%!important;
}
.phase87-pos-split > .card.panel,
.phase872-pos-register > .card.panel{
  height:clamp(690px,calc(100vh - 178px),830px)!important;
  min-height:0!important;
  overflow:hidden!important;
  padding:var(--dbs-panel-pad)!important;
  display:flex!important;
  flex-direction:column!important;
}
.phase87-work-panel,.phase872-register-right{min-width:0!important;}
.phase872-register-left{min-width:0!important;}
.phase872-transaction-tabs{
  display:flex!important;
  align-items:stretch!important;
  gap:0!important;
  overflow:hidden!important;
  height:48px!important;
  min-height:48px!important;
  border-bottom:1px solid #cfe1ef!important;
  background:#eaf7ff!important;
}
.phase872-transaction-tabs .tx-tab,
.phase872-transaction-tabs span.active{
  width:clamp(110px,8vw,150px)!important;
  max-width:clamp(110px,8vw,150px)!important;
  min-width:0!important;
  height:48px!important;
  padding:7px 8px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  border:0!important;
  border-right:1px solid #cfe1ef!important;
  background:#eaf7ff!important;
  color:#0580c4!important;
  border-radius:0!important;
  box-shadow:none!important;
  white-space:normal!important;
}
.phase872-transaction-tabs .tx-tab.active,
.phase872-transaction-tabs span.active{background:#e3f4ff!important;}
.phase872-transaction-tabs .plus{
  flex:0 0 52px!important;
  width:52px!important;
  min-width:52px!important;
  height:48px!important;
  border-radius:0!important;
  margin:0!important;
  padding:0!important;
  background:linear-gradient(135deg,#ff9e15,#d87500)!important;
  color:#fff!important;
  box-shadow:none!important;
}
.phase872-cart-table-wrap{
  flex:1 1 auto!important;
  min-height:240px!important;
  max-height:none!important;
  overflow:hidden!important;
  border-bottom:1px solid #d7e5ef!important;
}
.phase872-cart-table th,.phase872-cart-table td{font-size:var(--dbs-small-font)!important;padding:8px 10px!important;}
.phase872-bottom-split{
  flex:0 0 auto!important;
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:12px!important;
  margin-top:12px!important;
}
.phase872-intake-bottom .phase872-totals-box,
.phase872-intake-bottom .phase872-customer-box,
.phase872-totals-box,.phase872-customer-box{
  min-height:142px!important;
  padding:14px!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:flex-start!important;
}
.phase874-left-actions{
  flex:0 0 auto!important;
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:12px!important;
  margin-top:12px!important;
}
.phase874-left-actions .button{min-height:42px!important;padding:9px 12px!important;border-radius:12px!important;}
.phase87-recent-box{margin-top:12px!important;max-height:120px!important;overflow:hidden!important;}
/* Collapsed measurement profile remains compact. */
.phase876-collapsible.is-collapsed .phase87-compact-grid,
.phase876-collapsible.is-collapsed .section-help{display:none!important;}
.phase876-collapsible.is-collapsed{padding-bottom:10px!important;}
/* True 3-row button grids. */
.phase876-paged-grid,
.phase872-product-grid{
  display:grid!important;
  grid-template-columns:repeat(6,minmax(0,1fr))!important;
  grid-template-rows:repeat(3,clamp(48px,5.35vh,62px))!important;
  gap:9px!important;
  height:calc(3 * clamp(48px,5.35vh,62px) + 18px)!important;
  min-height:calc(3 * clamp(48px,5.35vh,62px) + 18px)!important;
  max-height:calc(3 * clamp(48px,5.35vh,62px) + 18px)!important;
  overflow:hidden!important;
  align-content:start!important;
}
.phase876-paged-grid > .quick-item,
.phase872-product-grid > .quick-item,
.phase876-paged-grid > button,
.phase872-product-grid > button,
.phase876-blank-tile{
  height:clamp(48px,5.35vh,62px)!important;
  min-height:0!important;
  width:100%!important;
  margin:0!important;
  padding:6px 8px!important;
  border-radius:10px!important;
  overflow:hidden!important;
}
.phase876-paged-grid > [hidden],
.phase872-product-grid > [hidden],
.phase878-page-hidden{display:none!important;}
.phase876-blank-tile{visibility:hidden!important;pointer-events:none!important;background:transparent!important;border:0!important;box-shadow:none!important;}
.phase878-pager,.phase876-pager{
  display:grid!important;
  grid-template-columns:92px 1fr 92px!important;
  gap:12px!important;
  align-items:center!important;
  margin:10px 0 8px!important;
}
.phase878-pager button,.phase876-pager button{
  height:38px!important;
  min-height:38px!important;
  padding:8px 10px!important;
  border-radius:11px!important;
  background:#142a48!important;
  color:#fff!important;
  box-shadow:0 8px 18px rgba(20,42,72,.16)!important;
}
.phase878-pager button:disabled,.phase876-pager button:disabled{opacity:.45!important;cursor:not-allowed!important;}
.phase878-pager span,.phase876-pager span{text-align:center!important;font-weight:900!important;color:#946000!important;font-size:var(--dbs-btn-font)!important;}
/* Keep Details visible right below paged service area. */
.phase87-detail-grid{gap:10px 14px!important;}
.phase87-detail-grid input,.phase87-detail-grid select{height:40px!important;}
.phase87-bottom-actions{gap:10px!important;margin-top:12px!important;}
.phase87-bottom-actions .button{min-height:40px!important;padding:9px 11px!important;border-radius:12px!important;}
/* Shop specific balance: recent tickets on the left, products on the right. */
.phase87-shop-page .phase872-register-left,
.phase87-shop-page .phase872-register-right{height:clamp(720px,calc(100vh - 150px),855px)!important;}
.phase87-shop-page .phase872-register-left .phase872-cart-form{display:flex!important;flex-direction:column!important;min-height:0!important;flex:1 1 auto!important;}
.phase87-shop-page .phase872-cart-table-wrap{min-height:230px!important;}
.phase87-shop-page .phase872-bottom-split{grid-template-columns:1fr 1fr!important;}
.phase87-shop-page .phase872-customer-box{min-height:180px!important;padding:13px!important;}
.phase87-shop-page .phase872-customer-grid{grid-template-columns:minmax(120px,.9fr) minmax(150px,1fr)!important;gap:10px!important;}
.phase87-shop-page .phase872-customer-box .muted-text{margin:8px 0!important;line-height:1.35!important;font-size:var(--dbs-small-font)!important;}
.phase877-customer-actions{margin-top:auto!important;display:grid!important;grid-template-columns:1fr 1fr!important;gap:12px!important;}
.phase877-customer-actions .button{min-height:36px!important;height:36px!important;padding:7px 10px!important;border-radius:10px!important;font-size:var(--dbs-small-font)!important;}
.phase878-recent-tender{margin-top:12px!important;padding:12px!important;flex:0 0 198px!important;min-height:0!important;overflow:hidden!important;background:#fffefa!important;border:1px solid var(--dbs-border)!important;border-radius:16px!important;}
.phase878-recent-tender .panel-head{margin-bottom:8px!important;}
.phase878-recent-tender h2{font-size:clamp(18px,1.3vw,26px)!important;}
.phase878-shop-ticket-list{max-height:130px!important;overflow:hidden!important;}
.phase878-shop-ticket-list .list-row{padding:9px 10px!important;margin-bottom:8px!important;}
.phase87-shop-page .phase872-register-right{overflow:hidden!important;}
.phase872-register-right .phase872-register-search{display:grid!important;grid-template-columns:1fr auto!important;gap:10px!important;margin-bottom:8px!important;}
.phase872-register-right .barcode-entry{margin-bottom:8px!important;}
.phase872-keypad{display:grid!important;grid-template-columns:repeat(3,1fr)!important;gap:7px!important;margin:8px 0!important;}
.phase872-keypad button{height:34px!important;min-height:34px!important;background:#fff!important;color:#061a38!important;border:1px solid #cbddec!important;border-radius:9px!important;}
.phase872-function-grid{display:grid!important;grid-template-columns:repeat(3,1fr)!important;gap:7px!important;margin:8px 0!important;}
.phase872-function-grid button{height:36px!important;min-height:36px!important;padding:7px 8px!important;border-radius:9px!important;}
.phase872-payment-summary{padding:10px!important;margin:9px 0!important;}
.phase872-payment-summary textarea{min-height:42px!important;height:42px!important;}
.phase87-shop-page .product-tabs{gap:8px!important;margin-bottom:9px!important;}
.phase87-shop-page .phase872-product-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;grid-template-rows:repeat(3,clamp(46px,5.1vh,60px))!important;height:calc(3 * clamp(46px,5.1vh,60px) + 18px)!important;min-height:calc(3 * clamp(46px,5.1vh,60px) + 18px)!important;max-height:calc(3 * clamp(46px,5.1vh,60px) + 18px)!important;}
/* Standard list pages: no long scrolling, use compact rows + pager. */
.phase876-paged-list > .list-row[hidden],
.phase876-paged-list > .card-lite[hidden],
.phase876-paged-list > tr[hidden],
.phase876-paged-list > .phase875-label-product-row[hidden],
.phase876-paged-list > .phase872-label-product-row[hidden],
.phase876-paged-list > .phase872-tag-order-card[hidden]{display:none!important;}
.phase876-list-pager,.phase878-list-pager{display:grid!important;grid-template-columns:92px 1fr 92px!important;align-items:center!important;gap:12px!important;margin:12px 0!important;}
.phase876-list-pager button,.phase878-list-pager button{height:36px!important;border-radius:11px!important;background:#142a48!important;color:#fff!important;}
.phase876-list-pager span,.phase878-list-pager span{text-align:center!important;font-weight:900!important;color:#946000!important;}
/* Admin user directory pager area. */
body:has(.admin-actions) .split-layout{align-items:stretch!important;}
body:has(.admin-actions) .split-layout > .card.panel{height:clamp(700px,calc(100vh - 150px),850px)!important;overflow:hidden!important;}
body:has(.admin-actions) .list-table.compact{max-height:560px!important;overflow:hidden!important;}
/* Reduce blank bottom space by keeping common pages inside viewport when rows are paged. */
body:has(.phase876-paged-list) .app-footer{margin-top:12px!important;}
/* Responsive shrink proportional. */
@media (max-width:1500px){
  .phase876-paged-grid,.phase872-product-grid{grid-template-columns:repeat(5,minmax(0,1fr))!important;}
  .phase87-shop-page .phase872-product-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;}
  .phase872-transaction-tabs .tx-tab,.phase872-transaction-tabs span.active{width:120px!important;}
}
@media (max-width:1180px){
  .phase87-pos-split,.phase872-pos-register{grid-template-columns:1fr!important;}
  .phase87-pos-split > .card.panel,.phase872-pos-register > .card.panel{height:auto!important;min-height:0!important;overflow:visible!important;}
}
@media (max-width:760px){
  .phase876-paged-grid,.phase872-product-grid,.phase87-shop-page .phase872-product-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
  .phase878-pager,.phase876-pager,.phase876-list-pager,.phase878-list-pager{grid-template-columns:70px 1fr 70px!important;}
  .phase872-bottom-split,.phase874-left-actions,.phase877-customer-actions{grid-template-columns:1fr!important;}
}
