﻿/* Planer: eckige Kacheln – kein Border-Radius (außer bewusst runde Marker) */
body.planner-tiles .card,
body.planner-tiles .card-header,
body.planner-tiles .card-body,
body.planner-tiles .card-footer,
body.planner-tiles .btn,
body.planner-tiles .form-control,
body.planner-tiles .form-select,
body.planner-tiles .input-group-text,
body.planner-tiles .modal-content,
body.planner-tiles .modal-header,
body.planner-tiles .modal-footer,
body.planner-tiles .alert,
body.planner-tiles .badge,
body.planner-tiles .dropdown-menu,
body.planner-tiles .list-group-item,
body.planner-tiles .nav-link,
body.planner-tiles .navbar,
body.planner-tiles .progress,
body.planner-tiles .progress-bar,
body.planner-tiles #scheduler-container,
body.planner-tiles #scheduler-container *,
body.planner-tiles #scheduler-content,
body.planner-tiles #scheduler-content *,
body.planner-tiles .scheduler-day-view,
body.planner-tiles .scheduler-day-view *,
body.planner-tiles .scheduler-week-view,
body.planner-tiles .scheduler-week-view *,
body.planner-tiles .scheduler-month-view,
body.planner-tiles .scheduler-month-view *,
body.planner-tiles .scheduler-shop-view,
body.planner-tiles .scheduler-shop-view *,
body.planner-tiles .shop-floor,
body.planner-tiles .shop-floor *,
body.planner-tiles .work-time-bar,
body.planner-tiles .work-time-bar *,
body.planner-tiles .worktime-license-box,
body.planner-tiles .context-menu,
body.planner-tiles .context-menu *,
body.planner-tiles .scheduler-popover-content,
body.planner-tiles .scheduler-popover-content *,
body.planner-tiles .template-dropdown-btn,
body.planner-tiles .template-dropdown-menu,
body.planner-tiles .template-dropdown-menu *,
body.planner-tiles #day-view-info-card,
body.planner-tiles #day-view-info-card *,
body.planner-tiles .open-past-panel,
body.planner-tiles .open-past-panel *,
body.planner-tiles .wt-msg-item,
body.planner-tiles .infobar-wt-msg-plate,
body.planner-tiles .app-update-banner,
body.planner-tiles .current-time-label,
body.planner-tiles .employee-day-aw-container,
body.planner-tiles .employee-aw-bar-container,
body.planner-tiles .employee-aw-bar,
body.planner-tiles .week-day-aw-summary,
body.planner-tiles .week-day-aw-bar-container,
body.planner-tiles .week-day-aw-bar,
body.planner-tiles .month-day-aw-bar-container,
body.planner-tiles .month-day-aw-bar,
body.planner-tiles .clickable-aw-summary,
body.planner-tiles .clickable-employee-aw,
body.planner-tiles .aw-vertical-bar-container,
body.planner-tiles .aw-vertical-bar,
body.planner-tiles .resize-handle,
body.planner-tiles .resize-handle-left,
body.planner-tiles .resize-handle-right,
body.planner-tiles .canceled-overlay-label,
body.planner-tiles .parking-card,
body.planner-tiles .parking-card *,
body.planner-tiles .customers-summary-chip,
body.planner-tiles .customers-table-wrap,
body.planner-tiles .customers-loading,
body.planner-tiles .customers-empty,
body.planner-tiles .customers-page-btn,
body.planner-tiles .stats-loading,
body.planner-tiles .stats-kpi-card,
body.planner-tiles .stats-card,
body.planner-tiles .stats-panel,
body.planner-tiles .stats-day-bar,
body.planner-tiles .stats-hour-bar,
body.planner-tiles .stats-bar-track,
body.planner-tiles .stats-bar-fill,
body.planner-tiles .stats-rank-n,
body.planner-tiles .stats-delta {
    border-radius: 0 !important;
}
body.planner-tiles .loading,
body.planner-tiles .current-time-pin,
body.planner-tiles .stats-emp-dot {
    border-radius: 50% !important;
}

/* Kennzeichen-Kästchen am Balken – im Balken immer geclippt; volle Info nur im Hover-Overlay */
.worktime-license-box {
    display: inline-block;
    min-width: 0;
    max-width: 100%;
    background: #fff;
    color: #333;
    border: 1px solid #bbb;
    border-radius: 0;
    font-size: 11px;
    font-weight: bold;
    padding: 0 6px;
    margin-right: 6px;
    vertical-align: middle;
    box-shadow: 0 1px 2px rgba(0,0,0,0.07);
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

/* Positioniere den Balkennamen unterhalb des Kennzeichens (nur wenn genug Platz) */
.work-time-bar .worktime-license-box,
.work-time-bar.staggered .worktime-license-box {
    display: block;
    margin-right: 0;
    margin-bottom: 0.15rem;
}
.work-time-bar .work-time-title,
.work-time-bar.staggered .work-time-title {
    display: block;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Kurze Termine (≤ ~6 AW): Kennzeichen oben, unsichtbarer Titel als Layout-Anker */
.work-time-bar.is-narrow,
.work-time-bar.staggered.is-narrow {
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    padding: 0 2px;
}
.work-time-bar.is-narrow .worktime-license-box,
.work-time-bar.staggered.is-narrow .worktime-license-box {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 3px;
    font-size: 9px;
    letter-spacing: 0;
    line-height: 1.2;
}
/* Unsichtbarer Fake-Titel: hält Platz, damit Kennzeichen oben bleibt wie bei normalen Balken */
.work-time-bar.is-narrow:has(.worktime-license-box) .work-time-title,
.work-time-bar.staggered.is-narrow:has(.worktime-license-box) .work-time-title {
    display: block;
    visibility: hidden;
    font-size: 10px;
    line-height: 1.1;
    padding: 0 2px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}
.work-time-bar.is-narrow:not(:has(.worktime-license-box)) .work-time-title,
.work-time-bar.staggered.is-narrow:not(:has(.worktime-license-box)) .work-time-title {
    display: block;
    font-size: 10px;
    padding: 0 2px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Status-Icons bleiben unten rechts (wie .worktime-status-container Standard) */

/* Mittlere Termine (≤ ~10 AW): Kennzeichen + Titel einzeilig, stark gekürzt */
.work-time-bar.is-compact:not(.is-narrow),
.work-time-bar.staggered.is-compact:not(.is-narrow) {
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    padding: 1px 3px;
}
.work-time-bar.is-compact:not(.is-narrow) .worktime-license-box,
.work-time-bar.staggered.is-compact:not(.is-narrow) .worktime-license-box {
    font-size: 10px;
    padding: 0 4px;
    letter-spacing: 0.5px;
    margin-bottom: 0;
}
.work-time-bar.is-compact:not(.is-narrow) .work-time-title,
.work-time-bar.staggered.is-compact:not(.is-narrow) .work-time-title {
    font-size: 11px;
    padding: 0 2px;
    line-height: 1.1;
}

/* Hover im Balken: Inhalt bleibt geclippt – volle Texte nur im Floating-Overlay */
.work-time-bar:hover .worktime-license-box,
.work-time-bar.staggered:hover .worktime-license-box,
.work-time-bar:focus-within .worktime-license-box {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    position: static;
    z-index: auto;
    box-shadow: 0 1px 2px rgba(0,0,0,0.07);
}
/* separator removed - not used anymore (kept spacing via .worktime-license-box margin) */
/* Zeit-Inputs im Arbeitszeit-Modal: beide clock-timepicker-Wrapper und Inputs gleichmäßig nebeneinander, volle Breite */
#workTimeModal .input-group.w-100 {
    width: 100%;
    display: flex;
    gap: 0;
}
#workTimeModal .input-group.w-100 .clock-timepicker {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
}
#workTimeModal .input-group.w-100 .clock-timepicker .form-control.flex-grow-1 {
    width: 100%;
    flex: 1 1 0;
    min-width: 0;
}
/* Monatsansicht: Optimierung für exakte Ausrichtung und Scrollbarkeit */
.scheduler-month-view {
    width: 100%;
    min-width: 1200px;
    overflow-x: auto;
}
.scheduler-month-view .month-header,
.scheduler-month-view .month-row {
    min-width: 1200px;
}
.scheduler-month-view .month-header {
    display: grid;
    grid-template-columns: 50px repeat(7, minmax(0, 1fr));
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: bold;
    font-size: 14px;
    width: 100%;
}
.scheduler-month-view .month-header-cell {
    padding: 10px 0;
    text-align: center;
    font-weight: bold;
    border-right: 1px solid #dee2e6;
    min-width: 0;
}
.scheduler-month-view .month-header-cell:first-child {
    min-width: 50px;
    max-width: 50px;
    background: #e9ecef;
    grid-column: 1;
}
.scheduler-month-view .month-header-cell:last-child {
    border-right: none;
}
.scheduler-month-view .month-row {
    display: grid;
    grid-template-columns: 50px repeat(7, minmax(0, 1fr));
    border-bottom: 1px solid #dee2e6;
    min-height: 100px;
    min-width: 1200px;
    width: 100%;
}
.scheduler-month-view .month-day-cell {
    border-right: 1px solid #e9ecef;
    position: relative;
    padding: 26px 6px 10px 6px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 250px;
    min-width: 0;
    background: #fff;
    box-sizing: border-box;
    cursor: pointer;
    transition: background 0.1s;
}
.scheduler-month-view .month-day-cell:last-child {
    border-right: none;
}
.scheduler-month-view .month-day-cell.empty-day {
    background: #f4f4f4;
    cursor: default;
}
.scheduler-month-view .month-day-date {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 2px;
    padding-top: 5px;
    padding-bottom: 10px;
}
.scheduler-month-view .month-day-aw-container {
    margin-top: 2px;
    width: 100%;
}
.scheduler-month-view .month-day-aw-bar-container {
    width: 100%;
    height: 16px;
    background: #e9ecef;
    border-radius: 0;
    margin: 10px 0 10px 0;
    overflow: hidden;
}
.scheduler-month-view .month-day-aw-bar {
    height: 100%;
    border-radius: 0;
    transition: width 0.3s ease;
    position: absolute;
    top: 0;
    left: 0;
}
.scheduler-month-view .month-day-aw-bar.low {
    background: #e74c3c;
}
.scheduler-month-view .month-day-aw-bar.medium {
    background: #f1c40f;
}
.scheduler-month-view .month-day-aw-bar.high {
    background: #2ecc71;
}
.scheduler-month-view .month-day-aw-text {
    font-size: 11px;
    color: #555;
}
/* Allgemeine Stile für größere Schrift */
.scheduler-month-view,
.scheduler-week-view,
.scheduler-day-view {
    font-size: 14px;
}

/* Hauptcontainer */
#scheduler-container {
    background: white;
    border-radius: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    position: relative;
}

/* Tagesansicht - komplett überarbeitet */
.scheduler-day-view .day-view-header {
    display: flex;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0;
}

.scheduler-day-view .employee-header {
    width: 200px;
    padding: 15px;
    font-weight: bold;
    border-right: 1px solid #dee2e6;
    background: #e9ecef;
}

.scheduler-day-view .time-header {
    flex: 1;
    display: flex;
    background: #f8f9fa;
}

.scheduler-day-view .time-slot-header {
    flex: 1;
    text-align: center;
    padding: 15px 5px;
    font-weight: bold;
    border-right: 1px solid #dee2e6;
    font-size: 14px;
}

.scheduler-day-view .time-slot-header:last-child {
    border-right: none;
}

.scheduler-day-view .employee-row {
    display: flex;
    border-left: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    min-height: 40px; /* wie Balkenhöhe */
    position: relative;
    background: white;
    overflow: visible; /* Status-Outline darf über die Namenszelle zeichnen */
}

/* Annahme / Büro: nur Name + leeres Zeitfeld */
.scheduler-day-view .employee-row.is-desk-row {
    background: #fafafa;
}

.scheduler-day-view .employee-row.is-desk-row .employee-name {
    min-height: 40px;
    padding: 4px 8px;
}

