/* Transaction forms and the receipt share a compact layout at every width. */
:root{--page-accent:#286b52;--page-ink:#204f3c}
.login-card .auth-error{margin:0 0 14px;padding:11px 13px;border:1px solid #edc9c1;border-radius:9px;background:#fff2ee;color:#a13628;font-size:14px;line-height:1.6;overflow-wrap:anywhere}
.login-card .auth-error[hidden]{display:none}
.field:has(input[required]:not(:disabled),select[required]:not(:disabled),textarea[required]:not(:disabled))>span::after,.required-label::after{content:" *";color:#b43b32;font-size:14px;font-weight:700;margin-left:3px}
.button.primary{background:var(--page-accent,#286b52);border-color:var(--page-accent,#286b52);color:#fff}
.dialog-card{--page-accent:#286b52;--page-ink:#204f3c;color:#20352b;display:flex;flex-direction:column;max-height:90dvh}
.dialog-card>header,.dialog-card>footer{flex-shrink:0}
.dialog-card>footer{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}
.dialog-card>.dialog-body{flex:1;min-height:0;max-height:none;overflow-y:auto}
.dialog-card footer .button.primary{background:#286b52;border-color:#286b52;color:#fff;min-width:100px}
.dialog-card footer .button.primary:disabled{background:#557566;color:#fff;opacity:.72}
.dialog-body{overflow-x:hidden}
.dialog-card header h2{color:#20352b}
.sidebar nav{margin-top:24px}
.order-actions{display:flex;align-items:center;justify-content:flex-end;gap:7px;white-space:nowrap}
.order-actions .button{min-width:54px}
.category-tabs{display:flex;flex-wrap:wrap;gap:6px;padding:10px 14px;max-height:112px;overflow-y:auto;overflow-x:hidden;flex-shrink:0;border-bottom:1px solid #e5ece6}
.category-tabs .button{min-height:32px;white-space:normal;text-align:left;overflow-wrap:anywhere}
.category-tabs .button.soft{background:#e6f1e9;border-color:#b5d0bd;color:#23523b}
.page-pos .order-builder{grid-template-columns:minmax(0,1fr) minmax(320px,410px);height:calc(100dvh - 110px);min-height:0;align-items:stretch}
.page-pos .builder-main,.page-pos .checkout-rail{display:flex;flex-direction:column;min-width:0;min-height:0;height:100%;overflow:hidden}
.page-pos .builder-main>.catalog-section{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
.page-pos .builder-main>.customer-section{flex-shrink:0}
.page-pos .builder-main:not(:has(.catalog-section))>.customer-section{display:flex;flex-direction:column;flex:1;min-height:0}
.page-pos .picker-panel{min-height:0;flex:1}
.page-pos .picker-list{max-height:none;min-height:0;flex:1;overflow-y:auto;overflow-x:hidden}
.page-pos .catalog-strip{flex-wrap:wrap;flex-shrink:0}
.page-pos .catalog-strip .searchbox{min-width:140px;flex:1}
.page-pos .mini-catalog{flex:1;min-height:0;max-height:none;grid-auto-rows:min-content;align-content:start;overflow-y:auto;overflow-x:hidden;padding:10px 0}
.page-pos .mini-product{min-height:65px;gap:8px;padding:10px}
.page-pos .mini-product b{white-space:normal;overflow-wrap:anywhere;font-size:13px}
.page-pos .mini-product>.icon{flex-shrink:0;width:16px}
.page-pos .checkout-rail{position:static;padding:15px 16px;border-top:3px solid #2b6da5}
.checkout-head{flex-shrink:0}
.receipt-scroll{flex:1;min-height:0;min-width:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-gutter:stable}
.receipt-items,.receipt-item{min-width:0;max-width:100%}
.receipt-item{padding:14px 0;border-bottom:1px solid #e5ece6}
.receipt-item-heading{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:10px}
.receipt-item-heading>b{font-size:14px;overflow-wrap:anywhere;white-space:normal}
.receipt-item-heading>strong{white-space:nowrap;font-size:15px;color:#244435}
.receipt-item-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:8px}
.receipt-item-meta small{min-width:0;overflow-wrap:anywhere}
.receipt-item .qty-stepper{display:flex;align-items:center;gap:4px;flex-shrink:0}
.receipt-item .qty-stepper .button{width:30px;min-width:30px;min-height:30px;height:30px;background:#f4f7f4;border:1px solid #dce5df;border-radius:7px}
.receipt-item .qty-stepper>span{min-width:22px;text-align:center;font-variant-numeric:tabular-nums}
.receipt-item-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.receipt-item-controls .field{min-width:0;margin:9px 0 0}
.receipt-item-controls input,.receipt-item-controls select{min-width:0;width:100%;max-width:100%;min-height:38px}
.discount-control{display:flex;align-items:center;gap:5px;min-width:0}
.discount-control input{flex:1;width:0}
.discount-control>span{flex-shrink:0;color:#6f7d75}
.order-detail-fields{padding:10px 0 2px}
.order-detail-fields .field{min-width:0}
.order-detail-fields input{min-width:0;max-width:100%}
.receipt-footer{flex-shrink:0;border-top:1px solid #dce5df;padding-top:4px}
.receipt-footer .checkout-total{padding:12px 0}
.receipt-footer>small{text-align:center;padding-top:8px}
.receipt-scroll .empty{padding:26px 4px}
.record-detail-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.record-detail-heading p{font-size:12px;color:#6f7d75;margin-top:5px}
.record-item{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;padding:12px 0;border-bottom:1px solid #e5ece6}
.record-item b{font-size:13px;overflow-wrap:anywhere}
.record-item small{margin-top:5px;white-space:normal;line-height:1.7}
.record-item>strong{white-space:nowrap;align-self:center}
.order-note{margin:12px 0;color:#5d6d63;font-size:12px;overflow-wrap:anywhere}
.refund-entry{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-top:20px;margin-top:12px;border-top:1px solid #e5ece6}
.refund-entry .button.link{font-weight:600;color:#b43b32;font-size:12px;white-space:normal}
.payment-row{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.payment-row .field{min-width:0}
.payment-validation{padding:10px 12px;margin-top:12px;border-radius:8px;color:#9d3f32;background:#fff1ed;font-size:12px}
.payment-validation[hidden]{display:none}
.checkout-staff{padding:14px;margin-bottom:14px;border:1px solid #dce5df;background:#f8faf8;border-radius:10px}
.checkout-staff h3{margin-bottom:4px}
.allocation-row{grid-template-columns:minmax(0,1fr) minmax(80px,120px)}
.allocation-row input{width:100%;min-width:0;min-height:38px}
.allocation-total{display:flex;align-items:center;justify-content:space-between;padding-top:10px}
.member-wallets{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:14px 0}
.member-wallets>div{padding:12px;background:#f4f8f4;border:1px solid #dce6de;border-radius:9px}
.member-wallets span{display:block;color:#66786b;font-size:12px}
.member-wallets b{display:block;margin-top:6px;font-size:18px;font-variant-numeric:tabular-nums}
.member-record-tabs{padding:0 0 10px}
.member-record-tabs small{display:inline;margin-left:6px;color:inherit}
.member-record-scroll{max-height:min(46dvh,440px);overflow-y:auto;overflow-x:hidden;padding-top:8px;overscroll-behavior:contain}
.member-record{border:1px solid #dce5df;border-radius:10px;margin:0 0 9px;background:#fff;overflow:hidden}
.member-record summary{display:flex;align-items:center;gap:12px;padding:15px;cursor:pointer;list-style:none}
.member-record summary::-webkit-details-marker{display:none}
.member-record summary:focus-visible{outline:2px solid #7ba68e;outline-offset:-2px}
.member-record summary>span{flex:1;min-width:0}
.member-record summary small{margin-top:4px}
.member-record summary>.icon{width:16px;height:16px;color:#819186;flex-shrink:0;transition:transform .15s}
.member-record[open] summary>.icon{transform:rotate(180deg)}
.member-record[open] summary{background:#f7faf7;border-bottom:1px solid #e5ece6}
.member-record-body{padding:0 15px 12px}
.member-record-body .history-total{display:flex;justify-content:space-between;padding:12px 0 0;margin:0}
.recharge-record{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:15px}
.recharge-record small{margin-top:5px}
.recharge-record>strong{color:#286b52}
.category-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:15px 18px;border-bottom:1px solid #e7eee8}
.category-row:last-child{border-bottom:0}
.category-row small{margin-top:4px}
.checkbox-line{display:flex;gap:10px;align-items:flex-start;padding:12px;border:1px solid #dce5df;border-radius:9px;margin:12px 0}
.checkbox-line[hidden]{display:none}
.checkbox-line input[type=checkbox]{width:18px;height:18px;min-height:18px;flex-shrink:0;margin:2px 0;accent-color:#286b52}
.checkbox-line small{margin-top:4px}
.import-intro p{margin:7px 0 12px;color:#66786b;font-size:12px;line-height:1.7}
.import-summary{font-weight:650;padding:12px 0}
.import-errors{max-height:200px;overflow-y:auto;padding:12px;background:#fff3ef;border-radius:9px;color:#943f34}
.import-errors p{margin:5px 0}
.import-preview{max-height:280px;overflow-y:auto;border:1px solid #dce5df;border-radius:9px;margin-bottom:9px}
.import-preview>div{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border-bottom:1px solid #e5ece6}
.import-preview small{margin-top:4px}
.staff-card>.row{margin-bottom:12px}
.staff-card .staff-metric strong{font-variant-numeric:tabular-nums}
.desktop-todo{position:relative;display:inline-flex;width:44px;height:44px;flex-shrink:0;color:#286b52}
.desktop-todo>.icon{width:25px;height:25px}
.mobile-appbar-todo{width:44px!important;height:44px!important;min-width:44px;padding:0;flex-shrink:0}
.mobile-appbar-todo>span{display:flex;align-items:center;justify-content:center}
.mobile-appbar-todo>span .icon{width:25px!important;height:25px!important}
.mobile-appbar-todo>b{min-width:20px!important;height:20px!important;font-size:11px!important;right:-4px!important;top:-4px!important}
.desktop-todo b{position:absolute;right:-6px;top:-6px;display:grid;place-items:center;min-width:19px;height:19px;padding:0 4px;border:2px solid #fff;border-radius:12px;background:#b24a36;color:#fff;font-size:10px;line-height:1}
.refund-entry .button{color:#b43b32;text-decoration:underline;text-underline-offset:4px;font-weight:600;min-height:40px;padding:8px 0;cursor:pointer}
.refund-entry .button:hover,.refund-entry .button:focus-visible{color:#8b211e;background:#fff0ed}
.payment-method-actions{display:flex;justify-content:flex-start;margin:6px 0}
.payment-lines .payment-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.setting-list{grid-template-columns:repeat(2,minmax(0,1fr))}
#product-category-option[hidden],#service-commission-option[hidden]{display:none}
.category-picker-heading{display:flex;justify-content:space-between;align-items:center;margin:18px 0 10px;font-size:14px}
.category-picker-heading>span{color:#587063;font-size:12px}
.category-product-search{width:100%;margin-bottom:10px;min-height:42px}
.category-product-list{max-height:44dvh;overflow-y:auto;overflow-x:hidden;border:1px solid #dce5df;border-radius:10px;overscroll-behavior:contain}
.category-product-group h3{display:flex;justify-content:space-between;padding:10px 12px;background:#f1f5f2;font-size:12px;color:#5b6f62}
.category-product-option{display:flex;align-items:center;gap:11px;padding:12px;min-height:54px;cursor:pointer;border-top:1px solid #e8eee9;background:#fff}
.category-product-option:has(:checked){background:#f1f8f3}
.category-product-option input[type=checkbox]{width:19px;height:19px;min-height:19px;margin:0;flex:0 0 19px;accent-color:#286b52}
.category-product-option>span:not(.pill){flex:1;min-width:0}
.category-product-option b{display:block;font-size:14px;overflow-wrap:anywhere}
.category-product-option small{display:block;margin-top:4px;color:#6f7d75;line-height:1.5}
.category-products-empty{padding:16px 12px;color:#6f7d75;font-size:13px}
.category-product-option[hidden],.category-product-group[hidden],.category-products-empty[hidden]{display:none}
.catalog-card-list,.customer-card-list,.commission-record-list{display:grid;gap:12px;padding:12px;background:#f3f6f3}
.catalog-card,.customer-card,.commission-record{border:1px solid #d9e3dc;border-radius:12px;background:#fff;overflow:hidden;min-width:0}
.catalog-card,.customer-card{padding:16px}
.catalog-card-heading,.customer-card-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:14px}
.catalog-card-heading>div{min-width:0}
.catalog-card-heading b,.customer-card-heading>b{font-size:16px;color:#203d30;line-height:1.5;overflow-wrap:anywhere}
.catalog-card-heading small{display:block;color:#677b6d;font-size:12px;line-height:1.6;margin-top:5px}
.catalog-card-heading>strong{font-size:18px;color:#264f3c;white-space:nowrap;padding-top:2px}
.catalog-card-footer,.customer-card-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:14px;padding-top:12px;border-top:1px solid #e6ece7}
.catalog-card-facts{display:flex;align-items:center;flex-wrap:wrap;gap:8px;color:#65756b;font-size:12px}
.catalog-card-actions,.customer-card-footer>div{display:flex;align-items:center;gap:7px;flex-shrink:0}
.catalog-card-actions .button,.customer-card-footer .button{min-height:36px;padding:7px 10px}
.customer-card-contact,.customer-card-number{color:#667a6c;font-size:12px;line-height:1.6;margin-top:5px;overflow-wrap:anywhere}
.customer-card-wallet{margin-top:13px;padding:12px;border:1px solid #e0e9e2;border-radius:9px;background:#f7faf7}
.customer-card-wallet>div:first-child{display:flex;justify-content:space-between;align-items:center;font-size:12px;color:#546d5d}
.customer-card-wallet strong{font-size:20px;color:#24553e}
.customer-card-stores{display:flex;flex-direction:column;gap:6px;margin-top:10px;padding-top:9px;border-top:1px solid #e0e9e2}
.customer-card-stores>span{display:flex;align-items:baseline;justify-content:space-between;gap:12px;color:#68796c;font-size:11px}
.customer-card-stores b{color:#4e6757;font-weight:500;white-space:nowrap}
.customer-card-footer>small{font-size:11px;line-height:1.6;color:#6d7e72}
.commission-record summary{display:block;list-style:none;padding:15px 16px;cursor:pointer}
.commission-record summary::-webkit-details-marker{display:none}
.commission-record-heading{display:grid;grid-template-columns:minmax(0,1fr) auto 16px;align-items:center;gap:12px}
.commission-record-heading>b{font-size:16px;color:#203d30}
.commission-value{display:flex;align-items:baseline;gap:7px;color:#286b52}
.commission-value small{font-size:12px;color:#647969}
.commission-value strong{font-size:20px}
.commission-record-heading>.icon{width:16px;height:16px;color:#718276;transition:transform .2s}
.commission-record[open] .commission-record-heading>.icon{transform:rotate(180deg)}
.commission-record-meta{display:flex;justify-content:space-between;flex-wrap:wrap;gap:6px;font-size:12px;line-height:1.6;color:#687b6c;margin-top:9px}
.commission-record-staff{font-size:12px;color:#485f4e;margin-top:8px;line-height:1.6}
.commission-record-body{padding:0 16px 10px;background:#f8faf8;border-top:1px solid #dee7e0}
.commission-item{display:flex;justify-content:space-between;gap:12px;padding:13px 0;border-bottom:1px solid #e3ebe5;font-size:13px}
.commission-item:last-child{border-bottom:0}
.commission-item>div:first-child{min-width:0}
.commission-item small{display:block;margin-top:5px;color:#6a7d6e;font-size:11px;line-height:1.5}
.commission-item-amounts{display:flex;flex-direction:column;gap:5px;align-items:flex-end;flex-shrink:0;color:#667969;font-size:11px}
.commission-item-amounts b{font-size:13px;margin-left:5px;font-weight:600}
.commission-detail-row[hidden]{display:none}
.commission-detail-row>td{background:#f5f9f5!important;padding:4px 22px!important}
.mobile-customer-actions{display:flex;align-items:center;gap:4px}
.mobile-customer-actions .button{font-size:12px;min-height:36px;padding:7px 9px;white-space:nowrap}
.mobile-customer-actions .icon{width:15px;height:15px}
.settings-account-panel{margin-top:16px;border:1px solid #dce6df;border-radius:14px;background:#fff;overflow:hidden}
.settings-account-row{display:flex;align-items:center;gap:12px;width:100%;min-height:68px;padding:14px 16px;border:0;background:#fff;color:#284b38;font-size:14px;font-weight:650;text-align:left}
.settings-account-icon{display:grid;place-items:center;flex-shrink:0;width:38px;height:38px;border-radius:11px;background:#eef3ef;color:#4b6f59}
.settings-account-icon .icon{width:21px;height:21px}
.settings-account-row>.icon{margin-left:auto;width:18px;color:#8a9d8f}
.settings-signout{display:flex;align-items:center;justify-content:center;gap:9px;width:100%;min-height:48px;margin-top:14px;border:1px solid #e2d7d2;border-radius:12px;background:#fff;color:#a64937;font-size:14px;font-weight:650}
.settings-signout .icon{width:19px;height:19px}
@media(min-width:700px) and (max-width:1023px){
  .catalog-card-list,.customer-card-list{grid-template-columns:repeat(2,minmax(0,1fr))}
  .customer-card{display:flex;flex-direction:column}
  .customer-card-footer{margin-top:auto;padding-top:12px}
  .customer-card-wallet{margin-bottom:14px}
}
@media(max-width:390px){
  .page-clients .mobile-brand-mark{display:none}
  .mobile-customer-actions .button{padding:7px 6px;font-size:11px;gap:4px}
  .catalog-card-footer{align-items:flex-start}
  .catalog-card-facts{gap:6px;align-items:flex-start;flex-direction:column}
}
@media(max-width:1023px){
  .management-tabs{display:none}
  .mobile-order-card-meta,.mobile-order-card-foot,.mobile-client-card-meta,.mobile-client-card-foot{margin-left:0}
  .mobile-order-card-actions{flex-wrap:wrap;justify-content:flex-end}
  .page-pos .order-builder{height:calc(100dvh - 94px)}
}
@media(max-width:767px){
  .page-pos .order-builder{grid-template-columns:minmax(0,1fr);height:auto;min-height:0;gap:12px}
  .page-pos .builder-main{max-height:57dvh;min-height:260px}
  .page-pos .checkout-rail{height:auto;max-height:72dvh;min-height:240px}
  .page-pos .mini-catalog{grid-template-columns:repeat(2,minmax(0,1fr));max-height:30dvh;min-height:110px}
  .page-pos .picker-list{max-height:34dvh}
  .receipt-scroll{max-height:47dvh}
  .receipt-item .qty-stepper .button{min-width:36px;min-height:36px;height:36px;width:36px}
  .receipt-item-controls input,.receipt-item-controls select{min-height:42px}
  .dialog-card footer .button{min-height:42px;min-width:0;white-space:normal}
  .category-tabs .button{min-height:36px}
  .category-row{padding:14px}
  .member-record summary,.recharge-record{padding:13px}
}

/* One vertical scroll owner per page; the order builder has sibling scroll areas. */
html:has(.app-shell),body:has(.app-shell){height:100%;overflow:hidden}
.app-shell{height:100dvh;min-height:0;overflow:hidden}
.app-shell .main-shell{display:flex;flex-direction:column;height:100%;min-height:0}
.app-shell .topbar{flex-shrink:0}
.app-shell .content{flex:1;width:100%;max-width:none;min-width:0;min-height:0;margin:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain}
.panel>.scroll-area{max-height:none;overflow:visible}
.content>.panel .category-tabs{max-height:none;overflow:visible}
.data-table{width:100%;min-width:0}
.data-table td{overflow-wrap:anywhere}
#dialog{overflow:hidden;padding:0;max-height:90dvh}
.dialog-body .member-record-scroll,.dialog-body .category-product-list,.dialog-body .import-preview,.dialog-body .import-errors{max-height:none;overflow:visible}
@media(min-width:768px){
  .page-pos:has(.order-builder) .content{overflow:hidden}
  .page-pos .order-builder{height:100%;min-height:0}
}
@media(max-width:767px){
  .page-pos .order-builder{height:auto;min-height:0}
  .page-pos .builder-main,.page-pos .checkout-rail{height:auto;max-height:none;min-height:0;overflow:visible}
  .page-pos .builder-main>.catalog-section,.page-pos .picker-list,.page-pos .mini-catalog,.page-pos .receipt-scroll{max-height:none;overflow:visible}
  .page-pos .category-tabs{max-height:none;overflow:visible}
  .page-pos .receipt-scroll{flex:none}
}
@media(max-width:620px){
  .page-clients .filter-bar{flex-wrap:wrap;gap:9px}
  .page-clients .filter-bar>.segmented{flex:1;min-width:0}
  .page-clients .filter-bar>.searchbox{flex:1 0 100%;width:100%}
  .page-clients .filter-bar>select{max-width:45%}
}
