/* Smart School — shared brand layer (Al-Imtidad Al-Raqami house style).
   Used by every sign-in screen (login.html, index, parent, vendor, teacher, owner) so they all
   look identical, and by the alerts drawer (alerts.js). Everything is prefixed bd- (brand door)
   or ssa- (alerts) so it never collides with a page's own component styles. */

:root {
  --ssb-navy: #14315E;
  --ssb-navy-deep: #0C2145;
  --ssb-navy-soft: #1C407A;
  --ssb-gold: #C8A24B;
  --ssb-gold-deep: #A6842F;
  --ssb-gold-soft: #F6EFDC;
  --ssb-cream: #FBFAF6;
  --ssb-paper: #FFFFFF;
  --ssb-ink: #16223A;
  --ssb-muted: #5A6576;
  --ssb-faint: #8A93A3;
  --ssb-line: #E3E2DC;
  --ssb-field: #FBFBF9;
  --ssb-red: #A94425;
  --ssb-red-soft: #FBEAE3;
  --ssb-green: #2E7D52;
  --ssb-green-soft: #DFF3E8;
  --ssb-font: "Tajawal", "Segoe UI", Tahoma, system-ui, sans-serif;
  --ssb-display: "Outfit", "Tajawal", "Segoe UI", system-ui, sans-serif;
  --ssb-safe-top: env(safe-area-inset-top, 0px);
  --ssb-safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* =====================================================================
   Sign-in page: navy brand panel + card on the cream side.
   Phones: the panel becomes a compact header band and the card rides over it.
   ===================================================================== */
.bd-page {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(380px, 44%) 1fr;
  background: var(--ssb-cream);
  color: var(--ssb-ink);
  font-family: var(--ssb-font);
  font-size: 16px;
  line-height: 1.5;
  color-scheme: light;
  text-align: start;
  -webkit-text-size-adjust: 100%;
}
.bd-page *, .bd-page *::before, .bd-page *::after { box-sizing: border-box; }
.bd-page button, .bd-page input { font-family: inherit; }
.bd-page [hidden] { display: none !important; }
.bd-page :where(a) { color: inherit; }

/* ---------- brand panel ---------- */
.bd-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding: calc(2.5rem + var(--ssb-safe-top)) 3rem 2.5rem;
  color: #fff;
  background: linear-gradient(160deg, var(--ssb-navy) 0%, var(--ssb-navy-deep) 100%);
  isolation: isolate;
}
.bd-grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse at 30% 40%, #000 30%, transparent 75%);
}
.bd-glow {
  position: absolute;
  z-index: -1;
  width: 440px;
  height: 440px;
  inset-inline-end: -150px;
  bottom: -170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 162, 75, 0.36), transparent 65%);
  pointer-events: none;
}
.bd-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.bd-company {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  text-decoration: none;
  width: fit-content;
  border-radius: 14px;
  padding: 2px 8px 2px 2px;
  margin: -2px;
}
html[dir="rtl"] .bd-company { padding: 2px 2px 2px 8px; }
.bd-company:hover .bd-company-name { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--ssb-gold); }
.bd-company:focus-visible { outline: 2px solid var(--ssb-gold); outline-offset: 3px; }
.bd-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.bd-mark svg { display: block; width: 30px; height: 30px; }
.bd-company-txt { display: flex; flex-direction: column; line-height: 1.2; }
.bd-company-by { font-size: 0.74rem; letter-spacing: 0.04em; color: rgba(255, 255, 255, 0.62); }
.bd-company-name { font-weight: 700; font-size: 1.08rem; }