.scheduler-day-view .employee-row.is-desk-row .employee-name-main {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scheduler-day-view .time-slots-blank {
    flex: 1;
    min-height: 40px;
    background: #f3f4f6;
    border-left: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
}

/* Schicht als farbiges Band über die ganze Zeitfläche */
.scheduler-day-view .time-slots-blank.desk-shift-band {
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.82rem;
}

.scheduler-day-view .time-slots-blank.desk-shift-band[data-shift="frueh"] {
    background: linear-gradient(90deg, #cfe2ff 0%, #9ec5fe 50%, #cfe2ff 100%);
    color: #084298;
    border-left-color: #0d6efd;
}

.scheduler-day-view .time-slots-blank.desk-shift-band[data-shift="mittel"] {
    background: linear-gradient(90deg, #cff4fc 0%, #9eeaf9 50%, #cff4fc 100%);
    color: #055160;
    border-left-color: #0dcaf0;
}

.scheduler-day-view .time-slots-blank.desk-shift-band[data-shift="spaet"] {
    background: linear-gradient(90deg, #fff3cd 0%, #ffe69c 50%, #fff3cd 100%);
    color: #664d03;
    border-left-color: #ffc107;
}

.scheduler-day-view .time-slots-blank.desk-shift-band:not([data-shift]) {
    background: #eef0f2;
    color: #6c757d;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}

.scheduler-day-view .desk-shift-band-text.is-empty {
    font-weight: 500;
    opacity: 0.85;
}

/* Versteckte Termine ohne sichtbare Mitarbeiterzeile */
#hidden-worktimes-panel .card-header {
    background: #fff3cd;
}

.hidden-wt-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hidden-wt-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    background: #fffdf5;
    border: 1px solid #f0e2a8;
    flex-wrap: wrap;
}

.hidden-wt-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    min-width: 0;
    flex: 1;
}

.hidden-wt-emp {
    color: #1f2937;
}

.hidden-wt-time {
    font-variant-numeric: tabular-nums;
    color: #4b5563;
    font-weight: 600;
}

.hidden-wt-title {
    color: #374151;
}

.hidden-wt-plate {
    background: #111827;
    color: #fff;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    padding: 2px 6px;
}

.hidden-wt-reason {
    color: #92400e;
    font-size: 0.85rem;
    font-weight: 600;
}

.hidden-wt-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.scheduler-day-view .employee-row:last-child {
    border-radius: 0;
}

.scheduler-day-view .employee-row:hover {
    background: #f8f9fa;
}

.scheduler-day-view .employee-name,
.scheduler-week-view .employee-name,
.scheduler-month-view .month-employee-name {
    width: 200px;
    padding: 4px 8px;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    font-weight: bold;
    display: flex;
    flex-direction: row;
    align-items: center;
    /* Unter den Zeitbalken / Status-Glow (time-slots hat höheren z-index) */
    z-index: 1;
    min-height: 40px;
}

.scheduler-day-view .employee-name-main,
.scheduler-week-view .employee-name-main,
.scheduler-month-view .employee-name-main {
    font-size: 14px;
    flex: 1;
    margin-right: 10px;
}

.scheduler-day-view .employee-aw-info {
    font-size: 12px;
    color: #666;
    margin-top: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    align-items: center;
}

.scheduler-day-view .employee-aw-info .aw-used {
    font-weight: bold;
    color: #3498db;
}

.scheduler-day-view .employee-aw-info .aw-max {
    font-weight: bold;
    color: #2c3e50;
}

.scheduler-day-view .employee-aw-info .aw-available {
    color: #27ae60;
    font-size: 14px;
    margin-left: 4px;
}

.scheduler-day-view .employee-aw-info .aw-available.aw-low {
    color: #e74c3c;
    font-weight: bold;
    animation: pulse 2s infinite;
}

.scheduler-day-view .time-slots {
    flex: 1;
    display: flex;
    position: relative;
    /* Über Mitarbeiterzelle: Status-Outline/Glow am linken Rand bleibt sichtbar */
    z-index: 5;
    min-height: 40px;
    background: transparent;
    overflow: visible;
}

.scheduler-day-view .time-slot {
    flex: 1;
    border-right: 1px solid #e9ecef;
    min-height: 40px;
    position: relative;
    transition: background-color 0.2s ease;
}

.scheduler-day-view .time-slot:last-child {
    border-right: none;
}

.scheduler-day-view .time-slot:hover {
    background: rgba(52, 152, 219, 0.1);
    cursor: pointer;
}

/* Wochenansicht mit individuellen Mitarbeiter-Ladebalken */
.scheduler-week-view .week-header {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.scheduler-week-view .week-day {
    flex: 1;
    text-align: center;
    padding: 10px;
    font-weight: bold;
    border-right: 1px solid #dee2e6;
    position: relative;
    min-width: 0; /* Wichtig für korrekte Flex-Berechnung */
}

.scheduler-week-view .week-day:last-child {
    border-right: none;
}

.scheduler-week-view .employee-row {
    display: flex;
    border-bottom: 1px solid #dee2e6;
    min-height: 40px;
}

/* Korrigierte Breite für Mitarbeiter-Namen */
.scheduler-week-view .employee-name {
    width: 150px; /* Gleiche Breite wie in der Header-Zelle */
    min-width: 150px; /* Fixiere die Breite */
    max-width: 150px; /* Verhindere Überlauf */
    padding: 4px 8px;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scheduler-week-view .employee-name-main {
    font-size: 14px;
    margin-bottom: 0;
}

.scheduler-week-view .employee-aw-info {
    font-size: 12px;
    color: #666;
    margin-top: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    align-items: center;
}

.scheduler-week-view .employee-aw-info .aw-used {
    font-weight: bold;
    color: #3498db;
}

.scheduler-week-view .employee-aw-info .aw-max {
    font-weight: bold;
    color: #2c3e50;
}

.scheduler-week-view .employee-aw-info .aw-available {
    color: #27ae60;
    font-size: 14px;
    margin-left: 4px;
}

.scheduler-week-view .employee-aw-info .aw-available.aw-low {
    color: #e74c3c;
    font-weight: bold;
    animation: pulse 2s infinite;
}

.scheduler-week-view .week-slots {
    flex: 1;
    display: flex;
    min-width: 0; /* Wichtig für korrekte Flex-Berechnung */
}

/* Klickbare Ladebalken mit Hover-Effekten */
.clickable-aw-bar {
    cursor: pointer;
    transition: all 0.2s ease;
}

.clickable-aw-bar:hover,
.clickable-aw-bar.aw-bar-hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 100;
}

.week-day-aw-bar-container.clickable-aw-bar:hover,
.week-day-aw-bar-container.clickable-aw-bar.aw-bar-hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border-color: #007bff;
}

.employee-aw-bar-container.clickable-aw-bar:hover,
.employee-aw-bar-container.clickable-aw-bar.aw-bar-hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    border-color: #007bff;
}

/* Visuelles Feedback für klickbare Elemente */
.week-day-aw-text.clickable-aw-bar:hover,
.week-day-aw-text.clickable-aw-bar.aw-bar-hover {
    color: #007bff;
    background: rgba(0, 123, 255, 0.1);
    border-radius: 0;
    padding: 2px 4px;
    margin: 0 -4px;
}

.employee-aw-text.clickable-aw-bar:hover,
.employee-aw-text.clickable-aw-bar.aw-bar-hover {
    color: #007bff;
    background: rgba(0, 123, 255, 0.1);
    border-radius: 0;
    padding: 1px 3px;
    margin: 0 -3px;
}

/* Pointer-Cursor für alle klickbaren AW-Elemente */
.week-day-aw-summary:hover {
    cursor: pointer;
}

.employee-day-aw-container:hover {
    cursor: pointer;
}

/* Tooltip-Hinweis für bessere Usability */
.clickable-aw-bar::after {
    content: 'Klicken für Tagesansicht';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 0;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    margin-bottom: 5px;
}

.clickable-aw-bar:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Spezielle Styles für Wochenansicht */
.scheduler-week-view .week-header .clickable-aw-bar {
    position: relative;
}

/* Individuelle Mitarbeiter-Ladebalken pro Tag */
.scheduler-week-view .day-column {
    flex: 1;
    border-right: 1px solid #e9ecef;
    position: relative;
    min-height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2px 4px;
    background: #fff;
    min-width: 0; /* Wichtig für korrekte Flex-Berechnung */
}

.scheduler-week-view .day-column:last-child {
    border-right: none;
}

/* Header-Zelle für Mitarbeiter-Namen */
.scheduler-week-view .week-header .week-day:first-child {
    width: 150px; /* Gleiche Breite wie Mitarbeiter-Namen */
    min-width: 150px;
    max-width: 150px;
    padding: 10px;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
}

.scheduler-week-view .day-column:hover {
    background: rgba(52, 152, 219, 0.1);
}

/* Mitarbeiter-Ladebalken Container */
.employee-day-aw-container {
    width: 96%;
    margin-bottom: 5px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 0;
    border: 1px solid #e9ecef;
}

.employee-aw-bar-container {
    width: 100%;
    height: 16px;
    background: #e9ecef;
    border: 1px solid #ddd;
    border-radius: 0;
    position: relative;
    overflow: hidden;
    margin-bottom: 3px;
}

.employee-aw-bar {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 0;
    transition: width 0.3s ease;
    position: absolute;
    top: 0;
    left: 0;
}

.employee-aw-bar.warning {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
}

.employee-aw-bar.danger {
    background: linear-gradient(90deg, #dc3545, #c82333);
}

.employee-aw-text {
    font-size: 12px;
    color: #666;
    text-align: center;
    font-weight: bold;
}

.employee-aw-text .aw-value {
    color: #3498db;
}

.employee-aw-text .aw-max {
    color: #2c3e50;
}

.employee-aw-text .aw-percentage {
    color: #6c757d;
    font-size: 9px;
    display: block;
}

/* AW-Anzeige in den Tageszellen */
.day-aw-display {
    text-align: center;
    font-size: 14px;
    color: #666;
    padding: 5px;
}

.day-aw-display .aw-value {
    font-weight: bold;
    color: #3498db;
    font-size: 12px;
}

/* Monatsansicht */
.scheduler-month-view .month-header {
    display: grid;
    grid-template-columns: 50px repeat(7, 1fr);
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.scheduler-month-view .month-header-cell {
    padding: 10px;
    text-align: center;
    font-weight: bold;
    border-right: 1px solid #dee2e6;
}

.scheduler-month-view .month-header-cell:last-child {
    border-right: none;
}

.scheduler-month-view .month-row-cell {
    min-height: 150px;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    border-right: 1px solid #dee2e6;
}

.scheduler-month-view .month-row {
    display: grid;
    grid-template-columns: 50px repeat(7, 1fr);
    border-bottom: 1px solid #dee2e6;
    min-height: 100px;
}

.scheduler-month-view .month-employee-name {
    padding: 15px;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.scheduler-month-view .month-employee-name .employee-name-main {
    font-size: 14px;
    margin-bottom: 5px;
}

.scheduler-month-view .month-employee-name .employee-aw-info {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    align-items: center;
}

.scheduler-month-view .month-employee-name .employee-aw-info .aw-used {
    font-weight: bold;
    color: #3498db;
}

.scheduler-month-view .month-employee-name .employee-aw-info .aw-max {
    font-weight: bold;
    color: #2c3e50;
}

.scheduler-month-view .month-employee-name .employee-aw-info .aw-available {
    color: #27ae60;
    font-size: 14px;
    margin-left: 4px;
}

.scheduler-month-view .month-employee-name .employee-aw-info .aw-available.aw-low {
    color: #e74c3c;
    font-weight: bold;
    animation: pulse 2s infinite;
}

/* Tages-Ladebalken in der Monatsansicht */
.scheduler-month-view .month-day-cell {
    border-right: 1px solid #e9ecef;
    position: relative;
    padding: 25px 10px 30px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 160px;
}

.scheduler-month-view .month-day-cell:hover {
    background: rgba(52, 152, 219, 0.1);
    cursor: pointer;
}

/* AW-Anzeige für Wochen-Tage */
.week-day-aw-summary {
    margin-top: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 0;
    border: 1px solid #e9ecef;
}

.week-day-aw-container {
    margin-top: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.week-day-aw-bar-container {
    width: 100%;
    height: 16px;
    background: #e9ecef;
    border: 1px solid #ddd;
    border-radius: 0;
    position: relative;
    overflow: hidden;
    margin-bottom: 6px;
}

.week-day-aw-bar {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 0;
    transition: width 0.3s ease;
    position: absolute;
    top: 0;
    left: 0;
}

.week-day-aw-bar.warning {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
}

.week-day-aw-bar.danger {
    background: linear-gradient(90deg, #dc3545, #c82333);
}

.week-day-aw-text {
    font-size: 14px;
    color: #666;
    text-align: center;
    font-weight: bold;
}

.week-day-aw-text .aw-used {
    color: #3498db;
}

.week-day-aw-text .aw-max {
    color: #2c3e50;
}

.week-day-aw-text .aw-percentage {
    color: #6c757d;
    font-size: 12px;
    display: block;
    margin-top: 2px;
}

.week-day-aw-text .aw-available {
    color: #27ae60;
}

.week-day-aw-text .aw-available.aw-low {
    color: #e74c3c;
    font-weight: bold;
}

/* Tages-Ladebalken Container */
.month-day-aw-container {
    width: 100%;
    height: 200px;
    text-align: center;
    margin-bottom: 10px;
}

.month-day-aw-bar-container {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border: 1px solid #ddd;
    border-radius: 0;
    position: relative;
    overflow: hidden;
    margin-bottom: 8px;
}

.month-day-aw-bar {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 0;
    transition: width 0.3s ease, background 0.3s ease;
    position: absolute;
    top: 0;
    left: 0;
}

.month-day-aw-bar.warning {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
}

.month-day-aw-bar.danger {
    background: linear-gradient(90deg, #dc3545, #c82333);
}

.month-day-aw-text {
    font-size: 14px;
    color: #666;
    text-align: center;
    font-weight: bold;
    line-height: 1.3;
}

.month-day-aw-text .aw-used {
    color: #3498db;
}

.month-day-aw-text .aw-max {
    color: #2c3e50;
}

.month-day-aw-text .aw-percentage {
    color: #6c757d;
    font-size: 12px;
    display: block;
    margin-top: 2px;
}

/* Mitarbeiter-Hervorhebung in Tagesansicht */
.highlighted-employee {
    background: #ff3985;
    box-shadow: 0 0 0 2px #ff3985;
    z-index: 1 !important;
    position: relative;
    transition: background 0.3s;
}

/* Klickbare Elemente */
.clickable-day-cell {
    cursor: pointer;
    transition: all 0.2s ease;
}

.clickable-day-cell:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Datum-Anzeige */
.month-day-date {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-top: 20px;
    margin-bottom: 0px;
}

/* Klickbare Ladebalken mit Hover-Effekten */
.clickable-aw-summary {
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0;
}

.clickable-employee-aw {
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0;
}

.clickable-aw-summary:hover,
.clickable-employee-aw:hover,
.aw-element-hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    background: rgba(0, 123, 255, 0.05);
}

.week-day-aw-bar-container:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border-color: #007bff;
}

.employee-aw-bar-container:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    border-color: #007bff;
}

/* Visuelles Feedback für klickbare Elemente */
.week-day-aw-text:hover {
    color: #007bff;
}

.employee-aw-text:hover {
    color: #007bff;
}

/* Pointer-Cursor für alle klickbaren AW-Elemente */
.clickable-aw-summary,
.clickable-employee-aw {
    cursor: pointer;
}

/* Tooltip-Hinweis für bessere Usability */
.clickable-aw-summary::after,
.clickable-employee-aw::after {
    content: 'Klicken für Tagesansicht';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 0;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    margin-bottom: 5px;
}

.clickable-aw-summary:hover::after,
.clickable-employee-aw:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Spezielle Styles für Wochenansicht */
.scheduler-week-view .week-header .clickable-aw-summary {
    position: relative;
}

/* Container für vertikalen Ladebalken mit Text */
.aw-container {
    display: flex;
    align-items: center;
    height: 40px;
    width: auto;
    margin: 0;
    flex-shrink: 0;
}

/* Vertikaler Ladebalken */
.aw-vertical-bar-container {
    width: 15px;
    height: 40px;
    background: #e9ecef;
    border: 1px solid #ddd;
    border-radius: 0;
    position: relative;
    overflow: hidden;
    margin-left: 10px;
}

.aw-vertical-bar {
    width: 100%;
    background: linear-gradient(180deg, #28a745, #20c997);
    border-radius: 0;
    transition: height 0.3s ease;
    position: absolute;
    bottom: 0;
    left: 0;
}

/* Prozent-Label über dem vertikalen AW-Balken (mittig) */
.aw-vertical-percent {
    position: absolute;
    font-size: 0.85rem;
    font-weight: 600;
    color: #222;
    white-space: nowrap;
    pointer-events: none;
    transform: translateX(-50%);
    z-index: 50;
}

/* Warnung bei hoher Auslastung */
.aw-vertical-bar.warning {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
}

.aw-vertical-bar.danger {
    background: linear-gradient(90deg, #dc3545, #c82333);
}

/* AW-Text neben dem Balken */
.aw-text {
    font-size: 14px;
    color: #666;
    display: flex;
    flex-direction: column;
    justify-content: center;
    white-space: nowrap;
}

.aw-text .aw-values {
    font-weight: bold;
    color: #3498db;
    margin-bottom: 2px;
    font-size: 14px;
}

.aw-text .aw-available {
    color: #27ae60;
    font-size: 12px;
}

.aw-text .aw-available.aw-low {
    color: #e74c3c;
    font-weight: bold;
}

/* Pulsierende Animation für niedrige AW */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.aw-text .aw-available.aw-low {
    animation: pulse 2s infinite;
}

.week-day-aw-text .aw-available.aw-low {
    animation: pulse 2s infinite;
}

/* Arbeitszeit-Balken – flache Kacheln */
.work-time-bar {
    --bar-color: #3498db;
    position: absolute;
    height: 40px;
    border-radius: 0;
    cursor: move;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    padding-left: 4px;
    padding-right: 4px;
    font-size: 14px;
    color: white;
    overflow: visible; /* Status-Icons unten rechts dürfen überstehen; Text clippt sich selbst */
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid rgba(0, 0, 0, 0.2);
    background: var(--bar-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    z-index: 10000;
    user-select: none;
    will-change: transform;
    backface-visibility: hidden;
    transition: transform 0.1s ease, box-shadow 0.15s ease;
    pointer-events: auto;
    box-sizing: border-box;
}

/* Zusätzlicher Status-Rand um den Balken (einstellbar über Kontextmenü).
   Outline darf nach außen stehen; time-slots liegt über .employee-name,
   damit der Glow links nicht von der Namenszelle überdeckt wird. */
.work-time-bar.has-status-border,
.work-time-bar.staggered.has-status-border {
    outline: 3px solid var(--status-border-color, transparent);
    outline-offset: 1px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

/* Stornierter Status: Ausgegraut, keine Interaktion und optisch zurückgenommen */
.work-time-bar.status-canceled,
.work-time-bar.staggered.status-canceled {
    background: #bdc3c7 !important;
    background-image: none !important;
    border-color: #95a5a6 !important;
    color: #fff !important;
    opacity: 0.5;
    box-shadow: none !important;
    animation: none !important;
    outline: none !important;
    cursor: default;
    z-index: 50;
    text-decoration: line-through;
}
/* Inline-Kontrastfarbe vom Original überschreiben – sonst verschwindet der Titel im Grau */
.work-time-bar.status-canceled .work-time-title,
.work-time-bar.staggered.status-canceled .work-time-title {
    color: #fff !important;
}
/* Keine Status-Icons auf stornierten Balken */
.work-time-bar.status-canceled .worktime-status-container,
.work-time-bar.staggered.status-canceled .worktime-status-container {
    display: none !important;
}

/* Dringender Status: Kunde wartet – Fade-in, kurze Pause, Fade-out */
.work-time-bar.status-customer_waiting,
.work-time-bar.staggered.status-customer_waiting {
    animation: status-pulse-urgent 3.2s ease-in-out infinite !important;
    border-width: 4px !important;
    z-index: 10005 !important;
}

@keyframes status-pulse-urgent {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
        filter: brightness(1);
    }
    /* Fade-in bis ~25 %, dann bis ~65 % halten, danach Fade-out */
    25%,
    65% {
        box-shadow: 0 0 18px 4px rgba(255, 0, 0, 0.85);
        filter: brightness(1.15);
    }
}

/* Verbesserte Lesbarkeit: Schatten + feine Kontur nur für den Balken-Titel
   Damit erhalten nur die Titeltexte eine bessere Lesbarkeit, nicht alle
   Inhalte innerhalb des Balkens. */
.work-time-bar .work-time-title,
.work-time-bar.staggered .work-time-title {
    /* leichte Kontur/Rand für bessere Kanten in unterstützten Browsern */
    -webkit-text-stroke: 0.25px rgba(0,0,0,0.35);
    /* Kein fester Hintergrund im Normalzustand; der schwarze Pill wird nur beim Hover angewendet */
    background: transparent;
    padding: 2px 6px;
    border-radius: 0;
    display: inline-block; /* damit padding und radius wirken */
    line-height: 1; /* verhindert vertikale Verschiebung in engen Balken */
    /* sanfte Transition für Hover-Effekt (inkl. Padding/Height) */
    transition: background 140ms ease, text-shadow 140ms ease, -webkit-text-stroke 140ms ease, padding 140ms ease, height 160ms ease;
    /* Truncate at the end with ellipsis in the default state */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* Hover im Balken: Title bleibt geclippt (volle Anzeige nur im Floating-Overlay) */
.work-time-bar:hover .work-time-title,
.work-time-bar.staggered:hover .work-time-title,
.work-time-bar:focus-within .work-time-title {
    color: #fff !important;
    background: rgba(0, 0, 0, 0.55);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    position: static;
    z-index: auto;
}

/* Text + Status-Icons + Nachrichten-Badge im Balken ausblenden, während das Hover-Panel offen ist */
.work-time-bar.hover-text-hidden .worktime-license-box,
.work-time-bar.hover-text-hidden .work-time-title,
.work-time-bar.hover-text-hidden .worktime-status-container,
.work-time-bar.hover-text-hidden .worktime-msg-badge,
.work-time-bar.staggered.hover-text-hidden .worktime-license-box,
.work-time-bar.staggered.hover-text-hidden .work-time-title,
.work-time-bar.staggered.hover-text-hidden .worktime-status-container,
.work-time-bar.staggered.hover-text-hidden .worktime-msg-badge {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.12s ease;
}

/* Nachrichten-Indikator am Arbeitszeitbalken */
.worktime-msg-badge {
    position: absolute;
    left: -6px;
    top: auto;
    bottom: -6px;
    z-index: 10002;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0;
    background: #fff;
    color: #495057;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
}
.worktime-msg-badge.has-messages {
    background: #eef6ff;
    color: #0d6efd;
    border-color: rgba(13, 110, 253, 0.35);
}
.worktime-msg-badge.has-unread {
    background: #dc3545;
    color: #fff;
    border-color: #b02a37;
    animation: wt-msg-pulse 1.6s ease-in-out infinite;
}
.worktime-msg-badge .worktime-msg-count {
    font-weight: 700;
    font-size: 10px;
}
@keyframes wt-msg-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.55); transform: scale(1); }
    50% { box-shadow: 0 0 0 6px rgba(220, 53, 69, 0); transform: scale(1.06); }
}

.context-menu-msg-badge {
    display: inline-block;
    margin-left: 8px;
    min-width: 18px;
    padding: 0 5px;
    border-radius: 0;
    background: #dc3545;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.wt-msg-list {
    max-height: 340px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding-right: 2px;
}
.wt-msg-empty {
    padding: 1rem 0.5rem;
    text-align: center;
}
.wt-msg-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0;
    padding: 0.55rem 0.75rem;
}
.wt-msg-item.is-mine {
    background: #e8f1ff;
    border-color: #cfe2ff;
}
.wt-msg-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
}
.wt-msg-head-right {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.wt-msg-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}
.wt-msg-actions .btn-link {
    text-decoration: none;
    line-height: 1;
}
.wt-msg-time {
    color: #6c757d;
    white-space: nowrap;
}
.wt-msg-edit-input {
    resize: vertical;
}
.wt-msg-body {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.95rem;
}
.popover-messages {
    color: #0d6efd;
    display: block;
    margin-top: 0.35rem;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
.popover-messages .wt-msg-open-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
}
.popover-messages .text-danger {
    color: #dc3545 !important;
}

/* Infobar: Updates */
#infobarUpdatesBtn.has-new-update {
    border-color: #ffc107;
    color: #996c00;
}
#infobar-updates-badge {
    font-size: 0.65rem;
    font-weight: 700;
}
.infobar-update-link {
    white-space: normal;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}
.infobar-update-date {
    font-weight: 700;
    font-size: 0.92rem;
    margin-bottom: 0.2rem;
}
.infobar-update-topics {
    font-size: 0.82rem;
    color: #495057;
    line-height: 1.35;
}
.infobar-update-topic {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Infobar: Termin-Nachrichten */
#infobarWtMessagesBtn.has-unread-msgs {
    border-color: #dc3545;
    color: #dc3545;
}
.infobar-wt-msg-item {
    white-space: normal;
}
.infobar-wt-msg-plate {
    display: inline-block;
    margin-left: 0.35rem;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 0;
    padding: 0 5px;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.4px;
    color: #333;
}

/* App-Update Hinweis */
.app-update-banner {
    position: sticky;
    top: 0;
    z-index: 20000;
    background: linear-gradient(90deg, #fff3cd 0%, #ffe8a3 100%);
    border-bottom: 1px solid #ffc107;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.app-update-banner[hidden] {
    display: none !important;
}
.app-update-banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.65rem 1rem;
}
.app-update-banner-text {
    color: #664d03;
}
.app-update-changelog {
    color: #664d03;
    text-decoration: underline;
}
.app-update-banner-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Globaler Systemhinweis (Admin) */
.global-notice-banner {
    position: sticky;
    top: 0;
    z-index: 20010;
    border-bottom: 1px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.global-notice-banner[hidden] {
    display: none !important;
}
.global-notice-banner.is-info {
    background: linear-gradient(90deg, #cff4fc 0%, #b6effb 100%);
    border-bottom-color: #0dcaf0;
}
.global-notice-banner.is-warning {
    background: linear-gradient(90deg, #fff3cd 0%, #ffe8a3 100%);
    border-bottom-color: #ffc107;
}
.global-notice-banner.is-danger {
    background: linear-gradient(90deg, #f8d7da 0%, #f5c2c7 100%);
    border-bottom-color: #dc3545;
}
.global-notice-banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.7rem 1rem;
}
.global-notice-banner-text {
    flex: 1 1 280px;
    line-height: 1.45;
}
.global-notice-banner.is-info .global-notice-banner-text,
.global-notice-banner.is-info .global-notice-link {
    color: #055160;
}
.global-notice-banner.is-warning .global-notice-banner-text,
.global-notice-banner.is-warning .global-notice-link {
    color: #664d03;
}
.global-notice-banner.is-danger .global-notice-banner-text,
.global-notice-banner.is-danger .global-notice-link {
    color: #842029;
}
.global-notice-link {
    font-weight: 600;
    text-decoration: underline;
    word-break: break-all;
}
.global-notice-banner-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Offene Alttermine */
#open-past-btn {
    white-space: nowrap;
}
.overview-modal-search {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.85rem;
}
.overview-modal-search > i {
    color: #6c757d;
    flex-shrink: 0;
}
.overview-modal-search .form-control {
    border-radius: 0;
}
.open-past-desc {
    margin-top: 0.25rem;
    color: #495057;
    font-size: 0.9rem;
    line-height: 1.35;
    word-break: break-word;
}
.open-past-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.open-past-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid #ffe08a;
    background: #fffbeb;
    border-radius: 0;
}
.open-past-main {
    min-width: 0;
    flex: 1;
}
.open-past-top,
.open-past-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.75rem;
    align-items: center;
}
.open-past-meta {
    margin-top: 0.2rem;
    color: #5c5c5c;
    font-size: 0.92rem;
}
.open-past-plate {
    display: inline-block;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 0;
    padding: 0 6px;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}
.open-past-status {
    color: #9a6700;
    font-weight: 600;
}

/* Teile wartend (Warte auf Teile / Teile bestellt) */
#parts-waiting-btn,
.parts-waiting-btn {
    white-space: nowrap;
    color: #6f42c1;
    border-color: #6f42c1;
}
#parts-waiting-btn:hover,
.parts-waiting-btn:hover,
#parts-waiting-btn.is-parts-waiting {
    color: #fff;
    background: #6f42c1;
    border-color: #6f42c1;
}
.parts-waiting-days {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.85rem;
}
.parts-waiting-day-chip {
    appearance: none;
    border: 1px solid color-mix(in srgb, #6f42c1 40%, #ced4da);
    background: #fff;
    color: #4a2f7a;
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
    line-height: 1.2;
    cursor: pointer;
    border-radius: 0;
}
.parts-waiting-day-chip:hover {
    border-color: #6f42c1;
    background: color-mix(in srgb, #6f42c1 10%, #fff);
}
.parts-waiting-day-chip.is-active {
    background: #6f42c1;
    border-color: #6f42c1;
    color: #fff;
}
.parts-waiting-day-chip.is-past:not(.is-active) {
    border-color: #c9a0ff;
    background: color-mix(in srgb, #6f42c1 8%, #fff);
}
.parts-waiting-day-chip.is-today:not(.is-active) {
    font-weight: 700;
}
.parts-waiting-day-count {
    display: inline-block;
    margin-left: 0.35rem;
    min-width: 1.25rem;
    padding: 0 0.3rem;
    text-align: center;
    font-weight: 700;
    font-size: 0.78rem;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 0;
}
.parts-waiting-day-chip.is-active .parts-waiting-day-count {
    background: rgba(255, 255, 255, 0.22);
}
.parts-waiting-day-heading {
    margin: 0.55rem 0 0.15rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: #4a2f7a;
}
.parts-waiting-list .open-past-row {
    border-color: color-mix(in srgb, #6f42c1 35%, #ced4da);
    background: color-mix(in srgb, #6f42c1 8%, #fff);
}
.parts-waiting-list .open-past-status {
    color: #6f42c1;
}
.work-time-bar .ui-resizable-e {
    right: -6px;
    width: 12px !important;
    margin: 0;
}
.work-time-bar .ui-resizable-w {
    left: -6px;
    width: 12px !important;
    margin: 0;
}

.work-time-bar:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
    z-index: 1000;
}

.work-time-bar.ui-draggable-dragging {
    z-index: 10000 !important;
    opacity: 0.9;
    box-shadow: none !important;
    transform: none !important;
    cursor: grabbing;
    transition: none;
}

.work-time-bar.ui-resizable-resizing {
    z-index: 10000 !important;
    opacity: 0.9;
    box-shadow: none !important;
    transform: none !important;
    cursor: e-resize !important;
    transition: none;
}

/* Verbesserte Click-Handling für Handles */
.ui-resizable-handle {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: auto;
}

.work-time-bar.work {
    --bar-color: #3498db;
}

.work-time-bar.block {
    --bar-color: #e74c3c;
}

/* Drop-Zonen-Highlight */
.scheduler-day-view .employee-row.drop-active {
    background: rgba(46, 204, 113, 0.2) !important;
    border: 2px dashed #2ecc71;
}

.drop-hover {
    background: rgba(46, 204, 113, 0.3) !important;
    border: 2px dashed #2ecc71;
}

/* Versetzte Balken-Anzeige */
.work-time-bar-container {
    position: relative;
    width: 100%;
    height: 60px; /* Verdoppelt für zwei Reihen */
    min-height: 60px;
    background: transparent;
    border-bottom: 1px solid #e9ecef;
}

/* Obere Reihe für Balken */
.work-time-bar-row-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 30px; /* Halbe Höhe */
    display: flex;
    align-items: center;
}

/* Untere Reihe für Balken */
.work-time-bar-row-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px; /* Halbe Höhe */
    display: flex;
    align-items: center;
}

/* Versetzte Balken-Stile */
.work-time-bar.staggered {
    position: absolute;
    border-radius: 0;
    cursor: move;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    padding-left: 4px;
    padding-right: 4px;
    font-size: 14px;
    color: white;
    overflow: visible;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid rgba(0, 0, 0, 0.2);
    z-index: 100;
    user-select: none;
    will-change: transform;
    backface-visibility: hidden;
    transition: transform 0.1s ease, box-shadow 0.15s ease;
    pointer-events: auto;
}

.work-time-bar.staggered.ui-draggable-dragging {
    z-index: 10000 !important;
    opacity: 0.9;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3) !important;
    transform: none !important;
    cursor: grabbing;
    transition: none;
}

/* Farben für versetzte Balken */
.work-time-bar.staggered.work {
    --bar-color: #3498db;
}

.work-time-bar.staggered.block {
    --bar-color: #e74c3c;
}

/* Resizable Handles für versetzte Balken */
.work-time-bar.staggered .ui-resizable-handle {
    position: absolute;
    font-size: 0.1px;
    display: block;
    z-index: 99999;
}

.work-time-bar.staggered .ui-resizable-e {
  right: -6px;
  width: 12px !important;
  margin: 0;
}

.work-time-bar.staggered .ui-resizable-w {
  left: -6px;
  width: 12px !important;
  margin: 0;
}

/* Kontextmenü für versetzte Balken */
.work-time-bar.staggered.context-menu-active {
    box-shadow: 0 0 0 2px #007bff;
}

/* Drag & Drop Styles für versetzte Balken */
.work-time-bar.staggered.drop-hover {
    background: rgba(46, 204, 113, 0.3) !important;
    border: 2px dashed #2ecc71;
}

/* Leere Zellen für versetzte Anzeige */
.work-time-cell-staggered {
    position: relative;
    width: 100%;
    height: 60px;
    min-height: 60px;
    background: transparent;
    border-bottom: 1px solid #e9ecef;
    border-right: 1px solid #e9ecef;
}

.work-time-cell-staggered:last-child {
    border-right: none;
}

.work-time-cell-staggered:hover {
    background: rgba(52, 152, 219, 0.1);
    cursor: pointer;
}

/* Normale Balken-Höhe */
.scheduler-day-view .work-time-bar,
.scheduler-week-view .work-time-bar,
.scheduler-month-view .work-time-bar {
    height: 40px;
}

/* Versetzte Balken-Höhe */
.scheduler-day-view .work-time-bar.staggered,
.scheduler-week-view .work-time-bar.staggered,
.scheduler-month-view .work-time-bar.staggered {
    height: 50%; /* Halbe Höhe für versetzte Anzeige */
    min-height: 20px;
}

/* Container für versetzte Anzeige */
.time-slots {
    position: relative;
    min-height: 40px;
    height: 40px;
}

/* Versetzte Positionen */
.work-time-bar.top-row {
    top: 0;
}

.work-time-bar.bottom-row {
    bottom: 0;
}

/* Hover-Effekte für versetzte Balken */
.work-time-bar:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
    z-index: 1000;
}

