:root {
  --green-deep: #0f3d2e;
  --green: #1a5c40;
  --green-mid: #2d7a55;
  --gold: #c4a035;
  --cream: #f3efe6;
  --ink: #1c241f;
  --muted: #5a665f;
  --white: #ffffff;
  --danger: #9b2c2c;
  --border: rgba(15, 61, 46, 0.14);
  --shadow: 0 18px 40px rgba(15, 61, 46, 0.12);
  --font-display: "Source Serif 4", Georgia, serif;
  --font-body: "DM Sans", "Segoe UI", sans-serif;
  --dash-sidebar-w: 248px;
  --dash-header-h: 72px;
  --dash-surface: #ffffff;
  --dash-footer-h: 4.5rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(196, 160, 53, 0.16), transparent 32%),
    radial-gradient(circle at 88% 0%, rgba(45, 122, 85, 0.18), transparent 34%),
    linear-gradient(180deg, #f7f4ee 0%, #ebe6db 100%);
  min-height: 100vh;
  line-height: 1.55;
}

a {
  color: var(--green);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--green-deep);
}

img {
  max-width: 100%;
  height: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  background: rgba(243, 239, 230, 0.88);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
}

.brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}

.brand-text span {
  font-size: 0.78rem;
  color: var(--muted);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.1rem;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--green);
}

.nav-reset-item {
  display: flex;
  align-items: center;
}

.nav-reset-form {
  margin: 0;
  display: flex;
  align-items: center;
}

.nav-reset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.nav-reset-btn:hover {
  color: #b42318;
  background: rgba(180, 35, 24, 0.08);
  border-color: rgba(180, 35, 24, 0.2);
}

.nav-reset-icon {
  display: block;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.2rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-deep) 100%);
  color: var(--white);
  box-shadow: 0 10px 24px rgba(26, 92, 64, 0.28);
}

.btn-primary:hover {
  color: var(--white);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink);
}

.btn-gold {
  background: linear-gradient(135deg, #d4b04a, var(--gold));
  color: var(--ink);
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - 80px);
  display: grid;
  place-items: center;
  padding: 3rem 1.25rem 4rem;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(15, 61, 46, 0.88) 0%, rgba(15, 61, 46, 0.55) 48%, rgba(196, 160, 53, 0.35) 100%),
    url("../img/logo.png") center / 48% no-repeat;
  opacity: 0.95;
  animation: heroPulse 10s ease-in-out infinite alternate;
}

@keyframes heroPulse {
  from { transform: scale(1); }
  to { transform: scale(1.04); }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
  text-align: center;
  color: var(--white);
  animation: fadeUp 0.8s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-logo {
  width: 110px;
  height: 110px;
  object-fit: contain;
  margin-bottom: 1rem;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.25));
  animation: fadeUp 1s ease 0.1s both;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.05;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: 1.1rem;
  opacity: 0.92;
  margin: 0 auto 1.5rem;
  max-width: 36rem;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 3rem 1.25rem;
}

.section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  margin: 0 0 0.5rem;
  color: var(--green-deep);
}

.section-lead {
  color: var(--muted);
  margin: 0 0 1.5rem;
  max-width: 40rem;
}

.dash-breadcrumb {
  margin: 0 0 1rem;
}

.dash-breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0.55rem 0.85rem;
  max-width: 100%;
  background: #f3f7f4;
  border: 1px solid rgba(26, 92, 64, 0.12);
  border-radius: 999px;
  font-size: 0.86rem;
  line-height: 1.35;
}

.dash-breadcrumb-list li {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  color: var(--green-deep);
}

.dash-breadcrumb-list li:not(:last-child)::after {
  content: "›";
  margin-left: 0.45rem;
  margin-right: 0.35rem;
  color: rgba(26, 92, 64, 0.45);
  font-weight: 600;
  speak: never;
}

.dash-breadcrumb-list a {
  color: var(--green-deep);
  text-decoration: none;
  font-weight: 550;
  max-width: 18rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-breadcrumb-list a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dash-breadcrumb-current {
  color: #1a2e24;
  font-weight: 650;
  max-width: 22rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grid-2 {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.panel {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
}

.panel h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  color: var(--green-deep);
}

.list-plain {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-plain li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.list-plain li:last-child {
  border-bottom: none;
}

.site-footer {
  margin-top: 2rem;
  padding: 2rem 1.25rem;
  background: var(--green-deep);
  color: rgba(255, 255, 255, 0.88);
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}

.footer-inner a {
  color: #f0e2a8;
}

.dash-layout {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  grid-template-columns: var(--dash-sidebar-w) minmax(0, 1fr);
  align-items: stretch;
  min-height: calc(100vh - var(--dash-header-h));
}

.dash-side {
  background: var(--green-deep);
  border: none;
  border-radius: 0;
  /* No bottom padding — logout bar must sit flush with the nested footer */
  padding: 1.35rem 0 0;
  color: #f4faf6;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--dash-header-h);
  align-self: start;
  max-height: calc(100vh - var(--dash-header-h));
  overflow: hidden;
  min-height: calc(100vh - var(--dash-header-h));
}

.dash-main {
  background: var(--dash-surface);
  border: none;
  border-radius: 0;
  padding: 1.5rem 1.75rem 2.75rem;
  box-shadow: none;
  width: 100%;
  min-height: calc(100vh - var(--dash-header-h));
}

.dash-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  margin: 0.15rem 0.95rem 0.35rem;
}

.dash-identity strong {
  color: #fff;
  font-size: 1.05rem;
}

.dash-role {
  margin: 0 0.95rem 1rem;
  color: rgba(244, 250, 246, 0.72);
  font-size: 0.82rem;
  text-align: center;
}

.dash-avatar {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 3px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.dash-avatar--lg {
  width: 140px;
  height: 140px;
  border-color: rgba(26, 92, 64, 0.25);
}

.dash-avatar--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--green-deep);
  letter-spacing: 0.02em;
}

.dash-avatar--lg.dash-avatar--fallback {
  font-size: 1.5rem;
}

.dash-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-height: 0;
  padding-left: 0.95rem;
  overflow: visible;
}

