/* v35: the staff workspace uses the whole viewport, with an on-demand drawer. */
html:not(.staff-locked), html:not(.staff-locked) body { height:100%; overflow:hidden; }
.app-shell { display:block; height:100vh; height:100dvh; min-height:0; overflow:hidden; }
.app-shell .main-area { display:flex; flex-direction:column; height:100%; min-height:0; }
.app-shell .topbar { position:relative; top:auto; flex:0 0 64px; height:64px; min-height:0; padding:6px 18px; gap:12px; z-index:30; }
.topbar .page-heading { margin-right:auto; min-width:0; }
.topbar .page-heading h1 { font-size:20px; }
.topbar .finance-server-button { max-width:180px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap!important; }
.topbar .mobile-menu { display:grid; flex:0 0 38px; place-items:center; padding:0; }
.app-shell > .sidebar { display:flex; position:fixed; inset:0 auto 0 0; z-index:80; width:min(294px,88vw); height:100vh; height:100dvh; min-height:0; overflow:auto; transform:translateX(-110%); transition:transform .2s ease; box-shadow:12px 0 40px #06294d33; padding:20px 16px; }
.app-shell > .sidebar.is-open { transform:translateX(0); }
.sidebar .brand-logo { height:118px; object-fit:contain; }
.sidebar .brand { padding-bottom:4px; }
.staff-nav-close { align-self:flex-end; flex:0 0 32px; width:32px; border:1px solid #ffffff55; background:transparent; color:white; border-radius:8px; font-size:24px; }
.mobile-nav-backdrop { display:block; position:fixed; inset:0; z-index:75; border:0; background:#06294d66; }
.main-area > .view.active { flex:1 1 0; min-height:0; overflow:auto; }
.view > .section-intro, .purchase-return-area > .section-intro { top:0; }
#kasir.view.active { height:auto; padding:0; overflow:hidden; }
#kasir .pos-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(310px,36%); grid-template-rows:minmax(0,1fr); height:100%; max-width:none; gap:0; position:relative; overflow:hidden; }
#kasir .catalog-panel { display:flex; flex-direction:column; min-height:0; height:100%; overflow:hidden; padding:18px; }
#kasir .catalog-header { flex:0 0 auto; gap:10px; }
#kasir .catalog-header h2 { font-size:19px; }
#kasir .catalog-header p { font-size:12px; margin-top:4px; }
#kasir .search-box { flex:0 0 40px; margin:12px 0 10px; width:100%; min-width:0; }
#kasir .category-row { flex:0 0 auto; min-height:38px; width:100%; overflow-x:auto; overflow-y:hidden; }
#kasir .category { flex:0 0 auto; white-space:nowrap; }
#kasir .product-grid { flex:1 1 0; min-height:0; min-width:0; grid-template-columns:repeat(auto-fill,minmax(145px,1fr)); align-content:start; grid-auto-rows:max-content; overflow-y:auto; overflow-x:hidden; overscroll-behavior:contain; margin-top:10px; padding:0 4px 12px 0; gap:12px; }
#kasir .product-card { min-width:0; width:100%; height:auto; }
#kasir .product-visual { width:100%; aspect-ratio:1/1; height:auto; min-height:0; }
#kasir .cart-panel { display:flex; flex-direction:column; position:relative; inset:auto; height:100%; min-height:0; padding:12px 14px; overflow:hidden; transform:none; border:0; border-left:1px solid var(--line); border-radius:0; box-shadow:none; }
#kasir .cart-sheet-toggle { display:none; }
#kasir .cashier-order-tabs { flex:0 0 37px; min-height:37px; margin:0 0 8px; gap:4px; overflow:hidden; }
#kasir .cashier-order-tab { flex:0 1 38px; min-width:30px; }
#kasir .cashier-order-tab.active { flex:1 1 86px; }
#kasir .cashier-order-tab > button:first-child { display:flex; flex-direction:row; align-items:center; min-height:35px; height:35px; padding:5px 18px 5px 7px; gap:4px; border-radius:7px; overflow:hidden; }
#kasir .cashier-order-tab > button:first-child span { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
#kasir .cashier-order-tab em { font-style:normal; }
#kasir .cashier-order-tab:not(.active) em, #kasir .cashier-order-tab:not(.active) small { display:none; }
#kasir .cashier-order-tab.active small { margin-left:auto; flex-shrink:0; font-size:9px; }
#kasir .cashier-order-close { right:0; top:8px; width:16px; height:20px; }
#kasir .cashier-order-add { flex:0 0 31px; min-height:35px; height:35px; font-size:17px; padding:2px; gap:0; border-radius:7px; }
#kasir .cashier-order-add small { font-size:8px; }
#kasir .cart-title-row { flex:0 0 auto; margin:0 0 8px; align-items:center; }
#kasir .cart-title-row h2 { font-size:12px; margin:2px 0 0; }
#kasir .customer-select { flex:0 0 auto; padding:7px 9px; margin:0 0 8px; min-height:44px; }
#kasir .customer-select > span:nth-child(2) { min-width:0; }
#kasir .customer-select strong { font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#kasir .customer-points-summary { font-size:10px; }
#kasir .cart-items { display:flex; flex-direction:column; flex:1 1 0; min-height:0; max-height:none; overflow-y:auto; overflow-x:hidden; gap:0; padding:0 3px 0 0; overscroll-behavior:contain; }
#kasir .cart-items:empty { flex-grow:0; }
#kasir .cart-item { flex:0 0 auto; display:grid; grid-template-columns:42px minmax(0,1fr) auto; align-items:start; gap:8px; padding:10px 0; border-bottom:1px solid #edf1f5; }
#kasir .cart-item .thumb { width:42px; height:42px; }
#kasir .cart-item strong { font-size:12px; overflow-wrap:anywhere; }
#kasir .cart-item small { display:block; white-space:normal; line-height:1.35; font-size:10px; }
#kasir .item-actions { display:flex; flex-direction:column; align-items:flex-end; gap:7px; }
#kasir .quantity-control { margin:0; }
#kasir .quantity-control button { width:26px; height:27px; }
#kasir .empty-cart { flex:1 1 0; min-height:0; padding:12px; overflow:auto; }
#kasir .cart-bottom { flex:0 0 auto; margin:0; padding-top:8px; border-top:1px solid var(--line); }
.order-details-button { display:block; width:100%; border:1px solid var(--line); background:#f4f7fb; color:var(--ink); border-radius:7px; min-height:30px; margin:0 0 6px; font-size:11px; font-weight:650; }
#kasir .checkout-button { min-height:43px; height:43px; margin:0; padding:8px 12px; font-size:15px; }
.order-details-dialog { width:min(480px,calc(100vw - 24px)); max-height:calc(100vh - 24px); max-height:calc(100dvh - 24px); overflow:auto; border:0; border-radius:16px; padding:24px; color:var(--ink); }
.order-details-dialog::backdrop { background:#06294d66; }
.order-details-dialog h2 { margin:0 26px 8px 0; }
.order-details-dialog p { color:var(--muted); font-size:12px; }
.order-details-dialog .note-field { display:flex; flex-direction:column; align-items:stretch; margin:12px 0; }
.order-details-dialog .note-field input, .order-details-dialog .note-field select { min-width:0; width:100%; height:38px; }
.order-details-dialog .cashier-point-panel { margin:12px 0; }
.order-details-dialog .totals { margin:14px 0; }
.modifier-product-photo { display:block; width:96px; height:96px; margin:12px auto; border-radius:12px; }
.modifier-quantity-field { display:flex; justify-content:space-between; align-items:center; gap:12px; margin:14px 0; font-weight:650; }
.modifier-quantity-field input { width:100px; min-width:0; padding:9px; border:1px solid var(--line); border-radius:8px; }
.toast { right:auto; left:20px; bottom:20px; max-width:min(420px,calc(60vw - 40px)); pointer-events:none; }
#kasir .catalog-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; }
@media (max-height:600px) {
  .app-shell .topbar { height:50px; flex-basis:50px; }
  .topbar .eyebrow { display:none; }
  #kasir .catalog-panel { padding:10px; }
  #kasir .catalog-header p { display:none; }
  #kasir .search-box { margin:7px 0; flex-basis:35px; }
  #kasir .cart-panel { padding:7px 10px; }
  #kasir .cashier-order-tabs { margin-bottom:4px; }
  #kasir .cart-title-row { margin-bottom:4px; }
  #kasir .cart-title-row h2 { display:none; }
  #kasir .customer-select { min-height:32px; padding:4px 7px; margin-bottom:4px; }
  #kasir .customer-select small { display:none; }
  #kasir .cart-bottom { padding-top:4px; }
  #kasir .checkout-button { min-height:36px; height:36px; }
  .order-details-button { min-height:26px; margin-bottom:4px; }
}
@media (max-width:1000px) {
  .topbar .connection-button small, .topbar .sync-label, .topbar .outlet-control > span { display:none; }
  .topbar .connection-button { width:36px; padding:0; justify-content:center; }
  #kasir .pos-layout { grid-template-columns:minmax(0,1fr) minmax(280px,40%); }
  #kasir .product-grid { grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); }
}
@media (max-width:650px), (max-width:850px) and (orientation:portrait) {
  .app-shell .topbar { height:auto; min-height:66px; flex-basis:auto; flex-wrap:wrap; gap:5px 8px; padding:6px 10px; }
  .topbar .page-heading { flex:1 1 auto; }
  .topbar .page-heading h1 { font-size:16px; }
  .topbar .eyebrow { display:none; }
  .topbar-actions { flex:0 0 100%; flex-wrap:wrap; justify-content:space-between; gap:5px; }
  .topbar-actions .live-clock { display:block; font-size:11px; }
  .topbar-actions .finance-server-button { flex:1 1 75px; min-width:0; max-width:110px; padding:6px!important; font-size:11px!important; }
  .topbar-actions .outlet-control select { max-width:100px; padding:4px; font-size:11px; }
  .topbar-actions .help-button { display:block; padding:0 8px; height:32px; font-size:11px; }
  .topbar-actions .help-button::before { content:none; }
  .topbar-actions .help-button { width:auto; }
  .toast { left:12px; bottom:82px; max-width:calc(100vw - 24px); }
  .topbar-actions .icon-button, .topbar-actions .connection-button, .topbar-actions .sync-status-button { height:32px; width:30px; flex-shrink:0; }
  #kasir .pos-layout { display:block; }
  #kasir .catalog-panel { padding:12px 12px 68px; }
  #kasir .product-grid { grid-template-columns:repeat(auto-fill,minmax(125px,1fr)); gap:10px; }
  #kasir .catalog-header h2 { font-size:17px; }
  #kasir .catalog-header p { display:none; }
  #kasir .cart-panel { position:absolute; inset:auto 0 0; height:calc(100% - 10px); padding:0 12px 10px; border:1px solid var(--line); border-radius:16px 16px 0 0; background:white; z-index:25; box-shadow:0 -8px 30px #06294d22; transform:translateY(calc(100% - 58px)); transition:transform .2s ease; }
  #kasir .cart-panel.sheet-open { transform:translateY(0); }
  #kasir .cart-sheet-toggle { display:grid; grid-template-columns:1fr auto 18px; flex:0 0 58px; height:58px; width:calc(100% + 24px); margin:0 -12px; padding:19px 12px 8px; align-items:end; }
  #kasir .cart-title-row { display:none; }
  #kasir .cart-panel:not(.sheet-open) > :not(.cart-sheet-toggle) { visibility:hidden; }
  #kasir .cart-item { padding:12px 0; }
}
@media (prefers-reduced-motion:reduce) { .app-shell > .sidebar, #kasir .cart-panel { transition:none; } }
