/* ======================================= */
/* === GRUNDEINSTELLUNGEN & VARIABLEN === */
/* ======================================= */
:root {
    --primary-color: #3B82F6;
    --primary-hover-color: #2563EB;
    --background-color: #F1F5F9;
    --form-background-color: #FFFFFF;
    --text-color: #1E293B;
    --label-color: #475569;
    --border-color: #CBD5E1;
    --error-color: #EF4444;
}

/* ======================================= */
/* === DARK THEME VARIABLEN === */
/* ======================================= */
body.dark-theme {
    --primary-color: #3B82F6;
    --primary-hover-color: #60A5FA;
    --background-color: #1E293B;
    --form-background-color: #334155;
    --text-color: #F1F5F9;
    --label-color: #94A3B8;
    --border-color: #475569;
    --error-color: #F87171;
}

/* ======================================= */
/* === GRUND- & TYPOGRAPHIE-STILE === */
/* ======================================= */
body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.6;
    display: block;
    padding-top: 70px;
}

*, *::before, *::after {
    box-sizing: inherit;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover-color);
}

/* ======================================= */
/* === LAYOUT & ALLGEMEINE KOMPONENTEN === */
/* ======================================= */
.main-content {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
}

/* ======================================= */
/* === FORMULAR- & LOGIN-STILE === */
/* ======================================= */
.form-container, .container {
    width: 100%;
    max-width: 400px;
    background-color: var(--form-background-color);
    padding: 2.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

h2 {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--label-color);
}

input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="datetime-local"], select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: box-shadow 0.2s, border-color 0.2s;
    background-color: var(--background-color);
    color: var(--text-color);
    box-sizing: border-box;
}

input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

button {
    display: inline-block;
    width: 100%;
    padding: 0.85rem;
    border: none;
    border-radius: 0.5rem;
    background-color: var(--primary-color);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s;
}

button:hover {
    background-color: var(--primary-hover-color);
}

.error {
    background-color: #FEE2E2;
    color: #B91C1C;
    padding: 0.75rem;
    border-radius: 0.5rem;
    text-align: center;
    margin-bottom: 1rem;
}

.container {
    text-align: center;
}

.container h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* ======================================= */
/* === ZIELVEREINBARUNG STYLES (NEU) === */
/* ======================================= */
.progress-bar-fill-green {
    background-color: #28a745; /* Success Green */
    height: 100%;
    border-radius: inherit; /* Inherit radius from parent */
    transition: width 0.5s ease-in-out;
}

.progress-bar-fill-blue {
    background-color: var(--primary-color); /* Default Blue */
    height: 100%;
    border-radius: inherit; /* Inherit radius from parent */
    transition: width 0.5s ease-in-out;
}

