:root {
    --primary: #007aff; /* Modernes App-Blau */
    --success: #34c759; /* Apple Grün */
    --danger: #ff3b30;  /* Apple Rot */
    --warning: #ffcc00;
    --text: #1d1d1f;    /* Weiches Schwarz */
    --gray: #86868b;
    --bg: #f5f5f7;      /* Edles Hellgrau für den Hintergrund */
    --card-bg: #ffffff;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    padding-bottom: 100px; /* Platz für die Bottom Navigation */
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}

/* =========================================
   1. BOTTOM NAVIGATION (MILCHGLAS-EFFEKT)
   ========================================= */
.navbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-around;
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px)) 0;
    z-index: 1000;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.04);
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--gray);
    font-size: 0.75rem;
    font-weight: 600;
    gap: 6px;
    transition: transform 0.1s;
}

.nav-link .nav-icon {
    font-size: 1.4rem;
    /* 🔥 NEU: Volle Farbe, aber leicht transparent für den modernen Look */
    filter: opacity(0.4); 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link.active .nav-icon {
    /* 🔥 NEU: Volle Deckkraft und das Icon springt leicht nach oben */
    filter: opacity(1);
    transform: scale(1.25) translateY(-3px); 
}

.nav-link.active .nav-icon {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.15); /* Icon wird leicht größer, wenn aktiv */
}

/* =========================================
   2. DER MAGISCHE RIESEN-BUTTON
   ========================================= */
.btn-in, .btn-out {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 30px auto;
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent; /* Verhindert das blaue Flackern beim Tippen */
}

/* Die Klick-Animation (fühlt sich physisch an) */
.btn-in:active, .btn-out:active {
    transform: scale(0.92);
}

