/* FAGLeague — pickleball league schedule table (court-grouped) */

.pb-sch {
    --pb-navy: #07131F;
    --pb-teal: #0F9C8F;
    --pb-teal-d: #0A7A70;
    --pb-ink: #102033;
    --pb-paper: #F4F7F5;
    --pb-line: #E3EBE8;
    --pb-muted: #5B6B74;
    --pb-men: #1D4ED8;
    --pb-women: #BE185D;
    --pb-mixed: #0F766E;
    --pb-num: "Barlow Condensed", "Plus Jakarta Sans", sans-serif;
    --pb-radius: 18px;
    background: var(--pb-paper);
    padding: 14px 16px 20px;
    color: var(--pb-ink);
}

.match-hub:has(.pb-sch),
.panel.match-hub:has(.pb-sch) {
    overflow: visible;
}

.pb-toolbar {
    margin-bottom: 12px;
}

.pb-status-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pb-status-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--pb-line);
    background: #fff;
    min-height: 0;
    cursor: pointer;
    font-family: inherit;
}

.pb-status-tab strong {
    font-family: var(--pb-num);
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
    color: var(--pb-navy);
}

.pb-status-tab span {
    font-size: 12px;
    font-weight: 700;
    color: #64748B;
}

.pb-status-tab:hover { border-color: #C5D5CE; }
.pb-status-tab.active { border-color: var(--pb-navy); box-shadow: inset 0 0 0 1px var(--pb-navy); }
.pb-status-tab[data-pb-status="upcoming"] { background: #fff; }
.pb-status-tab[data-pb-status="due"] { background: #FFFBEB; border-color: #FDE68A; }
.pb-status-tab[data-pb-status="due"].active { border-color: #CA8A04; box-shadow: inset 0 0 0 1px #CA8A04; }
.pb-status-tab[data-pb-status="live"] { background: #FEF2F2; border-color: #FECACA; }
.pb-status-tab[data-pb-status="live"].active { border-color: #DC2626; box-shadow: inset 0 0 0 1px #DC2626; }
.pb-status-tab[data-pb-status="done"] { background: #F0FDF4; border-color: #BBF7D0; }
.pb-status-tab[data-pb-status="done"].active { border-color: #16A34A; box-shadow: inset 0 0 0 1px #16A34A; }

.pb-filter-rows {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 14px 20px;
    margin-top: 14px;
}

.pb-filter-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pb-filter-court { width: 220px; flex: 0 0 220px; }
.pb-filter-date { width: 200px; flex: 0 0 200px; }
.pb-filter-time { width: auto; flex: 0 0 auto; }
.pb-filter-cat { flex: 1 1 280px; }

.pb-filter-row > span {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #8A9AA3;
}

.pb-time-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pb-time-range .pb-select {
    width: 118px;
    padding-right: 32px;
}

.pb-time-range em {
    font-style: normal;
    font-weight: 800;
    color: #8A9AA3;
}

.pb-filter-cat > div { display: flex; flex-wrap: wrap; gap: 8px; }

.pb-select {
    appearance: none;
    width: 100%;
    height: 42px;
    padding: 0 40px 0 14px;
    border: 1px solid var(--pb-line);
    border-radius: 12px;
    background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%235B6B74' d='M1 1l5 5 5-5'/></svg>") no-repeat right 14px center;
    font-size: 14px;
    font-weight: 700;
    color: var(--pb-navy);
    font-family: inherit;
    cursor: pointer;
}

.pb-select:hover,
.pb-select:focus {
    border-color: #B7D4CE;
    outline: none;
}

.pb-chip {
    border: 1px solid var(--pb-line);
    background: #fff;
    color: var(--pb-ink);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 700;
    height: 42px;
    cursor: pointer;
    font-family: inherit;
}

.pb-chip:hover { border-color: #B7D4CE; }
.pb-chip.active {
    background: var(--pb-navy);
    color: #fff;
    border-color: var(--pb-navy);
}

.pb-legend {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 4px 0 14px;
}

.pb-swatch {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--pb-line);
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.35;
}

.pb-swatch b { display: block; font-size: 13px; color: var(--pb-ink); }
.pb-swatch span { color: var(--pb-muted); font-weight: 600; }
.pb-swatch i {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    flex-shrink: 0;
    margin-top: 1px;
    border: 1px solid rgba(15, 23, 42, .08);
    display: block;
}

.pb-court { margin-bottom: 22px; }
.pb-court:last-child { margin-bottom: 0; }

.pb-court-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin: 6px 2px 12px;
}

.pb-court-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pb-court-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-family: var(--pb-num);
    font-weight: 800;
    font-size: 18px;
    color: #fff;
    background: var(--pb-teal);
}

.pb-court[data-court="VIP"] .pb-court-mark {
    background: linear-gradient(160deg, #C9A227, #8A5A12);
    font-size: 13px;
    letter-spacing: .04em;
}

.pb-court[data-court="unassigned"] .pb-court-mark {
    background: #64748B;
}

.pb-court-title h3 {
    font-size: 22px;
    letter-spacing: -.02em;
    margin: 0;
    font-weight: 800;
}

.pb-court-title span {
    display: block;
    color: var(--pb-muted);
    font-size: 13px;
    font-weight: 600;
    margin-top: 2px;
}

.pb-live-note {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #E11D2E;
    background: #FEE2E2;
    border-radius: 999px;
    padding: 6px 10px;
}

.pb-live-note.is-due {
    color: #A16207;
    background: #FFFBEB;
}

.pb-table-card {
    background: #fff;
    border: 1px solid var(--pb-line);
    border-radius: var(--pb-radius);
    box-shadow: 0 1px 2px rgba(7, 19, 31, .04), 0 18px 40px rgba(7, 19, 31, .08);
    overflow: hidden;
    border-left: 4px solid var(--pb-teal);
}

.pb-court[data-court="VIP"] .pb-table-card { border-left-color: #C9A227; }
.pb-court[data-court="unassigned"] .pb-table-card { border-left-color: #94A3B8; }

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

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

.pb-table thead th {
    text-align: center;
    vertical-align: middle;
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #7A8B93;
    background: #F7FBFA;
    padding: 12px 16px;
    border-bottom: 1px solid var(--pb-line);
    white-space: nowrap;
}

.pb-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #EEF3F1;
    vertical-align: middle;
}

.pb-table tbody tr:last-child td { border-bottom: 0; }
.pb-table tbody tr.status-upcoming td { background: #fff; }
.pb-table tbody tr.status-due td { background: #FFFBEB; }
.pb-table tbody tr.status-live td { background: #FEF2F2; }
.pb-table tbody tr.status-done td { background: #F0FDF4; }
.pb-table tbody tr.status-due td:first-child { box-shadow: inset 3px 0 0 #FCD34D; }
.pb-table tbody tr.status-live td:first-child { box-shadow: inset 3px 0 0 #FCA5A5; }
.pb-table tbody tr.status-done td:first-child { box-shadow: inset 3px 0 0 #86EFAC; }
.pb-table tbody tr.status-upcoming:hover td { background: #FAFFFD; }
.pb-table tbody tr.status-due:hover td { background: #FEF9C3; }
.pb-table tbody tr.status-live:hover td { background: #FEE2E2; }
.pb-table tbody tr.status-done:hover td { background: #DCFCE7; }

.pb-time {
    font-family: var(--pb-num);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: .02em;
    color: var(--pb-navy);
    line-height: 1;
}

.pb-date {
    margin-top: 5px;
    font-size: 12px;
    font-weight: 700;
    color: #7A8B93;
    letter-spacing: .02em;
    white-space: nowrap;
}

.pb-court-name {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    font-weight: 800;
    background: #F1F5F4;
    border-radius: 999px;
    padding: 6px 10px;
    color: var(--pb-navy);
    white-space: nowrap;
}

.pb-court[data-court="VIP"] .pb-court-name,
.pb-table tr[data-court="VIP"] .pb-court-name {
    background: #FEF3C7;
    color: #92400E;
}

.pb-meta { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }

.pb-meta-cell {
    width: 1%;
    white-space: nowrap;
    vertical-align: middle;
}

.pb-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 8px;
    padding: 5px 8px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .02em;
    background: #EEF2F6;
    color: #334155;
}

.pb-badge-tk { background: #EEF2F6; color: #334155; }
.pb-badge-bk { background: #FEF3C7; color: #92400E; }
.pb-badge-ck { background: #FEE2E2; color: #991B1B; }

.pb-grade {
    display: inline-flex;
    margin-left: 4px;
    border-radius: 8px;
    padding: 5px 7px;
    font-size: 12px;
    font-weight: 800;
    background: #F4F1E8;
    color: #8A5A12;
}

.pb-grade-c1 { background: #FEF3C7; color: #92400E; }
.pb-grade-c2 { background: #EEF2F6; color: #334155; }
.pb-grade-c3 { background: #F3E8E0; color: #9A3412; }

.pb-cat { font-size: 13px; font-weight: 800; }
.pb-cat-men { color: var(--pb-men); }
.pb-cat-women { color: var(--pb-women); }
.pb-cat-mixed { color: var(--pb-mixed); }

.pb-matchup-cell { width: auto; }

.pb-matchup {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) 88px minmax(140px, 1fr);
    justify-content: stretch;
    align-items: center;
    column-gap: 14px;
}

.pb-matchup > div:nth-child(2) {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pb-side { overflow: visible; min-width: 0; }
.pb-side-a { text-align: right; }

.pb-team-tag {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    color: #6B7C85;
    margin-bottom: 3px;
    white-space: nowrap;
}

.pb-player-line {
    font-size: 14.5px;
    font-weight: 800;
    letter-spacing: -.015em;
    line-height: 1.35;
    white-space: nowrap;
}

.pb-seed {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #7A8B93;
    margin-bottom: 3px;
}

.pb-side.tbd .pb-player-line { color: #94A3B8; font-weight: 600; font-style: italic; }
.pb-side.winner .pb-player-line { color: #14532D; }
.pb-side.winner .pb-team-tag { color: #3F6F55; }

.pb-vs {
    width: 52px;
    height: 52px;
    margin: 0 auto;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-family: var(--pb-num);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .08em;
    color: #5B6B74;
    background: #F4F7F5;
    border: 1px solid #E3EBE8;
}

tr.status-due .pb-vs { background: #FEF9C3; border-color: #FDE68A; color: #A16207; }
tr.status-live .pb-vs { background: #FEE2E2; border-color: #FECACA; color: #B91C1C; }
tr.status-done .pb-vs,
tr.status-live .pb-vs {
    font-size: 26px;
    letter-spacing: -.02em;
    width: auto;
    min-width: 64px;
    height: 48px;
    padding: 0 12px;
    border-radius: 12px;
    line-height: 1;
}

tr.status-done .pb-vs {
    background: #DCFCE7;
    border-color: #BBF7D0;
    color: #14532D;
}

.pb-bo3 {
    margin-top: 4px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    color: #9AA8AE;
    text-align: center;
}

.pb-set-chips {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    padding-left: 0;
}

.pb-set-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    padding: 3px 7px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #D7E3DE;
    font-family: var(--pb-num);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    color: #64748B;
    box-shadow: 0 1px 0 rgba(7, 19, 31, .04);
}

.pb-set-chip i {
    font-style: normal;
    font-size: 10px;
    font-weight: 600;
    color: #CBD5E1;
}

.pb-set-chip b { font-weight: 700; }

.pb-set-chip.is-home {
    background: #F0FDFA;
    border-color: #99F6E4;
}

.pb-set-chip.is-home b:first-of-type {
    color: #0F766E;
    font-weight: 800;
}

.pb-set-chip.is-away {
    background: #F8FAFC;
    border-color: #E2E8F0;
}

.pb-set-chip.is-away b:last-of-type {
    color: #0F766E;
    font-weight: 800;
}

tr.status-done .pb-set-chip {
    background: #fff;
}

tr.status-done .pb-set-chip.is-home {
    background: #ECFDF5;
    border-color: #A7F3D0;
}

tr.status-live .pb-set-chip {
    background: #fff;
}

.pb-live {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    color: #B91C1C;
    background: #FEE2E2;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    border-radius: 999px;
    padding: 3px 7px;
}

.pb-live::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #EF4444;
    animation: pb-pulse 1.2s ease-in-out infinite;
}

@keyframes pb-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .35; }
}

.pb-action { width: 108px; text-align: right; }

.pb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid #D1DDD8;
    background: #fff;
    color: var(--pb-navy);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 800;
    font-family: inherit;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
}

.pb-btn:hover {
    border-color: var(--pb-teal);
    color: var(--pb-teal-d);
    background: #F0FDFA;
}

.pb-empty {
    text-align: center;
    padding: 36px 20px;
    color: var(--pb-muted);
    font-weight: 600;
}

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

@media (max-width: 860px) {
    .pb-filter-court,
    .pb-filter-date { flex-basis: 100%; width: 100%; }
}

@media (max-width: 760px) {
    .pb-time { font-size: 24px; }
    .pb-sch { padding-left: 12px; padding-right: 12px; }
    .pb-court-title h3 { font-size: 18px; }
}

.pb-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(7, 19, 31, .48);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.pb-modal-backdrop.open { display: flex; }
.pb-modal {
    width: min(560px, 100%);
    max-height: min(90vh, 760px);
    overflow: auto;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(7, 19, 31, .22);
    color: #102033;
}
.pb-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 22px 12px;
}
.pb-modal-head h3 { font-size: 18px; letter-spacing: -.02em; margin: 0; }
.pb-modal-sub { margin-top: 4px; font-size: 13px; font-weight: 600; color: #5B6B74; }
.pb-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #F4F7F5;
    font-size: 20px;
    color: #5B6B74;
    border: 0;
    cursor: pointer;
    flex-shrink: 0;
}
.pb-modal-vs {
    margin: 0 22px 16px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    align-items: center;
    padding: 14px;
    background: #F7FBFA;
    border-radius: 14px;
}
.pb-modal-vs .pb-side { min-width: 0; }
.pb-modal-vs .pb-vs { width: 40px; height: 40px; font-size: 12px; }
.pb-modal-body { padding: 0 22px 8px; }
.pb-field-label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #7A8B93;
    margin: 0 0 8px;
}
.pb-status-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}
.pb-status-opt {
    text-align: left;
    border: 1px solid #E3EBE8;
    background: #fff;
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
    font-family: inherit;
}
.pb-status-opt b { display: block; font-size: 13px; }
.pb-status-opt span { display: block; font-size: 11px; font-weight: 600; color: #5B6B74; margin-top: 2px; }
.pb-status-opt.active[data-status="upcoming"] { background: #fff; outline: 2px solid #94A3B8; }
.pb-status-opt.active[data-status="due"] { background: #FFFBEB; outline: 2px solid #FCD34D; }
.pb-status-opt.active[data-status="live"] { background: #FEF2F2; outline: 2px solid #FCA5A5; }
.pb-status-opt.active[data-status="done"] { background: #F0FDF4; outline: 2px solid #86EFAC; }
.pb-sets-grid { display: grid; gap: 8px; margin-bottom: 8px; }
.pb-set-row {
    display: grid;
    grid-template-columns: 64px 1fr auto 1fr;
    gap: 8px;
    align-items: center;
}
.pb-set-row label { font-size: 12px; font-weight: 800; color: #64748B; }
.pb-set-row input {
    width: 100%;
    border: 1px solid #D1DDD8;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 18px;
    font-weight: 800;
    font-family: "Barlow Condensed", "Plus Jakarta Sans", sans-serif;
    text-align: center;
}
.pb-set-row em { font-style: normal; font-weight: 800; color: #94A3B8; }
.pb-modal-hint {
    font-size: 12px;
    font-weight: 600;
    color: #5B6B74;
    margin-bottom: 12px;
}
.pb-modal-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 22px 20px;
    border-top: 1px solid #E3EBE8;
}
.pb-btn-ghost,
.pb-btn-save,
.pb-btn-start,
.pb-btn-finish {
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 800;
    border: 0;
    cursor: pointer;
    font-family: inherit;
}
.pb-btn-ghost { background: #F4F7F5; color: #07131F; }
.pb-btn-save { background: #07131F; color: #fff; }
.pb-btn-start { background: #FEE2E2; color: #B91C1C; }
.pb-btn-finish { background: #DCFCE7; color: #166534; }
