:root {
    --blue: #0f6cbd;
    --blue-dark: #084c8d;
    --blue-soft: #eaf3ff;
    --green: #2e7d32;
    --green-soft: #dff3e2;
    --red: #d13438;
    --red-soft: #fff0f0;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #dce2ea;
    --surface: #ffffff;
    --background: #f5f7fb;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --radius: 12px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background: linear-gradient(135deg, #f8fbff 0%, #eef5fc 100%);
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

.app-shell { min-height: 100vh; }

.topbar {
    height: 64px;
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 0 24px;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    min-width: 180px;
}

.brand-icon {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: var(--blue-dark);
    color: white;
    font-size: 20px;
}

.brand-text { letter-spacing: 0.2px; }

.main-nav {
    display: flex;
    align-items: stretch;
    gap: 10px;
    height: 100%;
    flex: 1;
}

.main-nav a {
    display: flex;
    align-items: center;
    padding: 0 18px;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    color: #111827;
}

.main-nav a:hover,
.main-nav a.is-active {
    color: var(--blue);
    border-bottom-color: var(--blue);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 600;
    color: var(--muted);
}

.lang-switch a.is-active { color: var(--blue); }

.bell { color: var(--muted); font-size: 20px; }

.mobile-menu-button {
    display: none;
    border: 0;
    background: transparent;
    width: 40px;
    height: 40px;
    padding: 8px;
}

.mobile-menu-button span {
    display: block;
    height: 2px;
    background: var(--text);
    margin: 6px 0;
    border-radius: 999px;
}

.page {
    padding: 24px;
    max-width: 1480px;
    margin: 0 auto;
}

.panel {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(360px, 0.95fr) minmax(520px, 1.45fr);
    gap: 24px;
    align-items: start;
}

.panel-news,
.panel-calendar,
.wide-panel,
.detail-main,
.detail-side,
.login-card {
    padding: 22px;
}

.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.section-header h1,
.detail-title h1 {
    margin: 0 0 14px 0;
    font-size: 24px;
    letter-spacing: -0.03em;
}

.section-header h2,
.selected-tournament h2,
.detail-side h2,
.subsection-header h2 {
    margin: 0 0 12px 0;
    font-size: 18px;
}

.select-control,
input,
button,
.btn {
    font: inherit;
}

.select-control,
input {
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fff;
    color: var(--text);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.btn-primary {
    background: var(--blue);
    color: white;
    box-shadow: 0 6px 16px rgba(15, 108, 189, 0.25);
}

.btn-outline {
    border-color: #a9c7eb;
    color: var(--blue);
    background: white;
}

.btn-danger {
    border-color: #f0b9ba;
    color: var(--red);
    background: var(--red-soft);
}

.btn:disabled,
input:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.full { width: 100%; }

.admin-hint,
.hint,
.muted {
    color: var(--muted);
    font-size: 13px;
}

.news-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 18px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
    margin-bottom: 14px;
}

.news-card h2 {
    color: var(--blue);
    font-size: 18px;
    margin: 0 0 8px 0;
}

.news-card p {
    line-height: 1.45;
    margin: 9px 0;
}

.meta {
    color: var(--muted);
    font-size: 13px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.card-actions {
    display: flex;
    gap: 20px;
    margin-top: 18px;
    color: var(--muted);
    font-size: 14px;
}

.news-image {
    min-height: 116px;
    border-radius: 9px;
    background-size: cover;
    background-position: center;
}

.image-table-tennis {
    background-image:
        radial-gradient(circle at 32% 52%, #fff 0 12px, transparent 13px),
        linear-gradient(140deg, rgba(11, 83, 148, 0.15), rgba(8, 76, 141, 0.92)),
        linear-gradient(35deg, #111827 0 46%, #ef4444 47% 53%, #111827 54% 100%);
}

.image-fair-play {
    background-image:
        radial-gradient(circle at 45% 50%, rgba(255,255,255,0.9) 0 16px, transparent 17px),
        linear-gradient(135deg, #c9a56b, #ffffff 48%, #6b7280 49%, #111827);
}

.image-pickleball {
    background-image:
        radial-gradient(circle at 66% 55%, #c6f432 0 13px, transparent 14px),
        linear-gradient(135deg, rgba(15, 108, 189, 0.25), rgba(15, 108, 189, 0.95)),
        radial-gradient(ellipse at 38% 55%, #111827 0 34px, transparent 35px);
}

.calendar-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 24px;
}

.calendar-header {
    align-items: center;
}

.calendar-tabs {
    display: flex;
    border: 1px solid var(--border);
    background: #f4f7fb;
    border-radius: 8px;
    overflow: hidden;
}

.calendar-tabs button,
.calendar-toolbar button {
    border: 0;
    background: transparent;
    padding: 9px 13px;
    cursor: pointer;
}

.calendar-tabs button.is-active,
.calendar-toolbar button:last-child {
    background: white;
    color: var(--blue);
    font-weight: 700;
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(74px, 1fr));
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
    overflow: hidden;
    border-radius: 10px;
}

.day-name,
.calendar-day {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: white;
}

.day-name {
    padding: 10px;
    text-align: center;
    font-weight: 700;
    color: var(--muted);
}

.calendar-day {
    min-height: 94px;
    padding: 9px;
    position: relative;
}

.calendar-day.is-past {
    background: #fafbfc;
    color: #9ca3af;
}

.event {
    display: block;
    margin-top: 8px;
    padding: 6px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
}

.event-upcoming { background: #dbeafe; color: #0b57a3; }
.event-finished { background: #dff3e2; color: #14532d; }

.legend {
    display: flex;
    gap: 22px;
    margin-top: 16px;
    color: var(--muted);
    font-size: 14px;
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-right: 8px;
}
.dot.upcoming { background: var(--blue); }
.dot.finished { background: var(--green); }

.selected-card {
    border-left: 1px solid var(--border);
    padding-left: 18px;
}

.selected-card strong {
    display: block;
    margin-bottom: 14px;
}

.side-action {
    display: block;
    padding: 13px 12px;
    border: 1px solid var(--border);
    margin-top: 10px;
    border-radius: 8px;
    color: var(--muted);
    background: white;
}

.table-wrap { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

.data-table th {
    color: var(--muted);
    font-size: 13px;
    background: #fafbfc;
}

.data-table tr:last-child td { border-bottom: 0; }
.data-table.compact th,
.data-table.compact td { padding: 12px; }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.badge-success { color: #14532d; background: var(--green-soft); }
.badge-blue { color: #0b57a3; background: #dbeafe; }

.icon-link { color: var(--blue); font-weight: 700; }
.positive { color: #14823d; font-weight: 700; }
.negative { color: var(--red); font-weight: 700; }

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
}

.detail-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
}

.tabs {
    display: flex;
    gap: 20px;
    border-bottom: 1px solid var(--border);
    margin: 20px 0;
    overflow-x: auto;
}

.tabs a {
    padding: 12px 0;
    color: var(--muted);
    font-weight: 700;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

.tabs a.is-active {
    color: var(--blue);
    border-bottom-color: var(--blue);
}

.subsection-header,
.player-search {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.player-search input { width: min(340px, 100%); }

.settings-list {
    margin: 0 0 24px 0;
}

.settings-list div {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
    gap: 16px;
}

.settings-list dt { color: var(--muted); }
.settings-list dd { margin: 0; font-weight: 700; text-align: right; }
.detail-side .btn { margin-bottom: 10px; }

.login-card {
    max-width: 430px;
    margin: 60px auto;
}

.login-form {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

.login-form label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

@media (max-width: 1120px) {
    .dashboard-grid,
    .calendar-layout,
    .detail-layout {
        grid-template-columns: 1fr;
    }
    .selected-card { border-left: 0; padding-left: 0; }
}

@media (max-width: 760px) {
    .topbar {
        flex-wrap: wrap;
        height: auto;
        min-height: 64px;
        padding: 12px 16px;
        gap: 12px;
    }

    .brand { min-width: auto; flex: 1; }
    .brand-text { display: none; }
    .mobile-menu-button { display: inline-block; }

    .main-nav {
        order: 10;
        width: 100%;
        height: auto;
        display: none;
        flex-direction: column;
        background: white;
        border: 1px solid var(--border);
        border-radius: 10px;
        padding: 8px;
    }

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

    .main-nav a {
        padding: 12px;
        border-bottom: 0;
        border-radius: 8px;
    }

    .main-nav a.is-active { background: var(--blue-soft); }

    .topbar-actions {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .page { padding: 16px; }
    .section-header,
    .calendar-header,
    .subsection-header,
    .player-search,
    .detail-title {
        flex-direction: column;
        align-items: stretch;
    }

    .news-card {
        grid-template-columns: 1fr;
    }

    .news-image { min-height: 150px; }

    .calendar-grid {
        grid-template-columns: repeat(7, minmax(42px, 1fr));
        font-size: 12px;
    }

    .calendar-day {
        min-height: 72px;
        padding: 5px;
    }

    .event { font-size: 10px; padding: 4px; }
    .legend { flex-direction: column; gap: 8px; }
}

@media (max-width: 480px) {
    .topbar-actions .btn { padding: 0 10px; min-height: 34px; }
    .lang-switch { font-size: 13px; }
    .bell { display: none; }
    .panel-news, .panel-calendar, .wide-panel, .detail-main, .detail-side, .login-card { padding: 16px; }
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue);
    font-weight: 700;
    font-size: 13px;
}

.flash {
    width: min(1180px, 100%);
    margin: 0 auto 14px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    font-weight: 600;
}

.flash-success {
    border-color: rgba(46, 125, 50, .35);
    background: rgba(46, 125, 50, .08);
    color: #1b5e20;
}

.flash-error,
.form-error,
.error-state {
    border-color: rgba(209, 52, 56, .35) !important;
    background: rgba(209, 52, 56, .08) !important;
    color: #a4262c !important;
}

.disabled,
.btn.disabled {
    opacity: .55;
    pointer-events: none;
}

.empty-state {
    padding: 22px;
    border: 1px dashed var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, .7);
    color: var(--muted);
}

.empty-state.small { padding: 14px; }
.empty-cell { text-align: center; color: var(--muted); padding: 22px !important; }
.news-content { line-height: 1.6; }
.inline-filter { margin-top: 8px; }

.auth-panel {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 140px);
}

.auth-card,
.tool-card {
    width: min(480px, 100%);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 28px;
}

.auth-card h1,
.tool-card h1 { margin-top: 0; }
.auth-help,
.hint { color: var(--muted); font-size: 14px; line-height: 1.5; }

.form-field {
    display: grid;
    gap: 6px;
    margin: 14px 0;
    color: var(--text);
    font-weight: 700;
    font-size: 14px;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 9px 11px;
    font: inherit;
    background: white;
}

.form-error {
    padding: 12px 14px;
    border: 1px solid;
    border-radius: 10px;
    margin: 12px 0;
    font-weight: 600;
}

.tool-page {
    min-height: 100vh;
    margin: 0;
    padding: 24px;
    background: var(--background);
    color: var(--text);
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.tool-card {
    width: min(980px, 100%);
    margin: 0 auto;
}

.tool-card table { margin-top: 14px; }

.badge-muted { background: #f3f4f6; color: #4b5563; }
.badge-warning { background: #fff4ce; color: #8a5a00; }
.badge-danger { background: rgba(209, 52, 56, .1); color: #a4262c; }
.calendar-day.is-muted { opacity: .48; }

code {
    background: #f3f4f6;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1px 5px;
}

@media (max-width: 480px) {
    .auth-card,
    .tool-card { padding: 18px; border-radius: 14px; }
    .tool-page { padding: 12px; }
}

/* Step 3 - News administration */
.inline-filter {
    display: inline-block;
}

.danger-link {
    color: var(--red) !important;
}

.news-form-panel {
    max-width: 1120px;
    margin: 0 auto;
}

.news-admin-form {
    display: grid;
    gap: 22px;
}

.form-grid {
    display: grid;
    gap: 16px;
}

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

.form-field {
    display: grid;
    gap: 8px;
    font-weight: 700;
}

.form-field input[type="text"],
.form-field select {
    width: 100%;
}

.checkbox-field {
    align-self: end;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
}

.checkbox-field input {
    width: 18px;
    height: 18px;
}

.editor-language-block {
    display: grid;
    gap: 10px;
}

.editor-language-block h2 {
    margin: 0;
    font-size: 18px;
}

.news-editor-wrap {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    background: #f7f9fc;
    border-bottom: 1px solid var(--border);
}

.editor-toolbar button {
    min-height: 34px;
    border: 1px solid #cdd7e4;
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-weight: 700;
    padding: 0 12px;
    cursor: pointer;
}

.editor-toolbar button:hover {
    color: var(--blue);
    border-color: #a9c7eb;
    background: var(--blue-soft);
}

.news-editor {
    min-height: 260px;
    padding: 16px;
    outline: none;
    line-height: 1.55;
}

.news-editor:focus {
    box-shadow: inset 0 0 0 2px rgba(15, 108, 189, 0.18);
}

.news-editor p,
.news-content p {
    margin: 0 0 12px 0;
}

.news-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.news-table td,
.news-table th,
.news-content table td,
.news-content table th {
    border: 1px solid var(--border);
    padding: 8px;
    min-width: 56px;
}

.news-image-inline,
.news-content img {
    display: inline-block;
    vertical-align: top;
    margin: 6px 8px 6px 0;
    border-radius: 10px;
    max-width: 100%;
    height: auto;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.confirm-panel {
    max-width: 680px;
    margin: 0 auto;
}

.confirm-panel h1 {
    margin-top: 0;
}

.delete-preview {
    padding: 16px;
    margin: 18px 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    font-weight: 700;
}

.flash-success {
    border-color: #b9dfc0;
    background: #effaf1;
    color: #1f6f31;
}

.flash-error {
    border-color: #f0b9ba;
    background: var(--red-soft);
    color: var(--red);
}

.error-state {
    color: var(--red);
}

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

    .editor-toolbar {
        align-items: stretch;
    }

    .editor-toolbar button {
        flex: 1 1 auto;
    }
}

/* Step 3 - automatic CZ -> EN news translation */
.translation-box {
    border: 1px solid #cfe2ff;
    background: #f3f8ff;
    border-radius: 12px;
    padding: 14px 16px;
    display: grid;
    gap: 6px;
}

.translation-box p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.translation-checkbox {
    min-height: auto;
    align-self: start;
    font-weight: 800;
}

.translation-details {
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: #fff;
    padding: 0;
    overflow: hidden;
}

.translation-details summary {
    cursor: pointer;
    padding: 14px 16px;
    font-weight: 800;
    background: #f7f9fc;
}

.translation-details-body {
    display: grid;
    gap: 18px;
    padding: 16px;
}

.flash-warning {
    border-color: #f5d596;
    background: #fff8e6;
    color: #8a5a00;
}

/* Step 4 - tournament administration */
.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.tournament-list-header {
    align-items: flex-start;
}

.table-title-link {
    color: var(--blue);
    font-weight: 800;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.tournament-form-panel {
    max-width: 1120px;
    margin: 0 auto;
}

.tournament-admin-form {
    display: grid;
    gap: 22px;
}

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

.form-field textarea {
    width: 100%;
    min-height: 140px;
    resize: vertical;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    line-height: 1.5;
    background: white;
}

.tournament-checkbox {
    align-self: end;
}

.detail-description {
    margin: 18px 0 4px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
    line-height: 1.55;
    color: var(--text);
}

.tournament-delete-preview {
    display: grid;
    gap: 8px;
}

.tournament-delete-preview span {
    color: var(--muted);
    font-weight: 500;
}

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

/* Step 5 - players in tournament */
.tournament-players-section {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.player-add-form {
    position: relative;
    display: grid;
    grid-template-columns: minmax(260px, 1.6fr) minmax(120px, 180px) minmax(180px, auto) auto;
    gap: 12px;
    align-items: end;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f8fafc;
}

.player-name-field {
    position: relative;
}

.autocomplete-results {
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}

.autocomplete-item {
    display: grid;
    gap: 3px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.autocomplete-item:hover,
.autocomplete-item:focus {
    background: #eef6ff;
    outline: none;
}

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

.manual-lock-field {
    padding-bottom: 10px;
}

.ranked-small-input {
    max-width: 110px;
    padding: 7px 8px;
    border: 1px solid var(--border);
    border-radius: 9px;
    font: inherit;
}

.small-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

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

.button-link {
    border: 0;
    background: transparent;
    padding: 0;
    font: inherit;
    cursor: pointer;
}

.players-table td {
    vertical-align: middle;
}

.players-bulk-form {
    display: grid;
    gap: 12px;
}

.players-bulk-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    justify-content: flex-start;
}

@media (max-width: 1100px) {
    .player-add-form {
        grid-template-columns: 1fr 160px;
    }
}

@media (max-width: 700px) {
    .player-add-form {
        grid-template-columns: 1fr;
    }

    .ranked-small-input {
        max-width: 100%;
        width: 100%;
    }
}

/* Step 6 - tournament groups */
.tournament-groups-section {
    display: grid;
    gap: 18px;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}

.groups-control-form {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f8fafc;
}

.groups-count-field {
    min-width: 240px;
    margin: 0;
}

.groups-admin-hint {
    margin-top: -8px;
}

.groups-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.group-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.group-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

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

.group-table-wrap {
    margin: 0;
}

.group-small-select {
    min-width: 120px;
    padding: 7px 8px;
    border-radius: 9px;
}

.unassigned-box {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px dashed var(--border);
    border-radius: 14px;
    background: #fbfdff;
}

.unassigned-box h3 {
    margin: 0;
    font-size: 16px;
}

.pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.player-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    font-size: 13px;
}

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

@media (max-width: 700px) {
    .groups-control-form {
        display: grid;
        grid-template-columns: 1fr;
    }

    .groups-count-field {
        min-width: 0;
    }

    .group-card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .group-small-select {
        width: 100%;
    }
}
