:root {
  color-scheme: light;
  --bg: #eef4f3;
  --panel: #ffffff;
  --panel-muted: #f6faf9;
  --text: #182522;
  --muted: #667872;
  --line: #d9e4e1;
  --accent: #14746f;
  --accent-strong: #0b5955;
  --accent-soft: #dff3ef;
  --warm: #f4a261;
  --warm-soft: #fff1df;
  --danger: #b42318;
  --shadow: 0 16px 40px rgba(24, 37, 34, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: white;
  padding: 0 14px;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.link-button {
  width: fit-content;
  min-height: auto;
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 0;
  font-weight: 800;
}

.link-button:hover {
  background: transparent;
  color: var(--accent-strong);
  text-decoration: underline;
}

.forgot-password-button {
  justify-self: end;
  margin-top: -6px;
  font-size: 13px;
}

#login-form button[type="submit"] {
  border-color: rgb(232, 97, 31);
  background: rgb(232, 97, 31);
}

#login-form button[type="submit"]:hover {
  border-color: #c94f12;
  background: #c94f12;
}

.toolbar-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.toolbar-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.toolbar-filter select {
  min-width: 150px;
}

.success-text {
  margin: 0;
  color: #17643a;
  font-size: 14px;
  font-weight: 800;
}

.auth-link-button {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(720px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.login-logo {
  display: block;
  width: min(90px, 50%);
  height: auto;
  margin: 0 auto 14px;
}

.login-header {
  text-align: center;
}

.login-panel h1,
.topbar h1 {
  margin: 4px 0 0;
  font-size: 28px;
  line-height: 1.2;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.form-stack {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.auth-form fieldset {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.auth-form legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
  font-weight: 800;
}

.auth-form legend .material-symbols-rounded,
.register-title .material-symbols-rounded {
  color: var(--accent);
  font-size: 24px;
  vertical-align: -4px;
}

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

.initial-students-list {
  display: grid;
  gap: 12px;
}

.initial-student-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.initial-student-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.initial-student-card header strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.initial-student-card header .material-symbols-rounded {
  color: var(--accent);
  font-size: 22px;
}

.add-student-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  border-color: rgb(232, 97, 31);
  background: rgb(232, 97, 31);
  font-weight: 900;
}

.add-student-button:hover {
  border-color: #c94f12;
  background: #c94f12;
}

.submit-register-button,
.auth-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.submit-register-button .material-symbols-rounded,
.add-student-button .material-symbols-rounded,
.auth-link-button .material-symbols-rounded {
  font-size: 21px;
}

.initial-student-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.initial-student-grid .full {
  grid-column: 1 / -1;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 20px;
}

.auth-tabs button,
.auth-tab-link {
  min-height: 36px;
  border-color: var(--line);
  background: #fff;
  color: var(--text);
  padding: 0 8px;
  text-align: center;
}

.auth-tab-link {
  display: grid;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
}

.auth-tabs button.active {
  border-color: var(--accent);
  background: #e8f2f5;
  color: var(--accent-strong);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--text);
  background: #fff;
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--text);
  background: #fff;
  font: inherit;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(23, 107, 135, 0.22);
  border-color: var(--accent);
}

.readonly-field {
  display: block;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-muted);
  padding: 10px 11px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.error-text {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.app-shell.role-guardian {
  grid-template-columns: minmax(0, 1fr);
}

.app-shell.role-guardian .sidebar,
.app-shell.role-guardian .drawer-toggle,
.app-shell.role-guardian .drawer-backdrop {
  display: none;
}

.sidebar {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
  min-height: 100vh;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfa 100%);
  padding: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #0b5955;
  color: #fff;
  font-weight: 800;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.menu {
  display: grid;
  align-content: start;
  gap: 6px;
}

.menu button,
.secondary-button {
  width: 100%;
  justify-content: flex-start;
  border-color: transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  border-radius: 10px;
  font-weight: 700;
}

.menu button {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 900;
}

svg {
  display: block;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
}

.menu button:hover,
.menu button.active,
.secondary-button:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.content {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 68px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 26px rgba(24, 37, 34, 0.05);
  padding: 10px 12px;
}

.drawer-toggle {
  display: none;
}

.topbar-title {
  min-width: 0;
  flex: 1;
}

.user-chip {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-muted);
  padding: 6px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.portal-card {
  min-width: 0;
}

.full-width {
  grid-column: 1 / -1;
}

.metric-card {
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
}

.metric-card strong {
  display: block;
  margin-top: 12px;
  font-size: 30px;
}

.resource-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(24, 37, 34, 0.05);
}

.guardian-portal {
  align-items: start;
}

#guardian-panel .row-button:not(.danger-button),
#guardian-panel .guardian-settings-form button,
#guardian-new-student-button,
#guardian-refresh-button {
  border-color: rgb(232, 97, 31);
  background: rgb(232, 97, 31);
  color: #fff;
}

