:root {
    --bg-main: #0f1117;
    --bg-sidebar: #111827;
    --bg-card: #1a1f2b;
    --bg-card-soft: #202635;
    --bg-hover: #252d3d;

    --text-main: #f3f4f6;
    --text-muted: #9ca3af;

    --accent: #10b981;
    --accent-soft: rgba(16, 185, 129, 0.14);

    --warning: #f59e0b;
    --success: #22c55e;
    --danger: #ef4444;

    --border-color: #2c3444;
    --sidebar-width: 260px;
    --header-height: 82px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
}

body {
    display: flex;
}

/* Linke Navigation bleibt fest */
aside {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    padding: 28px 18px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
}

aside h1 {
    margin: 0 0 42px 0;
    font-size: 26px;
    color: var(--text-main);
}

aside nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-link {
    display: block;
    padding: 13px 15px;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    background: var(--bg-hover);
    color: var(--accent);
    border-left-color: var(--accent);
}

aside footer {
    font-size: 12px;
    color: var(--text-muted);
}

/* Rechter App-Bereich */
main {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header bleibt oben fix innerhalb des Systems */
header {
    height: var(--header-height);
    flex-shrink: 0;
    margin: 24px 24px 0 24px;
    padding: 0 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 20;
}

header h2 {
    margin: 0;
    font-size: 24px;
    color: var(--text-main);
}

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

.user-info {
    font-size: 14px;
    color: var(--text-muted);
}

.user-info strong {
    color: var(--text-main);
}

/* Nur dieser Bereich scrollt */
.content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 22px 24px 24px 24px;
}

.content::-webkit-scrollbar {
    width: 8px;
}

.content::-webkit-scrollbar-track {
    background: transparent;
}

.content::-webkit-scrollbar-thumb {
    background: #394256;
    border-radius: 999px;
}

.content::-webkit-scrollbar-thumb:hover {
    background: #4b5568;
}

/* Karten */
.card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.card,
.dashboard-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 22px;
    transition: 0.2s ease;
}

.card:hover,
.dashboard-section:hover {
    border-color: rgba(16, 185, 129, 0.45);
    box-shadow: 0 0 24px rgba(16, 185, 129, 0.08);
}

.card.clickable {
    cursor: pointer;
}

.card h3,
.dashboard-section h3 {
    margin: 0 0 12px 0;
    font-size: 17px;
    color: var(--text-main);
}

.card p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.55;
    font-size: 14px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 24px;
    padding: 0 8px;
    margin-left: 6px;
    border-radius: 999px;
    background: var(--accent);
    color: #06130e;
    font-size: 13px;
    font-weight: 700;
}

.badge.warning {
    background: var(--warning);
    color: #111827;
}

.badge.success {
    background: var(--success);
    color: #06130e;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.dashboard-section {
    min-height: 420px;
}

.chart-wrap {
    position: relative;
    width: 100%;
    height: 330px;
}

/* Buttons */
.btn,
.btn-settings,
.btn-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 9px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    border: 1px solid var(--border-color);
    background: var(--bg-card-soft);
    color: var(--text-main);
    cursor: pointer;
    transition: 0.2s ease;
}

.btn:hover,
.btn-settings:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-logout {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.22);
    color: #fff;
}

/* Kalender */
.fc {
    color: var(--text-main);
}

.fc .fc-toolbar-title {
    font-size: 22px;
    color: var(--text-main);
}

.fc .fc-button {
    background: var(--bg-card-soft);
    border-color: var(--border-color);
    color: var(--text-main);
    border-radius: 7px;
    box-shadow: none;
}

.fc .fc-button:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #06130e;
}

.fc .fc-button-primary:not(:disabled).fc-button-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #06130e;
}

.fc .fc-daygrid-day-number,
.fc .fc-col-header-cell-cushion {
    color: var(--text-main);
    text-decoration: none;
}

.fc-theme-standard td,
.fc-theme-standard th,
.fc-theme-standard .fc-scrollgrid {
    border-color: var(--border-color);
}

