/* style.css – Haupt-Stylesheet für das TraFo Logbuch */
/* Sidebar-Layout, Farben und Komponenten */

/* ===== RESET & GRUNDSTILE ===== */
* {
    box-sizing: border-box; /* Padding und Border in Breite einrechnen */
    margin: 0;
    padding: 0;
}

/* Grundschrift und Hintergrund */
body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f0f4f8; /* Heller grau-blauer Hintergrund */
    color: #333;
    font-size: 15px;
    line-height: 1.5;
}

/* ===== SIDEBAR ===== */
/* Feste Sidebar links */
.sidebar {
    position: fixed;       /* Bleibt beim Scrollen stehen */
    top: 0;
    left: 0;
    width: 220px;          /* Sidebar-Breite */
    height: 100vh;         /* Volle Fensterhöhe */
    background: #1a3a5c;   /* Dunkelblau */
    color: #fff;
    overflow-y: auto;      /* Scrollen wenn Inhalt zu lang */
    z-index: 1000;         /* Über anderem Inhalt */
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease; /* Animation für Mobile */
}

/* Sidebar-Logo/Kopfbereich */
.sidebar-logo {
    padding: 20px 16px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.15); /* Trennlinie */
    text-align: center;
}

/* Fahrzeug-Emoji im Logo */
.sidebar-logo-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 6px;
}

/* App-Name im Logo */
.sidebar-logo-name {
    font-size: 1rem;
    font-weight: bold;
    color: #e8a020; /* Orange Akzent */
    display: block;
    line-height: 1.3;
}

/* Fahrzeugname klein darunter */
.sidebar-fahrzeug {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    display: block;
    margin-top: 3px;
}

/* Navigationsbereich */
.sidebar-nav {
    flex: 1;   /* Nimmt verfügbaren Platz ein */
    padding: 10px 0;
}

/* Gruppen-Überschriften in der Sidebar */
.nav-gruppe {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.4);
    padding: 14px 16px 4px;
    font-weight: bold;
}

/* Navigations-Links */
.nav-link {
    display: block;
    padding: 9px 16px;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.9rem;
    border-left: 3px solid transparent; /* Wird bei aktiver Seite sichtbar */
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

/* Hover-Effekt */
.nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-left-color: rgba(232,160,32,0.5); /* Orange Akzent beim Hover */
}

/* Aktiver Link (aktuelle Seite) */
.nav-active {
    background: rgba(232,160,32,0.2);     /* Orange-transparenter Hintergrund */
    color: #e8a020 !important;             /* Orange Schrift */
    border-left-color: #e8a020 !important; /* Orange Linie links */
    font-weight: bold;
}

/* Logout-Link in Rot */
.nav-link-rot {
    color: #ff7b7b !important; /* Rötliche Farbe */
}
.nav-link-rot:hover {
    background: rgba(255,80,80,0.15);
    color: #ff4444 !important;
}

/* ===== HAMBURGER-MENÜ (Mobile) ===== */
/* Hamburger-Button */
.hamburger {
    display: none;         /* Auf Desktop versteckt */
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1100;         /* Über der Sidebar */
    background: #1a3a5c;
    border: none;
    color: #fff;
    font-size: 22px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Overlay-Hintergrund (Mobile) */
.sidebar-overlay {
    display: none;         /* Standardmäßig unsichtbar */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5); /* Halbtransparent schwarz */
    z-index: 999;          /* Zwischen Inhalt und Sidebar */
}

/* ===== HAUPT-INHALTSBEREICH ===== */
.inhalt {
    margin-left: 220px;   /* Platz für die Sidebar */
    padding: 24px;
    min-height: 100vh;
}

/* ===== SEITENHEADER ===== */
.seiten-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

/* Seitentitel */
.seiten-titel {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1a3a5c;
}

/* Untertitel */
.seiten-untertitel {
    font-size: 0.9rem;
    color: #666;
    margin-top: 2px;
}

/* ===== KARTEN ===== */
/* Standard-Karte */
.karte {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    border-left: 4px solid #1a3a5c; /* Dunkelblauer linker Rand */
}

/* Karten-Kopfzeile */
.karte-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

/* Karten-Titel */
.karte-titel {
    font-size: 1.1rem;
    font-weight: bold;
    color: #1a3a5c;
}

/* Karten-Datum */
.karte-datum {
    font-size: 0.85rem;
    color: #888;
}

