@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html,
body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #f8fafc;
    color: #1f2937;
}

h1:focus {
    outline: none;
}

a,
.btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

/* Blazor default error UI */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

/* Shared page styles */
.page-title {
    margin: 0 0 1rem 0;
    font-size: 1.7rem;
    font-weight: 700;
    color: #18283a;
}

.loading-text {
    color: #64748b;
    font-size: 1rem;
}

/* Shared card/grid styles */
.group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 1rem;
}

.group-card {
    background: #ffffff;
    border: 1px solid #d8e0ea;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.group-card-header {
    background: linear-gradient(135deg, #123b72, #1e5ca8);
    color: #ffffff;
    padding: 0.85rem 1rem;
}

    .group-card-header h4 {
        margin: 0;
        font-size: 1.05rem;
        font-weight: 700;
        letter-spacing: 0.02em;
    }

.group-card-body {
    padding: 0.75rem 0.9rem 0.9rem 0.9rem;
}

/* Shared flag style */
.flag-icon {
    width: 20px !important;
    height: 14px !important;
    min-width: 20px;
    max-width: 20px;
    min-height: 14px;
    max-height: 14px;
    display: inline-block;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 8px;
    border: 1px solid #d7dde5;
    border-radius: 2px;
}

/* =========================
   GROUP STANDINGS PAGE
   ========================= */
.standings-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    font-size: 0.9rem;
}

    .standings-table thead th {
        background: #f7f9fc;
        color: #5b6778;
        font-size: 0.74rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        padding: 0.55rem 0.35rem;
        border-bottom: 1px solid #e3e8ef;
        text-align: center;
    }

    .standings-table tbody td {
        padding: 0.5rem 0.35rem;
        border-bottom: 1px solid #edf2f7;
        text-align: center;
        color: #1f2937;
        line-height: 1.15;
    }

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

    .standings-table tbody tr:hover {
        background: #f8fbff;
    }

    .standings-table img {
        max-height: 14px !important;
        max-width: 20px !important;
    }

.rank-col {
    width: 34px;
}

.rank-cell {
    width: 34px;
    font-weight: 700;
    color: #475569;
}

.team-col {
    text-align: left !important;
    min-width: 180px;
}

.team-cell {
    text-align: left !important;
    white-space: nowrap;
}

.team-name {
    vertical-align: middle;
    font-weight: 500;
    color: #0f172a;
}

.points-cell {
    font-weight: 800;
    color: #0f3f7f;
}

.gd-cell {
    font-weight: 600;
}

.qualified-1 {
    background: rgba(21, 128, 61, 0.08);
}

.qualified-2 {
    background: rgba(37, 99, 235, 0.06);
}

    .qualified-1 .rank-cell,
    .qualified-2 .rank-cell {
        font-weight: 800;
    }

/* =========================
   MATCH ENTRY PAGE
   ========================= */
.match-entry-page {
    display: grid;
    gap: 1rem;
}

.match-entry-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    font-size: 0.92rem;
}

    .match-entry-table thead th {
        background: #f7f9fc;
        color: #5b6778;
        font-size: 0.74rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        padding: 0.6rem 0.8rem;
        border-bottom: 1px solid #e3e8ef;
        text-align: center;
    }

    .match-entry-table tbody td {
        padding: 0.65rem 0.8rem;
        border-bottom: 1px solid #edf2f7;
        text-align: center;
        vertical-align: middle;
    }

    .match-entry-table tbody tr:hover {
        background: #f8fbff;
    }

    .match-entry-table tbody tr:last-child td {
        border-bottom: none;
    }

    .match-entry-table .team-cell {
        text-align: left !important;
        min-width: 130px;
        font-weight: 500;
        color: #0f172a;
        white-space: nowrap;
    }

    .match-entry-table th:nth-child(1),
    .match-entry-table td:nth-child(1) {
        width: 72px;
    }

    .match-entry-table th:nth-child(2),
    .match-entry-table td:nth-child(2) {
        width: 95px;
    }

    .match-entry-table th:nth-child(3),
    .match-entry-table td:nth-child(3) {
        min-width: 150px;
    }

    .match-entry-table th:nth-child(4),
    .match-entry-table td:nth-child(4),
    .match-entry-table th:nth-child(7),
    .match-entry-table td:nth-child(7) {
        min-width: 180px;
    }

    .match-entry-table th:nth-child(5),
    .match-entry-table td:nth-child(5),
    .match-entry-table th:nth-child(6),
    .match-entry-table td:nth-child(6) {
        width: 82px;
    }