.work-time-bar.ui-draggable-dragging {
    z-index: 10000 !important;
    opacity: 0.9;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3) !important;
    transform: none !important;
    cursor: grabbing;
}

/* Verbesserte Zellen-Höhen für versetzte Anzeige */
.scheduler-day-view .time-slots {
    min-height: 40px;
    height: 40px;
    position: relative;
    z-index: 5;
    overflow: visible;
}

/* Verbesserte Container für versetzte Anzeige */
.time-slot-container {
    position: relative;
    width: 100%;
    height: 40px;
}

/* Versetzte Reihen-Container */
.time-slot-row-top,
.time-slot-row-bottom {
    position: absolute;
    width: 100%;
    height: 50%;
    left: 0;
}

.time-slot-row-top {
    top: 0;
}

.time-slot-row-bottom {
    bottom: 0;
}

/* Verbesserte Balken für versetzte Anzeige */
.work-time-bar.staggered {
    position: absolute;
    height: calc(50% - 2px); /* Etwas kleiner für Abstand */
    min-height: 20px;
}

.work-time-bar.staggered.top-row {
    top: 0;
}

.work-time-bar.staggered.bottom-row {
    bottom: 0;
}

/* Verbesserte Hover-Effekte für versetzte Balken */
.work-time-bar.staggered:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28) !important;
    z-index: 10000 !important;
}

