/* ==========================================================================
   App-Gerüst: Tab-Leiste (Smartphone) bzw. Seitenleiste (ab Tablet-Querformat)
   ========================================================================== */
.app-main {
    min-height: 100dvh;
    padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 24px);
}

/* ---------- Tab-Leiste ---------- */
.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding-bottom: var(--safe-bottom);
    background: rgba(0, 0, 0, 0.88);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    backdrop-filter: blur(20px) saturate(1.4);
    border-top: 1px solid var(--border);
}

.tabbar__item {
    height: var(--tabbar-h);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-3);
    transition: color 0.2s ease;
}
.tabbar__item .icon { width: 1.4rem; height: 1.4rem; }
.tabbar__item.is-active { color: var(--amber-400); }
.tabbar__item.is-active .icon { filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.55)); }

/* ---------- Seitenleiste ---------- */
.sidebar { display: none; }

@media (min-width: 960px) {
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 40;
        width: var(--sidebar-w);
        display: flex;
        flex-direction: column;
        padding: 24px 16px;
        background: rgba(0, 0, 0, 0.7);
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
        border-right: 1px solid var(--border);
    }
    .app-main { margin-left: var(--sidebar-w); padding-bottom: 48px; }
    .tabbar { display: none; }
    .page-header__brand { display: none !important; }
}

.sidebar__brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 28px; }

.brand-mark {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: #000;
    box-shadow: 0 0 0 1px rgba(217, 119, 6, 0.25), 0 10px 20px rgba(0, 0, 0, 0.4);
    transition: box-shadow 0.3s ease;
}
.brand-mark img { width: 32px; height: 32px; object-fit: contain; }
.sidebar__brand:hover .brand-mark { box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.5), 0 0 20px rgba(212, 175, 55, 0.2); }
.brand-name { font-family: var(--font-serif); font-size: 1.3rem; font-weight: 700; line-height: 1.1; }

.sidebar__nav { display: flex; flex-direction: column; gap: 4px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius);
    color: var(--text-2);
    font-weight: 500;
    font-size: 0.9375rem;
    transition: color 0.2s ease, background 0.2s ease;
}
.nav-item:hover { color: var(--amber-400); background: rgba(212, 175, 55, 0.06); }
.nav-item.is-active {
    color: var(--amber-400);
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.16), rgba(212, 175, 55, 0.02));
    box-shadow: inset 2px 0 0 var(--gold);
}

.sidebar__summary {
    margin-top: auto;
    margin-bottom: 16px;
    padding: 16px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(217, 119, 6, 0.3);
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.95), #000);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar__total {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--amber-400), var(--amber-300));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.sidebar__account { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.sidebar__email { padding: 0 12px; font-size: 0.75rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__logout { width: 100%; border: 0; background: none; text-align: left; font: inherit; cursor: pointer; }

.sidebar__footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 8px 0;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-3);
}
.sidebar__footer .icon { width: 0.9rem; height: 0.9rem; color: var(--gold); }

/* ---------- Seitenkopf ---------- */
.page-header {
    position: sticky;
    top: 0;
    z-index: 30;
    padding-top: var(--safe-top);
    background: rgba(0, 0, 0, 0.82);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.page-header__inner {
    max-width: var(--content-w);
    min-height: 64px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header__brand {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: #000;
    box-shadow: 0 0 0 1px rgba(217, 119, 6, 0.25);
}
.page-header__brand img { width: 28px; height: 28px; object-fit: contain; }

.page-header__titles { flex: 1; min-width: 0; }

.page-header__title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-header__sub {
    margin-top: 1px;
    font-size: 0.8125rem;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-header__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ---------- Seiteninhalt ---------- */
.page {
    max-width: var(--content-w);
    margin: 0 auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: fade-up 0.35s ease-out;
}

@media (min-width: 640px) {
    .page-header__inner { padding: 12px 24px; }
    .page { padding: 28px 24px; gap: 24px; }
}

@media (min-width: 960px) {
    .page-header__inner, .page { padding-left: 32px; padding-right: 32px; }
}

.app-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 0 8px;
    text-align: center;
}
.app-footer img { width: 40px; height: 40px; opacity: 0.85; }
.app-footer span { font-family: var(--font-serif); font-weight: 700; font-size: 1.05rem; }
.app-footer small { color: var(--text-3); font-size: 0.75rem; }

/* ==========================================================================
   Anmeldeseite (ohne Sitzung)
   ========================================================================== */
.auth-screen {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: calc(32px + var(--safe-top)) 16px calc(24px + var(--safe-bottom));
    animation: fade-in 0.3s ease;
}
.auth-card {
    width: min(420px, 100%);
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 28px 24px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(13, 16, 23, 0.92), rgba(7, 8, 12, 0.92));
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 40px rgba(212, 175, 55, 0.06);
}
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.auth-brand img { filter: drop-shadow(0 0 24px rgba(212, 175, 55, 0.35)); }
.auth-title { font-family: var(--font-serif); font-size: 1.75rem; }
.auth-subtitle { color: var(--text-2); font-size: 0.9375rem; }
.auth-submit { width: 100%; margin-top: 4px; }
.auth-links { display: flex; gap: 20px; font-size: 0.8125rem; }
.auth-links a { color: var(--text-3); }
.auth-links a:hover { color: var(--amber-400); }
@media (min-width: 640px) { .auth-card { padding: 36px 32px; } }

/* Sperrseite nach Ablauf der Testphase */
.paywall__card { width: min(760px, 100%); }
.paywall .auth-title { color: var(--text); }
.paywall__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
