/* Organization workspace only; school and platform role layouts are untouched. */
body[data-portal-role="organization_admin"] { --org-ink: #172f49; --org-blue: #205ecf; --org-muted: #60728a; --org-line: #e2e9f1; }
body[data-portal-role="organization_admin"] .page-content { max-width: 1640px; margin-inline: auto; width: 100%; padding: 28px 32px 48px; }
.orgx-workspace { display: flex; flex-direction: column; gap: 24px; color: var(--org-ink); }
.orgx-workspace *, .orgx-workspace *::before, .orgx-workspace *::after { box-sizing: border-box; }
.orgx-context { font-size: 12px; color: var(--org-muted); letter-spacing: .03em; }
.orgx-workspace .org-hero { margin: 0; padding: 30px 32px; border: 1px solid #dce7f7; border-radius: 20px; background: linear-gradient(120deg,#edf4ff,#f8fbff 65%,#edf7f5); box-shadow: none; color: var(--org-ink); }
.orgx-workspace .org-hero h2 { font-family: inherit; font-size: clamp(25px,2.5vw,36px); line-height: 1.2; letter-spacing: -.8px; max-width: 700px; margin: 8px 0 12px; color: var(--org-ink); }
.orgx-workspace .org-hero p { color: #546982; line-height: 1.7; max-width: 700px; }
.orgx-workspace .command-kicker, .orgx-eyebrow { color: #41658c; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.orgx-workspace .card, .orgx-workspace .org-school-card, .orgx-workspace .org-insight-card { border: 1px solid var(--org-line); border-radius: 16px; box-shadow: 0 2px 5px #16355c04; background: white; }
.orgx-workspace .super-kpi-grid { gap: 16px; margin: 0; }
.orgx-workspace .super-kpi-grid > * { border-radius: 16px; padding: 22px; border: 1px solid var(--org-line); box-shadow: none; background: #fff; min-width: 0; }
.orgx-workspace .super-kpi-grid .orgx-text-button { display: block; margin-top: 14px; font-size: 12px; }
.orgx-workspace .super-kpi-grid strong { font-variant-numeric: tabular-nums; }
.orgx-workspace .org-dashboard-grid { margin: 0; grid-template-columns: minmax(0,1.5fr) minmax(310px,1fr); }
.orgx-intelligence-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 24px; order: 0; }
.orgx-intelligence-grid > .card { padding: 24px; min-width: 0; margin: 0; }
.orgx-heading { margin-bottom: 18px; display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.orgx-heading h3 { font-family: inherit; font-size: 20px; margin: 5px 0 0; letter-spacing: -.35px; }
.orgx-heading p, .orgx-note { font-size: 12px; line-height: 1.7; color: var(--org-muted); }
.orgx-select { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--org-muted); margin: 12px 0 16px; }
.orgx-select select { max-width: 240px; min-height: 40px; border: 1px solid #d9e3ef; border-radius: 8px; background: #fff; color: var(--org-ink); padding: 7px 10px; }
.orgx-bars { display: grid; gap: 12px; margin: 22px 0; }
.orgx-bar-row { display: grid; grid-template-columns: minmax(90px,1fr) minmax(60px,1fr) 64px; align-items: center; gap: 16px; width: 100%; background: none; border: 0; text-align: start; padding: 8px 0; color: var(--org-ink); cursor: pointer; font-family: inherit; }
.orgx-bar-row:hover .orgx-bar-name { color: var(--org-blue); text-decoration: underline; }
.orgx-bar-name { font-size: 12px; overflow-wrap: anywhere; }
.orgx-bar-row strong { text-align: end; font-size: 12px; font-variant-numeric: tabular-nums; }
.orgx-bar-track { height: 10px; border-radius: 3px; background: #eef3fa; overflow: hidden; }
.orgx-bar-track > span { display: block; height: 100%; background: #3374ce; border-radius: 3px; }
.orgx-workspace table { width: 100%; border-collapse: collapse; font-size: 12px; }
.orgx-workspace caption { text-align: start; font-weight: 500; color: var(--org-muted); margin: 10px 0; }
.orgx-workspace th, .orgx-workspace td { padding: 12px; border-bottom: 1px solid var(--org-line); text-align: start; }
.orgx-workspace thead th { font-weight: 600; font-size: 11px; background: #f7f9fc; color: #506680; white-space: nowrap; }
.orgx-matrix tbody th { max-width: 170px; font-weight: 500; }
.orgx-cell { display: block; padding: 9px 5px; border-radius: 7px; min-width: 55px; text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; }
.orgx-cell.high { background: #e7f4f0; color: #1c6653; }
.orgx-cell.mid { background: #fff2d9; color: #78551e; }
.orgx-cell.low { background: #fae9e6; color: #8c4337; }
.orgx-cell.no-data { background: #f0f3f7; color: #67778b; font-weight: 400; }
.orgx-text-button { background: none; border: 0; padding: 0; color: #205ecf; font: inherit; cursor: pointer; text-align: start; }
.orgx-text-button:hover { text-decoration: underline; }
.orgx-chart-body { min-width: 0; padding: 0 6px; }
.orgx-series-totals { display: flex; flex-wrap: wrap; gap: 14px; font-size: 11px; color: var(--org-muted); margin-top: 14px; }
.orgx-trend-meta { display: flex; gap: 14px; align-items: baseline; margin: 12px 0 0; }
.orgx-trend-meta strong { font-size: 30px; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.orgx-trend-meta span { font-size: 12px; color: var(--org-muted); }
.orgx-trend { width: 100%; height: auto; display: block; overflow: visible; }
.orgx-trend text { fill: #65778b; font-family: inherit; font-size: 11px; }
.orgx-gridline { stroke: #e6edf5; stroke-dasharray: 3 4; }
.orgx-area { fill: #edf4ff; }
.orgx-line { fill: none; stroke: #286bca; stroke-width: 2.5; stroke-linejoin: round; }
.orgx-dot { fill: #286bca; }
.orgx-data summary, .orgx-definitions summary { cursor: pointer; color: #315d91; font-size: 13px; font-weight: 600; padding: 14px 0; }
.orgx-data .table-scroll { max-height: 360px; overflow: auto; }
.orgx-data { border-top: 1px solid var(--org-line); margin-top: 18px; }
.orgx-definitions { border: 1px solid var(--org-line); border-radius: 14px; padding: 0 22px; background: #f9fbfd; }
.orgx-definitions dl { margin: 0 0 20px; display: grid; grid-template-columns: 160px 1fr; gap: 14px 24px; font-size: 13px; }
.orgx-definitions dt { font-weight: 650; }
.orgx-definitions dd { margin: 0; color: var(--org-muted); line-height: 1.7; }
.orgx-workspace .org-school-grid { gap: 18px; }
.orgx-workspace .org-school-card { padding: 22px; }
.orgx-workspace .org-school-card h3 { font-size: 17px; }
.orgx-workspace .org-school-card header p, .orgx-workspace .org-analytics-table td > small { color: #687c92; font-size: 11px; }
.orgx-view-switch { display: flex; gap: 3px; padding: 4px; background: #edf2f8; border-radius: 9px; flex-shrink: 0; }
.orgx-view-switch button { padding: 8px 14px; border: 0; border-radius: 6px; font: inherit; font-size: 12px; background: transparent; cursor: pointer; color: #546982; }
.orgx-view-switch button[aria-pressed="true"] { background: white; color: #205ecf; box-shadow: 0 1px 3px #19344e15; }
.orgx-compact .org-school-grid { grid-template-columns: 1fr; gap: 12px; }
.orgx-compact .org-school-card { display: grid; grid-template-columns: minmax(220px,1.2fr) minmax(240px,1fr); gap: 14px 24px; padding: 18px; }
.orgx-compact .org-school-card > header, .orgx-compact .org-school-facts { margin: 0; }
.orgx-compact .org-school-card > footer, .orgx-compact .org-school-detail { grid-column: 1 / -1; }
.orgx-workspace .org-school-detail { border-radius: 10px; background: #f7faff; }
.orgx-workspace .org-branding-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(320px,.85fr); gap: 24px; align-items: start; }
.orgx-workspace .org-branding-layout > *, .orgx-workspace .org-brand-school, .orgx-workspace .org-brand-school > form > * { min-width: 0; }
.orgx-workspace .org-brand-schools { grid-column: 1 / -1; }
.orgx-workspace .org-brand-schools > div:last-child { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
/* Stay in the first grid row: sticky positioning can paint over the full-width
   school inheritance row while the shared branding grid continues scrolling. */
.orgx-family-preview { padding: 24px; position: static; }
.orgx-phone { padding: 22px; border: 1px solid #dce7f2; border-radius: 22px; margin-bottom: 16px; background: linear-gradient(#f8fbff,#fff); }
.orgx-phone-language { font-size: 10px; color: #67809a; letter-spacing: .12em; }
.orgx-phone-brand { display: flex; align-items: center; gap: 12px; margin: 18px 0 8px; }
.orgx-phone-brand img { width: 40px; height: 40px; object-fit: contain; }
.orgx-phone-brand > span { font-size: 30px; color: #2761ac; }
.orgx-phone > small { font-size: 11px; color: #708399; }
.orgx-phone h4 { font-size: 23px; margin: 28px 0 8px; font-family: inherit; overflow-wrap: anywhere; }
.orgx-phone p { font-size: 13px; color: #60728a; line-height: 1.7; overflow-wrap: anywhere; }
.orgx-preview-placeholder { padding: 28px 18px; border: 1px dashed #cbd9e9; border-radius: 12px; margin-top: 22px; font-size: 12px; color: #65809a; text-align: center; }
.orgx-save-state { padding: 12px; border-radius: 8px; background: #edf4ff; font-size: 12px; color: #3f628d; }
.orgx-empty { padding: 32px 12px; text-align: center; font-size: 14px; color: var(--org-muted); line-height: 1.8; }
.orgx-workspace [hidden] { display: none !important; }
@media (max-width: 1180px) {
  .orgx-intelligence-grid, .orgx-workspace .org-dashboard-grid { grid-template-columns: 1fr; }
  .orgx-workspace .super-kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 780px) {
  body[data-portal-role="organization_admin"] .page-content { padding: 18px 14px 36px; }
  .orgx-workspace { gap: 18px; }
  .orgx-workspace .org-hero { padding: 24px 20px; }
  .orgx-workspace .super-kpi-grid { gap: 10px; }
  .orgx-workspace .super-kpi-grid > * { padding: 16px; }
  .orgx-intelligence-grid > .card { padding: 18px; }
  .orgx-workspace .org-branding-layout, .orgx-workspace .org-brand-schools > div:last-child, .orgx-compact .org-school-card { grid-template-columns: 1fr; }
  .orgx-family-preview { position: static; }
  .orgx-definitions dl { grid-template-columns: 1fr; gap: 7px; }
  .orgx-definitions dd { margin-bottom: 12px; }
  .orgx-select { flex-wrap: wrap; }
  .orgx-bar-row { gap: 10px; grid-template-columns: minmax(90px,1fr) minmax(45px,.8fr) 56px; }
  .orgx-workspace .platform-access-heading { flex-wrap: wrap; }
}
@media print {
  .orgx-workspace button, .orgx-view-switch, .orgx-select { display: none; }
  .orgx-workspace .card { break-inside: avoid; box-shadow: none; }
}
