:root {
  font-family: 'DM Sans', sans-serif;
  color: #173a33;
  background: #f7f8f4;
  font-synthesis: none
}

* {
  box-sizing: border-box
}

html,
body {
  margin: 0;
  min-width: 320px;
  overflow-x: clip;
}

button,
input,
textarea,
select {
  font: inherit
}

button {
  cursor: pointer
}

a {
  color: inherit;
  text-decoration: none
}

h1,
h2,
h3,
p {
  margin-top: 0
}

h1,
h2,
h3 {
  line-height: 1.18
}

h1,
h2 {
  font-family: 'Playfair Display', Georgia, serif;
  letter-spacing: -.035em
}

h1 {
  font-size: clamp(2.7rem, 5vw, 4.9rem)
}

h2 {
  font-size: clamp(1.9rem, 3vw, 2.7rem)
}

h3 {
  font-size: 1.08rem
}

p {
  line-height: 1.65;
  color: #667b73
}

.site {
  min-height: 100vh
}

.public {
  background: #fafbf7
}

.eyebrow {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-weight: 800;
  color: #b88e48
}

.row {
  display: flex;
  align-items: center
}

.wrap {
  flex-wrap: wrap
}

.gap {
  gap: .65rem
}

.space-between {
  justify-content: space-between
}

.grow {
  flex: 1;
  min-width: 0
}

.muted {
  color: #879891;
  font-size: .83rem
}

.small-text {
  font-size: .85rem
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: .83rem 1.18rem;
  font-weight: 700;
  white-space: nowrap;
  transition: .2s ease;
  background: transparent
}

.btn:hover {
  transform: translateY(-1px)
}

.btn.primary {
  background: #0c6b54;
  color: #fff;
  box-shadow: 0 8px 18px #0c6b5426
}

.btn.primary:hover {
  background: #07543f
}

.btn.light {
  background: #fff;
  color: #0d5746
}

.btn.ghost {
  color: #0b6953;
  border-color: #d9e7df;
  background: #fff
}

.btn.ghost:hover {
  background: #eff7f2
}

.btn.outline-light {
  color: #fff;
  border-color: #ffffff79
}

.btn.small {
  padding: .55rem .82rem;
  font-size: .78rem;
  border-radius: 8px
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  border: 0;
  background: none;
  color: #0e765b;
  font-weight: 800;
  font-size: .85rem;
  padding: .4rem
}

.text-link:hover {
  text-decoration: underline
}

.public-header {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0 clamp(1.2rem, 5vw, 5.4rem);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid #e9eee9
}

.brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  color: #104c40;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer
}

.brand small {
  display: block;
  font: 700 .53rem 'DM Sans', sans-serif;
  text-transform: uppercase;
  letter-spacing: .18em;
  margin-top: .25rem;
  color: #b28a4c
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #0e614e;
  color: #e9d9aa;
  font-size: 1.75rem;
  line-height: 1
}

.public-header nav {
  display: flex;
  gap: 1.5rem;
  height: 100%;
  align-items: center
}

.public-header nav button,
.public-header nav a {
  border: 0;
  background: none;
  color: #536a61;
  font-size: .86rem;
  font-weight: 700;
  position: relative;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.public-header nav button.active,
.public-header nav a.active,
.public-header nav button:hover,
.public-header nav a:hover {
  color: #0b6c53;
}

.public-header nav button.active:after,
.public-header nav a.active:after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: 0;
  right: 0;
  height: 2px;
  background: #0b6c53;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem
}

.role-select {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 142px
}

.role-select select {
  appearance: none;
  width: 100%;
  border: 1px solid #dae8df;
  border-radius: 9px;
  background: #f8fbf8;
  color: #305a4d;
  padding: .63rem 1.9rem .63rem .85rem;
  font-weight: 700;
  font-size: .75rem;
  cursor: pointer
}

.role-select svg {
  position: absolute;
  right: .6rem;
  pointer-events: none
}

.mobile-menu {
  display: none;
  border: 0;
  background: none;
  color: #174c3d;
  padding: .3rem
}

.hero {
  min-height: 575px;
  background: #0c463b;
  color: #fff;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  position: relative;
  overflow: hidden
}

.hero:before,
.student-hero:before,
.cta-band:before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 30%, #4a93724b 0, transparent 42%), repeating-radial-gradient(circle at 91% 12%, transparent 0 28px, #ffffff0a 29px 30px);
  pointer-events: none
}

.hero-copy {
  position: relative;
  z-index: 1;
  align-self: center;
  padding: 4.2rem 2rem 4.2rem clamp(1.4rem, 8vw, 9rem);
  max-width: 720px
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: #f1dba5;
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .05em
}

.hero h1 {
  font-size: clamp(3.2rem, 6.5vw, 6.7rem);
  line-height: 1.05;
  margin: 1.6rem 0
}

.hero h1 em {
  color: #ddc691;
  font-weight: 500
}

.hero p {
  color: #c7ded5;
  max-width: 530px;
  font-size: 1.03rem
}

.hero-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: 1.7rem
}

.hero-proof {
  display: flex;
  align-items: center;
  gap: .8rem;
  color: #d3e2d9;
  font-size: .74rem;
  margin-top: 3rem
}

.avatar-stack {
  display: flex;
  padding-left: .3rem
}

.avatar-stack b {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  margin-left: -.3rem;
  border: 2px solid #0c463b;
  border-radius: 50%;
  background: #d5bd83;
  color: #124536;
  font-size: .55rem
}

.avatar-stack b:nth-child(2) {
  background: #9fcec0
}

.avatar-stack b:nth-child(3) {
  background: #e2a88b
}

.hero-art {
  display: grid;
  place-items: center;
  position: relative;
  min-height: 480px;
  padding: 2rem
}

.arch {
  width: min(80%, 430px);
  height: 480px;
  border-radius: 220px 220px 8px 8px;
  background: linear-gradient(135deg, #e5d3a2, #a77e42);
  padding: 12px;
  box-shadow: 30px 30px 0 #ffffff08, 0 35px 80px #03261d80
}

.arch-inner {
  width: 100%;
  height: 100%;
  border: 2px solid #184e3e80;
  border-radius: 210px 210px 2px 2px;
  background: radial-gradient(circle at 55% 35%, #3c8c68, #0d4b3e 60%, #073b32);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden
}

.arch-inner:before {
  content: '۞';
  position: absolute;
  font-size: 24rem;
  color: #ffffff09;
  line-height: 1
}

.arabic {
  font-family: Georgia, serif;
  font-size: clamp(4rem, 7vw, 7rem);
  color: #f5e8bf;
  z-index: 1
}

.arch-caption {
  font-family: 'Playfair Display', Georgia, serif;
  color: #e8d6ac;
  letter-spacing: .1em;
  z-index: 1
}

.floating-note {
  position: absolute;
  bottom: 65px;
  left: 0;
  background: #fff;
  color: #215b49;
  padding: 1rem 1.2rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: .7rem;
  font-weight: 800;
  font-size: .8rem;
  box-shadow: 0 12px 35px #001e1947
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 1.8rem clamp(1.2rem, 8vw, 9rem);
  background: #f0f4ec;
  gap: 1rem
}

.stats-strip div {
  text-align: center;
  border-right: 1px solid #d9e3d6
}

.stats-strip div:last-child {
  border: 0
}

.stats-strip strong {
  display: block;
  color: #175a48;
  font-family: 'Playfair Display';
  font-size: 1.45rem
}

.stats-strip span {
  font-size: .74rem;
  color: #71847a
}

.content-section {
  padding: 5.5rem clamp(1.2rem, 8vw, 9rem)
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1.5rem;
  margin-bottom: 1.65rem
}

.section-heading h2 {
  margin: .45rem 0 0
}

.program-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem
}

.program-card,
.resource-card {
  background: #fff;
  border: 1px solid #e4ebe4;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 10px 25px #1c554509
}

.program-card h3,
.resource-card h3 {
  font-family: 'Playfair Display';
  font-size: 1.5rem;
  margin: .65rem 0
}

.program-card p,
.resource-card p {
  min-height: 70px;
  font-size: .88rem
}

.icon-badge {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  background: #ecf5ec;
  border-radius: 14px;
  color: #126d55;
  margin-bottom: 1.4rem
}

.card-footer {
  border-top: 1px solid #edf1eb;
  padding-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #899b8f;
  font-size: .72rem
}

.round-link {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #e8f3eb;
  color: #0d6952;
  display: grid;
  place-items: center
}

.how-section {
  background: #eaf2e9;
  padding: 5rem clamp(1.2rem, 8vw, 9rem);
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 7rem
}

.how-section h2 {
  margin: 1rem 0
}

.how-section>div:first-child>p {
  max-width: 420px
}

.how-section .btn {
  margin-top: 1rem
}

.steps {
  border-left: 1px solid #ccdccc;
  padding-left: 2.2rem
}

.step {
  display: flex;
  gap: 1.5rem;
  padding: 1.2rem 0
}

.step>span {
  font-family: 'Playfair Display';
  font-size: 2rem;
  color: #b7955d
}

.step h3 {
  margin: 0 0 .3rem
}

.step p {
  font-size: .86rem;
  margin: 0
}

.quote-section {
  text-align: center;
  background: #fff;
  padding: 4rem 1rem
}

.quote-section .arabic {
  font-size: 2.5rem;
  color: #b9975b
}

.quote-section h2 {
  font-size: 1.65rem;
  color: #225946;
  margin: 1.1rem auto;
  max-width: 720px
}

.quote-section p {
  font-size: .8rem
}

.teacher-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem
}