#guardian-panel .row-button:not(.danger-button):hover,
#guardian-panel .guardian-settings-form button:hover,
#guardian-new-student-button:hover,
#guardian-refresh-button:hover {
  border-color: #c94f12;
  background: #c94f12;
}

#guardian-new-student-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.refresh-icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  min-height: 40px;
  border-radius: 12px;
  padding: 0;
  font-size: 18px;
  font-weight: 900;
}

.add-icon-button {
  display: grid;
  place-items: center;
  width: 32px;
  min-height: 32px;
  border-radius: 10px;
  padding: 0;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.refresh-icon-button svg,
.add-icon-button svg,
.drawer-toggle svg {
  width: 20px;
  height: 20px;
}

.language-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  min-height: 38px;
  border-color: var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
}

.language-toggle:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.language-toggle strong {
  font-size: 12px;
}

.language-flag {
  display: inline-block;
  width: 24px;
  height: 16px;
  overflow: hidden;
  border: 1px solid rgba(24, 37, 34, 0.18);
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.flag-es {
  background: linear-gradient(to bottom, #c60b1e 0 25%, #ffc400 25% 75%, #c60b1e 75% 100%);
}

.flag-ca {
  background: repeating-linear-gradient(to bottom, #ffd200 0 2px, #ffd200 2px 4px, #d9272e 4px 6px, #d9272e 6px 8px);
}

.guardian-section .table-toolbar {
  align-items: flex-start;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
}

.guardian-section .table-toolbar > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-actions {
  display: flex;
  justify-content: flex-end;
  padding: 10px 12px 0;
}

.section-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0;
  border-radius: 10px;
  background: var(--warm-soft);
  color: #9a5a19;
  font-size: 20px;
  font-weight: 900;
}

.guardian-section h2 {
  font-size: 20px;
}

.guardian-section table {
  min-width: 720px;
}

.guardian-section th {
  background: #eef8f6;
  color: #3d615b;
}

.guardian-section td {
  padding-block: 14px;
}

.guardian-section .row-button {
  min-height: 38px;
  border-radius: 8px;
  font-weight: 700;
}

.guardian-home {
  min-width: 0;
}

.guardian-home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.guardian-home-card {
  position: relative;
  display: flex;
  min-height: 90px;
  align-items: flex-end;
  justify-content: space-between;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background-color: #1f2937;
  background-position: center;
  background-size: cover;
  color: #fff;
  padding: 12px;
  text-align: left;
  box-shadow: 0 14px 28px rgba(24, 37, 34, 0.12);
}

.guardian-home-card::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(24, 37, 34, 0.08), rgba(24, 37, 34, 0.72));
  content: "";
}

.guardian-home-card > * {
  position: relative;
  z-index: 1;
}

.guardian-home-card strong,
.guardian-home-card small {
  display: block;
}

.guardian-home-card strong {
  font-size: 14px;
  line-height: 1.15;
}

.guardian-home-card small {
  max-width: 20ch;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.35;
}

.home-card-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: rgb(232, 97, 31);
}

.home-card-icon svg {
  width: 18px;
  height: 18px;
}

.guardian-home-card.students {
  background-color: #e8611f;
}

.guardian-home-card.activities {
  background-color: #0f766e;
}

.guardian-home-card.enrollments {
  background-color: #2563eb;
}

.guardian-home-card.messages {
  background-color: #7c3aed;
}

.guardian-home-card.settings {
  background-color: #475569;
}

.guardian-home-card.help {
  background-color: #be123c;
}

.guardian-alerts {
  display: grid;
  gap: 10px;
}

.guardian-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #f6c453;
  border-radius: 12px;
  background: #fff7d6;
  padding: 12px 14px;
  color: #6f4b00;
  box-shadow: 0 10px 22px rgba(111, 75, 0, 0.08);
}

