/* OPS Gate — Unified Page Standard
   Explicit, opt-in layout contract. Only elements carrying ops-standard-* classes
   are normalized; legacy/global heuristics are intentionally avoided. */
:root{
  --ops-standard-max:1680px;
  --ops-standard-gap:1rem;
  --ops-standard-radius:18px;
  --ops-standard-border:var(--ops-ds-border,rgba(203,213,225,.88));
  --ops-standard-surface:var(--ops-ds-card-bg,#fff);
  --ops-standard-muted:var(--ops-ds-muted,#64748b);
  --ops-standard-text:var(--ops-ds-text,#0f172a);
  --ops-standard-shadow:0 14px 34px rgba(15,23,42,.07);
}

/* Keep standardized modules anchored to the top of the content viewport. */
#main-content {
  align-content: start !important;
}
#main-content .ops-standard-page {
  justify-content: flex-start !important;
  align-content: start !important;
}
#main-content .ops-standard-page > :is(.row,.container,.container-fluid,section,.card) {
  align-self: stretch !important;
}

/* Page flow: always header, KPI row, controls/tabs, then workspace. */
#main-content .ops-standard-page{
  box-sizing:border-box!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  gap:var(--ops-standard-gap)!important;
  width:min(100%,var(--ops-standard-max))!important;
  max-width:var(--ops-standard-max)!important;
  min-width:0!important;
  margin:0 auto!important;
  padding:.25rem .25rem 1.35rem!important;
}
#main-content .ops-standard-page > *{min-width:0!important;max-width:100%!important}
#main-content .ops-standard-page > .mb-3,
#main-content .ops-standard-page > .mb-4{margin-bottom:0!important}

/* Header / hero */
#main-content .ops-standard-hero{
  box-sizing:border-box!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:1rem 1.25rem!important;
  width:100%!important;
  min-height:0!important;
  height:auto!important;
  max-height:none!important;
  flex:0 0 auto!important;
  align-self:stretch!important;
  margin:0!important;
  padding:clamp(.9rem,1.05vw,1.1rem) clamp(1rem,1.25vw,1.3rem)!important;
  border:1px solid var(--ops-standard-border)!important;
  border-radius:var(--ops-standard-radius)!important;
  background:linear-gradient(118deg,var(--ops-standard-surface) 0%,var(--ops-standard-surface) 62%,rgba(37,99,235,.07) 100%)!important;
  box-shadow:var(--ops-standard-shadow)!important;
  overflow:hidden!important;
}
#main-content .ops-standard-hero > :first-child{min-width:0!important;max-width:980px!important}
#main-content .ops-standard-hero > :last-child:not(:first-child){
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  flex-wrap:wrap!important;
  gap:.55rem!important;
  width:auto!important;
  max-width:100%!important;
}
#main-content .ops-standard-hero h1,
#main-content .ops-standard-hero h2,
#main-content .ops-standard-hero h3{
  margin:.3rem 0 0!important;
  color:var(--ops-standard-text)!important;
  font-size:clamp(1.45rem,2.05vw,2.05rem)!important;
  line-height:1.12!important;
  font-weight:950!important;
  letter-spacing:-.025em!important;
}
#main-content .ops-standard-hero p{
  max-width:920px!important;
  margin:.35rem 0 0!important;
  color:var(--ops-standard-muted)!important;
  line-height:1.48!important;
}
#main-content .ops-standard-hero .btn{min-height:44px!important;border-radius:12px!important;font-weight:850!important}
/* Prevent legacy module flex/height rules from stretching standardized page headers. */
#main-content :is(.ops-page-header,.ops-core-hero,.ops-admin-hero,.ops-ann-hero,.ops-requests-hero,.ops-people-hero,.ops-ticket-hero,.ops-events-hero,.ops-workshops-header,.ops-assets-hero,.ops-suggestions-hero).ops-standard-hero{
  min-height:0!important;
  height:auto!important;
  block-size:auto!important;
  max-block-size:none!important;
  flex-grow:0!important;
  flex-shrink:0!important;
  align-self:stretch!important;
}