.bd-hero { max-width: 31rem; }
.bd-product { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.bd-app-icon {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.bd-product-name {
  margin: 0;
  font-family: var(--ssb-display);
  font-weight: 700;
  font-size: clamp(2.3rem, 3.6vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: #fff;
}
html[dir="rtl"] .bd-product-name { font-family: var(--ssb-font); font-weight: 800; letter-spacing: 0; }
.bd-owner-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 11px 4px 9px;
  border-radius: 999px;
  background: var(--ssb-gold);
  color: var(--ssb-navy-deep);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
html[dir="rtl"] .bd-owner-chip { letter-spacing: 0; padding: 4px 9px 4px 11px; }
.bd-owner-chip svg { width: 14px; height: 14px; fill: currentColor; }
.bd-tagline { margin: 0 0 2rem; font-size: 1.18rem; color: rgba(255, 255, 255, 0.8); }
.bd-features { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.bd-features li { display: flex; align-items: flex-start; gap: 0.8rem; font-size: 1.02rem; line-height: 1.6; color: rgba(255, 255, 255, 0.92); }
.bd-dot { flex: none; width: 10px; height: 10px; margin-top: 0.55em; background: var(--ssb-gold); border-radius: 2px; }
.bd-site {
  font-family: var(--ssb-display);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  width: fit-content;
}
.bd-site:hover { color: #fff; }
.bd-site:focus-visible { outline: 2px solid var(--ssb-gold); outline-offset: 3px; border-radius: 4px; }

/* ---------- language switch (one element, positioned over whichever side is on top) ---------- */
.bd-lang {
  position: absolute;
  z-index: 3;
  top: calc(1.25rem + var(--ssb-safe-top));
  inset-inline-end: 1.5rem;
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--ssb-line);
  box-shadow: 0 1px 2px rgba(22, 34, 58, 0.05);
}
.bd-lang-btn {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ssb-muted);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}
.bd-lang-btn:hover { color: var(--ssb-navy); }
.bd-lang-btn.active { background: var(--ssb-navy); color: #fff; }
.bd-lang-btn:focus-visible { outline: 2px solid var(--ssb-gold); outline-offset: 2px; }

/* ---------- sign-in side ---------- */
.bd-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 5rem 1.5rem 1.75rem;
  min-width: 0;
}
.bd-card {
  width: 100%;
  max-width: 440px;
  margin: 0;
  background: var(--ssb-paper);
  border: 1px solid var(--ssb-line);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(22, 34, 58, 0.04), 0 18px 40px -12px rgba(22, 34, 58, 0.18);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  animation: bd-rise 0.35s ease-out both;
}
@keyframes bd-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.bd-head { display: flex; align-items: center; gap: 0.95rem; margin-bottom: 0.15rem; }
.bd-head-icon {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--ssb-gold-soft);
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 1px rgba(200, 162, 75, 0.25);
  overflow: hidden;
}
.bd-head-icon img { width: 52px; height: 52px; display: block; }
.bd-head-icon svg { width: 28px; height: 28px; }
.bd-title {
  margin: 0;
  font-family: var(--ssb-display);
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.005em;
  color: var(--ssb-navy);
}
html[dir="rtl"] .bd-title { font-family: var(--ssb-font); font-weight: 800; letter-spacing: 0; }
.bd-hint { margin: 0.2rem 0 0; color: var(--ssb-muted); font-size: 0.95rem; }

/* role tabs (the shared door) */
.bd-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: #F2F1EC;
  border: 1px solid #ECEBE5;
}
.bd-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 60px;
  padding: 6px 4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ssb-muted);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.bd-tab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bd-tab:hover { color: var(--ssb-navy); }
.bd-tab[aria-selected="true"] {
  background: #fff;
  color: var(--ssb-navy);
  box-shadow: 0 1px 3px rgba(22, 34, 58, 0.12), inset 0 -2px 0 var(--ssb-gold);
}
.bd-tab:focus-visible { outline: 2px solid var(--ssb-navy); outline-offset: 1px; }
.bd-tab-sub { margin: -0.35rem 0 0; font-size: 0.86rem; color: var(--ssb-muted); text-align: center; }