.dash-nav-link {
  display: block;
  box-sizing: border-box;
  padding: 0.6rem 0.85rem;
  margin-right: 0.95rem;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.88) !important;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  border: none;
  background: transparent;
  width: auto;
  max-width: none;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, margin 0.15s ease, border-radius 0.15s ease;
}

.dash-nav-more-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.dash-nav-more-chevron {
  font-size: 1.25rem;
  line-height: 1;
  opacity: 0.85;
  flex-shrink: 0;
}

.dash-nav-more-btn.is-active .dash-nav-more-chevron {
  color: var(--green-deep);
}

.dash-nav-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff !important;
}

.dash-nav-link.is-active {
  background: var(--dash-surface);
  color: var(--green-deep) !important;
  font-weight: 600;
  margin-right: 0;
  border-radius: 999px 0 0 999px;
  position: relative;
  z-index: 5;
  box-shadow: 2px 0 0 0 var(--dash-surface);
  overflow: visible;
}

/* True inverted corners: green is scooped, white L-joins the main pane */
.dash-nav-link.is-active::before,
.dash-nav-link.is-active::after {
  content: "";
  position: absolute;
  right: 0;
  width: 14px;
  height: 14px;
  background: transparent;
  pointer-events: none;
  z-index: 6;
}

.dash-nav-link.is-active::before {
  bottom: 100%;
  border-bottom-right-radius: 14px;
  box-shadow: 7px 7px 0 7px var(--dash-surface);
}

.dash-nav-link.is-active::after {
  top: 100%;
  border-top-right-radius: 14px;
  box-shadow: 7px -7px 0 7px var(--dash-surface);
}

.dash-side-foot {
  margin-top: auto;
  flex-shrink: 0;
  height: var(--dash-footer-h);
  min-height: var(--dash-footer-h);
  box-sizing: border-box;
  padding: 0 0.95rem;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
}

.dash-side-foot form {
  width: 100%;
}

.dash-side .btn-ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
  background: transparent;
}

.dash-side .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Secondary “More options” drawer — slides in from the left */
.dash-more {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}

.dash-more.is-open {
  pointer-events: auto;
}

.dash-more-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(8, 28, 18, 0.42);
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.22s ease;
}

.dash-more.is-open .dash-more-backdrop {
  opacity: 1;
}

.dash-more-panel {
  position: absolute;
  top: var(--dash-header-h);
  left: 0;
  bottom: 0;
  width: min(280px, 88vw);
  background: var(--green-deep);
  color: #f4faf6;
  display: flex;
  flex-direction: column;
  box-shadow: 8px 0 28px rgba(0, 0, 0, 0.28);
  transform: translateX(-105%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  padding: 0;
}

.dash-more.is-open .dash-more-panel {
  transform: translateX(0);
}

.dash-more-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.1rem 1.1rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.dash-more-head strong {
  color: #fff;
  font-size: 1.02rem;
  font-weight: 650;
}

.dash-more-close {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.dash-more-close:hover {
  background: rgba(255, 255, 255, 0.18);
}

.dash-more-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.85rem 0 1.25rem 0.95rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.dash-more-nav .dash-nav-link {
  width: auto;
}

/* In the drawer, active is a solid pill — no main-pane fillet */
.dash-more-nav .dash-nav-link.is-active {
  margin-right: 0.95rem;
  border-radius: 999px;
  box-shadow: none;
}

.dash-more-nav .dash-nav-link.is-active::before,
.dash-more-nav .dash-nav-link.is-active::after {
  display: none;
}

body.dash-more-open {
  overflow: hidden;
}

.dash-main h1 {
  font-family: var(--font-display);
  color: var(--green-deep);
  margin: 0 0 0.35rem;
  font-size: clamp(1.55rem, 2.4vw, 2rem);
}

.dash-greeting {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.35rem;
}

.dash-greeting p {
  margin: 0;
  color: var(--muted);
  max-width: 36rem;
}

.dash-quick {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  margin: 0 0 1.5rem;
}

.dash-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 1rem 0.9rem;
  border-radius: 16px;
  background: #f3f8f5;
  border: 1px solid rgba(26, 92, 64, 0.1);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
  min-height: 108px;
}

.dash-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(15, 61, 46, 0.1);
  border-color: rgba(26, 92, 64, 0.22);
  color: var(--ink);
  text-decoration: none;
}

