* {
    box-sizing: border-box;
}

:root {
    --bg: #0b1020;
    --panel: rgba(255,255,255,0.05);
    --panel-border: rgba(255,255,255,0.08);
    --text: #eef2ff;
    --muted: #9ca3af;
    --green: #1d6f0b;
    --discord: #5865F2;
}

html, body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    min-width: 260px;
    background: #111827;
    padding: 18px;
    border-right: 1px solid var(--panel-border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    min-width: 0;
}

.brand-image {
    width: 46px;
    height: 46px;
    min-width: 46px;
    object-fit: contain;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    padding: 5px;
}

.brand h1 {
    margin: 0;
    font-size: 18px;
    line-height: 1.15;
}

.brand span {
    color: var(--muted);
    font-size: 12px;
}

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

nav a {
    color: #dbeafe;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    font-size: 14px;
}

nav a:hover {
    background: rgba(34,197,94,0.16);
}

.main {
    flex: 1;
    min-width: 0;
    padding: 18px;
    max-width: calc(100vw - 260px);
}

.topbar {
    min-height: 64px;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    gap: 14px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar-logo {
    width: 40px;
    height: 40px;
    min-width: 40px;
    object-fit: contain;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    padding: 5px;
}

.topbar strong {
    font-size: 16px;
}

.topbar small {
    display: block;
    color: var(--muted);
    margin-top: 3px;
    font-size: 12px;
    max-width: 520px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-pill {
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(34,197,94,0.16);
    color: #bbf7d0;
    font-size: 12px;
    white-space: nowrap;
}

.page h2 {
    margin: 0 0 8px;
    font-size: clamp(24px, 2vw, 30px);
}

.page-head {
    margin-bottom: 16px;
}

.page-head p {
    max-width: 950px;
    line-height: 1.5;
}

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

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

.cards.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 14px;
    min-width: 0;
}

.card h3 {
    margin: 0 0 12px;
    font-size: 17px;
}

.card p {
    line-height: 1.5;
}

.success {
    color: #86efac;
}

.error, .login-error {
    color: #fca5a5;
    white-space: pre-wrap;
    margin: 12px 0;
    padding: 10px;
    border-radius: 10px;
    background: rgba(239,68,68,0.10);
}

.warning-box {
    border-color: rgba(250,204,21,0.25);
    background: rgba(250,204,21,0.08);
}

.warning-text {
    color: #fde68a;
    margin: 8px 0;
}

.table-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
}

.table-item {
    padding: 9px 10px;
    background: rgba(0,0,0,0.22);
    border-radius: 9px;
    color: #dbeafe;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-box {
    width: 100%;
    max-width: 440px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 20px;
    padding: 24px;
}

.login-logo {
    margin-bottom: 16px;
}

.login-box h1 {
    margin: 0 0 8px;
    font-size: 26px;
}

.login-box label {
    display: block;
    margin-top: 16px;
    margin-bottom: 8px;
}

.login-box input {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(0,0,0,0.25);
    color: #fff;
    border-radius: 11px;
    outline: none;
}

.login-box button,
.discord-login-button {
    width: 100%;
    margin-top: 16px;
    padding: 13px 15px;
    border: none;
    border-radius: 11px;
    background: var(--discord);
    color: white;
    font-weight: 800;
    cursor: pointer;
    display: block;
    text-align: center;
    text-decoration: none;
}

.login-box button:hover,
.discord-login-button:hover {
    filter: brightness(1.08);
}

.login-box small {
    display: block;
    margin-top: 14px;
    color: var(--muted);
    word-break: break-all;
}

.login-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.12);
    margin: 20px 0 8px;
}

code {
    color: #bfdbfe;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.stat-card {
    background: linear-gradient(180deg, rgba(31,41,55,0.95), rgba(17,24,39,0.95));
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 16px;
    min-width: 0;
}

.stat-label {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 8px;
    line-height: 1.35;
}

.stat-value {
    display: block;
    font-size: clamp(22px, 2.4vw, 30px);
    line-height: 1.1;
    word-break: break-word;
}

.mini-stats {
    display: grid;
    gap: 10px;
}

