:root {
    --bg: #171717;
    --panel: rgba(23, 23, 23, 0.78);
    --panel-strong: rgba(14, 18, 27, 0.88);
    --panel-border: rgba(255, 255, 255, 0.13);
    --text: #f3f3f3;
    --muted: #aaa;
    --soft: #777;
    --blue: #6a9cff;
    --mint: #8affc1;
    --yellow: #ffd36a;
    --red: #ff6a8f;
    --green: #8affc1;
    --purple: #b388ff;
    --input: rgba(255, 255, 255, 0.045);
    --shadow: 0 18px 70px rgba(0, 0, 0, 0.38);
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Roboto Mono", Consolas, monospace;
    line-height: 1.45;
    scroll-behavior: smooth;
}

body {
    position: relative;
    overflow-x: hidden;
    cursor: default;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    animation: pageFade 700ms ease;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at center, transparent 44%, rgba(0, 0, 0, 0.50));
    z-index: 0;
}

::selection {
    color: #111;
    background: var(--mint);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #111;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--blue), var(--mint));
    border-radius: 20px;
    border: 2px solid #111;
}

#particles {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.85;
}

.noise {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.login-page,
.dashboard-page,
.footer,
.top-nav {
    position: relative;
    z-index: 1;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5rem 1rem 4rem;
}

.login-shell {
    width: min(460px, 100%);
    opacity: 0;
    animation: fadeUp 850ms ease 120ms forwards;
}

.brand-block {
    text-align: center;
    margin-bottom: 1.7rem;
    user-select: none;
}

.eyebrow {
    margin: 0 0 0.9rem;
    color: var(--soft);
    font-size: 0.82rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.eyebrow.center {
    text-align: center;
}

.eyebrow.mini {
    margin-bottom: 0.35rem;
    font-size: 0.72rem;
}

.brand-title,
.page-title {
    display: inline-block;
    margin: 0;
    line-height: 0.95;
    letter-spacing: -0.075em;
    user-select: none;
    background: linear-gradient(45deg, var(--blue) 0%, var(--mint) 25%, var(--blue) 50%, var(--mint) 75%, var(--blue) 100%);
    background-size: 400% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient 8s ease-in-out infinite alternate, glowPulse 6s ease-in-out infinite, floatY 6s ease-in-out infinite;
}

.brand-title {
    font-size: clamp(2.4rem, 9vw, 4.6rem);
}

.page-title {
    font-size: clamp(3rem, 8vw, 6.4rem);
}

.brand-subtitle,
.subtitle {
    margin: 1rem auto 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.65;
}

.subtitle {
    max-width: 800px;
    margin-left: 0;
}

.glass-card,
.stat-card {
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.glass-card {
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(106, 156, 255, 0.09), rgba(138, 255, 193, 0.045), transparent 55%);
}

.glass-card > * {
    position: relative;
    z-index: 1;
}

.login-card {
    padding: 1.45rem;
}

.badge,
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
    padding: 0.42rem 0.65rem;
    border-radius: 999px;
    user-select: none;
}

.badge {
    margin-bottom: 1rem;
    color: var(--mint);
    font-size: 0.72rem;
    border: 1px solid rgba(138, 255, 193, 0.2);
    background: rgba(138, 255, 193, 0.045);
}

.badge-dot,
.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 15px rgba(138, 255, 193, 0.85);
}

label {
    display: block;
    margin-bottom: 0.45rem;
    color: #d9d9d9;
    font-size: 0.8rem;
    user-select: none;
}

input,
select {
    width: 100%;
    height: 48px;
    padding: 0 0.95rem;
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: var(--input);
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

input:focus,
select:focus {
    border-color: rgba(138, 255, 193, 0.55);
    background: rgba(255, 255, 255, 0.065);
    box-shadow: 0 0 0 3px rgba(138, 255, 193, 0.08);
}

.btn,
.top-nav a,
.top-nav button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.7rem 0.9rem;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 10px;
    text-decoration: none;
    transition: transform 0.2s ease, filter 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover,
.top-nav a:hover,
.top-nav button:hover {
    transform: translateY(-1px);
}

.btn:disabled,
.top-nav button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
}

.btn.primary {
    color: #101010;
    border: none;
    background: linear-gradient(45deg, var(--blue), var(--mint));
    box-shadow: 0 12px 35px rgba(106, 156, 255, 0.16);
}

.btn.primary:hover {
    filter: brightness(1.06);
}

.btn.secondary,
.top-nav a,
.top-nav button {
    color: var(--muted);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.btn.secondary:hover,
.top-nav a:hover,
.top-nav button:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.06);
}

.btn.full {
    width: 100%;
    min-height: 50px;
    margin-top: 1rem;
}

.status-box,
.status-line {
    color: #dfffee;
    font-size: 0.78rem;
    line-height: 1.5;
}