.dash-tile-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 92, 64, 0.12);
  color: var(--green-deep);
  font-weight: 700;
  font-size: 0.95rem;
}

.dash-tile strong {
  font-size: 0.92rem;
  line-height: 1.25;
}

.dash-tile span {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.3;
}

.dash-panels {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.dash-panels .panel {
  margin: 0;
  box-shadow: none;
  background: #f7faf8;
}

/* Student biodata (admin / registrar view) */
.biodata-card {
  padding: 1.5rem 1.75rem 1.75rem;
}

.biodata-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1.35rem 1.75rem;
  align-items: flex-start;
  padding-bottom: 1.35rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.biodata-photo .dash-avatar--lg {
  width: 140px;
  height: 140px;
}

.biodata-identity {
  flex: 1;
  min-width: 220px;
}

.biodata-identity h1 {
  margin: 0 0 0.35rem;
}

.biodata-meta {
  margin: 0 0 0.25rem;
  color: var(--muted, #5a6b62);
  font-size: 0.95rem;
}

.biodata-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.biodata-grid {
  display: grid;
  gap: 1.25rem;
}

.biodata-section h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--green-deep);
}

.biodata-dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem 1.25rem;
  margin: 0;
}

.biodata-dl > div {
  min-width: 0;
}

.biodata-dl .biodata-span {
  grid-column: 1 / -1;
}

.biodata-dl dt {
  font-size: 0.75rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #5a6b62);
  margin: 0 0 0.2rem;
}

.biodata-dl dd {
  margin: 0;
  font-size: 0.98rem;
  color: var(--ink, #1a2e24);
  line-height: 1.35;
}

.profile-readonly {
  display: grid;
  gap: 0.55rem;
  margin: 0;
}

.profile-readonly > div {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 0.5rem;
  align-items: baseline;
}

.profile-readonly dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.profile-readonly dd {
  margin: 0;
}

body.dash-app .site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  height: var(--dash-header-h);
  display: flex;
  align-items: center;
}

body.dash-app .nav-inner {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0 1.5rem 0 0.95rem;
  display: grid;
  grid-template-columns: var(--dash-sidebar-w) minmax(0, 1fr);
  align-items: center;
  gap: 0;
}

body.dash-app .nav-inner .brand {
  padding-left: 0.35rem;
}

body.dash-app .nav-inner nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

body.dash-app .nav-links li:not(:nth-last-child(-n+2)):not(.nav-reset-item) {
  display: none;
}

body.dash-app .nav-links .nav-reset-item {
  display: flex;
}

body.dash-app {
  background:
    radial-gradient(circle at 10% 0%, rgba(45, 122, 85, 0.14), transparent 36%),
    linear-gradient(180deg, #e7f0ea 0%, #f4f1ea 55%, #ebe6db 100%);
  overflow: hidden;
  height: 100vh;
}

body.dash-app .dash-layout {
  display: block;
  margin-top: var(--dash-header-h);
  height: calc(100vh - var(--dash-header-h));
  min-height: 0;
}

body.dash-app .dash-main {
  margin-left: var(--dash-sidebar-w);
  width: auto;
  height: calc(100vh - var(--dash-header-h));
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  background: var(--dash-surface);
  box-shadow: none;
  padding-bottom: 0;
}

body.dash-app .dash-side {
  position: fixed;
  top: var(--dash-header-h);
  left: 0;
  bottom: 0;
  width: var(--dash-sidebar-w);
  z-index: 30;
  min-height: 0;
  max-height: none;
  align-self: auto;
  box-shadow: none;
  overflow: hidden;
}

/* Hide page-level footer until JS nests it into .dash-main */
body.dash-app > .site-footer {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* Nested footer scrolls with the white main pane */
body.dash-app .dash-main > .site-footer {
  position: static;
  width: auto;
  height: auto;
  min-height: var(--dash-footer-h);
  max-height: none;
  box-sizing: border-box;
  overflow: visible;
  clip: unset;
  clip-path: none;
  display: flex;
  align-items: center;
  margin-left: -1.75rem;
  margin-right: -1.75rem;
  margin-bottom: 0;
  margin-top: auto;
  padding: 0.85rem 1.75rem;
  border-radius: 0;
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

body.dash-app .dash-main > .site-footer .footer-inner {
  max-width: none;
  margin: 0;
  width: 100%;
  gap: 0.35rem 1rem;
}

body.dash-app .messages {
  position: fixed;
  top: calc(var(--dash-header-h) + 0.5rem);
  left: calc(var(--dash-sidebar-w) + 1.25rem);
  right: 1.25rem;
  z-index: 45;
  max-width: none;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

body.dash-app .messages li {
  pointer-events: auto;
  box-shadow: var(--shadow);
}

.messages {
  max-width: 1120px;
  margin: 0.75rem auto 0;
  padding: 0 1.25rem;
}

.messages li {
  list-style: none;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: #e7f3ec;
  border: 1px solid rgba(26, 92, 64, 0.2);
  margin-bottom: 0.5rem;
}

.form-input,
textarea.form-input,
select.form-input {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font: inherit;
  margin-bottom: 0.75rem;
}

label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.table th,
.table td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--green-deep);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Reusable data-list layout (extend includes/data_list_base.html) */
.btn-sm {
  padding: 0.42rem 0.9rem;
  font-size: 0.86rem;
}

.data-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.data-list__page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.data-list__title-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
}

.data-list__title {
  margin: 0;
  font-family: var(--font-display);
  color: var(--green-deep);
  font-size: 1.85rem;
  line-height: 1.2;
}

.data-list__subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 40rem;
}

.data-list__page-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.data-list__card {
  background: #fff;
  border: 1px solid rgba(15, 61, 46, 0.12);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(15, 61, 46, 0.08);
  overflow: hidden;
}

.data-list__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem 1.15rem;
  background: linear-gradient(180deg, #f6faf8 0%, #eef5f1 100%);
  border-bottom: 1px solid #d8e5dd;
}

.data-list__toolbar-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  flex: 1 1 auto;
  min-width: 0;
}