.mini-stat {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    min-width: 0;
}

.mini-stat span {
    color: #cbd5e1;
}

.mini-stat strong {
    text-align: right;
    word-break: break-word;
}

.ranking-list {
    display: grid;
    gap: 8px;
}

.ranking-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    min-width: 0;
}

.ranking-row span {
    color: #e5e7eb;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-row strong {
    white-space: nowrap;
}

@media (max-width: 1280px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cards.two-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-width: 0;
    }

    .main {
        max-width: none;
        padding: 14px;
    }

    .brand {
        margin-bottom: 18px;
    }

    nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .topbar small {
        max-width: 100%;
        white-space: normal;
    }

    .cards,
    .cards.two-col,
    .table-list,
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .sidebar {
        padding: 14px;
    }

    .brand-image {
        width: 42px;
        height: 42px;
        min-width: 42px;
    }

    .topbar-logo {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    .stat-card,
    .card {
        padding: 14px;
    }

    nav {
        grid-template-columns: 1fr;
    }
}

/* Update 031 - Discord only Login + Verwaltungstool Look */
:root {
    --blue: #2563eb;
    --blue-soft: rgba(37,99,235,0.18);
    --danger: #ef4444;
}

body {
    background:
        radial-gradient(circle at top left, rgba(37,99,235,0.22), transparent 34%),
        radial-gradient(circle at bottom right, rgba(88,101,242,0.18), transparent 36%),
        var(--bg);
}

.sidebar {
    background: rgba(8,13,28,0.96);
    backdrop-filter: blur(14px);
}

.brand span {
    color: #93c5fd;
    font-weight: 800;
}

nav a {
    border: 1px solid transparent;
}

nav a:hover,
nav a.active {
    background: rgba(37,99,235,0.18);
    border-color: rgba(96,165,250,0.26);
    color: #eff6ff;
}

.status-pill-discord {
    background: rgba(88,101,242,0.18);
    color: #e0e7ff;
    border: 1px solid rgba(165,180,252,0.22);
}

.login-shell {
    width: min(980px, 100%);
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 18px;
    align-items: stretch;
}

.login-hero-card,
.login-box {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.28);
}

.login-hero-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 420px;
    background:
        radial-gradient(circle at 20% 20%, rgba(88,101,242,0.40), transparent 36%),
        linear-gradient(145deg, rgba(30,41,59,0.92), rgba(8,13,28,0.95));
}

.login-hero-card img {
    width: 86px;
    height: 86px;
    object-fit: contain;
    border-radius: 18px;
    background: rgba(255,255,255,0.08);
    padding: 10px;
    margin-bottom: auto;
}

.login-hero-card span {
    color: #bfdbfe;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 12px;
}

.login-hero-card h1 {
    font-size: clamp(32px, 5vw, 54px);
    line-height: 0.98;
    margin: 10px 0 12px;
}

.login-hero-card p {
    color: #cbd5e1;
    max-width: 520px;
    line-height: 1.55;
}

.login-box {
    max-width: none;
    align-self: center;
}

.login-box h2 {
    margin: 0 0 8px;
    font-size: 28px;
}

.discord-login-button.disabled {
    opacity: 0.55;
    pointer-events: none;
    filter: grayscale(0.35);
}

.empty-dashboard-card {
    min-height: 260px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-style: dashed;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

.settings-card label {
    display: block;
    margin: 14px 0 7px;
    font-weight: 900;
    color: #dbeafe;
}

.settings-card input,
.settings-card textarea {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(0,0,0,0.25);
    color: #fff;
    border-radius: 12px;
    padding: 12px 13px;
    outline: none;
    resize: vertical;
}

.settings-card input:focus,
.settings-card textarea:focus {
    border-color: rgba(96,165,250,0.8);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.18);
}

