/* Modern Duolingo-inspired Design */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;600;700&display=swap');

:root {
    --primary-green: #58cc02;
    --secondary-green: #46a302;
    --light-green: #e8f5e8;
    --accent-yellow: #ffc800;
    --accent-orange: #ff9600;
    --text-dark: #3c3c3c;
    --text-light: #666;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.15);
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--text-dark);
    line-height: 1.6;
}

header {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    color: white;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.header-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem;
}

.header-content .back-button {
    justify-self: start;
}

.header-content .header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.header-content .header-logout-btn {
    justify-self: end;
}

.header-spacer {
    display: block;
    width: 40px;
    height: 40px;
}

.header-icon {
    font-size: 1.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
    60% { transform: translateY(-3px); }
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

main {
    min-height: calc(100vh - 80px);
    padding: 1rem;
}

.view {
    display: block;
}

.view.hidden {
    display: none;
}

#start-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    text-align: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.hero {
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease-out;
}

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

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

.hero-icon {
    font-size: 4rem;
    color: var(--primary-green);
    margin-bottom: 1rem;
    animation: rocket 3s ease-in-out infinite;
}

@keyframes rocket {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary-green), var(--accent-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    margin: 0;
    color: var(--text-light);
    font-size: 1.2rem;
    font-weight: 400;
    max-width: 600px;
}

.tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.2rem;
    width: 100%;
    max-width: 1240px;
}

.tile {
    background: white;
    color: var(--text-dark);
    border-radius: var(--border-radius);
    padding: 1.2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    animation: slideIn 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(88, 204, 2, 0.1), transparent);
    transition: left 0.5s;
}

.tile:hover::before {
    left: 100%;
}

.tile:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-green);
}

.tile-icon {
    font-size: 2.2rem;
    color: var(--primary-green);
    margin-bottom: 0.6rem;
    transition: var(--transition);
}

.tile:hover .tile-icon {
    transform: scale(1.1);
    color: var(--accent-orange);
}

.tile h2 {
    margin: 0 0 0.35rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    text-align: center;
}

.tile p {
    margin: 0 0 0.7rem 0;
    font-size: 0.92rem;
    color: var(--text-light);
    line-height: 1.35;
    text-align: center;
}

.tile-badge {
    background: var(--accent-yellow);
    color: var(--text-dark);
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: auto;
}

.quiz-view {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
}

.quiz-intro,
.quiz-panel,
.quiz-result-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.quiz-intro {
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
}

.quiz-intro h2 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-green);
    font-size: 2rem;
}

.quiz-intro p,
.section-heading p,
.level-card p,
.feedback-box,
.result-recommendation {
    color: var(--text-light);
}

.quiz-level-section {
    display: block;
}

.section-heading {
    margin-bottom: 1rem;
}

.section-heading h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.4rem;
    color: var(--text-dark);
}

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

.level-card {
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    background: white;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.level-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-green);
    box-shadow: var(--shadow-hover);
}

.level-chip,
.level-meta,
.quiz-progress-badge,
.quiz-label,
.quiz-question-label {
    display: inline-flex;
    align-items: center;
    font-weight: 700;
}

.level-chip {
    background: var(--light-green);
    color: var(--secondary-green);
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.85rem;
    margin-bottom: 0.9rem;
}

.level-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: var(--text-dark);
}

    font-size: 0.8rem;
    margin: 0 0 1rem 0;
    min-height: 72px;
}

.level-meta {
    color: var(--accent-orange);
    font-size: 0.9rem;
}

.quiz-panel {
    padding: 1.5rem;
}

.quiz-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.quiz-meta h3 {
    margin: 0.25rem 0 0 0;
    font-size: 1.5rem;
    color: var(--text-dark);
}