/* Karten-Meta-Infos (Zeile mit Icons) */
.karte-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 0.88rem;
    color: #555;
    margin-bottom: 10px;
}

/* Einzelne Meta-Info */
.karte-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Karten-Aktionen (Button-Bereich) */
.karte-aktionen {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

/* ===== BUTTONS ===== */
/* Standard-Button */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: bold;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
    line-height: 1.4;
}
.btn:hover {
    transform: translateY(-1px); /* Leichter Lift-Effekt */
}
.btn:active {
    transform: translateY(0);
}

/* Primär-Button (Orange) */
.btn-primary {
    background: #e8a020;
    color: #fff;
}
.btn-primary:hover {
    background: #c8881a;
}

/* Sekundär-Button (Blau) */
.btn-sekundaer {
    background: #1a3a5c;
    color: #fff;
}
.btn-sekundaer:hover {
    background: #142d47;
}

/* Bearbeiten-Button (Blaugrau) */
.btn-bearbeiten {
    background: #4a7a9b;
    color: #fff;
}
.btn-bearbeiten:hover {
    background: #3a6a8b;
}

/* Löschen-Button (Rot) */
.btn-loeschen {
    background: #e05050;
    color: #fff;
}
.btn-loeschen:hover {
    background: #c04040;
}

/* Erfolgs-Button (Grün) */
.btn-erfolg {
    background: #3a9a5c;
    color: #fff;
}
.btn-erfolg:hover {
    background: #2a8a4c;
}

/* Kleiner Button */
.btn-klein {
    padding: 5px 10px;
    font-size: 0.8rem;
}

/* ===== FORMULARE ===== */
/* Formular-Sektion (Karte für Formular-Gruppen) */
.form-section {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

/* Formular-Sektions-Titel */
.form-section h3 {
    color: #1a3a5c;
    font-size: 1rem;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e8a020; /* Orange Unterstrich */
}

/* Zweispaltige Formular-Zeile */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Zwei gleiche Spalten */
    gap: 14px;
    margin-bottom: 14px;
}

/* Dreispaltige Formular-Zeile */
.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr; /* Drei gleiche Spalten */
    gap: 14px;
    margin-bottom: 14px;
}

/* Formular-Gruppe (Label + Input) */
.form-gruppe {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Labels */
label {
    font-size: 0.85rem;
    font-weight: bold;
    color: #444;
}

/* Eingabefelder */
input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="email"],
input[type="tel"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 9px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s;
    background: #fafafa;
}

/* Fokus-Stil für Felder */
input:focus,
select:focus,
textarea:focus {
    border-color: #e8a020; /* Orange Rand bei Fokus */
    outline: none;
    background: #fff;
}

/* Readonly-Felder */
input[readonly] {
    background: #eee;
    color: #666;
}

/* Textarea höher */
textarea {
    min-height: 80px;
    resize: vertical; /* Nur vertikal vergrößerbar */
}

/* Checkbox-Gruppe */
.checkbox-gruppe {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 24px; /* Ausrichtung mit anderen Feldern */
}
.checkbox-gruppe input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #e8a020; /* Orange Checkbox */
}
.checkbox-gruppe label {
    font-size: 0.9rem;
    cursor: pointer;
}

/* Leerer Platzhalter in Grid */
.leer {
    /* Leeres Grid-Element zur Ausrichtung */
}

/* ===== STATISTIK-KACHELN ===== */
/* Grid für Kacheln */
.kachel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

/* Einzelne Kachel */
.kachel {
    background: #fff;
    border-radius: 10px;
    padding: 18px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    border-top: 4px solid #e8a020; /* Orange oberer Rand */
}

/* Kachel-Zahl */
.kachel-zahl {
    font-size: 2rem;
    font-weight: bold;
    color: #1a3a5c;
    display: block;
}

/* Kachel-Label */
.kachel-label {
    font-size: 0.8rem;
    color: #777;
    margin-top: 4px;
}

