/* CTR SUITE — Unified workspace UX, 2026-09-21.
 * Scope intentional: preserve POS payment / table touch UI and print layout. */
:root{
  --ctr-title-size:clamp(20px,2vw,24px);
  --ctr-subtitle-size:13px;
  --ctr-section-title-size:15px;
  --ctr-body-size:13px;
  --ctr-small-size:11.5px;
  --ctr-label-size:11px;
  --ctr-control-h:44px;
  --ctr-page-gap:16px;
  --ctr-card-radius:16px;
  --ctr-card-radius-sm:12px;
}
/* Content hierarchy; existing data and page-specific interactions untouched. */
.main > :is(.module-page,.notifications-page,.profile-page,.customer-page,.opening-shift-page) :is(h1,h2,h3),
.main > .content :is(.pb-page-head,.m-page-head,.sales-page-head,.reports-page-head,.notifications-head) :is(h1,h2){line-height:1.24;letter-spacing:-.02em}
.main :is(.pb-stat-label,.pb-mini-label,.m-kpi span,.customer-stat span,.stat-card span,.tbl-stat-card span,.pb-period-note){font-size:11px!important;line-height:1.4!important;letter-spacing:0!important}
.main :is(.pb-stat-value,.m-kpi strong,.customer-stat strong,.tbl-stat-card strong){font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
/* Consistent keyboard affordance. No modification to JS submit handlers. */
.main :is(button,a,[role="button"],input,select,textarea,summary):focus-visible{outline:2px solid var(--blue,#2F6FEA)!important;outline-offset:2px}
.main :is(button,a,[role="button"],input,select,textarea){touch-action:manipulation}
.main :is(.module-page,.customer-page,.profile-page,.notifications-page) :is(button,.btn,.m-btn,.pb-btn),
.main .sales-modern-page :is(.btn,.sales-btn),
.main .content .pb-page-head .pb-btn{min-height:40px;line-height:1.25;max-width:100%;white-space:normal}
.main :is(.module-page,.customer-page,.profile-page,.notifications-page) :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea){font-size:14px;min-width:0}
.main :is(.module-page,.customer-page,.profile-page,.notifications-page) :is(input:not([type="checkbox"]):not([type="radio"]),select){min-height:40px}
/* Filters: wrap and let search occupy available room without pushing actions off screen. */
.main :is(.m-toolbar,.pb-filter-bar,.customer-toolbar,.filter-bar,.ctr-filter-card,.sales-toolbar,.pb-page-head,.pb-head-actions){min-width:0;max-width:100%;flex-wrap:wrap;gap:10px}
.main :is(.pb-search,.customer-search,.sales-search){min-width:min(100%,220px);flex:1 1 220px}
.main :is(.pb-filter-bar,.m-toolbar,.customer-toolbar,.filter-bar) :is(input,select){max-width:100%}
.main :is(.pb-filter-status,.pb-head-actions,.receipt-toolbar-controls){display:flex;flex-wrap:wrap;align-items:center;gap:8px}
/* Tables remain scrollable rather than shrinking numeric values to tiny text. */
.main :is(.pb-table,.m-table,.customer-table,.sales-table,.pmx-table,.team-table){font-variant-numeric:tabular-nums}
.main :is(.pb-table,.m-table,.customer-table,.sales-table,.pmx-table,.team-table) :is(td,th){font-size:12.5px;line-height:1.45;overflow-wrap:anywhere}
.main :is(.pb-table,.m-table,.customer-table,.sales-table,.pmx-table,.team-table) td.num{text-align:right;white-space:nowrap}
.main :is(.pb-table-wrap,.m-table-wrap,.sales-table-wrap,.customer-table-wrap,.table-responsive){max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
/* Text inside dialogs must remain legible on small devices, with internal scrolling. */
.main :is(.modal,.m-modal,.pmx-modal,.pb-modal,.modal-content){max-height:min(92dvh,900px);max-width:calc(100vw - 24px)}
.main :is(.m-body,.modal-body,.pb-modal-body,.pmx-modal-body){overscroll-behavior:contain}
/* Purchase — one leading KPI, supporting totals visually secondary. */
.main .pb-summary-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,185px),1fr));gap:10px!important}
.main .pb-summary-grid .pb-card:first-child{border-color:color-mix(in srgb,var(--blue,#2F6FEA) 42%,var(--ctr-surface-border,#e2e8f0))!important;background:color-mix(in srgb,var(--blue,#2F6FEA) 5%,var(--card,#fff))}
.main .pb-summary-grid .pb-card:first-child .pb-stat-value{font-size:clamp(18px,2vw,24px)!important}
.main .pb-summary-grid .pb-card:not(:first-child){box-shadow:none!important}
.main .pb-period-note{flex-basis:100%;margin-top:2px}
/* Dashboard/read-only finance — keep numbers clear without adding redundant boxes. */
.main :is(.owner-kpi-grid,.finance-kpi-grid,.m-grid,.stats,.summary-grid){min-width:0}
.main :is(.owner-kpi-grid,.finance-kpi-grid,.m-grid,.stats,.summary-grid) > *{min-width:0}
.main .ctr-flow-nav{display:flex;flex-wrap:wrap;gap:7px;min-width:0}
.main .ctr-flow-nav a{min-height:38px;display:inline-flex;align-items:center;gap:7px}
@media(max-width:700px){
 :root{--ctr-page-x:14px;--ctr-page-top:17px;--ctr-page-bottom:86px;--ctr-control-h:44px}
 .main :is(.module-page,.customer-page,.profile-page,.notifications-page) :is(button,.btn,.m-btn,.pb-btn){min-height:44px}
 .main :is(.pb-page-head,.pb-head-actions,.m-toolbar,.filter-bar,.sales-toolbar){align-items:stretch}
 .main .pb-page-head .pb-head-actions{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
 .main .pb-page-head .pb-head-actions .pb-btn{min-width:0;justify-content:center}
 .main .pb-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px!important}
 .main .pb-summary-grid .pb-card{min-width:0;padding:12px!important}
 .main .pb-summary-grid .pb-stat-value{font-size:16px!important}
 .main .pb-search{flex-basis:100%}
 .main .pb-filter-bar{padding:12px!important}
 .main .pb-filter-bar .pb-filter-status{flex-basis:100%;overflow-x:auto;flex-wrap:nowrap;padding-bottom:2px}
 .main .pb-filter-bar .pb-chip{flex:0 0 auto;min-height:40px}
 .main .pb-month-filter{max-width:100%;flex:1 1 190px}
 .main :is(.m-toolbar,.customer-toolbar,.filter-bar) :is(input,select){min-width:0}
 .main :is(.pb-table,.m-table,.customer-table,.sales-table,.pmx-table,.team-table) :is(td,th){font-size:12.5px!important}
 .main :is(.modal,.m-modal,.pmx-modal,.pb-modal,.modal-content){max-height:calc(100dvh - 20px)!important;max-width:calc(100vw - 16px)!important}
}
@media(prefers-reduced-motion:reduce){.main :is(button,a,summary){scroll-behavior:auto}}
@media print{.main .receipt-toolbar{display:none!important}}