.quiz-label,
.quiz-question-label {
    color: var(--accent-orange);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.quiz-progress-badge {
    background: var(--light-green);
    color: var(--secondary-green);
    padding: 0.6rem 0.9rem;
    border-radius: 999px;
    white-space: nowrap;
}

.quiz-card {
    background: linear-gradient(180deg, #ffffff 0%, #f9fff1 100%);
    border: 1px solid rgba(88, 204, 2, 0.12);
    border-radius: var(--border-radius);
    padding: 1.75rem;
}

.quiz-card h2 {
    margin: 0.35rem 0 1.5rem 0;
    font-size: 1.9rem;
    line-height: 1.25;
}

.answers-list {
    display: grid;
    gap: 0.85rem;
}

.answer-option {
    width: 100%;
    border: 2px solid #dfe7d4;
    border-radius: 14px;
    background: white;
    color: var(--text-dark);
    padding: 1rem 1.1rem;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.answer-option:hover:not(:disabled),
.answer-option.selected {
    border-color: var(--primary-green);
    background: #f6ffed;
}

.answer-option.correct,
.answer-option.correct:hover {
    border-color: #169c48;
    background: #dff7e8;
    color: #0d6b31;
}

.answer-option.wrong,
.answer-option.wrong:hover {
    border-color: #d93434;
    background: #ffe2e2;
    color: #8a1f1f;
}

.answer-option:disabled {
    cursor: default;
}

.feedback-box {
    margin-top: 1rem;
    border-radius: 14px;
    padding: 1rem 1.1rem;
    font-weight: 600;
    white-space: pre-line;
}

.question-count-modal-content {
    max-width: 520px;
    margin: 10vh auto;
    border: 2px solid #e5f1d8;
    background: linear-gradient(180deg, #ffffff 0%, #f8fff1 100%);
}

.question-count-description {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.question-count-label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.question-count-input {
    width: 100%;
    border: 2px solid #d9e9c8;
    border-radius: 12px;
    padding: 0.85rem 0.95rem;
    font-size: 1rem;
    font-weight: 700;
    transition: var(--transition);
    background: #fff;
}

.question-count-input:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(88, 204, 2, 0.15);
}

.question-count-error {
    margin-top: 0.6rem;
    margin-bottom: 0;
    color: #932727;
    font-weight: 700;
}

.question-count-actions {
    margin-top: 1.4rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.feedback-correct {
    background: #e5f9ed;
    color: #116e35;
}

.feedback-wrong {
    background: #ffe8e8;
    color: #932727;
}

.quiz-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.quiz-button {
    border: none;
    border-radius: 12px;
    padding: 0.9rem 1.3rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    color: white;
}

.quiz-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 204, 2, 0.35);
}

.quiz-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.quiz-button-secondary {
    background: #eef4e7;
    color: var(--text-dark);
}

@media (max-width: 600px) {
    .question-count-modal-content {
        margin: 6vh auto;
        padding: 1.4rem;
    }

    .question-count-actions {
        justify-content: stretch;
    }

    .question-count-actions .quiz-button {
        width: 100%;
    }
}

.quiz-result {
    display: block;
}

.quiz-result-card {
    padding: 1.75rem;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin: 1.25rem 0;
}

.result-stat {
    background: var(--light-green);
    border-radius: 14px;
    padding: 1rem;
}

.result-stat span {
    display: block;
    color: var(--text-light);
    margin-bottom: 0.35rem;
}

.result-stat strong {
    font-size: 1.6rem;
    color: var(--secondary-green);
}

.result-recommendation {
    margin: 0;
    font-size: 1rem;
}

.hidden {
    display: none;
}

    .tournaments-view {
        max-width: 1100px;
        margin: 0 auto;
        padding: 2rem 1rem;
    }

    .tournaments-intro {
        background: white;
        padding: 1.5rem 1.75rem;
        border-radius: var(--border-radius);
        box-shadow: var(--shadow);
        margin-bottom: 1.75rem;
    }

    .tournaments-intro h2 {
        margin: 0 0 0.5rem 0;
        color: var(--primary-green);
        font-size: 2rem;
    }

    .tournaments-intro p {
        margin: 0;
        color: var(--text-light);
        font-size: 1rem;
    }

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

    .table-controls label {
        font-weight: 600;
        color: var(--text-dark);
    }

    .table-controls input {
        flex: 1;
        min-width: 220px;
        border: 2px solid #e0e0e0;
        border-radius: 12px;
        padding: 0.75rem 1rem;
        font-size: 1rem;
        transition: var(--transition);
    }

    .table-controls input:focus {
        outline: none;
        border-color: var(--primary-green);
        box-shadow: 0 0 0 4px rgba(88, 204, 2, 0.12);
    }

    #add-training-btn {
        width: auto;
        height: auto;
        white-space: nowrap;
        padding: 0.75rem 1rem;
        flex: 0 0 auto;
    }

    .table-wrapper {
        overflow-x: auto;
        background: white;
        border-radius: var(--border-radius);
        box-shadow: var(--shadow);
        border: 1px solid rgba(88, 204, 2, 0.12);
    }

    .tournaments-table {
        width: 100%;
        border-collapse: collapse;
        min-width: 680px;
    }

    .tournaments-table th,
    .tournaments-table td {
        padding: 1rem 1.25rem;
        text-align: left;
    }

    .tournaments-table thead {
        background: var(--light-green);
    }

    .tournaments-table th {
        cursor: pointer;
        color: var(--text-dark);
        font-weight: 700;
        position: relative;
        user-select: none;
        font-size: 0.95rem;
    }

    .tournaments-table th .sort-indicator {
        margin-left: 0.5rem;
        font-size: 0.8rem;
        color: var(--primary-green);
    }

    .tournaments-table tbody tr {
        border-bottom: 1px solid #eaeaea;
        transition: var(--transition);
    }

    .tournaments-table tbody tr:hover {
        background: #f7fdf7;
        transform: translateY(-1px);
    }

    .tournament-row-clickable {
        cursor: pointer;
    }

    .tournaments-table td {
        color: var(--text-dark);
        font-size: 0.95rem;
        vertical-align: top;
    }

    .tournaments-table td::before {
        content: attr(data-label);
        display: none;
    }

    .tournaments-table th:first-child,
    .tournaments-table td:first-child {
        width: 170px;
    }

    .tournaments-table th:nth-child(2),
    .tournaments-table td:nth-child(2) {
        width: 210px;
    }

    .weiterbildungen-table {
        table-layout: fixed;
        min-width: 1020px;
    }

    .weiterbildungen-table th:nth-child(1),
    .weiterbildungen-table td:nth-child(1) {
        width: 26%;
    }

    .weiterbildungen-table th:nth-child(2),
    .weiterbildungen-table td:nth-child(2) {
        width: 12%;
    }

    .weiterbildungen-table th:nth-child(3),
    .weiterbildungen-table td:nth-child(3) {
        width: 13%;
    }

    .weiterbildungen-table th:nth-child(4),
    .weiterbildungen-table td:nth-child(4) {
        width: 17%;
    }

    .weiterbildungen-table th:nth-child(5),
    .weiterbildungen-table td:nth-child(5) {
        width: 16%;
    }

    .weiterbildungen-table th:nth-child(6),
    .weiterbildungen-table td:nth-child(6) {
        width: 16%;
    }

    .weiterbildungen-table td {
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
        font-size: 0.95rem;
    }

    .weiterbildungen-table td:nth-child(3) {
        white-space: nowrap;
        overflow-wrap: normal;
        word-break: normal;
    }

    .weiterbildungen-table td:nth-child(3) .date-pill {
        white-space: nowrap;
    }

    .weiterbildung-status-badge {
        display: inline-flex;
        align-items: center;
        padding: 0.22rem 0.55rem;
        border-radius: 999px;
        font-size: 0.95rem;
        font-weight: 700;
        line-height: 1.2;
        white-space: nowrap;
    }

    .weiterbildung-status-geplant {
        background: #f0f0f0;
        color: #5a5a5a;
    }

    .weiterbildung-status-veroeffentlicht {
        background: #fff4bf;
        color: #8a6a00;
    }

    .weiterbildung-status-abgeschlossen {
        background: #e4f8e6;
        color: #17703a;
    }

    .weiterbildung-status-default {
        background: #e9edf3;
        color: #394a5f;
    }

    .date-pill {
        display: inline-flex;
        align-items: center;
        padding: 0.45rem 0.75rem;
        border-radius: 999px;
        background: var(--light-green);
        color: var(--secondary-green);
        font-weight: 700;
        line-height: 1.35;
    }

    .need-badges {
        display: flex;
        flex-wrap: wrap;
        gap: 0.45rem;
    }

    .need-badge {
        display: inline-flex;
        align-items: center;
        padding: 0.35rem 0.65rem;
        border-radius: 999px;
        font-size: 0.8rem;
        font-weight: 700;
        line-height: 1.2;
        white-space: nowrap;
    }

    .need-badge-osr {
        background: #e4f8e6;
        color: #17703a;
    }

    .need-badge-el {
        background: #fff1d6;
        color: #9a5a00;
    }

    .need-badge-rt {
        background: #e8f1ff;
        color: #2254a3;
    }

    .need-badge-srat {
        background: #f3e9ff;
        color: #7240a8;
    }

    .need-badge-default {
        background: #f1f1f1;
        color: var(--text-dark);
    }

    .need-badge-full {
        background: #e4f8e6;
        color: #17703a;
    }

    .need-badge-partial {
        background: #fff1d6;
        color: #9a5a00;
    }

    .need-badge-empty {
        background: #f1f1f1;
        color: #666;
    }

    .tournaments-table tbody tr:last-child {
        border-bottom: none;
    }

.back-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.breadcrumb {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.breadcrumb-item {
    cursor: pointer;
    color: var(--primary-green);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    transition: var(--transition);
    font-weight: 500;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.breadcrumb-item:hover {
    background: var(--primary-green);
    color: white;
}

.anmelden-btn {
    width: 100%;
    height: 100%;
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
    padding: 0.5rem 1rem;
}

.anmelden-btn:hover {
    background: var(--secondary-green);
    transform: scale(1.02);
}

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

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 2rem;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow);
}

.modal-content.modal-large {
    max-width: 800px;
    margin: 5% auto;
}

.close {
    color: var(--text-light);
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: var(--text-dark);
}

#turnier-info,
.tournament-info-box {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--light-green);
    border-radius: var(--border-radius);
}

.referees-list-container {
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.referees-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.referees-table th {
    background: var(--light-green);
    padding: 0.75rem 0.5rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--primary-green);
}

.referees-table td {
    padding: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.referees-table tbody tr:hover {
    background: #f9f9f9;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.status-bestätigt {
    background: var(--light-green);
    color: var(--secondary-green);
}

.status-badge.status-beworben {
    background: #fff3cd;
    color: #856404;
}

.status-badge.status-abgesagt {
    background: #f8d7da;
    color: #721c24;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
    padding-top: 1rem;
}

#anmeldung-form label {
    display: block;
    margin-top: 1rem;
    font-weight: 600;
}

#anmeldung-form input,
#anmeldung-form select {
    width: 100%;
    padding: 0.5rem;
    margin-top: 0.25rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
}

#new-training-referenten {
    min-height: 140px;
}

.referenten-live-results {
    display: none;
    margin-top: 0.4rem;
    border: 1px solid #d7e6c9;
    border-radius: 10px;
    background: #ffffff;
    max-height: 180px;
    overflow-y: auto;
}

.referenten-live-results.is-visible {
    display: block;
}

.referenten-live-item {
    width: 100%;
    border: none;
    border-bottom: 1px solid #e7efd9;
    background: transparent;
    text-align: left;
    padding: 0.55rem 0.8rem;
    font-size: 0.92rem;
    color: #243044;
    cursor: pointer;
}

.referenten-live-item:last-child {
    border-bottom: none;
}

.referenten-live-item:hover {
    background: #f4fbe9;
}

.referenten-live-empty {
    padding: 0.55rem 0.8rem;
    font-size: 0.88rem;
    color: #5f6f89;
}

.referenten-selected-list {
    margin-top: 0.65rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.assigned-referees-table {
    width: 100%;
    margin-top: 0.65rem;
    border-collapse: collapse;
    background: #ffffff;
    font-size: 0.9rem;
}

.assigned-referees-table th,
.assigned-referees-table td {
    padding: 0.6rem 0.7rem;
    border: 1px solid #e7efd9;
    text-align: left;
    vertical-align: middle;
}

.assigned-referees-table th {
    background: #f4fbe9;
    color: #2f6b3f;
    font-weight: 700;
    white-space: nowrap;
}

.assigned-referees-table th.need-badge-empty {
    background: #f1f1f1;
    color: #666;
}

.assigned-referees-table th.need-badge-partial {
    background: #fff1d6;
    color: #9a5a00;
}

.assigned-referees-table th.need-badge-full {
    background: #e4f8e6;
    color: #17703a;
}

.assigned-referees-table th.need-badge-over {
    background: #fde2e2;
    color: #b42318;
}

.assigned-referees-table .assignment-day-cell {
    min-width: 6.25rem;
    text-align: center;
}

.assigned-referees-table td:last-child,
.assigned-referees-table th:last-child {
    width: 2.75rem;
    text-align: center;
}

.assignment-participation-select {
    min-width: 8.5rem;
    padding: 0.45rem 0.6rem;
    font-size: 0.9rem;
}

.assignment-partial-dates {
    display: grid;
    grid-template-columns: repeat(2, minmax(8rem, 1fr));
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.assignment-partial-dates .form-control {
    min-width: 0;
    padding: 0.45rem 0.5rem;
    font-size: 0.85rem;
}

.assignment-day-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.7rem;
    min-width: 14rem;
}

.assignment-day-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
}

.assignment-day-option input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--primary-green);
}

.assignment-role-block {
    padding: 1rem;
    border: 1px solid #d7e6c9;
    border-left: 4px solid #58cc02;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 2px 8px rgba(46, 71, 110, 0.06);
}

.assignment-role-block + .assignment-role-block {
    margin-top: 0.8rem;
}

@media (max-width: 900px) {
    .assigned-referees-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .assigned-referees-table th,
    .assigned-referees-table td {
        min-width: 8rem;
    }
}

.teilnehmer-selected-table-host {
    display: block;
}

.referenten-selected-empty {
    font-size: 0.9rem;
    color: #5f6f89;
}

