html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: #1a1a1a;
}

:root {
    --accent-gradient: #159079;
    --accent-shadow: rgba(21, 144, 121, 0.32);
    --accent-solid: #159079;
}

.app {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    box-sizing: border-box;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.sidebar-logo {
    position: absolute;
    top: 0;
    left: 16px;
    right: 16px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo img {
    max-width: 100%;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 90px;
}

.nav-bottom {
    margin-top: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    box-sizing: border-box;
    width: 100%;
    height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    color: #9a9a9a;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.nav-item.active {
    background: var(--accent-gradient);
    color: #ffffff;
    box-shadow: 0 8px 20px var(--accent-shadow);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.content {
    flex: 1;
    background: #f7f7f5;
    border-radius: 24px 0 0 24px;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
}

.topbar {
    position: sticky;
    top: 0;
    flex-shrink: 0;
    box-sizing: border-box;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 15px 28px;
    background: rgba(247, 247, 245, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid #e6e6e3;
    z-index: 10;
}

.topbar-left {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1;
}

.topbar-search {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 480px;
}

.topbar-search-icon {
    position: absolute;
    left: 15px;
    width: 18px;
    height: 18px;
    color: #8a8a87;
    pointer-events: none;
}

.topbar-search-input {
    width: 100%;
    height: 44px;
    box-sizing: border-box;
    padding: 0 16px 0 44px;
    border: 1px solid #e2e2df;
    border-radius: 100px;
    background: #ffffff;
    color: #1a1a1a;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.topbar-search-input::placeholder {
    color: #a4a4a0;
}

.topbar-search-input:focus {
    border-color: var(--accent-solid);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-logo {
    display: none;
}

[data-home] {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

[data-home]:focus-visible {
    outline: 2px solid var(--accent-solid);
    outline-offset: 4px;
    border-radius: 4px;
}

.topbar-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid #e2e2df;
    border-radius: 12px;
    background: #ffffff;
    color: #1a1a1a;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.topbar-icon-btn:hover {
    background: #f0f0ee;
    border-color: #d5d5d2;
}

.topbar-icon-btn svg {
    width: 20px;
    height: 20px;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid #e2e2df;
    border-radius: 12px;
    background: #ffffff;
    color: #1a1a1a;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover {
    background: #f0f0ee;
    border-color: #d5d5d2;
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

/* Sprachumschalter (DE/EN) – nutzt den Look des Theme-Buttons */
.theme-toggle.lang-toggle {
    width: auto;
    gap: 6px;
    padding: 0 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.theme-toggle.lang-toggle svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 820px) {
    .theme-toggle.lang-toggle {
        width: auto;
        padding: 0 10px;
    }

    .theme-toggle.lang-toggle svg {
        display: none;
    }
}

.lang-menu {
    position: relative;
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 60;
    display: none;
    min-width: 168px;
    padding: 6px;
    border: 1px solid #e2e2df;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.14);
}

.lang-menu.open .lang-dropdown {
    display: block;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: #1a1a1a;
    font: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}

.lang-option b {
    min-width: 24px;
    font-size: 12px;
    color: #8a8a87;
}

.lang-option:hover {
    background: #f2f2f0;
}

.lang-option.active {
    background: rgba(21, 144, 121, 0.1);
    color: var(--accent-solid);
    font-weight: 600;
}

.lang-option.active b {
    color: var(--accent-solid);
}

body.dark .lang-dropdown {
    background: #1f1f1f;
    border-color: rgba(255, 255, 255, 0.07);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.6);
}

body.dark .lang-option {
    color: #e2e2e6;
}

body.dark .lang-option:hover {
    background: rgba(255, 255, 255, 0.06);
}

body.dark .lang-option.active {
    background: rgba(21, 144, 121, 0.18);
    color: var(--accent-solid);
}

.profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 14px 6px 6px;
    border: 1px solid #e2e2df;
    border-radius: 14px;
    background: #ffffff;
}

.profile-menu {
    position: relative;
}

.profile-menu.logged-in .profile {
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.profile-menu.logged-in .profile:hover {
    border-color: #c7c9f7;
    background: #f5f5ff;
}

/* Abgemeldet: Profil-Button wie der Theme-Toggle (44x44, ohne Farbe) */
.profile-menu:not(.logged-in) .profile {
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.profile-menu:not(.logged-in) .profile:hover {
    background: #f0f0ee;
    border-color: #d5d5d2;
}

.profile-menu:not(.logged-in) .profile-info {
    display: none;
}

.profile-menu:not(.logged-in) .avatar {
    width: auto;
    height: auto;
    background: transparent;
    color: #1a1a1a;
}

.profile-menu:not(.logged-in) .avatar svg {
    width: 22px;
    height: 22px;
    color: #1a1a1a;
}

.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    padding-top: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    z-index: 100;
}

.profile-menu.logged-in:hover .profile-dropdown,
.profile-menu.logged-in:focus-within .profile-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-dropdown-card {
    min-width: 220px;
    padding: 6px;
    background: #ffffff;
    border: 1px solid #ececf7;
    border-radius: 16px;
    box-shadow: 0 18px 44px rgba(21, 144, 121, 0.18);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px 11px;
    margin-bottom: 3px;
    border-bottom: 1px solid #ececf7;
}

.dropdown-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: var(--accent-gradient);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
}

.dropdown-header-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.dropdown-name {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-email {
    font-size: 11px;
    font-weight: 500;
    color: #8a8aa0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: none;
    border-radius: 10px;
    background: transparent;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: #2a2a2a;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

button.dropdown-item:hover {
    background: linear-gradient(135deg, rgba(79, 107, 255, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    color: #2a2a2a;
}

.dropdown-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--accent-solid);
    transition: color 0.15s ease;
}

.dropdown-plan {
    cursor: pointer;
}

/* Sprache im Profil-Menü – nur auf dem Handy (Desktop hat den Button oben) */
.dropdown-lang {
    display: none;
}

.dropdown-lang-list {
    display: grid;
    gap: 2px;
    margin: 2px 0 4px 26px;
}

.dropdown-lang-list[hidden] {
    display: none;
}

.dropdown-lang-list .lang-option {
    padding: 7px 10px;
    font-size: 13px;
}

.dropdown-plan-value {
    margin-left: auto;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: #6a6a80;
    background: #f0f0f5;
}

.dropdown-divider {
    height: 1px;
    margin: 6px 8px;
    background: #e6e6f2;
}

.dropdown-danger {
    color: #c0392b;
}

.dropdown-danger svg {
    color: #c0392b;
}

button.dropdown-danger:hover {
    background: #fbecea;
    color: #c0392b;
}

button.dropdown-danger:hover svg {
    color: #c0392b;
}

.dropdown-logout {
    color: #c0392b;
}

.dropdown-logout svg {
    color: #c0392b;
}

button.dropdown-logout:hover {
    background: #fbecea;
    color: #c0392b;
}

button.dropdown-logout:hover svg {
    color: #c0392b;
}

.avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--accent-gradient);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
}

.avatar svg,
.dropdown-avatar svg {
    width: 20px;
    height: 20px;
    color: #ffffff;
}

.profile-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.profile-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

.profile-role {
    font-size: 12px;
    color: #8a8a87;
}

.page-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 18px 40px 40px;
    overflow-y: auto;
    /* Scrollbar ausblenden, Scrollen bleibt möglich */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge (alt) */
}

.page-body::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none; /* Chrome, Safari, Edge */
}

.page-head {
    display: flex;
    flex-direction: column;
    gap: 22px;
    border-bottom: 1px solid rgba(26, 26, 26, 0.08);
}

.page-head.no-tabs {
    border-bottom: none;
    gap: 0;
}

.page-head-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.page-action-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 34px;
    margin-top: 18px;
    padding: 0 15px;
    border: none;
    border-radius: 10px;
    background: var(--accent-gradient);
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: normal;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--accent-shadow);
    transition: filter 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.page-action-btn svg {
    display: block;
    width: 16px;
    height: 16px;
}

/* Gleicht die untere Schriftmetrik aus, damit die Beschriftung optisch mittig sitzt */
.page-action-btn span {
    display: inline-block;
    transform: translateY(-1px);
}

.page-action-btn .page-action-label-short {
    display: none;
}

.page-action-btn:hover {
    filter: brightness(1.07);
    box-shadow: 0 6px 16px var(--accent-shadow);
}

.page-action-btn:active {
    transform: scale(0.98);
}

.page-action-btn[hidden] {
    display: none;
}

.page-heading {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-heading-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--accent-gradient);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 22px var(--accent-shadow);
}