.guardian-alert .material-symbols-rounded {
  color: #b45309;
  font-size: 24px;
}

.guardian-alert p {
  margin: 0;
  white-space: pre-wrap;
}

.guardian-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  padding: 14px;
}

.guardian-card,
.empty-card,
.calendar-day {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(24, 37, 34, 0.06);
}

.guardian-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.student-card {
  gap: 10px;
  padding: 12px;
}

.activity-card.is-requested {
  border-color: #f7c56b;
  background: #fff8e6;
}

.activity-card.is-requested.in_progress {
  border-color: #7dd3fc;
  background: #eef8ff;
}

.activity-card.is-requested.active {
  border-color: #86efac;
  background: #eefbf2;
}

.activity-card.is-requested .card-icon {
  background: rgba(255, 255, 255, 0.82);
}

.activity-card .row-button:disabled {
  border-color: #cbd5d1;
  background: #e7ecea;
  color: #66736f;
  cursor: not-allowed;
}

#guardian-panel .activity-toggle-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  min-height: 30px;
  border-color: #2563eb;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 800;
}

#guardian-panel .activity-toggle-button::after {
  content: "+";
  font-size: 14px;
  line-height: 1;
}

#guardian-panel .activity-toggle-button:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
}

#guardian-panel .activity-toggle-button[aria-expanded="true"] {
  border-color: #0f766e;
  background: #0f766e;
}

#guardian-panel .activity-toggle-button[aria-expanded="true"]::after {
  content: "-";
}

#guardian-panel .activity-toggle-button[aria-expanded="true"]:hover {
  border-color: #115e59;
  background: #115e59;
}

.activity-groups-list {
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.activity-group-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  padding: 8px 10px;
}

.activity-group-row.is-requested {
  border-color: #f7c56b;
  background: #fff8e6;
}

.activity-group-row.is-requested.in_progress {
  border-color: #7dd3fc;
  background: #eef8ff;
}

.activity-group-row.is-requested.active {
  border-color: #86efac;
  background: #eefbf2;
}

.activity-group-row h4 {
  margin: 0 0 5px;
  font-size: 14px;
  line-height: 1.2;
}

.activity-group-row .card-meta {
  gap: 5px;
}

.activity-group-row .card-meta span {
  padding: 4px 7px;
  font-size: 12px;
  line-height: 1.2;
}

.activity-group-row .enrollment-info {
  background: #fef3c7;
  color: #713f12;
  font-weight: 800;
}

.activity-group-row .enrollment-info strong {
  color: inherit;
  font-weight: 900;
}

.activity-group-row .row-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.activity-group-row .row-button:disabled {
  border-color: #cbd5d1;
  background: #e7ecea;
  color: #66736f;
  cursor: not-allowed;
}

.guardian-card header,
.guardian-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.guardian-card header > div {
  min-width: 0;
  flex: 1;
}

.guardian-card h3 {
  margin: 0;
  font-size: 17px;
}

.guardian-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.card-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 22px;
  font-weight: 900;
}

.student-card .card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #fff1df;
  color: #c2410c;
  font-size: 20px;
}

.student-card .student-initials {
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.student-heading {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
}

.student-heading h3 {
  flex: 0 1 auto;
}

.student-heading .card-meta {
  flex: 0 0 auto;
  gap: 6px;
}

.student-card .card-meta span {
  padding: 5px 8px;
}

.card-meta .activity-tag {
  border-color: rgba(232, 97, 31, 0.28);
  background: #fff1df;
  color: #9a3412;
  font-weight: 900;
}

.card-meta .activity-tag.is-requested {
  border-color: #eab308;
  background: #fde68a;
  color: #713f12;
}

.card-meta .activity-tag.is-requested.in_progress {
  border-color: #38bdf8;
  background: #bae6fd;
  color: #075985;
}

.card-meta .activity-tag.is-requested.active {
  border-color: #4ade80;
  background: #bbf7d0;
  color: #166534;
}

.student-card footer .row-button {
  min-height: 34px;
}

.card-actions {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
}

.mini-icon-button {
  display: grid;
  place-items: center;
  width: 30px;
  min-height: 30px;
  border-color: var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--accent-strong);
  padding: 0;
  font-size: 16px;
}