.training-person-table-wrapper {
    border: 1px solid #d7e6c9;
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
}

.training-person-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.training-person-table th,
.training-person-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid #e7efd9;
    text-align: left;
    vertical-align: middle;
}

.training-person-table th {
    background: #f4fbe9;
    color: #2f6b3f;
    font-weight: 700;
}

.training-person-table tbody tr:last-child td {
    border-bottom: none;
}

.training-person-table td:last-child,
.training-person-table th:last-child {
    width: 3rem;
    text-align: center;
}

.training-person-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 999px;
    border: 1px solid #bfe2bf;
    background: #f4fbe9;
}

.referenten-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #e8f5e8;
    color: #2f6b3f;
    border: 1px solid #bfe2bf;
    border-radius: 999px;
    padding: 0.25rem 0.55rem;
    font-size: 0.85rem;
}

.referenten-chip-remove {
    border: none;
    background: transparent;
    color: #2f6b3f;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
}

.referenten-chip-remove:hover {
    color: #1f4a2c;
}

#anmeldung-form button {
    margin-top: 1.5rem;
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
}

#anmeldung-form button:hover {
    background: var(--secondary-green);
}

#current-node h2 {
    color: var(--primary-green);
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

#children-list {
    display: grid;
    gap: 0.75rem;
}

.child-node {
    padding: 1rem 1.5rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.child-node:hover {
    border-color: var(--primary-green);
    background: var(--light-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.details-container {
    flex: 1;
    padding: 2rem;
    background: white;
    overflow-y: auto;
}

.details {
    background: var(--light-green);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.05);
    min-height: 100%;
}

.details-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.details-header i {
    color: var(--primary-green);
    font-size: 1.5rem;
}

.details-header h3 {
    margin: 0;
    color: var(--primary-green);
    font-size: 1.4rem;
    font-weight: 600;
}

.details h2 {
    color: var(--primary-green);
    margin-bottom: 1rem;
    font-size: 1.6rem;
    font-weight: 700;
}

.details p {
    margin: 1rem 0;
    font-size: 1rem;
    line-height: 1.6;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.details li {
    margin: 0.75rem 0;
    line-height: 1.6;
    position: relative;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.details li::marker {
    color: var(--primary-green);
}

.details button {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(88, 204, 2, 0.3);
    margin-top: 1rem;
}

.details button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 204, 2, 0.4);
}

.referee-view {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
}

.referee-hero {
    position: relative;
    background: linear-gradient(130deg, #1f2f54 0%, #2d4a86 55%, #58cc02 120%);
    color: white;
    border-radius: 22px;
    padding: 1.7rem 1.8rem;
    box-shadow: 0 18px 35px rgba(31, 47, 84, 0.2);
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.referee-hero::after {
    content: '';
    position: absolute;
    width: 220px;
    height: 220px;
    right: -70px;
    top: -70px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 72%);
}

.referee-kicker {
    margin: 0;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
}

.referee-hero h2 {
    margin: 0.35rem 0 0.45rem;
    font-size: 2rem;
}

.referee-hero p {
    margin: 0;
    max-width: 620px;
    color: rgba(255, 255, 255, 0.9);
}

.referee-photo-container {
    width: 140px;
    height: 140px;
    border-radius: 12px;
    background: white;
    border: 2px solid rgba(88, 204, 2, 0.3);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.referee-photo-container:hover {
    border-color: #58cc02;
    box-shadow: 0 4px 12px rgba(88, 204, 2, 0.2);
}

.referee-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.referee-photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #ccc;
    font-size: 2rem;
    text-align: center;
    width: 100%;
    height: 100%;
}

.referee-photo-placeholder i {
    font-size: 3rem;
    color: #ddd;
}


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

.referee-list-toolbar,
.admin-users-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.referee-search-input,
.referee-filter-select {
    border: 2px solid #d9e4f7;
    border-radius: 12px;
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    transition: var(--transition);
}

.referee-search-input {
    flex: 1;
    min-width: 220px;
}

.referee-filter-select {
    min-width: 170px;
}

.referee-search-input:focus,
.referee-filter-select:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 4px rgba(88, 204, 2, 0.12);
}

.referee-count {
    margin-left: auto;
    font-weight: 700;
    color: #1f2f54;
    background: #eef4ff;
    border-radius: 999px;
    padding: 0.45rem 0.8rem;
    font-size: 0.85rem;
}

.referee-table-wrapper {
    background: white;
    border: 1px solid rgba(31, 47, 84, 0.12);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: auto;
    max-height: 62vh;
}

.referee-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 460px;
}

.referee-table th,
.referee-table td {
    padding: 0.72rem 0.9rem;
    text-align: left;
    font-size: 0.94rem;
}

.referee-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.referee-table th {
    background: #ecf3ff;
    color: #1f2f54;
    font-weight: 800;
    letter-spacing: 0.02em;
    border-bottom: 1px solid #dce5f6;
}

.referee-table .sortable-th {
    cursor: pointer;
    user-select: none;
}

.referee-table .sortable-th .sort-indicator {
    display: inline-block;
    min-width: 0.9rem;
    margin-left: 0.2rem;
    color: #4d638f;
    font-size: 0.75rem;
}

.referee-row {
    cursor: pointer;
}

.referee-table tbody tr {
    border-bottom: 1px solid #edf1f7;
}

.referee-table tbody tr:last-child {
    border-bottom: none;
}

.referee-table tbody tr:hover {
    background: #f7fbff;
}

.referee-user-link {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.referee-user-name {
    font-size: 0.82rem;
    color: #5a6a83;
    font-weight: 700;
}

.referee-assignment-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
}

.referee-assignment-linked {
    background: #e6f2ff;
    color: #1f4f8f;
}

.referee-gender-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 999px;
    font-size: 0.95rem;
    border: 1px solid transparent;
}

.referee-gender-maennlich {
    background: #e7f1ff;
    color: #2d5fb3;
    border-color: #c9dcff;
}

.referee-gender-weiblich {
    background: #ffeaf3;
    color: #b03b73;
    border-color: #f5c9df;
}

.referee-gender-divers {
    background: #f2ecff;
    color: #6b45b1;
    border-color: #dfd0ff;
}

.referee-gender-unbekannt {
    background: #f3f5f8;
    color: #6d7787;
    border-color: #d8dee8;
}

.referee-assignment-free {
    background: #f1f4f8;
    color: #5a6a83;
}

.referee-empty {
    text-align: center;
    color: #5a6a83;
    font-weight: 700;
    padding: 1rem;
}

.referee-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.85rem;
}