.page-heading-icon svg {
    width: 26px;
    height: 26px;
}

.page-heading-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.page-eyebrow {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #8a8a87;
}

.page-title {
    margin: 0;
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: #1a1a1a;
}

.page-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* Platz neben den Unter-Tabs, nur auf Mobile sichtbar */
.page-tabs-extra {
    display: none;
}

.page-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: #5c5c59;
    cursor: pointer;
    transition: color 0.15s ease;
}

.page-tab svg {
    width: 17px;
    height: 17px;
}

.page-tab:hover {
    color: #1a1a1a;
}

.page-tab.active {
    color: var(--accent-solid);
}

.page-tab::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: -1px;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.page-tab.active::after {
    transform: scaleX(1);
}

/* Erster Tab bündig linksbündig mit Titel/Rand oben */
.page-tab:first-child {
    padding-left: 0;
}

.page-tab:first-child::after {
    left: 0;
}

.page-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding-top: 32px;
    color: #b4b4b0;
    font-size: 15px;
    font-weight: 500;
}

/* ------------------------------------------------------------------ */
/*  Dark Mode – nur der weiße Arbeitsbereich wird dunkler             */
/*  (heller als die Sidebar #1a1a1a).                                 */
/* ------------------------------------------------------------------ */
body.dark .content {
    background: #1e1e1e;
}