/* Verbesserte Click-Handling für versetzte Balken */
.work-time-bar.staggered {
    pointer-events: auto;
    touch-action: none;
}

/* Verbesserte Positionierung für versetzte Balken */
.work-time-bar.staggered.top-row {
    top: 0;
}

.work-time-bar.staggered.bottom-row {
    bottom: 0;
}

/* Verbesserte Größen für versetzte Balken */
.work-time-bar.staggered {
    height: calc(50% - 2px); /* Halbe Höhe minus Abstand */
    min-height: 20px;
}

/* Verbesserte Dragging-Styles für versetzte Balken */
.work-time-bar.staggered.ui-draggable-dragging {
    cursor: grabbing !important;
    z-index: 10000 !important;
    opacity: 0.9 !important;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3) !important;
    transform: none !important;
}

/* Verbesserte Resizable-Styles für versetzte Balken */
.work-time-bar.staggered.ui-resizable-resizing {
    cursor: col-resize !important;
    z-index: 10000 !important;
    opacity: 0.9 !important;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3) !important;
    transform: none !important;
    transition: none !important;
}

/* Overlay für Klick-Erkennung */
.work-time-cell-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

/* Kontextmenü */
.context-menu {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    min-width: 200px;
    display: none;
    font-size: 14px;
    padding: 5px 0;
    animation: fadeIn 0.15s ease-out;
}

.context-menu-item {
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: #333;
}

.context-menu-item:hover {
    background: #f8f9fa;
    color: #007bff;
}

.context-menu-item.text-danger:hover {
    background: #fff5f5;
    color: #dc3545 !important;
}

