.topbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 25 !important;
  min-height: 83px;
  background-color: rgba(247, 248, 244, 0.98) !important;
  background-image: linear-gradient(rgba(247, 248, 244, 0.98), rgba(247, 248, 244, 0.98)) !important;
  box-shadow: 0 8px 18px rgba(24, 57, 45, 0.09) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  isolation: isolate;
}

.finance-welcome {
  align-items: center;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(115deg, #fff 15%, #f0f7f2 100%);
  box-shadow: var(--shadow);
}

.finance-welcome h1 {
  margin: 2px 0 0;
}

.finance-kicker {
  margin: 0 0 4px !important;
  color: var(--forest-2) !important;
  font-size: 10px !important;
  font-weight: 800;
  letter-spacing: .2px;
}

.finance-overview {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.finance-overview .stat-card {
  min-width: 0;
  min-height: 116px;
  padding: 14px 15px;
}

.finance-overview .stat-value {
  font-size: clamp(17px, 1.5vw, 23px);
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.finance-currency-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  width: 100%;
  direction: rtl;
}

.finance-currency-badge {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 7px;
  max-width: 100%;
  padding: 3px 8px;
  border: 1px solid #e9eeea;
  border-radius: 8px;
  background: #f6f8f6;
  color: var(--ink);
  direction: ltr;
  font-family: 'DM Sans', 'Cairo', sans-serif;
  font-size: .84em;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  white-space: nowrap;
}

.finance-currency-badge > span {
  color: var(--muted);
  font-family: 'Cairo', sans-serif;
  font-size: .78em;
}

.finance-currency-badge.zero {
  border-color: #ecefed;
  background: #f5f6f5;
  color: #929a95;
}

.finance-currency-badge.zero > span {
  color: #929a95;
}

.finance-currency-badge.positive {
  border-color: #d3eadc;
  background: #edf7f0;
  color: #247148;
}

.finance-currency-badge.positive > span {
  color: #4f8062;
}

.finance-currency-badge.negative {
  border-color: #f0d9d9;
  background: #fff1f0;
  color: #b33e3e;
}

.finance-currency-badge.negative > span {
  color: #a75d5d;
}

.finance-overview .stat-value,
.finance-snapshot .stat-value {
  direction: rtl;
  text-align: right;
  font-size: 19px;
  line-height: 1.35;
  overflow-wrap: normal;
}

.finance-net {
  border-color: #cfe5d6;
  background: linear-gradient(145deg, #fff 8%, #edf7f0 100%);
  box-shadow: 0 5px 18px rgba(39, 113, 72, .08);
}

.finance-net .stat-icon {
  color: #247148;
  background: #dff1e5;
}

.finance-net .stat-value {
  display: grid;
  gap: 4px;
}

.finance-collection {
  padding-bottom: 42px !important;
}

.finance-card-link {
  position: absolute;
  right: 15px;
  bottom: 11px;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: var(--forest-2);
  font-size: 10px;
  font-weight: 700;
}

.finance-card-link:hover {
  color: #247148;
  text-decoration: underline;
}

.assistant-floating-root {
  position: fixed;
  z-index: 50;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: max(24px, env(safe-area-inset-left));
  direction: rtl;
}

.assistant-fab {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, #28684f, #174b3a);
  color: #fff;
  box-shadow: 0 9px 25px rgba(23, 63, 53, .3);
  font-size: 27px;
  transition: transform .18s ease, box-shadow .18s ease;
}

.assistant-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(23, 63, 53, .36);
}

.assistant-fab svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
}

.assistant-popup[hidden] {
  display: none;
}

.assistant-popup {
  position: fixed;
  z-index: 50;
  bottom: calc(max(24px, env(safe-area-inset-bottom)) + 74px);
  left: max(24px, env(safe-area-inset-left));
  width: min(420px, calc(100vw - 32px));
  max-height: min(720px, calc(100dvh - 120px));
  animation: assistant-popup-in .2s ease-out;
}

.assistant-popup-card {
  display: flex;
  max-height: min(720px, calc(100dvh - 120px));
  flex-direction: column;
  gap: 11px;
  overflow: auto;
  padding: 15px;
  border-color: #dce9df;
  box-shadow: 0 18px 55px rgba(22, 52, 41, .22);
}

.assistant-popup-card .panel-header {
  margin-bottom: 0;
}

.assistant-popup-card .assistant-chat {
  min-height: 120px;
  max-height: min(36vh, 300px);
}

.assistant-popup-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.assistant-close {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  font-size: 21px;
  line-height: 1;
}

@keyframes assistant-popup-in {
  from { opacity: 0; transform: translateY(9px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.finance-dashboard-lower {
  grid-template-columns: minmax(0, 1.35fr) minmax(270px, .8fr);
  align-items: start;
  margin-top: 16px;
}

.finance-recent-list {
  display: grid;
}

.finance-recent-row,
.finance-quick-stat,
.finance-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.finance-recent-row:last-child,
.finance-quick-stat:last-of-type,
.finance-history-row:last-child {
  border-bottom: 0;
}

.finance-recent-row > span:first-child {
  display: grid;
  gap: 4px;
}

.finance-recent-row small {
  color: var(--muted);
  font-size: 10px;
}

.finance-status {
  padding: 4px 8px;
  border-radius: 99px;
  background: var(--mint-2);
  color: var(--forest-2);
  font-size: 10px;
}

.finance-quick-stat {
  color: var(--muted);
}

.finance-quick-stat b {
  color: var(--forest);
  font-size: 14px;
}

.finance-full-button {
  width: 100%;
  margin-top: 13px;
}

.finance-section {
  margin: 20px 0 28px;
}

.finance-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 0 3px;
}

.finance-section-heading h2 {
  margin: 1px 0 3px;
  color: var(--ink);
  font-size: 18px;
}

.finance-section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.finance-section-count {
  flex: none;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: white;
  color: var(--forest);
  font-size: 11px;
  font-weight: 700;
}

.finance-account-list {
  display: grid;
  gap: 10px;
}

.finance-account-card {
  padding: 0;
  overflow: hidden;
}

.finance-account-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  cursor: pointer;
  list-style: none;
}

.finance-account-card > summary::-webkit-details-marker {
  display: none;
}

.finance-account-card > summary::after {
  content: "⌄";
  flex: none;
  color: var(--muted);
  font-size: 17px;
  transition: transform .15s ease;
}

.finance-account-card[open] > summary::after {
  transform: rotate(180deg);
}

.finance-account-card > summary > span:first-child {
  display: grid;
  gap: 4px;
  min-width: 155px;
}

.finance-account-card > summary b {
  color: var(--ink);
  font-size: 13px;
}

.finance-account-card > summary small {
  color: var(--muted);
  font-size: 10px;
}

.finance-account-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 6px;
}

.finance-balance-chip,
.finance-settled-label {
  padding: 5px 9px;
  border-radius: 99px;
  background: #fff3e8;
  color: #93602d;
  font-size: 10px;
  font-weight: 700;
}

.finance-settled-label {
  background: var(--mint-2);
  color: var(--forest-2);
}

.finance-account-content {
  padding: 4px 18px 18px;
  border-top: 1px solid var(--line);
}

.finance-account-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
}

