﻿/* Compact calendar and planning inspector, using the shared GymOS theme. */
.schedule-page { --schedule-muted: #aeb0c0; --schedule-panel: var(--liquid-fill); --schedule-field: rgba(255, 255, 255, .06); --schedule-own: #ff9aa5; max-width: 1660px; }
body.theme-light .schedule-page { --schedule-muted: #5c6070; --schedule-panel: var(--liquid-fill), #fff; --schedule-field: rgba(255, 255, 255, .78); --schedule-own: #b51b36; }
.schedule-page [hidden] { display: none !important; }
.schedule-page .time-header { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 24px; }
.schedule-heading { min-width: 0; }
.schedule-page .page-eyebrow { color: var(--schedule-muted); font-size: 11px; }
.schedule-page h1 { font-size: clamp(26px, 2.5vw, 34px); letter-spacing: -.03em; margin: 4px 0 8px; line-height: 1.2; }
.schedule-page .time-header p { color: var(--schedule-muted); font-size: 13px; line-height: 1.5; }
.schedule-toolbar { display: flex; align-items: flex-end; flex-direction: column; gap: 10px; max-width: 310px; }
.schedule-location-wrap { display: flex; gap: 8px; align-items: center; }
.schedule-location-wrap svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--schedule-muted); }
.schedule-page .schedule-location { color: var(--text); font-weight: 650; overflow-wrap: anywhere; }
.schedule-toolbar label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--schedule-muted); }
.schedule-toolbar select { flex: 1; }
.schedule-page .time-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.schedule-page.can-manage .time-layout { grid-template-columns: minmax(0, 1fr) 290px; }
.schedule-page .time-form, .schedule-page .time-list-panel { background: var(--schedule-panel); border: 1px solid transparent; border-radius: var(--r-lg); box-shadow: var(--shadow-card); min-width: 0; padding: 0; }
/* The joined month grid runs edge to edge; clip it to the glass panel's corners */
.schedule-page .time-list-panel { overflow: clip; }
.schedule-page .time-form { display: flex; flex-direction: column; gap: 16px; padding: 20px; }
.schedule-page h2 { font-size: 19px; font-weight: 750; letter-spacing: -.025em; }
.schedule-page .time-form > h2 { margin-bottom: 4px; }
.schedule-page .time-form > label, .schedule-page .time-row label { display: flex; flex-direction: column; gap: 7px; font-size: 12px; font-weight: 650; color: var(--schedule-muted); }
.schedule-page input, .schedule-page select, .schedule-page textarea { font: inherit; font-size: 13px; color: var(--text); background: var(--schedule-field); border: 1px solid var(--border-glass-strong); border-radius: var(--r-md); padding: 10px 14px; min-width: 0; min-height: 44px; max-width: 100%; color-scheme: dark; }
body.theme-light .schedule-page :is(input, select, textarea) { color-scheme: light; }
.schedule-page option { background: var(--bg); color: var(--text); }
.schedule-page textarea { min-height: 70px; resize: vertical; }
.schedule-page .time-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.schedule-page button { font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; border: 1px solid var(--border-glass-strong); border-radius: var(--r-full); min-height: 44px; padding: 9px 16px; color: var(--text); background: var(--schedule-field); }
.schedule-page button:hover:not(:disabled) { background: var(--glass-12); }
.schedule-page button, .schedule-page button:hover { box-shadow: none; transform: none; }
.schedule-page button::after { display: none; }
.schedule-page button:disabled { opacity: .55; cursor: wait; }
.schedule-page :is(button, input, select, textarea, a):focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.schedule-page button.save-time-btn, .schedule-page button.save-time-btn:hover { background: var(--gradient-brand); color: #fff; border-color: transparent; box-shadow: var(--primary-glow); }
.schedule-page .save-time-btn:hover:not(:disabled) { filter: brightness(1.08); }
.schedule-page input::placeholder, .schedule-page textarea::placeholder { color: var(--schedule-muted); opacity: 1; }
.schedule-page .change-signature-btn { background: transparent; margin-top: -8px; }
.schedule-page .time-panel-header { display: flex; justify-content: space-between; gap: 14px; align-items: center; flex-wrap: wrap; padding: 20px 20px 16px; }
.schedule-page .time-panel-header p { font-size: 12px; color: var(--schedule-muted); margin-top: 5px; }
.schedule-page .time-actions { display: flex; gap: 8px; align-items: center; min-width: 0; }
.schedule-month-control { display: flex; align-items: center; border: 1px solid var(--border-glass-strong); border-radius: var(--r-full); overflow: hidden; }
.schedule-page .month-step { border: 0; border-radius: 0; padding: 8px; width: 36px; background: transparent; display: grid; place-items: center; }
.month-step svg { width: 17px; height: 17px; }
.schedule-page #schicht-month { width: 157px; border: 0; border-radius: 0; padding: 8px 4px; background: transparent; font-size: 12px; }
.schedule-page #schicht-today { background: transparent; }
.schedule-calendar-options { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 0 20px 14px; }
.schedule-filter { display: inline-flex; align-items: center; gap: 9px; min-height: 36px; font-size: 12px; cursor: pointer; }
.schedule-page .schedule-filter input, .schedule-page .employee-check input { width: 17px; height: 17px; min-height: 17px; padding: 0; accent-color: var(--primary-strong); flex-shrink: 0; }
.schedule-legend, .schedule-legend > span { display: flex; align-items: center; gap: 7px; }
.schedule-legend { gap: 14px; font-size: 11px; color: var(--schedule-muted); }
.legend-dot, .calendar-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--schedule-muted); display: inline-block; }
.legend-dot.is-own, .calendar-dot.is-own { background: var(--schedule-own); }
.schedule-page .time-panel-scroll { overflow: visible; }
/* Joined month grid; populated and empty days always have the same height. */
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { border-top: 1px solid var(--border-glass-mid); background: var(--schedule-field); }
.calendar-weekday { font-size: 11px; font-weight: 600; color: var(--schedule-muted); padding: 10px 12px; }
.calendar-grid { gap: 0; }
.schedule-page .calendar-grid > .calendar-cell { display: flex; flex-direction: column; gap: 4px; align-items: stretch; height: 78px; min-height: 0; min-width: 0; padding: 6px 9px; border: 0; border-radius: 0; border-right: 1px solid var(--border-glass); border-bottom: 1px solid var(--border-glass); background: transparent; text-align: left; position: relative; }
.schedule-page .calendar-grid > .calendar-cell:nth-child(7n) { border-right: 0; }
.schedule-page .calendar-grid > .calendar-cell:nth-child(7n), .schedule-page .calendar-grid > .calendar-cell:nth-child(7n - 1) { background: var(--glass-4); }
.schedule-page .calendar-grid > .calendar-cell:hover { background: var(--glass-8); }
.schedule-page .calendar-grid > .calendar-cell.is-outside { color: var(--schedule-muted); background: var(--schedule-field); }
.calendar-cell.is-outside .calendar-daynum { font-weight: 500; }
.schedule-page .calendar-grid > .calendar-cell.is-selected { box-shadow: inset 0 0 0 1.5px var(--primary); background: var(--primary-subtle); z-index: 1; }
.schedule-page .calendar-grid > .calendar-cell:focus-visible { outline-offset: -3px; z-index: 2; }
.calendar-cell-top { display: flex; justify-content: space-between; align-items: center; gap: 2px; }
.calendar-daynum { font-size: 12px; font-weight: 650; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.calendar-cell.is-today .calendar-daynum { color: #fff; background: var(--primary-strong); }
.calendar-count { font-size: 10px; color: var(--schedule-muted); font-variant-numeric: tabular-nums; }
.calendar-cell.has-own .calendar-count::before { content: ""; display: inline-block; width: 5px; height: 5px; margin-right: 4px; vertical-align: 1px; border-radius: 50%; background: var(--schedule-own); }
.calendar-chips { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.calendar-chip { display: block; font-size: 11px; font-weight: 550; line-height: 1.3; padding: 1px 5px; border-radius: 4px; color: var(--text); background: var(--glass-8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendar-chip.is-own { color: var(--schedule-own); background: var(--primary-glass); }
.calendar-more, .calendar-indicators { display: none; }
/* Selected-day details remain directly below the calendar. */
.calendar-day-detail { padding: 20px; }
.calendar-day-detail h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; text-transform: capitalize; }
.schedule-shift { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 15px 0; }
.schedule-shift + .schedule-shift { border-top: 1px solid var(--border-glass); }
.schedule-time { font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1.8; }
.schedule-time span { color: var(--schedule-muted); font-weight: 400; }
.schedule-person { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; min-width: 0; overflow-wrap: anywhere; font-size: 13px; line-height: 1.8; }
.schedule-person p { width: 100%; color: var(--schedule-muted); font-size: 12px; line-height: 1.5; }
.schedule-badge { font-size: 10px; font-weight: 650; padding: 1px 6px; color: var(--schedule-own); background: var(--primary-glass); border-radius: 4px; }
.schedule-home { font-size: 10px; color: var(--schedule-muted); }
.schedule-page .time-entry-actions { display: flex; gap: 6px; }
.schedule-page .time-entry-actions button { font-size: 11px; padding: 7px 9px; min-height: 36px; background: transparent; }
.schedule-page .time-entry-actions button[data-action="delete-schicht"] { color: var(--schedule-muted); }
.time-empty-inline, .schedule-page .time-empty { color: var(--schedule-muted); font-size: 13px; padding: 14px 0; line-height: 1.6; }
.schedule-page .calendar-add-btn { margin-top: 6px; background: transparent; border-style: dashed; width: 100%; color: var(--text); }
.employee-picker { display: flex; flex-direction: column; gap: 8px; }
.employee-picker-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 650; color: var(--schedule-muted); }
.schedule-page .employee-picker-all { min-height: 32px; padding: 4px 10px; font-size: 11px; background: transparent; }
.employee-picker-list { display: flex; flex-direction: column; max-height: 175px; overflow-y: auto; border: 1px solid var(--border-glass-strong); border-radius: var(--r-md); background: var(--schedule-field); padding: 5px; }
.schedule-page .employee-check { display: flex; flex-direction: row; align-items: center; gap: 9px; padding: 8px 6px; min-height: 40px; border-radius: 10px; font-size: 12px; font-weight: 500; color: var(--text); cursor: pointer; }
.employee-check-info { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; flex: 1; min-width: 0; }
.employee-check-name { overflow-wrap: anywhere; }
.employee-check-studio { flex: none; font-size: 10px; font-weight: 650; color: var(--schedule-muted); background: var(--glass-8); border-radius: 999px; padding: 2px 8px; }
.employee-check:hover { background: var(--glass-8); }
.employee-check:has(input:checked) { background: var(--primary-subtle); }
.employee-check:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.employee-picker-count { font-size: 11px; color: var(--schedule-muted); }
@media (min-width: 1550px) {
  .schedule-page.can-manage .time-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .schedule-page .calendar-grid > .calendar-cell { height: 86px; }
  .calendar-chip { font-size: 11px; }
}
@media (max-width: 1250px) {
  .schedule-page.can-manage .time-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; }
  .schedule-page .time-header { align-items: flex-start; }
  .schedule-page.can-manage .schedule-shift { grid-template-columns: 105px minmax(0, 1fr); }
  .schedule-page.can-manage .time-entry-actions { grid-column: 2; }
}
@media (max-width: 1050px) {
  .schedule-page.can-manage .time-layout { grid-template-columns: minmax(0, 1fr); }
  .schedule-page .time-form { order: 1; }
}
@media (max-width: 650px) {
  .schedule-page .time-header { flex-direction: column; gap: 14px; margin-bottom: 18px; }
  .schedule-page .time-header .schedule-heading p { font-size: 12px; }
  .schedule-toolbar { align-items: flex-start; max-width: 100%; width: 100%; }
  .schedule-toolbar label { flex-wrap: wrap; width: 100%; }
  .schedule-toolbar select { width: 100%; }
  .schedule-page .time-panel-header { padding: 16px 14px 10px; gap: 12px; }
  .schedule-page .time-actions { width: 100%; justify-content: space-between; }
  .schedule-month-control { flex: 1; min-width: 0; max-width: 235px; }
  .schedule-page .month-step { flex: 0 0 32px; }
  .schedule-page #schicht-month { width: 100%; flex: 1; font-size: 12px; }
  .schedule-calendar-options { padding: 0 14px 12px; gap: 6px; }
  .schedule-legend { font-size: 10px; }
  .calendar-weekday { text-align: center; padding: 9px 2px; }
  .schedule-page .calendar-grid > .calendar-cell { height: 60px; padding: 7px 5px; align-items: center; gap: 6px; }
  .calendar-cell-top { width: 100%; justify-content: center; }
  .calendar-count { position: absolute; top: 5px; right: 4px; font-size: 9px; }
  .calendar-cell.has-own .calendar-count::before { display: none; }
  .calendar-chips { display: none; }
  .calendar-indicators { display: flex; justify-content: center; align-items: center; gap: 3px; min-height: 6px; }
  .calendar-daynum { width: 25px; height: 25px; font-size: 12px; }
  .calendar-day-detail { padding: 16px 14px; }
  .schedule-page .schedule-shift, .schedule-page.can-manage .schedule-shift { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .schedule-page.can-manage .time-entry-actions { grid-column: auto; margin-top: 8px; }
  .schedule-page .time-entry-actions button { min-height: 44px; font-size: 12px; padding-inline: 12px; }
  .schedule-page .time-form { padding: 18px; }
  .schedule-page .employee-check { min-height: 44px; }
  .schedule-page .employee-picker-all { min-height: 44px; }
  .schedule-page :is(input[type="date"], input[type="time"], select, textarea) { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .schedule-page, .schedule-page * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Central calendar: one location selector and search in the existing GymOS palette. */
.calendar-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 14px; margin-bottom: 18px; }
.calendar-filters label, .calendar-editor-switch { display: flex; flex-direction: column; gap: 7px; color: var(--schedule-muted); font-size: 12px; font-weight: 650; min-width: 0; }
.calendar-filters :is(input, select) { width: 100%; }
.calendar-feedback { color: var(--schedule-muted); font-size: 13px; line-height: 1.5; }
.calendar-feedback:not(:empty) { margin-bottom: 12px; }
.schedule-page #calendar-retry { margin-bottom: 16px; }
.calendar-editor { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.calendar-editor-switch select { width: 100%; }
.calendar-editor .time-form { width: 100%; margin: 0; }
.schedule-page .calendar-editor .time-form { order: 0; }
.calendar-editor .time-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.calendar-editor .time-row:has(input[type="date"]) { grid-template-columns: minmax(0, 1fr); }
.calendar-editor .time-row label { min-width: 0; }
.calendar-editor .time-row input { width: 100%; }
.calendar-editor fieldset { border: 0; padding: 0; min-width: 0; }
.calendar-editor legend { font-size: 12px; color: var(--schedule-muted); font-weight: 650; margin-bottom: 8px; }
.calendar-hint { font-size: 12px; line-height: 1.6; color: var(--schedule-muted); }
.schedule-page .time-form > .calendar-allday { flex-direction: row; align-items: center; }
.schedule-page .calendar-form-error { font-size: 13px; line-height: 1.5; color: var(--schedule-own); }
.calendar-manage-link { font-size: 13px; color: var(--text); padding-block: 10px; text-decoration: underline; text-underline-offset: 4px; }
.calendar-event { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 16px 0; }
.calendar-event + :is(.calendar-event, .schedule-shift), .schedule-shift + .calendar-event { border-top: 1px solid var(--border-glass); }
.calendar-event .schedule-person { gap: 4px 8px; }
.calendar-category { width: 100%; color: var(--schedule-own); font-size: 11px; font-weight: 600; }
.calendar-event .schedule-time small { display: block; white-space: normal; color: var(--schedule-muted); font-weight: 400; font-size: 11px; line-height: 1.6; }
.calendar-description { white-space: pre-wrap; }
.calendar-chip.is-event { background: var(--primary-subtle); color: var(--text); }
.calendar-day-actions { display: flex; gap: 8px; }
.calendar-day-actions #schicht-add-for-day { width: auto; flex-shrink: 0; }
.calendar-groups { padding: 16px 0; border-top: 1px solid var(--border-glass-mid); }
.calendar-groups > summary { font-weight: 650; font-size: 13px; cursor: pointer; min-height: 44px; display: list-item; align-content: center; }
.calendar-groups > .calendar-hint { margin: 8px 0 12px; }
.calendar-group-row { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; font-size: 13px; overflow-wrap: anywhere; border-bottom: 1px solid var(--border-glass); }
.calendar-group-row p { color: var(--schedule-muted); margin-top: 4px; font-size: 12px; }
.calendar-groups #calendar-group-form { margin-top: 16px; }
.schedule-page .calendar-grid > .calendar-cell { height: 94px; }
.calendar-more { display: block; color: var(--schedule-muted); font-size: 10px; line-height: 1.2; }
.schedule-page #schicht-studio-row { display: none; }
@media (max-width: 1250px) {
  .schedule-page.can-manage .calendar-event { grid-template-columns: 105px minmax(0, 1fr); }
  .calendar-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .calendar-filters { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .calendar-filters select { padding-inline: 8px; font-size: 14px; }
  .schedule-page .calendar-grid > .calendar-cell { height: 60px; }
  .calendar-event, .schedule-page.can-manage .calendar-event { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .calendar-event .time-entry-actions { grid-column: auto; }
  .calendar-event .schedule-time small { display: inline; margin-left: 8px; }
  .calendar-editor .time-form .time-row { grid-template-columns: minmax(0, 1fr); }
  .calendar-editor { margin-top: 6px; }
  .calendar-day-actions { flex-wrap: wrap; }
  .calendar-day-actions #schicht-add-for-day { width: 100%; }
}
