/* =========================================================
   Dashboard – Grundlayout
   ========================================================= */

:root {
    --sidebar-width: 250px;
    --sidebar-width-collapsed: 72px;
    --sidebar-bg: #212529;
    --sidebar-color: #e9ecef;
    --sidebar-color-muted: #adb5bd;
    --sidebar-active-bg: #0d6efd;
}

html, body {
    height: 100%;
    background-color: #f5f6f8;
}

.dashboard-wrapper {
    min-height: 100vh;
}

/* -------------------- Sidebar -------------------- */

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-color);
    flex-shrink: 0;
    transition: width 0.2s ease-in-out;
}

.sidebar .sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    color: #fff;
    font-size: 1.05rem;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--sidebar-color-muted);
    border-radius: 0.5rem;
    padding: 0.55rem 0.75rem;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar .nav-link i {
    font-size: 1.1rem;
    width: 1.3rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.08);
}

.sidebar .nav-link.active {
    color: #fff;
    background-color: var(--sidebar-active-bg);
}

.sidebar-divider {
    margin: 0.75rem 0 0.35rem;
    padding: 0 0.75rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sidebar-color-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 0.75rem;
}

/* Eingeklappter Zustand (nur Desktop, ab lg-Breakpoint) */
@media (min-width: 992px) {
    .dashboard-wrapper.sidebar-collapsed .sidebar {
        width: var(--sidebar-width-collapsed);
    }

    .dashboard-wrapper.sidebar-collapsed .sidebar .nav-label,
    .dashboard-wrapper.sidebar-collapsed .sidebar-divider .nav-label {
        display: none;
    }

    .dashboard-wrapper.sidebar-collapsed .sidebar-divider {
        text-align: center;
    }

    .dashboard-wrapper.sidebar-collapsed .sidebar .nav-link {
        justify-content: center;
        padding: 0.6rem 0;
    }

    .dashboard-wrapper.sidebar-collapsed .sidebar-brand span.nav-label {
        display: none;
    }
}

/* -------------------- Hauptbereich -------------------- */

.main-content {
    min-width: 0; /* verhindert Overflow bei Flex-Kindern */
}

.topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.topbar .btn-icon {
    border: none;
    background: transparent;
    font-size: 1.4rem;
    line-height: 1;
    color: #495057;
}

/* -------------------- Widget-Karten -------------------- */

.widget-card {
    height: 100%;
}

.widget-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.widget-card .card-header .widget-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    margin: 0;
}

/* -------------------- ToDo-Widget -------------------- */

.todo-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.todo-list .todo-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.todo-list .todo-item:last-child {
    border-bottom: none;
}

.todo-list .todo-item.done .todo-text {
    text-decoration: line-through;
    color: #9aa0a6;
}

.todo-list .todo-text {
    flex-grow: 1;
    word-break: break-word;
}

.todo-empty-state {
    color: #9aa0a6;
    text-align: center;
    padding: 1rem 0;
}