.finance-account-heading h3,
.finance-account-content h4 {
  margin: 0;
  color: var(--forest);
  font-size: 13px;
}

.finance-account-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.finance-account-content > .family-statement {
  margin-top: 15px;
  box-shadow: none;
}

.finance-monthly-ledger {
  display: grid;
  gap: 7px;
}

.finance-ledger-row {
  display: grid;
  grid-template-columns: minmax(45px, .45fr) repeat(3, minmax(110px, 1fr)) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdfb;
  font-size: 10px;
}

.finance-ledger-row > span:first-child {
  color: var(--forest);
  font-weight: 800;
}

.finance-ledger-row > span:not(:first-child),
.finance-ledger-row > b {
  color: var(--muted);
}

.finance-ledger-row > b {
  color: var(--forest);
  white-space: nowrap;
}

.finance-ledger-row .btn {
  padding: 7px 9px;
  white-space: nowrap;
  font-size: 10px;
}

.finance-payment-history {
  display: grid;
}

.finance-history-row {
  color: var(--muted);
}

@media (max-width: 1050px) {
  .finance-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-ledger-row {
    grid-template-columns: minmax(45px, .5fr) repeat(2, minmax(100px, 1fr));
  }

  .finance-ledger-row > *:nth-child(n + 4) {
    grid-column: auto;
  }
}

@media (max-width: 700px) {
  .finance-welcome {
    align-items: stretch;
    padding: 16px;
  }

  .finance-welcome .welcome-actions {
    flex-wrap: wrap;
  }

  .finance-section-heading,
  .finance-account-heading,
  .finance-account-card > summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .finance-account-card > summary {
    gap: 9px;
    padding: 13px;
  }

  .finance-account-card > summary::after {
    display: none;
  }

  .finance-account-summary {
    justify-content: start;
  }

  .finance-account-content {
    padding: 4px 12px 14px;
  }

  .finance-ledger-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .finance-ledger-row > *:nth-child(n + 4) {
    grid-column: auto;
  }
}

.family-directory-heading {
  align-items: center;
}

.family-split-view {
  display: grid;
  grid-template-columns: minmax(270px, 0.82fr) minmax(0, 1.8fr);
  align-items: start;
  gap: 16px;
  min-width: 0;
}

.family-master-panel,
.family-detail-panel {
  min-width: 0;
  padding: 17px;
}

.family-master-panel {
  position: sticky;
  top: 96px;
}

.family-master-heading {
  display: grid;
  gap: 13px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.family-master-heading > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.family-master-heading h2,
.family-master-heading span,
.family-detail-heading h2,
.family-detail-heading p,
.family-detail-heading > div > span {
  margin: 0;
}

.family-master-heading h2,
.family-detail-heading h2 {
  color: var(--forest);
  font-size: 16px;
}

.family-master-heading > div > span,
.family-detail-heading > div > span {
  color: var(--muted);
  font-size: 10px;
}

.family-master-heading .search-box {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.family-master-heading .search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 11px;
}

.family-master-list {
  display: grid;
  gap: 7px;
  max-height: min(68vh, 760px);
  overflow: auto;
  padding-top: 11px;
}

.family-master-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--ink);
  text-align: right;
  cursor: pointer;
}

.family-master-item:hover,
.family-master-item.active {
  border-color: #dce9df;
  background: #f4f9f5;
}

.family-master-initial,
.family-detail-student .mini-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 12px;
  background: var(--mint-2);
  color: var(--forest);
  font-size: 15px;
  font-weight: 800;
}

.family-master-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.family-master-copy b {
  overflow: hidden;
  color: var(--forest);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-master-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-payment-state {
  padding: 5px 8px;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.family-payment-state.settled {
  background: #e8f5ec;
  color: #287047;
}

.family-payment-state.overdue {
  background: #fff0ed;
  color: #a63e34;
}

.family-detail-panel {
  overflow: hidden;
}

.family-detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 2px 15px;
  border-bottom: 1px solid var(--line);
}

.family-detail-heading > div:first-child {
  display: grid;
  gap: 5px;
}

.family-detail-heading > div:first-child > p {
  color: var(--forest-2);
  font-size: 10px;
  font-weight: 700;
}

.family-detail-heading h2 {
  font-size: 19px;
}

.family-detail-actions,
.family-detail-student-actions,
.family-finance-actions,
.family-contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.family-detail-actions .btn,
.family-detail-student-actions .btn,
.family-finance-actions .btn,
.family-contact-actions .btn {
  font-size: 10px;
}

.family-detail-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 14px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f7faf7;
}

.family-detail-tabs button {
  flex: 0 0 auto;
  padding: 9px 13px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.family-detail-tabs button.active {
  background: #fff;
  color: var(--forest);
  box-shadow: 0 2px 8px rgba(24, 57, 45, 0.1);
}

.family-detail-content {
  min-width: 0;
}

.family-detail-students {
  display: grid;
  gap: 11px;
}

.family-detail-student {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.family-detail-student > header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.family-detail-student > header > span:nth-child(2) {
  display: grid;
  flex: 1;
  gap: 4px;
  min-width: 0;
}

.family-detail-student > header b {
  color: var(--forest);
  font-size: 13px;
}

.family-detail-student > header small {
  color: var(--muted);
  font-size: 10px;
}

.family-detail-student-info {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.family-detail-student-info > span {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  padding: 9px;
  border-radius: 9px;
  background: #f7faf7;
}

.family-detail-student-info small {
  color: var(--muted);
  font-size: 9px;
}

.family-detail-student-info b {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 10px;
}

.family-weekly-schedule {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.family-weekly-schedule span {
  padding: 6px 9px;
  border: 1px solid #dce9df;
  border-radius: 20px;
  background: #f5faf6;
  color: var(--forest);
  font-size: 9px;
}

.family-finance-actions {
  margin: 3px 0 12px;
}

.family-contact-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(120deg, #fff, #f3f9f4);
}

.family-contact-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
  background: var(--mint-2);
  color: var(--forest);
  font-size: 21px;
}

.family-contact-card > div:nth-child(2) {
  display: grid;
  gap: 5px;
}

.family-contact-card h3 {
  margin: 0;
  color: var(--forest);
  font-size: 13px;
}

.family-contact-card b {
  font-size: 12px;
}

.family-contact-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 900px) {
  .family-split-view {
    grid-template-columns: minmax(0, 1fr);
  }

  .family-master-panel {
    position: static;
  }

  .family-master-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 340px;
  }
}

@media (max-width: 600px) {
  .family-directory-heading {
    align-items: stretch;
  }

  .family-directory-heading .toolbar {
    flex-wrap: wrap;
  }

  .family-master-panel,
  .family-detail-panel {
    padding: 12px;
  }

  .family-master-list {
    grid-template-columns: minmax(0, 1fr);
    max-height: 280px;
  }

  .family-detail-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .family-detail-actions,
  .family-finance-actions {
    width: 100%;
  }

  .family-detail-actions .btn,
  .family-finance-actions .btn {
    flex: 1;
  }

  .family-detail-student-info {
    grid-template-columns: minmax(0, 1fr);
  }

  .family-contact-card {
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: start;
  }

  .family-contact-icon {
    width: 40px;
    height: 40px;
  }

  .family-contact-actions {
    grid-column: 1 / -1;
  }

  .family-contact-actions .btn {
    flex: 1;
    text-align: center;
  }
}

.qutof-form-section {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbfdfb;
}

.qutof-form-section[hidden] {
  display: none;
}

.form-field[hidden] {
  display: none !important;
}

.qutof-form-section h3 {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--forest);
  font-size: 13px;
}

