/*
 * School 360 Card System
 * UI/IX v13.2 — five-family card runtime contract.
 *
 * This stylesheet intentionally loads after the scoped Tailwind runtime layer.
 * It defines the approved modern card families after legacy runtime card
 * compatibility selectors have been removed.
 */

.s360-ui-card,
.s360-ui-section-card,
.s360-ui-dashboard-panel,
.s360-ui-stat-card,
.s360-admin-dashboard__utility-card,
.s360-ui-action-card{
  box-sizing:border-box;
  min-width:0;
}

/* Family 1: Core content card. */
.s360-ui-card{
  background:var(--s360-card-core-bg,var(--s360-color-surface-raised));
  border:1px solid var(--s360-card-core-border-color,var(--s360-component-card-border-color));
  border-radius:var(--s360-card-core-radius,var(--s360-component-card-radius));
  box-shadow:var(--s360-card-core-shadow,var(--s360-component-card-shadow));
}

.s360-ui-card{
  padding:var(--s360-card-core-padding,var(--s360-component-card-padding));
}

/* Family 2: Section card + dashboard-panel structural variant. */
.s360-ui-section-card,
.s360-ui-dashboard-panel{
  background:var(--s360-ui-section-card-bg,var(--s360-color-surface-raised));
  border:1px solid var(--s360-ui-section-card-border-color,var(--s360-dashboard-panel-border-color,var(--s360-component-card-border-color)));
  border-radius:var(--s360-ui-section-card-radius,var(--s360-dashboard-panel-radius,var(--s360-component-card-radius)));
  box-shadow:var(--s360-ui-section-card-shadow,var(--s360-dashboard-panel-soft-shadow,var(--s360-component-card-shadow)));
}

.s360-ui-section-card{
  padding:var(--s360-ui-section-card-padding,var(--s360-component-card-padding));
}

/* Family 3: Stat / KPI card. */
.s360-ui-stat-card{
  display:flex;
  flex-direction:column;
  gap:var(--s360-card-stat-gap,var(--s360-statcard-gap,8px));
  min-height:var(--s360-card-stat-min-height,var(--s360-statcard-min-height,76px));
  padding:var(--s360-card-stat-padding,var(--s360-statcard-padding,14px 16px));
  background:var(--s360-card-stat-bg,var(--s360-statcard-bg,var(--s360-color-bg-subtle,#f8fafc)));
  border:var(--s360-statcard-border-width,1px) solid var(--s360-card-stat-border-color,var(--s360-statcard-border-color,var(--s360-color-border-muted,#e2e8f0)));
  border-radius:var(--s360-card-stat-radius,var(--s360-statcard-radius,var(--s360-radius-xl,12px)));
  box-shadow:var(--s360-card-stat-shadow,var(--s360-statcard-shadow,none));
}

.s360-ui-stat-card--warning{
  background:var(--s360-card-stat-warning-bg,linear-gradient(180deg,var(--s360-color-warning-surface) 0%,var(--s360-color-surface-raised) 100%));
  border-color:var(--s360-card-stat-warning-border,var(--s360-color-border-warning));
}

.s360-ui-stat-card--success{
  border-color:var(--s360-color-border-success);
}

.s360-ui-stat-card--danger{
  border-color:var(--s360-color-border-danger);
}

/* Family 4: Dashboard utility card. */
.s360-admin-dashboard__utility-card{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:var(--s360-card-utility-gap,var(--s360-dashboard-compact-gap,var(--s360-space-sm)));
  width:100%;
  min-height:var(--s360-card-utility-min-height,58px);
  margin:0;
  padding:var(--s360-card-utility-padding-y,var(--s360-dashboard-top-card-padding-y,14px)) var(--s360-card-utility-padding-x,var(--s360-dashboard-top-card-padding-x,16px));
  background:var(--s360-card-utility-bg,linear-gradient(180deg,var(--s360-color-surface-raised) 0%,var(--s360-color-bg-subtle) 100%));
  border:1px solid var(--s360-card-utility-border-color,var(--s360-color-border-muted));
  border-radius:var(--s360-card-utility-radius,var(--s360-dashboard-panel-radius,var(--s360-radius-xl)));
  box-shadow:var(--s360-card-utility-shadow,var(--s360-shadow-sm));
  color:var(--s360-color-text-heading);
}

.s360-admin-dashboard__utility-card--notification{
  border-inline-start:3px solid var(--s360-card-utility-notification-accent,var(--s360-color-warning));
}

.s360-admin-dashboard__utility-card--school{
  border-inline-start:3px solid var(--s360-card-utility-school-accent,var(--s360-color-primary));
}

/* Family 5: Action / command / navigation card. */
.s360-ui-action-card,
.s360-admin-shortcut.s360-ui-dashboard-shortcut{
  display:flex;
  flex-direction:column;
  gap:var(--s360-card-action-gap,var(--s360-component-card-stack-gap));
  min-height:var(--s360-card-action-min-height,96px);
  padding:var(--s360-card-action-padding,var(--s360-component-card-padding-compact));
  background:var(--s360-card-action-bg,var(--s360-color-surface-raised));
  border:1px solid var(--s360-card-action-border-color,var(--s360-component-card-border-color));
  border-radius:var(--s360-card-action-radius,var(--s360-component-card-radius));
  box-shadow:var(--s360-card-action-shadow,var(--s360-shadow-sm));
  color:var(--s360-color-text-body);
  text-decoration:none;
  transition:border-color var(--s360-component-transition-fast,.15s ease), box-shadow var(--s360-component-transition-fast,.15s ease), transform var(--s360-component-transition-fast,.15s ease), background-color var(--s360-component-transition-fast,.15s ease);
}

.s360-ui-action-card__header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:var(--s360-space-sm);
}

.s360-ui-action-card__icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  width:var(--s360-card-action-icon-size,36px);
  height:var(--s360-card-action-icon-size,36px);
  border-radius:var(--s360-radius-xl);
  background:var(--s360-card-action-icon-bg,var(--s360-color-primary-soft));
  color:var(--s360-card-action-icon-color,var(--s360-color-primary-chip));
  font-weight:var(--s360-font-weight-bold);
}

.s360-ui-action-card__title,
.s360-admin-shortcut.s360-ui-dashboard-shortcut :where(strong,.s360-admin-shortcut__title){
  margin:0;
  color:var(--s360-color-text-heading);
  font-size:var(--s360-card-action-title-size,14px);
  font-weight:var(--s360-font-weight-bold);
  line-height:1.35;
}

.s360-ui-action-card__description,
.s360-ui-action-card__meta,
.s360-admin-shortcut.s360-ui-dashboard-shortcut :where(p,small,em,.s360-admin-shortcut__meta){
  margin:0;
  color:var(--s360-color-text-tertiary);
  font-size:var(--s360-card-action-meta-size,12px);
  line-height:1.55;
}

.s360-ui-action-card__actions{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:var(--s360-component-toolbar-gap);
  margin-top:auto;
}


/* Phase 3B: command/action/navigation migration states. */
.s360-ui-action-card[data-s360-ui-action-card]{
  border-inline-start:4px solid var(--s360-card-action-accent,var(--s360-color-primary));
}

.s360-ui-action-card--success,
.s360-ui-action-card--ready,
.s360-ui-action-card--payment{
  --s360-card-action-accent:var(--s360-color-success);
  --s360-card-action-icon-bg:var(--s360-color-success-surface,var(--s360-color-bg-subtle));
  --s360-card-action-icon-color:var(--s360-color-success-strong,var(--s360-color-success));
}

.s360-ui-action-card--warning{
  --s360-card-action-accent:var(--s360-color-warning);
  --s360-card-action-icon-bg:var(--s360-color-warning-surface,var(--s360-color-bg-subtle));
  --s360-card-action-icon-color:var(--s360-color-warning-strong,var(--s360-color-warning));
}

.s360-ui-action-card--danger,
.s360-ui-action-card--blocked,
.s360-ui-action-card--audit{
  --s360-card-action-accent:var(--s360-color-danger);
  --s360-card-action-icon-bg:var(--s360-color-danger-surface,var(--s360-color-bg-subtle));
  --s360-card-action-icon-color:var(--s360-color-danger-strong,var(--s360-color-danger));
}

.s360-ui-action-card--info{
  --s360-card-action-accent:var(--s360-color-primary);
}

.s360-ui-action-card > :where(span,small,em):first-child{
  display:block;
  margin:0;
  color:var(--s360-color-text-tertiary);
  font-size:var(--s360-card-action-meta-size,12px);
  font-weight:var(--s360-font-weight-bold,700);
  letter-spacing:.04em;
  line-height:1.45;
  text-transform:uppercase;
}

.s360-ui-action-card > strong{
  display:block;
  margin:0;
  color:var(--s360-color-text-heading);
  font-size:var(--s360-card-action-value-size,22px);
  font-weight:var(--s360-font-weight-bold,700);
  line-height:1.2;
}

.s360-ui-action-card > :where(p,small,em):not(:first-child){
  margin:0;
  color:var(--s360-color-text-tertiary);
  font-size:var(--s360-card-action-meta-size,12px);
  line-height:1.55;
}

:where(a.s360-ui-card,a.s360-ui-section-card,a.s360-ui-stat-card,a.s360-ui-action-card,button.s360-ui-action-card,[role="button"].s360-ui-action-card):hover,
:where(.s360-ui-action-card,.s360-ui-action-card,.s360-ui-action-card,.s360-ui-action-card,.s360-ui-action-card,.s360-ui-action-card,.s360-admin-shortcut.s360-ui-dashboard-shortcut):where(a,button,[role="button"]):hover{
  border-color:var(--s360-card-action-border-color-hover,var(--s360-color-primary-soft-border));
  box-shadow:var(--s360-card-action-shadow-hover,var(--s360-component-card-shadow-hover));
  transform:translateY(-1px);
  text-decoration:none;
}

:where(a.s360-ui-card,a.s360-ui-section-card,a.s360-ui-stat-card,a.s360-ui-action-card,button.s360-ui-action-card,[role="button"].s360-ui-action-card):focus-visible,
:where(.s360-ui-action-card,.s360-ui-action-card,.s360-ui-action-card,.s360-ui-action-card,.s360-ui-action-card,.s360-ui-action-card,.s360-admin-shortcut.s360-ui-dashboard-shortcut):where(a,button,[role="button"]):focus-visible{
  outline:2px solid var(--s360-color-primary);
  outline-offset:2px;
  border-color:var(--s360-color-primary-soft-border);
  box-shadow:var(--s360-focus-ring), var(--s360-card-action-shadow-hover,var(--s360-component-card-shadow-hover));
  text-decoration:none;
}

.s360-family-compatibility-note{
  display:none;
}

@media (max-width: 782px){
  .s360-ui-card,
  .s360-ui-section-card{
    padding:var(--s360-card-mobile-padding,var(--s360-component-card-padding-compact));
  }

  .s360-ui-action-card,
  .s360-admin-shortcut.s360-ui-dashboard-shortcut{
    min-height:0;
    padding:var(--s360-card-action-mobile-padding,var(--s360-component-card-padding-tight));
  }

  .s360-admin-dashboard__utility-card{
    flex-direction:column;
    align-items:stretch;
    min-height:0;
  }
}

@media (prefers-reduced-motion: reduce){
  .s360-ui-card,
  .s360-ui-section-card,
  .s360-ui-stat-card,
  .s360-ui-action-card,
  .s360-admin-dashboard__utility-card,
  :where(.s360-ui-action-card,.s360-ui-action-card,.s360-ui-action-card,.s360-ui-action-card,.s360-ui-action-card,.s360-ui-action-card,.s360-admin-shortcut.s360-ui-dashboard-shortcut){
    transition:none;
  }

  :where(a.s360-ui-card,a.s360-ui-section-card,a.s360-ui-stat-card,a.s360-ui-action-card,button.s360-ui-action-card,[role="button"].s360-ui-action-card):hover,
  .s360-admin-shortcut.s360-ui-dashboard-shortcut:where(a,button,[role="button"]):hover{
    transform:none;
  }
}

/* Modern equivalents for former core/admin card modifiers. */
.s360-ui-section-card--full{
  width:100%;
}

.s360-ui-card--subtle{
  background:var(--s360-color-surface-muted,var(--s360-color-bg-subtle));
  border-color:var(--s360-color-border-muted);
  box-shadow:none;
}

/* --note canonical definition.
 * Secondary subtle variant: smaller padding/radius with surface background.
 * Use for inline note cards inside lists. */
.s360-ui-card--note{
  padding:var(--s360-space-sm,12px);
  border:1px solid var(--s360-color-border-subtle,#e5e7eb);
  border-radius:var(--s360-radius-xl,12px);
  background:var(--s360-color-surface,#fff);
  box-shadow:none;
  list-style:none;
}

/* ============================================================================
 * Universal state modifiers
 * Apply to any card family: card, section-card, stat-card, action-card.
 * ============================================================================ */

/* --primary: highlight as primary action / important item (4px top accent).
 * Use for primary/highlight card states. */
.s360-ui-card--primary,
.s360-ui-section-card--primary{
  border-top:4px solid var(--s360-color-primary);
}

/* --disabled: dashed border + reduced opacity. Card visible but inactive.
 * Use for items pending deletion, archived items, locked features. */
.s360-ui-card--disabled,
.s360-ui-section-card--disabled,
.s360-ui-stat-card--disabled,
.s360-ui-action-card--disabled{
  border-style:dashed;
  opacity:.92;
}

/* --readonly: muted opacity. Card content visible but cannot be interacted with.
 * Use for view-only fields, system-managed values, archived previews. */
.s360-ui-card--readonly,
.s360-ui-section-card--readonly,
.s360-ui-stat-card--readonly,
.s360-ui-action-card--readonly{
  opacity:.78;
}

/* ============================================================================
 * Status modifier extensions
 * Extend status modifiers to non-stat-card families for status-encoded borders.
 * ============================================================================ */

/* --warning border (applies to all families, mirrors stat-card--warning) */
.s360-ui-card--warning,
.s360-ui-section-card--warning{
  border-color:var(--s360-color-border-warning,var(--s360-color-border-muted));
}

.s360-ui-stat-card__value{
  margin:0;
  color:var(--s360-color-text-heading);
  font-size:var(--s360-card-stat-value-size,var(--s360-statcard-value-size,24px));
  line-height:1;
  font-weight:var(--s360-statcard-value-weight,var(--s360-font-weight-bold,700));
}

.s360-ui-stat-card__value--success{
  color:var(--s360-color-success-strong,var(--s360-color-success));
}

.s360-ui-stat-card__value--warning{
  color:var(--s360-color-warning-strong,var(--s360-color-warning));
}


/* Module-owned card rules live in their admin/portal CSS bundles.
 * Core keeps only neutral card family contracts and universal modifiers. */

/* Admissions card data-attribute support. */
.s360-ui-section-card[data-s360-admissions-card],
.s360-ui-card[data-s360-admissions-card]{
  box-sizing:border-box;
  min-width:0;
}

/* Portal/frontend runtime using data-s360-portal-card attributes. */
.s360-ui-card[data-s360-portal-card="login"]{
  max-width:460px;
  margin:auto;
}

.s360-ui-card[data-s360-portal-card="login"].s360-ui-form{
  gap:var(--s360-space-md, 16px);
}

.s360-portal-login-shell .s360-ui-card[data-s360-portal-card="login"]{
  padding:clamp(20px,4vw,32px);
  border-radius:var(--s360-component-card-radius);
  border:1px solid var(--s360-component-card-border-color);
  box-shadow:var(--s360-shadow-card,0 10px 28px rgba(15,23,42,.08));
}

.s360-ui-card[data-s360-portal-card="login"] .s360-ui-form-actions{
  padding-top:var(--s360-space-2xs, 4px);
}

.s360-ui-card[data-s360-portal-card="summary"],
.s360-ui-card[data-s360-portal-card="school-summary"],
.s360-ui-card[data-s360-portal-card="compact"]{
  min-width:0;
}

.s360-ui-card[data-s360-portal-card="compact"]{
  padding:var(--s360-card-core-padding-compact,var(--s360-component-card-padding-compact,14px));
}

.s360-ui-section-card[data-s360-portal-card="hero"]{
  padding:var(--s360-portal-phase5-card-padding,var(--s360-component-card-padding));
  border-radius:var(--s360-portal-phase5-radius,var(--s360-component-card-radius));
  background:
    radial-gradient(circle at 92% 8%, color-mix(in srgb,var(--s360-color-primary,#2271b1) 12%, transparent), transparent 18rem),
    linear-gradient(135deg,var(--s360-color-surface-raised,#fff),var(--s360-color-bg-soft,#f8fbff));
}

.s360-ui-section-card[data-s360-portal-card="toolbar"]{
  padding:var(--s360-component-card-padding);
}

.s360-frontend-portal-phase5 .s360-ui-section-card[data-s360-portal-card="hero"] .s360-cluster-between,
.s360-frontend-portal-phase5 .s360-ui-section-card[data-s360-portal-card="toolbar"] > .s360-cluster-between,
.s360-frontend-portal-phase5 #portal-payment-center > .s360-cluster-between,
.s360-frontend-portal-phase5 [id$="-documents"] > .s360-cluster-between,
.s360-frontend-portal-phase5 [id$="-document-requirements"] > .s360-cluster-between{
  align-items:flex-start;
  gap:var(--s360-portal-phase5-gap,var(--s360-space-md));
}

.s360-frontend-portal-phase5 .s360-ui-section-card[data-s360-portal-card="hero"] h2{
  overflow-wrap:anywhere;
}

.s360-ui-stat-card--portal{
  min-width:0;
  min-height:108px;
  color:var(--s360-color-text-heading);
  font-weight:700;
}

.s360-ui-section-card--calendar-portal{
  padding:var(--s360-component-card-padding);
}

/* Calendar event pill component rules live in assets/css/ui-system.css. */

/* Strict modern helper aliases after legacy card CSS cleanup. */
.s360-ui-grid{display:grid;gap:var(--s360-layout-grid-gap,var(--s360-space-md));grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));}
.s360-ui-grid--summary{grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr));}
.s360-ui-grid--wide{grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));}
.s360-ui-grid--calendar{grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));}
.s360-ui-card--compact{padding:var(--s360-component-card-padding-tight) var(--s360-component-card-padding-compact);}
.s360-ui-card__title-reset{margin:0;color:var(--s360-color-text-heading);}
.s360-ui-stat-card__label{margin:0;color:var(--s360-color-text-label,var(--s360-color-text-tertiary));font-size:var(--s360-statcard-label-size,var(--s360-font-size-xs,12px));font-weight:var(--s360-statcard-label-weight,var(--s360-font-weight-semibold,600));}
.s360-ui-stat-card__meta{margin:0;color:var(--s360-color-text-tertiary);font-size:var(--s360-statcard-meta-size,var(--s360-font-size-xs,12px));line-height:1.45;}
.s360-ui-stat-card__value--danger{color:var(--s360-color-danger-strong,var(--s360-color-danger));}
.s360-ui-section-card--settings-panel,
.s360-ui-section-card--toolbar{padding:var(--s360-ui-section-card-padding,var(--s360-component-card-padding));}

/* UI Phase 4B: canonical admin shell and neutral wrapper background.
 * All normal admin pages now include .s360-admin-wrapper. Keep the wrapper as
 * a structural shell only; module identity/background belongs inside cards,
 * headers, badges and controls, not on the page shell.
 */
body.wp-admin .wrap.s360-admin-wrapper {
    max-width: var(--s360-layout-admin-page-max, none);
    background: transparent ;
    background-image: none ;
}

body.wp-admin .wrap.s360-admin-wrapper:where(
    .school360-students-phase-k,
    .s360-calendar-phase-k,
    .s360-communication-phase-l,
    .s360-content-assets-phase-l,
    .s360-admissions-phase-g,
    .s360-custom-fields-phase-g,
    .s360-finance-phase-h,
    .s360-treasury-phase-h,
    .s360-expense-phase-h,
    .s360-billing-phase-h,
    .s360-accounting-phase-h,
    .s360-reports-phase-f,
    .s360-analytics-phase-f,
    .s360-reports-v2-phase-f,
    .s360-hr-phase-i,
    .s360-settings-phase-e,
    .s360-schools-phase-m,
    .s360-data-center-phase-m,
    .s360-compliance-phase-m,
    .s360-external-ecosystem-phase-m,
    .s360-teacher-workbench-phase-m,
    .s360-teacher-workbench-phase-n,
    .s360-own-access-phase-m,
    .school360-dashboard-phase-d,
    .school360-dashboard-phase-5
) {
    background: transparent ;
    background-image: none ;
    box-shadow: none ;
}


/* UI Phase 5A: admin forms, controls, buttons and tables compatibility layer.
 * Normal admin pages already share .s360-admin-wrapper. This layer gives
 * legacy WordPress/raw controls the same School 360 visual language without
 * changing form actions, names, nonces, routes, validation or JS hooks.
 */
body.wp-admin .s360-admin-wrapper :where(form):not(.s360-ui-form):not(.s360-ui-inline-form){
    max-width:100%;
}
body.wp-admin .s360-admin-wrapper :where(.form-table, table.form-table){
    width:100%;
    border-collapse:separate;
    border-spacing:0;
    margin:0 0 var(--s360-space-md,16px);
}
body.wp-admin .s360-admin-wrapper :where(.form-table th){
    color:var(--s360-color-text-label,var(--s360-color-text-secondary));
    font-size:13px;
    font-weight:700;
    line-height:1.45;
    padding:14px 16px 14px 0;
    vertical-align:top;
}
body.wp-admin .s360-admin-wrapper :where(.form-table td){
    padding:12px 0;
    vertical-align:top;
}
body.wp-admin .s360-admin-wrapper :where(.form-table .description, .description){
    color:var(--s360-color-text-tertiary,#64748b);
    font-size:12px;
    line-height:1.5;
    margin-top:6px;
}
body.wp-admin .s360-admin-wrapper :where(input[type="text"],input[type="email"],input[type="number"],input[type="password"],input[type="search"],input[type="date"],input[type="time"],input[type="url"],input[type="tel"],select,textarea):not(.s360-ui-input):not(.s360-ui-select):not(.s360-ui-textarea):not(.s360-ui-control):not(.wp-color-picker):not(.wp-picker-clear):not(.button){
    max-width:100%;
    min-height:var(--s360-control-height-md,38px);
    border:var(--s360-control-border-width,1px) solid var(--s360-color-input-border,var(--s360-color-border,#cbd5e1));
    border-radius:var(--s360-control-radius,10px);
    background:var(--s360-color-input-bg,var(--s360-color-surface-raised,#fff));
    color:var(--s360-color-input-text,var(--s360-color-text-body,#1e293b));
    box-shadow:var(--s360-shadow-input,0 1px 2px rgba(15,23,42,.04));
    font-size:14px;
    line-height:1.45;
    padding:var(--s360-control-padding-y,8px) var(--s360-control-padding-x,12px);
    transition:border-color .15s ease,box-shadow .15s ease,background-color .15s ease,color .15s ease;
}
body.wp-admin .s360-admin-wrapper :where(select):not(.s360-ui-select):not(.s360-ui-control){
    padding-right:34px;
}
body.wp-admin .s360-admin-wrapper :where(textarea):not(.s360-ui-textarea):not(.s360-ui-control){
    min-height:108px;
    resize:vertical;
}
body.wp-admin .s360-admin-wrapper :where(input[type="text"],input[type="email"],input[type="number"],input[type="password"],input[type="search"],input[type="date"],input[type="time"],input[type="url"],input[type="tel"],select,textarea):not(.s360-ui-input):not(.s360-ui-select):not(.s360-ui-textarea):not(.s360-ui-control):not(.wp-color-picker):not(.button):hover{
    border-color:var(--s360-color-input-border-hover,var(--s360-color-border-strong,#94a3b8));
}
body.wp-admin .s360-admin-wrapper :where(input[type="text"],input[type="email"],input[type="number"],input[type="password"],input[type="search"],input[type="date"],input[type="time"],input[type="url"],input[type="tel"],select,textarea):not(.s360-ui-input):not(.s360-ui-select):not(.s360-ui-textarea):not(.s360-ui-control):not(.wp-color-picker):not(.button):focus,
body.wp-admin .s360-admin-wrapper :where(input[type="text"],input[type="email"],input[type="number"],input[type="password"],input[type="search"],input[type="date"],input[type="time"],input[type="url"],input[type="tel"],select,textarea):not(.s360-ui-input):not(.s360-ui-select):not(.s360-ui-textarea):not(.s360-ui-control):not(.wp-color-picker):not(.button):focus-visible{
    outline:none;
    border-color:var(--s360-color-input-border-focus,var(--s360-color-primary,#2271b1));
    box-shadow:var(--s360-shadow-input-focus,0 0 0 3px rgba(34,113,177,.16));
}
body.wp-admin .s360-admin-wrapper :where(input[type="checkbox"],input[type="radio"]):not(.s360-ui-control){
    accent-color:var(--s360-color-primary-strong,var(--s360-color-primary,#2271b1));
}
body.wp-admin .s360-admin-wrapper :where(.button,button.button,a.button,input[type="submit"].button):not(.nav-tab):not(.s360-ui-button){
    align-items:center;
    border-radius:var(--s360-radius-lg,10px);
    display:inline-flex;
    font-weight:700;
    justify-content:center;
    min-height:var(--s360-control-height-md,38px);
    padding:7px 14px;
    transition:background-color .15s ease,border-color .15s ease,color .15s ease,box-shadow .15s ease,transform .15s ease;
}
body.wp-admin .s360-admin-wrapper :where(.button,button.button,a.button,input[type="submit"].button):not(.nav-tab):not(.s360-ui-button):hover{
    transform:translateY(-1px);
    box-shadow:var(--s360-component-button-shadow-hover,0 8px 18px rgba(15,23,42,.10));
}
body.wp-admin .s360-admin-wrapper :where(.button-primary):not(.s360-ui-button){
    background:var(--s360-color-primary-strong,var(--s360-color-primary,#2271b1));
    border-color:var(--s360-color-primary-strong,var(--s360-color-primary,#2271b1));
    color:var(--s360-color-surface-raised,#fff);
}
body.wp-admin .s360-admin-wrapper :where(.button-secondary):not(.s360-ui-button),
body.wp-admin .s360-admin-wrapper :where(.button):not(.button-primary):not(.button-link):not(.nav-tab):not(.s360-ui-button){
    background:var(--s360-color-surface-raised,#fff);
    border-color:var(--s360-color-border-strong,#cbd5e1);
    color:var(--s360-color-text-heading,#0f172a);
}
body.wp-admin .s360-admin-wrapper :where(table.widefat,table.wp-list-table,table.striped):not(.s360-ui-table){
    width:100%;
    border:var(--s360-table-border-width,1px) solid var(--s360-color-border-muted,#e2e8f0);
    border-collapse:separate;
    border-radius:var(--s360-table-radius,14px);
    border-spacing:0;
    overflow:hidden;
    background:var(--s360-color-surface-raised,#fff);
    box-shadow:var(--s360-table-shadow,0 12px 28px rgba(15,23,42,.06));
}
body.wp-admin .s360-admin-wrapper :where(table.widefat,table.wp-list-table,table.striped):not(.s360-ui-table) :where(th,td){
    border-bottom:1px solid var(--s360-color-border-muted,#e2e8f0);
    color:var(--s360-color-text-body,#334155);
    padding:12px 14px;
    vertical-align:middle;
}
body.wp-admin .s360-admin-wrapper :where(table.widefat,table.wp-list-table,table.striped):not(.s360-ui-table) :where(th){
    background:var(--s360-table-head-bg,var(--s360-color-bg-subtle,#f8fafc));
    color:var(--s360-color-text-label,#475569);
    font-size:12px;
    font-weight:800;
    letter-spacing:.02em;
}
body.wp-admin .s360-admin-wrapper :where(table.widefat,table.wp-list-table,table.striped):not(.s360-ui-table) tbody tr:hover td{
    background:var(--s360-table-row-hover-bg,var(--s360-color-bg-subtle,#f8fafc));
}
body.wp-admin .s360-admin-wrapper :where(table.widefat,table.wp-list-table,table.striped):not(.s360-ui-table) tr:last-child :where(th,td){
    border-bottom:0;
}
@media (max-width:782px){
    body.wp-admin .s360-admin-wrapper :where(.form-table,.form-table tbody,.form-table tr,.form-table th,.form-table td){
        display:block;
        width:100%;
    }
    body.wp-admin .s360-admin-wrapper :where(.form-table th,.form-table td){
        padding:8px 0;
    }
    body.wp-admin .s360-admin-wrapper :where(.button,button.button,a.button,input[type="submit"].button):not(.nav-tab):not(.s360-ui-button){
        width:100%;
    }
}

/* UI Phase 5B: admin notices, badges, status chips and action rows compatibility layer.
 * This is scoped to the shared admin wrapper introduced in Phase 4. It aligns
 * legacy WordPress notices and module-specific status UI with the shared School
 * 360 visual language without changing markup, routes, actions, nonces or JS.
 */
body.wp-admin .s360-admin-wrapper :where(.notice,.updated,.error):not(.s360-ui-notice):not(.s360-unstyled-notice){
    border:var(--s360-component-notice-border-width,1px) solid var(--s360-color-border-muted,#e2e8f0);
    border-left:4px solid var(--s360-color-primary,#2271b1);
    border-radius:var(--s360-component-notice-radius,var(--s360-radius-xl,14px));
    background:var(--s360-color-surface-raised,#fff);
    box-shadow:var(--s360-shadow-soft,0 10px 24px rgba(15,23,42,.06));
    color:var(--s360-color-text-body,#334155);
    margin:var(--s360-space-md,16px) 0;
    padding:var(--s360-component-alert-padding-y,12px) var(--s360-component-alert-padding-x,14px);
}
body.wp-admin .s360-admin-wrapper :where(.notice,.updated,.error):not(.s360-ui-notice):not(.s360-unstyled-notice) :where(p){
    margin:.35em 0;
}
body.wp-admin .s360-admin-wrapper :where(.notice.notice-success,.updated):not(.s360-ui-notice):not(.s360-unstyled-notice){
    border-left-color:var(--s360-color-success,#16a34a);
    background:var(--s360-color-surface-success-soft,#f0fdf4);
}
body.wp-admin .s360-admin-wrapper :where(.notice.notice-warning):not(.s360-ui-notice):not(.s360-unstyled-notice){
    border-left-color:var(--s360-color-warning,#d97706);
    background:var(--s360-color-surface-warning-soft,#fffbeb);
}
body.wp-admin .s360-admin-wrapper :where(.notice.notice-error,.error):not(.s360-ui-notice):not(.s360-unstyled-notice){
    border-left-color:var(--s360-color-danger,#dc2626);
    background:var(--s360-color-danger-tint,#fef2f2);
}
body.wp-admin .s360-admin-wrapper :where(.notice.notice-info):not(.s360-ui-notice):not(.s360-unstyled-notice){
    border-left-color:var(--s360-color-info,#2563eb);
    background:var(--s360-color-info-surface,#eff6ff);
}
body.wp-admin .s360-admin-wrapper :where(.notice.is-dismissible):not(.s360-ui-notice):not(.s360-unstyled-notice){
    padding-right:42px;
}
body.wp-admin .s360-admin-wrapper :where(.s360-alert,.s360-status-callout,.s360-timetable-conflict-notice,.s360-admissions-notice-warning,.s360-expense-final-polish):not(.s360-ui-notice){
    border:var(--s360-component-notice-border-width,1px) solid var(--s360-color-border-muted,#e2e8f0);
    border-left:4px solid var(--s360-color-primary,#2271b1);
    border-radius:var(--s360-component-notice-radius,var(--s360-radius-xl,14px));
    background:var(--s360-color-surface-raised,#fff);
    box-shadow:var(--s360-shadow-soft,0 10px 24px rgba(15,23,42,.06));
    color:var(--s360-color-text-body,#334155);
    padding:var(--s360-component-alert-padding-y,12px) var(--s360-component-alert-padding-x,14px);
}
body.wp-admin .s360-admin-wrapper :where(.s360-alert--success,.s360-status-callout.is-success,.s360-expense-final-polish.is-success){
    border-left-color:var(--s360-color-success,#16a34a);
    background:var(--s360-color-surface-success-soft,#f0fdf4);
}
body.wp-admin .s360-admin-wrapper :where(.s360-alert--warning,.s360-status-callout.is-warning,.s360-timetable-conflict-notice,.s360-admissions-notice-warning,.s360-expense-final-polish.is-warning){
    border-left-color:var(--s360-color-warning,#d97706);
    background:var(--s360-color-surface-warning-soft,#fffbeb);
}
body.wp-admin .s360-admin-wrapper :where(.s360-alert--danger,.s360-alert--error,.s360-status-callout.is-danger,.s360-status-callout.is-error){
    border-left-color:var(--s360-color-danger,#dc2626);
    background:var(--s360-color-danger-tint,#fef2f2);
}
body.wp-admin .s360-admin-wrapper :where(.s360-badge,.s360-badge-info,.s360-badge-success,.s360-badge-warning,.s360-badge-danger,.s360-badge-neutral,.s360-status-badge,.s360-status-pill,.s360-expense-status-pill,.s360-admissions-status-chip,.s360-hr-status-pill,.s360-report-chip,.s360-system-badge,.s360-qa-status,.s360-hr-portal-badge,.s360-hr-role-badge):not(.s360-ui-badge){
    align-items:center;
    border:1px solid var(--s360-color-border-muted,#e2e8f0);
    border-radius:var(--s360-component-pill-radius,999px);
    display:inline-flex;
    font-size:var(--s360-component-badge-font-size,12px);
    font-weight:700;
    gap:var(--s360-module-badge-gap,6px);
    line-height:1.2;
    min-height:var(--s360-component-badge-min-height,24px);
    padding:var(--s360-component-badge-padding-y,5px) var(--s360-component-badge-padding-x,10px);
    text-decoration:none;
    vertical-align:middle;
    white-space:nowrap;
    background:var(--s360-color-neutral-bg,#f8fafc);
    color:var(--s360-color-text-secondary,#475569);
}
body.wp-admin .s360-admin-wrapper :where(.s360-badge-success,.s360-badge--success,.s360-status-positive,.s360-status-paid,.s360-status-completed,.s360-status-approved,.s360-status-active,.s360-status-badge.is-published,.s360-qa-status-ok,.s360-hr-status-pill--success,.s360-hr-portal-badge-active,.s360-hr-portal-badge-approved,.s360-hr-portal-badge-completed){
    border-color:var(--s360-color-success-border,var(--s360-color-success,#16a34a));
    background:var(--s360-color-surface-success-soft,#f0fdf4);
    color:var(--s360-color-success-deep,#166534);
}
body.wp-admin .s360-admin-wrapper :where(.s360-badge-warning,.s360-badge--warning,.s360-status-pending,.s360-status-unpaid,.s360-status-partial,.s360-status-due_soon,.s360-status-due-soon,.s360-status-open,.s360-status-badge.is-draft,.s360-qa-status-warning,.s360-hr-status-pill--warning,.s360-expense-status-pill.is-warning){
    border-color:var(--s360-color-warning-border,var(--s360-color-warning,#d97706));
    background:var(--s360-color-surface-warning-soft,#fffbeb);
    color:var(--s360-color-warning-deep,#92400e);
}
body.wp-admin .s360-admin-wrapper :where(.s360-badge-danger,.s360-badge--danger,.s360-status-negative,.s360-status-overdue,.s360-status-rejected,.s360-status-badge.is-archived,.s360-hr-status-pill--danger){
    border-color:var(--s360-color-danger-border,var(--s360-color-danger,#dc2626));
    background:var(--s360-color-danger-tint,#fef2f2);
    color:var(--s360-color-danger-strong,#991b1b);
}
body.wp-admin .s360-admin-wrapper :where(.s360-badge-info,.s360-badge--info,.s360-status-returned,.s360-status-processing,.s360-status-pending_verification,.s360-hr-status-pill--neutral){
    border-color:var(--s360-color-info-border,var(--s360-color-info,#2563eb));
    background:var(--s360-color-info-surface,#eff6ff);
    color:var(--s360-color-info-chip,#1d4ed8);
}
body.wp-admin .s360-admin-wrapper :where(.s360-toolbar,.s360-actions,.s360-card-actions,.s360-page-actions,.s360-ui-page-actions,.s360-expense-status-actions,.s360-hr-actions,.s360-admissions-actions,.s360-finance-actions,.s360-report-actions,.s360-admin-actions):not(.s360-ui-toolbar){
    align-items:center;
    display:flex;
    flex-wrap:wrap;
    gap:var(--s360-component-toolbar-gap,8px);
    justify-content:flex-start;
}
body.wp-admin .s360-admin-wrapper :where(.s360-toolbar.is-end,.s360-actions.is-end,.s360-card-actions.is-end,.s360-page-actions.is-end,.s360-admin-actions.is-end){
    justify-content:flex-end;
}
body.wp-admin .s360-admin-wrapper :where(.tablenav):not(.s360-ui-toolbar){
    align-items:center;
    display:flex;
    flex-wrap:wrap;
    gap:var(--s360-component-toolbar-gap,8px);
    justify-content:space-between;
    min-height:44px;
}
body.wp-admin .s360-admin-wrapper :where(.tablenav .actions,.tablenav-pages){
    align-items:center;
    display:flex;
    flex-wrap:wrap;
    gap:var(--s360-component-toolbar-gap,8px);
}
@media (max-width:782px){
    body.wp-admin .s360-admin-wrapper :where(.s360-toolbar,.s360-actions,.s360-card-actions,.s360-page-actions,.s360-ui-page-actions,.s360-expense-status-actions,.s360-hr-actions,.s360-admissions-actions,.s360-finance-actions,.s360-report-actions,.s360-admin-actions,.tablenav):not(.s360-ui-toolbar){
        align-items:stretch;
        flex-direction:column;
    }
    body.wp-admin .s360-admin-wrapper :where(.s360-badge,.s360-badge-info,.s360-badge-success,.s360-badge-warning,.s360-badge-danger,.s360-badge-neutral,.s360-status-badge,.s360-status-pill,.s360-expense-status-pill,.s360-admissions-status-chip,.s360-hr-status-pill,.s360-report-chip,.s360-system-badge,.s360-qa-status,.s360-hr-portal-badge,.s360-hr-role-badge):not(.s360-ui-badge){
        white-space:normal;
    }
}

/* UI Phase 5C: admin modals, dropdowns, filters, empty states and loading states compatibility layer.
 * Scoped to the shared admin wrapper introduced in Phase 4. This aligns existing
 * utility and module-specific UI surfaces without changing PHP markup, routes,
 * nonces, actions, permission checks, AJAX/REST handlers or JavaScript behavior.
 */
body.wp-admin .s360-admin-wrapper :where(.s360-ui-modal,.s360-modal,.school360-modal,.s360-builder-modal,.s360-expense-receipt-modal):not(.s360-unstyled-modal){
    color:var(--s360-color-text-body,#334155);
    font-family:inherit;
}
body.wp-admin .s360-admin-wrapper :where(.s360-ui-modal__dialog,.s360-modal__dialog,.school360-modal__dialog,.s360-builder-modal__dialog,.s360-expense-receipt-modal):not(.s360-unstyled-modal){
    background:var(--s360-color-surface-raised,#fff);
    border:1px solid var(--s360-color-border-muted,#e2e8f0);
    border-radius:var(--s360-component-modal-radius,var(--s360-radius-2xl,18px));
    box-shadow:var(--s360-shadow-modal,0 24px 64px rgba(15,23,42,.22));
    overflow:hidden;
}
body.wp-admin .s360-admin-wrapper :where(.s360-ui-modal__header,.s360-modal__header,.school360-modal__header,.s360-builder-modal__header,.s360-expense-receipt-modal-head):not(.s360-unstyled-modal){
    align-items:center;
    background:var(--s360-color-surface-subtle,#f8fafc);
    border-bottom:1px solid var(--s360-color-border-muted,#e2e8f0);
    display:flex;
    gap:var(--s360-space-sm,10px);
    justify-content:space-between;
    padding:var(--s360-component-modal-header-padding-y,16px) var(--s360-component-modal-header-padding-x,20px);
}
body.wp-admin .s360-admin-wrapper :where(.s360-ui-modal__title,.s360-modal__title,.school360-modal__title,.s360-builder-modal__header h2,.s360-expense-receipt-modal-head h2):not(.s360-unstyled-modal *){
    color:var(--s360-color-text-heading,#0f172a);
    font-size:var(--s360-component-modal-title-size,18px);
    font-weight:800;
    line-height:1.25;
    margin:0;
}
body.wp-admin .s360-admin-wrapper :where(.s360-ui-modal__body,.s360-modal__body,.school360-modal__body,.s360-builder-modal__body):not(.s360-unstyled-modal){
    padding:var(--s360-component-modal-body-padding,var(--s360-space-xl,24px));
}
body.wp-admin .s360-admin-wrapper :where(.s360-ui-modal__footer,.s360-modal__footer,.school360-modal__footer,.s360-builder-modal__footer):not(.s360-unstyled-modal){
    align-items:center;
    background:var(--s360-color-surface-subtle,#f8fafc);
    border-top:1px solid var(--s360-color-border-muted,#e2e8f0);
    display:flex;
    flex-wrap:wrap;
    gap:var(--s360-space-sm,10px);
    justify-content:flex-end;
    padding:var(--s360-component-modal-footer-padding-y,14px) var(--s360-component-modal-footer-padding-x,20px);
}
body.wp-admin .s360-admin-wrapper :where(.s360-ui-modal__close,.s360-modal-close,.school360-modal-close):not(.s360-unstyled-modal *){
    align-items:center;
    background:transparent;
    border:0;
    border-radius:var(--s360-radius-md,8px);
    color:var(--s360-color-text-muted,#64748b);
    cursor:pointer;
    display:inline-flex;
    justify-content:center;
    min-height:32px;
    min-width:32px;
    padding:4px;
}
body.wp-admin .s360-admin-wrapper :where(.s360-ui-modal__close,.s360-modal-close,.school360-modal-close):hover:not(.s360-unstyled-modal *){
    background:var(--s360-color-surface-hover,#f1f5f9);
    color:var(--s360-color-text-heading,#0f172a);
}
body.wp-admin .s360-admin-wrapper :where(.s360-ui-modal-backdrop,.s360-builder-modal__backdrop,.s360-modal-backdrop,.school360-modal-backdrop):not(.s360-unstyled-modal){
    background:var(--s360-modal-backdrop-bg,rgba(15,23,42,.48));
    backdrop-filter:blur(2px);
}
body.wp-admin .s360-admin-wrapper :where(.s360-dropdown,.s360-ui-dropdown,.school360-dropdown):not(.s360-unstyled-dropdown){
    position:relative;
}
body.wp-admin .s360-admin-wrapper :where(.s360-dropdown-trigger,.s360-ui-dropdown__trigger,.school360-dropdown-trigger):not(.s360-unstyled-dropdown *){
    align-items:center;
    display:inline-flex;
    gap:var(--s360-space-xs,6px);
}
body.wp-admin .s360-admin-wrapper :where(.s360-dropdown-menu,.s360-ui-dropdown__menu,.school360-dropdown-menu):not(.s360-unstyled-dropdown *){
    background:var(--s360-color-surface-raised,#fff);
    border:1px solid var(--s360-color-border-muted,#e2e8f0);
    border-radius:var(--s360-dropdown-radius,var(--s360-radius-xl,14px));
    box-shadow:var(--s360-shadow-dropdown,0 18px 44px rgba(15,23,42,.16));
    min-width:var(--s360-dropdown-min-width,180px);
    overflow:hidden;
    padding:var(--s360-space-xs,6px);
    z-index:var(--s360-z-dropdown,1000);
}
body.wp-admin .s360-admin-wrapper :where(.s360-dropdown-item,.s360-ui-dropdown__item,.school360-dropdown-item):not(.s360-unstyled-dropdown *){
    align-items:center;
    border-radius:var(--s360-radius-md,8px);
    color:var(--s360-color-text-body,#334155);
    display:flex;
    gap:var(--s360-space-xs,6px);
    line-height:1.35;
    padding:var(--s360-dropdown-item-padding-y,8px) var(--s360-dropdown-item-padding-x,10px);
    text-decoration:none;
    width:100%;
}
body.wp-admin .s360-admin-wrapper :where(.s360-dropdown-item,.s360-ui-dropdown__item,.school360-dropdown-item):hover:not(.s360-unstyled-dropdown *),
body.wp-admin .s360-admin-wrapper :where(.s360-dropdown-item.is-active,.s360-ui-dropdown__item--active,.school360-dropdown-item.is-active):not(.s360-unstyled-dropdown *){
    background:var(--s360-color-surface-hover,#f1f5f9);
    color:var(--s360-color-primary,#2271b1);
}
body.wp-admin .s360-admin-wrapper :where(.s360-dropdown-item.is-danger,.s360-ui-dropdown__item--danger,.school360-dropdown-item.is-danger):not(.s360-unstyled-dropdown *){
    color:var(--s360-color-danger-strong,#991b1b);
}
body.wp-admin .s360-admin-wrapper :where(.s360-filter-panel,.s360-ui-filter-shell,.s360-report-filter-panel,.s360-analytics-filter-panel,.s360-calendar-filter-section,.s360-finance-ledger-filters,.s360-hr-directory-filters,.s360-admissions-inbox-filters,.s360-gd-filters-grid,.s360-phase4-filterbar):not(.s360-unstyled-filter){
    background:var(--s360-color-surface-raised,#fff);
    border:1px solid var(--s360-color-border-muted,#e2e8f0);
    border-radius:var(--s360-component-card-radius,var(--s360-radius-2xl,18px));
    box-shadow:var(--s360-shadow-soft,0 10px 24px rgba(15,23,42,.06));
    color:var(--s360-color-text-body,#334155);
    padding:var(--s360-component-filter-padding,var(--s360-space-lg,20px));
}
body.wp-admin .s360-admin-wrapper :where(.s360-filter-bar,.s360-calendar-filterbar,.s360-expense-filter-bar,.s360-expense-quick-filters,.s360-hr-filter-chips,.s360-fee-filter-pills,.s360-report-chip-row):not(.s360-unstyled-filter){
    align-items:center;
    display:flex;
    flex-wrap:wrap;
    gap:var(--s360-component-toolbar-gap,8px);
}
body.wp-admin .s360-admin-wrapper :where(.s360-filter-grid,.s360-filter-grid-5,.s360-report-filter-grid,.s360-analytics-filter-grid,.s360-finance-ledger-filter-grid):not(.s360-unstyled-filter){
    display:grid;
    gap:var(--s360-component-filter-grid-gap,var(--s360-space-md,16px));
    grid-template-columns:repeat(auto-fit,minmax(var(--s360-component-filter-min-width,180px),1fr));
}
body.wp-admin .s360-admin-wrapper :where(.s360-filter-actions,.s360-report-filter-actions,.s360-analytics-filter-actions,.s360-finance-ledger-filter-actions,.s360-hr-filter-actions):not(.s360-unstyled-filter){
    align-items:flex-end;
    display:flex;
    flex-wrap:wrap;
    gap:var(--s360-component-toolbar-gap,8px);
}
body.wp-admin .s360-admin-wrapper :where(.s360-empty-state,.s360-ui-empty-state,.s360-calendar-empty-state,.s360-report-empty-state,.s360-hr-empty-state,.s360-hr-portal-empty,.s360-builder-empty-state,.s360-builder-section-empty,.s360-layout-lane__empty,.s360-profile-table__empty,.s360-u-empty-center-lg,.s360-analytics-chart-empty):not(.s360-unstyled-empty){
    align-items:center;
    background:var(--s360-color-surface-subtle,#f8fafc);
    border:1px dashed var(--s360-color-border-muted,#e2e8f0);
    border-radius:var(--s360-component-empty-state-radius,var(--s360-radius-2xl,18px));
    color:var(--s360-color-text-secondary,#475569);
    display:flex;
    flex-direction:column;
    gap:var(--s360-space-sm,10px);
    justify-content:center;
    min-height:var(--s360-component-empty-state-min-height,120px);
    padding:var(--s360-component-empty-state-padding,var(--s360-space-xl,24px));
    text-align:center;
}
body.wp-admin .s360-admin-wrapper :where(.s360-empty-state h2,.s360-empty-state h3,.s360-empty-state h4,.s360-ui-empty-state__title,.s360-hr-empty-state h3,.s360-builder-empty-state h3,.s360-report-empty-state h3):not(.s360-unstyled-empty *){
    color:var(--s360-color-text-heading,#0f172a);
    margin:0;
}
body.wp-admin .s360-admin-wrapper :where(.s360-empty-state p,.s360-ui-empty-state__message,.s360-ui-empty-state__hint,.s360-hr-empty-state p,.s360-builder-empty-state p,.s360-report-empty-state p):not(.s360-unstyled-empty *){
    color:var(--s360-color-text-secondary,#475569);
    margin:0;
    max-width:60ch;
}
body.wp-admin .s360-admin-wrapper :where(.s360-loading,.s360-loading-state,.s360-skeleton,.s360-ui-skeleton,.s360-skeleton-line):not(.s360-unstyled-loading){
    background:linear-gradient(90deg,var(--s360-skeleton-bg,#f1f5f9),var(--s360-color-surface-raised,#fff),var(--s360-skeleton-bg,#f1f5f9));
    background-size:200% 100%;
    border-radius:var(--s360-skeleton-radius,var(--s360-radius-lg,12px));
    min-height:var(--s360-skeleton-min-height,16px);
}
body.wp-admin .s360-admin-wrapper :where(.s360-loading-state):not(.s360-unstyled-loading){
    align-items:center;
    border:1px solid var(--s360-color-border-muted,#e2e8f0);
    display:flex;
    gap:var(--s360-space-sm,10px);
    justify-content:center;
    padding:var(--s360-space-lg,20px);
}
@media (prefers-reduced-motion:no-preference){
    body.wp-admin .s360-admin-wrapper :where(.s360-loading,.s360-loading-state,.s360-skeleton,.s360-ui-skeleton,.s360-skeleton-line):not(.s360-unstyled-loading){
        animation:s360-admin-skeleton-pulse var(--s360-skeleton-animation-duration,1.4s) ease-in-out infinite;
    }
}
@keyframes s360-admin-skeleton-pulse{
    0%{background-position:200% 0;}
    100%{background-position:-200% 0;}
}
@media (max-width:782px){
    body.wp-admin .s360-admin-wrapper :where(.s360-ui-modal__footer,.s360-modal__footer,.school360-modal__footer,.s360-builder-modal__footer):not(.s360-unstyled-modal){
        align-items:stretch;
        flex-direction:column-reverse;
    }
    body.wp-admin .s360-admin-wrapper :where(.s360-filter-panel,.s360-ui-filter-shell,.s360-report-filter-panel,.s360-analytics-filter-panel,.s360-calendar-filter-section,.s360-finance-ledger-filters,.s360-hr-directory-filters,.s360-admissions-inbox-filters,.s360-gd-filters-grid,.s360-phase4-filterbar):not(.s360-unstyled-filter){
        padding:var(--s360-space-md,16px);
    }
    body.wp-admin .s360-admin-wrapper :where(.s360-filter-actions,.s360-report-filter-actions,.s360-analytics-filter-actions,.s360-finance-ledger-filter-actions,.s360-hr-filter-actions):not(.s360-unstyled-filter){
        align-items:stretch;
        flex-direction:column;
    }
}

/* UI Phase 5D: responsive, mobile and horizontal-overflow compatibility layer.
 * Scoped to the shared admin wrapper introduced in Phase 4. This pass keeps markup,
 * routing, permissions, nonces, AJAX/REST handlers and JavaScript behavior unchanged.
 */
body.wp-admin .s360-admin-wrapper,
body.wp-admin .s360-admin-wrapper * ,
body.wp-admin .s360-admin-wrapper *::before,
body.wp-admin .s360-admin-wrapper *::after{
    box-sizing:border-box;
}
body.wp-admin .s360-admin-wrapper{
    max-width:100%;
    min-width:0;
    overflow-wrap:anywhere;
}
body.wp-admin .s360-admin-wrapper :where(.s360-ui-page-header,.s360-ui-card,.s360-ui-section-card,.s360-card,.s360-panel,.s360-surface,.postbox,.s360-admin-shell,.s360-admin-content,.s360-layout,.s360-main,.s360-content):not(.s360-allow-overflow){
    max-width:100%;
    min-width:0;
}
body.wp-admin .s360-admin-wrapper :where(.s360-ui-grid,.s360-grid,.s360-dashboard-grid,.s360-stat-grid,.s360-kpi-grid,.s360-card-grid,.s360-section-grid,.s360-settings-grid,.s360-hr-grid,.s360-finance-grid,.s360-expense-grid,.s360-report-grid,.s360-admissions-grid):not(.s360-allow-overflow){
    max-width:100%;
    min-width:0;
}
body.wp-admin .s360-admin-wrapper :where(.s360-ui-tabs,.nav-tab-wrapper,.s360-ui-tabs__nav,.s360-tabs,.school360-tabs,.s360-report-tabs,.s360-academic-tabs,.s360-hr-nav):not(.s360-allow-overflow){
    max-width:100%;
    min-width:0;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:thin;
}
body.wp-admin .s360-admin-wrapper :where(.s360-ui-tabs__nav,.nav-tab-wrapper,.s360-tabs,.school360-tabs,.s360-report-tabs,.s360-academic-tabs,.s360-hr-nav):not(.s360-allow-overflow){
    flex-wrap:nowrap;
    white-space:nowrap;
}
body.wp-admin .s360-admin-wrapper :where(.s360-ui-tabs__tab,.nav-tab,.s360-tab,.school360-tab,.s360-report-tab,.s360-academic-tab,.s360-hr-nav-item):not(.s360-allow-overflow){
    flex:0 0 auto;
}
body.wp-admin .s360-admin-wrapper :where(.s360-table-wrap,.s360-ui-table-wrap,.s360-table-responsive,.s360-table-scroll,.s360-data-table-wrap,.s360-report-table-wrap,.s360-finance-table-wrap,.s360-expense-table-wrap,.s360-hr-table-wrap,.s360-admissions-table-wrap,.s360-scroll-x,.tablenav-pages):not(.s360-allow-overflow){
    max-width:100%;
    overflow-x:auto;
    overflow-y:visible;
    -webkit-overflow-scrolling:touch;
}
body.wp-admin .s360-admin-wrapper :where(table,.widefat,.wp-list-table,.s360-table,.s360-data-table,.s360-report-table,.s360-finance-table,.s360-expense-table,.s360-hr-table,.s360-admissions-table):not(.s360-allow-overflow){
    max-width:100%;
}
body.wp-admin .s360-admin-wrapper :where(img,svg,canvas,video,iframe):not(.s360-allow-overflow){
    max-width:100%;
}
body.wp-admin .s360-admin-wrapper :where(input[type="text"],input[type="search"],input[type="email"],input[type="url"],input[type="tel"],input[type="number"],input[type="password"],input[type="date"],input[type="time"],input[type="datetime-local"],select,textarea):not(.s360-allow-overflow){
    max-width:100%;
}
body.wp-admin .s360-admin-wrapper :where(.s360-ui-modal__dialog,.s360-modal__dialog,.school360-modal__dialog,.s360-builder-modal__dialog,.s360-expense-receipt-modal):not(.s360-allow-overflow):not(.s360-unstyled-modal){
    max-height:calc(100dvh - 32px);
    max-width:calc(100vw - 32px);
    overflow:auto;
}
@media (max-width:960px){
    body.wp-admin .s360-admin-wrapper :where(.s360-ui-grid,.s360-grid,.s360-dashboard-grid,.s360-stat-grid,.s360-kpi-grid,.s360-card-grid,.s360-section-grid,.s360-settings-grid,.s360-hr-grid,.s360-finance-grid,.s360-expense-grid,.s360-report-grid,.s360-admissions-grid):not(.s360-allow-overflow){
        grid-template-columns:repeat(auto-fit,minmax(min(100%,var(--s360-responsive-grid-min,220px)),1fr));
    }
    body.wp-admin .s360-admin-wrapper :where(.widefat,.wp-list-table,.s360-table,.s360-data-table,.s360-report-table,.s360-finance-table,.s360-expense-table,.s360-hr-table,.s360-admissions-table):not(.s360-allow-overflow){
        display:block;
        overflow-x:auto;
        -webkit-overflow-scrolling:touch;
        white-space:nowrap;
        width:100%;
    }
}
@media (max-width:782px){
    body.wp-admin .s360-admin-wrapper{
        padding-inline:var(--s360-responsive-admin-padding-inline,0);
    }
    body.wp-admin .s360-admin-wrapper :where(.s360-ui-page-header,.s360-ui-card,.s360-ui-section-card,.s360-card,.s360-panel,.postbox):not(.s360-allow-overflow){
        border-radius:var(--s360-responsive-card-radius,var(--s360-radius-xl,14px));
    }
    body.wp-admin .s360-admin-wrapper :where(.s360-ui-tabs__nav,.nav-tab-wrapper,.s360-tabs,.school360-tabs,.s360-report-tabs,.s360-academic-tabs,.s360-hr-nav):not(.s360-allow-overflow){
        scroll-padding-inline:var(--s360-space-sm,12px);
        scroll-snap-type:x proximity;
    }
    body.wp-admin .s360-admin-wrapper :where(.s360-ui-tabs__tab,.nav-tab,.s360-tab,.school360-tab,.s360-report-tab,.s360-academic-tab,.s360-hr-nav-item):not(.s360-allow-overflow){
        scroll-snap-align:start;
    }
    body.wp-admin .s360-admin-wrapper :where(.s360-ui-modal__dialog,.s360-modal__dialog,.school360-modal__dialog,.s360-builder-modal__dialog,.s360-expense-receipt-modal):not(.s360-allow-overflow):not(.s360-unstyled-modal){
        max-height:calc(100dvh - 20px);
        max-width:calc(100vw - 20px);
    }
}
@media (max-width:600px){
    body.wp-admin .s360-admin-wrapper :where(.s360-ui-page-header__actions,.s360-toolbar,.s360-actions,.s360-card-actions,.s360-page-actions,.s360-ui-page-actions,.s360-admin-actions,.s360-filter-actions,.s360-report-filter-actions,.s360-analytics-filter-actions,.s360-finance-ledger-filter-actions,.s360-hr-filter-actions):not(.s360-allow-overflow){
        align-items:stretch;
        flex-direction:column;
    }
    body.wp-admin .s360-admin-wrapper :where(.s360-ui-page-header__actions .button,.s360-toolbar .button,.s360-actions .button,.s360-card-actions .button,.s360-page-actions .button,.s360-admin-actions .button,.s360-filter-actions .button,.s360-ui-button):not(.s360-allow-overflow){
        justify-content:center;
        text-align:center;
        width:100%;
    }
    body.wp-admin .s360-admin-wrapper :where(.s360-filter-grid,.s360-filter-grid-5,.s360-report-filter-grid,.s360-analytics-filter-grid,.s360-finance-ledger-filter-grid,.s360-ui-grid,.s360-grid):not(.s360-allow-overflow){
        grid-template-columns:1fr;
    }
}

/* v13.3 hotfix: unify page-level/main navigation tabs visually.
 * The markup contract is already `.s360-ui-main-tabs`; this late card-system
 * layer makes Admin Dashboard and grouped/module pages render the same
 * rounded card + pill-tab pattern, neutralizing older underline overrides.
 * Sub/workflow tabs remain controlled by `.s360-ui-sub-tabs` and are not changed.
 */
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-ui-main-tabs,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.s360-grouped-admin .s360-ui-main-tabs,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.school360-dashboard-phase-d nav.s360-admin-dashboard__tabs.s360-ui-main-tabs,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.s360-expense-phase-h .s360-ui-main-tabs,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.s360-finance-phase-h .s360-ui-main-tabs{
    position:relative;
    top:auto;
    z-index:auto;
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    justify-content:flex-start;
    gap:var(--s360-space-xs, 8px);
    width:100%;
    max-width:none;
    min-width:0;
    margin:18px 0 22px;
    padding:var(--s360-space-xs, 8px);
    border:1px solid var(--s360-color-border-muted,var(--s360-color-border,#dbe5f0));
    border-bottom:1px solid var(--s360-color-border-muted,var(--s360-color-border,#dbe5f0));
    border-radius:16px;
    background:var(--s360-color-surface,var(--s360-color-white,#fff));
    box-shadow:var(--s360-shadow-sm,0 1px 2px rgba(15,23,42,.06));
    backdrop-filter:none;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:thin;
    white-space:nowrap;
}
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-ui-main-tabs .nav-tab,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-ui-main-tabs .s360-ui-tabs__tab,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-ui-main-tabs .s360-finance-tab-link,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-ui-main-tabs .s360-tab,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-ui-main-tabs .school360-tab,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.school360-dashboard-phase-d nav.s360-admin-dashboard__tabs.s360-ui-main-tabs > a.nav-tab.s360-ui-tabs__tab{
    position:relative;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 auto;
    min-height:38px;
    margin:0;
    padding:var(--s360-space-xs, 8px) var(--s360-space-sm, 12px);
    border:1px solid transparent;
    border-bottom:1px solid transparent;
    border-radius:999px;
    background:transparent;
    box-shadow:none;
    color:var(--s360-color-text-soft,var(--s360-color-text-muted,#64748b));
    font-size:13px;
    font-weight:700;
    line-height:1.3;
    text-align:center;
    text-decoration:none;
    white-space:nowrap;
    transform:none;
}
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-ui-main-tabs .nav-tab:hover,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-ui-main-tabs .nav-tab:focus-visible,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-ui-main-tabs .s360-ui-tabs__tab:hover,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-ui-main-tabs .s360-ui-tabs__tab:focus-visible,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-ui-main-tabs .s360-finance-tab-link:hover,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-ui-main-tabs .s360-finance-tab-link:focus-visible,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-ui-main-tabs .s360-tab:hover,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-ui-main-tabs .s360-tab:focus-visible,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-ui-main-tabs .school360-tab:hover,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-ui-main-tabs .school360-tab:focus-visible,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.school360-dashboard-phase-d nav.s360-admin-dashboard__tabs.s360-ui-main-tabs > a.nav-tab.s360-ui-tabs__tab:hover,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.school360-dashboard-phase-d nav.s360-admin-dashboard__tabs.s360-ui-main-tabs > a.nav-tab.s360-ui-tabs__tab:focus-visible{
    border-color:var(--s360-color-primary-soft-border,var(--s360-color-border,#bfdbfe));
    border-bottom-color:var(--s360-color-primary-soft-border,var(--s360-color-border,#bfdbfe));
    background:var(--s360-color-bg-subtle,var(--s360-color-bg,#f8fafc));
    color:var(--s360-color-primary,#2271b1);
    box-shadow:none;
    outline:none;
}
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-ui-main-tabs .nav-tab-active,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-ui-main-tabs .is-active,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-ui-main-tabs .active,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-ui-main-tabs [aria-current="page"],
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-ui-main-tabs [aria-selected="true"],
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.school360-dashboard-phase-d nav.s360-admin-dashboard__tabs.s360-ui-main-tabs > a.nav-tab.s360-ui-tabs__tab.nav-tab-active,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.school360-dashboard-phase-d nav.s360-admin-dashboard__tabs.s360-ui-main-tabs > a.nav-tab.s360-ui-tabs__tab.is-active,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.school360-dashboard-phase-d nav.s360-admin-dashboard__tabs.s360-ui-main-tabs > a.nav-tab.s360-ui-tabs__tab[aria-current="page"]{
    border-color:var(--s360-color-primary-soft-border,var(--s360-color-primary,#2271b1));
    border-bottom-color:var(--s360-color-primary-soft-border,var(--s360-color-primary,#2271b1));
    background:var(--s360-color-primary-soft,var(--s360-color-border-exact-f0f6fc,#f0f6fc));
    color:var(--s360-color-primary,#2271b1);
    box-shadow:none;
}
@media (max-width:782px){
    body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-ui-main-tabs,
    body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.s360-grouped-admin .s360-ui-main-tabs,
    body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.school360-dashboard-phase-d nav.s360-admin-dashboard__tabs.s360-ui-main-tabs,
    body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.s360-expense-phase-h .s360-ui-main-tabs,
    body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.s360-finance-phase-h .s360-ui-main-tabs{
        flex-wrap:nowrap;
        scroll-padding-inline:var(--s360-space-sm,12px);
    }
}

/* v13.3 corrective alignment: Dashboard/Finance/HR use the same main-nav visual
 * as grouped admin pages/modules. Earlier fixes standardized the class contract,
 * but screenshots confirmed dashboard-, finance- and HR-specific selectors still
 * influenced color/spacing. Keep compatibility classes for JS and legacy CSS, but
 * make every .s360-ui-main-tabs strip render through this final shared contract.
 * Scope: page-level/main navigation only; .s360-ui-sub-tabs remain unchanged.
 */
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-ui-main-tabs:not(.s360-ui-sub-tabs){
    position:relative;
    top:auto;
    z-index:auto;
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    justify-content:flex-start;
    gap:var(--s360-space-xs, 8px);
    width:100%;
    max-width:none;
    min-width:0;
    box-sizing:border-box;
    margin:18px 0 22px;
    padding:var(--s360-space-xs, 8px);
    border:1px solid var(--s360-color-border-muted,var(--s360-color-border,#dbe5f0));
    border-bottom:1px solid var(--s360-color-border-muted,var(--s360-color-border,#dbe5f0));
    border-radius:16px;
    background:var(--s360-color-surface,var(--s360-color-white,#fff));
    background-image:none;
    box-shadow:var(--s360-shadow-sm,0 1px 2px rgba(15,23,42,.06));
    backdrop-filter:none;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:thin;
    white-space:nowrap;
}
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-ui-main-tabs:not(.s360-ui-sub-tabs) :where(.nav-tab,.s360-ui-tabs__tab,.s360-finance-tab-link,.s360-hr-nav-item,.s360-tab,.school360-tab,a,button){
    position:relative;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 auto;
    min-height:38px;
    min-width:0;
    width:auto;
    margin:0;
    padding:8px 12px;
    border:1px solid transparent;
    border-bottom:1px solid transparent;
    border-radius:999px;
    background:transparent;
    background-image:none;
    box-shadow:none;
    color:var(--s360-color-primary,#2271b1);
    font-size:13px;
    font-weight:700;
    line-height:1.3;
    letter-spacing:normal;
    text-align:center;
    text-decoration:none;
    text-transform:none;
    white-space:nowrap;
    transform:none;
}
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-ui-main-tabs:not(.s360-ui-sub-tabs) :where(.nav-tab:hover,.nav-tab:focus-visible,.s360-ui-tabs__tab:hover,.s360-ui-tabs__tab:focus-visible,.s360-finance-tab-link:hover,.s360-finance-tab-link:focus-visible,.s360-hr-nav-item:hover,.s360-hr-nav-item:focus-visible,.s360-tab:hover,.s360-tab:focus-visible,.school360-tab:hover,.school360-tab:focus-visible,a:hover,a:focus-visible,button:hover,button:focus-visible){
    border-color:var(--s360-color-primary-soft-border,var(--s360-color-border,#bfdbfe));
    border-bottom-color:var(--s360-color-primary-soft-border,var(--s360-color-border,#bfdbfe));
    background:var(--s360-color-bg-subtle,var(--s360-color-bg,#f8fafc));
    background-image:none;
    color:var(--s360-color-primary,#2271b1);
    box-shadow:none;
    outline:none;
    transform:none;
}
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-ui-main-tabs:not(.s360-ui-sub-tabs) :where(.nav-tab-active,.is-active,.active,[aria-current="page"],[aria-selected="true"]){
    border-color:var(--s360-color-primary-soft-border,var(--s360-color-primary,#2271b1));
    border-bottom-color:var(--s360-color-primary-soft-border,var(--s360-color-primary,#2271b1));
    background:var(--s360-color-primary-soft,var(--s360-color-border-exact-f0f6fc,#f0f6fc));
    background-image:none;
    color:var(--s360-color-primary,#2271b1);
    box-shadow:none;
}
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.school360-dashboard-phase-d nav.s360-admin-dashboard__tabs.s360-ui-main-tabs,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.s360-finance-phase-h nav.s360-finance-tabs.s360-ui-main-tabs,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.s360-hr-phase-i nav.s360-hr-nav.s360-ui-main-tabs{
    margin:var(--s360-tabs-main-margin,14px 0 16px);
}
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.s360-hr-phase-i .s360-ui-section-card--hr-navigation{
    display:block;
    min-height:0;
    margin:18px 0 22px;
    padding:0;
    border:0;
    border-radius:0;
    background:transparent;
    background-image:none;
    box-shadow:none;
}
@media (max-width:782px){
    body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-ui-main-tabs:not(.s360-ui-sub-tabs){
        flex-wrap:nowrap;
        scroll-padding-inline:var(--s360-space-sm,12px);
    }
}

/* v13.3 final specificity guard: neutralize Dashboard, Finance and HR
 * module-specific main-tab selectors that carry more specificity than the generic
 * shared contract above. These selectors intentionally keep existing compatibility
 * class names while preserving the same grouped/module visual result.
 * Phase 7: priority flags were removed from this final guard. The selector
 * specificity plus card-system.css load order now carry the contract without
 * priority flags; keep Dashboard/Finance/HR navigation in QA for this phase.
 */
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.school360-dashboard-phase-d nav.s360-admin-dashboard__tabs.s360-ui-main-tabs,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.s360-finance-phase-h nav.s360-finance-tabs.s360-ui-main-tabs,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.s360-hr-phase-i .s360-ui-section-card--hr-navigation nav.s360-hr-nav.s360-ui-main-tabs{
    position:relative;
    top:auto;
    z-index:auto;
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    justify-content:flex-start;
    gap:var(--s360-space-xs, 8px);
    width:100%;
    max-width:none;
    min-width:0;
    box-sizing:border-box;
    margin:18px 0 22px;
    padding:var(--s360-space-xs, 8px);
    border:1px solid var(--s360-color-border-muted,var(--s360-color-border,#dbe5f0));
    border-bottom:1px solid var(--s360-color-border-muted,var(--s360-color-border,#dbe5f0));
    border-radius:16px;
    background:var(--s360-color-surface,var(--s360-color-white,#fff));
    background-image:none;
    box-shadow:var(--s360-shadow-sm,0 1px 2px rgba(15,23,42,.06));
    backdrop-filter:none;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:thin;
    white-space:nowrap;
}
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.school360-dashboard-phase-d nav.s360-admin-dashboard__tabs.s360-ui-main-tabs > a.nav-tab.s360-ui-tabs__tab,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.s360-finance-phase-h nav.s360-finance-tabs.s360-ui-main-tabs > a.nav-tab.s360-finance-tab-link.s360-ui-tabs__tab,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.s360-hr-phase-i .s360-ui-section-card--hr-navigation nav.s360-hr-nav.s360-ui-main-tabs > a.nav-tab.s360-hr-nav-item.s360-ui-tabs__tab{
    position:relative;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 auto;
    min-height:38px;
    min-width:0;
    width:auto;
    margin:0;
    padding:var(--s360-space-xs, 8px) var(--s360-space-sm, 12px);
    border:1px solid transparent;
    border-bottom:1px solid transparent;
    border-radius:999px;
    background:transparent;
    background-image:none;
    box-shadow:none;
    color:var(--s360-color-primary,#2271b1);
    font-size:13px;
    font-weight:700;
    line-height:1.3;
    letter-spacing:normal;
    text-align:center;
    text-decoration:none;
    text-transform:none;
    white-space:nowrap;
    transform:none;
}
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.school360-dashboard-phase-d nav.s360-admin-dashboard__tabs.s360-ui-main-tabs > a.nav-tab.s360-ui-tabs__tab:hover,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.school360-dashboard-phase-d nav.s360-admin-dashboard__tabs.s360-ui-main-tabs > a.nav-tab.s360-ui-tabs__tab:focus-visible,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.s360-finance-phase-h nav.s360-finance-tabs.s360-ui-main-tabs > a.nav-tab.s360-finance-tab-link.s360-ui-tabs__tab:hover,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.s360-finance-phase-h nav.s360-finance-tabs.s360-ui-main-tabs > a.nav-tab.s360-finance-tab-link.s360-ui-tabs__tab:focus-visible,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.s360-hr-phase-i .s360-ui-section-card--hr-navigation nav.s360-hr-nav.s360-ui-main-tabs > a.nav-tab.s360-hr-nav-item.s360-ui-tabs__tab:hover,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.s360-hr-phase-i .s360-ui-section-card--hr-navigation nav.s360-hr-nav.s360-ui-main-tabs > a.nav-tab.s360-hr-nav-item.s360-ui-tabs__tab:focus-visible{
    border-color:var(--s360-color-primary-soft-border,var(--s360-color-border,#bfdbfe));
    border-bottom-color:var(--s360-color-primary-soft-border,var(--s360-color-border,#bfdbfe));
    background:var(--s360-color-bg-subtle,var(--s360-color-bg,#f8fafc));
    background-image:none;
    color:var(--s360-color-primary,#2271b1);
    box-shadow:none;
    outline:none;
    transform:none;
}
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.school360-dashboard-phase-d nav.s360-admin-dashboard__tabs.s360-ui-main-tabs > a.nav-tab.s360-ui-tabs__tab.nav-tab-active,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.school360-dashboard-phase-d nav.s360-admin-dashboard__tabs.s360-ui-main-tabs > a.nav-tab.s360-ui-tabs__tab.is-active,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.school360-dashboard-phase-d nav.s360-admin-dashboard__tabs.s360-ui-main-tabs > a.nav-tab.s360-ui-tabs__tab[aria-current="page"],
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.s360-finance-phase-h nav.s360-finance-tabs.s360-ui-main-tabs > a.nav-tab.s360-finance-tab-link.s360-ui-tabs__tab.nav-tab-active,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.s360-finance-phase-h nav.s360-finance-tabs.s360-ui-main-tabs > a.nav-tab.s360-finance-tab-link.s360-ui-tabs__tab.is-active,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.s360-finance-phase-h nav.s360-finance-tabs.s360-ui-main-tabs > a.nav-tab.s360-finance-tab-link.s360-ui-tabs__tab[aria-selected="true"],
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.s360-hr-phase-i .s360-ui-section-card--hr-navigation nav.s360-hr-nav.s360-ui-main-tabs > a.nav-tab.s360-hr-nav-item.s360-ui-tabs__tab.nav-tab-active,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.s360-hr-phase-i .s360-ui-section-card--hr-navigation nav.s360-hr-nav.s360-ui-main-tabs > a.nav-tab.s360-hr-nav-item.s360-ui-tabs__tab.is-active,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.s360-hr-phase-i .s360-ui-section-card--hr-navigation nav.s360-hr-nav.s360-ui-main-tabs > a.nav-tab.s360-hr-nav-item.s360-ui-tabs__tab.s360-hr-nav-active,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.s360-hr-phase-i .s360-ui-section-card--hr-navigation nav.s360-hr-nav.s360-ui-main-tabs > a.nav-tab.s360-hr-nav-item.s360-ui-tabs__tab[aria-current="page"]{
    border-color:var(--s360-color-primary-soft-border,var(--s360-color-primary,#2271b1));
    border-bottom-color:var(--s360-color-primary-soft-border,var(--s360-color-primary,#2271b1));
    background:var(--s360-color-primary-soft,var(--s360-color-border-exact-f0f6fc,#f0f6fc));
    background-image:none;
    color:var(--s360-color-primary,#2271b1);
    box-shadow:none;
}
@media (max-width:782px){
    body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.school360-dashboard-phase-d nav.s360-admin-dashboard__tabs.s360-ui-main-tabs,
    body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.s360-finance-phase-h nav.s360-finance-tabs.s360-ui-main-tabs,
    body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper.s360-hr-phase-i .s360-ui-section-card--hr-navigation nav.s360-hr-nav.s360-ui-main-tabs{
        flex-wrap:nowrap;
        scroll-padding-inline:var(--s360-space-sm,12px);
    }
}

/* Phase 8 ownership extraction: Phase 6 relocated from ui-system.css: v13.3 UI/IX refinement v3: Admissions/System dashboard compact-card correction. now lives in its scoped admin ownership layer. */

/* v13.3 Phase 9A: grouped admin shell adoption for custom workspaces.
 * Goal: HR, Finance, Calendar & Events and Admin Dashboard now opt into the
 * same structural shell classes as grouped admin modules while preserving their
 * existing functional classes, routes, JS hooks and permissions.
 * Scope: layout/visual contract only; sub/workflow tabs remain unchanged.
 */
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-page-shell{
    max-width:none;
    width:auto;
    min-width:0;
    box-sizing:border-box;
    background:transparent;
    background-image:none;
}
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-page-shell > :where(.s360-ui-page-header,.s360-grouped-admin__hero,.s360-grouped-admin__notice-slot,.s360-grouped-admin__top-surfaces,.s360-ui-header-utility-grid,.s360-admin-dashboard__top-surfaces,.s360-ui-main-tabs,.s360-grouped-admin__content,.s360-admin-dashboard__workspace,.s360-calendar-workspace,.s360-hr-shell),
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-hr-phase-i .s360-hr-shell > :where(.s360-ui-page-header,.s360-grouped-admin__hero,.s360-grouped-admin__top-surfaces,.s360-ui-header-utility-grid,.s360-ui-section-card--hr-navigation,.s360-hr-main){
    width:100%;
    max-width:none;
    min-width:0;
    box-sizing:border-box;
}
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-hr-phase-i .s360-hr-shell{
    display:block;
    width:100%;
    max-width:none;
    min-width:0;
    margin-top:0;
}
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-hr-phase-i .s360-ui-section-card--hr-navigation{
    margin:18px 0 22px;
    padding:0;
    border:0;
    border-radius:0;
    background:transparent;
    background-image:none;
    box-shadow:none;
}
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-calendar-phase-k > .s360-calendar-workspace,
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-admin-dashboard > .s360-admin-dashboard__workspace,
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-finance-page,
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-hr-phase-i .s360-hr-main{
    max-width:none;
    min-width:0;
}
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin .s360-grouped-admin__hero.s360-ui-page-header{
    margin-top:0;
}
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-calendar-phase-k .s360-calendar-action-tabs.s360-ui-main-tabs,
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-finance-phase-h .s360-finance-tabs.s360-ui-main-tabs,
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-hr-phase-i .s360-hr-nav.s360-ui-main-tabs,
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.school360-dashboard-phase-d .s360-admin-dashboard__tabs.s360-ui-main-tabs{
    margin:var(--s360-tabs-main-margin,14px 0 16px);
}


/* v13.3 Phase 9B: first-class grouped shell main navigation.
 * Custom Dashboard, Calendar, HR and Finance workspaces now expose their
 * page-level tab strip as the same grouped shell sibling used by the grouped
 * admin renderer. Functional module classes remain in place for JS/PHP hooks;
 * this block only normalizes spacing/width after the structural move.
 */
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-page-shell .s360-grouped-admin__main-tabs.s360-ui-main-tabs:not(.s360-ui-sub-tabs){
    width:100%;
    max-width:none;
    min-width:0;
    box-sizing:border-box;
    margin:var(--s360-tabs-main-margin,14px 0 16px);
}
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-page-shell > .s360-grouped-admin__main-tabs.s360-ui-main-tabs:not(.s360-ui-sub-tabs),
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-page-shell .s360-hr-shell > .s360-grouped-admin__main-tabs.s360-ui-main-tabs:not(.s360-ui-sub-tabs){
    align-self:stretch;
}
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-calendar-phase-k > .s360-calendar-workspace.s360-grouped-admin__content,
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.school360-dashboard-phase-d > .s360-admin-dashboard__workspace.s360-grouped-admin__content,
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-hr-phase-i .s360-hr-main.s360-grouped-admin__content{
    margin-top:0;
}
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-hr-phase-i .s360-hr-shell > nav.s360-hr-nav.s360-grouped-admin__main-tabs.s360-ui-main-tabs{
    margin:var(--s360-tabs-main-margin,14px 0 16px);
}
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-calendar-phase-k > nav.s360-calendar-action-tabs.s360-grouped-admin__main-tabs.s360-ui-main-tabs{
    margin:var(--s360-tabs-main-margin,14px 0 16px);
}


/* v13.3 Phase 9C: grouped shell parity hardening for remaining custom tab shells.
 * Scope: visual/layout contract only. Functional module classes remain intact;
 * sub/workflow tabs are still excluded by the `.s360-ui-sub-tabs` guard.
 */
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-page-shell > .s360-grouped-admin__main-tabs.s360-ui-main-tabs:not(.s360-ui-sub-tabs),
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-page-shell .s360-hr-shell > .s360-grouped-admin__main-tabs.s360-ui-main-tabs:not(.s360-ui-sub-tabs),
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-page-shell .s360-grouped-admin__content > .s360-grouped-admin__main-tabs.s360-ui-main-tabs:not(.s360-ui-sub-tabs){
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:8px;
    width:100%;
    max-width:none;
    min-width:0;
    margin:18px 0 22px;
    padding:8px;
    border:1px solid var(--s360-color-border-muted,var(--s360-color-border,#dbe5f0));
    border-radius:16px;
    background:var(--s360-color-surface,var(--s360-color-white,#fff));
    background-image:none;
    box-shadow:var(--s360-shadow-sm,0 1px 2px rgba(15,23,42,.06));
    box-sizing:border-box;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:thin;
    white-space:nowrap;
}
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-page-shell .s360-grouped-admin__main-tabs.s360-ui-main-tabs:not(.s360-ui-sub-tabs) :where(.nav-tab,.s360-ui-tabs__tab,.s360-finance-tab-link,.s360-hr-nav-item,.s360-tab,.school360-tab,a,button){
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 auto;
    min-height:38px;
    margin:0;
    padding:8px 12px;
    border:1px solid transparent;
    border-radius:999px;
    background:transparent;
    background-image:none;
    box-shadow:none;
    color:var(--s360-color-primary,#2271b1);
    font-size:13px;
    font-weight:700;
    line-height:1.3;
    text-decoration:none;
    white-space:nowrap;
}
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-page-shell .s360-grouped-admin__main-tabs.s360-ui-main-tabs:not(.s360-ui-sub-tabs) :where(.nav-tab:hover,.nav-tab:focus-visible,.s360-ui-tabs__tab:hover,.s360-ui-tabs__tab:focus-visible,.s360-finance-tab-link:hover,.s360-finance-tab-link:focus-visible,.s360-hr-nav-item:hover,.s360-hr-nav-item:focus-visible,.s360-tab:hover,.s360-tab:focus-visible,.school360-tab:hover,.school360-tab:focus-visible,a:hover,a:focus-visible,button:hover,button:focus-visible){
    border-color:var(--s360-color-primary-soft-border,var(--s360-color-border,#bfdbfe));
    background:var(--s360-color-bg-subtle,var(--s360-color-bg,#f8fafc));
    background-image:none;
    color:var(--s360-color-primary,#2271b1);
    box-shadow:none;
    outline:none;
}
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-page-shell .s360-grouped-admin__main-tabs.s360-ui-main-tabs:not(.s360-ui-sub-tabs) :where(.nav-tab-active,.is-active,.active,[aria-current="page"],[aria-selected="true"],.s360-hr-nav-active){
    border-color:var(--s360-color-primary-soft-border,var(--s360-color-primary,#2271b1));
    background:var(--s360-color-primary-soft,var(--s360-color-border-exact-f0f6fc,#f0f6fc));
    background-image:none;
    color:var(--s360-color-primary,#2271b1);
    box-shadow:none;
}
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-page-shell > .s360-grouped-admin__content,
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-page-shell .s360-hr-shell > .s360-grouped-admin__content{
    width:100%;
    max-width:none;
    min-width:0;
    margin-top:0;
    box-sizing:border-box;
}
@media (max-width:782px){
    body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-page-shell .s360-grouped-admin__main-tabs.s360-ui-main-tabs:not(.s360-ui-sub-tabs){
        flex-wrap:nowrap;
        scroll-padding-inline:var(--s360-space-sm,12px);
    }
}

/* Phase 8 ownership extraction: v13.3 Phase 9N: Admin Dashboard header school selector placement. now lives in its scoped admin ownership layer. */

/* Phase 8 ownership extraction: v13.3 Phase 9V: Calendar & Events admin workspace polish. now lives in its scoped admin ownership layer. */

/* Phase 8 ownership extraction: School 360 Phase 11C: Student Operations visual polish. now lives in its scoped admin ownership layer. */

/* v13.3 STAT-INLINE-01: Shared stat/KPI inline metric row.
 * Scope: WordPress admin stat cards that expose the standard
 * .s360-ui-stat-card__value + label pattern. Keeps PHP markup, routes,
 * permissions, data queries, and JS unchanged.
 */
body.wp-admin .s360-admin-wrapper .s360-ui-stat-card:has(> .s360-ui-stat-card__value):has(> .s360-ui-stat-card__label),
body.wp-admin .s360-admin-wrapper .s360-ui-stat-card:has(> .s360-ui-stat-card__value + div:not([class])),
body.wp-admin .s360-admin-wrapper .s360-grid-4-stat > .s360-ui-card:has(> .s360-ui-stat-card__value + div:not([class])){
    display:grid;
    grid-template-columns:auto minmax(0,1fr);
    grid-template-areas:
        "value label"
        "helper helper"
        "meta meta"
        "delta delta"
        "footer footer"
        "action action";
    align-items:baseline;
    justify-content:start;
    column-gap:var(--s360-space-xs, 8px);
    row-gap:var(--s360-space-2xs, 4px);
}
body.wp-admin .s360-admin-wrapper .s360-ui-stat-card:has(> .s360-ui-stat-card__value):has(> .s360-ui-stat-card__label) > .s360-ui-stat-card__value,
body.wp-admin .s360-admin-wrapper .s360-ui-stat-card:has(> .s360-ui-stat-card__value + div:not([class])) > .s360-ui-stat-card__value,
body.wp-admin .s360-admin-wrapper .s360-grid-4-stat > .s360-ui-card:has(> .s360-ui-stat-card__value + div:not([class])) > .s360-ui-stat-card__value{
    grid-area:value;
    margin:0;
    align-self:baseline;
}
body.wp-admin .s360-admin-wrapper .s360-ui-stat-card:has(> .s360-ui-stat-card__value):has(> .s360-ui-stat-card__label) > .s360-ui-stat-card__label,
body.wp-admin .s360-admin-wrapper .s360-ui-stat-card:has(> .s360-ui-stat-card__value + div:not([class])) > .s360-ui-stat-card__value + div:not([class]),
body.wp-admin .s360-admin-wrapper .s360-grid-4-stat > .s360-ui-card:has(> .s360-ui-stat-card__value + div:not([class])) > .s360-ui-stat-card__value + div:not([class]){
    grid-area:label;
    min-width:0;
    margin:0;
    align-self:baseline;
    color:var(--s360-color-text-label,var(--s360-color-text-muted,#475569));
    font-size:12px;
    line-height:1.25;
    overflow-wrap:anywhere;
}
body.wp-admin .s360-admin-wrapper .s360-ui-stat-card:has(> .s360-ui-stat-card__value):has(> .s360-ui-stat-card__label) > :where(.s360-ui-stat-card__helper,.s360-ui-stat-card__meta,small),
body.wp-admin .s360-admin-wrapper .s360-ui-stat-card:has(> .s360-ui-stat-card__value + div:not([class])) > :where(.s360-ui-stat-card__helper,.s360-ui-stat-card__meta,small),
body.wp-admin .s360-admin-wrapper .s360-grid-4-stat > .s360-ui-card:has(> .s360-ui-stat-card__value + div:not([class])) > :where(.s360-ui-stat-card__helper,.s360-ui-stat-card__meta,small){
    grid-area:helper;
    grid-column:1/-1;
}
body.wp-admin .s360-admin-wrapper .s360-ui-stat-card:has(> .s360-ui-stat-card__value):has(> .s360-ui-stat-card__label) > .s360-ui-stat-card__delta,
body.wp-admin .s360-admin-wrapper .s360-ui-stat-card:has(> .s360-ui-stat-card__value + div:not([class])) > .s360-ui-stat-card__delta{
    grid-area:delta;
    grid-column:1/-1;
}
body.wp-admin .s360-admin-wrapper .s360-ui-stat-card:has(> .s360-ui-stat-card__value):has(> .s360-ui-stat-card__label) > .s360-ui-stat-card__footer,
body.wp-admin .s360-admin-wrapper .s360-ui-stat-card:has(> .s360-ui-stat-card__value + div:not([class])) > .s360-ui-stat-card__footer{
    grid-area:footer;
    grid-column:1/-1;
}
body.wp-admin .s360-admin-wrapper .s360-ui-stat-card:has(> .s360-ui-stat-card__value):has(> .s360-ui-stat-card__label) > .s360-ui-stat-card__action,
body.wp-admin .s360-admin-wrapper .s360-ui-stat-card:has(> .s360-ui-stat-card__value + div:not([class])) > .s360-ui-stat-card__action{
    grid-area:action;
    grid-column:1/-1;
}
body.wp-admin .s360-teacher-workbench-phase-n .s360-teacher-workbench-stats-grid > .s360-ui-card:has(> .s360-ui-stat-card__value + div:not([class])){
    min-height:60px;
    padding:10px var(--s360-space-sm, 12px);
}

/* Phase 8 ownership extraction: Teacher Workbench communication/alerts/permission notices now lives in its scoped admin ownership layer. */

/* v13.3 COMM-UI-01: Communication Overview density/dashboard cleanup.
 * Scope: Communication Center Overview only. Keeps routes, permissions,
 * delivery handlers, notification handlers, and data queries unchanged.
 */
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-kpi-grid{
    grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));
    gap:var(--s360-space-sm, 12px);
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-shortcuts-panel{
    display:block;
    padding:var(--s360-component-card-padding-compact, 16px) 18px 18px;
}
body.wp-admin .s360-communication-overview-phase-m .s360-section-heading{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:var(--s360-space-sm, 12px);
    margin:0 0 var(--s360-component-card-header-gap, 14px);
}
body.wp-admin .s360-communication-overview-phase-m .s360-section-heading h2{
    margin:0;
    font-size:17px;
    line-height:1.25;
}
body.wp-admin .s360-communication-overview-phase-m .s360-section-heading p{
    max-width:46rem;
    margin:2px 0 0;
    color:var(--s360-color-text-muted,#64748b);
    font-size:12px;
    line-height:1.45;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-shortcuts-grid{
    grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));
    gap:var(--s360-space-sm, 12px);
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-shortcuts-grid .s360-communication-workflow-card{
    display:flex;
    flex-direction:column;
    justify-content:flex-start;
    gap:var(--s360-space-xs, 8px);
    min-height:0;
    padding:var(--s360-component-card-padding-tight, 14px);
    box-shadow:var(--s360-shadow-sm,0 1px 2px rgba(15,23,42,.05));
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-shortcuts-grid .s360-communication-workflow-card > strong{
    color:var(--s360-color-text-heading,#0f172a);
    font-size:14px;
    line-height:1.3;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-shortcuts-grid .s360-communication-workflow-card p{
    margin:0;
    color:var(--s360-color-text-muted,#64748b);
    font-size:12px;
    line-height:1.45;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-shortcuts-grid .s360-communication-workflow-card .s360-ui-button,
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-shortcuts-grid .s360-communication-workflow-card .button{
    align-self:flex-start;
    margin-top:auto;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-guidance{
    display:block;
    padding:0;
    overflow:hidden;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-guidance > summary{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:var(--s360-space-sm, 12px);
    padding:var(--s360-component-card-padding-tight, 14px) var(--s360-component-card-padding-compact, 16px);
    cursor:pointer;
    color:var(--s360-color-text-heading,#0f172a);
    font-weight:700;
    list-style-position:inside;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-guidance > summary::marker{
    color:var(--s360-color-primary,#2271b1);
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-guidance > summary .description{
    max-width:48rem;
    color:var(--s360-color-text-muted,#64748b);
    font-size:12px;
    font-weight:500;
    line-height:1.4;
    text-align:right;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-guidance[open] > summary{
    border-bottom:1px solid var(--s360-color-border-muted,#e2e8f0);
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-guidance-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:16px;
    padding:16px;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-guidance-section h3{
    margin:0 0 10px;
    font-size:13px;
    line-height:1.3;
    text-transform:uppercase;
    letter-spacing:.04em;
    color:var(--s360-color-text-muted,#64748b);
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-guidance-section .s360-ui-grid{
    grid-template-columns:1fr;
    gap:10px;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-guidance-section .s360-ui-card--compact{
    padding:var(--s360-space-sm, 12px);
    box-shadow:none;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-guidance-section .s360-ui-card--compact p{
    margin:6px 0 0;
    color:var(--s360-color-text-muted,#64748b);
    font-size:12px;
    line-height:1.45;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));
    gap:16px;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-card{
    display:block;
    padding:var(--s360-component-card-padding-compact, 16px);
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-card h2{
    margin:0 0 var(--s360-space-sm, 12px);
    font-size:16px;
    line-height:1.3;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-card .s360-list{
    margin:0;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-card .s360-list li{
    padding:10px 0;
    border-top:1px solid var(--s360-color-border-subtle,#eef2f7);
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-card .s360-list li:first-child{
    padding-top:0;
    border-top:0;
}
@media (max-width:900px){
    body.wp-admin .s360-communication-overview-phase-m .s360-section-heading,
    body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-guidance > summary{
        flex-direction:column;
        align-items:flex-start;
    }
    body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-guidance > summary .description{
        text-align:left;
    }
    body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-guidance-grid{
        grid-template-columns:1fr;
    }
}

/* v13.3 COMM-UI-02: Communication Overview guidance placement and recent item readability.
 * Scope: Communication Center Overview only. Reorders PHP output and adds
 * structured subject/sender/body styling without changing handlers or queries.
 */
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-guidance{
    margin-top:12px;
    margin-bottom:16px;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-list{
    display:flex;
    flex-direction:column;
    gap:10px;
    margin:0;
    padding:0;
    list-style:none;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-list .s360-communication-overview-recent-item,
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-list .s360-communication-overview-recent-item:first-child{
    margin:0;
    padding:12px;
    border:1px solid var(--s360-color-border-subtle,#eef2f7);
    border-radius:12px;
    background:var(--s360-color-surface,#fff);
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-head,
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-body{
    display:grid;
    grid-template-columns:72px minmax(0,1fr);
    gap:10px;
    min-width:0;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-head strong{
    min-width:0;
    color:var(--s360-color-text-heading,#0f172a);
    font-size:13px;
    font-weight:800;
    line-height:1.35;
    overflow-wrap:anywhere;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-label{
    color:var(--s360-color-text-muted,#64748b);
    font-size:10px;
    font-weight:800;
    line-height:1.4;
    letter-spacing:.04em;
    text-transform:uppercase;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-meta{
    display:grid;
    grid-template-columns:72px minmax(0,1fr) auto;
    gap:10px;
    align-items:center;
    min-width:0;
    margin-top:6px;
    color:var(--s360-color-text,#334155);
    font-size:12px;
    line-height:1.35;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-meta > span:not(.s360-communication-overview-recent-label):not(.s360-communication-overview-recent-date){
    min-width:0;
    overflow-wrap:anywhere;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-date{
    justify-self:end;
    color:var(--s360-color-text-muted,#64748b);
    font-size:11px;
    white-space:nowrap;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-body{
    margin:8px 0 0;
    color:var(--s360-color-text-muted,#64748b);
    font-size:12px;
    line-height:1.45;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-body span:last-child{
    min-width:0;
    overflow-wrap:anywhere;
}
@media (max-width:782px){
    body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-head,
    body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-body,
    body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-meta{
        grid-template-columns:1fr;
        gap:3px;
    }
    body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-date{
        justify-self:start;
    }
}

/* v13.3 COMM-UI-03: compact Communication guidance notice and cleaner recent activity rows.
 * Scope: Communication Center Overview only. Keeps guidance as a collapsible
 * notice and removes explicit Subject/Sender/Body labels from recent items.
 */
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-guidance{
    margin:8px 0 12px;
    border-left:4px solid var(--s360-color-primary,#2271b1);
    border-radius:10px;
    box-shadow:none;
    background:var(--s360-color-surface-subtle,#f8fafc);
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-guidance > summary{
    padding:9px var(--s360-space-sm, 12px);
    min-height:0;
    gap:var(--s360-space-xs, 8px);
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-guidance > summary span:first-child{
    font-size:13px;
    line-height:1.3;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-guidance > summary .description{
    font-size:11px;
    line-height:1.35;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-guidance-grid{
    gap:12px;
    padding:12px;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-guidance-section .s360-ui-card--compact{
    padding:10px;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-list{
    gap:0;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-list .s360-communication-overview-recent-item,
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-list .s360-communication-overview-recent-item:first-child{
    padding:11px 0;
    border:0;
    border-bottom:1px solid var(--s360-color-border-subtle,#eef2f7);
    border-radius:0;
    background:transparent;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-list .s360-communication-overview-recent-item:first-child{
    padding-top:0;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-list .s360-communication-overview-recent-item:last-child{
    padding-bottom:0;
    border-bottom:0;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-head{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:start;
    gap:10px;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-body{
    display:block;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-head strong{
    color:var(--s360-color-text-heading,#0f172a);
    font-size:13px;
    font-weight:800;
    line-height:1.35;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-meta{
    display:block;
    margin-top:4px;
    color:var(--s360-color-text,#475569);
    font-size:12px;
    line-height:1.35;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-body{
    margin:5px 0 0;
    color:var(--s360-color-text-muted,#64748b);
    font-size:12px;
    line-height:1.45;
    overflow-wrap:anywhere;
}
body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-date{
    color:var(--s360-color-text-muted,#64748b);
    font-size:11px;
    line-height:1.35;
    white-space:nowrap;
}
@media (max-width:782px){
    body.wp-admin .s360-communication-overview-phase-m .s360-communication-overview-recent-head{
        grid-template-columns:1fr;
        gap:3px;
    }
}

/* v13.3 COMM-MSG-01: Messages overview mailbox list, cleaner inbox, and modern compose form.
 * Scope: Communication Center > Messages only. Keeps handlers, routes,
 * permissions, nonces, and message queries unchanged.
 */
body.wp-admin .s360-messages-phase-m .s360-message-section-header{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:var(--s360-space-sm, 12px);
    margin:0 0 var(--s360-component-card-header-gap, 14px);
}
body.wp-admin .s360-messages-phase-m .s360-message-section-header h2{
    margin:0;
    color:var(--s360-color-text-heading,#0f172a);
    font-size:17px;
    line-height:1.25;
}
body.wp-admin .s360-messages-phase-m .s360-message-section-header p{
    margin:var(--s360-space-2xs, 4px) 0 0;
    color:var(--s360-color-text-muted,#64748b);
    font-size:12px;
    line-height:1.45;
}
body.wp-admin .s360-messages-phase-m .s360-message-section-header > span{
    flex:0 0 auto;
    padding:var(--s360-space-2xs, 4px) 9px;
    border-radius:999px;
    background:var(--s360-color-bg-subtle,#f1f5f9);
    color:var(--s360-color-text-muted,#64748b);
    font-size:11px;
    font-weight:800;
    line-height:1.3;
    white-space:nowrap;
}
body.wp-admin .s360-messages-phase-m .s360-message-recent-card{
    padding:18px;
}
body.wp-admin .s360-messages-phase-m .s360-message-mailbox-list{
    display:flex;
    flex-direction:column;
    gap:0;
    margin:0;
    padding:0;
}
body.wp-admin .s360-messages-phase-m .s360-message-mailbox-item{
    display:grid;
    grid-template-columns:10px minmax(0,1fr) auto;
    gap:12px;
    align-items:start;
    padding:13px 0;
    border-bottom:1px solid var(--s360-color-border-subtle,#eef2f7);
    color:inherit;
    text-decoration:none;
}
body.wp-admin .s360-messages-phase-m .s360-message-mailbox-item:first-child{
    padding-top:0;
}
body.wp-admin .s360-messages-phase-m .s360-message-mailbox-item:last-child{
    padding-bottom:0;
    border-bottom:0;
}
body.wp-admin .s360-messages-phase-m .s360-message-mailbox-item:hover,
body.wp-admin .s360-messages-phase-m .s360-message-mailbox-item:focus-visible{
    color:inherit;
    text-decoration:none;
}
body.wp-admin .s360-messages-phase-m .s360-message-mailbox-item:hover .s360-message-mailbox-subject,
body.wp-admin .s360-messages-phase-m .s360-message-mailbox-item:focus-visible .s360-message-mailbox-subject{
    color:var(--s360-color-primary,#2271b1);
    text-decoration:underline;
    text-underline-offset:2px;
}
body.wp-admin .s360-messages-phase-m .s360-message-mailbox-status{
    width:8px;
    height:8px;
    margin-top:5px;
    border-radius:999px;
    background:var(--s360-color-border-muted,#dbe5f0);
}
body.wp-admin .s360-messages-phase-m .s360-message-mailbox-item.is-unread .s360-message-mailbox-status{
    background:var(--s360-color-primary,#2271b1);
    box-shadow:0 0 0 3px rgba(34,113,177,.12);
}
body.wp-admin .s360-messages-phase-m .s360-message-mailbox-main{
    display:flex;
    flex-direction:column;
    gap:3px;
    min-width:0;
}
body.wp-admin .s360-messages-phase-m .s360-message-mailbox-subject{
    min-width:0;
    color:var(--s360-color-text-heading,#0f172a);
    font-size:13px;
    font-weight:800;
    line-height:1.35;
    overflow-wrap:anywhere;
}
body.wp-admin .s360-messages-phase-m .s360-message-mailbox-meta{
    color:var(--s360-color-text,#475569);
    font-size:12px;
    font-weight:600;
    line-height:1.35;
    overflow-wrap:anywhere;
}
body.wp-admin .s360-messages-phase-m .s360-message-mailbox-preview{
    color:var(--s360-color-text-muted,#64748b);
    font-size:12px;
    line-height:1.45;
    overflow-wrap:anywhere;
}
body.wp-admin .s360-messages-phase-m .s360-message-mailbox-side{
    display:flex;
    flex-direction:column;
    align-items:flex-end;
    gap:7px;
    min-width:78px;
}
body.wp-admin .s360-messages-phase-m .s360-message-mailbox-date{
    color:var(--s360-color-text-muted,#64748b);
    font-size:11px;
    line-height:1.35;
    white-space:nowrap;
}
body.wp-admin .s360-messages-phase-m .s360-message-inbox-card{
    padding:18px;
}
body.wp-admin .s360-messages-phase-m .s360-message-inbox-card .s360-ui-table-wrap{
    border:0;
    border-radius:0;
    box-shadow:none;
    background:transparent;
}
body.wp-admin .s360-messages-phase-m .s360-message-inbox-card .s360-ui-table-wrap > .s360-ui-table-toolbar:first-child{
    border-radius:0;
}
body.wp-admin .s360-messages-phase-m .s360-message-inbox-card .s360-ui-table--communication{
    border:0;
    border-radius:0;
    box-shadow:none;
}
body.wp-admin .s360-messages-phase-m .s360-message-inbox-card .s360-ui-table--communication :where(th,td):first-child{
    padding-left:var(--s360-space-sm, 12px);
}
body.wp-admin .s360-messages-phase-m .s360-message-inbox-card .s360-ui-table--communication :where(th,td):last-child{
    padding-right:var(--s360-space-sm, 12px);
}
body.wp-admin .s360-messages-phase-m .s360-message-compose-card{
    max-width:940px;
    padding:22px;
}
body.wp-admin .s360-messages-phase-m .s360-message-compose-header{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
    margin:0 0 18px;
}
body.wp-admin .s360-messages-phase-m .s360-message-compose-header h2{
    margin:0;
    color:var(--s360-color-text-heading,#0f172a);
    font-size:18px;
    line-height:1.25;
}
body.wp-admin .s360-messages-phase-m .s360-message-compose-header p{
    margin:5px 0 0;
    max-width:42rem;
    color:var(--s360-color-text-muted,#64748b);
    font-size:12px;
    line-height:1.45;
}
body.wp-admin .s360-messages-phase-m .s360-message-compose-form{
    display:flex;
    flex-direction:column;
    gap:16px;
    margin:0;
}
body.wp-admin .s360-messages-phase-m .s360-message-compose-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
}
body.wp-admin .s360-messages-phase-m .s360-message-compose-field{
    display:flex;
    flex-direction:column;
    gap:6px;
    min-width:0;
}
body.wp-admin .s360-messages-phase-m .s360-message-compose-field > label{
    color:var(--s360-color-text-heading,#0f172a);
    font-size:12px;
    font-weight:800;
    line-height:1.35;
}
body.wp-admin .s360-messages-phase-m .s360-message-compose-field :where(input[type="text"],select){
    width:100%;
    max-width:none;
}
body.wp-admin .s360-messages-phase-m .s360-message-compose-field--editor{
    gap:8px;
}
body.wp-admin .s360-messages-phase-m .s360-message-compose-editor-shell{
    overflow:hidden;
    border:1px solid var(--s360-color-border-muted,#dbe5f0);
    border-radius:12px;
    background:var(--s360-color-surface,#fff);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.7);
}
body.wp-admin .s360-messages-phase-m .s360-message-compose-editor-shell :where(.wp-editor-wrap,.wp-editor-container){
    border:0;
    box-shadow:none;
}
body.wp-admin .s360-messages-phase-m .s360-message-compose-actions{
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:10px;
}
@media (max-width:782px){
    body.wp-admin .s360-messages-phase-m .s360-message-section-header,
    body.wp-admin .s360-messages-phase-m .s360-message-compose-header{
        flex-direction:column;
        align-items:flex-start;
    }
    body.wp-admin .s360-messages-phase-m .s360-message-mailbox-item{
        grid-template-columns:10px minmax(0,1fr);
    }
    body.wp-admin .s360-messages-phase-m .s360-message-mailbox-side{
        grid-column:2;
        align-items:flex-start;
        min-width:0;
    }
    body.wp-admin .s360-messages-phase-m .s360-message-compose-grid{
        grid-template-columns:1fr;
    }
    body.wp-admin .s360-messages-phase-m .s360-message-compose-card{
        padding:var(--s360-component-card-padding-compact, 16px);
    }
}

/* COMM-SPLIT-01: nested Communication workflow pages */
body.wp-admin .s360-communication-phase-m .s360-communication-subnav--nested{
    margin-top:14px;
    margin-bottom:14px;
}
body.wp-admin .s360-communication-phase-m .s360-communication-subpage-body{
    max-width:1180px;
}
body.wp-admin .s360-communication-phase-m .s360-communication-form-card{
    padding:var(--s360-component-card-padding, 20px);
}
body.wp-admin .s360-communication-phase-m .s360-communication-form-card .s360-ui-form-grid{
    width:100%;
}
body.wp-admin .s360-communication-phase-m .s360-communication-form-card :where(input[type="text"],input[type="datetime-local"],select,textarea){
    max-width:100%;
}

/* COMM-SEND-01: modernized Communication send/create forms */
body.wp-admin .s360-communication-phase-m .s360-communication-subpage-body{
    align-items:start;
}
body.wp-admin .s360-communication-phase-m .s360-communication-send-card{
    width:100%;
    max-width:1040px;
    padding:var(--s360-space-lg, 24px);
}
body.wp-admin .s360-communication-phase-m .s360-communication-send-card h2{
    margin:0 0 var(--s360-space-md, 16px);
    color:var(--s360-color-text-heading,#0f172a);
    font-size:18px;
    line-height:1.25;
}
body.wp-admin .s360-communication-phase-m .s360-communication-send-card > p{
    margin:0 0 18px;
    max-width:48rem;
    color:var(--s360-color-text-muted,#64748b);
    font-size:13px;
    line-height:1.5;
}
body.wp-admin .s360-communication-phase-m .s360-communication-send-form{
    display:flex;
    flex-direction:column;
    gap:18px;
    margin:0;
}
body.wp-admin .s360-communication-phase-m .s360-communication-send-form .s360-ui-form-grid{
    display:block;
    width:100%;
    margin:0;
    border:0;
    background:transparent;
}
body.wp-admin .s360-communication-phase-m .s360-communication-send-form .s360-ui-form-grid tbody{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:16px 18px;
    width:100%;
}
body.wp-admin .s360-communication-phase-m .s360-communication-send-form .s360-ui-form-grid tr{
    display:flex;
    flex-direction:column;
    gap:7px;
    min-width:0;
    padding:0;
    border:0;
}
body.wp-admin .s360-communication-phase-m .s360-communication-send-form .s360-ui-form-grid tr.s360-communication-editor-row{
    grid-column:1 / -1;
}
body.wp-admin .s360-communication-phase-m .s360-communication-send-form .s360-ui-form-grid th,
body.wp-admin .s360-communication-phase-m .s360-communication-send-form .s360-ui-form-grid td{
    display:block;
    width:auto;
    min-width:0;
    padding:0;
    border:0;
    background:transparent;
    vertical-align:top;
}
body.wp-admin .s360-communication-phase-m .s360-communication-send-form .s360-ui-form-grid th{
    color:var(--s360-color-text-heading,#0f172a);
    font-size:12px;
    font-weight:800;
    line-height:1.35;
}
body.wp-admin .s360-communication-phase-m .s360-communication-send-form .s360-ui-form-grid th label{
    display:inline-flex;
    align-items:center;
    gap:6px;
}
body.wp-admin .s360-communication-phase-m .s360-communication-send-form :where(input[type="text"],input[type="datetime-local"],select,textarea){
    width:100%;
    max-width:none;
    min-height:40px;
    border-radius:10px;
}
body.wp-admin .s360-communication-phase-m .s360-communication-send-form textarea{
    min-height:104px;
}
body.wp-admin .s360-communication-phase-m .s360-communication-send-form .description{
    margin:6px 0 0;
    color:var(--s360-color-text-muted,#64748b);
    font-size:12px;
    line-height:1.4;
}
body.wp-admin .s360-communication-phase-m .s360-communication-send-form label:has(input[type="checkbox"]){
    display:flex;
    align-items:flex-start;
    gap:8px;
    margin:0 0 7px;
    color:var(--s360-color-text,#334155);
    font-size:13px;
    line-height:1.35;
}
body.wp-admin .s360-communication-phase-m .s360-communication-send-form label:has(input[type="checkbox"]):last-child{
    margin-bottom:0;
}
body.wp-admin .s360-communication-phase-m .s360-communication-send-form :where(.wp-editor-wrap,.wp-editor-container){
    max-width:100%;
}
body.wp-admin .s360-communication-phase-m .s360-communication-send-form .wp-editor-wrap{
    border:1px solid var(--s360-color-border-muted,#dbe5f0);
    border-radius:12px;
    overflow:hidden;
    background:var(--s360-color-surface,#fff);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.7);
}
body.wp-admin .s360-communication-phase-m .s360-communication-send-form .wp-editor-container{
    border:0;
    box-shadow:none;
}
body.wp-admin .s360-communication-phase-m .s360-communication-send-form .wp-editor-tools{
    padding:8px 10px 0;
    background:var(--s360-color-surface-muted,#f8fafc);
}
body.wp-admin .s360-communication-phase-m .s360-communication-send-form .mce-toolbar-grp,
body.wp-admin .s360-communication-phase-m .s360-communication-send-form .quicktags-toolbar{
    border-left:0;
    border-right:0;
}
body.wp-admin .s360-communication-phase-m .s360-communication-send-form > .s360-ui-button,
body.wp-admin .s360-communication-phase-m .s360-communication-send-form > .button,
body.wp-admin .s360-communication-phase-m .s360-communication-send-form > button{
    align-self:flex-start;
}
body.wp-admin .s360-communication-phase-m .s360-communication-send-form > .s360-ui-button + .s360-ui-button,
body.wp-admin .s360-communication-phase-m .s360-communication-send-form > .button + .button,
body.wp-admin .s360-communication-phase-m .s360-communication-send-form > button + button{
    margin-left:8px;
}
body.wp-admin .s360-communication-phase-m .s360-communication-send-form .s360-audience-preview,
body.wp-admin .s360-communication-phase-m .s360-communication-send-form .s360-communication-audience-preview{
    margin-top:2px;
}
body.wp-admin .s360-communication-phase-m .s360-communication-send-notes{
    align-self:start;
    padding:22px;
}
body.wp-admin .s360-communication-phase-m .s360-communication-send-notes h2{
    margin:0 0 14px;
    font-size:17px;
    line-height:1.25;
}
body.wp-admin .s360-communication-phase-m .s360-communication-send-notes .s360-list{
    margin:0;
}
body.wp-admin .s360-communication-phase-m .s360-communication-send-card--audience{
    max-width:none;
}
body.wp-admin .s360-communication-phase-m .s360-communication-send-card--audience .s360-ui-form-grid tbody{
    grid-template-columns:repeat(2,minmax(0,1fr));
}
@media (max-width:960px){
    body.wp-admin .s360-communication-phase-m .s360-communication-send-card{
        max-width:none;
    }
    body.wp-admin .s360-communication-phase-m .s360-communication-send-form .s360-ui-form-grid tbody,
    body.wp-admin .s360-communication-phase-m .s360-communication-send-card--audience .s360-ui-form-grid tbody{
        grid-template-columns:1fr;
    }
}
@media (max-width:782px){
    body.wp-admin .s360-communication-phase-m .s360-communication-send-card,
    body.wp-admin .s360-communication-phase-m .s360-communication-send-notes{
        padding:16px;
    }
}

/* v13.3 approved UI/IX Phase 1: unified sub/workflow tabs.
 * Scope: every `.s360-ui-sub-tabs` navigation strip across modules/pages.
 * Goal: one compact secondary visual contract for Students, Academic,
 * People, Communication, Admissions, Custom Fields, HR profile, Schools,
 * Settings, System, Transport and template-driven sub tabs.
 * Main/page-level tabs remain guarded by `.s360-ui-main-tabs`.
 */
.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs),
body.wp-admin .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs),
body.wp-admin .s360-tailwind-foundation .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs),
body.wp-admin .s360-admin-wrapper .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs),
body.wp-admin .s360-grouped-admin .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs){
    position:relative;
    top:auto;
    z-index:auto;
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    justify-content:flex-start;
    gap:6px;
    width:100%;
    max-width:none;
    min-width:0;
    box-sizing:border-box;
    margin:var(--s360-tabs-sub-margin,14px 0 16px);
    padding:6px;
    border:1px solid var(--s360-color-border-muted,var(--s360-color-border,#dbe5f0));
    border-left:1px solid var(--s360-color-border-muted,var(--s360-color-border,#dbe5f0));
    border-bottom:1px solid var(--s360-color-border-muted,var(--s360-color-border,#dbe5f0));
    border-radius:12px;
    background:var(--s360-color-bg-subtle,var(--s360-color-bg,#f8fafc));
    background-image:none;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.75);
    backdrop-filter:none;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:thin;
    white-space:nowrap;
    transform:none;
}
.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab,.s360-school-tab,.s360-system-tab,.s360-builder-tab,.s360-admin-nav-pill,.s360-hr-profile-tab),
body.wp-admin .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab,.s360-school-tab,.s360-system-tab,.s360-builder-tab,.s360-admin-nav-pill,.s360-hr-profile-tab),
body.wp-admin .s360-tailwind-foundation .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab,.s360-school-tab,.s360-system-tab,.s360-builder-tab,.s360-admin-nav-pill,.s360-hr-profile-tab),
body.wp-admin .s360-admin-wrapper .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab,.s360-school-tab,.s360-system-tab,.s360-builder-tab,.s360-admin-nav-pill,.s360-hr-profile-tab),
body.wp-admin .s360-grouped-admin .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab,.s360-school-tab,.s360-system-tab,.s360-builder-tab,.s360-admin-nav-pill,.s360-hr-profile-tab){
    position:relative;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 auto;
    min-height:34px;
    min-width:0;
    width:auto;
    max-width:none;
    margin:0;
    padding:7px 11px;
    border:1px solid transparent;
    border-bottom:1px solid transparent;
    border-radius:9px;
    background:transparent;
    background-image:none;
    box-shadow:none;
    color:var(--s360-color-text-muted,var(--s360-color-text-secondary,#475569));
    font-size:12px;
    font-weight:700;
    line-height:1.25;
    letter-spacing:.01em;
    text-align:center;
    text-decoration:none;
    text-transform:none;
    white-space:nowrap;
    cursor:pointer;
    transform:none;
}
.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab,.s360-school-tab,.s360-system-tab,.s360-builder-tab,.s360-admin-nav-pill,.s360-hr-profile-tab):hover,
.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab,.s360-school-tab,.s360-system-tab,.s360-builder-tab,.s360-admin-nav-pill,.s360-hr-profile-tab):focus-visible,
body.wp-admin .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab,.s360-school-tab,.s360-system-tab,.s360-builder-tab,.s360-admin-nav-pill,.s360-hr-profile-tab):hover,
body.wp-admin .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab,.s360-school-tab,.s360-system-tab,.s360-builder-tab,.s360-admin-nav-pill,.s360-hr-profile-tab):focus-visible,
body.wp-admin .s360-tailwind-foundation .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab,.s360-school-tab,.s360-system-tab,.s360-builder-tab,.s360-admin-nav-pill,.s360-hr-profile-tab):hover,
body.wp-admin .s360-tailwind-foundation .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab,.s360-school-tab,.s360-system-tab,.s360-builder-tab,.s360-admin-nav-pill,.s360-hr-profile-tab):focus-visible,
body.wp-admin .s360-admin-wrapper .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab,.s360-school-tab,.s360-system-tab,.s360-builder-tab,.s360-admin-nav-pill,.s360-hr-profile-tab):hover,
body.wp-admin .s360-admin-wrapper .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab,.s360-school-tab,.s360-system-tab,.s360-builder-tab,.s360-admin-nav-pill,.s360-hr-profile-tab):focus-visible,
body.wp-admin .s360-grouped-admin .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab,.s360-school-tab,.s360-system-tab,.s360-builder-tab,.s360-admin-nav-pill,.s360-hr-profile-tab):hover,
body.wp-admin .s360-grouped-admin .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab,.s360-school-tab,.s360-system-tab,.s360-builder-tab,.s360-admin-nav-pill,.s360-hr-profile-tab):focus-visible{
    border-color:var(--s360-color-primary-soft-border,var(--s360-color-border,#bfdbfe));
    border-bottom-color:var(--s360-color-primary-soft-border,var(--s360-color-border,#bfdbfe));
    background:var(--s360-color-surface,var(--s360-color-white,#fff));
    background-image:none;
    color:var(--s360-color-primary,#2271b1);
    box-shadow:0 1px 2px rgba(15,23,42,.05);
    outline:none;
    transform:none;
}
.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(.nav-tab-active,.is-active,.active,.s360-hr-profile-tab-active,[aria-current="page"],[aria-selected="true"]),
body.wp-admin .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(.nav-tab-active,.is-active,.active,.s360-hr-profile-tab-active,[aria-current="page"],[aria-selected="true"]),
body.wp-admin .s360-tailwind-foundation .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(.nav-tab-active,.is-active,.active,.s360-hr-profile-tab-active,[aria-current="page"],[aria-selected="true"]),
body.wp-admin .s360-admin-wrapper .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(.nav-tab-active,.is-active,.active,.s360-hr-profile-tab-active,[aria-current="page"],[aria-selected="true"]),
body.wp-admin .s360-grouped-admin .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(.nav-tab-active,.is-active,.active,.s360-hr-profile-tab-active,[aria-current="page"],[aria-selected="true"]){
    border-color:var(--s360-color-primary-soft-border,var(--s360-color-primary,#bfdbfe));
    border-bottom-color:var(--s360-color-primary-soft-border,var(--s360-color-primary,#bfdbfe));
    background:var(--s360-color-surface,var(--s360-color-white,#fff));
    background-image:none;
    color:var(--s360-color-primary,#2271b1);
    box-shadow:0 1px 3px rgba(15,23,42,.08);
}
.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(.disabled,[disabled],[aria-disabled="true"]),
body.wp-admin .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(.disabled,[disabled],[aria-disabled="true"]),
body.wp-admin .s360-tailwind-foundation .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(.disabled,[disabled],[aria-disabled="true"]),
body.wp-admin .s360-admin-wrapper .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(.disabled,[disabled],[aria-disabled="true"]),
body.wp-admin .s360-grouped-admin .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(.disabled,[disabled],[aria-disabled="true"]){
    cursor:not-allowed;
    opacity:.58;
    box-shadow:none;
}
@media (max-width:782px){
    .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs),
    body.wp-admin .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs),
    body.wp-admin .s360-tailwind-foundation .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs),
    body.wp-admin .s360-admin-wrapper .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs),
    body.wp-admin .s360-grouped-admin .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs){
        flex-wrap:nowrap;
        scroll-padding-inline:var(--s360-space-sm,12px);
        scroll-snap-type:x proximity;
    }
    .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab,.s360-school-tab,.s360-system-tab,.s360-builder-tab,.s360-admin-nav-pill,.s360-hr-profile-tab),
    body.wp-admin .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab,.s360-school-tab,.s360-system-tab,.s360-builder-tab,.s360-admin-nav-pill,.s360-hr-profile-tab),
    body.wp-admin .s360-tailwind-foundation .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab,.s360-school-tab,.s360-system-tab,.s360-builder-tab,.s360-admin-nav-pill,.s360-hr-profile-tab),
    body.wp-admin .s360-admin-wrapper .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab,.s360-school-tab,.s360-system-tab,.s360-builder-tab,.s360-admin-nav-pill,.s360-hr-profile-tab),
    body.wp-admin .s360-grouped-admin .s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab,.s360-school-tab,.s360-system-tab,.s360-builder-tab,.s360-admin-nav-pill,.s360-hr-profile-tab){
        scroll-snap-align:start;
    }
}

/* v13.3 approved UI/IX Phase 1.1: Students sub-tabs visual alignment.
 * Scope: Students-owned workflow subnav aliases that have stronger legacy
 * specificity than the global Phase 1 `.s360-ui-sub-tabs` contract.
 * This keeps Students/Attendance/Transport sub-tabs visually identical to
 * the approved unified secondary sub-tab style without changing markup or JS.
 */
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-students-subnav.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs),
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-page-shell .s360-students-subnav.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs),
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-student-ops-subtabs.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs),
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-page-shell .s360-student-ops-subtabs.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs){
    position:relative;
    top:auto;
    z-index:auto;
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    justify-content:flex-start;
    gap:6px;
    width:100%;
    max-width:none;
    min-width:0;
    box-sizing:border-box;
    margin:var(--s360-tabs-sub-margin,14px 0 16px);
    padding:6px;
    border:1px solid var(--s360-color-border-muted,var(--s360-color-border,#dbe5f0));
    border-left:1px solid var(--s360-color-border-muted,var(--s360-color-border,#dbe5f0));
    border-bottom:1px solid var(--s360-color-border-muted,var(--s360-color-border,#dbe5f0));
    border-radius:12px;
    background:var(--s360-color-bg-subtle,var(--s360-color-bg,#f8fafc));
    background-image:none;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.75);
    backdrop-filter:none;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:thin;
    white-space:nowrap;
    transform:none;
}
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-students-subnav.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab),
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-page-shell .s360-students-subnav.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab),
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-student-ops-subtabs.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab),
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-page-shell .s360-student-ops-subtabs.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab){
    position:relative;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 auto;
    min-height:34px;
    min-width:0;
    width:auto;
    max-width:none;
    margin:0;
    padding:7px 11px;
    border:1px solid transparent;
    border-bottom:1px solid transparent;
    border-radius:9px;
    background:transparent;
    background-image:none;
    box-shadow:none;
    color:var(--s360-color-text-muted,var(--s360-color-text-secondary,#475569));
    font-size:12px;
    font-weight:700;
    line-height:1.25;
    letter-spacing:.01em;
    text-align:center;
    text-decoration:none;
    text-transform:none;
    white-space:nowrap;
    cursor:pointer;
    transform:none;
}
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-students-subnav.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab):hover,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-students-subnav.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab):focus-visible,
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-page-shell .s360-students-subnav.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab):hover,
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-page-shell .s360-students-subnav.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab):focus-visible,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-student-ops-subtabs.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab):hover,
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-student-ops-subtabs.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab):focus-visible,
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-page-shell .s360-student-ops-subtabs.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab):hover,
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-page-shell .s360-student-ops-subtabs.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab):focus-visible{
    border-color:var(--s360-color-primary-soft-border,var(--s360-color-border,#bfdbfe));
    border-bottom-color:var(--s360-color-primary-soft-border,var(--s360-color-border,#bfdbfe));
    background:var(--s360-color-surface,var(--s360-color-white,#fff));
    background-image:none;
    color:var(--s360-color-primary,#2271b1);
    box-shadow:0 1px 2px rgba(15,23,42,.05);
    outline:none;
    transform:none;
}
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-students-subnav.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(.nav-tab-active,.is-active,.active,[aria-current="page"],[aria-selected="true"]),
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-page-shell .s360-students-subnav.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(.nav-tab-active,.is-active,.active,[aria-current="page"],[aria-selected="true"]),
body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-student-ops-subtabs.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(.nav-tab-active,.is-active,.active,[aria-current="page"],[aria-selected="true"]),
body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-page-shell .s360-student-ops-subtabs.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(.nav-tab-active,.is-active,.active,[aria-current="page"],[aria-selected="true"]){
    border-color:var(--s360-color-primary-soft-border,var(--s360-color-primary,#bfdbfe));
    border-bottom-color:var(--s360-color-primary-soft-border,var(--s360-color-primary,#bfdbfe));
    background:var(--s360-color-surface,var(--s360-color-white,#fff));
    background-image:none;
    color:var(--s360-color-primary,#2271b1);
    box-shadow:0 1px 3px rgba(15,23,42,.08);
}
@media (max-width:782px){
    body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-students-subnav.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs),
    body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-page-shell .s360-students-subnav.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs),
    body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-student-ops-subtabs.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs),
    body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-page-shell .s360-student-ops-subtabs.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs){
        flex-wrap:nowrap;
        scroll-padding-inline:var(--s360-space-sm,12px);
        scroll-snap-type:x proximity;
    }
    body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-students-subnav.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab),
    body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-page-shell .s360-students-subnav.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab),
    body.wp-admin .s360-tailwind-foundation.s360-admin-wrapper .s360-student-ops-subtabs.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab),
    body.wp-admin .s360-tailwind-foundation.s360-grouped-admin.s360-page-shell .s360-student-ops-subtabs.s360-ui-sub-tabs.s360-ui-tabs__nav:not(.s360-ui-main-tabs) > :is(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab){
        scroll-snap-align:start;
    }
}
/* v13.3 approved UI/IX Forms Phase 1.1: unified admin form visual alignment.
 * Scope: CSS-only final compatibility layer for existing School 360 admin forms.
 * Goal: normalize raw/helper controls, table-style create/edit forms, HR employee
 * forms, card forms, filters and inline action rows without changing PHP markup,
 * form actions, field names, nonces, validation, JS hooks or database behavior.
 */
body.wp-admin .s360-admin-wrapper :where(.s360-ui-form,.s360-ui-card form,.s360-ui-section-card form,[data-s360-hr-panel] form,.s360-form-grid,.s360-ui-form-grid,.s360-ui-form-table,.form-table){
    box-sizing:border-box;
    max-width:100%;
}
body.wp-admin .s360-admin-wrapper :where(.s360-ui-form-field,.s360-form-field,.school360-form-field,.s360-ui-field,.s360-field){
    display:flex;
    flex-direction:column;
    gap:var(--s360-form-field-gap,6px);
    min-width:0;
}
body.wp-admin .s360-admin-wrapper :where(.s360-ui-form-field,.s360-form-field,.school360-form-field,.s360-ui-field,.s360-field) > :where(label,.s360-ui-form-label,.s360-form-label),
body.wp-admin .s360-admin-wrapper :where(.s360-ui-form-table,.form-table,table.s360-ui-form-grid--table) th,
body.wp-admin .s360-admin-wrapper :where(.s360-filter-bar,.s360-filter-grid,.s360-report-filter-form,.s360-expense-report-filter-form,.s360-calendar-filter-form) label{
    color:var(--s360-color-form-label,var(--s360-color-text-label,#475569));
    font-size:12px;
    font-weight:800;
    letter-spacing:.035em;
    line-height:1.35;
}
body.wp-admin .s360-admin-wrapper :where(.s360-ui-card form,.s360-ui-section-card form,[data-s360-hr-panel] form,.s360-ui-form,.s360-form-grid,.s360-ui-form-grid,.s360-filter-bar,.s360-filter-grid,.s360-report-filter-form,.s360-expense-report-filter-form,.s360-calendar-filter-form) :where(input:not([type]),input[type="text"],input[type="email"],input[type="number"],input[type="password"],input[type="search"],input[type="date"],input[type="time"],input[type="datetime-local"],input[type="url"],input[type="tel"],select,textarea,.s360-ui-control,.s360-ui-input,.s360-ui-select,.s360-ui-textarea):not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not(.wp-color-picker):not(.wp-picker-clear):not(.button):not(.s360-unstyled-control){
    box-sizing:border-box;
    max-width:100%;
    min-width:0;
    min-height:var(--s360-control-height-md,38px);
    border:var(--s360-control-border-width,1px) solid var(--s360-color-input-border,var(--s360-color-border,#cbd5e1));
    border-radius:var(--s360-control-radius,10px);
    background:var(--s360-color-input-bg,var(--s360-color-surface-raised,#fff));
    color:var(--s360-color-input-text,var(--s360-color-text-body,#1e293b));
    box-shadow:var(--s360-shadow-input,0 1px 2px rgba(15,23,42,.04));
    font-size:14px;
    line-height:1.45;
    padding:var(--s360-control-padding-y,8px) var(--s360-control-padding-x,12px);
    transition:border-color .15s ease,box-shadow .15s ease,background-color .15s ease,color .15s ease;
}
body.wp-admin .s360-admin-wrapper :where(.s360-ui-card form,.s360-ui-section-card form,[data-s360-hr-panel] form,.s360-ui-form,.s360-form-grid,.s360-ui-form-grid,.s360-filter-bar,.s360-filter-grid,.s360-report-filter-form,.s360-expense-report-filter-form,.s360-calendar-filter-form) :where(select,.s360-ui-select):not(.s360-unstyled-control){
    padding-right:34px;
}
body.wp-admin .s360-admin-wrapper :where(.s360-ui-card form,.s360-ui-section-card form,[data-s360-hr-panel] form,.s360-ui-form,.s360-form-grid,.s360-ui-form-grid) :where(textarea,.s360-ui-textarea):not(.s360-unstyled-control){
    min-height:108px;
    resize:vertical;
}
body.wp-admin .s360-admin-wrapper :where(.s360-ui-card form,.s360-ui-section-card form,[data-s360-hr-panel] form,.s360-ui-form,.s360-form-grid,.s360-ui-form-grid,.s360-filter-bar,.s360-filter-grid,.s360-report-filter-form,.s360-expense-report-filter-form,.s360-calendar-filter-form) :where(input:not([type]),input[type="text"],input[type="email"],input[type="number"],input[type="password"],input[type="search"],input[type="date"],input[type="time"],input[type="datetime-local"],input[type="url"],input[type="tel"],select,textarea,.s360-ui-control,.s360-ui-input,.s360-ui-select,.s360-ui-textarea):not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not(.wp-color-picker):not(.wp-picker-clear):not(.button):not(.s360-unstyled-control):hover{
    border-color:var(--s360-color-input-border-hover,var(--s360-color-border-strong,#94a3b8));
}
body.wp-admin .s360-admin-wrapper :where(.s360-ui-card form,.s360-ui-section-card form,[data-s360-hr-panel] form,.s360-ui-form,.s360-form-grid,.s360-ui-form-grid,.s360-filter-bar,.s360-filter-grid,.s360-report-filter-form,.s360-expense-report-filter-form,.s360-calendar-filter-form) :where(input:not([type]),input[type="text"],input[type="email"],input[type="number"],input[type="password"],input[type="search"],input[type="date"],input[type="time"],input[type="datetime-local"],input[type="url"],input[type="tel"],select,textarea,.s360-ui-control,.s360-ui-input,.s360-ui-select,.s360-ui-textarea):not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not(.wp-color-picker):not(.wp-picker-clear):not(.button):not(.s360-unstyled-control):focus,
body.wp-admin .s360-admin-wrapper :where(.s360-ui-card form,.s360-ui-section-card form,[data-s360-hr-panel] form,.s360-ui-form,.s360-form-grid,.s360-ui-form-grid,.s360-filter-bar,.s360-filter-grid,.s360-report-filter-form,.s360-expense-report-filter-form,.s360-calendar-filter-form) :where(input:not([type]),input[type="text"],input[type="email"],input[type="number"],input[type="password"],input[type="search"],input[type="date"],input[type="time"],input[type="datetime-local"],input[type="url"],input[type="tel"],select,textarea,.s360-ui-control,.s360-ui-input,.s360-ui-select,.s360-ui-textarea):not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not(.wp-color-picker):not(.wp-picker-clear):not(.button):not(.s360-unstyled-control):focus-visible{
    outline:none;
    border-color:var(--s360-color-input-border-focus,var(--s360-color-primary,#2271b1));
    box-shadow:var(--s360-shadow-input-focus,0 0 0 3px rgba(34,113,177,.16));
}
body.wp-admin .s360-admin-wrapper :where(.s360-ui-card form,.s360-ui-section-card form,[data-s360-hr-panel] form,.s360-ui-form,.s360-form-grid,.s360-ui-form-grid) :where(input:not([type]),input[type="text"],input[type="email"],input[type="number"],input[type="password"],input[type="search"],input[type="date"],input[type="time"],input[type="datetime-local"],input[type="url"],input[type="tel"],select,textarea,.s360-ui-control,.s360-ui-input,.s360-ui-select,.s360-ui-textarea):not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):disabled,
body.wp-admin .s360-admin-wrapper :where(.s360-ui-card form,.s360-ui-section-card form,[data-s360-hr-panel] form,.s360-ui-form,.s360-form-grid,.s360-ui-form-grid) :where(input:not([type]),input[type="text"],input[type="email"],input[type="number"],input[type="password"],input[type="search"],input[type="date"],input[type="time"],input[type="datetime-local"],input[type="url"],input[type="tel"],select,textarea,.s360-ui-control,.s360-ui-input,.s360-ui-select,.s360-ui-textarea):not([type="hidden"]):not([type="checkbox"]):not([type="radio"])[readonly]{
    background:var(--s360-color-input-disabled-bg,var(--s360-color-bg-subtle,#f8fafc));
    border-color:var(--s360-color-input-disabled-border,var(--s360-color-border-muted,#e2e8f0));
    color:var(--s360-color-input-disabled-text,var(--s360-color-text-tertiary,#64748b));
    cursor:not-allowed;
    box-shadow:none;
}
body.wp-admin .s360-admin-wrapper :where(.s360-ui-card form,.s360-ui-section-card form,[data-s360-hr-panel] form,.s360-ui-form) :where(input[type="checkbox"],input[type="radio"]):not(.s360-unstyled-control){
    accent-color:var(--s360-color-primary-strong,var(--s360-color-primary,#2271b1));
}
body.wp-admin .s360-admin-wrapper :where(.s360-ui-form-grid,.s360-form-grid,.s360-form-grid-2,.s360-filter-grid){
    display:grid;
    gap:var(--s360-form-row-gap,14px);
    min-width:0;
}
body.wp-admin .s360-admin-wrapper :where(.s360-ui-form-grid,.s360-form-grid,.s360-form-grid-2):not(table){
    grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr));
}
body.wp-admin .s360-admin-wrapper :where(.s360-ui-form-grid--single,.s360-form-grid--single){
    grid-template-columns:1fr;
}
body.wp-admin .s360-admin-wrapper :where(.s360-ui-form-actions,.s360-form-actions,.s360-card-actions,form > .submit){
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:var(--s360-form-actions-gap,10px);
    margin:var(--s360-space-md,16px) 0 0;
    padding:0;
}
body.wp-admin .s360-admin-wrapper :where(.s360-filter-bar,.s360-report-filter-form,.s360-expense-report-filter-form,.s360-calendar-filter-form){
    display:flex;
    flex-wrap:wrap;
    align-items:flex-end;
    gap:var(--s360-form-actions-gap,10px);
    max-width:100%;
}
body.wp-admin .s360-admin-wrapper :where(.s360-filter-bar,.s360-report-filter-form,.s360-expense-report-filter-form,.s360-calendar-filter-form) :where(input:not([type]),input[type="text"],input[type="search"],input[type="date"],input[type="number"],select){
    width:auto;
    flex:1 1 180px;
}
body.wp-admin .s360-admin-wrapper :where(.s360-inline-form,.s360-ui-inline-form,.s360-inline-action-form,.s360-u-inline){
    display:inline-flex;
    flex-wrap:wrap;
    align-items:center;
    gap:8px;
    max-width:100%;
}
body.wp-admin .s360-admin-wrapper :where(.s360-inline-form,.s360-ui-inline-form,.s360-inline-action-form,.s360-u-inline) :where(input:not([type]),input[type="text"],input[type="number"],input[type="date"],select){
    width:auto;
    min-width:120px;
}
body.wp-admin .s360-tailwind-foundation.s360-hr-phase-i :where(table.s360-ui-form-grid--table){
    display:block;
    width:100%;
    margin:0;
    border-collapse:separate;
    border-spacing:0;
}
body.wp-admin .s360-tailwind-foundation.s360-hr-phase-i :where(table.s360-ui-form-grid--table caption){
    display:block;
}
body.wp-admin .s360-tailwind-foundation.s360-hr-phase-i :where(table.s360-ui-form-grid--table tbody){
    display:grid;
    gap:12px;
    width:100%;
}
body.wp-admin .s360-tailwind-foundation.s360-hr-phase-i :where(table.s360-ui-form-grid--table tr){
    display:grid;
    grid-template-columns:minmax(120px,160px) minmax(0,1fr);
    gap:12px 18px;
    align-items:start;
    width:100%;
}
body.wp-admin .s360-tailwind-foundation.s360-hr-phase-i :where(table.s360-ui-form-grid--table th){
    display:block;
    width:auto;
    padding:9px 0 0;
    vertical-align:top;
    color:var(--s360-color-form-label,var(--s360-color-text-label,#475569));
}
body.wp-admin .s360-tailwind-foundation.s360-hr-phase-i :where(table.s360-ui-form-grid--table td){
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:8px;
    min-width:0;
    padding:0;
}
body.wp-admin .s360-tailwind-foundation.s360-hr-phase-i :where(table.s360-ui-form-grid--table td) :where(input:not([type]),input[type="text"],input[type="email"],input[type="number"],input[type="date"],select):not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not(.wp-color-picker):not(.button){
    flex:1 1 180px;
    width:auto;
}
body.wp-admin .s360-tailwind-foundation.s360-hr-phase-i :where(table.s360-ui-form-grid--table td) :where(input[size="6"],input[name="currency"]){
    flex:0 1 96px;
}
body.wp-admin .s360-tailwind-foundation.s360-hr-phase-i :where(table.s360-ui-form-grid--table td) :where(textarea,.s360-ui-textarea){
    flex:1 1 100%;
    width:100%;
    min-height:110px;
}
body.wp-admin .s360-tailwind-foundation.s360-hr-phase-i :where(.s360-ui-section-card--hr-panel form > p:has(input,.s360-ui-control,select,textarea,.s360-ui-button,.button),.s360-ui-card--hr-legacy-panel form > .inside > p:has(input,.s360-ui-control,select,textarea,.s360-ui-button,.button)){
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:var(--s360-space-xs, 8px);
    margin:0 0 var(--s360-space-sm,12px);
}
body.wp-admin .s360-tailwind-foundation.s360-hr-phase-i :where(.s360-ui-section-card--hr-panel form > p:has(input,.s360-ui-control,select,textarea,.s360-ui-button,.button),.s360-ui-card--hr-legacy-panel form > .inside > p:has(input,.s360-ui-control,select,textarea,.s360-ui-button,.button)) :where(input:not([type]),input[type="text"],input[type="email"],input[type="number"],input[type="date"],input[type="time"],select):not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not(.button){
    flex:1 1 180px;
    width:auto;
}
body.wp-admin .s360-tailwind-foundation.s360-hr-phase-i :where(.s360-ui-section-card--hr-panel form > p:has(textarea),.s360-ui-card--hr-legacy-panel form > .inside > p:has(textarea)){
    align-items:stretch;
}
body.wp-admin .s360-tailwind-foundation.s360-hr-phase-i :where(.s360-ui-section-card--hr-panel form > p:has(textarea),.s360-ui-card--hr-legacy-panel form > .inside > p:has(textarea)) :where(textarea,.s360-ui-textarea){
    flex:1 1 100%;
    width:100%;
}
@media (max-width:782px){
    body.wp-admin .s360-admin-wrapper :where(.s360-ui-form-grid,.s360-form-grid,.s360-form-grid-2,.s360-filter-grid){
        grid-template-columns:1fr;
    }
    body.wp-admin .s360-tailwind-foundation.s360-hr-phase-i :where(table.s360-ui-form-grid--table tr){
        grid-template-columns:1fr;
        gap:6px;
    }
    body.wp-admin .s360-tailwind-foundation.s360-hr-phase-i :where(table.s360-ui-form-grid--table th){
        padding:0;
    }
    body.wp-admin .s360-tailwind-foundation.s360-hr-phase-i :where(table.s360-ui-form-grid--table td),
    body.wp-admin .s360-tailwind-foundation.s360-hr-phase-i :where(.s360-ui-section-card--hr-panel form > p:has(input,.s360-ui-control,select,textarea,.s360-ui-button,.button),.s360-ui-card--hr-legacy-panel form > .inside > p:has(input,.s360-ui-control,select,textarea,.s360-ui-button,.button)){
        flex-direction:column;
        align-items:stretch;
    }
    body.wp-admin .s360-admin-wrapper :where(.s360-ui-form-actions,.s360-form-actions,.s360-card-actions,form > .submit),
    body.wp-admin .s360-admin-wrapper :where(.s360-filter-bar,.s360-report-filter-form,.s360-expense-report-filter-form,.s360-calendar-filter-form),
    body.wp-admin .s360-admin-wrapper :where(.s360-inline-form,.s360-ui-inline-form,.s360-inline-action-form,.s360-u-inline){
        align-items:stretch;
    }
    body.wp-admin .s360-admin-wrapper :where(.s360-filter-bar,.s360-report-filter-form,.s360-expense-report-filter-form,.s360-calendar-filter-form) :where(input:not([type]),input[type="text"],input[type="search"],input[type="date"],input[type="number"],select),
    body.wp-admin .s360-admin-wrapper :where(.s360-inline-form,.s360-ui-inline-form,.s360-inline-action-form,.s360-u-inline) :where(input:not([type]),input[type="text"],input[type="number"],input[type="date"],select),
    body.wp-admin .s360-tailwind-foundation.s360-hr-phase-i :where(table.s360-ui-form-grid--table td) :where(input:not([type]),input[type="text"],input[type="email"],input[type="number"],input[type="date"],select):not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not(.wp-color-picker):not(.button){
        flex:1 1 auto;
        width:100%;
    }
}

/* v13.3 approved UI/IX Forms Width Phase 1.2: unified form width rhythm.
 * Scope: CSS-only final compatibility layer for form layout width.
 * Goal: give create/edit/profile/composition forms one predictable readable width
 * while keeping filter bars, bulk actions, table actions and inline toolbar forms
 * full-width/auto-width. No PHP markup, field names, actions, nonces, JS hooks,
 * validation or database behavior is changed.
 */
body.wp-admin .s360-admin-wrapper{
    --s360-form-readable-max-width:820px;
    --s360-form-grid-readable-max-width:960px;
}
body.wp-admin .s360-admin-wrapper :where(.s360-ui-card form,.s360-ui-section-card form,[data-s360-hr-panel] form,form.s360-ui-form,form.s360-form-grid,form.s360-ui-form-grid,form.s360-form-grid-2,form.s360-admissions-review-form,form.s360-admissions-status-form,form.s360-admissions-interview-response-form,form.s360-admissions-document-upload-form,form.s360-admissions-parent-response-form,form.s360-calendar-event-form,form.s360-communication-send-form,form.s360-custom-field-form,form.s360-document-form,form.s360-import-form,form.s360-installment-plan-form,form.s360-layout-board-form,form.s360-message-compose-form,form.s360-parent-pay-form,form.s360-parent-workflow-form,form.s360-portal-upload-form,form.s360-template-pack-form,form.s360-hr-portal-form):not(.s360-filter-bar):not(.s360-filter-grid):not(.s360-filter-panel):not(.s360-report-filter-form):not(.s360-expense-report-filter-form):not(.s360-calendar-filter-form):not(.s360-audit-filter-form):not(.s360-phase4-filterbar):not(.s360-hr-directory-filters):not(.s360-student-ops-roster-filter):not(.s360-gradebook-class-filter):not(.s360-inline-filter):not(.s360-teacher-workbench-filters):not(.s360-report-filter-grid):not(.s360-analytics-filter-grid):not(.s360-bulk-actions-form):not(.s360-payment-table-actions):not(.s360-inline-form):not(.s360-ui-inline-form):not(.s360-inline-action-form):not(.s360-form-inline):not(.s360-u-inline):not(.s360-u-inline-block):not(.s360-u-inline-chip-space-sm):not(.s360-form-width-full):not(.s360-ui-form--wide):not(.s360-layout-board-toolbar):not(.s360-field-toolbar){
    box-sizing:border-box;
    width:100%;
    max-width:var(--s360-form-readable-max-width,820px);
    margin-inline-start:0;
    margin-inline-end:auto;
}
body.wp-admin .s360-admin-wrapper :where(form.s360-ui-form-grid,form.s360-form-grid,form.s360-form-grid-2,form.s360-admissions-review-form,form.s360-calendar-event-form,form.s360-communication-send-form,form.s360-custom-field-form,form.s360-document-form,form.s360-import-form,form.s360-installment-plan-form,form.s360-layout-board-form,form.s360-message-compose-form,form.s360-parent-workflow-form,form.s360-template-pack-form):not(.s360-filter-bar):not(.s360-filter-grid):not(.s360-filter-panel):not(.s360-report-filter-form):not(.s360-expense-report-filter-form):not(.s360-calendar-filter-form):not(.s360-audit-filter-form):not(.s360-phase4-filterbar):not(.s360-hr-directory-filters):not(.s360-student-ops-roster-filter):not(.s360-gradebook-class-filter):not(.s360-inline-filter):not(.s360-teacher-workbench-filters):not(.s360-report-filter-grid):not(.s360-analytics-filter-grid):not(.s360-bulk-actions-form):not(.s360-payment-table-actions):not(.s360-inline-form):not(.s360-ui-inline-form):not(.s360-inline-action-form):not(.s360-form-inline):not(.s360-u-inline):not(.s360-u-inline-block):not(.s360-u-inline-chip-space-sm):not(.s360-form-width-full):not(.s360-ui-form--wide):not(.s360-layout-board-toolbar):not(.s360-field-toolbar){
    max-width:var(--s360-form-grid-readable-max-width,960px);
}
body.wp-admin .s360-admin-wrapper :where(.s360-ui-card form,.s360-ui-section-card form,[data-s360-hr-panel] form,form.s360-ui-form):not(.s360-filter-bar):not(.s360-filter-grid):not(.s360-filter-panel):not(.s360-report-filter-form):not(.s360-expense-report-filter-form):not(.s360-calendar-filter-form):not(.s360-audit-filter-form):not(.s360-phase4-filterbar):not(.s360-hr-directory-filters):not(.s360-student-ops-roster-filter):not(.s360-gradebook-class-filter):not(.s360-inline-filter):not(.s360-teacher-workbench-filters):not(.s360-report-filter-grid):not(.s360-analytics-filter-grid):not(.s360-bulk-actions-form):not(.s360-payment-table-actions):not(.s360-inline-form):not(.s360-ui-inline-form):not(.s360-inline-action-form):not(.s360-form-inline):not(.s360-u-inline):not(.s360-u-inline-block):not(.s360-u-inline-chip-space-sm):not(.s360-form-width-full):not(.s360-ui-form--wide):not(.s360-layout-board-toolbar):not(.s360-field-toolbar) :where(.form-table,.s360-ui-form-table,table.s360-ui-form-grid--table){
    width:100%;
    max-width:100%;
}
body.wp-admin .s360-admin-wrapper :where(.s360-filter-panel form,.s360-field-toolbar form,.s360-layout-board-toolbar form,.s360-table-actions form,.s360-ui-table form,.s360-data-table form,.s360-table form,.wp-list-table form,table form,form.s360-filter-bar,form.s360-filter-grid,form.s360-report-filter-form,form.s360-expense-report-filter-form,form.s360-calendar-filter-form,form.s360-audit-filter-form,form.s360-phase4-filterbar,form.s360-hr-directory-filters,form.s360-student-ops-roster-filter,form.s360-gradebook-class-filter,form.s360-inline-filter,form.s360-teacher-workbench-filters,form.s360-report-filter-grid,form.s360-analytics-filter-grid,form.s360-bulk-actions-form,form.s360-payment-table-actions,form.s360-inline-form,form.s360-ui-inline-form,form.s360-inline-action-form,form.s360-form-inline,form.s360-u-inline,form.s360-u-inline-block,form.s360-u-inline-chip-space-sm,form.s360-form-width-full,form.s360-ui-form--wide){
    max-width:100%;
}
@media (max-width:782px){
    body.wp-admin .s360-admin-wrapper :where(.s360-ui-card form,.s360-ui-section-card form,[data-s360-hr-panel] form,form.s360-ui-form,form.s360-form-grid,form.s360-ui-form-grid,form.s360-form-grid-2,form.s360-admissions-review-form,form.s360-admissions-status-form,form.s360-admissions-interview-response-form,form.s360-admissions-document-upload-form,form.s360-admissions-parent-response-form,form.s360-calendar-event-form,form.s360-communication-send-form,form.s360-custom-field-form,form.s360-document-form,form.s360-import-form,form.s360-installment-plan-form,form.s360-layout-board-form,form.s360-message-compose-form,form.s360-parent-pay-form,form.s360-parent-workflow-form,form.s360-portal-upload-form,form.s360-template-pack-form,form.s360-hr-portal-form){
        max-width:100%;
    }
}
body.wp-admin .s360-admin-wrapper :where(.s360-table-actions form,.s360-ui-table form,.s360-data-table form,.s360-table form,.wp-list-table form,table form,form.s360-payment-table-actions,form.s360-inline-form,form.s360-ui-inline-form,form.s360-inline-action-form,form.s360-form-inline,form.s360-u-inline,form.s360-u-inline-block,form.s360-u-inline-chip-space-sm){
    width:auto;
}
/* v13.3 approved UI/IX Page Shell Phase 1: unified admin body/page shell.
 * Scope: CSS-only final compatibility layer for admin module page wrappers.
 * Goal: give modern module pages one predictable outer width, gutter and stack
 * rhythm while preserving the existing PHP routes, module classes, tabs, forms,
 * tables, JS hooks, permissions and database behavior.
 */
body.wp-admin .wrap.s360-admin-wrapper{
    --s360-page-shell-max-width:1440px;
    --s360-page-shell-gutter-inline:20px;
    --s360-page-shell-gutter-inline-start:2px;
    --s360-page-shell-top-offset:16px;
    /* Faza 2: stack-gap konzumira jedinstveni token. */
    --s360-page-shell-stack-gap:var(--s360-unified-stack-gap, 14px);
    --s360-page-shell-mobile-gutter:12px;
}
body.wp-admin .wrap.s360-admin-wrapper:where(.s360-page-shell,.s360-grouped-admin,.s360-tailwind-foundation,.s360-wrap){
    box-sizing:border-box;
    width:auto;
    max-width:var(--s360-page-shell-max-width,1440px);
    min-width:0;
    margin-top:var(--s360-page-shell-top-offset,16px);
    margin-inline-start:var(--s360-page-shell-gutter-inline-start,2px);
    margin-inline-end:var(--s360-page-shell-gutter-inline,20px);
    background:transparent;
    background-image:none;
}
body.wp-admin .wrap.s360-admin-wrapper:where(.s360-page-shell,.s360-grouped-admin,.s360-tailwind-foundation,.s360-wrap) > :where(.s360-ui-page-header,.s360-page-hero,.s360-grouped-admin__hero,.s360-grouped-admin__notice-slot,.s360-grouped-admin__top-surfaces,.s360-ui-header-utility-grid,.s360-admin-dashboard__top-surfaces,.s360-readiness-hero,.s360-settings-hero,.s360-system-hero,.s360-ui-tabs__nav,.s360-ui-main-tabs,.s360-grouped-admin__main-tabs,.s360-grouped-admin__content,.s360-admin-dashboard__workspace,.s360-calendar-workspace,.s360-hr-shell,.s360-ui-card,.s360-ui-section-card){
    box-sizing:border-box;
    width:100%;
    max-width:100%;
    min-width:0;
}
body.wp-admin .wrap.s360-admin-wrapper:where(.s360-page-shell,.s360-grouped-admin,.s360-tailwind-foundation,.s360-wrap) > :where(.s360-ui-page-header,.s360-page-hero,.s360-grouped-admin__hero):first-child{
    margin-top:0;
}
body.wp-admin .wrap.s360-admin-wrapper:where(.s360-page-shell,.s360-grouped-admin,.s360-tailwind-foundation,.s360-wrap) > :where(.s360-grouped-admin__top-surfaces,.s360-ui-header-utility-grid,.s360-admin-dashboard__top-surfaces,.s360-readiness-hero,.s360-settings-hero,.s360-system-hero){
    margin-block-start:var(--s360-page-shell-stack-gap,14px);
    margin-block-end:0;
}
body.wp-admin .wrap.s360-admin-wrapper:where(.s360-page-shell,.s360-grouped-admin,.s360-tailwind-foundation,.s360-wrap) > :where(.s360-ui-main-tabs,.s360-grouped-admin__main-tabs):not(.s360-ui-sub-tabs){
    margin:var(--s360-tabs-main-margin,14px 0 16px);
}
body.wp-admin .wrap.s360-admin-wrapper:where(.s360-page-shell,.s360-grouped-admin,.s360-tailwind-foundation,.s360-wrap) > :where(.s360-grouped-admin__content,.s360-admin-dashboard__workspace,.s360-calendar-workspace){
    margin-block-start:var(--s360-page-shell-stack-gap,14px);
    margin-block-end:0;
}
body.wp-admin .wrap.s360-admin-wrapper.s360-hr-phase-i .s360-hr-shell{
    box-sizing:border-box;
    width:100%;
    max-width:100%;
    min-width:0;
    margin:0;
}
body.wp-admin .wrap.s360-admin-wrapper.s360-hr-phase-i .s360-hr-shell > :where(.s360-ui-page-header,.s360-grouped-admin__hero,.s360-grouped-admin__top-surfaces,.s360-ui-header-utility-grid,.s360-ui-main-tabs,.s360-grouped-admin__main-tabs,.s360-hr-main,.s360-grouped-admin__content){
    box-sizing:border-box;
    width:100%;
    max-width:100%;
    min-width:0;
}
body.wp-admin .wrap.s360-admin-wrapper.s360-hr-phase-i .s360-hr-shell > :where(.s360-ui-main-tabs,.s360-grouped-admin__main-tabs):not(.s360-ui-sub-tabs),
body.wp-admin .wrap.s360-admin-wrapper.s360-hr-phase-i .s360-hr-shell > :where(.s360-hr-main,.s360-grouped-admin__content){
    margin-block-start:var(--s360-page-shell-stack-gap,14px);
    margin-block-end:0;
}
body.wp-admin .wrap.s360-admin-wrapper :where(.s360-grouped-admin__content,.s360-admin-dashboard__workspace,.s360-calendar-workspace,.s360-hr-main,.s360-ui-section-card,.s360-ui-card,.s360-ui-grid,.s360-ui-form-grid,.s360-form-grid,table.widefat,.wp-list-table){
    min-width:0;
}
body.wp-admin .wrap.s360-admin-wrapper :where(.s360-grouped-admin__content,.s360-admin-dashboard__workspace,.s360-calendar-workspace,.s360-hr-main) > :where(.s360-ui-card,.s360-ui-section-card,.s360-ui-dashboard-panel,.s360-ui-grid,.s360-table-responsive,.s360-table-scroll,.s360-overflow-x-auto){
    max-width:100%;
}
@media (min-width:1500px){
    body.wp-admin .wrap.s360-admin-wrapper:where(.s360-page-shell,.s360-grouped-admin,.s360-tailwind-foundation,.s360-wrap){
        margin-inline-end:auto;
    }
}
@media (max-width:782px){
    body.wp-admin .wrap.s360-admin-wrapper{
        --s360-page-shell-gutter-inline:var(--s360-page-shell-mobile-gutter,12px);
        --s360-page-shell-gutter-inline-start:var(--s360-page-shell-mobile-gutter,12px);
        --s360-page-shell-top-offset:12px;
        --s360-page-shell-stack-gap:12px;
    }
    body.wp-admin .wrap.s360-admin-wrapper:where(.s360-page-shell,.s360-grouped-admin,.s360-tailwind-foundation,.s360-wrap){
        max-width:none;
        margin-inline-start:var(--s360-page-shell-gutter-inline-start,12px);
        margin-inline-end:var(--s360-page-shell-gutter-inline,12px);
    }
}


/* v13.3 approved UI/IX Page Shell Phase 1.1: enforce unified admin body shell.
 * Scope: CSS-only correction for real WordPress admin wrapper combinations.
 * Problem fixed: legacy full-width layers and .s360-grouped-fullwidth wrappers could keep
 * module pages visually wider than the approved School 360 shell width.
 * Contract: every School 360 admin page whose top-level wrapper carries
 * .wrap.s360-admin-wrapper uses the same max-width/gutter shell. Inner cards,
 * tables, filters and toolbars keep their existing component-level sizing.
 */
body.wp-admin{
    --s360-page-shell-max-width:1440px;
    --s360-page-shell-gutter-inline:20px;
    --s360-page-shell-gutter-inline-start:2px;
    --s360-page-shell-top-offset:16px;
    --s360-page-shell-stack-gap:var(--s360-component-card-header-gap, 14px);
    --s360-page-shell-mobile-gutter:12px;
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-wrap,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-page-shell,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-grouped-admin,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-grouped-fullwidth,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-tailwind-foundation,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.school360-tailwind-foundation,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.school360-wrap,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-ui-shell,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-student-workspace,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-admin-dashboard,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-admin-page,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-admin-wrap,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-hr-wrap{
    box-sizing:border-box;
    width:auto;
    inline-size:auto;
    max-width:var(--s360-page-shell-max-width,1440px);
    max-width:min(var(--s360-page-shell-max-width,1440px), calc(100% - var(--s360-page-shell-gutter-inline-start,2px) - var(--s360-page-shell-gutter-inline,20px)));
    max-inline-size:var(--s360-page-shell-max-width,1440px);
    max-inline-size:min(var(--s360-page-shell-max-width,1440px), calc(100% - var(--s360-page-shell-gutter-inline-start,2px) - var(--s360-page-shell-gutter-inline,20px)));
    min-width:0;
    margin-block-start:var(--s360-page-shell-top-offset,16px);
    margin-inline-start:var(--s360-page-shell-gutter-inline-start,2px);
    margin-inline-end:auto;
    background:transparent;
    background-image:none;
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-grouped-fullwidth,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-page-shell.s360-grouped-fullwidth,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-grouped-admin.s360-grouped-fullwidth{
    width:auto;
    inline-size:auto;
    max-width:var(--s360-page-shell-max-width,1440px);
    max-width:min(var(--s360-page-shell-max-width,1440px), calc(100% - var(--s360-page-shell-gutter-inline-start,2px) - var(--s360-page-shell-gutter-inline,20px)));
    max-inline-size:var(--s360-page-shell-max-width,1440px);
    max-inline-size:min(var(--s360-page-shell-max-width,1440px), calc(100% - var(--s360-page-shell-gutter-inline-start,2px) - var(--s360-page-shell-gutter-inline,20px)));
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper > :where(.s360-ui-page-header,.s360-page-hero,.s360-grouped-admin__hero,.s360-grouped-admin__notice-slot,.s360-grouped-admin__top-surfaces,.s360-ui-header-utility-grid,.s360-admin-dashboard__top-surfaces,.s360-readiness-hero,.s360-settings-hero,.s360-system-hero,.s360-ui-tabs__nav,.s360-ui-main-tabs,.s360-grouped-admin__main-tabs,.s360-grouped-admin__content,.s360-admin-dashboard__workspace,.s360-calendar-workspace,.s360-hr-shell,.s360-ui-card,.s360-ui-section-card){
    box-sizing:border-box;
    width:100%;
    max-width:100%;
    min-width:0;
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper > :where(.s360-ui-page-header,.s360-page-hero,.s360-grouped-admin__hero):first-child{
    margin-top:0;
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper > :where(.s360-grouped-admin__top-surfaces,.s360-ui-header-utility-grid,.s360-admin-dashboard__top-surfaces,.s360-readiness-hero,.s360-settings-hero,.s360-system-hero,.s360-ui-main-tabs,.s360-grouped-admin__main-tabs,.s360-grouped-admin__content,.s360-admin-dashboard__workspace,.s360-calendar-workspace):not(:first-child){
    margin-block-start:var(--s360-page-shell-stack-gap,14px);
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-hr-phase-i .s360-hr-shell,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-hr-shell{
    box-sizing:border-box;
    width:100%;
    max-width:100%;
    min-width:0;
    margin-inline-start:0;
    margin-inline-end:0;
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(.s360-grouped-admin__content,.s360-admin-dashboard__workspace,.s360-calendar-workspace,.s360-hr-main,.s360-ui-section-card,.s360-ui-card,.s360-ui-grid,.s360-ui-form-grid,.s360-form-grid,table.widefat,.wp-list-table){
    min-width:0;
}
@media (min-width:1500px){
    body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper{
        margin-inline-end:auto;
    }
}
@media (max-width:782px){
    body.wp-admin{
        --s360-page-shell-gutter-inline:var(--s360-page-shell-mobile-gutter,12px);
        --s360-page-shell-gutter-inline-start:var(--s360-page-shell-mobile-gutter,12px);
        --s360-page-shell-top-offset:12px;
        --s360-page-shell-stack-gap:12px;
    }
    body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper,
    body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-grouped-fullwidth{
        max-width:calc(100% - var(--s360-page-shell-gutter-inline-start,12px) - var(--s360-page-shell-gutter-inline,12px));
        max-inline-size:calc(100% - var(--s360-page-shell-gutter-inline-start,12px) - var(--s360-page-shell-gutter-inline,12px));
        margin-inline-start:var(--s360-page-shell-gutter-inline-start,12px);
        margin-inline-end:var(--s360-page-shell-gutter-inline,12px);
    }
}

/* Phase 8 ownership extraction: Admin Dashboard compact/density/workspace polish now lives in its scoped admin ownership layer. */

/* Phase 8 ownership extraction: Calendar & Events density/filter/KPI/table polish now lives in its scoped admin ownership layer. */

/* Phase 8 ownership extraction: Admin Dashboard KPI grid restore polish now lives in its scoped admin ownership layer. */

/* v13.6.30 UI/IX Unified Navigation Tabs CSS Consolidation.
 * Scope: canonical `.s360-ui-main-tabs` and `.s360-ui-sub-tabs` tab rows inside
 * the School 360 admin wrapper, plus known WordPress/module bridge aliases that
 * already carry the canonical classes.
 * Goal: make one main-tab visual contract and one sub-tab visual contract win at
 * the final card-system layer without changing PHP markup, JavaScript behavior,
 * routes, permissions, nonces, REST/AJAX/admin-post handlers or database logic.
 * Legacy `.nav-tab*` classes remain bridge compatibility classes.
 */
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-ui-main-tabs:not(.s360-ui-sub-tabs),
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-ui-tabs__nav.s360-ui-main-tabs:not(.s360-ui-sub-tabs),
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper nav.s360-ui-main-tabs:not(.s360-ui-sub-tabs),
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.school360-dashboard-phase-d nav.s360-admin-dashboard__tabs.s360-ui-main-tabs,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-finance-phase-h nav.s360-finance-tabs.s360-ui-main-tabs,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-expense-phase-h nav.s360-expense-tabs.s360-ui-main-tabs,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-hr-phase-i .s360-ui-section-card--hr-navigation nav.s360-hr-nav.s360-ui-main-tabs{
    position:relative;
    top:auto;
    z-index:auto;
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    justify-content:flex-start;
    gap:var(--s360-tabs-main-gap,8px);
    width:100%;
    max-width:100%;
    min-width:0;
    box-sizing:border-box;
    margin:var(--s360-tabs-main-margin,14px 0 16px);
    padding:var(--s360-tabs-main-padding,8px);
    border:1px solid var(--s360-tabs-main-border,var(--s360-color-border-muted,var(--s360-color-border,#dbe5f0)));
    border-bottom:1px solid var(--s360-tabs-main-border,var(--s360-color-border-muted,var(--s360-color-border,#dbe5f0)));
    border-radius:var(--s360-tabs-main-radius,16px);
    background:var(--s360-tabs-main-bg,var(--s360-color-surface,var(--s360-color-white,#fff)));
    background-image:none;
    box-shadow:var(--s360-tabs-main-shadow,var(--s360-shadow-sm,0 1px 2px rgba(15,23,42,.06)));
    backdrop-filter:none;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:thin;
    white-space:nowrap;
    transform:none;
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-ui-main-tabs:not(.s360-ui-sub-tabs) > :where(a,button,.nav-tab,.s360-ui-tabs__tab,.s360-finance-tab-link,.s360-expense-tab-link,.s360-hr-nav-item,.s360-tab,.school360-tab),
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.school360-dashboard-phase-d nav.s360-admin-dashboard__tabs.s360-ui-main-tabs > :where(a,button,.nav-tab,.s360-ui-tabs__tab),
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-finance-phase-h nav.s360-finance-tabs.s360-ui-main-tabs > :where(a,button,.nav-tab,.s360-ui-tabs__tab,.s360-finance-tab-link),
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-expense-phase-h nav.s360-expense-tabs.s360-ui-main-tabs > :where(a,button,.nav-tab,.s360-ui-tabs__tab,.s360-expense-tab-link),
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-hr-phase-i .s360-ui-section-card--hr-navigation nav.s360-hr-nav.s360-ui-main-tabs > :where(a,button,.nav-tab,.s360-ui-tabs__tab,.s360-hr-nav-item){
    position:relative;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 auto;
    min-height:var(--s360-tabs-main-item-min-height,38px);
    min-width:0;
    width:auto;
    max-width:none;
    margin:0;
    padding:var(--s360-tabs-main-item-padding,8px 12px);
    border:1px solid transparent;
    border-bottom:1px solid transparent;
    border-radius:var(--s360-tabs-main-item-radius,999px);
    background:transparent;
    background-image:none;
    box-shadow:none;
    color:var(--s360-tabs-main-text,var(--s360-color-primary,#2271b1));
    font-size:var(--s360-tabs-main-font-size,13px);
    font-weight:700;
    line-height:1.3;
    letter-spacing:normal;
    text-align:center;
    text-decoration:none;
    text-transform:none;
    white-space:nowrap;
    cursor:pointer;
    transform:none;
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-ui-main-tabs:not(.s360-ui-sub-tabs) > :where(a,button,.nav-tab,.s360-ui-tabs__tab,.s360-finance-tab-link,.s360-expense-tab-link,.s360-hr-nav-item,.s360-tab,.school360-tab):hover,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-ui-main-tabs:not(.s360-ui-sub-tabs) > :where(a,button,.nav-tab,.s360-ui-tabs__tab,.s360-finance-tab-link,.s360-expense-tab-link,.s360-hr-nav-item,.s360-tab,.school360-tab):focus-visible,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.school360-dashboard-phase-d nav.s360-admin-dashboard__tabs.s360-ui-main-tabs > :where(a,button,.nav-tab,.s360-ui-tabs__tab):hover,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.school360-dashboard-phase-d nav.s360-admin-dashboard__tabs.s360-ui-main-tabs > :where(a,button,.nav-tab,.s360-ui-tabs__tab):focus-visible,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-finance-phase-h nav.s360-finance-tabs.s360-ui-main-tabs > :where(a,button,.nav-tab,.s360-ui-tabs__tab,.s360-finance-tab-link):hover,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-finance-phase-h nav.s360-finance-tabs.s360-ui-main-tabs > :where(a,button,.nav-tab,.s360-ui-tabs__tab,.s360-finance-tab-link):focus-visible,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-expense-phase-h nav.s360-expense-tabs.s360-ui-main-tabs > :where(a,button,.nav-tab,.s360-ui-tabs__tab,.s360-expense-tab-link):hover,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-expense-phase-h nav.s360-expense-tabs.s360-ui-main-tabs > :where(a,button,.nav-tab,.s360-ui-tabs__tab,.s360-expense-tab-link):focus-visible,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-hr-phase-i .s360-ui-section-card--hr-navigation nav.s360-hr-nav.s360-ui-main-tabs > :where(a,button,.nav-tab,.s360-ui-tabs__tab,.s360-hr-nav-item):hover,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-hr-phase-i .s360-ui-section-card--hr-navigation nav.s360-hr-nav.s360-ui-main-tabs > :where(a,button,.nav-tab,.s360-ui-tabs__tab,.s360-hr-nav-item):focus-visible{
    border-color:var(--s360-tabs-main-hover-border,var(--s360-color-primary-soft-border,var(--s360-color-border,#bfdbfe)));
    border-bottom-color:var(--s360-tabs-main-hover-border,var(--s360-color-primary-soft-border,var(--s360-color-border,#bfdbfe)));
    background:var(--s360-tabs-main-hover-bg,var(--s360-color-bg-subtle,var(--s360-color-bg,#f8fafc)));
    background-image:none;
    color:var(--s360-tabs-main-hover-text,var(--s360-color-primary,#2271b1));
    box-shadow:none;
    outline:none;
    transform:none;
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-ui-main-tabs:not(.s360-ui-sub-tabs) > :where(a,button,.nav-tab,.s360-ui-tabs__tab,.s360-finance-tab-link,.s360-expense-tab-link,.s360-hr-nav-item,.s360-tab,.school360-tab):focus-visible,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.school360-dashboard-phase-d nav.s360-admin-dashboard__tabs.s360-ui-main-tabs > :where(a,button,.nav-tab,.s360-ui-tabs__tab):focus-visible,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-finance-phase-h nav.s360-finance-tabs.s360-ui-main-tabs > :where(a,button,.nav-tab,.s360-ui-tabs__tab,.s360-finance-tab-link):focus-visible,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-expense-phase-h nav.s360-expense-tabs.s360-ui-main-tabs > :where(a,button,.nav-tab,.s360-ui-tabs__tab,.s360-expense-tab-link):focus-visible,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-hr-phase-i .s360-ui-section-card--hr-navigation nav.s360-hr-nav.s360-ui-main-tabs > :where(a,button,.nav-tab,.s360-ui-tabs__tab,.s360-hr-nav-item):focus-visible{
    outline:2px solid var(--s360-tabs-focus-ring,var(--s360-color-primary,#2271b1));
    outline-offset:2px;
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-ui-main-tabs:not(.s360-ui-sub-tabs) > :is(.nav-tab-active,.is-active,.active,.s360-hr-nav-active,[aria-current="page"],[aria-selected="true"]),
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.school360-dashboard-phase-d nav.s360-admin-dashboard__tabs.s360-ui-main-tabs > :is(.nav-tab-active,.is-active,.active,[aria-current="page"],[aria-selected="true"]),
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-finance-phase-h nav.s360-finance-tabs.s360-ui-main-tabs > :is(.nav-tab-active,.is-active,.active,[aria-current="page"],[aria-selected="true"]),
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-expense-phase-h nav.s360-expense-tabs.s360-ui-main-tabs > :is(.nav-tab-active,.is-active,.active,[aria-current="page"],[aria-selected="true"]),
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-hr-phase-i .s360-ui-section-card--hr-navigation nav.s360-hr-nav.s360-ui-main-tabs > :is(.nav-tab-active,.is-active,.active,.s360-hr-nav-active,[aria-current="page"],[aria-selected="true"]){
    border-color:var(--s360-tabs-main-active-border,var(--s360-color-primary-soft-border,var(--s360-color-primary,#2271b1)));
    border-bottom-color:var(--s360-tabs-main-active-border,var(--s360-color-primary-soft-border,var(--s360-color-primary,#2271b1)));
    background:var(--s360-tabs-main-active-bg,var(--s360-color-primary-soft,var(--s360-color-border-exact-f0f6fc,#f0f6fc)));
    background-image:none;
    color:var(--s360-tabs-main-active-text,var(--s360-color-primary,#2271b1));
    box-shadow:none;
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-ui-sub-tabs:not(.s360-ui-main-tabs),
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-ui-tabs__nav.s360-ui-sub-tabs:not(.s360-ui-main-tabs),
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper nav.s360-ui-sub-tabs:not(.s360-ui-main-tabs),
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-students-subnav.s360-ui-sub-tabs,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-student-ops-subtabs.s360-ui-sub-tabs,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-people-subnav.s360-ui-sub-tabs,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-communication-subnav.s360-ui-sub-tabs,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-hr-profile-tabs.s360-ui-sub-tabs{
    position:relative;
    top:auto;
    z-index:auto;
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    justify-content:flex-start;
    gap:var(--s360-tabs-sub-gap,6px);
    width:100%;
    max-width:100%;
    min-width:0;
    box-sizing:border-box;
    margin:var(--s360-tabs-sub-margin,14px 0 16px);
    padding:var(--s360-tabs-sub-padding,6px);
    border:1px solid var(--s360-tabs-sub-border,var(--s360-color-border-muted,var(--s360-color-border,#dbe5f0)));
    border-bottom:1px solid var(--s360-tabs-sub-border,var(--s360-color-border-muted,var(--s360-color-border,#dbe5f0)));
    border-radius:var(--s360-tabs-sub-radius,12px);
    background:var(--s360-tabs-sub-bg,var(--s360-color-bg-subtle,var(--s360-color-bg,#f8fafc)));
    background-image:none;
    box-shadow:var(--s360-tabs-sub-shadow,inset 0 1px 0 rgba(255,255,255,.75));
    backdrop-filter:none;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:thin;
    white-space:nowrap;
    transform:none;
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-ui-sub-tabs:not(.s360-ui-main-tabs) > :where(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab,.s360-school-tab,.s360-system-tab,.s360-builder-tab,.s360-admin-nav-pill,.s360-hr-profile-tab),
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-students-subnav.s360-ui-sub-tabs > :where(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab),
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-student-ops-subtabs.s360-ui-sub-tabs > :where(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab),
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-people-subnav.s360-ui-sub-tabs > :where(a,button,span,div,.nav-tab,.s360-ui-tabs__tab),
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-communication-subnav.s360-ui-sub-tabs > :where(a,button,span,div,.nav-tab,.s360-ui-tabs__tab),
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-hr-profile-tabs.s360-ui-sub-tabs > :where(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-hr-profile-tab){
    position:relative;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 auto;
    min-height:var(--s360-tabs-sub-item-min-height,34px);
    min-width:0;
    width:auto;
    max-width:none;
    margin:0;
    padding:var(--s360-tabs-sub-item-padding,7px 11px);
    border:1px solid transparent;
    border-bottom:1px solid transparent;
    border-radius:var(--s360-tabs-sub-item-radius,9px);
    background:transparent;
    background-image:none;
    box-shadow:none;
    color:var(--s360-tabs-sub-text,var(--s360-color-text-muted,var(--s360-color-text-secondary,#475569)));
    font-size:var(--s360-tabs-sub-font-size,12px);
    font-weight:700;
    line-height:1.25;
    letter-spacing:.01em;
    text-align:center;
    text-decoration:none;
    text-transform:none;
    white-space:nowrap;
    cursor:pointer;
    transform:none;
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-ui-sub-tabs:not(.s360-ui-main-tabs) > :where(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab,.s360-school-tab,.s360-system-tab,.s360-builder-tab,.s360-admin-nav-pill,.s360-hr-profile-tab):hover,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-ui-sub-tabs:not(.s360-ui-main-tabs) > :where(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab,.s360-school-tab,.s360-system-tab,.s360-builder-tab,.s360-admin-nav-pill,.s360-hr-profile-tab):focus-visible,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-students-subnav.s360-ui-sub-tabs > :where(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab):hover,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-students-subnav.s360-ui-sub-tabs > :where(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab):focus-visible,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-student-ops-subtabs.s360-ui-sub-tabs > :where(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab):hover,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-student-ops-subtabs.s360-ui-sub-tabs > :where(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab):focus-visible,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-people-subnav.s360-ui-sub-tabs > :where(a,button,span,div,.nav-tab,.s360-ui-tabs__tab):hover,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-people-subnav.s360-ui-sub-tabs > :where(a,button,span,div,.nav-tab,.s360-ui-tabs__tab):focus-visible,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-communication-subnav.s360-ui-sub-tabs > :where(a,button,span,div,.nav-tab,.s360-ui-tabs__tab):hover,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-communication-subnav.s360-ui-sub-tabs > :where(a,button,span,div,.nav-tab,.s360-ui-tabs__tab):focus-visible,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-hr-profile-tabs.s360-ui-sub-tabs > :where(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-hr-profile-tab):hover,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-hr-profile-tabs.s360-ui-sub-tabs > :where(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-hr-profile-tab):focus-visible{
    border-color:var(--s360-tabs-sub-hover-border,var(--s360-color-primary-soft-border,var(--s360-color-border,#bfdbfe)));
    border-bottom-color:var(--s360-tabs-sub-hover-border,var(--s360-color-primary-soft-border,var(--s360-color-border,#bfdbfe)));
    background:var(--s360-tabs-sub-hover-bg,var(--s360-color-surface,var(--s360-color-white,#fff)));
    background-image:none;
    color:var(--s360-tabs-sub-hover-text,var(--s360-color-primary,#2271b1));
    box-shadow:var(--s360-tabs-sub-hover-shadow,0 1px 2px rgba(15,23,42,.05));
    outline:none;
    transform:none;
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-ui-sub-tabs:not(.s360-ui-main-tabs) > :where(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab,.s360-school-tab,.s360-system-tab,.s360-builder-tab,.s360-admin-nav-pill,.s360-hr-profile-tab):focus-visible,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-students-subnav.s360-ui-sub-tabs > :where(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab):focus-visible,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-student-ops-subtabs.s360-ui-sub-tabs > :where(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab):focus-visible,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-people-subnav.s360-ui-sub-tabs > :where(a,button,span,div,.nav-tab,.s360-ui-tabs__tab):focus-visible,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-communication-subnav.s360-ui-sub-tabs > :where(a,button,span,div,.nav-tab,.s360-ui-tabs__tab):focus-visible,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-hr-profile-tabs.s360-ui-sub-tabs > :where(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-hr-profile-tab):focus-visible{
    outline:2px solid var(--s360-tabs-focus-ring,var(--s360-color-primary,#2271b1));
    outline-offset:2px;
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-ui-sub-tabs:not(.s360-ui-main-tabs) > :is(.nav-tab-active,.is-active,.active,.s360-hr-profile-tab-active,[aria-current="page"],[aria-selected="true"]),
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-students-subnav.s360-ui-sub-tabs > :is(.nav-tab-active,.is-active,.active,[aria-current="page"],[aria-selected="true"]),
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-student-ops-subtabs.s360-ui-sub-tabs > :is(.nav-tab-active,.is-active,.active,[aria-current="page"],[aria-selected="true"]),
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-people-subnav.s360-ui-sub-tabs > :is(.nav-tab-active,.is-active,.active,[aria-current="page"],[aria-selected="true"]),
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-communication-subnav.s360-ui-sub-tabs > :is(.nav-tab-active,.is-active,.active,[aria-current="page"],[aria-selected="true"]),
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-hr-profile-tabs.s360-ui-sub-tabs > :is(.nav-tab-active,.is-active,.active,.s360-hr-profile-tab-active,[aria-current="page"],[aria-selected="true"]){
    border-color:var(--s360-tabs-sub-active-border,var(--s360-color-primary-soft-border,var(--s360-color-primary,#bfdbfe)));
    border-bottom-color:var(--s360-tabs-sub-active-border,var(--s360-color-primary-soft-border,var(--s360-color-primary,#bfdbfe)));
    background:var(--s360-tabs-sub-active-bg,var(--s360-color-surface,var(--s360-color-white,#fff)));
    background-image:none;
    color:var(--s360-tabs-sub-active-text,var(--s360-color-primary,#2271b1));
    box-shadow:var(--s360-tabs-sub-active-shadow,0 1px 3px rgba(15,23,42,.08));
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(.s360-ui-main-tabs,.s360-ui-sub-tabs) > :is(.disabled,[disabled],[aria-disabled="true"]){
    cursor:not-allowed;
    opacity:.58;
    box-shadow:none;
}
@media (max-width:782px){
    body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-ui-main-tabs:not(.s360-ui-sub-tabs),
    body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper .s360-ui-sub-tabs:not(.s360-ui-main-tabs){
        flex-wrap:nowrap;
        scroll-padding-inline:var(--s360-tabs-mobile-scroll-padding,var(--s360-space-sm,12px));
        scroll-snap-type:x proximity;
    }
    body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(.s360-ui-main-tabs,.s360-ui-sub-tabs) > :where(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab,.s360-finance-tab-link,.s360-expense-tab-link,.s360-hr-nav-item,.s360-hr-profile-tab){
        scroll-snap-align:start;
    }
}

/* v13.6.30 UI/IX Unified Body Shell Phase 3: CSS shell consolidation.
 * Scope: CSS-only final layer for the body/page shell contract introduced by
 * docs/UIIX_UNIFIED_BODY_SHELL_STANDARD_V13_6.md.
 * Contract: .wrap.s360-admin-wrapper is the outer WordPress admin boundary,
 * .s360-page-shell is the canonical page shell, .s360-ui-shell is an optional
 * inner workspace shell, and legacy/module shell classes remain bridge hooks.
 * This layer intentionally does not alter PHP routes, JS hooks, data flows,
 * capabilities, nonces, forms, SQL, REST/AJAX/admin-post handlers or database
 * schema.
 */
body.wp-admin{
    --s360-body-shell-max-width:var(--s360-page-shell-max-width,1440px);
    --s360-body-shell-gutter-start:var(--s360-page-shell-gutter-inline-start,2px);
    --s360-body-shell-gutter-end:var(--s360-page-shell-gutter-inline,20px);
    --s360-body-shell-top-offset:var(--s360-page-shell-top-offset,16px);
    --s360-body-shell-stack-gap:var(--s360-page-shell-stack-gap,14px);
    --s360-body-shell-mobile-gutter:var(--s360-page-shell-mobile-gutter,12px);
    --s360-body-shell-surface:transparent;
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper{
    box-sizing:border-box;
    display:block;
    width:auto;
    inline-size:auto;
    max-width:var(--s360-body-shell-max-width,1440px);
    max-width:min(var(--s360-body-shell-max-width,1440px), calc(100% - var(--s360-body-shell-gutter-start,2px) - var(--s360-body-shell-gutter-end,20px)));
    max-inline-size:var(--s360-body-shell-max-width,1440px);
    max-inline-size:min(var(--s360-body-shell-max-width,1440px), calc(100% - var(--s360-body-shell-gutter-start,2px) - var(--s360-body-shell-gutter-end,20px)));
    min-width:0;
    margin-block-start:var(--s360-body-shell-top-offset,16px);
    margin-block-end:0;
    margin-inline-start:var(--s360-body-shell-gutter-start,2px);
    margin-inline-end:auto;
    padding:0;
    background:var(--s360-body-shell-surface,transparent);
    background-image:none;
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-page-shell,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-grouped-admin,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-wrap,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.school360-wrap,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-tailwind-foundation,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.school360-tailwind-foundation{
    width:auto;
    inline-size:auto;
    max-width:var(--s360-body-shell-max-width,1440px);
    max-width:min(var(--s360-body-shell-max-width,1440px), calc(100% - var(--s360-body-shell-gutter-start,2px) - var(--s360-body-shell-gutter-end,20px)));
    max-inline-size:var(--s360-body-shell-max-width,1440px);
    max-inline-size:min(var(--s360-body-shell-max-width,1440px), calc(100% - var(--s360-body-shell-gutter-start,2px) - var(--s360-body-shell-gutter-end,20px)));
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-page-shell--workspace,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-page-shell--fullwidth,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-grouped-fullwidth,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-admin-dashboard,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-finance-page,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-student-workspace,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-admissions-workspace,
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper.s360-people-workspace{
    width:auto;
    inline-size:auto;
    max-width:var(--s360-body-shell-max-width,1440px);
    max-width:min(var(--s360-body-shell-max-width,1440px), calc(100% - var(--s360-body-shell-gutter-start,2px) - var(--s360-body-shell-gutter-end,20px)));
    max-inline-size:var(--s360-body-shell-max-width,1440px);
    max-inline-size:min(var(--s360-body-shell-max-width,1440px), calc(100% - var(--s360-body-shell-gutter-start,2px) - var(--s360-body-shell-gutter-end,20px)));
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper > :where(.s360-page-shell__header,.s360-ui-page-header,.s360-page-hero,.s360-grouped-admin__hero,.s360-readiness-hero,.s360-settings-hero,.s360-system-hero,.s360-grouped-admin__notice-slot,.s360-grouped-admin__top-surfaces,.s360-ui-header-utility-grid,.s360-admin-dashboard__top-surfaces,.s360-ui-tabs,.s360-ui-tabs__nav,.s360-ui-main-tabs,.s360-grouped-admin__main-tabs,.s360-page-shell__body,.s360-ui-shell,.s360-grouped-admin__content,.s360-admin-dashboard__workspace,.s360-calendar-workspace,.s360-hr-shell,.s360-hr-main,.s360-ui-card,.s360-ui-section-card,.s360-ui-dashboard-panel){
    box-sizing:border-box;
    width:100%;
    max-width:100%;
    min-width:0;
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper > :where(.s360-page-shell__header,.s360-ui-page-header,.s360-page-hero,.s360-grouped-admin__hero,.s360-readiness-hero,.s360-settings-hero,.s360-system-hero):first-child{
    margin-block-start:0;
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper > :where(.s360-page-shell__header,.s360-ui-page-header,.s360-page-hero,.s360-grouped-admin__hero,.s360-readiness-hero,.s360-settings-hero,.s360-system-hero,.s360-grouped-admin__notice-slot,.s360-grouped-admin__top-surfaces,.s360-ui-header-utility-grid,.s360-admin-dashboard__top-surfaces,.s360-ui-tabs__nav,.s360-ui-main-tabs,.s360-grouped-admin__main-tabs,.s360-page-shell__body,.s360-ui-shell,.s360-grouped-admin__content,.s360-admin-dashboard__workspace,.s360-calendar-workspace,.s360-hr-shell,.s360-ui-card,.s360-ui-section-card,.s360-ui-dashboard-panel):not(:first-child){
    margin-block-start:var(--s360-body-shell-stack-gap,14px);
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper > :where(.s360-page-shell__body,.s360-ui-shell,.s360-grouped-admin__content,.s360-admin-dashboard__workspace,.s360-calendar-workspace,.s360-hr-shell,.s360-hr-main){
    margin-block-end:0;
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(.s360-ui-shell,.s360-page-shell__body,.s360-grouped-admin__content,.s360-admin-dashboard__workspace,.s360-calendar-workspace,.s360-hr-shell,.s360-hr-main){
    box-sizing:border-box;
    width:100%;
    max-width:100%;
    min-width:0;
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(.s360-ui-shell,.s360-page-shell__body,.s360-grouped-admin__content,.s360-admin-dashboard__workspace,.s360-calendar-workspace,.s360-hr-shell,.s360-hr-main) > :where(.wrap,.s360-wrap,.school360-wrap,.s360-page-shell,.s360-ui-shell,.s360-ui-card,.s360-ui-section-card,.s360-ui-dashboard-panel,.s360-ui-grid,.s360-grid,.s360-table-responsive,.s360-table-scroll,.s360-overflow-x-auto){
    box-sizing:border-box;
    max-width:100%;
    min-width:0;
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(.s360-ui-shell,.s360-page-shell__body,.s360-grouped-admin__content,.s360-admin-dashboard__workspace,.s360-calendar-workspace,.s360-hr-shell,.s360-hr-main) > :where(.wrap,.s360-wrap,.school360-wrap):not(.s360-admin-wrapper){
    margin-inline-start:0;
    margin-inline-end:0;
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(table.widefat,.wp-list-table,.s360-ui-table,.s360-data-table,.s360-table,.s360-ui-grid,.s360-grid,.s360-form-grid,.s360-ui-form-grid,.s360-ui-card,.s360-ui-section-card,.s360-ui-dashboard-panel){
    max-width:100%;
    min-width:0;
}
@media (min-width:1500px){
    body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper{
        margin-inline-end:auto;
    }
}
@media (max-width:782px){
    body.wp-admin{
        --s360-body-shell-gutter-start:var(--s360-body-shell-mobile-gutter,12px);
        --s360-body-shell-gutter-end:var(--s360-body-shell-mobile-gutter,12px);
        --s360-body-shell-top-offset:12px;
        --s360-body-shell-stack-gap:12px;
    }
    body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper{
        max-width:calc(100% - var(--s360-body-shell-gutter-start,12px) - var(--s360-body-shell-gutter-end,12px));
        max-inline-size:calc(100% - var(--s360-body-shell-gutter-start,12px) - var(--s360-body-shell-gutter-end,12px));
        margin-inline-start:var(--s360-body-shell-gutter-start,12px);
        margin-inline-end:var(--s360-body-shell-gutter-end,12px);
    }
    body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper > :where(.s360-ui-tabs__nav,.s360-ui-main-tabs,.s360-grouped-admin__main-tabs,.s360-page-shell__body,.s360-ui-shell,.s360-grouped-admin__content,.s360-admin-dashboard__workspace,.s360-calendar-workspace,.s360-hr-shell){
        max-width:100%;
        overflow-wrap:anywhere;
    }
}

/* v13.6.30 UI/IX Unified Blocks / Sections / Cards Phase 3: CSS consolidation.
 * Scope: CSS-only final layer for the canonical card/block/section contract
 * documented in docs/UIIX_UNIFIED_BLOCKS_SECTIONS_CARDS_STANDARD_V13_6.md.
 * This layer strengthens shared card rhythm, header/body/footer structure,
 * stat/action card overflow safety, and table/grid containment without changing
 * PHP routes, JavaScript hooks, permissions, nonces, REST/AJAX/admin-post
 * handlers, form actions, SQL, database schema or business workflows.
 */
:root{
    --s360-cards-consolidated-stack-gap:var(--s360-component-card-stack-gap,var(--s360-space-md,16px));
    --s360-cards-consolidated-header-gap:var(--s360-space-sm,12px);
    --s360-cards-consolidated-title-size:var(--s360-font-size-lg,18px);
    --s360-cards-consolidated-subtitle-size:var(--s360-font-size-sm,13px);
    --s360-cards-consolidated-footer-gap:var(--s360-component-toolbar-gap,var(--s360-space-sm,12px));
}
:where(.s360-ui-card,.s360-ui-section-card,.s360-ui-dashboard-panel,.s360-ui-stat-card,.s360-admin-dashboard__utility-card,.s360-ui-action-card){
    box-sizing:border-box;
    max-width:100%;
    min-width:0;
    overflow-wrap:anywhere;
}
:where(.s360-ui-card,.s360-ui-section-card,.s360-ui-dashboard-panel) > :where(.s360-ui-card__header,.s360-ui-section-card__header,.s360-ui-dashboard-panel__header){
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:var(--s360-cards-consolidated-header-gap,12px);
    min-width:0;
    margin:0;
}
:where(.s360-ui-card,.s360-ui-section-card,.s360-ui-dashboard-panel) > :where(.s360-ui-card__header,.s360-ui-section-card__header,.s360-ui-dashboard-panel__header) > :where(.s360-ui-card__heading,.s360-ui-section-card__heading,.s360-ui-dashboard-panel__heading){
    min-width:0;
}
:where(.s360-ui-card__title,.s360-ui-section-card__title,.s360-ui-dashboard-panel__title){
    margin:0;
    color:var(--s360-color-text-heading,#111827);
    font-size:var(--s360-cards-consolidated-title-size,18px);
    font-weight:var(--s360-font-weight-bold,700);
    line-height:1.3;
}
:where(.s360-ui-card__subtitle,.s360-ui-section-card__subtitle,.s360-ui-dashboard-panel__subtitle){
    margin:.25rem 0 0;
    color:var(--s360-color-text-tertiary,#64748b);
    font-size:var(--s360-cards-consolidated-subtitle-size,13px);
    line-height:1.55;
}
:where(.s360-ui-card,.s360-ui-section-card,.s360-ui-dashboard-panel) > :where(.s360-ui-card__body,.s360-ui-section-card__body,.s360-ui-dashboard-panel__body){
    min-width:0;
    margin:0;
}
:where(.s360-ui-card,.s360-ui-section-card,.s360-ui-dashboard-panel) > :where(.s360-ui-card__header,.s360-ui-section-card__header,.s360-ui-dashboard-panel__header) + :where(.s360-ui-card__body,.s360-ui-section-card__body,.s360-ui-dashboard-panel__body),
:where(.s360-ui-card,.s360-ui-section-card,.s360-ui-dashboard-panel) > :where(.s360-ui-card__body,.s360-ui-section-card__body,.s360-ui-dashboard-panel__body) + :where(.s360-ui-card__footer,.s360-ui-section-card__footer,.s360-ui-dashboard-panel__footer){
    margin-block-start:var(--s360-cards-consolidated-stack-gap,16px);
}
:where(.s360-ui-card,.s360-ui-section-card,.s360-ui-dashboard-panel) > :where(.s360-ui-card__footer,.s360-ui-section-card__footer,.s360-ui-dashboard-panel__footer){
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    justify-content:flex-end;
    gap:var(--s360-cards-consolidated-footer-gap,12px);
    min-width:0;
    margin-block-end:0;
}
:where(.s360-ui-card,.s360-ui-section-card,.s360-ui-dashboard-panel) > :where(h1,h2,h3,h4,p,ul,ol,dl,table,form,.s360-ui-grid,.s360-grid):first-child{
    margin-block-start:0;
}
:where(.s360-ui-card,.s360-ui-section-card,.s360-ui-dashboard-panel) > :where(h1,h2,h3,h4,p,ul,ol,dl,table,form,.s360-ui-grid,.s360-grid):last-child{
    margin-block-end:0;
}
:where(.s360-ui-card,.s360-ui-section-card,.s360-ui-dashboard-panel) :where(.widefat,.wp-list-table,table,.s360-ui-table,.s360-data-table,.s360-table,.s360-table-scroll,.s360-table-responsive,.s360-ui-grid,.s360-grid,.s360-form-grid,.s360-ui-form-grid){
    max-width:100%;
    min-width:0;
}
:where(.s360-ui-stat-card) > :where(.s360-ui-stat-card__value,.s360-ui-stat-card__label,.s360-ui-stat-card__meta,.s360-ui-stat-card__helper,.s360-ui-stat-card__delta,.s360-ui-stat-card__footer,.s360-ui-stat-card__action){
    min-width:0;
}
:where(.s360-ui-stat-card__label,.s360-ui-stat-card__meta,.s360-ui-stat-card__helper){
    overflow-wrap:anywhere;
}
:where(.s360-admin-dashboard__utility-card) > *,
:where(.s360-ui-action-card) > *{
    min-width:0;
}
:where(.s360-ui-action-card__actions){
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:var(--s360-cards-consolidated-footer-gap,12px);
    min-width:0;
}
:where(.s360-ui-action-card[href],button.s360-ui-action-card,[role="button"].s360-ui-action-card,.s360-admin-dashboard__utility-card[href],button.s360-admin-dashboard__utility-card,[role="button"].s360-admin-dashboard__utility-card){
    cursor:pointer;
}
:where(.s360-ui-action-card[href],button.s360-ui-action-card,[role="button"].s360-ui-action-card,.s360-admin-dashboard__utility-card[href],button.s360-admin-dashboard__utility-card,[role="button"].s360-admin-dashboard__utility-card):focus-visible{
    outline:2px solid var(--s360-color-primary,#2271b1);
    outline-offset:2px;
}
@media (max-width:782px){
    :where(.s360-ui-card,.s360-ui-section-card,.s360-ui-dashboard-panel) > :where(.s360-ui-card__header,.s360-ui-section-card__header,.s360-ui-dashboard-panel__header),
    :where(.s360-ui-card,.s360-ui-section-card,.s360-ui-dashboard-panel) > :where(.s360-ui-card__footer,.s360-ui-section-card__footer,.s360-ui-dashboard-panel__footer){
        flex-direction:column;
        align-items:stretch;
    }
}

/* v13.6.30 UI/IX Unified Spacing Phase 3: Admin compact density alignment.
 * Scope: CSS-only admin density layer for School 360 admin pages/modules.
 * Goal: make non-dashboard admin modules use the same compact visual rhythm as
 * the dashboard: tighter card padding, grid gaps, stat/action spacing and shell
 * stack spacing. Public/portal pages, PHP renderers, JS hooks, permissions,
 * nonce, REST/AJAX, database and business workflows remain unchanged.
 */
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper{
    --s360-admin-compact-density-panel-padding-y:var(--s360-component-card-padding-tight, 14px);
    --s360-admin-compact-density-panel-padding-x:var(--s360-component-card-padding-compact, 16px);
    --s360-admin-compact-density-mobile-panel-padding-y:var(--s360-space-sm, 12px);
    --s360-admin-compact-density-mobile-panel-padding-x:var(--s360-space-sm, 12px);
    --s360-admin-compact-density-shell-stack-gap:10px;
    --s360-admin-compact-density-mobile-shell-stack-gap:var(--s360-space-xs, 8px);
    --s360-admin-compact-density-card-stack-gap:10px;
    --s360-admin-compact-density-header-gap:var(--s360-space-xs, 8px);
    --s360-admin-compact-density-footer-gap:var(--s360-space-xs, 8px);
    --s360-admin-compact-density-grid-gap:10px;
    --s360-admin-compact-density-grid-gap-lg:var(--s360-space-sm, 12px);
    --s360-admin-compact-density-stat-padding-y:14px;
    --s360-admin-compact-density-stat-padding-x:16px;
    --s360-admin-compact-density-stat-gap:var(--s360-statcard-gap, 8px);
    --s360-admin-compact-density-action-padding-y:10px;
    --s360-admin-compact-density-action-padding-x:var(--s360-space-sm, 12px);
    --s360-admin-compact-density-action-gap:var(--s360-space-2xs, 4px);
    --s360-page-shell-stack-gap:var(--s360-admin-compact-density-shell-stack-gap, 10px);
    --s360-body-shell-stack-gap:var(--s360-admin-compact-density-shell-stack-gap, 10px);
    --s360-layout-grid-gap:var(--s360-admin-compact-density-grid-gap, 10px);
    --s360-layout-grid-gap-lg:var(--s360-admin-compact-density-grid-gap-lg, 12px);
    --s360-card-core-padding:var(--s360-admin-compact-density-panel-padding-y, 14px) var(--s360-admin-compact-density-panel-padding-x, 16px);
    --s360-ui-section-card-padding:var(--s360-admin-compact-density-panel-padding-y, 14px) var(--s360-admin-compact-density-panel-padding-x, 16px);
    --s360-card-stat-padding:var(--s360-statcard-padding, 14px 16px);
    --s360-card-stat-gap:var(--s360-statcard-gap, 8px);
    --s360-card-action-padding:var(--s360-admin-compact-density-action-padding-y, 10px) var(--s360-admin-compact-density-action-padding-x, 12px);
    --s360-card-action-gap:var(--s360-admin-compact-density-action-gap, 4px);
    --s360-card-utility-padding-y:var(--s360-admin-compact-density-panel-padding-y, 14px);
    --s360-card-utility-padding-x:var(--s360-admin-compact-density-panel-padding-x, 16px);
    --s360-card-utility-gap:var(--s360-space-sm, 12px);
    --s360-cards-consolidated-stack-gap:var(--s360-admin-compact-density-card-stack-gap, 10px);
    --s360-cards-consolidated-header-gap:var(--s360-admin-compact-density-header-gap, 8px);
    --s360-cards-consolidated-footer-gap:var(--s360-admin-compact-density-footer-gap, 8px);
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(.s360-ui-card,.s360-ui-section-card,.s360-ui-dashboard-panel):not(.s360-ui-stat-card):not(.s360-ui-action-card):not(.s360-admin-dashboard__utility-card){
    padding:var(--s360-admin-compact-density-panel-padding-y, 14px) var(--s360-admin-compact-density-panel-padding-x, 16px);
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(.s360-ui-stat-card){
    gap:var(--s360-card-stat-gap,var(--s360-statcard-gap,8px));
    padding:var(--s360-card-stat-padding,var(--s360-statcard-padding,14px 16px));
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(.s360-ui-action-card,.s360-admin-shortcut.s360-ui-dashboard-shortcut){
    gap:var(--s360-admin-compact-density-action-gap, 4px);
    padding:var(--s360-admin-compact-density-action-padding-y, 10px) var(--s360-admin-compact-density-action-padding-x, 12px);
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(.s360-admin-dashboard__utility-card){
    gap:var(--s360-card-utility-gap, 12px);
    padding:var(--s360-card-utility-padding-y, 14px) var(--s360-card-utility-padding-x, 16px);
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(.s360-ui-grid,.s360-grid,.s360-dashboard-grid,.s360-stat-grid,.s360-kpi-grid,.s360-card-grid,.s360-section-grid,.s360-settings-grid,.s360-hr-grid,.s360-finance-grid,.s360-expense-grid,.s360-report-grid,.s360-admissions-grid,.s360-admin-kpi-grid,.s360-admin-kpi-grid--compact,.s360-admin-attention-grid,.s360-admin-shortcuts,.s360-ui-dashboard-shortcuts,.s360-admin-today-subpanels){
    gap:var(--s360-admin-compact-density-grid-gap, 10px);
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(.s360-ui-card,.s360-ui-section-card,.s360-ui-dashboard-panel) > :where(.s360-ui-card__header,.s360-ui-section-card__header,.s360-ui-dashboard-panel__header) + :where(.s360-ui-card__body,.s360-ui-section-card__body,.s360-ui-dashboard-panel__body),
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(.s360-ui-card,.s360-ui-section-card,.s360-ui-dashboard-panel) > :where(.s360-ui-card__body,.s360-ui-section-card__body,.s360-ui-dashboard-panel__body) + :where(.s360-ui-card__footer,.s360-ui-section-card__footer,.s360-ui-dashboard-panel__footer){
    margin-block-start:var(--s360-admin-compact-density-card-stack-gap, 10px);
}
@media (max-width:782px){
    body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper{
        --s360-admin-compact-density-panel-padding-y:var(--s360-admin-compact-density-mobile-panel-padding-y, 12px);
        --s360-admin-compact-density-panel-padding-x:var(--s360-admin-compact-density-mobile-panel-padding-x, 12px);
        --s360-admin-compact-density-shell-stack-gap:var(--s360-admin-compact-density-mobile-shell-stack-gap, 8px);
        --s360-admin-compact-density-card-stack-gap:var(--s360-space-xs, 8px);
        --s360-admin-compact-density-header-gap:var(--s360-space-xs, 8px);
        --s360-admin-compact-density-footer-gap:var(--s360-space-xs, 8px);
        --s360-admin-compact-density-grid-gap:var(--s360-space-xs, 8px);
        --s360-admin-compact-density-grid-gap-lg:10px;
        --s360-admin-compact-density-stat-padding-y:10px;
        --s360-admin-compact-density-stat-padding-x:var(--s360-space-sm, 12px);
        --s360-admin-compact-density-action-padding-y:10px;
        --s360-admin-compact-density-action-padding-x:var(--s360-space-sm, 12px);
    }
}

/* v13.6.30 UI/IX Unified Spacing Phase 4: compact density coverage audit + fix.
 * Scope: CSS-only admin coverage layer for School 360 admin pages/modules.
 * Goal: extend dashboard-like compact spacing to module-specific/legacy phase
 * wrappers and surfaces that do not fully inherit the Phase 3 canonical card
 * density variables. Public/portal pages, print views, PHP renderers, JS hooks,
 * permissions, nonce, REST/AJAX, database and business workflows remain unchanged.
 */
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper{
    --s360-admin-compact-density-page-bottom-padding:var(--s360-component-card-padding-compact, 16px);
    --s360-admin-compact-density-large-token:var(--s360-space-sm, 12px);
    --s360-admin-compact-density-xl-token:var(--s360-component-card-padding-compact, 16px);
    --s360-admin-compact-density-2xl-token:24px;
    --s360-space-lg:var(--s360-admin-compact-density-large-token, 12px);
    --s360-space-xl:var(--s360-admin-compact-density-xl-token, 16px);
    --s360-space-2xl:var(--s360-admin-compact-density-2xl-token, 24px);
    --sui-spacing-school-lg:var(--s360-admin-compact-density-large-token, 12px);
    --sui-spacing-school-xl:var(--s360-admin-compact-density-xl-token, 16px);
    --sui-spacing-school-2xl:var(--s360-admin-compact-density-2xl-token, 24px);
    --s360-layout-page-gap:var(--s360-admin-compact-density-grid-gap-lg, 12px);
    --s360-layout-grid-gap-lg:var(--s360-admin-compact-density-grid-gap-lg, 12px);
    --s360-layout-sidebar-gap:var(--s360-admin-compact-density-grid-gap-lg, 12px);
    --s360-module-stack-gap:var(--s360-admin-compact-density-grid-gap, 10px);
    --s360-module-section-gap:var(--s360-admin-compact-density-grid-gap, 10px);
    --s360-dashboard-workspace-gap:var(--s360-admin-compact-density-grid-gap, 10px);
    --s360-admissions-workspace-gap:var(--s360-admin-compact-density-grid-gap, 10px);
    --s360-secondary-page-gap:var(--s360-admin-compact-density-grid-gap, 10px);
    --s360-profile-header-gap:var(--s360-admin-compact-density-grid-gap, 10px);
    --s360-profile-section-gap:var(--s360-admin-compact-density-grid-gap, 10px);
    --s360-profile-tabs-padding:var(--s360-admin-compact-density-panel-padding-y, 14px) var(--s360-admin-compact-density-panel-padding-x, 16px);
    --s360-component-filter-padding:var(--s360-admin-compact-density-panel-padding-y, 14px) var(--s360-admin-compact-density-panel-padding-x, 16px);
    --s360-component-empty-state-padding:var(--s360-admin-compact-density-panel-padding-y, 14px) var(--s360-admin-compact-density-panel-padding-x, 16px);
    --s360-component-modal-body-padding:var(--s360-admin-compact-density-grid-gap-lg, 12px) var(--s360-admin-compact-density-panel-padding-x, 16px);
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper:is(
    .s360-settings-phase-e,
    .s360-reports-phase-f,
    .s360-analytics-phase-f,
    .s360-reports-v2-phase-f,
    .s360-admissions-phase-g,
    .s360-custom-fields-phase-g,
    .s360-finance-phase-h,
    .s360-treasury-phase-h,
    .s360-expense-phase-h,
    .s360-billing-phase-h,
    .s360-accounting-phase-h,
    .s360-hr-phase-i,
    .school360-students-phase-k,
    .s360-calendar-phase-k,
    .s360-communication-phase-l,
    .s360-content-assets-phase-l,
    .s360-own-access-phase-m,
    .s360-teacher-workbench-phase-m,
    .s360-compliance-phase-m,
    .s360-data-center-phase-m,
    .s360-schools-phase-m,
    .s360-external-ecosystem-phase-m
){
    padding-bottom:var(--s360-admin-compact-density-page-bottom-padding, 16px);
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-page-hero,
    .s360-ui-page-header,
    .s360-admissions-page-header,
    .s360-admissions-detail-header,
    .s360-admin-student-page-header,
    .s360-reports-hero,
    .s360-analytics-hero,
    .s360-hr-header,
    .s360-hr-profile-hero,
    .s360-hr-overview-hero,
    .s360-communication-center-shortcode
){
    gap:var(--s360-admin-compact-density-grid-gap, 10px);
    margin-block-end:var(--s360-admin-compact-density-grid-gap, 10px);
    padding:var(--s360-admin-compact-density-panel-padding-y, 14px) var(--s360-admin-compact-density-panel-padding-x, 16px);
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-system-panel,
    .s360-school-panel,
    .s360-ui-admin-panel,
    .s360-builder-panel,
    .s360-custom-fields-builder,
    .s360-custom-fields-hero,
    .s360-library-insight-panel,
    .s360-layout-board,
    .s360-template-preview,
    .s360-report-kpi-panel,
    .s360-report-insight-panel,
    .s360-report-empty-state,
    .s360-analytics-kpi,
    .s360-analytics-chart-panel,
    .s360-analytics-risk-summary,
    .s360-finance-section-title,
    .s360-expense-status-center,
    .s360-ui-card--expense-detail,
    .s360-hr-quick-dock,
    .s360-hr-side-panel__surface,
    .s360-hr-panel,
    .s360-hr-card,
    .s360-calendar-statistics-section,
    .s360-calendar-filter-section,
    .s360-calendar-browser,
    .s360-filter-panel,
    .s360-ui-filter-shell,
    .s360-report-filter-panel,
    .s360-analytics-filter-panel,
    .s360-finance-ledger-filters,
    .s360-calendar-filter-form,
    .s360-report-filter-form,
    .s360-expense-report-filter-form
){
    padding:var(--s360-admin-compact-density-panel-padding-y, 14px) var(--s360-admin-compact-density-panel-padding-x, 16px);
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-filter-bar,
    .s360-field-toolbar,
    .s360-cf-library-toolbar,
    .s360-template-toolbar,
    .s360-layout-board-toolbar,
    .s360-layout-board-toolbar-secondary,
    .s360-library-selection-bar,
    .s360-finance-toolbar,
    .s360-report-toolbar,
    .s360-hr-toolbar,
    .s360-calendar-toolbar,
    .s360-action-toolbar
){
    gap:var(--s360-admin-compact-density-grid-gap, 10px);
    margin-block-end:var(--s360-admin-compact-density-grid-gap, 10px);
    padding:var(--s360-admin-compact-density-mobile-panel-padding-y, 12px) var(--s360-admin-compact-density-panel-padding-x, 16px);
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-grid,
    .s360-grid,
    .s360-two-col,
    .s360-summary-grid,
    .s360-flag-grid,
    .s360-form-grid,
    .s360-form-grid-2,
    .s360-custom-fields-layout,
    .s360-admissions-actions-layout,
    .s360-report-kpi-grid,
    .s360-report-exec-grid,
    .s360-report-insight-grid,
    .s360-analytics-kpis,
    .s360-analytics-quality-grid,
    .s360-analytics-risk-summary,
    .s360-analytics-chart-grid,
    .s360-finance-kpi-grid,
    .s360-finance-grid,
    .s360-expense-grid,
    .s360-approval-command-grid,
    .s360-audit-command-grid,
    .s360-masterdata-grid,
    .s360-settings-qa-grid,
    .s360-admissions-builder-grid,
    .s360-hr-command-grid,
    .s360-hr-profile-grid,
    .s360-hr-kpi-grid,
    .s360-hr-grid,
    .s360-calendar-stats-grid,
    .s360-detail-grid,
    .s360-admin-attention-grid,
    .s360-admin-today-subpanels
){
    gap:var(--s360-admin-compact-density-grid-gap, 10px);
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-tailwind-foundation .nav-tab-wrapper,
    .s360-tailwind-foundation .s360-ui-tabs,
    .s360-school-tabs,
    .s360-system-tabs,
    .s360-finance-tabs,
    .s360-expense-workspace-tabs,
    .s360-student-workspace__tabs,
    .s360-calendar-action-tabs,
    .s360-hr-nav,
    .s360-people-subnav
){
    margin:var(--s360-admin-compact-density-grid-gap, 10px) 0 var(--s360-admin-compact-density-grid-gap, 10px);
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-module-stack,
    .s360-ui-module-section,
    .s360-finance-tab-panel,
    .s360-custom-fields-workspace,
    .s360-hr-main,
    .s360-calendar-workspace,
    .s360-communication-center,
    .s360-content-assets-phase-l
) > * + *{
    margin-block-start:var(--s360-admin-compact-density-grid-gap, 10px);
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(.postbox .inside):not(.s360-unstyled-panel){
    padding:var(--s360-admin-compact-density-panel-padding-y, 14px) var(--s360-admin-compact-density-panel-padding-x, 16px);
}
@media (max-width:782px){
    body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
        .s360-page-hero,
        .s360-ui-page-header,
        .s360-admissions-page-header,
        .s360-admissions-detail-header,
        .s360-admin-student-page-header,
        .s360-reports-hero,
        .s360-analytics-hero,
        .s360-hr-header,
        .s360-hr-profile-hero,
        .s360-hr-overview-hero,
        .s360-communication-center-shortcode,
        .s360-system-panel,
        .s360-school-panel,
        .s360-ui-admin-panel,
        .s360-builder-panel,
        .s360-custom-fields-builder,
        .s360-custom-fields-hero,
        .s360-library-insight-panel,
        .s360-layout-board,
        .s360-template-preview,
        .s360-report-kpi-panel,
        .s360-report-insight-panel,
        .s360-report-empty-state,
        .s360-analytics-kpi,
        .s360-analytics-chart-panel,
        .s360-finance-section-title,
        .s360-expense-status-center,
        .s360-hr-quick-dock,
        .s360-hr-side-panel__surface,
        .s360-hr-panel,
        .s360-hr-card,
        .s360-calendar-statistics-section,
        .s360-calendar-filter-section,
        .s360-calendar-browser,
        .s360-filter-panel,
        .s360-ui-filter-shell,
        .s360-report-filter-panel,
        .s360-analytics-filter-panel,
        .s360-finance-ledger-filters
    ){
        padding:var(--s360-admin-compact-density-mobile-panel-padding-y, 12px) var(--s360-admin-compact-density-mobile-panel-padding-x, 12px);
    }
}

/* v13.6.30 UIIX Unified Spacing Phase 5: targeted module density overrides.
 * Scope: admin-only spacing coverage for HR, Content & Assets, Finance
 * navigation surfaces, Admissions, Communication, Students and Academic.
 * Intent: make remaining module-specific wrappers follow the same compact
 * dashboard-like rhythm without PHP/JS/DB/workflow changes and without
 * using priority overrides.
 */
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper:is(
    .s360-hr-phase-i,
    .s360-content-assets-phase-l,
    .s360-finance-phase-h,
    .s360-admissions-phase-g,
    .s360-communication-phase-l,
    .school360-students-phase-k
){
    --s360-target-density-gap:var(--s360-admin-compact-density-grid-gap, 10px);
    --s360-target-density-gap-sm:var(--s360-admin-compact-density-mobile-grid-gap, 8px);
    --s360-target-density-panel-padding:var(--s360-admin-compact-density-panel-padding-y, 14px) var(--s360-admin-compact-density-panel-padding-x, 16px);
    --s360-target-density-mobile-panel-padding:var(--s360-admin-compact-density-mobile-panel-padding-y, 12px) var(--s360-admin-compact-density-mobile-panel-padding-x, 12px);
    --s360-target-density-stat-padding:var(--s360-admin-compact-density-stat-padding-y, 12px) var(--s360-admin-compact-density-stat-padding-x, 14px);
    --s360-target-density-action-padding:var(--s360-admin-compact-density-action-padding-y, 10px) var(--s360-admin-compact-density-action-padding-x, 12px);
    --s360-hr-panel-gap:var(--s360-target-density-gap);
    --s360-hr-card-padding:var(--s360-target-density-panel-padding);
    --s360-content-assets-gap:var(--s360-target-density-gap);
    --s360-communication-card-gap:var(--s360-target-density-gap);
    --s360-students-card-gap:var(--s360-target-density-gap);
    --s360-admissions-card-gap:var(--s360-target-density-gap);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper:is(
    .s360-hr-phase-i,
    .s360-content-assets-phase-l,
    .s360-finance-phase-h,
    .s360-admissions-phase-g,
    .s360-communication-phase-l,
    .school360-students-phase-k
) > :is(
    .s360-grouped-admin__hero,
    .s360-ui-page-header,
    .s360-page-hero,
    .s360-grouped-admin__main-tabs,
    .s360-ui-main-tabs,
    .s360-grouped-admin__content,
    .s360-ui-shell,
    .s360-page-shell__body,
    .s360-hr-shell
):not(:first-child){
    margin-block-start:var(--s360-target-density-gap);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper:is(
    .s360-hr-phase-i,
    .s360-content-assets-phase-l,
    .s360-finance-phase-h,
    .s360-admissions-phase-g,
    .s360-communication-phase-l,
    .school360-students-phase-k
) :is(
    .s360-grouped-admin__content,
    .s360-ui-shell,
    .s360-page-shell__body,
    .s360-hr-shell,
    .s360-hr-main,
    .s360-student-workspace,
    .s360-student-ops-workspace,
    .s360-content-assets-phase-l,
    .s360-communication-center,
    .s360-admissions-workspace,
    .s360-finance-page,
    .s360-finance-tab-panel
) > :is(
    .s360-ui-card,
    .s360-ui-section-card,
    .s360-ui-dashboard-panel,
    .s360-page-hero,
    .s360-ui-page-header,
    .s360-students-subnav,
    .s360-student-ops-command-bar,
    .s360-student-panel,
    .s360-student-panels,
    .s360-admissions-section,
    .s360-admissions-queue-panel,
    .s360-admissions-command-panel,
    .s360-admissions-status-grid,
    .s360-admissions-section-grid,
    .s360-communication-form-card,
    .s360-communication-send-card,
    .s360-communication-workflow-card,
    .s360-communication-overview-shortcuts-panel,
    .s360-gd-form-panel,
    .s360-gd-list-shell,
    .s360-gd-layout,
    .s360-gd-filters-grid,
    .s360-document-panel-head,
    .s360-hr-panel,
    .s360-hr-card,
    .s360-hr-quick-dock,
    .s360-hr-side-panel__surface,
    .s360-ui-section-card--hr-navigation,
    .s360-finance-tabs,
    .s360-finance-section-title,
    .s360-finance-kpi-grid,
    .s360-finance-grid,
    .s360-finance-analytics-panel
):not(:first-child){
    margin-block-start:var(--s360-target-density-gap);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper:is(
    .s360-hr-phase-i,
    .s360-content-assets-phase-l,
    .s360-finance-phase-h,
    .s360-admissions-phase-g,
    .s360-communication-phase-l,
    .school360-students-phase-k
) :is(
    .s360-grouped-admin__hero.s360-ui-page-header,
    .s360-page-hero,
    .s360-ui-page-header,
    .s360-admissions-page-header,
    .s360-admissions-detail-header,
    .s360-admin-student-page-header,
    .s360-hr-header,
    .s360-hr-profile-hero,
    .s360-hr-overview-hero,
    .s360-content-assets-hero,
    .s360-communication-center-shortcode
){
    gap:var(--s360-target-density-gap);
    margin-block-end:var(--s360-target-density-gap);
    padding:var(--s360-target-density-panel-padding);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper:is(
    .s360-hr-phase-i,
    .s360-content-assets-phase-l,
    .s360-finance-phase-h,
    .s360-admissions-phase-g,
    .s360-communication-phase-l,
    .school360-students-phase-k
) :is(
    .s360-ui-main-tabs,
    .s360-grouped-admin__main-tabs,
    .s360-finance-tabs,
    .s360-expense-workspace-tabs,
    .s360-hr-nav,
    .s360-students-subnav,
    .s360-student-ops-subtabs,
    .s360-communication-subnav,
    .s360-people-subnav
){
    gap:var(--s360-target-density-gap-sm);
    margin:var(--s360-target-density-gap) 0;
    padding:var(--s360-target-density-gap-sm);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper:is(
    .s360-hr-phase-i,
    .s360-content-assets-phase-l,
    .s360-finance-phase-h,
    .s360-admissions-phase-g,
    .s360-communication-phase-l,
    .school360-students-phase-k
) :is(
    .s360-ui-main-tabs,
    .s360-grouped-admin__main-tabs,
    .s360-finance-tabs,
    .s360-expense-workspace-tabs,
    .s360-hr-nav,
    .s360-students-subnav,
    .s360-student-ops-subtabs,
    .s360-communication-subnav,
    .s360-people-subnav
) > :is(a,button,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab,.s360-finance-tab-link,.s360-hr-nav-item){
    min-height:32px;
    padding:6px 10px;
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper:is(
    .s360-hr-phase-i,
    .s360-content-assets-phase-l,
    .s360-finance-phase-h,
    .s360-admissions-phase-g,
    .s360-communication-phase-l,
    .school360-students-phase-k
) :is(
    .s360-ui-card,
    .s360-ui-section-card,
    .s360-ui-dashboard-panel,
    .s360-system-panel,
    .s360-school-panel,
    .s360-ui-admin-panel,
    .s360-builder-panel,
    .s360-custom-fields-builder,
    .s360-finance-section-title,
    .s360-finance-analytics-panel,
    .s360-finance-tab-panel,
    .s360-admissions-section,
    .s360-admissions-queue-panel,
    .s360-admissions-command-panel,
    .s360-communication-form-card,
    .s360-communication-send-card,
    .s360-communication-workflow-card,
    .s360-communication-overview-shortcuts-panel,
    .s360-gd-form-panel,
    .s360-gd-list-shell,
    .s360-document-panel-head,
    .s360-hr-panel,
    .s360-hr-card,
    .s360-hr-quick-dock,
    .s360-hr-side-panel__surface,
    .s360-student-panel,
    .s360-student-ops-command-bar
):not(.s360-density-comfortable):not(.s360-spacing-legacy){
    padding:var(--s360-target-density-panel-padding);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper:is(
    .s360-hr-phase-i,
    .s360-content-assets-phase-l,
    .s360-finance-phase-h,
    .s360-admissions-phase-g,
    .s360-communication-phase-l,
    .school360-students-phase-k
) :is(
    .s360-ui-stat-card,
    .s360-admin-dashboard__utility-card,
    .s360-finance-kpi-grid .s360-ui-card,
    .s360-finance-kpi-grid .s360-ui-stat-card,
    .s360-student-ops-kpi,
    .s360-admissions-status-grid .s360-ui-card,
    .s360-hr-kpi-grid .s360-ui-card,
    .s360-hr-kpi-grid .s360-ui-stat-card
):not(.s360-density-comfortable):not(.s360-spacing-legacy){
    padding:var(--s360-target-density-stat-padding);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper:is(
    .s360-hr-phase-i,
    .s360-content-assets-phase-l,
    .s360-finance-phase-h,
    .s360-admissions-phase-g,
    .s360-communication-phase-l,
    .school360-students-phase-k
) :is(
    .s360-ui-action-card,
    .s360-ui-action-card--finance,
    .s360-ui-action-card--hr-command,
    .s360-ui-action-card--hr-workflow,
    .s360-communication-overview-shortcuts-panel .s360-ui-action-card,
    .s360-admissions-command-panel .s360-ui-action-card,
    .s360-student-ops-command-bar .s360-ui-action-card
):not(.s360-density-comfortable):not(.s360-spacing-legacy){
    gap:var(--s360-target-density-gap-sm);
    padding:var(--s360-target-density-action-padding);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper:is(
    .s360-hr-phase-i,
    .s360-content-assets-phase-l,
    .s360-finance-phase-h,
    .s360-admissions-phase-g,
    .s360-communication-phase-l,
    .school360-students-phase-k
) :is(
    .s360-ui-grid,
    .s360-grid,
    .s360-kpi-grid,
    .s360-card-grid,
    .s360-section-grid,
    .s360-finance-kpi-grid,
    .s360-finance-grid,
    .s360-admissions-status-grid,
    .s360-admissions-section-grid,
    .s360-communication-grid,
    .s360-gd-layout,
    .s360-gd-filters-grid,
    .s360-hr-grid,
    .s360-hr-kpi-grid,
    .s360-student-panels,
    .s360-student-ops-kpi-grid
){
    gap:var(--s360-target-density-gap);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper:is(
    .s360-hr-phase-i,
    .s360-content-assets-phase-l,
    .s360-finance-phase-h,
    .s360-admissions-phase-g,
    .s360-communication-phase-l,
    .school360-students-phase-k
) :is(.s360-mt-lg,.s360-mt-md){
    margin-top:var(--s360-target-density-gap);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper:is(
    .s360-hr-phase-i,
    .s360-content-assets-phase-l,
    .s360-finance-phase-h,
    .s360-admissions-phase-g,
    .s360-communication-phase-l,
    .school360-students-phase-k
) :is(h1,h2,h3,p):first-child{
    margin-block-start:0;
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper:is(
    .s360-hr-phase-i,
    .s360-content-assets-phase-l,
    .s360-finance-phase-h,
    .s360-admissions-phase-g,
    .s360-communication-phase-l,
    .school360-students-phase-k
) :is(h1,h2,h3,p):last-child{
    margin-block-end:0;
}

@media (max-width:782px){
    body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper:is(
        .s360-hr-phase-i,
        .s360-content-assets-phase-l,
        .s360-finance-phase-h,
        .s360-admissions-phase-g,
        .s360-communication-phase-l,
        .school360-students-phase-k
    ) :is(
        .s360-grouped-admin__hero.s360-ui-page-header,
        .s360-page-hero,
        .s360-ui-page-header,
        .s360-admissions-page-header,
        .s360-admissions-detail-header,
        .s360-admin-student-page-header,
        .s360-hr-header,
        .s360-hr-profile-hero,
        .s360-hr-overview-hero,
        .s360-content-assets-hero,
        .s360-communication-center-shortcode,
        .s360-ui-card,
        .s360-ui-section-card,
        .s360-ui-dashboard-panel,
        .s360-finance-section-title,
        .s360-finance-analytics-panel,
        .s360-admissions-section,
        .s360-admissions-queue-panel,
        .s360-admissions-command-panel,
        .s360-communication-form-card,
        .s360-communication-send-card,
        .s360-communication-workflow-card,
        .s360-gd-form-panel,
        .s360-gd-list-shell,
        .s360-document-panel-head,
        .s360-hr-panel,
        .s360-hr-card,
        .s360-hr-quick-dock,
        .s360-hr-side-panel__surface,
        .s360-student-panel,
        .s360-student-ops-command-bar
    ):not(.s360-density-comfortable):not(.s360-spacing-legacy){
        padding:var(--s360-target-density-mobile-panel-padding);
    }
    body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper:is(
        .s360-hr-phase-i,
        .s360-content-assets-phase-l,
        .s360-finance-phase-h,
        .s360-admissions-phase-g,
        .s360-communication-phase-l,
        .school360-students-phase-k
    ) :is(
        .s360-ui-main-tabs,
        .s360-grouped-admin__main-tabs,
        .s360-finance-tabs,
        .s360-expense-workspace-tabs,
        .s360-hr-nav,
        .s360-students-subnav,
        .s360-student-ops-subtabs,
        .s360-communication-subnav,
        .s360-people-subnav
    ){
        margin:var(--s360-target-density-gap-sm) 0;
        padding:var(--s360-target-density-gap-sm);
    }
}

/* UI-IX Unified Card Surface — Phase 3: CSS Token Consolidation
 * Runtime scope: CSS-only card surface token bridge for v13.6.
 * Purpose: route canonical and remaining module-specific card surfaces through
 * shared border, shadow, radius, hover, active, focus and accent variables.
 */
:root{
    --s360-card-border-width:1px;
    --s360-card-border-style:solid;
    --s360-card-border-color:var(--s360-color-border-muted,var(--s360-color-border,#dcdcde));
    --s360-card-hover-border-color:var(--s360-color-border-accent,var(--s360-color-primary,#2271b1));
    --s360-card-radius:var(--s360-component-card-radius,var(--s360-radius-lg,10px));
    --s360-card-shadow:var(--s360-component-card-shadow,var(--s360-shadow-sm,0 1px 2px rgba(0,0,0,.04)));
    --s360-card-hover-shadow:var(--s360-dashboard-card-hover-shadow,var(--s360-shadow-floating,var(--s360-shadow-md,0 4px 12px rgba(0,0,0,.06))));
    --s360-card-active-border-color:var(--s360-color-primary,var(--s360-color-primary-strong,#2271b1));
    --s360-card-active-shadow:0 0 0 1px var(--s360-card-active-border-color,var(--s360-color-primary,#2271b1));
    --s360-card-accent-width:3px;
    --s360-card-accent-color:var(--s360-color-primary,var(--s360-color-primary-strong,#2271b1));
    --s360-card-focus-ring:var(--s360-focus-ring,0 0 0 3px rgba(59,130,246,.12));
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper{
    --s360-card-core-border-color:var(--s360-card-border-color);
    --s360-card-core-radius:var(--s360-card-radius);
    --s360-card-core-shadow:var(--s360-card-shadow);
    --s360-ui-section-card-border-color:var(--s360-card-border-color);
    --s360-ui-section-card-radius:var(--s360-card-radius);
    --s360-ui-section-card-shadow:var(--s360-card-shadow);
    --s360-dashboard-panel-border-color:var(--s360-card-border-color);
    --s360-dashboard-panel-radius:var(--s360-card-radius);
    --s360-dashboard-panel-soft-shadow:var(--s360-card-shadow);
    --s360-card-action-border-color:var(--s360-card-border-color);
    --s360-card-action-radius:var(--s360-card-radius);
    --s360-card-action-shadow:var(--s360-card-shadow);
    --s360-card-utility-border-color:var(--s360-card-border-color);
    --s360-card-utility-radius:var(--s360-card-radius);
    --s360-card-utility-shadow:var(--s360-card-shadow);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-card,
    .s360-ui-section-card,
    .s360-ui-dashboard-panel
):not(.s360-surface-legacy){
    border-width:var(--s360-card-border-width);
    border-style:var(--s360-card-border-style);
    border-color:var(--s360-card-border-color);
    border-radius:var(--s360-card-radius);
    box-shadow:var(--s360-card-shadow);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(.s360-ui-stat-card):not(.s360-surface-legacy){
    border-width:var(--s360-card-border-width);
    border-style:var(--s360-card-border-style);
    border-color:var(--s360-card-stat-border-color,var(--s360-card-border-color));
    border-radius:var(--s360-card-stat-radius,var(--s360-card-radius,var(--s360-radius-3xl,16px)));
    box-shadow:var(--s360-card-stat-shadow,var(--s360-shadow-xl,var(--s360-card-shadow)));
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(.s360-admin-dashboard__utility-card):not(.s360-surface-legacy){
    border-width:var(--s360-card-border-width);
    border-style:var(--s360-card-border-style);
    border-color:var(--s360-card-utility-border-color,var(--s360-card-border-color));
    border-radius:var(--s360-card-utility-radius,var(--s360-card-radius));
    box-shadow:var(--s360-card-utility-shadow,var(--s360-card-shadow));
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(.s360-ui-action-card,.s360-admin-shortcut.s360-ui-dashboard-shortcut):not(.s360-surface-legacy){
    border-width:var(--s360-card-border-width);
    border-style:var(--s360-card-border-style);
    border-color:var(--s360-card-action-border-color,var(--s360-card-border-color));
    border-radius:var(--s360-card-action-radius,var(--s360-card-radius));
    box-shadow:var(--s360-card-action-shadow,var(--s360-card-shadow));
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    a.s360-ui-card,
    a.s360-ui-section-card,
    a.s360-ui-stat-card,
    a.s360-ui-action-card,
    button.s360-ui-action-card,
    [role="button"].s360-ui-card,
    [role="button"].s360-ui-section-card,
    [role="button"].s360-ui-action-card,
    .s360-admin-dashboard__utility-card,
    .s360-admin-shortcut.s360-ui-dashboard-shortcut
):not(.s360-surface-legacy):hover{
    border-color:var(--s360-card-hover-border-color);
    box-shadow:var(--s360-card-hover-shadow);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    a.s360-ui-card,
    a.s360-ui-section-card,
    a.s360-ui-stat-card,
    a.s360-ui-action-card,
    button.s360-ui-action-card,
    [role="button"].s360-ui-card,
    [role="button"].s360-ui-section-card,
    [role="button"].s360-ui-action-card,
    .s360-admin-dashboard__utility-card,
    .s360-admin-shortcut.s360-ui-dashboard-shortcut
):not(.s360-surface-legacy):focus-visible{
    outline:2px solid transparent;
    box-shadow:var(--s360-card-focus-ring), var(--s360-card-hover-shadow);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-card,
    .s360-ui-section-card,
    .s360-ui-stat-card,
    .s360-ui-action-card,
    .s360-admin-dashboard__utility-card,
    .s360-ui-dashboard-panel
):where(.is-active,[aria-selected="true"],[aria-current="page"],.is-selected):not(.s360-surface-legacy){
    border-color:var(--s360-card-active-border-color);
    box-shadow:var(--s360-card-active-shadow);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-card--primary,
    .s360-ui-section-card--primary,
    .s360-ui-stat-card--primary,
    .s360-ui-action-card--primary
){
    --s360-card-border-color:var(--s360-color-border-accent,var(--s360-color-primary));
    --s360-card-accent-color:var(--s360-color-primary,var(--s360-color-primary-strong));
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-card--info,
    .s360-ui-section-card--info,
    .s360-ui-stat-card--info,
    .s360-ui-action-card--info
){
    --s360-card-border-color:var(--s360-color-border-info,var(--s360-color-border-accent));
    --s360-card-accent-color:var(--s360-color-info-strong,var(--s360-color-primary));
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-card--success,
    .s360-ui-section-card--success,
    .s360-ui-stat-card--success,
    .s360-ui-action-card--success
){
    --s360-card-border-color:var(--s360-color-border-success,var(--s360-color-success));
    --s360-card-accent-color:var(--s360-color-success,var(--s360-color-success-strong));
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-card--warning,
    .s360-ui-section-card--warning,
    .s360-ui-stat-card--warning,
    .s360-ui-action-card--warning
){
    --s360-card-border-color:var(--s360-color-border-warning,var(--s360-color-warning));
    --s360-card-accent-color:var(--s360-color-warning,var(--s360-color-warning-strong));
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-card--danger,
    .s360-ui-section-card--danger,
    .s360-ui-stat-card--danger,
    .s360-ui-action-card--danger
){
    --s360-card-border-color:var(--s360-color-border-danger,var(--s360-color-danger));
    --s360-card-accent-color:var(--s360-color-danger,var(--s360-color-danger-strong));
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-card--readonly,
    .s360-ui-section-card--readonly,
    .s360-ui-stat-card--readonly,
    .s360-ui-action-card--readonly
){
    --s360-card-border-color:var(--s360-color-readonly-border,var(--s360-color-border-subtle));
    --s360-card-shadow:none;
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-card--disabled,
    .s360-ui-section-card--disabled,
    .s360-ui-stat-card--disabled,
    .s360-ui-action-card--disabled
){
    --s360-card-border-color:var(--s360-color-disabled-border,var(--s360-color-border-muted));
    --s360-card-shadow:none;
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-card--accent,
    .s360-ui-section-card--accent,
    .s360-ui-stat-card--accent,
    .s360-ui-action-card--accent,
    .s360-ui-card--accent-primary,
    .s360-ui-section-card--accent-primary,
    .s360-ui-stat-card--accent-primary,
    .s360-ui-action-card--accent-primary,
    .s360-ui-card--accent-info,
    .s360-ui-section-card--accent-info,
    .s360-ui-stat-card--accent-info,
    .s360-ui-action-card--accent-info,
    .s360-ui-card--accent-success,
    .s360-ui-section-card--accent-success,
    .s360-ui-stat-card--accent-success,
    .s360-ui-action-card--accent-success,
    .s360-ui-card--accent-warning,
    .s360-ui-section-card--accent-warning,
    .s360-ui-stat-card--accent-warning,
    .s360-ui-action-card--accent-warning,
    .s360-ui-card--accent-danger,
    .s360-ui-section-card--accent-danger,
    .s360-ui-stat-card--accent-danger,
    .s360-ui-action-card--accent-danger
):not(.s360-surface-legacy){
    border-inline-start-width:var(--s360-card-accent-width);
    border-inline-start-style:var(--s360-card-border-style);
    border-inline-start-color:var(--s360-card-accent-color);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(.s360-ui-card--accent-info,.s360-ui-section-card--accent-info,.s360-ui-stat-card--accent-info,.s360-ui-action-card--accent-info){
    --s360-card-accent-color:var(--s360-color-info-strong,var(--s360-color-primary));
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(.s360-ui-card--accent-success,.s360-ui-section-card--accent-success,.s360-ui-stat-card--accent-success,.s360-ui-action-card--accent-success){
    --s360-card-accent-color:var(--s360-color-success,var(--s360-color-success-strong));
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(.s360-ui-card--accent-warning,.s360-ui-section-card--accent-warning,.s360-ui-stat-card--accent-warning,.s360-ui-action-card--accent-warning){
    --s360-card-accent-color:var(--s360-color-warning,var(--s360-color-warning-strong));
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(.s360-ui-card--accent-danger,.s360-ui-section-card--accent-danger,.s360-ui-stat-card--accent-danger,.s360-ui-action-card--accent-danger){
    --s360-card-accent-color:var(--s360-color-danger,var(--s360-color-danger-strong));
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-system-panel,
    .s360-school-panel,
    .s360-ui-admin-panel,
    .s360-builder-panel,
    .s360-custom-fields-builder,
    .s360-finance-analytics-panel,
    .s360-finance-tab-panel,
    .s360-admissions-section,
    .s360-admissions-queue-panel,
    .s360-admissions-command-panel,
    .s360-communication-form-card,
    .s360-communication-send-card,
    .s360-communication-workflow-card,
    .s360-communication-overview-shortcuts-panel,
    .s360-gd-form-panel,
    .s360-gd-list-shell,
    .s360-document-panel-head,
    .s360-hr-panel,
    .s360-hr-card,
    .s360-hr-quick-dock,
    .s360-hr-side-panel__surface,
    .s360-student-panel,
    .s360-student-ops-command-bar,
    .postbox
):not(.s360-surface-legacy){
    border-width:var(--s360-card-border-width);
    border-style:var(--s360-card-border-style);
    border-color:var(--s360-card-border-color);
    border-radius:var(--s360-card-radius);
    box-shadow:var(--s360-card-shadow);
}

/* UI-IX Unified Card Surface — Phase 4: Flat Default Card Surface
 * Runtime scope: CSS-only admin card surface refinement for v13.6.
 * Purpose: keep the shared border/radius contract, but make default card
 * surfaces flat by default. Elevation is reserved for hover, focus and
 * active/selected states.
 */
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper{
    --s360-card-flat-shadow:none;
    --s360-card-shadow:var(--s360-card-flat-shadow);
    --s360-card-core-shadow:var(--s360-card-flat-shadow);
    --s360-ui-section-card-shadow:var(--s360-card-flat-shadow);
    --s360-dashboard-panel-soft-shadow:var(--s360-card-flat-shadow);
    --s360-card-stat-shadow:var(--s360-card-flat-shadow);
    --s360-card-action-shadow:var(--s360-card-flat-shadow);
    --s360-card-utility-shadow:var(--s360-card-flat-shadow);
    --s360-card-hover-shadow:var(--s360-card-soft-hover-shadow,0 2px 6px rgba(15,23,42,.08));
    --s360-card-active-shadow:0 0 0 1px var(--s360-card-active-border-color,var(--s360-color-primary,#2271b1));
    --s360-card-focus-ring:var(--s360-focus-ring,0 0 0 3px rgba(59,130,246,.12));
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-card,
    .s360-ui-section-card,
    .s360-ui-stat-card,
    .s360-admin-dashboard__utility-card,
    .s360-ui-action-card,
    .s360-ui-dashboard-panel,
    .s360-admin-shortcut.s360-ui-dashboard-shortcut,
    .s360-system-panel,
    .s360-school-panel,
    .s360-ui-admin-panel,
    .s360-builder-panel,
    .s360-custom-fields-builder,
    .s360-finance-analytics-panel,
    .s360-finance-tab-panel,
    .s360-admissions-section,
    .s360-admissions-queue-panel,
    .s360-admissions-command-panel,
    .s360-communication-form-card,
    .s360-communication-send-card,
    .s360-communication-workflow-card,
    .s360-communication-overview-shortcuts-panel,
    .s360-gd-form-panel,
    .s360-gd-list-shell,
    .s360-document-panel-head,
    .s360-hr-panel,
    .s360-hr-card,
    .s360-hr-quick-dock,
    .s360-hr-side-panel__surface,
    .s360-student-panel,
    .s360-student-ops-command-bar,
    .postbox
):not(.s360-surface-legacy):not(:hover):not(:focus-visible):not(.is-active):not(.is-selected):not([aria-selected="true"]):not([aria-current="page"]){
    box-shadow:var(--s360-card-flat-shadow);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    a.s360-ui-card,
    a.s360-ui-section-card,
    a.s360-ui-stat-card,
    a.s360-ui-action-card,
    button.s360-ui-action-card,
    [role="button"].s360-ui-card,
    [role="button"].s360-ui-section-card,
    [role="button"].s360-ui-action-card,
    .s360-admin-dashboard__utility-card,
    .s360-admin-shortcut.s360-ui-dashboard-shortcut
):not(.s360-surface-legacy):hover{
    box-shadow:var(--s360-card-hover-shadow);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    a.s360-ui-card,
    a.s360-ui-section-card,
    a.s360-ui-stat-card,
    a.s360-ui-action-card,
    button.s360-ui-action-card,
    [role="button"].s360-ui-card,
    [role="button"].s360-ui-section-card,
    [role="button"].s360-ui-action-card,
    .s360-admin-dashboard__utility-card,
    .s360-admin-shortcut.s360-ui-dashboard-shortcut
):not(.s360-surface-legacy):focus-visible{
    box-shadow:var(--s360-card-focus-ring), var(--s360-card-hover-shadow);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-card,
    .s360-ui-section-card,
    .s360-ui-stat-card,
    .s360-ui-action-card,
    .s360-admin-dashboard__utility-card,
    .s360-ui-dashboard-panel
):where(.is-active,[aria-selected="true"],[aria-current="page"],.is-selected):not(.s360-surface-legacy){
    box-shadow:var(--s360-card-active-shadow);
}

/* UI-IX Unified Card Surface — Phase 5: Background Token Consolidation
 * Runtime scope: CSS-only admin card surface refinement for v13.6.
 * Purpose: centralize default card backgrounds through unified variables and
 * bridge remaining module-specific card/panel backgrounds into the same
 * surface contract. Status/semantic surfaces remain token-driven exceptions.
 */
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper{
    --s360-card-background:var(--s360-color-surface-raised,var(--s360-color-surface,#fff));
    --s360-card-background-muted:var(--s360-color-bg-subtle,#f8fafc);
    --s360-card-background-soft:var(--s360-color-bg-soft,#f8fbff);
    --s360-card-background-hover:var(--s360-color-bg-subtle,#f8fafc);
    --s360-card-background-active:var(--s360-color-primary-soft,var(--s360-color-bg-soft,#eff6ff));
    --s360-card-background-info:var(--s360-color-surface-info-soft,var(--s360-color-info-surface,#eef6ff));
    --s360-card-background-success:var(--s360-color-surface-success-soft,var(--s360-color-success-surface,#edfaef));
    --s360-card-background-warning:var(--s360-color-surface-warning-soft,var(--s360-color-warning-surface,#fff8e5));
    --s360-card-background-danger:var(--s360-color-surface-danger-soft,var(--s360-color-danger-surface,#fde8e8));
    --s360-card-background-readonly:var(--s360-color-readonly-surface,var(--s360-color-bg-subtle,#f8fafc));
    --s360-card-background-disabled:var(--s360-color-disabled-surface,var(--s360-color-surface-contrast,#f9fafb));
    --s360-card-core-bg:var(--s360-card-background);
    --s360-ui-section-card-bg:var(--s360-card-background);
    --s360-card-action-bg:var(--s360-card-action-background,var(--s360-card-background));
    --s360-card-stat-bg:var(--s360-card-stat-background,var(--s360-card-background-muted));
    --s360-card-utility-bg:var(--s360-card-utility-background,var(--s360-card-background-muted));
    --s360-dashboard-panel-bg:var(--s360-card-background);
    --s360-module-card-bg:var(--s360-card-background);
    --s360-secondary-panel-bg:var(--s360-card-background);
    --s360-secondary-stat-bg:var(--s360-card-background-muted);
    --s360-admissions-panel-bg:var(--s360-card-background);
    --s360-admissions-panel-muted-bg:var(--s360-card-background-muted);
    --s360-builder-panel-bg:var(--s360-card-background);
    --s360-builder-panel-muted-bg:var(--s360-card-background-muted);
    --s360-profile-section-card-bg:var(--s360-card-background);
}

/*
 * v13.6.36 — stat-card token unification bridge.
 * Academic / students / transport / calendar stat-card variants read the
 * general --s360-card-radius / --s360-card-border-color / --s360-card-background(-muted)
 * tokens, while the base .s360-ui-stat-card reads the --s360-card-stat-* group.
 * Both groups now resolve to the canonical --s360-statcard-* masters in tokens.css.
 * Here we redirect the general tokens to the same masters *only within stat-card
 * grids*, so editing a --s360-statcard-* value updates every stat card at once,
 * while ordinary content cards keep their own card tokens untouched.
 */
body.wp-admin #wpbody-content :where(
    .s360-ui-stat-card,
    .s360-academic-stat-card,
    .s360-students-stat-card,
    .s360-calendar-stat-card,
    .s360-teacher-workbench-stat-card
){
    --s360-card-radius:var(--s360-statcard-radius);
    --s360-card-border-color:var(--s360-statcard-border-color);
    --s360-card-border-width:var(--s360-statcard-border-width);
    --s360-card-background:var(--s360-statcard-bg);
    --s360-card-background-muted:var(--s360-statcard-bg);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-card,
    .s360-ui-section-card,
    .s360-ui-dashboard-panel,
    .s360-system-panel,
    .s360-school-panel,
    .s360-ui-admin-panel,
    .s360-builder-panel,
    .s360-custom-fields-builder,
    .s360-finance-analytics-panel,
    .s360-finance-tab-panel,
    .s360-admissions-section,
    .s360-admissions-queue-panel,
    .s360-admissions-command-panel,
    .s360-communication-form-card,
    .s360-communication-send-card,
    .s360-communication-workflow-card,
    .s360-communication-overview-shortcuts-panel,
    .s360-gd-form-panel,
    .s360-gd-list-shell,
    .s360-document-panel-head,
    .s360-hr-panel,
    .s360-hr-card,
    .s360-hr-quick-dock,
    .s360-hr-side-panel__surface,
    .s360-student-panel,
    .s360-student-ops-command-bar,
    .postbox
):not(.s360-surface-legacy):not(.s360-card-background-legacy){
    background:var(--s360-card-background);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-stat-card
):not(.s360-surface-legacy):not(.s360-card-background-legacy){
    background:var(--s360-card-stat-background,var(--s360-card-background-muted));
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-admin-dashboard__utility-card,
    .s360-admin-shortcut.s360-ui-dashboard-shortcut
):not(.s360-surface-legacy):not(.s360-card-background-legacy){
    background:var(--s360-card-utility-background,var(--s360-card-background-muted));
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-action-card
):not(.s360-surface-legacy):not(.s360-card-background-legacy){
    background:var(--s360-card-action-background,var(--s360-card-background));
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-card--primary,
    .s360-ui-section-card--primary,
    .s360-ui-stat-card--primary,
    .s360-ui-action-card--primary
):not(.s360-surface-legacy):not(.s360-card-background-legacy){
    background:var(--s360-card-background-active);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-card--info,
    .s360-ui-section-card--info,
    .s360-ui-stat-card--info,
    .s360-ui-action-card--info
):not(.s360-surface-legacy):not(.s360-card-background-legacy){
    background:var(--s360-card-background-info);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-card--success,
    .s360-ui-section-card--success,
    .s360-ui-stat-card--success,
    .s360-ui-action-card--success
):not(.s360-surface-legacy):not(.s360-card-background-legacy){
    background:var(--s360-card-background-success);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-card--warning,
    .s360-ui-section-card--warning,
    .s360-ui-stat-card--warning,
    .s360-ui-action-card--warning
):not(.s360-surface-legacy):not(.s360-card-background-legacy){
    background:var(--s360-card-background-warning);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-card--danger,
    .s360-ui-section-card--danger,
    .s360-ui-stat-card--danger,
    .s360-ui-action-card--danger
):not(.s360-surface-legacy):not(.s360-card-background-legacy){
    background:var(--s360-card-background-danger);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-card--readonly,
    .s360-ui-section-card--readonly,
    .s360-ui-stat-card--readonly,
    .s360-ui-action-card--readonly
):not(.s360-surface-legacy):not(.s360-card-background-legacy){
    background:var(--s360-card-background-readonly);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-card--disabled,
    .s360-ui-section-card--disabled,
    .s360-ui-stat-card--disabled,
    .s360-ui-action-card--disabled
):not(.s360-surface-legacy):not(.s360-card-background-legacy){
    background:var(--s360-card-background-disabled);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    a.s360-ui-card,
    a.s360-ui-section-card,
    a.s360-ui-stat-card,
    a.s360-ui-action-card,
    button.s360-ui-action-card,
    [role="button"].s360-ui-card,
    [role="button"].s360-ui-section-card,
    [role="button"].s360-ui-action-card,
    .s360-admin-dashboard__utility-card,
    .s360-admin-shortcut.s360-ui-dashboard-shortcut
):not(.s360-surface-legacy):not(.s360-card-background-legacy):hover{
    background:var(--s360-card-background-hover);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-card,
    .s360-ui-section-card,
    .s360-ui-stat-card,
    .s360-ui-action-card,
    .s360-admin-dashboard__utility-card,
    .s360-ui-dashboard-panel
):where(.is-active,[aria-selected="true"],[aria-current="page"],.is-selected):not(.s360-surface-legacy):not(.s360-card-background-legacy){
    background:var(--s360-card-background-active);
}


/* v13.6.36 Phase B — unified stat-card base polish.
 * Scope: CSS-only token/base contract for admin stat/KPI cards.
 * Purpose: make the shared stat-card family clean, flat, compact and token-driven
 * without changing PHP markup, JS, DB or module workflows.
 */
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-stat-card,
    .s360-academic-stat-card,
    .s360-students-stat-card,
    .s360-calendar-stat-card,
    .s360-teacher-workbench-stat-card
):not(.s360-surface-legacy):not(.s360-stat-card-legacy){
    min-height:var(--s360-card-stat-min-height,var(--s360-statcard-min-height,76px));
    padding:var(--s360-card-stat-padding,var(--s360-statcard-padding,14px 16px));
    gap:var(--s360-card-stat-gap,var(--s360-statcard-gap,8px));
    background:var(--s360-card-stat-background,var(--s360-card-stat-bg,var(--s360-statcard-bg,var(--s360-color-bg-subtle,#f8fafc))));
    border:var(--s360-statcard-border-width,1px) solid var(--s360-card-stat-border-color,var(--s360-statcard-border-color,var(--s360-color-border-muted,#e2e8f0)));
    border-radius:var(--s360-card-stat-radius,var(--s360-statcard-radius,var(--s360-radius-xl,12px)));
    box-shadow:var(--s360-card-stat-shadow,var(--s360-statcard-shadow,none));
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-stat-card,
    .s360-academic-stat-card,
    .s360-students-stat-card,
    .s360-calendar-stat-card,
    .s360-teacher-workbench-stat-card
):not(.s360-surface-legacy):not(.s360-stat-card-legacy) :where(.s360-ui-stat-card__label,.description){
    font-size:var(--s360-statcard-label-size,var(--s360-font-size-xs,12px));
    font-weight:var(--s360-statcard-label-weight,700);
    line-height:var(--s360-statcard-line-height,1.2);
    color:var(--s360-color-text-label,var(--s360-color-text-secondary,#475569));
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-stat-card,
    .s360-academic-stat-card,
    .s360-students-stat-card,
    .s360-calendar-stat-card,
    .s360-teacher-workbench-stat-card
):not(.s360-surface-legacy):not(.s360-stat-card-legacy) :where(.s360-ui-stat-card__value,h2){
    font-size:var(--s360-card-stat-value-size,var(--s360-statcard-value-size,24px));
    font-weight:var(--s360-statcard-value-weight,800);
    line-height:1;
    color:var(--s360-color-text-heading,#0f172a);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-stat-card,
    .s360-academic-stat-card,
    .s360-students-stat-card,
    .s360-calendar-stat-card,
    .s360-teacher-workbench-stat-card
):not(.s360-surface-legacy):not(.s360-stat-card-legacy) :where(.s360-ui-stat-card__meta,.s360-ui-stat-card__helper,small){
    font-size:var(--s360-statcard-meta-size,var(--s360-font-size-xs,12px));
    line-height:1.45;
    color:var(--s360-color-text-tertiary,#64748b);
}


/* Phase 8 ownership extraction: Calendar & Events v13.6.30 polish/hotfix tail now lives in its scoped admin ownership layer. */

/* v13.6.30 P1 Unified Admin Body Shell Spacing Contract.
 * Scope: late CSS-only runtime contract for School 360 admin pages.
 * Goal: centralize the margin/gap rhythm for the body shell, main tabs,
 * sub/workflow tabs and primary card families without changing PHP markup,
 * JS behavior, REST/AJAX, database, permissions, portal/public CSS or Tailwind
 * build output. This layer intentionally uses the existing v13.6.30 density and
 * unified spacing tokens so future tuning can happen from one variable surface.
 */
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper{
    --s360-p1-shell-card-gap:var(--s360-admin-compact-density-grid-gap,var(--s360-unified-gap-card,10px));
    --s360-p1-shell-section-gap:var(--s360-admin-compact-density-grid-gap-lg,var(--s360-unified-gap-section,12px));
    --s360-p1-shell-stack-gap:var(--s360-admin-compact-density-shell-stack-gap,var(--s360-unified-stack-gap,10px));
    --s360-p1-shell-tight-gap:var(--s360-unified-gap-tight,var(--s360-space-xs,8px));
    --s360-p1-shell-card-padding:var(--s360-admin-compact-density-panel-padding-y,var(--s360-unified-card-padding-y,14px)) var(--s360-admin-compact-density-panel-padding-x,var(--s360-unified-card-padding-x,16px));
    --s360-p1-shell-stat-padding:var(--s360-card-stat-padding,var(--s360-statcard-padding,14px 16px));
    --s360-p1-shell-action-padding:var(--s360-admin-compact-density-action-padding-y,10px) var(--s360-admin-compact-density-action-padding-x,var(--s360-space-sm,12px));
    --s360-p1-main-tabs-padding:var(--s360-p1-shell-tight-gap,8px);
    --s360-p1-sub-tabs-padding:6px;
    --s360-p1-main-tab-item-padding:8px 12px;
    --s360-p1-sub-tab-item-padding:7px 11px;
    --s360-layout-page-gap:var(--s360-p1-shell-section-gap,12px);
    --s360-layout-section-gap:var(--s360-p1-shell-section-gap,12px);
    --s360-layout-panel-gap:var(--s360-p1-shell-section-gap,12px);
    --s360-layout-grid-gap:var(--s360-p1-shell-card-gap,10px);
    --s360-layout-grid-gap-lg:var(--s360-p1-shell-section-gap,12px);
    --s360-layout-sidebar-gap:var(--s360-p1-shell-section-gap,12px);
    --s360-body-shell-stack-gap:var(--s360-p1-shell-stack-gap,10px);
    --s360-page-shell-stack-gap:var(--s360-p1-shell-stack-gap,10px);
    --s360-module-stack-gap:var(--s360-p1-shell-card-gap,10px);
    --s360-module-section-gap:var(--s360-p1-shell-card-gap,10px);
    --s360-dashboard-workspace-gap:var(--s360-p1-shell-card-gap,10px);
    --s360-admissions-workspace-gap:var(--s360-p1-shell-card-gap,10px);
    --s360-secondary-page-gap:var(--s360-p1-shell-card-gap,10px);
    --s360-tabs-main-margin:var(--s360-p1-shell-stack-gap,10px) 0 var(--s360-p1-shell-section-gap,12px);
    --s360-tabs-sub-margin:var(--s360-p1-shell-stack-gap,10px) 0 var(--s360-p1-shell-section-gap,12px);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper:where(
    .s360-page-shell,
    .s360-ui-shell,
    .s360-grouped-admin,
    .s360-tailwind-foundation,
    .school360-tailwind-foundation,
    .s360-wrap,
    .school360-wrap,
    .s360-admin-dashboard,
    .s360-student-workspace,
    .s360-admissions-workspace,
    .s360-custom-fields-page
){
    row-gap:var(--s360-p1-shell-stack-gap,10px);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper > :where(
    .s360-ui-page-header,
    .s360-page-hero,
    .s360-grouped-admin__hero,
    .s360-grouped-admin__notice-slot,
    .s360-grouped-admin__top-surfaces,
    .s360-ui-header-utility-grid,
    .s360-admin-dashboard__top-surfaces,
    .s360-ui-tabs__nav,
    .nav-tab-wrapper,
    .s360-grouped-admin__content,
    .s360-admin-dashboard__workspace,
    .s360-calendar-workspace,
    .s360-hr-shell,
    .s360-hr-main,
    .s360-ui-card,
    .s360-ui-section-card,
    .s360-ui-dashboard-panel,
    .postbox
){
    box-sizing:border-box;
    max-width:100%;
    min-width:0;
}

/* Main/page-level tabs: one shell margin and one card-rail rhythm. */
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-tabs__nav.s360-ui-main-tabs,
    .nav-tab-wrapper.s360-ui-main-tabs,
    .s360-grouped-admin__main-tabs,
    .s360-finance-tabs,
    .s360-admissions-tabs,
    .s360-calendar-action-tabs,
    .s360-hr-nav
):not(.s360-ui-sub-tabs){
    position:relative;
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    justify-content:flex-start;
    gap:var(--s360-p1-shell-tight-gap,8px);
    width:100%;
    max-width:100%;
    min-width:0;
    margin:var(--s360-tabs-main-margin,10px 0 12px);
    padding:var(--s360-p1-main-tabs-padding,8px);
    box-sizing:border-box;
    border:1px solid var(--s360-color-border-muted,var(--s360-color-border,#dbe5f0));
    border-radius:var(--s360-radius-2xl,var(--s360-radius-xl,14px));
    background:var(--s360-card-background,var(--s360-color-surface-raised,#fff));
    background-image:none;
    box-shadow:var(--s360-card-flat-shadow,0 1px 2px rgba(15,23,42,.04));
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:thin;
    white-space:nowrap;
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-tabs__nav.s360-ui-main-tabs,
    .nav-tab-wrapper.s360-ui-main-tabs,
    .s360-grouped-admin__main-tabs,
    .s360-finance-tabs,
    .s360-admissions-tabs,
    .s360-calendar-action-tabs,
    .s360-hr-nav
):not(.s360-ui-sub-tabs) > :where(a,button,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab,.s360-finance-tab-link,.s360-hr-nav-item){
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 auto;
    min-height:36px;
    width:auto;
    max-width:100%;
    margin:0;
    padding:var(--s360-p1-main-tab-item-padding,8px 12px);
    border:1px solid transparent;
    border-radius:var(--s360-radius-xl,12px);
    background:transparent;
    background-image:none;
    box-shadow:none;
    line-height:1.25;
    text-decoration:none;
    white-space:nowrap;
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-tabs__nav.s360-ui-main-tabs,
    .nav-tab-wrapper.s360-ui-main-tabs,
    .s360-grouped-admin__main-tabs,
    .s360-finance-tabs,
    .s360-admissions-tabs,
    .s360-calendar-action-tabs,
    .s360-hr-nav
):not(.s360-ui-sub-tabs) > :where(.nav-tab-active,.is-active,.active,.s360-hr-nav-active,[aria-current="page"],[aria-selected="true"]){
    border-color:var(--s360-color-primary-soft-border,var(--s360-color-border-accent,#bfdbfe));
    background:var(--s360-card-background-active,var(--s360-color-primary-soft,#eef2ff));
    color:var(--s360-color-primary-strong,var(--s360-color-primary,#2271b1));
    box-shadow:0 1px 2px rgba(15,23,42,.05);
}

/* Sub/workflow tabs: shared secondary rail for module-level navigation. */
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-tabs__nav.s360-ui-sub-tabs,
    .s360-students-subnav,
    .s360-people-subnav,
    .s360-communication-subnav,
    .s360-school-tabs,
    .s360-system-tabs,
    .s360-builder-tabs,
    .s360-hr-profile-tabs
):not(.s360-ui-main-tabs){
    position:relative;
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    justify-content:flex-start;
    gap:6px;
    width:100%;
    max-width:100%;
    min-width:0;
    margin:var(--s360-tabs-sub-margin,10px 0 12px);
    padding:var(--s360-p1-sub-tabs-padding,6px);
    box-sizing:border-box;
    border:1px solid var(--s360-color-border-muted,var(--s360-color-border,#dbe5f0));
    border-radius:var(--s360-radius-xl,12px);
    background:var(--s360-card-background-muted,var(--s360-color-bg-subtle,#f8fafc));
    background-image:none;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.75);
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:thin;
    white-space:nowrap;
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-tabs__nav.s360-ui-sub-tabs,
    .s360-students-subnav,
    .s360-people-subnav,
    .s360-communication-subnav,
    .s360-school-tabs,
    .s360-system-tabs,
    .s360-builder-tabs,
    .s360-hr-profile-tabs
):not(.s360-ui-main-tabs) > :where(a,button,span,div,.nav-tab,.s360-ui-tabs__tab,.s360-tab,.school360-tab,.s360-school-tab,.s360-system-tab,.s360-builder-tab,.s360-admin-nav-pill,.s360-hr-profile-tab){
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 auto;
    min-height:34px;
    width:auto;
    max-width:100%;
    margin:0;
    padding:var(--s360-p1-sub-tab-item-padding,7px 11px);
    border:1px solid transparent;
    border-radius:var(--s360-radius-lg,10px);
    background:transparent;
    background-image:none;
    box-shadow:none;
    color:var(--s360-color-text-muted,var(--s360-color-text-secondary,#475569));
    font-size:12px;
    font-weight:700;
    line-height:1.25;
    text-align:center;
    text-decoration:none;
    text-transform:none;
    white-space:nowrap;
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-tabs__nav.s360-ui-sub-tabs,
    .s360-students-subnav,
    .s360-people-subnav,
    .s360-communication-subnav,
    .s360-school-tabs,
    .s360-system-tabs,
    .s360-builder-tabs,
    .s360-hr-profile-tabs
):not(.s360-ui-main-tabs) > :where(.nav-tab-active,.is-active,.active,.s360-hr-profile-tab-active,[aria-current="page"],[aria-selected="true"]){
    border-color:var(--s360-color-primary-soft-border,var(--s360-color-border-accent,#bfdbfe));
    background:var(--s360-card-background,var(--s360-color-surface-raised,#fff));
    color:var(--s360-color-primary-strong,var(--s360-color-primary,#2271b1));
    box-shadow:0 1px 2px rgba(15,23,42,.05);
}

/* Other tab wrappers that carry a card shell around the generated tabs. */
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-student-profile-tabs-wrap,
    .s360-student-workspace__tabs,
    .s360-admin-student-profile-tabs,
    .s360-custom-fields-tabs,
    .s360-expense-workspace-tabs
){
    box-sizing:border-box;
    max-width:100%;
    margin-block:var(--s360-tabs-sub-margin,10px 0 12px);
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-student-profile-tabs-wrap,
    .s360-student-workspace__tabs
).s360-ui-card{
    padding:var(--s360-p1-shell-card-padding,14px 16px);
}

/* Card/grid rhythm: one padding and gap contract for the primary admin families. */
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-card,
    .s360-ui-section-card,
    .s360-ui-dashboard-panel,
    .s360-system-panel,
    .s360-school-panel,
    .s360-ui-admin-panel,
    .s360-builder-panel,
    .s360-custom-fields-builder,
    .s360-finance-analytics-panel,
    .s360-finance-tab-panel,
    .s360-admissions-section,
    .s360-admissions-queue-panel,
    .s360-admissions-command-panel,
    .s360-communication-form-card,
    .s360-communication-send-card,
    .s360-communication-workflow-card,
    .s360-gd-form-panel,
    .s360-gd-list-shell,
    .s360-hr-panel,
    .s360-hr-card,
    .s360-student-panel,
    .postbox
):not(.s360-ui-stat-card):not(.s360-ui-action-card):not(.s360-admin-dashboard__utility-card):not(.s360-surface-legacy){
    padding:var(--s360-p1-shell-card-padding,14px 16px);
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(.s360-ui-stat-card){
    gap:var(--s360-card-stat-gap,var(--s360-statcard-gap,8px));
    padding:var(--s360-p1-shell-stat-padding,var(--s360-statcard-padding,14px 16px));
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(.s360-ui-action-card,.s360-admin-shortcut.s360-ui-dashboard-shortcut){
    gap:var(--s360-admin-compact-density-action-gap,var(--s360-unified-gap-stat,4px));
    padding:var(--s360-p1-shell-action-padding,10px 12px);
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(.s360-admin-dashboard__utility-card){
    gap:var(--s360-card-utility-gap,var(--s360-p1-shell-card-gap,10px));
    padding:var(--s360-p1-shell-card-padding,14px 16px);
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-grid,
    .s360-grid,
    .s360-grid-auto,
    .s360-grid-auto-lg,
    .s360-stat-grid,
    .s360-kpi-grid,
    .s360-card-grid,
    .s360-section-grid,
    .s360-settings-grid,
    .s360-dashboard-grid,
    .s360-hr-grid,
    .s360-finance-grid,
    .s360-expense-grid,
    .s360-report-grid,
    .s360-admissions-grid,
    .s360-admin-kpi-grid,
    .s360-admin-kpi-grid--compact,
    .s360-admin-attention-grid,
    .s360-admin-shortcuts,
    .s360-ui-dashboard-shortcuts,
    .s360-admin-today-subpanels
){
    gap:var(--s360-p1-shell-card-gap,10px);
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-grouped-admin__content,
    .s360-admin-dashboard__workspace,
    .s360-calendar-workspace,
    .s360-hr-main,
    .s360-admissions-workspace,
    .s360-custom-fields-page,
    .s360-student-workspace
){
    gap:var(--s360-p1-shell-stack-gap,10px);
}
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-card,
    .s360-ui-section-card,
    .s360-ui-dashboard-panel
) > :where(.s360-ui-card__header,.s360-ui-section-card__header,.s360-ui-dashboard-panel__header) + :where(.s360-ui-card__body,.s360-ui-section-card__body,.s360-ui-dashboard-panel__body),
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-card,
    .s360-ui-section-card,
    .s360-ui-dashboard-panel
) > :where(.s360-ui-card__body,.s360-ui-section-card__body,.s360-ui-dashboard-panel__body) + :where(.s360-ui-card__footer,.s360-ui-section-card__footer,.s360-ui-dashboard-panel__footer){
    margin-block-start:var(--s360-p1-shell-card-gap,10px);
}

@media (max-width:782px){
    body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper{
        --s360-p1-shell-card-gap:var(--s360-unified-gap-card-mobile,var(--s360-space-xs,8px));
        --s360-p1-shell-section-gap:var(--s360-unified-gap-section-mobile,var(--s360-space-sm,12px));
        --s360-p1-shell-stack-gap:var(--s360-admin-compact-density-mobile-shell-stack-gap,var(--s360-unified-stack-gap-mobile,8px));
        --s360-p1-shell-card-padding:var(--s360-admin-compact-density-mobile-panel-padding-y,var(--s360-unified-card-padding-mobile,12px)) var(--s360-admin-compact-density-mobile-panel-padding-x,var(--s360-unified-card-padding-mobile,12px));
        --s360-p1-main-tabs-padding:6px;
        --s360-p1-sub-tabs-padding:6px;
        --s360-p1-main-tab-item-padding:7px 10px;
        --s360-p1-sub-tab-item-padding:6px 10px;
    }
    body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
        .s360-ui-tabs__nav.s360-ui-main-tabs,
        .nav-tab-wrapper.s360-ui-main-tabs,
        .s360-grouped-admin__main-tabs,
        .s360-finance-tabs,
        .s360-admissions-tabs,
        .s360-calendar-action-tabs,
        .s360-hr-nav,
        .s360-ui-tabs__nav.s360-ui-sub-tabs,
        .s360-students-subnav,
        .s360-people-subnav,
        .s360-communication-subnav,
        .s360-school-tabs,
        .s360-system-tabs,
        .s360-builder-tabs,
        .s360-hr-profile-tabs
    ){
        flex-wrap:nowrap;
        max-width:100%;
    }
}

/* v13.6.30 P2 Scoped Legacy Margin Normalization.
 * Scope: CSS-only admin shell layer. This intentionally does not globally reset
 * all .s360-mt-* / .s360-mb-* utilities. It only normalizes legacy margins when
 * they are attached to known School 360 admin navigation tabs, cards, panels,
 * table wrappers, dashboard grids and utility layout wrappers inside the admin
 * body shell. No PHP, JS, DB, Tailwind build, routes, permissions, forms or
 * functional workflow behavior are changed.
 */
body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper{
    --s360-p2-legacy-card-gap:var(--s360-p1-shell-card-gap,var(--s360-unified-gap-card,10px));
    --s360-p2-legacy-section-gap:var(--s360-p1-shell-section-gap,var(--s360-unified-gap-section,12px));
    --s360-p2-legacy-main-tabs-margin:var(--s360-p1-main-tabs-margin,10px 0 12px);
    --s360-p2-legacy-sub-tabs-margin:var(--s360-p1-sub-tabs-margin,10px 0 12px);
    --s360-p2-legacy-layout-gap:var(--s360-p1-shell-card-gap,var(--s360-unified-gap-card,10px));
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-main-tabs,
    .s360-grouped-admin__main-tabs,
    .s360-admin-dashboard__tabs,
    .s360-finance-tabs,
    .s360-admissions-tabs,
    .s360-calendar-action-tabs,
    .s360-hr-nav,
    .s360-admin-nav-pills,
    .s360-report-nav
):not(.s360-spacing-legacy){
    margin:var(--s360-p2-legacy-main-tabs-margin);
    margin-inline:0;
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-sub-tabs,
    .s360-students-subnav,
    .s360-student-ops-subtabs,
    .s360-student-profile-tabs-wrap,
    .s360-student-workspace__tabs,
    .s360-workspace-tabs,
    .s360-people-subnav,
    .s360-people-subnav--nested,
    .s360-communication-subnav,
    .s360-communication-subnav--nested,
    .s360-expense-workspace-tabs,
    .s360-school-tabs,
    .s360-system-tabs,
    .s360-builder-tabs,
    .s360-custom-fields-tabs,
    .s360-hr-profile-tabs,
    .s360-hr-subnav,
    .s360-hr-portal-tabs,
    .s360-tabs,
    .s360-quick-actions-under-tabs
):not(.s360-spacing-legacy){
    margin:var(--s360-p2-legacy-sub-tabs-margin);
    margin-inline:0;
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-main-tabs,
    .s360-grouped-admin__main-tabs,
    .s360-admin-dashboard__tabs,
    .s360-finance-tabs,
    .s360-admissions-tabs,
    .s360-calendar-action-tabs,
    .s360-hr-nav,
    .s360-admin-nav-pills,
    .s360-report-nav,
    .s360-ui-sub-tabs,
    .s360-students-subnav,
    .s360-student-ops-subtabs,
    .s360-student-profile-tabs-wrap,
    .s360-student-workspace__tabs,
    .s360-workspace-tabs,
    .s360-people-subnav,
    .s360-people-subnav--nested,
    .s360-communication-subnav,
    .s360-communication-subnav--nested,
    .s360-expense-workspace-tabs,
    .s360-school-tabs,
    .s360-system-tabs,
    .s360-builder-tabs,
    .s360-custom-fields-tabs,
    .s360-hr-profile-tabs,
    .s360-hr-subnav,
    .s360-hr-portal-tabs,
    .s360-tabs,
    .s360-quick-actions-under-tabs
):where(
    .s360-mt-xs,
    .s360-mt-sm,
    .s360-mt-md,
    .s360-mt-lg,
    .s360-mt-xl,
    .s360-mt-2xl,
    .s360-mt-md-plus,
    .s360-mb-xs,
    .s360-mb-sm,
    .s360-mb-md,
    .s360-mb-lg,
    .s360-mb-md-plus,
    .s360-my-md,
    .s360-my-lg,
    .s360-my-md-plus,
    .s360-my-md-lg,
    [class*="s360-u-mt-"],
    [class*="s360-u-mb-"],
    [class*="s360-u-my-"],
    [class*="-mt16"],
    [class*="-mt14"],
    [class*="-mt12"],
    [class*="-mt10"],
    [class*="-mt8"],
    [class*="-mt6"],
    [class*="-mt4"],
    [class*="-mb16"],
    [class*="-mb14"],
    [class*="-mb12"],
    [class*="-mb10"],
    [class*="-mb8"],
    [class*="-mb6"],
    [class*="-mb4"],
    [class*="-my16"],
    [class*="-my14"],
    [class*="-my12"],
    [class*="-my8"]
):not(.s360-spacing-legacy){
    margin-inline:0;
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-card,
    .s360-ui-section-card,
    .s360-ui-dashboard-panel,
    .s360-ui-admin-panel,
    .s360-admin-panel,
    .s360-admin-secondary-panel,
    .s360-system-panel,
    .s360-school-panel,
    .s360-builder-panel,
    .s360-finance-tab-panel,
    .s360-finance-analytics-panel,
    .s360-admissions-section,
    .s360-admissions-queue-panel,
    .s360-admissions-command-panel,
    .s360-communication-form-card,
    .s360-communication-send-card,
    .s360-communication-workflow-card,
    .s360-gd-form-panel,
    .s360-gd-list-shell,
    .s360-hr-panel,
    .s360-hr-card,
    .s360-hr-live-panel,
    .s360-hr-side-panel,
    .s360-student-panel,
    .s360-report-section-panel,
    .s360-report-filter-panel,
    .s360-report-help-panel,
    .s360-filter-panel,
    .s360-provider-panel,
    .s360-payment-add-panel,
    .s360-gateway-health-panel,
    .s360-audit-json-panel,
    .s360-parent-panel,
    .postbox
):where(
    .s360-mt-xs,
    .s360-mt-sm,
    .s360-mt-md,
    .s360-mt-lg,
    .s360-mt-xl,
    .s360-mt-2xl,
    .s360-mt-md-plus,
    [class*="s360-u-mt-"],
    [class*="-mt16"],
    [class*="-mt14"],
    [class*="-mt12"],
    [class*="-mt10"],
    [class*="-mt8"],
    [class*="-mt6"],
    [class*="-mt4"]
):not(.s360-spacing-legacy):not(.s360-density-comfortable){
    margin-block-start:var(--s360-p2-legacy-card-gap);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-card,
    .s360-ui-section-card,
    .s360-ui-dashboard-panel,
    .s360-ui-admin-panel,
    .s360-admin-panel,
    .s360-admin-secondary-panel,
    .s360-system-panel,
    .s360-school-panel,
    .s360-builder-panel,
    .s360-finance-tab-panel,
    .s360-finance-analytics-panel,
    .s360-admissions-section,
    .s360-admissions-queue-panel,
    .s360-admissions-command-panel,
    .s360-communication-form-card,
    .s360-communication-send-card,
    .s360-communication-workflow-card,
    .s360-gd-form-panel,
    .s360-gd-list-shell,
    .s360-hr-panel,
    .s360-hr-card,
    .s360-hr-live-panel,
    .s360-hr-side-panel,
    .s360-student-panel,
    .s360-report-section-panel,
    .s360-report-filter-panel,
    .s360-report-help-panel,
    .s360-filter-panel,
    .s360-provider-panel,
    .s360-payment-add-panel,
    .s360-gateway-health-panel,
    .s360-audit-json-panel,
    .s360-parent-panel,
    .postbox
):where(
    .s360-mb-xs,
    .s360-mb-sm,
    .s360-mb-md,
    .s360-mb-lg,
    .s360-mb-md-plus,
    [class*="s360-u-mb-"],
    [class*="-mb16"],
    [class*="-mb14"],
    [class*="-mb12"],
    [class*="-mb10"],
    [class*="-mb8"],
    [class*="-mb6"],
    [class*="-mb4"]
):not(.s360-spacing-legacy):not(.s360-density-comfortable){
    margin-block-end:var(--s360-p2-legacy-card-gap);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-card,
    .s360-ui-section-card,
    .s360-ui-dashboard-panel,
    .s360-ui-admin-panel,
    .s360-admin-panel,
    .s360-admin-secondary-panel,
    .s360-system-panel,
    .s360-school-panel,
    .s360-builder-panel,
    .s360-finance-tab-panel,
    .s360-finance-analytics-panel,
    .s360-admissions-section,
    .s360-communication-form-card,
    .s360-communication-send-card,
    .s360-communication-workflow-card,
    .s360-gd-form-panel,
    .s360-gd-list-shell,
    .s360-hr-panel,
    .s360-hr-card,
    .s360-student-panel,
    .postbox
):where(
    .s360-my-md,
    .s360-my-lg,
    .s360-my-md-plus,
    .s360-my-md-lg,
    [class*="s360-u-my-"],
    [class*="-my16"],
    [class*="-my14"],
    [class*="-my12"],
    [class*="-my8"]
):not(.s360-spacing-legacy):not(.s360-density-comfortable){
    margin-block-start:var(--s360-p2-legacy-card-gap);
    margin-block-end:var(--s360-p2-legacy-card-gap);
    margin-inline:0;
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-grid,
    .s360-grid,
    .s360-grid-2,
    .s360-grid-3,
    .s360-grid-4,
    .s360-grid-auto,
    .s360-grid-auto-lg,
    .s360-stat-grid,
    .s360-kpi-grid,
    .s360-card-grid,
    .s360-section-grid,
    .s360-settings-grid,
    .s360-dashboard-grid,
    .s360-hr-grid,
    .s360-finance-grid,
    .s360-expense-grid,
    .s360-report-grid,
    .s360-admissions-grid,
    .s360-admin-kpi-grid,
    .s360-admin-kpi-grid--compact,
    .s360-admin-attention-grid,
    .s360-admin-shortcuts,
    .s360-ui-dashboard-shortcuts,
    .s360-admin-today-subpanels,
    .s360-table-scroll,
    .s360-ui-table-wrap,
    .s360-table-wrapper,
    .s360-u-grid-2-16-mt16,
    .s360-u-grid-3-16-my-16,
    .s360-u-grid-3-12-my12,
    .s360-u-grid-3-12-my14,
    .s360-u-grid-280-16-mt16,
    .s360-u-flex-start-8-my,
    .s360-u-flex-wrap-10-my-lg
):not(.s360-spacing-legacy){
    gap:var(--s360-p2-legacy-layout-gap);
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-ui-grid,
    .s360-grid,
    .s360-grid-2,
    .s360-grid-3,
    .s360-grid-4,
    .s360-grid-auto,
    .s360-grid-auto-lg,
    .s360-stat-grid,
    .s360-kpi-grid,
    .s360-card-grid,
    .s360-section-grid,
    .s360-settings-grid,
    .s360-dashboard-grid,
    .s360-hr-grid,
    .s360-finance-grid,
    .s360-expense-grid,
    .s360-report-grid,
    .s360-admissions-grid,
    .s360-table-scroll,
    .s360-ui-table-wrap,
    .s360-table-wrapper,
    .s360-u-grid-2-16-mt16,
    .s360-u-grid-3-16-my-16,
    .s360-u-grid-3-12-my12,
    .s360-u-grid-3-12-my14,
    .s360-u-grid-280-16-mt16,
    .s360-u-flex-start-8-my,
    .s360-u-flex-wrap-10-my-lg
):where(
    .s360-mt-xs,
    .s360-mt-sm,
    .s360-mt-md,
    .s360-mt-lg,
    .s360-mt-xl,
    .s360-mt-2xl,
    .s360-mt-md-plus,
    .s360-my-md,
    .s360-my-lg,
    .s360-my-md-plus,
    .s360-my-md-lg,
    [class*="s360-u-mt-"],
    [class*="s360-u-my-"],
    [class*="-mt16"],
    [class*="-mt14"],
    [class*="-mt12"],
    [class*="-mt10"],
    [class*="-mt8"],
    [class*="-mt6"],
    [class*="-mt4"],
    [class*="-my16"],
    [class*="-my14"],
    [class*="-my12"],
    [class*="-my8"]
):not(.s360-spacing-legacy){
    margin-block-start:var(--s360-p2-legacy-card-gap);
    margin-inline:0;
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-table-scroll,
    .s360-ui-table-wrap,
    .s360-table-wrapper,
    .s360-ui-table,
    .s360-calendar-table,
    .s360-admin-dashboard-table
):where(
    .s360-mb-xs,
    .s360-mb-sm,
    .s360-mb-md,
    .s360-mb-lg,
    .s360-mb-md-plus,
    .s360-my-md,
    .s360-my-lg,
    .s360-my-md-plus,
    .s360-my-md-lg,
    [class*="s360-u-mb-"],
    [class*="s360-u-my-"],
    [class*="-mb16"],
    [class*="-mb14"],
    [class*="-mb12"],
    [class*="-mb10"],
    [class*="-mb8"],
    [class*="-mb6"],
    [class*="-mb4"],
    [class*="-my16"],
    [class*="-my14"],
    [class*="-my12"],
    [class*="-my8"]
):not(.s360-spacing-legacy){
    margin-block-end:var(--s360-p2-legacy-card-gap);
    margin-inline:0;
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper :where(
    .s360-grouped-admin__content,
    .s360-admin-dashboard__workspace,
    .s360-calendar-workspace,
    .s360-hr-main,
    .s360-admissions-workspace,
    .s360-custom-fields-page,
    .s360-custom-fields-workspace,
    .s360-student-workspace,
    .s360-expense-dashboard-panels,
    .s360-builder-panels
) > :where(
    .s360-ui-card,
    .s360-ui-section-card,
    .s360-ui-dashboard-panel,
    .s360-ui-admin-panel,
    .s360-admin-panel,
    .s360-system-panel,
    .s360-school-panel,
    .s360-builder-panel,
    .s360-finance-tab-panel,
    .s360-admissions-section,
    .s360-communication-form-card,
    .s360-communication-send-card,
    .s360-communication-workflow-card,
    .s360-gd-form-panel,
    .s360-gd-list-shell,
    .s360-hr-panel,
    .s360-hr-card,
    .s360-student-panel,
    .postbox
) + :where(
    .s360-ui-card,
    .s360-ui-section-card,
    .s360-ui-dashboard-panel,
    .s360-ui-admin-panel,
    .s360-admin-panel,
    .s360-system-panel,
    .s360-school-panel,
    .s360-builder-panel,
    .s360-finance-tab-panel,
    .s360-admissions-section,
    .s360-communication-form-card,
    .s360-communication-send-card,
    .s360-communication-workflow-card,
    .s360-gd-form-panel,
    .s360-gd-list-shell,
    .s360-hr-panel,
    .s360-hr-card,
    .s360-student-panel,
    .postbox
):not(.s360-spacing-legacy){
    margin-block-start:var(--s360-p2-legacy-card-gap);
}

@media (max-width:782px){
    body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper{
        --s360-p2-legacy-card-gap:var(--s360-p1-shell-card-gap,var(--s360-unified-gap-card-mobile,8px));
        --s360-p2-legacy-section-gap:var(--s360-p1-shell-section-gap,var(--s360-unified-gap-section-mobile,10px));
        --s360-p2-legacy-layout-gap:var(--s360-p1-shell-card-gap,var(--s360-unified-gap-card-mobile,8px));
        --s360-p2-legacy-main-tabs-margin:8px 0 10px;
        --s360-p2-legacy-sub-tabs-margin:8px 0 10px;
    }
}


/* v13.6.30 P3 Unified Direct-Child Stack Spacing.
 * Scope: CSS-only admin shell layer over P2. This layer targets the issue
 * confirmed during visual QA: inconsistent vertical rhythm between direct
 * horizontal UI blocks (page header, readiness/top-surface cards, main tabs,
 * nested report workspace header, report document card, role panel, report nav,
 * section cards and grids). It does not globally reset every .s360-mt-* or
 * .s360-mb-* utility. It normalizes the stack only inside School 360 admin
 * shell/workspace containers and keeps card padding, borders, JS hooks, PHP
 * markup, database, permissions, routes and Tailwind build output unchanged.
 */
body.wp-admin #wpbody-content .wrap.s360-admin-wrapper{
    --s360-p3-shell-row-gap:var(--s360-p2-legacy-card-gap,var(--s360-p1-shell-card-gap,var(--s360-unified-gap-card,10px)));
    --s360-p3-shell-row-gap-mobile:var(--s360-unified-gap-card-mobile,8px);
    --s360-p3-shell-section-gap:var(--s360-p2-legacy-section-gap,var(--s360-p1-shell-section-gap,var(--s360-unified-gap-section,12px)));
    --s360-body-shell-stack-gap:var(--s360-p3-shell-row-gap);
    --s360-page-shell-stack-gap:var(--s360-p3-shell-row-gap);
    --s360-module-stack-gap:var(--s360-p3-shell-row-gap);
    --s360-module-section-gap:var(--s360-p3-shell-row-gap);
    --s360-dashboard-workspace-gap:var(--s360-p3-shell-row-gap);
    --s360-layout-page-gap:var(--s360-p3-shell-row-gap);
    --s360-layout-section-gap:var(--s360-p3-shell-row-gap);
    --s360-layout-panel-gap:var(--s360-p3-shell-row-gap);
    --s360-layout-grid-gap:var(--s360-p3-shell-row-gap);
    --s360-tabs-main-margin:var(--s360-p3-shell-row-gap) 0 0;
    --s360-tabs-sub-margin:var(--s360-p3-shell-row-gap) 0 0;
}

body.wp-admin #wpbody-content .wrap.s360-admin-wrapper:is(
    .s360-page-shell,
    .s360-ui-shell,
    .s360-grouped-admin,
    .s360-tailwind-foundation,
    .school360-tailwind-foundation,
    .s360-wrap,
    .school360-wrap,
    .s360-admin-dashboard,
    .s360-reports-workspace,
    .s360-analytics-workspace,
    .s360-student-workspace,
    .s360-admissions-workspace,
    .s360-custom-fields-page,
    .s360-calendar-phase-k,
    .s360-hr-phase-i,
    .s360-finance-phase-h,
    .s360-expense-phase-h
) > :where(
    .s360-ui-page-header,
    .s360-page-hero,
    .s360-grouped-admin__hero,
    .s360-grouped-admin__notice-slot,
    .s360-grouped-admin__top-surfaces,
    .s360-ui-header-utility-grid,
    .s360-admin-dashboard__top-surfaces,
    .s360-ui-page-notices,
    .s360-ui-tabs,
    .s360-ui-tabs__nav,
    .nav-tab-wrapper,
    .s360-ui-main-tabs,
    .s360-ui-sub-tabs,
    .s360-grouped-admin__main-tabs,
    .s360-admin-dashboard__tabs,
    .s360-finance-tabs,
    .s360-admissions-tabs,
    .s360-calendar-action-tabs,
    .s360-hr-nav,
    .s360-admin-nav-pills,
    .s360-report-nav,
    .s360-page-shell__body,
    .s360-ui-shell,
    .s360-grouped-admin__content,
    .s360-admin-dashboard__workspace,
    .s360-calendar-workspace,
    .s360-hr-shell,
    .s360-hr-main,
    .s360-ui-card,
    .s360-ui-section-card,
    .s360-ui-dashboard-panel,
    .s360-ui-admin-panel,
    .s360-admin-panel,
    .s360-report-section-panel,
    .s360-report-role-panel,
    .s360-report-document-header,
    .s360-report-executive-summary,
    .s360-report-filter-panel,
    .s360-report-help-panel,
    .s360-report-insights,
    .s360-ui-grid,
    .s360-grid,
    .s360-three-col,
    .postbox,
    .wrap.s360-admin-wrapper
):not(.s360-spacing-legacy):not(.s360-density-comfortable){
    box-sizing:border-box;
    width:100%;
    max-width:100%;
    min-width:0;
    margin-block-start:0;
    margin-block-end:0;
    margin-inline-start:0;
    margin-inline-end:0;
}

body.wp-admin #wpbody-content .wrap.s360-admin-wrapper:is(
    .s360-page-shell,
    .s360-ui-shell,
    .s360-grouped-admin,
    .s360-tailwind-foundation,
    .school360-tailwind-foundation,
    .s360-wrap,
    .school360-wrap,
    .s360-admin-dashboard,
    .s360-reports-workspace,
    .s360-analytics-workspace,
    .s360-student-workspace,
    .s360-admissions-workspace,
    .s360-custom-fields-page,
    .s360-calendar-phase-k,
    .s360-hr-phase-i,
    .s360-finance-phase-h,
    .s360-expense-phase-h
) > :where(
    .s360-ui-page-header,
    .s360-page-hero,
    .s360-grouped-admin__hero,
    .s360-grouped-admin__notice-slot,
    .s360-grouped-admin__top-surfaces,
    .s360-ui-header-utility-grid,
    .s360-admin-dashboard__top-surfaces,
    .s360-ui-page-notices,
    .s360-ui-tabs,
    .s360-ui-tabs__nav,
    .nav-tab-wrapper,
    .s360-ui-main-tabs,
    .s360-ui-sub-tabs,
    .s360-grouped-admin__main-tabs,
    .s360-admin-dashboard__tabs,
    .s360-finance-tabs,
    .s360-admissions-tabs,
    .s360-calendar-action-tabs,
    .s360-hr-nav,
    .s360-admin-nav-pills,
    .s360-report-nav,
    .s360-page-shell__body,
    .s360-ui-shell,
    .s360-grouped-admin__content,
    .s360-admin-dashboard__workspace,
    .s360-calendar-workspace,
    .s360-hr-shell,
    .s360-hr-main,
    .s360-ui-card,
    .s360-ui-section-card,
    .s360-ui-dashboard-panel,
    .s360-ui-admin-panel,
    .s360-admin-panel,
    .s360-report-section-panel,
    .s360-report-role-panel,
    .s360-report-document-header,
    .s360-report-executive-summary,
    .s360-report-filter-panel,
    .s360-report-help-panel,
    .s360-report-insights,
    .s360-ui-grid,
    .s360-grid,
    .s360-three-col,
    .postbox,
    .wrap.s360-admin-wrapper
):not(.s360-spacing-legacy):not(.s360-density-comfortable) + :where(
    .s360-ui-page-header,
    .s360-page-hero,
    .s360-grouped-admin__hero,
    .s360-grouped-admin__notice-slot,
    .s360-grouped-admin__top-surfaces,
    .s360-ui-header-utility-grid,
    .s360-admin-dashboard__top-surfaces,
    .s360-ui-page-notices,
    .s360-ui-tabs,
    .s360-ui-tabs__nav,
    .nav-tab-wrapper,
    .s360-ui-main-tabs,
    .s360-ui-sub-tabs,
    .s360-grouped-admin__main-tabs,
    .s360-admin-dashboard__tabs,
    .s360-finance-tabs,
    .s360-admissions-tabs,
    .s360-calendar-action-tabs,
    .s360-hr-nav,
    .s360-admin-nav-pills,
    .s360-report-nav,
    .s360-page-shell__body,
    .s360-ui-shell,
    .s360-grouped-admin__content,
    .s360-admin-dashboard__workspace,
    .s360-calendar-workspace,
    .s360-hr-shell,
    .s360-hr-main,
    .s360-ui-card,
    .s360-ui-section-card,
    .s360-ui-dashboard-panel,
    .s360-ui-admin-panel,
    .s360-admin-panel,
    .s360-report-section-panel,
    .s360-report-role-panel,
    .s360-report-document-header,
    .s360-report-executive-summary,
    .s360-report-filter-panel,
    .s360-report-help-panel,
    .s360-report-insights,
    .s360-ui-grid,
    .s360-grid,
    .s360-three-col,
    .postbox,
    .wrap.s360-admin-wrapper
):not(.s360-spacing-legacy):not(.s360-density-comfortable){
    margin-block-start:var(--s360-p3-shell-row-gap);
}

body.wp-admin #wpbody-content .wrap.s360-admin-wrapper :where(
    .s360-page-shell__body,
    .s360-ui-shell,
    .s360-grouped-admin__content,
    .s360-reports-workspace__content,
    .s360-admin-dashboard__workspace,
    .s360-calendar-workspace,
    .s360-hr-shell,
    .s360-hr-main,
    .s360-finance-page,
    .s360-student-workspace,
    .s360-admissions-workspace,
    .s360-custom-fields-workspace,
    .s360-communication-center,
    .s360-expense-dashboard-panels,
    .s360-builder-panels
){
    box-sizing:border-box;
    width:100%;
    max-width:100%;
    min-width:0;
    row-gap:var(--s360-p3-shell-row-gap);
}

body.wp-admin #wpbody-content .wrap.s360-admin-wrapper :where(
    .s360-page-shell__body,
    .s360-ui-shell,
    .s360-grouped-admin__content,
    .s360-reports-workspace__content,
    .s360-admin-dashboard__workspace,
    .s360-calendar-workspace,
    .s360-hr-shell,
    .s360-hr-main,
    .s360-finance-page,
    .s360-student-workspace,
    .s360-admissions-workspace,
    .s360-custom-fields-workspace,
    .s360-communication-center,
    .s360-expense-dashboard-panels,
    .s360-builder-panels
) > :where(
    .wrap.s360-admin-wrapper,
    .s360-wrap,
    .school360-wrap,
    .s360-page-shell,
    .s360-ui-shell,
    .s360-ui-page-header,
    .s360-page-hero,
    .s360-grouped-admin__hero,
    .s360-grouped-admin__notice-slot,
    .s360-grouped-admin__top-surfaces,
    .s360-ui-header-utility-grid,
    .s360-admin-dashboard__top-surfaces,
    .s360-ui-tabs,
    .s360-ui-tabs__nav,
    .nav-tab-wrapper,
    .s360-ui-main-tabs,
    .s360-ui-sub-tabs,
    .s360-grouped-admin__main-tabs,
    .s360-admin-dashboard__tabs,
    .s360-finance-tabs,
    .s360-admissions-tabs,
    .s360-calendar-action-tabs,
    .s360-hr-nav,
    .s360-admin-nav-pills,
    .s360-report-nav,
    .s360-ui-card,
    .s360-ui-section-card,
    .s360-ui-dashboard-panel,
    .s360-ui-admin-panel,
    .s360-admin-panel,
    .s360-admin-secondary-panel,
    .s360-system-panel,
    .s360-school-panel,
    .s360-builder-panel,
    .s360-finance-tab-panel,
    .s360-finance-analytics-panel,
    .s360-admissions-section,
    .s360-communication-form-card,
    .s360-communication-send-card,
    .s360-communication-workflow-card,
    .s360-gd-form-panel,
    .s360-gd-list-shell,
    .s360-hr-panel,
    .s360-hr-card,
    .s360-student-panel,
    .s360-report-section-panel,
    .s360-report-role-panel,
    .s360-report-document-header,
    .s360-report-executive-summary,
    .s360-report-filter-panel,
    .s360-report-help-panel,
    .s360-report-insights,
    .s360-report-kpi-grid,
    .s360-report-insight-grid,
    .s360-report-qa-grid,
    .s360-report-readiness-grid,
    .s360-ui-grid,
    .s360-grid,
    .s360-three-col,
    .s360-table-scroll,
    .s360-ui-table-wrap,
    .s360-table-wrapper,
    .s360-overflow-x,
    .s360-overflow-x-auto,
    .postbox
):not(.s360-spacing-legacy):not(.s360-density-comfortable){
    box-sizing:border-box;
    max-width:100%;
    min-width:0;
    margin-block-start:0;
    margin-block-end:0;
    margin-inline-start:0;
    margin-inline-end:0;
}

body.wp-admin #wpbody-content .wrap.s360-admin-wrapper :where(
    .s360-page-shell__body,
    .s360-ui-shell,
    .s360-grouped-admin__content,
    .s360-reports-workspace__content,
    .s360-admin-dashboard__workspace,
    .s360-calendar-workspace,
    .s360-hr-shell,
    .s360-hr-main,
    .s360-finance-page,
    .s360-student-workspace,
    .s360-admissions-workspace,
    .s360-custom-fields-workspace,
    .s360-communication-center,
    .s360-expense-dashboard-panels,
    .s360-builder-panels
) > :where(
    .wrap.s360-admin-wrapper,
    .s360-wrap,
    .school360-wrap,
    .s360-page-shell,
    .s360-ui-shell,
    .s360-ui-page-header,
    .s360-page-hero,
    .s360-grouped-admin__hero,
    .s360-grouped-admin__notice-slot,
    .s360-grouped-admin__top-surfaces,
    .s360-ui-header-utility-grid,
    .s360-admin-dashboard__top-surfaces,
    .s360-ui-tabs,
    .s360-ui-tabs__nav,
    .nav-tab-wrapper,
    .s360-ui-main-tabs,
    .s360-ui-sub-tabs,
    .s360-grouped-admin__main-tabs,
    .s360-admin-dashboard__tabs,
    .s360-finance-tabs,
    .s360-admissions-tabs,
    .s360-calendar-action-tabs,
    .s360-hr-nav,
    .s360-admin-nav-pills,
    .s360-report-nav,
    .s360-ui-card,
    .s360-ui-section-card,
    .s360-ui-dashboard-panel,
    .s360-ui-admin-panel,
    .s360-admin-panel,
    .s360-admin-secondary-panel,
    .s360-system-panel,
    .s360-school-panel,
    .s360-builder-panel,
    .s360-finance-tab-panel,
    .s360-finance-analytics-panel,
    .s360-admissions-section,
    .s360-communication-form-card,
    .s360-communication-send-card,
    .s360-communication-workflow-card,
    .s360-gd-form-panel,
    .s360-gd-list-shell,
    .s360-hr-panel,
    .s360-hr-card,
    .s360-student-panel,
    .s360-report-section-panel,
    .s360-report-role-panel,
    .s360-report-document-header,
    .s360-report-executive-summary,
    .s360-report-filter-panel,
    .s360-report-help-panel,
    .s360-report-insights,
    .s360-report-kpi-grid,
    .s360-report-insight-grid,
    .s360-report-qa-grid,
    .s360-report-readiness-grid,
    .s360-ui-grid,
    .s360-grid,
    .s360-three-col,
    .s360-table-scroll,
    .s360-ui-table-wrap,
    .s360-table-wrapper,
    .s360-overflow-x,
    .s360-overflow-x-auto,
    .postbox
):not(.s360-spacing-legacy):not(.s360-density-comfortable) + :where(
    .wrap.s360-admin-wrapper,
    .s360-wrap,
    .school360-wrap,
    .s360-page-shell,
    .s360-ui-shell,
    .s360-ui-page-header,
    .s360-page-hero,
    .s360-grouped-admin__hero,
    .s360-grouped-admin__notice-slot,
    .s360-grouped-admin__top-surfaces,
    .s360-ui-header-utility-grid,
    .s360-admin-dashboard__top-surfaces,
    .s360-ui-tabs,
    .s360-ui-tabs__nav,
    .nav-tab-wrapper,
    .s360-ui-main-tabs,
    .s360-ui-sub-tabs,
    .s360-grouped-admin__main-tabs,
    .s360-admin-dashboard__tabs,
    .s360-finance-tabs,
    .s360-admissions-tabs,
    .s360-calendar-action-tabs,
    .s360-hr-nav,
    .s360-admin-nav-pills,
    .s360-report-nav,
    .s360-ui-card,
    .s360-ui-section-card,
    .s360-ui-dashboard-panel,
    .s360-ui-admin-panel,
    .s360-admin-panel,
    .s360-admin-secondary-panel,
    .s360-system-panel,
    .s360-school-panel,
    .s360-builder-panel,
    .s360-finance-tab-panel,
    .s360-finance-analytics-panel,
    .s360-admissions-section,
    .s360-communication-form-card,
    .s360-communication-send-card,
    .s360-communication-workflow-card,
    .s360-gd-form-panel,
    .s360-gd-list-shell,
    .s360-hr-panel,
    .s360-hr-card,
    .s360-student-panel,
    .s360-report-section-panel,
    .s360-report-role-panel,
    .s360-report-document-header,
    .s360-report-executive-summary,
    .s360-report-filter-panel,
    .s360-report-help-panel,
    .s360-report-insights,
    .s360-report-kpi-grid,
    .s360-report-insight-grid,
    .s360-report-qa-grid,
    .s360-report-readiness-grid,
    .s360-ui-grid,
    .s360-grid,
    .s360-three-col,
    .s360-table-scroll,
    .s360-ui-table-wrap,
    .s360-table-wrapper,
    .s360-overflow-x,
    .s360-overflow-x-auto,
    .postbox
):not(.s360-spacing-legacy):not(.s360-density-comfortable){
    margin-block-start:var(--s360-p3-shell-row-gap);
}

body.wp-admin #wpbody-content .wrap.s360-admin-wrapper .s360-reports-workspace__content > .s360-report-document-header:first-child{
    margin-block-start:0;
}

body.wp-admin #wpbody-content .wrap.s360-admin-wrapper .s360-reports-workspace__content > .s360-report-nav.s360-ui-grid,
body.wp-admin #wpbody-content .wrap.s360-admin-wrapper .s360-reports-workspace__content > .s360-report-kpi-grid.s360-ui-grid,
body.wp-admin #wpbody-content .wrap.s360-admin-wrapper .s360-reports-workspace__content > .s360-report-insight-grid,
body.wp-admin #wpbody-content .wrap.s360-admin-wrapper .s360-reports-workspace__content > .s360-report-qa-grid,
body.wp-admin #wpbody-content .wrap.s360-admin-wrapper .s360-reports-workspace__content > .s360-report-readiness-grid,
body.wp-admin #wpbody-content .wrap.s360-admin-wrapper :where(.s360-ui-grid,.s360-grid,.s360-card-grid,.s360-section-grid,.s360-dashboard-grid,.s360-report-grid){
    gap:var(--s360-p3-shell-row-gap);
}

@media (max-width:782px){
    body.wp-admin #wpbody-content .wrap.s360-admin-wrapper{
        --s360-p3-shell-row-gap:var(--s360-p3-shell-row-gap-mobile,8px);
        --s360-body-shell-stack-gap:var(--s360-p3-shell-row-gap);
        --s360-page-shell-stack-gap:var(--s360-p3-shell-row-gap);
        --s360-module-stack-gap:var(--s360-p3-shell-row-gap);
        --s360-module-section-gap:var(--s360-p3-shell-row-gap);
        --s360-layout-page-gap:var(--s360-p3-shell-row-gap);
        --s360-layout-section-gap:var(--s360-p3-shell-row-gap);
        --s360-layout-panel-gap:var(--s360-p3-shell-row-gap);
        --s360-layout-grid-gap:var(--s360-p3-shell-row-gap);
        --s360-tabs-main-margin:var(--s360-p3-shell-row-gap) 0 0;
        --s360-tabs-sub-margin:var(--s360-p3-shell-row-gap) 0 0;
    }
}


/* v13.6.30 P4 Top Stack Gap Alignment.
 * Scope: CSS-only follow-up over P3. Visual QA after P3 confirmed that the
 * direct-child stack is mostly fixed, but the page-header -> notification /
 * readiness card -> main tabs vertical rhythm remained tighter than the card
 * and section rhythm. P4 promotes the shell row gap from the compact card gap
 * to the unified stack gap and explicitly applies the same gap to the top
 * notification/readiness and main/sub navigation stack. It does not globally
 * reset .s360-mt-* / .s360-mb-* utilities, does not add important override, and does
 * not change PHP markup, JS hooks, database, permissions, routes or Tailwind
 * build output.
 */
body.wp-admin #wpbody-content .wrap.s360-admin-wrapper{
    --s360-p4-top-stack-gap:var(--s360-unified-stack-gap,14px);
    --s360-p4-top-stack-gap-mobile:var(--s360-unified-stack-gap-mobile,10px);
    --s360-p3-shell-row-gap:var(--s360-p4-top-stack-gap);
    --s360-body-shell-stack-gap:var(--s360-p4-top-stack-gap);
    --s360-page-shell-stack-gap:var(--s360-p4-top-stack-gap);
    --s360-module-stack-gap:var(--s360-p4-top-stack-gap);
    --s360-dashboard-workspace-gap:var(--s360-p4-top-stack-gap);
    --s360-layout-page-gap:var(--s360-p4-top-stack-gap);
    --s360-layout-section-gap:var(--s360-p4-top-stack-gap);
    --s360-layout-panel-gap:var(--s360-p4-top-stack-gap);
    --s360-layout-grid-gap:var(--s360-p4-top-stack-gap);
    --s360-tabs-main-margin:var(--s360-p4-top-stack-gap) 0 0;
    --s360-tabs-sub-margin:var(--s360-p4-top-stack-gap) 0 0;
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper > :where(
    .s360-ui-page-header,
    .s360-page-hero,
    .s360-grouped-admin__hero,
    .s360-grouped-admin__notice-slot,
    .s360-grouped-admin__top-surfaces,
    .s360-ui-header-utility-grid,
    .s360-admin-dashboard__top-surfaces,
    .s360-readiness-hero,
    .s360-settings-hero,
    .s360-system-hero,
    .s360-ui-page-notices,
    .s360-ui-tabs,
    .s360-ui-tabs__nav,
    .nav-tab-wrapper,
    .s360-ui-main-tabs,
    .s360-grouped-admin__main-tabs,
    .s360-ui-sub-tabs,
    .s360-students-subnav,
    .s360-student-ops-subtabs,
    .s360-people-subnav,
    .s360-communication-subnav,
    .s360-grouped-admin__content,
    .s360-admin-dashboard__workspace,
    .s360-calendar-workspace,
    .s360-student-workspace,
    .s360-reports-workspace__content,
    .s360-hr-shell,
    .s360-hr-main,
    .s360-ui-card,
    .s360-ui-section-card,
    .s360-ui-dashboard-panel,
    .s360-report-document-header,
    .s360-report-section-panel,
    .s360-report-role-panel,
    .s360-report-nav,
    .s360-ui-grid,
    .s360-grid,
    .s360-three-col,
    .postbox
):not(.s360-spacing-legacy):not(.s360-density-comfortable){
    margin-block-end:0;
}

body.wp-admin #wpbody-content > .wrap.s360-admin-wrapper > :where(
    .s360-grouped-admin__top-surfaces,
    .s360-ui-header-utility-grid,
    .s360-admin-dashboard__top-surfaces,
    .s360-readiness-hero,
    .s360-settings-hero,
    .s360-system-hero,
    .s360-ui-page-notices,
    .s360-ui-tabs,
    .s360-ui-tabs__nav,
    .nav-tab-wrapper,
    .s360-ui-main-tabs,
    .s360-grouped-admin__main-tabs,
    .s360-ui-sub-tabs,
    .s360-students-subnav,
    .s360-student-ops-subtabs,
    .s360-people-subnav,
    .s360-communication-subnav,
    .s360-grouped-admin__content,
    .s360-admin-dashboard__workspace,
    .s360-calendar-workspace,
    .s360-student-workspace,
    .s360-reports-workspace__content,
    .s360-hr-shell,
    .s360-hr-main
):not(:first-child):not(.s360-spacing-legacy):not(.s360-density-comfortable){
    margin-block-start:var(--s360-p4-top-stack-gap);
}

body.wp-admin #wpbody-content .wrap.s360-admin-wrapper :where(
    .s360-ui-main-tabs:not(.s360-ui-sub-tabs),
    .s360-grouped-admin__main-tabs.s360-ui-main-tabs:not(.s360-ui-sub-tabs),
    .s360-admin-dashboard__tabs.s360-ui-main-tabs,
    .s360-finance-tabs.s360-ui-main-tabs,
    .s360-admissions-tabs.s360-ui-main-tabs,
    .s360-calendar-action-tabs.s360-ui-main-tabs,
    .s360-hr-nav.s360-ui-main-tabs,
    .nav-tab-wrapper:not(.s360-ui-sub-tabs)
):not(.s360-spacing-legacy):not(.s360-density-comfortable){
    margin-block-start:var(--s360-p4-top-stack-gap);
    margin-block-end:0;
}

body.wp-admin #wpbody-content .wrap.s360-admin-wrapper :where(
    .s360-ui-sub-tabs:not(.s360-ui-main-tabs),
    .s360-students-subnav.s360-ui-sub-tabs,
    .s360-student-ops-subtabs.s360-ui-sub-tabs,
    .s360-people-subnav.s360-ui-sub-tabs,
    .s360-communication-subnav.s360-ui-sub-tabs,
    .s360-hr-profile-tabs.s360-ui-sub-tabs,
    .s360-workspace-tabs.s360-ui-sub-tabs,
    #s360-structure-tabs.s360-ui-sub-tabs
):not(.s360-spacing-legacy):not(.s360-density-comfortable){
    margin-block-start:var(--s360-p4-top-stack-gap);
    margin-block-end:0;
}

body.wp-admin #wpbody-content .wrap.s360-admin-wrapper :where(
    .s360-grouped-admin__content,
    .s360-admin-dashboard__workspace,
    .s360-calendar-workspace,
    .s360-student-workspace,
    .s360-reports-workspace__content,
    .s360-hr-main,
    .s360-page-shell__body,
    .s360-ui-shell
) > :where(
    .s360-ui-main-tabs,
    .s360-ui-sub-tabs,
    .nav-tab-wrapper,
    .s360-ui-card,
    .s360-ui-section-card,
    .s360-ui-dashboard-panel,
    .s360-admin-dashboard__utility-card,
    .s360-report-document-header,
    .s360-report-section-panel,
    .s360-report-role-panel,
    .s360-report-nav,
    .s360-report-kpi-grid,
    .s360-report-insight-grid,
    .s360-report-qa-grid,
    .s360-report-readiness-grid,
    .s360-ui-grid,
    .s360-grid,
    .s360-three-col,
    .s360-table-scroll,
    .s360-ui-table-wrap,
    .postbox
):not(.s360-spacing-legacy):not(.s360-density-comfortable) + :where(
    .s360-ui-main-tabs,
    .s360-ui-sub-tabs,
    .nav-tab-wrapper,
    .s360-ui-card,
    .s360-ui-section-card,
    .s360-ui-dashboard-panel,
    .s360-admin-dashboard__utility-card,
    .s360-report-document-header,
    .s360-report-section-panel,
    .s360-report-role-panel,
    .s360-report-nav,
    .s360-report-kpi-grid,
    .s360-report-insight-grid,
    .s360-report-qa-grid,
    .s360-report-readiness-grid,
    .s360-ui-grid,
    .s360-grid,
    .s360-three-col,
    .s360-table-scroll,
    .s360-ui-table-wrap,
    .postbox
):not(.s360-spacing-legacy):not(.s360-density-comfortable){
    margin-block-start:var(--s360-p4-top-stack-gap);
}

@media (max-width:782px){
    body.wp-admin #wpbody-content .wrap.s360-admin-wrapper{
        --s360-p4-top-stack-gap:var(--s360-p4-top-stack-gap-mobile,10px);
        --s360-p3-shell-row-gap:var(--s360-p4-top-stack-gap);
        --s360-body-shell-stack-gap:var(--s360-p4-top-stack-gap);
        --s360-page-shell-stack-gap:var(--s360-p4-top-stack-gap);
        --s360-module-stack-gap:var(--s360-p4-top-stack-gap);
        --s360-dashboard-workspace-gap:var(--s360-p4-top-stack-gap);
        --s360-layout-page-gap:var(--s360-p4-top-stack-gap);
        --s360-layout-section-gap:var(--s360-p4-top-stack-gap);
        --s360-layout-panel-gap:var(--s360-p4-top-stack-gap);
        --s360-layout-grid-gap:var(--s360-p4-top-stack-gap);
        --s360-tabs-main-margin:var(--s360-p4-top-stack-gap) 0 0;
        --s360-tabs-sub-margin:var(--s360-p4-top-stack-gap) 0 0;
    }
}


/* v13.6.30 P5 Global Utility Margin Reset.
 * Scope: CSS-only admin shell layer over P4. Visual QA after P4 showed that
 * the remaining inconsistent vertical rhythm no longer comes only from known
 * tab/card selectors, but also from scattered legacy utility margin classes and
 * grid/card wrapper margins inside nested School 360 admin workspaces. This
 * layer intentionally resets S360 vertical margin utilities globally inside the
 * School 360 admin shell only, then restores one deterministic stack rhythm for
 * direct shell/workspace children. It does not affect the WordPress admin
 * outside School 360, public/portal screens, PHP markup, JS hooks, database,
 * routes, permissions, nonces, or Tailwind build output.
 */
body.wp-admin #wpbody-content .wrap.s360-admin-wrapper{
    --s360-p5-stack-gap:var(--s360-unified-stack-gap,14px);
    --s360-p5-stack-gap-mobile:var(--s360-unified-stack-gap-mobile,10px);
    --s360-p5-grid-gap:var(--s360-unified-stack-gap,14px);
    --s360-p5-grid-gap-mobile:var(--s360-unified-stack-gap-mobile,10px);
    --s360-p4-top-stack-gap:var(--s360-p5-stack-gap);
    --s360-p3-shell-row-gap:var(--s360-p5-stack-gap);
    --s360-p2-legacy-card-gap:var(--s360-p5-stack-gap);
    --s360-p2-legacy-layout-gap:var(--s360-p5-grid-gap);
    --s360-body-shell-stack-gap:var(--s360-p5-stack-gap);
    --s360-page-shell-stack-gap:var(--s360-p5-stack-gap);
    --s360-module-stack-gap:var(--s360-p5-stack-gap);
    --s360-module-section-gap:var(--s360-p5-stack-gap);
    --s360-dashboard-workspace-gap:var(--s360-p5-stack-gap);
    --s360-layout-page-gap:var(--s360-p5-stack-gap);
    --s360-layout-section-gap:var(--s360-p5-stack-gap);
    --s360-layout-panel-gap:var(--s360-p5-stack-gap);
    --s360-layout-grid-gap:var(--s360-p5-grid-gap);
    --s360-tabs-main-margin:0;
    --s360-tabs-sub-margin:0;
}

body.wp-admin #wpbody-content .wrap.s360-admin-wrapper :where(
    [class*="s360-mt-"],
    [class*="s360-mb-"],
    [class*="s360-my-"],
    [class*="s360-u-mt-"],
    [class*="s360-u-mb-"],
    [class*="s360-u-my-"],
    [class*="-mt16"],
    [class*="-mt14"],
    [class*="-mt12"],
    [class*="-mt10"],
    [class*="-mt8"],
    [class*="-mt6"],
    [class*="-mt4"],
    [class*="-mt-16"],
    [class*="-mt-14"],
    [class*="-mt-12"],
    [class*="-mt-10"],
    [class*="-mt-8"],
    [class*="-mt-6"],
    [class*="-mt-4"],
    [class*="-mb16"],
    [class*="-mb14"],
    [class*="-mb12"],
    [class*="-mb10"],
    [class*="-mb8"],
    [class*="-mb6"],
    [class*="-mb4"],
    [class*="-mb-16"],
    [class*="-mb-14"],
    [class*="-mb-12"],
    [class*="-mb-10"],
    [class*="-mb-8"],
    [class*="-mb-6"],
    [class*="-mb-4"],
    [class*="-my16"],
    [class*="-my14"],
    [class*="-my12"],
    [class*="-my10"],
    [class*="-my8"],
    [class*="-my6"],
    [class*="-my4"],
    [class*="-my-16"],
    [class*="-my-14"],
    [class*="-my-12"],
    [class*="-my-10"],
    [class*="-my-8"],
    [class*="-my-6"],
    [class*="-my-4"]
):not(.s360-spacing-legacy):not(.s360-density-comfortable){
    margin-block-start:0;
    margin-block-end:0;
    margin-inline-start:0;
    margin-inline-end:0;
}

body.wp-admin #wpbody-content .wrap.s360-admin-wrapper :where(
    .s360-ui-main-tabs,
    .s360-grouped-admin__main-tabs,
    .s360-admin-dashboard__tabs,
    .s360-finance-tabs,
    .s360-admissions-tabs,
    .s360-calendar-action-tabs,
    .s360-hr-nav,
    .s360-admin-nav-pills,
    .s360-report-nav,
    .s360-ui-sub-tabs,
    .s360-students-subnav,
    .s360-student-ops-subtabs,
    .s360-student-profile-tabs-wrap,
    .s360-student-workspace__tabs,
    .s360-workspace-tabs,
    .s360-people-subnav,
    .s360-people-subnav--nested,
    .s360-communication-subnav,
    .s360-communication-subnav--nested,
    .s360-expense-workspace-tabs,
    .s360-school-tabs,
    .s360-system-tabs,
    .s360-builder-tabs,
    .s360-custom-fields-tabs,
    .s360-hr-profile-tabs,
    .s360-hr-subnav,
    .s360-hr-portal-tabs,
    .s360-tabs,
    .s360-quick-actions-under-tabs
):not(.s360-spacing-legacy):not(.s360-density-comfortable){
    margin-block-start:0;
    margin-block-end:0;
    margin-inline-start:0;
    margin-inline-end:0;
}

body.wp-admin #wpbody-content .wrap.s360-admin-wrapper > *:not(.s360-spacing-legacy):not(.s360-density-comfortable){
    box-sizing:border-box;
    max-width:100%;
    min-width:0;
    margin-block-start:0;
    margin-block-end:0;
}

body.wp-admin #wpbody-content .wrap.s360-admin-wrapper > *:not([hidden]):not(.s360-spacing-legacy):not(.s360-density-comfortable) + *:not([hidden]):not(.s360-spacing-legacy):not(.s360-density-comfortable){
    margin-block-start:var(--s360-p5-stack-gap);
}

body.wp-admin #wpbody-content .wrap.s360-admin-wrapper :where(
    .s360-page-shell__body,
    .s360-grouped-admin__content,
    .s360-admin-dashboard__workspace,
    .s360-admin-dashboard__tab-panel,
    .s360-calendar-workspace,
    .s360-student-workspace,
    .s360-student-workspace--admin,
    .s360-reports-workspace__content,
    .s360-analytics-workspace,
    .s360-admissions-workspace,
    .s360-custom-fields-workspace,
    .s360-communication-center,
    .s360-finance-page,
    .s360-expense-dashboard-panels,
    .s360-builder-panels,
    .s360-hr-shell,
    .s360-hr-main
):not(.s360-spacing-legacy):not(.s360-density-comfortable) > *:not(.s360-spacing-legacy):not(.s360-density-comfortable){
    box-sizing:border-box;
    max-width:100%;
    min-width:0;
    margin-block-start:0;
    margin-block-end:0;
}

body.wp-admin #wpbody-content .wrap.s360-admin-wrapper :where(
    .s360-page-shell__body,
    .s360-grouped-admin__content,
    .s360-admin-dashboard__workspace,
    .s360-admin-dashboard__tab-panel,
    .s360-calendar-workspace,
    .s360-student-workspace,
    .s360-student-workspace--admin,
    .s360-reports-workspace__content,
    .s360-analytics-workspace,
    .s360-admissions-workspace,
    .s360-custom-fields-workspace,
    .s360-communication-center,
    .s360-finance-page,
    .s360-expense-dashboard-panels,
    .s360-builder-panels,
    .s360-hr-shell,
    .s360-hr-main
):not(.s360-spacing-legacy):not(.s360-density-comfortable) > *:not([hidden]):not(.s360-spacing-legacy):not(.s360-density-comfortable) + *:not([hidden]):not(.s360-spacing-legacy):not(.s360-density-comfortable){
    margin-block-start:var(--s360-p5-stack-gap);
}

body.wp-admin #wpbody-content .wrap.s360-admin-wrapper :where(
    .s360-ui-grid,
    .s360-grid,
    .s360-grid-2,
    .s360-grid-3,
    .s360-grid-4,
    .s360-grid-auto,
    .s360-grid-auto-lg,
    .s360-grid-auto-320,
    .s360-stat-grid,
    .s360-kpi-grid,
    .s360-card-grid,
    .s360-section-grid,
    .s360-settings-grid,
    .s360-dashboard-grid,
    .s360-hr-grid,
    .s360-finance-grid,
    .s360-expense-grid,
    .s360-report-grid,
    .s360-admissions-grid,
    .s360-admin-kpi-grid,
    .s360-admin-kpi-grid--compact,
    .s360-admin-attention-grid,
    .s360-admin-shortcuts,
    .s360-ui-dashboard-shortcuts,
    .s360-admin-today-subpanels,
    .s360-report-kpi-grid,
    .s360-report-insight-grid,
    .s360-report-qa-grid,
    .s360-report-readiness-grid,
    .s360-two-col,
    .s360-three-col,
    .s360-filter-grid,
    .s360-filter-grid-5,
    .s360-report-filter-grid,
    .s360-analytics-filter-grid,
    .s360-finance-ledger-filter-grid,
    .s360-u-grid-2-16-mt16,
    .s360-u-grid-3-16-my-16,
    .s360-u-grid-3-12-my12,
    .s360-u-grid-3-12-my14,
    .s360-u-grid-280-16-mt16,
    .s360-u-flex-start-8-my,
    .s360-u-flex-wrap-10-my-lg
):not(.s360-spacing-legacy):not(.s360-density-comfortable){
    row-gap:var(--s360-p5-grid-gap);
    column-gap:var(--s360-p5-grid-gap);
}

body.wp-admin #wpbody-content .wrap.s360-admin-wrapper :where(
    .s360-ui-grid,
    .s360-grid,
    .s360-grid-2,
    .s360-grid-3,
    .s360-grid-4,
    .s360-grid-auto,
    .s360-grid-auto-lg,
    .s360-grid-auto-320,
    .s360-stat-grid,
    .s360-kpi-grid,
    .s360-card-grid,
    .s360-section-grid,
    .s360-settings-grid,
    .s360-dashboard-grid,
    .s360-hr-grid,
    .s360-finance-grid,
    .s360-expense-grid,
    .s360-report-grid,
    .s360-admissions-grid,
    .s360-admin-kpi-grid,
    .s360-admin-kpi-grid--compact,
    .s360-admin-attention-grid,
    .s360-admin-shortcuts,
    .s360-ui-dashboard-shortcuts,
    .s360-admin-today-subpanels,
    .s360-report-kpi-grid,
    .s360-report-insight-grid,
    .s360-report-qa-grid,
    .s360-report-readiness-grid,
    .s360-two-col,
    .s360-three-col
):not(.s360-spacing-legacy):not(.s360-density-comfortable) > *:not(.s360-spacing-legacy):not(.s360-density-comfortable){
    margin-block-start:0;
    margin-block-end:0;
    margin-inline-start:0;
    margin-inline-end:0;
}

body.wp-admin #wpbody-content .wrap.s360-admin-wrapper :where(
    .s360-ui-card,
    .s360-ui-section-card,
    .s360-ui-dashboard-panel,
    .s360-ui-admin-panel,
    .s360-admin-panel,
    .s360-admin-secondary-panel,
    .s360-system-panel,
    .s360-school-panel,
    .s360-builder-panel,
    .s360-finance-tab-panel,
    .s360-finance-analytics-panel,
    .s360-admissions-section,
    .s360-admissions-queue-panel,
    .s360-admissions-command-panel,
    .s360-communication-form-card,
    .s360-communication-send-card,
    .s360-communication-workflow-card,
    .s360-gd-form-panel,
    .s360-gd-list-shell,
    .s360-hr-panel,
    .s360-hr-card,
    .s360-hr-live-panel,
    .s360-hr-side-panel,
    .s360-student-panel,
    .s360-report-section-panel,
    .s360-report-filter-panel,
    .s360-report-help-panel,
    .s360-report-role-panel,
    .s360-report-document-header,
    .s360-admin-dashboard__utility-card,
    .s360-filter-panel,
    .s360-provider-panel,
    .s360-payment-add-panel,
    .s360-gateway-health-panel,
    .s360-audit-json-panel,
    .s360-parent-panel,
    .postbox
):not(.s360-spacing-legacy):not(.s360-density-comfortable){
    margin-block-start:0;
    margin-block-end:0;
}

body.wp-admin #wpbody-content .wrap.s360-admin-wrapper :where(
    .s360-ui-table-wrap,
    .s360-table-scroll,
    .s360-table-wrapper,
    .s360-table-responsive,
    .s360-overflow-x,
    .s360-overflow-x-auto,
    .s360-ui-page-notices,
    .s360-grouped-admin__notice-slot,
    .s360-grouped-admin__top-surfaces,
    .s360-admin-dashboard__top-surfaces,
    .s360-ui-header-utility-grid
):not(.s360-spacing-legacy):not(.s360-density-comfortable){
    margin-block-start:0;
    margin-block-end:0;
}

@media (max-width:782px){
    body.wp-admin #wpbody-content .wrap.s360-admin-wrapper{
        --s360-p5-stack-gap:var(--s360-p5-stack-gap-mobile,10px);
        --s360-p5-grid-gap:var(--s360-p5-grid-gap-mobile,10px);
        --s360-p4-top-stack-gap:var(--s360-p5-stack-gap);
        --s360-p3-shell-row-gap:var(--s360-p5-stack-gap);
        --s360-p2-legacy-card-gap:var(--s360-p5-stack-gap);
        --s360-p2-legacy-layout-gap:var(--s360-p5-grid-gap);
        --s360-body-shell-stack-gap:var(--s360-p5-stack-gap);
        --s360-page-shell-stack-gap:var(--s360-p5-stack-gap);
        --s360-module-stack-gap:var(--s360-p5-stack-gap);
        --s360-module-section-gap:var(--s360-p5-stack-gap);
        --s360-dashboard-workspace-gap:var(--s360-p5-stack-gap);
        --s360-layout-page-gap:var(--s360-p5-stack-gap);
        --s360-layout-section-gap:var(--s360-p5-stack-gap);
        --s360-layout-panel-gap:var(--s360-p5-stack-gap);
        --s360-layout-grid-gap:var(--s360-p5-grid-gap);
    }
}

/* v13.6.30 P6 Unified Stack Gap Contract.
 * Scope: School 360 wp-admin shell only.
 * Goal: force the same external vertical spacing for Dashboard-like module
 * stacks across Academic, Students, People, Communication, Admissions,
 * Finance, Content & Assets, Reports, HR, Expenses and other grouped
 * workspaces. P1-P5 reset utility margins; P6 also normalizes parent
 * display/gap stacks so notification/readiness cards, main tabs, sub tabs,
 * cards, grids and panels share one visible rhythm.
 * Runtime scope: CSS-only; no PHP, JS, DB, Tailwind rebuild, URL, nonce,
 * permission, capability, form/action or workflow changes.
 */
body.wp-admin #wpbody-content .wrap.s360-admin-wrapper{
    --s360-p6-stack-gap:16px;
    --s360-p6-stack-gap-mobile:12px;
    --s360-p6-card-grid-gap:16px;
    --s360-p6-card-grid-gap-mobile:12px;
    --s360-unified-stack-gap:var(--s360-p6-stack-gap);
    --s360-p5-stack-gap:var(--s360-p6-stack-gap);
    --s360-p5-grid-gap:var(--s360-p6-card-grid-gap);
    --s360-p4-top-stack-gap:var(--s360-p6-stack-gap);
    --s360-p3-shell-row-gap:var(--s360-p6-stack-gap);
    --s360-p2-legacy-card-gap:var(--s360-p6-stack-gap);
    --s360-p2-legacy-layout-gap:var(--s360-p6-card-grid-gap);
    --s360-body-shell-stack-gap:var(--s360-p6-stack-gap);
    --s360-page-shell-stack-gap:var(--s360-p6-stack-gap);
    --s360-module-stack-gap:var(--s360-p6-stack-gap);
    --s360-module-section-gap:var(--s360-p6-stack-gap);
    --s360-dashboard-workspace-gap:var(--s360-p6-stack-gap);
    --s360-layout-page-gap:var(--s360-p6-stack-gap);
    --s360-layout-section-gap:var(--s360-p6-stack-gap);
    --s360-layout-panel-gap:var(--s360-p6-stack-gap);
    --s360-layout-grid-gap:var(--s360-p6-card-grid-gap);
}

body.wp-admin #wpbody-content .wrap.s360-admin-wrapper:where(
    .s360-page-shell,
    .s360-grouped-admin,
    .s360-tailwind-foundation,
    .s360-wrap,
    .school360-wrap,
    .s360-admin-dashboard,
    .s360-attendance-phase-k,
    .s360-student-workspace,
    .s360-people-workspace,
    .s360-communication-overview-phase-m,
    .s360-admissions-phase-k,
    .s360-finance-page,
    .s360-content-assets-page,
    .s360-reports-workspace,
    .s360-hr-phase-i
),
body.wp-admin #wpbody-content .wrap.s360-admin-wrapper :where(
    .s360-page-shell__body,
    .s360-ui-shell,
    .s360-grouped-admin__content,
    .s360-admin-dashboard__workspace,
    .s360-admin-dashboard__tab-panel,
    .s360-calendar-workspace,
    .s360-student-workspace,
    .s360-student-workspace--admin,
    .s360-admissions-workspace,
    .s360-communication-center,
    .s360-finance-workspace,
    .s360-finance-page,
    .s360-content-assets-workspace,
    .s360-reports-workspace__content,
    .s360-analytics-workspace,
    .s360-custom-fields-workspace,
    .s360-expense-dashboard-panels,
    .s360-builder-panels,
    .s360-hr-shell,
    .s360-hr-main
):not(.s360-spacing-legacy):not(.s360-density-comfortable){
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:var(--s360-p6-stack-gap);
    row-gap:var(--s360-p6-stack-gap);
}

body.wp-admin #wpbody-content .wrap.s360-admin-wrapper:where(
    .s360-page-shell,
    .s360-grouped-admin,
    .s360-tailwind-foundation,
    .s360-wrap,
    .school360-wrap,
    .s360-admin-dashboard,
    .s360-attendance-phase-k,
    .s360-student-workspace,
    .s360-people-workspace,
    .s360-communication-overview-phase-m,
    .s360-admissions-phase-k,
    .s360-finance-page,
    .s360-content-assets-page,
    .s360-reports-workspace,
    .s360-hr-phase-i
) > *:not(.s360-spacing-legacy):not(.s360-density-comfortable),
body.wp-admin #wpbody-content .wrap.s360-admin-wrapper :where(
    .s360-page-shell__body,
    .s360-ui-shell,
    .s360-grouped-admin__content,
    .s360-admin-dashboard__workspace,
    .s360-admin-dashboard__tab-panel,
    .s360-calendar-workspace,
    .s360-student-workspace,
    .s360-student-workspace--admin,
    .s360-admissions-workspace,
    .s360-communication-center,
    .s360-finance-workspace,
    .s360-finance-page,
    .s360-content-assets-workspace,
    .s360-reports-workspace__content,
    .s360-analytics-workspace,
    .s360-custom-fields-workspace,
    .s360-expense-dashboard-panels,
    .s360-builder-panels,
    .s360-hr-shell,
    .s360-hr-main
):not(.s360-spacing-legacy):not(.s360-density-comfortable) > *:not(.s360-spacing-legacy):not(.s360-density-comfortable){
    min-width:0;
    max-width:100%;
    margin-block-start:0;
    margin-block-end:0;
}

body.wp-admin #wpbody-content .wrap.s360-admin-wrapper :where(
    .wrap.s360-admin-wrapper,
    .s360-wrap,
    .school360-wrap
):not(#wpbody-content > .wrap.s360-admin-wrapper){
    margin-block-start:0;
    margin-block-end:0;
    padding-block-start:0;
    padding-block-end:0;
}

/*
 * v13.6.33 — nested-wrapper stack-gap parity.
 * On grouped-admin pages a second .wrap.s360-admin-wrapper is nested inside
 * .s360-grouped-admin__content. The Phase 6 flex-gap rhythm did not list that
 * nested wrapper, so its direct children (help strip, tab strips, cards) fell
 * back to the legacy adjacent-sibling margin path and rendered an uneven gap
 * around the tab strips. Promote the nested wrapper to the same column flex
 * gap so every block — tab strips included — uses one uniform stack gap.
 */
body.wp-admin #wpbody-content .wrap.s360-admin-wrapper :where(
    .wrap.s360-admin-wrapper,
    .s360-wrap,
    .school360-wrap
):not(#wpbody-content > .wrap.s360-admin-wrapper):not(.s360-spacing-legacy):not(.s360-density-comfortable){
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:var(--s360-p6-stack-gap);
    row-gap:var(--s360-p6-stack-gap);
}

body.wp-admin #wpbody-content .wrap.s360-admin-wrapper :where(
    .wrap.s360-admin-wrapper,
    .s360-wrap,
    .school360-wrap
):not(#wpbody-content > .wrap.s360-admin-wrapper):not(.s360-spacing-legacy):not(.s360-density-comfortable) > *:not(.s360-spacing-legacy):not(.s360-density-comfortable){
    margin-block-start:0;
    margin-block-end:0;
}

body.wp-admin #wpbody-content .wrap.s360-admin-wrapper :where(
    .s360-grouped-admin__hero,
    .s360-ui-page-header,
    .s360-page-hero,
    .s360-grouped-admin__top-surfaces,
    .s360-admin-dashboard__top-surfaces,
    .s360-admin-dashboard__utility-card--notification,
    .s360-ui-header-utility-grid,
    .s360-grouped-admin__notice-slot,
    .s360-ui-tabs,
    .s360-ui-tabs__nav,
    .s360-ui-main-tabs,
    .s360-grouped-admin__main-tabs,
    .nav-tab-wrapper,
    .s360-ui-sub-tabs,
    .s360-students-subnav,
    .s360-workspace-tabs,
    .s360-people-subnav,
    .s360-communication-subnav,
    .s360-admissions-tabs,
    .s360-finance-tabs,
    .s360-expense-workspace-tabs,
    .s360-school-tabs,
    .s360-system-tabs,
    .s360-builder-tabs,
    .s360-custom-fields-tabs,
    .s360-hr-subnav,
    .s360-hr-profile-tabs,
    .s360-hr-portal-tabs,
    .s360-report-nav,
    .s360-quick-actions-under-tabs,
    .s360-ui-card,
    .s360-ui-section-card,
    .s360-ui-dashboard-panel,
    .s360-ui-stat-card,
    .s360-admin-dashboard__utility-card,
    .s360-admin-panel,
    .s360-admin-secondary-panel,
    .s360-system-panel,
    .s360-school-panel,
    .s360-builder-panel,
    .s360-finance-tab-panel,
    .s360-admissions-section,
    .s360-communication-form-card,
    .s360-communication-send-card,
    .s360-communication-workflow-card,
    .s360-hr-panel,
    .s360-hr-card,
    .s360-student-panel,
    .s360-report-section-panel,
    .s360-report-filter-panel,
    .s360-report-help-panel,
    .s360-report-role-panel,
    .s360-report-document-header,
    .postbox
):not(.s360-spacing-legacy):not(.s360-density-comfortable){
    margin-block-start:0;
    margin-block-end:0;
}

body.wp-admin #wpbody-content .wrap.s360-admin-wrapper :where(
    .s360-ui-grid,
    .s360-grid,
    .s360-grid-2,
    .s360-grid-3,
    .s360-grid-4,
    .s360-grid-auto,
    .s360-grid-auto-lg,
    .s360-grid-auto-320,
    .s360-stat-grid,
    .s360-kpi-grid,
    .s360-card-grid,
    .s360-section-grid,
    .s360-settings-grid,
    .s360-dashboard-grid,
    .s360-hr-grid,
    .s360-finance-grid,
    .s360-expense-grid,
    .s360-report-grid,
    .s360-admissions-grid,
    .s360-admin-kpi-grid,
    .s360-admin-kpi-grid--compact,
    .s360-admin-attention-grid,
    .s360-admin-shortcuts,
    .s360-ui-dashboard-shortcuts,
    .s360-admin-today-subpanels,
    .s360-report-kpi-grid,
    .s360-report-insight-grid,
    .s360-report-qa-grid,
    .s360-report-readiness-grid,
    .s360-two-col,
    .s360-three-col,
    .s360-filter-grid,
    .s360-filter-grid-5,
    .s360-report-filter-grid,
    .s360-analytics-filter-grid,
    .s360-finance-ledger-filter-grid
):not(.s360-spacing-legacy):not(.s360-density-comfortable){
    margin-block-start:0;
    margin-block-end:0;
    row-gap:var(--s360-p6-card-grid-gap);
    column-gap:var(--s360-p6-card-grid-gap);
}

body.wp-admin #wpbody-content .wrap.s360-admin-wrapper :where(
    .s360-ui-grid,
    .s360-grid,
    .s360-stat-grid,
    .s360-kpi-grid,
    .s360-card-grid,
    .s360-section-grid,
    .s360-dashboard-grid,
    .s360-report-grid,
    .s360-admissions-grid,
    .s360-admin-kpi-grid,
    .s360-admin-kpi-grid--compact,
    .s360-report-kpi-grid
):not(.s360-spacing-legacy):not(.s360-density-comfortable) > *{
    margin-block-start:0;
    margin-block-end:0;
}

@media (max-width:782px){
    body.wp-admin #wpbody-content .wrap.s360-admin-wrapper{
        --s360-p6-stack-gap:var(--s360-p6-stack-gap-mobile,12px);
        --s360-p6-card-grid-gap:var(--s360-p6-card-grid-gap-mobile,12px);
    }
}

/* P7-P12 admin help/intro strip parity rules moved to
 * assets/css/admin/60-help-strip-contract.css. The extracted file is
 * enqueued after school360-card-system for wp-admin contexts only.
 */

/* ========================================================================== 
   v13.6.36 Phase H — portal statistic-card contract consolidation
   --------------------------------------------------------------------------
   Scope: frontend parent/student portal and staff HR portal stat cards. This
   block intentionally lives in the final shared card layer so it can normalize
   portal stat cards after optional enhancement CSS has loaded. No priority
   flags are used; semantic notices, badges, forms and non-stat portal cards are
   not targeted.
   ========================================================================== */
:where(
  .s360-frontend-portal-phase5,
  .s360-frontend-portal-phase-j,
  .s360-portal,
  .s360-hr-portal-experience,
  .s360-hr-portal-phase-i
) :where(
  .s360-stat-grid,
  .s360-ui-stat-card--hr-portals,
  .s360-hr-portal-mini-grid
){
  gap:var(--s360-statcard-grid-gap,var(--s360-portal-phase5-gap,var(--s360-unified-gap-card,var(--s360-space-sm,12px))));
}

:where(
  .s360-frontend-portal-phase5,
  .s360-frontend-portal-phase-j,
  .s360-portal
) :where(
  .s360-stat-grid > .s360-ui-stat-card,
  .s360-ui-stat-card--portal,
  [data-s360-portal-card="stat"]
),
:where(
  .s360-hr-portal-experience,
  .s360-hr-portal-phase-i
) :where(
  .s360-ui-stat-card--hr-portal,
  .s360-hr-portal-mini-grid > div
){
  box-sizing:border-box;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:flex-start;
  width:100%;
  min-width:0;
  min-height:var(--s360-card-stat-min-height,var(--s360-statcard-min-height,76px));
  margin:0;
  padding:var(--s360-card-stat-padding,var(--s360-statcard-padding,14px 16px));
  gap:var(--s360-card-stat-gap,var(--s360-statcard-gap,8px));
  overflow:hidden;
  color:var(--s360-color-text-heading,#0f172a);
  background:var(--s360-card-stat-bg,var(--s360-statcard-bg,var(--s360-color-bg-subtle,#f8fafc)));
  border:var(--s360-statcard-border-width,1px) solid var(--s360-card-stat-border-color,var(--s360-statcard-border-color,var(--s360-color-border-muted,#e2e8f0)));
  border-radius:var(--s360-card-stat-radius,var(--s360-statcard-radius,var(--s360-radius-xl,12px)));
  box-shadow:var(--s360-card-stat-shadow,var(--s360-statcard-shadow,none));
  text-decoration:none;
  transform:none;
}

:where(
  .s360-frontend-portal-phase5,
  .s360-frontend-portal-phase-j,
  .s360-portal
) :where(
  .s360-stat-grid > .s360-ui-stat-card,
  .s360-ui-stat-card--portal,
  [data-s360-portal-card="stat"]
)::before,
:where(
  .s360-frontend-portal-phase5,
  .s360-frontend-portal-phase-j,
  .s360-portal
) :where(
  .s360-stat-grid > .s360-ui-stat-card,
  .s360-ui-stat-card--portal,
  [data-s360-portal-card="stat"]
)::after,
:where(
  .s360-hr-portal-experience,
  .s360-hr-portal-phase-i
) :where(
  .s360-ui-stat-card--hr-portal,
  .s360-hr-portal-mini-grid > div
)::before,
:where(
  .s360-hr-portal-experience,
  .s360-hr-portal-phase-i
) :where(
  .s360-ui-stat-card--hr-portal,
  .s360-hr-portal-mini-grid > div
)::after{
  content:none;
  display:none;
}

:where(
  .s360-frontend-portal-phase5,
  .s360-frontend-portal-phase-j,
  .s360-portal
) :where(
  .s360-stat-grid > .s360-ui-stat-card,
  .s360-ui-stat-card--portal,
  [data-s360-portal-card="stat"]
) > :where(.s360-ui-stat-card__label,.s360-stat-label,span:not(.s360-ui-stat-card__value):first-child),
:where(
  .s360-hr-portal-experience,
  .s360-hr-portal-phase-i
) :where(
  .s360-ui-stat-card--hr-portal,
  .s360-hr-portal-mini-grid > div
) > :where(.s360-ui-stat-card__label,.s360-stat-label,span:first-child){
  order:1;
  display:block;
  margin:0;
  color:var(--s360-color-text-label,var(--s360-color-text-secondary,#475569));
  font-size:var(--s360-statcard-label-size,var(--s360-font-size-xs,12px));
  line-height:var(--s360-statcard-line-height,1.2);
  font-weight:var(--s360-statcard-label-weight,700);
  letter-spacing:-.01em;
  text-transform:none;
}

:where(
  .s360-frontend-portal-phase5,
  .s360-frontend-portal-phase-j,
  .s360-portal
) :where(
  .s360-stat-grid > .s360-ui-stat-card,
  .s360-ui-stat-card--portal,
  [data-s360-portal-card="stat"]
) > :where(.s360-ui-stat-card__value,.s360-stat-value,strong),
:where(
  .s360-hr-portal-experience,
  .s360-hr-portal-phase-i
) :where(
  .s360-ui-stat-card--hr-portal,
  .s360-hr-portal-mini-grid > div
) > :where(.s360-ui-stat-card__value,.s360-stat-value,strong){
  order:2;
  display:block;
  margin:0;
  color:var(--s360-color-text-heading,#0f172a);
  font-size:var(--s360-card-stat-value-size,var(--s360-statcard-value-size,24px));
  line-height:1;
  font-weight:var(--s360-statcard-value-weight,800);
  letter-spacing:-.035em;
}

:where(
  .s360-frontend-portal-phase5,
  .s360-frontend-portal-phase-j,
  .s360-portal
) :where(
  .s360-stat-grid > .s360-ui-stat-card,
  .s360-ui-stat-card--portal,
  [data-s360-portal-card="stat"]
) > :where(.s360-ui-stat-card__helper,.s360-ui-stat-card__meta,small,em,p),
:where(
  .s360-hr-portal-experience,
  .s360-hr-portal-phase-i
) :where(
  .s360-ui-stat-card--hr-portal,
  .s360-hr-portal-mini-grid > div
) > :where(.s360-ui-stat-card__helper,.s360-ui-stat-card__meta,small,em,p){
  order:3;
  display:block;
  margin:0;
  color:var(--s360-color-text-tertiary,#64748b);
  font-size:var(--s360-statcard-meta-size,var(--s360-font-size-xs,12px));
  line-height:1.45;
  font-weight:var(--s360-font-weight-normal,400);
  letter-spacing:0;
  text-transform:none;
}

:where(
  .s360-frontend-portal-phase5,
  .s360-frontend-portal-phase-j,
  .s360-portal
) :where(
  .s360-stat-grid > .s360-ui-stat-card,
  .s360-ui-stat-card--portal,
  [data-s360-portal-card="stat"]
):hover,
:where(
  .s360-hr-portal-experience,
  .s360-hr-portal-phase-i
) :where(
  .s360-ui-stat-card--hr-portal,
  .s360-hr-portal-mini-grid > div
):hover{
  transform:none;
  border-color:var(--s360-card-stat-hover-border-color,var(--s360-color-primary-soft-border,var(--s360-color-border-muted,#e2e8f0)));
  box-shadow:var(--s360-card-stat-hover-shadow,var(--s360-statcard-shadow,none));
}

@media (max-width:720px){
  :where(
    .s360-frontend-portal-phase5,
    .s360-frontend-portal-phase-j,
    .s360-portal
  ) :where(
    .s360-stat-grid > .s360-ui-stat-card,
    .s360-ui-stat-card--portal,
    [data-s360-portal-card="stat"]
  ),
  :where(
    .s360-hr-portal-experience,
    .s360-hr-portal-phase-i
  ) :where(
    .s360-ui-stat-card--hr-portal,
    .s360-hr-portal-mini-grid > div
  ){
    min-height:var(--s360-statcard-mobile-min-height,70px);
  }
}


/* ========================================================================== 
   v13.6.36 Phase K — frontend expense portal statistic-card residual bridge
   --------------------------------------------------------------------------
   Scope: compact Expense Portal status stats that use legacy text-node labels.
   The parent label styling and ordered value element keep the visual contract
   consistent without touching portal PHP markup or workflows. No priority flags.
   ========================================================================== */
.s360-expense-portal-mobile-ready .s360-expense-mobile-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(150px,100%),1fr));
  gap:var(--s360-statcard-grid-gap,var(--s360-portal-phase5-gap,var(--s360-unified-gap-card,var(--s360-space-sm,12px))));
  align-items:stretch;
}

.s360-expense-portal-mobile-ready .s360-expense-mobile-grid > .s360-expense-stat{
  box-sizing:border-box;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:flex-start;
  width:100%;
  min-width:0;
  min-height:var(--s360-card-stat-min-height,var(--s360-statcard-min-height,76px));
  margin:0;
  padding:var(--s360-card-stat-padding,var(--s360-statcard-padding,14px 16px));
  gap:var(--s360-card-stat-gap,var(--s360-statcard-gap,8px));
  overflow:hidden;
  background:var(--s360-card-stat-bg,var(--s360-statcard-bg,var(--s360-color-bg-subtle,#f8fafc)));
  border:var(--s360-statcard-border-width,1px) solid var(--s360-card-stat-border-color,var(--s360-statcard-border-color,var(--s360-color-border-muted,#e2e8f0)));
  border-radius:var(--s360-card-stat-radius,var(--s360-statcard-radius,var(--s360-radius-xl,12px)));
  box-shadow:var(--s360-card-stat-shadow,var(--s360-statcard-shadow,none));
  color:var(--s360-color-text-label,var(--s360-color-text-secondary,#475569));
  font-size:var(--s360-statcard-label-size,var(--s360-font-size-xs,12px));
  line-height:var(--s360-statcard-line-height,1.2);
  font-weight:var(--s360-statcard-label-weight,700);
  letter-spacing:-.01em;
  text-transform:none;
  transform:none;
}

.s360-expense-portal-mobile-ready .s360-expense-mobile-grid > .s360-expense-stat > strong{
  order:2;
  display:block;
  margin:0;
  color:var(--s360-color-text-heading,#0f172a);
  font-size:var(--s360-card-stat-value-size,var(--s360-statcard-value-size,24px));
  line-height:1;
  font-weight:var(--s360-statcard-value-weight,800);
  letter-spacing:-.035em;
}

.s360-expense-portal-mobile-ready .s360-expense-mobile-grid > .s360-expense-stat:hover{
  transform:none;
  border-color:var(--s360-card-stat-hover-border-color,var(--s360-color-primary-soft-border,var(--s360-color-border-muted,#e2e8f0)));
  box-shadow:var(--s360-card-stat-hover-shadow,var(--s360-statcard-shadow,none));
}

@media (max-width:720px){
  .s360-expense-portal-mobile-ready .s360-expense-mobile-grid{
    grid-template-columns:1fr;
  }

  .s360-expense-portal-mobile-ready .s360-expense-mobile-grid > .s360-expense-stat{
    min-height:var(--s360-statcard-mobile-min-height,70px);
  }
}