.teacher-card,
button.teacher-card {
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  background: #fff;
  border: 1px solid #e1ebe3;
  border-radius: 16px;
  overflow: hidden;
  padding: 0;
  width: 100%;
  text-align: left;
}

.teacher-portrait {
  width: 38% !important;
  min-width: 150px !important;
  min-height: 260px;
  background: #d9e8da;
  display: grid !important;
  place-items: center !important;
  position: relative;
  overflow: hidden;
  flex-shrink: 0 !important;
}

.portrait-pattern {
  position: absolute;
  inset: 0;
  background: repeating-radial-gradient(circle at 25% 20%, transparent 0 22px, #ffffff70 23px 24px), linear-gradient(135deg, #a9c9ae, #e5dcc3)
}

.teacher-portrait>span {
  z-index: 1;
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #0e614e;
  color: #f8e9c0;
  font: 2rem 'Playfair Display'
}

.teacher-info {
  padding: 2rem;
  flex: 1 1 0% !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  text-align: left !important;
}

.teacher-info h3 {
  font-family: 'Playfair Display';
  font-size: 1.55rem;
  margin: .65rem 0
}

.teacher-info p {
  font-size: .86rem
}

.tags {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap
}

.tags span {
  padding: .4rem .6rem;
  background: #eff5ef;
  border-radius: 30px;
  color: #39705a;
  font-size: .65rem;
  font-weight: 700
}

.cta-band {
  margin: 1rem clamp(1.2rem, 8vw, 9rem) 5rem;
  background: #124d40;
  border-radius: 17px;
  color: #fff;
  padding: 2.6rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden
}

.cta-band>* {
  position: relative
}

.cta-band h2 {
  margin: .4rem 0
}

.cta-band p {
  color: #d2e4db;
  margin: 0
}

.page-intro {
  padding: 4rem clamp(1.2rem, 8vw, 9rem) 2rem
}

.page-intro h1 {
  max-width: 850px;
  margin: .6rem 0 1rem;
  font-size: clamp(2.4rem, 4.2vw, 4rem)
}

.page-intro p {
  font-size: 1rem;
  max-width: 650px
}

.page-intro+.program-grid,
.page-intro+.teacher-grid,
.page-intro+.resource-grid,
.public .form-panel {
  margin: 0 clamp(1.2rem, 8vw, 9rem) 5rem
}

.form-panel {
  max-width: 850px;
  background: #fff;
  border: 1px solid #e4ebe4;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 10px 30px #1759400c
}

.smart-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem
}

.smart-form label {
  display: flex;
  flex-direction: column;
  gap: .48rem;
  font-size: .76rem;
  font-weight: 800;
  color: #426358
}

.smart-form label.wide {
  grid-column: 1/-1
}

/* Required fields: a small star after the label text. It follows the field's own
   `required` attribute, so the star always matches what the form really asks for.
   The second `content` hides the star from screen readers (they already announce "required"). */
/* Server-side errors (shown by ayah-modals.js; the popup stays open). */
.form-error {
  grid-column: 1/-1;
  margin: 0 0 .9rem;
  padding: .7rem .9rem;
  border: 1px solid #f1c9bf;
  border-radius: 10px;
  background: #fdf1ee;
  color: #a2402c;
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.5
}

.smart-form .form-error {
  margin: 0
}

.smart-form .field-error {
  color: #b3412e;
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.4
}

.smart-form label.has-error input,
.smart-form label.has-error textarea,
.smart-form label.has-error select,
.smart-form label.has-error .select2-container--default .select2-selection--single {
  border-color: #d0604b !important;
  box-shadow: 0 0 0 3px rgba(208, 96, 75, .12) !important
}

.smart-form label:has(input[required], select[required], textarea[required])>span:first-child::after {
  content: " *";
  content: " *" / "";
  color: #c0533a;
  font-weight: 800
}

.smart-form input,
.smart-form textarea,
.smart-form select {
  width: 100%;
  min-width: 0;
  border: 1px solid #dce8de;
  border-radius: 9px;
  background: #fbfcfa;
  color: #214c3f;
  padding: .78rem .9rem;
  outline: none
}

.smart-form input:focus,
.smart-form textarea:focus,
.smart-form select:focus,
.message-compose input:focus {
  border-color: #0e765b;
  box-shadow: 0 0 0 3px #0e765b20
}

.smart-form textarea {
  resize: vertical
}

.form-submit {
  justify-self: start;
  margin-top: .5rem;
  grid-column: 1/-1
}

.form-hint {
  font-size: .75rem;
  margin: 1rem 0 0
}

.footer {
  background: #0b392f;
  color: #fff;
  padding: 4rem clamp(1.2rem, 8vw, 9rem) 1.8rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem
}

.footer .brand {
  color: #fff
}

.footer p {
  color: #bcd2c7;
  max-width: 290px;
  font-size: .82rem;
  margin-top: 1rem
}

.footer strong,
.footer button,
.footer a {
  display: block;
  margin-bottom: .7rem
}

.footer strong {
  color: #d8bf88
}

.footer button {
  padding: 0;
  border: 0;
  background: none;
  color: #d5e7dc
}

.footer a {
  color: #d5e7dc;
  font-size: .82rem
}

.footer>small {
  grid-column: 1/-1;
  border-top: 1px solid #ffffff22;
  padding-top: 1.4rem;
  color: #a8c7b7
}

/* Footer: "Teach with us" column with the teacher sign-up button. */
.footer:has(.footer-teach) {
  grid-template-columns: 1.6fr 1fr 1fr 1.4fr
}

.footer .footer-teach p {
  margin: 0 0 1rem;
  max-width: 260px
}

.footer .footer-teach .btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin: 0;
  color: #0b392f;
  background: #f3e7cc;
  border-color: #f3e7cc
}

.footer .footer-teach .btn:hover {
  background: #fff;
  color: #0b392f
}

@media (max-width: 980px) {
  .footer:has(.footer-teach) {
    grid-template-columns: 1fr 1fr
  }

  .footer .footer-teach {
    grid-column: 1/-1
  }
}

.portal-shell {
  display: flex;
  background: #f7f9f5;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  min-height: 100vh;
  background: #fff;
  border-right: 1px solid #e6eee7;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 30;
  overflow-y: auto;
}

@media (min-width: 801px) {
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    width: 250px !important;
    z-index: 30 !important;
    overflow-y: auto !important;
  }

  .portal-main {
    margin-left: 250px !important;
    width: calc(100% - 250px) !important;
    min-width: 0 !important;
    flex: 1;
  }

  .portal-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 25 !important;
    background: #fff !important;
  }
}

.sidebar .brand {
  padding: 1.7rem 1.3rem;
  border-bottom: 1px solid #edf2ed;
  font-size: 1.18rem
}

.sidebar-label {
  color: #a9b8ad;
  font-size: .61rem;
  letter-spacing: .18em;
  font-weight: 800;
  margin: 2rem 1.4rem .7rem
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: .18rem;
  padding: 0 .7rem;
  overflow: auto
}

.sidebar nav button,
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: .8rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #6a8073;
  text-align: left;
  padding: .75rem .85rem;
  font-size: .83rem;
  font-weight: 700;
  text-decoration: none;
}

.sidebar nav button.active,
.sidebar nav a.active {
  background: #eaf4ec;
  color: #09694f;
}

/* The page that is open: a green bar on its left (the gold dot on the right
   still means "something new"). */
.sidebar nav a {
  position: relative;
}

.sidebar nav button.active::before,
.sidebar nav a.active::before {
  content: '';
  position: absolute;
  left: -.7rem;
  top: 7px;
  bottom: 7px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: #0c6b54;
}

.sidebar nav a.active svg {
  color: #0c6b54;
}

.sidebar nav button:hover,
.sidebar nav a:hover {
  background: #f1f6f1;
}

.sidebar nav button i,
.sidebar nav a i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c99557;
  margin-left: auto;
}

.sidebar-bottom {
  margin-top: auto;
  padding: 1rem
}

.sidebar-help {
  background: #edf5eb;
  border-radius: 13px;
  padding: 1rem;
  color: #1c624a
}

.sidebar-help h3 {
  font-size: .9rem;
  margin: .5rem 0 .3rem
}

.sidebar-help p {
  font-size: .7rem;
  margin: 0 0 .5rem
}

.sidebar-help a {
  display: flex;
  align-items: center;
  font-size: .72rem;
  font-weight: 800
}

.demo-label {
  font-size: .6rem;
  color: #a1b4a6;
  margin: 1rem 0 0;
  text-align: center
}

.portal-main {
  min-width: 0;
  flex: 1
}

.portal-header {
  height: 75px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid #e6eee7;
  padding: 0 clamp(1rem, 3vw, 2.7rem);
  position: sticky;
  top: 0;
  z-index: 10
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  color: #a0b1a5;
  font-size: .76rem
}

.breadcrumb strong {
  color: #2c604a
}

