/* Produkcyjny kalendarz floty */
.calendar-module { min-width: 0; }
.calendar-module .calendar-toolbar { flex-wrap: wrap; }
.calendar-module.is-calendar-transitioning { overflow: clip; }
.calendar-module[aria-busy="true"] .calendar-nav-button { pointer-events: none; }
.calendar-module[aria-busy="true"] .period-control strong { opacity: .62; }
.calendar-state-form { display: flex; align-items: center; gap: 6px; }
.calendar-nav-button { display: inline-grid; width: 32px; height: 32px; place-items: center; color: var(--navy); background: #fff; border: 1px solid var(--line); border-radius: 5px; font-size: calc(18px * var(--panel-font-scale, 1)); font-weight: 900; text-decoration: none; }
.calendar-nav-button.today-button { width: auto; padding: 0 12px; font-size: calc(13px * var(--panel-font-scale, 1)); }
.calendar-filter-popover { position: relative; }
.calendar-filter-popover > summary { display: inline-flex; align-items: center; gap: 5px; list-style: none; cursor: pointer; }
.calendar-filter-popover > summary::-webkit-details-marker { display: none; }
.calendar-filter-popover > form { position: absolute; z-index: 30; top: calc(100% + 8px); right: 0; width: min(680px,calc(100vw - 42px)); padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 18px 45px rgba(6,41,91,.16); }
.calendar-filter-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.calendar-filter-grid fieldset { min-width: 0; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 5px; }
.calendar-filter-grid legend { padding: 0 5px; color: var(--navy); font-size: calc(12px * var(--panel-font-scale, 1)); font-weight: 900; }
.calendar-filter-grid label { display: flex; align-items: center; gap: 7px; margin: 6px 0; color: #526175; font-size: calc(12px * var(--panel-font-scale, 1)); }
.calendar-filter-grid input { margin: 0; }
.calendar-filter-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.calendar-carousel { position: relative; min-width: 0; overflow: hidden; }
.calendar-carousel.is-calendar-sliding .fleet-calendar { margin: 0; }
.calendar-carousel .fleet-calendar.is-calendar-slide-layer { position: absolute; inset: 0; width: 100%; max-width: 100%; clip-path: inset(0 0 0 190px); }
.calendar-vehicle-rail { position: absolute; z-index: 25; top: 0; left: 0; width: 190px; overflow: hidden; background: #fff; border-radius: 7px 0 0 7px; box-shadow: 1px 0 var(--line); pointer-events: none; }
.calendar-vehicle-rail .vehicle-heading, .calendar-vehicle-rail .vehicle-cell { position: relative; left: auto; width: 190px; box-sizing: border-box; }
.calendar-vehicle-rail .vehicle-heading { background: #f8fafc; border-bottom: 1px solid var(--line); }
.calendar-vehicle-rail .vehicle-cell { background: #fff; border-bottom: 1px solid var(--line); }
.calendar-vehicle-rail .vehicle-cell:last-child { border-bottom: 0; }
.calendar-module .fleet-calendar { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.calendar-module .calendar-grid { min-width: max(1080px,calc(190px + var(--calendar-days) * 89px)); grid-template-columns: 190px repeat(var(--calendar-days),minmax(89px,1fr)); }
.calendar-module .calendar-header-row { position: sticky; z-index: 8; top: 0; }
.calendar-module .vehicle-heading { position: sticky; z-index: 10; left: 0; background: #f8fafc; }
.calendar-module .fleet-row { position: relative; min-height: max(84px,calc(84px + (var(--calendar-lanes) - 1) * 50px)); background-image: repeating-linear-gradient(90deg,transparent 0,transparent calc((100% - 190px) / var(--calendar-days) - 1px),#edf0f4 calc((100% - 190px) / var(--calendar-days) - 1px),#edf0f4 calc((100% - 190px) / var(--calendar-days))); background-position: 190px 0; background-size: calc(100% - 190px) 100%; }
.calendar-module .fleet-row::after { display: none; }
.calendar-module .fleet-row.has-current-day::after { display: block; left: calc(190px + (100% - 190px) / var(--calendar-days) * var(--calendar-today)); width: calc((100% - 190px) / var(--calendar-days)); }
.calendar-module .vehicle-cell { min-height: 84px; align-self: stretch; }
.calendar-module .vehicle-cell > img { object-fit: contain; object-position: center; }
.calendar-module .vehicle-cell > span { display: grid; place-items: center; }
.calendar-module .booking-block { top: calc(19px + var(--event-lane) * 50px); left: calc(190px + (100% - 190px) / var(--calendar-days) * var(--event-start)); width: max(22px,calc((100% - 190px) / var(--calendar-days) * var(--event-span) - 4px)); color: inherit; text-decoration: none; cursor: pointer; touch-action: pan-y; user-select: none; }
.calendar-module .booking-block.is-calendar-dragging { z-index: 20; opacity: .88; box-shadow: 0 8px 20px rgba(6,41,91,.22); cursor: grabbing; }
.calendar-module .booking-block.is-calendar-pending { opacity: .55; }
.calendar-block-block { color: #566274; background: #f2f4f6; border-color: #7e8997; border-left-style: dashed; }
.block-legend { background: #7e8997; outline: 1px dashed #7e8997; outline-offset: 2px; }
.calendar-empty { min-width: 1080px; padding: 36px 20px; color: var(--muted); text-align: center; }
.calendar-event-modal form > label + .form-grid { margin-top: 14px; }
.calendar-event-modal label small { display: block; margin-top: 4px; color: var(--muted); font-size: calc(11px * var(--panel-font-scale, 1)); font-weight: 500; }
.calendar-event-modal .button-danger { margin-right: auto; color: #a93642; background: #fff; border-color: #e3b7bc; }
.calendar-module .calendar-footer { flex-wrap: wrap; }
.calendar-module .calendar-footer small { margin-left: auto; }

@media (hover: hover) and (pointer: fine) {
    .calendar-module .fleet-calendar { cursor: grab; }
    .calendar-module .fleet-calendar.is-calendar-panning,
    .calendar-module .fleet-calendar.is-calendar-panning * { cursor: grabbing; user-select: none; }
}

@media (prefers-reduced-motion: reduce) {
    .calendar-module .fleet-calendar, .calendar-module .calendar-toolbar, .calendar-module .calendar-footer { scroll-behavior: auto; }
}

@media (max-width: 760px) {
    .calendar-state-form { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
    .calendar-state-form label, .calendar-state-form select { width: 100%; }
    .calendar-filter-popover { width: 100%; }
    .calendar-filter-popover > summary { justify-content: center; width: 100%; }
    .calendar-filter-popover > form { right: auto; left: 0; width: min(680px,calc(100vw - 32px)); }
    .calendar-filter-grid { grid-template-columns: 1fr; max-height: 56vh; overflow-y: auto; }
    .calendar-filter-actions { position: sticky; bottom: 0; padding-top: 10px; background: #fff; }
    .calendar-module .calendar-footer small { flex-basis: 100%; margin-left: 0; }
}
