.studio-schedule-area {
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.schedule-head, .schedule-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.schedule-head p:last-child { color: var(--muted); margin-top: 6px; }
.schedule-toolbar h2 { text-transform: capitalize; }
.schedule-board, .schedule-detail { display: grid; gap: 14px; }
.schedule-detail > h2 { margin-bottom: 0; }
.schedule-detail:focus { outline: none; }
#schedule-area .schedule-detail > * + * { margin-top: 0; }

#finance-area .finance-tabs,
#finance-area .finance-filters { justify-content: flex-start; }

#finance-area .finance-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
  padding: 10px;
}
#finance-area .finance-tabs .studio-button {
  min-width: 0;
  margin: 0;
  justify-content: center;
  text-align: center;
}

#finance-area .finance-task > [data-finance-action="back"] { justify-self: start; }
#finance-area .finance-task > h2:focus { outline: none; }

.schedule-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  align-items: end;
  gap: 9px;
  background: var(--wash);
  border-radius: 12px;
  padding: 12px;
}

.schedule-filters .studio-button { justify-self: start; }
.schedule-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }

.schedule-calendar {
  display: grid;
  grid-template-columns: repeat(var(--schedule-columns, 7), minmax(0, 1fr));
  min-width: calc(var(--schedule-columns, 7) * 90px);
  background: var(--line);
  gap: 1px;
}

.schedule-weekday {
  text-align: center;
  padding: 9px;
  background: #e8f0ec;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 750;
}

.schedule-cell {
  display: flex;
  align-items: stretch;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  min-height: 105px;
  min-width: 0;
  background: var(--paper);
}

