.team-page {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 0;
}

.team-antiforgery {
    display: none;
}

/* DASHBOARD-LIKE BASE */

.dashboard-container {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
}

.card,
.team-header-card,
.team-table-card,
.team-overview-strip,
.player-team-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.08);
}

.card {
    padding: 20px;
}

/* =========================
   HERO (DASHBOARD-LIKE)
========================= */
.player-teams-hero,
.dashboard-hero,
.player-teams-TitleCard {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    padding: 30px;
    margin-bottom: 16px;
    color: #ffffff;
    background: linear-gradient(135deg, #111827, #1d4ed8);
    border-radius: 24px;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.18);
}

.small-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #93c5fd;
    font-weight: 900;
}

.player-teams-hero h1,
.player-teams-TitleCard h1 {
    margin: 8px 0;
    font-size: 34px;
    font-weight: 900;
}

.player-teams-hero p,
.player-teams-TitleCard p {
    margin: 0;
    color: #dbeafe;
    font-weight: 600;
}

/* Rechterkant: dashboard knop */
.team-hero-actions,
.team-TitleCard-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.dashboard-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 0 18px;
    border-radius: 14px;
    font-weight: 900;
    text-align: center;
    text-decoration: none !important;
    white-space: nowrap;
    transition: 0.2s ease;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff !important;
    font-size: 16px;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}

    .dashboard-action-btn:hover {
        transform: translateY(-2px);
        color: #ffffff !important;
        background: linear-gradient(135deg, #1d4ed8, #1e40af);
    }

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.stat-box {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border-radius: 20px;
    color: #ffffff;
}

    .stat-box span {
        display: block;
        font-weight: 700;
    }

    .stat-box strong {
        font-size: 28px;
        font-weight: 900;
    }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.2);
}

.blue {
    background: linear-gradient(135deg, #2563eb, #38bdf8);
}

.orange {
    background: linear-gradient(135deg, #f97316, #f59e0b);
}

.purple {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
}

.team-overview-card {
    margin-bottom: 16px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.info-box {
    padding: 15px;
    border-radius: 15px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

    .info-box span {
        display: block;
        margin-bottom: 7px;
        color: #64748b;
        font-weight: 700;
    }

    .info-box strong {
        display: block;
        color: #1e1b4b;
        font-size: 18px;
        font-weight: 900;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.team-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(82px, 1fr));
    gap: 10px;
    min-width: 300px;
}

    .team-TitleCard-stats div {
        padding: 13px 14px;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.13);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }

    .team-TitleCard-stats span {
        display: block;
        margin-bottom: 4px;
        color: #bfdbfe;
        font-size: 11px;
        font-weight: 900;
        letter-spacing: 0.7px;
        text-transform: uppercase;
    }

    .team-TitleCard-stats strong {
        display: block;
        color: #ffffff;
        font-size: 24px;
        line-height: 1;
    }

/* Witte dashboard knop zoals draft */
.team-dashboard-white-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 0 26px;
    border-radius: 14px;
    color: #070b3f;
    background: #ffffff;
    font-size: 17px;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
    transition: 0.2s ease;
}

    .team-dashboard-white-btn:hover {
        color: #070b3f;
        background: #f8fafc;
        transform: translateY(-2px);
    }

/* =========================
   OVERZICHTSTRIP
========================= */
.team-overview-strip {
    display: grid;
    grid-template-columns: 0.7fr 1.8fr 1fr;
    gap: 10px;
    padding: 12px;
    margin-bottom: 16px;
}

    .team-overview-strip div {
        padding: 13px 14px;
        border-radius: 12px;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
    }

    .team-overview-strip span {
        display: block;
        margin-bottom: 4px;
        color: #64748b;
        font-size: 11px;
        font-weight: 900;
        letter-spacing: 0.7px;
        text-transform: uppercase;
    }

    .team-overview-strip strong {
        display: block;
        color: #111827;
        font-size: 16px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

/* =========================
   PLAYER TEAM CARDS
========================= */
.player-team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 16px;
    align-items: stretch;
}

.player-team-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.player-team-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 18px 14px;
    border-top: none;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(90deg, rgba(255, 255, 255, 1) 0%, rgba(248, 250, 252, 1) 100%);
    flex-wrap: wrap;
    position: relative;
}

    .player-team-header::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 6px;
        background: linear-gradient(180deg, var(--player-color), var(--player-color-dark));
    }

    .player-team-header > * {
        position: relative;
        z-index: 1;
    }

