:root {
    --hub-bg: #f5f6f8;
    --hub-surface: #ffffff;
    --hub-border: #e2e5ea;
    --hub-text: #1f2430;
    --hub-text-muted: #6b7280;
    --hub-accent: #0a6e5a;
    --hub-accent-soft: #e3f3ef;
    --hub-warn: #b3441e;
    --hub-warn-soft: #fbeae3;
    --hub-radius: 10px;
    --hub-sidebar-width: 240px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--hub-bg);
    color: var(--hub-text);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

h1 {
    font-size: 1.5rem;
    margin: 0 0 1rem;
}

.hub-lead {
    color: var(--hub-text-muted);
    margin-top: -0.5rem;
}

/* --- Shell / Layout --- */
.hub-shell {
    display: flex;
    min-height: 100vh;
}

.hub-shell--embedded {
    grid-template-columns: 1fr;
}

.hub-shell--embedded .hub-main {
    max-width: none;
}

.hub-main {
    flex: 1;
    padding: 1.5rem 2rem 5rem;
    max-width: 1600px;
}

/* --- Desktop Sidebar --- */
.hub-sidebar {
    width: var(--hub-sidebar-width);
    flex-shrink: 0;
    background: var(--hub-surface);
    border-right: 1px solid var(--hub-border);
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
}

.hub-sidebar__brand {
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.5rem 1.25rem 1rem;
    border-bottom: 1px solid var(--hub-border);
    margin-bottom: 0.5rem;
}

.hub-sidebar__list {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
}

.hub-sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1.25rem;
    color: var(--hub-text);
    text-decoration: none;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
}

.hub-sidebar__link:hover {
    background: var(--hub-accent-soft);
}

.hub-sidebar__link.active {
    background: var(--hub-accent-soft);
    border-left-color: var(--hub-accent);
    color: var(--hub-accent);
    font-weight: 600;
}

.hub-sidebar__footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--hub-border);
}

.hub-sidebar__hint {
    font-size: 0.8rem;
    color: var(--hub-text-muted);
}

/* --- Mobile bottom nav --- */
.hub-mobilenav {
    display: none;
}

/* --- Cards (Home) --- */
.hub-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.hub-card {
    background: var(--hub-surface);
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius);
    padding: 1.25rem;
    text-decoration: none;
    color: var(--hub-text);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.hub-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}

.hub-card__icon { font-size: 1.6rem; }
.hub-card__title { font-weight: 600; }
.hub-card__desc { color: var(--hub-text-muted); font-size: 0.85rem; }

/* --- Panels / Stats --- */
.hub-panel {
    background: var(--hub-surface);
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius);
    padding: 1.25rem;
}

.hub-panel__person {
    color: var(--hub-text-muted);
    margin-top: 0;
}

.hub-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.hub-stat {
    background: var(--hub-bg);
    border-radius: var(--hub-radius);
    padding: 0.75rem 1rem;
}

.hub-stat--accent {
    background: var(--hub-accent-soft);
}

.hub-stat__label {
    display: block;
    font-size: 0.75rem;
    color: var(--hub-text-muted);
}

.hub-stat__value {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
}

.hub-progress {
    background: var(--hub-border);
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.hub-progress__bar {
    background: var(--hub-accent);
    height: 100%;
}

.hub-progress__caption {
    font-size: 0.8rem;
    color: var(--hub-text-muted);
    margin: 0.4rem 0 0;
}

/* --- Toolbar / Table --- */
.hub-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.hub-toolbar__label {
    font-weight: 600;
}

.hub-btn {
    border: 1px solid var(--hub-border);
    background: var(--hub-surface);
    border-radius: var(--hub-radius);
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
}

.hub-btn:hover {
    background: var(--hub-accent-soft);
}

.hub-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--hub-surface);
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius);
    overflow: hidden;
}

.hub-table th, .hub-table td {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--hub-border);
    font-size: 0.9rem;
}

.hub-table th {
    background: var(--hub-bg);
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--hub-text-muted);
}

.hub-row--warn td {
    background: var(--hub-warn-soft);
}

.hub-error {
    background: var(--hub-warn-soft);
    color: var(--hub-warn);
    padding: 0.75rem 1rem;
    border-radius: var(--hub-radius);
}

.hub-notice {
    background: var(--hub-accent-soft);
    color: var(--hub-accent);
    padding: 0.75rem 1rem;
    border-radius: var(--hub-radius);
}

.hub-mobile-only { display: none; }
.hub-desktop-only { display: block; }

/* Fokus sichtbar halten */
a:focus-visible, button:focus-visible {
    outline: 2px solid var(--hub-accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* --- Mobile: Sidebar aus, Bottom-Nav an --- */
@media (max-width: 720px) {
    .hub-sidebar { display: none; }

    .hub-main {
        padding: 1rem 1rem 5.5rem;
        max-width: none;
    }

    .hub-mobilenav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--hub-surface);
        border-top: 1px solid var(--hub-border);
        justify-content: space-around;
        padding: 0.4rem 0;
    }

    .hub-mobilenav__link {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.15rem;
        color: var(--hub-text-muted);
        text-decoration: none;
        font-size: 0.7rem;
    }

    .hub-mobilenav__link.active {
        color: var(--hub-accent);
        font-weight: 600;
    }

    .hub-mobile-only { display: block; }
    .hub-desktop-only { display: none; }
}

/* --- Blazor default error UI / loading --- */
#blazor-error-ui {
    background: var(--hub-warn-soft);
    color: var(--hub-warn);
    bottom: 0;
    box-shadow: 0 -1px 6px rgba(0,0,0,0.15);
    display: none;
    left: 0;
    padding: 0.75rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.hub-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    color: var(--hub-text-muted);
    font-family: "Segoe UI", system-ui, sans-serif;
}
