/* ===== 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;
}