.pagination-button {
    border: none;
    border-radius: 10px;
    background: #1f2f54;
    color: white;
    font-weight: 700;
    padding: 0.55rem 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.pagination-button:hover:not(:disabled) {
    transform: translateY(-1px);
    background: #2d4a86;
}

.pagination-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info {
    font-weight: 700;
    color: #1f2f54;
}

.referee-info-card {
    background: white;
    border-radius: 16px;
    border: 1px solid rgba(31, 47, 84, 0.1);
    padding: 1.1rem 1.2rem;
    box-shadow: var(--shadow);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
}

.referee-info-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.editable-card {
    cursor: pointer;
}

.editable-card:hover {
    border-color: #58cc02;
}

.edit-icon {
    font-size: 0.7rem;
    color: #58cc02;
    margin-left: 0.3rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.editable-card:hover .edit-icon {
    opacity: 1;
}

.referee-info-label {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #5a6a83;
    font-weight: 700;
    margin-bottom: 0.45rem;
}

.referee-info-value {
    font-size: 1.55rem;
    line-height: 1.2;
    color: #1f2f54;
    font-weight: 700;
}

.referee-linked-user {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.referee-linked-user-name {
    font-size: 1.15rem;
    line-height: 1.25;
}

.referee-linked-user-meta {
    font-size: 0.92rem;
    line-height: 1.45;
    color: #5a6a83;
    font-weight: 600;
}

.referee-status-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 700;
    background: #e6f9d6;
    color: #2d7a00;
}

.referee-status-pill.status-aktiv {
    background: #e6f9d6;
    color: #2d7a00;
}

.referee-status-pill.status-ausgeschieden {
    background: #eceff4;
    color: #4b5568;
}

.referee-status-pill.status-beurlaubt {
    background: #fff8cc;
    color: #8a6a00;
}

.referee-status-pill.status-im-ruhestand {
    background: #e4f4ff;
    color: #1f5f96;
}

.referee-status-pill.status-passiv {
    background: #ffe1e1;
    color: #b42323;
}

.referee-status-pill.status-verstorben {
    background: #2e3340;
    color: #f4f6fb;
}

.referee-status-pill.status-default {
    background: #f0f3f8;
    color: #4f5b6d;
}

/* ===== Login ===== */

.login-body {
    background: linear-gradient(135deg, #1f2f54 0%, #2d4a86 60%, #3a7d44 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-main {
    width: 100%;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: white;
    border-radius: 24px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
    animation: fadeInUp 0.5s ease-out;
    text-align: center;
}

.login-logo {
    font-size: 3rem;
    color: var(--primary-green);
    margin-bottom: 0.75rem;
}

.login-title {
    margin: 0 0 0.3rem;
    font-size: 1.5rem;
    color: #1f2f54;
    font-weight: 700;
}

.login-subtitle {
    margin: 0 0 2rem;
    color: var(--text-light);
    font-size: 0.95rem;
}

.login-field {
    margin-bottom: 1.1rem;
    text-align: left;
}

.login-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1f2f54;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-icon {
    position: absolute;
    left: 0.9rem;
    color: #9aa5b8;
    font-size: 0.95rem;
    pointer-events: none;
}

.login-input {
    width: 100%;
    border: 2px solid #d9e4f7;
    border-radius: 12px;
    padding: 0.75rem 2.8rem 0.75rem 2.5rem;
    font-size: 1rem;
    font-family: inherit;
    background: #f7faff;
    transition: var(--transition);
}

.login-input:focus {
    outline: none;
    border-color: var(--primary-green);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(88, 204, 2, 0.12);
}

.login-pw-toggle {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: #9aa5b8;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.95rem;
    transition: var(--transition);
}

.login-pw-toggle:hover {
    color: #1f2f54;
}

.login-error {
    background: #ffe5e5;
    color: #b42323;
    border-radius: 10px;
    padding: 0.65rem 0.9rem;
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: left;
}

.login-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.9rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 204, 2, 0.35);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Logout button in header */
.header-logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.35rem 0.7rem;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
}

.header-logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
    .header-content {
        gap: 0.5rem;
        padding: 0 0.5rem;
    }

    .tournaments-view {
        padding: 1rem 0.75rem 2rem;
    }

    .tournaments-intro {
        padding: 1rem 1rem 1.1rem;
        margin-bottom: 1rem;
    }

    .tournaments-intro h2 {
        font-size: 1.5rem;
    }

    .table-controls {
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }

    .table-controls input {
        min-width: 0;
        width: 100%;
        padding: 0.7rem 0.9rem;
    }

    .table-wrapper {
        overflow: visible;
        background: transparent;
        box-shadow: none;
        border: none;
    }

    .tournaments-table {
        min-width: 0;
        width: 100%;
    }

    .weiterbildungen-table {
        min-width: 0;
        width: 100%;
        table-layout: auto;
        display: block;
    }

    .weiterbildungen-table tbody,
    .weiterbildungen-table tr {
        width: 100%;
        max-width: 100%;
    }

    .weiterbildungen-table th:nth-child(1),
    .weiterbildungen-table td:nth-child(1),
    .weiterbildungen-table th:nth-child(2),
    .weiterbildungen-table td:nth-child(2),
    .weiterbildungen-table th:nth-child(3),
    .weiterbildungen-table td:nth-child(3),
    .weiterbildungen-table th:nth-child(4),
    .weiterbildungen-table td:nth-child(4),
    .weiterbildungen-table th:nth-child(5),
    .weiterbildungen-table td:nth-child(5),
    .weiterbildungen-table th:nth-child(6),
    .weiterbildungen-table td:nth-child(6) {
        width: auto !important;
    }

    .tournaments-table thead {
        display: none;
    }

    .tournaments-table tbody {
        display: grid;
        gap: 0.9rem;
        width: 100%;
    }

    .tournaments-table tbody tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem 0.85rem;
        width: 100%;
        background: white;
        border: 1px solid rgba(88, 204, 2, 0.12);
        border-radius: 18px;
        box-shadow: var(--shadow);
        padding: 0.95rem;
    }

    .tournaments-table tbody tr:hover {
        background: white;
    }

    .tournaments-table td {
        display: flex;
        flex-direction: column;
        gap: 0.2rem;
        padding: 0;
        border: none;
        font-size: 0.92rem;
    }

    .weiterbildungen-table td {
        font-size: 0.95rem;
    }

    .tournaments-table td::before {
        display: block;
        color: var(--accent-orange);
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .tournaments-table td:nth-child(4),
    .tournaments-table td:nth-child(3) {
        grid-column: 1 / -1;
    }

    .tournaments-table td:nth-child(3) {
        order: -3;
    }

    .tournaments-table td:nth-child(1) {
        order: -2;
    }

    .tournaments-table td:nth-child(2) {
        order: -1;
    }

    .tournaments-table td:nth-child(4) {
        order: 1;
    }

    .weiterbildungen-table tbody tr {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
        padding: 1rem;
        border-radius: 16px;
        width: 100%;
    }

    .weiterbildungen-table td {
        min-width: 0;
        gap: 0.28rem;
    }

    .weiterbildungen-table td::before {
        font-size: 0.7rem;
        color: #4b6587;
    }

    .weiterbildungen-table td:nth-child(1),
    .weiterbildungen-table td:nth-child(6) {
        grid-column: 1 / -1;
    }

    .weiterbildungen-table td:nth-child(1) {
        order: -4;
    }

    .weiterbildungen-table td:nth-child(2) {
        order: -3;
    }

    .weiterbildungen-table td:nth-child(3) {
        order: -2;
    }

    .weiterbildungen-table td:nth-child(4) {
        order: -1;
    }

    .weiterbildungen-table td:nth-child(5) {
        order: 1;
    }

    .weiterbildungen-table td:nth-child(6) {
        order: 2;
    }

    .weiterbildungen-table td:nth-child(1) {
        padding-bottom: 0.2rem;
        border-bottom: 1px solid #edf3e4;
    }

    .weiterbildungen-table td:nth-child(2),
    .weiterbildungen-table td:nth-child(3) {
        background: #f8fcf2;
        border: 1px solid #e3edd2;
        border-radius: 10px;
        padding: 0.55rem 0.65rem;
    }

    .weiterbildungen-table td:nth-child(4),
    .weiterbildungen-table td:nth-child(5),
    .weiterbildungen-table td:nth-child(6) {
        background: #f5faf0;
        border: 1px solid #e5efda;
        border-radius: 10px;
        padding: 0.6rem 0.65rem;
    }

    .weiterbildungen-table td:nth-child(4)::before,
    .weiterbildungen-table td:nth-child(5)::before,
    .weiterbildungen-table td:nth-child(6)::before {
        color: #3f5f35;
    }

    .weiterbildungen-table td:nth-child(3) .date-pill {
        font-weight: 700;
    }

    .tournaments-table td strong {
        font-size: 1rem;
        line-height: 1.35;
    }

    .date-pill {
        padding: 0;
        background: transparent;
        border-radius: 0;
    }

    .need-badges {
        gap: 0.35rem;
    }

    .need-badge {
        font-size: 0.76rem;
        padding: 0.3rem 0.55rem;
    }

    .tournaments-table tbody tr td[colspan] {
        display: block;
        text-align: center;
        padding: 1rem;
    }

    .container {
        flex-direction: column;
        height: auto;
        gap: 0;
        overflow: visible;
    }

    .tree-container {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        max-height: none;
        overflow: visible;
        padding-bottom: 1.5rem;
    }

    .details-container {
        padding-top: 1.5rem;
        overflow: visible;
    }

    .details {
        min-height: auto;
    }

    .referee-view {
        padding: 1rem 0.75rem 2rem;
    }

    .referee-hero {
        padding: 1.25rem;
        border-radius: 18px;
    }

    .referee-hero h2 {
        font-size: 1.5rem;
    }

    .referee-grid {
        gap: 0.8rem;
    }

    .referee-list-toolbar {
        gap: 0.6rem;
    }


@media (max-width: 520px) {
    .tournaments-view {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0.75rem 0.5rem 1.5rem;
    }

    .table-wrapper {
        width: 100%;
        margin: 0;
    }

    .weiterbildungen-table {
        width: 100% !important;
        min-width: 0 !important;
    }

    .weiterbildungen-table tbody tr {
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin: 0;
    }

    .weiterbildungen-table td:nth-child(1),
    .weiterbildungen-table td:nth-child(6) {
        grid-column: 1 / -1;
    }
}
    .referee-search-input,
    .referee-filter-select {
        width: 100%;
        min-width: 0;
    }

    .referee-count {
        margin-left: 0;
    }

    .referee-table-wrapper {
        max-height: none;
    }

    .referee-table {
        min-width: 0;
    }

    .referee-table th,
    .referee-table td {
        padding: 0.62rem 0.65rem;
        font-size: 0.86rem;
    }

    .referee-pagination {
        flex-wrap: wrap;
    }

    .pagination-button {
        flex: 1;
    }

    .referee-info-card {
        min-height: 0;
    }

    .referee-info-value {
        font-size: 1.35rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .quiz-intro h2 {
        font-size: 1.6rem;
    }

    .quiz-meta {
        flex-direction: column;
    }

    .quiz-card h2 {
        font-size: 1.5rem;
    }

    .quiz-actions {
        justify-content: stretch;
    }

    .quiz-button {
        width: 100%;
    }

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

    .tile {
        padding: 1.05rem 0.85rem;
    }

    header h1 {
        font-size: 1.2rem;
        line-height: 1.25;
        min-width: 0;
    }
}

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

    .birthdays-month-grid {
        grid-template-columns: 1fr;
    }

    .birthdays-hero h2 {
        font-size: 1.35rem;
    }

    .birthdays-filters {
        gap: 0.55rem;
    }

    .birthdays-filters .referee-filter-select,
    .birthdays-round-filter {
        width: 100%;
    }

    .birthdays-status-dropdown {
        width: 100%;
    }

    .birthdays-status-menu {
        min-width: 100%;
        width: 100%;
    }

    .birthday-person-line {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .birthday-person-line > * {
        min-width: 0;
    }

    .birthday-people-inline,
    .birthday-status-inline,
    .round-badge-inline {
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .birthday-people-inline {
        order: 2;
        flex: 1 1 100%;
    }

    .birthday-date-pill {
        order: 1;
    }

    .birthday-status-inline,
    .round-badge-inline {
        order: 3;
        flex: 0 1 auto;
    }

    .birthday-status-inline {
        margin-left: 0;
    }
}

/* --- ADMIN STYLES --- */

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
}

.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--text-dark);
}

