/* ── Layout ──────────────────────────────────────────────────────────────── */

/* The row stretches all columns to equal height; the sidebar column is a
   flex column so the nav can grow to fill whatever space the content creates. */
#sidebar-col {
    min-height: auto;
}

@media (min-width: 576px) {
    #sidebar-col {
        min-height: 100vh;
    }
}

#sidebar-logo {
    background-color: white;
    padding: 10px 12px;
    border-bottom: 1px solid #ccc;
    flex-shrink: 0;
}

#sidebar-logo img {
    width: 100%;
    height: auto;
    display: block;
}

#sidebar-toggle {
    display: none;
    width: 100%;
    margin-top: 8px;
    padding: 6px 10px;
    background-color: #666;
    color: white;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.95rem;
}

#sidebar-toggle:hover {
    background-color: #555;
}

@media (max-width: 575px) {
    #sidebar-toggle {
        display: block;
    }

    #sidebar-menu {
        display: none;
    }

    #sidebar-menu.open {
        display: block;
    }
}

.sidebar-nav {
    list-style: none;
    background-color: gray;
    width: 100%;
    margin: 0;
    padding: 16px 0 24px;
}

.sidebar-nav li {
    padding: 5px 16px;
}

.sidebar-nav a,
.sidebar-nav button {
    color: white;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
}

.sidebar-nav a:hover,
.sidebar-nav button:hover {
    color: #ddd;
}

#welcome-text {
    padding: 14px 20px 4px;
    color: #555;
    font-size: 0.9rem;
    border-bottom: 1px solid #eee;
    margin-bottom: 8px;
}

/* ── Detail page definition list ────────────────────────────────────────── */

.detail-list {
    margin: 0;
    padding: 0;
}

.detail-row {
    display: flex;
    gap: 12px;
    padding: 9px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row dt {
    flex: 0 0 120px;
    color: #666;
    font-size: 0.85rem;
    font-weight: 600;
    padding-top: 1px;
}

.detail-row dd {
    flex: 1;
    margin: 0;
    word-break: break-word;
}

/* ── Mobile card-stack for tables ───────────────────────────────────────── */

@media (max-width: 575px) {
    table.table thead {
        display: none;
    }

    table.table tbody tr {
        display: block;
        border: 1px solid #dee2e6;
        border-radius: 6px;
        margin-bottom: 12px;
        overflow: hidden;
    }

    table.table td {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 12px;
        border: none;
        border-bottom: 1px solid #f0f0f0;
        padding: 8px 12px;
        text-align: right;
    }

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

    table.table td[data-label]::before {
        content: attr(data-label);
        font-weight: 600;
        color: #555;
        font-size: 0.85em;
        white-space: nowrap;
        flex-shrink: 0;
        text-align: left;
    }
}

/* ── Auth pages (login, password reset, …) ──────────────────────────────── */

body.auth-page {
    background-color: #f0f0f0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.auth-wrapper {
    width: 100%;
    max-width: 440px;
}

.auth-card {
    border: none;
    border-radius: 8px;
    overflow: hidden;
}

.auth-logo {
    background-color: white;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e8e8e8;
}

.auth-logo img {
    width: 100%;
    height: auto;
    display: block;
}

.auth-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #444;
    margin: 20px 0 20px;
    text-align: center;
}

.auth-terms {
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    margin-top: 12px;
    font-size: 0.85rem;
    color: #555;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.auth-footer {
    text-align: center;
    font-size: 0.8rem;
    color: #888;
    margin-top: 16px;
}

.auth-footer a {
    color: #666;
}

/* ── Print ───────────────────────────────────────────────────────────────── */

@media print {
    #sidebar-col,
    #welcome-text,
    .btn,
    .no-print {
        display: none !important;
    }

    .col-md-6 {
        width: 50% !important;
        float: left;
    }

    .card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        break-inside: avoid;
    }

    .badge {
        border: 1px solid #ccc;
        color: #000 !important;
        background: none !important;
    }

    a[href]::after {
        content: none !important;
    }

    body {
        font-size: 11pt;
    }
}

/* ── Utilities ───────────────────────────────────────────────────────────── */

.Mitte {
    display: flex;
    justify-content: center;
    align-items: center;
}

.errornote {
    color: red;
}

.Inhalt {
    padding: 20px;
}

select.form-control {
    max-width: 100%;
}

.checkbox-scroll {
    max-height: 160px;
    overflow-y: auto;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 6px 10px;
    background: #fff;
}

.checkbox-scroll ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.checkbox-scroll li {
    padding: 2px 0;
}

/* Prevent flex columns from expanding to fit wide form controls */
.row > [class*="col-"] {
    min-width: 0;
}