/* KPI rows. Bootstrap row widths/margins are explicitly neutralized. */
#main-content .ops-standard-kpi-grid{
  box-sizing:border-box!important;
  display:grid!important;
  gap:.85rem!important;
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  padding:0!important;
  align-items:stretch!important;
}
#main-content .ops-standard-kpi-grid--3{grid-template-columns:repeat(3,minmax(0,1fr))!important}
#main-content .ops-standard-kpi-grid--4{grid-template-columns:repeat(4,minmax(0,1fr))!important}
#main-content .ops-standard-kpi-grid--5{grid-template-columns:repeat(5,minmax(0,1fr))!important}
#main-content .ops-standard-kpi-grid--6{grid-template-columns:repeat(6,minmax(0,1fr))!important}
#main-content .ops-standard-kpi-grid > [class*="col-"],
#main-content .ops-standard-kpi-grid > .ops-module-kpi-slot,
#main-content .ops-standard-kpi-grid > .ops-events-stat-slot{
  display:block!important;
  width:auto!important;
  max-width:none!important;
  min-width:0!important;
  margin:0!important;
  padding:0!important;
}
#main-content .ops-standard-kpi-grid :is(
  .ops-kpi-card,.ops-ann-stat,.ops-clients-stat,.ops-org-stat,.ops-assets-stat,
  .ops-people-stat,.ops-ticket-stat,.ops-events-stat,.ops-sub-stat,.ops-admin-kpi,
  .ops-suggestions-kpi,.ops-business-stat,.ops-timeline-stat
){
  box-sizing:border-box!important;
  display:block!important;
  width:100%!important;
  height:100%!important;
  min-height:118px!important;
  margin:0!important;
  padding:1rem!important;
  border:1px solid var(--ops-standard-border)!important;
  border-radius:var(--ops-standard-radius)!important;
  background:var(--ops-standard-surface)!important;
  box-shadow:var(--ops-standard-shadow)!important;
  overflow:hidden!important;
}
#main-content .ops-standard-kpi-grid :is(.ops-kpi-card,.ops-ann-stat,.ops-clients-stat,.ops-org-stat,.ops-assets-stat,.ops-people-stat,.ops-ticket-stat,.ops-events-stat,.ops-sub-stat,.ops-admin-kpi,.ops-suggestions-kpi) > :is(i,.bi){
  width:38px!important;
  height:38px!important;
  display:grid!important;
  place-items:center!important;
  border-radius:12px!important;
  background:rgba(37,99,235,.10)!important;
  color:var(--ops-primary,#2563eb)!important;
  font-size:1.08rem!important;
}
#main-content .ops-standard-kpi-grid :is(.ops-kpi-card,.ops-ann-stat,.ops-clients-stat,.ops-org-stat,.ops-assets-stat,.ops-people-stat,.ops-ticket-stat,.ops-events-stat,.ops-sub-stat,.ops-admin-kpi,.ops-suggestions-kpi) > :is(span,small){
  display:block!important;
  margin-top:.48rem!important;
  color:var(--ops-standard-muted)!important;
  font-size:.8rem!important;
  line-height:1.32!important;
  font-weight:850!important;
  overflow-wrap:anywhere!important;
}
#main-content .ops-standard-kpi-grid :is(.ops-kpi-card,.ops-ann-stat,.ops-clients-stat,.ops-org-stat,.ops-assets-stat,.ops-people-stat,.ops-ticket-stat,.ops-events-stat,.ops-sub-stat,.ops-admin-kpi,.ops-suggestions-kpi) > strong{
  display:block!important;
  margin-top:.15rem!important;
  color:var(--ops-standard-text)!important;
  font-size:clamp(1.55rem,2vw,2rem)!important;
  line-height:1.08!important;
  font-weight:950!important;
  overflow-wrap:anywhere!important;
}

/* Tabs and workspaces */
#main-content .ops-standard-tabs{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:.55rem!important;
  width:100%!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
}
#main-content .ops-standard-tabs .nav-link{
  min-height:46px!important;
  border-radius:13px!important;
  font-weight:850!important;
}
#main-content .ops-standard-workspace{width:100%!important;min-width:0!important;margin:0!important}
#main-content .ops-standard-workspace > .tab-pane{width:100%!important;min-width:0!important}

