/* ==========================================================================
   1. GLOBALE APP-EINSTELLUNGEN, SCHRIFTART & HINTERGRUND
   ========================================================================== */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    /* Calibri als Standard-Schriftart */
    font-family: Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif;
    /* Punkt 1: Erhöhte Basis-Schriftgröße zur Kompensation der Calibri-Optik */
    font-size: 16px; 
    
    /* Hintergrundbild gedehnt, fixiert und am Piktogramm unten rechts ausgerichtet */
    background: #e9ecef url('../background.jpg') no-repeat right bottom fixed;
    background-size: cover;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Calibri-Zwang für alle Formular- und Steuerelemente */
input, select, textarea, button {
    font-family: Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif !important;
    font-size: 14px !important;
}

/* ==========================================================================
   2. UNIFIED GRID-LAYOUTS (Punkt 6: Flexibles Spalten-Grid für alle Views)
   ========================================================================== */
.app-split-container {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important; /* Verhindert das Umbrechen untereinander */
    gap: 20px !important;
    width: 100% !important;
    padding: 10px !important;
    align-items: flex-start !important;
}

/* Linke Spalte (Hauptbereich / Tabellen) */
.app-column-main {
    flex: 2 !important;
    min-width: 600px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
}

/* Rechte Spalte (Sidebars / Legenden / Formulare) */
.app-column-sidebar {
    flex: 1 !important;
    min-width: 320px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
}

/* Standardisierte Inhalts-Karten */
.app-card {
    background: #ffffff !important;
    padding: 15px !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05) !important;
    margin-bottom: 15px !important;
    width: 100% !important;
}

/* ==========================================================================
   3. SCHRIFTGRÖSSEN-HARMONISIERUNG (Punkt 3: Begrüßung & Überschriften)
   ========================================================================== */
.welcome-text, 
.page-title {
    font-size: 1.25rem !important; /* Exakt identische Größe */
    font-weight: bold !important;
    color: #333333 !important;
    margin: 0 !important;
    line-height: 34px !important; /* Schließt bündig mit der Header-Höhe ab */
    display: inline-block !important;
}

/* ==========================================================================
   4. GLOBALE FORMULARE & DROPDOWNS (Punkt 5: Filterbreiten korrigiert)
   ========================================================================== */
/* Standard-Dropdowns erhalten das visuelle Gewicht der Dashboard-Buttons */
select, 
.header-dropdown {
    height: 28px !important;
    padding: 2px 8px !important;
    border: 1px solid #ced4da !important;
    border-radius: 4px !important;
    background-color: #f1f3f5 !important; /* Helles Grau analog Dashboard-Buttons */
    color: #212529 !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

select:hover,
.header-dropdown:hover {
    background-color: #e9ecef !important;
    border-color: #b0b5b9 !important;
}

/* 100% Breite ausschließlich in echten, vertikalen Formularen erzwingen */
.form-container .form-input,
.app-form-box .form-input,
.login-box .form-input {
    width: 100% !important;
}

/* Horizontale Label-Eingabe-Ausrichtung */
.form-group-horizontal {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
}

.form-group-horizontal .form-label {
    flex: 0 0 120px;
    margin-bottom: 0;
    white-space: nowrap;
    text-align: right;
    font-weight: bold;
    color: #495057;
}

/* ==========================================================================
   5. HEADER-ELEMENTE (Punkt 4 & 5: Ausrichtungen im Header gerettet)
   ========================================================================== */
.global-app-header {
    width: 100%;
    display: flex;
    flex-direction: column;
    background-color: #c6d9f1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 6px 15px;
}

.header-meta-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 34px;
}

/* Punkt 4: Erzwingt das saubere Nebeneinanderstehen der Controls im Header */
.header-controls-area {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
}

.header-home-control-form {
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
}

.header-home-icon-btn {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 2px 8px !important;
    border-radius: 4px;
    font-size: 14px !important;
    height: 28px !important;
    cursor: pointer;
}

/* Punkt 5: Horizontale Filterzeile im Header repariert */
.header-filter-line {
    margin-top: 6px !important; 
    padding-top: 6px !important; 
    /*border-top: 1px solid rgba(0, 0, 0, 0.08) !important;*/
    display: flex !important;
    flex-direction: row !important; /* Filter nebeneinander */
    flex-wrap: wrap !important; 
    gap: 15px !important; 
    align-items: center !important;
}

.header-filter-line .filter-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 6px !important;
}

.header-filter-line .filter-item label {
    font-size: 13px !important;
    font-weight: bold !important;
    color: #495057 !important;
    margin: 0 !important;
    white-space: nowrap !important;
}

/* Verhindert, dass die Filter-Dropdowns auf 100% Breite springen */
.header-filter-line select,
.header-filter-line input {
    width: auto !important;
}

/* Breitenklassen für Filter-Komponenten aus Access */
.filter-team-select { width: 180px !important; }
.filter-employee-select { width: 220px !important; }
.filter-dwpid-select { width: 80px !important; }

/* ==========================================================================
   6. DASHBOARD-KACHELN (Punkt 2: Farbstreifen links erzwingen, Box weiß)
   ========================================================================== */