.context-menu-item.status-item.active {
    background: linear-gradient(90deg, color-mix(in srgb, #0d6efd 18%, #fff) 0%, #eef2f7 100%);
    color: #111827;
    font-weight: 700;
    box-shadow: inset 4px 0 0 #0d6efd;
}

.context-menu-item.border-color-item.active {
    background: linear-gradient(90deg, color-mix(in srgb, #0d6efd 18%, #fff) 0%, #eef2f7 100%);
    color: #111827;
    font-weight: 700;
    box-shadow: inset 4px 0 0 #0d6efd;
}

.context-menu-item i {
    margin-right: 10px;
    width: 16px;
    text-align: center;
}

.context-menu-separator {
    height: 1px;
    background: #e9ecef;
    margin: 5px 0;
}

/* Kontextmenü-Untermenü */
.context-menu-submenu {
    position: relative;
}

.context-menu-submenu > .context-menu-parent {
    justify-content: flex-start;
}

.context-menu-submenu-arrow {
    margin-left: auto;
    font-size: 10px;
    color: #999;
}

.context-menu-submenu-arrow i {
    margin-right: 0;
    width: auto;
}

.context-menu-submenu-panel {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10001;
    min-width: 220px;
    padding: 5px 0;
    overflow-x: hidden;
}

.context-menu-submenu.is-open > .context-menu-submenu-panel {
    display: block;
}

/* Rechtsklick-Indikator */
.work-time-bar.context-menu-active {
    box-shadow: 0 0 0 2px #007bff;
}

/* Status checkmarks inside work-time bars */
.worktime-status-container {
    position: absolute;
    right: -8px;
    bottom: -8px;
    display: flex;
    align-items: center;
    gap: -6px;
    z-index: 10001;
    pointer-events: none;
    overflow: visible;
}

.worktime-status-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    position: relative;
    pointer-events: none;
}

.worktime-status-check .material-symbols-outlined {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-size: 18px;
    line-height: 1;
    border-radius: 50%;
    padding: 0;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.16);
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.12);
    box-sizing: border-box;
}

.worktime-status-check.status-open .material-symbols-outlined { color: #6f42c1; background-color: rgba(255, 255, 255, 0.75); -webkit-text-stroke-color: rgba(111, 66, 193, 0.5); }
.worktime-status-check.status-prepared .material-symbols-outlined { color: #17a2b8; background-color: rgba(255, 255, 255, 0.75); -webkit-text-stroke-color: rgba(23, 162, 184, 0.5); }
.worktime-status-check.status-postponed .material-symbols-outlined { color: #6c757d; background-color: rgba(255, 255, 255, 0.75); -webkit-text-stroke-color: rgba(108, 117, 125, 0.5); }
.worktime-status-check.status-customer .material-symbols-outlined { color: #0084ff; background-color: rgba(255, 255, 255, 0.75); -webkit-text-stroke-color: rgba(4, 0, 255, 0.5); }
.worktime-status-check.status-inprogress .material-symbols-outlined { color: #eeff00; background-color: rgba(255, 255, 255, 0.75); -webkit-text-stroke-color: rgba(255, 251, 0, 0.5); }
.worktime-status-check.status-waiting-urgent .material-symbols-outlined { color: #ff0000; background-color: rgba(255, 255, 255, 0.9); box-shadow: 0 0 12px rgba(255, 0, 0, 0.5); -webkit-text-stroke-color: rgba(255, 0, 0, 0.5); }
.worktime-status-check.status-done .material-symbols-outlined { color: #00ff22; background-color: rgba(255, 255, 255, 0.75); -webkit-text-stroke-color: rgba(22, 185, 0, 0.5); }
.worktime-status-check.status-consult .material-symbols-outlined { color: #c2185b; background-color: rgba(255, 255, 255, 0.75); -webkit-text-stroke-color: rgba(255, 0, 0, 0.5); }
/* done_all is a single glyph; no separate second-check styling needed */

/* Einheitliches Balken-Hover (ein Panel statt Popover + Overlay) */
.scheduler-popover-container {
    position: fixed;
    z-index: 11000;
    pointer-events: auto;
}
.scheduler-popover-container.worktime-bar-hover {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.16s ease, transform 0.16s ease;
}
.scheduler-popover-container.worktime-bar-hover.show {
    opacity: 1;
    transform: translateY(0);
}
.scheduler-popover-container.worktime-bar-hover.placement-above {
    transform: translateY(-4px);
}
.scheduler-popover-container.worktime-bar-hover.placement-above.show {
    transform: translateY(0);
}
.scheduler-popover-container.worktime-bar-hover.placement-below {
    transform: translateY(4px);
}
.scheduler-popover-container.worktime-bar-hover.placement-below.show {
    transform: translateY(0);
}

.scheduler-popover-content {
    background: rgba(0, 0, 0, 0.92);
    color: white;
    padding: 12px;
    border-radius: 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    font-size: 14px;
    min-width: 220px;
    max-width: 320px;
    text-align: left;
    pointer-events: auto;
    border: 1px solid rgba(255,255,255,0.12);
}

.worktime-bar-hover .bar-hover-license {
    margin-bottom: 8px;
}
.worktime-bar-hover .bar-hover-license .worktime-license-box {
    display: inline-block;
    max-width: 100%;
    overflow: visible;
    text-overflow: clip;
    font-size: 13px;
    letter-spacing: 1px;
    margin: 0;
}

.worktime-bar-hover .popover-arrow {
    position: absolute;
    left: 50%;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    transform: translateX(-50%);
    pointer-events: none;
}
.worktime-bar-hover.placement-above .popover-arrow {
    top: 100%;
    border-top-color: rgba(0, 0, 0, 0.92);
}
.worktime-bar-hover.placement-below .popover-arrow {
    bottom: 100%;
    border-bottom-color: rgba(0, 0, 0, 0.92);
}

.custom-popover-wrapper {
    position: absolute;
    z-index: 10000;
}

.custom-popover {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px;

}

/* Status-Label im Popover */
.popover-status {
    display: flex;
    align-items: center;
    font-weight: 600;
}
.popover-status i {
    width: 14px;
    text-align: center;
}
.popover-status.status-open { color: #b794f6; }
.popover-status.status-prepared { color: #17a2b8; }
.popover-status.status-customer { color: #34b7f1; }
.popover-status.status-inprogress { color: #ffd54f; }
.popover-status.status-consult { color: #c2185b; }
.popover-status.status-postponed { color: #6c757d; }
.popover-status.status-canceled { color: #ff0000; }
.popover-status.status-waiting-urgent { color: #ff3333; font-weight: bold; }
.popover-status.status-done { color: #25d366; }

.popover-header {
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.popover-header strong {
    display: block;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
}

.popover-item {
    margin: 4px 0;
    color: #e0e0e0;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.popover-item .fas {
    margin-right: 8px;
    width: 14px;
    text-align: center;
    font-size: 14px;
}

.popover-type {
    font-style: italic;
    color: #bbb;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(255,255,255,0.2);
    font-size: 14px;
}

.popover-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

/* Dropdown-Menü für Templates */
.template-dropdown {
    position: relative;
    display: inline-block;
    margin-right: 10px;
}

.template-dropdown-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 0;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.template-dropdown-btn:hover {
    background: #0056b3;
}

.template-dropdown-btn i {
    transition: transform 0.2s ease;
}

.template-dropdown-btn.active i {
    transform: rotate(180deg);
}

.template-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    /* Erhöhte Größe für bessere Übersicht auf der Hauptseite */
    min-width: 520px; /* vorher 350px */
    min-height: 180px;
    max-height: 650px; /* vorher 300px */
    overflow-y: auto;
    display: none;
}

/* Infobar dropdown should appear above the sticky navbar/side navigation */
.infobar .dropdown-menu {
    z-index: 2000; /* higher than .sticky-top (1020) */
}

.template-dropdown-menu.show {
    display: block;
}

.template-dropdown-header {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    font-weight: bold;
    color: #333;
    background: #f8f9fa;
}

.template-move .btn {
    padding: 6px 8px;
    line-height: 1;
    font-size: 13px;
}
.template-move .btn i {
    pointer-events: none;
}

.template-move .btn i {
    font-size: 14px;
}

.template-item {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.template-item:last-child {
    border-bottom: none;
}

.template-item:hover {
    background: #f8f9fa;
}

.template-item.work {
    border-left: 4px solid #3498db;
}

.template-item.block {
    border-left: 4px solid #e74c3c;
}

.template-item-color {
    width: 26px;
    height: 26px;
    border-radius: 0;
    margin-right: 14px;
    border: 1px solid rgba(0,0,0,0.12);
}

.template-item-info {
    flex: 1;
}

.template-item-title {
    font-weight: bold;
    font-size: 14px;
    color: #333;
    margin-bottom: 2px;
}

.template-item-details {
    font-size: 12px;
    color: #666;
}

.template-item-time {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.template-item-actions {
    display: flex;
    gap: 5px;
    margin-left: 10px;
}

.template-item-actions .btn {
    padding: 6px 8px;
    font-size: 13px;
    border-radius: 0;
}

.template-item-actions .btn i {
    font-size: 14px;
}

.btn-edit {
    background: #ffc107;
    color: #212529;
    border: none;
}

.btn-delete {
    background: #dc3545;
    color: white;
    border: none;
}

.template-empty {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Dropdown für Template-Erstellung */
.template-create-form {
    padding: 15px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.template-create-form .btn {
    padding: 8px 12px;
    font-size: 13px;
}

.template-create-form label {
    display: block;
    font-size: 12px;
    margin-bottom: 3px;
    color: #555;
}

.template-create-form input,
.template-create-form select,
.template-create-form textarea {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 0;
    font-size: 12px;
}

.template-create-form .form-row {
    display: flex;
    gap: 10px;
}

.template-create-form .form-row .form-group {
    flex: 1;
}

.template-create-buttons {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.template-create-buttons .btn {
    flex: 1;
    padding: 6px;
    font-size: 12px;
}

.btn-primary {
    background: #007bff;
    color: white;
    border: none;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
}

/* Template-Modal Styles */
#templateModal .modal-content {
    border-radius: 0;
}

#templateModal .modal-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 0;
}

#templateModal .modal-title {
    font-weight: bold;
}

#templateModal .form-label {
    font-weight: 500;
    color: #495057;
}

#templateModal .form-control,
#templateModal .form-select {
    border: 1px solid #ced4da;
    border-radius: 0;
    padding: 8px 12px;
}

#templateModal .form-control:focus,
#templateModal .form-select:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

#templateModal .btn-primary {
    background: #007bff;
    border: none;
    padding: 8px 16px;
    border-radius: 0;
    font-weight: 500;
}

#templateModal .btn-primary:hover {
    background: #0056b3;
}

#templateModal .btn-secondary {
    background: #6c757d;
    border: none;
    padding: 8px 16px;
    border-radius: 0;
    font-weight: 500;
}

#templateModal .btn-secondary:hover {
    background: #545b62;
}

/* Template-Hinweis */
#templateHint {
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: none;
}

#templateHint .btn-close {
    padding: 0.5rem;
}

#templateHint strong {
    color: #0c5460;
}

#templateHint.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* Drag & Drop Styles */
.ui-draggable-dragging {
    z-index: 10000 !important;
    opacity: 0.9;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3) !important;
    transform: none !important;
    cursor: grabbing;
}

.ui-resizable-handle {
    position: absolute;
    font-size: 0.1px;
    display: block;
    z-index: 99999;
    background: rgba(255, 255, 255, 0.3) !important;
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
    border-radius: 0;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    pointer-events: auto; /* WICHTIG: Events aktivieren */
}

.ui-resizable-e {
    cursor: e-resize !important;
    width: 8px !important; /* BREITER für bessere Treffsicherheit */
    right: -4px !important; /* ZENTRIERT über die Kante */
    top: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.3) !important;
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
    border-radius: 0;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
    pointer-events: auto;
    z-index: 100000 !important;
}

.ui-resizable-w {
    cursor: w-resize !important;
    width: 8px !important; /* BREITER für bessere Treffsicherheit */
    left: -4px !important; /* ZENTRIERT über die Kante */
    top: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.3) !important;
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
    border-radius: 0;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
    pointer-events: auto;
    z-index: 100000 !important;
}

.work-time-bar:hover .ui-resizable-handle,
.work-time-bar.ui-resizable-resizing .ui-resizable-handle {
    opacity: 1 !important; /* SICHTBAR */
}

.ui-resizable-handle:hover {
    background: rgba(255, 255, 255, 0.6) !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
    opacity: 1 !important;
}

/* Drop-Zonen-Highlight */
.scheduler-day-view .employee-row.drop-active {
    background: rgba(46, 204, 113, 0.2) !important;
    border: 2px dashed #2ecc71;
}

.drop-hover {
    background: rgba(46, 204, 113, 0.3) !important;
    border: 2px dashed #2ecc71;
}

/* Hardware-Beschleunigung für häufig animierte Elemente */
.employee-row,
.time-slots,
.time-slot {
    transform: translateZ(0); /* Hardware-Beschleunigung */
    backface-visibility: hidden;
}

/* Pulsierende Animation für niedrige AW */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Animationen für bessere UX */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .scheduler-day-view .employee-name,
    .scheduler-week-view .employee-name,
    .scheduler-month-view .month-employee-name {
        width: 100px;
        font-size: 12px;
        padding: 10px 5px;
    }

    .employee-aw-info {
        font-size: 10px !important;
    }
    
    .employee-aw-info .aw-available {
        font-size: 9px !important;
    }
    
    .work-time-bar {
        height: 35px;
        font-size: 11px;
        padding: 0 6px;
    }

    .work-time-bar-container {
        height: 50px;
    }
    
    .work-time-bar-row-top,
    .work-time-bar-row-bottom {
        height: 25px;
    }
    
    .work-time-bar-staggered {
        height: 22px;
        font-size: 10px;
        padding: 0 6px;
    }
    
    .work-time-cell-staggered {
        height: 50px;
    }
    
    .scheduler-day-view .time-slot-header {
        font-size: 10px;
        padding: 10px 2px;
    }

    .context-menu {
        min-width: 150px;
        font-size: 12px;
    }
    
    .context-menu-item {
        padding: 8px 12px;
    }
}

/* Touch-Optimierungen */
@media (hover: none) and (pointer: coarse) {
    .work-time-bar {
        height: 45px;
        min-width: 60px;
    }

    .work-time-bar-staggered {
        height: 30px;
        min-width: 60px;
    }
    
    .work-time-bar-staggered .work-time-tooltip {
        font-size: 14px;
        padding: 12px;
    }
}

/* Current time indicator styles */
#scheduler-container {
    position: relative; /* allow absolute child to span rows */
}

.current-time-vertical {
    position: absolute;
    width: 1px;
    /* 35% opacity */
    background: rgba(220,53,69,0.30);
    z-index: 40;
    pointer-events: none;
    box-shadow: 0 0 6px rgba(220,53,69,0.25);
}

.current-time-pin {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #dc3545;
    transform: translateX(-50%);
    z-index: 55;
    pointer-events: none;
    box-shadow: 0 0 6px rgba(220,53,69,0.30);
}

/* Search results dropdown (resource-date search) */
.resource-search-results {
    position: absolute;
    z-index: 12000;
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    max-height: 320px;
    overflow: auto;
    min-width: 220px;
    border-radius: 0;
    padding: 6px 0;
    font-size: 14px;
}
.resource-search-empty {
    padding: 8px 12px;
    color: #666;
}
.resource-search-item {
    padding: 8px 12px;
    border-bottom: 1px solid #f6f6f6;
    cursor: pointer;
    display: block;
}
.resource-search-item:hover {
    background: #f8f9fa;
}
.resource-search-item-title {
    font-weight: 600;
    color: #222;
}
.resource-search-item-subtitle {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.resource-search-item.selected,
.resource-search-item:focus,
.resource-search-item[aria-selected="true"] {
    background: #e9f2ff;
    outline: 2px solid #cfe8ff;
}

.resource-search-loadmore {
    padding: 8px 12px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    color: #007bff;
    border-top: 1px solid #f1f1f1;
}
.resource-search-loadmore:hover {
    background: #f8f9fa;
}

/* Temporary highlight applied after clicking a search result */
.search-click-highlight {
    box-shadow: 0 0 0 4px rgba(0,123,255,0.18) !important;
    background: rgba(0,123,255,0.06) !important;
    transition: box-shadow 0.25s ease, background 0.25s ease;
}

/* Dim overlay shown briefly during search-result highlight */
#search-dim-overlay {
    position: fixed;
    inset: 0; /* top:0; right:0; bottom:0; left:0; */
    background: rgba(0,0,0,0.35);
    z-index: 9995; /* slightly below typical work-time bars (which are ~10000) */
    pointer-events: none;
    opacity: 0;
    transition: opacity 220ms ease;
}

/* Floating clone used to render the highlight above the dim overlay. It is
   absolutely positioned in the page and mirrors the visual of the original
   element while being appended to <body> so it sits above any stacking contexts. */
.search-highlight-clone {
    position: fixed !important;
    pointer-events: none !important;
    z-index: 12060 !important; /* above the dim overlay (9995) and other UI */
    background: transparent !important;
    box-sizing: border-box !important;
}



.current-time-label {
    position: absolute;
    background: rgba(0,0,0,0.75);
    color: #fff;
    padding: 4px 8px;
    border-radius: 0;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    z-index: 60;
    pointer-events: none;
    transform: translateX(-50%);
}

/* Styles for the day view info row (inline editable note) */
.day-view-info-row {
    min-height: 50px;
    background: #00000008;
    border-bottom: 1px solid #eee;
    padding: 8px 12px;
    text-align: center;
}
.day-view-info-row .info-text {
    color: #444;
    font-size: 13px;
}
.day-view-info-row .day-view-info-edit textarea.form-control {
    resize: vertical;
    min-height: 44px;
}

/* Rich text editor toolbar for day view info */
.day-editor-toolbar .editor-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 28px;
    padding: 0.25rem 0.35rem;
}
.day-view-info-edit .editor {
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 0;
    min-height: 60px;
}


/* Mobile: prevent day-view time columns from being compressed — allow horizontal scrolling */
@media (max-width: 768px) {
    /* Enable horizontal scrolling for the time header and the time slot row */
    .scheduler-day-view .time-header,
    .scheduler-day-view .time-slots {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* smooth momentum scrolling on iOS */
    }

    /* Give each hour column a sensible minimum width so they don't collapse */
    .scheduler-day-view .time-header .time-slot-header,
    .scheduler-day-view .time-slots .time-slot {
        flex: 0 0 64px; /* fixed column width on small screens */
        min-width: 64px;
    }

    /* Shrink the employee name column slightly to gain horizontal space for time columns */
    .scheduler-day-view .employee-header,
    .scheduler-day-view .employee-name {
        width: 120px;
        min-width: 120px;
        flex: 0 0 120px;
    }

    /* Ensure percent label is placed outside the name column and not clipped */
    .scheduler-day-view .aw-vertical-percent {
        left: calc(100% + 6px);
        transform: none;
    }
}

/* NEU-Markierung als Buch-Lesezeichen-Bändchen */
.work-time-new-corner {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 60px;
    height: 30px;
    background: transparent;
    color: #ffd700;
    font-size: 28px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 0;
    box-shadow: none;
    z-index: 10;
    white-space: nowrap;
    border: none;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    clip-path: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Spezielle Styling für das Stern-Icon */
.work-time-new-corner .material-symbols-outlined {
    font-size: 40px;
    line-height: 1;
}

/* Pseudo-Element für den umgeknickten Teil des Bändchens */
.work-time-new-corner::before {
    display: none;
}

/* Kleinere Version für versetzte Balken */
.work-time-bar.staggered .work-time-new-corner {
    top: -12px;
    right: -22px;
    width: 50px;
    height: 25px;
    font-size: 20px;
    clip-path: none;
}

.work-time-bar.staggered .work-time-new-corner .material-symbols-outlined {
    font-size: 28px;
    line-height: 1;
}

.work-time-bar.staggered .work-time-new-corner::before {
    display: none;
}

/* Markierung für nicht belegte Tage in der Wochenansicht */
.unoccupied-day {
    background-image: repeating-linear-gradient(
        55deg,
        transparent,
        transparent 8px,
        rgba(200, 200, 200, 0.3) 8px,
        rgba(200, 200, 200, 0.3) 16px
    );
}

/* Markierung für nicht belegte Mitarbeiter-Felder in der Wochenansicht */
.unoccupied-employee-field {
    background-image: repeating-linear-gradient(
        55deg,
        transparent,
        transparent 8px,
        rgba(200, 200, 200, 0.3) 8px,
        rgba(200, 200, 200, 0.3) 16px
    ) !important;
}

/* Markierung für leere Schicht-Felder im Schichtplan */
.unoccupied-shift-cell {
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(200, 200, 200, 0.4) 10px,
        rgba(200, 200, 200, 0.4) 20px
    );
}

/* ========== Werkstatt-Station (Touch / gemeinsames Gerät) ========== */
.station-floor {
    gap: 1rem;
}
/* Werkstatt-Station: eckige Kacheln, kein Radius */
.station-floor,
.station-floor *,
.station-job-card,
.station-job-card * {
    border-radius: 0 !important;
}
.station-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
}
.station-headline {
    min-width: 0;
}
.station-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #212529;
}
.station-sub {
    color: #6c757d;
    margin-top: 0.15rem;
}
.station-clock {
    justify-self: center;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
    font-size: clamp(1.75rem, 3.2vw, 2.6rem);
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1;
    color: #212529;
    padding: 0.35rem 0.75rem;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid #dee2e6;
    white-space: nowrap;
    user-select: none;
}
.station-search-wrap {
    position: relative;
    justify-self: end;
    width: 100%;
    min-width: min(100%, 280px);
    max-width: 420px;
}
@media (max-width: 900px) {
    .station-top {
        grid-template-columns: 1fr;
        justify-items: stretch;
    }
    .station-clock {
        justify-self: center;
    }
    .station-search-wrap {
        justify-self: stretch;
        max-width: none;
    }
}
.station-search-wrap .material-symbols-outlined {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 22px;
}
.station-search-input {
    width: 100%;
    height: 48px;
    border: 1px solid #ced4da;
    border-radius: 0;
    padding: 0 42px 0 44px;
    font-size: 1.05rem;
}
.station-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    font-size: 1.4rem;
    line-height: 1;
    color: #6c757d;
    width: 36px;
    height: 36px;
}
.station-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.station-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid color-mix(in srgb, var(--chip-color) 45%, #fff);
    background: #fff;
    color: #343a40;
    border-radius: 0;
    padding: 0.45rem 0.85rem;
    font-weight: 600;
    min-height: 42px;
}
.station-filter-chip.is-active {
    background: var(--chip-color);
    border-color: var(--chip-color);
    color: #fff;
}
.station-chip-count {
    min-width: 1.5rem;
    text-align: center;
    background: rgba(0,0,0,0.08);
    border-radius: 0;
    padding: 0 0.35rem;
    font-size: 0.9rem;
}
.station-filter-chip.is-active .station-chip-count {
    background: rgba(255,255,255,0.25);
}
.station-filter-chip.is-past-waiting:not(.is-active) {
    border-style: dashed;
}
.station-section-past_waiting .station-section-head h3 {
    color: #5b21b6;
}
.station-section {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 0;
    padding: 0.85rem;
}
.station-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.station-section-head h3 {
    margin: 0;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.station-section-hint {
    color: #6c757d;
    font-size: 0.9rem;
}
.station-section-count {
    background: #f1f3f5;
    border-radius: 0;
    min-width: 2rem;
    text-align: center;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
}
.station-job-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 0.75rem;
}
.station-job-card {
    --bar-color: #3498db;
    position: relative;
    border: 1px solid color-mix(in srgb, var(--bar-color) 55%, #adb5bd);
    border-radius: 0;
    border-left: 8px solid var(--bar-color);
    background:
        linear-gradient(135deg,
            color-mix(in srgb, var(--bar-color) 42%, #fff) 0%,
            color-mix(in srgb, var(--bar-color) 22%, #fff) 55%,
            color-mix(in srgb, var(--bar-color) 12%, #fff) 100%);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bar-color) 18%, transparent);
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 180px;
    overflow: hidden;
}
.station-job-card.is-work {
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--bar-color) 18%, transparent),
        0 0 0 2px rgba(241, 196, 15, 0.35);
}
.station-job-card.is-waiting {
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--bar-color) 18%, transparent),
        0 0 0 2px rgba(111, 66, 193, 0.3);
}
.station-job-card.is-carryover {
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--bar-color) 18%, transparent),
        0 0 0 2px rgba(111, 66, 193, 0.45);
}
.station-job-card.is-done {
    opacity: 0.82;
    filter: saturate(0.85);
}
.station-job-header {
    box-sizing: border-box;
    width: calc(100% + 1.7rem + 8px);
    max-width: none;
    margin: -0.85rem -0.85rem 0 calc(-0.85rem - 8px);
    padding: 0.55rem 0.85rem 0.55rem calc(0.85rem + 8px);
    border-radius: 0;
    background: color-mix(in srgb, var(--bar-color) 72%, #1a1a1a);
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.3;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.station-carryover-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.15rem 0.45rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-shadow: none;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.35);
    white-space: nowrap;
}
.station-carryover-badge .material-symbols-outlined {
    font-size: 0.95rem;
}
.station-job-main {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}
.station-job-plate {
    width: 100%;
    box-sizing: border-box;
    background: #fff;
    border: 2px solid #333;
    border-radius: 0;
    padding: 0.45rem 0.65rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    font-size: 1.25rem;
    text-align: center;
}
.station-job-ticker {
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    border: 1px solid #ced4da;
    background: #111;
    padding: 0.4rem 0.65rem;
    line-height: 1.2;
    text-align: center;
}
.station-job-pause-info {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border: 1px solid color-mix(in srgb, #6f42c1 45%, #ced4da);
    background: color-mix(in srgb, #6f42c1 14%, #fff);
    color: #5a32a3;
    padding: 0.4rem 0.65rem;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.station-job-pause-info .material-symbols-outlined {
    font-size: 1.25rem;
}
.station-job-ticker-text {
    display: inline-block;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    background: linear-gradient(
        90deg,
        #ff0040,
        #ff8c00,
        #ffee00,
        #00e676,
        #00b0ff,
        #d500f9,
        #ff0040
    );
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: station-ticker-colors 2.5s linear infinite;
}
@keyframes station-ticker-colors {
    from { background-position: 0% 50%; }
    to { background-position: 100% 50%; }
}
@media (prefers-reduced-motion: reduce) {
    .station-job-ticker-text {
        animation: none;
        color: #ff8c00;
        -webkit-text-fill-color: #ff8c00;
        background: none;
    }
}
.station-job-title {
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.3;
    word-break: break-word;
}
.station-job-description {
    margin-top: 0.35rem;
    font-size: 0.95rem;
    line-height: 1.4;
    color: #212529;
    word-break: break-word;
    white-space: pre-wrap;
}
.station-job-info {
    flex: 1 1 auto;
    min-width: 0;
}
.station-job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    color: #495057;
    font-size: 0.92rem;
    margin-top: 0.2rem;
}
.station-job-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.4rem;
}
.station-status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 0;
    padding: 0.15rem 0.55rem;
    font-size: 0.8rem;
    font-weight: 700;
    background: color-mix(in srgb, var(--badge-color, #6c757d) 18%, #fff);
    color: #212529;
    border: 1px solid color-mix(in srgb, var(--badge-color, #6c757d) 45%, #fff);
}
.station-status-badge.is-neutral {
    background: #e9ecef;
    border-color: #ced4da;
}
.station-job-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: auto;
}
.station-job-actions-primary,
.station-job-actions-secondary {
    display: grid;
    gap: 0.5rem;
}
.station-job-actions-primary {
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch;
}
.station-job-actions-secondary {
    grid-template-columns: 1fr 1fr;
}
.station-aw-counter {
    min-width: 4.5rem;
    min-height: 48px;
    padding: 0.25rem 0.55rem;
    border-radius: 0;
    border: 1px solid #ced4da;
    background: #fff;
    color: #495057;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.station-aw-counter-value {
    font-size: 1.1rem;
    font-weight: 700;
}
.station-aw-counter-unit {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    opacity: 0.75;
}
.station-aw-counter.is-running {
    border-color: #ced4da;
    background: #fff;
    color: #495057;
}
.station-aw-counter.is-done {
    border-color: #ced4da;
    background: #fff;
    color: #495057;
}
.station-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-height: 48px;
    border-radius: 0;
    border: 1px solid #ced4da;
    background: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    color: #212529;
}
.station-action-btn .material-symbols-outlined {
    font-size: 22px;
}
.station-action-btn.is-start.is-active,
.station-action-btn.is-start:active {
    background: #fff3cd;
    border-color: #f1c40f;
}
.station-action-btn.is-done-btn {
    background: #e8f7ec;
    border-color: #28a745;
    color: #146c2e;
}
.station-action-btn.is-done-btn.is-active {
    background: #28a745;
    color: #fff;
}
.station-action-btn.is-waiting-btn {
    background: #f3e8ff;
    border-color: #6f42c1;
    color: #5a32a3;
}
.station-action-btn.is-waiting-btn.is-active {
    background: #6f42c1;
    color: #fff;
}
.station-action-btn.is-msg {
    background: #eef6ff;
    border-color: #0d6efd;
    color: #0d6efd;
}
.station-action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.station-empty,
.station-empty-soft {
    text-align: center;
    color: #6c757d;
    padding: 1.5rem 1rem;
}
.station-empty .material-symbols-outlined {
    font-size: 2.5rem;
    color: #28a745;
}
@media (max-width: 700px) {
    .station-job-actions-primary,
    .station-job-actions-secondary {
        grid-template-columns: 1fr;
    }
    .station-aw-counter {
        min-height: 44px;
    }
    .station-job-main {
        flex-direction: column;
    }
}

/* ========== Werkstatt-Cockpit (Shop Floor) ========== */
.scheduler-shop-view {
    min-height: 60vh;
}

.shop-floor {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 4px 2px 24px;
}

.shop-floor-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.shop-floor-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.shop-mode-toggle {
    display: inline-flex;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    padding: 3px;
    gap: 2px;
}

.shop-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: transparent;
    color: #6b7280;
    height: 36px;
    padding: 0 10px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
}

.shop-mode-btn .material-symbols-outlined {
    font-size: 18px;
    line-height: 1;
}

.shop-mode-btn.is-active {
    background: #fff;
    color: #111827;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.shop-mine-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    color: #4b5563;
    font-size: 0.9rem;
}

.shop-mine-picker label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-weight: 600;
}

.shop-mine-picker .material-symbols-outlined {
    font-size: 18px;
}

.shop-my-employee-select {
    min-width: 180px;
    border: 1px solid #d1d5db;
    background: #fff;
    padding: 6px 10px;
    color: #111827;
}

.shop-filter-bar.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.shop-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shop-section-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shop-section-head h3 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1f2937;
}