.fc .fc-daygrid-day.fc-day-today {
    background: var(--accent-soft);
}

.fc .fc-daygrid-day-frame {
    min-height: 78px;
}

/* Chart */
canvas {
    max-width: 100%;
}

/* Responsive */
@media (max-width: 1300px) {
    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    html,
    body {
        height: auto;
        overflow: auto;
    }

    body {
        display: block;
    }

    aside {
        position: relative;
        width: 100%;
        height: auto;
    }

    main {
        margin-left: 0;
        width: 100%;
        height: auto;
        overflow: visible;
    }

    header {
        height: auto;
        margin: 16px;
        padding: 18px;
        flex-direction: column;
        align-items: flex-start;
    }

    .header-right {
        width: 100%;
        flex-wrap: wrap;
    }

    .content {
        overflow: visible;
        padding: 0 16px 16px 16px;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .chart-wrap {
        height: 260px;
    }
}

/* Auth Layout: Login, Registrierung, Passwort vergessen */

body.auth-hero {
    min-height: 100vh;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background:
        radial-gradient(circle at top left, rgba(16, 185, 129, 0.18), transparent 34%),
        radial-gradient(circle at bottom right, rgba(133, 200, 248, 0.12), transparent 36%),
        var(--bg-main);
}

body.auth-hero main,
body.auth-hero .auth-card {
    margin-left: 0;
    width: 100%;
    max-width: 460px;
    height: auto;
    display: block;
}

.auth-card {
    background: rgba(26, 31, 43, 0.96);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    padding: 34px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

.auth-header {
    height: auto;
    margin: 0 0 26px 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    display: block;
}

.auth-brand {
    margin-bottom: 14px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

.auth-title,
.auth-header h1 {
    margin: 0 0 10px 0;
    font-size: 30px;
    line-height: 1.15;
    color: var(--text-main);
}

.auth-sub,
.auth-header p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.55;
}

.auth-grid,
.auth-form {
    display: grid;
    gap: 17px;
}

.auth-label,
.form-group label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.auth-input,
.form-group input,
.form-group select {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: #111827;
    color: var(--text-main);
    font-size: 15px;
    outline: none;
}

.auth-input:focus,
.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.auth-actions,
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 6px;
}

.btn-primary,
.btn-secondary,
.btn-ghost,
.btn.btn-primary,
.btn.btn-secondary {
    min-height: 44px;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary,
.btn.btn-primary {
    background: var(--accent);
    color: #06130e;
}

.btn-primary:hover,
.btn.btn-primary:hover {
    filter: brightness(1.08);
}

.btn-secondary,
.btn-ghost,
.btn.btn-secondary {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover,
.btn-ghost:hover,
.btn.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.auth-error {
    margin-bottom: 18px;
    padding: 13px 14px;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fecaca;
    font-size: 14px;
}

.auth-meta {
    margin: 22px 0 0 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.auth-meta a,
.auth-forgot {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
}

.auth-meta a:hover,
.auth-forgot:hover {
    text-decoration: underline;
}

.auth-forgot-wrap {
    margin-top: -6px;
    text-align: right;
    font-size: 13px;
}

@media (max-width: 640px) {
    .auth-card {
        padding: 26px 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .auth-actions,
    .form-actions {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary,
    .btn-ghost,
    .btn.btn-primary,
    .btn.btn-secondary {
        width: 100%;
    }
}





/************************* Fixex ******************************************/



.finance-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.finance-summary-card {
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
}

.finance-summary-card span {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.finance-summary-card strong {
    display: block;
    font-size: 22px;
    color: var(--text-main);
}

@media (max-width: 760px) {
    .finance-summary {
        grid-template-columns: 1fr;
    }
}


.dashboard-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 18px;
    align-items: stretch;
}

.dashboard-section {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.dashboard-section .chart-wrap {
    flex: 1;
    min-height: 320px;
}

#calendar {
    flex: 1;
    min-height: 320px;
}

/* FullCalendar sauber einpassen */
.fc {
    height: 100% !important;
}

.fc-view-harness {
    min-height: 320px;
}