html,
body {
    height: 100%;
}

body {
    background: #f4f6f9;
    font-family: Arial, Helvetica, sans-serif;
    display: flex;
    color: #212529;
}

/* Sidebar */

.sidebar {
    width: 250px;
    min-height: 100vh;
    background: #343a40;
    color: #c2c7d0;
    position: fixed;
    left: 0;
    top: 0;
    transition: all 0.25s ease;
}

.sidebar .brand {
    height: 58px;
    border-bottom: 1px solid #4b545c;
    display: flex;
    align-items: center;
    padding: 0 18px;
    color: #fff;
    font-size: 20px;
    font-weight: 600;
}

.sidebar a {
    color: #c2c7d0;
    text-decoration: none;
    display: block;
    padding: 12px 18px;
    border-radius: 4px;
    margin: 4px 10px;
    white-space: nowrap;
}

.sidebar a:hover,
.sidebar a.active {
    background: #007bff;
    color: #fff;
}

/* Layout */

.content-wrapper {
    margin-left: 250px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
    transition: all 0.25s ease;
    background: #f4f6f9;
}

.topbar {
    height: 58px;
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.content {
    padding: 24px;
    flex: 1;
}

.footer {
    background: #fff;
    border-top: 1px solid #dee2e6;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #6c757d;
    font-size: 14px;
}

/* Login */

.login-page {
    background: #f4f6f9;
    display: block;
}

.auth-card {
    width: 420px;
}

.auth-card-lg {
    width: 460px;
}

/* Components */

.small-box {
    border-radius: 4px;
    color: #fff;
    padding: 18px;
    position: relative;
    overflow: hidden;
}

.small-box h3 {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
}

.small-box p {
    margin: 4px 0 0;
}

.small-box .icon {
    position: absolute;
    right: 16px;
    top: 10px;
    font-size: 52px;
    opacity: .3;
}

.card {
    border-radius: 4px;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #dee2e6;
}

.btn {
    border-radius: 4px;
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #0069d9;
    border-color: #0062cc;
}

.text-primary {
    color: #007bff !important;
}

.bg-primary {
    background-color: #007bff !important;
}

.badge.bg-primary {
    background-color: #007bff !important;
}

.form-control,
.form-select,
.input-group-text {
    border-radius: 4px;
}

/* Buttons */

.sidebar-toggle,
.theme-toggle {
    border: 0;
    background: transparent;
    font-size: 22px;
    color: #343a40;
    padding: 4px 8px;
    border-radius: 4px;
}

.theme-toggle {
    font-size: 18px;
}

.sidebar-toggle:hover,
.theme-toggle:hover {
    background: #f1f1f1;
}

/* Sidebar collapsed */

body.sidebar-collapsed .sidebar {
    width: 70px;
}

body.sidebar-collapsed .content-wrapper {
    margin-left: 70px;
}

body.sidebar-collapsed .sidebar .brand {
    justify-content: center;
    padding: 0;
}

body.sidebar-collapsed .sidebar .brand span,
body.sidebar-collapsed .sidebar small,
body.sidebar-collapsed .sidebar strong,
body.sidebar-collapsed .sidebar nav a span {
    display: none;
}

body.sidebar-collapsed .sidebar a {
    text-align: center;
    padding: 12px 0;
}

body.sidebar-collapsed .sidebar a i {
    margin-right: 0 !important;
    font-size: 18px;
}

/* DARK MODE */

body.dark-mode {
    background: #1f2327;
    color: #d6d8db;
}

body.dark-mode .content-wrapper {
    background: #1f2327;
}

body.dark-mode .topbar,
body.dark-mode .footer,
body.dark-mode .card,
body.dark-mode .card-header,
body.dark-mode .card-footer {
    background: #2b3035 !important;
    color: #d6d8db !important;
    border-color: #454d55 !important;
}

body.dark-mode .table {
    --bs-table-bg: #2b3035;
    --bs-table-color: #d6d8db;
    --bs-table-border-color: #454d55;
    --bs-table-hover-bg: #343a40;
    --bs-table-hover-color: #ffffff;
    color: #d6d8db !important;
    border-color: #454d55 !important;
}

body.dark-mode .table th,
body.dark-mode .table td {
    color: #d6d8db !important;
    border-color: #454d55 !important;
}

body.dark-mode .text-muted {
    color: #adb5bd !important;
}

body.dark-mode .form-control,
body.dark-mode .form-select,
body.dark-mode .input-group-text {
    background-color: #343a40 !important;
    color: #ffffff !important;
    border-color: #495057 !important;
}

body.dark-mode .form-control::placeholder {
    color: #adb5bd !important;
}

body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
    background-color: #343a40 !important;
    color: #ffffff !important;
    border-color: #0d6efd !important;
    box-shadow: none;
}

body.dark-mode .sidebar-toggle,
body.dark-mode .theme-toggle {
    color: #d6d8db;
}

body.dark-mode .sidebar-toggle:hover,
body.dark-mode .theme-toggle:hover {
    background: #343a40;
}

body.dark-mode .alert-success {
    background: #1f5132;
    color: #d1e7dd;
    border-color: #2c6b43;
}

body.dark-mode .alert-danger {
    background: #842029;
    color: #f8d7da;
    border-color: #a52834;
}

body.dark-mode .toast {
    background: #198754 !important;
    color: #fff !important;
}

/* Responsive */

@media (max-width: 768px) {
    body {
        display: flex;
    }

    .sidebar {
        position: fixed;
        width: 250px;
        min-height: 100vh;
        z-index: 1050;
        transform: translateX(-250px);
    }

    .content-wrapper {
        margin-left: 0;
        min-height: 100vh;
        width: 100%;
    }

    body.sidebar-mobile-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-collapsed .sidebar {
        width: 250px;
    }

    body.sidebar-collapsed .content-wrapper {
        margin-left: 0;
    }

    body.sidebar-collapsed .sidebar .brand span,
    body.sidebar-collapsed .sidebar small,
    body.sidebar-collapsed .sidebar strong,
    body.sidebar-collapsed .sidebar nav a span {
        display: inline;
    }

    .topbar {
        padding: 0 16px;
    }

    .content {
        padding: 16px;
    }

    .auth-card,
    .auth-card-lg {
        width: 100%;
    }

    .footer {
        display: block;
        text-align: center;
    }
}
.sidebar-user-box {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 14px 16px !important;
    margin: 0 !important;
    border-bottom: 1px solid #4b545c;
    border-radius: 0 !important;
}

.sidebar-user-box:hover {
    background: #3f474e !important;
}

.sidebar-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #6c757d;
}

.sidebar-user-text {
    line-height: 1.2;
    overflow: hidden;
}

.sidebar-user-text small {
    color: #adb5bd;
}

.sidebar-user-text strong {
    color: #fff;
}

.profile-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #dee2e6;
}

/* Eingeklappte Sidebar: nur Bild anzeigen */
body.sidebar-collapsed .sidebar-user-box {
    justify-content: center;
    padding: 14px 0 !important;
}

body.sidebar-collapsed .sidebar-user-text {
    display: none;
}

body.sidebar-collapsed .sidebar-avatar {
    width: 42px;
    height: 42px;
}