.settings-card button,
.settings-link-button {
    margin-top: 16px;
    border: 0;
    border-radius: 12px;
    padding: 12px 14px;
    background: var(--discord);
    color: #fff;
    font-weight: 900;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.settings-link-button {
    margin-left: 8px;
    background: rgba(255,255,255,0.09);
    border: 1px solid rgba(255,255,255,0.12);
}

.success-box {
    border-color: rgba(34,197,94,0.26);
    background: rgba(34,197,94,0.09);
    color: #bbf7d0;
}

.danger-source {
    background: rgba(239,68,68,0.16) !important;
    border-color: rgba(248,113,113,0.28) !important;
    color: #fecaca !important;
}

@media (max-width: 900px) {
    .login-shell,
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .login-hero-card {
        min-height: 300px;
    }
}

/* Update 031 - Discord Zugriffsverwaltung */
.access-add-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 10px;
}

.access-add-row select {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(0,0,0,0.25);
    color: #fff;
    border-radius: 12px;
    padding: 12px 13px;
    outline: none;
}

.access-list-block {
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.access-list-block h4 {
    margin: 0 0 10px;
    color: #e5e7eb;
}

.access-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.access-entry span {
    display: grid;
    gap: 3px;
    color: #cbd5e1;
    word-break: break-all;
}

.access-entry span strong {
    color: #93c5fd;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.access-entry button {
    margin-top: 0;
    background: rgba(239,68,68,0.18);
    border: 1px solid rgba(248,113,113,0.24);
    color: #fecaca;
    padding: 8px 10px;
    flex-shrink: 0;
}

@media (max-width: 650px) {
    .access-add-row {
        grid-template-columns: 1fr;
    }
}

/* Update 032 - kompakte Discord Einstellungen mit Vorschlägen */
.settings-compact-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
    gap: 14px;
    align-items: start;
}

.discord-main-card,
.access-manager-card,
.oauth-details-card {
    overflow: visible;
}

.compact-muted {
    margin: 3px 0 0;
    font-size: 13px;
}

.form-two,
.form-three {
    display: grid;
    gap: 12px;
}

.form-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.button-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.button-row .settings-link-button {
    margin-left: 0;
}

.settings-details,
.oauth-details-card {
    margin-top: 12px;
}

.settings-details summary,
.oauth-details-card > summary {
    cursor: pointer;
    color: #bfdbfe;
    font-weight: 900;
    padding: 10px 0;
}

.access-tabs {
    display: inline-flex;
    gap: 6px;
    padding: 4px;
    background: rgba(0,0,0,0.22);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    margin-bottom: 8px;
}

.access-tabs button {
    margin: 0;
    padding: 8px 12px;
    background: transparent;
    border: 0;
    border-radius: 10px;
    color: #cbd5e1;
}

.access-tabs button.active {
    background: rgba(88,101,242,0.26);
    color: #fff;
}

.combo-wrap {
    position: relative;
}

.combo-results {
    display: none;
    position: absolute;
    z-index: 50;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    max-height: 285px;
    overflow: auto;
    border: 1px solid rgba(148,163,184,0.24);
    border-radius: 14px;
    background: rgba(8,13,28,0.98);
    box-shadow: 0 20px 60px rgba(0,0,0,0.38);
    padding: 6px;
}

.combo-results.open {
    display: grid;
    gap: 4px;
}

.combo-option {
    width: 100%;
    display: grid;
    grid-template-columns: 16px 1fr;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 11px;
    border: 0;
    background: transparent;
    color: #e5e7eb;
    text-align: left;
    cursor: pointer;
}

.combo-option:hover {
    background: rgba(255,255,255,0.08);
}