body.dark .topbar {
    background: rgba(30, 30, 30, 0.82);
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

body.dark .topbar-search-input {
    background: #242424;
    border-color: rgba(255, 255, 255, 0.07);
    color: #e9e9ec;
}

body.dark .topbar-search-input::placeholder {
    color: #8b8b93;
}

body.dark .topbar-search-icon {
    color: #8b8b93;
}

body.dark .topbar-icon-btn,
body.dark .theme-toggle,
body.dark .profile {
    background: #242424;
    border-color: rgba(255, 255, 255, 0.07);
    color: #e9e9ec;
}

body.dark .topbar-icon-btn:hover,
body.dark .theme-toggle:hover {
    background: #2e2e2e;
    border-color: rgba(255, 255, 255, 0.13);
}

body.dark .profile-menu.logged-in .profile:hover {
    background: #2e2e2e;
    border-color: rgba(255, 255, 255, 0.13);
}

body.dark .profile-menu:not(.logged-in) .avatar,
body.dark .profile-menu:not(.logged-in) .avatar svg {
    color: #e9e9ec;
}

body.dark .profile-menu:not(.logged-in) .profile:hover {
    background: #2e2e2e;
    border-color: rgba(255, 255, 255, 0.13);
}

body.dark .page-eyebrow {
    color: #9a9aa2;
}

body.dark .page-title {
    color: #f2f2f4;
}

body.dark .page-head {
    border-bottom-color: rgba(255, 255, 255, 0.09);
}

body.dark .page-tab {
    color: #9a9aa2;
}

body.dark .page-tab:hover {
    color: #f2f2f4;
}

body.dark .page-content {
    color: #8b8b93;
}

body.dark .profile-name {
    color: #f2f2f4;
}

body.dark .profile-role {
    color: #9a9aa2;
}

body.dark .profile-dropdown-card {
    background: #1f1f1f;
    border-color: rgba(255, 255, 255, 0.07);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.6);
}

body.dark .dropdown-header {
    border-bottom-color: rgba(255, 255, 255, 0.07);
}

body.dark .dropdown-name {
    color: #f2f2f4;
}

body.dark .dropdown-item {
    color: #e2e2e6;
}

body.dark .dropdown-item svg {
    color: var(--accent-solid);
}

body.dark button.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #e2e2e6;
}

body.dark button.dropdown-danger:hover,
body.dark button.dropdown-logout:hover {
    background: rgba(192, 57, 43, 0.16);
    color: #f0857a;
}

body.dark button.dropdown-danger:hover svg,
body.dark button.dropdown-logout:hover svg {
    color: #f0857a;
}

body.dark .dropdown-plan-value {
    background: rgba(255, 255, 255, 0.08);
    color: #c8c8d0;
}

/* ------------------------------------------------------------------ */
/*  Burger-Menü / Sidebar-Toggle (Desktop: versteckt)                 */
/* ------------------------------------------------------------------ */
.sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    margin-right: 12px;
    border: 1px solid #e2e2df;
    border-radius: 12px;
    background: #ffffff;
    color: #1a1a1a;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.sidebar-toggle:hover {
    background: #f0f0ee;
    border-color: #d5d5d2;
}

