@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap');
@import url('https://cdn.jsdelivr.net/npm/@tabler/icons-webfont@latest/tabler-icons.min.css');

/* ===================================================================
   HILFSBEREITER DESIGN SYSTEM
   =================================================================== */

/* ===== CSS Variablen ===== */
:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #eef2ff;
    --primary-dark: #3730a3;
    --bg: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f1f3f5;
    --text: #1a1a2e;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --border-focus: #6366f1;
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --info: #3b82f6;
    --info-light: #dbeafe;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-glow-primary: 0 4px 20px rgba(99, 102, 241, 0.4);
    --font: 'Outfit', system-ui, -apple-system, sans-serif;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

/* ===== Typographie ===== */
h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

h2 {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

h3 {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.4;
}

h4 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
}

p {
    color: var(--text);
    margin-bottom: 0.5rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

    a:hover {
        color: var(--primary-hover);
        text-decoration: underline;
    }

.text-muted {
    color: var(--text-muted);
}

.text-secondary {
    color: var(--text-secondary);
}

/* ===================================================================
   BUTTONS
   =================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 0.5px solid transparent;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.1s;
    white-space: nowrap;
    text-decoration: none;
}

    .btn:active {
        transform: scale(0.98);
    }

    .btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

    .btn-primary:hover {
        background: var(--primary-hover);
        border-color: var(--primary-hover);
        color: white;
        text-decoration: none;
    }

.btn-secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

    .btn-secondary:hover {
        background: var(--bg-secondary);
        color: var(--text);
        text-decoration: none;
    }

.btn-ghost {
    background: transparent;
    color: var(--primary);
    border-color: transparent;
}

    .btn-ghost:hover {
        background: var(--primary-light);
        text-decoration: none;
    }

.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

    .btn-success:hover {
        opacity: 0.9;
        text-decoration: none;
    }

.btn-danger {
    background: transparent;
    color: var(--danger);
    border-color: var(--danger);
}

    .btn-danger:hover {
        background: var(--danger-light);
        text-decoration: none;
    }

.btn-danger-solid {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

    .btn-danger-solid:hover {
        opacity: 0.9;
        color: white;
        text-decoration: none;
    }

.btn-glass {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.1s;
}

    .btn-glass:hover {
        background: rgba(255, 255, 255, 0.15);
        border-color: rgba(255, 255, 255, 0.5);
        color: #ffffff;
        text-decoration: none;
        box-shadow: 0 0 16px rgba(255, 255, 255, 0.1);
    }

.btn-glass-primary {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5);
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
}

    .btn-glass-primary:hover {
        background: linear-gradient(135deg, #4f46e5, #6366f1);
        box-shadow: 0 4px 28px rgba(99, 102, 241, 0.7);
        transform: translateY(-1px);
        color: #ffffff;
        text-decoration: none;
    }

    .btn-glass-primary:active {
        transform: translateY(0) scale(0.98);
        box-shadow: 0 2px 12px rgba(99, 102, 241, 0.6);
    }

.btn-sm {
    padding: 0.4rem 0.875rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-icon {
    padding: 0.5rem;
    width: 36px;
    height: 36px;
}

.btn-icon-sm {
    padding: 0.35rem;
    width: 28px;
    height: 28px;
}

.btn-full {
    width: 100%;
}

.btn-hero {
    font-size: 1.75rem;
    font-weight: 700;
    padding: 1rem 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glow-primary);
    width: 100%;
    max-width: 320px;
}

    .btn-hero:active {
        transform: scale(0.96);
    }

/* ===================================================================
   BADGES
   =================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 20px;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-info {
    background: var(--info-light);
    color: var(--info);
}

.badge-gray {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.badge-lg {
    padding: 0.6rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
}

.badge-xl {
    padding: 0.75rem 2rem;
    font-size: 1.25rem;
    font-weight: 700;
    border-radius: var(--radius-lg);
}

/* ===================================================================
   CARDS
   =================================================================== */
.card {
    background: var(--bg);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 0.5px solid var(--border);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    overflow-wrap: anywhere;
}

.card-md {
    padding: 1.5rem;
    width: 100%;
    max-width: 480px;
}

.card-lg {
    padding: 1.5rem;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.card-hover {
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}

    .card-hover:hover {
        border-color: var(--primary);
        background: var(--primary-light);
        text-decoration: none;
    }

/* ===================================================================
   FORMS & INPUTS
   =================================================================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label, .form-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
}

.form-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="tel"],
input[type="number"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: 0.65rem 0.875rem;
    font-family: var(--font);
    font-size: 0.9rem;
    color: var(--text);
    background: var(--bg);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
}

    .form-input:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline: none;
        border-color: var(--border-focus);
        box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
    }

.form-input-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--bg-secondary);
}

.input-with-icon {
    position: relative;
}

    .input-with-icon .ti {
        position: absolute;
        left: 0.75rem;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-muted);
        font-size: 1rem;
        pointer-events: none;
    }

    .input-with-icon input {
        padding-left: 2.5rem;
    }

textarea {
    min-height: 100px;
    resize: vertical;
}

.form-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.form-error {
    font-size: 0.78rem;
    color: var(--danger);
}

/* ===================================================================
   TABLES
   =================================================================== */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

    .table th {
        text-align: left;
        padding: 0.625rem 0.875rem;
        font-size: 0.78rem;
        font-weight: 600;
        color: var(--text-secondary);
        border-bottom: 0.5px solid var(--border);
        background: var(--bg-secondary);
    }

    .table td {
        padding: 0.75rem 0.875rem;
        border-bottom: 0.5px solid var(--border);
        color: var(--text);
    }

    .table tr:last-child td {
        border-bottom: none;
    }

    .table tr:hover td {
        background: var(--bg-secondary);
    }

/* ===================================================================
   ALERTS
   =================================================================== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.alert-success {
    background: var(--success-light);
    color: var(--success);
}

.alert-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.alert-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.alert-info {
    background: var(--info-light);
    color: var(--info);
}

/* ===================================================================
   MISC / UTILITIES
   =================================================================== */
.divider {
    border: none;
    border-top: 0.5px solid var(--border);
    margin: 1.5rem 0;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.hidden-mobile {
    display: none;
}

.hidden-desktop {
    display: block;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--text-muted);
    }

/* ===== Blazor Defaults überschreiben ===== */
h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--success);
}