.score-input {
    width: 64px;
    height: 38px;
    padding: 0.35rem 0.4rem;
    text-align: center;
    border: 1px solid #cfd8e3;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    background: #ffffff;
    color: #0f172a;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

    .score-input:focus {
        border-color: #1e5ca8;
        box-shadow: 0 0 0 3px rgba(30, 92, 168, 0.12);
    }

.save-cell {
    width: 110px;
    min-width: 110px;
    text-align: center;
}

.save-button {
    width: 88px;
    height: 36px;
    background: linear-gradient(135deg, #1e5ca8, #174a88);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(23, 74, 136, 0.18);
    transition: opacity 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

    .save-button:hover {
        opacity: 0.96;
        box-shadow: 0 4px 10px rgba(23, 74, 136, 0.22);
    }

    .save-button:active {
        transform: translateY(1px);
    }

.save-message {
    margin-top: 1rem;
    padding: 0.8rem 1rem;
    background: #edf6ff;
    border: 1px solid #cfe5ff;
    border-radius: 10px;
    color: #18406b;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 900px) {
    .match-entry-table {
        font-size: 0.84rem;
    }

        .match-entry-table thead th,
        .match-entry-table tbody td {
            padding: 0.45rem 0.35rem;
        }

    .score-input {
        width: 52px;
        height: 34px;
        font-size: 0.95rem;
    }

    .save-button {
        width: 78px;
        height: 34px;
        font-size: 0.78rem;
    }
}

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

    .group-card-body {
        padding: 0.55rem 0.6rem 0.7rem 0.6rem;
    }

    .standings-table {
        font-size: 0.82rem;
    }

        .standings-table thead th,
        .standings-table tbody td {
            padding: 0.42rem 0.22rem;
        }

    .team-col {
        min-width: 140px;
    }

    .team-name {
        display: inline-block;
        max-width: 110px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* =========================
   BRACKET PAGE
   ========================= */

/* Horizontal scroll wrapper for wide bracket */
.bk-scroll-wrapper {
    overflow-x: auto;
    padding-bottom: 1.5rem;
}

/* Root flex container: left-half | center | right-half */
.bk-root {
    display: flex;
    align-items: stretch;
    gap: 0;
    min-width: 900px;
    min-height: 860px;
}

/* ── Halves ── */
.bk-half {
    flex: 1;
    display: flex;
    align-items: stretch;
    gap: 0;
}

/* Left half: rounds go L→R (R32 first, SF last) */
.bk-half--left {
    flex-direction: row;
}

/* Right half: rounds go L→R (SF first, R32 last) */
.bk-half--right {
    flex-direction: row;
}

/* ── Round column ── */
.bk-round {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0 6px;
    position: relative;
}

.bk-round-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    text-align: center;
    padding: 0.6rem 0 0.5rem 0;
    white-space: nowrap;
    border-bottom: 2px solid #e8edf4;
    margin-bottom: 0;
}

.bk-round-label--center {
    text-align: center;
    color: #1e4a8a;
    border-bottom: 2px solid #cfddf0;
    width: 100%;
}

.bk-third-label {
    margin-top: 1.25rem;
    color: #7c4a00;
    border-bottom: 2px solid #f0dfc0;
}

/* ── Slot column (holds match cards, spaced evenly) ── */
.bk-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 0.5rem 0;
    position: relative;
}

/* Connector lines between rounds — right edge of left rounds */
.bk-half--left .bk-round:not(:last-child) .bk-col::after {
    content: "";
    position: absolute;
    right: -6px;
    top: 5%;
    bottom: 5%;
    width: 2px;
    background: linear-gradient(to bottom, transparent, #c8d8ec 15%, #c8d8ec 85%, transparent);
    z-index: 0;
}

/* Connector lines — left edge of right rounds */
.bk-half--right .bk-round:not(:last-child) .bk-col::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 5%;
    bottom: 5%;
    width: 2px;
    background: linear-gradient(to bottom, transparent, #c8d8ec 15%, #c8d8ec 85%, transparent);
    z-index: 0;
}

/* Slot: wraps each match card and draws horizontal connector nub */
.bk-slot {
    position: relative;
    display: flex;
    justify-content: stretch;
    align-items: center;
    padding: 4px 0;
}

/* Right nub on left-half slots */
.bk-half--left .bk-round:not(:last-child) .bk-slot::after {
    content: "";
    position: absolute;
    right: -6px;
    top: 50%;
    width: 6px;
    height: 2px;
    background: #c8d8ec;
    transform: translateY(-50%);
}

/* Left nub on right-half slots */
.bk-half--right .bk-round:not(:last-child) .bk-slot::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 50%;
    width: 6px;
    height: 2px;
    background: #c8d8ec;
    transform: translateY(-50%);
}

/* ── Center column ── */
.bk-center {
    width: 220px;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    gap: 0.5rem;
}

.bk-trophy {
    font-size: 2.4rem;
    line-height: 1;
    margin-bottom: 0.25rem;
    filter: drop-shadow(0 2px 6px rgba(180, 130, 0, 0.3));
}

/* ── Match card ── */
.bk-card {
    width: 100%;
    background: #ffffff;
    border: 1px solid #d8e2ef;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

    .bk-card:hover {
        box-shadow: 0 4px 16px rgba(15, 23, 42, 0.11);
        border-color: #b0c4de;
    }

.bk-card--center {
    width: 200px;
    border-color: #a8c0dc;
    box-shadow: 0 4px 18px rgba(30, 74, 138, 0.12);
}

.bk-card--played {
    border-color: #a0b8d8;
}

.bk-card--pending {
    background: #f8fafc;
    border-style: dashed;
    border-color: #cbd5e1;
    box-shadow: none;
    padding: 1rem 0;
}

.bk-pending-label {
    text-align: center;
    font-size: 0.72rem;
    color: #94a3b8;
    font-style: italic;
}

/* Card header */
.bk-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #1a3a6e 0%, #1e5ca8 100%);
    padding: 0.3rem 0.55rem;
    gap: 0.4rem;
}

.bk-game-code {
    font-size: 0.68rem;
    font-weight: 800;
    color: #e2eaf8;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.bk-venue {
    font-size: 0.62rem;
    color: #93b3d8;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
    text-align: right;
}

/* Team rows */
.bk-team {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.55rem;
    min-height: 28px;
    background: #fff;
    transition: background 0.1s;
}

    .bk-team:first-of-type {
        border-bottom: 1px solid #edf2f7;
    }

.bk-team--winner {
    background: #f0faf4;
}

.bk-team--loser {
    opacity: 0.55;
}

.bk-flag {
    width: 20px;
    height: 14px;
    min-width: 20px;
    object-fit: cover;
    border: 1px solid #d7dde5;
    border-radius: 2px;
    flex-shrink: 0;
}

.bk-flag-placeholder {
    width: 20px;
    height: 14px;
    min-width: 20px;
    background: #e8edf4;
    border-radius: 2px;
    flex-shrink: 0;
}

.bk-team-name {
    font-size: 0.78rem;
    font-weight: 500;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.bk-team--winner .bk-team-name {
    font-weight: 700;
    color: #14532d;
}

.bk-score {
    font-size: 0.82rem;
    font-weight: 700;
    color: #334155;
    margin-left: auto;
    flex-shrink: 0;
    min-width: 14px;
    text-align: center;
}

.bk-score--winner {
    color: #15803d;
    font-weight: 800;
}

/* Divider (shows "vs" when unplayed) */
.bk-divider {
    height: 1px;
    background: #edf2f7;
    font-size: 0.65rem;
    font-weight: 700;
    color: #94a3b8;
    text-align: center;
    line-height: 0;
    letter-spacing: 0.06em;
}

    .bk-divider:not(:empty) {
        height: auto;
        padding: 3px 0;
        background: #f8fafc;
        border-top: 1px solid #edf2f7;
        border-bottom: 1px solid #edf2f7;
    }

/* Knockout stage heading used in entry pages */
.knockout-stage-heading {
    color: #1a3a6e;
    font-weight: 700;
    font-size: 1rem;
    border-left: 4px solid #1e5ca8;
    padding-left: 0.6rem;
}

/* Third-place summary card */
.third-place-summary-card {
    border-color: #d8c9a0;
}


/* =========================
   GROUPS PAGE LOGO
   ========================= */
.groups-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #f0f2f5;
    border-radius: 14px;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
}

.groups-header .page-title {
    margin: 0;
}

.groups-logo {
    max-height: 70px;
    max-width: 160px;
    object-fit: contain;
    flex-shrink: 0;
}

/* =========================
   SIDEBAR NAV
   ========================= */

.sidebar {
    background: linear-gradient(180deg, #0f1f3d 0%, #162f5a 60%, #1a3a6e 100%);
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
    padding-bottom: 1.5rem;
    position: relative;
    transition: width 0.2s ease;
    overflow: hidden;
}

/* Collapsed state — icon-only width */
.sidebar--collapsed {
    width: 54px;
    min-width: 54px;
}

/* Brand */
.sidebar-brand {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.7rem;
    padding: 1rem 0.7rem 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    margin-bottom: 0.5rem;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.05em;
    white-space: nowrap;
    transition: opacity 0.15s ease;
}

.sidebar--collapsed .sidebar-title {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Collapse toggle button */
.sidebar-collapse-btn {
    position: absolute;
    bottom: 1.2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
    z-index: 5;
}

.sidebar-collapse-btn:hover {
    background: rgba(255,255,255,0.2);
    color: #ffffff;
}

.collapse-arrow {
    font-size: 0.7rem;
}

/* Nav wrapper */
.sidebar-nav-wrapper {
    display: flex;
    flex-direction: column;
    padding: 0 0.4rem;
    overflow: hidden;
}

/* Section labels */
.sidebar-section-label {
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.38);
    padding: 0.75rem 0.5rem 0.3rem;
    white-space: nowrap;
    transition: opacity 0.15s ease;
}

.sidebar--collapsed .sidebar-section-label {
    opacity: 0;
}

/* Nav links */
.sidebar-link {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.65rem;
    padding: 0.6rem 0.5rem;
    margin: 1px 0;
    border-radius: 8px;
    text-decoration: none !important;
    color: rgba(255,255,255,0.72) !important;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.1);
    color: #ffffff !important;
    text-decoration: none !important;
}

.sidebar-link.active {
    background: rgba(255,255,255,0.15);
    color: #ffffff !important;
    font-weight: 700;
    border-left: 3px solid #60a5fa;
    padding-left: calc(0.5rem - 3px);
}

.sidebar-icon {
    font-size: 1rem;
    width: 1.4rem;
    text-align: center;
    flex-shrink: 0;
    line-height: 1;
}

.sidebar-label {
    white-space: nowrap;
    flex: 1;
    transition: opacity 0.15s ease;
}

.sidebar--collapsed .sidebar-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Mobile */
@media (max-width: 640px) {
    .sidebar-nav-wrapper { display: flex; }
}

@media (min-width: 641px) {
    .sidebar-nav-wrapper { display: flex !important; }
}

/* =========================
   BRACKET PAGE HEADER
   ========================= */
.bracket-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #f0f2f5;
    border-radius: 14px;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
}

.bracket-header .page-title {
    margin: 0;
}

.bracket-logo {
    max-height: 70px;
    max-width: 160px;
    object-fit: contain;
    flex-shrink: 0;
}

/* =========================
   LOGIN PAGE
   ========================= */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f1f3d 0%, #1a3a6e 100%);
    padding: 1rem;
}

