/* PG Stay shell geometry/palette; actual PG font/scales are in school-typography.css. */
html.school-theme { overflow-x: visible !important; }
body.portal-layout.school-shell {
  --school-sidebar-width: 250px;
  --school-header-height: 64px;
  --school-footer-height: 96px;
  margin: 0;
  min-width: 0;
  background: #eef2f6;
  color: #102033;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.3;
  overflow-x: visible !important;
}
body.school-shell *, body.school-shell *::before, body.school-shell *::after { box-sizing: border-box; }
body.school-shell .wrapper { min-width: 0; min-height: 100vh; min-height: 100dvh; }
body.portal-layout.school-shell .main-header {
  position: fixed !important;
  top: 0 !important; right: 0 !important; left: var(--school-sidebar-width) !important;
  display: flex !important;
  width: auto !important;
  max-width: none !important;
  min-height: calc(58px + env(safe-area-inset-top, 0px)) !important;
  height: auto !important;
  margin: 0 !important;
  padding: calc(6px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) 6px 12px !important;
  border: 0 !important;
  border-bottom: 1px solid #d9e7df !important;
  background: #043b32 !important;
  color: #fff !important;
  box-shadow: 0 2px 8px #102a4308 !important;
  opacity: 1 !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  overflow: visible !important;
  z-index: 1050 !important;
}
body.school-shell .main-header .navbar-nav { min-width: 0; flex-direction: row; align-items: center; }
body.school-shell .main-header .navbar-nav:last-child { margin-left: auto; }
body.school-shell .main-header .navbar-nav:first-child { flex: 1 1 auto; }
body.school-shell .main-header .navbar-nav:first-child > .nav-item:last-child { min-width: 0; }
body.school-shell .main-header .school-header-brand { gap: 8px; justify-content: flex-start; min-width: 0; max-width: 100%; }
body.school-shell .school-header-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.portal-layout.school-shell .main-header .nav-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; height: auto;
  padding: 8px 10px; color: #fff !important;
}
body.school-shell .main-header .nav-user-link { gap: 6px; min-width: 0; max-width: min(42vw, 340px); }
body.school-shell .nav-user-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.school-shell .nav-user-name { font-weight: 800; }
body.school-shell .nav-user-role { flex: none; font-size: .8rem; color: #d7e4ed; }
body.school-shell .main-header :is(.dropdown-menu, .language-dropdown, [data-language-menu]) { z-index: 1060; }
body.portal-layout.school-shell .main-sidebar {
  position: fixed !important; top: 0 !important; bottom: 0 !important; left: 0 !important;
  width: var(--school-sidebar-width) !important; height: 100vh !important; height: 100dvh !important;
  margin: 0 !important; background: #043b32 !important; transform: none !important;
  z-index: 1048 !important;
}
body.portal-layout.school-shell .main-sidebar .brand-link {
  display: flex; align-items: center; gap: 8px;
  min-height: var(--school-header-height); height: auto;
  max-width: 100%; padding: 12px 14px;
  background: #043b32 !important; color: #fff !important;
  border-bottom: 1px solid #ffffff24;
}
body.school-shell .brand-link .brand-image { float: none; flex: none; margin: 0 !important; }
body.school-shell .brand-link .brand-text { min-width: 0; white-space: normal; overflow-wrap: anywhere; font-size: 1rem; }
body.school-shell .main-sidebar > .sidebar {
  height: calc(100dvh - var(--school-header-height));
  overflow-y: auto !important; overflow-x: hidden;
  padding-bottom: max(18px, env(safe-area-inset-bottom, 0px));
}
body.school-shell .main-sidebar .nav-sidebar .nav-link { display: flex; align-items: center; gap: 8px; min-height: 44px; min-width: 0; }
body.school-shell .main-sidebar .nav-sidebar .nav-link p { min-width: 0; margin: 0; white-space: normal; overflow-wrap: anywhere; }
body.school-shell .main-sidebar .user-panel .info { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
body.portal-layout.school-shell .content-wrapper {
  width: auto !important; max-width: none !important; min-width: 0 !important;
  margin-left: var(--school-sidebar-width) !important; margin-top: 0 !important;
  padding-top: calc(var(--school-header-height) + 12px) !important;
  padding-bottom: calc(var(--school-footer-height) + 20px) !important;
  min-height: 100vh !important; min-height: 100dvh !important;
  overflow: visible !important;
}
body.school-shell .content-wrapper > :is(.content, .content-header) { min-width: 0; max-width: 100%; }
body.school-shell :is(.container-fluid, .card, .card-body, .row > *) { min-width: 0; }
body.school-shell .content-header { position: static !important; }
body.school-shell :is(.table-responsive, .sp-table-scroll, .school-superadmin-table-scroll) { max-width: 100%; min-width: 0; overscroll-behavior-x: contain; }
body.school-shell .table-responsive { overflow-x: auto; }
body.portal-layout.school-shell .main-footer {
  position: fixed !important; left: var(--school-sidebar-width) !important; right: 0 !important; bottom: 0 !important;
  width: auto !important; max-width: none !important; min-width: 0;
  margin: 0 !important; padding: 8px max(14px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px)) !important;
  border-top: 1px solid #ffffff24 !important; background: #043b32 !important; color: #fff !important;
  opacity: 1 !important; filter: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  z-index: 1040 !important;
}
.school-shell-footer-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; min-width: 0; font-size: .8rem; }
.school-shell-footer-meta :is(strong, span) { overflow-wrap: anywhere; }
.school-shell-footer-meta > span { margin-left: auto; }
.school-shell-footer-meta a { color: #d7e4ed; }
.school-shell-footer-nav { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; margin-bottom: 6px; }
.school-shell-footer-nav a { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; min-width: 0; padding: 5px 8px; border-radius: 4px; color: #d7e4ed; text-align: center; text-decoration: none; font-size: .88rem; font-weight: 700; overflow-wrap: anywhere; }
.school-shell-footer-nav a:is(:hover, :focus-visible, [aria-current="page"]) { color: #fff; background: #007bff; }
/* The fixed footer is for touch navigation; desktop users have the sidebar. */
@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
  body.portal-layout.school-shell .main-footer { display: none !important; }
}
/* Keep the footer on touch devices, including iPads used with a pointer. */
@media (min-width: 768px) and (hover: hover) and (pointer: fine) and (any-pointer: coarse) {
  body.portal-layout.school-shell .main-footer { display: block !important; }
}
body.school-shell .portal-chat-widget { bottom: calc(var(--school-footer-height) + 12px) !important; max-width: calc(100% - 24px); }
body.school-shell .portal-chat-widget-panel { max-height: calc(100dvh - var(--school-header-height) - var(--school-footer-height) - 32px); }
body.school-shell.sidebar-collapse { --school-sidebar-width: 68px; }
@media (min-width: 1200px) {
  body.school-shell.sidebar-collapse .main-sidebar:hover { width: 250px !important; }
  body.school-shell.sidebar-collapse .main-sidebar:not(:hover) :is(.brand-text, .user-panel .info, .nav-link p) { display: none !important; }
  body.school-shell.sidebar-collapse .main-sidebar:hover :is(.brand-text, .user-panel .info, .nav-link p) { display: block !important; opacity: 1 !important; visibility: visible !important; width: auto !important; }
}
.school-shell-overlay { display: none; }
@media (max-width: 1199.98px) {
  body.portal-layout.school-shell { --school-sidebar-width: 0px; }
  body.portal-layout.school-shell .main-sidebar {
    top: var(--school-header-height) !important; bottom: var(--school-footer-height) !important;
    width: 264px !important; max-width: calc(100% - 44px) !important;
    height: auto !important; transform: translateX(-100%) !important; visibility: hidden;
    transition: transform 160ms ease, visibility 160ms ease;
  }
  body.school-shell.sidebar-open .main-sidebar { transform: translateX(0) !important; visibility: visible; }
  body.school-shell .main-sidebar .brand-link { min-height: 56px; }
  body.school-shell .main-sidebar > .sidebar { height: calc(100dvh - var(--school-header-height) - var(--school-footer-height) - 56px); }
  body.school-shell .main-sidebar :is(.brand-text, .user-panel .info, .nav-link p) { display: block !important; opacity: 1 !important; visibility: visible !important; }
  body.school-shell.sidebar-open .school-shell-overlay {
    display: block; position: fixed; inset: var(--school-header-height) 0 var(--school-footer-height);
    border: 0; background: #102a4366; z-index: 1046;
  }
}
@media (max-width: 767.98px) {
  body.school-shell .main-header .portal-header-title { display: none !important; }
  body.school-shell .main-header .nav-user-link { display: none !important; }
  body.school-shell .main-header .nav-user-link { max-width: calc(100vw - 160px); }
  body.school-shell .main-header .nav-user-role { display: none; }
  .school-shell-footer-meta { justify-content: center; font-size: .7rem; gap: 3px 10px; }
  .school-shell-footer-meta > span { display: none; }
  .school-shell-footer-nav { gap: 3px; }
  .school-shell-footer-nav a { flex-direction: column; gap: 2px; padding: 5px 2px; font-size: .78rem; }
  .school-shell-footer-nav a[aria-current="page"] { color: #fff; background: #007bff; }
  body.school-shell .content-wrapper { padding-inline: 0; }
}
@media (max-width: 700px) {
  body.portal-layout.school-shell .main-header { min-height: calc(62px + env(safe-area-inset-top, 0px)) !important; padding-top: calc(8px + env(safe-area-inset-top, 0px)) !important; padding-bottom: 8px !important; }
}
@media (prefers-reduced-motion: reduce) { body.school-shell .main-sidebar { transition: none; } }

/* Public registration shares the theme without changing public page content. */
body.school-public-shell { min-width: 0; overflow-x: visible !important; font-family: Inter, "Segoe UI", Arial, sans-serif; font-size: 1rem; }
body.school-public-shell .public-school-header { position: sticky; top: 0; z-index: 1050; height: auto !important; min-height: 64px; padding: 0 !important; align-items: stretch; background: #043b32; opacity: 1; filter: none; backdrop-filter: none; }
body.school-public-shell .public-school-header :is(.navbar, .public-school-nav) { background: #043b32; }
body.school-public-shell .public-school-header :is(.nav-link, .public-school-brand, .navbar-brand, .public-school-login, .navbar-toggler) { color: #fff !important; }
body.public-school-page.school-public-shell .public-school-nav .navbar-collapse,
body.public-school-page.school-public-shell .public-school-nav .navbar-collapse.show { background: #043b32 !important; }
body.school-public-shell :is(main, .public-school-footer, .public-school-footer > div) { min-width: 0; max-width: 100%; }
body.school-public-shell .public-school-footer { flex-wrap: wrap; gap: 16px; }
body.school-public-shell .public-school-footer :is(span, strong, a) { overflow-wrap: anywhere; }
body.school-public-shell .public-school-footer { background: #043b32; color: #fff; }
body.school-public-shell .public-school-footer :is(a, span) { color: #d7e4ed; }
body.school-public-shell .public-school-footer strong { color: #fff; }
@media (max-width: 991.98px) {
  body.public-school-page.school-public-shell .public-school-nav { display: grid !important; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px !important; }
  body.public-school-page.school-public-shell .public-school-nav .navbar-brand { grid-column: 1; max-width: 100% !important; margin: 0 !important; }
  body.public-school-page.school-public-shell .public-school-actions { grid-column: 2; margin: 0 !important; max-width: none !important; }
  body.public-school-page.school-public-shell .public-school-nav .navbar-toggler { grid-column: 3; }
  body.public-school-page.school-public-shell .public-school-nav .navbar-collapse { grid-column: 1 / -1; width: 100%; }
}

/* The school dashboard retains its records and status content in PG Stay cards. */
body.school-shell .school-portal-dashboard .small-box { border-radius: 6px; box-shadow: 0 1px 4px #10203326; min-height: 118px; }
body.school-shell .school-portal-dashboard .small-box.bg-info { background: #2f83a8 !important; }
body.school-shell .school-portal-dashboard .small-box.bg-success { background: #248f72 !important; }
body.school-shell .school-portal-dashboard .small-box.bg-secondary { background: #526272 !important; }
body.school-shell .school-portal-dashboard .small-box .inner { padding: 16px 18px; }
body.school-shell .school-portal-dashboard .small-box h3 { font-size: 1.85rem; line-height: 1.2; overflow-wrap: anywhere; }
body.school-shell .school-portal-dashboard .small-box p { font-size: .92rem; }
body.school-shell .school-portal-dashboard :is(.card, .card-body, .card-header) { min-width: 0; }
body.school-shell .school-portal-dashboard .card { border: 1px solid #d3dbe3; border-radius: 6px; }