.status-box {
    display: none;
    margin-top: 1rem;
    padding: 0.85rem;
    border: 1px solid rgba(138, 255, 193, 0.22);
    border-radius: 10px;
    background: rgba(138, 255, 193, 0.055);
}

.status-box.error,
.status-line.error {
    color: var(--red);
}

.status-line.warning {
    color: var(--yellow);
}

.small-note {
    margin: 1rem 0 0;
    color: var(--soft);
    font-size: 0.72rem;
    line-height: 1.55;
}

.top-nav {
    position: fixed;
    top: 2vmin;
    right: 2vmin;
    display: flex;
    gap: 0.7rem;
    z-index: 5;
}

.top-nav button {
    appearance: none;
}

.dashboard-page {
    width: min(1360px, calc(100% - 32px));
    margin: 0 auto;
    padding: 12vh 0 8vh;
}

.hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeUp 850ms ease 120ms forwards;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    justify-content: flex-end;
}

.control-panel,
.tables-card,
.overview-card,
.recent-card {
    padding: 1rem;
}

.control-panel {
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeUp 850ms ease 200ms forwards;
}

.control-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.7rem;
    align-items: end;
}

.pill-row,
.tab-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.pill-row {
    margin: 1rem 0 0.7rem;
}

.pill,
.tab-btn {
    min-height: 36px;
    padding: 0.55rem 0.75rem;
    color: var(--muted);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.pill:hover,
.tab-btn:hover {
    transform: translateY(-1px);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
}

.pill.active,
.tab-btn.active {
    color: #101010;
    border-color: transparent;
    background: linear-gradient(45deg, var(--blue), var(--mint));
}

.quick-stats,
.balance-stats {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
    opacity: 0;
}

.quick-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    animation: fadeUp 850ms ease 280ms forwards;
}

.balance-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    animation: fadeUp 850ms ease 320ms forwards;
}

.stat-card {
    position: relative;
    padding: 1rem;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent 60%);
}

.stat-card span,
.stat-card strong,
.stat-card small {
    position: relative;
    display: block;
}

.stat-card span {
    color: var(--soft);
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.stat-card strong {
    margin-top: 0.45rem;
    font-size: clamp(1.45rem, 3vw, 2.25rem);
    line-height: 1.05;
    letter-spacing: -0.08em;
}

.stat-card small {
    margin-top: 0.4rem;
    color: var(--muted);
    font-size: 0.78rem;
}

.accent-green { border-top-color: rgba(138, 255, 193, 0.55); }
.accent-red { border-top-color: rgba(255, 106, 143, 0.55); }
.accent-blue { border-top-color: rgba(106, 156, 255, 0.55); }
.accent-yellow { border-top-color: rgba(255, 211, 106, 0.55); }
.accent-purple { border-top-color: rgba(179, 136, 255, 0.55); }

.main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 430px;
    gap: 1rem;
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeUp 850ms ease 360ms forwards;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel-heading.compact {
    margin-bottom: 0.8rem;
}

.panel-heading h2 {
    margin: 0;
    font-size: 1.25rem;
    letter-spacing: -0.04em;
}

.status-pill {
    color: var(--mint);
    font-size: 0.72rem;
    border: 1px solid rgba(138, 255, 193, 0.2);
    background: rgba(138, 255, 193, 0.045);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 58px;
    padding: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.032);
}

.info-row span {
    color: var(--soft);
    font-size: 0.76rem;
}

.info-row strong {
    color: #d9d9d9;
    font-size: 0.88rem;
    text-align: right;
}

.recent-list {
    display: grid;
    gap: 0.55rem;
    max-height: 410px;
    overflow: auto;
    padding-right: 0.2rem;
}

.recent-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.7rem;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.032);
}

.recent-item.log-item {
    align-items: flex-start;
}

.type-pill {
    min-width: 46px;
    padding: 0.3rem 0.45rem;
    border-radius: 999px;
    text-align: center;
    font-size: 0.68rem;
    font-weight: 800;
}

.type-pill.sell {
    color: #101010;
    background: var(--mint);
}

.type-pill.buy {
    color: #fff;
    background: var(--red);
}

.type-pill.log {
    color: #101010;
    background: var(--blue);
}

.type-pill.balance {
    color: #101010;
    background: var(--yellow);
}

.recent-main strong,
.recent-main small {
    display: block;
}

.recent-main strong {
    font-size: 0.82rem;
    white-space: normal;
    word-break: break-word;
}

.recent-main small,
.recent-date {
    color: var(--soft);
    font-size: 0.7rem;
}

.recent-date {
    text-align: right;
    white-space: nowrap;
}

.recent-price {
    color: #d9d9d9;
    font-size: 0.82rem;
    font-weight: 800;
    text-align: right;
}

.tables-card {
    opacity: 0;
    animation: fadeUp 850ms ease 440ms forwards;
}

.table-heading {
    align-items: flex-end;
}

.search-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.8rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.032);
}

.search-row label {
    margin: 0;
}

.table-wrap {
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.16);
}


.table-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    margin-bottom: 1rem;
    padding: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.032);
}