.avatar {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  flex: none;
  border-radius: 50%;
  background: #cfe5d2;
  color: #0c624b;
  font-size: .7rem;
  font-weight: 800
}

.header-avatar {
  background: #0e614e;
  color: #fff
}

/* Teacher / student: the initials open "My profile". */
.header-avatar-link {
  transition: box-shadow .18s ease, background .18s ease
}

.header-avatar-link:hover,
.header-avatar-link:focus-visible {
  background: #0a5040;
  box-shadow: 0 0 0 3px #0e614e33
}

.portal-content {
  padding: 0 clamp(1rem, 3vw, 2.7rem) 4rem;
  max-width: 1600px;
  margin: auto
}

.page-intro.portal {
  padding: 2.5rem 0 1rem
}

.page-intro.portal h1 {
  font-size: clamp(2rem, 3vw, 2.9rem)
}

.page-intro.portal p {
  font-size: .88rem;
  margin-bottom: .7rem
}

.page-intro.portal .section-heading {
  margin: 0
}

.page-intro.portal .section-heading h2 {
  font-size: 2.6rem
}

.wave {
  font-family: 'DM Sans';
  color: #cbab6e;
  font-size: .75em
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 1.5rem 0
}

.metric-grid.three {
  grid-template-columns: repeat(3, 1fr)
}

.metric-card {
  background: #fff;
  border: 1px solid #e5ece5;
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  box-shadow: 0 8px 20px #1c554506
}

.metric-icon {
  width: 37px;
  height: 37px;
  border-radius: 10px;
  background: #eaf5ec;
  color: #0e6f54;
  display: grid;
  place-items: center
}

.metric-card strong {
  font-family: 'Playfair Display';
  font-size: 2rem;
  color: #184b3b
}

.metric-card>span:last-child {
  font-size: .76rem;
  color: #8da097
}

.dashboard-columns {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 1.2rem;
  align-items: start;
  margin-top: 1.2rem
}

.panel {
  background: #fff;
  border: 1px solid #e5ece5;
  border-radius: 14px;
  padding: 1.4rem;
  box-shadow: 0 8px 20px #1c554507
}

.panel .section-heading {
  margin-bottom: 1.2rem
}

.panel .section-heading h2 {
  font-size: 1.45rem
}

.panel h3 {
  margin: .3rem 0
}

.panel p {
  font-size: .8rem
}

.attention-item,
.list-row,
.invoice-row,
.request-row {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: 1rem 0;
  border-bottom: 1px solid #edf1eb
}

.attention-item:last-child,
.list-row:last-child,
.invoice-row:last-child,
.request-row:last-child {
  border: 0
}

.attention-item .mini-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  background: #e6f2e7;
  border-radius: 10px;
  color: #267453;
  font-weight: 800
}

.attention-item div:nth-child(2) {
  flex: 1
}

.attention-item strong {
  font-size: .8rem
}

.attention-item p {
  margin: 0;
  font-size: .71rem
}

.lesson-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid #edf2ec
}

.lesson-card:last-child {
  border: 0
}

.date-tile {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  background: #eef5e9;
  border-radius: 10px;
  color: #165b45
}

.date-tile strong {
  font: 1.35rem 'Playfair Display'
}

.date-tile span {
  font-size: .62rem;
  text-transform: uppercase;
  font-weight: 800
}

.lesson-main {
  flex: 1;
  min-width: 0
}

.lesson-main h3 {
  margin: 0;
  font-size: .9rem
}

.lesson-main p {
  margin: .3rem 0;
  font-size: .73rem
}

.metadata {
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
  color: #8a9b90;
  font-size: .69rem
}

.metadata span {
  display: flex;
  gap: .25rem;
  align-items: center
}

.lesson-actions {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  align-items: stretch
}

.lesson-actions .btn {
  font-size: .72rem
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 100px;
  background: #edf3ed;
  color: #547360;
  padding: .25rem .55rem;
  font-size: .63rem;
  font-weight: 800;
  white-space: nowrap
}

.status.scheduled,
.status.approved,
.status.paid,
.status.assigned,
.status.completed {
  background: #e1f3e7;
  color: #19734f
}

.status.pending,
.status.due,
.status.new,
.status.warning {
  background: #fff2db;
  color: #9b6e28
}

.status.declined,
.status.cancelled {
  background: #fbe9e6;
  color: #a7524c
}

.student-hero {
  position: relative;
  overflow: hidden;
  background: #0e5142;
  border-radius: 16px;
  padding: 2rem 2.3rem;
  color: #fff;
  display: flex;
  justify-content: space-between;
  min-height: 245px
}

.student-hero>div {
  z-index: 1
}

.student-hero h2 {
  font-size: 2rem;
  margin: .7rem 0
}

.student-hero p {
  color: #c6ddcf;
  font-size: .86rem
}

.hero-lesson-meta {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  color: #e4f1e6;
  font-size: .76rem
}

.hero-lesson-meta span {
  display: flex;
  gap: .4rem;
  align-items: center
}

.student-hero .hero-actions {
  margin-top: 1.5rem
}

.student-hero-art {
  min-width: 260px;
  display: grid;
  place-items: center
}

.seal {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 1px solid #dfc3898a;
  border-radius: 50%;
  width: 200px;
  height: 200px;
  box-shadow: 0 0 0 15px #ffffff08, 0 0 0 30px #ffffff06
}

.seal .arabic {
  font-size: 2rem
}

.seal small {
  color: #d8c48e;
  margin-top: .6rem
}

.side-stack {
  display: grid;
  gap: 1.2rem
}

.teacher-mini .row {
  margin: 1rem 0
}

.avatar.large {
  width: 53px;
  height: 53px
}

.teacher-mini p {
  margin: 0
}

.teacher-mini .btn {
  width: 100%
}

.tabs {
  display: flex;
  gap: .4rem;
  border-bottom: 1px solid #e9eee9;
  padding-bottom: .7rem;
  overflow: auto
}

.tabs button {
  border: 0;
  background: transparent;
  padding: .6rem 1rem;
  color: #8b9f90;
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
  border-radius: 8px
}

.tabs button.active {
  color: #0e6c54;
  background: #e8f3e9
}

.request-row {
  justify-content: space-between;
  align-items: center
}

.request-row p {
  margin: .4rem 0
}

.progress-row {
  display: flex;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid #edf1eb
}

.progress-row:last-child {
  border: 0
}

.progress-dot {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: #dff1e4;
  color: #187354;
  display: grid;
  place-items: center
}

.progress-row h3 {
  margin: .35rem 0
}

.progress-row p {
  margin: .2rem 0
}

.divider {
  height: 1px;
  background: #e7eee7;
  margin: 1.2rem 0
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .8rem 1.15rem;
  background: #ffffff;
  border: 1.5px solid #d6e4d9;
  border-radius: 11px;
  color: #728c7b;
  margin-bottom: 1.1rem;
  max-width: 480px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.filter-bar:hover {
  border-color: #bad3c2;
}

.filter-bar:focus-within {
  border-color: #0c6b54 !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3.5px rgba(12, 107, 84, 0.16) !important;
  color: #0c6b54 !important;
}

.filter-bar:focus-within svg,
.filter-bar:focus-within i {
  color: #0c6b54 !important;
}

.filter-bar input,
.filter-bar input:focus {
  border: 0 !important;
  background: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  width: 100%;
  font-size: .88rem;
  color: #173a33;
}

.list-row h3,
.invoice-row h3 {
  font-size: .86rem
}

.list-row p,
.invoice-row p {
  margin: .25rem 0
}

.invoice-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #e9f4eb;
  color: #207453;
  display: grid;
  place-items: center
}

.invoice-amount {
  font-family: 'Playfair Display';
  font-size: 1.15rem;
  white-space: nowrap
}

.demo-note {
  font-size: .71rem;
  margin-top: 1rem
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem
}

.resource-card {
  padding: 1.5rem
}

.resource-card p {
  min-height: 60px
}

.editable-program .program-card {
  height: calc(100% - 42px)
}

.editable-program>.btn {
  margin-top: .4rem
}

.reset-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  max-width: 850px
}

.reset-panel p {
  margin: 0
}

.messages-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  border: 1px solid #e4ebe4;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  height: clamp(540px, calc(100vh - 220px), 640px);
}

.contact-list {
  border-right: 1px solid #edf2ed;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #fff;
}

.contact-list h3 {
  padding: 1rem 1rem 0.6rem;
  margin: 0;
  font-size: .85rem;
  flex-shrink: 0;
}

.contact-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  margin: 0 0.8rem 0.6rem;
  background: #f7faf7;
  border: 1px solid #e2ebe3;
  border-radius: 8px;
  color: #7d9687;
  flex-shrink: 0;
}

.contact-search-wrap input {
  border: 0;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 0.76rem;
  color: #173a33;
}

