/* ==========================================================================
   IPMS WORKFORCE – ZENTRALE STYLESHEET
   ==========================================================================

   SCHNELLSUCHE IM EDITOR:
   - GRUNDLAGEN / VARIABLEN
   - NAVIGATION / LAYOUT
   - FORMULARE / BUTTONS
   - TABELLEN / BADGES
   - DASHBOARD / KARTE / WETTER
   - EINSATZPLANUNG / DRAG & DROP
   - MONATS- UND JAHRESÜBERSICHT
   - MITARBEITERÜBERSICHT
   - RESPONSIVE / MOBILE

   Tipp: In VS Code oder Notepad++ mit Strg+F nach den oben genannten
   Begriffen oder nach einem Klassennamen suchen.
   ========================================================================== */

/* ========================= GRUNDLAGEN / VARIABLEN ======================== */
:root {
    --blue: #0B2D5C;
    --blue2: #071f40;
    --orange: #F28C28;
    --bg: #F5F7FA;
    --text: #1F2937;
    --muted: #6B7280;
    --border: #E5E7EB;
    --green: #15803D;
    --red: #DC3545;
    --shadow: 0 12px 30px rgba(11, 45, 92, .08)
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text)
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    background: linear-gradient(180deg, var(--blue), var(--blue2));
    color: #fff;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    z-index: 10
}

.product-brand {
    display: flex;
    gap: 14px;
    align-items: center;
    padding-bottom: 24px;
    border-bottom: 1px solid #ffffff24
}

.brand-mark {
    width: 52px;
    height: 52px;
    margin-top: 20px;
    border-radius: 14px;
    background: var(--orange);
    display: grid;
    place-items: center;
    font-weight: 800
}

.brand-title {
    font-weight: 800;
    font-size: 15px
}

.brand-subtitle,
.small {
    font-size: 11px;
    color: #ffffffaa
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 24px
}

.nav a {
    color: #ffffffd9;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 600
}

.nav a i {
    width: 22px
}

.nav a:hover,
.nav a.active {
    background: #ffffff1f;
    border-left: 4px solid var(--orange);
    color: #fff
}

.sidebar-footer {
    margin-top: auto;
    line-height: 1.6
}

.main {
    margin-left: 280px;
    min-width: 0
}

.topbar {
    position: sticky;
    top: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 22px 34px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 5
}

.topbar h1 {
    margin: 0;
    color: var(--blue);
    font-size: 28px
}

.page-subtitle {
    margin-top: 8px;
    color: var(--muted);
    border-left: 4px solid var(--orange);
    padding-left: 12px
}

.content {
    padding: 30px 34px
}

.panel,
.kpi {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow)
}

.panel {
    padding: 24px;
    margin-bottom: 22px
}

.panel h2 {
    margin: 0 0 18px;
    color: var(--blue)
}

.panel p {
    color: var(--muted)
}

.kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 22px
}

.kpi {
    padding: 22px
}

.kpi i {
    font-size: 26px;
    color: var(--blue)
}

.kpi b {
    display: block;
    font-size: 34px;
    color: var(--blue);
    margin-top: 8px
}

.kpi span {
    color: var(--muted);
    font-weight: 600
}

.kpi.orange i {
    color: var(--orange)
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.35fr .65fr;
    gap: 22px
}

.dach-map svg {
    width: 100%;
    min-height: 420px
}

.country {
    fill: #eef2f7;
    stroke: #cbd5e1;
    stroke-width: 2
}

.marker {
    stroke: #fff;
    stroke-width: 3;
    cursor: pointer
}

.marker.active,
.dot.active {
    fill: var(--green);
    background: var(--green)
}

.marker.planned,
.dot.planned {
    fill: var(--orange);
    background: var(--orange)
}

.dach-map text {
    font-size: 14px;
    font-weight: 700;
    fill: var(--blue)
}

.map-legend {
    display: flex;
    gap: 18px
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px
}

.staff-row,
.site-card,
.accommodation-card {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit
}

.staff-row small,
.site-card small,
.accommodation-card small {
    display: block;
    color: var(--muted);
    margin-top: 7px
}

.grid2 {
    display: grid;
    grid-template-columns: minmax(340px, .75fr) minmax(500px, 1.25fr);
    gap: 22px
}

.form {
    display: flex;
    flex-direction: column;
    gap: 14px
}

.form label,
.filters label {
    font-weight: 700;
    font-size: 13px;
    color: var(--blue)
}

input,
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #fff;
    color: var(--text);
    font: inherit
}

textarea {
    min-height: 90px;
    resize: vertical
}

.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px
}

.form-row:has(>label:nth-child(2):last-child) {
    grid-template-columns: repeat(2, 1fr)
}

.check {
    display: flex !important;
    align-items: center;
    gap: 8px
}

.check input {
    width: auto
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: var(--blue);
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer
}

.btn.secondary {
    background: #e8eef6;
    color: var(--blue)
}

.btn.full {
    width: 100%
}

.filters,
.week-nav {
    display: flex;
    align-items: end;
    gap: 10px
}

.filters input,
.filters select {
    min-width: 180px
}

.table-wrap {
    overflow: auto
}

table {
    width: 100%;
    border-collapse: collapse
}

th {
    background: var(--blue);
    color: #fff;
    text-align: left;
    padding: 11px;
    font-size: 13px
}

td {
    padding: 11px;
    border-bottom: 1px solid var(--border);
    vertical-align: top
}

th small,
td small {
    display: block;
    margin-top: 5px;
    color: inherit;
    opacity: .75
}

.badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    background: #e5e7eb
}

.badge.ok,
.badge.active {
    background: #dcfce7;
    color: #166534
}

.badge.warn,
.badge.sick {
    background: #fee2e2;
    color: #991b1b
}

.badge.planned,
.badge.vacation {
    background: #ffedd5;
    color: #9a3412
}

.badge.completed,
.badge.inactive {
    background: #e5e7eb;
    color: #374151
}

.actions {
    display: flex;
    align-items: center;
    gap: 10px
}

.actions a {
    color: var(--blue)
}

.actions form {
    margin: 0
}

.icon {
    border: 0;
    background: none;
    cursor: pointer
}

.danger {
    color: var(--red) !important
}

.first-aid {
    display: inline-grid;
    place-items: center;
    margin-left: 6px;
    width: 18px;
    height: 18px;
    background: var(--green);
    color: #fff;
    border-radius: 3px;
    font-weight: 900
}

.site-card {
    align-items: flex-start
}

.site-title {
    display: flex;
    align-items: center;
    gap: 10px
}

.accommodation-card {
    display: block;
    position: relative
}

.accommodation-card .actions {
    position: absolute;
    right: 0;
    top: 12px
}

.info-box {
    white-space: pre-line;
    background: #fff7ed;
    border-left: 4px solid var(--orange);
    padding: 12px;
    margin-top: 12px;
    border-radius: 8px
}

.info-box strong {
    display: block;
    color: #9a3412;
    margin-bottom: 5px
}

fieldset {
    border: 1px solid var(--border);
    border-radius: 10px
}

legend {
    color: var(--blue);
    font-weight: 700
}

.guest-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px
}

.planning-panel {
    padding: 0
}

.planning-table {
    min-width: 1500px
}

.planning-table th:first-child,
.planning-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2
}

.planning-table td:first-child {
    background: #fff;
    min-width: 180px
}

.planning-table th:first-child {
    z-index: 3
}

.planning-table td select {
    min-width: 170px;
    font-size: 12px
}

.planning-table td input {
    margin-top: 6px;
    font-size: 12px
}

