.rg-max-route { width: 100%; min-width: 0; }
.rg-settings-wrapper > .stack-xl { display: contents; }
.booking-toolbar { display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 10px; }
.booking-toolbar label { display: grid; gap: 7px; min-width: 170px; color: var(--muted, #738096); font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.booking-input, .booking-select, .booking-button, .booking-icon-button, .booking-textarea { box-sizing: border-box; border: 1px solid var(--border, #d5dde7); color: var(--text, #172033); background: var(--surface, #fff); font: inherit; }
.booking-input, .booking-select { height: 48px; width: 100%; padding: 0 14px; border-radius: 14px; outline: none; }
.booking-textarea { width: 100%; min-height: 90px; resize: vertical; padding: 12px 14px; border-radius: 14px; outline: none; }
.booking-input:focus, .booking-select:focus, .booking-textarea:focus { border-color: var(--accent, #5e8eb2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #5e8eb2) 18%, transparent); }
.booking-button, .booking-icon-button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border-radius: 14px; padding: 0 17px; font-weight: 800; cursor: pointer; transition: transform .15s ease, background-color .15s ease, border-color .15s ease; }
.booking-button:hover, .booking-icon-button:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--surface, #fff) 88%, var(--accent, #5e8eb2)); }
.booking-button.primary { color: #fff; border-color: var(--accent, #5e8eb2); background: var(--accent, #5e8eb2); box-shadow: 0 10px 24px color-mix(in srgb, var(--accent, #5e8eb2) 26%, transparent); }
.booking-button.primary:hover { background: color-mix(in srgb, var(--accent, #5e8eb2) 88%, #000); }
.booking-button.danger { color: #fff; border-color: #c7444c; background: #c7444c; }
.booking-button.danger:hover { background: #ad343c; }
.booking-button:disabled { opacity: .55; cursor: wait; transform: none; }
.booking-icon-button { width: 48px; padding: 0; }

.booking-calendar-card, .booking-request-card { padding: 0; overflow: hidden; }
.booking-alert { margin-bottom: 16px; padding: 13px 16px; border: 1px solid color-mix(in srgb, #e09e28 45%, var(--border, #ddd)); border-radius: 14px; color: #b5760b; background: color-mix(in srgb, #e09e28 10%, var(--surface, #fff)); }
.booking-empty { min-height: 260px; display: grid; place-items: center; padding: 40px; text-align: center; color: var(--muted, #738096); }
.booking-loading { min-height: 100vh; display: grid; place-items: center; background: var(--bg, #f4f7fa); color: var(--muted, #738096); font-weight: 700; }

.week-title { min-width: 230px; text-align: center; font-size: 16px; }
.week-switcher { display: flex; align-items: center; gap: 8px; }
.calendar-scroll { max-width: 100%; overflow: auto; overscroll-behavior-inline: contain; scrollbar-gutter: stable; }
.week-calendar { --hour-height: 70px; min-width: 1210px; display: grid; grid-template-columns: 74px repeat(7, minmax(160px, 1fr)); }
.calendar-corner, .calendar-day-head { position: sticky; top: 0; z-index: 4; min-height: 70px; padding: 14px 10px; border-bottom: 1px solid var(--border, #dfe5ec); background: var(--surface, #fff); }
.calendar-corner { left: 0; z-index: 5; }
.calendar-day-head { text-align: center; border-left: 1px solid var(--border, #dfe5ec); }
.calendar-day-head strong, .calendar-day-head span { display: block; }
.calendar-day-head span { margin-top: 4px; color: var(--muted, #738096); font-size: 12px; }
.calendar-day-head.today { color: var(--accent, #5e8eb2); background: color-mix(in srgb, var(--accent, #5e8eb2) 8%, var(--surface, #fff)); }
.calendar-times { position: sticky; left: 0; z-index: 3; background: var(--surface, #fff); }
.calendar-time { height: var(--hour-height); box-sizing: border-box; padding: 8px 10px; border-bottom: 1px solid var(--border, #dfe5ec); color: var(--muted, #738096); font-size: 12px; text-align: right; }
.calendar-day { position: relative; border-left: 1px solid var(--border, #dfe5ec); background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour-height) - 1px), var(--border, #dfe5ec) calc(var(--hour-height) - 1px), var(--border, #dfe5ec) var(--hour-height)); }
.calendar-slot { position: absolute; z-index: 2; left: calc(6px + var(--slot-column, 0) * ((100% - 12px) / var(--slot-columns, 1))); width: calc((100% - 12px) / var(--slot-columns, 1) - 4px); min-width: 0; min-height: 44px; padding: 8px 9px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--accent, #5e8eb2) 35%, var(--border, #dfe5ec)); border-radius: 12px; color: var(--text, #172033); background: color-mix(in srgb, var(--accent, #5e8eb2) 16%, var(--surface, #fff)); text-decoration: none; box-shadow: 0 6px 16px color-mix(in srgb, #0d1b2a 9%, transparent); transition: transform .15s ease, box-shadow .15s ease; }
.calendar-slot:hover { z-index: 3; transform: translateY(-2px); box-shadow: 0 10px 22px color-mix(in srgb, #0d1b2a 16%, transparent); }
.calendar-slot strong, .calendar-slot span { display: block; overflow: hidden; text-overflow: ellipsis; }
.calendar-slot strong { white-space: nowrap; font-size: 13px; }
.calendar-slot span { margin-top: 3px; color: var(--muted, #738096); font-size: 11px; line-height: 1.25; }
.calendar-slot-teacher { display: block !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendar-slot-parallel { padding-inline: 7px; }
.calendar-slot-parallel strong { font-size: 12px; }
.calendar-slot-parallel span { font-size: 10px; }
.calendar-slot-parallel .calendar-slot-course { white-space: nowrap; }
.calendar-slot-short .calendar-slot-course, .calendar-slot-short .calendar-slot-teacher { display: none !important; }

.booking-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.booking-stat { padding: 18px; border: 1px solid var(--border, #dfe5ec); border-radius: 18px; background: var(--surface, #fff); }
.booking-stat strong { display: block; font-size: 25px; }
.booking-stat span { display: block; margin-top: 5px; color: var(--muted, #738096); }
.booking-request-toolbar .document-filters { flex: 1 1 360px; }
.booking-request-toolbar .table-search { flex: 1 1 220px; }
.booking-table { width: 100%; min-width: 900px; border-collapse: separate; border-spacing: 0; }
.booking-table tbody tr { cursor: pointer; transition: background-color .14s ease; }
.booking-table strong, .booking-table small { display: block; }
.booking-table small { margin-top: 4px; color: var(--muted, #738096); }
.booking-badge { min-height: 30px; display: inline-flex; align-items: center; justify-content: center; padding: 5px 11px; border-radius: 999px; background: color-mix(in srgb, var(--muted, #738096) 12%, var(--surface, #fff)); color: var(--muted, #738096); font-size: 12px; font-weight: 800; white-space: nowrap; }
.booking-badge.new { color: #3e769e; background: color-mix(in srgb, #5e8eb2 17%, var(--surface, #fff)); }
.booking-badge.positive { color: #188363; background: color-mix(in srgb, #2dad83 15%, var(--surface, #fff)); }
.booking-badge.negative { color: #c7444c; background: color-mix(in srgb, #e35b62 14%, var(--surface, #fff)); }
.booking-modal { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: start center; padding: clamp(18px, 5vh, 54px) 18px; overflow-y: auto; background: rgba(9, 15, 22, .68); }
.booking-modal-panel { width: min(760px, 100%); max-height: none; border: 1px solid var(--border, #dfe5ec); border-radius: 26px; background: var(--surface, #fff); box-shadow: 0 32px 90px rgba(4, 10, 18, .35); }
.booking-modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 24px 26px; border-bottom: 1px solid var(--border, #dfe5ec); border-radius: 26px 26px 0 0; background: var(--surface, #fff); }
.booking-modal-head h2 { margin: 0; font-size: 25px; }
.booking-modal-head p { margin: 5px 0 0; color: var(--muted, #738096); }
.booking-modal-body { padding: 24px 26px 30px; }
.booking-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.booking-detail { min-width: 0; padding: 14px; border: 1px solid var(--border, #dfe5ec); border-radius: 15px; background: color-mix(in srgb, var(--surface, #fff) 94%, var(--bg, #f4f7fa)); }
.booking-detail span, .booking-detail strong { display: block; overflow-wrap: anywhere; }
.booking-detail span { color: var(--muted, #738096); font-size: 12px; }
.booking-detail strong { margin-top: 5px; }
.booking-detail.wide { grid-column: 1 / -1; }
.booking-links { display: grid; gap: 8px; margin-top: 18px; }
.booking-links a { padding: 12px 14px; border: 1px solid var(--border, #dfe5ec); border-radius: 13px; color: var(--accent, #4f83a9); text-decoration: none; font-weight: 750; }
.booking-max-id { padding: 12px 14px; border: 1px solid var(--border, #dfe5ec); border-radius: 13px; color: var(--muted, #778195); background: var(--surface-2, #f7f9fb); }
.booking-max-id span, .booking-max-id strong { display: block; }
.booking-max-id span { font-size: 11px; line-height: 1.45; }
.booking-max-id strong { margin-top: 5px; color: var(--text, #192133); font-size: 12px; }
.booking-match-kind { display: inline-flex; align-items: center; min-height: 25px; margin-right: 9px; padding: 2px 9px; border-radius: 999px; color: var(--text, #172033); background: color-mix(in srgb, var(--accent, #5e8eb2) 14%, var(--surface, #fff)); font-size: 11px; font-weight: 850; }
.booking-form { display: grid; gap: 14px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border, #dfe5ec); }
.booking-form label { display: grid; gap: 7px; color: var(--muted, #738096); font-size: 13px; font-weight: 700; }
.booking-form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.booking-form-spacer { flex: 1 1 auto; }
.booking-delete-overlay { position: fixed; inset: 0; z-index: 10002; display: grid; place-items: center; padding: 18px; background: rgba(9, 15, 22, .76); }
.booking-delete-confirm { width: min(480px, 100%); padding: 24px; border: 1px solid color-mix(in srgb, #c7444c 38%, var(--border, #dfe5ec)); border-radius: 22px; background: var(--surface, #fff); box-shadow: 0 28px 80px rgba(4, 10, 18, .42); }
.booking-delete-confirm h3 { margin: 0; color: var(--text, #172033); font-size: 22px; }
.booking-delete-confirm p { margin: 12px 0 22px; color: var(--muted, #738096); line-height: 1.55; }
.booking-delete-confirm > div { display: flex; justify-content: flex-end; gap: 10px; }
.booking-reason-label { display: grid; gap: 7px; margin: -4px 0 20px; color: var(--muted, #738096); font-size: 13px; font-weight: 750; }
.booking-blacklist-note { padding: 13px 14px; border: 1px solid color-mix(in srgb, #c7444c 40%, var(--border, #dfe5ec)); border-radius: 13px; color: #c7444c; background: color-mix(in srgb, #c7444c 9%, var(--surface, #fff)); font-weight: 750; line-height: 1.45; }

.booking-policy-shell { min-height: 100vh; padding: 40px 18px 70px; background: var(--bg, #f4f7fa); color: var(--text, #172033); }
.booking-policy { width: min(900px, 100%); margin: 0 auto; padding: clamp(25px, 5vw, 60px); border: 1px solid var(--border, #dfe5ec); border-radius: 28px; background: var(--surface, #fff); box-shadow: 0 20px 60px color-mix(in srgb, #0d1b2a 9%, transparent); }
.booking-policy-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 32px; }
.booking-policy-logo img { width: 56px; height: 56px; padding: 8px; border-radius: 17px; background: #fff; }
.booking-policy h1 { margin: 0; font-size: clamp(30px, 5vw, 48px); letter-spacing: -.04em; }
.booking-policy h2 { margin: 32px 0 10px; font-size: 21px; }
.booking-policy p, .booking-policy li { line-height: 1.65; color: color-mix(in srgb, var(--text, #172033) 82%, var(--muted, #738096)); }
.booking-policy a { color: var(--accent, #4f83a9); font-weight: 750; overflow-wrap: anywhere; }
.booking-policy ul { padding-left: 22px; }
.booking-policy-meta { margin-top: 9px; color: var(--muted, #738096); }
.max-settings-grid .switch-row { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 18px; text-align: left; }
.max-settings-grid .switch-row > span { min-width: 0; flex: 1; }
.max-settings-grid .switch-row input[type="checkbox"] { flex: 0 0 22px; width: 22px; height: 22px; min-height: 22px; margin: 0; }
.booking-policy-warning { padding: 16px; border: 1px solid #e8b55d; border-radius: 14px; background: color-mix(in srgb, #e09e28 10%, var(--surface, #fff)); color: #9b6509; }

.max-settings-card { grid-column: 1 / -1; margin-top: 0; padding: 22px; overflow: hidden; }
.max-settings-card > form { margin-top: 18px; }
.max-settings-card .settings-heading > svg { flex: 0 0 auto; }
.max-settings-card .max-settings-status { margin-left: auto; }
.max-settings-card .max-settings-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.max-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.max-settings-grid label { display: grid; gap: 7px; min-width: 0; color: var(--muted, #738096); font-size: 13px; font-weight: 700; }
.max-settings-grid .wide { grid-column: 1 / -1; }
.max-settings-grid input, .max-settings-grid select, .max-settings-grid textarea { box-sizing: border-box; width: 100%; border: 1px solid var(--border, #d5dde7); border-radius: 13px; background: var(--surface, #fff); color: var(--text, #172033); padding: 12px 14px; font: inherit; }
.max-settings-grid textarea { min-height: 76px; resize: vertical; }
.max-settings-grid .compact-address textarea { min-height: 48px; }
.max-settings-card .max-hint { margin: 14px 0 0; color: var(--muted, #738096); line-height: 1.5; }
.max-course-content { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--border, #dfe5ec); }
.max-course-content-heading h4 { margin: 0; color: var(--text, #172033); font-size: 19px; }
.max-course-content-heading p { margin: 6px 0 0; color: var(--muted, #738096); line-height: 1.5; }
.max-course-message-list { display: grid; gap: 14px; margin-top: 16px; }
.max-course-message { min-width: 0; padding: 18px; border: 1px solid var(--border, #dfe5ec); border-radius: 18px; background: color-mix(in srgb, var(--surface, #fff) 96%, var(--bg, #f4f7fa)); }
.max-course-message > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.max-course-message > header strong, .max-course-message > header span { display: block; }
.max-course-message > header strong { color: var(--text, #172033); font-size: 16px; }
.max-course-message > header div > span { margin-top: 3px; color: var(--muted, #738096); font-size: 12px; }
.max-course-message > label { display: grid; gap: 7px; margin-top: 12px; color: var(--muted, #738096); font-size: 13px; font-weight: 750; }
.max-course-message input, .max-course-message textarea { box-sizing: border-box; width: 100%; border: 1px solid var(--border, #d5dde7); border-radius: 13px; outline: none; background: var(--surface, #fff); color: var(--text, #172033); padding: 12px 14px; font: inherit; }
.max-course-message textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.max-course-message input:focus, .max-course-message textarea:focus { border-color: var(--accent, #5e8eb2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #5e8eb2) 18%, transparent); }
.max-course-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; margin-top: 14px; }
.max-course-images figure { position: relative; min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--border, #dfe5ec); border-radius: 14px; background: var(--surface, #fff); }
.max-course-images img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.max-course-images figcaption { padding: 7px 9px; color: var(--muted, #738096); font-size: 11px; text-align: center; }
.max-course-images figure button { position: absolute; top: 7px; right: 7px; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.45); border-radius: 10px; color: #fff; background: rgba(19, 27, 39, .78); font-size: 21px; line-height: 1; cursor: pointer; }
.max-course-images-empty { grid-column: 1 / -1; padding: 16px; border: 1px dashed var(--border, #dfe5ec); border-radius: 13px; color: var(--muted, #738096); text-align: center; }
.max-course-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.max-course-actions small { color: var(--muted, #738096); }
.max-course-upload { cursor: pointer; }
.max-course-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.max-course-message-status .booking-alert { margin: 12px 0 0; }
.max-blacklist { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--border, #dfe5ec); }
.max-blacklist-add { display: grid; grid-template-columns: minmax(180px, .7fr) minmax(260px, 1.5fr) auto; align-items: end; gap: 10px; margin-top: 16px; }
.max-blacklist-add label { display: grid; gap: 7px; min-width: 0; color: var(--muted, #738096); font-size: 13px; font-weight: 750; }
.max-blacklist-add input { box-sizing: border-box; width: 100%; height: 48px; border: 1px solid var(--border, #d5dde7); border-radius: 13px; outline: none; background: var(--surface, #fff); color: var(--text, #172033); padding: 0 14px; font: inherit; }
.max-blacklist-add input:focus { border-color: var(--accent, #5e8eb2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #5e8eb2) 18%, transparent); }
.max-blacklist-list { display: grid; gap: 9px; margin-top: 14px; }
.max-blacklist-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; border: 1px solid var(--border, #dfe5ec); border-radius: 15px; background: color-mix(in srgb, var(--surface, #fff) 96%, var(--bg, #f4f7fa)); }
.max-blacklist-row > div { min-width: 0; }
.max-blacklist-row strong, .max-blacklist-row span, .max-blacklist-row small { display: block; overflow-wrap: anywhere; }
.max-blacklist-row strong { color: var(--text, #172033); }
.max-blacklist-row span { margin-top: 4px; color: var(--muted, #738096); line-height: 1.4; }
.max-blacklist-row small { margin-top: 5px; color: var(--muted, #738096); }
.max-blacklist-empty { padding: 20px; border: 1px dashed var(--border, #dfe5ec); border-radius: 14px; color: var(--muted, #738096); text-align: center; }

@media (max-width: 1100px) {
  .booking-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .booking-request-toolbar .document-filters,
  .booking-request-toolbar .table-search,
  .booking-request-toolbar .table-search input { width: 100%; min-height: 44px; height: 44px; }
  .booking-request-toolbar .table-search { padding-block: 0; }
  .booking-toolbar, .booking-toolbar > .button { width: 100%; }
  .week-switcher { width: 100%; justify-content: space-between; }
  .week-title { min-width: 0; flex: 1; }
  .booking-stats { grid-template-columns: 1fr 1fr; }
  .booking-stat { padding: 14px; }
  .booking-stat strong { font-size: 21px; }
  .booking-detail-grid { grid-template-columns: 1fr; }
  .booking-detail.wide { grid-column: auto; }
  .booking-modal { padding: 0; align-items: stretch; }
  .booking-modal-panel { width: 100%; min-height: 100vh; border-radius: 0; border-inline: 0; }
  .booking-modal-head { top: 0; border-radius: 0; padding: 18px; }
  .booking-modal-body { padding: 18px 18px 36px; }
  .booking-form-actions { flex-direction: column-reverse; }
  .booking-form-actions .booking-button { width: 100%; }
  .booking-form-spacer { display: none; }
  .booking-delete-confirm > div { flex-direction: column-reverse; }
  .booking-delete-confirm .booking-button { width: 100%; }
  .max-settings-grid { grid-template-columns: 1fr; }
  .max-settings-grid .wide { grid-column: auto; }
  .max-settings-card { padding: 18px; }
  .max-settings-card .max-settings-actions .button { width: 100%; }
  .max-course-message { padding: 15px; }
  .max-course-message > header { align-items: flex-start; }
  .max-course-actions { align-items: stretch; flex-direction: column; }
  .max-course-actions .button { width: 100%; }
  .max-blacklist-add { grid-template-columns: 1fr; align-items: stretch; }
  .max-blacklist-add .booking-button { width: 100%; }
  .max-blacklist-row { align-items: stretch; flex-direction: column; }
  .max-blacklist-row .booking-button { width: 100%; }
}

@media (max-width: 820px) {
  .booking-table { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .booking-button, .booking-icon-button, .calendar-slot, .booking-table tbody tr { transition: none; }
}
