/* --- BASIS-VARIABLEN --- */
:root { 
    --main: #8d6e63;      /* Kaffee-Braun */
    --accent: #4caf50;    /* Erfolgs-Grün */
    --warning: #ffab40;   /* Hilfe-Orange */
    --danger: #ff5252;    /* Notfall-Rot */
    --text: #3e2723;
    --glass: rgba(255, 255, 255, 0.9);
}

/* --- ALLGEMEINES LAYOUT --- */
body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background-image: url('hintergrund.png'); 
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    margin: 0; 
    padding: 0;
    color: var(--text); 
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Sorgt dafür, dass der Footer unten bleibt */
}

/* --- ADMIN-LOGIN-KNOPF --- */
.admin-trigger { 
    position: absolute; 
    top: 15px; 
    right: 15px; 
    z-index: 1000; 
}

#login-btn, #logout-btn { 
    background: rgba(238, 238, 238, 0.9); 
    border: 1px solid #ccc; 
    cursor: pointer; 
    padding: 6px 12px; 
    border-radius: 4px; 
    font-weight: bold;
    color: #555;
}

#logout-btn { 
    background: #ffebee; 
    color: #c62828; 
    border-color: #ffcdd2; 
}

/* --- HEADER --- */
/* --- HEADER --- */
.main-header {
    /* Viel transparenter: Nur noch 40% Weiß */
    background: rgba(255, 255, 255, 0.4); 
    padding: 2rem 1rem;
    text-align: center;
    border-bottom: 4px solid var(--main);
    
    /* Der Milchglas-Effekt (Blur) */
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px); /* Wichtig für Safari/Apple-Geräte */
    
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.main-header h1 {
    margin: 0;
    font-size: 2.8rem;
    color: var(--main);
    /* Ein leichter Schatten, damit die Schrift auf dem Bild lesbar bleibt */
    text-shadow: 1px 1px 4px rgba(255, 255, 255, 0.8); 
}

.subtitle {
    margin: 5px 0 15px 0;
    font-weight: bold;
    color: #e91e63; /* Pinkton aus dem Bild-Slogan */
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.9rem;
}

#quote-box {
    font-style: italic;
    color: var(--text);
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.1rem;
    padding: 10px;
    background: rgba(255,255,255,0.4);
    border-radius: 8px;
}

/* --- HAUPTBEREICH --- */
.main-layout { 
    display: flex; 
    gap: 30px; 
    max-width: 1400px; 
    margin: 30px auto; 
    padding: 0 20px 100px 20px; /* Puffer unten für den sticky footer */
    flex: 1;
    width: 95%;
}

/* --- SIDEBAR --- */
.sidebar { 
    width: 280px; 
    min-width: 280px; 
    background: var(--glass);
    padding: 20px; 
    border-radius: 12px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: sticky; 
    top: 20px; 
    height: fit-content;
    box-sizing: border-box;
}

.pool-zone {
    margin-top: 15px;
    max-height: 400px;
    overflow-y: auto;
}

/* --- INHALTSBEREICH --- */
.content { 
    flex: 1; 
}

/* Dashboard Summary */
.summary-box { 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
    margin-bottom: 30px; 
}

.summary-item { 
    padding: 15px; 
    border-radius: 10px; 
    border-left: 10px solid; 
    background: var(--glass);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); 
}

