/* ===========================================
   Allgemein
=========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    background: #f5f6f8;
    color: #222;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===========================================
   Kopfbereich
=========================================== */

header {
    height: 64px;

    background: #005ea8;
    color: white;

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 0 24px;

    box-shadow: 0 2px 6px rgba(0,0,0,.15);

    z-index: 1000;
}

header h1 {
    font-size: 26px;
}

header a {
    color: white;
    text-decoration: none;
    font-weight: 600;
}

header a:hover {
    text-decoration: underline;
}

/* ===========================================
   Layout
=========================================== */

#admin-layout {

    flex: 1;

    display: flex;

    overflow: hidden;

}

/* ===========================================
   Seitenleiste
=========================================== */

#sidebar {

    width: 320px;

    background: rgb(255, 255, 255);

    border-right: 1px solid #d9d9d9;

    padding: 20px;

    overflow-y: auto;

    box-shadow: 2px 0 8px rgba(0,0,0,.05);

}

#sidebar h2 {

    font-size: 18px;

    margin-bottom: 15px;

}

#zone-list {

    margin-bottom: 25px;

    user-select: none;

}

/* ===========================================
   Zoneneinträge
=========================================== */

.zone-item {

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 12px 14px;

    margin-bottom: 8px;

    border-radius: 8px;

    border: 1px solid #d9d9d9;

    background: white;

    cursor: pointer;

    transition: all .15s ease;

}

.zone-item:hover {

    background: #f4f8fd;

    border-color: #5a9df5;

}

.zone-item.selected {

    background: #dcecff;

    border-color: #2f80ed;

    font-weight: 600;

}

.zone-color {

    width: 16px;

    height: 16px;

    border-radius: 4px;

    border: 1px solid rgba(0,0,0,.25);

    flex-shrink: 0;

}

/* ===========================================
   Eigenschaften
=========================================== */

#zone-editor {

    border-top: 1px solid #ddd;

    padding-top: 20px;

}

#zone-editor h2 {

    margin-bottom: 15px;

}

#zone-editor label {

    display: block;

    font-weight: 600;

    margin-bottom: 6px;

    margin-top: 16px;

}

#zone-editor input[type="text"] {

    width: 100%;

    padding: 10px 12px;

    border: 1px solid #cfcfcf;

    border-radius: 6px;

    font-size: 15px;

}

#zone-editor input[type="text"]:focus {

    outline: none;

    border-color: #2f80ed;

}

/* ===========================================
   Karte
=========================================== */

main {

    flex: 1;

}

#map {

    width: 100%;

    height: 100%;

}

/* ===========================================
   Leaflet
=========================================== */

.leaflet-container {

    background: #ddd;

}

#zone-editor select {

    width: 100%;

    padding: 10px 12px;

    border: 1px solid #cfcfcf;

    border-radius: 6px;

    font-size: 15px;

    background: white;

}

#zone-editor select:focus {

    outline: none;

    border-color: #2f80ed;

}

/* ===========================================
   Statuskarten
=========================================== */

#status-cards {

    display: flex;

    flex-direction: column;

    gap: 12px;

    margin-bottom: 25px;

}

.status-card {

    background: white;

    border-radius: 10px;

    padding: 14px 18px;

    display: flex;

    justify-content: space-between;

    align-items: center;

    border-left: 8px solid;

    box-shadow: 0 2px 8px rgba(0,0,0,.08);

}

.status-card.aufgebaut {

    border-color: #28a745;

}

.status-card.abgebaut {

    border-color: #dc3545;

}

.status-title {

    font-size: 15px;

    font-weight: 600;

}

.status-count {

    font-size: 28px;

    font-weight: bold;

}

/* ===========================================
   Speicherstatus
=========================================== */

#save-status {

    position: fixed;

    bottom: 20px;

    right: 20px;

    padding: 10px 16px;

    border-radius: 8px;

    font-size: 14px;

    font-weight: 600;

    color: white;

    background: #28a745;

    box-shadow: 0 2px 8px rgba(0,0,0,.2);

    transition: background-color 0.2s;

    z-index: 9999;

}

#save-status.saving {

    background: #f39c12;

}

#save-status.saved {

    background: #28a745;

}

#zone-editor textarea {

    width: 100%;

    min-height: 120px;

    resize: vertical;

    padding: 10px;

    border: 1px solid #cfcfcf;

    border-radius: 6px;

    font-family: inherit;

    font-size: 14px;

}

#zone-editor textarea:focus {

    outline: none;

    border-color: #2f80ed;

}

/* ===========================================
   Login
=========================================== */

#login-overlay.hidden {

    display: none;

}

#login-overlay {

    position: fixed;

    inset: 0;

    background: rgba(0,0,0,.45);

    display: flex;

    justify-content: center;

    align-items: center;

    z-index: 10000;

}

#login-box {

    width: 380px;

    background: white;

    border-radius: 10px;

    padding: 24px;

    box-shadow: 0 10px 30px rgba(0,0,0,.25);

}

#login-box h2 {

    margin-bottom: 10px;

}

#login-box p {

    margin-bottom: 15px;

}

#login-box input {

    width: 100%;

    padding: 10px;

    font-size: 15px;

    border: 1px solid #ccc;

    border-radius: 6px;

}

#login-error {

    color: #d32f2f;

    min-height: 20px;

    margin-top: 10px;

    margin-bottom: 10px;

}

.login-buttons {

    display: flex;

    justify-content: flex-end;

    gap: 10px;

    margin-top: 20px;

}

.login-buttons button {

    padding: 10px 18px;

    border: none;

    border-radius: 6px;

    cursor: pointer;

}

#login-submit {

    background: #005ea8;

    color: white;

}

#login-cancel {

    background: #ddd;

}

/* ===========================================
   Zonenbeschriftung
=========================================== */

.zone-label {

    background: rgba(255,255,255,0.95);

    border: 1px solid #555;

    border-radius: 5px;

    padding: 3px 8px;

    font-size: 13px;

    font-weight: bold;

    color: black;

    white-space: nowrap;

    text-align: center;

    box-shadow: 0 2px 6px rgba(0,0,0,.25);

}