.tab-btn.active {
    color: var(--primary-green);
    border-bottom-color: var(--primary-green);
}

.admin-tab-content {
    display: none;
    animation: fadeInUp 0.3s ease-out;
}

.admin-tab-content.active {
    display: block;
}

.referee-tabs {
    margin-top: 2rem;
}

.referee-tab-buttons {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 1.5rem;
}

.referee-tab-btn {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.referee-tab-btn:hover {
    color: var(--text-dark);
}

.referee-tab-btn.active {
    color: var(--primary-green);
    border-bottom-color: var(--primary-green);
}

.referee-tab-content {
    display: none;
    animation: fadeInUp 0.3s ease-out;
}

.referee-tab-content.active {
    display: block;
}

.referee-history-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.referee-history-table th,
.referee-history-table td {
    padding: 0.8rem;
    text-align: left !important;
    vertical-align: top;
}

.referee-history-table thead th {
    font-weight: 700;
}

.referee-history-table tbody td {
    border-bottom: 1px solid #ececec;
}

.referee-history-table tbody tr:nth-child(even) {
    background: #f8fbff;
}

.admin-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-section-header h2 {
    margin: 0;
    color: var(--text-dark);
    font-size: 1.8rem;
}

.birthdays-view {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding: 0.75rem 0.4rem 1.4rem;
}

.birthdays-hero {
    background: linear-gradient(130deg, #1f2f54 0%, #2f4d82 70%, #436ca8 100%);
    color: #fff;
    padding: 0.95rem 1.05rem;
    border-radius: 14px;
    margin-bottom: 0.8rem;
    box-shadow: var(--shadow);
}

.birthdays-kicker {
    margin: 0 0 0.2rem;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.86;
    font-weight: 700;
}

.birthdays-hero h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
}

.birthdays-hero p {
    margin: 0.2rem 0 0;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.9);
}

.birthdays-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin: 0;
}

.birthdays-controls {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: stretch;
    gap: 0.7rem;
    margin-bottom: 0.75rem;
}

.birthdays-month-nav {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    margin: 0;
    background: #fff;
    border: 1px solid rgba(88, 204, 2, 0.2);
    border-radius: 12px;
    padding: 0.28rem;
}

.month-nav-btn {
    border: 1px solid rgba(88, 204, 2, 0.28);
    background: #ffffff;
    color: #2d4b78;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(34, 56, 95, 0.1);
}

.month-nav-btn:hover {
    background: #f3fbe8;
}

.month-today-btn {
    color: #2d4b78;
    border-color: rgba(88, 204, 2, 0.28);
    background: #ffffff;
}

.month-today-btn:hover {
    background: #f3fbe8;
}

.month-range-label {
    min-width: 11.5rem;
    min-height: 2.2rem;
    padding: 0 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f5f9ff;
    border-radius: 10px;
    text-align: center;
    color: #22385f;
    font-size: 0.95rem;
    font-weight: 800;
}

.birthdays-round-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #fff;
    border: 1px solid rgba(88, 204, 2, 0.2);
    border-radius: 12px;
    min-height: 2.2rem;
    padding: 0.42rem 0.65rem;
    box-sizing: border-box;
    color: #30486f;
    font-size: 0.88rem;
    font-weight: 700;
}

.birthdays-round-filter input {
    accent-color: var(--primary-green);
}

.birthdays-status-dropdown {
    position: relative;
    min-width: 230px;
}

.birthdays-status-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    width: 100%;
    min-height: 2.2rem;
    box-sizing: border-box;
}

.birthdays-status-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    z-index: 30;
    min-width: 260px;
    max-height: 260px;
    overflow: auto;
    background: #fff;
    border: 1px solid rgba(88, 204, 2, 0.22);
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(34, 56, 95, 0.14);
    padding: 0.55rem;
}

.birthdays-status-controls {
    display: flex;
    gap: 0.45rem;
    margin-bottom: 0.4rem;
}

.status-control-btn {
    border: 1px solid rgba(88, 204, 2, 0.34);
    background: #f6ffec;
    color: #2b6a0f;
    border-radius: 8px;
    padding: 0.3rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.status-control-btn:hover {
    background: #ebffd8;
}

.birthdays-status-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #30486f;
    font-size: 0.9rem;
    border-radius: 8px;
    padding: 0.3rem 0.35rem;
    cursor: pointer;
}

.birthdays-status-option:hover {
    background: #f5f9ef;
}

.birthdays-status-option input {
    accent-color: var(--primary-green);
}

.birthdays-month-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
}

.birthdays-month-card {
    background: #fff;
    border: 1px solid rgba(88, 204, 2, 0.15);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 0.75rem;
}

.birthdays-month-card h3 {
    margin: 0 0 0.55rem;
    color: #22385f;
    font-size: 1.05rem;
}

.birthday-days-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.65rem;
}

.birthday-day-card {
    border: 1px solid #e4ebf7;
    background: #f5f9ff;
    border-radius: 12px;
    padding: 0.55rem;
    min-width: 0;
}

.birthday-day-title {
    margin: 0 0 0.45rem;
    display: flex;
    align-items: center;
}

.birthday-cards-list {
    display: grid;
    gap: 0.55rem;
}

.birthday-person-card {
    border: 1px solid #e8edf6;
    background: #f9fbff;
    border-radius: 12px;
    padding: 0.55rem;
}