/* Optional: Style adjustments for the table in details view */
.zielvereinbarung-detail-table td {
    vertical-align: middle;
}
.zielvereinbarung-detail-table .progress-bar-bg {
    height: 1rem; /* Slightly smaller bar */
    border-radius: 0.5rem;
    background-color: var(--background-color);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

/* ======================================= */
/* === HEADER & NAVIGATION (FINAL) === */
/* ======================================= */
.main-header,
.admin-nav {
    background-color: var(--form-background-color);
    border-bottom: 1px solid var(--border-color);
    height: 70px;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    padding: 0 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.admin-nav {
    background-color: #1E293B; /* Dunkler Hintergrund für Admin-Nav */
}
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

/* Desktop-Navigation (User) */
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2rem; }
.main-nav a, .nav-link { text-decoration: none; color: var(--label-color); font-weight: 500; transition: color 0.2s; }
.main-nav a:hover, .main-nav .active a { color: var(--primary-color); }
.user-menu { display: flex; align-items: center; gap: 1.5rem; }
.user-menu .logo { height: 35px; width: auto; }
.user-menu .logout-link { background-color: var(--background-color); padding: 0.5rem 1rem; border-radius: 0.5rem; text-decoration: none; color: var(--label-color); font-weight: 500; transition: background-color 0.2s, color 0.2s; }
.user-menu .logout-link:hover { background-color: var(--primary-color); color: white; }
.user-info { display: inline-flex; align-items: center; gap: 8px; }
.settings-icon { font-size: 1.2em; text-decoration: none; color: inherit; }
.settings-icon i { color: var(--label-color); transition: color 0.2s; } /* Stil für FontAwesome Icon */
.settings-icon:hover i { color: var(--primary-color); }

/* Desktop-Navigation (Admin) */
.admin-nav-brand { font-size: 1.25rem; font-weight: 600; color: #F1F5F9; }
.admin-nav-links { list-style: none; margin: 0; padding: 0; display: flex; gap: 2rem; }
.admin-nav-links a { color: #CBD5E1; text-decoration: none; font-weight: 500; transition: color 0.2s; }
.admin-nav-links a:hover { color: #FFFFFF; }
.admin-nav-usermenu { display: flex; align-items: center; gap: 1.5rem; color: #CBD5E1; }
.admin-nav-usermenu a { color: #CBD5E1; text-decoration: none; font-weight: 500; transition: color 0.2s; }
.admin-nav-usermenu a:hover { color: #FFFFFF; }

/* Hamburger-Button */
.hamburger-button {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-around;
    width: 2rem;
    height: 2rem;
    padding: 0;
    z-index: 1001;
}
.hamburger-line { width: 2rem; height: 0.25rem; background-color: var(--text-color); border-radius: 10px; transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out; }
.admin-nav .hamburger-line { background-color: #FFFFFF; } /* Weiße Linien in der Admin-Nav */

/* Mobile Navigation (User & Admin) */
.main-nav-mobile,
.admin-nav-mobile {
    display: none;
    background-color: var(--form-background-color);
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 1rem 0;
    z-index: 999;
}
.admin-nav-mobile { background-color: #334155; } /* Dunklerer Hintergrund für Admin Mobile Nav */
.main-nav-mobile ul,
.admin-nav-mobile ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.main-nav-mobile li,
.admin-nav-mobile li { text-align: center; }
.main-nav-mobile a,
.admin-nav-mobile a { display: block; padding: 0.8rem 1rem; color: var(--label-color); text-decoration: none; font-weight: 500; transition: color 0.2s, background-color 0.2s; }
.admin-nav-mobile a { color: #CBD5E1; }
.main-nav-mobile a:hover { color: var(--primary-color); background-color: var(--background-color); }
.admin-nav-mobile a:hover { color: #FFFFFF; background-color: #475569; }
.main-nav-mobile li.active a { color: var(--primary-color); font-weight: 600; }
.nav-separator-mobile { height: 1px; background-color: var(--border-color); width: 90%; margin: 0.5rem auto; }
.admin-nav-mobile .nav-separator-mobile { background-color: #475569; }

/* Responsive Steuerung & Animationen */
@media (max-width: 992px) {
    /* Desktop-Navs ausblenden */
    .main-nav, .user-menu,
    .admin-nav-links, .admin-nav-usermenu, .admin-nav-brand {
        display: none;
    }
    .hamburger-button { display: flex; } /* Hamburger einblenden */

    /* Mobile Navs bei Klick einblenden */
    .main-header.nav-active ~ .main-nav-mobile,
    .admin-nav.nav-active ~ .admin-nav-mobile {
        display: block;
}
}
.hamburger-button.is-active .hamburger-line:nth-child(1) { transform: translateY(10px) rotate(45deg); }
.hamburger-button.is-active .hamburger-line:nth-child(2) { opacity: 0; }
.hamburger-button.is-active .hamburger-line:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

body.login-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding-top: 0;
}

.content-area {
    padding: 2rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.dashboard-tile {
    background-color: var(--form-background-color);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.dashboard-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    color: var(--primary-color);
}

.tile-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.tile-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.tile-description {
    font-size: 0.9rem;
    color: var(--label-color);
    line-height: 1.5;
}

/* ======================================= */
/* === AKTIONSLISTE FÜR ADMINS       === */
/* ======================================= */

.admin-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; 
    gap: 1rem;
    margin-bottom: 2rem;
}

.admin-actions-bar .actions-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.admin-actions-bar .actions-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* ======================================= */
/* === TABELLEN & LISTEN === */
/* ======================================= */
.user-table-wrapper {
    overflow-x: auto;
}

.user-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--form-background-color);
    color: var(--text-color);
    box-shadow: 0 0 0 1px var(--border-color);
    border-radius: 0.75rem;
    overflow: hidden;
}

.user-table th,
.user-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.user-table th {
    background-color: #dc2626;
    color: white;
    font-weight: 600;
}

body.dark-theme .user-table th {
    background-color: #b91c1c;
}

.user-table th a {
    color: white;
    text-decoration: none;
    display: inline-block;
    width: 100%;
}

.user-table th a:hover {
    text-decoration: underline;
}

.user-table tbody tr:last-child td {
    border-bottom: none;
}

.user-table .actions a {
    margin-right: 0.75rem;
    color: var(--label-color);
    text-decoration: none;
    font-size: 1.1rem;
}

.user-table .actions a:hover {
    color: var(--primary-color);
}

.success-message {
    background-color: #DCFCE7;
    color: #166534;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.info-message {
    background-color: #DBEAFE;
    color: #1E40AF;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* ======================================= */
/* === BUTTONS & FORMULAR-ELEMENTE === */
/* ======================================= */
.button-primary {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 0.5rem;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s;
}

.button-primary:hover {
    background-color: var(--primary-hover-color);
}

.button-secondary {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: transparent;
    color: var(--label-color);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.button-secondary:hover {
    background-color: var(--background-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
    background-color: var(--form-background-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
    font-size: 1rem;
    color: var(--text-color);
    font-family: inherit;
    line-height: 1.5;
    width: 100%;
    box-sizing: border-box;
    cursor: text;
}

input[type="date"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* ======================================= */
/* === DASHBOARD & WIDGET STYLES       === */
/* ======================================= */

.dashboard-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

.dashboard-top-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.dashboard-box {
    background-color: var(--form-background-color);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 8px;
}

.dashboard-box h3 {
    text-align: center;
    margin-bottom: 1rem;
    margin-top: 0;
}

.main-content-area-box {
    background-color: var(--form-background-color);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 8px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
    text-align: center;
}

.stat-item {
    padding: 0.5rem;
    background-color: rgba(0,0,0,0.05);
    border-radius: 8px;
    position: relative;
}

body.dark-theme .stat-item {
    background-color: rgba(255,255,255,0.1);
}

.stat-item .stat-value {
    font-size: 1.7rem;
    font-weight: 600;
    line-height: 1.2;
    word-wrap: break-word;
}

.stat-item .stat-label {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0;
    text-transform: uppercase;
}

body.dark-theme .stat-item .stat-label {
    color: #adb5bd;
}

.positive-delta { color: #28a745; }
.negative-delta { color: #dc3545; }

.tooltip {
    position: absolute;
    top: 5px;
    right: 8px;
    cursor: help;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8em;
    pointer-events: none;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* KORRIGIERTES WIDGET LAYOUT */
.dashboard-widget-area {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-top: 25px;
}

.dashboard-widget-row {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
}

.dashboard-widget-row .dashboard-box {
    flex: 1 1 300px;
    min-width: 300px;
}

.widget-full-width {
    flex-basis: 100%;
}

.widget-stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    justify-content: center;
}
.widget-stats-item {
    background-color: var(--background-color);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
    flex-basis: 130px;
}
.widget-stats-item .stat-count {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
}
.widget-stats-item .stat-name {
    font-size: 0.8rem;
    color: var(--label-color);
    margin-top: 0.25rem;
}

.widget-ranking-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}
.widget-ranking-table td {
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9em;
}
.widget-ranking-table tr:last-child td {
    border-bottom: none;
}
.widget-ranking-table .ranking-position {
    font-weight: 600;
    color: var(--label-color);
    width: 30px;
}
.widget-ranking-table .ranking-name {
    text-align: left;
    font-weight: 500;
}
.widget-ranking-table .ranking-value {
    text-align: right;
    font-weight: 600;
    font-size: 1.1em;
}

.widget-placeholder {
    text-align: center;
    color: var(--label-color);
    margin-top: 1.5rem;
}

a.button-primary:hover {
    color: white !important;
}

/* ======================================= */
/* === VERTRAGSERFASSUNG === */
/* ======================================= */
.form-section {
    background-color: var(--form-background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
}
.form-section h2 {
    text-align: left;
    font-size: 1.5rem;
    margin-top: 0;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}
.category-grid label {
    display: block;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    text-align: center;
}
.category-grid input[type="radio"] {
    display: none;
}
.category-grid input[type="radio"]:checked + label {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}
#einstufung-container, #unterkategorien-container, .option-wrapper, #Zusatzfelder-container {
    display: none;
}
.einstufung-option small {
    color: var(--label-color);
    font-size: 0.9em;
}
.category-grid input[type="radio"]:checked + label small {
    color: white;
}
.options-grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}
.options-grid-compact label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    font-weight: normal;
}
.Zusatzfelder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.erfassung-layout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 0;
}
@media (min-width: 992px) {
    .erfassung-layout-grid {
        grid-template-columns: repeat(2, 1fr);
        align-items: start;
    }
}
.erfassung-layout-grid .form-section {
    margin-bottom: 0;
}

/* ======================================= */
/* === SEITEN-SPEZIFISCHE ANPASSUNGEN === */
/* ======================================= */
.vertrag-erfassen-container {
    max-width: 1200px !important;
    margin: 0 auto;
    text-align: left;
    padding: 2.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-radius: 0.75rem;
    background-color: var(--form-background-color);
}

.vertrag-erfassen-container h1,
.vertrag-erfassen-container p {
    text-align: left;
}

.vertrag-erfassen-container .form-section {
    margin-bottom: 1.5rem;
}

.vertrag-erfassen-container form > .form-section:last-of-type {
    margin-bottom: 2rem;
}

.vertrag-erfassen-container .button-primary,
.vertrag-erfassen-container .button-secondary {
    margin-right: 1rem;
    display: inline-block;
    width: auto;
}

.vertrag-erfassen-container button[type="submit"] {
    margin-left: 0;
}

/* Horizontales Schnellmenü */
.schnellmenue-bar {
    background-color: var(--form-background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    margin-bottom: 25px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.schnellmenue-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    text-decoration: none;
    color: var(--label-color);
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}

.schnellmenue-link:hover {
    background-color: var(--primary-color);
    color: white;
}

.schnellmenue-link i {
    font-size: 1em;
}

/* Unternehmensziel-Box */
.unternehmensziel-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.unternehmensziel-box .ziel-werte {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    color: var(--label-color);
    margin-bottom: 0.75rem;
}

.unternehmensziel-box .progress-bar-container {
    position: relative; /* WICHTIG: Für den Bonus-Marker */
    width: 100%;
    height: 1.25rem;
    background-color: var(--background-color);
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
}

.unternehmensziel-box .progress-bar-fill {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 1rem;
    transition: width 0.5s ease-in-out;
}

.unternehmensziel-box .ziel-delta {
    text-align: center;
    font-weight: 600;
    font-size: 1.1em;
}

/* NEU: Klasse für die orange Delta-Farbe */
.warning-delta {
    color: #F59E0B;
}

/* Der Marker für die Bonusschwelle */
.bonus-marker {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 3px;
    background-color: #F59E0B; /* Ein auffälliges Gelb/Orange */
    border-radius: 3px;
    cursor: help;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
    z-index: 2; /* Stellt sicher, dass er über dem Füllbalken liegt */
}

.bonus-marker::after { /* Kleiner Pfeil nach unten als visueller Hinweis */
    content: '';
    position: absolute;
    left: 50%;
    bottom: -8px;
    transform: translateX(-50%);
    width: 0; 
    height: 0; 
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #F59E0B;
}

/* ======================================= */
/* === WIDGET AUSWAHLSEITE === */
/* ======================================= */
.widget-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}
.widget-option label {
    display: block;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    height: 100%;
}
.widget-option input[type="checkbox"] {
    display: none;
}
.widget-option input[type="checkbox"]:checked + label {
    border-color: var(--primary-color);
    background-color: #3b82f61a; /* Leichter blauer Hintergrund */
}
.widget-option h3 {
    margin-top: 0;
    color: var(--text-color);
}
.widget-option p {
    color: var(--label-color);
    font-size: 0.9em;
    margin-bottom: 0;
}

/* ======================================= */
/* === WIDGET AUSWAHLLISTE === */
/* ======================================= */
.widget-selection-list { 
    list-style: none; 
    padding: 0; 
    margin-top: 2rem;
}
.widget-selection-list li { 
    background-color: var(--background-color); 
    padding: 1rem 1.5rem; 
    border-radius: 0.5rem; 
    margin-bottom: 1rem; 
    display: flex; 
    align-items: center; 
    gap: 1rem; 
    border: 1px solid var(--border-color);
}
.widget-selection-list label {
    font-weight: 500;
    margin-bottom: 0;
}
.widget-selection-list input[type="checkbox"] { 
    transform: scale(1.5); 
    margin-right: 0.5rem; 
}

.summary-widget-container {
        /* max-height und overflow entfernt */
        padding-right: 10px; 
}
.summary-widget-table {
        width: 100%;
        border-collapse: collapse;
}
.summary-widget-table td {
        padding: 0.5rem 0.25rem;
        border-bottom: 1px solid var(--border-color);
}
.summary-widget-table tr:last-child td {
        border-bottom: none;
}
.zeile-titel td {
        color: var(--text-color);
        font-weight: bold;
        padding-top: 1rem;
}
.zeile-leerzeile td {
        padding: 0.25rem;
        border-bottom: none;
}
.zeile-summe {
        font-weight: bold;
        border-top: 2px solid var(--text-color);
}
.wert-spalte {
        text-align: right;
        font-weight: bold;
        width: 60px;
}
.performance-table {
        width: 100%; 
        border-collapse: collapse; 
}
.performance-table th, .performance-table td {
        padding: 0.6rem; 
        text-align: right; 
        border-bottom: 1px solid var(--border-color); 
}
.performance-table th:first-child, .performance-table td:first-child { 
        text-align: left; 
}
.performance-table th { 
    font-weight: 600; 
    font-size: 0.8em; 
    color: var(--label-color); 
}
.performance-table .progress-bar-cell { 
        width: 120px; 
        vertical-align: middle; 
}
.performance-table .progress-bar-bg { 
        background-color: var(--background-color); 
        border-radius: 5px; 
        height: 10px; 
        overflow: hidden; 
}
.performance-table .progress-bar-fill { 
        background-color: var(--primary-color); 
        height: 100%; 
        border-radius: 5px; 
}

/* ======================================= */
/* === INFOBOX STYLES (USER DASHBOARD) === */
/* ======================================= */
.infobox-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 25px;
    margin-bottom: 25px;
}

.infobox-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background-color: var(--form-background-color);
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--primary-color);
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    /* NEU: Inhalt zentrieren, um die Darstellung auszubalancieren */
    justify-content: center;
}

/* Spezieller Stil für Geburtstage */
.infobox-type-geburtstag {
    border-left-color: #F59E0B;
}

.infobox-type-system_info {
    border-left-color: var(--error-color);
}

.infobox-type-system_info .infobox-image i {
    color: var(--error-color);
}

.infobox-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    /* NEU: Zentriert das Icon perfekt im Container */
    display: flex;
    align-items: center;
    justify-content: center;
}

.infobox-image img {
    width: 100%;
    height: 100%;
    /* KORREKTUR: 'contain' stellt sicher, dass das ganze Bild sichtbar ist */
    object-fit: contain;
    border-radius: 0.5rem;
}

.infobox-content {
    flex-grow: 1;
    /* NEU: Maximale Breite, damit der Text nicht zu sehr in die Breite geht */
    max-width: 600px;
}

.infobox-content h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.infobox-content p {
    margin: 0;
    color: var(--label-color);
    line-height: 1.6;
}

.infobox-content p strong {
    color: var(--text-color);
}

@media (max-width: 640px) {
    .infobox-item {
        flex-direction: column;
        text-align: center;
    }
}

.filter-tabs { 
    display: flex; 
    gap: 0.5rem;
    border-radius: 0.5rem; 
    padding: 0.25rem; 
}
.tab-link { 
    padding: 0.5rem 1rem; 
    text-decoration: none; 
    color: var(--label-color); 
    border-radius: 0.375rem; 
    font-weight: 500; 
    transition: background-color 0.2s, color 0.2s; 
    border: 1px solid transparent; 
}
.tab-link:hover { 
    color: var(--primary-color); 
}
.tab-link.active { 
    background-color: var(--form-background-color); 
    color: var(--primary-color); 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
    border-color: var(--border-color); 
}

.status-quick-select {
    padding: 0.3rem 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    background-color: var(--background-color);
    color: var(--text-color);
}

.task-layout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
@media (min-width: 992px) {
    .task-layout-grid {
        grid-template-columns: 2fr 1fr;
    }
}
.task-sidebar .form-group { margin-bottom: 1rem; }
.task-sidebar button { margin-top: 1rem; }
.static-details .detail-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.static-details .detail-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.static-details .detail-item strong {
    display: block;
    color: var(--label-color);
    font-size: 0.9em;
    margin-bottom: 0.25rem;
}
.static-details .detail-item p { 
    margin: 0; 
}
.comment-section { 
    display: flex; 
    flex-direction: column; 
    gap: 1rem; 
}
.comment-item { 
    background-color: var(--background-color); 
    padding: 1rem; 
    border-radius: 0.5rem; 
    border: 1px solid var(--border-color); 
}
.comment-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 0.5rem; 
    padding-bottom: 0.5rem; 
    border-bottom: 1px solid var(--border-color); 
}
.comment-date { 
    font-size: 0.8em; 
    color: var(--label-color); 
}
.comment-body { 
    white-space: pre-wrap; 
    line-height: 1.6; 
}
textarea { 
    width: 100%; 
    padding: 0.75rem; 
    border: 1px solid var(--border-color); 
    border-radius: 0.5rem; 
    font-size: 1rem; 
    background-color: var(--background-color); 
    color: var(--text-color); 
}

.quick-update-form {
    display: flex;
    align-items: center;
}
.quick-update-form select {
    flex-grow: 1;
}

/* KORREKTUR für das Formular "Bereich wechseln" */
.area-switcher-form button {
    width: auto;
    display: block;
    margin: 0.75rem auto 0;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* NEU: Styling für das Font Awesome Icon in der Infobox */
.infobox-image i {
    font-size: 48px;
    color: var(--primary-color);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kontingent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}
.kontingent-item {
    background-color: var(--background-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    border: 1px solid var(--border-color);
}
.kontingent-title {
    font-size: 0.9em;
    font-weight: 500;
    color: var(--label-color);
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kontingent-value {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--primary-color);
    line-height: 1.2;
}
.kontingent-label {
    font-size: 0.8em;
    color: var(--label-color);
}

/* ======================================= */
/* === MODAL STYLES === */
/* ======================================= */
.modal-overlay {
    display: none; /* Standardmäßig versteckt */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--form-background-color);
    color: var(--text-color);
    margin: auto;
    padding: 2rem;
    border-radius: 0.75rem;
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-close {
    color: var(--label-color);
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
}

.modal-close:hover,
.modal-close:focus {
    color: var(--text-color);
    text-decoration: none;
    cursor: pointer;
}

.modal-content h2 {
    text-align: left;
    margin-top: 0;
}

.modal-hr {
    border: none;
    height: 1px;
    background-color: var(--border-color);
    margin: 1.5rem 0;
}

.modal-content h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.disclaimer-text {
    font-size: 0.9em;
    color: var(--label-color);
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 0.5rem;
    background-color: var(--background-color);
}

.disclaimer-text p {
    margin-bottom: 1em;
}

.disclaimer-text p:last-child {
    margin-bottom: 0;
}

/* ======================================= */
/* === DSGVO MODAL STYLES (NEU) === */
/* ======================================= */
#dsgvo-modal .modal-content {
    max-width: 700px;
}

#dsgvo-modal h2 {
    text-align: center;
}

.consent-area {
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.consent-item {
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
}

.consent-item h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
}

.consent-item p {
    margin: 0;
    font-size: 0.9em;
    color: var(--label-color);
}

#dsgvo-consent-button {
    width: auto;
    padding: 0.85rem 2rem;
    display: block;
    margin: 0 auto;
}

/* ======================================= */
/* === WIDGET FILTER FORM (NEU) === */
/* ======================================= */
.widget-filter-form {
    margin-bottom: 1.5rem;
}

.filter-controls {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.filter-controls select {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    background-color: var(--background-color);
    color: var(--text-color);
    font-weight: 500;
}

#bestaetigung-zuweisung-container .checkbox-list-container {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
    background-color: var(--background-color);
}
.checkbox-list-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 0.375rem;
}
.checkbox-list-item:hover {
    background-color: var(--form-background-color);
}
.checkbox-list-item input[type="checkbox"] {
    margin-right: 0.75rem;
    transform: scale(1.2);
    cursor: pointer;
}
.checkbox-list-item label {
    margin-bottom: 0;
    cursor: pointer;
    width: 100%;
}#bestaetigung-zuweisung-container .checkbox-list-container {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
    background-color: var(--background-color);
    /* --- ANPASSUNG FÜR KOMPAKTE ANSICHT --- */
    column-count: 2; /* Liste in zwei Spalten aufteilen */
    column-gap: 1rem; /* Abstand zwischen den Spalten */
    /* --- ENDE ANPASSUNG --- */
}
.checkbox-list-item {
    display: flex;
    align-items: center;
    padding: 0.25rem 0.5rem; /* Vertikales Padding reduziert für Kompaktheit */
    border-radius: 0.375rem;
    break-inside: avoid; /* Verhindert, dass ein einzelner Name umbricht */
}
.checkbox-list-item:hover {
    background-color: var(--form-background-color);
}
.checkbox-list-item input[type="checkbox"] {
    margin-right: 0.75rem;
    transform: scale(1.2);
    cursor: pointer;
}
.checkbox-list-item label {
    margin-bottom: 0;
    cursor: pointer;
    width: 100%;
}
/* ======================================= */
/* === TREND ICONS (DASHBOARD) === */
/* ======================================= */
.trend-icon {
    font-size: 0.8em;
    margin-left: 5px;
}
.trend-up {
    color: #22c55e; /* Grün */
}
.trend-down {
    color: #ef4444; /* Rot */
}
.trend-equal {
    color: #3b82f6; /* Blau */
}