.mobile-view {
    max-width: 680px;
    margin: auto
}

.profile-head {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px
}

.profile-head h2 {
    margin: 0;
    color: var(--blue)
}

.avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 30px
}

.mobile-view h3 {
    color: var(--blue);
    margin-top: 28px
}

.mobile-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: var(--shadow)
}

.mobile-card.accent {
    border-top: 5px solid var(--orange)
}

.mobile-card h4 {
    font-size: 19px;
    color: var(--blue);
    margin: 8px 0
}

.date-chip {
    background: #e8eef6;
    color: var(--blue);
    padding: 5px 9px;
    border-radius: 8px;
    font-weight: 800
}

.empty {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    color: var(--muted)
}

@media(max-width:1100px) {
    .kpis {
        grid-template-columns: repeat(2, 1fr)
    }

    .dashboard-grid,
    .grid2 {
        grid-template-columns: 1fr
    }
}

@media(max-width:760px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto
    }

    .main {
        margin-left: 0
    }

    .nav {
        display: grid;
        grid-template-columns: repeat(2, 1fr)
    }

    .topbar {
        padding: 18px
    }

    .topbar-user {
        display: none
    }

    .content {
        padding: 18px
    }

    .kpis {
        grid-template-columns: 1fr 1fr
    }

    .form-row {
        grid-template-columns: 1fr
    }

    .dashboard-grid {
        display: block
    }
}

/* V2 Einsatzplanung */
.planning-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px
}

.date-nav,
.date-nav form,
.view-switch {
    display: flex;
    align-items: center;
    gap: 10px
}

.date-nav input {
    min-width: 150px
}

.toast {
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 8px
}

.toast.ok {
    background: #dcfce7;
    color: #166534
}

.toast.error {
    background: #fee2e2;
    color: #991b1b
}

.board {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    align-items: start
}

.pool-board,
.site-zone-wrap {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow)
}

.pool-board {
    padding: 16px;
    position: sticky;
    top: 125px;
    min-height: 420px
}

.zone-title,
.site-zone-wrap header,
.site-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px
}

.zone-title h2,
.site-zone-wrap h3 {
    margin: 0;
    color: var(--blue)
}

.zone-title p,
.site-zone-wrap header span {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px
}

.count-badge {
    background: var(--blue);
    color: #fff;
    border-radius: 999px;
    min-width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    font-weight: 800
}

.site-board-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(300px, 1fr));
    gap: 18px
}

.site-zone-wrap {
    overflow: hidden
}

.site-zone-wrap header {
    padding: 16px 18px;
    background: linear-gradient(135deg, #fff, #f5f8fc);
    border-bottom: 1px solid var(--border)
}

.site-meta {
    padding: 10px 18px;
    background: #f8fafc;
    color: var(--blue);
    font-size: 13px
}

.status-pill {
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px !important;
    font-weight: 800
}

.status-pill.active {
    background: #dcfce7;
    color: #166534 !important
}

.status-pill.planned {
    background: #ffedd5;
    color: #9a3412 !important
}

.dropzone {
    transition: .18s ease
}

.site-dropzone {
    min-height: 180px;
    padding: 12px;
    background: #fbfdff;
    border-top: 3px solid transparent
}

.site-dropzone.under {
    border-top-color: #ef4444;
    background: #fffafa
}

.site-dropzone.ok {
    border-top-color: #22c55e
}

.dropzone.dragover {
    outline: 3px dashed var(--orange);
    outline-offset: -6px;
    background: #fff7ed
}

.person-card {
    background: #fff;
    border: 1px solid #d8e0ea;
    border-left: 5px solid var(--blue);
    border-radius: 11px;
    padding: 11px 12px;
    margin-top: 10px;
    cursor: grab;
    box-shadow: 0 4px 12px rgba(11, 45, 92, .08)
}

.person-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 7px 16px rgba(11, 45, 92, .12)
}

.person-card.dragging {
    opacity: .45
}

.person-header {
    display: flex;
    justify-content: space-between;
    align-items: center
}

.person-card small {
    display: block;
    color: var(--muted);
    margin-top: 4px
}

.first-aid-cross {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: #15803d;
    color: #fff;
    font-weight: 900
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 18px
}

.calendar-legend span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px
}

.site-code {
    display: inline-grid;
    place-items: center;
    min-width: 28px;
    height: 22px;
    border-radius: 5px;
    background: #dbeafe;
    color: #1e3a8a;
    font-size: 10px;
    font-weight: 900
}

.code-2 {
    background: #ffedd5;
    color: #9a3412
}

.code-3 {
    background: #dcfce7;
    color: #166534
}

.code-4 {
    background: #f3e8ff;
    color: #6b21a8
}

.code-5 {
    background: #fce7f3;
    color: #9d174d
}

.calendar-wrapper {
    overflow: auto
}

.overview-table {
    min-width: 1100px
}

.overview-table th,
.overview-table td {
    text-align: center;
    padding: 7px 5px;
    border-right: 1px solid #edf0f4
}

.overview-table .employee-col {
    position: sticky;
    left: 0;
    z-index: 2;
    text-align: left;
    min-width: 180px
}

.overview-table td.employee-col {
    background: #fff
}

.overview-table th.employee-col {
    z-index: 3
}

.day-head {
    min-width: 34px
}

.weekend {
    background: #f3f4f6 !important
}

.plan-cell {
    height: 36px
}

.overview-table.compact th,
.overview-table.compact td {
    padding: 4px 3px
}

.overview-table.compact .site-code {
    min-width: 20px;
    height: 18px;
    font-size: 8px
}

.year-month h2 {
    margin-bottom: 12px
}

.dach-map {
    position: relative;
    background: radial-gradient(circle at 30% 20%, #f8fbff, #eef4fa);
    border: 1px solid #dbe4ee;
    border-radius: 18px;
    padding: 10px;
    overflow: hidden
}

.dach-map:before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(11, 45, 92, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(11, 45, 92, .025) 1px, transparent 1px);
    background-size: 24px 24px
}

.dach-map svg {
    position: relative;
    z-index: 1
}

.country {
    fill: url(#countryGradient);
    stroke: #9fb1c5;
    stroke-width: 2.2;
    filter: drop-shadow(0 5px 8px rgba(11, 45, 92, .09))
}

.country-label {
    font-size: 28px !important;
    fill: #9aabc0 !important;
    font-weight: 800 !important;
    letter-spacing: 3px
}

.marker-ring {
    fill: #fff;
    stroke: rgba(11, 45, 92, .18);
    stroke-width: 1
}

.marker {
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .25))
}

.map-city-label {
    paint-order: stroke;
    stroke: #fff;
    stroke-width: 4px;
    stroke-linejoin: round;
    font-size: 13px !important
}

@media(max-width:1200px) {
    .site-board-grid {
        grid-template-columns: 1fr
    }
}

@media(max-width:850px) {
    .board {
        grid-template-columns: 1fr
    }

    .pool-board {
        position: static
    }

    .planning-toolbar {
        align-items: flex-start;
        flex-direction: column
    }
}

/* V3 responsive dashboard, interactive map and fleet */
.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px
}

.panel-head h2 {
    margin: 3px 0 5px
}

.panel-head p {
    margin: 0
}

.eyebrow {
    display: block;
    color: var(--orange);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase
}

.compact {
    padding: 8px 11px;
    font-size: 12px
}

.text-link {
    color: var(--blue);
    font-weight: 800;
    text-decoration: none;
    font-size: 13px
}

.mobile-menu-button,
.sidebar-backdrop {
    display: none
}

.dashboard-kpis .kpi-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform .18s ease, box-shadow .18s ease
}

