/* Phase 3 — Utilities */
.sg-flex{display:flex;}
.sg-inline-flex{display:inline-flex;}
.sg-wrap{flex-wrap:wrap;}
.sg-align-center,.sg-ai-center{align-items:center;}
.sg-justify-between,.sg-jc-between{justify-content:space-between;}
.sg-justify-end,.sg-jc-end{justify-content:flex-end;}
.sg-gap-4{gap:4px;}
.sg-gap-6{gap:6px;}
.sg-gap-8{gap:8px;}
.sg-gap-10{gap:10px;}
.sg-gap-12{gap:12px;}
.sg-gap-16{gap:16px;}
.sg-gap-20{gap:20px;}
.sg-mt-8{margin-top:8px;}
.sg-mt-10{margin-top:10px;}
.sg-mt-12{margin-top:12px;}
.sg-mt-16{margin-top:16px;}
.sg-mb-0{margin-bottom:0;}
.sg-p-0{padding:0;}
.sg-w-full{width:100%;}
.sg-text-muted,.sg-muted{color:var(--sg-muted);}
.sg-grid{display:grid;}
.sg-grid-2{grid-template-columns:repeat(2,minmax(0,1fr));}
.sg-grid-3{grid-template-columns:repeat(3,minmax(0,1fr));}
.sg-col-span-2{grid-column:span 2;}
.sg-overflow-x-auto{overflow-x:auto;}
@media (max-width: 980px){.sg-grid-2,.sg-grid-3{grid-template-columns:1fr;}.sg-col-span-2{grid-column:auto;}}


.sg-ta-r{text-align:right !important;}

.is-hidden{display:none !important;}


/* Phase 2 — moved from app.css */
.sg-mt-1{margin-top:var(--sg-space-1) !important;}
.sg-mt-2{margin-top:var(--sg-space-2) !important;}
.sg-mt-3{margin-top:var(--sg-space-3) !important;}
.sg-mt-15{margin-top:8px !important;}
.sg-mb-1{margin-bottom:var(--sg-space-1) !important;}
.sg-mb-2{margin-bottom:var(--sg-space-2) !important;}
.sg-mb-3{margin-bottom:var(--sg-space-3) !important;}
.sg-mb-15{margin-bottom:8px !important;}
.sg-gap-1{gap:var(--sg-space-1) !important;}
.sg-gap-2{gap:var(--sg-space-2) !important;}
.sg-gap-3{gap:var(--sg-space-3) !important;}
.sg-stack{display:flex !important;flex-direction:column !important;gap:var(--sg-space-2) !important;}
.sg-text-center{text-align:center !important;}
.sg-text-right{text-align:right !important;}
.sg-fw-800{font-weight:800 !important;}
.sg-fw-900{font-weight:900 !important;}
.sg-fs-18{font-size:18px !important;}
.sg-w-90{width:90px !important;}
.sg-minw-110{min-width:110px !important;}
.sg-minw-120{min-width:120px !important;}
.sg-flex-between{justify-content:space-between !important;}
.sg-card-tight{padding:10px !important;}
.sg-kpi-num{font-weight:900;font-size:18px;}
.sg-grid-3-wide{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;}
.sg-grid-5{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;}
@media (max-width:1100px){.sg-grid-3-wide{grid-template-columns:repeat(2,minmax(0,1fr));}.sg-grid-5{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media (max-width:640px){.sg-grid-3-wide,.sg-grid-5{grid-template-columns:1fr;}}


/* Phase P2 — canonical responsive actions / tabs / toolbars */
.sg-actions-responsive{display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-width:0;}
.sg-actions-responsive > :where(.sg-btn,a.sg-btn,button.sg-btn,.sgr-btn,.sg-filter-iconbtn){min-width:0;}
.sg-actions-responsive--header{justify-content:flex-end;}
.sg-local-tabs-responsive{scrollbar-width:thin;scroll-snap-type:x proximity;}
.sg-local-tabs-responsive > :where(.sg-tab,.sgr-tab){scroll-snap-align:start;}
.sg-toolbar-cluster-responsive{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;min-width:0;}
.sg-toolbar-cluster-responsive > :first-child{min-width:0;}
.sg-toolbar-cluster-responsive > :last-child{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
@media (max-width:1100px){
  .sg-actions-responsive{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;align-items:stretch;}
  .sg-actions-responsive > :where(.sg-btn,a.sg-btn,button.sg-btn,.sgr-btn,.sg-filter-iconbtn){width:100%;justify-content:center;}
  .sg-local-tabs-responsive{display:flex!important;flex-wrap:nowrap!important;overflow:auto hidden!important;padding-bottom:6px!important;}
  .sg-local-tabs-responsive > :where(.sg-tab,.sgr-tab){min-width:max-content!important;white-space:nowrap!important;}
}
@media (max-width:640px){
  .sg-actions-responsive{grid-template-columns:1fr;}
  .sg-toolbar-cluster-responsive{grid-template-columns:1fr;}
}


/* Phase P2 — canonical page chrome / matrix / report export */
.sg-page-actions-canonical{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap;min-width:0;}
.sg-page-actions-canonical > :where(.sg-btn,a.sg-btn,button.sg-btn){min-width:0;}
.sg-tabs-canonical-mobile{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-width:0;}
.sg-tabs-canonical-mobile > :where(.sg-tab,.sgr-tab){min-width:0;}
.sg-filter-grid-canonical{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;align-items:end;}
.sg-filter-grid-canonical > .sg-field,.sg-filter-grid-canonical > .sgr-field{min-width:0;}
.sg-filter-grid-canonical > .is-actions,.sg-filter-grid-canonical > [data-role="actions"]{display:grid;align-content:end;}
.sg-perm-matrix-shell{display:grid;grid-template-columns:minmax(240px,300px) minmax(0,1fr);gap:14px;min-width:0;}
.sg-perm-matrix-shell__aside{min-width:0;border-right:1px solid var(--sg-divider,var(--sg-border));padding-right:10px;}
.sg-perm-matrix-shell__main{min-width:0;}
.sg-report-export-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-width:0;}
.sg-report-export-actions > :where(.sg-btn,a.sg-btn,button.sg-btn,.sgr-btn){min-width:0;}
@media (max-width:1100px){
  .sg-page-actions-canonical{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;}
  .sg-page-actions-canonical > :where(.sg-btn,a.sg-btn,button.sg-btn){width:100%;justify-content:center;}
  .sg-perm-matrix-shell{grid-template-columns:1fr;}
  .sg-perm-matrix-shell__aside{border-right:0;padding-right:0;padding-bottom:8px;border-bottom:1px solid var(--sg-divider,var(--sg-border));}
}
@media (max-width:760px){
  .sg-tabs-canonical-mobile{display:flex!important;flex-wrap:nowrap!important;overflow:auto hidden!important;padding-bottom:6px!important;scroll-snap-type:x proximity;}
  .sg-tabs-canonical-mobile > :where(.sg-tab,.sgr-tab){min-width:max-content!important;white-space:nowrap!important;scroll-snap-align:start;}
  .sg-report-export-actions,.sg-page-actions-canonical{grid-template-columns:1fr;}
  .sg-report-export-actions{display:grid;width:100%;}
  .sg-report-export-actions > :where(.sg-btn,a.sg-btn,button.sg-btn,.sgr-btn){width:100%;justify-content:center;}
}
