* {
    box-sizing: border-box;
}

:root {
    --bg: #071018;
    --bg-soft: #0c1824;
    --panel: rgba(13, 25, 36, 0.92);
    --panel-border: rgba(116, 202, 255, 0.16);
    --text: #e6eef7;
    --muted: #8ea4b8;
    --accent: #2d8cff;
    --accent-soft: rgba(45, 140, 255, 0.16);
    --green: #38d996;
    --danger: #ff5d73;
    --code: #00c8ff;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 0%, rgba(30, 120, 160, 0.15), transparent 35%),
        radial-gradient(circle at 90% 20%, rgba(40, 200, 150, 0.08), transparent 30%),
        var(--bg);
    color: var(--text);
    font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
}

.hero {
    height: 255px;
    background:
        linear-gradient(90deg, rgba(4, 9, 14, 0.88), rgba(4, 9, 14, 0.2), rgba(4, 9, 14, 0.92)),
        url("header.png") center/cover no-repeat;
    border-bottom: 1px solid var(--panel-border);
}

.hero-overlay {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 56px;
    background: linear-gradient(180deg, transparent, rgba(7, 16, 24, 0.2));
}

.hero-content {
    max-width: 720px;
}

.hero-kicker {
    color: #6bdcff;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    font-size: 13px;
    margin-bottom: 14px;
}