.dashboard-kpis .kpi-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(11, 45, 92, .13)
}

.kpi-icon {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #eaf1f8;
    display: grid;
    place-items: center
}

.kpi-icon i {
    font-size: 23px
}

.kpi-icon.orange {
    background: #fff2e4
}

.dashboard-kpis .kpi b {
    margin: 0;
    font-size: 28px
}

.dashboard-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(330px, .65fr);
    gap: 22px;
    align-items: stretch;
    margin-bottom: 22px
}

.dashboard-main-grid>.panel,
.dashboard-side>.panel {
    margin-bottom: 0
}

.dashboard-side {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 22px
}

.map-panel {
    min-width: 0
}

.site-map {
    height: 520px;
    border-radius: 14px;
    overflow: hidden;
    background: #dbe7f2;
    z-index: 1
}

.map-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-top: 12px;
    color: var(--muted)
}

.map-footer small {
    font-size: 10px
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 12px
}

.legend-marker {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
    box-shadow: 0 0 0 4px rgba(0, 0, 0, .05)
}

.legend-marker.active {
    background: #15803d
}

.legend-marker.planned {
    background: #f28c28
}

.legend-marker.critical {
    background: #dc3545
}

.ipms-map-marker-wrap {
    background: none;
    border: 0
}

.ipms-map-marker {
    position: relative;
    width: 38px;
    height: 38px;
    border: 4px solid #fff;
    border-radius: 13px 13px 13px 3px;
    background: var(--marker);
    color: #fff;
    display: grid;
    place-items: center;
    transform: rotate(-45deg);
    box-shadow: 0 7px 18px rgba(11, 45, 92, .32)
}

.ipms-map-marker i {
    font-size: 16px;
    transform: rotate(45deg)
}

.leaflet-popup-content-wrapper {
    border-radius: 14px;
    box-shadow: 0 14px 32px rgba(11, 45, 92, .18)
}

.map-popup {
    min-width: 220px
}

.map-popup>small,
.map-popup>span {
    display: block;
    color: var(--muted);
    margin-bottom: 5px
}

.map-popup>strong {
    display: block;
    color: var(--blue);
    font-size: 15px;
    margin-bottom: 4px
}

.popup-staff {
    border-top: 1px solid var(--border);
    margin-top: 10px;
    padding-top: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px
}

.popup-alert,
.popup-ok {
    font-size: 10px !important;
    font-weight: 800;
    padding: 4px 7px;
    border-radius: 999px;
    margin: 0 !important
}

.popup-alert {
    background: #fee2e2;
    color: #991b1b !important
}

.popup-ok {
    background: #dcfce7;
    color: #166534 !important
}

.popup-neutral {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: 0.45rem;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: #eef1f5;
    color: #596273;
    font-size: 0.75rem;
    font-weight: 700;
}

.map-popup a {
    display: inline-block;
    margin-top: 11px;
    color: var(--blue);
    font-weight: 800;
    text-decoration: none
}

.live-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--green);
    font-size: 11px;
    font-weight: 800
}

.live-chip i {
    width: 7px;
    height: 7px;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 0 4px #dcfce7
}

.weather-overview {
    min-height: 0
}

.weather-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
    max-height: 430px;
    overflow: auto;
    padding-right: 2px
}

.weather-card {
    appearance: none;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #f9fbfd;
    padding: 11px;
    display: grid;
    grid-template-columns: 35px minmax(0, 1fr) auto;
    grid-template-areas: "icon place values" "risk risk risk";
    align-items: center;
    gap: 8px 10px;
    text-align: left;
    cursor: pointer;
    color: inherit
}

.weather-card:hover {
    border-color: #9fb5ce;
    background: #fff
}

.weather-icon {
    grid-area: icon;
    color: var(--blue);
    font-size: 25px
}

.weather-place {
    grid-area: place;
    min-width: 0
}

.weather-place strong,
.weather-place small,
.weather-values b,
.weather-values small {
    display: block
}

.weather-place strong {
    color: var(--blue)
}

.weather-place small {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--muted);
    margin-top: 3px;
    font-size: 10px
}

.weather-values {
    grid-area: values;
    text-align: right
}

.weather-values b {
    color: var(--blue);
    font-size: 20px
}

.weather-values small {
    color: var(--muted);
    font-size: 9px
}

.weather-risk {
    grid-area: risk;
    justify-self: start;
    font-size: 10px;
    font-weight: 800;
    border-radius: 999px;
    padding: 4px 8px
}

.weather-risk.good {
    background: #dcfce7;
    color: #166534
}

.weather-risk.warning {
    background: #ffedd5;
    color: #9a3412
}

.weather-risk.danger {
    background: #fee2e2;
    color: #991b1b
}

.loading-state {
    display: grid;
    place-items: center;
    gap: 10px;
    min-height: 150px;
    color: var(--muted);
    text-align: center
}

.loading-state i {
    font-size: 30px;
    color: var(--blue)
}

.loading-state.error i {
    color: var(--orange)
}

.mini-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px
}

.mini-stat-grid div {
    background: #f5f8fc;
    border-radius: 12px;
    padding: 12px;
    text-align: center
}

.mini-stat-grid strong,
.mini-stat-grid span {
    display: block
}

.mini-stat-grid strong {
    font-size: 23px;
    color: var(--blue)
}

.mini-stat-grid span {
    color: var(--muted);
    font-size: 10px;
    margin-top: 4px
}

.mini-stat-grid .warning {
    background: #fff4e8
}

.mini-stat-grid .warning strong {
    color: #c2410c
}

.staffing-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px
}

.staffing-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 15px;
    text-decoration: none;
    color: inherit;
    background: #fff;
    min-width: 0
}

.staffing-card:hover {
    border-color: #a9bad0;
    box-shadow: 0 8px 20px rgba(11, 45, 92, .08)
}

.staffing-card.critical {
    border-top: 4px solid #dc3545
}

.staffing-card.ok {
    border-top: 4px solid #16a34a
}

.staffing-card>strong {
    display: block;
    color: var(--blue);
    margin: 10px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.staffing-card-top,
.staffing-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 11px
}

.staffing-card-top i {
    margin-left: auto
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8
}

.status-dot.active {
    background: #15803d
}

.status-dot.planned {
    background: #f28c28
}

.staff-progress {
    height: 6px;
    background: #e9eef4;
    border-radius: 999px;
    overflow: hidden
}

.staff-progress span {
    display: block;
    height: 100%;
    background: var(--blue);
    border-radius: 999px
}

.staffing-meta {
    justify-content: space-between;
    margin-top: 9px
}

.staffing-meta b {
    color: var(--blue)
}

.shortage {
    color: #b91c1c;
    font-weight: 800
}

.complete {
    color: #15803d;
    font-weight: 800
}

.fleet-layout {
    grid-template-columns: minmax(330px, .72fr) minmax(0, 1.28fr)
}

.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px
}

.vehicle-card {
    position: relative;
    display: flex;
    gap: 13px;
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 15px;
    background: #fff;
    min-width: 0
}

.vehicle-icon {
    flex: 0 0 43px;
    width: 43px;
    height: 43px;
    border-radius: 12px;
    background: #eaf1f8;
    color: var(--blue);
    display: grid;
    place-items: center;
    font-size: 20px
}

.vehicle-body {
    min-width: 0;
    flex: 1
}

.vehicle-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px
}

.vehicle-body h3 {
    font-size: 15px;
    color: var(--blue);
    margin: 5px 0
}

.vehicle-body p {
    font-size: 12px;
    margin: 0 0 10px
}