.data-list__toolbar-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 1 280px;
  min-width: 200px;
}

.data-list__toolbar-search:has(.data-list__save-btn) {
  flex: 1 1 26rem;
  max-width: 100%;
}

.data-list__toolbar-search .data-list__search-input {
  flex: 1 1 9rem;
  min-width: 7.5rem;
}

.data-list__toolbar-search .data-list__save-btn {
  flex-shrink: 0;
  white-space: nowrap;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.data-list__save-btn--clean {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-deep) 100%);
  color: #fff;
  border-color: var(--green-deep);
  box-shadow: 0 6px 16px rgba(26, 92, 64, 0.24);
  cursor: pointer;
}

.data-list__save-btn--clean:hover {
  color: #fff;
  filter: brightness(1.05);
}

.data-list__save-btn--dirty {
  background: linear-gradient(135deg, #d64545 0%, #b71c1c 100%);
  color: #fff;
  border-color: #9f1818;
  box-shadow: 0 6px 16px rgba(183, 28, 28, 0.28);
  cursor: pointer;
}

.data-list__save-btn--dirty:hover {
  color: #fff;
  filter: brightness(1.06);
}

.gradebook-table {
  table-layout: fixed;
  width: max-content;
  min-width: 100%;
}

.gradebook-table th,
.gradebook-table td {
  padding: 0.5rem 0.4rem;
}

.gradebook-col-lrn {
  width: 5.5rem;
}

.gradebook-col-student {
  width: 14rem;
}

.gradebook-col-grade {
  width: 5.25rem;
}

.gradebook-col-check {
  width: 2.5rem;
}

.gradebook-table th.is-term-group {
  text-align: center;
  padding-bottom: 0.15rem;
}

.gradebook-table thead tr:nth-child(2) th {
  padding-top: 0.15rem;
  font-size: 0.68rem;
  text-align: center;
}

.gradebook-table th.is-check,
.gradebook-table td.is-check {
  text-align: center;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

.gradebook-table td.is-grade {
  text-align: center;
}

.gradebook-table .gradebook-input {
  width: 100%;
  max-width: 4.75rem;
  min-width: 0;
  height: 2rem;
  padding: 0 0.35rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  border: 1px solid #b8c9bf;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 0.875rem;
  box-shadow: inset 0 1px 2px rgba(15, 61, 46, 0.04);
}

.gradebook-table .gradebook-input:focus {
  outline: none;
  border-color: var(--green-mid);
  box-shadow: 0 0 0 3px rgba(45, 122, 85, 0.15);
}

.gradebook-table td.is-check input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
  margin: 0;
}

.gradebook-table td.is-check input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.data-list__toolbar-divider {
  width: 1px;
  height: 1.6rem;
  background: #c5d5cb;
  flex-shrink: 0;
}

.data-list__field {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  white-space: nowrap;
}

.data-list__field-label {
  color: #4a5c54;
  font-weight: 600;
  font-size: 0.82rem;
}

.data-list__field-suffix {
  color: var(--muted);
  font-size: 0.82rem;
}

.data-list__select,
.data-list__search-input {
  height: 2.1rem;
  padding: 0 0.6rem;
  border: 1px solid #b8c9bf;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 0.875rem;
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(15, 61, 46, 0.04);
}

.data-list__select {
  min-width: 4.2rem;
  cursor: pointer;
}

.data-list__search-input {
  flex: 1;
  min-width: 10rem;
  padding-left: 0.75rem;
}

.data-list__select:focus,
.data-list__search-input:focus {
  outline: none;
  border-color: var(--green-mid);
  box-shadow: 0 0 0 3px rgba(45, 122, 85, 0.15);
}

.data-list__toolbar-btns {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.data-list--live .data-list__filter-btn {
  display: none;
}

.data-list__live-hint {
  font-size: 0.82rem;
  color: #6b7f76;
  font-style: italic;
  line-height: 1.3;
}

.data-list__table-wrap.is-loading {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.data-list__table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #e5ece8;
  text-align: left;
  vertical-align: middle;
}

.data-table thead th {
  background: var(--green-deep);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: none;
  white-space: nowrap;
}

.data-table thead th:first-child {
  border-radius: 0;
}

.data-table tbody tr:nth-child(even) td {
  background: #f9fcfa;
}

.data-table tbody tr:hover td {
  background: #edf6f0;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table .is-num {
  text-align: center;
  width: 5rem;
}

.data-table .is-actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.cell-section {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.cell-section__grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #e8f3ec, #d4e8dc);
  color: var(--green-deep);
  font-size: 0.82rem;
  font-weight: 800;
  flex-shrink: 0;
}

.cell-section__name {
  font-weight: 650;
  color: var(--ink);
}

.cell-teacher {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.cell-teacher .dash-avatar {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
}

.data-table__contact {
  font-size: 0.88rem;
  color: var(--ink);
}

.line-tag {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: #eef3f0;
  color: var(--green-deep);
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.data-table__sy {
  color: #3d4f47;
  font-size: 0.86rem;
  white-space: nowrap;
}

.data-table__person {
  font-size: 0.88rem;
}

.data-table__empty {
  color: #9aa8a1;
  font-size: 0.86rem;
  font-style: italic;
}

.data-table__lrn {
  font-variant-numeric: tabular-nums;
  font-size: 0.88rem;
  color: #6b7a72;
  white-space: nowrap;
}

.data-table__status-select {
  min-width: 11rem;
}

.data-list__date-input {
  min-width: 10.5rem;
}

.data-list__hint {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: #8a6d1f;
}

.data-list__hint--ok {
  color: #2d6a4f;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: #eef2ef;
  color: #7a8a82;
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat-pill--on {
  background: #dff0e6;
  color: var(--green-deep);
}

.row-actions {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid #d0ddd6;
  border-radius: 9px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 61, 46, 0.05);
}

.row-actions__item,
.row-actions__form button.row-actions__item {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.58rem;
  border: none;
  border-right: 1px solid #e2ebe6;
  background: transparent;
  color: var(--green);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s ease;
}

.row-actions__item:last-child,
.row-actions__form:last-child .row-actions__item {
  border-right: none;
}

.row-actions__item:hover {
  background: #f0f7f3;
  color: var(--green-deep);
}

.row-actions__item--danger {
  color: var(--danger);
}

.row-actions__item--danger:hover {
  background: #fdf0f0;
  color: var(--danger);
}

.row-actions__item--muted {
  color: #9aa8a1;
  cursor: default;
}

.row-actions__item--muted:hover {
  background: transparent;
  color: #9aa8a1;
}

.row-actions__form {
  display: contents;
}

.badge {
  display: inline-block;
  padding: 0.24rem 0.62rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge--regular {
  background: #ecefed;
  color: #4f5c56;
}

.badge--ste {
  background: #dff0e6;
  color: #145c3a;
}

.badge--stem {
  background: #f9efd4;
  color: #7a6118;
}

.badge--status-approved {
  background: #dff0e6;
  color: #145c3a;
}

.badge--status-pending {
  background: #f9efd4;
  color: #7a6118;
}

.badge--status-rejected {
  background: #fde8e8;
  color: #9b2c2c;
}

.badge--incident-submitted {
  background: #eef2ff;
  color: #3730a3;
}
.badge--incident-under_review {
  background: #fef3c7;
  color: #92400e;
}
.badge--incident-investigating {
  background: #ffe4e6;
  color: #9f1239;
}
.badge--incident-resolved {
  background: #dcfce7;
  color: #166534;
}
.badge--incident-closed {
  background: #f3f4f6;
  color: #4b5563;
}
.badge--priority-low {
  background: #f3f4f6;
  color: #4b5563;
}
.badge--priority-medium {
  background: #e0f2fe;
  color: #075985;
}
.badge--priority-high {
  background: #ffedd5;
  color: #9a3412;
}
.badge--priority-urgent {
  background: #fee2e2;
  color: #991b1b;
}

.incident-attachment-img {
  display: block;
  max-width: min(100%, 420px);
  max-height: 320px;
  width: auto;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-top: 0.5rem;
}

.case-update-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.case-update-item {
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.case-update-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.case-update-note {
  color: var(--ink);
}

.journalism-cover {
  margin-bottom: 1rem;
}

.journalism-cover-img {
  display: block;
  max-width: min(100%, 560px);
  max-height: 360px;
  width: auto;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  object-fit: cover;
}

.journalism-cover-img--sm {
  max-width: 280px;
  max-height: 180px;
}

.journalism-cover-img--card {
  width: 100%;
  max-width: 100%;
  max-height: 180px;
  margin-bottom: 0.75rem;
}

.journalism-cover--public {
  margin: 0 0 1.25rem;
}

.journalism-body {
  margin-top: 0.75rem;
}

/* Public news — newspaper-style article */
.news-article {
  max-width: 52rem;
}

.news-article__title {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.6rem);
  line-height: 1.15;
  color: var(--green-deep);
  margin: 0 0 0.5rem;
}

.news-article__byline {
  margin: 0 0 1.35rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.news-article__body {
  overflow: hidden; /* clear floats */
}

.news-article__figure {
  float: left;
  width: min(42%, 300px);
  margin: 0.15rem 1.35rem 0.85rem 0;
  shape-outside: margin-box;
}

.news-article__figure img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 380px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 22px rgba(15, 61, 46, 0.1);
}

.news-article__prose {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--ink);
}

.news-article__prose p {
  margin: 0 0 1rem;
  text-align: justify;
  hyphens: auto;
}

.news-article__prose p:last-child {
  margin-bottom: 0;
}

/* Public news index — image left, copy right */
.news-index {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 52rem;
}

.news-index__card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.1rem;
  align-items: start;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.news-index__thumb {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 4 / 3;
}

.news-index__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.news-index__copy h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.25;
}

.news-index__copy h3 a {
  color: var(--green-deep);
  text-decoration: none;
}

.news-index__copy h3 a:hover {
  text-decoration: underline;
}

.news-index__meta {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.news-index__excerpt {
  margin: 0 0 0.65rem;
  color: var(--ink);
  line-height: 1.55;
}

.news-index__more {
  font-weight: 600;
  color: var(--green);
  text-decoration: none;
}

.news-index__more:hover {
  text-decoration: underline;
}

@media (max-width: 700px) {
  .news-article__figure {
    float: none;
    width: 100%;
    max-width: 100%;
    margin: 0 0 1rem;
  }

  .news-article__figure img {
    max-height: 260px;
    width: 100%;
  }

  .news-article__prose p {
    text-align: left;
  }

  .news-index__card {
    grid-template-columns: 1fr;
  }

  .news-index__thumb {
    max-height: 200px;
  }
}

.badge--muted {
  background: #ecefed;
  color: #6b7280;
  margin-left: 0.35rem;
}

.data-list__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.8rem 1.15rem;
  background: #f8fbf9;
  border-top: 1px solid #dde8e2;
}

.data-list__count {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.data-list__pagination {
  display: flex;
  gap: 0.2rem;
  align-items: center;
  margin-left: auto;
}

.data-list__page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  min-width: 2rem;
  padding: 0 0.65rem;
  border-radius: 8px;
  border: 1px solid #c5d5cb;
  background: #fff;
  color: #3d4f47;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.data-list__page-btn:hover {
  background: #edf5f0;
  border-color: #9bb8a8;
  color: var(--green-deep);
}

.data-list__page-btn.is-current {
  background: var(--green-deep);
  border-color: var(--green-deep);
  color: #fff;
  pointer-events: none;
}

.data-list__page-btn.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.data-list__empty {
  text-align: center;
  padding: 3rem 1.5rem;
}

.data-list__empty-title {
  margin: 0 0 0.35rem;
  font-weight: 700;
  color: var(--ink);
}

.data-list__empty-text {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .data-list__toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .data-list__toolbar-search {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
  }

  .data-list__toolbar-divider {
    display: none;
  }
}

@media (max-width: 640px) {
  .row-actions {
    flex-wrap: wrap;
    max-width: 11rem;
  }

  .row-actions__item {
    border-right: none;
    border-bottom: 1px solid #e2ebe6;
    width: 50%;
    justify-content: center;
  }
}

/* Assign teaching load — form + active loads side by side */
.assign-load-layout {
  display: grid;
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.assign-load-layout--solo {
  grid-template-columns: minmax(300px, 640px);
}

.assign-load-layout__heading {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  color: var(--green-deep);
  font-size: 1.05rem;
}

.assign-load-layout__table-wrap {
  overflow-x: auto;
}

.assign-load-table {
  margin: 0;
}

.assign-load-table__actions {
  text-align: right;
  white-space: nowrap;
}

.assign-load-end-form {
  display: inline;
  margin: 0;
}

@media (max-width: 900px) {
  .assign-load-layout {
    grid-template-columns: 1fr;
  }
}

/* Account approval review — profile left, actions right */
.approval-review-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
  margin-top: 1rem;
}

.approval-review-profile__title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  color: var(--green-deep);
}

.approval-review-profile__status {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.approval-review-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.approval-review-card__title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  color: var(--green-deep);
  font-size: 1.05rem;
}

.approval-review-card__title--danger {
  color: var(--danger);
}

.approval-placement {
  border: 1px dashed rgba(15, 61, 46, 0.18);
  border-radius: 12px;
  padding: 0.85rem 1rem 0.25rem;
  margin: 0 0 1rem;
}

.approval-placement__legend {
  padding: 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--muted);
}

.approval-placement__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--green-deep);
  cursor: pointer;
}

