/* OSK: karty kursantów i wpłat oraz kalendarz z osią godzin. */

/* Formularz kursanta – wyraźne grupy zamiast jednej długiej siatki pól. */
#recordModal.student-form-modal .dialog {
  width: min(820px, 100%);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 24px;
  border: 1px solid #d5e3ef;
  border-top: 5px solid #1976b9;
  border-radius: 18px;
  box-shadow: 0 24px 70px #102f4a2e;
}
#recordModal.student-form-modal .dialog > .kicker { color: #1976b9; font-weight: 750; letter-spacing: .08em; }
#recordModal.student-form-modal .dialog > h2 { margin: 3px 0 5px; font-size: 23px; }
#recordModal.student-form-modal .dialog > .sub { margin: 0 0 17px; color: #64778a; }
#recordModal.student-form-modal #recordFields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.student-form-section,
.student-payment-profile {
  min-width: 0;
  padding: 15px 16px 16px;
  border: 1px solid #dce7f0;
  border-radius: 13px;
  background: linear-gradient(145deg, #fff, #f8fbfe);
}
.student-form-section h3 { margin: 0; color: #1a3854; font-size: 14px; font-weight: 750; }
.student-form-section > p { margin: 4px 0 12px; color: #708194; font-size: 11px; line-height: 1.4; }
.student-form-section-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 14px; }
.student-form-section-grid > label,
#recordModal.student-form-modal #recordFields > label {
  display: block;
  min-width: 0;
  margin: 0;
  color: #53677c;
  font-size: 12px;
  font-weight: 650;
}
.student-form-section-grid > .full,
.student-form-section-grid > .category-picker { grid-column: 1 / -1; }
.student-form-section-grid .course-select-field.full { grid-column: auto; }
#recordModal.student-form-modal #recordFields input:not([type="checkbox"]),
#recordModal.student-form-modal #recordFields select,
#recordModal.student-form-modal #recordFields textarea {
  width: 100%;
  min-width: 0;
  min-height: 43px;
  margin-top: 5px;
  padding: 9px 11px;
  border: 1px solid #d3dfeb;
  border-radius: 9px;
  background: #fff;
  color: #18334c;
  font: inherit;
  font-size: 13px;
}
#recordModal.student-form-modal #recordFields input:focus,
#recordModal.student-form-modal #recordFields select:focus,
#recordModal.student-form-modal #recordFields textarea:focus { border-color: #1976b9; outline: 3px solid #1976b91c; }
#recordModal.student-form-modal .category-picker { min-width: 0; margin: 0; padding: 0; border: 0; }
#recordModal.student-form-modal .category-picker legend { margin-bottom: 8px; color: #53677c; font-size: 12px; font-weight: 650; }
#recordModal.student-form-modal .category-options { display: flex; flex-wrap: wrap; gap: 7px; }
#recordModal.student-form-modal .category-choice {
  display: inline-flex; align-items: center; gap: 7px; width: auto; min-width: 66px; min-height: 38px; margin: 0;
  padding: 7px 10px; border: 1px solid #d3dfeb; border-radius: 9px; background: #fff; color: #304b64;
  font-size: 12px; font-weight: 700; cursor: pointer;
}
#recordModal.student-form-modal .category-choice:has(input:checked) { border-color: #1976b9; background: #eaf5fc; color: #1268a8; }
#recordModal.student-form-modal .category-choice input { width: 16px; height: 16px; min-height: 16px; margin: 0; accent-color: #1976b9; }
.student-form-section-grid > label.check-field.full { grid-column: auto; display: flex !important; align-items: center; gap: 8px; min-height: 38px; }
.student-form-section-grid > label.check-field input { width: 17px !important; height: 17px; min-height: 17px !important; margin: 0 !important; accent-color: #1976b9; }
.student-payment-profile { grid-column: auto; }
#recordModal.student-form-modal .student-payment-profile h3 { margin-top: 0; }
#recordModal.student-form-modal .dialog .actions { position: sticky; bottom: -1px; z-index: 3; margin-top: 5px; padding: 12px 0 0; background: #fff; }
#recordModal.student-form-modal .dialog .actions .primary { min-width: 140px; min-height: 44px; }

/* Wpłata – osobny panel z danymi osoby i danymi transakcji. */
#manualPaymentPanel.payment-entry-card {
  max-width: 980px;
  margin: 16px 20px;
  padding: 23px;
  border: 1px solid #d7e4ee;
  border-left: 5px solid #1976b9;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 28px #173a5410;
}
.payment-entry-title { display: flex; align-items: center; gap: 13px; margin: 0 0 19px; }
.payment-entry-icon { display: grid; flex: 0 0 48px; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: #e8f4fc; color: #1976b9; font-size: 20px; font-weight: 800; }
.payment-entry-title .kicker { margin: 0 0 3px; color: #1976b9; font-size: 10px; font-weight: 750; letter-spacing: .08em; }
.payment-entry-title h2 { margin: 0 0 3px; color: #18334c; font-size: 20px; }
.payment-entry-title .sub { margin: 0; color: #708194; font-size: 12px; }
.payment-entry-section { min-width: 0; margin-top: 12px; padding: 15px; border: 1px solid #e0e9f1; border-radius: 12px; background: #f9fbfd; }
.payment-entry-section-heading { display: flex; align-items: center; gap: 10px; margin: 0 0 13px; }
.payment-entry-step { display: grid; flex: 0 0 27px; place-items: center; width: 27px; height: 27px; border-radius: 8px; background: #e6f2fb; color: #1976b9; font-size: 11px; font-weight: 800; }
.payment-entry-section-heading h3 { margin: 0; color: #1a3854; font-size: 14px; }
.payment-entry-section-heading p { margin: 3px 0 0; color: #708194; font-size: 11px; }
.payment-fields-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 14px; }
.payment-fields-grid > label { display: block; min-width: 0; margin: 0; color: #53677c; font-size: 12px; font-weight: 650; }
.payment-fields-grid > .payment-wide { grid-column: 1 / -1; }
.payment-fields-grid input:not([type="checkbox"]), .payment-fields-grid select {
  width: 100%; min-width: 0; min-height: 44px; margin-top: 5px; padding: 9px 11px; border: 1px solid #d3dfeb;
  border-radius: 9px; background: #fff; color: #18334c; font: inherit; font-size: 13px;
}
.payment-fields-grid input:focus, .payment-fields-grid select:focus { border-color: #1976b9; outline: 3px solid #1976b91c; }
#manualPaymentForm label:has(#manualPaymentMode) { grid-column: 1 / -1; }
#manualPaymentForm label:has(#manualPaymentAmount) input { min-height: 50px; color: #145f96; font-size: 18px; font-weight: 750; }
#manualPaymentForm .student-picker { margin-top: 5px; }
#manualPaymentForm .student-picker-input { min-height: 44px; border: 1px solid #d3dfeb; background: #fff; color: #18334c; font-size: 13px; }
#manualPaymentForm .student-picker-input:focus { border-color: #1976b9; box-shadow: 0 0 0 3px #1976b91c; }
#manualPaymentSummary.payment-balance-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 13px 0 3px; }
#manualPaymentSummary.payment-balance-grid p { min-width: 0; margin: 0; padding: 12px; border: 1px solid #d9e5ee; border-radius: 10px; background: #fff; }
#manualPaymentSummary.payment-balance-grid span { margin-bottom: 5px; color: #64778a; font-size: 11px; }
#manualPaymentSummary.payment-balance-grid strong { color: #173a55; font-size: 15px; font-variant-numeric: tabular-nums; }
#manualPaymentSummary #manualPaymentBalance { color: #16724c; }
#manualPaymentForm > .actions { justify-content: flex-end; margin-top: 14px; }
#manualPaymentForm > .actions .primary { min-width: 170px; min-height: 46px; }
#manualPaymentMessage.success { color: #16724c; }

/* Tydzień i dzień – pionowa oś czasu, wspólne poziomy dla każdego startu godziny. */
.mode-timeline { overflow: auto; scrollbar-width: thin; }
.calendar-timeline { --timeline-hour-height: 88px; --timeline-columns: 7; --timeline-col-min: 150px; min-width: 1220px; color: #15263b; }
.calendar-timeline.is-day { --timeline-columns: 1; --timeline-col-min: 0px; min-width: 0; width: 100%; }
.calendar-timeline-header, .calendar-timeline-body { display: grid; grid-template-columns: 56px repeat(var(--timeline-columns), minmax(var(--timeline-col-min), 1fr)); }
.calendar-timeline-header { position: sticky; top: 0; z-index: 5; border-bottom: 1px solid #d9e3ed; background: #fff; }
.calendar-timeline-spacer { min-height: 47px; border-right: 1px solid #e4ebf1; }
.calendar-timeline-day-head { min-width: 0; min-height: 47px; padding: 7px 8px; border-top: 3px solid #1976b9; border-right: 1px solid #e4ebf1; background: #fff; }
.calendar-timeline-day-head strong { display: block; overflow: hidden; color: #1a3854; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.calendar-timeline-day-head span { color: #62768a; font-size: 10px; }
.calendar-timeline-day-head small { display: block; overflow: hidden; color: #708194; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.calendar-timeline-axis { position: relative; border-right: 1px solid #d9e3ed; background: #fff; }
.calendar-timeline-hour-label { position: absolute; right: 7px; z-index: 1; color: #718296; font-size: 10px; font-variant-numeric: tabular-nums; transform: translateY(-50%); }
.calendar-timeline-hour-label:first-child { transform: none; }
.calendar-timeline-day-track { position: relative; min-width: 0; border-right: 1px solid #d9e3ed; background-color: #fff; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--timeline-hour-height) - 1px), #e4ebf1 calc(var(--timeline-hour-height) - 1px), #e4ebf1 var(--timeline-hour-height)); }
.calendar-timeline-event { position: absolute; z-index: 2; min-width: 0; min-height: 70px; padding: 5px 6px; border-radius: 7px; box-shadow: 0 1px 3px #16324b16; overflow: hidden; }
.calendar-timeline-event .calendar-event-header { gap: 3px; margin-bottom: 3px; }
.calendar-timeline-event .calendar-event-time { font-size: 9px; }
.calendar-timeline-event .calendar-status { max-width: 58px; padding: 1px 3px; font-size: 8px; }
.calendar-timeline-event .calendar-event-title { margin-bottom: 3px; font-size: 10px; line-height: 1.15; }
.calendar-timeline-event .calendar-person-meta { gap: 2px 4px; font-size: 8px; line-height: 1.15; }
.calendar-timeline-event .calendar-person-meta > span:first-child { display: none; }
.calendar-timeline-event .calendar-person-meta > span:not(:last-of-type)::after { margin-left: 3px; }
.calendar-timeline-event .calendar-kind { min-width: 16px; min-height: 16px; padding: 0 3px; font-size: 8px; }
.calendar-timeline-event .calendar-person-name { margin-bottom: 2px; font-size: 9px; line-height: 1.15; }
.calendar-timeline-event .calendar-participants { gap: 3px; }
.calendar-timeline-event .calendar-participant { padding-top: 3px; }
.calendar-timeline-event .calendar-cumulative, .calendar-timeline-event .calendar-event-meta, .calendar-timeline-event .calendar-collision-warning { margin-top: 2px; font-size: 8px; }
.calendar-timeline-event .calendar-event-actions { gap: 3px; margin-top: 4px; padding-top: 3px; }
.calendar-timeline-event .calendar-action { min-height: 22px; padding: 2px 5px; font-size: 8px; }
.calendar-timeline-empty { position: absolute; inset: 12px 4px auto; color: #a0adba; font-size: 10px; text-align: center; }
@media (max-width: 700px) {
  #recordModal.student-form-modal .dialog { padding: 20px 15px calc(15px + env(safe-area-inset-bottom)); }
  .student-form-section { padding: 13px; }
  .student-form-section-grid, .payment-fields-grid { grid-template-columns: minmax(0, 1fr); }
  .student-form-section-grid > .full, .student-form-section-grid > .category-picker, #manualPaymentForm label:has(#manualPaymentMode) { grid-column: auto; }
  #manualPaymentPanel.payment-entry-card { max-width: none; margin: 12px; padding: 16px; }
  .payment-entry-section { padding: 12px; }
  #manualPaymentSummary.payment-balance-grid { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  #manualPaymentSummary.payment-balance-grid p { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  #manualPaymentSummary.payment-balance-grid span { margin: 0; }
  #manualPaymentSummary.payment-balance-grid strong { text-align: right; }
  #manualPaymentForm > .actions .primary { width: 100%; }
  .calendar-timeline.is-day { min-width: 0; }
  .calendar-timeline-event { padding: 5px; }
}