.vehicle-body dl {
    margin: 0;
    display: grid;
    gap: 5px
}

.vehicle-body dl div {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
    font-size: 11px
}

.vehicle-body dt {
    color: var(--muted)
}

.vehicle-body dd {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.vehicle-actions {
    position: absolute;
    right: 12px;
    bottom: 10px;
    display: flex;
    gap: 7px
}

.vehicle-actions a {
    color: var(--blue)
}

.badge.available {
    background: #dcfce7;
    color: #166534
}

.badge.assigned {
    background: #dbeafe;
    color: #1e40af
}

.badge.maintenance {
    background: #ffedd5;
    color: #9a3412
}

@media(max-width:1320px) {
    .dashboard-main-grid {
        grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr)
    }

    .staffing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .vehicle-grid {
        grid-template-columns: 1fr
    }
}

@media(max-width:1050px) {
    .dashboard-main-grid {
        grid-template-columns: 1fr
    }

    .dashboard-side {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto
    }

    .weather-list {
        max-height: 310px
    }

    .fleet-layout {
        grid-template-columns: 1fr
    }
}

@media(max-width:760px) {
    body {
        padding-top: 62px
    }

    .mobile-menu-button {
        display: grid;
        position: fixed;
        top: 11px;
        left: 13px;
        z-index: 30;
        width: 42px;
        height: 42px;
        place-items: center;
        border: 0;
        border-radius: 11px;
        background: var(--blue);
        color: #fff;
        font-size: 24px;
        box-shadow: 0 6px 18px rgba(11, 45, 92, .25)
    }

    .sidebar {
        position: fixed;
        width: min(86vw, 300px);
        height: 100%;
        transform: translateX(-105%);
        transition: transform .22s ease;
        padding-top: 70px;
        z-index: 25
    }

    .nav {
        display: flex;
        grid-template-columns: none
    }

    .nav-open .sidebar {
        transform: translateX(0)
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(3, 16, 34, .48);
        z-index: 20;
        opacity: 0;
        visibility: hidden;
        transition: .2s
    }

    .nav-open .sidebar-backdrop {
        opacity: 1;
        visibility: visible
    }

    .main {
        margin-left: 0
    }

    .topbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 62px;
        padding: 10px 15px 10px 68px;
        z-index: 15
    }

    .topbar h1 {
        font-size: 20px
    }

    .page-subtitle {
        display: none
    }

    .content {
        padding: 15px
    }

    .dashboard-kpis {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 5px
    }

    .dashboard-kpis .kpi {
        min-width: 205px;
        scroll-snap-align: start
    }

    .dashboard-main-grid,
    .dashboard-side {
        display: grid;
        grid-template-columns: 1fr
    }

    .site-map {
        height: 58vh;
        min-height: 390px
    }

    .map-footer {
        align-items: flex-start;
        flex-direction: column
    }

    .responsive-head {
        align-items: flex-start;
        flex-direction: column
    }

    .map-actions,
    .map-actions .btn {
        width: 100%
    }

    .staffing-grid {
        grid-template-columns: 1fr
    }

    .weather-list {
        max-height: none
    }

    .vehicle-grid {
        grid-template-columns: 1fr
    }

    .vehicle-card {
        padding: 13px
    }

    .panel {
        padding: 16px;
        border-radius: 15px
    }

    .panel h2 {
        font-size: 20px
    }

    .form-row,
    .guest-grid {
        grid-template-columns: 1fr
    }

    .filters,
    .week-nav {
        align-items: stretch;
        flex-direction: column
    }

    .filters input,
    .filters select {
        min-width: 0
    }

    .board {
        display: block
    }

    .site-board-grid {
        grid-template-columns: 1fr
    }

    .pool-board {
        position: static;
        margin-bottom: 16px
    }

    .planning-toolbar,
    .date-nav,
    .view-switch {
        width: 100%;
        flex-wrap: wrap
    }

    .overview-table .employee-col {
        min-width: 140px
    }

    .topbar-user {
        display: none
    }
}

@media(max-width:430px) {
    .dashboard-kpis .kpi {
        min-width: 180px;
        padding: 15px
    }

    .kpi-icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px
    }

    .dashboard-kpis .kpi b {
        font-size: 23px
    }

    .site-map {
        height: 54vh
    }

    .weather-card {
        grid-template-columns: 32px minmax(0, 1fr) auto
    }

    .mini-stat-grid {
        gap: 5px
    }

    .mini-stat-grid div {
        padding: 10px 5px
    }

    .staffing-card>strong {
        white-space: normal
    }

    .vehicle-body dl div {
        grid-template-columns: 60px minmax(0, 1fr)
    }
}

/* V4: Zeitraumplanung, Abwesenheiten und korrigiertes Ersthelfersymbol */
.range-form {
    display: flex;
    align-items: end;
    gap: 10px
}

.range-form label {
    font-size: 12px;
    font-weight: 700;
    color: var(--blue)
}

.period-strip {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap
}

.period-strip>div {
    display: flex;
    gap: 6px;
    flex-wrap: wrap
}

.period-day {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    min-width: 48px;
    padding: 6px 8px;
    border-radius: 9px;
    background: #eef3f8;
    color: var(--blue);
    font-size: 11px
}

.period-day b {
    font-size: 12px
}

.period-day.weekend-day {
    background: #fff1df;
    color: #9a4b00;
    border: 1px solid #ffd3a0
}

.period-strip small {
    width: 100%;
    color: var(--muted)
}

.first-aid-cross {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    line-height: 1;
    border-radius: 4px;
    background: #15803d;
    color: #fff
}

.first-aid-cross i {
    display: block;
    font-size: 14px;
    line-height: 1;
    transform: none
}

.person-header {
    min-height: 22px
}

.unavailable-board {
    margin-top: 16px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow)
}

.unavailable-board h2 {
    margin: 0;
    color: var(--blue);
    font-size: 18px
}

.person-card.unavailable {
    cursor: not-allowed;
    border-left-color: #9ca3af;
    background: #f8fafc;
    opacity: .88
}

.count-badge.muted {
    background: #6b7280
}

.absence-code {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 22px;
    padding: 0 5px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 900
}

.absence-code.vacation {
    background: #ffedd5;
    color: #9a3412
}

.absence-code.sick {
    background: #fee2e2;
    color: #991b1b
}

.absence-code.absent {
    background: #e5e7eb;
    color: #374151
}

.absence-form {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 1fr 1.4fr auto;
    gap: 10px;
    align-items: end
}

.absence-form label {
    font-size: 12px;
    font-weight: 700;
    color: var(--blue)
}

.absence-list {
    display: grid;
    gap: 8px
}

.absence-list>div {
    display: grid;
    grid-template-columns: auto minmax(150px, 1fr) auto minmax(120px, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border)
}

.absence-list small {
    color: var(--muted)
}

@media(max-width:1000px) {
    .absence-form {
        grid-template-columns: repeat(2, 1fr)
    }

    .absence-form .btn {
        align-self: end
    }

    .range-form {
        flex-wrap: wrap
    }
}

@media(max-width:760px) {
    .range-form {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr
    }

    .range-form .btn {
        grid-column: 1/-1
    }

    .period-strip {
        align-items: flex-start
    }

    .period-strip>div {
        overflow-x: auto;
        flex-wrap: nowrap;
        width: 100%;
        padding-bottom: 5px
    }

    .period-day {
        flex: 0 0 48px
    }

    .absence-form {
        grid-template-columns: 1fr
    }

    .absence-list>div {
        grid-template-columns: auto 1fr auto
    }

    .absence-list>div span:nth-of-type(2),
    .absence-list small {
        grid-column: 2/-1
    }
}