.sidebar-toggle svg {
    width: 22px;
    height: 22px;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 40;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

body.dark .sidebar-toggle {
    background: #242424;
    border-color: rgba(255, 255, 255, 0.07);
    color: #e9e9ec;
}

body.dark .sidebar-toggle:hover {
    background: #2e2e2e;
    border-color: rgba(255, 255, 255, 0.13);
}

/* ------------------------------------------------------------------ */
/*  Mobile (<=820px): Sidebar wird per Burger-Menü ein-/ausgeblendet   */
/* ------------------------------------------------------------------ */
@media (max-width: 820px) {
    .sidebar-toggle {
        display: flex;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 260px;
        z-index: 50;
        transform: translate3d(-100%, 0, 0);
        transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.32s ease;
        will-change: transform;
        backface-visibility: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    body.sidebar-open .sidebar {
        transform: translate3d(0, 0, 0);
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.4);
    }

    /* Immer im Layout, damit die Abdunklung weich ein- und ausblendet */
    .sidebar-backdrop {
        display: block;
    }

    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition: opacity 0.3s ease, visibility 0s;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .content {
        border-radius: 0;
        width: 100%;
    }

    .topbar {
        padding: 12px 16px;
        background: #1a1a1a;
        border-bottom-color: rgba(255, 255, 255, 0.08);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    body.dark .topbar {
        background: #1a1a1a;
        border-bottom-color: rgba(255, 255, 255, 0.08);
    }

    body.dark .topbar .sidebar-toggle {
        background: transparent;
        border-color: transparent;
    }

    body.dark .topbar .sidebar-toggle:hover {
        background: transparent;
        border-color: transparent;
    }

    .topbar-search,
    #langMenu {
        display: none;
    }

    #notificationBtn {
        width: 40px;
        height: 40px;
        border-radius: 11px;
        background: #242424;
        border-color: rgba(255, 255, 255, 0.1);
        color: #f2f2f4;
    }

    #notificationBtn:hover {
        background: #2e2e2e;
        border-color: rgba(255, 255, 255, 0.18);
    }

    #notificationBtn svg {
        width: 18px;
        height: 18px;
    }

    .dropdown-lang {
        display: flex;
    }

    .topbar-left {
        flex: 0 0 auto;
        gap: 4px;
    }

    .topbar {
        height: 64px;
        padding: 8px 14px;
    }

    .topbar-logo {
        display: block;
        height: 18px;
        width: auto;
        margin-left: -15px;
    }

    .topbar-right {
        gap: 8px;
    }

    .theme-toggle {
        width: 40px;
        height: 40px;
        border-radius: 11px;
    }

    .theme-toggle svg {
        width: 18px;
        height: 18px;
    }

    /* Nur das Profilbild zeigen (wie in Standard-Apps) – Name/Rolle ausblenden */
    .profile {
        gap: 0;
        padding: 0;
        width: 40px;
        height: 40px;
        justify-content: center;
        border-radius: 50%;
    }

    .profile .avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        font-size: 13px;
    }

    .profile-info {
        display: none;
    }

    .sidebar-toggle,
    .theme-toggle,
    .profile {
        background: #242424;
        border-color: rgba(255, 255, 255, 0.1);
        color: #f2f2f4;
    }

    .topbar .sidebar-toggle {
        width: 44px;
        height: 44px;
        background: transparent;
        border-color: transparent;
        margin-left: -8px;
    }

    .topbar .sidebar-toggle svg {
        width: 26px;
        height: 26px;
    }

    .sidebar-toggle:hover,
    .theme-toggle:hover,
    .profile:hover {
        background: #2e2e2e;
        border-color: rgba(255, 255, 255, 0.18);
    }

    .topbar .sidebar-toggle:hover {
        background: transparent;
        border-color: transparent;
    }

    .profile-name {
        color: #f2f2f4;
    }

    .profile-role {
        color: #a4a4aa;
    }

    /* Überschrift ganz oben, Aktion schwebt stattdessen unten mittig */
    .page-body {
        padding: 14px 20px 24px;
    }

    .page-head {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 10px;
        row-gap: 14px;
        border-bottom: none;
    }

    .page-head-top {
        grid-column: 1 / -1;
        align-items: center;
    }

    .page-tabs-extra {
        display: block;
        align-self: center;
    }

    .page-tabs-extra:empty {
        display: none;
    }

    .page-heading {
        gap: 12px;
    }

    .page-heading-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        box-shadow: 0 6px 14px var(--accent-shadow);
    }

    .page-heading-icon svg {
        width: 20px;
        height: 20px;
    }

    .page-eyebrow {
        font-size: 11.5px;
        letter-spacing: 0.02em;
    }

    .page-title {
        font-size: 24px;
        letter-spacing: -0.02em;
    }

    /* Unterseiten als kompakte Pillen statt Unterstrich-Tabs */
    .page-tabs {
        gap: 8px;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .page-tabs::-webkit-scrollbar {
        display: none;
    }

    .page-tab {
        flex-shrink: 0;
        gap: 6px;
        height: 34px;
        padding: 0 14px;
        border-radius: 999px;
        background: rgba(26, 26, 26, 0.05);
        font-size: 13px;
        font-weight: 600;
    }

    .page-tab:first-child {
        padding-left: 14px;
    }

    .page-tab svg {
        width: 15px;
        height: 15px;
    }

    .page-tab.active {
        background: var(--accent-gradient);
        color: #ffffff;
    }

    .page-tab::after,
    .page-tab:first-child::after {
        display: none;
    }

    body.dark .page-tab {
        background: rgba(255, 255, 255, 0.07);
    }

    body.dark .page-tab.active {
        background: var(--accent-gradient);
        color: #ffffff;
    }

    .page-content {
        padding-top: 22px;
    }

    .page-action-btn {
        position: fixed;
        left: 50%;
        bottom: calc(22px + env(safe-area-inset-bottom));
        z-index: 40;
        height: 48px;
        margin-top: 0;
        padding: 0 26px;
        border-radius: 999px;
        font-size: 15px;
        font-weight: 600;
        transform: translateX(-50%);
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
    }

    .page-action-btn:active {
        transform: translateX(-50%) scale(0.97);
    }

    .page-action-btn svg {
        width: 18px;
        height: 18px;
    }

    .page-action-btn .page-action-label {
        display: none;
    }

    .page-action-btn .page-action-label-short {
        display: inline-block;
    }
}

