body {
    font-family: Arial, sans-serif;
    background-color: #f2f2f2;
    margin: 0;
    padding: 30px;
}

/* Überschriften */
h1 {
    color: darkred;
}

/* Navigation */
nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 15px;
    margin-bottom: 20px;
}

nav a {
    color: darkred;
    font-weight: bold;
    text-decoration: none;
}

nav a:hover {
    text-decoration: underline;
}

/* Standard-Box für Seiten */
.card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    max-width: 700px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

/* Breite Einsatzübersicht */
.einsatz-card {
    max-width: 1300px;
    width: calc(100vw - 60px);
}

/* Formularfelder */
label {
    display: block;
    margin-top: 15px;
    font-weight: bold;
}

input,
select,
textarea {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 5px;
}

textarea {
    height: 100px;
    resize: vertical;
}

/* Buttons */
button {
    margin-top: 20px;
    padding: 12px 20px;
    background-color: darkred;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

button:hover {
    background-color: #a00000;
}

/* Meldung beim Erstellen */
#meldung {
    margin-top: 15px;
    font-weight: bold;
}

/* Aktive Einsätze oben, beendete darunter */
.einsatz-layout {
    display: block;
    width: 100%;
}

/* Bereiche */
.einsatz-links,
.einsatz-rechts {
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 18px;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

/* Überschrift aktive Einsätze */
.einsatz-links h3 {
    margin-top: 0;
    color: darkred;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

/* Bereiche Alarmiert, Unterwegs und Vor Ort */
.status-bereich {
    margin-top: 20px;
}

.status-bereich h4 {
    margin-bottom: 10px;
    color: #333;
}

.status-bereich h4 span {
    color: #777;
    font-size: 14px;
}

/* Immer zwei aktive Einsätze nebeneinander */
.aktive-einsatz-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
    width: 100%;
}

/* Einsatzkarten innerhalb des Grids */
.aktive-einsatz-grid .einsatz {
    min-width: 0;
    width: 100%;
    margin-top: 0;
}

/* Leermeldung über beide Spalten */
.aktive-einsatz-grid > .leer {
    grid-column: 1 / -1;
}

/* Beendete Einsätze immer unten */
.einsatz-rechts {
    display: block;
    margin-top: 25px;
}

/* Aufklappbare Überschrift */
.einsatz-rechts summary {
    color: darkred;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    padding: 5px 0;
}

/* Geöffneter Bereich */
.einsatz-rechts[open] summary {
    border-bottom: 1px solid #ddd;
    padding-bottom: 12px;
    margin-bottom: 15px;
}

/* Einsatzkarte */
.einsatz {
    border: 1px solid #ccc;
    padding: 15px;
    margin-top: 15px;
    border-radius: 8px;
    background-color: white;
    box-sizing: border-box;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: normal;
}

.einsatz h4 {
    margin-top: 0;
    color: darkred;
}

.einsatz p {
    margin: 9px 0;
}

/* Statusanzeige */
.status {
    font-weight: bold;
    color: darkred;
}

/* Status-Buttons */
.status-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.status-buttons button {
    margin-top: 0;
    padding: 8px 12px;
    font-size: 14px;
    white-space: nowrap;
}

/* Keine Einsätze vorhanden */
.leer {
    color: #777;
    font-style: italic;
}

/* Fahrzeugstatus */
.fahrzeug-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    color: white;
    font-size: 13px;
    font-weight: bold;
}

.fahrzeug-status.verfuegbar {
    background-color: green;
}

.fahrzeug-status.nicht_verfuegbar {
    background-color: darkred;
}

.fahrzeug-status.unterwegs {
    background-color: #0d6efd;
}

.fahrzeug-status.vor_ort {
    background-color: orange;
}

/* Tablet und Handy */
@media (max-width: 900px) {
    body {
        padding: 15px;
    }

    .card,
    .einsatz-card {
        width: 100%;
        max-width: none;
    }

    .einsatz-card {
        padding: 15px;
    }

    /* Weiterhin zwei Karten nebeneinander */
    .aktive-einsatz-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .einsatz-layout {
        display: block;
    }

    .einsatz-rechts {
        margin-top: 20px;
    }
}