.invalid {
    outline: 1px solid var(--danger);
}

.validation-message {
    color: var(--danger);
    font-size: 0.78rem;
}

/* ===================================================================
   AUTH PAGES
   =================================================================== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--bg-tertiary);
    background-image: url('../images/background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.auth-card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

    .auth-card > * {
        flex-shrink: 0;
    }

    .auth-card .btn-secondary {
        color: #ffffff;
        border-color: rgba(255, 255, 255, 0.4);
    }

        .auth-card .btn-secondary:hover {
            background: rgba(255, 255, 255, 0.1);
            color: #ffffff;
        }

    .auth-card .form-label {
        color: rgba(255, 255, 255, 0.85);
    }

    .auth-card .form-input {
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.2);
        color: #ffffff;
        transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    }

        .auth-card .form-input::placeholder {
            color: rgba(255, 255, 255, 0.4);
        }

        .auth-card .form-input:focus {
            background: rgba(255, 255, 255, 0.1);
            border-color: rgba(129, 140, 248, 0.8);
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25), 0 0 20px rgba(99, 102, 241, 0.15);
        }

    .auth-card .input-with-icon .ti {
        color: rgba(255, 255, 255, 0.5);
    }

    .auth-card .auth-remember input[type="checkbox"] {
        width: 16px;
        height: 16px;
        accent-color: var(--primary);
    }

.auth-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

    .auth-header h1 {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
        color: #ffffff !important;
        font-family: 'Outfit', sans-serif;
        font-weight: 700;
    }

.auth-logo {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.auth-sub {
    font-size: 0.9rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 0.25rem;
}

    .auth-remember label {
        color: rgba(255, 255, 255, 0.85);
    }

.auth-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

    .auth-footer a {
        color: rgba(255, 255, 255, 0.85);
        text-decoration: none;
        padding: 0.35rem 0.75rem;
        border-radius: 20px;
        transition: background 0.2s, color 0.2s;
    }

        .auth-footer a:hover {
            background: rgba(255, 255, 255, 0.1);
            color: #ffffff;
            text-decoration: none;
        }

/* ===================================================================
   APP LAYOUT (Header/Footer/Panel)
   =================================================================== */
.app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 2rem);
    background: var(--bg-tertiary);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
    margin: 1rem !important;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    height: 96px;
    background: var(--bg-tertiary);
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-footer {
    background: var(--bg-tertiary);
    border-top: none;
    color: var(--text-muted);
}

.header-side {
    min-width: 150px;
}

    .header-side:last-child {
        display: flex;
        justify-content: flex-end;
    }

.header-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
    text-decoration: none;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text);
}

    .header-logo:hover {
        text-decoration: none;
    }

.logo-icon {
    font-size: 20px;
}