/* ===== HINWEIS-BOXEN ===== */
/* Allgemeine Hinweis-Box */
.hinweis {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

/* Warnung (Orange) */
.hinweis-warnung {
    background: #fff3cd;
    border-left: 4px solid #e8a020;
    color: #7a5c00;
}

/* Fehler/Alarm (Rot) */
.hinweis-fehler {
    background: #fde;
    border-left: 4px solid #e05050;
    color: #8b0000;
}

/* Erfolg (Grün) */
.hinweis-erfolg {
    background: #d4edda;
    border-left: 4px solid #3a9a5c;
    color: #155724;
}

/* Info (Blau) */
.hinweis-info {
    background: #d1ecf1;
    border-left: 4px solid #1a3a5c;
    color: #0c5460;
}

/* ===== BADGES ===== */
/* Allgemeines Badge */
.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Badge-Varianten */
.badge-blau    { background: #d1ecf1; color: #0c5460; }
.badge-gruen   { background: #d4edda; color: #155724; }
.badge-orange  { background: #fff3cd; color: #856404; }
.badge-rot     { background: #fde;    color: #8b0000; }
.badge-grau    { background: #e9ecef; color: #444;    }
.badge-dunkel  { background: #1a3a5c; color: #fff;    }

/* ===== SUCHFELD ===== */
.suchfeld-wrapper {
    margin-bottom: 16px;
}
.suchfeld-wrapper input {
    max-width: 400px;
    border-radius: 20px; /* Abgerundetes Suchfeld */
    padding: 8px 16px;
}

/* ===== TABELLEN ===== */
.tabelle {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.tabelle th {
    background: #1a3a5c;
    color: #fff;
    padding: 10px 12px;
    text-align: left;
    font-size: 0.85rem;
}
.tabelle td {
    padding: 9px 12px;
    border-bottom: 1px solid #eee;
}
.tabelle tr:hover td {
    background: #f8f9fa;
}
.tabelle tr:last-child td {
    border-bottom: none;
}

/* ===== FORTSCHRITTSBALKEN ===== */
.progress-wrapper {
    background: #eee;
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
    margin: 6px 0;
}
.progress-bar {
    height: 100%;
    background: #e8a020; /* Orange Balken */
    border-radius: 10px;
    transition: width 0.4s ease;
}
.progress-bar.gruen {
    background: #3a9a5c; /* Grün wenn komplett */
}

/* ===== FOTO-GALERIE ===== */
.foto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 16px;
}
.foto-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    cursor: pointer;
}
.foto-item img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
    transition: transform 0.2s;
}
.foto-item:hover img {
    transform: scale(1.03);
}
.foto-beschriftung {
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 0.75rem;
    padding: 4px 8px;
    text-align: center;
}
.foto-loeschen {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(200,0,0,0.8);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ===== LIGHTBOX ===== */
.lightbox {
    display: none;           /* Standardmäßig versteckt */
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}
.lightbox.aktiv {
    display: flex;
}
.lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
}
.lightbox-schliessen {
    position: absolute;
    top: 16px; right: 20px;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
}
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: none;
    font-size: 28px;
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 6px;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.35); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-bildtext {
    position: absolute;
    bottom: 20px;
    color: #fff;
    font-size: 0.95rem;
    text-align: center;
    padding: 0 40px;
}

/* ===== STERNE-BEWERTUNG ===== */
.sterne {
    color: #e8a020;
    font-size: 1.1rem;
    letter-spacing: 2px;
}
.sterne-leer {
    color: #ddd;
}

/* ===== BESTÄTIGUNGS-DIALOG ===== */
.bestaetigung-box {
    max-width: 480px;
    margin: 60px auto;
}

/* ===== DRUCKANSICHT ===== */
@media print {
    /* Sidebar und Buttons beim Drucken ausblenden */
    .sidebar,
    .hamburger,
    .sidebar-overlay,
    .btn,
    .karte-aktionen,
    .seiten-header .btn {
        display: none !important;
    }
    /* Inhalt nimmt volle Breite ein */
    .inhalt {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    /* Seitenumbrüche verwalten */
    .karte {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    body {
        background: #fff;
    }
}

/* ===== RESPONSIVE (MOBILE) ===== */
@media (max-width: 768px) {
    /* Hamburger-Button anzeigen */
    .hamburger {
        display: block;
    }

    /* Sidebar auf Mobile nach links verstecken */
    .sidebar {
        transform: translateX(-100%); /* Außerhalb des Sichtfelds */
    }

    /* Geöffnete Sidebar */
    .sidebar.geoeffnet {
        transform: translateX(0); /* Einfahren */
    }

    /* Overlay anzeigen wenn Sidebar offen */
    .sidebar-overlay.aktiv {
        display: block;
    }

    /* Inhalt nimmt volle Breite */
    .inhalt {
        margin-left: 0;
        padding: 16px;
        padding-top: 56px; /* Platz für Hamburger-Button */
    }

    /* Formular-Zeilen auf Mobile einspaltig */
    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }

    /* Kachel-Grid anpassen */
    .kachel-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