.contact-list-items {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.contact-list button {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: 100%;
  padding: .8rem 1rem;
  border: 0;
  background: #fff;
  text-align: left;
  color: #35614b
}

.contact-list button.active {
  background: #edf6ed
}

.contact-list button>span:nth-child(2) {
  flex: 1
}

.contact-list strong,
.contact-list small,
.conversation-head strong,
.conversation-head small {
  display: block
}

.contact-list strong {
  font-size: .75rem
}

.contact-list small,
.conversation-head small {
  color: #95a89a;
  font-size: .63rem;
  margin-top: .25rem
}

.conversation {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  overflow: hidden;
}

.conversation-head {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .8rem 1rem;
  border-bottom: 1px solid #edf2ed;
  flex-shrink: 0;
}

.conversation-head strong {
  font-size: .83rem
}

.message-stream {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  padding: 1.3rem;
  overflow-y: auto;
  min-height: 0;
  background: #fcfdfa
}

.bubble {
  max-width: 70%;
  background: #eef4ed;
  border-radius: 12px 12px 12px 2px;
  padding: .7rem .9rem;
  align-self: flex-start
}

.bubble.mine {
  align-self: flex-end;
  background: #0c7055;
  border-radius: 12px 12px 2px 12px
}

.bubble p {
  font-size: .78rem;
  margin: 0;
  color: #315b49
}

.bubble.mine p,
.bubble.mine small {
  color: #fff
}

.bubble small {
  font-size: .6rem;
  color: #93a69a;
  display: block;
  margin-top: .3rem
}

.message-compose {
  display: flex;
  gap: .6rem;
  padding: .8rem;
  border-top: 1px solid #edf2ed
}

.message-compose input {
  flex: 1;
  min-width: 0;
  border: 1px solid #e0eae0;
  background: #f9fbf8;
  border-radius: 9px;
  padding: .7rem .85rem;
  outline: none
}

.empty {
  text-align: center;
  color: #8ca092;
  padding: 2rem
}

.empty>span {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: auto;
  background: #edf5ec;
  color: #3f8a60
}

.empty p {
  margin: .7rem 0 0;
  font-size: .8rem
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: #082d26aa;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
  overflow: auto
}

.modal {
  position: relative;
  width: min(100%, 750px);
  max-height: calc(100vh - 2.5rem);
  overflow-y: auto;
  overflow-x: hidden !important;
  background: #fff;
  border-radius: 18px;
  padding: 2.2rem 2.6rem 2.4rem;
  box-shadow: 0 24px 80px rgba(0, 26, 23, 0.35);
  box-sizing: border-box;
}

/* Assign teacher popup only: taller, so its Teacher / Program lists open inside it
   (on short screens: as tall as the screen allows), with the green button at the
   bottom, a little above the edge. Every other popup keeps its normal size. */
.modal.modal-assign {
  min-height: min(590px, calc(100vh - 2.5rem));
  display: flex;
  flex-direction: column;
}

.modal.modal-assign #modalContent {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.modal.modal-assign #modalContent>.smart-form {
  flex: 1;
  position: relative;
  align-content: start;
  padding-bottom: 4.6rem;
}

.modal.modal-assign #modalContent>.smart-form>.form-submit {
  position: absolute;
  left: 0;
  bottom: 0;
  margin: 0;
}

.modal::-webkit-scrollbar {
  width: 5px;
}

.modal::-webkit-scrollbar-track {
  background: transparent;
}

.modal::-webkit-scrollbar-thumb {
  background: #c3d5cb;
  border-radius: 4px;
}

.modal h2 {
  font-size: 1.8rem;
  margin: .4rem 0 1.4rem
}

.modal-close {
  position: absolute;
  right: 1.2rem;
  top: 1.2rem;
  border: 0;
  background: #f0f5f0;
  border-radius: 8px;
  padding: .45rem;
  color: #3f6c50
}

/* Back to the previous popup (shown only when this one was opened from another) */
.modal-back {
  display: flex;
  width: max-content;
  align-items: center;
  gap: .35rem;
  margin: 0 0 .7rem;
  border: 0;
  background: #f0f5f0;
  border-radius: 8px;
  padding: .4rem .75rem .4rem .55rem;
  color: #3f6c50;
  font-size: .8rem;
  font-weight: 700;
}

.modal-back:hover,
.modal-back:focus-visible {
  background: #e2ede4;
}

.modal-back[hidden] {
  display: none;
}

.modal-context {
  font-size: .85rem
}

.modal-footer {
  justify-content: end;
  margin-top: 1.4rem
}

.toast {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 120;
  background: #164f3f;
  color: #fff;
  display: flex;
  align-items: center;
  gap: .6rem;
  border-radius: 10px;
  padding: .85rem 1.1rem;
  box-shadow: 0 12px 25px #173c2a40;
  font-size: .78rem;
  font-weight: 700;
  max-width: min(440px, calc(100vw - 2.4rem))
}

button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 3px solid #c5a465;
  outline-offset: 2px
}

@media(max-width:1150px) {
  .public-header nav {
    gap: .7rem
  }

  .public-header nav button,
  .public-header nav a {
    font-size: .75rem
  }

  .program-grid,
  .resource-grid {
    grid-template-columns: repeat(2, 1fr)
  }

  .hero-copy {
    padding-left: 5vw
  }

  .hero-art {
    min-width: 0
  }

  .sidebar {
    width: 220px
  }

  .dashboard-columns {
    grid-template-columns: 1fr
  }

  .student-hero-art {
    min-width: 180px
  }
}

@media(max-width:800px) {
  .public-header {
    height: 68px
  }

  .public-header nav {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    height: auto;
    background: #fff;
    box-shadow: 0 10px 20px #143f2520;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem
  }

  .public-header nav.open {
    display: flex
  }

  .public-header nav button,
  .public-header nav a {
    text-align: left;
    padding: .6rem
  }

  .public-header nav button.active:after,
  .public-header nav a.active:after {
    display: none
  }

  .mobile-menu {
    display: block
  }

  .hero {
    grid-template-columns: 1fr
  }

  .hero-copy {
    padding: 4rem 1.4rem
  }

  .hero-art {
    display: none
  }

  .stats-strip {
    grid-template-columns: repeat(2, 1fr)
  }

  .stats-strip div:nth-child(2) {
    border: 0
  }

  .how-section {
    grid-template-columns: 1fr;
    gap: 2rem
  }

  .teacher-grid {
    grid-template-columns: 1fr
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: 15px 0 40px #0c3d2322
  }

  .sidebar.open {
    transform: translateX(0)
  }

  .mobile-scrim {
    position: fixed;
    inset: 0;
    background: #0a332883;
    z-index: 25
  }

  .portal-main {
    width: 100%
  }

  .portal-header {
    height: 64px
  }

  .portal-header .mobile-menu {
    margin-right: .4rem
  }

  .portal-header .breadcrumb {
    margin-right: auto
  }

  .metric-grid {
    grid-template-columns: repeat(2, 1fr)
  }

  .metric-grid.three {
    grid-template-columns: repeat(3, 1fr)
  }

  .messages-layout {
    grid-template-columns: 210px 1fr
  }

  .student-hero-art {
    display: none
  }
}

@media(max-width:580px) {

  .public-header,
  .portal-header {
    padding-left: 1rem;
    padding-right: 1rem
  }

  .brand {
    font-size: 1.1rem
  }

  .public-header .role-select,
  .portal-header .role-select {
    min-width: 105px
  }

  .role-select select {
    font-size: .6rem;
    padding-left: .5rem
  }

  .hero h1 {
    font-size: 3.4rem
  }

  .content-section {
    padding: 3rem 1.1rem
  }

  .program-grid,
  .resource-grid {
    grid-template-columns: 1fr
  }

  .page-intro+.program-grid,
  .page-intro+.teacher-grid,
  .page-intro+.resource-grid,
  .public .form-panel {
    margin-left: 1.1rem;
    margin-right: 1.1rem
  }

  .program-card p {
    min-height: 0
  }

  .section-heading {
    align-items: start
  }

  .section-heading .btn {
    font-size: .65rem;
    padding: .5rem
  }

  .teacher-card {
    flex-direction: column
  }

  .teacher-portrait {
    width: 100%;
    min-height: 180px
  }

  .teacher-info {
    padding: 1.3rem
  }

  .cta-band {
    margin: 1rem 1rem 3rem;
    padding: 2rem;
    display: block
  }

  .cta-band .btn {
    margin-top: 1.2rem
  }

  .footer {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem
  }

  .footer>div:first-child {
    grid-column: 1/-1
  }

  .portal-content {
    padding: 0 1rem 3rem
  }

  .page-intro.portal .section-heading h2 {
    font-size: 2rem
  }

  .metric-grid,
  .metric-grid.three {
    grid-template-columns: repeat(2, 1fr)
  }

  .metric-card {
    padding: 1rem
  }

  .student-hero {
    padding: 1.5rem
  }

  .student-hero h2 {
    font-size: 1.7rem
  }

  .lesson-card {
    align-items: flex-start;
    flex-wrap: wrap
  }

  .lesson-actions {
    width: 100%;
    flex-direction: row;
    padding-left: 74px
  }

  .lesson-actions .btn {
    flex: 1
  }

  .request-row,
  .invoice-row {
    align-items: start;
    flex-wrap: wrap
  }

  .request-row .row.gap:last-child {
    width: 100%;
    justify-content: end
  }

  .invoice-amount {
    margin-left: auto
  }

  .messages-layout {
    display: block
  }

  .contact-list {
    border-right: 0;
    border-bottom: 1px solid #edf2ed;
    display: flex;
    overflow: auto
  }

  .contact-list h3 {
    display: none
  }

  .contact-list button {
    min-width: 160px
  }

  .conversation {
    min-height: 500px
  }

  .bubble {
    max-width: 85%
  }

  .smart-form {
    grid-template-columns: 1fr
  }

  .smart-form label.wide,
  .form-submit {
    grid-column: 1
  }

  .form-panel {
    padding: 1.2rem
  }

  .modal {
    padding: 1.4rem
  }

  .reset-panel {
    align-items: flex-start;
    gap: 1rem;
    flex-direction: column
  }
}