.mini-icon-button svg {
  width: 16px;
  height: 16px;
}

.material-symbols-rounded {
  font-family: "Material Symbols Rounded";
  font-weight: 500;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "liga";
}

.material-icon {
  color: currentColor;
}

.card-icon .material-symbols-rounded {
  font-size: 24px;
}

.mini-icon-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.danger-mini {
  color: var(--danger);
}

.danger-mini:hover {
  border-color: #fecaca;
  background: #fee2e2;
}

.info-icon-button {
  display: grid;
  place-items: center;
  align-self: flex-start;
  width: 30px;
  min-height: 30px;
  border-color: #b7dfd5;
  border-radius: 999px;
  background: #fff;
  color: var(--accent-strong);
  padding: 0;
  font-family: Georgia, serif;
  font-size: 16px;
  font-style: italic;
  font-weight: 700;
}

.info-icon-button:hover {
  background: var(--accent-soft);
}

.request-sheet-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.request-sheet-body p {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-muted);
  padding: 12px;
  color: var(--muted);
  font-size: 14px;
}

.student-enrollments {
  display: grid;
  gap: 7px;
  border-top: 1px solid var(--line);
  padding-top: 9px;
}

.student-enrollments div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.student-enrollments span {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-enrollment-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.student-enrollment-title.requested span {
  color: #713f12;
}

.student-enrollment-title.in_progress span {
  color: #075985;
}

.student-enrollment-title.active span {
  color: #166534;
}

.student-enrollment-title.waiting_list span {
  color: #854d0e;
}

.student-enrollment-title.withdrawal_requested span {
  color: #991b1b;
}

.student-enrollment-title.withdrawn span {
  color: #374151;
}

.student-enrollment-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.student-enrollment-icon svg {
  width: 15px;
  height: 15px;
}

.student-enrollment-icon .material-symbols-rounded {
  font-size: 17px;
}

.muted-line {
  color: var(--muted);
  font-size: 13px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-meta span {
  border-radius: 999px;
  background: var(--panel-muted);
  padding: 7px 10px;
  color: var(--muted);
  font-size: 13px;
}

.card-meta .info-badge {
  background: #e0f2fe;
  color: #075985;
  font-weight: 800;
}

.guardian-card .inline-action {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.guardian-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 16px 0;
}

.activity-search {
  padding: 14px 16px 0;
}

.activity-search label {
  max-width: 520px;
}

.activity-search input {
  min-height: 44px;
}

.guardian-tabs button {
  min-height: 38px;
  border-color: var(--line);
  background: #fff;
  color: var(--text);
  font-weight: 800;
}

.guardian-tabs button.active {
  border-color: rgb(232, 97, 31);
  background: rgb(232, 97, 31);
  color: #fff;
}

.status-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 10px;
  background: #eef2f1;
  color: #52625f;
  font-size: 12px;
  font-weight: 900;
}

.status-badge.active {
  background: #dcfce7;
  color: #166534;
}

.status-badge.requested {
  background: #fef3c7;
  color: #713f12;
}

.status-badge.in_progress {
  background: #e0f2fe;
  color: #075985;
}

.status-badge.waiting_list {
  background: #fef3c7;
  color: #854d0e;
}

.status-badge.withdrawal_requested {
  background: #fee2e2;
  color: #991b1b;
}

.status-badge.withdrawn {
  background: #e5e7eb;
  color: #374151;
}

.availability-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
}

.availability-badge.available {
  background: #dcfce7;
  color: #166534;
}

.availability-badge.full {
  background: #fee2e2;
  color: #991b1b;
}

.enrollment-card {
  gap: 8px;
  padding: 10px;
}

.enrollment-card header,
.enrollment-card footer {
  gap: 8px;
}

.enrollment-card .card-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.enrollment-card h3 {
  font-size: 15px;
  line-height: 1.2;
}

.enrollment-card p {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.25;
}

.enrollment-card .card-meta {
  gap: 5px;
}

.enrollment-card .card-meta span,
.enrollment-card .status-badge {
  padding: 4px 7px;
  font-size: 11px;
  line-height: 1.2;
}

.enrollment-card footer {
  justify-content: flex-end;
}

.enrollment-card .row-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.status-stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.status-stepper li {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
}

.status-stepper span {
  height: 5px;
  border-radius: 999px;
  background: var(--line);
}