/* V5 – getrennte Scrollbereiche, Baustellenfilter und ausgerichtete Datumssteuerung */
.range-form label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 0
}

.range-form label span {
    display: block;
    line-height: 1
}

.range-form input,
.range-form .btn,
.date-nav>.btn {
    height: 42px;
    min-height: 42px
}

.range-form input {
    padding-top: 8px;
    padding-bottom: 8px
}

.nav-square {
    width: 44px;
    min-width: 44px;
    padding: 0
}

.planning-filters {
    flex-wrap: wrap
}

.planning-filters label {
    min-width: 190px
}

.roofing-board {
    height: clamp(520px, calc(100vh - 390px), 820px);
    min-height: 520px;
    overflow: hidden
}

.personnel-scroll,
.sites-scroll {
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding-right: 7px
}

.personnel-scroll {
    display: flex;
    flex-direction: column;
    gap: 16px
}

.pool-board {
    position: static;
    min-height: 280px;
    flex: 0 0 auto
}

.unavailable-board {
    margin-top: 0;
    flex: 0 0 auto
}

.sites-scroll {
    padding-bottom: 10px
}

.site-board-grid {
    align-content: start
}

.personnel-scroll::-webkit-scrollbar,
.sites-scroll::-webkit-scrollbar {
    width: 10px
}

.personnel-scroll::-webkit-scrollbar-thumb,
.sites-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box
}

.empty-sites {
    grid-column: 1/-1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    text-align: center;
    color: var(--muted);
    margin: 0
}

.empty-sites i {
    font-size: 34px;
    color: var(--blue);
    margin-bottom: 10px
}

.empty-sites strong {
    color: var(--blue);
    margin-bottom: 5px
}

@media(max-width:850px) {
    .roofing-board {
        height: auto;
        min-height: 0;
        overflow: visible
    }

    .personnel-scroll,
    .sites-scroll {
        height: auto;
        max-height: none;
        overflow: visible;
        padding-right: 0
    }

    .personnel-scroll {
        margin-bottom: 18px
    }
}

@media(max-width:760px) {
    .range-form {
        align-items: end
    }

    .range-form input,
    .range-form .btn,
    .date-nav>.btn {
        height: 44px;
        min-height: 44px
    }

    .planning-filters label {
        min-width: 0;
        width: 100%
    }
}

/* V6 – alignment, first-aider badge and weekend contrast */
.first-aid-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 25px;
    height: 20px;
    padding: 0 5px;
    border: 1px solid #dc2626;
    border-radius: 5px;
    background: #fff1f2;
    color: #b91c1c;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: .02em;
    vertical-align: middle
}

.person-header .first-aid-badge {
    margin-left: 8px
}

.date-nav {
    align-items: flex-end
}

.date-nav .range-form {
    align-items: flex-end
}

.range-form>button {
    align-self: flex-end
}

.date-nav>.nav-square {
    align-self: flex-end
}

.overview-table th.day-head.weekend {
    background: #e5e7eb !important;
    color: #0B2D5C !important
}

.overview-table th.day-head.weekend small {
    color: #0B2D5C !important;
    opacity: .8
}

@media(max-width:760px) {
    .date-nav {
        align-items: flex-end
    }

    .date-nav .range-form {
        align-items: flex-end
    }
}

/* ========================= MITARBEITERÜBERSICHT ===========================
   Template: app/templates/employees.html
   Hier befinden sich bewusst alle kleinen Layoutkorrekturen der
   Mitarbeiterliste an einer leicht auffindbaren Stelle.
   ========================================================================== */

.employee-filters {
    margin-bottom: 16px;
}

.employee-name-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.employees-table .first-aid-badge {
    margin-left: 0;
}

/* ========================================================================== */
/* EINSATZPLANUNG: SOLL-, GEPLANT- UND FEHLBESETZUNG                          */
/* ========================================================================== */

.planning-capacity {
    align-items: center;
    flex-wrap: wrap;
}

.planning-capacity > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.missing-count-wrap.warning {
    color: #b91c1c;
    font-weight: 700;
}

.missing-count-wrap.complete {
    color: #15803d;
    font-weight: 700;
}

/* ========================================================================== */
/* UNTERBRINGUNG: KAPAZITÄT UND ZEITBEZOGENE MITARBEITERZUORDNUNG            */
/* ========================================================================== */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
    padding: 13px 15px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-weight: 700;
}

.alert-error {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fecaca;
}

.alert-success {
    color: #166534;
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.accommodation-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.accommodation-card-detailed {
    display: block;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: #ffffff;
}

.accommodation-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.accommodation-card-head h3 {
    margin: 0;
    color: var(--blue);
}

.accommodation-card-head p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.occupancy-badge {
    flex: 0 0 auto;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.occupancy-badge.available {
    color: #166534;
    background: #dcfce7;
}

.occupancy-badge.full {
    color: #991b1b;
    background: #fee2e2;
}

.accommodation-details {
    display: grid;
    gap: 7px;
    margin: 15px 0;
    color: var(--muted);
    font-size: 13px;
}

.accommodation-details span {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.occupancy-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.section-heading-row h4 {
    margin: 0;
    color: var(--blue);
}

.section-heading-row p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.occupancy-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
}

.occupancy-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
}

.occupancy-row strong,
.occupancy-row small {
    display: block;
}

.occupancy-row small {
    margin-top: 3px;
    color: var(--muted);
}

.occupancy-form {
    display: grid;
    grid-template-columns: minmax(170px, 1.4fr) minmax(130px, 1fr) minmax(130px, 1fr) auto;
    align-items: end;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    background: #f3f7fb;
}

.occupancy-form label {
    min-width: 0;
    color: var(--blue);
    font-size: 12px;
    font-weight: 700;
}

.occupancy-form input,
.occupancy-form select {
    width: 100%;
    margin-top: 5px;
}

.btn-small {
    min-height: 42px;
    white-space: nowrap;
}

.empty.compact {
    padding: 10px;
    font-size: 13px;
}

@media (max-width: 1100px) {
    .accommodation-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .accommodation-card-head {
        flex-direction: column;
    }

    .occupancy-form {
        grid-template-columns: 1fr;
    }

    .occupancy-form .btn-small {
        width: 100%;
    }
}


/* ========================= FUHRPARK-ZEITRÄUME ========================== */
.vehicle-card-detailed {
    align-items: flex-start;
}

.vehicle-assignment-section {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.vehicle-assignment-list {
    display: grid;
    gap: 8px;
    margin: 12px 0;
}

.vehicle-assignment-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
}

.vehicle-assignment-row small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.vehicle-assignment-form {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
    gap: 10px;
    align-items: end;
}

.vehicle-assignment-note {
    grid-column: 1 / -2;
}

/* ========================= UNTERKUNFT-KOPF ============================= */
.accommodation-head-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 0 0 auto;
}