/* Kleine Handys */
@media (max-width: 500px) {
    body {
        padding: 8px;
        font-size: 14px;
    }

    .card,
    .einsatz-card {
        padding: 10px;
    }

    .einsatz-links,
    .einsatz-rechts {
        padding: 10px;
    }

    /* Auch hier zwei Karten nebeneinander */
    .aktive-einsatz-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .einsatz {
        padding: 10px;
    }

    .status-buttons {
        gap: 5px;
    }

    .status-buttons button {
        padding: 7px 8px;
        font-size: 12px;
    }

    button {
        padding: 9px 10px;
        font-size: 12px;
    }

    input,
    select,
    textarea {
        padding: 8px;
        font-size: 12px;
    }
}

/* Fahrzeugliste: zwei Fahrzeuge nebeneinander */
#fahrzeugListe {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

/* Fahrzeugkarten in der Fahrzeugliste */
#fahrzeugListe .einsatz {
    margin-top: 0;
    width: 100%;
}

/* Falls keine Fahrzeuge da sind */
#fahrzeugListe .leer {
    grid-column: 1 / -1;
}

/* Auf kleinen Handys wieder untereinander */
@media (max-width: 650px) {
    #fahrzeugListe {
        grid-template-columns: 1fr;
    }
}

/* Rückmeldungen nach Abteilung */
.abteilung-liste {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.abteilung-box {
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
}

.abteilung-box h5 {
    margin: 0 0 10px 0;
    color: darkred;
    font-size: 16px;
}

.abteilung-box p {
    margin: 6px 0;
}

/* Einsatzkarte mit Karte rechts */
.einsatz-mit-karte {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 20px;
    align-items: start;
}

.einsatz-info {
    min-width: 0;
}

.einsatz-map {
    width: 100%;
    min-height: 260px;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    background: #f5f5f5;
}

.einsatz-map iframe {
    width: 100%;
    height: 260px;
    border: 0;
    display: block;
}

.einsatz-map-title {
    font-weight: bold;
    color: darkred;
    margin-bottom: 8px;
}

/* Auf Handy untereinander */
@media (max-width: 900px) {
    .einsatz-mit-karte {
        grid-template-columns: 1fr;
    }

    .einsatz-map iframe {
        height: 220px;
    }
}

/* Einsatzübersicht mit kleiner Karte rechts oben */
.einsatz-uebersicht-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 15px;
    align-items: start;
}

.einsatz-uebersicht-info {
    min-width: 0;
}

.einsatz-uebersicht-map-box {
    min-width: 0;
}

.einsatz-uebersicht-map-title {
    font-weight: bold;
    color: darkred;
    margin-bottom: 6px;
}

.einsatz-uebersicht-map {
    width: 100%;
    height: 180px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.einsatz-uebersicht-map iframe {
    width: 100%;
    height: 180px;
    border: 0;
    display: block;
}

/* Unterer Bereich nutzt wieder die ganze Einsatzkarten-Breite */
.einsatz-uebersicht-unten {
    grid-column: 1 / -1;
}

/* Rückmeldungen in der Einsatzübersicht sauber darstellen */
.einsatz-uebersicht-rueckmeldung {
    white-space: nowrap;
}

/* Buttons unten wieder sauber nebeneinander */
.einsatz-uebersicht-unten .status-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.einsatz-uebersicht-unten .status-buttons button {
    margin-top: 0;
}

/* Fahrzeug-Auswahl unten nicht zu riesig */
.einsatz-uebersicht-unten select {
    max-width: 420px;
}

/* Wenn es zu schmal wird, Karte unter die Infos */
@media (max-width: 900px) {
    .einsatz-uebersicht-layout {
        grid-template-columns: 1fr;
    }

    .einsatz-uebersicht-unten {
        grid-column: 1;
    }

    .einsatz-uebersicht-map {
        height: 200px;
    }

    .einsatz-uebersicht-map iframe {
        height: 200px;
    }

    .einsatz-uebersicht-rueckmeldung {
        white-space: normal;
    }
}

/* Fahrzeuge im Einsatz untereinander mit Status */
.einsatz-fahrzeuge-liste {
    display: grid;
    gap: 7px;
    margin-top: 8px;
    margin-bottom: 12px;
}

.einsatz-fahrzeug-zeile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 7px 9px;
    border: 1px solid #ddd;
    border-radius: 7px;
    background: #fafafa;
}

.einsatz-fahrzeug-name {
    font-weight: bold;
    min-width: 0;
}

/* Auf kleinen Bildschirmen Status unter den Namen */
@media (max-width: 600px) {
    .einsatz-fahrzeug-zeile {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }
}