/* Shared visual language for the CMS and its loading states. */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: var(--font-sans);
  --primary: #0066cc;
  --primary-glow: #0055ad;
  --secondary: #b36b00;
  --brand-primary: #373478;
  --brand-secondary: #f3a942;
  --background: #fff;
  --surface: #f5f5f7;
  --foreground: #1d1d1f;
  --muted-foreground: #6e6e73;
  --border: #e2e2e7;
  --success: #248044;
  --danger: #c9342b;
  --radius: 8px;
  --sidebar-width: 256px;
  --sidebar-collapsed-width: 76px;
  --transition: 180ms ease;
  --shadow-soft: none;
  --shadow-elegant: none;
}

body { font-family: var(--font-sans); background: var(--surface); }
button, input, textarea, select { font-family: inherit; }
::selection { background: #d5e7fc; color: var(--foreground); }
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 3px solid #0071e3;
  outline-offset: 3px;
}
[hidden] { display: none !important; }

.sidebar {
  background: #f1eef9;
  color: var(--foreground);
  border-right: 1px solid #e1dfed;
  box-shadow: none;
}
.sidebar-head { min-height: 88px; padding: 20px 14px; background: #eae6f5; border-color: #e5c99f; }
.brand { gap: 10px; }
.brand-mark { width: 36px; height: 36px; flex-basis: 36px; border: 0; border-radius: 10px; box-shadow: none; }
.brand-mark img { width: 30px; height: 30px; }
.brand-copy strong { font-size: 14px; font-weight: 600; letter-spacing: -0.025em; color: var(--brand-primary); }
.brand-copy span { font-size: 11px; letter-spacing: 0; color: var(--muted-foreground); }
.brand-wordmark > .brand-word-react, .brand-wordmark > .brand-word-systems { display: inline; font: inherit; letter-spacing: inherit; }
.brand-wordmark > .brand-word-react { color: #0066cc; }
.brand-wordmark > .brand-word-systems { color: #b85c00; }
.sidebar-collapse { width: 28px; height: 32px; flex-basis: 28px; border: 0; color: var(--muted-foreground); background: transparent; }
.sidebar-collapse:hover { color: var(--brand-primary); background: #e9e7f3; }
.side-nav { gap: 5px; padding: 20px 12px; scrollbar-color: #c6c6cc transparent; }
.sidebar-skeleton { position: absolute; inset: 0; z-index: 5; padding: 20px 12px; background: inherit; }
.sidebar-skeleton[hidden] { display: none; }
.sidebar-skeleton-brand, .sidebar-skeleton-link { display: flex; align-items: center; gap: 12px; }
.sidebar-skeleton-brand { min-height: 48px; padding: 0 4px; }
.sidebar-skeleton-brand > span, .sidebar-skeleton-link > span { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 7px; background: rgba(90, 86, 112, .2); }
.sidebar-skeleton-brand > i { height: 10px; border-radius: 5px; background: rgba(90, 86, 112, .2); }
.sidebar-skeleton-brand > i:first-of-type { width: 74px; }
.sidebar-skeleton-brand > i:last-of-type { display: none; }
.sidebar-skeleton-links { display: grid; gap: 7px; margin-top: 24px; }
.sidebar-skeleton-link { min-height: 48px; padding: 0 12px; border-radius: 8px; }
.sidebar-skeleton-link > span { width: 18px; height: 18px; flex-basis: 18px; }
.sidebar-skeleton-link > i { width: 108px; height: 10px; border-radius: 5px; background: rgba(90, 86, 112, .2); }
.sidebar-skeleton-brand > span, .sidebar-skeleton-brand > i, .sidebar-skeleton-link > span, .sidebar-skeleton-link > i { animation: sidebar-skeleton-pulse 1.2s ease-in-out infinite alternate; }
@keyframes sidebar-skeleton-pulse { from { opacity: .48; } to { opacity: 1; } }
.side-link, .nav-parent { min-height: 42px; padding: 10px 12px; gap: 10px; border-radius: 9px; color: #515156; font-size: 13px; font-weight: 500; }
.side-link:hover, .nav-parent:hover { background: #e6e0f3; color: var(--brand-primary); }
.side-link.active, .nav-parent.active { background: #e5e2f1; color: var(--brand-primary); box-shadow: none; }
.side-nav > .side-link.active::after, .nav-parent.active::after { content: ""; position: absolute; left: 0; top: 11px; bottom: 11px; width: 3px; border-radius: 2px; background: var(--brand-secondary); }
.nav-icon { color: var(--brand-primary); width: 20px; height: 20px; flex-basis: 20px; }
.nav-icon svg { stroke-width: 1.65; }
.nav-chevron { color: #797980; }
.nav-text { padding-bottom: 0; border-bottom: 0; }
.nav-submenu { padding-left: 34px; gap: 2px; }
.nav-submenu .side-link { min-height: 36px; padding: 8px 15px; font-size: 13px; font-weight: 400; }
.nav-submenu .side-link::before { left: 0; width: 5px; height: 5px; background: transparent; }
.nav-submenu .side-link.active { background: transparent; color: #515156; }
.nav-submenu .side-link.active::before { background: var(--brand-primary); }
.nav-badge { background: var(--brand-primary); color: #fff; font-weight: 600; }
.side-link.active .nav-badge { background: var(--brand-primary); color: #fff; }

.admin-content { --content-gutter: clamp(20px, 3.3vw, 52px); padding: 0 var(--content-gutter) 48px; }
.admin-topbar { min-height: 88px; background: rgba(245, 245, 247, .93); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); padding: 16px var(--content-gutter); box-shadow: none; }
.topbar-title h1 { color: var(--foreground); font-size: clamp(20px, 2.2vw, 28px); font-weight: 600; letter-spacing: -.04em; line-height: 1.2; }
.topbar-kicker { color: var(--muted-foreground); font-size: 11px; letter-spacing: .02em; text-transform: none; font-weight: 400; }
.topbar-menu { width: 44px; height: 44px; flex-basis: 44px; background: #ebe8f5; color: var(--brand-primary); border: 0; border-radius: 50%; }
.topbar-menu:hover { background: #e0daee; color: var(--brand-primary); }
.notification-link, .user-menu-trigger { display: inline-grid; place-items: center; width: 44px; height: 44px; min-height: 44px; flex: 0 0 44px; padding: 10px; border: 0; border-radius: 50%; background: #ebe8f5; color: var(--brand-primary); box-shadow: none; }
.notification-link:hover, .user-menu-trigger:hover, .user-menu-wrapper.is-open .user-menu-trigger { border: 0; background: #e0daee; color: var(--brand-primary); box-shadow: none; }
.notification-link svg, .user-menu-trigger > svg { width: 22px; height: 22px; stroke-width: 1.7; }
.notification-badge { top: 0; right: 0; background: var(--brand-secondary); color: var(--brand-primary); }
.user-menu-dropdown, .table-actions-menu[popover] { padding: 6px; border-radius: 12px; border-color: #d6d6dc; background: #fff; box-shadow: none; }
.user-menu-item { min-height: 38px; font-size: 13px; font-weight: 400; border-radius: 7px; }
.user-menu-item:hover { background: #f0f0f4; color: var(--foreground); }

.card,
.editor-panel,
.static-setting-card { border-color: var(--border); border-radius: var(--radius); background: #fff; box-shadow: none; }
.card { padding: clamp(22px, 2.5vw, 34px); }
.panel-kicker { color: var(--muted-foreground); font-size: 11px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
.section-heading, .content-form-intro h2 { color: var(--foreground); font-size: clamp(21px, 2vw, 26px); font-weight: 600; line-height: 1.25; letter-spacing: -.035em; }
.section-note, .content-form-intro p { font-size: 14px; line-height: 1.6; color: var(--muted-foreground); max-width: 70ch; }
.subheading, .dashboard-section-title { font-size: 17px; font-weight: 600; letter-spacing: -.025em; color: var(--foreground); }
.dashboard-section-title { margin: 28px 0 14px; }
.dashboard-section-title:first-child { margin-top: 0; }
.chart-title { font-size: 16px; font-weight: 600; letter-spacing: -.02em; }
.stat-card[style*="background"], .stat-card-modern[style*="background"], .stat-card {
  background: var(--stat-tint, #fff);
  border: 1px solid color-mix(in srgb, var(--stat-accent, var(--primary)) 14%, var(--border));
  border-radius: var(--radius);
  min-height: 118px;
  padding: 20px;
  box-shadow: none;
}
a.stat-card:hover { border-color: color-mix(in srgb, var(--stat-accent, var(--primary)) 45%, var(--border)); background: color-mix(in srgb, var(--stat-accent, var(--primary)) 12%, #fff); }
a.stat-card:focus-visible { outline-color: var(--stat-accent, var(--primary)); }
.stat-info .label { color: var(--muted-foreground); font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.stat-info .value { margin-top: 6px; font-size: 30px; font-weight: 600; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat-icon { width: 38px; height: 38px; border-radius: 11px; color: var(--stat-accent, var(--primary)); background: rgba(255, 255, 255, .72); }
.stat-icon svg { width: 21px; height: 21px; stroke-width: 1.6; }
.stat-info { min-width: 0; }
.content-stats-grid .stat-card { padding: 18px; gap: 10px; }
.content-stats-grid .stat-icon { width: 32px; height: 32px; flex: 0 0 32px; }
.content-stats-grid .stat-info .value { font-size: 26px; }
.chart-card .card-heading-row { align-items: flex-start; flex-wrap: wrap; gap: 16px; margin-bottom: 0; }
.charts-row > .card + .card { margin-top: 0; }
.charts-row { grid-auto-rows: 1fr; align-items: stretch; }
.charts-row > .chart-card { height: 100%; }
.edu360-visitor-chart { grid-template-columns: minmax(0, 1fr); margin-top: 0; }
.chart-card .section-note { margin-bottom: 0; font-size: 12px; }
.chart-summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin: 22px 0 20px; }
.chart-summary strong { color: var(--foreground); font-size: 32px; font-weight: 600; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.chart-summary > span { color: var(--muted-foreground); font-size: 12px; }
.chart-card .chart-container { min-height: 280px; }
.chart-empty-state { color: var(--muted-foreground); font-size: 12px; text-align: center; margin: 16px 0 0; }
.chart-load-error { padding: 36px 16px; color: var(--muted-foreground); font-size: 14px; text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.btn, .icon-btn, .filter-btn { min-height: 40px; border-radius: 9px; font-size: 13px; font-weight: 500; box-shadow: none; transition: background-color var(--transition), border-color var(--transition), color var(--transition); }
.btn { padding: 9px 16px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: none; }
.btn-primary:hover { background: var(--primary-glow); opacity: 1; }
.btn-secondary { color: var(--foreground); border-color: #d5d5db; background: #fff; }
.btn-secondary:hover { background: #f2f2f5; border-color: #bcbcc4; color: var(--foreground); }
.btn-danger { background: #fff1f0; color: var(--danger); border-color: #f3d3cf; }
.btn-danger:hover { background: #fce5e2; color: #a5241d; }
.filter-btn { min-height: 32px; padding: 6px 12px; border: 0; color: var(--muted-foreground); }
.chart-filters { padding: 3px; gap: 2px; border-radius: 10px; background: #f0f0f3; }
.filter-btn.active { background: #fff; color: var(--foreground); box-shadow: none; }
.filter-btn:hover { background: #e5e5eb; color: var(--foreground); }
.table-actions-trigger { width: 36px; min-height: 36px; padding: 7px; border-color: transparent; background: transparent; color: var(--muted-foreground); }
.table-actions-trigger:hover, .table-actions-trigger[aria-expanded="true"] { border-color: var(--border); background: var(--surface); color: var(--foreground); }
.table-actions-menu[popover]:popover-open { grid-template-columns: minmax(0, 1fr); justify-content: stretch; align-items: stretch; }
.table-actions-menu[popover] > form { width: 100%; }
.table-actions-menu[popover] .table-action-item { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 8px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--foreground); text-align: left; font-size: 13px; line-height: 20px; font-weight: 400; box-shadow: none; }
.table-actions-menu[popover] .table-action-item.btn-danger { color: var(--danger); }
.table-actions-menu[popover] .table-action-icon { width: 18px; height: 18px; }
.table-action-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.table-wrap, .table-shell { border-color: var(--border); border-radius: var(--radius); box-shadow: none; }
.data-table th, th { background: #fafafa; color: var(--muted-foreground); font-size: 11px; font-weight: 500; letter-spacing: .01em; text-transform: none; padding: 13px 16px; }
.data-table td, td { font-size: 13px; padding: 16px; border-bottom-color: #eeeef1; }
td strong { font-weight: 500; }
tbody tr:hover { background: #fafbfc; }
.muted { color: var(--muted-foreground); font-size: 12px; }
.preview-image { border-radius: 8px; border: 1px solid var(--border); }
.status { border-radius: 6px; font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; padding: 4px 8px; }

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), textarea, select {
  border: 1px solid #d2d2d7;
  border-radius: 9px;
  background: #fff;
  color: var(--foreground);
  min-height: 44px;
  padding: 11px 13px;
  font-size: 14px;
  font-weight: 400;
}
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px #0071e320; background: #fff; }
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); }
input:disabled { background: var(--surface); }
input::placeholder, textarea::placeholder { color: #86868b; }
.field label, .field > span, .label { color: #424245; font-size: 13px; font-weight: 500; }
.field { gap: 8px; }
.form-grid { gap: 22px 24px; }
.edu360-settings-form { grid-template-columns: minmax(0, 1fr); }
.edu360-settings-form > .settings-panel,
.skeleton-school-settings-panel { width: 100%; max-width: 980px; margin-inline: auto; }
.edu360-settings-form > .settings-panel { justify-self: center; }
.school-settings-actions { justify-content: flex-end; margin-top: 24px; }
.help-text { color: var(--muted-foreground); font-size: 12px; line-height: 1.5; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }
.content-form-section { padding: 24px; margin-bottom: 26px; border-radius: var(--radius); }
.content-form-section > legend { color: var(--foreground); font-size: 15px; font-weight: 600; }
.content-form-progress-track { height: 5px; border: 0; background: #e9e9ee; }
.content-form-progress-label { font-size: 12px; }
.content-form .content-form-footer { border-top: 1px solid var(--border); padding-top: 22px; }
.sticky-actions { background: rgba(255, 255, 255, .95); border-color: var(--border); box-shadow: none; }
.settings-tabs { background: #eaeaf0; border: 0; border-radius: 11px; padding: 4px; gap: 3px; }
.settings-tab { padding: 9px 15px; font-size: 13px; font-weight: 500; border-radius: 8px; }
.settings-tab[aria-selected="true"] { color: var(--foreground); background: #fff; }
.settings-tab:hover { color: var(--foreground); }
[data-settings-tabs] > .settings-panel, .skeleton-brand-panel { width: 100%; max-width: none; margin-inline: 0; }

.audit-pagination { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
.audit-pagination-summary { font-size: 12px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.audit-pagination-links { gap: 3px; padding: 4px; border: 1px solid var(--border); border-radius: 11px; background: #f0f0f3; overflow: visible; }
.audit-pagination-links li > a, .audit-pagination-links li > span,
.audit-pagination-links li + li > a, .audit-pagination-links li + li > span { display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 34px; min-height: 34px; padding: 7px 10px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted-foreground); font-size: 12px; font-weight: 500; line-height: 18px; font-variant-numeric: tabular-nums; transition: background-color var(--transition), color var(--transition), border-color var(--transition); }
.audit-pagination-links li:first-child > *, .audit-pagination-links li:last-child > * { border-radius: 7px; }
.audit-pagination-links li > a:hover { background: #e4e4ea; border-color: transparent; color: var(--foreground); }
.audit-pagination-links li > [aria-current="page"] { border-color: #d5d5db; background: #fff; color: var(--foreground); font-weight: 600; }
.audit-pagination-links li > [aria-disabled="true"] { color: var(--muted-foreground); opacity: .4; cursor: default; }
.audit-pagination-links a:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.audit-pagination-links .pagination-direction-label { display: inline; min-width: 0; min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: inherit; font: inherit; }
.pagination-chevron { width: 16px; height: 16px; flex: 0 0 16px; }
.empty-state-action { border-style: solid; background: #fafafa; padding: 48px 24px; }
.empty-state-action .empty-state-icon { background: #edf2fa; color: var(--primary); }
.empty-state-action strong { font-weight: 600; font-size: 18px; letter-spacing: -.02em; }
.message-avatar { background: #edf2fa; color: var(--primary); border-radius: 50%; font-weight: 500; }
.message-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.message-meta > span + span { padding-left: 8px; border-left: 1px solid var(--border); }
.message-list { border-radius: 0; border-inline: 0; }
.message-list-item { position: relative; grid-template-columns: 46px minmax(0, 1fr) 44px; align-items: center; border-radius: 0; border-left: 3px solid transparent; }
.message-list-item:hover { background: #f5f5f7; }
.message-list-item:focus-within { background: #f5f9ff; }
.message-list-content { display: flex; flex-direction: column; gap: 8px; }
.message-list-time { display: block; color: var(--muted-foreground); font-size: 12px; line-height: 1.5; }
.message-open-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.message-open-link:focus-visible { outline: none; }
.message-open-link:focus-visible::after { outline: 2px solid var(--primary); outline-offset: -2px; }
.message-list-actions { position: relative; z-index: 2; grid-column: auto; justify-content: flex-end; padding-left: 0; }
.message-delete-button.btn { display: inline-grid; place-items: center; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 10px; flex: 0 0 44px; border: 0; background: transparent; box-shadow: none; }
.message-delete-button.btn:hover, .message-delete-button.btn:focus-visible { border-color: transparent; background: transparent; color: #a5241d; box-shadow: none; }
.message-delete-button svg { width: 24px; height: 24px; max-width: none; }
.message-list-item.is-unread { background: #f5f9ff; box-shadow: none; border-left: 3px solid var(--primary); }
.message-bubble { background: #f5f5f7; border-radius: 14px; color: var(--foreground); }
.confirm-modal { background: #1d1d1f55; backdrop-filter: blur(5px); }
.confirm-dialog { border-radius: 20px; border-color: var(--border); box-shadow: none; padding: 28px; }
.confirm-dialog h2 { letter-spacing: -.025em; font-weight: 600; }
.toast { border-radius: 12px; box-shadow: none; }
.auth-page { background: #f5f5f7; }
.auth-layout, .auth-card { border-color: var(--border); border-radius: var(--radius); box-shadow: none; }
.auth-layout { background: #fff; }
.auth-visual { background: #f7f8fa; }
.auth-visual-copy h1, .auth-card h2 { letter-spacing: -.04em; }
.auth-visual-logo { box-shadow: none; }
.auth-shell { background: #f5f5f7; padding: clamp(20px, 4vw, 56px); }
.auth-layout { width: min(1080px, 100%); min-height: 640px; grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr); border-color: var(--border); }
.auth-visual { padding: 36px; background: #f1eef8; border-right: 1px solid #e5e1ef; }
.auth-visual-brand strong { font-size: 15px; font-weight: 600; color: var(--brand-primary); }
.auth-visual-brand small { color: var(--muted-foreground); }
.auth-visual-logo { border: 0; border-radius: 8px; }
.auth-brand-artwork { display: grid; flex: 1; min-height: 250px; place-items: center; margin: 28px 0; }
.auth-brand-artwork img { display: block; width: min(240px, 100%); height: auto; object-fit: contain; }
.auth-eyebrow, .auth-kicker { color: var(--muted-foreground); font-size: 11px; font-weight: 500; letter-spacing: .07em; }
.auth-visual-copy h1 { font-size: clamp(26px, 2.7vw, 34px); line-height: 1.18; font-weight: 600; }
.auth-visual-copy p { font-size: 14px; line-height: 1.65; }
.auth-panel { background: #fff; padding: 44px; }
.auth-panel::before, .auth-panel::after { display: none; }
.auth-card { width: 100%; max-width: 360px; max-height: none; overflow: visible; padding: 0; border: 0; background: transparent; }
.auth-signin-mark { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 26px; border-radius: 14px; color: var(--brand-primary); background: #efecf7; }
.auth-signin-mark svg { width: 26px; height: 26px; }
.auth-card h2 { margin: 8px 0; font-size: 29px; line-height: 1.2; font-weight: 600; }
.auth-card .auth-intro { margin-bottom: 28px; font-size: 14px; line-height: 1.6; }
.auth-form { gap: 20px; }
.auth-page .auth-form .auth-input-wrap input { min-height: 50px; padding: 12px 44px; border-color: #d8d8de; border-radius: var(--radius); background: #fafafa; }
.auth-page .auth-form .auth-input-wrap input:focus { border-color: var(--brand-primary); background: #fff; box-shadow: 0 0 0 3px #37347818; }
.auth-input-icon { color: #86868b; }
.auth-input-wrap:focus-within .auth-input-icon { color: var(--brand-primary); }
.auth-password-toggle { width: 44px; height: 44px; right: 3px; color: var(--muted-foreground); border-radius: 6px; }
.auth-password-toggle:hover { color: var(--brand-primary); }
.auth-password-toggle svg { width: 20px; height: 20px; }
.auth-submit { min-height: 48px; margin-top: 4px; background: var(--brand-secondary); border-color: var(--brand-secondary); color: #0d0b07; border-radius: var(--radius); }
.auth-submit:hover { background: #e99a2e; border-color: #e99a2e; color: #0d0b07; }
.auth-card .auth-security-note { font-size: 12px; line-height: 1.6; color: var(--muted-foreground); }
.auth-page :where(a, button, input):focus-visible { outline-color: var(--brand-primary); }

@media (max-width: 900px) {
  .auth-shell { padding: 16px; }
  .auth-layout { width: min(480px, 100%); min-height: auto; grid-template-columns: minmax(0, 1fr); }
  .auth-panel { min-height: auto; padding: clamp(24px, 6vw, 40px); }
  .auth-page .auth-form .auth-input-wrap input { font-size: 16px; }
}

/* Skeletons share the same grid classes, padding, and breakpoints as the pages. */
.page-skeleton { display: block; }
.skeleton-layout { position: relative; overflow: hidden; }
.skeleton-layout > div { position: absolute; margin: 0; }
.skeleton-surface { background: #fff; border: 1px solid var(--border); }
.skeleton-block { background: linear-gradient(90deg, #ececf0 25%, #e2e2e8 50%, #ececf0 75%); background-size: 200% 100%; border-radius: 5px; }
.skeleton-panel { border-radius: var(--radius); padding: clamp(22px, 2.5vw, 34px); background: #fff; }
.skeleton-heading { margin-bottom: 24px; }
.skeleton-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.skeleton-header .skeleton-heading { flex: 1; margin-bottom: 0; }
.skeleton-header .skeleton-button { flex: 0 0 132px; margin: 0; height: 40px; }
.skeleton-stat { display: flex; align-items: center; justify-content: space-between; gap: 14px; background: var(--stat-tint, #fff); border-color: color-mix(in srgb, var(--stat-accent, var(--primary)) 22%, var(--border)); }
.skeleton-stat > div:first-child { flex: 1; }
.skeleton-stat .skeleton-block { background: linear-gradient(90deg, color-mix(in srgb, var(--stat-accent, var(--primary)) 10%, #fff) 25%, color-mix(in srgb, var(--stat-accent, var(--primary)) 20%, #fff) 50%, color-mix(in srgb, var(--stat-accent, var(--primary)) 10%, #fff) 75%); background-size: 200% 100%; }
.skeleton-stat-icon { width: 38px; height: 38px; border: 1px solid color-mix(in srgb, var(--stat-accent, var(--primary)) 12%, transparent); border-radius: 11px; }
.skeleton-layout .skeleton-block[style*="--stat-accent"] { background: linear-gradient(90deg, color-mix(in srgb, var(--stat-accent, var(--primary)) 10%, #fff) 25%, color-mix(in srgb, var(--stat-accent, var(--primary)) 20%, #fff) 50%, color-mix(in srgb, var(--stat-accent, var(--primary)) 10%, #fff) 75%); background-size: 200% 100%; }
.skeleton-stat .skeleton-title { width: 50%; height: 34px; margin: 6px 0 0; }
.skeleton-stat .skeleton-label { width: 80%; margin: 0; }
.skeleton-chart-heading { flex: 1; }
.skeleton-chart-heading .skeleton-title { height: 20px; width: 160px; margin: 0 0 10px; }
.skeleton-chart-heading .skeleton-line { height: 14px; margin: 0; }
.chart-container > .skeleton-chart { width: 100%; height: 280px; }
.page-skeleton .chart-summary .skeleton-title { height: 32px; width: 60px; margin: 0; }
.page-skeleton .chart-summary .skeleton-label { width: 130px; margin: 0; }
.skeleton-section-title { height: 21px; width: 160px; margin: 28px 0 14px; }
.skeleton-section-title:first-child { margin-top: 0; }
.skeleton-table-row { grid-template-columns: minmax(170px, 2fr) repeat(var(--skeleton-middle-columns), minmax(100px, 1fr)) 60px; min-width: max-content; min-height: 78px; gap: 20px; padding: 16px; }
.skeleton-table-row:first-child { min-height: 43px; padding-block: 13px; background: #fafafa; }
.skeleton-table-row .skeleton-line { margin: 0; height: 12px; }
.skeleton-table-row:first-child .skeleton-line { width: 70%; height: 10px; }
.skeleton-table { overflow-x: auto; }
.skeleton-action { width: 6px; height: 20px; justify-self: center; }
.skeleton-content-form { padding: clamp(18px, 3vw, 32px); }
.skeleton-form-section { padding: 24px; border-radius: var(--radius); margin-bottom: 26px; }
.skeleton-form-section .form-grid { margin-top: 18px; }
.skeleton-form-section > .skeleton-title { height: 18px; width: 160px; margin-top: 0; }
.skeleton-form-field > .skeleton-label { width: 110px; max-width: 70%; margin: 0 0 8px; height: 16px; }
.skeleton-form-field > .skeleton-input { height: 44px; }
.skeleton-form-field > .skeleton-textarea { margin: 0; }
.skeleton-form-field > .skeleton-editor { margin: 0; }
.skeleton-form-field > .skeleton-upload { margin: 0; }
.skeleton-form-progress { margin-bottom: 28px; }
.skeleton-form-progress .skeleton-progress { height: 5px; }
.skeleton-form-footer { padding-top: 22px; justify-content: flex-end; }
.skeleton-form-footer .skeleton-button { height: 40px; }
.skeleton-form-footer > .skeleton-button:first-child { margin-right: auto; }
.skeleton-checkbox { height: 20px; width: 145px; margin-top: 22px; }
.skeleton-tabs { display: flex; gap: 6px; padding: 4px; border-radius: 11px; background: #eaeaf0; overflow: hidden; margin-bottom: 26px; }
.skeleton-tab { height: 38px; width: 130px; flex: 0 0 130px; }
.skeleton-message { grid-template-columns: 46px minmax(0, 1fr) 44px; gap: 14px; padding: 18px; }
.skeleton-message .skeleton-button { width: 44px; margin: 0; height: 44px; }
.skeleton-contact-detail { padding: 16px 0; border-bottom: 1px solid var(--border); }
.skeleton-contact-detail .skeleton-label { margin: 0 0 10px; }
.skeleton-checkbox { margin-bottom: 0; }
.skeleton-content-form .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.skeleton-content-form .form-grid > .full { grid-column: 1 / -1; }

@media (max-width: 760px) {
  .admin-content { --content-gutter: 16px; padding-bottom: 28px; }
  .admin-topbar { min-height: 74px; padding-block: 12px; }
  .card, .skeleton-panel { padding: 20px; border-radius: var(--radius); }
  .stat-card[style*="background"], .stat-card { padding: 16px; min-height: 110px; }
  .skeleton-header { align-items: stretch; flex-direction: column; gap: 16px; }
  .skeleton-header .skeleton-button { flex-basis: 40px; width: 100%; }
  .skeleton-message { grid-template-columns: 46px minmax(0, 1fr) 44px; }
  .skeleton-message > .skeleton-button { grid-column: auto; }
  .content-form-section, .skeleton-form-section { padding: 16px; }
  .settings-tab { min-height: 40px; }
  .notification-link, .topbar-menu, .table-actions-trigger { min-width: 40px; min-height: 40px; }
}
@media (max-width: 640px) {
  .skeleton-content-form .form-grid { grid-template-columns: minmax(0, 1fr); }
  .audit-pagination { flex-direction: column; justify-content: center; gap: 12px; }
  .audit-pagination-links { gap: 2px; }
  .audit-pagination-links li > a, .audit-pagination-links li > span { min-width: 28px; min-height: 36px; padding: 8px; }
  .audit-pagination-links .pagination-direction-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Edu360 workspace accents; navigation and page flow remain shared. */
.workspace-edu360 { --brand-primary: #1769ea; --brand-secondary: #b5e66c; --primary: #1769ea; --primary-glow: #1155c2; }
.workspace-edu360 .sidebar-head { background: #e8f0ff; border-color: #cbdcff; }
.workspace-edu360 .side-link:hover, .workspace-edu360 .nav-parent:hover,
.workspace-edu360 .side-link.active, .workspace-edu360 .nav-parent.active { background: #e5efff; color: #1769ea; }
.workspace-edu360 .topbar-menu, .workspace-edu360 .notification-link, .workspace-edu360 .user-menu-trigger { background: #eaf1ff; color: #1769ea; }
.topbar-workspace { margin-left: auto; }
.workspace-switcher { position: relative; flex: 0 0 auto; margin: 0 0 0 auto; }
.topbar-title { flex: 1; }
.topbar-user { flex-shrink: 0; margin-left: 0; }
.workspace-switcher-trigger {
  display: inline-flex;
  width: 174px;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 14px;
  border: 1px solid rgba(60, 60, 67, .16);
  border-radius: 12px;
  color: var(--foreground);
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), inset 0 1px rgba(255, 255, 255, .8);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.workspace-switcher-trigger > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.workspace-switcher-trigger > svg { width: 12px; height: 8px; flex-shrink: 0; fill: none; stroke: #6e6e73; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--transition); }
.workspace-switcher-trigger:hover, .workspace-switcher.is-open .workspace-switcher-trigger { background: #fff; border-color: rgba(60, 60, 67, .28); }
.workspace-switcher-trigger:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.workspace-switcher.is-open .workspace-switcher-trigger > svg { transform: rotate(180deg); }
.workspace-switcher-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 90;
  display: grid;
  width: 260px;
  gap: 3px;
  padding: 6px;
  border: 1px solid rgba(60, 60, 67, .14);
  border-radius: 14px;
  background: rgba(255, 255, 255, .96);
  box-shadow: none;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-5px) scale(.98);
  transform-origin: top right;
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}
.workspace-switcher.is-open .workspace-switcher-menu { visibility: visible; opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }
.workspace-switcher-option {
  display: flex;
  width: 100%;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  color: var(--foreground);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.workspace-switcher-option:hover, .workspace-switcher-option:focus-visible { outline: none; background: #f2f2f7; }
.workspace-switcher-option[aria-checked="true"] { background: #f5f5f8; }
.workspace-switcher-option > span { display: grid; gap: 3px; }
.workspace-switcher-option strong { font-size: 13px; font-weight: 550; }
.workspace-switcher-option small { color: var(--muted-foreground); font-size: 11px; }
.workspace-switcher-option > svg { width: 18px; height: 18px; fill: none; stroke: var(--primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.workspace-switcher-option[aria-checked="true"] > svg { opacity: 1; }
.workspace-edu360 .workspace-switcher-trigger { border-color: rgba(23, 105, 234, .2); }
.workspace-edu360 .workspace-switcher-option[aria-checked="true"] > svg { stroke: #1769ea; }
@media (max-width: 760px) {
  .admin-topbar {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 97px;
    grid-template-areas: "menu workspace user" "title title title";
    gap: 8px;
  }
  .topbar-menu { grid-area: menu; }
  .topbar-title { grid-area: title; }
  .topbar-user { grid-area: user; }
  .workspace-switcher {
    grid-area: workspace;
    position: static;
    justify-self: end;
    width: min(174px, 100%);
    margin: 0;
  }
  .workspace-switcher-trigger { width: 100%; gap: 8px; padding-inline: 10px; }
  .workspace-switcher-menu {
    left: var(--content-gutter);
    right: var(--content-gutter);
    width: auto;
    transform-origin: top center;
  }
}
/* Workspace accents belong to the CMS sidebar, keeping the admin layout shared. */
.workspace-reactsystems .sidebar {
  color: #454452;
  background: #d5d4e9;
  border-right-color: #e3e1eb;
  box-shadow: none;
}
.workspace-reactsystems .sidebar-head {
  background: #eae8f2;
  border-color: #e2d1b5;
}
.workspace-reactsystems .sidebar-head :where(a, span, p, h1, h2, h3) { color: #373478; }
.workspace-reactsystems .sidebar-collapse { color: #625f72; }
.workspace-reactsystems .sidebar-collapse:hover { background: #e1dfeb; }
.workspace-reactsystems .side-link,
.workspace-reactsystems .nav-parent { color: #555363; }
.workspace-reactsystems .side-link:hover,
.workspace-reactsystems .nav-parent:hover { background: #e9e7f1; color: #373478; }
.workspace-reactsystems .side-link.active,
.workspace-reactsystems .nav-parent.active {
  color: #373478;
  background: #e5e2ef;
  box-shadow: inset 0 0 0 1px #d9d5e7;
}
.workspace-reactsystems .nav-icon { color: #514d91; }
.workspace-reactsystems .side-nav > .side-link.active::after,
.workspace-reactsystems .side-nav > .nav-group > .nav-parent.active::after { background: #c78a3b; }
.workspace-reactsystems .nav-submenu { border-color: #dcd9e8; }
.workspace-reactsystems .nav-submenu .side-link { color: #666474; }
.workspace-reactsystems .nav-submenu .side-link.active { color: #666474; background: transparent; box-shadow: none; }
.workspace-reactsystems .nav-submenu .side-link.active::before { background: #c78a3b; }

.workspace-edu360 .sidebar {
  color: #3f4c5d;
  background: #d1dbef;
  border-right-color: #dfe7f2;
  box-shadow: none;
}
.workspace-edu360 .sidebar-head {
  background: #e6eef9;
  border-color: #d3e0f2;
}
.workspace-edu360 .sidebar-head :where(a, span, p, h1, h2, h3) { color: #174d92; }
.workspace-edu360 .sidebar-collapse { color: #58708d; }
.workspace-edu360 .sidebar-collapse:hover { background: #dce8f7; }
.workspace-edu360 .side-link,
.workspace-edu360 .nav-parent { color: #465568; }
.workspace-edu360 .side-link:hover,
.workspace-edu360 .nav-parent:hover { background: #e7effa; color: #1769c2; }
.workspace-edu360 .side-link.active,
.workspace-edu360 .nav-parent.active {
  color: #155db5;
  background: #e3edfb;
  box-shadow: inset 0 0 0 1px #d4e3f7;
}
.workspace-edu360 .nav-icon { color: #3476c4; }
.workspace-edu360 .side-nav > .side-link.active::after,
.workspace-edu360 .side-nav > .nav-group > .nav-parent.active::after { background: #91b95a; }
.workspace-edu360 .nav-submenu { border-color: #dce5f1; }
.workspace-edu360 .nav-submenu .side-link { color: #5a6a7d; }
.workspace-edu360 .nav-submenu .side-link.active { color: #5a6a7d; background: transparent; box-shadow: none; }
.workspace-edu360 .nav-submenu .side-link.active::before { background: #91b95a; }
.workspace-reactsystems .sidebar :where(.side-link, .nav-parent):focus-visible,
.workspace-edu360 .sidebar :where(.side-link, .nav-parent):focus-visible { outline-color: #1769c2; }

/* Workspace colours mirror the public frontends, including after PJAX switches. */
body.workspace-reactsystems {
  --primary: #373478; --primary-glow: #4a46a3; --secondary: #f3a942;
  --brand-primary: #373478; --brand-secondary: #f3a942;
  --workspace-tint: #eae8f2; --workspace-hover: #e5e2ef; --workspace-sidebar: #d5d4e9;
}
body.workspace-edu360 {
  --primary: #1769ea; --primary-glow: #2868b8; --secondary: #c4ed9c;
  --brand-primary: #1769ea; --brand-secondary: #c4ed9c;
  --workspace-tint: #f0f7ff; --workspace-hover: #e3edfb; --workspace-sidebar: #d1dbef;
}
body.workspace-reactbooks {
  --primary: #0e6b52; --primary-glow: #149c85; --secondary: #2778b8;
  --brand-primary: #0e6b52; --brand-secondary: #2778b8;
  --workspace-tint: #f3fbf8; --workspace-hover: #ddf6ee; --workspace-sidebar: #d2e9e1;
}
body[class*="workspace-"] .sidebar {
  color: var(--foreground); background: var(--workspace-sidebar);
  border-right-color: var(--border); box-shadow: none;
}
body[class*="workspace-"] .sidebar-head { background: var(--workspace-tint); border-color: var(--workspace-hover); }
body[class*="workspace-"] .sidebar-head :where(a, span, p, h1, h2, h3),
body[class*="workspace-"] .nav-icon { color: var(--brand-primary); }
body[class*="workspace-"] .sidebar-collapse { color: var(--brand-primary); }
body[class*="workspace-"] .sidebar-collapse:hover,
body[class*="workspace-"] .side-link:hover,
body[class*="workspace-"] .nav-parent:hover { background: var(--workspace-tint); color: var(--brand-primary); }
body[class*="workspace-"] .nav-submenu .side-link:hover { background: transparent; color: inherit; }
body[class*="workspace-"] .side-link.active,
body[class*="workspace-"] .nav-parent.active { color: var(--brand-primary); background: var(--workspace-hover); box-shadow: none; }
body[class*="workspace-"] .side-nav > .side-link.active::after,
body[class*="workspace-"] .nav-parent.active::after,
body[class*="workspace-"] .nav-submenu .side-link.active::before { background: var(--brand-secondary); }
body[class*="workspace-"] .nav-submenu { border-color: var(--workspace-hover); }
body[class*="workspace-"] .sidebar :where(.side-link, .nav-parent):focus-visible { outline-color: var(--primary); }
body[class*="workspace-"] .topbar-menu,
body[class*="workspace-"] .notification-link,
body[class*="workspace-"] .user-menu-trigger { color: var(--primary); background: var(--workspace-hover); }
body[class*="workspace-"] .topbar-menu:hover,
body[class*="workspace-"] .notification-link:hover,
body[class*="workspace-"] .user-menu-trigger:hover,
body[class*="workspace-"] .user-menu-wrapper.is-open .user-menu-trigger { color: var(--primary-glow); background: var(--workspace-sidebar); }
body[class*="workspace-"] .workspace-switcher-option:hover,
body[class*="workspace-"] .workspace-switcher-option[aria-checked="true"] { background: var(--workspace-tint); }
body[class*="workspace-"] .workspace-switcher-option[aria-checked="true"] > svg { stroke: var(--primary); }
body[class*="workspace-"] :is(input, textarea, select):focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent); }

/* Make Edu360's selected submenu marker clear against the pale sidebar. */
body.workspace-edu360 .nav-submenu .side-link.active::before {
  background: #2e7d32;
}
