/* ===== GRUNDLAYOUT ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    background: #F5F5F7;
    color: #1d1d1f;
}

/* ===== NAVBAR ===== */
.navbar-top {
    background: #fff;
    border-bottom: 0.5px solid #e0e0e0;
    padding: 0 24px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.navbar-brand {
    font-size: 15px;
    font-weight: 500;
    color: #185FA5;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    white-space: nowrap;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
    flex: 0 0 auto;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 7px 14px;
    border-radius: 8px;
    border: 0.5px solid #d0d0d0;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    color: #1d1d1f;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

    .btn:hover {
        background: #F5F5F7;
    }

.btn-primary {
    background: #185FA5;
    color: #fff;
    border-color: #185FA5;
}

    .btn-primary:hover {
        background: #0C447C;
    }

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-danger {
    color: #A32D2D;
    border-color: #F09595;
}

    .btn-danger:hover {
        background: #FCEBEB;
    }

.btn-success {
    background: #1D9E75;
    color: #fff;
    border-color: #1D9E75;
}

    .btn-success:hover {
        background: #0F6E56;
    }

/* ===== SIDEBAR LAYOUT ===== */
.app-layout {
    display: flex;
    min-height: calc(100vh - 52px);
}

.sidebar {
    width: 200px;
    background: #fff;
    border-right: 0.5px solid #e0e0e0;
    padding: 12px 0;
    flex-shrink: 0;
    position: sticky;
    top: 52px;
    height: calc(100vh - 52px);
    overflow-y: auto;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    font-size: 14px;
    color: #444;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background 0.1s;
}

    .sidebar-item:hover {
        background: #F5F5F7;
        color: #185FA5;
    }

    .sidebar-item.active {
        background: #E6F1FB;
        color: #185FA5;
        font-weight: 500;
        border-left: 3px solid #185FA5;
    }

    .sidebar-item svg {
        flex-shrink: 0;
        opacity: 0.7;
    }

    .sidebar-item.active svg {
        opacity: 1;
    }

.page-content {
    flex: 1;
    overflow-x: hidden;
    min-width: 0;
}

/* ===== CONTENT ===== */
main {
    padding: 0;
}

.content {
    padding: 24px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.page-title {
    font-size: 18px;
    font-weight: 500;
}

/* ===== STATS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0,1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.stat-card {
    background: #F5F5F7;
    border-radius: 8px;
    padding: 12px 14px;
}

.stat-label {
    font-size: 11px;
    color: #666;
    margin-bottom: 3px;
}

.stat-value {
    font-size: 20px;
    font-weight: 500;
}

/* ===== FILTER ===== */
.filter-card {
    background: #fff;
    border: 0.5px solid #e0e0e0;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 16px;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

    .filter-row:last-child {
        margin-bottom: 0;
    }

.filter-label {
    font-size: 12px;
    color: #666;
    min-width: 30px;
    font-weight: 500;
}

.chip-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.chip {
    padding: 3px 10px;
    border-radius: 20px;
    border: 0.5px solid #d0d0d0;
    font-size: 12px;
    cursor: pointer;
    background: #fff;
    color: #666;
}

    .chip.active {
        background: #E6F1FB;
        color: #0C447C;
        border-color: #85B7EB;
        font-weight: 500;
    }

.inp {
    border: 0.5px solid #d0d0d0;
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 13px;
    background: #fff;
    color: #1d1d1f;
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-top: 10px;
    border-top: 0.5px solid #e0e0e0;
    width: 100%;
}

/* ===== TABELLE ===== */
.table-wrap {
    background: #fff;
    border: 0.5px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    border-bottom: 0.5px solid #e0e0e0;
}

.table-count {
    font-size: 12px;
    color: #666;
}

.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
}

th {
    padding: 8px 10px;
    text-align: left;
    font-size: 11px;
    font-weight: 500;
    color: #666;
    border-bottom: 0.5px solid #e0e0e0;
    background: #F5F5F7;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    cursor: pointer;
}

    th:hover {
        color: #1d1d1f;
    }

td {
    padding: 9px 10px;
    font-size: 13px;
    border-bottom: 0.5px solid #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

tr:nth-child(even) td {
    background: #F9F9FB;
}

tr:nth-child(odd) td {
    background: #fff;
}

tr:last-child td {
    border-bottom: none;
}

tr.clickrow {
    cursor: pointer;
}

    tr.clickrow:hover td {
        background: #E6F1FB !important;
    }

    tr.clickrow:hover .rtitle {
        color: #0C447C;
        text-decoration: underline;
    }

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.badge-gut {
    background: #EAF3DE;
    color: #3B6D11;
}

.badge-normal {
    background: #F5F5F7;
    color: #666;
}

.badge-schlecht {
    background: #FCEBEB;
    color: #A32D2D;
}

.badge-ja {
    background: #E6F1FB;
    color: #185FA5;
}

/* ===== MEDIEN ICONS ===== */
.micons {
    display: flex;
    gap: 4px;
}

.micon {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    color: #666;
    padding: 2px 5px;
    border-radius: 10px;
    background: #F5F5F7;
    border: 0.5px solid #e0e0e0;
}

    .micon.on {
        color: #185FA5;
        background: #E6F1FB;
        border-color: #85B7EB;
    }

/* ===== AKTIONS SPALTE ===== */
.td-actions {
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: flex-end;
}

.btn-detail {
    background: #E6F1FB;
    color: #0C447C;
    border-color: #85B7EB;
    font-size: 11px;
    padding: 3px 9px;
}

    .btn-detail:hover {
        background: #B5D4F4;
    }

/* ===== FORMULAR ===== */
.form-card {
    background: #fff;
    border: 0.5px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.form-header {
    padding: 14px 20px;
    border-bottom: 0.5px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-title {
    font-size: 15px;
    font-weight: 500;
}

.form-body {
    padding: 18px 20px;
}

.form-footer {
    padding: 14px 20px;
    border-top: 0.5px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    background: #F5F5F7;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0;
}

.form-col:not(:last-child) {
    border-right: 0.5px solid #e0e0e0;
    padding-right: 22px;
}

.form-col + .form-col {
    padding-left: 22px;
}

.fgroup {
    margin-bottom: 14px;
}

.flabel {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.rstar {
    color: #E24B4A;
}

.finput {
    width: 100%;
    border: 0.5px solid #d0d0d0;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 13px;
    background: #fff;
    color: #1d1d1f;
    font-family: inherit;
}

    .finput:focus {
        outline: none;
        border-color: #185FA5;
        box-shadow: 0 0 0 2px #E6F1FB;
    }

    .finput.err {
        border-color: #E24B4A;
        background: #FCEBEB;
    }

.finput-comp {
    background: #F5F5F7;
    color: #185FA5;
    font-weight: 500;
    cursor: default;
}

.finput-ta {
    height: 80px;
    resize: none;
}

.val-bar {
    background: #FCEBEB;
    border: 0.5px solid #F09595;
    border-radius: 8px;
    padding: 9px 14px;
    margin-bottom: 14px;
    font-size: 13px;
    color: #A32D2D;
    display: none;
}

    .val-bar.show {
        display: block;
    }

/* ===== DETAIL ===== */
.detail-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0,1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.det-box {
    background: #fff;
    border: 0.5px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 14px;
}

.det-lbl {
    font-size: 11px;
    color: #666;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.det-val {
    font-size: 20px;
    font-weight: 500;
}

.det-unit {
    font-size: 11px;
    color: #666;
}

.det-card {
    background: #fff;
    border: 0.5px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
}

.det-card-title {
    font-size: 11px;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}

.det-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 0.5px solid #e0e0e0;
    font-size: 13px;
}

    .det-row:last-child {
        border-bottom: none;
    }

.det-row-lbl {
    color: #666;
}

.det-row-val {
    font-weight: 500;
}
/* ============================================================================
   ERWEITERUNG FÜR app.css
   ----------------------------------------------------------------------------
   Diesen Block komplett an das ENDE von wwwroot/app.css kopieren.
   Styles passen zum bestehenden Design (Primär #185FA5, Akzent #E6F1FB,
   Radien 8px, Borders 0.5px #e0e0e0).
   Enthalten:
     • Benutzer-Menü in der Topbar (Avatar + Vorname + Dropdown)
     • Profil-Seite (Panels, Formulare, Buttons)
     • Konto-Seiten (Platzhalter, Warnung, Löschung)
   ============================================================================ */

/* ===== BENUTZER-MENÜ (Topbar oben rechts) ===== */

.user-menu {
    position: relative;
    display: inline-block;
}

.user-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 3px 10px 3px 3px;
    background: transparent;
    border: 0.5px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    color: #1d1d1f;
    font-family: inherit;
    font-size: 13px;
    height: 36px;
    transition: background 0.1s, border-color 0.1s;
}

    .user-menu-trigger:hover,
    .user-menu.is-open .user-menu-trigger {
        background: #F5F5F7;
        border-color: #e0e0e0;
    }

.user-avatar-img,
.user-avatar-fallback {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #E6F1FB;
    color: #0C447C;
    font-size: 12px;
    font-weight: 500;
}

.user-avatar-lg {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    font-size: 16px;
}

.user-name {
    font-weight: 500;
    font-size: 13px;
    color: #444;
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-chevron {
    width: 12px;
    height: 12px;
    opacity: 0.5;
    transition: transform 0.15s;
    color: #666;
}

.user-menu.is-open .user-chevron {
    transform: rotate(180deg);
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 240px;
    background: #fff;
    color: #1d1d1f;
    border: 0.5px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    z-index: 200;
    padding: 6px;
}

.user-menu-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 12px;
}

.user-menu-name {
    font-weight: 500;
    font-size: 13px;
    color: #1d1d1f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.user-menu-login {
    color: #888;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.user-menu-divider {
    height: 0.5px;
    background: #e0e0e0;
    margin: 4px 0;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    color: #1d1d1f;
    font-family: inherit;
    font-size: 13px;
    text-align: left;
    transition: background 0.1s;
}

    .user-menu-item:hover {
        background: #F5F5F7;
        color: #185FA5;
    }

    .user-menu-item svg {
        width: 16px;
        height: 16px;
        opacity: 0.7;
        flex-shrink: 0;
    }

.user-menu-item-danger {
    color: #A32D2D;
}

    .user-menu-item-danger:hover {
        background: #FCEBEB;
        color: #A32D2D;
    }

.user-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 150;
    background: transparent;
}

/* ===== PROFIL / MEIN KONTO / KONTO LÖSCHEN (Seiten-Layout) ===== */

.page {
    max-width: 860px;
    margin: 0 auto;
    padding: 24px;
}

.page-head h1 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 500;
    color: #1d1d1f;
}

.page-head p {
    margin: 0 0 20px;
    color: #666;
    font-size: 13px;
}

.panel {
    background: #fff;
    border: 0.5px solid #e0e0e0;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 16px;
}

    .panel h2 {
        margin: 0 0 14px;
        font-size: 13px;
        font-weight: 500;
        color: #666;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

.muted {
    color: #888;
    font-size: 13px;
}

    .muted.sm {
        font-size: 11px;
        display: block;
        margin-top: 4px;
        color: #999;
    }

.liste {
    margin: 6px 0 12px 20px;
    color: #444;
    font-size: 13px;
}

    .liste li {
        margin-bottom: 2px;
    }

/* Profilbild-Block */
.profil-bild-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.profil-bild-vorschau {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: #E6F1FB;
    border: 0.5px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 84px;
}

    .profil-bild-vorschau img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.profil-bild-fallback {
    color: #0C447C;
    font-size: 28px;
    font-weight: 500;
}

.profil-bild-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

/* Formulare (nutzen teilweise bestehende .inp / .btn-Klassen) */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 20px;
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

    .form-field label {
        font-size: 12px;
        font-weight: 500;
        color: #666;
    }

    .form-field .inp,
    .form-field .sel {
        padding: 7px 10px;
        border: 0.5px solid #d0d0d0;
        border-radius: 8px;
        font-size: 13px;
        background: #fff;
        color: #1d1d1f;
        font-family: inherit;
        width: 100%;
    }

        .form-field .inp:focus,
        .form-field .sel:focus {
            outline: none;
            border-color: #185FA5;
            box-shadow: 0 0 0 2px #E6F1FB;
        }

        .form-field .inp:disabled {
            background: #F5F5F7;
            color: #999;
        }

.switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    color: #444;
}

.form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
    flex-wrap: wrap;
}

.btn-ghost {
    background: transparent;
}

/* Meldungen */
.meldung {
    margin-top: 12px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
}

.meldung-erfolg {
    background: #EAF3DE;
    color: #3B6D11;
    border: 0.5px solid #C9E09A;
}

.meldung-fehler {
    background: #FCEBEB;
    color: #A32D2D;
    border: 0.5px solid #F09595;
}

/* Gefahr- / Warn-Panels für Konto-Löschung */
.panel-danger {
    border-color: #F09595;
    background: #fdf4f3;
}

.panel-warn {
    border-color: #F3D9A4;
    background: #FFF9EC;
}

/* Mein Konto – Placeholder */
.panel-placeholder {
    text-align: center;
    padding: 40px 24px;
}

.placeholder-icon {
    margin: 0 auto 14px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #185FA5;
}

    .placeholder-icon svg {
        width: 100%;
        height: 100%;
    }

.plan-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 12px 14px;
    border: 0.5px solid #e0e0e0;
    border-radius: 10px;
    background: #F5F5F7;
}

.plan-badge {
    padding: 3px 9px;
    background: #185FA5;
    color: #fff;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.plan-name {
    font-weight: 500;
    font-size: 14px;
}

.plan-desc {
    font-size: 12px;
    color: #666;
}

.plan-price {
    font-weight: 500;
    color: #185FA5;
    font-size: 14px;
}