.status-stepper li.done span {
  background: var(--accent);
}

.enrollment-card .status-stepper {
  gap: 4px;
}

.enrollment-card .status-stepper li {
  gap: 3px;
  font-size: 10px;
}

.enrollment-card .status-stepper span {
  height: 4px;
}

.guardian-calendar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  padding: 10px;
}

.calendar-day {
  padding: 10px;
}

.calendar-day h3 {
  margin: 0 0 6px;
  border-radius: 6px;
  background: #0f766e;
  color: #fff;
  padding: 6px 8px;
  font-size: 14px;
  line-height: 1.2;
}

.calendar-day article {
  display: grid;
  gap: 2px;
  border-top: 1px solid var(--line);
  padding: 7px 0;
}

.calendar-day article strong {
  font-size: 13px;
  line-height: 1.25;
}

.calendar-day span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.empty-card {
  padding: 18px;
  color: var(--muted);
}

.guardian-settings-form {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.settings-tab-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.guardian-settings-form .checkbox-label {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-muted);
  padding: 10px 12px;
}

.guardian-settings-form button {
  justify-self: start;
  min-height: 46px;
}

.guardian-settings-form .guardian-logout-button {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
}

.guardian-settings-form .guardian-logout-button:hover {
  border-color: rgb(232, 97, 31);
  background: #fff1df;
  color: #c2410c;
}

.guardian-bottom-nav {
  display: none;
}

.app-shell.role-guardian .content {
  padding-bottom: 104px;
}

.app-shell.role-guardian .guardian-bottom-nav {
  position: fixed;
  inset: auto 18px 18px;
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  max-width: 720px;
  margin-inline: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  padding: 8px;
}

.guardian-bottom-nav button {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 56px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  padding: 5px 4px;
}

.guardian-bottom-nav button.active {
  background: rgb(232, 97, 31);
  color: #fff;
}

.guardian-bottom-nav span {
  display: grid;
  place-items: center;
  height: 20px;
}

.guardian-bottom-nav svg {
  width: 20px;
  height: 20px;
}

.guardian-bottom-nav strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: grid;
  gap: 10px;
}

.toast {
  width: min(360px, calc(100vw - 28px));
  border: 1px solid #b7dfd5;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 13px 14px;
  color: var(--accent-strong);
  font-weight: 800;
}

.toast.error {
  border-color: #fecaca;
  color: var(--danger);
}

.messages-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  min-height: 560px;
}

.messages-sidebar {
  border-right: 1px solid var(--line);
  background: var(--panel-muted);
}

.message-compose {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.messages-list {
  display: grid;
}

.message-item {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 74px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--text);
  padding: 12px 16px;
  text-align: left;
}

.message-item:hover,
.message-item.active {
  background: #e8f2f5;
  color: var(--text);
}

.message-item strong,
.message-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-item span,
.message-bubble small,
.empty-state {
  color: var(--muted);
  font-size: 13px;
}

.messages-thread {
  min-width: 0;
  display: grid;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 360px;
}

