/* Keep toolbar controls inside the available grid column at every width. */
.calendar-panel,.day-overview,.calendar-header,.calendar-nav,.type-filters,.employee-select {min-width:0;max-width:100%;box-sizing:border-box}
.calendar-nav,.type-filters,.calendar-header,.topbar-actions {flex-wrap:wrap;row-gap:8px}
.calendar-nav {flex:1 1 480px}
.calendar-nav button {flex-shrink:0}
.type-filters {flex:1 1 360px}
.employee-select {flex-wrap:wrap;margin-left:0}
.employee-select select {min-width:0;max-width:100%}
.calendar-panel {overflow:hidden}
.main-content {grid-template-columns:320px minmax(0,1fr) auto}
.main-content.day-view {grid-template-columns:320px minmax(0,1fr)}
.main-content.orders-collapsed {grid-template-columns:0 minmax(0,1fr) auto}
.main-content.orders-collapsed.day-view {grid-template-columns:0 minmax(0,1fr)}
.main-content.map-collapsed {grid-template-columns:320px minmax(0,1fr) 0}
.main-content.orders-collapsed.map-collapsed {grid-template-columns:0 minmax(0,1fr) 0}
.main-content.team-week-view {grid-template-columns:minmax(0,1fr)}
.calendar-day.past {opacity:1;pointer-events:auto;background:#f8fafc}
.calendar-day.past::after {display:none}
.calendar-day.past .day-events {pointer-events:auto}
.calendar-day-header {font-size:12px;height:auto;padding:7px}
.calendar-day {min-width:0}
.calendar-body {grid-template-columns:repeat(5,minmax(180px,1fr));min-height:0}
.planning-dossiers {margin:0 5px 6px;border:1px solid #d6e0ec;border-radius:6px;background:#f7f9fc;font-size:12px;flex:none}
.planning-dossiers summary {padding:8px;cursor:pointer;color:#314865;font-weight:600}
.planning-dossiers small {font-weight:400}
.planning-dossiers>div {max-height:180px;overflow:auto;padding:4px}
.planning-dossiers .dispo-chip {height:auto;white-space:normal;overflow-wrap:anywhere;padding:8px;font-size:12px;line-height:1.4}
.week-agenda .day-events {display:flex;gap:8px;padding:8px;cursor:default;overflow-y:auto;justify-content:flex-start}
.planning-appointment {display:flex;flex:none;flex-direction:column;gap:4px;text-align:left;width:100%;background:#fff;border:1px solid #ccd8e5;border-left:4px solid #135487;border-radius:7px;padding:10px;color:#16354f;font:inherit;font-size:13px;cursor:pointer;overflow-wrap:anywhere}
.planning-appointment:hover {background:#eaf3fb;border-color:#5688b3}
.planning-appointment.dispo-status-kopiert,.scheduled-order.exchange-event.dispo-status-kopiert {background:#f0fdf4!important;border-color:#86efac!important;border-left-color:#16a34a!important;color:#166534!important}
.planning-appointment.dispo-status-fix-fehlt,.scheduled-order.exchange-event.dispo-status-fix-fehlt {background:#fff1f2!important;border-color:#fca5a5!important;border-left-color:#dc2626!important;color:#991b1b!important}
.planning-appointment.dispo-status-planen,.scheduled-order.exchange-event.dispo-status-planen {background:#fffbeb!important;border-color:#fcd34d!important;border-left-color:#d97706!important;color:#92400e!important}
.planning-appointment.dispo-status-pruefen,.scheduled-order.exchange-event.dispo-status-pruefen {background:#f8fafc!important;border-color:#cbd5e1!important;border-left-color:#64748b!important;color:#475569!important}
.planning-appointment small {color:#53667b;font-size:11px}
.planning-empty {color:#66768a;font-size:12px;padding:8px;line-height:1.5}
.object-history {grid-column:1/-1;flex-basis:100%;border:1px solid #cedcea;border-radius:8px;padding:12px;margin:10px 0;font-size:13px;min-width:0}
.object-history summary {font-weight:700;cursor:pointer;color:#17436a}
.object-history p {line-height:1.5;color:#53657a}
.object-history button,.history-new {padding:7px 10px;border:1px solid #b8cadc;background:#f4f8fc;border-radius:6px;cursor:pointer;color:#17436a;margin:5px 0}
.object-history button:disabled {opacity:.5;cursor:default}
.history-choice {display:flex!important;align-items:flex-start!important;gap:10px;margin:10px 0;padding:8px;border-bottom:1px solid #e0e7ef;max-width:100%}
.history-choice input {width:18px!important;flex:none;margin-top:2px}
.history-choice>span {min-width:0;flex:1}
.history-choice b,.history-choice small,.history-text {display:block;white-space:pre-wrap;overflow-wrap:anywhere}
.history-choice small {color:#596d84;margin:4px 0}
.history-text {max-height:140px;overflow:auto;font-size:12px;font-weight:400}
.history-transfer textarea {width:100%;box-sizing:border-box;margin:8px 0}
.history-transfer {display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.planning-search-status {display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;padding:8px 14px;background:#eaf3fb;color:#163c62;font-size:12px}
.planning-search-status[hidden] {display:none}
.planning-search-status button,[data-week-layout] {border:1px solid #aabbd0;border-radius:6px;padding:7px 10px;background:#fff;color:#173d60;cursor:pointer}
[data-week-layout].active {background:#003b70;color:#fff}
@media(max-width:900px){.main-content:not(.team-week-view):not(.orders-collapsed){grid-template-columns:260px minmax(0,1fr) 0}.calendar-header{padding:10px;gap:10px}.topbar>div:first-child{min-width:0!important;flex-wrap:wrap}.topbar-actions{max-width:100%}}
@media(max-width:600px){.main-content:not(.team-week-view),.main-content.day-view{grid-template-columns:minmax(0,1fr)}.calendar-nav{gap:6px}.calendar-title{font-size:14px;min-width:130px}}