/* Panels, filters and registries */
#main-content .ops-standard-panel{
  box-sizing:border-box!important;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  margin:0!important;
  align-self:stretch!important;
  border:1px solid var(--ops-standard-border)!important;
  border-radius:var(--ops-standard-radius)!important;
  background:var(--ops-standard-surface)!important;
  box-shadow:var(--ops-standard-shadow)!important;
  overflow:hidden!important;
}
#main-content .ops-standard-panel > :is(.card-header,.ops-ann-panel-head,.ops-clients-panel-head,.ops-org-panel-head,.ops-people-panel-head,.ops-requests-panel-head,.ops-ticket-panel-head,.ops-assets-panel-head,.ops-events-section-title,.ops-admin-section-head){
  box-sizing:border-box!important;
  width:100%!important;
}
#main-content .ops-standard-panel :is(.table-responsive,.ops-core-table-shell,.ops-ann-table-wrap,.ops-clients-table-wrap,.ops-org-table-wrap,.ops-assets-table-wrap,.ops-ticket-table-wrap,.ops-events-table-wrap,.ops-sub-table-wrap,.ops-suggestions-table-wrap,.ops-upload-table-wrap){
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  overflow:auto!important;
}
#main-content .ops-standard-panel table{width:100%!important}
#main-content .ops-standard-panel > .card-header,
#main-content .ops-standard-panel > .card-body{width:100%!important;max-width:none!important}

/* Explicit primary page corrections. */
#main-content :is(#opsAnnouncementsHub,.ops-core-page--projects,#opsClientsPage,#opsOrganizationSettings,#opsWorkshopsRoot,#opsAssetsPage,.ops-core-page--employees,.ops-requests-hub,#opsEventsPage,.ops-sub-wrap,#opsTicketHub,#opsSuggestionsPage) > :is(.ops-standard-panel,.ops-standard-workspace,.tab-content,.ops-events-main-grid){width:100%!important;max-width:none!important;align-self:stretch!important}

#main-content .ops-core-page--projects > .ops-standard-panel .card-header,
#main-content #opsClientsPage > .ops-standard-panel .ops-clients-panel-head,
#main-content #opsAnnouncementsHub > .ops-standard-panel > div:first-of-type{
  width:100%!important;
  max-width:none!important;
}
#main-content .ops-core-page--projects > .ops-standard-panel .card-body,
#main-content #opsClientsPage > .ops-standard-panel,
#main-content #opsOrganizationSettings .tab-content,
#main-content #opsWorkshopsRoot > .ops-standard-panel,
#main-content #opsAssetsPage > .ops-standard-panel,
#main-content .ops-requests-hub > .ops-standard-panel{width:100%!important;max-width:none!important}

/* Requests history must not float to the right. */
#main-content .ops-requests-hub > .ops-standard-panel,
#main-content .ops-requests-hub .ops-requests-panel-head,
#main-content .ops-requests-hub .ops-requests-table-wrap{margin-inline:0!important;width:100%!important;max-width:none!important}

/* Events now use the full workspace: Highlights above Calendar, both full width. */
#main-content #opsEventsPage.ops-standard-page{
  width:100%!important;
  max-width:none!important;
  margin:0!important;
}
#main-content #opsEventsPage .ops-events-main-grid{
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  gap:1rem!important;
  width:100%!important;
  margin:0!important;
}
#main-content #opsWorkshopsRoot .ops-workshops-toolbar{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:1rem!important;
  flex-wrap:wrap!important;
}
#main-content #opsWorkshopsRoot .ops-workshops-filters{flex:1 1 760px!important;min-width:0!important}

/* Assets: stock and history are full-width stacked workspaces. */
#main-content #opsAssetsPage > section,
#main-content #opsAssetsPage > div:not(.modal){width:100%!important;max-width:none!important;min-width:0!important}
#main-content #opsAssetsPage .ops-assets-stock-card,
#main-content #opsAssetsPage .ops-assets-history,
#main-content #opsAssetsPage .ops-assets-panel{width:100%!important;max-width:none!important}

