/* Parent portal: only what the admin site gets from Bootstrap and its scripts, plus the phone layout.
   The shell, sign-in card, cards, tables, buttons, fields and badges all come from the shared design system
   (/Shared/Content/lt/components.css, be-theme.css, ui-kit.css); every colour, size and radius is a token. */

/* ---- Bootstrap pieces the shared CSS expects ------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
.hidden { display: none !important; }
.fade { opacity: 0; transition: opacity .15s linear; }
.fade.in { opacity: 1; }
.dropdown { position: relative; list-style: none; }
.nav.navbar-nav { margin: 0; padding: 0; list-style: none; }
.dropdown-menu { display: none; position: absolute; top: 100%; right: 0; z-index: var(--z-dropdown, 1000); min-width: 180px; margin: 4px 0 0; padding: 4px 0; list-style: none; }
.dropdown.open > .dropdown-menu { display: block; }
.dropdown-usermenu li > a { display: block; padding: 8px 14px; text-decoration: none; cursor: pointer; }
.container.body { width: 100%; }

/* ---- shell pieces of the portal ------------------------------------------------------------------- */
.pp-logo { display: inline-flex; align-items: center; justify-content: center; width: var(--size-avatar); height: var(--size-avatar); border-radius: var(--radius-round); background: var(--color-primary-soft); color: var(--color-primary); font-size: 1.2em; }
.lt-shell .pp-bar-student { max-width: 360px; }
.lt-shell .pp-student-select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: var(--space-md); text-overflow: ellipsis; }
.pp-menu-btn { display: none; }
.pp-bell { position: relative; }
.lt-shell #ppUserMenu .lt-user-avatar { text-transform: uppercase; }
.pp-main { display: block; }
.pp-page-title { margin: 0 0 var(--space-lg); }
.pp-grid { display: grid; gap: var(--space-lg); grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-bottom: var(--space-lg); }
.pp-section { margin-bottom: var(--space-xl, 32px); }
.pp-toolbar { display: flex; gap: var(--space-md); align-items: flex-end; flex-wrap: wrap; margin-bottom: var(--space-lg); }
.pp-day { margin-bottom: var(--space-lg); }
.pp-day-title { margin: 0 0 var(--space-sm); color: var(--color-muted); font-weight: 600; }
.pp-note { white-space: pre-wrap; }
.pp-unread { border-left: 4px solid var(--color-primary); }
.pp-center { text-align: center; }
.pp-hidden { display: none !important; }
.pp-drawer-backdrop, .pp-tabbar { display: none; }

/* sign-in: the shell is hidden by the shared "body:has(.lt-auth)" rules; the card fills the window like the admin sign-in */
body:has(.lt-auth) .pp-main { padding: 0; }
body:has(.lt-auth) .lt-footer { display: none; }

/* ---- tablet: the shared CSS already shows the icon rail; nothing to add ---------------------------- */

/* ---- phone: bottom tab bar (like a mobile app); the sidebar becomes a drawer opened from "More" or the menu button ---- */
@media (max-width: 700px) {
  .pp-menu-btn { display: inline-flex; }
  body.lt-shell .lt-main, body.lt-shell.nav-md .lt-main, body.lt-shell.nav-sm .lt-main { margin: 0; border-radius: 0; border: 0; padding: var(--space-sm) var(--space-sm) calc(64px + env(safe-area-inset-bottom)); min-height: 100vh; }
  .lt-shell:is(.nav-md, .nav-sm) .container.body .lt-sidebar { display: none; width: min(300px, 85vw); }
  body.pp-drawer .lt-shell:is(.nav-md, .nav-sm) .container.body .lt-sidebar,
  body.lt-shell.pp-drawer:is(.nav-md, .nav-sm) .container.body .lt-sidebar { display: block; box-shadow: var(--shadow-sidebar-overlay); z-index: calc(var(--z-sidebar) + 2); }
  body.lt-shell.pp-drawer .pp-drawer-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: calc(var(--z-sidebar) + 1); }
  body.lt-shell.pp-drawer .lt-sidebar-toggle { display: none; }
  .lt-shell .lt-content-card { padding: var(--space-md); }
  .lt-shell .lt-footer { display: none; }
  .lt-shell .pp-bar-student { flex: 1 1 0; max-width: none; }

  .pp-tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sidebar); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--color-topbar); border-top: 1px solid var(--color-card-border); }
  .pp-tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; border-radius: var(--radius-lg); color: var(--color-muted); text-decoration: none; font-size: var(--font-size-2xs, 11px); }
  .pp-tabbar a i { font-size: 1.5em; }
  .pp-tabbar a.pp-active { color: var(--color-primary); background: var(--color-primary-soft); font-weight: 600; }
  .pp-toolbar > * { flex: 1 1 100%; }
  .pp-grid { grid-template-columns: 1fr; }
}

/* KPI tiles use the dashboards' tile (be-dashboards.css); the portal only gives the value and icon their own class names */
.pp-toolbar .be-kpi-tile { min-width: 200px; }
.pp-grid .be-kpi-tile { margin: 0; }

/* top bar: the student box (or nothing) on the left, chips on the right - like the admin search + chips */
.lt-shell .pp-bar-spacer { flex: 1 1 auto; }
.lt-shell .pp-menu-btn { display: none; }
.lt-shell .lt-user-btn, .lt-shell .lt-user-btn:hover { text-decoration: none; }
.lt-shell .lt-menu a { text-decoration: none; }
.lt-auth-form .lt-auth-btn { margin-top: var(--space-md); }

/* student cards on Home */
.pp-avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; width: var(--size-avatar); height: var(--size-avatar); border-radius: var(--radius-round); background: var(--color-primary); color: var(--palette-white, #fff); font-weight: 600; text-transform: uppercase; }
.pp-kid-name { font-weight: 600; font-size: var(--font-size-lg, 1.05em); color: var(--color-text); }
@media (max-width: 700px) {
  .lt-shell .pp-menu-btn { display: inline-flex; }
  .lt-shell .lt-status, .lt-shell .lt-user-name, .lt-shell .lt-user-btn .fa-angle-down { display: none; }
  .lt-shell .lt-topbar { flex-wrap: nowrap; }
  .pp-grid.pp-tiles { grid-template-columns: 1fr 1fr; gap: var(--space-sm); }
  .pp-grid .be-kpi-tile { padding: var(--space-md) !important; }
  .be-hero { padding: var(--space-md) var(--space-lg); }
}
.lt-shell .pp-student-select { font: inherit; }