/* fields */
.bd-field { display: flex; flex-direction: column; gap: 0.4rem; margin: 0; }
.bd-label { font-weight: 700; font-size: 0.92rem; color: var(--ssb-ink); }
.bd-input { position: relative; display: flex; align-items: center; }
.bd-page .bd-input input {
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 0 2.9rem;
  font-size: 16px; /* no zoom on iPhone */
  border: 1.5px solid var(--ssb-line);
  border-radius: 12px;
  background: var(--ssb-field);
  color: var(--ssb-ink);
  outline: none;
  box-shadow: none;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.bd-page .bd-input input::placeholder { color: #A9AFBA; }
.bd-page .bd-input input:focus {
  border-color: var(--ssb-navy);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(20, 49, 94, 0.12);
}
.bd-page .bd-input input[readonly] { background: #F3F2EE; color: var(--ssb-muted); }
.bd-page .bd-input input[aria-invalid="true"] { border-color: #C0564A; box-shadow: 0 0 0 4px rgba(192, 86, 74, 0.12); }
/* inputs hold phone numbers, usernames, passwords and codes: left-to-right, so their icons stay
   on the physical sides in both languages */
.bd-icon { position: absolute; left: 0.95rem; width: 20px; height: 20px; fill: #9AA3B2; pointer-events: none; }
.bd-page .bd-input input.bd-otp-input { letter-spacing: 0.3em; font-weight: 700; font-size: 20px; }
.bd-eye {
  position: absolute;
  right: 0.45rem;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #6B7280;
}
.bd-eye:hover { background: #F1F0EC; color: var(--ssb-navy); }
.bd-eye:focus-visible { outline: 2px solid var(--ssb-navy); outline-offset: 0; }
.bd-eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bd-eye .bd-eye-off { display: none; }
.bd-eye[aria-pressed="true"] .bd-eye-on { display: none; }
.bd-eye[aria-pressed="true"] .bd-eye-off { display: block; }

/* messages */
.bd-error, .bd-info {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.5;
  font-weight: 600;
}
.bd-error { background: var(--ssb-red-soft); color: #8E3A20; border: 1px solid #F0CDBF; }
.bd-info { background: #EEF2F9; color: var(--ssb-navy); border: 1px solid #DCE3F0; }
.bd-error:empty, .bd-info:empty { display: none; }
.bd-error::before, .bd-info::before {
  content: "!";
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--ssb-red);
  color: #fff;
  font-family: var(--ssb-display);
  font-size: 12px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}
.bd-info::before { content: "i"; background: var(--ssb-navy); }

/* primary button */
.bd-submit {
  position: relative;
  min-height: 54px;
  width: 100%;
  margin: 0;
  border-radius: 12px;
  border: 0;
  background: var(--ssb-navy);
  color: #fff;
  font-size: 1.08rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: inset 0 -3px 0 var(--ssb-gold);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.bd-submit:hover:not(:disabled) { background: var(--ssb-navy-soft); }
.bd-submit:active:not(:disabled) { transform: translateY(1px); }
.bd-submit:disabled { opacity: 0.6; cursor: progress; }
.bd-submit:focus-visible { outline: 3px solid var(--ssb-gold); outline-offset: 2px; }
.bd-spin {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: bd-spin 0.8s linear infinite;
}
.bd-submit.is-busy .bd-spin { display: inline-block; }
@keyframes bd-spin { to { transform: rotate(360deg); } }

.bd-linkbtn {
  align-self: center;
  border: 0;
  background: none;
  padding: 4px 6px;
  color: var(--ssb-navy);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(20, 49, 94, 0.3);
  cursor: pointer;
  border-radius: 6px;
}
.bd-linkbtn:hover { text-decoration-color: var(--ssb-gold); }
.bd-linkbtn:focus-visible { outline: 2px solid var(--ssb-navy); outline-offset: 2px; }

.bd-note {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  background: #F4F6FA;
  color: #4B5563;
  font-size: 0.86rem;
  line-height: 1.55;
}
.bd-note svg { flex: none; width: 20px; height: 20px; margin-top: 1px; fill: none; stroke: var(--ssb-navy); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: 0.8; }

.bd-divider { display: flex; align-items: center; gap: 0.75rem; color: var(--ssb-faint); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; }
.bd-divider::before, .bd-divider::after { content: ""; flex: 1; height: 1px; background: var(--ssb-line); }

/* "continue as" — sessions already open on this device */
.bd-continue { display: grid; gap: 8px; }
.bd-continue-title { margin: 0; font-size: 0.86rem; font-weight: 800; color: var(--ssb-muted); }
.bd-continue a {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 56px;
  padding: 0.55rem 0.8rem;
  border-radius: 12px;
  border: 1.5px solid var(--ssb-line);
  background: var(--ssb-field);
  color: var(--ssb-ink);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.bd-continue a:hover { border-color: var(--ssb-navy); background: #fff; }
.bd-continue a:focus-visible { outline: 2px solid var(--ssb-navy); outline-offset: 2px; }
.bd-continue .bd-c-ic { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--ssb-gold-soft); display: grid; place-items: center; color: var(--ssb-navy); }
.bd-continue .bd-c-ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bd-continue .bd-c-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.bd-continue .bd-c-txt b { font-size: 0.98rem; }
.bd-continue .bd-c-txt span { font-size: 0.82rem; color: var(--ssb-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-continue .bd-c-go { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--ssb-faint); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
html[dir="rtl"] .bd-continue .bd-c-go { transform: scaleX(-1); }

.bd-alt { align-self: center; font-size: 0.88rem; font-weight: 700; color: var(--ssb-navy); text-decoration: none; padding: 4px 6px; border-radius: 6px; }
.bd-alt:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--ssb-gold); }
.bd-alt:focus-visible { outline: 2px solid var(--ssb-navy); outline-offset: 2px; }

/* legal footer under the card */
.bd-legal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: #858B96;
  text-align: center;
}
.bd-legal a { color: inherit; text-decoration: underline; text-decoration-color: rgba(133, 139, 150, 0.4); text-underline-offset: 2px; }
.bd-legal a:hover { color: var(--ssb-navy); }
.bd-secure { display: inline-flex; align-items: center; gap: 0.35rem; color: #4D7C5B; font-weight: 700; }
.bd-secure svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- owner variant ---------- */
.bd-page.bd-owner .bd-brand { background: linear-gradient(160deg, #10284F 0%, #08172F 100%); }
.bd-page.bd-owner .bd-glow { background: radial-gradient(circle, rgba(200, 162, 75, 0.48), transparent 65%); }
.bd-page.bd-owner .bd-card { border-top: 4px solid var(--ssb-gold); }
.bd-page.bd-owner .bd-head-icon { background: var(--ssb-navy); box-shadow: 0 0 0 1px rgba(20, 49, 94, 0.3); }

/* ---------- tablets and phones: brand panel becomes a header band ---------- */
@media (max-width: 900px) {
  .bd-page { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .bd-brand {
    padding: calc(1rem + var(--ssb-safe-top)) max(1.1rem, env(safe-area-inset-right)) 4.6rem max(1.1rem, env(safe-area-inset-left));
    gap: 1.1rem;
    justify-content: flex-start;
  }
  .bd-mark { width: 40px; height: 40px; border-radius: 11px; }
  .bd-mark svg { width: 26px; height: 26px; }
  .bd-company-name { font-size: 0.98rem; }
  .bd-company-by { font-size: 0.7rem; }
  .bd-product { gap: 0.8rem; margin-bottom: 0.35rem; }
  .bd-app-icon { width: 48px; height: 48px; border-radius: 13px; }
  .bd-product-name { font-size: 1.75rem; }
  .bd-owner-chip { margin-top: 4px; font-size: 0.7rem; }
  .bd-tagline { margin: 0; font-size: 0.98rem; }
  .bd-features, .bd-site { display: none; }
  .bd-glow { width: 300px; height: 300px; bottom: -150px; }
  .bd-main {
    justify-content: flex-start;
    margin-top: -3.4rem;
    padding: 0 max(1rem, env(safe-area-inset-right)) max(1.5rem, var(--ssb-safe-bottom)) max(1rem, env(safe-area-inset-left));
    position: relative;
    z-index: 2;
  }
  /* the switch sits in the navy band: translucent, and only the language you can switch TO */
  .bd-lang {
    top: calc(1.05rem + var(--ssb-safe-top));
    inset-inline-end: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.26);
    box-shadow: none;
  }
  .bd-lang-btn { color: #fff; min-height: 32px; }
  .bd-lang-btn:hover { color: #fff; }
  .bd-lang-btn.active { display: none; }
}

@media (max-width: 420px) {
  .bd-card { padding: 1.4rem 1.1rem; border-radius: 18px; gap: 1rem; }
  .bd-title { font-size: 1.35rem; }
  .bd-head-icon, .bd-head-icon img { width: 46px; height: 46px; }
  .bd-tab { min-height: 56px; font-size: 0.84rem; }
}

@media (prefers-reduced-motion: reduce) {
  .bd-card { animation: none; }
  .bd-spin { animation-duration: 2s; }
  .bd-page *, .ssa-panel, .ssa-scrim { transition: none !important; }
}

/* =====================================================================
   Alerts: trigger badge, drawer, push-notification control (alerts.js)
   ===================================================================== */
.ssa-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--ssb-gold);
  color: var(--ssb-navy-deep);
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  margin-inline-start: auto;
}
.ssa-count[hidden] { display: none; }
.ssa-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--ssb-line);
  background: #fff;
  color: var(--ssb-navy);
  font-family: var(--ssb-font);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
.ssa-trigger:hover { border-color: var(--ssb-navy); }
.ssa-trigger:focus-visible { outline: 2px solid var(--ssb-navy); outline-offset: 2px; }
.ssa-trigger svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ssa-trigger .ssa-count { margin-inline-start: 0; }

.ssa-scrim {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(12, 33, 69, 0.45);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.ssa-scrim.open { opacity: 1; }
.ssa-panel {
  position: fixed;
  z-index: 9001;
  top: 0;
  bottom: 0;
  inset-inline-end: 0;
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--ssb-cream);
  color: var(--ssb-ink);
  font-family: var(--ssb-font);
  font-size: 15px;
  line-height: 1.5;
  box-shadow: -18px 0 50px rgba(12, 33, 69, 0.22);
  transform: translateX(100%);
  transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
  text-align: start;
}
html[dir="rtl"] .ssa-panel { transform: translateX(-100%); box-shadow: 18px 0 50px rgba(12, 33, 69, 0.22); }
.ssa-panel.open, html[dir="rtl"] .ssa-panel.open { transform: none; }
.ssa-panel[hidden], .ssa-scrim[hidden] { display: none !important; }
.ssa-panel *, .ssa-panel *::before, .ssa-panel *::after { box-sizing: border-box; }
.ssa-panel button { font-family: inherit; }
.ssa-panel [hidden] { display: none !important; }

.ssa-head {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(18px + var(--ssb-safe-top)) 18px 18px 20px;
  background: linear-gradient(160deg, var(--ssb-navy) 0%, var(--ssb-navy-deep) 100%);
  color: #fff;
}
html[dir="rtl"] .ssa-head { padding: calc(18px + var(--ssb-safe-top)) 20px 18px 18px; }
.ssa-head::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  inset-inline-end: -80px;
  top: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 162, 75, 0.35), transparent 65%);
  pointer-events: none;
}
.ssa-head h2 { margin: 0; font-family: var(--ssb-display); font-size: 20px; font-weight: 700; flex: 1; }
html[dir="rtl"] .ssa-head h2 { font-family: var(--ssb-font); font-weight: 800; }
.ssa-head .ssa-sub { display: block; font-family: var(--ssb-font); font-size: 12.5px; font-weight: 500; color: rgba(255, 255, 255, 0.7); margin-top: 2px; }
.ssa-close {
  position: relative;
  z-index: 1;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.ssa-close:hover { background: rgba(255, 255, 255, 0.16); }
.ssa-close:focus-visible { outline: 2px solid var(--ssb-gold); outline-offset: 2px; }
.ssa-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

.ssa-body { flex: 1; overflow-y: auto; padding: 16px 16px calc(16px + var(--ssb-safe-bottom)); display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain; }

.ssa-push {
  background: #fff;
  border: 1px solid var(--ssb-line);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.ssa-push-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--ssb-gold-soft); color: var(--ssb-navy); }
.ssa-push-ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ssa-push[data-state="on"] .ssa-push-ic { background: var(--ssb-green-soft); color: var(--ssb-green); }
.ssa-push[data-state="blocked"] .ssa-push-ic, .ssa-push[data-state="error"] .ssa-push-ic { background: var(--ssb-red-soft); color: var(--ssb-red); }
.ssa-push-txt { flex: 1; min-width: 0; }
.ssa-push-txt b { display: block; font-size: 15px; }
.ssa-push-txt p { margin: 2px 0 0; font-size: 13.5px; color: var(--ssb-muted); }
.ssa-push-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ssa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  background: var(--ssb-navy);
  color: #fff;
}
.ssa-btn:hover:not(:disabled) { background: var(--ssb-navy-soft); }
.ssa-btn.quiet { background: #fff; color: var(--ssb-navy); border-color: var(--ssb-line); }
.ssa-btn.quiet:hover:not(:disabled) { border-color: var(--ssb-navy); background: #fff; }
.ssa-btn:disabled { opacity: 0.55; cursor: progress; }
.ssa-btn:focus-visible { outline: 2px solid var(--ssb-gold); outline-offset: 2px; }
.ssa-msg { font-size: 13px; font-weight: 600; margin-top: 8px; color: var(--ssb-green); }
.ssa-msg.err { color: var(--ssb-red); }
.ssa-msg:empty { display: none; }

.ssa-list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 2px 0; }
.ssa-list-head h3 { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ssb-faint); }
html[dir="rtl"] .ssa-list-head h3 { letter-spacing: 0; }
.ssa-list { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--ssb-line); border-radius: 16px; overflow: hidden; }
.ssa-item { display: flex; gap: 12px; padding: 13px 16px; border-bottom: 1px solid #EFEEE9; }
.ssa-item:last-child { border-bottom: 0; }
.ssa-item-dot { flex: none; width: 9px; height: 9px; margin-top: 7px; border-radius: 50%; background: transparent; }
.ssa-item.unread { background: #FFFDF7; }
.ssa-item.unread .ssa-item-dot { background: var(--ssb-gold); box-shadow: 0 0 0 3px var(--ssb-gold-soft); }
.ssa-item-main { flex: 1; min-width: 0; }
.ssa-item-title { font-weight: 700; font-size: 14.5px; overflow-wrap: anywhere; }
.ssa-item:not(.unread) .ssa-item-title { font-weight: 600; color: #2B3750; }
.ssa-item-body { margin-top: 2px; font-size: 13.5px; color: var(--ssb-muted); overflow-wrap: anywhere; white-space: pre-line; }
.ssa-item-time { margin-top: 4px; font-size: 12px; color: var(--ssb-faint); }
.ssa-empty { padding: 28px 16px; text-align: center; color: var(--ssb-faint); font-size: 14px; background: #fff; border: 1px dashed var(--ssb-line); border-radius: 16px; }
.ssa-empty svg { display: block; margin: 0 auto 8px; width: 30px; height: 30px; fill: none; stroke: #C3C7CF; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ssa-loading { padding: 18px; text-align: center; color: var(--ssb-faint); font-size: 13.5px; }

/* the nav-item flavour of the trigger (school dashboard sidebar) */
.nav-item .ssa-count { margin-inline-start: auto; }