.login-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo-row {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.login-logo {
    max-height: 80px;
    object-fit: contain;
}

.login-title {
    text-align: center;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.login-subtitle {
    text-align: center;
    color: #64748b;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.login-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
}

.login-btn {
    background: linear-gradient(135deg, #162f5a 0%, #1b55a0 100%);
    color: #ffffff;
    font-weight: 700;
    padding: 0.65rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: opacity 0.15s;
}

.login-btn:hover { opacity: 0.9; color: #ffffff; }
.login-btn:disabled { opacity: 0.6; }

/* Sidebar user / logout */
.sidebar-user {
    margin-top: auto;
    padding: 0.75rem 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-username {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.6);
    padding: 0 0.5rem 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-logout {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    color: rgba(255,255,255,0.75);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.sidebar-logout:hover {
    background: rgba(255,59,59,0.25);
    color: #ffffff;
    border-color: rgba(255,100,100,0.3);
}

.sidebar--collapsed .sidebar-username { display: none; }
.sidebar--collapsed .sidebar-logout span { display: none; }

/* =========================
   LOGIN PAGE
   ========================= */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 2rem 1rem;
}

.login-card {
    background: #ffffff;
    border: 1px solid #d8e2ef;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(15,23,42,0.10);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
}

.login-logo-row {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.login-logo {
    max-height: 80px;
    object-fit: contain;
}

.login-title {
    text-align: center;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.login-subtitle {
    text-align: center;
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 1.5rem;
}

/* =========================
   SIDEBAR USER / LOGOUT
   ========================= */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.5rem;
    margin: 1px 0;
    color: rgba(255,255,255,0.55);
    font-size: 0.8rem;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-logout {
    background: transparent;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

    .sidebar-logout:hover {
        background: rgba(255,100,100,0.15) !important;
        color: #fca5a5 !important;
    }


/* =========================
   MOBILE NAV
   ========================= */

/* Hamburger — hidden on desktop */
.mobile-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    margin-left: auto;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.ham-line {
    display: block;
    width: 24px;
    height: 2px;
    background: rgba(255,255,255,0.9);
    border-radius: 2px;
}

/* Collapse button — hidden on mobile */
.sidebar-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    padding: 0.25rem 0.6rem;
    font-size: 0.7rem;
    margin-left: auto;
    flex-shrink: 0;
    transition: background 0.15s;
    touch-action: manipulation;
}

.sidebar-collapse-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }

@media (max-width: 640px) {
    /* Show hamburger, hide collapse arrow */
    .mobile-hamburger     { display: flex; }
    .sidebar-collapse-btn { display: none !important; }

    /* Prevent collapsed state from hiding labels on mobile */
    .sidebar--collapsed .sidebar-title         { opacity: 1 !important; width: auto !important; }
    .sidebar--collapsed .sidebar-label         { opacity: 1 !important; width: auto !important; }
    .sidebar--collapsed .sidebar-section-label { opacity: 1 !important; }

    /* Brand bar — stays in normal document flow, full width */
    .sidebar {
        width: 100% !important;
        min-width: 0 !important;
        position: relative !important;
        height: auto !important;
        overflow: visible !important;
    }

    .sidebar-brand {
        padding: 0.65rem 1rem;
    }

    /* Nav drawer — fixed, drops down from top of viewport when open */
    .sidebar-nav-wrapper {
        display: none !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(180deg, #0f1f3d 0%, #162f5a 100%);
        box-shadow: 0 8px 24px rgba(0,0,0,0.35);
        z-index: 1001;
        padding: 1rem 0 2rem;
        overflow-y: auto;
    }

    .sidebar-nav-wrapper.mobile-open {
        display: flex !important;
    }

    .sidebar-link {
        padding: 0.9rem 1.2rem;
        font-size: 1.05rem;
        min-height: 52px;
    }

    .sidebar-section-label {
        font-size: 0.68rem;
        padding: 1.25rem 1.2rem 0.4rem;
        margin-top: 0 !important;
    }
}

/* Mobile drawer close button */
.mobile-drawer-close {
    display: none;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    color: rgba(255,255,255,0.85);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    margin: 0.5rem 1rem 0;
    cursor: pointer;
    width: calc(100% - 2rem);
    text-align: center;
    touch-action: manipulation;
}

@media (max-width: 640px) {
    .mobile-drawer-close { display: block; }
}

/* =========================
   MOBILE GROUPS TABLE
   ========================= */
@media (max-width: 640px) {
    .group-grid {
        grid-template-columns: 1fr;
    }

    .standings-table {
        font-size: 0.78rem;
    }

    /* Hide W, D, L, GF, GA on mobile — keep P, GD, Pts */
    .standings-table .col-w,
    .standings-table .col-d,
    .standings-table .col-l,
    .standings-table .col-gf,
    .standings-table .col-ga {
        display: none;
    }

    .standings-table thead th,
    .standings-table tbody td {
        padding: 0.4rem 0.2rem;
    }

    .team-col {
        min-width: 110px;
    }

    .team-name {
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
    }

    .flag-icon {
        width: 16px !important;
        height: 11px !important;
        min-width: 16px;
        max-width: 16px;
        margin-right: 4px;
    }
}