.approval-enroll-now-input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--green);
}

.approval-placement__intro {
  margin: 0 0 0.75rem;
}

.approval-placement__fields[hidden] {
  display: none;
}

.approval-placement .form-field {
  margin-bottom: 0.75rem;
}

.approval-submit-hint {
  margin: 0 0 0.5rem;
  color: var(--muted);
}

.btn-primary:disabled,
.btn-primary[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.field-hint {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
}

.approval-reject-btn {
  margin-top: 0.5rem;
  border-color: var(--danger);
  color: var(--danger);
}

@media (max-width: 960px) {
  .approval-review-layout {
    grid-template-columns: 1fr;
  }
}

/* Legacy list toolbar (subject_list, etc.) */
.list-toolbar {
  margin: 0.75rem 0;
  display: flex;
  gap: 0.75rem;
  align-items: end;
  flex-wrap: wrap;
}

.list-toolbar .field {
  min-width: 10rem;
}

.list-toolbar .field-narrow {
  min-width: 5.5rem;
}

.list-toolbar .field-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  min-width: auto;
}

.list-toolbar label {
  margin-bottom: 0.25rem;
}

.list-toolbar select.form-input {
  margin-bottom: 0;
}

.auth-wrap {
  max-width: 420px;
  margin: 3rem auto;
  padding: 0 1rem;
}

