/* =====================================================================
   BRIGHT-BRIDGE — PARENT & STUDENT PORTAL
   ---------------------------------------------------------------------
   Deliberately plainer than the admin panel. A parent opens this once a
   term, often on a phone, often on a slow connection: big touch
   targets, one column, and no chrome that has to be learned.
   ===================================================================== */

:root {
  --pt-navy:   #281670;
  --pt-deep:   #10092D;
  --pt-lift:   #361E97;
  --pt-link:   #2D187E;
  --pt-050:    #F2EEFE;
  --pt-100:    #E2DCFC;
  --pt-gold:   #F7C100;
  --pt-ink:    #1A1A1A;
  --pt-soft:   #4A4A55;
  --pt-muted:  #6B6B78;
  --pt-line:   #E3E4EF;
  --pt-bg:     #F5F6FB;
  --pt-radius: 14px;

  --bs-primary: #281670;
  --bs-primary-rgb: 40, 22, 112;
  --bs-border-radius: 12px;
}

* { box-sizing: border-box; }

body.portal,
body.portal-auth {
  margin: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Roboto, Arial, sans-serif;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--pt-ink);
  background: var(--pt-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--pt-link); text-decoration: none; }
a:hover { color: var(--pt-navy); }
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -.015em; margin: 0 0 .5rem; }
:focus-visible { outline: 3px solid var(--pt-gold); outline-offset: 2px; border-radius: 4px; }

.pt-wrap { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }

/* ---------------------------------------------------------------------
   SIGN IN
   ------------------------------------------------------------------ */
body.portal-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--pt-deep);
  padding: 1.5rem 1rem;
}
.auth-card {
  width: 100%;
  max-width: 27rem;
  background: #fff;
  border-radius: 18px;
  padding: 2rem 1.75rem;
  box-shadow: 0 24px 60px rgba(16, 9, 45, .45);
}
.auth-brand { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.5rem; color: inherit; }
.auth-brand img { background: #fff; border-radius: 10px; }
.auth-brand strong { display: block; font-size: 1rem; color: var(--pt-navy); }
.auth-brand small { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--pt-muted); }
.auth-card h1 { font-size: 1.4rem; }
.auth-lead { color: var(--pt-soft); font-size: .93rem; margin-bottom: 1.5rem; }
.auth-foot { margin: 1rem 0 0; text-align: center; font-size: .9rem; }
.auth-foot.small { color: var(--pt-muted); font-size: .82rem; }
.auth-back { margin: 1.5rem 0 0; text-align: center; font-size: .82rem; }
.auth-back a { color: var(--pt-muted); }

/* ---------------------------------------------------------------------
   SHELL
   ------------------------------------------------------------------ */
