/* ============================================
   MeinTurniermanager - Stylesheet
   Modernes, responsives Design
   ============================================ */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary-color: #10b981;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --border-radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);

    /* Semantische Theme-Variablen (Light-Standard) */
    --bg-page: #f9fafb;
    --bg-surface: #ffffff;
    --bg-header: #ffffff;
    --text-color: #1f2937;
    --border-default: #e5e7eb;
    --thead-bg: #f3f4f6;
    --sidebar-bg: #111827;
    --sidebar-link: #d1d5db;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-page);
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */

.header {
    background: var(--bg-header);
    box-shadow: var(--shadow);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    /* Nötig für absolutes Nav-Dropdown auf Mobile */
    isolation: isolate;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav a {
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav a:hover {
    color: var(--primary-color);
}

.nav a.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-disabled {
    background: var(--gray-400);
    color: var(--gray-700);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-disabled:hover {
    background: var(--gray-400);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--gray-900);
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: 0.5rem;
}

.card-body {
    padding: 0.5rem 0;
}

/* ============================================
   TABLES
   ============================================ */

.table-container {
    overflow-x: auto;
    margin: 1rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-surface);
    border-radius: var(--border-radius);
    overflow: hidden;
}

thead {
    background: var(--thead-bg);
}

th {
    padding: 0.875rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 0.875rem;
    border-top: 1px solid var(--gray-200);
}

tr:hover {
    background: var(--gray-50);
}

.rank-cell {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--gray-700);
}

