/* Allgemeine Seitenstruktur und Grid-Layouts */

/* ================================================================= */
/* Bootstrap-Overrides und globale Basis-Stile                        */
/* ================================================================= */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: #f4f7f6;
    color: #333;
    font-size: 0.95rem;
    line-height: 1.5;
}

a { text-decoration: none; }
a:hover { text-decoration: none; }

/* Zwingt Plotly, nicht breiter als der Container zu sein */
.js-plotly-plot, .plot-container {
    width: 100% !important;
}

/* ================================================================= */
/* Navigation                                                          */
/* ================================================================= */

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1em 2em;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

@media (min-width: 768px) {
    nav {
        position: sticky;
        top: 0;
        z-index: 2000;
    }
}

nav a { color: #007bff; text-decoration: none; font-weight: 500; }
nav a.brand { font-size: 1.5em; font-weight: bold; }
nav a.brand-version { font-size: 0.7em; font-weight: normal; color: #999; margin-left: 0.4em; vertical-align: super; text-decoration: none; }
nav a.brand-version:hover { color: #555; text-decoration: underline; }

.nav-left, .nav-right { display: flex; align-items: center; }

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0 0 0 2em;
    display: flex;
}
.nav-menu li { margin-left: 1.5em; position: relative; }
.user-info { color: #666; margin-right: 1.5em; }

ul.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    list-style: none;
    padding: 0.5em 0;
    border: none;
    border-radius: 5px;
    min-width: 160px;
    z-index: 2100;
}
.dropdown-menu li { margin: 0; }
.dropdown-menu li a {
    display: block;
    padding: 0.75em 1.5em;
    color: #333;
    white-space: nowrap;
}
.dropdown-menu li a:hover { background-color: #f4f7f6; }
.dropdown:hover .dropdown-menu { display: block; }

/* ================================================================= */
/* Container und Seiten-Layout                                         */
/* ================================================================= */

.container { max-width: 1300px !important; margin: 2em auto; padding: 0 2em !important; width: 100%; }

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1em;
    margin-bottom: 2em;
    border-bottom: 1px solid #ddd;
    padding-bottom: 1em;
}

.header h1 {
    margin-bottom: 0.2em;
}

.header .actions {
    display: flex;
    align-items: center;
    gap: 0.5em;
    flex-wrap: wrap;
}

/* Dashboard-Grid (2-spaltig mit Media-Query) */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 992px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .card.full-width {
        grid-column: 1 / -1;
    }
}

/* Dashboard-Grid-Container (1fr 2fr Aufteilung) */
.dashboard-grid-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2em;
    align-items: start;
}

.dashboard-column-left,
.dashboard-column-right {
    display: flex;
    flex-direction: column;
    gap: 2em;
}

@media (max-width: 992px) {
    .dashboard-grid-container {
        grid-template-columns: 1fr;
    }
}

/* Dashboard-Layout mit Reihen */
.dashboard-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.row-full {
    width: 100%;
}

.row-three {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.row-two {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

@media (max-width: 1000px) {
    .row-three {
        grid-template-columns: 1fr;
    }
    .row-two {
        grid-template-columns: 1fr;
    }
}

/* Mobile: Edge-to-Edge Layout */
@media (max-width: 768px) {
    .container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    .header {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}