.accommodation-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.accommodation-card-actions a,
.accommodation-card-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 900px) {
    .vehicle-assignment-form {
        grid-template-columns: 1fr 1fr;
    }

    .vehicle-assignment-note {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .vehicle-assignment-form {
        grid-template-columns: 1fr;
    }

    .vehicle-assignment-note {
        grid-column: auto;
    }

    .accommodation-head-actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* ========================================================================
   V9 – FUHRPARK: STABILES KARTEN- UND FORMULARLAYOUT
   ======================================================================== */

/* Die Übersicht nutzt bewusst eine Spalte. Dadurch bleibt ausreichend
   Platz für Baustelle, Zeitraum, Fahrer, Hinweis und Aktionsbutton. */
.vehicle-grid {
    grid-template-columns: minmax(0, 1fr);
}

.vehicle-card-detailed {
    display: grid;
    grid-template-columns: 43px minmax(0, 1fr);
    align-items: start;
    overflow: hidden;
}

.vehicle-card-detailed .vehicle-body {
    min-width: 0;
}

.vehicle-card-detailed .vehicle-actions {
    position: static;
    grid-column: 2;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.vehicle-assignment-form {
    display: grid;
    grid-template-columns:
        minmax(180px, 1.4fr)
        minmax(145px, 1fr)
        minmax(145px, 1fr)
        minmax(180px, 1.2fr);
    gap: 12px;
    align-items: end;
    min-width: 0;
}

.vehicle-assignment-form label {
    min-width: 0;
}

.vehicle-assignment-form input,
.vehicle-assignment-form select {
    width: 100%;
    min-width: 0;
}

.vehicle-assignment-note {
    grid-column: 1 / -1;
}

.vehicle-assignment-form .btn {
    grid-column: 1 / -1;
    justify-self: start;
    width: auto;
    max-width: 100%;
    white-space: normal;
}

.vehicle-body dl div {
    grid-template-columns: 110px minmax(0, 1fr);
    column-gap: 10px;
}

.vehicle-body dd {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

@media (max-width: 1250px) {
    .fleet-layout {
        grid-template-columns: minmax(310px, 0.75fr) minmax(0, 1.25fr);
    }

    .vehicle-assignment-form {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .vehicle-assignment-note,
    .vehicle-assignment-form .btn {
        grid-column: 1 / -1;
    }
}

@media (max-width: 980px) {
    .fleet-layout {
        grid-template-columns: 1fr;
    }

    .vehicle-assignment-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .vehicle-card-detailed {
        grid-template-columns: 1fr;
    }

    .vehicle-card-detailed .vehicle-icon {
        margin-bottom: 10px;
    }

    .vehicle-card-detailed .vehicle-actions {
        grid-column: 1;
    }

    .vehicle-assignment-form {
        grid-template-columns: 1fr;
    }

    .vehicle-assignment-note,
    .vehicle-assignment-form .btn {
        grid-column: 1;
        width: 100%;
    }
}

/* ========================================================================
   V9 – BAUSTELLENÜBERSICHT: ERREICHBARE AKTIONEN
   ======================================================================== */

.site-list {
    display: grid;
}

.site-overview-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
    align-items: start;
    padding: 18px 0;
}

.site-card-content {
    min-width: 0;
}

.site-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.site-card-actions form {
    margin: 0;
}

.btn-site-planning {
    min-height: 38px;
    padding: 8px 13px;
    font-size: 13px;
    white-space: nowrap;
}

.icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    color: var(--blue);
    border-radius: 8px;
}

.icon-link:hover {
    color: var(--orange);
    background: #f3f6fa;
}

@media (max-width: 760px) {
    .site-overview-card {
        grid-template-columns: 1fr;
    }

    .site-card-actions {
        justify-content: flex-start;
    }
}


/* ==========================================================================
   V10 – KUNDENBRANDING WERDER BEDACHUNGEN
   ========================================================================== */

.client-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 92px;
    padding: 12px 14px;
    margin-bottom: 16px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
}

.client-logo {
    display: block;
    width: 200px;
    height: auto;
    margin: 0 auto 12px;
    margin-top: 10px;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
}

.product-brand {
    margin-bottom: 4px;
}

.fixed-site-filter {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    border: 1px solid #c8d7ea;
    border-radius: 10px;
    background: #eef5ff;
    color: var(--blue);
    font-weight: 700;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .client-brand {
        min-height: 76px;
        padding: 8px 12px;
    }

    .client-logo {
        max-height: 64px;
    }

    .fixed-site-filter {
        width: 100%;
        white-space: normal;
    }
}

/* ========================================================================
   V11 – MITARBEITER-INFOS: ABSTAND ZUM ANRUF-BUTTON
   ======================================================================== */
.accommodation-call-button {
    margin-top: 18px;
}

/* ========================================================================
   V11 – FUHRPARK: NICHTVERFÜGBARKEITEN
   ======================================================================== */
.vehicle-unavailability-section {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.vehicle-blocked-row {
    border-color: #f6c6c6;
    background: #fff7f7;
}

.vehicle-unavailability-form {
    display: grid;
    grid-template-columns:
        minmax(180px, 1.2fr)
        minmax(145px, 1fr)
        minmax(145px, 1fr);
    gap: 12px;
    align-items: end;
    min-width: 0;
}

.vehicle-unavailability-form label {
    min-width: 0;
}

.vehicle-unavailability-form input,
.vehicle-unavailability-form select {
    width: 100%;
    min-width: 0;
}

.vehicle-unavailability-note {
    grid-column: 1 / -1;
}

.vehicle-unavailability-form .btn {
    grid-column: 1 / -1;
    justify-self: start;
}

.field-help {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}

.field-help a {
    color: var(--blue);
    font-weight: 700;
}

/* ========================================================================
   V11 – ZENTRALE STAMMDATEN
   ======================================================================== */
.master-data-layout {
    align-items: start;
}

.master-data-list {
    display: grid;
    gap: 10px;
}

.master-data-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
}

.master-data-row strong,
.master-data-row small {
    display: block;
}

.master-data-row small {
    margin-top: 4px;
    color: var(--muted);
}

.master-data-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.master-data-actions form {
    margin: 0;
}

@media (max-width: 900px) {
    .vehicle-unavailability-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .vehicle-unavailability-note,
    .vehicle-unavailability-form .btn {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .vehicle-unavailability-form {
        grid-template-columns: 1fr;
    }

    .vehicle-unavailability-note,
    .vehicle-unavailability-form .btn {
        grid-column: 1;
        width: 100%;
    }

    .master-data-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .master-data-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* ========================================================================== 
   V12 – FUHRPARKFILTER
   ========================================================================== */
.fleet-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(150px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 22px;
  padding: 16px;
  border: 1px solid #dbe4ef;
  border-radius: 14px;
  background: #f8fafc;
}
.fleet-filter-bar label { display: grid; gap: 6px; font-weight: 700; font-size: 13px; }
.fleet-filter-actions { display: flex; gap: 8px; align-items: center; }

/* V12 – ERWEITERTE STAMMDATEN */
.master-data-dashboard { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.master-data-section { min-width: 0; }
.master-inline-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin: 14px 0 18px; }
.master-inline-form-wide { grid-template-columns: 1.5fr 90px 130px auto; }
.master-data-chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.master-data-chip { padding: 7px 10px; border-radius: 999px; background: #eef4fb; color: #0b2d5c; font-size: 13px; font-weight: 700; }
.section-note { color: #64748b; }

/* V12 – BENUTZERKONTEN UND LOGIN */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #eef3f8; }
.login-card { width: min(430px, 100%); padding: 34px; border-radius: 22px; background: #fff; box-shadow: 0 24px 70px rgba(11,45,92,.14); }
.login-logo {
    display: block;
    width: 250px;
    max-width: 100%;
    height: auto;
    margin: 0 auto 28px;
}
.login-product { color: #f28c28; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; }
.login-card h1 { color: #0b2d5c; margin: 8px 0 22px; }
.login-button { width: 100%; justify-content: center; }
.login-hint { margin-top: 18px; padding: 12px; border-radius: 10px; background: #fff7ed; font-size: 13px; }
.topbar-user { display: flex; align-items: center; gap: 9px; }
.topbar-role { color: #64748b; font-size: 12px; }
.logout-link { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; color: #0b2d5c; background: #eef4fb; }
.role-help { margin-top: 24px; padding: 16px; border-radius: 12px; background: #f8fafc; }
.role-help p { margin: 7px 0; }

@media (max-width: 1100px) {
  .fleet-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fleet-filter-actions { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .fleet-filter-bar, .master-data-dashboard, .master-inline-form, .master-inline-form-wide { grid-template-columns: 1fr; }
  .fleet-filter-actions { flex-wrap: wrap; }
  .topbar-role { display: none; }
}

/* ========================================================================== 
   V13 – BAUSTELLENDETAILSEITE
   ========================================================================== */
.site-detail-page {
  display: grid;
  gap: 20px;
}

.site-detail-header {
  display: grid;
  gap: 22px;
}

.site-detail-heading,
.section-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.site-detail-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-detail-title h2,
.section-heading-row h2 {
  margin: 0;
}

.site-detail-customer,
.section-heading-row p {
  margin: 6px 0 0;
  color: var(--muted);
}

.site-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: flex-end;
}

.site-detail-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.site-detail-facts > div,
.site-detail-note,
.site-accommodation-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}

.site-detail-facts span,
.site-detail-facts small,
.site-accommodation-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.site-detail-facts strong {
  display: block;
  margin-top: 5px;
}

.site-detail-note p {
  margin: 7px 0 0;
}

.site-detail-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.site-detail-kpis .metric-card {
  min-width: 0;
}

.site-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.timeline-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.timeline-row {
  display: grid;
  grid-template-columns: minmax(120px, 150px) 1fr;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}

.timeline-period strong,
.timeline-period span,
.timeline-content strong,
.timeline-content small {
  display: block;
}

.timeline-period span,
.timeline-content small {
  margin-top: 4px;
  color: var(--muted);
}

.timeline-content .first-aid-badge {
  margin-left: 8px;
}

.site-accommodation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.site-accommodation-card strong {
  display: block;
  margin-bottom: 7px;
}

.btn-site-detail {
  white-space: nowrap;
}

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

  .site-detail-grid {
    grid-template-columns: 1fr;
  }

  .site-accommodation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .site-detail-heading,
  .section-heading-row {
    flex-direction: column;
  }

  .site-detail-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .site-detail-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .site-detail-facts,
  .site-detail-kpis,
  .site-accommodation-grid {
    grid-template-columns: 1fr;
  }

  .timeline-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* ========================================================================== */
/* RC1 – Kartenposition, Fehlerseiten und Stammdaten                          */
/* ========================================================================== */

.coordinate-details {
    margin-top: 4px;
    padding: 14px 16px;
    border: 1px solid var(--border, #dfe5ec);
    border-radius: 10px;
    background: #f8fafc;
}

.coordinate-details summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--primary, #0b2d5c);
}

.coordinate-details[open] summary {
    margin-bottom: 10px;
}

.error-page {
    max-width: 720px;
    margin: 40px auto;
    text-align: center;
}

.error-code {
    font-size: clamp(3rem, 10vw, 6rem);
    line-height: 1;
    font-weight: 800;
    color: var(--primary, #0b2d5c);
    opacity: 0.18;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

/* ========================================================================== */
/* RC1 – Unterkunft: Mehrfachauswahl Baustellen                               */
/* ========================================================================== */

.field-help {
    display: block;
    margin-top: 6px;
    color: var(--muted, #64748b);
    font-size: 0.82rem;
    line-height: 1.4;
}

select[multiple] {
    min-height: 132px;
    padding: 8px;
}

/* ==========================================================================
   RC1 FINAL – KUNDENBRANDING UND STATUSMARKER
   ========================================================================== */

.client-brand {
    position: relative;
    min-height: 108px;
    padding: 16px 18px;
    overflow: hidden;
    background:
        radial-gradient(
            circle at 15% 15%,
            rgba(242, 140, 40, 0.20),
            transparent 42%
        ),
        linear-gradient(145deg, #173a66 0%, #071f40 100%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.10),
        0 10px 24px rgba(0, 0, 0, 0.24);
}

.client-brand::after {
    content: "Powered by IPMS";
    position: absolute;
    right: 10px;
    bottom: 2px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.client-logo {
    max-width: 224px;
    max-height: 78px;
    filter: drop-shadow(0 3px 7px rgba(0, 0, 0, 0.38));
}

.legend-marker.completed {
    background: #64748b;
}

.ipms-map-marker {
    --marker-color: #f28c28;
    background: var(--marker-color);
    transition:
        transform 0.16s ease,
        filter 0.16s ease;
}

.ipms-map-marker-wrap:hover .ipms-map-marker {
    filter: brightness(1.08);
    transform: rotate(-45deg) scale(1.08);
}

.ipms-map-marker.marker-active {
    --marker-color: #15803d;
}

.ipms-map-marker.marker-planned {
    --marker-color: #f28c28;
}

.ipms-map-marker.marker-critical {
    --marker-color: #dc3545;
}

.ipms-map-marker.marker-completed {
    --marker-color: #64748b;
}

.ipms-map-marker.marker-small {
    width: 34px;
    height: 34px;
    border-width: 4px;
}

.ipms-map-marker.marker-medium {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

.ipms-map-marker.marker-large {
    width: 46px;
    height: 46px;
    border-width: 5px;
}

.popup-site-status {
    display: inline-flex !important;
    width: fit-content;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
    margin-bottom: 1px !important;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
}

.popup-site-status i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.popup-site-status.status-active {
    color: #166534 !important;
    background: #dcfce7;
}

.popup-site-status.status-planned {
    color: #9a3412 !important;
    background: #ffedd5;
}

.popup-site-status.status-critical {
    color: #991b1b !important;
    background: #fee2e2;
}

.popup-site-status.status-completed {
    color: #475569 !important;
    background: #e2e8f0;
}

@media (max-width: 760px) {
    .client-brand {
        min-height: 88px;
        padding: 11px 14px;
    }

    .client-logo {
        max-height: 62px;
    }
}

/* ========================================================================== 
   RC1 FINAL – UNTERKUNFTSHINWEISE UND FILTER
   ========================================================================== */

.accommodation-filters {
    display: grid;
    grid-template-columns: minmax(190px, 1.4fr) minmax(180px, 1fr) minmax(150px, .8fr) auto auto;
    align-items: end;
    gap: 10px;
    margin-bottom: 18px;
}

.accommodation-filters label {
    min-width: 0;
}

.accommodation-filters input,
.accommodation-filters select {
    min-width: 0;
}

.accommodation-notes-box {
    margin-top: 12px;
    white-space: pre-line;
}

@media (max-width: 1180px) {
    .accommodation-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .accommodation-filters {
        grid-template-columns: 1fr;
    }

    .accommodation-filters .btn {
        width: 100%;
    }
}

/* ========================================================================== 
   RC1 SPRINTS 1–3 – ROLLEN, ÜBERSICHT, FILTER UND RESPONSIVE
   ========================================================================== */
.sidebar {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
}

.sidebar-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.nav-group-label {
    margin: 18px 16px 6px;
    color: rgba(255, 255, 255, .55);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.filters-responsive,
.site-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    align-items: end;
    gap: 12px;
    width: 100%;
    margin-bottom: 18px;
}

.filters-responsive > *,
.site-filters > * {
    min-width: 0;
    max-width: 100%;
}

.filters-responsive .btn,
.site-filters .btn {
    min-height: 44px;
    justify-content: center;
}

.aligned-nav {
    display: inline-grid;
    grid-template-columns: 44px minmax(92px, auto) 44px;
    align-items: center;
    gap: 8px;
}

.aligned-nav strong {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    line-height: 1;
    text-align: center;
}

.wrapping-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
}

.wrapping-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.overview-site-list {
    display: grid;
    gap: 16px;
}

.overview-site-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.overview-site-header p {
    margin: 6px 0;
}

.overview-disclosures {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.overview-disclosures details {
    border: 1px solid #dbe4ef;
    border-radius: 12px;
    background: #f8fafc;
}

.overview-disclosures summary {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 13px 15px;
    cursor: pointer;
    font-weight: 700;
}

.overview-disclosures summary span {
    margin-left: auto;
    color: #64748b;
    font-size: 12px;
}

.overview-detail-list {
    display: grid;
    gap: 8px;
    padding: 0 14px 14px;
}

.overview-detail-list > div {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) auto minmax(100px, .6fr);
    gap: 12px;
    padding: 10px 12px;
    border-radius: 9px;
    background: #fff;
}

.warning-panel {
    border-left: 4px solid #dc2626;
}

.cleanup-confirm-form {
    display: flex;
    align-items: end;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #dbe4ef;
}

.cleanup-confirm-form label {
    max-width: 360px;
}

.btn.danger {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #fff;
}

.qualification-entry {
    align-items: end;
}

.qualification-multi-select {
    min-height: 150px;
    padding: 6px;
}

.qualification-multi-select option {
    padding: 6px 8px;
}

.form-hint {
    display: block;
    margin-top: 6px;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.35;
}

@media (max-width: 1180px) {
    .fleet-filters,
    .accommodation-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .fleet-card form,
    .vehicle-assignment-form,
    .vehicle-unavailability-form {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 760px) {
    .sidebar {
        max-height: 100dvh;
    }

    .sidebar-scroll {
        padding-bottom: 24px;
    }

    .filters-responsive,
    .site-filters,
    .fleet-filters,
    .accommodation-filters,
    .fleet-card form,
    .vehicle-assignment-form,
    .vehicle-unavailability-form,
    .absence-form {
        grid-template-columns: 1fr !important;
    }

    .filters-responsive .btn,
    .site-filters .btn,
    .fleet-filters .btn,
    .accommodation-filters .btn {
        width: 100%;
    }

    .planning-toolbar,
    .overview-site-header,
    .cleanup-confirm-form {
        align-items: stretch;
        flex-direction: column;
    }

    .date-nav.aligned-nav {
        width: 100%;
        grid-template-columns: 44px 1fr 44px;
    }

    .view-switch {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .overview-detail-list > div {
        grid-template-columns: 1fr;
        gap: 3px;
    }
}


/* RC1 Testkorrektur 2: Meldungen bleiben unabhängig von der Scrollposition sichtbar. */
.alert {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 3000;
    width: min(520px, calc(100vw - 36px));
    box-shadow: 0 14px 34px rgba(11, 45, 92, 0.22);
}
@media (max-width: 640px) {
    .alert {
        top: 10px;
        right: 10px;
        width: calc(100vw - 20px);
    }
}

.qualification-dropdown {
    position: relative;
    width: 100%;
}

.qualification-dropdown summary {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
    user-select: none;
    list-style: none;
}

.qualification-dropdown summary::-webkit-details-marker {
    display: none;
}

.qualification-dropdown summary::after {
    content: "▾";
    margin-left: auto;
    font-size: 0.9rem;
    transition: transform 0.15s ease;
}

.qualification-dropdown[open] summary::after {
    transform: rotate(180deg);
}

.qualification-dropdown-content {
    position: absolute;
    z-index: 50;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
}

.qualification-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 4px;
    cursor: pointer;
}

.qualification-checkbox:hover {
    background: #f1f5f9;
}

.qualification-checkbox input {
    width: 16px;
    height: 16px;
    margin: 0;
}

.qualification-summary-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* RC1 Testkorrektur 4: Mehrfachqualifikationen und Mitarbeiterliste. */
.qualification-entry {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    align-items: end;
}

.qualification-entry > * {
    min-width: 0;
}

.qualification-field,
.qualification-new-field {
    min-width: 0;
}

.field-label {
    display: block;
    margin-bottom: 6px;
    color: var(--blue);
    font-size: 13px;
    font-weight: 700;
}

.qualification-dropdown,
.qualification-dropdown summary,
.qualification-new-field input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.qualification-dropdown summary {
    min-width: 0;
}

.qualification-summary-text {
    display: block;
    min-width: 0;
    max-width: calc(100% - 24px);
}

.qualification-dropdown-content {
    box-sizing: border-box;
}

.employee-actions {
    min-height: 22px;
    align-items: center;
    white-space: nowrap;
}

.employee-actions a,
.employee-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    line-height: 1;
    box-sizing: border-box;
}

.employees-table th:last-child,
.employees-table td:last-child {
    width: 86px;
    vertical-align: middle;
}

@media (max-width: 760px) {
    .qualification-entry {
        grid-template-columns: 1fr !important;
        align-items: stretch;
    }
}


/* RC1 Testkorrektur 5: einklappbare Übersichten */
.overview-disclosure {
    width: 100%;
    min-width: 0;
}

.overview-disclosure > summary {
    list-style: none;
}

.overview-disclosure > summary::-webkit-details-marker {
    display: none;
}

.overview-disclosure-summary {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        170px
        24px;
    align-items: center;
    gap: 16px;
}

.vehicle-summary-status {
    display: flex;
    justify-content: center;
}

.overview-disclosure-summary::after {
    content: "\F282";
    flex: 0 0 auto;
    font-family: "bootstrap-icons";
    font-size: 14px;
    transition: transform .18s ease;
}

.overview-disclosure[open] > .overview-disclosure-summary::after {
    transform: rotate(180deg);
}

.overview-disclosure-summary > div:first-child {
    min-width: 0;
}

.overview-disclosure-summary strong,
.overview-disclosure-summary small {
    display: block;
}

.overview-disclosure-summary small {
    margin-top: 4px;
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.overview-disclosure-content {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.vehicle-disclosure {
    grid-column: 1 / -1;
}

.vehicle-summary-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vehicle-summary-main > i {
    flex: 0 0 auto;
    font-size: 22px;
}

.vehicle-disclosure-content {
    display: grid;
    grid-template-columns: 43px minmax(0, 1fr);
    align-items: start;
}

@media (max-width: 620px) {
    .overview-disclosure-summary {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .overview-disclosure-summary::after {
        margin-left: auto;
    }
}


/* RC1 Testkorrektur 7: frei wählbare Icons für Fuhrparktypen */
.vehicle-type-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 18px;
}

.vehicle-type-form label {
    min-width: 0;
}

.vehicle-icon-select-wrap {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
}

.vehicle-icon-select-wrap > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    border: 1px solid var(--border);
    border-right: 0;
    border-radius: 6px 0 0 6px;
    background: var(--surface-soft, #f7f9fc);
    color: var(--blue);
    font-size: 20px;
}

.vehicle-icon-select-wrap select {
    min-width: 0;
    border-radius: 0 6px 6px 0;
}

.vehicle-type-form-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.vehicle-type-name {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.vehicle-type-name > span:last-child {
    min-width: 0;
}

.vehicle-type-icon {
    display: inline-flex;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(11, 45, 92, .08);
    color: var(--blue);
    font-size: 20px;
}

@media (max-width: 900px) {
    .vehicle-type-form {
        grid-template-columns: 1fr 1fr;
    }

    .vehicle-type-form-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .vehicle-type-form {
        grid-template-columns: 1fr;
    }

    .vehicle-type-form-actions {
        grid-column: auto;
        flex-wrap: wrap;
    }
}