.schedule-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #e9eee9
}

.schedule-toolbar .tabs {
  border: 0
}

.view-toggle {
  display: flex;
  background: #eef5ed;
  border-radius: 8px;
  padding: 3px;
  flex: none
}

.view-toggle button {
  border: 0;
  background: transparent;
  padding: .45rem .65rem;
  font-size: .71rem;
  font-weight: 800;
  color: #789083;
  border-radius: 6px
}

.view-toggle button.active {
  background: #fff;
  color: #0b6b52;
  box-shadow: 0 2px 6px #1b563015
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.2rem 0
}

.calendar-head strong {
  font-family: 'Playfair Display';
  font-size: 1.25rem;
  min-width: 175px;
  text-align: center
}

.calendar-head button {
  border: 1px solid #e1e9e0;
  background: #fff;
  border-radius: 7px;
  color: #316b54;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid #e7eee7;
  border-left: 1px solid #e7eee7
}

.calendar-grid>* {
  border-right: 1px solid #e7eee7;
  border-bottom: 1px solid #e7eee7
}

.weekday {
  text-align: center;
  padding: .6rem;
  font-size: .66rem;
  font-weight: 800;
  color: #92a296;
  background: #f7faf6
}

.calendar-day {
  min-height: 84px;
  padding: .5rem;
  background: #fff;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  border-top: 0;
  border-left: 0;
  color: #476552
}

.calendar-day:hover,
.calendar-day.selected {
  background: #edf7ed
}

.calendar-day>span {
  font-size: .75rem;
  font-weight: 800
}

.calendar-day small {
  background: #ddefdf;
  color: #216b4d;
  border-radius: 4px;
  padding: .15rem .25rem;
  font-size: .57rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%
}

.calendar-blank {
  background: #fafcf9
}

.calendar-selected {
  padding-top: 1.3rem
}

.calendar-selected h3 {
  font-family: 'Playfair Display';
  font-size: 1.2rem
}

@media(max-width:680px) {
  .schedule-toolbar {
    display: block
  }

  .view-toggle {
    width: max-content;
    margin: .6rem 0
  }

  .calendar-day {
    min-height: 53px;
    padding: .25rem
  }

  .calendar-day small {
    font-size: .48rem
  }

  .weekday {
    padding: .4rem .1rem
  }
}

.request-actions {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  justify-content: flex-end
}

.payment-panel {
  margin-top: 1rem
}

.payment-panel h3 {
  font-family: 'Playfair Display';
  font-size: 1.25rem
}

.payment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid #edf1eb;
  padding: .7rem 0;
  color: #6d8475;
  font-size: .75rem
}

.payment-row:last-child {
  border: 0
}

.payment-row>span:first-child {
  display: flex;
  align-items: center;
  gap: .4rem;
  color: #176b51
}

.payment-row strong {
  color: #1e5743
}

.status.archived,
.status.superseded {
  background: #edf1ed;
  color: #82938a
}

@media(max-width:580px) {
  .request-actions {
    width: 100%;
    justify-content: start
  }

  .payment-row {
    flex-wrap: wrap
  }
}

.metric-card {
  position: relative;
  text-align: left;
  cursor: pointer;
  width: 100%;
  color: inherit
}

.metric-card:hover,
.enrolment-card:hover,
.clickable-row:hover,
.attention-button:hover {
  border-color: #badbc5;
  background: #fbfefb;
  box-shadow: 0 10px 24px #0d664018;
  transform: translateY(-2px)
}

.metric-arrow {
  position: absolute;
  right: 1rem;
  top: 1rem;
  color: #9ab9a4
}

.metric-card,
.enrolment-card,
.clickable-row,
.attention-button {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease
}

.lesson-card {
  gap: .55rem
}

.lesson-open {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 9px;
  padding: .35rem;
  color: inherit
}

.lesson-open:hover {
  background: #f0f7f0
}

.lesson-open .lesson-main {
  display: block
}

.lesson-title {
  display: block;
  font-size: .9rem;
  color: #1a4838
}

.lesson-topic {
  display: block;
  margin: .3rem 0;
  color: #667b73;
  font-size: .73rem
}

.lesson-open .metadata {
  display: flex
}

.attention-button {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #edf1eb;
  background: transparent;
  text-align: left;
  color: inherit
}

.attention-button:last-child {
  border-bottom: 0
}

.attention-copy {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: .2rem
}

.attention-copy strong {
  font-size: .82rem
}

.attention-copy small {
  color: #8b9c8e;
  font-size: .7rem
}

.attention-button>svg {
  color: #8eab96
}

.clickable-row {
  width: 100%;
  text-align: left;
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  color: inherit
}

.clickable-row .grow {
  display: flex;
  flex-direction: column;
  gap: .25rem
}

.clickable-row small {
  font-size: .76rem;
  color: #657b6e
}

.clickable-row>svg {
  color: #92aa97
}

.enrolment-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem
}

.enrolment-toolbar>span {
  color: #8ea094;
  font-size: .75rem;
  font-weight: 700
}

.enrolment-tabs {
  margin: .3rem 0 1rem
}

.enrolment-tabs button small {
  background: #dfe9dc;
  border-radius: 12px;
  padding: .1rem .35rem;
  margin-left: .2rem
}

.enrolment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem
}

.enrolment-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  background: #fff;
  border: 1px solid #e2ebe2;
  border-radius: 13px;
  padding: 1.15rem;
  color: #1c4938;
  min-width: 0;
  min-height: 215px
}

.enrolment-card-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: .7rem
}

.enrolment-card>strong {
  font-size: .95rem
}

.enrolment-card>small {
  font-size: .72rem;
  color: #87998c;
  margin: .25rem 0
}

.enrolment-program {
  font-size: .76rem;
  color: #237454;
  font-weight: 800;
  margin: .55rem 0
}

.enrolment-meta {
  display: flex;
  align-items: center;
  gap: .3rem;
  color: #778b7b;
  font-size: .71rem;
  margin-top: auto
}

.enrolment-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #edf1eb;
  padding-top: .65rem;
  margin-top: .7rem;
  color: #95a89a;
  font-size: .69rem
}

.notification-anchor {
  position: relative
}

.notification-trigger {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid #e1ebe2;
  border-radius: 10px;
  background: #fbfdfb;
  color: #2b6953
}

.notification-trigger:hover {
  background: #eef7ef
}

.notification-count {
  position: absolute;
  right: -5px;
  top: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 3px;
  border-radius: 10px;
  background: #ba6b37;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: .58rem;
  font-weight: 800
}

.notification-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  width: min(390px, calc(100vw - 2rem));
  background: #fff;
  border: 1px solid #e0ebe1;
  border-radius: 13px;
  box-shadow: 0 20px 50px #133f2d30;
  z-index: 60;
  overflow: hidden
}

.notification-popover-head {
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #edf2ed
}

.notification-popover-head strong,
.notification-popover-head small {
  display: block
}

.notification-popover-head small {
  font-size: .69rem;
  color: #8fa392
}

.notification-scroll {
  max-height: 390px;
  overflow: auto
}

.notification-item {
  display: flex;
  align-items: start;
  gap: .7rem;
  width: 100%;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #eef2ed;
  text-align: left;
  padding: .85rem 1rem;
  color: #285340
}

.notification-item.unread {
  background: #f1f8f1
}

.notification-item:hover {
  background: #e9f4ea
}

.notification-symbol {
  width: 29px;
  height: 29px;
  flex: none;
  border-radius: 8px;
  background: #dceddf;
  color: #237559;
  display: grid;
  place-items: center
}

.notification-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: .2rem
}

.notification-text strong {
  font-size: .76rem
}

.notification-text small {
  font-size: .69rem;
  color: #758c7b;
  line-height: 1.35
}

.notification-text em {
  font-style: normal;
  font-size: .62rem;
  color: #9aaca0
}

.unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0d7657;
  flex: none;
  margin-top: .35rem
}

.notification-all {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .3rem;
  width: 100%;
  padding: .8rem;
  background: #fff;
  border: 0;
  color: #0d7657;
  font-size: .75rem;
  font-weight: 800
}

.modal-notification-list {
  max-height: 58vh;
  overflow: auto;
  border: 1px solid #e9efe9;
  border-radius: 9px
}

.modal-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem
}

.modal-tools p {
  font-size: .8rem
}

.modal-overview {
  max-height: 58vh;
  overflow: auto
}

.modal-overview h3 {
  font-size: .86rem;
  margin: 1rem 0 .4rem
}

.overview-row {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .8rem .3rem;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #edf1eb;
  background: #fff;
  text-align: left;
  color: #28533d
}

.overview-row:hover,
.detail-inline-row:hover {
  background: #f2f8f2
}

.overview-row>span:nth-child(2) {
  flex: 1;
  min-width: 0
}

.overview-row strong,
.overview-row small {
  display: block
}