.logo-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: var(--radius-md);
    transition: background 0.2s;
}

    .header-user:hover {
        background: var(--bg-secondary);
        text-decoration: none;
    }

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.app-main {
    flex: 1;
    padding: 2rem 1.5rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* ===================================================================
   DASHBOARD
   =================================================================== */
.dashboard-wrapper {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    padding: 2rem;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dashboard-panel {
    background: var(--bg);
    border: none;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

    .dashboard-panel:last-of-type {
        margin-bottom: 0;
    }

.plugin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.plugin-category {
    margin-bottom: 3rem;
}

.plugin-category-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.plugin-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
}

.plugin-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.plugin-card:hover .plugin-icon-wrapper {
    transform: scale(1.08);
}

.plugin-icon-admin {
    background: #fef3c7;
    color: #b45309;
}

.plugin-icon-cardmarket {
    background: #ede9fe;
    color: #7c3aed;
}

.plugin-icon-bahnhof {
    background: #dbeafe;
    color: #1d4ed8;
}

.plugin-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.plugin-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.plugin-beschreibung {
    font-size: 12px;
    color: var(--text-secondary);
}

.plugin-arrow {
    color: var(--text-muted);
    font-size: 16px;
    flex-shrink: 0;
}

/* ===================================================================
   ACCORDION
   =================================================================== */
.accordion-trigger {
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 0.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-family: var(--font);
    text-align: left;
    transition: color 0.2s;
}

    .accordion-trigger:hover {
        color: var(--primary);
    }

        .accordion-trigger:hover .accordion-icon {
            color: var(--primary);
        }

.accordion-icon {
    color: var(--text-muted);
    transition: transform 0.2s;
}

.accordion-item.open .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: max-height 0.35s ease, opacity 0.25s ease, transform 0.3s ease;
}

.accordion-item.open .accordion-content {
    max-height: 600px;
    opacity: 1;
    transform: translateY(0);
}

/* ===================================================================
   MANAGE / PROFIL
   =================================================================== */
.manage-wrapper {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.manage-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.manage-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    flex-shrink: 0;
}

.manage-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
}

    .manage-panel .manage-tabs {
        box-shadow: none;
        margin-bottom: 1rem;
        border: 1.5px solid var(--border);
    }

    .manage-panel .card {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
        border: 1.5px solid var(--border);
    }

.manage-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 1rem;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--radius-md);
}

.manage-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    transition: background 0.2s, color 0.2s;
    font-family: var(--font);
    text-decoration: none;
    cursor: default;
}

    .manage-tab:hover {
        text-decoration: none;
        color: var(--text);
    }

    .manage-tab.active {
        background: var(--primary) !important;
        color: #ffffff !important;
        box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    }

        .manage-tab.active i.ti {
            color: #ffffff !important;
        }

.manage-action-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    border-bottom: 0.5px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}

    .manage-action-row:hover {
        background: var(--bg-secondary);
    }

.manage-action-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

/* ===================================================================
   MODAL
   =================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 0.5px solid var(--border);
}

/* ===================================================================
   LOBBY
   =================================================================== */
.lobby-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1rem;
}

/* ===================================================================
   SPIEL OVERLAY
   =================================================================== */
.spiel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
}

.spiel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-bottom: 1rem;
    border-bottom: 0.5px solid var(--border);
}

.spiel-flagge-wrapper {
    display: flex;
    justify-content: center;
}

.spiel-flagge {
    max-width: 320px;
    width: 100%;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: filter 0.3s;
}

.spiel-flagge-blur {
    filter: blur(10px);
}