.pt-bar { background: var(--pt-navy); color: #fff; position: sticky; top: 0; z-index: 100; }
.pt-bar .pt-wrap { display: flex; align-items: center; gap: 1rem; min-height: 62px; flex-wrap: wrap; }

.pt-brand { display: flex; align-items: center; gap: .6rem; color: #fff; margin-right: auto; }
.pt-brand:hover { color: #fff; }
.pt-brand img { background: #fff; border-radius: 8px; padding: 2px; }
.pt-brand img, .pt-auth__head img { width: 52px; height: 52px; object-fit: contain; }
.pt-brand strong { display: block; font-size: .95rem; line-height: 1.1; }
.pt-brand small { display: block; font-size: .64rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--pt-gold); }

.pt-burger {
  display: none;
  background: none; border: 1px solid rgba(255,255,255,.3);
  color: #fff; border-radius: 9px; width: 40px; height: 40px; font-size: 1.2rem;
}

.pt-nav { display: flex; gap: .15rem; flex-wrap: wrap; }
.pt-nav a {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem .8rem; border-radius: 9px;
  color: rgba(255,255,255,.82); font-size: .88rem; font-weight: 600;
}
.pt-nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.pt-nav a.active { background: rgba(255,255,255,.16); color: #fff; box-shadow: inset 0 -3px 0 var(--pt-gold); }
.pt-nav .pt-out { color: rgba(255,255,255,.6); }

@media (max-width: 860px) {
  .pt-burger { display: inline-flex; align-items: center; justify-content: center; }
  .pt-nav { display: none; width: 100%; flex-direction: column; padding-bottom: .75rem; }
  .pt-nav.is-open { display: flex; }
  .pt-nav a { padding: .7rem .8rem; }
}

.pt-main { padding: 1.75rem 0 3rem; min-height: 60vh; }

.pt-head {
  display: flex; flex-wrap: wrap; gap: 1rem;
  align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
}
.pt-head h1 { font-size: 1.5rem; margin: 0; }
.pt-head p { margin: 0; color: var(--pt-muted); font-size: .92rem; }

.pt-user { display: inline-flex; align-items: center; gap: .55rem; font-size: .88rem; font-weight: 600; }
.pt-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--pt-navy); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 800;
}

.pt-foot { border-top: 1px solid var(--pt-line); background: #fff; padding: 1.25rem 0; font-size: .82rem; color: var(--pt-muted); }
.pt-foot .pt-wrap { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }

/* ---------------------------------------------------------------------
   PIECES
   ------------------------------------------------------------------ */
.pt-card {
  background: #fff;
  border: 1px solid var(--pt-line);
  border-radius: var(--pt-radius);
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.pt-card__head {
  display: flex; flex-wrap: wrap; gap: .75rem;
  align-items: center; justify-content: space-between;
  padding: .95rem 1.15rem;
  border-bottom: 1px solid var(--pt-line);
  background: #FCFCFE;
}
.pt-card__head h2 { font-size: .98rem; margin: 0; }
.pt-card__body { padding: 1.15rem; }

/* Child switcher — the single most-used control for a parent with
   more than one child at the school */
.pt-kids { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.pt-kid {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .5rem .9rem .5rem .5rem;
  background: #fff; border: 2px solid var(--pt-line);
  border-radius: 999px; color: var(--pt-ink); font-weight: 700; font-size: .9rem;
}
.pt-kid:hover { border-color: var(--pt-100); color: var(--pt-ink); }
.pt-kid.active { border-color: var(--pt-navy); background: var(--pt-050); color: var(--pt-navy); }
.pt-kid__pic {
  width: 30px; height: 30px; border-radius: 50%; object-fit: cover;
  background: var(--pt-navy); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 800;
}

.pt-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.pt-tile {
  background: #fff; border: 1px solid var(--pt-line); border-radius: var(--pt-radius);
  padding: 1.1rem 1.2rem; color: inherit;
}
a.pt-tile:hover { border-color: var(--pt-100); color: inherit; }
.pt-tile__value { font-size: 1.6rem; font-weight: 900; letter-spacing: -.02em; line-height: 1.15; }
.pt-tile__label { font-size: .8rem; color: var(--pt-muted); margin: 0; }
.pt-tile--navy { background: var(--pt-navy); border-color: var(--pt-navy); color: #fff; }
.pt-tile--navy .pt-tile__label { color: rgba(255,255,255,.75); }
.pt-tile--gold { border-left: 4px solid var(--pt-gold); }
.pt-tile--good { border-left: 4px solid #12805C; }
.pt-tile--owed { border-left: 4px solid #C42D2D; }

.pt-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.pt-table th {
  text-align: left; padding: .7rem 1.15rem;
  font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--pt-muted); background: #FCFCFE; border-bottom: 1px solid var(--pt-line);
}
.pt-table td { padding: .8rem 1.15rem; border-bottom: 1px solid var(--pt-line); vertical-align: top; }
.pt-table tr:last-child td { border-bottom: 0; }
.pt-table tfoot th { background: var(--pt-050); color: var(--pt-navy); font-size: .82rem; text-transform: none; letter-spacing: 0; }

.pt-empty { text-align: center; padding: 2.5rem 1.25rem; color: var(--pt-muted); }
.pt-empty i { font-size: 2.2rem; color: var(--pt-100); display: block; margin-bottom: .75rem; }
.pt-empty h3 { font-size: 1.05rem; color: var(--pt-ink); }
.pt-empty p { margin: 0 auto; max-width: 30rem; font-size: .92rem; }

.pt-notice { padding: 1.15rem; border-bottom: 1px solid var(--pt-line); }
.pt-notice:last-child { border-bottom: 0; }
.pt-notice--urgent { border-left: 4px solid #C42D2D; background: #FFF8F8; }
.pt-notice h3 { font-size: 1rem; margin-bottom: .2rem; }
.pt-notice__meta { font-size: .78rem; color: var(--pt-muted); margin-bottom: .6rem; }
.pt-notice__body { font-size: .93rem; color: var(--pt-soft); }
.pt-notice__body p:last-child { margin-bottom: 0; }

.pt-cal { display: flex; gap: 1rem; padding: .9rem 1.15rem; border-bottom: 1px solid var(--pt-line); align-items: flex-start; }
.pt-cal:last-child { border-bottom: 0; }
.pt-cal__date {
  flex: 0 0 62px; text-align: center;
  background: var(--pt-050); border-radius: 10px; padding: .4rem 0; color: var(--pt-navy);
}
.pt-cal__date strong { display: block; font-size: 1.15rem; line-height: 1; }
.pt-cal__date span { font-size: .66rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.pt-cal h3 { font-size: .95rem; margin: 0 0 .1rem; }
.pt-cal p { margin: 0; font-size: .85rem; color: var(--pt-muted); }

.btn-brand { background: var(--pt-navy); border-color: var(--pt-navy); color: #fff; font-weight: 700; }
.btn-brand:hover { background: var(--pt-lift); border-color: var(--pt-lift); color: #fff; }
.btn-soft { background: var(--pt-050); border-color: var(--pt-050); color: var(--pt-navy); font-weight: 700; }
.btn-soft:hover { background: var(--pt-100); color: var(--pt-navy); }

.text-muted-2 { color: var(--pt-muted) !important; }
.pt-pill {
  display: inline-block; padding: .12rem .5rem; border-radius: 999px;
  font-size: .72rem; font-weight: 800;
}

@media print {
  .pt-bar, .pt-foot, .pt-kids, .pt-head, .alert, .pt-noprint { display: none !important; }
  body.portal { background: #fff; font-size: 12px; }
  .pt-card { border: 0; }
  .pt-main { padding: 0; }
}

/* ---------------------------------------------------------------------
   REPORT CARD — the same shape the office prints, so a parent's copy
   and the school's copy are recognisably one document
   ------------------------------------------------------------------ */
.report-card__head {
  display: flex; gap: 1rem; align-items: center;
  border-bottom: 3px solid var(--pt-navy);
  padding-bottom: 1rem; margin-bottom: 1.25rem;
}
.report-card__head img { background: #fff; border-radius: 8px; }
.report-card__head h2 { font-size: 1.15rem; margin: 0; color: var(--pt-navy); }
.report-card__head p { margin: 0; font-size: .8rem; color: var(--pt-muted); }

.report-card__title {
  text-align: center; font-size: .8rem; font-weight: 900;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--pt-muted); margin: 0 0 1.25rem;
}

.report-card__facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .85rem 1.5rem; margin: 0 0 1.5rem;
  padding: 1rem 1.15rem; background: var(--pt-050); border-radius: var(--pt-radius);
}
.report-card__facts dt {
  font-size: .66rem; font-weight: 800; letter-spacing: .09em;
  text-transform: uppercase; color: var(--pt-muted);
}
.report-card__facts dd { margin: .1rem 0 0; font-weight: 700; font-size: .92rem; }

.report-card__sign {
  display: flex; gap: 2rem; flex-wrap: wrap;
  margin-top: 2.5rem; font-size: .78rem; color: var(--pt-muted);
}
.report-card__sign div { flex: 1 1 160px; }
.report-card__sign span {
  display: block; border-bottom: 1px solid var(--pt-muted);
  height: 2.2rem; margin-bottom: .35rem;
}