.overview-row strong {
  font-size: .8rem
}

.overview-row small {
  font-size: .7rem;
  color: #879a8d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.overview-row .mini-avatar {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: #e7f2e7;
  display: grid;
  place-items: center;
  color: #14714f;
  font-weight: 800;
  flex: none
}

.detail-view {
  max-height: 66vh;
  overflow: auto;
  padding-right: .2rem
}

.detail-hero {
  background: #edf6ed;
  border-radius: 12px;
  padding: 1.3rem;
  margin-bottom: 1rem
}

.detail-hero h3 {
  font-family: 'Playfair Display';
  font-size: 1.35rem;
  margin: .6rem 0 .25rem
}

.detail-hero p {
  font-size: .8rem;
  margin: 0
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem
}

.detail-grid>div {
  border: 1px solid #e6eee5;
  border-radius: 10px;
  padding: .85rem;
  min-width: 0
}

.detail-grid small,
.detail-grid strong {
  display: block
}

.detail-grid small {
  font-size: .66rem;
  color: #9baa9a;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .3rem
}

.detail-grid strong {
  font-size: .79rem;
  overflow-wrap: anywhere
}

.detail-section {
  padding: 1rem 0;
  border-bottom: 1px solid #ebf0ea
}

.detail-section:last-child {
  border: 0
}

.detail-section h3 {
  font-size: .87rem;
  margin: 0 0 .6rem
}

.detail-section p {
  font-size: .78rem;
  margin: 0
}

.detail-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap
}

.detail-actions .btn {
  font-size: .75rem;
  padding: .65rem .85rem
}

.detail-inline-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  border: 0;
  background: #fff;
  padding: .6rem;
  color: #33634a;
  text-align: left;
  font-size: .75rem
}

.date-picker-wrap {
  width: 100%
}

.date-picker-wrap input {
  width: 100%
}

.date-picker-popper {
  z-index: 110 !important
}

.react-datepicker {
  font-family: 'DM Sans', sans-serif !important;
  border-color: #d6e6da !important;
  box-shadow: 0 14px 36px #0e47302b
}

.react-datepicker__header {
  background: #ecf5ec !important;
  border-color: #d6e6da !important
}

.react-datepicker__day--selected,
.react-datepicker__day--keyboard-selected,
.react-datepicker__time-list-item--selected {
  background: #0c6b54 !important;
  color: #fff !important
}

.react-datepicker__time-container {
  width: 95px !important
}

.fullcalendar-wrap {
  padding-top: 1rem;
  --fc-border-color: #e1ebe2;
  --fc-event-bg-color: #197457;
  --fc-event-border-color: #197457;
  --fc-button-bg-color: #0d6c53;
  --fc-button-border-color: #0d6c53;
  --fc-button-hover-bg-color: #0a5944;
  --fc-button-active-bg-color: #094b3b
}

.fullcalendar-wrap .fc-toolbar-title {
  font-family: 'Playfair Display', Georgia, serif;
  color: #174b3b;
  font-size: 1.45rem !important
}

.fullcalendar-wrap .fc-button {
  font-size: .75rem !important;
  text-transform: capitalize !important;
  border-radius: 7px !important
}

.fullcalendar-wrap .fc-daygrid-day-number {
  font-size: .75rem;
  color: #416450
}

.fullcalendar-wrap .fc-col-header-cell-cushion {
  font-size: .7rem;
  color: #698373
}

.fullcalendar-wrap .fc-event {
  cursor: pointer;
  font-size: .68rem
}

.fullcalendar-wrap .lesson-event-completed {
  --fc-event-bg-color: #91a99b;
  --fc-event-border-color: #91a99b
}

.fullcalendar-wrap .lesson-event-cancelled {
  --fc-event-bg-color: #ae847a;
  --fc-event-border-color: #ae847a
}

.calendar-tip {
  font-size: .7rem;
  color: #8a9c8e;
  margin: 1rem 0 0
}

@media(max-width:1050px) {
  .enrolment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }
}

@media(max-width:680px) {
  .enrolment-grid {
    grid-template-columns: 1fr
  }

  .enrolment-toolbar {
    align-items: stretch;
    flex-direction: column
  }

  .enrolment-toolbar>span {
    margin-top: -.7rem
  }

  .notification-popover {
    right: -125px
  }

  .fullcalendar-wrap .fc-header-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .8rem
  }

  .fullcalendar-wrap .fc-toolbar-chunk:nth-child(2) {
    order: -1;
    width: 100%;
    text-align: center
  }

  .fullcalendar-wrap .fc-toolbar-title {
    font-size: 1.2rem !important
  }

  .fullcalendar-wrap .fc-button {
    padding: .3rem .45rem !important;
    font-size: .62rem !important
  }

  .detail-grid {
    grid-template-columns: 1fr
  }

  .modal-tools {
    align-items: start
  }
}

.card-button {
  width: 100%;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.program-card,
.teacher-card,
.resource-card {
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.program-card:hover,
.teacher-card:hover,
.resource-card:hover,
.program-card.card-button:hover,
.teacher-card.card-button:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(18, 59, 43, 0.16) !important;
  border-color: #b8d8c3 !important;
}

.teacher-portrait>.portrait-pattern {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: repeating-radial-gradient(circle at 25% 20%, transparent 0 22px, #ffffff70 23px 24px), linear-gradient(135deg, #a9c9ae, #e5dcc3);
}

.resource-open {
  width: 100%;
  display: block;
  text-align: left;
  background: transparent;
  color: inherit;
  border: 0;
  padding: 0;
}

.resource-open:hover h3 {
  color: #0d7657;
}

/* Public resources page: card is just information (no popup). */
.resource-static {
  cursor: default;
}

.resource-static:hover h3 {
  color: inherit;
}


/* ── Select2 Deenwabayan Custom Theme ─────────────────────────────────────── */
.select2-container {
  font-family: 'DM Sans', sans-serif !important;
}

label>.select2-container,
.smart-form .select2-container,
.select2-container {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.select2-container--open {
  max-width: 100% !important;
}

/* The open list is a separate wrapper placed on the popup backdrop / page body at the
   field's position. It must not take the 100% width above (that pushed it past the right
   edge and showed a horizontal scrollbar); the list inside sets its own width. */
.modal-backdrop>.select2-container,
.modal>.select2-container,
body>.select2-container {
  width: auto !important;
  max-width: none !important;
}

.select2-close-mask {
  display: none !important;
}

.select2-container--default .select2-selection--single {
  height: 48px !important;
  background-color: #fcfdfa !important;
  border: 1px solid #dbe6dc !important;
  border-radius: 10px !important;
  display: flex !important;
  align-items: center !important;
  transition: border-color .18s ease, box-shadow .18s ease !important;
  outline: none !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #1d463b !important;
  font-size: 0.88rem !important;
  font-family: 'DM Sans', sans-serif !important;
  font-weight: 500 !important;
  padding-left: 0.95rem !important;
  padding-right: 2.2rem !important;
  line-height: 46px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 46px !important;
  right: 0.85rem !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: #124c3e transparent transparent transparent !important;
  border-width: 6px 5px 0 5px !important;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
  border-color: transparent transparent #124c3e transparent !important;
  border-width: 0 5px 6px 5px !important;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: #0c6b54 !important;
  box-shadow: 0 0 0 3px rgba(12, 107, 84, 0.12) !important;
}

.select2-dropdown {
  border: 1px solid #dbe6dc !important;
  border-radius: 10px !important;
  background: #fff !important;
  box-shadow: 0 14px 35px rgba(14, 70, 60, 0.15) !important;
  overflow: hidden !important;
  font-family: 'DM Sans', sans-serif !important;
  font-size: 0.88rem !important;
  z-index: 99999 !important;
  box-sizing: border-box !important;
}

.select2-search--dropdown {
  padding: 0.6rem !important;
  display: block !important;
}

.select2-search--dropdown .select2-search__field {
  width: 100% !important;
  box-sizing: border-box !important;
  border: 1px solid #dce8de !important;
  border-radius: 8px !important;
  padding: 0.55rem 0.8rem !important;
  font-family: 'DM Sans', sans-serif !important;
  font-size: 0.85rem !important;
  outline: none !important;
  background-color: #fcfdfa !important;
}

.select2-search--dropdown .select2-search__field:focus {
  border-color: #0c6b54 !important;
}

.select2-container--default .select2-results__option {
  padding: 0.65rem 0.95rem !important;
  color: #1d463b !important;
  font-size: 0.86rem !important;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background-color: #0c6b54 !important;
  color: #fff !important;
}

.select2-container--default .select2-results__option--selected {
  background-color: #e8f3ee !important;
  color: #0c6b54 !important;
  font-weight: 700 !important;
}

/* ── Blade parity: React rendered these as <button>, Blade uses <a>.
      Give links the browser's default button padding so spacing matches. ── */
.public-header nav a {
  padding: 1px 6px;
}

/* ── Blade parity: Select2 inside forms should look like React's native <select> ── */
.smart-form .select2-container--default .select2-selection--single {
  height: 46px !important;
  background-color: #fbfcfa !important;
  border: 1px solid #dce8de !important;
  border-radius: 9px !important;
}

.smart-form .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #214c3f !important;
  font-size: .76rem !important;
  font-weight: 800 !important;
  padding-left: .9rem !important;
}

/* Multi-choice dropdown (e.g. "Subjects you teach"): same box as the other fields,
   chosen items shown as small green chips. */
.smart-form .select2-container--default .select2-selection--multiple {
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: .3rem .5rem;
  background-color: #fbfcfa;
  border: 1px solid #dce8de;
  border-radius: 9px;
  cursor: text;
}

.smart-form .select2-container--default.select2-container--focus .select2-selection--multiple,
.smart-form .select2-container--default.select2-container--open .select2-selection--multiple {
  border-color: #0c6b54;
  box-shadow: 0 0 0 3px rgba(12, 107, 84, .12);
}

.smart-form .select2-container--default .select2-selection--multiple {
  flex-wrap: wrap;
}

/* Chips and the typing box share one wrapping row; the typing box takes the rest. */
.smart-form .select2-container--default .select2-selection--multiple .select2-selection__rendered {
  display: contents;
}

.smart-form .select2-container--default .select2-selection--multiple .select2-search--inline {
  flex: 1;
  min-width: 1rem;
}

.smart-form .select2-container--default .select2-selection--multiple .select2-selection__choice {
  display: inline-flex;
  align-items: center;
  margin: .15rem .3rem .15rem 0;
  padding: .2rem .55rem .2rem 0;
  border: 0;
  border-radius: 999px;
  background: #e3f1e6;
  color: #0c5d48;
  font-size: .74rem;
  font-weight: 700;
}

.smart-form .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  position: static;
  margin: 0 .3rem 0 .15rem;
  padding: 0 .3rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #0c6b54;
  font-weight: 800;
}

.smart-form .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
  background: #cfe6d5;
  color: #08402f;
}