.spiel-aktion {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.spiel-abstimmung-buttons {
    display: flex;
    gap: 1rem;
    width: 100%;
    max-width: 400px;
}

.spiel-abstimmung-btn {
    flex: 1;
    font-size: 1rem;
    padding: 0.75rem;
}

.spiel-hint {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
}

.spiel-punkte-liste {
    width: 100%;
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.spiel-punkte-zeile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 0.5px solid var(--border);
    transition: background 0.2s;
}

    .spiel-punkte-zeile:last-child {
        border-bottom: none;
    }

.spiel-punkte-erster {
    background: var(--warning-light);
}

.spiel-punkte-wert {
    font-weight: 600;
    font-size: 0.95rem;
}

.spiel-punkte-positiv {
    color: var(--success);
}

.spiel-punkte-negativ {
    color: var(--danger);
}

body.spiel-aktiv {
    overflow: hidden;
    touch-action: none;
}

/* ===================================================================
   ===================================================================
   MEDIA QUERIES — GESAMMELT NACH BREAKPOINT
   Alle responsive Anpassungen stehen ab hier zusammen, gruppiert
   absteigend nach Breakpoint-Breite (768px -> 350px).
   ===================================================================
   =================================================================== */

/* ===== prefers-color-scheme: dark ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --primary: #818cf8;
        --primary-hover: #6366f1;
        --primary-light: #1e1b4b;
        --primary-dark: #c7d2fe;
        --bg: #0f0f1a;
        --bg-secondary: #1a1a2e;
        --bg-tertiary: #16213e;
        --text: #f1f5f9;
        --text-secondary: #94a3b8;
        --text-muted: #64748b;
        --border: #2d2d44;
        --border-focus: #818cf8;
        --success: #34d399;
        --success-light: #064e3b;
        --danger: #f87171;
        --danger-light: #450a0a;
        --warning: #fbbf24;
        --warning-light: #451a03;
        --info: #60a5fa;
        --info-light: #1e3a5f;
    }
}

/* ===== min-width: 1024px ===== */
@media (min-width: 1024px) {
    .container {
        padding: 0 2rem;
    }
}

/* ===== min-width: 768px ===== */
@media (min-width: 768px) {
    .hidden-mobile {
        display: block;
    }

    .hidden-desktop {
        display: none;
    }
}

/* ===== min-width: 640px ===== */
@media (min-width: 640px) {
    .container {
        padding: 0 1.5rem;
    }
}

/* ===== max-width: 768px ===== */
@media (max-width: 768px) {
    .btn-icon-sm {
        width: 36px;
        height: 36px;
        padding: 0.5rem;
    }

    .form-input,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="date"],
    input[type="tel"],
    input[type="number"],
    input[type="search"],
    select,
    textarea {
        font-size: 1rem;
    }
}

/* ===== max-width: 650px ===== */
@media (max-width: 650px) {
    .header-side {
        min-width: 44px;
    }

    .header-title {
        font-size: 1.1rem;
    }

    .user-name {
        display: none;
    }
}

/* ===== max-width: 640px ===== */
@media (max-width: 640px) {
    .table {
        min-width: 480px;
    }

    .app-main {
        padding: 1.25rem 1rem;
    }

    .lobby-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

        .dashboard-header > div:last-child {
            width: 100%;
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
        }

        .dashboard-header .btn {
            flex: 1;
            justify-content: center;
        }

    .spiel-abstimmung-buttons {
        flex-direction: column;
    }
}

.modal-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}


.spiel-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Antwort-Buttons im Wissensquiz, Dark-Mode-tauglich */
.spiel-antwort-richtig {
    background: var(--success-light);
    border: 2px solid var(--success);
    color: var(--success);
}

.spiel-antwort-falsch {
    background: var(--danger-light);
    border: 2px solid var(--danger);
    color: var(--danger);
}

/* ===== max-width: 520px ===== */
@media (max-width: 520px) {
    .card-md {
        padding: 1.25rem;
        border-radius: var(--radius-md);
    }

    .auth-card {
        padding: 1.5rem 1.25rem;
        border-radius: var(--radius-md);
    }
}

/* ===== max-width: 480px ===== */
@media (max-width: 480px) {
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }

    .btn-hero {
        font-size: 1.4rem;
        padding: 0.875rem 2rem;
    }

    .badge-xl {
        padding: 0.6rem 1.25rem;
        font-size: 1.05rem;
    }

    .card {
        padding: 1rem;
    }

    .card-lg {
        padding: 1rem;
        max-height: 95vh;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .header-nav {
        gap: 8px;
    }

    .dashboard-wrapper {
        padding: 1rem;
    }

    .dashboard-panel {
        padding: 1rem;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
    }

        .dashboard-header .input-with-icon {
            max-width: 100% !important;
        }

    .plugin-grid {
        grid-template-columns: 1fr;
    }

    .manage-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

        .manage-tabs::-webkit-scrollbar {
            display: none;
        }

        .manage-tabs .manage-tab {
            flex-shrink: 0;
        }

    .spiel-flagge {
        max-width: 240px;
    }
}

/* ===== max-width: 400px ===== */
@media (max-width: 400px) {
    .modal-overlay {
        padding: 0.5rem;
    }

    .spiel-overlay {
        padding: 0.5rem;
    }
}

/* ===== max-width: 360px ===== */
@media (max-width: 360px) {
    .manage-header {
        gap: 0.75rem;
    }
}

/* ===== max-width: 350px ===== */
@media (max-width: 350px) {
    .plugin-name,
    .plugin-beschreibung {
        display: none;
    }

    .plugin-icon-wrapper {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .plugin-card {
        padding: 0.875rem 1rem;
        justify-content: center;
    }
}