.schedule-calendar[data-calendar-mode="week"] .schedule-cell { min-height: 220px; }
.schedule-calendar[data-calendar-mode="month"] .schedule-cell[data-outside="true"] { background: #f6f9f7; }

.schedule-cell .studio-button {
  align-self: flex-start;
  padding: 2px 6px;
  min-width: 29px;
  min-height: 29px;
  border-color: transparent;
}

.schedule-cell .studio-button[aria-current="date"] { background: var(--green); color: #fff; }

.schedule-event {
  width: 100%;
  min-width: 0;
  text-align: left;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--schedule-event-color, #47806c);
  border-radius: 7px;
  background: #eef5f1;
  color: var(--ink);
  font: inherit;
  font-size: .8rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.schedule-event:focus-within, .schedule-event:hover { background: #e1eee6; }
.schedule-event[data-state="cancelled"], .schedule-event[data-state="declined"] {
  background: #f4f5f4;
  border-left-color: #929b96;
  color: #5c6661;
}
.schedule-event[data-state="cancelled"] .schedule-event-description > strong,
.schedule-event[data-state="declined"] .schedule-event-description > strong { text-decoration: line-through; text-decoration-color: #9fa9a3; }
.schedule-event-open {
  display: grid;
  gap: 2px;
  flex: 1 1 100%;
  min-width: 0;
  border: 0;
  padding: 3px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.schedule-event-actions { display: flex; gap: 4px; margin-left: auto; }
.schedule-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}
.schedule-icon:hover { border-color: var(--line); background: var(--paper); }
.schedule-icon[data-schedule-action="cancel-appointment"] { color: #962b3c; }
.schedule-icon svg { width: 17px; height: 17px; pointer-events: none; }
.schedule-event-time { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.schedule-event-description { display: grid; gap: 3px; min-width: 0; }
.schedule-event-description small { color: var(--muted); font-size: .76rem; }
.schedule-event-description .schedule-conflict-label, .schedule-conflict-label { color: #962b3c; font-weight: 750; }
.schedule-list { display: grid; gap: 14px; }
.schedule-list-day { display: grid; gap: 7px; padding-block: 2px 4px; }
.schedule-list-day h3 { margin: 0; font-size: .94rem; text-transform: capitalize; }
.schedule-list-day h3[aria-current="date"] { color: var(--green); }
.schedule-list-day .schedule-event {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 7px 9px;
  font-size: .92rem;
}
.schedule-list-day .schedule-event-open {
  grid-template-columns: minmax(95px, max-content) minmax(0, 1fr) max-content;
  gap: 12px;
  align-items: center;
}
.schedule-legacy > summary { cursor: pointer; color: var(--muted); }
.schedule-legacy > div { margin-top: 9px; }
.schedule-empty-day {
  margin: 0;
  padding: 8px 12px;
  border-left: 3px solid #b55259;
  border-radius: 7px;
  background: #fbefef;
  color: #843943;
  font-size: .87rem;
}
.schedule-payment-chip {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f9ecd6;
  color: #784c19;
  font-size: .76rem;
  font-weight: 700;
}
.schedule-payment-chip[data-paid="true"] { background: #d9eee1; color: #245a40; }
.schedule-payment-detail {
  display: grid;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: var(--wash);
}
.schedule-payment-detail p { margin: 3px 0 0; }
.schedule-appointment-heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.schedule-appointment-heading h2 { margin: 0; font-size: 1.15rem; font-weight: 600; }
.schedule-appointment-heading p { margin: 6px 0 0; color: var(--muted); font-size: .82rem; }
.schedule-appointment-state { display: flex; align-items: center; gap: 10px; }
.schedule-appointment-state .schedule-status-chip { white-space: nowrap; padding: 4px 8px; border-radius: 5px; background: #e6ece8; font-size: .75rem; }
.schedule-appointment-state [data-state="completed"] { background: #e1e5e8; color: #46555e; }
.schedule-appointment-notes { margin: 0; font-size: .82rem; }
.schedule-payment-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.schedule-payment-heading h3 { margin: 0; font-size: .88rem; font-weight: 600; }
.schedule-payment-heading p { font-size: .76rem; color: var(--muted); }
.schedule-payment-totals { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 0; font-size: .8rem; }
.schedule-payment-totals dt { color: var(--muted); }
.schedule-payment-totals dd { margin: 3px 0 0; font-weight: 550; font-variant-numeric: tabular-nums; }
.schedule-last-payment { padding-top: 9px; border-top: 1px solid var(--line); font-size: .77rem; line-height: 1.5; }
.schedule-last-payment p { margin: 0; }
.schedule-last-payment small { display: block; margin-top: 3px; color: var(--muted); }
.schedule-last-payment[data-payment-kind="reversal"] > p { color: #8a3844; }
.schedule-outcome-line { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 20px; padding-top: 5px; }
.schedule-outcome-line small { font-size: .74rem; color: var(--muted); padding-bottom: 8px; }
.schedule-outcome label { font-size: .78rem; font-weight: 500; }
.schedule-outcome :is(select, button) { min-height: 34px; font-size: .8rem; padding: 6px 10px; }
.schedule-automation-hold { display: flex; gap: 10px; align-items: center; font-size: .76rem; }
.finance-payment-row { width: 100%; min-width: 0; border-left: 2px solid transparent; padding-left: 8px; }
.finance-payment-row[data-payment-kind="reversal"] { border-left-color: #b56c77; }
.finance-payment-row[data-payment-kind="restore"] { border-left-color: #6b947c; }
.finance-payment-row[data-corrected="true"] > .finance-record { color: #66746d; }
.finance-payment-links { display: flex; flex-wrap: wrap; gap: 5px 10px; padding: 0 8px 8px; }
.finance-payment-links .studio-button { min-height: 28px; padding: 4px 7px; font-size: .73rem; font-weight: 450; }
.finance-payment-meta { color: var(--muted); font-size: .76rem; }
.finance-payment-trail { margin-block: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding-block: 12px; }
.finance-payment-trail h3 { margin: 0 0 8px; font-size: .86rem; font-weight: 550; }
.finance-payment-trail ol { margin: 0; padding: 0 0 0 18px; display: grid; gap: 5px; }
.finance-payment-trail .studio-button { min-height: 30px; padding: 5px 8px; font-size: .76rem; font-weight: 450; text-align: left; white-space: normal; }
.finance-payment-trail [aria-current="true"] .studio-button { background: #edf3ef; border-color: #b8cec0; }
.finance-payment-trail p { margin: 9px 0 0; font-size: .79rem; }
@media (max-width: 560px) {
  .schedule-appointment-heading { flex-wrap: wrap; }
  .schedule-appointment-state { width: 100%; justify-content: space-between; }
  .schedule-payment-heading { flex-wrap: wrap; }
}
.schedule-service-tag { width:fit-content; border:1px solid var(--schedule-event-color, #707782); border-radius:999px; padding:3px 7px; font-size:.72rem; font-weight:750; }
.schedule-event .schedule-status-chip {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e0ede5;
  color: #275a42;
  font-size: .73rem;
  font-weight: 650;
  line-height: 1.4;
}
.schedule-event[data-state="completed"] {
  background: #e1e5e8;
  border-color: #cbd2d7;
  border-left-color: #8c989f;
  color: #46555e;
}
.schedule-event[data-state="completed"]:hover,
.schedule-event[data-state="completed"]:focus-within { background: #d9e0e5; }
.schedule-event[data-state="completed"] .schedule-status-chip { background: #cfd8dd; color: #3c4c55; }
.schedule-event[data-state="completed"] .schedule-status-chip::before { content: "✓"; margin-right: 4px; }
.schedule-event[data-state="completed"][data-completion-source="automatic"] { border-left-color: #8c989f; }
.schedule-event[data-state="completed"][data-completion-source="automatic"] .schedule-status-chip { background: #cfd8dd; color: #3c4c55; }
.schedule-event[data-state="no_show"] { background: #fff2df; border-left-color: #b57b29; }
.schedule-event[data-state="no_show"] .schedule-status-chip { background: #f7dfb6; color: #79500e; }
.schedule-event[data-state="cancelled"] .schedule-status-chip,
.schedule-event[data-state="declined"] .schedule-status-chip { background: #e5e8e6; color: #626d66; }
.schedule-outcome { display:flex; align-items:end; gap:10px; flex-wrap:wrap; }
.schedule-outcome label { min-width:180px; }
.schedule-auto-note { padding:10px 12px; border-radius:9px; background:#fff0d9; color:#725020; }
.finance-record { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; width:100%; padding:8px; border:0; border-radius:8px; background:transparent; color:inherit; font:inherit; text-align:left; cursor:pointer; }
.finance-record:hover { background:#e4eee9; }
.finance-record small { flex-basis:100%; margin:0!important; }
.schedule-billing { gap: 10px 14px; }
.schedule-billing p { margin: 0; }
.schedule-choices { margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.schedule-choices legend { font-weight: 650; padding-inline: 4px; }
.schedule-types { list-style: none; padding: 0; display: grid; gap: 7px; }
.schedule-types li { display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; background: var(--wash); border-radius: 8px; }
.working-hours-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 10px; }
.working-hours-day { min-width: 0; margin: 0; padding: 9px; border: 1px solid var(--line); border-radius: 9px; }
.working-hours-day legend { padding-inline: 4px; font-weight: 700; }
.working-hours-day:disabled { opacity: .55; }
.working-hours-bands:not([hidden]) { display: grid; gap: 8px; margin-top: 8px; }
.working-hours-period { padding-top: 6px; border-top: 1px solid var(--line); }
.working-hours-form .working-hours-switch { display: flex; align-items: center; gap: 7px; }
.working-hours-form .working-hours-switch input { width: 18px; min-height: 18px; margin: 0; accent-color: var(--coach-accent); }
.working-hours-band { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-bottom: 5px; }
.working-hours-band input { width: 100%; min-width: 0; }
.working-hours-band input:disabled { opacity: .48; }

@media (max-width: 600px) {
  #finance-area .finance-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .schedule-toolbar { align-items: flex-start; }
  .schedule-detail .studio-form-grid { grid-template-columns: minmax(0, 1fr); }
  .schedule-list-day .schedule-event-open { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}
/* Renewal evidence reuses the financial ledger and never creates receipts. */
.finance-renewal-summary { display:flex; flex-wrap:wrap; gap:12px 28px; font-size:.86rem; }
.finance-renewal-summary strong { font-size:1.25rem; margin-right:4px; }
.finance-renewal-chart { margin:16px 0; display:grid; gap:7px; }
.finance-renewal-chart > div { display:grid; grid-template-columns:62px minmax(0,1fr) 50px; align-items:center; gap:12px; font-size:.76rem; }
.finance-renewal-track { height:12px; position:relative; background:#f1f3f5; border-radius:3px; overflow:hidden; }
.finance-renewal-track i, .finance-renewal-track b { display:block; position:absolute; inset:0 auto 0 0; background:#c9d8de; border-radius:3px; }
.finance-renewal-track b { background:#3d7e59; }