.combo-option strong,
.access-entry-main strong {
    display: block;
    font-size: 13px;
    color: #f8fafc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.combo-option small,
.access-entry-main small {
    display: block;
    margin-top: 2px;
    color: #94a3b8;
    font-size: 11px;
    word-break: break-all;
}

.role-dot {
    width: 13px;
    height: 13px;
    border-radius: 999px;
    background: var(--role-color, #64748b);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.05);
    flex-shrink: 0;
}

.user-dot {
    color: #93c5fd;
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}

.access-current-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.fancy-access-entry {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    background: rgba(255,255,255,0.035);
    margin-bottom: 8px;
}

.fancy-access-entry button {
    margin-top: 0;
}

@media (max-width: 1250px) {
    .settings-compact-grid,
    .access-current-list,
    .form-three {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .form-two {
        grid-template-columns: 1fr;
    }
}


/* Update 046 - sichere IP-Nutzung + einheitliches responsives Scaling */
:root {
    --lp-sidebar-width: clamp(214px, 15.8vw, 260px);
    --lp-page-pad: clamp(12px, 1.05vw, 18px);
    --lp-card-pad: clamp(12px, 0.95vw, 16px);
    --lp-gap: clamp(10px, 0.9vw, 14px);
    --lp-radius: clamp(12px, 1vw, 16px);
}

html {
    font-size: clamp(13px, 0.72vw + 4px, 16px);
}

body {
    font-size: 1rem;
}

.sidebar {
    width: var(--lp-sidebar-width);
    min-width: var(--lp-sidebar-width);
    padding: var(--lp-page-pad);
}

.main {
    padding: var(--lp-page-pad);
    max-width: calc(100vw - var(--lp-sidebar-width));
}

.card,
.stat-card,
.login-hero-card,
.login-box {
    padding: var(--lp-card-pad);
    border-radius: var(--lp-radius);
}

.cards,
.stats-grid,
.settings-grid,
.settings-compact-grid,
.access-current-list {
    gap: var(--lp-gap);
}

.topbar {
    min-height: clamp(52px, 4vw, 64px);
    padding: clamp(8px, 0.75vw, 12px) clamp(12px, 1vw, 16px);
    border-radius: var(--lp-radius);
}

.brand-image {
    width: clamp(38px, 3vw, 46px);
    height: clamp(38px, 3vw, 46px);
    min-width: clamp(38px, 3vw, 46px);
}

.topbar-logo {
    width: clamp(34px, 2.6vw, 40px);
    height: clamp(34px, 2.6vw, 40px);
    min-width: clamp(34px, 2.6vw, 40px);
}

nav a,
.small-table,
.table-item,
.mini-stat,
.player-row small,
.status-pill,
.source-badge {
    font-size: 0.9rem;
}

.page h2 {
    font-size: clamp(1.45rem, 1.6vw, 1.9rem);
}

.card h3,
.discord-owner-head h3,
.detail-header h3 {
    font-size: clamp(1.05rem, 1.35vw, 1.5rem);
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
}

.cards {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.cards.two-col,
.settings-grid,
.settings-compact-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}

.table-responsive,
.small-table-wrap,
.card:has(table) {
    overflow-x: auto;
}

img, video, canvas, svg {
    max-width: 100%;
}

@media (min-width: 901px) and (max-width: 1450px) {
    .sidebar nav {
        gap: 6px;
    }

    nav a {
        padding: 9px 10px;
    }

    .brand h1 {
        font-size: 1.05rem;
    }

    .topbar small {
        max-width: 38vw;
    }
}

@media (max-width: 900px) {
    .sidebar,
    .main {
        width: 100%;
        min-width: 0;
        max-width: none;
    }
}

/* Login-Erweiterung 2026-07-18 – ausschließlich Login und lokale Benutzer */
.login-shell-centered {
    width: min(520px, 100%);
    grid-template-columns: 1fr;
}
.login-box-unified {
    padding: 32px;
}
.login-brand-center {
    text-align: center;
    margin-bottom: 18px;
}
.login-brand-center img {
    width: 76px;
    height: 76px;
    object-fit: contain;
    padding: 9px;
    border-radius: 18px;
    background: rgba(255,255,255,.07);
}
.login-brand-center span {
    display: block;
    margin-top: 10px;
    color: #bfdbfe;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.login-brand-center h1 {
    margin: 4px 0 8px;
    font-size: 30px;
}
.login-divider-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 4px;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.login-divider-label::before,
.login-divider-label::after {
    content: "";
    height: 1px;
    flex: 1;
    background: rgba(255,255,255,.12);
}
.local-user-list .ranking-row span {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.local-user-list .ranking-row small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}
.local-user-card {
    margin-top: 14px;
}
@media (max-width: 650px) {
    .login-box-unified { padding: 22px; }
    .login-brand-center h1 { font-size: 25px; }
}