/* Administration routes use the same vertical contract even when they predate the standard. */
#main-content :is(#opsMeetingsPage,#tasksPage,#opsPermissionsPage,#opsNotificationCenterRoot,#opsNotificationTemplatesRoot,#opsApprovalChains,#opsSystemSettingsRoot,.ops-upload-limits,#opsSystemUpdatesRoot).ops-standard-page{
  gap:1rem!important;
}
#main-content :is(#opsMeetingsPage,#tasksPage) > .ops-admin-kpi-grid{width:100%!important;margin:0!important}
#main-content #opsSystemUpdatesRoot > .row,
#main-content #opsNotificationCenterRoot > .row,
#main-content #opsNotificationTemplatesRoot > .row,
#main-content #opsPermissionsPage > .row{width:100%!important;margin-inline:0!important}

/* Long text and labels should never split into one-letter columns. */
#main-content .ops-standard-page :is(.ops-ann-stat,.ops-clients-stat,.ops-org-stat,.ops-assets-stat,.ops-people-stat,.ops-ticket-stat,.ops-events-stat,.ops-sub-stat,.ops-admin-kpi,.ops-suggestions-kpi) :is(span,small,strong){word-break:normal!important;hyphens:none!important}

html[data-ops-theme="dark"] #main-content .ops-standard-hero{
  background:linear-gradient(118deg,#111827 0%,#111827 62%,rgba(37,99,235,.16) 100%)!important;
  border-color:rgba(71,85,105,.86)!important;
}
html[data-ops-theme="dark"] #main-content .ops-standard-panel,
html[data-ops-theme="dark"] #main-content .ops-standard-kpi-grid :is(.ops-kpi-card,.ops-ann-stat,.ops-clients-stat,.ops-org-stat,.ops-assets-stat,.ops-people-stat,.ops-ticket-stat,.ops-events-stat,.ops-sub-stat,.ops-admin-kpi,.ops-suggestions-kpi){
  background:#111827!important;
  border-color:rgba(71,85,105,.86)!important;
  box-shadow:0 18px 42px rgba(2,6,23,.42)!important;
}

@media(max-width:1399.98px){
  #main-content .ops-standard-kpi-grid--5,
  #main-content .ops-standard-kpi-grid--6{grid-template-columns:repeat(3,minmax(0,1fr))!important}
}
@media(max-width:1099.98px){
  #main-content .ops-standard-kpi-grid--4{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  #main-content #opsEventsPage .ops-events-main-grid{grid-template-columns:1fr!important}
}
@media(max-width:899.98px){
  #main-content .ops-standard-hero{grid-template-columns:1fr!important;align-items:start!important;min-height:0!important}
  #main-content .ops-standard-hero > :last-child:not(:first-child){justify-content:flex-start!important;width:100%!important}
  #main-content .ops-standard-kpi-grid--3,
  #main-content .ops-standard-kpi-grid--5,
  #main-content .ops-standard-kpi-grid--6{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:575.98px){
  #main-content .ops-standard-page{padding:0 0 1rem!important;gap:.75rem!important}
  #main-content .ops-standard-hero{padding:1rem!important;border-radius:16px!important}
  #main-content .ops-standard-hero > :last-child:not(:first-child){display:grid!important;grid-template-columns:1fr!important}
  #main-content .ops-standard-hero .btn{width:100%!important;justify-content:center!important}
  #main-content .ops-standard-kpi-grid--3,
  #main-content .ops-standard-kpi-grid--4,
  #main-content .ops-standard-kpi-grid--5,
  #main-content .ops-standard-kpi-grid--6{grid-template-columns:1fr!important;gap:.65rem!important}
  #main-content .ops-standard-kpi-grid :is(.ops-kpi-card,.ops-ann-stat,.ops-clients-stat,.ops-org-stat,.ops-assets-stat,.ops-people-stat,.ops-ticket-stat,.ops-events-stat,.ops-sub-stat,.ops-admin-kpi,.ops-suggestions-kpi){min-height:104px!important}
  #main-content .ops-standard-tabs{display:grid!important;grid-template-columns:1fr!important}
  #main-content .ops-standard-tabs .nav-item,#main-content .ops-standard-tabs .nav-link{width:100%!important}
  #main-content .ops-standard-panel{border-radius:16px!important}
}