.hero h1 {
    margin: 0;
    font-size: 52px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.hero p {
    color: var(--muted);
    font-size: 17px;
    margin: 14px 0 0;
}

.app-shell {
    padding: 34px 48px 28px;
}

.grid-layout {
    display: grid;
    grid-template-columns: minmax(360px, 0.95fr) minmax(540px, 1.3fr);
    gap: 28px;
    align-items: stretch;
}

.panel,
.alert-card,
.login-card {
    background: linear-gradient(180deg, rgba(17, 32, 46, 0.95), rgba(9, 18, 27, 0.95));
    border: 1px solid var(--panel-border);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}

.panel {
    padding: 26px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 22px;
}

.panel-header h2 {
    margin: 0;
    text-transform: uppercase;
    font-size: 16px;
    letter-spacing: 0.14em;
}

.panel-header p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.badge {
    border: 1px solid rgba(107, 220, 255, 0.22);
    background: rgba(70, 160, 220, 0.09);
    color: #a7dfff;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    white-space: nowrap;
}

.badge.muted {
    color: var(--muted);
}

.module-list {
    border: 1px solid rgba(116, 202, 255, 0.14);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(3, 10, 16, 0.35);
}

.module-row {
    display: grid;
    grid-template-columns: 24px 1fr 34px;
    align-items: center;
    min-height: 35px;
    padding: 0 12px;
    color: #d9e8f5;
    border-bottom: 1px solid rgba(255, 255, 255, 0.035);
    cursor: pointer;
}

.module-row:nth-child(even) {
    background: rgba(255, 255, 255, 0.025);
}

.module-row:hover {
    background: rgba(45, 140, 255, 0.08);
}

.module-row.selected {
    background: rgba(45, 140, 255, 0.13);
}

.module-row input {
    accent-color: var(--accent);
}

.module-link {
    appearance: none;
    width: 100%;
    padding: 8px 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.module-link:hover {
    color: #ffffff;
}

.order-number {
    color: var(--green);
    font-weight: 700;
    text-align: right;
}

.actions {
    display: flex;
    gap: 12px;
    margin-top: 22px;
    flex-wrap: wrap;
}

button {
    font: inherit;
}

.primary-button,
.secondary-button {
    border-radius: 8px;
    padding: 13px 18px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.primary-button {
    background: linear-gradient(135deg, #1f6feb, #164a8d);
    color: white;
    border: 1px solid rgba(117, 190, 255, 0.34);
}

.secondary-button {
    background: rgba(255, 255, 255, 0.035);
    color: #d8e6f2;
    border: 1px solid rgba(150, 190, 220, 0.22);
}

.primary-button:hover,
.secondary-button:hover {
    transform: translateY(-1px);
    border-color: rgba(130, 220, 255, 0.55);
}

.output-panel textarea {
    width: 100%;
    height: 540px;
    resize: vertical;
    border-radius: 10px;
    border: 1px solid rgba(116, 202, 255, 0.18);
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.35)),
        #020812;
    color: var(--code);
    padding: 20px;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.45;
    outline: none;
    box-shadow: inset 0 0 35px rgba(0, 190, 255, 0.04);
}

.footer {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 22px;
    align-items: center;
    border-top: 1px solid var(--panel-border);
    padding: 18px 48px 24px;
    color: var(--muted);
    font-size: 13px;
}

.footer a {
    color: #c8d8e8;
    text-decoration: none;
}

.footer a:hover {
    color: white;
}

.version {
    text-align: right;
}

.alert-card {
    padding: 28px;
    border-color: rgba(255, 93, 115, 0.32);
}

.alert-card h2 {
    color: var(--danger);
    margin-top: 0;
}

.login-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    background:
        linear-gradient(90deg, rgba(4, 9, 14, 0.9), rgba(4, 9, 14, 0.55)),
        url("header.png") center/cover no-repeat,
        var(--bg);
}

.login-shell {
    width: min(440px, calc(100vw - 32px));
}

.login-card {
    padding: 34px;
}

.login-brand {
    margin-bottom: 28px;
}

.brand-kicker {
    color: #6bdcff;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    font-size: 12px;
    margin-bottom: 10px;
}

.login-brand h1 {
    margin: 0;
    font-size: 30px;
}

.login-brand p {
    margin: 8px 0 0;
    color: var(--muted);
}

.login-form {
    display: grid;
    gap: 10px;
}

.login-form label {
    color: #b7c9d8;
    font-size: 13px;
}

.login-form input {
    width: 100%;
    padding: 13px 14px;
    border-radius: 8px;
    border: 1px solid rgba(116, 202, 255, 0.18);
    background: rgba(2, 8, 18, 0.82);
    color: white;
    outline: none;
}

.login-form input:focus {
    border-color: rgba(107, 220, 255, 0.55);
}

.full-width {
    width: 100%;
    margin-top: 12px;
}

.error-box {
    background: rgba(255, 93, 115, 0.1);
    border: 1px solid rgba(255, 93, 115, 0.25);
    color: #ffb7c2;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 18px;
}

@media (max-width: 1050px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }

    .hero {
        height: 220px;
    }

    .hero h1 {
        font-size: 36px;
    }

    .app-shell {
        padding: 24px;
    }

    .footer {
        grid-template-columns: 1fr;
        padding: 18px 24px 24px;
    }

    .version {
        text-align: left;
    }
}

/* Hauptnavigation */
.top-nav {
    position: relative;
    z-index: 10;
    border-bottom: 1px solid var(--panel-border);
    background: rgba(6, 14, 22, 0.96);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.top-nav-inner {
    display: flex;
    gap: 8px;
    padding: 0 48px;
}

.top-nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 54px;
    padding: 0 18px;
    color: var(--muted);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 12px;
    font-weight: 700;
}

.top-nav-link:hover {
    color: #ffffff;
    background: rgba(45, 140, 255, 0.06);
}

.top-nav-link.active {
    color: #ffffff;
}

.top-nav-link.active::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 0;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 12px rgba(45, 140, 255, 0.75);
}

/* Motivationstabelle */
.motivation-shell {
    display: grid;
    gap: 28px;
}

.motivation-top-grid {
    display: grid;
    grid-template-columns: minmax(360px, 0.8fr) minmax(500px, 1.2fr);
    gap: 28px;
}

.motivation-settings-form {
    display: grid;
    gap: 12px;
}

.motivation-settings-form label {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) minmax(180px, 1fr);
    align-items: center;
    gap: 16px;
    color: #c8d8e8;
    font-size: 13px;
}

