/* Warm Notebook: schedule and finance surfaces. Kept inside these screens so
   the shared application theme can roll out to other sections independently. */
.calendar-page,
.schedule-form,
.lesson-detail-card,
.finance-page {
  --bg: #FBF8F2;
  --surface: #FFFFFF;
  --text: #202431;
  --muted: #666D75;
  --accent: #AF5138;
  --accent-soft: #F3EDE4;
  --line: #E4DDD3;
  --danger: #A43C34;
  --shadow: 0 3px 14px rgba(32, 36, 49, .045);
  color: var(--text);
  font-family: "Golos Text", system-ui, sans-serif;
}
.calendar-page :is(h1,h2,h3,h4),
.schedule-form :is(h1,h2,h3,h4),
.lesson-detail-card :is(h1,h2,h3,h4),
.finance-page :is(h1,h2,h3,h4),
.finance-page .money-month-title {
  font-family: Manrope, "Golos Text", sans-serif;
}

/* Calendar */
.calendar-page { min-width: 0; }
.calendar-page:not(.is-student-calendar) .is-week-view .time-header,
.calendar-page:not(.is-student-calendar) .is-week-view .time-body{min-width:0;grid-template-columns:46px repeat(7,minmax(0,1fr))}
.calendar-page:not(.is-student-calendar) .is-week-view .time-day-heading{flex-direction:column;gap:0;padding:6px 0;font-size:11px}
.calendar-page:not(.is-student-calendar) .is-week-view .time-event{padding:4px 2px;font-size:11px;border-left-width:2px}
.calendar-page:not(.is-student-calendar) .is-week-view .time-event strong{font-size:10px}
.calendar-page:not(.is-student-calendar) .is-week-view .time-event :is(strong,span){white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media(max-width:540px){.calendar-page:not(.is-student-calendar) .is-week-view .time-header,.calendar-page:not(.is-student-calendar) .is-week-view .time-body{grid-template-columns:31px repeat(7,minmax(0,1fr))}.calendar-page:not(.is-student-calendar) .is-week-view .time-event small{display:none}}
.calendar-page .calendar-toolbar { margin-bottom: 18px; }
.calendar-page .calendar-icon-button,
.calendar-page .calendar-view-switch,
.calendar-page .time-calendar,
.calendar-page .month-calendar {
  border-color: var(--line);
  background: #fff;
}
.calendar-page .calendar-icon-button {
  width: 44px; height: 44px; border-radius: 14px;
  color: var(--text); font-family: "Golos Text", sans-serif;
}
.calendar-page .calendar-view-switch { padding: 4px; border-radius: 999px; background: var(--accent-soft); }
.calendar-page .calendar-view-switch a { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; }
.calendar-page .calendar-view-switch a[aria-current="page"] { background: #fff; color: var(--accent); box-shadow: 0 1px 3px rgba(32,36,49,.08); }
.calendar-page .calendar-current-date { font-family: Manrope, sans-serif; font-size: 17px; letter-spacing: -.02em; }
.calendar-page .time-calendar,
.calendar-page .month-calendar { border-radius: 18px; box-shadow: var(--shadow); }
.calendar-page .time-header { background: rgba(255,255,255,.97); }
.calendar-page .time-gutter-heading { font-size: 10px; font-weight: 700; letter-spacing: .03em; }
.calendar-page .time-day-heading { min-height: 56px; color: var(--muted); }
.calendar-page .time-day-heading.is-selected strong { background: var(--accent); }
.calendar-page .time-day-column { background: repeating-linear-gradient(to bottom, transparent 0, transparent 63px, var(--line) 63px, var(--line) 64px); }
.calendar-page .time-create-slot:hover { background: rgba(175,81,56,.08); }
.calendar-page .time-event { border-left-color: var(--accent); border-radius: 9px; background: #F3EDE4; color: #603626; }
.calendar-page .time-event.status-completed { border-left-color: #42634A; background: #EAF0E5; color: #34533D; }
.calendar-page .time-event.status-cancelled { border-left-color: #AFA9A1; background: #F3F1EE; color: #6B6864; }
.calendar-page .month-weekdays { background: #F8F5EF; }
.calendar-page .month-weekdays span { padding: 12px 3px; font-weight: 600; }
.calendar-page .month-day { min-height: 112px; background: #fff; }
.calendar-page .month-day.is-outside { background: #FAF8F4; color: #96918A; }
.calendar-page .month-day.is-selected { background: #FBF8F2; }
.calendar-page .month-day.is-selected .month-day-number { background: var(--accent); }
.calendar-page .month-event { background: #F3EDE4; color: #603626; }
.calendar-page .month-event.status-completed { background: #EAF0E5; color: #34533D; }
.calendar-page .month-event.status-cancelled { background: #F3F1EE; color: #6B6864; text-decoration: line-through; }
.calendar-page .month-add { color: var(--accent); }
/* Preserve the existing grid geometry and calendar.js positioning. This only
   improves the 00:00 gutter label's legibility. */
.calendar-page .hour-label { line-height: 1.35; font-variant-numeric: tabular-nums; }
.calendar-page .hour-label:first-child { top: 0; }

/* Lesson create/edit and detail */
.schedule-form.form-card,
.lesson-detail-card {
  border-color: var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow);
}
.schedule-form.form-card { padding: 22px; }
.schedule-form > .muted { margin: 0; line-height: 1.6; }
.schedule-form .form-stack { gap: 18px; }
.schedule-form .field input,
.schedule-form .field select,
.schedule-form .field textarea,
.finance-page .field input,
.finance-page .field select,
.finance-page .field textarea {
  max-width: 100%; min-width: 0; border-color: var(--line); border-radius: 12px; background: #fff;
}
.schedule-form .field :is(input,select,textarea),
.finance-page .field :is(input,select,textarea) { font-family: "Golos Text", sans-serif; }
.schedule-form .field :is(input,select,textarea):focus,
.finance-page .field :is(input,select,textarea):focus { outline-color: rgba(175,81,56,.18); border-color: var(--accent); }
.schedule-form .form-actions { gap: 10px; }
.lesson-detail-card { padding: 24px; }
.lesson-detail-heading h2 { font-size: 23px; letter-spacing: -.03em; }
.lesson-status { background: #F3EDE4; color: #603626; }
.lesson-status.status-completed { background: #EAF0E5; color: #42634A; }
.lesson-status.status-cancelled { background: #F3F1EE; color: #6B6864; }
.lesson-facts div { background: #F8F5EF; }
.lesson-facts dt { color: var(--muted); }
.lesson-actions { border-color: var(--line); }
.lesson-actions .button { min-height: 48px; border-radius: 999px; }
.lesson-actions .button-primary { background: var(--accent); }
.lesson-actions .button-secondary { border-color: var(--line); }
.lesson-actions .button-danger-quiet { border-color: #EAD6D0; background: #FBF4F1; color: var(--danger); }

/* Shared controls, scoped to finance/schedule cards only. */
.calendar-page .button,
.schedule-form .button,
.lesson-detail-card .button,
.finance-page .button {
  min-height: 48px; border-radius: 999px; font-family: "Golos Text", sans-serif;
}
.calendar-page .button-primary,
.schedule-form .button-primary,
.lesson-detail-card .button-primary,
.finance-page .button-primary { background: var(--accent); }
.calendar-page .button-primary:hover,
.schedule-form .button-primary:hover,
.lesson-detail-card .button-primary:hover,
.finance-page .button-primary:hover { background: #97432D; }
.calendar-page .button-secondary,
.schedule-form .button-secondary,
.lesson-detail-card .button-secondary,
.finance-page .button-secondary { border-color: var(--line); background: #fff; }

/* Finance overview, student ledger, and payment forms */
.finance-page { min-width: 0; }
.finance-page h2 { margin-top: 0; font-size: 22px; letter-spacing: -.025em; }
.finance-page .money-toolbar { gap: 10px; margin: 18px 0 22px; }
.finance-page .money-toolbar > .button { width: 48px; height: 48px; padding: 0; flex: 0 0 48px; font-size: 22px; }
.finance-page .money-month-picker { min-width: 0; }
.finance-page .money-month-title { color: var(--text); font-size: 21px; }
.finance-page .money-month-picker > div { gap: 7px; }
.finance-page .money-month-picker input { width: min(100%, 176px); min-height: 42px; border-color: var(--line); border-radius: 12px; background: #fff; font-family: "Golos Text", sans-serif; }
.finance-page .money-month-picker .text-button { color: var(--accent); }
.finance-page .money-headline { gap: 12px; }
.finance-page .money-card { padding: 20px; border-color: var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.finance-page .money-card > span { color: var(--muted); font-size: 14px; font-weight: 550; }
.finance-page .money-card > strong { color: var(--text); font-family: Manrope, "Golos Text", sans-serif; font-size: 28px; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.finance-page .money-headline .money-card > p { line-height: 1.5; }
.finance-page .money-highlight { border-color: #E9D4C8; background: #F3EDE4; }
.finance-page .money-highlight > strong { color: var(--accent); }
.finance-page .money-balances { gap: 12px; padding: 0 0 22px; border: 0; }
.finance-page .money-balances > a,
.finance-page .money-balances > div { padding: 17px 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.finance-page .money-balances > :first-child { border-color: #F0D7D0; background: #FBF0EC; }
.finance-page .money-balances > :nth-child(2) { border-color: #D9E5D5; background: #EAF0E5; }
.finance-page .money-balances strong { font-family: Manrope, "Golos Text", sans-serif; font-size: 23px; font-variant-numeric: tabular-nums; }
.finance-page .money-balances > :first-child strong { color: #9B4035; }
.finance-page .money-balances > :nth-child(2) strong { color: #42634A; }
.finance-page .money-debt { color: #9B4035; }
.finance-page .money-explanation { line-height: 1.6; }
.finance-page .money-filter { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,190px) auto auto; gap: 8px; margin: 0 0 10px; }
.finance-page .money-filter input,
.finance-page .money-filter select { width: 100%; max-width: 100%; min-height: 48px; border-color: var(--line); border-radius: 12px; background: #fff; }
.finance-page .money-filter .button { min-width: 112px; }
.finance-page .money-student-grid { align-items: stretch; gap: 14px; }
.finance-page .money-student { gap: 14px; }
.finance-page .money-student h3 { font-family: Manrope, "Golos Text", sans-serif; font-size: 18px; }
.finance-page .money-badge { background: #E9F1F6; color: #3E657A; }
.finance-page .money-badge.money-debt { background: #F8E9E5; color: #9B4035; }
.finance-page .money-breakdown { gap: 9px; }
.finance-page .money-breakdown dt { line-height: 1.4; }
.finance-page .money-breakdown dd { font-variant-numeric: tabular-nums; }
.finance-page .money-quick { padding: 13px; border: 1px solid #D9E5D5; border-radius: 14px; background: #EAF0E5; }
.finance-page .money-quick > span { color: #42634A; font-weight: 600; }
.finance-page .money-actions { gap: 8px; }
.finance-page .money-actions .button { flex: 1 1 145px; }
.finance-page .money-student > .text-link { margin-top: 0; }
.finance-page .money-help { padding: 0 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.finance-page .money-help summary { color: var(--text); }
.finance-page .money-prepayment { max-width: 720px; }
.finance-page .money-prepayment > .money-card { margin: 18px 0 0; }
.finance-page .money-total { border-color: var(--line); }
.finance-page .money-lesson { gap: 10px; }
.finance-page .money-lesson .money-row { align-items: center; }
.finance-page .money-lesson .money-row > strong { font-variant-numeric: tabular-nums; }
.finance-page .money-lesson .money-actions form { display: flex; }
.finance-page .money-history { margin-top: 28px; }
.finance-page .money-history > summary { min-height: 48px; font-family: Manrope, sans-serif; }
.finance-page .money-void-confirm summary { color: var(--danger); }
.finance-page .money-void { background: #F8F6F2; }
.payment-page { max-width: 680px; }
.payment-page .form-card { max-width: none; padding: 24px; border-color: var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow); }
.payment-page .form-card > p:first-child { color: var(--muted); line-height: 1.6; }
.payment-page .form-stack { gap: 18px; }
.payment-page .form-stack > .button { width: 100%; margin-top: 4px; }

@media (max-width: 700px) {
  .finance-page .money-filter { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .finance-page .money-filter input { grid-column: 1 / -1; }
  .finance-page .money-filter .button { width: 100%; min-width: 0; }
  .finance-page .money-filter .text-link { justify-content: center; }
}
@media (max-width: 540px) {
  .calendar-page .calendar-toolbar { gap: 12px; }
  .calendar-page .calendar-current-date { font-size: 15px; }
  .calendar-page .calendar-date-controls { max-width: 100%; }
  .calendar-page .calendar-icon-button { width: 42px; height: 42px; }
  .calendar-page .month-day { min-height: 88px; }
  .schedule-form.form-card { padding: 17px; }
  .lesson-detail-card { padding: 17px; }
  .finance-page .money-headline { gap: 9px; }
  .finance-page .money-card { padding: 16px; }
  .finance-page .money-headline .money-card > strong { font-size: clamp(19px, 6vw, 24px); }
  .finance-page .money-balances { gap: 9px; }
  .finance-page .money-balances > a,
  .finance-page .money-balances > div { padding: 14px; }
  .finance-page .money-balances strong { font-size: 19px; }
  .finance-page .money-month-title { font-size: 18px; }
  .finance-page .money-month-picker input { width: min(100%, 148px); font-size: 14px; }
  .payment-page .form-card { padding: 18px; }
}
@media (max-width: 370px) {
  .calendar-page .calendar-date-controls { gap: 6px; }
  .calendar-page .calendar-current-date { font-size: 14px; }
  .calendar-page .calendar-view-switch a { padding-right: 8px; padding-left: 8px; font-size: 13px; }
  .calendar-page .month-weekdays span { padding: 9px 1px; }
  .finance-page .money-month-picker > div { flex-wrap: wrap; }
  .finance-page .money-headline .money-card { padding: 12px; }
  .finance-page .money-headline .money-card > span { font-size: 12px; }
  .finance-page .money-headline .money-card > strong { font-size: 18px; }
  .finance-page .money-breakdown { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .calendar-page *, .schedule-form *, .lesson-detail-card *, .finance-page * { scroll-behavior: auto; transition: none; }
}