.smart-form .select2-container--default .select2-selection--multiple .select2-selection__choice__display {
  padding: 0;
}

.smart-form .select2-container--default .select2-search--inline .select2-search__field {
  width: 100% !important;
  height: 26px;
  margin: .15rem 0;
  padding: 0 .3rem;
  overflow: hidden;
  resize: none;
  white-space: nowrap;
  line-height: 26px;
  vertical-align: middle;
  border: 0 !important;
  background: transparent;
  box-shadow: none !important;
  font: 600 .8rem 'DM Sans', sans-serif;
  color: #214c3f;
}

.smart-form .select2-container--default .select2-search--inline .select2-search__field::placeholder {
  color: #8a9b90;
}

/* ── Cards: equal heights, footer pinned to the bottom, responsive on every screen ── */
.program-card,
.resource-card,
.teacher-card {
  display: flex;
  flex-direction: column;
}

.program-card p {
  flex: 1;
}

.program-card .card-footer {
  margin-top: auto;
}

.resource-card .resource-open {
  flex: 1;
}

.resource-card>.row {
  margin-top: 1rem;
  gap: .6rem;
  flex-wrap: wrap;
}

/* Admin program cards with their "Edit program" button underneath */
.editable-program {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.editable-program .program-card {
  height: auto;
  flex: 1;
}

.editable-program>.btn {
  margin-top: 0;
  align-self: flex-start;
}

/* Inside the portal the grids use the full content width (the public-page side
   margins do not apply) and wrap by available space instead of fixed columns. */
.portal-content .page-intro+.program-grid,
.portal-content .page-intro+.resource-grid,
.portal-content .page-intro+.teacher-grid {
  margin: 0 0 2rem;
}

.portal-content .program-grid,
.portal-content .resource-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
}

/* Destructive actions (remove person) */
.btn.ghost.danger {
  color: #a7524c;
  border-color: #efd9d6;
}

.btn.primary.danger {
  background: #a7524c;
  box-shadow: 0 8px 18px #a7524c26;
}

.btn.primary.danger:hover {
  background: #8e423d;
}

/* ── Small screens: keep the portal header and page headings inside the viewport ── */
@media (max-width: 580px) {
  .portal-header .header-actions {
    gap: .5rem;
  }

  .portal-header .logout-text,
  .portal-header .breadcrumb-root {
    display: none;
  }

  .portal-header .btn.ghost.small {
    padding: .55rem .65rem;
  }

  .section-heading {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .section-heading>.btn {
    flex: none;
  }
}

/* Closed mobile sidebar should not cast a shadow onto the page edge */
@media (max-width: 800px) {
  .sidebar:not(.open) {
    box-shadow: none;
  }
}

/* ── Pagination (server-side lists and the lesson list view) ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  flex-wrap: wrap;
  margin-top: 1.3rem;
  padding-top: 1rem;
  border-top: 1px solid #edf1eb;
}

.pagination-info {
  font-size: .76rem;
  color: #879891;
}

.pagination-links {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 .55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dfe9e0;
  border-radius: 9px;
  background: #fff;
  color: #2c604a;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

a.page-btn:hover,
button.page-btn:hover:not(.disabled) {
  border-color: #b8d8c3;
  background: #f1f8f2;
}

.page-btn.active {
  background: #0c6b54;
  border-color: #0c6b54;
  color: #fff;
}

.page-btn.disabled {
  opacity: .45;
  cursor: default;
}

.page-btn.dots {
  border-color: transparent;
  background: transparent;
}

.enrolment-grid+.pagination,
.enrolment-grid .pagination {
  grid-column: 1 / -1;
}

.public-pagination-wrap {
  margin: -3rem clamp(1.2rem, 8vw, 9rem) 5rem;
}

.public-pagination-wrap .pagination {
  margin-top: 0;
  padding-top: 1.5rem;
  border-top: 1px solid #edf1eb;
}

@media (max-width: 680px) {
  .public-pagination-wrap {
    margin: -1.5rem 1.1rem 3rem;
  }
}

/* Tab links (server-side filters) look exactly like the React tab buttons */
.tabs a.tab-link {
  display: inline-block;
  padding: .6rem 1rem;
  color: #8b9f90;
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
  border-radius: 8px;
  text-decoration: none;
}

.tabs a.tab-link.active {
  color: #0e6c54;
  background: #e8f3e9;
}

.enrolment-tabs a.tab-link small {
  background: #dfe9dc;
  border-radius: 12px;
  padding: .1rem .35rem;
  margin-left: .2rem;
}

.filter-bar input[type="search"]::-webkit-search-cancel-button {
  cursor: pointer;
}

/* Messages: WhatsApp-style loader, typing indicator and "new message" pill */
.message-stream .history-loader {
  align-self: center;
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .35rem .8rem;
  border-radius: 999px;
  background: #eef4ed;
  color: #557563;
  font-size: .66rem;
  font-weight: 700;
}

.message-stream .history-loader .spinner {
  width: 13px;
  height: 13px;
  border: 2px solid #cfe0d2;
  border-top-color: #0c7055;
  border-radius: 50%;
  animation: ayah-spin .8s linear infinite;
}

@keyframes ayah-spin {
  to {
    transform: rotate(360deg)
  }
}

.message-stream .typing-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: .75rem .9rem;
}

.message-stream .typing-bubble span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7f9c88;
  animation: ayah-typing 1.2s ease-in-out infinite;
}

.message-stream .typing-bubble span:nth-child(2) {
  animation-delay: .15s
}

.message-stream .typing-bubble span:nth-child(3) {
  animation-delay: .3s
}

@keyframes ayah-typing {

  0%,
  60%,
  100% {
    opacity: .35;
    transform: translateY(0)
  }

  30% {
    opacity: 1;
    transform: translateY(-3px)
  }
}

.message-stream .new-msg-pill {
  position: sticky;
  bottom: 0;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .9rem;
  border: 0;
  border-radius: 999px;
  background: #0c7055;
  color: #fff;
  font: inherit;
  font-size: .68rem;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(12, 112, 85, .25);
  cursor: pointer;
}

.message-stream .history-loader[hidden],
.message-stream .typing-bubble[hidden],
.message-stream .new-msg-pill[hidden] {
  display: none !important;
}

