/* Shared layout rules apply to every module and dialog. */
:root{--muted:#647487;--line:#dfe6ed}
html{scrollbar-gutter:stable;scroll-padding-top:90px}body{overflow-wrap:break-word}
button,input,select,textarea{touch-action:manipulation}button:focus-visible,a:focus-visible{outline:3px solid #16858a;outline-offset:3px}
input,select,textarea,.field{min-width:0}.form-grid,.settings-grid,.report-selection,.report-filter-grid{min-width:0}
.form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.kpis{grid-template-columns:repeat(4,minmax(0,1fr))}
.page-heading>div,.toolbar>div,.panel-head>div,.between>div{min-width:0}.page-heading{flex-wrap:wrap}.page-heading>.flex{flex-wrap:wrap;gap:8px}
.panel-head.between,.panel-head>.between,.toolbar>.flex{flex-wrap:wrap}.panel-body,.table-wrap{min-width:0;max-width:100%}
.table-wrap{overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:#91b7b7 #eff4f4}
.table-wrap.has-horizontal-scroll{box-shadow:inset -5px 0 7px -7px #17324d,inset 5px 0 7px -7px #17324d}
.kpi .value{overflow-wrap:anywhere}.notice,.hint,.report-notes,.cell-sub{overflow-wrap:anywhere}
.sidebar{height:100dvh}.sidebar-brand{display:flex;align-items:center;justify-content:space-between}.sidebar-close,.menu-backdrop,.auth-mobile-brand{display:none}
.sidebar-bottom{padding:15px 20px}.sidebar-bottom .profile{margin-bottom:9px}.sidebar-bottom .profile>div{min-width:0;overflow-wrap:anywhere}
.nav-item{min-height:44px;color:#546779}.workspace{flex-shrink:0}.profile .icon-button{margin-left:auto;flex-shrink:0}
.topbar .breadcrumbs{min-width:0}.breadcrumbs b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:28vw}
.button+.button{margin-left:0}.page-heading>.button{flex-shrink:0}.pos{height:100dvh}.pos-user{overflow-wrap:anywhere}.pos-session-bar{flex-wrap:wrap}
dialog{max-height:calc(100dvh - 32px);overscroll-behavior:contain;scrollbar-gutter:stable}
.modal-head{position:sticky;top:0;background:white;z-index:2;gap:14px}.modal-head .icon-button{flex-shrink:0}
.modal-footer{position:sticky;bottom:0;z-index:2}.modal-head h2{overflow-wrap:anywhere}.modal-head p{line-height:1.6}
.modal-body{min-width:0}.auth-logo .brand{max-width:100%}.pos-empty{min-height:150px}
@media(max-width:1100px){.kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.topbar{gap:12px}.topbar-actions{gap:10px}.topbar .date{display:none}.settings-grid{grid-template-columns:minmax(0,1fr)}.pos-main{grid-template-columns:minmax(0,1fr) minmax(300px,36%)}.auth-hero h1{font-size:38px}.auth-aside{padding:35px}.auth-main{padding:32px}}
@media(max-width:760px){
  html{scroll-padding-top:74px}body{font-size:14px}.content{padding:22px 16px 40px;padding-bottom:max(40px,env(safe-area-inset-bottom))}
  .auth-mobile-brand{display:block;margin-bottom:32px}.auth-mobile-brand .brand{width:210px;height:50px;object-fit:cover}.auth-main{min-height:100dvh;padding:28px 22px}.auth-card h2{font-size:25px}.auth-card>p{margin-bottom:24px}
  .topbar{height:66px;padding:0 12px;gap:8px}.topbar>.flex{gap:6px;min-width:0;flex:1}.breadcrumbs{font-size:13px;gap:0}.breadcrumbs{font-size:0}.breadcrumbs>span{display:none}.breadcrumbs b{font-size:12px;max-width:35vw}.topbar-actions{gap:6px}.topbar-actions .pill{font-size:0;padding:8px}.topbar-actions .pill .dot{width:8px;height:8px}.topbar-actions .button{padding:8px;min-height:44px;font-size:11px;gap:5px}.topbar-actions .demo-banner{display:none}
  .mobile-menu,.icon-button{min-width:44px;min-height:44px}.sidebar{width:min(300px,calc(100vw - 44px));transition:none;z-index:21;padding-top:env(safe-area-inset-top)}.sidebar-brand{padding:17px 12px}.sidebar-brand .brand{width:185px;height:43px;object-fit:cover}.sidebar-close{display:grid}.nav-item{font-size:13px;padding:12px}.workspace{margin-top:13px}.sidebar-bottom{padding-bottom:max(14px,env(safe-area-inset-bottom))}
  .shell.menu-open .menu-backdrop{display:block;position:fixed;inset:0;background:#14283f88;z-index:20}body:has(.shell.menu-open){overflow:hidden}.shell:has(.menu-backdrop:focus-visible) .sidebar{outline:2px solid var(--teal)}
  .page-heading{display:flex;flex-direction:column;align-items:stretch;gap:17px;margin-bottom:22px}.page-heading h1{font-size:25px;line-height:1.25;letter-spacing:-.6px}.page-heading>.flex{justify-content:flex-start;gap:8px}.page-heading>.button{align-self:flex-start}.page-heading p{font-size:13px;margin-top:8px}.page-heading .button,.button.small{min-height:44px;font-size:12px;padding:10px 13px}
  .button{min-height:44px}.toolbar{gap:12px}.toolbar .search{min-width:0;width:100%;flex-basis:100%}.toolbar>.flex{flex-wrap:wrap;width:100%}.search{min-width:0;max-width:100%}.toolbar select{max-width:100%}.filters{gap:7px}.filter{min-height:42px;font-size:12px}.tabs{gap:20px}.tabs .tab{min-height:44px;font-size:13px}
  .kpis{gap:12px}.kpi{padding:17px 15px}.kpi .label{font-size:12px;line-height:1.5}.kpi .value,.finance-kpis .value{font-size:23px;margin:13px 0 9px}.kpi .foot{font-size:11px;line-height:1.6}.report-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.report-kpis .value{font-size:21px}
  .quick-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.quick-action{padding:16px;min-height:100px}.quick-action strong{font-size:12px}.dashboard-grid{gap:18px}.panel-head,.panel-body{padding:18px}.panel-head{gap:12px;flex-wrap:wrap}.panel-head h2{line-height:1.5}.panel-head .flex{flex-wrap:wrap}.panel-head.between,.panel-head>.between{align-items:flex-start}
  .form-grid,.invoice-header-grid{grid-template-columns:minmax(0,1fr)}.form-grid .full{grid-column:auto}.field label{font-size:13px;line-height:1.5}input:not([type=checkbox]),select,textarea{font-size:16px;min-height:46px}.check{font-size:13px}.check input{width:18px;height:18px;flex-shrink:0}.hint,.notice{font-size:12px;line-height:1.8}.invoice-party-row{align-items:stretch}.invoice-party-row>.field{flex-basis:100%}.invoice-bottom{grid-template-columns:minmax(0,1fr);gap:18px}.invoice-meta{flex-direction:column;gap:14px}.invoice-meta>div{min-width:0}.invoice-totals{padding:14px}
  dialog,dialog.wide,dialog.invoice-editor{width:calc(100vw - 16px);max-width:none;max-height:calc(100dvh - 16px);border-radius:15px;margin:auto;padding:0}.modal-head{padding:15px 16px}.modal-head h2{font-size:19px}.modal-head p{font-size:12px}.modal-body{padding:20px 16px}.modal-footer{padding:13px 16px;padding-bottom:max(13px,env(safe-area-inset-bottom));gap:8px}.modal-footer .button{flex:1;white-space:normal;line-height:1.5}.modal-body .table-wrap{margin:16px 0;max-width:100%}
  .editable-table{min-width:0!important;width:100%!important;table-layout:auto}.editable-table thead{display:none}.editable-table tbody{display:block}.editable-table tr{display:block;border:1px solid var(--line);border-radius:10px;margin-bottom:14px;padding:12px;background:#fbfcfe}.editable-table td{display:block!important;width:100%!important;min-width:0!important;border:0;padding:7px 0!important;white-space:normal}.editable-table td::before{content:attr(data-label);display:block;font-size:12px;font-weight:600;color:#5e6e80;margin:0 0 7px}.editable-table td:empty{display:none!important}.editable-table input,.editable-table select{font-size:16px!important;width:100%!important;min-width:0!important;min-height:44px!important;margin-bottom:6px}.editable-table .money{padding-top:0}.editable-table .icon-button{background:#faecec;color:var(--danger)}
  .recipe-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.recipe-card{padding:15px;min-height:190px}.recipe-card h3{font-size:12px}.recipe-card-top{flex-wrap:wrap;gap:8px}.recipe-card-bottom{gap:8px;align-items:flex-start;flex-wrap:wrap}.recipe-card-bottom strong{font-size:12px}.recipe-card p{font-size:11px;line-height:1.5}.status-row{align-items:flex-start;gap:12px;line-height:1.7}.status-row .badge{max-width:58%}.status-row>.badge{flex-shrink:0}.account-cards{grid-template-columns:minmax(0,1fr)}.report-selection,.report-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.report-selection>.field:first-child{grid-column:1/-1}.report-run-row{gap:14px}.report-caption>small{white-space:normal}.report-pagination{padding:14px;font-size:12px}.report-pagination .flex{gap:8px;flex-wrap:wrap}.report-print-head h1{font-size:22px}
  .pos{height:auto;min-height:100dvh}.pos-main{grid-template-columns:minmax(0,1fr)}.pos-header{height:auto;min-height:72px;padding:12px;flex-wrap:wrap;gap:8px}.pos-header .brand{width:155px;height:40px;object-fit:cover}.pos-header .flex{gap:6px;flex-wrap:wrap}.pos-header .button{font-size:12px;padding:8px 10px}.pos-session-bar{padding:12px 16px;gap:12px}.pos-session-bar .button{flex:1}.pos-products{padding:22px 16px}.pos-products h1{font-size:24px}.pos-grid{gap:12px}.product-tile{padding:15px;min-height:160px}.product-tile strong{font-size:13px}.pos-products .toolbar{margin:20px 0}.pos-cart{border:1px solid var(--line);border-radius:15px;margin:0 12px 20px;max-width:calc(100% - 24px)}.cart-head,.cart-summary{padding:19px}.cart-lines{padding:0 18px;max-height:none}.cart-line h3{max-width:none}.payment-methods{gap:7px}.payment-method{min-height:50px}.qty-stepper button{min-width:42px;min-height:42px}.checkout{min-height:50px}.receipt{padding:15px;max-width:100%}.receipt-signatures{gap:20px}.print-form .line{flex-wrap:wrap;gap:6px}.print-form .line span{overflow-wrap:anywhere}.retail-welcome{padding:28px 16px}.retail-welcome h1{font-size:27px}.register-card{padding:21px}.upload-zone{padding:25px 16px}.upload-zone .flex{flex-wrap:wrap;justify-content:center}#toasts{right:12px;left:12px;bottom:max(14px,env(safe-area-inset-bottom));max-width:none}.toast{padding:14px 16px;font-size:13px}.receipt-print{padding:10px}
}
@media(max-width:360px){.recipe-grid,.report-selection,.report-filter-grid{grid-template-columns:minmax(0,1fr)}.report-selection>.field:first-child{grid-column:auto}.kpi .value{font-size:21px}.breadcrumbs b{max-width:30vw}.topbar-actions .button svg{display:none}.recipe-card{min-height:160px}.closing-metrics{grid-template-columns:minmax(0,1fr)}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition:none!important;scroll-behavior:auto!important}}
@media print{.menu-backdrop,.sidebar-close,.auth-mobile-brand{display:none!important}.modal-head,.modal-footer{position:static}dialog{max-height:none;scrollbar-gutter:auto}.table-wrap{box-shadow:none!important}.editable-table tr{display:table-row}.editable-table td{display:table-cell!important}.editable-table td::before{display:none}.editable-table thead{display:table-header-group}.editable-table tbody{display:table-row-group}html{scrollbar-gutter:auto}.pos-cart{margin:0;border:0}}
