        * { box-sizing: border-box; margin: 0; padding: 0; }

        body {
            font-family: system-ui, -apple-system, Arial, sans-serif;
            background: #f4f6f9;
            font-size: 14px;
        }

        /* ===== Header (grün) ===== */
        .header {
            position: fixed;
            top: 0; left: 0; right: 0;
            z-index: 4000;
            background: #2e7d32;
            color: #fff;
            padding: 10px 20px;
            display: grid;
            grid-template-columns: 1fr auto 1fr;
            align-items: center;
        }
        .header-left {
            display: flex;
            align-items: center;
        }
        .header-center {
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .header-center strong { font-size: 16px; }
        .header-right {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 14px;
        }
        .header-user { font-size: 13px; opacity: .85; }

        /* ===== Seitentitel-Balken (im Content) ===== */
.page-bar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 0;
    padding: 14px 20px;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-height: 59px;
}
.page-bar-title {
    font-size: 16px;
    font-weight: 500;
    color: #1f2937;
    text-align: center;
}
.page-bar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}
        .header-logout {
            color: rgba(255,255,255,.8);
            font-size: 13px;
            text-decoration: none;
        }
        .header-logout:hover { opacity: 1; text-decoration: underline; }

        /* ===== Layout ===== */
        .app-layout {
            display: flex;
            min-height: calc(100vh - 46px);
            padding-top: 46px;
        }

        /* ===== Sidebar Rollenwechsel ===== */
        .sidebar-rolle {
            padding: 10px 12px;
            border-bottom: 1px solid rgba(255,255,255,.08);
            margin-bottom: 0;
        }
        .sidebar-rolle-select {
            width: 100%;
            background: #2e7d32;
            border: 1px solid rgba(255,255,255,.2);
            color: #fff;
            padding: 6px 28px 6px 10px;
            border-radius: 6px;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            font-family: inherit;
            appearance: none;
            -webkit-appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 10px center;
        }
        .sidebar-rolle-select option {
            background: #2e7d32;
            color: #fff;
        }
        .sidebar-rolle-label {
            display: block;
            background: #2e7d32;
            color: #fff;
            padding: 6px 10px;
            border-radius: 6px;
            font-size: 12px;
            font-weight: 600;
            text-align: center;
        }

        /* ===== Sidebar (grau) ===== */
        .sidebar {
            width: 210px;
            background: #3a3a3a;
            flex-shrink: 0;
            padding: 8px 0;
        }

        /* Hauptbutton */
        .nav-main-btn {
            display: block;
            width: 100%;
            padding: 10px 18px;
            background: none;
            border: none;
            border-bottom: 3px solid transparent;
            cursor: pointer;
            font-size: 13px;
            font-weight: 500;
            color: #a89880;
            text-align: left;
            font-family: inherit;
        }
        .nav-main-btn:hover { color: #c9b79c; }
        .nav-main-btn.has-separator {
            border-top: 1px solid rgba(201,183,156,.2);
            padding-top: 12px;
            margin-top: 2px;
        }
        .nav-main-btn.active {
            color: #ffffff;
            font-weight: 700;
            border-bottom: 3px solid #b08a2e;
        }

        /* Subbuttons – eingerückt, nur sichtbar wenn Hauptbutton aktiv */
        .nav-sub-list {
            display: none;
            padding: 2px 0 6px 0;
        }
        .nav-sub-list.visible { display: block; }

        .nav-sub-btn {
            display: block;
            width: 100%;
            padding: 7px 18px 7px 36px;
            background: none;
            border: none;
            cursor: pointer;
            font-size: 12px;
            color: #a89880;
            text-align: left;
            font-family: inherit;
            text-decoration: none;
        }
        .nav-sub-btn:hover { color: #c9b79c; }
        .nav-sub-btn.active {
            color: #fff;
            font-weight: 600;
        }
        
/* ===== Content-Wrapper ===== */
.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}
        /* ===== Content ===== */
        .content {
            flex: 1;
            padding: 24px;
            background: #f4f6f9;
            overflow: auto;
        }

        /* ===== Tabellen ===== */
        .table-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
        }
        .table-outer {
            display: flex;
            justify-content: center;
        }
        .table-wrap {
            background: #fff;
            border: 1px solid #e5e7eb;
            border-radius: 10px;
            overflow: hidden;
            width: auto;
            display: inline-block;
            box-shadow: 0 1px 4px rgba(0,0,0,.06);
        }
        .table-wrap table { width: auto; }

        /* Gruppen-Header (über Spaltenüberschriften) */
        .group-header {
            background: #f0f0ee;
            padding: 10px 16px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            flex-wrap: wrap;
            border-bottom: 1px solid #e5e7eb;
        }
        .group-title {
            font-size: 13px;
            font-weight: 700;
            color: #374151;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .group-count {
            background: #e5e7eb;
            color: #6b7280;
            font-size: 11px;
            font-weight: 600;
            padding: 1px 7px;
            border-radius: 20px;
        }

        /* Tabellen-Header ohne Gruppe (direkt dunkel) */
        .table-header {
            background: #3a3a3a;
            padding: 10px 16px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            flex-wrap: wrap;
            outline: none;
        }
        .table-title {
            font-size: 13px;
            font-weight: 600;
            color: #e8d9c0;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .table-title .count {
            background: rgba(255,255,255,.12);
            color: #c9b79c;
            font-size: 11px;
            font-weight: 600;
            padding: 1px 7px;
            border-radius: 20px;
        }

        /* Suchfeld – hell (in group-header) */
        .search-row { display: flex; gap: 6px; }
        .search-input {
            padding: 5px 10px;
            border: 1px solid #e5e7eb;
            border-radius: 6px;
            font-size: 12px;
            width: 200px;
            color: #374151;
            font-family: inherit;
            background: #fff;
        }
        .search-input:focus { outline: none; border-color: #2e7d32; }

        /* Seitenüberschrift – weiß mit sandfarbener Schrift */
        .page-title-bar {
            background: #fff;
            border: 1px solid #b08a2e;
            border-radius: 8px;
            padding: 10px 16px;
            margin-bottom: 16px;
            display: inline-flex;
            align-items: center;
        }
        .page-title-bar .page-title-text {
            font-size: 13px;
            font-weight: 600;
            color: #b08a2e;
        }

        /* Suchfeld – dunkel (in table-header) */
        .table-header .search-input {
            background: rgba(255,255,255,.1);
            border-color: rgba(255,255,255,.15);
            color: #fff;
        }
        .table-header .search-input::placeholder { color: rgba(255,255,255,.4); }
        .table-header .search-input:focus { border-color: rgba(255,255,255,.4); }

        .search-btn {
            padding: 5px 12px;
            background: #2e7d32;
            color: #fff;
            border: none;
            border-radius: 6px;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            font-family: inherit;
        }
        .search-btn:hover { background: #1b5e20; }

        /* Spaltenüberschriften — dunkel mit sandfarbener Schrift */
        table { border-collapse: collapse; }
        th {
            background: #3a3a3a;
            color: #c9b79c;
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: .04em;
            padding: 8px 14px;
            text-align: left;
            white-space: nowrap;
        }
        td {
            padding: 8px 14px;
            font-size: 13px;
            color: #374151;
            border-bottom: 1px solid #f3f4f6;
            white-space: nowrap;
        }
        tr:last-child td { border-bottom: 0; }
        tr:hover td { background: #fafafa; }

        /* td-Hilfsklassen */
        .td-muted    { color: #6b7280; }
        .td-hint     { color: #9ca3af; }
        .td-positive { color: #1a6b2e; font-weight: 600; }
        .td-bold     { font-weight: 600; color: #374151; }
        .td-sm       { font-size: 12px; }
        .td-xs       { font-size: 11px; }
        .td-empty    { padding: 14px 16px; color: #9ca3af; }

        /* Popup-Container */
        /* Schwebendes Suchpanel */
        .floating-panel {
            position: fixed;
            top: 80px;
            right: 24px;
            width: 320px;
            max-width: calc(100vw - 16px);
            background: #fff;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 8px 32px rgba(0,0,0,.18);
            z-index: 2000;
        }
        .floating-panel-header {
            background: #3a3a3a;
            padding: 10px 16px;
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: grab;
            user-select: none;
        }
        .floating-panel-header:active { cursor: grabbing; }
        .floating-panel-header .card-title { color: #e8d9c0; }
        .floating-panel-header .card-header-dot { background: #b08a2e; }

        .popup-card {
            background: #fff;
            border-radius: 10px;
            overflow: hidden;
            width: 100%;
            box-shadow: 0 4px 24px rgba(0,0,0,.15);
        }
        .popup-card-scroll {
            background: #fff;
            border-radius: 10px;
            overflow: hidden;
            width: 100%;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: 0 4px 24px rgba(0,0,0,.15);
        }

        .popup-overlay {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 16px;
            box-sizing: border-box;
        }

        .card-outer {
            display: flex;
            justify-content: center;
            margin-bottom: 20px;
        }
        .card {
            background: #fff;
            border: 1px solid #e5e7eb;
            border-radius: 10px;
            overflow: hidden;
            width: 100%;
            max-width: 520px;
            box-shadow: 0 1px 4px rgba(0,0,0,.06);
        }
        .card-header {
            background: #3a3a3a;
            padding: 12px 18px;
            display: flex;
            align-items: center;
            gap: 8px;
            outline: none;
        }
        .card-header-dot {
            width: 7px; height: 7px;
            border-radius: 50%;
            background: #b08a2e;
            flex-shrink: 0;
        }
        .card-title {
            font-size: 13px;
            font-weight: 600;
            color: #e8d9c0;
            letter-spacing: .02em;
        }
        .card-body { padding: 20px; }
        .card-footer {
            padding: 12px 18px;
            background: #fafafa;
            border-top: 1px solid #f3f4f6;
            display: flex;
            gap: 8px;
        }
        .form-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 14px;
            margin-bottom: 14px;
        }
        .form-group {
            display: flex;
            flex-direction: column;
            gap: 5px;
            margin-bottom: 14px;
        }
        .form-group label {
            font-size: 12px;
            font-weight: 600;
            color: #6b7280;
        }
        .form-group input,
        .form-group select,
        .form-group textarea {
            padding: 8px 10px;
            border: 1px solid #e5e7eb;
            border-radius: 6px;
            font-size: 13px;
            color: #111827;
            font-family: inherit;
            background: #fff;
        }
        .form-group input:focus,
        .form-group select:focus,
        .form-group textarea:focus {
            outline: none;
            border-color: #2e7d32;
            box-shadow: 0 0 0 3px rgba(46,125,50,.1);
        }
        .form-group small {
            font-size: 12px;
            color: #9ca3af;
        }

        /* Checkboxen in Rollen-Liste */
        .check-list { display: flex; flex-direction: column; gap: 6px; }
        .check-item {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 7px 10px;
            border: 1px solid #e5e7eb;
            border-radius: 6px;
            font-size: 13px;
            color: #374151;
            cursor: pointer;
        }
        .check-item:hover { background: #f9fafb; }
        .check-item input[type=checkbox] {
            width: 15px; height: 15px;
            accent-color: #2e7d32;
            cursor: pointer;
            padding: 0; border: none; box-shadow: none;
        }

        /* Buttons */
        .btn-row {
            display: flex;
            gap: 8px;
            margin-top: 16px;
            padding-top: 14px;
            border-top: 1px solid #f3f4f6;
        }
        .btn {
            padding: 8px 16px;
            border-radius: 6px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            border: none;
            font-family: inherit;
            text-decoration: none;
            display: inline-block;
        }
        .btn-primary {
            background: #3a3a3a;
            color: #e8d9c0;
            border: 1px solid #3a3a3a;
        }
        .btn-primary:hover {
            background: #2a2a2a;
            border-color: #2a2a2a;
        }
        .btn-secondary {
            background: #fff;
            color: #374151;
            border: 1px solid #e5e7eb;
        }
        .btn-secondary:hover { background: #f9fafb; }
        .btn-danger {
            background: transparent;
            color: #b08a2e;
            border: 1px solid #b08a2e;
        }
        .btn-danger:hover {
            background: rgba(176,138,46,.08);
        }
        .btn-sm { padding: 5px 10px; font-size: 12px; }

        /* Badges */
        .badge {
            display: inline-block;
            padding: 2px 8px;
            border-radius: 20px;
            font-size: 11px;
            font-weight: 600;
        }
        .badge-green { background: #dcfce7; color: #15803d; }
        .badge-gray  { background: #f3f4f6; color: #6b7280; }
        .badge-amber { background: #fef3c7; color: #b45309; }
        .badge-red   { background: #fee2e2; color: #b91c1c; }

        /* Alerts */
        .alert {
            padding: 10px 14px;
            border-radius: 6px;
            margin-bottom: 14px;
            font-size: 13px;
        }
        .alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
        .alert-error   { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
        .alert-info    { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }

        /* Page title */
        .page-title {
            font-size: 17px;
            font-weight: 700;
            color: #1f2937;
            margin-bottom: 20px;
        }

/* ===== Auth-Layout (Login, Erstlogin) ===== */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f6f9;
    padding: 40px 16px;
}
.auth-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

/* ===== Hamburger-Button (immer vorhanden, nur < 900px sichtbar) ===== */
.hamburger {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    padding: 0 8px 0 0;
    line-height: 1;
}

/* ===== Sidebar-Backdrop ===== */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 46px; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.45);
    z-index: 2900;
}
.sidebar-backdrop.active { display: block; }

/* ===== Responsive: < 900px ===== */
@media (max-width: 900px) {

    /* Hamburger sichtbar */
    .hamburger { display: inline-block; }

    /* header-user (E-Mail) auf kleinen Screens ausblenden */
    .header-user { display: none; }

    /* Sidebar: standardmäßig versteckt, als Drawer einblendbar */
    .sidebar {
        display: none;
        position: fixed;
        top: 46px;
        left: 0;
        height: calc(100% - 46px);
        z-index: 3000;
        overflow-y: auto;
    }
    .sidebar.open { display: block; }

    /* Content bekommt mehr Platz */
    .content { padding: 12px; }

    /* Tabellen: horizontal scrollbar, korrekt begrenzt */
    .table-outer {
        overflow-x: auto;
        width: 100%;
    }
    .table-wrap {
        display: block;
        overflow-x: auto;
        width: 100%;
        min-width: 0;
    }

    /* Tabellen-Grid: untereinander */
    .table-grid { grid-template-columns: 1fr; }

    /* Popup-Cards: auf kleinen Screens scrollbar */
    .popup-card,
    .popup-card-scroll {
        max-height: 85vh;
        overflow-y: auto;
    }

    /* Floating Panel: dichter am Rand */
    .floating-panel {
        right: 8px;
        top: 60px;
    }
}