.chat-log {
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.chat-form .form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.chat-input {
  min-height: 4.5rem;
  font-size: 1rem;
}

.bubble {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--border);
}

.bubble.user {
  align-self: flex-end;
  background: #e5f2eb;
}

.bubble.assistant {
  align-self: flex-start;
}

.bubble.assistant.crisis {
  border-color: var(--danger);
  background: #fdf5f5;
}

.session-ended-note {
  border-style: dashed;
  font-size: 0.95rem;
}

.typing-indicator {
  align-self: flex-start;
  opacity: 0.85;
  font-size: 0.9rem;
  color: var(--muted);
}

.htmx-request .typing-indicator,
.htmx-request#typing-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#typing-indicator {
  display: none;
}

.htmx-request#typing-indicator {
  display: flex;
}

.typing-dots span {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 3px;
  border-radius: 50%;
  background: var(--muted);
  animation: typing-bounce 1.2s infinite ease-in-out;
}

.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-4px); opacity: 1; }
}

.mood-picker .mood-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.mood-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
}

.mood-option:has(input:checked) {
  border-color: var(--green);
  background: #e5f2eb;
}

.mood-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mood-emoji {
  font-size: 1.75rem;
}

.mood-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.wellbeing-consent ul {
  margin: 1rem 0 1.25rem;
  padding-left: 1.25rem;
}