.red-alert { border-color: var(--danger); color: #b71c1c; }
.orange-alert { border-color: var(--warning); color: #e65100; }
.green-alert { border-color: var(--accent); color: #2e7d32; } /* NEU: Das grüne Feld */

.day-badge { 
    display: inline-block; 
    background: rgba(0,0,0,0.05); 
    padding: 3px 8px; 
    border-radius: 4px; 
    margin: 2px; 
    font-size: 0.9rem; 
    font-weight: bold;
}

/* Admin Box */
.admin-box { 
    background: rgba(255, 253, 231, 0.95); 
    padding: 20px; 
    border-radius: 10px; 
    border: 2px dashed #fbc02d; 
    margin-bottom: 25px; 
}

/* --- TERMIN-GRID & KARTEN --- */
.grid { 
    display: grid; 
    /* Erzwingt exakt zwei gleich breite Spalten nebeneinander */
    grid-template-columns: 1fr 1fr; 
    gap: 25px; 
}

/* Wichtig für Smartphones: 
Damit die Karten auf kleinen Handydisplays nicht unlesbar klein gequetscht werden, 
brechen wir sie bei sehr schmalen Bildschirmen wieder in eine Spalte um. */
@media (max-width: 900px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

.shift-card { 
    position: relative; 
    padding: 20px; 
    border-radius: 15px; 
    border-top: 12px solid #ccc; /* Dickere Status-Leiste */
    box-shadow: 0 6px 18px rgba(0,0,0,0.2); 
    overflow: hidden; 
    min-height: 220px;
    background: white;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Kartenfarben je nach Status */
.shift-card.status-empty { 
    border-top-color: var(--danger) !important; 
    background-color: rgba(255, 245, 245, 0.98) !important; 
}

.shift-card.status-single { 
    border-top-color: var(--warning) !important; 
    background-color: rgba(255, 250, 240, 0.98) !important; 
}

.shift-card.status-ok { 
    border-top-color: var(--accent) !important; 
    background-color: rgba(245, 255, 245, 0.98) !important; 
}

.status-watermark { 
    position: absolute; 
    bottom: -10px; 
    right: -5px; 
    font-size: 6rem; 
    opacity: 0.12; 
    pointer-events: none; 
    z-index: 0; 
}

.shift-card.drag-over { 
    border: 2px dashed var(--main); 
    background-color: #fff9c4 !important;
}

/* Mitarbeiter im Termin */
.worker-tag { 
    background: white; 
    padding: 5px 12px; 
    border-radius: 20px; 
    margin: 4px; 
    display: inline-flex; 
    align-items: center; 
    border: 1px solid #ddd; 
    position: relative; 
    z-index: 2; 
    box-shadow: 1px 1px 3px rgba(0,0,0,0.1);
}

.remove-x { 
    color: var(--danger); 
    margin-left: 10px; 
    cursor: pointer; 
    font-weight: bold; 
}

/* --- STICKY FOOTER --- */
.main-footer {
    position: sticky;
    bottom: 0;
    width: 100%;
    background: var(--main);
    color: white;
    padding: 18px 0;
    text-align: center;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.3);
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.footer-contact {
    font-size: 1.05rem;
    letter-spacing: 0.5px;
}

/* --- FORMULAR-ELEMENTE --- */
input, button { 
    padding: 10px; 
    border-radius: 6px; 
    border: 1px solid #ccc; 
    font-size: 0.95rem;
}

button { 
    background: var(--main); 
    color: white; 
    cursor: pointer; 
    border: none; 
    font-weight: bold; 
    transition: background 0.2s;
}

button:hover { 
    filter: brightness(1.1); 
}

.draggable-name { 
    background: #efebe9; 
    padding: 12px; 
    margin: 8px 0; 
    border-radius: 8px; 
    cursor: grab; 
    border: 1px solid #d7ccc8; 
    text-align: center; 
    font-weight: bold; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.draggable-name:active { 
    cursor: grabbing; 
}

.delete-btn { 
    background: #ffebee; 
    color: #c62828; 
    margin-top: 15px; 
    width: 100%; 
    border: 1px solid #ffcdd2; 
    font-size: 0.8rem; 
}
/* =======================================================
   📱 MOBILE ANSICHT (Smartphones & schmale Tablets)
   ======================================================= */
@media (max-width: 850px) {
    /* Layout wird untereinander gestapelt statt nebeneinander */
    .main-layout { 
        flex-direction: column; 
        padding: 0 10px 120px 10px; /* Etwas weniger Rand, Platz für Footer */
        width: 100%;
        box-sizing: border-box;
    }

    /* Header anpassen */
    .main-header { padding: 1.5rem 0.5rem; }
    .main-header h1 { font-size: 2rem; }
    .subtitle { font-size: 0.8rem; }

    /* Sidebar rutscht nach oben und scrollt nicht mehr mit */
    .sidebar { 
        width: 100%; 
        min-width: 100%; 
        position: relative; 
        top: 0; 
        padding: 15px; 
        box-sizing: border-box;
    }

    /* Mitarbeiter-Pool wird zur wischbaren horizontalen Leiste */
    .pool-zone {
        display: flex;
        overflow-x: auto;
        gap: 10px;
        padding-bottom: 10px; /* Platz für die Scrollbar */
        max-height: auto;
    }

    .draggable-name {
        white-space: nowrap; /* Namen brechen nicht um */
        margin: 0; /* Vertikaler Abstand weg */
        padding: 10px 15px;
    }

    /* Grid bricht in eine einzige Spalte um */
    .grid { 
        grid-template-columns: 1fr; 
    }

    /* Admin-Bereich: Inputs und Button untereinander für fette Finger */
    .admin-flex { 
        flex-direction: column; 
    }
    
    .admin-flex input, .admin-flex button { 
        width: 100%; 
        box-sizing: border-box;
        padding: 12px; /* Größere Touch-Fläche */
        font-size: 1rem;
    }

    /* Eingabefeld in den Terminkarten auch untereinander */
    .shift-card > div:nth-last-child(2) {
        flex-direction: column;
    }
    
    .shift-card input[type="text"] {
        width: 100% !important;
        margin-bottom: 5px;
        box-sizing: border-box;
    }

    /* Footer Text anpassen */
    .footer-contact {
        font-size: 0.85rem;
        line-height: 1.6;
    }
    
    /* Footer-Inhalte auf Handys mit Zeilenumbruch */
    .footer-contact strong { display: inline-block; margin-top: 5px; }
}