@media (max-width: 560px) {
    .topbar-search {
        max-width: none;
    }

    .topbar-right {
        gap: 8px;
    }
}

body.dark .dropdown-divider {
    background: rgba(255, 255, 255, 0.08);
}

.pwa-overlay {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(20, 20, 20, 0.42);
    backdrop-filter: blur(3px);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.pwa-overlay.open {
    display: flex;
    animation: pwaFade 0.2s ease;
}

@keyframes pwaFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.pwa-modal {
    position: relative;
    width: min(100%, 420px);
    box-sizing: border-box;
    padding: 46px 40px 34px;
    border-radius: 28px;
    background: #ffffff;
    color: #1a1a1a;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    animation: pwaPop 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pwaPop {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.pwa-close {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 10px;
    background: #f2f2f0;
    color: #8a8a87;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.pwa-close:hover {
    background: #e6e6e3;
    color: #1a1a1a;
}

.pwa-close svg {
    width: 18px;
    height: 18px;
}

.pwa-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    border-radius: 22px;
    background: var(--accent-gradient);
    color: #ffffff;
    box-shadow: 0 12px 26px var(--accent-shadow);
}

.pwa-icon svg {
    width: 38px;
    height: 38px;
}

.pwa-modal h2 {
    margin: 0 0 10px;
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: #1a1a1a;
}

.pwa-modal p {
    margin: 0 auto 24px;
    max-width: 310px;
    color: #8a8a87;
    font-size: 14px;
    line-height: 1.55;
}

.pwa-modal .pwa-message {
    display: block;
    margin: -10px auto 20px;
    max-width: 310px;
    color: #b45309;
    font-size: 13px;
    line-height: 1.45;
}

.pwa-actions {
    display: flex;
    gap: 10px;
}