.shop-section-head .material-symbols-outlined,
.shop-rest-toggle .material-symbols-outlined {
    font-size: 22px;
    line-height: 1;
}

.shop-section-count {
    margin-left: auto;
    background: #e5e7eb;
    color: #111827;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 2px 8px;
}

.shop-rest-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #1f2937;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 10px 12px;
    cursor: pointer;
    text-align: left;
}

.shop-rest-toggle .shop-section-count {
    margin-left: auto;
}

.shop-rest-body {
    margin-top: 4px;
}

.shop-empty-soft .material-symbols-outlined {
    color: #9ca3af;
}

.shop-wall-exit {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 20000;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(17,24,39,0.88);
    color: #fff;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
}

.shop-wall-exit .material-symbols-outlined {
    font-size: 20px;
}

/* Wandansicht: wenig Chrome, große Platten */
body.shop-wall-mode .navbar,
body.shop-wall-mode .card.shadow-sm.mb-3,
body.shop-wall-mode .resource-date-headline,
body.shop-wall-mode #resource-date-search,
body.shop-wall-mode .breadcrumb,
body.shop-wall-mode footer {
    display: none !important;
}

body.shop-wall-mode {
    background: #0f172a;
}

body.shop-wall-mode #scheduler-container,
body.shop-wall-mode .scheduler-shop-view,
body.shop-wall-mode .container-fluid {
    max-width: none !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
}

body.shop-wall-mode .shop-floor {
    padding-top: 8px;
}

body.shop-wall-mode .shop-floor-title,
body.shop-wall-mode .shop-section-head h3 {
    color: #f8fafc;
}

body.shop-wall-mode .shop-floor-sub {
    color: #94a3b8;
}

body.shop-wall-mode .shop-mine-picker,
body.shop-wall-mode .shop-filter-bar,
body.shop-wall-mode .shop-layout-toggle,
body.shop-wall-mode .shop-layout-select {
    display: none !important;
}

body.shop-wall-mode .shop-tile-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}

body.shop-wall-mode .shop-job-plate {
    min-width: 160px;
    max-width: none;
    min-height: 88px;
    font-size: 1.85rem;
    letter-spacing: 0.06em;
}

body.shop-wall-mode .shop-job-title {
    font-size: 1.35rem;
}

body.shop-wall-mode .shop-job-card.is-tile .shop-job-plate {
    font-size: 2.1rem;
    min-height: 100px;
}

@media (max-width: 700px) {
    .shop-mode-label {
        display: none;
    }
}

.shop-floor-title {
    font-size: 1.55rem;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.shop-floor-sub {
    margin-top: 4px;
    color: #6b7280;
    font-size: 0.95rem;
}

.shop-layout-toggle {
    display: inline-flex;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    padding: 3px;
    gap: 2px;
}

.shop-layout-btn {
    border: none;
    background: transparent;
    color: #6b7280;
    min-width: 40px;
    height: 36px;
    padding: 0 8px;
    cursor: pointer;
}

.shop-layout-btn.is-active {
    background: #fff;
    color: #111827;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.shop-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.shop-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid color-mix(in srgb, var(--chip-color) 35%, #d1d5db);
    background: #fff;
    color: #1f2937;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.shop-filter-chip .shop-chip-count {
    min-width: 1.5rem;
    text-align: center;
    background: color-mix(in srgb, var(--chip-color) 14%, #f3f4f6);
    color: color-mix(in srgb, var(--chip-color) 70%, #111);
    padding: 3px 7px;
    font-weight: 700;
    font-size: 0.8rem;
}

.shop-filter-chip.is-active {
    background: var(--chip-color);
    border-color: var(--chip-color);
    color: #fff;
}

.shop-filter-chip.is-active .shop-chip-count {
    background: rgba(255,255,255,0.22);
    color: #fff;
}

.shop-job-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shop-job-card {
    --bar-color: #3498db;
    position: relative;
    background: var(--bar-color);
    border: 1px solid rgba(0, 0, 0, 0.2);
    color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    box-sizing: border-box;
}

.shop-job-card.has-status-border {
    outline: 3px solid var(--status-border-color, transparent);
    outline-offset: 1px;
}

.shop-job-card-inner {
    display: flex;
    gap: 14px;
    align-items: stretch;
    padding: 14px 14px 14px 12px;
    position: relative;
    z-index: 1;
}

.shop-job-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.22);
    transform: translateY(-1px);
}

.shop-job-card.is-urgent {
    animation: shop-urgent-pulse 2.2s ease-in-out infinite;
}

@keyframes shop-urgent-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,0,0,0.0); }
    50% { box-shadow: 0 0 0 4px rgba(255,0,0,0.18); }
}