.birthday-person-line {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.birthday-date-pill {
    min-width: 2.2rem;
    text-align: center;
    background: #eaf4ff;
    color: #22427a;
    border-radius: 999px;
    padding: 0.25rem 0.5rem;
    font-weight: 800;
    font-size: 0.82rem;
}

.birthday-people-inline {
    font-size: 0.88rem;
    color: #21385e;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.birthday-status-inline {
    display: inline-flex;
    gap: 0.3rem;
    align-items: center;
    white-space: nowrap;
}

.round-birthday {
    border-color: #ffc800;
    background: linear-gradient(135deg, #fffdf0 0%, #fff6d0 100%);
    box-shadow: 0 4px 14px rgba(255, 200, 0, 0.25);
}

.round-badge {
    margin-top: 0.35rem;
    display: inline-block;
    background: #ffc800;
    color: #3d3200;
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
    font-size: 0.68rem;
    font-weight: 800;
}

.round-badge-inline {
    display: inline-block;
    background: #ffc800;
    color: #3d3200;
    border-radius: 999px;
    padding: 0.12rem 0.45rem;
    font-size: 0.66rem;
    font-weight: 800;
    white-space: nowrap;
}

.birthdays-empty,
.birthdays-loading {
    text-align: center;
    padding: 0.75rem;
    font-size: 0.9rem;
    color: #6b7a90;
}

@media (max-width: 980px) {
    .birthdays-controls {
        grid-template-columns: 1fr;
    }

    .birthdays-month-nav {
        justify-content: center;
    }

    .birthdays-month-grid {
        grid-template-columns: 1fr;
    }

    .birthday-days-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

    .birthdays-month-card,
    .birthday-person-card {
        overflow: hidden;
    }

    .birthday-person-line {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .birthday-person-line > * {
        min-width: 0;
    }

    .birthday-people-inline {
        flex: 1 1 auto;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .birthday-status-inline {
        white-space: normal;
    }

    .birthday-status-inline .referee-status-pill {
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}

@media (max-width: 600px) {
    .birthdays-month-grid {
        grid-template-columns: 1fr;
    }

    .birthdays-filters {
        gap: 0.55rem;
    }

    .birthdays-month-nav {
        width: 100%;
        justify-content: space-between;
    }

    .month-range-label {
        min-width: 8.5rem;
        font-size: 0.9rem;
    }

    .birthdays-status-dropdown,
    .birthdays-round-filter,
    .birthdays-filters .referee-filter-select {
        width: 100%;
    }

    .birthdays-status-dropdown {
        min-width: 0;
    }

    .birthdays-status-menu {
        min-width: 100%;
        width: 100%;
    }

    .birthdays-month-card,
    .birthday-person-card {
        overflow: hidden;
    }

    .birthday-days-grid {
        grid-template-columns: 1fr;
    }

    .birthday-person-line {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .birthday-person-line > * {
        min-width: 0;
    }

    .birthday-date-pill {
        order: 1;
        flex: 0 0 auto;
    }

    .birthday-people-inline {
        order: 2;
        flex: 1 1 auto;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .birthday-status-inline {
        order: 2;
        flex: 0 0 auto;
        white-space: normal;
    }

    .round-badge-inline {
        order: 3;
        flex: 0 1 100%;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .birthday-status-inline .referee-status-pill {
        padding: 0.2rem 0.5rem;
        font-size: 0.75rem;
        line-height: 1.15;
        white-space: nowrap;
    }
}

    .status-view {
        width: 100%;
        max-width: 1080px;
        margin: 0 auto;
        padding: 0.75rem 0.4rem 1.4rem;
    }

    .status-hero {
        background: linear-gradient(130deg, #193252 0%, #205f8f 55%, #3f9a74 100%);
        color: #fff;
        padding: 1rem 1.1rem;
        border-radius: 14px;
        margin-bottom: 0.9rem;
        box-shadow: var(--shadow);
    }

    .status-kicker {
        margin: 0 0 0.2rem;
        font-size: 0.72rem;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        opacity: 0.88;
        font-weight: 700;
    }

    .status-hero h2 {
        margin: 0;
        font-size: 1.35rem;
        font-weight: 800;
    }

    .status-hero p {
        margin: 0.2rem 0 0;
        font-size: 0.92rem;
        color: rgba(255, 255, 255, 0.9);
    }

    .status-grid {
        display: block;
    }

    .status-layout {
        display: grid;
        gap: 0.9rem;
    }

    .status-top-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.9rem;
        align-items: stretch;
    }

    .status-chart-card,
    .status-list-card {
        background: #fff;
        border: 1px solid rgba(88, 204, 2, 0.15);
        border-radius: 16px;
        box-shadow: var(--shadow);
    }

    .status-chart-card {
        padding: 1.25rem;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .status-chart-wrap {
        position: relative;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .status-donut {
        width: 100%;
        height: auto;
        display: block;
    }

    .status-donut-segment {
        transition: stroke-dasharray 0.4s ease, transform 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
        transform-origin: center;
        cursor: pointer;
    }

    .status-donut-segment:hover,
    .status-donut-segment.is-active {
        filter: brightness(1.05);
        opacity: 1;
    }

    .status-donut-center {
        position: absolute;
        inset: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        color: #203a63;
        transition: transform 0.2s ease;
    }

    .status-donut-center.is-active {
        transform: scale(1.04);
    }

    .status-total-label {
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: #5f7492;
        font-weight: 700;
    }

    .status-donut-center strong {
        font-size: 2.2rem;
        line-height: 1;
    }

    .status-center-detail {
        margin-top: 0.2rem;
        font-size: 0.82rem;
        color: #607798;
        font-weight: 700;
    }

    .status-list-card {
        padding: 0.85rem;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .status-list-card h3 {
        margin: 0 0 0.7rem;
        color: #22385f;
        font-size: 1.05rem;
    }

    .status-filter-hint {
        margin: 0 0 0.65rem;
        font-size: 0.78rem;
        color: #607798;
        font-weight: 700;
    }

    .status-list {
        display: grid;
        gap: 0.5rem;
        align-content: start;
        grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    }

    .status-row {
        border: 1px solid #e5ecf8;
        border-radius: 12px;
        padding: 0.4rem 0.46rem;
        background: #fbfdff;
        transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
        cursor: pointer;
    }

    .status-row.is-selected {
        border-color: #58cc02;
        border-width: 2px;
        background: linear-gradient(135deg, #f0ffe1 0%, #e5ffd0 100%);
        box-shadow: 0 0 0 2px rgba(88, 204, 2, 0.25), 0 6px 16px rgba(88, 204, 2, 0.3);
    }

    .status-row.is-selected .status-row-values strong {
        color: #2d7a00;
        font-weight: 800;
    }

    .status-row.is-selected .status-row-bar {
        background: #d8efc8;
    }

    .status-row.is-active,
    .status-row:hover {
        border-color: rgba(58, 120, 195, 0.35);
        box-shadow: 0 4px 12px rgba(29, 58, 99, 0.12);
        background: #ffffff;
    }

    .status-row-main {
        display: flex;
        align-items: center;
        gap: 0.45rem;
    }

    .status-list .referee-status-pill {
        padding: 0.18rem 0.44rem;
        font-size: 0.72rem;
        line-height: 1.2;
    }

    .status-dot {
        width: 0.7rem;
        height: 0.7rem;
        border-radius: 999px;
        flex: 0 0 auto;
    }

    .status-row-values {
        margin-top: 0.28rem;
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        color: #334a71;
    }

    .status-row-values strong {
        font-size: 0.88rem;
    }

    .status-row-values span {
        font-size: 0.72rem;
        color: #607798;
        font-weight: 700;
    }

    .status-row-bar {
        margin-top: 0.36rem;
        height: 0.38rem;
        background: #e8eef8;
        border-radius: 999px;
        overflow: hidden;
    }

    .status-row-bar span {
        display: block;
        height: 100%;
        border-radius: 999px;
    }

    .status-age-card {
        background: #fff;
        border: 1px solid rgba(88, 204, 2, 0.15);
        border-radius: 16px;
        box-shadow: var(--shadow);
        padding: 0.85rem;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .status-age-card h3 {
        margin: 0 0 0.6rem;
        color: #22385f;
        font-size: 0.98rem;
    }

    .status-age-list {
        display: grid;
        gap: 0.45rem;
    }

    .status-age-row {
        background: #fbfdff;
        border: 1px solid #e5ecf8;
        border-radius: 10px;
        padding: 0.45rem 0.5rem;
    }

    .status-age-head {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 0.6rem;
        margin-bottom: 0.3rem;
    }

    .status-age-label {
        color: #2d466f;
        font-size: 0.8rem;
        font-weight: 700;
    }

    .status-age-value {
        color: #607798;
        font-size: 0.74rem;
        font-weight: 700;
        white-space: nowrap;
    }

    .status-age-bar-track {
        height: 0.38rem;
        border-radius: 999px;
        background: #e8eef8;
        overflow: hidden;
    }

    .status-age-bar-fill {
        display: block;
        height: 100%;
        border-radius: 999px;
        background: linear-gradient(90deg, #58cc02 0%, #31b584 100%);
    }

    .status-age-empty {
        margin: 0;
        color: #6b7a90;
        font-size: 0.86rem;
    }

    .status-loading {
        grid-column: 1 / -1;
        background: #fff;
        border-radius: 14px;
        border: 1px solid rgba(88, 204, 2, 0.18);
        box-shadow: var(--shadow);
        text-align: center;
        padding: 0.9rem;
        color: #6b7a90;
    }

    @media (max-width: 900px) {
        .status-top-grid {
            grid-template-columns: 1fr;
        }

        .status-list-card,
        .status-chart-card,
        .status-age-card {
            height: auto;
        }

        .status-chart-wrap {
            max-width: 250px;
        }
    }

    @media (max-width: 600px) {
        .status-view {
            padding: 0.6rem 0.2rem 1.1rem;
        }

        .status-chart-card,
        .status-list-card {
            padding: 0.8rem;
        }

        .status-list {
            grid-template-columns: 1fr;
        }

        .status-hero h2 {
            font-size: 1.2rem;
        }

        .status-donut-center strong {
            font-size: 1.9rem;
        }
    }

.admin-content {
    display: grid;
    gap: 1rem;
}

.admin-users-table-wrapper {
    background: white;
    border: 1px solid rgba(88, 204, 2, 0.2);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: auto;
}

.admin-users-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.admin-users-table th,
.admin-users-table td {
    padding: 0.9rem 1rem;
    text-align: left;
    border-bottom: 1px solid #edf2e4;
}

.admin-users-table th {
    background: #f2f9e9;
    color: #26405f;
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}

.admin-users-table .admin-sortable-th {
    cursor: pointer;
    user-select: none;
}

.admin-users-table .admin-sortable-th .sort-indicator {
    display: inline-block;
    min-width: 0.9rem;
    margin-left: 0.25rem;
    color: #4d638f;
    font-size: 0.72rem;
}

.admin-users-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-user-row {
    cursor: pointer;
    transition: var(--transition);
}

.admin-user-row:hover {
    background: #f8fff0;
}

.admin-user-action-cell {
    width: 90px;
}

.admin-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.admin-item:hover {
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-green);
}

.item-info {
    flex: 1;
}

.item-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.item-description {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.badge {
    display: inline-block;
    background: var(--light-green);
    color: var(--secondary-green);
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-gray {
    background: #f0f0f0;
    color: #666;
}

.badge-role-admin {
    background: #ffe8cc;
    color: #8a3f00;
}

.badge-role-schiedsrichter {
    background: #e6f2ff;
    color: #1f4f8f;
}

.badge-role-benutzer {
    background: #e7f9e7;
    color: #2f6f2f;
}

.badge-role-generic {
    background: #efe7ff;
    color: #5a3e8a;
}

.item-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: 1rem;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--primary-green);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    width: 2.3rem;
    height: 2.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--light-green);
    color: var(--secondary-green);
}

.btn-icon.btn-danger {
    background: #d93434;
    color: white;
    box-shadow: 0 6px 14px rgba(217, 52, 52, 0.18);
}

.btn-icon.btn-danger:hover {
    background: #b82828;
    color: white;
    transform: translateY(-1px);
}

.btn {
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 204, 2, 0.35);
}

.btn-secondary {
    background: #f0f0f0;
    color: var(--text-dark);
}

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

.btn-danger {
    background: #d93434;
    color: white;
}

.btn-danger:hover {
    background: #b82828;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(217, 52, 52, 0.35);
}

/* Modal Styles */
.modal {
    display: flex;
    position: fixed;
    z-index: 1200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 15% 15%, rgba(88, 204, 2, 0.2) 0%, rgba(10, 20, 45, 0.64) 48%, rgba(7, 12, 28, 0.78) 100%);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    animation: fadeInUp 0.24s ease-out;
}

.modal.hidden {
    display: none;
}

.modal-content {
    position: relative;
    background: linear-gradient(180deg, #ffffff 0%, #f9fff3 100%);
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 580px;
    max-height: min(90vh, 860px);
    overflow: auto;
    border: 1px solid rgba(88, 204, 2, 0.22);
    box-shadow: 0 24px 60px rgba(7, 12, 28, 0.35), 0 6px 20px rgba(88, 204, 2, 0.18);
    animation: slideIn 0.22s ease-out;
}

.modal-content.tournament-edit-modal {
    width: 100%;
    max-width: none;
}

.modal.tournament-edit-modal-open {
    padding: 0;
}

.modal-content::before {
    content: '';
    position: sticky;
    top: 0;
    display: block;
    height: 4px;
    background: linear-gradient(90deg, #58cc02 0%, #ffc800 45%, #58cc02 100%);
    z-index: 2;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.25rem 1rem;
    border-bottom: 1px solid #e7efd9;
    background: rgba(255, 255, 255, 0.86);
    position: sticky;
    top: 4px;
    z-index: 2;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: #22385f;
}

.modal-close {
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 999px;
    border: 1px solid #d8e6cb;
    background: #f4fbe9;
    font-size: 1.1rem;
    color: #446042;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: #22385f;
    background: #e6f7d4;
    transform: rotate(90deg);
}

.modal-content > form {
    padding: 1.2rem 1.25rem 1.1rem;
}

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

.role-demand-section {
    margin: 1.35rem 0;
    padding: 1rem;
    border: 1px solid #cfe3b9;
    border-radius: 12px;
    background: #f3fae9;
    box-shadow: 0 2px 8px rgba(46, 71, 110, 0.08);
}

.role-demand-section > label {
    font-size: 0.95rem;
    font-weight: 900;
    color: #22385f;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #cfe3b9;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 0.42rem;
    font-weight: 700;
    font-size: 0.83rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #2e476e;
}

.form-control {
    width: 100%;
    padding: 0.72rem 0.9rem;
    border: 2px solid #d7e6c9;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background: #ffffff;
    color: #243044;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: #58cc02;
    box-shadow: 0 0 0 4px rgba(88, 204, 2, 0.18);
}

#new-training-status {
    height: 50px;
    line-height: 1.2;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-dark);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-green);
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid #e7efd9;
}

.modal-actions .btn {
    flex: 0 1 auto;
}

.confirm-modal {
    max-width: 440px;
}

.confirm-modal > p {
    padding: 1.25rem;
    margin: 0;
    color: #22385f;
    font-size: 1rem;
    line-height: 1.6;
}

.confirm-modal .modal-actions {
    padding: 0.9rem 1.25rem 1.1rem;
    border-top: 1px solid #e7efd9;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
    font-size: 1rem;
}

@media (max-width: 600px) {
    .admin-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .admin-item {
        flex-direction: column;
    }

    .admin-users-table {
        min-width: 640px;
    }

    .item-actions {
        margin-left: 0;
        margin-top: 1rem;
        width: 100%;
        justify-content: flex-start;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: calc(100vh - 1.4rem);
        border-radius: 16px;
    }

    .modal-actions {
        flex-wrap: wrap;
        gap: 0.6rem;
    }

    .modal-actions .btn {
        flex: 1;
    }

    .admin-section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-section-header .btn {
        width: 100%;
        justify-content: center;
    }
}

/* --- ADMIN UX REFRESH OVERRIDES --- */

.admin-container {
    max-width: 1280px;
    padding-top: 1.2rem;
}

.admin-hero-panel {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1rem;
    align-items: center;
    background:
        radial-gradient(circle at 12% 24%, rgba(255, 200, 0, 0.2) 0%, transparent 44%),
        linear-gradient(135deg, #143459 0%, #1f5a86 55%, #2d8b6b 100%);
    color: #f5fbff;
    border-radius: 20px;
    padding: 1.25rem 1.35rem;
    margin-bottom: 1rem;
    box-shadow: 0 16px 36px rgba(19, 45, 82, 0.3);
}

.admin-hero-kicker {
    margin: 0 0 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.76rem;
    font-weight: 700;
    opacity: 0.9;
}

.admin-hero-panel h2 {
    margin: 0;
    font-size: 1.45rem;
    line-height: 1.25;
}

.admin-hero-subtitle {
    margin: 0.4rem 0 0;
    font-size: 0.93rem;
    color: rgba(245, 251, 255, 0.9);
}

.admin-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.admin-metric-card {
    border: 1px solid rgba(255, 255, 255, 0.26);
    background: rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    padding: 0.7rem 0.75rem;
    text-align: center;
    backdrop-filter: blur(2px);
}

.admin-metric-label {
    display: block;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

.admin-metric-card strong {
    display: block;
    margin-top: 0.2rem;
    font-size: 1.4rem;
    font-weight: 800;
}

.admin-shortcuts {
    margin-bottom: 1rem;
}

.admin-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.admin-layout.hidden {
    display: none;
}

.admin-tabs {
    display: grid;
    gap: 0.55rem;
    border: 1px solid #dce7f1;
    border-radius: 16px;
    padding: 0.6rem;
    background: linear-gradient(180deg, #f8fbff 0%, #f2fae9 100%);
    position: sticky;
    top: 1rem;
    margin-bottom: 0;
}

.tab-btn {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 0.72rem 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: #3f546f;
    font-weight: 700;
    border-bottom: 1px solid transparent;
    margin-bottom: 0;
}

.tab-btn i {
    width: 1.1rem;
    text-align: center;
}

.tab-btn.active {
    color: #183a66;
    border-color: rgba(32, 95, 143, 0.25);
    background: #ffffff;
    box-shadow: 0 6px 14px rgba(23, 57, 101, 0.12);
}

.admin-workspace {
    background: #ffffff;
    border: 1px solid #e1e9f2;
    border-radius: 18px;
    padding: 1rem;
    box-shadow: 0 10px 26px rgba(26, 51, 88, 0.08);
}

.admin-context-bar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 1rem;
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
    border: 1px solid #e5edf5;
    background: linear-gradient(120deg, #f7fbff 0%, #f5fbef 100%);
}

.admin-context-bar strong {
    color: #1e3f68;
    font-size: 1rem;
}

.admin-context-bar span {
    color: #607492;
    font-size: 0.88rem;
    font-weight: 600;
}

.admin-inline-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}

.admin-inline-toolbar .referee-search-input {
    flex: 1 1 300px;
}

.permission-toolbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.permission-toolbar-actions .btn {
    padding: 0.45rem 0.62rem;
    border-radius: 8px;
    font-size: 0.8rem;
}

.permission-health-panel {
    border: 1px solid #d7e5f3;
    background: #f7fbff;
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
    margin-bottom: 0.55rem;
    display: grid;
    gap: 0.12rem;
    font-size: 0.8rem;
    color: #3d5f82;
}

.permission-health-panel.ok {
    border-color: #cfe8cf;
    background: #f4fbf4;
    color: #315f31;
}

.permission-health-panel.warn {
    border-color: #f0dca8;
    background: #fffaf0;
    color: #7f5a12;
}

.admin-item-compact {
    padding: 1rem 1.1rem;
}

.admin-permission-group {
    border: 1px solid #e4eaf1;
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
    position: relative;
}

.admin-permission-group + .admin-permission-group {
    margin-top: 0.2rem;
}

.admin-permission-group-title {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 800;
    color: #244a76;
    background: #f4f8fc;
    padding: 0.56rem 0.75rem;
    border-bottom: 1px solid #e2eaf3;
    padding-right: 2.5rem;
}

.admin-permission-group-toggle {
    position: absolute;
    top: 0.34rem;
    right: 0.38rem;
    border: 1px solid #d7e3ef;
    background: #ffffff;
    color: #3d6086;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.admin-permission-group-toggle[aria-expanded='false'] i {
    transform: rotate(-90deg);
}

.admin-permission-group-list {
    display: grid;
    gap: 0;
    padding: 0;
}

@media (max-width: 980px) {
    .admin-hero-panel {
        grid-template-columns: 1fr;
    }

    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-tabs {
        position: static;
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .tab-btn {
        min-width: 160px;
        justify-content: center;
    }

    .admin-context-bar {
        flex-direction: column;
        align-items: flex-start;
    }

}

@media (max-width: 640px) {
    .admin-container {
        padding-left: 0.7rem;
        padding-right: 0.7rem;
    }

    .admin-metric-grid {
        grid-template-columns: 1fr;
    }

    .admin-workspace {
        padding: 0.75rem;
    }
}

.role-composer-help {
    margin: 0 0 0.65rem;
    color: #627895;
    font-size: 0.86rem;
    font-weight: 600;
}

.role-composer-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.role-composer-shell {
    padding: 0.95rem;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.role-composer-toolbar-main {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.role-composer-quick-actions {
    display: inline-flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.role-quick-btn {
    padding: 0.5rem 0.72rem;
    border-radius: 9px;
    font-size: 0.82rem;
}

.role-composer-selection {
    font-size: 0.82rem;
    font-weight: 700;
    color: #2b4f79;
    padding: 0.45rem 0.6rem;
    background: #edf4fc;
    border-radius: 8px;
    border: 1px solid #dbe8f6;
}

.role-tree {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 1fr;
}

.role-tree-group {
    border: 1px solid #dfe8f2;
    border-radius: 12px;
    overflow: hidden;
    background: #fbfdff;
}

.role-tree-group-card {
    padding: 0;
    background: #ffffff;
    box-shadow: none;
    min-width: 0;
}

.role-tree-group-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.58rem 0.7rem;
    background: #f6f9fd;
    border-bottom: 1px solid #e1ebf6;
}

.role-tree-toggle {
    border: 1px solid #d5e3f1;
    background: #ffffff;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 8px;
    cursor: pointer;
    color: #355c87;
}

.role-tree-toggle[aria-expanded='false'] i {
    transform: rotate(-90deg);
}

.role-tree-group-select {
    margin: 0;
    min-width: 0;
}

.role-tree-group-meta {
    justify-self: start;
    min-width: 0;
    font-size: 0.75rem;
    color: #60789a;
    font-weight: 700;
    background: #e9f1fa;
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
}

.role-tree-group-actions {
    justify-self: end;
    min-width: 0;
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.3rem;
}

.role-mini-btn {
    border: 1px solid #cfe0ef;
    background: #fff;
    color: #2f567f;
    border-radius: 8px;
    padding: 0.3rem 0.45rem;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}

.role-mini-btn:hover {
    background: #edf5ff;
}

.role-tree-group-body {
    display: grid;
    gap: 0.45rem;
    padding: 0.55rem 0.65rem 0.7rem;
    min-width: 0;
}

.role-tree-group-body.collapsed {
    display: none;
}

.role-tree-subgroup-card {
    border: 1px solid #e4ebf3;
    border-radius: 10px;
    background: #fff;
    padding: 0.35rem 0.45rem;
    box-shadow: none;
    min-width: 0;
}

.role-tree-subgroup-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
    min-width: 0;
}

.role-tree-subgroup-count {
    min-width: 1.6rem;
    padding: 0.1rem 0.38rem;
    border-radius: 999px;
    background: #eef4fb;
    color: #4a6888;
    font-size: 0.72rem;
    font-weight: 800;
    text-align: center;
}

.role-tree-subgroup-title {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #5e7592;
    margin-bottom: 0.4rem;
}

.role-tree-leaf-list {
    display: grid;
    gap: 0.3rem;
}

.role-tree-leaf {
    margin: 0;
    align-items: flex-start;
    border: 1px solid #e4ebf3;
    border-radius: 9px;
    padding: 0.38rem 0.5rem;
    background: #ffffff;
    min-width: 0;
}

.role-tree-leaf:hover {
    background: #f6fbff;
    border-color: #cfe0f0;
}

.role-tree-leaf-text {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
}

.role-tree-leaf-name {
    font-size: 0.86rem;
    color: #274a74;
    font-weight: 700;
}

.role-tree-leaf-description {
    font-size: 0.74rem;
    color: #6f8199;
}

.admin-permission-group-body {
    display: grid;
    gap: 0.35rem;
    padding: 0.4rem 0.55rem 0.55rem;
}

.admin-permission-group-body.collapsed {
    display: none;
}

.admin-permission-overview {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.admin-permission-group-section {
    border: 1px solid #e4ebf3;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
}

.admin-permission-group-card {
    padding: 0;
    background: #ffffff;
    box-shadow: none;
    min-width: 0;
}

.admin-permission-group-section-card {
    padding: 0;
    box-shadow: none;
    min-width: 0;
}

.admin-permission-group-section-title {
    background: #f6f9fd;
    color: #36557d;
    padding: 0.44rem 0.62rem;
    border-bottom: 1px solid #e4ebf3;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    min-width: 0;
}

.permission-item-card {
    background: #ffffff;
    display: grid;
    gap: 0.35rem;
    border-bottom: 1px solid #edf2f7;
    border-radius: 0;
    padding: 0.52rem 0.62rem;
    min-width: 0;
}

.permission-item-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.7rem;
}

.permission-item-card:last-child {
    border-bottom: none;
}

.permission-item-card:hover {
    background: #f9fcff;
}

.permission-item-card .item-title {
    margin-bottom: 0.2rem;
    font-size: 0.93rem;
}

.permission-item-card .item-description {
    margin-bottom: 0;
    font-size: 0.8rem;
}

.permission-item-card .item-actions {
    margin-left: 0;
}

.permission-info-toggle[aria-expanded='true'] {
    background: #eaf3fd;
    color: #204a74;
}

.permission-item-details {
    border-top: 1px solid #e6edf6;
    padding-top: 0.42rem;
    display: grid;
    gap: 0.24rem;
}

.permission-item-details.collapsed {
    display: none;
}

.permission-item-detail-text {
    font-size: 0.82rem;
    color: #445d78;
    line-height: 1.38;
}

.permission-item-detail-meta {
    font-size: 0.74rem;
    color: #6c8098;
}

.permission-group-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6rem;
    padding: 0.12rem 0.42rem;
    margin-left: 0.45rem;
    border-radius: 999px;
    background: #eaf4ff;
    color: #2f567f;
    font-size: 0.72rem;
    font-weight: 800;
    vertical-align: middle;
}

@media (max-width: 900px) {
    .role-composer-toolbar {
        grid-template-columns: 1fr;
    }

    .role-composer-toolbar-main {
        width: 100%;
    }

    .role-composer-selection {
        justify-self: start;
    }

    .role-tree,
    .admin-permission-overview {
        grid-template-columns: 1fr;
    }

    .role-tree-group-header {
        grid-template-columns: auto 1fr;
    }

    .role-tree-group-meta,
    .role-tree-group-actions {
        grid-column: 1 / -1;
    }

    .role-tree-group-actions {
        justify-self: start;
    }

    .role-composer-quick-actions {
        width: 100%;
    }

    .role-quick-btn {
        flex: 1 1 130px;
    }
}

@media (max-width: 768px) {
    main {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    main .tournaments-view {
        width: 100% !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    main .tournaments-view .table-wrapper {
        width: 100% !important;
        margin: 0 !important;
    }

    main .tournaments-view table.weiterbildungen-table {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    main .tournaments-view table.weiterbildungen-table > tbody {
        display: grid !important;
        width: 100% !important;
        grid-template-columns: 1fr !important;
    }

    main .tournaments-view table.weiterbildungen-table > tbody > tr {
        display: grid !important;
        width: 100% !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        margin: 0 !important;
        box-sizing: border-box;
    }

    main .tournaments-view table.weiterbildungen-table > tbody > tr > td:nth-child(1),
    main .tournaments-view table.weiterbildungen-table > tbody > tr > td:nth-child(6) {
        grid-column: 1 / -1;
    }

    main .tournaments-view table.weiterbildungen-table > tbody > tr > td:nth-child(2),
    main .tournaments-view table.weiterbildungen-table > tbody > tr > td:nth-child(3),
    main .tournaments-view table.weiterbildungen-table > tbody > tr > td:nth-child(4),
    main .tournaments-view table.weiterbildungen-table > tbody > tr > td:nth-child(5) {
        grid-column: auto !important;
    }

    main .tournaments-view table.weiterbildungen-table > tbody > tr > td:nth-child(2) {
        order: 2 !important;
    }

    main .tournaments-view table.weiterbildungen-table > tbody > tr > td:nth-child(3) {
        order: 3 !important;
    }

    main .tournaments-view table.weiterbildungen-table > tbody > tr > td:nth-child(4) {
        order: 4 !important;
    }

    main .tournaments-view table.weiterbildungen-table > tbody > tr > td:nth-child(5) {
        order: 5 !important;
    }

    main .tournaments-view table.weiterbildungen-table > tbody > tr > td:nth-child(6) {
        order: 6 !important;
        grid-column: 1 / -1 !important;
    }
}