/* Podium-Styling: Gold, Silber, Bronze (nur in .podium Tabellen) */
.podium .rank-1 {
    background: linear-gradient(90deg, #fbbf24 0%, #fbbf24 4px, #fffbeb 4px, #fffbeb 100%);
}
.podium .rank-1:hover {
    background: linear-gradient(90deg, #fbbf24 0%, #fbbf24 4px, #fef3c7 4px, #fef3c7 100%) !important;
}
.podium .rank-1 .rank-cell {
    color: #b45309;
    font-size: 1.25rem;
}
.podium .rank-1 .team-name {
    color: #92400e;
}

.podium .rank-2 {
    background: linear-gradient(90deg, #9ca3af 0%, #9ca3af 4px, #f9fafb 4px, #f9fafb 100%);
}
.podium .rank-2:hover {
    background: linear-gradient(90deg, #9ca3af 0%, #9ca3af 4px, #f3f4f6 4px, #f3f4f6 100%) !important;
}
.podium .rank-2 .rank-cell {
    color: #4b5563;
    font-size: 1.25rem;
}

.podium .rank-3 {
    background: linear-gradient(90deg, #d97706 0%, #d97706 4px, #fffbeb 4px, #fff 100%);
}
.podium .rank-3:hover {
    background: linear-gradient(90deg, #d97706 0%, #d97706 4px, #fef9ee 4px, #fef9ee 100%) !important;
}
.podium .rank-3 .rank-cell {
    color: #92400e;
    font-size: 1.25rem;
}

.team-name {
    font-weight: 600;
    color: var(--gray-900);
}

.points-cell {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--primary-color);
}

th.text-center,
td.text-center {
    text-align: center;
}

th.text-right,
td.text-right {
    text-align: right;
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.875rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border-default);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    transition: border-color 0.2s;
    background: var(--bg-surface);
    color: var(--text-color);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

/* ============================================
   BADGES & STATUS
   ============================================ */

.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background: #d1fae5;
    border-color: #10b981;
    color: #065f46;
}

.alert-error {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}

.alert-info {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1e40af;
}

.alert-warning {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

/* ============================================
   GRID LAYOUTS
   ============================================ */

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* ============================================
   DISCIPLINE CARDS
   ============================================ */

.discipline-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.discipline-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.discipline-card h3 {
    font-size: 1.25rem;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.discipline-card .meta {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.discipline-card .status {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.login-box {
    background: var(--bg-surface);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--gray-900);
}

/* ============================================
   ADMIN SIDEBAR
   ============================================ */

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

.sidebar {
    width: 250px;
    min-height: 100vh;
    background: var(--sidebar-bg);
    color: white;
    padding: 2rem 0;
}

.sidebar h2 {
    font-size: 1.1rem;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav a {
    display: block;
    padding: 0.875rem 1.5rem;
    color: var(--sidebar-link);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--gray-800);
    color: white;
}

.main-content {
    flex: 1;
    padding: 2rem;
}

/* ============================================
   STATISTICS
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-surface);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-card .label {
    color: var(--gray-600);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   UTILITIES
   ============================================ */

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-primary { color: var(--primary-color); }
.text-success { color: var(--secondary-color); }
.text-danger { color: var(--danger-color); }

.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.fw-normal { font-weight: 400; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ============================================
   HAMBURGER BUTTON
   ============================================ */

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    transition: background 0.2s;
}

.hamburger:hover {
    background: var(--gray-100);
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--gray-700);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================================
   TABLE COLUMN TOGGLE
   ============================================ */

.btn-toggle-cols {
    display: none; /* nur auf mobile sichtbar */
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8rem;
    padding: 0.375rem 0.75rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    cursor: pointer;
    color: var(--gray-700);
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}

.btn-toggle-cols:hover {
    background: var(--gray-200);
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* ============================================
   ADMIN MOBILE BAR (via JS injiziert)
   ============================================ */

.admin-mobile-bar {
    display: none; /* nur auf mobile */
    align-items: center;
    justify-content: space-between;
    background: var(--sidebar-bg);
    color: white;
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 110;
}

.admin-mobile-bar .admin-mobile-title {
    font-weight: 600;
    font-size: 1rem;
    color: white;
}

/* Hamburger-Streifen auf dunklem Hintergrund weiß */
.admin-mobile-bar .hamburger span {
    background: white;
}

@media (max-width: 768px) {
    /* --- Admin Layout --- */
    .admin-layout {
        flex-direction: column;
        position: relative;
    }

    .admin-mobile-bar {
        display: flex;
    }

    /* Sidebar standardmäßig versteckt auf Mobile */
    .sidebar {
        display: none;
        width: 100%;
    }

    /* Sidebar eingeblendet wenn geöffnet */
    .admin-layout.sidebar-open .sidebar {
        display: block;
    }

    .main-content {
        padding: 1rem;
    }

    /* --- Header kompakter --- */
    .header {
        padding: 0.625rem 0;
    }

    .header-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    /* Inline-Styles im header.php überschreiben */
    .header-logo {
        height: 35px !important;
    }

    .header-title .app-name {
        font-size: 1.15rem !important;
    }

    .header-title .turnier-name {
        font-size: 0.8rem !important;
    }

    /* --- Hamburger sichtbar, Nav als Dropdown --- */
    .hamburger {
        display: flex;
    }

    .nav {
        display: none;
        flex-direction: column;
        gap: 0;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-header);
        box-shadow: var(--shadow-lg);
        z-index: 200;
        padding: 0.5rem 0;
        border-top: 1px solid var(--border-default);
    }

    .nav.nav-open {
        display: flex;
    }

    .nav li {
        width: 100%;
    }

    .nav a {
        display: flex;
        align-items: center;
        padding: 0.875rem 1.5rem;
        min-height: 44px;
        border-bottom: none !important;
    }

    .nav a.active {
        background: var(--gray-50);
        border-left: 3px solid var(--primary-color) !important;
    }

    /* --- Grids --- */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    /* --- Tabellen --- */
    .table-container {
        font-size: 0.875rem;
    }

    th, td {
        padding: 0.5rem;
    }

    /* --- Spalten-Toggle Button auf Mobile anzeigen --- */
    .btn-toggle-cols {
        display: inline-flex;
    }

    /* Versteckte Spalten auf Mobile */
    .col-mobile-hidden {
        display: none;
    }

    /* Wenn Toggle aktiv: alle Spalten sichtbar */
    .table-container.show-all-cols .col-mobile-hidden {
        display: table-cell;
    }
}

/* ============================================
   MODALS
   ============================================ */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-surface);
    margin: auto;
    padding: 0;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--gray-900);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-600);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: var(--gray-900);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* ============================================
   KO-BRACKET MATCH CARDS
   ============================================ */

.ko-match-card {
    padding: 0.85rem 1.1rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    display: grid;
    grid-template-columns: 2fr auto 2fr auto;
    gap: 1rem;
    align-items: center;
}

.ko-match-team1 {
    text-align: right;
    font-size: 1.05rem;
}

.ko-match-score {
    padding: 0 0.75rem;
    text-align: center;
    min-width: 80px;
}

.ko-match-team2 {
    text-align: left;
    font-size: 1.05rem;
}

.ko-match-status {
    text-align: right;
    min-width: 90px;
}

@media (max-width: 768px) {
    .ko-match-card {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto auto;
        gap: 0.2rem 0.6rem;
    }

    .ko-match-team1 {
        text-align: left;
        grid-column: 1;
        grid-row: 1;
        font-size: 0.95rem;
    }

    .ko-match-score {
        grid-column: 2;
        grid-row: 1 / 3;
        min-width: 55px;
        padding: 0 0.4rem;
        align-self: center;
    }

    .ko-match-team2 {
        text-align: left;
        grid-column: 1;
        grid-row: 2;
        font-size: 0.95rem;
    }

    .ko-match-status {
        grid-column: 1 / 3;
        grid-row: 3;
        text-align: left;
        min-width: unset;
        padding-top: 0.3rem;
    }
}

@media print {
    .header,
    .sidebar,
    .btn,
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
}

/* ============================================
   MODALS (Pop-up Windows)
   ============================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-surface);
    border-radius: var(--border-radius);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--gray-900);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.close-btn:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

/* Modal Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Close modal when clicking outside */
.modal:not(.no-backdrop-close) {
    cursor: pointer;
}

.modal-content {
    cursor: default;
}

/* ============================================
   THEME SWITCHER
   ============================================ */

.theme-switcher {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.theme-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem 0.375rem;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s, border-color 0.2s, background 0.2s;
    color: var(--text-color);
}

.theme-btn:hover {
    opacity: 1;
    background: var(--gray-100);
}

.theme-btn.active {
    opacity: 1;
    border-color: var(--primary-color);
    background: var(--gray-100);
}

/* Sidebar theme switcher */
.sidebar-theme-switcher {
    display: flex;
    gap: 0.25rem;
    padding: 0.75rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: auto;
}

.sidebar-theme-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.25rem 0.4rem;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s, border-color 0.2s, background 0.2s;
    color: white;
}

.sidebar-theme-btn:hover {
    opacity: 1;
    background: rgba(255,255,255,0.2);
}

.sidebar-theme-btn.active {
    opacity: 1;
    border-color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.2);
}

/* ============================================
   DARK THEME
   ============================================ */

[data-theme="dark"] {
    --primary-color: #60a5fa;
    --primary-dark: #3b82f6;
    --primary-light: #93c5fd;
    --secondary-color: #34d399;
    --success-color: #34d399;
    --danger-color: #f87171;
    --warning-color: #fbbf24;

    --bg-page: #0f172a;
    --bg-surface: #1e293b;
    --bg-header: #1e293b;
    --text-color: #f1f5f9;
    --border-default: #334155;
    --thead-bg: #0f172a;
    --sidebar-bg: #020617;
    --sidebar-link: #94a3b8;

    /* Gray-Overrides für Dark-Kontext */
    --gray-50: #1e293b;
    --gray-100: #0f172a;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-400: #64748b;
    --gray-500: #94a3b8;
    --gray-600: #cbd5e1;
    --gray-700: #e2e8f0;
    --gray-800: #f1f5f9;
    --gray-900: #f8fafc;
}

[data-theme="dark"] .badge-success {
    background: rgba(52, 211, 153, 0.15);
    color: #6ee7b7;
}
[data-theme="dark"] .badge-warning {
    background: rgba(251, 191, 36, 0.15);
    color: #fde68a;
}
[data-theme="dark"] .badge-info {
    background: rgba(96, 165, 250, 0.15);
    color: #93c5fd;
}
[data-theme="dark"] .badge-danger {
    background: rgba(248, 113, 113, 0.15);
    color: #fca5a5;
}

[data-theme="dark"] .alert-success {
    background: rgba(52, 211, 153, 0.1);
    border-color: #34d399;
    color: #6ee7b7;
}
[data-theme="dark"] .alert-error {
    background: rgba(248, 113, 113, 0.1);
    border-color: #f87171;
    color: #fca5a5;
}
[data-theme="dark"] .alert-info {
    background: rgba(96, 165, 250, 0.1);
    border-color: #60a5fa;
    color: #93c5fd;
}
[data-theme="dark"] .alert-warning {
    background: rgba(251, 191, 36, 0.1);
    border-color: #fbbf24;
    color: #fde68a;
}

[data-theme="dark"] .hamburger span {
    background: var(--gray-300);
}

[data-theme="dark"] .theme-btn:hover,
[data-theme="dark"] .theme-btn.active {
    background: rgba(255,255,255,0.1);
}

[data-theme="dark"] .podium .rank-1,
[data-theme="dark"] .podium .rank-2,
[data-theme="dark"] .podium .rank-3 {
    color: var(--text-color);
}
[data-theme="dark"] .podium .rank-1 {
    background: linear-gradient(90deg, #fbbf24 0%, #fbbf24 4px, rgba(251,191,36,0.12) 4px, rgba(251,191,36,0.12) 100%);
}
[data-theme="dark"] .podium .rank-1:hover {
    background: linear-gradient(90deg, #fbbf24 0%, #fbbf24 4px, rgba(251,191,36,0.22) 4px, rgba(251,191,36,0.22) 100%) !important;
}
[data-theme="dark"] .podium .rank-1 .team-name {
    color: #fde68a;
}
[data-theme="dark"] .podium .rank-2 {
    background: linear-gradient(90deg, #9ca3af 0%, #9ca3af 4px, rgba(156,163,175,0.08) 4px, rgba(156,163,175,0.08) 100%);
}
[data-theme="dark"] .podium .rank-2:hover {
    background: linear-gradient(90deg, #9ca3af 0%, #9ca3af 4px, rgba(156,163,175,0.18) 4px, rgba(156,163,175,0.18) 100%) !important;
}
[data-theme="dark"] .podium .rank-2 .rank-cell {
    color: var(--gray-500);
}
[data-theme="dark"] .podium .rank-3 {
    background: linear-gradient(90deg, #d97706 0%, #d97706 4px, rgba(217,119,6,0.1) 4px, rgba(217,119,6,0.1) 100%);
}
[data-theme="dark"] .podium .rank-3:hover {
    background: linear-gradient(90deg, #d97706 0%, #d97706 4px, rgba(217,119,6,0.2) 4px, rgba(217,119,6,0.2) 100%) !important;
}

/* ============================================
   DARKGREEN THEME
   ============================================ */

[data-theme="darkgreen"] {
    --primary-color: #4ade80;
    --primary-dark: #22c55e;
    --primary-light: #86efac;
    --secondary-color: #fbbf24;
    --success-color: #34d399;
    --danger-color: #f87171;
    --warning-color: #fbbf24;

    --bg-page: #0a1510;
    --bg-surface: #0f2218;
    --bg-header: #0f2218;
    --text-color: #f0fdf4;
    --border-default: #1c3828;
    --thead-bg: #0a1510;
    --sidebar-bg: #050d08;
    --sidebar-link: #4ade80;

    /* Gray-Overrides für DarkGreen-Kontext */
    --gray-50: #0f2218;
    --gray-100: #0a1510;
    --gray-200: #1c3828;
    --gray-300: #264d38;
    --gray-400: #2e6045;
    --gray-500: #86efac;
    --gray-600: #bbf7d0;
    --gray-700: #d1fae5;
    --gray-800: #ecfdf5;
    --gray-900: #f0fdf4;
}

[data-theme="darkgreen"] .badge-success {
    background: rgba(52, 211, 153, 0.15);
    color: #6ee7b7;
}
[data-theme="darkgreen"] .badge-warning {
    background: rgba(251, 191, 36, 0.15);
    color: #fde68a;
}
[data-theme="darkgreen"] .badge-info {
    background: rgba(74, 222, 128, 0.15);
    color: #86efac;
}
[data-theme="darkgreen"] .badge-danger {
    background: rgba(248, 113, 113, 0.15);
    color: #fca5a5;
}

[data-theme="darkgreen"] .alert-success {
    background: rgba(52, 211, 153, 0.1);
    border-color: #34d399;
    color: #6ee7b7;
}
[data-theme="darkgreen"] .alert-error {
    background: rgba(248, 113, 113, 0.1);
    border-color: #f87171;
    color: #fca5a5;
}
[data-theme="darkgreen"] .alert-info {
    background: rgba(74, 222, 128, 0.1);
    border-color: #4ade80;
    color: #86efac;
}
[data-theme="darkgreen"] .alert-warning {
    background: rgba(251, 191, 36, 0.1);
    border-color: #fbbf24;
    color: #fde68a;
}

[data-theme="darkgreen"] .hamburger span {
    background: var(--gray-300);
}

[data-theme="darkgreen"] .theme-btn:hover,
[data-theme="darkgreen"] .theme-btn.active {
    background: rgba(255,255,255,0.1);
}

[data-theme="darkgreen"] .podium .rank-1,
[data-theme="darkgreen"] .podium .rank-2,
[data-theme="darkgreen"] .podium .rank-3 {
    color: var(--text-color);
}
[data-theme="darkgreen"] .podium .rank-1 {
    background: linear-gradient(90deg, #fbbf24 0%, #fbbf24 4px, rgba(251,191,36,0.12) 4px, rgba(251,191,36,0.12) 100%);
}
[data-theme="darkgreen"] .podium .rank-1:hover {
    background: linear-gradient(90deg, #fbbf24 0%, #fbbf24 4px, rgba(251,191,36,0.22) 4px, rgba(251,191,36,0.22) 100%) !important;
}
[data-theme="darkgreen"] .podium .rank-1 .team-name {
    color: #fde68a;
}
[data-theme="darkgreen"] .podium .rank-2 {
    background: linear-gradient(90deg, #9ca3af 0%, #9ca3af 4px, rgba(156,163,175,0.08) 4px, rgba(156,163,175,0.08) 100%);
}
[data-theme="darkgreen"] .podium .rank-2:hover {
    background: linear-gradient(90deg, #9ca3af 0%, #9ca3af 4px, rgba(156,163,175,0.18) 4px, rgba(156,163,175,0.18) 100%) !important;
}
[data-theme="darkgreen"] .podium .rank-2 .rank-cell {
    color: var(--gray-500);
}
[data-theme="darkgreen"] .podium .rank-3 {
    background: linear-gradient(90deg, #d97706 0%, #d97706 4px, rgba(217,119,6,0.1) 4px, rgba(217,119,6,0.1) 100%);
}
[data-theme="darkgreen"] .podium .rank-3:hover {
    background: linear-gradient(90deg, #d97706 0%, #d97706 4px, rgba(217,119,6,0.2) 4px, rgba(217,119,6,0.2) 100%) !important;
}

/* Sidebar-Navigation Hover/Active: gray-800 ist in dunklen Themes hell → überschreiben */
[data-theme="dark"] .sidebar-nav a:hover,
[data-theme="dark"] .sidebar-nav a.active,
[data-theme="darkgreen"] .sidebar-nav a:hover,
[data-theme="darkgreen"] .sidebar-nav a.active {
    background: rgba(255,255,255,0.08);
    color: var(--text-color);
}