.conversation-head small.typing,
.contact-list small.typing {
  color: #0c7055;
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {

  .message-stream .history-loader .spinner,
  .message-stream .typing-bubble span {
    animation: none
  }
}

/* Enroll Page Centering & Responsive Layout */
.enrol-page-wrap {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 clamp(1.2rem, 4vw, 2.5rem);
  box-sizing: border-box;
}

.enrol-intro {
  padding: 3.8rem 0 1.8rem !important;
  max-width: 100% !important;
}

.enrol-intro h1 {
  max-width: 100% !important;
}

.enrol-intro p {
  max-width: 100% !important;
}

.public .enrol-form-panel,
.enrol-form-panel {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 0 5rem 0 !important;
  box-sizing: border-box !important;
}

@media (max-width: 680px) {
  .enrol-form-panel .smart-form {
    grid-template-columns: 1fr !important;
  }

  .enrol-form-panel .smart-form label.wide,
  .enrol-form-panel .form-submit {
    grid-column: 1 !important;
  }
}

@media (max-width: 580px) {
  .enrol-page-wrap {
    padding: 0 1.1rem;
  }

  .enrol-intro {
    padding: 2.5rem 0 1.4rem !important;
  }

  .public .enrol-form-panel,
  .enrol-form-panel {
    margin: 0 0 3rem 0 !important;
  }
}

/* ── Teacher Slider (Home Page) ── */
.teacher-slider-wrap {
  position: relative;
  width: 100%;
}

.teacher-slider-track {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 8px 4px;
}

.teacher-slider-track::-webkit-scrollbar {
  display: none;
}

.teacher-slider-item {
  flex: 0 0 calc((100% - 1.25rem) / 2);
  width: calc((100% - 1.25rem) / 2);
  min-width: 0;
  scroll-snap-align: start;
  box-sizing: border-box;
  display: flex;
}

.teacher-slider-item>.teacher-card {
  width: 100% !important;
  height: 100% !important;
}

@media (max-width: 900px) {
  .teacher-slider-item {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
  }
}

.teacher-slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #0c6b54;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.teacher-slider-nav svg,
.teacher-slider-nav i {
  pointer-events: none;
}

.teacher-slider-nav:not(:disabled):hover {
  background: #0c6b54;
  color: #ffffff;
  border-color: #0c6b54;
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 6px 20px rgba(12, 107, 84, 0.35) !important;
}

.teacher-slider-nav:not(:disabled):active {
  transform: translateY(-50%) scale(0.95);
}

.teacher-slider-nav:disabled,
.teacher-slider-nav[disabled] {
  opacity: 0.3;
  cursor: not-allowed !important;
  pointer-events: none;
  background: #ffffff !important;
  color: #a0b3a8 !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
  transform: translateY(-50%) !important;
}

.teacher-slider-nav.prev {
  left: -24px;
}

.teacher-slider-nav.next {
  right: -24px;
}

@media (max-width: 1100px) {
  .teacher-slider-nav.prev {
    left: -12px;
  }

  .teacher-slider-nav.next {
    right: -12px;
  }
}

@media (max-width: 768px) {
  .teacher-slider-nav {
    width: 40px;
    height: 40px;
  }

  .teacher-slider-nav.prev {
    left: 4px;
  }

  .teacher-slider-nav.next {
    right: 4px;
  }
}

/* ── Contact list smooth scrollbar ── */
.contact-list-items {
  scrollbar-width: thin;
  scrollbar-color: #c3d5cb #f4f7f5;
}

.contact-list-items::-webkit-scrollbar {
  width: 6px;
}

.contact-list-items::-webkit-scrollbar-track {
  background: #f4f7f5;
}

.contact-list-items::-webkit-scrollbar-thumb {
  background: #c3d5cb;
  border-radius: 4px;
}

.contact-list-items::-webkit-scrollbar-thumb:hover {
  background: #8faea0;
}

/* ── People Categorized Sections ── */
.category-block {
  margin-bottom: 2rem;
}

.category-block:last-child {
  margin-bottom: 0.5rem;
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.4rem 0.85rem;
  border-bottom: 2px solid #e1ebe3;
  margin-bottom: 0.9rem;
}

.category-header h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #173a33;
  margin: 0;
  line-height: 1.2;
}

.category-header small {
  color: #6d8277;
  font-size: 0.76rem;
}

.category-rows {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.category-rows .list-row {
  margin-bottom: 0;
  transition: all 0.2s ease;
}

.category-rows .list-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(18, 59, 43, 0.08);
}

.role-badge.teacher {
  background: #eef5f0 !important;
  color: #0c6b54 !important;
  border: 1px solid #d2e4d7 !important;
  font-weight: 600 !important;
}

.role-badge.student {
  background: #edf4fa !important;
  color: #1e5a8a !important;
  border: 1px solid #cce0f0 !important;
  font-weight: 600 !important;
}

/* ── Deenwabayan date / date-time picker (public/js/ayah-datepicker.js) ──
   Compact panel right below its box, attached to it: month, the weeks of that month,
   one time row (hour / minute boxes with ▲▼ and AM / PM) and Clear / Done. */
.ayah-picker {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  width: 272px;
  max-width: calc(100vw - 32px);
  box-sizing: border-box;
  padding: .45rem .5rem .5rem;
  background: #fff;
  border: 1px solid #dbe6dc;
  border-radius: 13px;
  box-shadow: 0 16px 40px rgba(14, 70, 60, .17);
  font-family: 'DM Sans', sans-serif;
  color: #1d463b;
  text-align: left;
  cursor: default;
}

.ayah-picker[hidden] {
  display: none;
}

.ayah-picker.-align-right {
  left: auto;
  right: 0;
}

.ayah-date-wrap.-open .ayah-date-input {
  border-color: #0c6b54;
  box-shadow: 0 0 0 3px rgba(12, 107, 84, .12);
}

/* Month + arrows */
.ayah-picker .ap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .1rem;
}

.ayah-picker .ap-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: .95rem;
  font-weight: 700;
  color: #124c3e;
}

.ayah-picker .ap-nav {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #124c3e;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.ayah-picker .ap-nav:hover:not(:disabled) {
  background: #eef6f1;
}

.ayah-picker .ap-nav:disabled {
  opacity: .25;
  cursor: default;
}

/* Days */
.ayah-picker .ap-week,
.ayah-picker .ap-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}

.ayah-picker .ap-week span {
  padding: .2rem 0;
  text-align: center;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #c38a3a;
}

.ayah-picker .ap-day {
  height: 29px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #1d463b;
  font: 600 .8rem 'DM Sans', sans-serif;
  cursor: pointer;
}

.ayah-picker .ap-day:hover:not(:disabled) {
  background: #eef6f1;
}

.ayah-picker .ap-day:focus-visible {
  outline: 2px solid #0c6b54;
  outline-offset: 0;
}

.ayah-picker .ap-day.-other {
  color: #b7c6bf;
}

.ayah-picker .ap-day.-today {
  color: #c38a3a;
  font-weight: 800;
  box-shadow: inset 0 0 0 1.5px #e2c38f;
}

.ayah-picker .ap-day.-selected,
.ayah-picker .ap-day.-selected:hover {
  background: #0c6b54;
  color: #fff;
  font-weight: 800;
  box-shadow: none;
}

.ayah-picker .ap-day:disabled {
  color: #d3ddd8;
  cursor: not-allowed;
  background: transparent;
}

/* Time: [07 ▲▼] : [30 ▲▼]  AM|PM */
.ayah-picker .ap-time {
  display: flex;
  align-items: center;
  gap: .3rem;
  margin-top: .4rem;
  padding: .45rem .1rem 0;
  border-top: 1px solid #edf2ee;
}

.ayah-picker .ap-time-label {
  margin-right: auto;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #c38a3a;
}

.ayah-picker .ap-spin {
  display: inline-flex;
  align-items: stretch;
  height: 30px;
  border: 1px solid #dbe6dc;
  border-radius: 8px;
  background: #fcfdfa;
  overflow: hidden;
}

.ayah-picker .ap-spin:focus-within {
  border-color: #0c6b54;
  box-shadow: 0 0 0 3px rgba(12, 107, 84, .12);
}

.ayah-picker .ap-spin input,
.ayah-picker .ap-spin input:focus {
  width: 30px;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  text-align: center;
  color: #124c3e;
  font: 800 .86rem 'DM Sans', sans-serif;
}

.ayah-picker .ap-spin-btns {
  display: flex;
  flex-direction: column;
  border-left: 1px solid #e6eee8;
}

.ayah-picker .ap-spin-btns button {
  flex: 1;
  width: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #0c6b54;
  display: grid;
  place-items: center;
  cursor: pointer;
  touch-action: manipulation;
}

.ayah-picker .ap-spin-btns button+button {
  border-top: 1px solid #e6eee8;
}

.ayah-picker .ap-spin-btns button:hover {
  background: #eef6f1;
}

.ayah-picker .ap-colon {
  font-weight: 800;
  color: #124c3e;
}

.ayah-picker .ap-period {
  display: inline-flex;
  margin-left: .2rem;
  padding: 2px;
  border-radius: 8px;
  background: #eef5ed;
}

.ayah-picker .ap-period button {
  height: 26px;
  padding: 0 .45rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #6f8a7b;
  font: 800 .7rem 'DM Sans', sans-serif;
  cursor: pointer;
}

.ayah-picker .ap-period button.-on {
  background: #0c6b54;
  color: #fff;
}

/* Clear / Done / Today */
.ayah-picker .ap-foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .4rem;
  margin-top: .45rem;
}

.ayah-picker .ap-btn {
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #0c6b54;
  font: 800 .78rem 'DM Sans', sans-serif;
  cursor: pointer;
}

.ayah-picker .ap-btn:hover {
  background: #eef6f1;
}

.ayah-picker .ap-done,
.ayah-picker .ap-today {
  background: #0c6b54;
  color: #fff;
}

.ayah-picker .ap-done:hover,
.ayah-picker .ap-today:hover {
  background: #0a5a47;
}

/* The visible box that opens the picker (the real value sits in a hidden input next to it). */
.ayah-date-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.ayah-date-wrap .ayah-date-input {
  width: 100%;
  padding-right: 2.6rem;
  cursor: pointer;
  caret-color: transparent;
}

.ayah-date-icon {
  position: absolute;
  right: .85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #0c6b54;
  pointer-events: none;
  display: flex;
}


/* Time zone picked from this device (student profile) — saved only on Save. */
.tz-suggest {
  color: #0c6b54;
  font-size: .72rem;
  font-weight: 600;
}

.tz-suggest[hidden] {
  display: none;
}