.shop-job-main {
    display: flex;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.shop-job-plate {
    flex: 0 0 auto;
    min-width: 118px;
    max-width: 160px;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 10px;
    text-align: center;
    word-break: break-word;
}

.shop-job-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.shop-job-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.shop-job-line {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.92rem;
}

.shop-job-line i {
    margin-right: 5px;
    opacity: 0.85;
}

.shop-job-desc {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

.shop-job-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.shop-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.92);
    color: color-mix(in srgb, var(--badge-color, #6c757d) 80%, #111);
    border: 1px solid color-mix(in srgb, var(--badge-color, #6c757d) 45%, #fff);
    padding: 3px 8px;
    font-size: 0.8rem;
    font-weight: 600;
}

.shop-status-badge .material-symbols-outlined {
    font-size: 16px;
    line-height: 1;
}

.shop-status-neutral {
    --badge-color: #9ca3af;
}

.shop-job-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-content: center;
    justify-content: flex-end;
    max-width: 100%;
}

.shop-action-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 52px;
    min-height: 48px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.78);
    color: #374151;
    cursor: pointer;
    font-size: 0.66rem;
    font-weight: 600;
    padding: 5px 3px;
    line-height: 1.1;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease, opacity 0.15s ease;
}

.shop-action-btn:not(.is-active) {
    opacity: 0.82;
}

.shop-action-btn .material-symbols-outlined {
    font-size: 18px;
    line-height: 1;
    color: var(--action-color, #6c757d);
    transition: color 0.15s ease;
}

.shop-action-btn.is-active {
    opacity: 1;
    background: var(--action-color);
    border-color: #fff;
    color: #fff;
    font-weight: 800;
    box-shadow:
        0 0 0 2px var(--action-color),
        0 0 0 4px rgba(255, 255, 255, 0.95),
        0 4px 12px rgba(0, 0, 0, 0.35);
    transform: translateY(1px);
}

.shop-action-btn.is-active .material-symbols-outlined {
    color: #fff;
    font-variation-settings: 'FILL' 1, 'wght' 700;
}

/* Helle Statusfarben: dunkler Text für Lesbarkeit */
.shop-action-btn.is-active[style*="f1c40f"] {
    color: #1f2937;
    border-color: #fff;
    box-shadow:
        0 0 0 2px #f1c40f,
        0 0 0 4px rgba(255, 255, 255, 0.95),
        0 4px 12px rgba(0, 0, 0, 0.3);
}

.shop-action-btn.is-active[style*="f1c40f"] .material-symbols-outlined {
    color: #1f2937;
}

.shop-action-btn:hover:not(.is-active) {
    opacity: 1;
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--action-color);
}

.shop-action-btn.is-active:hover {
    filter: brightness(1.06);
}

.shop-job-card.is-compact .shop-job-card-inner {
    flex-direction: column;
    padding: 10px;
}

.shop-job-card.is-compact .shop-job-plate {
    flex: 0 0 auto;
    align-self: stretch;
    min-width: 0;
    width: 100%;
    max-width: none;
    font-size: 1rem;
    padding: 8px;
}

.shop-job-card.is-compact .shop-job-main {
    flex-direction: column;
    gap: 8px;
}

.shop-job-card.is-compact .shop-job-actions {
    max-width: none;
    justify-content: stretch;
}

.shop-job-card.is-compact .shop-action-btn {
    flex: 1;
    min-width: 0;
}

/* --- Kachelansicht --- */
.shop-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.shop-job-card.is-tile {
    border-left-width: 0;
    border-top: none;
    min-height: 100%;
}

.shop-job-card.is-tile .shop-job-card-inner {
    flex-direction: column;
    height: 100%;
    padding: 0;
}

.shop-job-card.is-tile .shop-job-main {
    flex-direction: column;
    gap: 0;
}

.shop-job-card.is-tile .shop-job-plate {
    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: 72px;
    font-size: 1.35rem;
    border-radius: 0;
}

.shop-job-card.is-tile .shop-job-meta {
    padding: 12px 14px 8px;
}

.shop-job-card.is-tile .shop-job-actions {
    max-width: none;
    padding: 0 10px 12px;
    margin-top: auto;
    justify-content: stretch;
}

.shop-job-card.is-tile .shop-action-btn {
    flex: 1;
    min-width: 0;
    min-height: 48px;
}

.shop-job-card.is-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

/* --- Voll-3D-Design --- */
.shop-solid3d-stage {
    perspective: 1600px;
    perspective-origin: 50% 20%;
    padding: 8px 4px 28px;
}

.shop-solid3d-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px 22px;
    transform-style: preserve-3d;
}

.shop-job-card.is-solid3d {
    border: none;
    border-left: none;
    background: transparent;
    box-shadow: none;
    outline: none;
    transform-style: preserve-3d;
    transition: transform 0.25s ease;
}

.shop-job-card.is-solid3d.has-status-border .shop-job-card-inner {
    outline: 3px solid var(--status-border-color, transparent);
    outline-offset: 2px;
}

.shop-job-card.is-solid3d .shop-job-card-inner {
    flex-direction: column;
    background: var(--bar-color, #3498db);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 0;
    padding: 0;
    overflow: hidden;
    color: #fff;
    transform: rotateX(8deg) rotateY(-8deg) translateZ(0);
    box-shadow:
        12px 18px 0 color-mix(in srgb, var(--bar-color) 55%, #1f2937),
        18px 26px 28px rgba(0,0,0,0.28),
        inset 0 1px 0 rgba(255,255,255,0.25),
        inset 0 -8px 16px rgba(0,0,0,0.12);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.shop-job-card.is-solid3d .shop-3d-face {
    position: absolute;
    pointer-events: none;
    z-index: 0;
}

.shop-job-card.is-solid3d .shop-3d-face-top {
    left: 8px;
    right: -6px;
    top: -10px;
    height: 14px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--bar-color) 40%, #94a3b8), color-mix(in srgb, var(--bar-color) 70%, #e2e8f0));
    transform: skewX(-40deg);
    border-radius: 0;
    opacity: 0.9;
}

.shop-job-card.is-solid3d .shop-3d-face-side {
    top: 6px;
    bottom: -8px;
    right: -11px;
    width: 14px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--bar-color) 45%, #64748b), color-mix(in srgb, var(--bar-color) 25%, #0f172a));
    transform: skewY(-38deg);
    border-radius: 0;
    opacity: 0.95;
}

.shop-job-card.is-solid3d .shop-3d-glow {
    position: absolute;
    inset: auto 10% -18px 10%;
    height: 24px;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.35), transparent 70%);
    filter: blur(4px);
    z-index: 0;
    pointer-events: none;
}

.shop-job-card.is-solid3d .shop-job-main {
    flex-direction: column;
    gap: 0;
}

.shop-job-card.is-solid3d .shop-job-plate {
    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: 78px;
    font-size: 1.4rem;
    background: linear-gradient(180deg, #1f2937 0%, #0b1220 100%);
    box-shadow: inset 0 -1px 0 rgba(255,255,255,0.08);
    text-shadow: 0 2px 0 rgba(0,0,0,0.45);
}

.shop-job-card.is-solid3d .shop-job-meta {
    padding: 14px 14px 8px;
}

.shop-job-card.is-solid3d .shop-job-title {
    font-size: 1.15rem;
}

.shop-job-card.is-solid3d .shop-job-actions {
    max-width: none;
    padding: 0 10px 12px;
    justify-content: stretch;
}

.shop-job-card.is-solid3d .shop-action-btn {
    flex: 1;
    min-width: 0;
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(4px);
    border-radius: 0;
}

.shop-job-card.is-solid3d:hover {
    transform: none;
    box-shadow: none;
    animation: none;
}

.shop-job-card.is-solid3d:hover .shop-job-card-inner {
    transform: rotateX(4deg) rotateY(-4deg) translateY(-6px) translateZ(12px);
    box-shadow:
        16px 24px 0 color-mix(in srgb, var(--bar-color) 60%, #111827),
        22px 34px 36px rgba(0,0,0,0.32),
        inset 0 1px 0 rgba(255,255,255,0.35);
}

.shop-job-card.is-solid3d.is-urgent .shop-job-card-inner {
    animation: shop-3d-urgent 2s ease-in-out infinite;
}

@keyframes shop-3d-urgent {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.08); }
}

.shop-layout-solid3d .shop-floor-title {
    background: linear-gradient(90deg, #111827, #334155);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.shop-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    align-items: start;
}

.shop-board-col {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-top: 3px solid var(--col-color, #6c757d);
    min-height: 180px;
}

.shop-board-col-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    font-weight: 700;
    font-size: 0.9rem;
    color: #1f2937;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}

.shop-board-col-head .material-symbols-outlined {
    font-size: 18px;
    color: var(--col-color);
}

.shop-board-col-count {
    margin-left: auto;
    background: #f3f4f6;
    padding: 2px 8px;
    font-size: 0.8rem;
}

.shop-board-col-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
}

.shop-empty-col,
.shop-empty-state {
    text-align: center;
    color: #9ca3af;
    padding: 28px 12px;
}

.shop-empty-state .material-symbols-outlined {
    font-size: 48px;
    color: #22c55e;
}

.shop-empty-state h3 {
    margin: 8px 0 4px;
    color: #374151;
}

@media (max-width: 900px) {
    .shop-job-card-inner {
        flex-direction: column;
    }

    .shop-job-actions {
        max-width: none;
        justify-content: stretch;
    }

    .shop-action-btn {
        flex: 1;
    }

    .shop-job-plate {
        width: 100%;
        max-width: none;
    }

    .shop-solid3d-stage {
        perspective: none;
    }

    .shop-job-card.is-solid3d .shop-job-card-inner,
    .shop-job-card.is-solid3d:hover .shop-job-card-inner {
        transform: none;
        box-shadow: 0 10px 24px rgba(0,0,0,0.18);
    }

    .shop-job-card.is-solid3d .shop-3d-face {
        display: none;
    }
}

/* --- Layout-Picker --- */
.shop-layout-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.shop-layout-select {
    min-width: 200px;
    border: 1px solid #d1d5db;
    background: #fff;
    padding: 7px 10px;
    color: #111827;
    font-size: 0.88rem;
    font-weight: 600;
}

/* --- 1. Mitarbeiter-Wand --- */
.shop-staff-wall {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    align-items: start;
}

.shop-staff-col {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    min-height: 160px;
}

.shop-staff-col-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.shop-staff-name {
    font-weight: 700;
    color: #111827;
}

.shop-staff-count {
    background: #e5e7eb;
    padding: 2px 8px;
    font-size: 0.8rem;
    font-weight: 700;
}

.shop-staff-waiting {
    margin-left: auto;
    color: #dc2626;
    font-size: 0.8rem;
    font-weight: 700;
}

.shop-staff-col-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
}

/* --- 2. Ampel-Timeline --- */
.shop-timeline-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shop-timeline-header {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
    gap: 2px;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 600;
}

.shop-timeline-hour {
    text-align: center;
}

.shop-timeline-track {
    position: relative;
    min-height: 58px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    overflow: visible;
}

.shop-timeline-now {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ef4444;
    z-index: 3;
    pointer-events: none;
}

.shop-timeline-seg {
    position: absolute;
    min-height: 38px;
    height: auto;
    border: 1px solid rgba(0, 0, 0, 0.2);
    background: var(--bar-color, #3498db);
    color: #fff;
    cursor: pointer;
    padding: 4px 6px;
    overflow: visible;
    box-sizing: border-box;
    z-index: 2;
}

.shop-timeline-seg.has-status-border {
    outline: 3px solid var(--status-border-color, transparent);
    outline-offset: 1px;
}

.shop-timeline-seg.is-overdue {
    box-shadow: 0 0 0 3px rgba(253, 126, 20, 0.55), 0 0 12px rgba(253, 126, 20, 0.35);
    animation: shop-timeline-overdue 1.8s ease-in-out infinite;
}

@keyframes shop-timeline-overdue {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.12); }
}

.shop-timeline-seg-plate {
    display: block;
    font-weight: 800;
    font-size: 0.78rem;
    line-height: 1.25;
    white-space: normal;
    word-break: break-word;
}

.shop-timeline-seg-aw {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.25;
    opacity: 0.92;
    white-space: normal;
    word-break: break-word;
}

.shop-timeline-legend {
    display: flex;
    gap: 16px;
    color: #6b7280;
    font-size: 0.82rem;
}

.shop-legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 6px;
    vertical-align: middle;
}

.shop-legend-dot.is-overdue { background: #fd7e14; }
.shop-legend-dot.is-now { background: #ef4444; }

/* --- 3. Gate-Board --- */
.shop-gate-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

.shop-gate-col {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-top: 4px solid var(--gate-color, #6c757d);
    min-height: 220px;
}

.shop-gate-col-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    font-weight: 700;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.shop-gate-col-head .material-symbols-outlined {
    color: var(--gate-color);
    font-size: 20px;
}

.shop-gate-count {
    margin-left: auto;
    background: #e5e7eb;
    padding: 2px 8px;
    font-size: 0.8rem;
}

.shop-gate-col-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
}

.shop-gate-card {
    --bar-color: #3498db;
    background: var(--bar-color);
    border: 1px solid rgba(0, 0, 0, 0.2);
    color: #fff;
    padding: 12px;
    cursor: pointer;
    box-sizing: border-box;
}

.shop-gate-card.has-status-border {
    outline: 3px solid var(--status-border-color, transparent);
    outline-offset: 1px;
}

.shop-gate-plate {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.shop-gate-title {
    font-weight: 700;
    margin-top: 4px;
}

.shop-gate-meta {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-top: 2px;
}

.shop-gate-advance {
    margin-top: 10px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.92);
    color: #111827;
    font-weight: 700;
    padding: 8px 10px;
    cursor: pointer;
}

/* --- 4. Teile-Engpass --- */
.shop-parts-view {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.shop-parts-group {
    border: 1px solid #e5e7eb;
    background: #fff;
}

.shop-parts-group-head {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 10px 12px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    color: #6f42c1;
}

.shop-parts-group-title {
    display: block;
    width: 100%;
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.3;
    color: #1f2937;
    word-break: break-word;
}

.shop-parts-group-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.shop-parts-group-head .material-symbols-outlined {
    font-size: 20px;
    color: #6f42c1;
}

.shop-parts-count {
    margin-left: auto;
    background: #ede9fe;
    color: #5b21b6;
    padding: 2px 8px;
    font-size: 0.8rem;
    font-weight: 700;
}

.shop-parts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
}

/* --- 5. Schicht-Übergabe --- */
.shop-handover-view {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.shop-handover-shift-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1rem;
    color: #1f2937;
    margin-bottom: 8px;
}

.shop-handover-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shop-handover-item {
    border: 1px solid #e5e7eb;
    background: #fff;
}

.shop-handover-item.is-done {
    opacity: 0.55;
}

.shop-handover-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
    padding: 0 10px 10px;
}

.shop-handover-note {
    flex: 1;
    min-width: 200px;
    border: 1px solid #d1d5db;
    padding: 8px 10px;
    font-size: 0.9rem;
    resize: vertical;
}

.shop-handover-check-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #374151;
    margin: 0;
    white-space: nowrap;
}

/* --- 6. Kennzeichen-Radar --- */
.shop-radar-view {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.shop-radar-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 2px solid #111827;
    background: #fff;
    padding: 10px 14px;
}

.shop-radar-search-wrap .material-symbols-outlined {
    font-size: 28px;
    color: #6b7280;
}