.weekly-day-picker,
.work-day-picker {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid #dfe9e2;
  border-radius: 14px;
  background: linear-gradient(145deg, #fbfdfb, #f5f9f6);
}

.weekly-day-picker legend,
.work-day-picker legend {
  padding: 0 7px;
  color: var(--forest);
  font-size: 14px;
  font-weight: 800;
}

.day-picker-hint {
  margin: 0 0 11px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.day-picker-grid {
  display: grid;
  gap: 8px;
}

.weekly-day-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.work-day-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.day-picker-card {
  min-width: 0;
  padding: 9px;
  border: 1px solid #e4ebe6;
  border-radius: 11px;
  background: #fff;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.day-picker-card.is-selected {
  border-color: #9fc3ac;
  background: #f0f8f2;
  box-shadow: 0 2px 7px rgba(23, 63, 53, .06);
}

.day-picker-choice {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 27px;
  margin: 0;
  color: var(--ink);
  cursor: pointer;
}

.weekly-day-picker .day-picker-input {
  position: absolute;
  inset-inline-start: 0;
  top: 50%;
  width: 1px !important;
  height: 1px !important;
  min-width: 1px !important;
  max-width: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  transform: translateY(-50%);
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.day-picker-checkmark {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1.5px solid #b7c7bc;
  border-radius: 6px;
  background: #fff;
  transition: background-color .15s ease, border-color .15s ease;
}

.day-picker-checkmark::after {
  width: 8px;
  height: 5px;
  border-bottom: 2px solid #fff;
  border-left: 2px solid #fff;
  content: "";
  opacity: 0;
  transform: translateY(-1px) rotate(-45deg);
}

.day-picker-input:checked + .day-picker-checkmark {
  border-color: var(--forest-2);
  background: var(--forest-2);
}

.day-picker-input:checked + .day-picker-checkmark::after {
  opacity: 1;
}

.day-picker-input:focus-visible + .day-picker-checkmark {
  outline: 3px solid rgba(36, 88, 72, .2);
  outline-offset: 2px;
}

.day-picker-name {
  min-width: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.day-picker-status {
  padding: 2px 7px;
  border-radius: 99px;
  background: #f1f4f2;
  color: #78867d;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.day-picker-card.is-selected .day-picker-status {
  background: #dcefe1;
  color: #286b45;
}

.day-time-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(95px, 118px);
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid #edf1ee;
  color: var(--muted);
  font-size: 10px;
}

.form-field .day-time-control {
  display: grid;
  margin: 8px 0 0;
}

.day-time-control input[type="time"] {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  direction: ltr;
  text-align: center;
}

.day-time-control input[type="time"]:disabled {
  border-color: #edf1ee;
  background: #f4f6f4;
  color: #a2aca5;
  cursor: not-allowed;
}

.day-picker-card.is-selected .day-time-control {
  border-color: #dce9df;
}

.day-picker-input:disabled + .day-picker-checkmark {
  opacity: .55;
}

@media (max-width: 520px) {
  .weekly-day-picker,
  .work-day-picker {
    padding: 11px;
  }

  .weekly-day-grid {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .work-day-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .day-picker-card {
    padding: 8px;
  }

  .day-time-control {
    grid-template-columns: minmax(0, 1fr) minmax(105px, 130px);
  }
}

.teacher-profile-list {
  display: grid;
  gap: 14px;
}

.teacher-profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 12px;
}

.teacher-profile-stats b {
  color: var(--forest);
}

.teacher-profile-card h3 {
  margin: 15px 0 8px;
  font-size: 13px;
}

.teacher-profile-students {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.teacher-profile-students span {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--mint-2);
  font-size: 11px;
}

.calendar-panel {
  overflow: hidden;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.calendar-toolbar h2 {
  min-width: 180px;
  margin: 0;
  text-align: center;
  font-size: 14px;
}

.weekly-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(155px, 1fr));
  gap: 9px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.calendar-day {
  min-height: 260px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdfb;
}

.calendar-day > header {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  margin-bottom: 9px;
  font-size: 11px;
}

.calendar-day > header span {
  color: var(--muted);
}

.calendar-add {
  width: 100%;
  margin-bottom: 8px;
  padding: 6px;
  border: 1px dashed #b7d3c1;
  border-radius: 8px;
  background: white;
  color: var(--forest);
  font-size: 10px;
  font-weight: 700;
}

.calendar-event {
  display: grid;
  gap: 5px;
  margin: 6px 0;
  padding: 8px;
  border-right: 3px solid var(--forest-2);
  border-radius: 8px;
  background: white;
  box-shadow: 0 2px 8px rgba(24, 57, 45, 0.05);
  font-size: 10px;
}

.calendar-event b {
  color: var(--forest);
}

.calendar-event span {
  color: var(--muted);
}

.calendar-event a {
  color: var(--forest-2);
  overflow-wrap: anywhere;
}

.recurring-event {
  border-right-color: var(--orange);
  background: #fffaf4;
}

.calendar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.calendar-empty {
  padding: 10px 2px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.qutof-notification-panel {
  position: fixed;
  z-index: 100;
  top: 76px;
  left: 25px;
  width: min(430px, calc(100vw - 28px));
  max-height: min(75vh, 620px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
  box-shadow: 0 18px 55px rgba(18, 49, 39, 0.2);
}

.qutof-notification-heading,
.qutof-notification-heading > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.qutof-notification-heading {
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.qutof-notification-heading > div {
  flex-wrap: wrap;
}

.qutof-notification-item {
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
}

.qutof-notification-item p {
  margin: 0 0 5px;
  font-size: 12px;
}

.qutof-notification-item small {
  color: var(--muted);
  font-size: 10px;
}

.qutof-notification-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.qutof-notification-footer button {
  padding: 2px 0;
  font-size: 10px;
}

.lesson-reminder-banner {
  position: fixed;
  z-index: 1200;
  top: 18px;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(620px, calc(100vw - 28px));
  padding: 13px 16px;
  border: 1px solid #b8d9c3;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 12px 36px rgba(23, 63, 53, .2);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -16px);
  transition: opacity .2s ease, transform .2s ease;
}

.lesson-reminder-banner.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.lesson-reminder-banner::before {
  width: 5px;
  align-self: stretch;
  border-radius: 999px;
  background: #397b56;
  content: '';
}

.lesson-reminder-banner > p {
  flex: 1;
  margin: 0;
  color: #244a37;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.7;
}

.lesson-reminder-controls {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
}

.lesson-reminder-controls button {
  border: 0;
  background: transparent;
  color: #426653;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  white-space: nowrap;
}

.lesson-reminder-close {
  font-size: 20px !important;
  line-height: 1;
}

.supervisor-teacher-assignments {
  display: grid;
  grid-column: 1 / -1;
  gap: 7px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, #f8fbf9, #f2f7f4);
}

.supervisor-teacher-assignments > label:first-child {
  margin: 0;
  color: var(--forest);
  font-size: 13px;
  font-weight: 700;
}

.supervisor-teacher-assignments > small {
  margin: 0 0 5px;
  color: var(--muted);
  line-height: 1.7;
}

.form-field.supervisor-teacher-assignments label.supervisor-teacher-option {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 8px 11px;
  border: 1px solid #e5ece7;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}

.form-field.supervisor-teacher-assignments label.supervisor-teacher-option:hover {
  border-color: #b9d5c4;
  background: #f5faf6;
}

.form-field.supervisor-teacher-assignments label.supervisor-teacher-option:has(input:checked) {
  border-color: #a9cbb5;
  background: #edf6ef;
  color: var(--forest);
  font-weight: 700;
}

.form-field.supervisor-teacher-assignments .supervisor-teacher-option input {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--forest);
}

.supervisor-teacher-assignments .muted {
  padding: 10px;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
}

.custom-currency-panel {
  margin-top: 16px;
}

.custom-currency-form {
  display: grid;
  grid-template-columns: minmax(120px, .7fr) minmax(180px, 1.3fr) auto;
  align-items: end;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f8fbf9;
}

.custom-currency-form .form-field {
  margin: 0;
}

.custom-currency-submit {
  padding-bottom: 2px;
}

.custom-currency-list {
  display: grid;
  gap: 4px;
  margin-top: 12px;
}

.custom-currency-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}

.custom-currency-row > div {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.custom-currency-row small {
  color: var(--muted);
}

.currency-symbol-preview {
  color: var(--forest-2);
  font-weight: 700;
}

.custom-currency-row button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.qutof-assistant-panel {
  max-width: 900px;
  margin: 0 auto;
}

.assistant-privacy-note {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--mint-2);
  color: var(--forest);
  font-size: 11px;
}

.assistant-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0;
}

.assistant-suggestions button {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: white;
  color: var(--forest);
  font-size: 10px;
}

.assistant-chat {
  display: grid;
  gap: 9px;
  min-height: 180px;
  max-height: 52vh;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbf9;
}

.assistant-message {
  width: fit-content;
  max-width: min(90%, 720px);
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.assistant-question {
  justify-self: end;
  background: var(--forest);
  color: white;
}

.assistant-reply {
  justify-self: start;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.assistant-input-row {
  display: flex;
  gap: 8px;
  margin-top: 11px;
}

.assistant-input-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.dashboard-assistant {
  max-width: 1100px;
  margin: 18px auto 0;
}

.dashboard-assistant .assistant-chat {
  min-height: 100px;
  max-height: 300px;
}

.assistant-local-badge {
  flex: none;
  padding: 5px 9px;
  border-radius: 99px;
  background: var(--mint-2);
  color: var(--forest-2);
  font-size: 10px;
  font-weight: 700;
}

.family-directory-tools {
  margin-bottom: 12px;
}

.family-directory-tools .search-box {
  width: min(100%, 560px);
}

.family-directory-tools input {
  width: 100%;
}

.family-card-overview {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.family-card-overview span {
  padding: 5px 9px;
  border-radius: 99px;
  background: #fff;
  color: var(--forest);
  font-size: 10px;
  font-weight: 700;
}

.family-student-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.family-student-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(190px, 1.4fr) auto;
  align-items: center;
  gap: 8px 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfdfb;
}

.family-student-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.family-student-identity > span:last-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.family-student-identity b {
  font-size: 11px;
}

.family-student-identity small,
.family-student-schedule {
  color: var(--muted);
  font-size: 9px;
}

.family-student-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  color: var(--muted);
  font-size: 9px;
}

.family-student-schedule {
  grid-column: 1 / -1;
}

[data-family-card][hidden] {
  display: none !important;
}

.report-page-heading {
  align-items: end;
  gap: 14px;
  margin: 25px 0 15px;
}

.report-page-heading h1 {
  margin: 0;
  font-size: 21px;
}

.report-period-field {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
}

.report-period-field input {
  min-height: 38px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--ink);
}

.report-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.report-summary-grid .stat-card {
  min-height: 110px;
}

.report-finance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 13px;
}

.report-finance-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
  box-shadow: var(--shadow);
}

.report-finance-card span {
  color: var(--muted);
  font-size: 10px;
}

.report-finance-card b {
  color: var(--forest);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.report-section {
  margin: 20px 0;
}

.report-section-heading {
  margin: 0 0 10px;
}

.report-section-heading h2 {
  margin: 0 0 3px;
  color: var(--ink);
  font-size: 15px;
}

.report-section-heading p,
.report-disclaimer {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.finance-page-heading {
  align-items: center;
  gap: 14px;
}

.finance-page-heading > div:first-child {
  min-width: 0;
}

.finance-page-heading h1 {
  margin: 0 0 5px;
}

.finance-page-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.finance-period-control {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
}

.finance-period-picker {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
}

.finance-period-picker input {
  min-width: 145px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.finance-snapshot {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
  margin: 16px 0 12px;
}

.finance-snapshot .stat-card {
  min-width: 0;
  min-height: 113px;
  padding: 13px 14px;
}

.finance-snapshot .stat-value {
  overflow-wrap: anywhere;
  font-size: clamp(15px, 1.35vw, 21px);
  line-height: 1.55;
}

.finance-snapshot .stat-sub {
  color: var(--muted);
  font-size: 10px;
}

.finance-snapshot .finance-net {
  min-width: 0;
}

.finance-arrears {
  border-color: #f0d8c0;
  background: linear-gradient(140deg, #fff, #fff8f0);
}

.finance-arrears .stat-value,
.finance-arrears .stat-icon {
  color: #a95732;
}

.finance-export-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.finance-ledgers {
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

.finance-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 12px 0;
  border-bottom: 1px solid var(--line);
  background: #fbfdfb;
}

.finance-tabs button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 13px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.finance-tabs button.active {
  border-bottom-color: var(--forest-2);
  color: var(--forest);
}

.finance-tabs button span,
.finance-ledger-intro > span {
  padding: 3px 8px;
  border-radius: 99px;
  background: var(--mint-2);
  color: var(--forest);
  font-size: 10px;
  font-weight: 700;
}

.finance-ledger-tab-content {
  padding: 15px;
}

.finance-ledger-tab-content[hidden] {
  display: none !important;
}

.finance-ledger-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.finance-ledger-intro h2 {
  margin: 0 0 4px;
  color: var(--forest);
  font-size: 15px;
}

.finance-ledger-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.finance-filter-row {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 9px;
  margin: 11px 0;
}

.finance-filter-row label {
  display: grid;
  gap: 5px;
  min-width: 145px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.finance-filter-row .finance-filter-search {
  flex: 1 1 220px;
}

.finance-filter-row input,
.finance-filter-row select {
  width: 100%;
  min-width: 0;
  min-height: 37px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 11px;
}

.finance-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.finance-ledger-table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
}

.finance-payroll-table {
  min-width: 1120px;
}

.finance-ledger-table th,
.finance-ledger-table td {
  padding: 11px 10px;
  border-bottom: 1px solid #e8eee9;
  text-align: right;
  vertical-align: middle;
  font-size: 10px;
}

.finance-ledger-table th {
  background: #f5f9f6;
  color: var(--forest);
  font-weight: 800;
  white-space: nowrap;
}

.finance-ledger-table tbody tr:last-child td {
  border-bottom: 0;
}

.finance-ledger-table tbody tr:hover {
  background: #fbfdfb;
}

.finance-ledger-table [hidden] {
  display: none !important;
}

.finance-ledger-table td > b,
.finance-ledger-table td > span:not(.finance-status-badge),
.finance-payroll-amounts {
  display: block;
}

.finance-ledger-table .student-sub {
  max-width: 310px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.finance-status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 230px;
  padding: 5px 8px;
  border-radius: 99px;
  background: #f1f4f2;
  color: #66746b;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.5;
}

.finance-status-badge.settled,
.finance-status-badge.paid {
  background: #e7f5e9;
  color: #286b45;
}

.finance-status-badge.due,
.finance-status-badge.pending {
  background: #fff0e6;
  color: #9a4e29;
}

.finance-status-badge.trial {
  background: #edf2ff;
  color: #425e9b;
}

.finance-status-badge.approved {
  background: #e9f3fa;
  color: #34617a;
}

.finance-row-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 140px;
}

.finance-row-actions .btn {
  white-space: nowrap;
}

.finance-whatsapp-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid #b9ddc1;
  border-radius: 8px;
  background: #f1faf2;
  color: #256b3a;
  font-size: 9px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.finance-payroll-amounts {
  display: grid;
  gap: 4px;
  min-width: 145px;
}

.finance-payroll-amounts > span {
  color: var(--forest);
  font-weight: 800;
}

.finance-payroll-amounts small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

@media (max-width: 1050px) {
  .finance-snapshot {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .finance-page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .finance-period-control {
    align-self: flex-start;
  }

  .finance-period-picker input {
    min-width: 135px;
  }

  .finance-overview .stat-value,
  .finance-snapshot .stat-value {
    font-size: 17px;
  }

  .assistant-floating-root {
    bottom: max(16px, env(safe-area-inset-bottom));
    left: max(16px, env(safe-area-inset-left));
  }

  .assistant-popup {
    bottom: calc(max(16px, env(safe-area-inset-bottom)) + 68px);
    left: 16px;
    width: min(420px, calc(100vw - 32px));
    max-height: calc(100dvh - 104px);
  }

  .assistant-popup-card {
    max-height: calc(100dvh - 104px);
  }

  .assistant-fab {
    width: 54px;
    height: 54px;
  }

  .finance-snapshot {
    gap: 8px;
  }

  .finance-snapshot .stat-card {
    min-height: 104px;
    padding: 11px;
  }

  .finance-snapshot .stat-value {
    font-size: 15px;
  }

  .finance-tabs {
    padding-right: 7px;
    padding-left: 7px;
  }

  .finance-tabs button {
    flex: 1;
    justify-content: center;
    gap: 5px;
    padding-right: 6px;
    padding-left: 6px;
    font-size: 9px;
  }

  .finance-ledger-tab-content {
    padding: 11px;
  }

  .finance-ledger-intro {
    align-items: flex-start;
  }

  .finance-export-actions .btn {
    flex: 1 1 160px;
    font-size: 10px;
  }
}

@media print {
  .finance-export-actions,
  .finance-tabs,
  .finance-filter-row,
  .finance-row-actions,
  .finance-period-control {
    display: none !important;
  }
}

.schedule-page-heading {
  align-items: center;
  gap: 14px;
}

.schedule-page-heading h1 {
  margin: 0 0 5px;
}

.schedule-page-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.schedule-primary-action {
  flex: none;
  background: #164e3f;
}

.schedule-calendar-panel {
  min-width: 0;
  padding: 14px;
}

.schedule-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.schedule-date-navigation,
.schedule-view-switcher {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.schedule-date-navigation h2 {
  min-width: 220px;
  margin: 0;
  color: var(--forest);
  font-size: 14px;
  text-align: center;
}

.schedule-date-navigation .btn {
  min-width: 36px;
  padding: 7px 10px;
}

.schedule-view-switcher {
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f5f8f5;
}

.schedule-view-switcher button {
  min-height: 34px;
  padding: 6px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.schedule-view-switcher button.active {
  background: #164e3f;
  color: #fff;
  box-shadow: 0 2px 6px rgba(22, 78, 63, .15);
}

.schedule-filter-row {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  margin: 13px 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fafcfb;
}

.schedule-filter-row label {
  display: grid;
  gap: 5px;
  min-width: 180px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.schedule-filter-row select {
  min-height: 36px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 11px;
}

.schedule-timezone-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-inline-start: auto;
  padding: 6px 10px;
  border: 1px solid #d6e8da;
  border-radius: 99px;
  background: #eef7f0;
  color: #245848;
  font-size: 10px;
  font-weight: 800;
}

.schedule-grid-scroll {
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 8px;
}

.schedule-time-grid {
  display: grid;
  grid-template-columns: 58px repeat(var(--schedule-column-count), minmax(150px, 1fr));
  min-width: max(100%, calc(58px + var(--schedule-column-count) * 150px));
  direction: rtl;
}

.schedule-time-axis,
.schedule-day-column {
  min-width: 0;
}

.schedule-time-axis > header,
.schedule-day-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 48px;
  border-bottom: 1px solid var(--line);
  color: var(--forest);
  font-size: 10px;
  font-weight: 800;
}

.schedule-day-heading {
  position: relative;
  flex-direction: column;
  gap: 1px;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: #fafcfb;
}

.schedule-day-heading span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.schedule-day-column.is-today .schedule-day-heading {
  background: #edf7f0;
  box-shadow: inset 0 3px #6aa881;
}

.schedule-day-heading button {
  position: absolute;
  inset-inline-end: 5px;
  width: 25px;
  height: 25px;
  border: 1px solid #d9e9de;
  border-radius: 7px;
  background: #fff;
  color: var(--forest);
  font-size: 15px;
  cursor: pointer;
}

.schedule-hour-labels {
  position: relative;
  height: 1440px;
  overflow: visible;
  border-left: 1px solid var(--line);
  color: var(--muted);
  direction: ltr;
  font-size: 9px;
  text-align: center;
}

.schedule-hour-labels > span {
  display: block;
  height: 60px;
  padding-top: 2px;
  border-top: 1px solid #e9efeb;
}

.schedule-hour-labels::after {
  position: absolute;
  right: 0;
  bottom: -9px;
  left: 0;
  content: "24:00";
  color: var(--muted);
  font-size: 9px;
}

.schedule-day-track {
  position: relative;
  height: 1440px;
  overflow: hidden;
  border: 1px solid #e9efeb;
  border-top: 0;
  background-color: #fff;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 29px, #f0f3f1 29px, #f0f3f1 30px), repeating-linear-gradient(to bottom, transparent 0, transparent 59px, #e3ebe5 59px, #e3ebe5 60px);
}

.schedule-day-column.is-today .schedule-day-track {
  background-color: #fcfefc;
}

.schedule-empty-slot {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 30px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  cursor: crosshair;
}

.schedule-empty-slot:not(:disabled):hover,
.schedule-empty-slot:not(:disabled):focus-visible {
  border-color: #cfe1d3;
  outline: 0;
  background: rgba(226, 242, 231, .56);
}

.schedule-empty-slot:disabled {
  cursor: default;
}

.schedule-session-card {
  position: absolute;
  z-index: 3;
  top: var(--session-top);
  right: calc(var(--session-right, 0%) + 4px);
  left: auto;
  width: calc(var(--session-width, 100%) - 8px);
  display: grid;
  align-content: start;
  gap: 2px;
  min-height: 54px;
  height: max(44px, var(--session-height));
  overflow: visible;
  padding: 5px 7px;
  border: 1px solid #c9e1d0;
  border-right: 3px solid #25804f;
  border-radius: 8px;
  background: #f0f8f2;
  box-shadow: 0 2px 5px rgba(22, 78, 63, .08);
  color: var(--ink);
  font-size: 9px;
  line-height: 1.4;
}

.schedule-session-card.track-noor-bayan {
  border-color: #d6d7f4;
  border-right-color: #6464b4;
  background: #f4f3ff;
}

.schedule-session-card.track-arabic {
  border-color: #d8dff4;
  border-right-color: #566fbd;
  background: #f3f6ff;
}

.schedule-session-card.track-islamic {
  border-color: #f0ddbb;
  border-right-color: #c88c2e;
  background: #fff9ed;
}

.schedule-session-card.track-other {
  border-color: #d9e3dd;
  border-right-color: #668377;
  background: #f5f8f6;
}

.schedule-session-card.is-single {
  border-top-style: dashed;
}

.schedule-session-time {
  overflow: hidden;
  color: var(--forest);
  font-size: 8px;
  font-weight: 800;
  direction: ltr;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-session-time span {
  color: var(--muted);
  font-weight: 600;
}

.schedule-session-student {
  overflow: hidden;
  color: var(--ink);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-session-family,
.schedule-session-teacher {
  overflow: hidden;
  color: #65736a;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-track-badge,
.schedule-kind-badge {
  width: fit-content;
  max-width: 100%;
  padding: 1px 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .8);
  color: var(--forest);
  font-size: 7px;
  white-space: nowrap;
}

.schedule-session-card.is-compact .schedule-track-badge {
  display: none;
}

.schedule-kind-badge {
  color: #758078;
}

.schedule-session-actions {
  position: absolute;
  z-index: 8;
  top: calc(100% - 5px);
  right: 0;
  display: none;
  flex-wrap: wrap;
  gap: 4px;
  width: max-content;
  max-width: min(230px, 80vw);
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(24, 57, 45, .16);
}

.schedule-session-card:hover .schedule-session-actions,
.schedule-session-card:focus-within .schedule-session-actions,
.schedule-timeline-item .schedule-session-actions {
  display: flex;
}

.schedule-session-actions button,
.schedule-session-actions a,
.schedule-timeline-item > button {
  padding: 4px 6px;
  border: 1px solid #e1e9e3;
  border-radius: 6px;
  background: #fff;
  color: var(--forest);
  font: inherit;
  font-size: 8px;
  text-decoration: none;
  cursor: pointer;
}

.schedule-session-actions .danger-link,
.schedule-timeline-item .danger-link {
  color: #a33122;
}

@media (max-width: 700px) {
  .custom-currency-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .custom-currency-submit .btn {
    width: 100%;
  }
}

.schedule-session-card.has-conflict,
.schedule-timeline-item.has-conflict {
  border-color: #da7770;
  border-right-color: #bd4038;
  background-image: repeating-linear-gradient(135deg, rgba(202, 67, 59, .13) 0, rgba(202, 67, 59, .13) 6px, rgba(255, 247, 246, .88) 6px, rgba(255, 247, 246, .88) 12px);
}

.schedule-conflict-warning {
  width: fit-content;
  padding: 2px 5px;
  border-radius: 5px;
  background: #a33122;
  color: white;
  font-size: 7px;
  font-weight: 800;
}

.schedule-now-line {
  position: absolute;
  z-index: 5;
  right: 0;
  left: 0;
  height: 0;
  border-top: 2px solid #d63838;
  pointer-events: none;
}

.schedule-now-line > span {
  position: absolute;
  top: -10px;
  right: 2px;
  padding: 1px 5px;
  border-radius: 5px;
  background: #c83232;
  color: white;
  font-size: 8px;
  font-weight: 800;
}

.schedule-now-line[hidden] {
  display: none;
}

.schedule-teacher-timeline {
  display: grid;
  gap: 12px;
}

.schedule-teacher-lane {
  display: grid;
  grid-template-columns: minmax(155px, .35fr) minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfdfb;
}

.schedule-teacher-lane > header {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
  padding: 7px;
}

.schedule-teacher-lane > header > div {
  display: grid;
  gap: 4px;
}

.schedule-teacher-lane > header b {
  color: var(--forest);
  font-size: 11px;
}

.schedule-teacher-lane > header small {
  color: var(--muted);
  font-size: 9px;
}

.schedule-teacher-lane-events {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  min-width: 0;
}

.schedule-timeline-item {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  padding: 9px;
  border: 1px solid #c9e1d0;
  border-right: 3px solid #25804f;
  border-radius: 9px;
  background: #f0f8f2;
  font-size: 9px;
}

.schedule-timeline-item.track-noor-bayan {
  border-color: #d6d7f4;
  border-right-color: #6464b4;
  background-color: #f4f3ff;
}

.schedule-timeline-item.track-arabic {
  border-color: #d8dff4;
  border-right-color: #566fbd;
  background-color: #f3f6ff;
}

.schedule-timeline-item.track-islamic {
  border-color: #f0ddbb;
  border-right-color: #c88c2e;
  background-color: #fff9ed;
}

.guardian-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 16px 20px;
}

.guardian-section {
  margin-top: 16px;
}

.guardian-section > .section-heading {
  margin-bottom: 9px;
}

.guardian-section > .section-heading h2 {
  margin: 0;
  color: var(--forest);
  font-size: 15px;
}

.guardian-child-card {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
  padding: 14px;
}

.guardian-child-heading {
  display: block;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.guardian-request-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.guardian-child-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.guardian-child-heading h2 {
  margin: 0;
  color: var(--forest);
  font-size: 16px;
}

.guardian-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.guardian-badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 8px;
  border: 1px solid #dce9df;
  border-radius: 999px;
  background: #f3f8f4;
  color: #355b45;
  font-size: 10px;
  font-weight: 700;
}

.guardian-badge.is-muted {
  border-color: #e5e9e6;
  background: #f6f7f6;
  color: #78837b;
}

.guardian-progress {
  display: grid;
  gap: 6px;
  padding: 9px 10px;
  border: 1px solid #e5eee7;
  border-radius: 10px;
  background: #fbfdfb;
}

.guardian-progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.guardian-progress-label b {
  color: var(--forest);
}

.guardian-progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eee9;
}

.guardian-progress-track > span {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #83b394, #2c7155);
  transition: width .2s ease;
}

.guardian-child-teachers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.guardian-child-teachers b {
  color: #33473d;
}

.guardian-assignment-pending,
.guardian-empty-note {
  color: #77837a;
  font-size: 10px;
}

.guardian-child-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 8px;
  padding: 10px 0;
}

.guardian-child-details > div {
  display: grid;
  align-content: start;
  gap: 5px;
}

.guardian-child-details b {
  color: #33473d;
  font-size: 11px;
}

.guardian-schedule,
.guardian-child-lessons {
  margin-top: 2px;
}

.guardian-schedule h3,
.guardian-child-lessons h3,
.guardian-finance-panel h3 {
  margin: 0 0 7px;
  color: var(--forest);
  font-size: 12px;
}

.guardian-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.guardian-chip {
  padding: 4px 9px;
  border: 1px solid #dce9df;
  border-radius: 999px;
  background: #f4f8f5;
  color: #355b45;
  font-size: 10px;
  line-height: 1.4;
}

.guardian-child-lessons .table-wrap {
  margin-top: 0;
}

.guardian-child-lessons .data-table {
  min-width: 620px;
}

.guardian-child-lessons .data-table td {
  vertical-align: middle;
}

.guardian-report-link {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.guardian-header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.guardian-header-actions .btn {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 10px;
}

.guardian-next-session {
  display: block;
  padding: 15px 18px;
  border-color: #cfe5d6;
  background: linear-gradient(115deg, #fff 10%, #edf7f0 100%);
  box-shadow: 0 5px 18px rgba(39, 113, 72, .08);
}

.guardian-next-copy {
  display: grid;
  gap: 3px;
}

.guardian-next-copy h2,
.guardian-next-copy p {
  margin: 0;
}

.guardian-next-copy h2,
.guardian-next-copy > strong {
  color: var(--forest);
  font-size: 13px;
}

.guardian-next-copy > p:not(.finance-kicker),
.guardian-next-empty span {
  color: var(--muted);
  font-size: 10px;
}

.guardian-next-empty > div {
  display: grid;
  gap: 3px;
}

.guardian-next-empty b {
  color: var(--forest);
  font-size: 13px;
}

.guardian-finance-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.guardian-balance-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 9px;
}

.guardian-finance-panel .table-wrap + h3 {
  margin-top: 8px;
}

.guardian-report-modal {
  max-width: 640px;
}

.guardian-report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.guardian-report-meta span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f6f2;
  color: #52675a;
  font-size: 10px;
}

.guardian-report-content {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdfb;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

@media (max-width: 560px) {
  .lesson-reminder-banner {
    top: 10px;
    align-items: flex-start;
    gap: 9px;
    padding: 11px;
  }

  .lesson-reminder-banner > p {
    font-size: 11px;
  }

  .lesson-reminder-controls {
    align-items: flex-end;
    flex-direction: column-reverse;
    gap: 4px;
  }
}

@media (max-width: 700px) {
  .guardian-welcome {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
  }

  .guardian-header-actions {
    width: 100%;
  }

  .guardian-header-actions .btn {
    justify-content: center;
    text-align: center;
  }

  .guardian-child-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .guardian-child-card {
    padding: 12px;
  }

  .guardian-progress-label {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
}

.schedule-timeline-item time {
  color: var(--forest);
  font-size: 9px;
  font-weight: 800;
}

.schedule-timeline-item > span,
.schedule-timeline-item > small,
.schedule-timeline-item > a {
  color: var(--muted);
  font-size: 9px;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .schedule-page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .schedule-primary-action {
    width: 100%;
  }

  .schedule-calendar-panel {
    padding: 10px;
  }

  .schedule-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .schedule-date-navigation {
    justify-content: space-between;
  }

  .schedule-date-navigation h2 {
    min-width: 0;
    flex: 1;
    font-size: 11px;
  }

  .schedule-view-switcher {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .schedule-view-switcher button {
    padding: 5px;
    font-size: 8px;
  }

  .schedule-filter-row {
    align-items: stretch;
  }

  .schedule-filter-row label {
    flex: 1 1 135px;
    min-width: 0;
  }

  .schedule-timezone-badge {
    margin-inline-start: 0;
  }

  .schedule-time-grid {
    grid-template-columns: 43px repeat(var(--schedule-column-count), minmax(135px, 1fr));
    min-width: max(100%, calc(43px + var(--schedule-column-count) * 135px));
  }

  .schedule-day-heading {
    font-size: 9px;
  }

  .schedule-session-card {
    right: calc(var(--session-right, 0%) + 2px);
    left: auto;
    width: calc(var(--session-width, 100%) - 4px);
    padding: 4px;
  }

  .schedule-session-actions {
    display: flex;
  }

  .schedule-teacher-lane {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }
}

.report-status-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.report-status-grid article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  font-size: 10px;
}

.report-status-grid span {
  color: var(--muted);
}

.report-status-grid b {
  color: var(--forest);
  font-size: 16px;
}

.report-table-panel {
  padding: 8px 12px;
}

.report-table-panel .data-table {
  min-width: 730px;
  white-space: normal;
}

.report-table-panel .data-table td {
  vertical-align: top;
  line-height: 1.65;
}

.report-disclaimer {
  margin: 12px 0 24px;
}

.weekly-schedule-rows {
  display: grid;
  gap: 9px;
}

.weekly-schedule-row {
  display: grid;
  grid-template-columns: auto minmax(100px, 1fr) auto minmax(100px, 1fr) auto minmax(130px, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfdfb;
}

.weekly-schedule-row label {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.weekly-schedule-row input,
.weekly-schedule-row select {
  min-width: 0;
  min-height: 38px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

@media (max-width: 800px) {
  .topbar {
    min-height: 66px;
    height: 66px;
  }

  .assistant-input-row {
    flex-direction: column;
  }

  .family-student-row {
    grid-template-columns: 1fr;
  }

  .family-student-schedule {
    grid-column: auto;
  }

  .report-page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .report-page-heading .toolbar {
    justify-content: start;
    flex-wrap: wrap;
  }

  .report-summary-grid,
  .report-finance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .qutof-form-section {
    grid-template-columns: 1fr;
  }
}

.lesson-kpi-grid {
  margin-bottom: 16px;
}

.lesson-kpi-button {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 4px;
  min-width: 0;
  padding: 16px;
  border: 1px solid #ead8b3;
  border-radius: 15px;
  background: linear-gradient(145deg, #fffdf8, #fff7e7);
  color: var(--ink);
  text-align: right;
  cursor: pointer;
}

.lesson-kpi-button:hover {
  border-color: #d9b96e;
  box-shadow: 0 7px 18px rgba(97, 73, 20, 0.08);
}

.lesson-kpi-label,
.lesson-kpi-button small {
  color: var(--muted);
  font-size: 11px;
}

.lesson-kpi-button strong {
  color: #946800;
  font-size: 25px;
}

.lesson-filters-panel {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.lesson-range-row,
.lesson-view-toolbar,
.lesson-bulk-toolbar,
.lesson-period-heading,
.lesson-range-buttons,
.lesson-structural-filters,
.lesson-custom-range {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lesson-range-row,
.lesson-view-toolbar,
.lesson-bulk-toolbar {
  justify-content: space-between;
  flex-wrap: wrap;
}

.lesson-period-heading h2 {
  min-width: 170px;
  margin: 0;
  color: var(--forest);
  font-size: 15px;
  text-align: center;
}

.lesson-range-buttons,
.lesson-view-switch {
  flex-wrap: wrap;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f7faf7;
}

.lesson-range-button,
.lesson-view-switch button {
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.lesson-range-button.active,
.lesson-view-switch button.active {
  background: white;
  color: var(--forest);
  box-shadow: 0 2px 8px rgba(24, 57, 45, 0.1);
}

.lesson-structural-filters {
  align-items: end;
  flex-wrap: wrap;
}

.lesson-filter-field {
  display: grid;
  flex: 1 1 170px;
  gap: 6px;
  min-width: 145px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.lesson-filter-field input,
.lesson-filter-field select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
}

.lesson-history-panel {
  min-width: 0;
  overflow: hidden;
}

.lesson-bulk-toolbar {
  margin: -5px 0 14px;
  padding: 11px 13px;
  border: 1px solid #dce9df;
  border-radius: 11px;
  background: #f5faf6;
}

.lesson-bulk-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--forest);
  font-size: 11px;
  font-weight: 700;
}

.lesson-bulk-toolbar input,
.lesson-select,
.lesson-bulk-toolbar input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--forest);
}

.lesson-view-toolbar {
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 11px;
}

.lesson-view-switch {
  display: inline-flex;
}

.lesson-date-group {
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.lesson-date-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  background: #f7faf7;
  color: var(--forest);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.lesson-date-group > summary::-webkit-details-marker,
.lesson-actions-menu > summary::-webkit-details-marker {
  display: none;
}

.lesson-date-group > summary::before {
  content: "＋";
  color: var(--forest-2);
}

.lesson-date-group[open] > summary::before {
  content: "−";
}

.lesson-date-group > summary span {
  flex: 1;
}

.lesson-date-group > summary b {
  color: var(--muted);
  font-size: 10px;
}

.lesson-history-table {
  min-width: 920px;
}

.lesson-history-table th,
.lesson-history-table td {
  vertical-align: middle;
}

.lesson-approval {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 20px;
  background: #f0f3f1;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.lesson-approval.approved {
  background: #e8f5ec;
  color: #287047;
}

.lesson-approval.pending {
  background: #fff4dc;
  color: #8b6411;
}

.lesson-report-open {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}

.lesson-actions-menu {
  position: relative;
  display: inline-block;
}

.lesson-actions-menu > summary {
  display: grid;
  width: 34px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--forest);
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  list-style: none;
}

.lesson-actions-popover {
  position: absolute;
  z-index: 10;
  inset-inline-end: 0;
  top: calc(100% + 4px);
  display: grid;
  min-width: 150px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(24, 57, 45, 0.15);
}

.lesson-actions-popover button {
  padding: 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  text-align: right;
  cursor: pointer;
}

.lesson-actions-popover button:hover {
  background: var(--mint-2);
}

.lesson-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 0 2px;
  color: var(--muted);
  font-size: 11px;
}

.lesson-calendar-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(190px, 1fr));
  gap: 9px;
  overflow-x: auto;
  padding: 2px 0 10px;
}

.lesson-calendar-day {
  min-height: 200px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdfb;
}

.lesson-calendar-day > header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--forest);
  font-size: 11px;
}

.lesson-calendar-day > header span {
  color: var(--muted);
}

.lesson-calendar-teacher {
  display: grid;
  gap: 6px;
  margin-top: 9px;
}

.lesson-calendar-teacher h4 {
  margin: 0;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.lesson-calendar-hour {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 7px;
  padding: 5px 0;
  border-bottom: 1px solid #edf1ee;
}

.lesson-calendar-hour > time {
  padding-top: 8px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.lesson-calendar-hour > div {
  display: grid;
  gap: 5px;
}

.lesson-calendar-event {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid #dce9df;
  border-right: 3px solid var(--forest-2);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: right;
  cursor: pointer;
}

.lesson-calendar-event time {
  color: var(--forest);
  font-size: 11px;
  font-weight: 800;
}

.lesson-calendar-event b,
.lesson-calendar-event span {
  font-size: 10px;
}

.lesson-calendar-event span {
  color: var(--muted);
}

.lesson-calendar-event.has-conflict {
  border-color: #e7a7a0;
  border-right-color: #b64036;
  background: #fff7f6;
}

.lesson-conflict-label {
  color: #a93229;
  font-size: 9px;
}

.lesson-calendar-empty {
  color: var(--muted);
  font-size: 10px;
}

.lesson-report-modal {
  width: min(620px, calc(100vw - 28px));
}

.lesson-report-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.lesson-report-details > div,
.lesson-report-details > article {
  display: grid;
  gap: 5px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdfb;
}

.lesson-report-details > div span {
  color: var(--muted);
  font-size: 10px;
}

.lesson-report-details > div b {
  color: var(--forest);
  font-size: 12px;
}

.lesson-report-details > article {
  grid-column: 1 / -1;
}

.lesson-report-details h3,
.lesson-report-details p {
  margin: 0;
}

.lesson-report-details h3 {
  color: var(--forest);
  font-size: 12px;
}

.lesson-report-details p {
  overflow-wrap: anywhere;
  line-height: 1.9;
  white-space: normal;
}

@media (max-width: 700px) {
  .lesson-range-row,
  .lesson-view-toolbar,
  .lesson-bulk-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .lesson-period-heading {
    justify-content: center;
  }

  .lesson-range-buttons {
    justify-content: center;
  }

  .lesson-range-button {
    flex: 1 1 40%;
  }

  .lesson-view-switch {
    width: 100%;
  }

  .lesson-view-switch button {
    flex: 1;
  }

  .lesson-pagination {
    gap: 8px;
  }

  .lesson-report-details {
    grid-template-columns: 1fr;
  }

  .lesson-report-details > article {
    grid-column: auto;
  }
}