.thread-header {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.thread-header h3 {
  margin: 0;
  font-size: 18px;
}

.thread-body {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 340px;
  max-height: 560px;
  overflow: auto;
  padding: 16px;
  background: #fbfcfd;
}

.message-bubble {
  max-width: min(680px, 82%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.message-bubble.own {
  justify-self: end;
  border-color: #b9d5dc;
  background: #e8f2f5;
}

.message-bubble p {
  margin: 4px 0 0;
  white-space: pre-wrap;
}

.message-reply {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--line);
}

.message-reply textarea {
  min-height: 52px;
}

.activity-info-card {
  overflow: hidden;
}

.activity-info-body {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.activity-info-image,
.activity-info-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-muted);
}

.activity-info-image {
  display: block;
  object-fit: cover;
}

.activity-info-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.activity-info-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.activity-info-list div {
  display: grid;
  gap: 4px;
}

.activity-info-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.activity-info-list dd {
  margin: 0;
  white-space: pre-wrap;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.table-toolbar h2 {
  margin: 0;
  font-size: 18px;
}

.table-wrap {
  width: 100%;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 14px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

td.actions-cell {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.row-button {
  min-height: 32px;
  padding: 0 10px;
}

.table-thumb {
  display: block;
  width: 54px;
  height: 38px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.inline-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.inline-action select {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  font: inherit;
}

.danger-button {
  border-color: #b42318;
  background: #b42318;
}

.danger-button:hover {
  background: #8f1d15;
}

dialog {
  width: min(720px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(23, 32, 42, 0.42);
}

.dialog-card {
  background: var(--panel);
}

.dialog-card header,
.dialog-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.dialog-card footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
}

.dialog-card h2 {
  margin: 0;
  font-size: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
}

.form-grid label.full {
  grid-column: 1 / -1;
}

.form-grid textarea,
.form-grid select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 11px;
  font: inherit;
}

.form-grid textarea {
  min-height: 92px;
  resize: vertical;
}

.guardian-help-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.guardian-help-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.guardian-help-body ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

.guardian-help-body li {
  line-height: 1.45;
}

.checkbox-label,
.permission-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.checkbox-label input,
.permission-check input {
  width: 18px;
  min-height: 18px;
}

.compact,
.icon-button {
  width: auto;
}

.icon-button {
  min-height: 34px;
  padding: 0 11px;
}

th {
  background: var(--panel-muted);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 70;
    width: min(320px, calc(100vw - 42px));
    transform: translateX(-105%);
    transition: transform 180ms ease;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    box-shadow: var(--shadow);
  }

  .drawer-open .sidebar {
    transform: translateX(0);
  }

  .drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 65;
    background: rgba(24, 37, 34, 0.42);
  }

  .drawer-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 40px;
    min-height: 38px;
    padding: 0 10px;
  }

  .content {
    padding-bottom: 96px;
  }

  .guardian-bottom-nav {
    position: fixed;
    inset: auto 10px 10px;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
    padding: 8px;
  }

  .guardian-bottom-nav button {
    display: grid;
    place-items: center;
    gap: 3px;
    min-height: 54px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: var(--muted);
    padding: 5px 2px;
  }

  .guardian-bottom-nav button.active {
    background: rgb(232, 97, 31);
    color: #fff;
  }

  .guardian-bottom-nav span {
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 900;
  }

  .guardian-bottom-nav svg {
    width: 21px;
    height: 21px;
  }

  .guardian-bottom-nav strong {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
    white-space: nowrap;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 540px) {
  .content,
  .sidebar {
    padding: 14px;
  }

  .topbar {
    align-items: center;
    flex-direction: row;
    gap: 8px;
    min-height: 58px;
    padding: 8px;
  }

  .topbar .eyebrow {
    font-size: 10px;
  }

  .dashboard-grid,
  .portal-grid,
  .messages-layout,
  .menu,
  .form-grid,
  .checkbox-grid,
  .initial-student-grid,
  .guardian-settings-form,
  .settings-tab-panel {
    grid-template-columns: 1fr;
  }

  .guardian-settings-form button,
  #guardian-new-student-button {
    width: 100%;
  }

  .guardian-section .table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .guardian-section .table-toolbar > div {
    align-items: flex-start;
  }

  .guardian-section table {
    min-width: 680px;
  }

  .guardian-section .table-wrap {
    display: none;
  }

  .guardian-card-grid {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .guardian-card {
    border-radius: 16px;
  }

  .guardian-card header,
  .guardian-card footer {
    align-items: flex-start;
  }

  .guardian-card .inline-action,
  .guardian-card .inline-action select,
  .guardian-card .inline-action button,
  .guardian-card footer > button {
    width: 100%;
  }

  .activity-group-row {
    grid-template-columns: 1fr;
  }

  .activity-group-row .row-button {
    width: 100%;
  }

  .student-card header {
    align-items: flex-start;
    flex-direction: row;
  }

  dialog {
    width: 100vw;
    max-width: 100vw;
    margin: auto 0 0;
    border-radius: 18px 18px 0 0;
  }

  dialog::backdrop {
    background: rgba(24, 37, 34, 0.48);
  }

  .toast-root {
    right: 12px;
    bottom: 92px;
    left: 12px;
  }

  .toast {
    width: 100%;
  }

  .topbar h1 {
    font-size: 19px;
  }

  .user-chip {
    max-width: 92px;
    padding: 5px 8px;
  }

  .messages-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .message-reply {
    grid-template-columns: 1fr;
  }

  .auth-tabs {
    grid-template-columns: 1fr;
  }
}