.pwa-actions button {
    flex: 1;
    height: 52px;
    border-radius: 14px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.pwa-actions button:active {
    transform: scale(0.99);
}

.pwa-cancel {
    border: 1px solid #e2e2df;
    background: #ffffff;
    color: #686864;
}

.pwa-install {
    border: none;
    background: var(--accent-gradient);
    color: #ffffff;
    box-shadow: 0 10px 26px var(--accent-shadow);
}

.pwa-install:hover:not(:disabled) {
    filter: brightness(1.08);
}

.pwa-install:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

body.dark .pwa-modal {
    background: #212121;
    color: #f2f2f4;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
}

body.dark .pwa-modal h2 {
    color: #f2f2f4;
}

body.dark .pwa-close {
    background: #2b2b2b;
    color: #b5b5bb;
}

body.dark .pwa-modal p {
    color: #a4a4aa;
}

body.dark .pwa-cancel {
    border-color: rgba(255, 255, 255, 0.12);
    background: #2b2b2b;
    color: #d7d7dc;
}

@media (max-width: 560px) {
    .pwa-modal {
        padding: 38px 22px 24px;
    }

    .pwa-actions {
        flex-direction: column-reverse;
    }
}

/* Offline-/Sync-Statusleiste (offline.js) – kleines Fenster mittig über dem Header */
.offline-banner {
    position: fixed;
    top: 14px;
    left: max(50%, 920px); /* Bildschirmmitte; auf schmaleren Desktops rechts neben der Suche */
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 12px;
    width: max-content;
    max-width: calc(100vw - 24px);
    padding: 8px 18px 8px 8px;
    border: 1px solid var(--profile-border);
    border-radius: 14px;
    background: var(--profile-white);
    color: var(--profile-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.3;
    box-shadow: 0 12px 32px rgba(16, 24, 40, 0.14), 0 2px 6px rgba(16, 24, 40, 0.06);
    transform: translateX(-50%);
    pointer-events: none;
    animation: offlineBannerIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.offline-banner[hidden] {
    display: none;
}

@keyframes offlineBannerIn {
    from { opacity: 0; transform: translate(-50%, -10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.offline-banner-ic {
    --tone: var(--profile-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--tone) 14%, transparent);
    color: var(--tone);
}

.offline-banner-ic svg {
    width: 18px;
    height: 18px;
}

.offline-banner.is-offline .offline-banner-ic { --tone: #d97706; }
.offline-banner.is-syncing .offline-banner-ic { --tone: var(--accent-solid); }
.offline-banner.is-done .offline-banner-ic { --tone: var(--accent-solid); }
.offline-banner.is-error .offline-banner-ic { --tone: #e5484d; }

.offline-banner.is-syncing .offline-banner-ic svg {
    animation: offlineBannerSpin 1.1s linear infinite;
}

@keyframes offlineBannerSpin {
    to { transform: rotate(360deg); }
}

.offline-banner-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.offline-banner-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--profile-text);
}

.offline-banner-text {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--profile-text-muted);
}

body.dark .offline-banner {
    background: #242424;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

body.dark .offline-banner.is-offline .offline-banner-ic { --tone: #f59e0b; }

.reduce-motion .offline-banner,
.reduce-motion .offline-banner.is-syncing .offline-banner-ic svg {
    animation: none;
}

@media (max-width: 820px) {
    .offline-banner {
        top: 10px;
        left: 50%;
        gap: 10px;
        padding: 6px 14px 6px 6px;
    }

    .offline-banner-ic {
        width: 32px;
        height: 32px;
    }

    .offline-banner-text {
        font-size: 12px;
    }
}

/* Kurze Hinweis-Meldung (window.polaruxToast) – schwebende Karte oben mittig */
.px-toast {
    position: fixed;
    top: 18px;
    left: 50%;
    z-index: 2500;
    display: flex;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
    max-width: min(460px, calc(100% - 32px));
    padding: 10px 18px 10px 10px;
    border: 1px solid #e6e6e3;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #1a1a1a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -0.005em;
    box-shadow: 0 18px 40px rgba(16, 24, 40, 0.16), 0 2px 6px rgba(16, 24, 40, 0.06);
    opacity: 0;
    transform: translate(-50%, -14px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.px-toast.is-show {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

.px-toast-ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    color: #ffffff;
}

.px-toast-ic svg {
    width: 16px;
    height: 16px;
}

.px-toast.is-success .px-toast-ic {
    background: var(--accent-solid);
    box-shadow: 0 6px 14px rgba(21, 144, 121, 0.35);
}

.px-toast.is-error .px-toast-ic {
    background: #e5484d;
    box-shadow: 0 6px 14px rgba(229, 72, 77, 0.32);
}

body.dark .px-toast {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(32, 32, 32, 0.96);
    color: #f2f2f4;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
}

@media (max-width: 640px) {
    .px-toast {
        top: 12px;
        width: calc(100% - 24px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .px-toast {
        transition: opacity 0.2s ease;
        transform: translate(-50%, 0);
    }
}

/* Landingpage: siehe landing.css */