.motivation-settings-form input,
.motivation-settings-form select,
.balance-input {
    width: 100%;
    border: 1px solid rgba(116, 202, 255, 0.18);
    border-radius: 7px;
    background: rgba(2, 8, 18, 0.76);
    color: var(--text);
    outline: none;
}

.motivation-settings-form input,
.motivation-settings-form select {
    padding: 11px 12px;
}

.motivation-settings-form input:focus,
.motivation-settings-form select:focus,
.balance-input:focus {
    border-color: rgba(107, 220, 255, 0.58);
    box-shadow: 0 0 0 2px rgba(45, 140, 255, 0.08);
}

.motivation-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.summary-card {
    min-height: 125px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(17, 32, 46, 0.95), rgba(9, 18, 27, 0.95));
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.26);
}

.summary-card span {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
}

.summary-card strong {
    color: #ffffff;
    font-size: clamp(20px, 2vw, 29px);
    font-weight: 600;
}

.motivation-chart-panel canvas {
    width: 100%;
    height: 360px;
    display: block;
    border-radius: 10px;
    border: 1px solid rgba(116, 202, 255, 0.14);
    background: #06101a;
}

.motivation-table-panel {
    min-width: 0;
}

.motivation-table-wrap {
    max-height: 720px;
    overflow: auto;
    border: 1px solid rgba(116, 202, 255, 0.14);
    border-radius: 10px;
    background: rgba(3, 10, 16, 0.35);
}

.motivation-table {
    width: 100%;
    min-width: 1120px;
    border-collapse: separate;
    border-spacing: 0;
    font-variant-numeric: tabular-nums;
}

.motivation-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 12px 11px;
    background: #d8a800;
    color: #111820;
    text-align: right;
    font-size: 12px;
    font-weight: 800;
    border-bottom: 1px solid #2b2b2b;
    white-space: nowrap;
}

.motivation-table th:first-child,
.motivation-table th:nth-child(2) {
    text-align: left;
}

.motivation-table td {
    height: 36px;
    padding: 5px 11px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.035);
    text-align: right;
    font-size: 12px;
    white-space: nowrap;
}

.motivation-table tbody tr:hover td {
    filter: brightness(1.08);
}

.motivation-table td:nth-child(1),
.motivation-table td:nth-child(5),
.motivation-table td:nth-child(6),
.motivation-table td:nth-child(7),
.motivation-table td:nth-child(8) {
    background: rgba(255, 232, 161, 0.09);
}

.motivation-table td:nth-child(2),
.motivation-table td:nth-child(3),
.motivation-table td:nth-child(4) {
    background: rgba(173, 196, 232, 0.11);
}

.motivation-table .month-cell,
.motivation-table td:nth-child(2) {
    text-align: left;
}

.month-cell {
    color: #f2d88e;
    font-weight: 600;
}

.plan-cell {
    color: #dbeaff;
}

.actual-cell {
    padding: 3px 6px !important;
}

.balance-input {
    min-width: 126px;
    padding: 7px 9px;
    text-align: right;
    font-size: 12px;
}

.metric.positive {
    color: var(--green);
    font-weight: 700;
}

.metric.negative {
    color: var(--danger);
    font-weight: 700;
}

.save-notice {
    width: fit-content;
    padding: 10px 14px;
    border: 1px solid rgba(56, 217, 150, 0.26);
    border-radius: 8px;
    background: rgba(56, 217, 150, 0.08);
    color: #a9f0cf;
    font-size: 13px;
}

.motivation-alert {
    margin: 0;
}

@media (max-width: 1050px) {
    .top-nav-inner {
        padding: 0 24px;
    }

    .motivation-top-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .top-nav-inner {
        padding: 0 12px;
    }

    .top-nav-link {
        padding: 0 12px;
        font-size: 11px;
    }

    .motivation-settings-form label {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .motivation-summary-grid {
        grid-template-columns: 1fr;
    }
}

/* Modularer Ausbau ab v1.2 */
.top-nav-inner{flex-wrap:wrap}
@media(max-width:640px){.top-nav-inner{gap:0}.top-nav-link{padding-left:9px;padding-right:9px;font-size:10px}}