.player-team-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.player-team-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: var(--player-text-color);
    background: var(--player-color);
    font-size: 15px;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.player-team-identity h2 {
    margin: 0;
    color: #111827;
    font-size: 20px;
    font-weight: 900;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.player-team-identity p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.team-completion {
    min-width: 128px;
    color: #0f172a;
    font-weight: 900;
    text-align: right;
    margin-left: auto;
}

    .team-completion span {
        display: block;
        margin-bottom: 7px;
        font-size: 13px;
    }

.team-completion-bar {
    width: 128px;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5e7eb;
}

    .team-completion-bar div {
        height: 100%;
        border-radius: inherit;
        background: linear-gradient(90deg, var(--player-color), var(--player-color-dark));
    }

/* =========================
   ROSTER TABLE
========================= */
.player-roster-table-wrap {
    overflow-x: hidden;
    flex: 1;
    padding: 6px 12px 12px;
}

.player-roster-table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    table-layout: fixed;
    border-radius: 16px;
    overflow: hidden;
}

    .player-roster-table th,
    .player-roster-table td {
        padding: 10px 10px;
        border-bottom: 1px solid #e5e7eb;
        vertical-align: middle;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .player-roster-table thead th {
        color: #475569;
        background: #f8fafc;
        font-size: 11px;
        font-weight: 900;
        letter-spacing: 0.7px;
        text-transform: uppercase;
    }

    .player-roster-table th:first-child,
    .player-roster-table td:first-child {
        width: 44px;
    }

    .player-roster-table th:nth-child(3),
    .player-roster-table td:nth-child(3) {
        width: 24%;
    }

    .player-roster-table th:last-child,
    .player-roster-table td:last-child {
        width: 76px;
        text-align: right;
    }

.roster-section-row th {
    padding: 9px 8px;
    border-bottom: none;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.roster-section-row.active-section th {
    color: var(--player-text-color);
    background: linear-gradient(90deg, var(--player-color), var(--player-color-dark));
    padding-left: calc(8px + 0.5ch);
}

.roster-section-row.bench-section th {
    color: #374151;
    background: #e5e7eb;
}

.roster-row.active-rider {
    background: var(--player-color-soft);
    border-left: 4px solid var(--player-color);
}

.roster-row.roster-before-bench td {
    border-bottom: 0;
}

.roster-row.bench-rider {
    background: #f3f4f6;
    border-left: 4px solid #9ca3af;
}

.roster-row.empty-slot {
    background: #ffffff;
}

    .roster-row.empty-slot .rider-name,
    .roster-row.empty-slot .rider-team {
        color: #94a3b8;
        font-style: italic;
        font-weight: 700;
    }

.slot-number {
    color: #64748b;
    font-weight: 900;
}

.rider-name,
.rider-team {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rider-name {
    color: #111827;
    font-weight: 900;
}

.rider-team {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
}

    .status-pill.active {
        color: var(--player-text-color);
        background: var(--player-color);
    }

    .status-pill.bench {
        color: #374151;
        background: #d1d5db;
    }

/* =========================
   EMPTY STATE + BUTTONS
========================= */
.team-table-card {
    padding: 24px;
}

.team-empty-state h2 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 22px;
}

.team-empty-state p {
    margin: 0 0 16px;
    color: #64748b;
    font-weight: 700;
}

.team-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: none;
    border-radius: 10px;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
}

.team-btn-primary {
    color: #ffffff;
    background: #2563eb;
}

    .team-btn-primary:hover {
        color: #ffffff;
        background: #1d4ed8;
    }

.team-btn-secondary {
    color: #0f172a;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.8);
}

    .team-btn-secondary:hover {
        color: #0f172a;
        background: #f8fafc;
    }

/* =========================
   SWAP SELECTIE
========================= */
tr[data-cyclist-id] {
    cursor: pointer;
}

    tr[data-cyclist-id]:hover {
        filter: brightness(0.95);
    }

.roster-row--selected {
    outline: 2px solid var(--player-color) !important;
    outline-offset: -2px;
    filter: brightness(0.92) !important;
}

.team-swap-hint {
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.18);
}

.team-swap-hint-global {
    margin: 0 0 14px;
}

.player-team-card.swap-mode .roster-row.swap-target {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.0), 0 0 0 2px rgba(191, 219, 254, 0.0);
    outline: 2px dashed rgba(191, 219, 254, 0.85);
    outline-offset: -2px;
}

    .player-team-card.swap-mode .roster-row.swap-target:hover {
        filter: brightness(0.93);
    }

.player-team-card.swap-mode .roster-row.swap-dimmed {
    opacity: 0.55;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 900px) {
    .player-teams-TitleCard {
        align-items: stretch;
        flex-direction: column;
    }

    .team-TitleCard-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .team-TitleCard-stats {
        min-width: 0;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    .team-dashboard-white-btn {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .info-grid {
        grid-template-columns: 1fr;
    }

    .player-team-grid {
        grid-template-columns: 1fr;
    }

    .player-team-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .team-completion,
    .team-completion-bar {
        width: 100%;
        min-width: 0;
        text-align: left;
    }

    .team-TitleCard-stats {
        grid-template-columns: 1fr;
    }

    .player-teams-hero h1 {
        font-size: 26px;
    }
}