.session-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.5rem;
}

.inline-delete-form {
  display: inline;
  margin: 0;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--danger);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
}

.muted-small {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.75rem;
}

.wellbeing-notice {
  margin-bottom: 1rem;
}

.disclaimer {
  font-size: 0.85rem;
  color: var(--muted);
  border-left: 3px solid var(--gold);
  padding-left: 0.75rem;
  margin: 1rem 0;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.stat {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
}

.stat strong {
  display: block;
  font-size: 1.6rem;
  font-family: var(--font-display);
  color: var(--green-deep);
}

.capability-grid ul {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.35rem 1rem;
}

.capability-grid li {
  margin: 0;
}

.capability-grid label {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-weight: 500;
  cursor: pointer;
}

.role-card {
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.role-card:hover {
  border-color: var(--green-mid);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.detail-list {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0.35rem 0.75rem;
  margin: 1rem 0 0;
}

.detail-list dt {
  color: var(--muted);
  font-size: 0.85rem;
}

.detail-list dd {
  margin: 0;
}

/* Learner portal — attendance calendar */
.attendance-calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem 0;
}
.attendance-calendar-nav__label {
  font-size: 1.05rem;
}
.attendance-calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.75rem 1rem;
}
.attendance-calendar {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin: 0 0 1rem;
}
.attendance-calendar th {
  text-align: center;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0.5rem 0.25rem;
  border-bottom: 1px solid var(--border);
}
.attendance-calendar__cell {
  vertical-align: top;
  min-height: 4.5rem;
  height: 5rem;
  border: 1px solid var(--border);
  padding: 0.35rem;
  background: var(--surface);
}
.attendance-calendar__cell.is-empty {
  background: var(--bg-subtle, #f8f9fa);
}
.attendance-calendar__daynum {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.attendance-calendar__marks {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.attendance-calendar__mark {
  display: block;
  font-size: 0.68rem;
  line-height: 1.2;
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
  text-align: center;
  font-weight: 600;
}
.attendance-calendar__mark--P {
  background: #e8f5e9;
  color: #2e7d32;
}
.attendance-calendar__mark--A {
  background: #ffebee;
  color: #c62828;
}
.attendance-calendar__mark--L {
  background: #fff8e1;
  color: #f57f17;
}
.attendance-calendar__mark--E {
  background: #e3f2fd;
  color: #1565c0;
}
.attendance-calendar__empty {
  color: var(--muted);
  font-size: 0.75rem;
}

/* Roll-forward wizard — section picker (Steps 5 & 8) */
.wizard-section-picker {
  margin-bottom: 1rem;
  max-width: 28rem;
}
.wizard-section-picker__label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.wizard-section-picker__select {
  width: 100%;
}
.wizard-section-picker__heading {
  margin: 1rem 0 0.75rem;
  font-size: 1.05rem;
}
.wizard-section-search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}
.wizard-enroll-hits {
  margin: 1rem 0;
  padding: 0;
  list-style: none;
}
.wizard-enroll-hits li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}
.wizard-enroll-hit-form {
  display: inline;
}
.wizard-section-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* --------------------------------------------------------------------------
   Roll-forward wizard — caution theme (orange / amber; once-a-year ops)
   -------------------------------------------------------------------------- */
body.roll-forward-wizard {
  --rf-deep: #7c2d12;
  --rf-mid: #c2410c;
  --rf-accent: #ea580c;
  --rf-amber: #d97706;
  --rf-surface: #fff7ed;
  --rf-surface-2: #ffedd5;
  --rf-border: rgba(124, 45, 18, 0.2);
  --rf-shadow: 0 18px 40px rgba(124, 45, 18, 0.12);

  --green-deep: var(--rf-deep);
  --green: var(--rf-mid);
  --green-mid: var(--rf-accent);
  --border: var(--rf-border);
  --shadow: var(--rf-shadow);

  background:
    radial-gradient(circle at 12% 8%, rgba(234, 88, 12, 0.12), transparent 32%),
    radial-gradient(circle at 88% 0%, rgba(217, 119, 6, 0.14), transparent 34%),
    linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
}

body.roll-forward-wizard .site-header {
  background: rgba(255, 247, 237, 0.92);
  border-bottom: 2px solid var(--rf-accent);
}

body.roll-forward-wizard .dash-side {
  background: linear-gradient(180deg, var(--rf-deep) 0%, #431407 100%);
  border-right: 1px solid rgba(255, 237, 213, 0.08);
}

body.roll-forward-wizard .dash-side-foot .btn-ghost {
  border-color: rgba(255, 237, 213, 0.35);
  color: #ffedd5;
}

body.roll-forward-wizard .dash-side-foot .btn-ghost:hover {
  background: rgba(255, 237, 213, 0.12);
  color: #fff;
}

body.roll-forward-wizard .dash-nav-link.is-active {
  background: rgba(255, 237, 213, 0.14);
  color: #ffedd5 !important;
}

body.roll-forward-wizard .dash-nav-link.is-active::before,
body.roll-forward-wizard .dash-nav-link.is-active::after {
  background: var(--rf-amber);
}

body.roll-forward-wizard .dash-main {
  background: transparent;
}

body.roll-forward-wizard .dash-main h1 {
  color: var(--rf-deep);
}

body.roll-forward-wizard .panel {
  border-color: var(--rf-border);
  box-shadow: var(--rf-shadow);
}

body.roll-forward-wizard .btn-primary {
  background: linear-gradient(135deg, var(--rf-accent) 0%, var(--rf-deep) 100%);
  border-color: var(--rf-deep);
}

body.roll-forward-wizard .btn-primary:hover {
  background: linear-gradient(135deg, #f97316 0%, #9a3412 100%);
}

body.roll-forward-wizard .btn-ghost {
  color: var(--rf-mid);
  border-color: var(--rf-border);
}

body.roll-forward-wizard .btn-ghost:hover {
  background: var(--rf-surface-2);
  color: var(--rf-deep);
}

body.roll-forward-wizard a:not(.btn) {
  color: var(--rf-mid);
}

body.roll-forward-wizard a:not(.btn):hover {
  color: var(--rf-deep);
}

.roll-forward-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(90deg, #ffedd5 0%, #fff7ed 55%, #ffedd5 100%);
  border: 1px solid rgba(234, 88, 12, 0.45);
  border-left: 5px solid var(--rf-accent);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(194, 65, 12, 0.12);
}

.roll-forward-banner__badge {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1;
  color: #fff;
  background: var(--rf-accent);
  border-radius: 50%;
}

.roll-forward-banner__text {
  flex: 1;
  min-width: 12rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #7c2d12;
}

.roll-forward-banner__text strong {
  display: block;
  font-size: 0.98rem;
  margin-bottom: 0.15rem;
}

.roll-forward-banner__exit {
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.roll-forward-wizard__back {
  color: var(--muted);
}

body.roll-forward-wizard .disclaimer {
  color: #9a3412;
}

body.roll-forward-wizard .table th {
  color: var(--rf-deep);
  border-bottom-color: var(--rf-border);
}

body.roll-forward-wizard .form-input:focus {
  border-color: var(--rf-accent);
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.2);
}

body.roll-forward-wizard .wizard-step4-shs-callout {
  border-left: 3px solid var(--rf-accent);
  margin-bottom: 1rem;
}

body.roll-forward-wizard .wizard-step4-table th {
  white-space: nowrap;
}

body.roll-forward-wizard .wizard-step4-apply-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

button.data-list__page-btn {
  cursor: pointer;
  font: inherit;
}

@media (max-width: 800px) {
  body.dash-app {
    overflow: auto;
    height: auto;
  }
  body.dash-app .site-header {
    position: sticky;
    height: auto;
  }
  body.dash-app .dash-layout {
    margin-top: 0;
    height: auto;
    display: block;
  }
  body.dash-app .dash-side {
    position: static;
    width: 100%;
  }
  body.dash-app .dash-main {
    margin-left: 0;
    height: auto;
    overflow: visible;
  }
  .dash-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .dash-side {
    position: static;
    min-height: 0;
    max-height: none;
    border-radius: 0;
  }
  .dash-main {
    margin-left: 0;
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  body.dash-app .nav-inner {
    display: flex;
    padding: 0.75rem 1.25rem;
  }
  body.dash-app .messages {
    position: static;
    left: auto;
    right: auto;
    padding: 0.75rem 1.25rem 0;
  }
  body.dash-app > .site-footer {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
  }
  body.dash-app .dash-main > .site-footer {
    margin: 1.5rem -1.25rem -1.5rem;
  }
  body.dash-app .nav-links li:not(:nth-last-child(-n+2)):not(.nav-reset-item) {
    display: list-item;
  }
  body.dash-app .nav-links .nav-reset-item {
    display: flex;
  }
  .nav-links {
    display: none;
  }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    width: 100%;
  }
}
