/* ── Reset ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:       #111c27;
    --surface:  #1a2634;
    --border:   #2e4058;
    --gold:     #e8a020;
    --gold-dim: rgba(232, 160, 32, 0.12);
    --text:     #e2e8f0;
    --muted:    #718096;
    --error:    #fc5c65;
    --on-gold:  #14202c;
    --radius:   10px;
}

/* ── Light Theme ────────────────────────── */
:root[data-theme="light"] {
    --bg:       #eef1f5;
    --surface:  #ffffff;
    --border:   #dde3ea;
    --gold:     #b57e14;
    --gold-dim: rgba(181, 126, 20, 0.12);
    --text:     #1b2733;
    --muted:    #69748a;
    --error:    #e03e4a;
    --on-gold:  #ffffff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ── LOGIN ──────────────────────────────── */
body.page-login {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 40px 36px;
    width: 100%;
    max-width: 360px;
    text-align: center;
}

.avatar {
    width: 54px;
    height: 54px;
    background: var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--on-gold);
    margin: 0 auto 14px;
}

.site-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text);
    margin-bottom: 28px;
    text-transform: lowercase;
}

.error-msg {
    background: rgba(252, 92, 101, 0.12);
    border: 1px solid rgba(252, 92, 101, 0.35);
    color: var(--error);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 18px;
    text-align: left;
}

form label {
    display: block;
    text-align: left;
    font-size: 11px;
    letter-spacing: 0.5px;
    color: var(--muted);
    margin-bottom: 5px;
    margin-top: 16px;
    text-transform: uppercase;
}

form input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 11px 14px;
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: border-color 0.18s;
}

form input:focus {
    border-color: var(--gold);
}

form button {
    width: 100%;
    margin-top: 24px;
    background: var(--gold);
    color: var(--on-gold);
    border: none;
    border-radius: 8px;
    padding: 13px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.18s;
    letter-spacing: 0.3px;
}

form button:hover { opacity: 0.87; }

/* ── DASHBOARD ──────────────────────────── */
body.page-dashboard {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 28px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-brand {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--gold);
    text-decoration: none;
    text-transform: lowercase;
}

.header-user {
    font-size: 13px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-user a {
    color: var(--gold);
    text-decoration: none;
    font-size: 13px;
}

.user-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--on-gold);
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.header-user a:hover { text-decoration: underline; }

.dashboard-main {
    flex: 1;
    padding: 40px 32px;
    width: 100%;
}

.dashboard-heading {
    font-size: 13px;
    letter-spacing: 2px;
    color: var(--muted);
    text-transform: uppercase;
    margin-bottom: 20px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.project-card {
    display: flex;
    align-items: center;
    gap: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--gold);
    border-radius: var(--radius);
    padding: 22px 20px;
    text-decoration: none;
    color: var(--text);
    transition: background 0.18s, transform 0.18s;
}

.project-card:hover {
    background: var(--gold-dim);
    transform: translateY(-1px);
}

.card-icon { font-size: 30px; flex-shrink: 0; }

.card-body h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.card-body p {
    font-size: 13px;
    color: var(--muted);
}

.card-arrow {
    margin-left: auto;
    color: var(--gold);
    font-size: 20px;
    opacity: 0.65;
    flex-shrink: 0;
}

/* ── Expander (Sub-Items) ───────────────── */
.project-expander {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0;
    cursor: pointer;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 18px;
    width: 100%;
    padding: 18px 20px;
    cursor: pointer;
    transition: background 0.18s;
}

.project-expander:hover .card-header {
    background: var(--gold-dim);
}

.card-toggle {
    margin-left: auto;
    color: var(--gold);
    font-size: 14px;
    opacity: 0.65;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.project-expander.expanded .card-toggle {
    transform: rotate(180deg);
}

.card-sub-items {
    display: none;
    width: 100%;
    flex-direction: column;
    border-top: 1px solid rgba(46, 64, 88, 0.4);
    background: rgba(232, 160, 32, 0.04);
}

.project-expander.expanded .card-sub-items {
    display: flex;
}

.sub-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px 8px 40px;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid rgba(46, 64, 88, 0.35);
    transition: background 0.15s;
}

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

.sub-item:hover {
    background: rgba(232, 160, 32, 0.08);
}

.sub-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.sub-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.sub-name {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.sub-desc {
    font-size: 10px;
    color: var(--muted);
    line-height: 1.2;
}

.sub-arrow {
    color: var(--gold);
    font-size: 13px;
    opacity: 0.4;
    flex-shrink: 0;
}

/* ── Theme-Umschalter ───────────────────── */
body { transition: background 0.2s ease, color 0.2s ease; }

.theme-toggle {
    /* Portalweit: immer oben rechts, fest im Blickfeld (07.09.2026).
       Vorher stand der Knopf da, wo er zufaellig im Markup lag - auf
       /versicherungen/ 5075 px, auf /magnesium/ 7618 px unter dem Seitenkopf.
       Seiten mit eigener .theme-toggle-Regel behalten ihre Werte. */
    position: fixed;
    top: 16px;
    right: 18px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s;
}

.theme-toggle:hover { border-color: var(--gold); background: var(--gold-dim); }

.theme-toggle.floating {
    position: fixed;
    top: 16px;
    right: 18px;
    z-index: 20;
    background: var(--surface);
}