.entries-control {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.entries-control label {
    margin: 0;
    white-space: nowrap;
}

.page-size-select {
    width: 96px;
    height: 42px;
}

.pagination-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
}

.pagination-btn {
    min-width: 92px;
}

.pagination-info,
.pagination-count {
    color: var(--muted);
    font-size: 0.78rem;
    white-space: nowrap;
}

.pagination-info {
    min-width: 110px;
    text-align: center;
}

.pagination-count {
    text-align: right;
}

table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

thead {
    background: rgba(255, 255, 255, 0.04);
}

th,
td {
    padding: 0.78rem 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.82rem;
    text-align: right;
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

th:first-child,
td:first-child {
    text-align: left;
}

tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.018);
}

tbody tr:hover {
    background: rgba(138, 255, 193, 0.045);
}

.money-sell { color: var(--green); }
.money-buy { color: var(--red); }
.money-profit.positive { color: var(--green); }
.money-profit.negative { color: var(--red); }
.money-profit.neutral { color: var(--muted); }

.empty-row td {
    padding: 2rem;
    color: var(--soft);
    text-align: center;
}

.footer {
    padding: 0 0 2rem;
    color: #555;
    font-size: 0.78rem;
    text-align: center;
    opacity: 0.7;
    user-select: none;
}

.footer:hover {
    opacity: 1;
}

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

@media (max-width: 960px) {
    .table-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .entries-control,
    .pagination-row {
        justify-content: space-between;
    }

    .pagination-count {
        text-align: left;
    }

    .hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero-actions {
        justify-content: flex-start;
    }

    .quick-stats,
    .balance-stats,
    .info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 720px) {
    .top-nav {
        left: 16px;
        right: 16px;
        justify-content: flex-end;
        gap: 8px;
    }

    .dashboard-page {
        width: min(100% - 24px, 1360px);
        padding-top: 6.5rem;
    }

    .quick-stats,
    .balance-stats,
    .info-grid,
    .search-row {
        grid-template-columns: 1fr;
    }

    .entries-control,
    .pagination-row {
        align-items: stretch;
        flex-direction: column;
    }

    .page-size-select,
    .pagination-btn,
    .pagination-info {
        width: 100%;
    }

    .page-title {
        letter-spacing: -0.06em;
    }

    .panel-heading,
    .table-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .recent-item {
        grid-template-columns: 1fr;
    }

    .recent-date,
    .recent-price {
        text-align: left;
    }
}

@media (prefers-reduced-motion) {
    body,
    .login-shell,
    .hero,
    .control-panel,
    .quick-stats,
    .balance-stats,
    .main-grid,
    .tables-card,
    .brand-title,
    .page-title {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

@keyframes gradient {
    from { background-position: 0% 50%; }
    to { background-position: 100% 50%; }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes glowPulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.1); }
}

@keyframes floatY {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

/* Auth-Erweiterungen */
.auth-page { padding-top: 6rem; }
.auth-shell-wide { width: min(720px, 100%); }
.auth-card { overflow: visible; }
.auth-card label:not(.check-row) { margin-top: 1rem; }
.auth-card label:first-of-type { margin-top: 0; }
.auth-top-nav { z-index: 20; }
.status-box.visible { display: block; margin: 0 0 1rem; }
.status-box.success { color: var(--mint); }
.status-box.error { color: var(--red); border-color: rgba(255, 106, 143, 0.28); background: rgba(255, 106, 143, 0.06); }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.7rem; margin-top: 1rem; }
.auth-links a { color: var(--muted); font-size: 0.75rem; text-decoration: none; }
.auth-links a:hover { color: #fff; }
.auth-divider { display: flex; align-items: center; gap: 0.8rem; margin: 1.2rem 0 0; color: var(--soft); font-size: 0.72rem; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; flex: 1; background: rgba(255,255,255,0.1); }
.password-field { position: relative; }
.password-field input { padding-right: 6.2rem; }
.password-toggle { position: absolute; right: 0.45rem; top: 50%; transform: translateY(-50%); min-height: 34px; padding: 0.35rem 0.65rem; border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; background: rgba(255,255,255,0.05); color: var(--muted); font-family: inherit; font-size: 0.7rem; cursor: pointer; }
.password-toggle:hover { color: #fff; border-color: rgba(255,255,255,0.22); }
.auth-grid-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; }
.check-row { display: flex; align-items: flex-start; gap: 0.7rem; margin-top: 1rem; color: var(--muted); font-size: 0.74rem; line-height: 1.5; cursor: pointer; }
.check-row input { width: 18px; height: 18px; min-height: 0; margin-top: 0.1rem; flex: 0 0 auto; accent-color: var(--mint); }
.logout-form { margin: 0; }
.logout-form button { font-family: inherit; }
@media (max-width: 680px) {
    .auth-grid-two { grid-template-columns: 1fr; gap: 0; }
    .auth-links { flex-direction: column; }
}