.btn-in {
    background: linear-gradient(135deg, #34c759 0%, #28a745 100%);
    box-shadow: 0 20px 40px rgba(52, 199, 89, 0.3);
}

.btn-out {
    background: linear-gradient(135deg, #ff3b30 0%, #dc3545 100%);
    box-shadow: 0 20px 40px rgba(255, 59, 48, 0.3);
}

/* DER LOGIK-TRICK: Ausblenden der inaktiven Buttons ohne JS! */
.btn-in:disabled, .btn-out:disabled {
    display: none !important;
}

/* =========================================
   3. EINGABEFELDER & TEXT
   ========================================= */
input[type="email"], input[type="password"], input[type="text"], input[type="date"], select {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,0.1);
    background: var(--card-bg);
    font-size: 1rem;
    box-sizing: border-box;
    margin-bottom: 12px;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
    -webkit-appearance: none; /* Entfernt Standard-iOS-Styling */
}

input:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

/* 🔥 Mindestschrift 16px für ALLE Eingabefelder (auch number, time, textarea).
   Grund: iOS/Safari zoomt beim Antippen automatisch in die Seite hinein, wenn die Schrift
   kleiner als 16px ist. Früher hat "user-scalable=no" das unterdrückt – das wurde entfernt
   (Pinch-Zoom, WCAG 1.4.4), deshalb muss die Schriftgröße das jetzt selbst verhindern. */
input, select, textarea {
    font-size: 16px;
}

/* =========================================
   TOUCH-ZIELE (mind. 44x44px, WCAG 2.5.5)
   =========================================
   .icon-btn  – kleine Symbol-Schaltflächen (✏️ 🗑️ ✖) in Listen
   .aktion-btn – Text-Schaltflächen in Button-Reihen
   Vorher hatten diese Buttons 4–8px Innenabstand und lagen direkt nebeneinander –
   auf dem Handy zu klein und mit hoher Gefahr, versehentlich Löschen zu treffen. */
.icon-btn {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 8px;
}

/* =========================================
   KOPFZEILE MITARBEITER-KARTE (Stunden, Admin)
   =========================================
   Links der Name, rechts die Kennzahlen-Box. Die Box braucht ihre ~155px, sonst
   brechen "STUNDENKONTO" und der Wert ineinander. Auf schmalen Geräten (<380px)
   bleibt daneben zu wenig für den Namen – dort stapeln wir beides untereinander,
   sonst läuft die Zeile über den rechten Rand hinaus. */
.ma-kopf {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.ma-stats {
    background: white;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid #e5e5ea;
    line-height: 1.3;
    min-width: 155px;
    box-sizing: border-box; /* 155px inkl. Polster statt zzgl. – spart 30px */
}

@media (max-width: 380px) {
    .ma-kopf { flex-direction: column; align-items: stretch; }
    .ma-stats { width: 100%; }
}

.aktion-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    padding: 6px 12px;
    text-align: center;
}

.btn-login {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 10px 20px rgba(0, 122, 255, 0.2);
}
.btn-login:active {
    transform: scale(0.96);
}

/* =========================================
   4. UHRZEIT & KARTEN
   ========================================= */
.clock-display {
    font-size: 4rem; /* Riesige, klare Uhrzeit */
    font-weight: 800;
    font-variant-numeric: tabular-nums; /* Zahlen springen nicht beim Ticken */
    margin: 10px 0;
    letter-spacing: -2px;
}

.date-text {
    font-size: 0.95rem;
    color: var(--gray);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* =========================================
   5. KALENDER & DIENSTPLAN (HANDY-FIX)
   ========================================= */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
}

.calendar-day {
    background: var(--card-bg);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 12px;
    padding: 8px 4px;
    text-align: center;
    min-height: 80px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
    /* 🔥 DER WICHTIGSTE BEFEHL: Zwingt die Box, auf dem Display zu bleiben */
    min-width: 0; 
    overflow: hidden;
    box-sizing: border-box;
}

/* Im Mehrfachmodus angetippter Tag. Bewusst kräftig, damit auf einen Blick
   erkennbar ist, was beim Speichern angelegt wird. */
.calendar-day.tag-gewaehlt {
    background: #eaf4ff;
    border: 2px solid var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

.calendar-day.tag-gewaehlt .day-number {
    color: var(--primary);
    font-weight: 800;
}

.shift-badge {
    font-size: 0.65rem; /* Perfekte Lesbarkeit für Handys */
    color: white;
    padding: 5px 4px;
    border-radius: 6px;
    margin-top: 5px;
    font-weight: 800;
    line-height: 1.1;
    /* 🔥 SCHUTZWAND FÜR LANGE NAMEN: Schneidet ab und setzt ... */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.day-number {
    display: block;
    font-size: 0.8rem;
    color: var(--text);
    margin-bottom: 5px;
}

/* =========================================
   🔥 ADMIN COCKPIT DESIGN (EINSTELLUNGEN)
   ========================================= */

.admin-cockpit-wrapper {
    max-width: 1600px; 
    margin: 0 auto;
    padding: 20px;
}

/* NEU: Das fließende Spalten-Layout (Masonry) */
.cockpit-grid {
    column-count: 3; /* 3 Spalten auf sehr großen Monitoren */
    column-gap: 25px; /* Abstand zwischen den Spalten */
    margin-top: 20px;
}

/* Die einzelnen Boxen */
.cockpit-panel {
    background: #ffffff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    border-top: 5px solid var(--primary);
    
    /* NEU: Zwingt die Box zusammenzubleiben und gibt Abstand nach unten */
    break-inside: avoid; 
    margin-bottom: 25px; 
}

.cockpit-panel h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.2rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* NEU: Responsive Anpassung je nach Bildschirmgröße */
@media (max-width: 1200px) {
    .cockpit-grid {
        column-count: 2; /* Nur 2 Spalten auf normalen Laptops */
    }
}

@media (max-width: 768px) {
    .cockpit-grid {
        column-count: 1; /* Alles brav untereinander auf dem Handy */
    }
}

/* =========================================
   🪄 COCKPIT KLAPP-FUNKTION (ACCORDION)
   ========================================= */

/* Wenn das Panel die Klasse 'collapsed' hat, verstecke alles AUSSER der Überschrift.
   !important ist hier nötig und kein Faulheitsfehler: Etliche Elemente im Cockpit
   tragen ein INLINE display (z.B. `<label style="display:block">`), und ein
   Inline-Stil schlägt jede Stylesheet-Regel. Ohne !important blieben beim
   zugeklappten Panel die Beschriftungen stehen, während ihre Eingabefelder
   verschwinden — gefunden am 01.08.2026 beim Durchgang auf Staging, betraf
   9 Elemente in vier Panels. Die Regel schützt zugleich vor künftigen
   Inline-Stilen, von denen es in dieser Datei viele gibt. */
.cockpit-panel.collapsed > *:not(h3) {
    display: none !important;
}

/* Mach die Überschrift klickbar wie einen Button */
.cockpit-panel h3 {
    cursor: pointer;
    user-select: none; /* Verhindert, dass der Text beim schnellen Klicken blau markiert wird */
    margin-bottom: 20px;
    transition: margin 0.2s;
}

/* Wenn das Panel zu ist, braucht die Überschrift keinen Abstand nach unten */
.cockpit-panel.collapsed h3 {
    margin-bottom: 0;
}

/* =========================================
   ℹ️ HILFE-AUFKLAPPER
   =========================================
   Bewusst als natives <details>/<summary>: kein JavaScript, funktioniert
   offline und auch dann, wenn ein Skript hängt. Der Aufklapper steht direkt
   unter der Einstellung, die er erklärt – dadurch bleibt das Panel kurz
   scannbar und die ausführliche Erklärung ist trotzdem einen Tipp entfernt. */

.hilfe {
    margin: -8px 0 18px 0; /* rückt dicht an das Feld darüber */
    font-size: 0.85rem;
}

.hilfe > summary {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 44px; /* Touch-Ziel, gleiche Vorgabe wie .aktion-btn */
    cursor: pointer;
    color: var(--primary);
    font-weight: 600;
    user-select: none;
    list-style: none; /* Standard-Dreieck weg (Chrome/Firefox) */
}
/* Safari/iOS braucht den eigenen Weg, sonst bleibt das Dreieck stehen */
.hilfe > summary::-webkit-details-marker { display: none; }

.hilfe > summary::after {
    content: "▸";
    margin-left: auto;
    color: var(--gray);
    font-size: 0.8rem;
    transition: transform 0.2s;
}
.hilfe[open] > summary::after { transform: rotate(90deg); }

.hilfe-text {
    background: #f2f2f7;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 6px;
    color: var(--text);
    line-height: 1.5;
}

/* Wärmerer Ton für alles, was Stunden oder Geld verändert */
.hilfe-text.warnung {
    background: #fff9f0;
    border: 1px solid #ffe0b2;
}

.hilfe-text p { margin: 0 0 10px 0; }
.hilfe-text p:last-child { margin-bottom: 0; }
.hilfe-text ol, .hilfe-text ul { margin: 0 0 10px 0; padding-left: 20px; }
.hilfe-text li { margin-bottom: 8px; }
.hilfe-text li:last-child { margin-bottom: 0; }

/* Rechenbeispiel: hebt sich vom Fließtext ab, damit Zahlen auffindbar bleiben */
.hilfe-bsp {
    background: #ffffff;
    border: 1px dashed #c7c7cc;
    border-radius: 8px;
    padding: 10px 12px;
    margin: 10px 0;
    font-size: 0.82rem;
    line-height: 1.6;
}

/* =========================================
   🌴 URLAUBS-KACHELN
   =========================================
   Vier Werte (Anspruch / Übertrag / Genehmigt / Rest). Auf breiten Handys
   stehen sie nebeneinander, unter ca. 360px brechen sie auf 2×2 um – die
   Zahlen bleiben lesbar, statt sich zu quetschen.
   min-width steuert den Umbruchpunkt: 4 × 70px + Abstände. */

.urlaub-kacheln {
    display: flex;
    flex-wrap: wrap;
    text-align: center;
    row-gap: 14px;
}

.urlaub-kacheln > div {
    flex: 1 1 70px;
    min-width: 70px;
}

.urlaub-kacheln > div > span {
    font-size: 0.7rem;
    color: var(--gray);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.urlaub-kacheln > div > strong {
    font-size: 1.4rem;
}

/* =========================================
   ❓ HILFE-KARTE (Mitarbeiter-Seiten)
   =========================================
   Auf den Mitarbeiter-Seiten gibt es nichts einzustellen – die Fragen sind
   seitenweit („warum ist mein Konto 0?"). Deshalb eine einzige ruhige Karte
   ganz unten statt Hinweisen an jedem Element: Der START-Knopf bleibt frei.
   text-align links, weil .container zentriert. */

.hilfe-karte {
    background: var(--card-bg);
    border-radius: 16px;
    border-left: 5px solid var(--gray);
    padding: 18px 20px;
    margin: 30px 0 10px 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.05);
    text-align: left;
}

.hilfe-karte > h3 {
    margin: 0 0 4px 0;
    font-size: 1.05rem;
    color: var(--text);
}

.hilfe-karte > p {
    margin: 0 0 10px 0;
    font-size: 0.85rem;
    color: var(--gray);
    line-height: 1.4;
}

/* Innerhalb der Karte trennt eine feine Linie die Fragen voneinander */
.hilfe-karte .hilfe {
    margin: 0;
    border-top: 1px solid #f2f2f7;
}
.hilfe-karte .hilfe:last-child > summary { margin-bottom: 0; }
.hilfe-karte .hilfe[open] { padding-bottom: 10px; }

/* Erste-Schritte-Panel: die Schritt-Liste */
.schritt-liste {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: schritt;
}
.schritt-liste > li {
    counter-increment: schritt;
    position: relative;
    padding-left: 38px;
    margin-bottom: 18px;
    line-height: 1.5;
    font-size: 0.9rem;
}
.schritt-liste > li:last-child { margin-bottom: 0; }
.schritt-liste > li::before {
    content: counter(schritt);
    position: absolute;
    left: 0;
    top: 0;
    width: 26px;
    height: 26px;
    box-sizing: border-box;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}
.schritt-liste .schritt-titel {
    display: block;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 3px;
}
.schritt-liste .schritt-info {
    color: var(--gray);
}