.dashboard-box {
    margin: 10px;
    min-width: 220px;
    max-width: 280px;
    width: auto;
    min-height: 200px;
    padding: 15px;
    box-sizing: border-box;
    text-align: center;
    
    /* Punkt 2: Kachel-Hintergrund ist jetzt IMMER weiß */
    background-color: #ffffff !important;
    border-radius: 8px !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    
    /* Senkrechter Farbstreifen auf der linken Seite */
    border-left-width: 10px !important; 
    border-left-style: solid !important;
    border-left-color: #f8f9fa; /* Standardfallback */
    
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;

    &:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    }

    h3 {
        margin-top: 0;
        margin-bottom: 15px;
        font-size: 1.05rem;
        color: #333333;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        padding-bottom: 5px;
        text-align: left;
    }

    .box-content {
        display: flex;
        flex-direction: column;
        gap: 8px;

        .btn-link {
            display: block;
            width: 100%;
            padding: 8px;
            border-radius: 4px;
            border: none;
            text-decoration: none;
            color: #212529;
            background-color: #f1f3f5; /* Hellgrauer Button-Hintergrund */
            font-weight: bold;
            font-size: 13px;
            transition: all 0.2s ease;
            cursor: pointer;
            text-align: center;
        }
    }
}

/* Punkt 2: Farbstreifen-Zuweisung und Absicherung des weißen Box-Hintergrunds */
.box-1 { border-left-color: #bebebe !important; background-color: #ffffff !important; .btn-link:hover { color: #ffffff; background-color: #555555; } }
.box-2 { border-left-color: #ffd39b !important; background-color: #ffffff !important; .btn-link:hover { color: #ffffff; background-color: green; } }
.box-3 { border-left-color: #97ffff !important; background-color: #ffffff !important; .btn-link:hover { color: #333333; background-color: #cccccc; } }
.box-4 { border-left-color: #6b8e23 !important; background-color: #ffffff !important; .btn-link:hover { color: #ffffff; background-color: #4c6619; } }
.box-5 { border-left-color: #eeb4b4 !important; background-color: #ffffff !important; .btn-link:hover { color: #333333; background-color: #ddb4b4; } }
.box-6 { border-left-color: #ffff00 !important; background-color: #ffffff !important; .btn-link:hover { color: #ffffff; background-color: #b3b300; } }
.box-7 { border-left-color: #00c5cd !important; background-color: #ffffff !important; .btn-link:hover { color: #ffffff; background-color: #00868b; } }
.box-8 { border-left-color: #deb887 !important; background-color: #ffffff !important; .btn-link:hover { color: #ffffff; background-color: #8b6914; } }
.box-default { border-left-color: #ced4da !important; background-color: #ffffff !important; .btn-link:hover { color: #ffffff; background-color: #007bff; } }

/* ==========================================================================
   7. STANDARD-TABELLEN (Zentrale tabellarische Basis)
   ========================================================================== */
.app-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #ffffff;
}

.app-table th,
.app-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #eeeeee;
    font-size: 13px;
}

.app-table th {
    background-color: #e3f2fd;
    font-weight: bold;
    color: #333333;
}

.app-table tr:hover {
    background-color: #f8f9fa;
}

/* Erlaubt das vertikale Scrollen von langen Tabellen-Listen */
.app-scroll-vertical {
    max-height: 600px;
    overflow-y: auto;
}

/* Fixiert den Tabellenkopf beim vertikalen Scrollen */
.app-th-sticky {
    position: sticky;
    top: 0;
    background-color: #e3f2fd !important;
    z-index: 10;
}

/* ==========================================================================
   8. FOOTER- & WRAPPER-STEUERUNG
   ========================================================================== */
.dashboard-wrapper {
    flex: 1 0 auto;
    width: 100%;
}

.container {
    display: flex;
    flex-wrap: wrap;
    margin-top: 20px;
    padding: 10px;
    justify-content: center;
}

footer {
    flex-shrink: 0;
    width: 100%;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.05);
}

footer p {
    margin: 0;
    font-size: 13px;
    color: #555555;
}

/* ==========================================================================
   9. HILFSKLASSEN & SPEZIALKOMPONENTEN
   ========================================================================== */
.submit-btn {
    padding: 8px 16px;
    font-weight: bold;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.submit-btn:hover { background-color: #218838; }
.submit-btn-secondary { background-color: #6c757d; }
.submit-btn-secondary:hover { background-color: #5a6268; }

.app-info-highlight {
    border-left: 5px solid #17a2b8;
    background-color: #f8f9fa;
    padding: 12px;
    border-radius: 0 4px 4px 0;
    margin-bottom: 15px;
}

.app-text-muted-italic {
    color: #6c757d;
    font-style: italic;
}

.btn-sort-action {
    width: 34px !important;
    height: 28px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ==========================================================================
   Header-Ausrichtungen für Inhalts-Karten (Cards)
   ========================================================================== */
.app-card-header-inline {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 12px;
}

.app-card-title-compact {
    margin: 0;
    font-size: 13px;
    color: #333333;
    font-weight: bold;
    border-bottom: none;
    padding-bottom: 0;
}

.app-form-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

/* ==========================================================================
   GLOBALES ZENTRIERUNGS- UND BREITEN-LAYOUT (Für alle Views gültig)
   ========================================================================== */

/* 1. Legt fest, dass sich der Hauptinhalt unter dem Header optimal einfügt 
      und auf großen Monitoren nicht unkontrolliert in die Breite zieht. */
.dashboard-wrapper > div:first-child,
.container-general,
.app-content-container {
    max-width: 1350px !important; /* Hier die gewünschte maximale Wunschbreite einstellen */
    width: 100% !important;
    margin: 20px auto !important;
    box-sizing: border-box !important;
    padding: 0 15px !important;
}

/* 2. Falls spezifische Content-Wrapper verwendet werden, diese ebenfalls global zentrieren */
.azehistorie-container-wide,
.container-jahresuebersicht {
    max-width: 1350px !important;
    margin: 20px auto !important;
}