.shop-radar-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.shop-radar-clear {
    border: none;
    background: #f3f4f6;
    color: #111827;
    width: 36px;
    height: 36px;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.shop-radar-spotlight .shop-job-card.is-tile .shop-job-plate {
    min-height: 110px;
    font-size: 2.4rem;
}

.shop-radar-hits-title {
    font-weight: 700;
    color: #374151;
    margin-bottom: 8px;
}

.shop-radar-hits {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shop-radar-hint {
    color: #6b7280;
    font-size: 0.95rem;
    text-align: center;
    padding: 24px 12px;
}

/* --- 7. Meister-Cockpit --- */
.shop-meister-view {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.shop-meister-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.shop-meister-kpi {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-top: 4px solid var(--kpi-color, #6c757d);
    padding: 14px 12px;
    text-align: center;
}

.shop-meister-kpi .material-symbols-outlined {
    color: var(--kpi-color);
    font-size: 24px;
}

.shop-meister-kpi-val {
    font-size: 2rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.1;
}

.shop-meister-kpi-label {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 600;
}

.shop-meister-hotlist {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (max-width: 900px) {
    .shop-gate-board {
        grid-template-columns: 1fr;
    }

    .shop-meister-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .shop-layout-select {
        width: 100%;
    }
}

/* --- Parkplatz Kennzeichen-Autocomplete --- */
.parking-plate-suggest {
    position: relative;
}

.parking-plate-suggestions {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    z-index: 1080;
    max-height: 360px;
    overflow: auto;
    background: #fff;
    border: 1px solid #d1d5db;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.parking-plate-suggestion {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    text-align: left;
    border: 0;
    border-bottom: 1px solid #f3f4f6;
    background: #fff;
    padding: 8px 10px;
    cursor: pointer;
}

.parking-plate-suggestion:last-child {
    border-bottom: 0;
}

.parking-plate-suggestion:hover,
.parking-plate-suggestion.is-active {
    background: #eff6ff;
}

.parking-plate-suggestion.is-muted {
    cursor: default;
    color: #6b7280;
    font-size: 0.9rem;
}

.parking-plate-suggestion.is-muted:hover {
    background: #fff;
}

.parking-suggest-plate {
    flex: 0 0 auto;
    min-width: 96px;
    background: #111827;
    color: #fff;
    font-weight: 800;
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    text-align: center;
    padding: 6px 8px;
}

.parking-suggest-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    font-size: 0.86rem;
    color: #4b5563;
}

.parking-suggest-meta strong {
    color: #111827;
    font-size: 0.92rem;
}

/* --- Parkplatzbelegung --- */
.parking-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.parking-kpi {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #3498db;
    padding: 12px 14px;
}

.parking-kpi.is-work {
    border-left-color: #f1c40f;
}

.parking-kpi.is-ready {
    border-left-color: #28a745;
}

.parking-kpi.is-long {
    border-left-color: #fd7e14;
}

.parking-kpi.is-visible {
    border-left-color: #6c757d;
}

.parking-term-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #0d6efd;
    text-decoration: none;
}

.parking-term-link:hover {
    text-decoration: underline;
}

.parking-card-history {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: #4b5563;
    font-size: 0.86rem;
}

.parking-kpi-value {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.1;
    color: #1f2937;
}

.parking-kpi-label {
    color: #6b7280;
    font-size: 0.85rem;
    margin-top: 2px;
}

.parking-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.parking-filter-chip {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    padding: 6px 12px;
    font-size: 0.9rem;
    cursor: pointer;
}

.parking-filter-chip.is-active {
    background: #1f2937;
    border-color: #1f2937;
    color: #fff;
}

.parking-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.parking-loading,
.parking-empty {
    background: #fff;
    border: 1px solid #e5e7eb;
    padding: 36px 20px;
    text-align: center;
    color: #6b7280;
}

.parking-empty .material-symbols-outlined {
    font-size: 42px;
    display: block;
    margin-bottom: 8px;
    color: #9ca3af;
}

.parking-empty h3 {
    margin: 0 0 6px;
    color: #111827;
    font-size: 1.15rem;
}

.parking-empty p {
    margin: 0;
}

.parking-section-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.parking-section-head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
}

.parking-section-head .material-symbols-outlined {
    color: #4b5563;
}

.parking-section-count {
    margin-left: auto;
    background: #f3f4f6;
    color: #374151;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 2px 8px;
}

.parking-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.parking-card {
    display: flex;
    gap: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 5px solid var(--parking-status, #3498db);
    padding: 12px;
    min-height: 110px;
}

.parking-card-plate {
    flex: 0 0 auto;
    min-width: 108px;
    align-self: flex-start;
    background: #111827;
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-align: center;
    padding: 10px 8px;
    word-break: break-word;
}

.parking-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.parking-card-title {
    font-weight: 700;
    color: #111827;
    line-height: 1.25;
}

.parking-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: #4b5563;
    font-size: 0.9rem;
}

.parking-card-meta i {
    margin-right: 4px;
    opacity: 0.8;
}

.parking-card-desc {
    color: #6b7280;
    font-size: 0.88rem;
}

.parking-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    flex-wrap: wrap;
}

.parking-card-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: fit-content;
    background: color-mix(in srgb, var(--parking-status, #6c757d) 16%, #fff);
    color: #111827;
    border: 1px solid color-mix(in srgb, var(--parking-status, #6c757d) 35%, #fff);
    padding: 3px 8px;
    font-size: 0.82rem;
    font-weight: 600;
}

.parking-card-status .material-symbols-outlined {
    font-size: 16px;
    color: var(--parking-status, #6c757d);
}

.parking-card-actions {
    display: flex;
    gap: 4px;
}

.parking-group-ready {
    --parking-status: #28a745;
}

.parking-group-parked {
    --parking-status: #007bff;
}

.parking-group-left {
    --parking-status: #6c757d;
    opacity: 0.92;
}

@media (max-width: 1100px) {
    .parking-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .parking-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .parking-summary {
        grid-template-columns: 1fr;
    }

    .parking-card {
        flex-direction: column;
    }

    .parking-card-plate {
        width: 100%;
    }
}

/* Kunden-Datenbank */
.customers-summary {
    margin-bottom: 1rem;
}
.customers-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.6rem;
}
.customers-summary-chip {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 0;
    padding: 0.7rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.customers-summary-chip strong {
    font-size: 1.25rem;
    line-height: 1.1;
}
.customers-summary-chip span {
    color: #6c757d;
    font-size: 0.85rem;
}
.customers-content {
    min-height: 120px;
}
.customers-loading,
.customers-empty {
    padding: 1.5rem;
    color: #6c757d;
    background: #f8f9fa;
    border-radius: 0;
    border: 1px dashed #dee2e6;
}
.customers-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.customers-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}
.customers-toolbar-label {
    margin: 0;
    font-size: 0.85rem;
    color: #64748b;
}
.customers-result-meta {
    font-size: 0.9rem;
    color: #64748b;
}
.customers-table-wrap {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0;
    overflow: hidden;
}
.customers-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.94rem;
}
.customers-table th,
.customers-table td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
    vertical-align: middle;
}
.customers-table th {
    background: #f8fafc;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.customer-row {
    cursor: pointer;
    transition: background 0.12s ease;
}
.customer-row:hover,
.customer-row:focus {
    background: #f8fafc;
    outline: none;
}
.customer-row-title {
    font-weight: 600;
    color: #0f172a;
}
.customer-plates {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
}
.customer-plate-badge {
    display: inline-block;
    background: #fff;
    color: #222;
    border: 1px solid #bbb;
    border-radius: 0;
    font-size: 12px;
    font-weight: 700;
    padding: 1px 7px;
    letter-spacing: 0.5px;
}
.customer-plates-more {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 600;
}
.customer-col-contact {
    color: #475569;
    font-size: 0.88rem;
}
.customer-col-contact span {
    display: inline-block;
    margin-right: 0.75rem;
}
.customer-col-contact i {
    width: 14px;
    margin-right: 3px;
    color: #94a3b8;
}
.customer-col-num,
.customer-col-date {
    white-space: nowrap;
    color: #475569;
}
.customers-pagination {
    display: flex;
    justify-content: center;
    margin: 1rem 0 1.5rem;
}
.customers-pagination-inner {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.customers-page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 0.65rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 0;
    color: #334155;
    font-size: 0.9rem;
    cursor: pointer;
}
.customers-page-btn:hover:not(:disabled) {
    border-color: #94a3b8;
    background: #f8fafc;
}
.customers-page-btn.is-active {
    background: #1e293b;
    border-color: #1e293b;
    color: #fff;
}
.customers-page-btn:disabled {
    opacity: 0.4;
    cursor: default;
}
.customers-page-ellipsis {
    color: #94a3b8;
    padding: 0 0.2rem;
}
.customer-vehicle-row,
.customer-history-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid #eee;
    font-size: 0.92rem;
}

/* Kennzeichen-Suggest im Planer-Modal */
.work-plate-suggest {
    position: relative;
}
.work-plate-suggestions {
    position: absolute;
    z-index: 1060;
    left: 0;
    right: 0;
    top: calc(100% + 2px);
    max-height: 240px;
    overflow: auto;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 0;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.work-plate-suggestion {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 0.55rem 0.75rem;
    cursor: pointer;
}
.work-plate-suggestion:hover,
.work-plate-suggestion.is-active {
    background: #f1f5f9;
}
.work-plate-suggestion-plate {
    font-weight: 700;
    letter-spacing: 0.5px;
}
.work-plate-suggestion-meta {
    color: #64748b;
    font-size: 0.85rem;
}
#workCustomerHint {
    min-height: 1.1rem;
}

@media (max-width: 900px) {
    .customers-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 900px) {
    .customers-table th:nth-child(3),
    .customers-table td.customer-col-contact {
        display: none;
    }
}
@media (max-width: 640px) {
    .customers-summary-grid {
        grid-template-columns: 1fr;
    }
    .customers-table th:nth-child(4),
    .customers-table td.customer-col-num {
        display: none;
    }
    .customers-toolbar-right {
        width: 100%;
    }
}

/* Wochenstatistik */
.stats-loading {
    padding: 1.5rem;
    color: #6c757d;
    background: #f8f9fa;
    border-radius: 0;
    border: 1px dashed #dee2e6;
}
.is-stats-mode.active {
    color: #fff !important;
}
.stats-delta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.15rem;
    font-size: 0.8rem;
}
.stats-delta-label {
    color: #94a3b8;
    flex-shrink: 0;
}
.stats-appt-desc {
    margin-top: 0.2rem;
    color: #64748b;
    font-size: 0.85rem;
    line-height: 1.35;
}
.stats-day-appointments tr.is-canceled {
    opacity: 0.55;
    text-decoration: line-through;
}
.stats-day-appointments tr.is-canceled .customer-plate-badge {
    text-decoration: none;
}
.stats-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.stats-kpi-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0;
    padding: 0.9rem 1rem;
}
.stats-kpi-top {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: #64748b;
    font-size: 0.88rem;
    margin-bottom: 0.35rem;
}
.stats-kpi-value {
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.1;
    color: #0f172a;
}
.stats-delta {
    display: inline-block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
}
.stats-delta.is-up { color: #16a34a; }
.stats-delta.is-down { color: #dc2626; }
.stats-delta.is-flat { color: #94a3b8; }

.stats-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0;
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
}
.stats-panel h5 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: #1e293b;
}
.stats-panel h5 i {
    margin-right: 0.35rem;
    color: #64748b;
}
.stats-hint {
    margin: 0 0 0.85rem;
    font-size: 0.8rem;
    line-height: 1.35;
    color: #94a3b8;
}
.stats-kpi-card .stats-hint {
    margin: 0.45rem 0 0;
}
.stats-insight .stats-hint {
    margin: 0.25rem 0 0;
}
.stats-panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.stats-panel-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.stats-panel-grid > .stats-panel {
    margin-bottom: 0;
}
.stats-panel-grid {
    margin-bottom: 1rem;
}

.stats-insight-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}
.stats-insight {
    background: #f8fafc;
    border-radius: 0;
    padding: 0.7rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.stats-insight strong {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
}
.stats-insight span {
    font-size: 1.05rem;
    color: #0f172a;
    font-weight: 600;
}

.stats-day-chart,
.stats-hour-chart {
    display: flex;
    align-items: flex-end;
    gap: 0.45rem;
    min-height: 180px;
}
.stats-day-col,
.stats-hour-col {
    flex: 1;
    text-align: center;
}
.stats-day-bar-wrap,
.stats-hour-bar-wrap {
    height: 140px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.stats-day-bar,
.stats-hour-bar {
    width: 70%;
    max-width: 42px;
    background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 0;
    min-height: 0;
}
.stats-hour-bar {
    background: linear-gradient(180deg, #14b8a6 0%, #0f766e 100%);
    max-width: 28px;
}
.stats-day-aw {
    font-weight: 700;
    font-size: 0.85rem;
    margin-top: 0.35rem;
}
.stats-day-name,
.stats-hour-label {
    font-size: 0.8rem;
    color: #64748b;
}
.stats-day-sub {
    font-size: 0.72rem;
    color: #94a3b8;
}

.stats-bars {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.stats-bar-row {
    display: grid;
    grid-template-columns: minmax(110px, 28%) 1fr auto;
    gap: 0.55rem;
    align-items: center;
}
.stats-bar-label {
    font-size: 0.9rem;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.stats-emp-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}
.stats-bar-track {
    height: 10px;
    background: #e2e8f0;
    border-radius: 0;
    overflow: hidden;
}
.stats-bar-fill {
    height: 100%;
    background: #2563eb;
    border-radius: 0;
}
.stats-bar-value {
    font-size: 0.82rem;
    color: #475569;
    white-space: nowrap;
    text-align: right;
}

.stats-table-wrap {
    overflow-x: auto;
}
.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}
.stats-table th,
.stats-table td {
    padding: 0.45rem 0.55rem;
    border-bottom: 1px solid #eef2f7;
    text-align: left;
    vertical-align: top;
}
.stats-table th {
    color: #64748b;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.stats-kv {
    list-style: none;
    margin: 0;
    padding: 0;
}
.stats-kv li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.92rem;
}
.stats-kv li span { color: #64748b; }
.stats-kv li strong { color: #0f172a; }

.stats-rank {
    list-style: none;
    margin: 0;
    padding: 0;
}
.stats-rank li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #f1f5f9;
}
.stats-rank-n {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #334155;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.stats-rank strong {
    margin-left: auto;
}
.stats-footnote {
    font-size: 0.85rem;
    margin: 0.5rem 0 1.5rem;
}

@media (max-width: 1100px) {
    .stats-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .stats-panel-grid,
    .stats-panel-grid-3,
    .stats-insight-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 640px) {
    .stats-kpi-grid {
        grid-template-columns: 1fr;
    }
    .stats-bar-row {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }
}

@media print {
    .navbar, .infobar, .card-header .btn, .card-header .btn-group, a.btn {
        display: none !important;
    }
    .stats-panel, .stats-kpi-card {
        break-inside: avoid;
        box-shadow: none !important;
    }
}

