/* ── Brand palette ───────────────────────────────────────────────────────── */

:root {
    --global-palette1: #105e8d;
    --global-palette2: #082f47;
    --global-palette3: #f9dc04;
    --global-palette4: #fdc300;
    --global-palette5: #101010;
    --global-palette6: #b4b4b4;
    --global-palette7: #e4eef4;
    --global-palette8: #f0f0f0;
    --global-palette9: #ffffff;

    /* Bootstrap overrides */
    --bs-primary:           var(--global-palette1);
    --bs-primary-rgb:       16, 94, 141;
    --bs-link-color:        var(--global-palette1);
    --bs-link-hover-color:  var(--global-palette2);
}

.btn-primary {
    --bs-btn-bg:                 var(--global-palette1);
    --bs-btn-border-color:       var(--global-palette1);
    --bs-btn-hover-bg:           var(--global-palette2);
    --bs-btn-hover-border-color: var(--global-palette2);
    --bs-btn-active-bg:          var(--global-palette2);
    --bs-btn-active-border-color:var(--global-palette2);
    --bs-btn-disabled-bg:        var(--global-palette1);
    --bs-btn-disabled-border-color:var(--global-palette1);
}

.btn-outline-primary {
    --bs-btn-color:              var(--global-palette1);
    --bs-btn-border-color:       var(--global-palette1);
    --bs-btn-hover-bg:           var(--global-palette1);
    --bs-btn-hover-border-color: var(--global-palette1);
    --bs-btn-active-bg:          var(--global-palette1);
    --bs-btn-active-border-color:var(--global-palette1);
}

/* ── Layout ─────────────────────────────────────────────────────────────── */

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa;
    font-size: 0.9rem;
}

main {
    flex: 1;
}

/* ── Filter sidebar collapse (mobile) ───────────────────────────────────── */

@media (min-width: 1200px) {
    #filter-collapse {
        display: block !important;
    }
}

.filter-toggle-btn {
    color: inherit !important;
    line-height: 1.4;
    min-width: 0;
    overflow: hidden;
}

.filter-chevron {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.filter-toggle-btn[aria-expanded="true"] .filter-chevron {
    transform: rotate(180deg);
}

/* ── Navbar (old classes removed — see new .navbar-main below) ───────────── */

/* ── Cards ───────────────────────────────────────────────────────────────── */

.card {
    border: 1px solid #e0e0e0;
    border-radius: 0.5rem;
}

.card-header {
    border-radius: 0.5rem 0.5rem 0 0 !important;
    padding: 0.75rem 1rem;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */

.table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
}

/* ── Per-competition blocks ──────────────────────────────────────────────── */

.comp-block {
    overflow: hidden;
}

.comp-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    background: #f0f6fb;
    border-bottom: 1px solid #c9dff0;
    border-radius: 0.5rem 0.5rem 0 0;
}

.comp-block-title-wrap {
    display: flex;
    align-items: center;
    min-width: 0;
}

.comp-block-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0c3a5c;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.comp-block-count {
    font-size: 0.7rem;
    flex-shrink: 0;
}

.comp-tabs {
    display: flex;
    gap: 0.1rem;
    flex-shrink: 0;
}

.comp-tab-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 500;
    border: none;
    border-radius: 0.375rem;
    background: transparent;
    color: rgba(8,47,71,0.55);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    line-height: 1.4;
}

.comp-tab-btn:hover {
    background: rgba(8,47,71,0.08);
    color: var(--global-palette2);
}

.comp-tab-btn--active {
    background: var(--global-palette2);
    color: var(--global-palette4);
}

.comp-tab-btn--active:hover {
    background: var(--global-palette2);
    color: var(--global-palette4);
}

.comp-tab-pane {
    /* panes shown/hidden via d-none; no layout needed */
}

/* ── Per-group sections within a competition block ───────────────────────── */

.comp-group-section--not-first {
    border-top: 2px solid #c9dff0;
}

@keyframes group-highlight {
    0%   { background: rgba(253,195,0,0.22); }
    100% { background: transparent; }
}

.comp-group-section--highlight {
    animation: group-highlight 1.8s ease-out forwards;
}

.comp-group-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0.5rem 0.3rem 0.75rem;
    background: #f4f8fb;
    border-bottom: 1px solid #e2eef6;
}

.comp-group-section-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--global-palette2);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-grow: 1;
}

.comp-team-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 0.75rem;
    background: #f8fbfd;
    border-bottom: 1px solid #e2eef6;
}

.comp-section-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid #e9ecef;
}

.comp-section-label--upcoming {
    background: #f0faf3;
    color: #157347;
}

.comp-section-label--past {
    background: #f8f9fa;
    color: #6c757d;
}

/* Hide the per-row competition name when inside a comp-block (already in header) */
.comp-block .match-meta-comp {
    display: none;
}

/* ── Match list (grid layout, replaces table) ────────────────────────────── */

.matches-list {
    overflow: hidden;
}

.match-item {
    display: grid;
    grid-template-columns: auto minmax(0, 150px) 1fr;
    grid-template-areas: "comp date main";
    align-items: center;
    gap: 0 0.75rem;
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    border-left: 3px solid transparent;
    transition: background 0.08s;
}

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

.match-item:hover {
    background: #f8f9fa;
}

.match-item.is-favorite {
    border-left-color: var(--global-palette4);
}

/* Date column */
.match-date-col {
    grid-area: date;
    display: flex;
    flex-direction: column;
}

/* Competition column */
.match-comp-col {
    grid-area: comp;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.match-meta-comp {
    font-size: 0.68rem;
    color: #6c757d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-meta-round {
    font-size: 0.68rem;
    color: #6c757d;
    white-space: nowrap;
}

.match-meta-date,
.match-meta-time {
    font-size: 0.68rem;
    color: #495057;
    font-weight: 500;
    white-space: nowrap;
}

/* Teams row */
.match-main {
    grid-area: main;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
}

.match-team {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1;
}

.match-team--local {
    justify-content: flex-end;
}

.match-team--local .team-cell {
    flex-direction: row-reverse;
}

/* Desktop: visitor score appears before the team name */
.match-team--visitor .match-score-split {
    order: -1;
}

.match-sep {
    flex-shrink: 0;
    color: #adb5bd;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0 0.2rem;
    align-self: center;
}

.match-score-split {
    font-size: 1rem;
    font-weight: 700;
    color: var(--global-palette5);
    white-space: nowrap;
    flex-shrink: 0;
    align-self: center;
    width: 1.8rem;
    text-align: center;
}

.match-actions {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    flex-shrink: 0;
}

.match-comp-header-row {
    background: #e8f0f8;
    padding: 0.3rem 0.75rem;
    border-bottom: 1px solid #c0d5e5;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--global-palette1);
}

.match-subgroup-header-row {
    background: #f8f9fa;
    padding: 0.2rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.68rem;
    font-weight: 600;
    color: #495057;
    font-style: italic;
}

.match-upcoming .team-name {
    font-weight: 600;
}

/* ── Match list: mobile layout ───────────────────────────────────────────── */

@media (max-width: 575px) {
    .match-item {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "comp  date"
            "main  main";
        gap: 0.15rem 0.5rem;
    }

    .match-date-col {
        align-items: flex-end;
    }

    .match-meta-comp {
        font-size: 1rem;
        font-weight: 700;
        color: var(--global-palette1);
        text-transform: uppercase;
        letter-spacing: 0.04em;
        overflow: visible;
        text-overflow: unset;
        white-space: normal;
    }

    .match-meta-round {
        font-size: 1rem;
    }

    .match-meta-date,
    .match-meta-time {
        font-size: 0.9rem;
        font-weight: 600;
        text-align: right;
    }

    .match-main {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-areas:
            "local"
            "visitor"
            "actions";
        gap: 0;
        padding: 15px 0px;
    }

    .match-sep {
        display: none;
    }

    .match-team {
        flex: none;
    }

    .match-team--local {
        grid-area: local;
        justify-content: space-between;
    }

    .match-team--local .team-cell {
        flex-direction: row;
    }

    .match-team--visitor {
        grid-area: visitor;
        justify-content: space-between;
    }

    .match-team--visitor .match-score-split {
        order: 0;
    }

    .match-actions {
        grid-area: actions;
        justify-content: flex-end;
        padding-top: 0.15rem;
    }

    .match-comp-header-row {
        font-size: 0.78rem;
        padding: 0.45rem 0.75rem;
        letter-spacing: 0.07em;
    }
}

.result-badge {
    font-size: 1.1rem;
    font-weight: 700;
    color: #dc3545;
    white-space: nowrap;
}

.result-pending {
    font-size: 0.75rem;
    color: #adb5bd;
}

#modal-acta .modal-body {
    flex: 1;
    min-height: 0;
}

button.result-badge--acta {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    border-bottom: 1px dashed currentColor;
}

button.result-badge--acta:hover {
    color: #b02a37;
}

.competition-label {
    font-size: 0.72rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    display: inline-block;
}

/* ── Team cell (logo + position + name) ──────────────────────────────────── */

.team-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    cursor: default;
    max-width: 300px;
}

@media (min-width: 1200px) {
    .team-cell { max-width: 320px; }
}

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

.team-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    border-radius: 3px;
    background: #6c757d;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    flex-shrink: 0;
    padding: 0 2px;
}

/* ── Competition picker ───────────────────────────────────────────────────── */

.comp-picker {
    position: relative;
}

.picker-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0.375rem 0.75rem;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #212529;
    transition: border-color 0.15s, box-shadow 0.15s;
    text-align: left;
}

.picker-toggle:hover {
    border-color: #7aafc9;
}

.picker-toggle.active {
    border-color: #7aafc9;
    box-shadow: 0 0 0 0.2rem rgba(16, 94, 141, 0.25);
}

.picker-toggle .bi-chevron-down {
    flex-shrink: 0;
    transition: transform 0.15s;
    font-size: 0.75rem;
    color: #6c757d;
}

.picker-toggle.active .bi-chevron-down {
    transform: rotate(180deg);
}

.picker-dropdown {
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    right: 0;
    z-index: 1050;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    max-height: 340px;
    overflow-y: auto;
}

.comp-group-header {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6c757d;
    padding: 0.5rem 0.75rem 0.2rem;
    background: #f8f9fa;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
}

.comp-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.5rem 0.3rem 0.75rem;
    cursor: pointer;
    font-size: 0.83rem;
    transition: background 0.08s;
}

.comp-item:hover {
    background: #e8f0f8;
}

.comp-item input[type="checkbox"] {
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #105e8d;
}

.comp-item-name {
    flex-grow: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.comp-fav-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 0.1rem 0.25rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: #ced4da;
    line-height: 1;
    border-radius: 0.25rem;
    transition: color 0.1s;
}

.comp-fav-btn:hover,
.comp-fav-btn.active {
    color: var(--global-palette4);
}

/* ── Club grid ────────────────────────────────────────────────────────────── */

.club-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 0.4rem;
    max-height: 490px;
    overflow-y: auto;
    padding-right: 2px;
}

.club-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.25rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.1s, background 0.1s, box-shadow 0.1s;
    text-align: center;
    min-height: 70px;
}

.club-tile:hover {
    border-color: #105e8d;
    background: #e8f0f8;
}

.club-tile.selected {
    border-color: #105e8d;
    background: #ddeaf5;
    box-shadow: 0 0 0 2px rgba(16, 94, 141, 0.2);
}

.club-tile-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.club-tile-icon {
    font-size: 1.4rem;
    color: #adb5bd;
}

.club-tile-name {
    font-size: 0.62rem;
    line-height: 1.25;
    color: #495057;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.club-tile.selected .club-tile-name {
    color: #0a4d73;
    font-weight: 600;
}

.club-tile-fav {
    position: absolute;
    top: 3px;
    right: 4px;
    font-size: 0.65rem;
    color: #ced4da;
    cursor: pointer;
    line-height: 1;
    transition: color 0.1s;
    z-index: 1;
}

.club-tile-fav:hover,
.club-tile-fav.active {
    color: var(--global-palette4);
}

/* ── Chips ────────────────────────────────────────────────────────────────── */

.chips-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.picker-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #105e8d;
    color: #fff;
    border-radius: 1rem;
    padding: 0.15rem 0.25rem 0.15rem 0.5rem;
    font-size: 0.72rem;
    max-width: 180px;
    line-height: 1.3;
}

.picker-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.picker-chip button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 0 0.1rem;
    line-height: 1;
    font-size: 1rem;
    flex-shrink: 0;
}

.picker-chip button:hover {
    color: #fff;
}

.picker-chip--club {
    gap: 0.35rem;
    padding-left: 0.35rem;
}

.fav-shortcut-chip {
    border: none;
    padding: 0.3rem 0.65rem 0.3rem 0.5rem;
    cursor: pointer;
    background: var(--global-palette2);
    max-width: none;
    width: 100%;
    border-radius: 0.45rem;
    align-items: flex-start;
    gap: 0.35rem;
}

.fav-shortcut-chip:hover {
    background: var(--global-palette1);
}

.fav-chip-star {
    font-size: 0.6rem;
    color: var(--global-palette4);
    flex-shrink: 0;
    margin-top: 0.18rem;
}

.fav-chip-body {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    text-align: left;
    font-size: 0.67rem;
    font-weight: 400;
    opacity: 0.65;
    line-height: 1.3;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}

.fav-chip-group {
    display: block;
    white-space: normal;
}

.fav-chip-team {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    opacity: 1;
    line-height: 1.3;
    white-space: normal;
}

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

/* ── Misc ────────────────────────────────────────────────────────────────── */

.btn-xs {
    font-size: 0.75rem;
}

#matches-loading {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.spin {
    display: inline-block;
    animation: spin 0.8s linear infinite;
}

/* ── Classificació ────────────────────────────────────────────────────────── */

tr.classif-highlight {
    background-color: var(--global-palette7) !important;
    font-weight: 600;
}

tr.classif-highlight:hover {
    background-color: #d4e5f0 !important;
}

/* ── Action buttons (WA + GCal) ──────────────────────────────────────────── */

.action-btns {
    display: inline-flex;
    gap: 0.3rem;
    align-items: center;
    justify-content: center;
}

.btn-wa-conv {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #25D366;
    border-radius: 0.3rem;
    background: transparent;
    color: #25D366;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
    padding: 0;
}

.btn-wa-conv:hover {
    background: #25D366;
    color: #fff;
}

.btn-gcal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #4285F4;
    border-radius: 0.3rem;
    background: transparent;
    color: #4285F4;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.1s, color 0.1s;
}

.btn-gcal:hover {
    background: #4285F4;
    color: #fff;
}

.btn-acta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #6c757d;
    border-radius: 0.3rem;
    background: transparent;
    color: #6c757d;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
    padding: 0;
}

.btn-acta:hover {
    background: #6c757d;
    color: #fff;
}


/* ── Convocatòria modal ───────────────────────────────────────────────────── */

.wa-message-preview {
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', ui-monospace, monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    resize: none;
    white-space: pre-wrap;
    background: #f8f9fa;
}

/* ── Classificació filtre per equip ──────────────────────────────────────── */


.classif-filter-team {
    position: relative;
    width: 44px;
    height: 44px;
    border: 2px solid #dee2e6;
    border-radius: 50%;
    background: #fff;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
    flex-shrink: 0;
}

.classif-filter-team img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.classif-filter-initials {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    color: #6c757d;
    pointer-events: none;
}

.classif-filter-team:not(.no-logo) .classif-filter-initials {
    display: none;
}

.classif-filter-team:hover {
    border-color: #105e8d;
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
    z-index: 1;
}

.classif-filter-team--sel {
    border-color: #105e8d;
    box-shadow: 0 0 0 3px rgba(16,94,141,.25);
}

.classif-filter-team--sel:hover {
    border-color: #0a4d73;
}

.classif-filter-clear {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 1rem;
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
    white-space: nowrap;
}

.classif-filter-clear:hover {
    background: #e9ecef;
    color: #212529;
}

/* ── Classificació agrupada per categoria ────────────────────────────────── */

.classif-group-header {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #105e8d;
    padding: 1rem 0 0.5rem;
    margin-top: 0.25rem;
    border-top: 2px solid #dee2e6;
}

.classif-group-header--first {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

/* ── Classificació taula estadístiques ───────────────────────────────────── */

.classif-table .classif-pts {
    border-left: 2px solid #dee2e6;
}

.classif-table .classif-stat {
    font-size: 0.78rem;
    color: #6c757d;
}

.classif-table thead .classif-stat {
    font-size: 0.7rem;
    color: #6c757d;
}

/* ── Classificació sub-grups (grups dins d'una lliga) ────────────────────── */

.classif-subgroup + .classif-subgroup {
    border-top: 2px solid #dee2e6;
}

.classif-subgroup-header {
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    background: #495057;
    padding: 0.3rem 0.75rem;
    letter-spacing: 0.03em;
}

/* ── Popovers ─────────────────────────────────────────────────────────────── */

.popover-prev-match .team-names strong {
    font-size: 0.82rem;
}


/* ── Navbar (redesign) ───────────────────────────────────────────────────── */

.navbar-main {
    background-color: var(--global-palette2);
    border-bottom: 3px solid var(--global-palette4);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.navbar-main .navbar-brand-icon {
    font-size: 1.6rem;
    color: var(--global-palette4);
    line-height: 1;
}

.navbar-main .navbar-brand-name {
    font-size: 1rem;
    font-weight: 800;
    color: var(--global-palette4);
    letter-spacing: 0.04em;
    line-height: 1.1;
}

.navbar-main .navbar-brand-sub {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    line-height: 1;
}

.navbar-main .nav-link {
    color: rgba(255,255,255,0.75);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: 0.375rem;
    transition: background 0.15s, color 0.15s;
}

.navbar-main .nav-link:hover,
.navbar-main .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.navbar-main .nav-link.active {
    color: var(--global-palette4);
}

/* ── Auth Modal (redesign) ───────────────────────────────────────────────── */

.auth-modal-dialog {
    max-width: 420px;
}

.auth-modal-header {
    background: var(--global-palette2);
    padding: 1.5rem 1.5rem 1.25rem;
    position: relative;
}

.auth-modal-icon {
    font-size: 1.5rem;
    color: var(--global-palette4);
}

.auth-modal-brand {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--global-palette4);
    letter-spacing: 0.04em;
}

.auth-modal-tagline {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.55);
    letter-spacing: 0.03em;
}

.auth-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.auth-tabs .nav-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--global-palette1);
    border-radius: 0.5rem;
}

.auth-tabs .nav-link.active {
    background-color: var(--global-palette1);
    color: #fff;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #adb5bd;
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid #dee2e6;
}
.auth-divider span {
    padding: 0 0.75rem;
}

/* ── Home: Hero + Search ─────────────────────────────────────────────────── */

.home-main {
    flex: 1;
}

.home-hero {
    background: linear-gradient(135deg, var(--global-palette2) 0%, var(--global-palette1) 100%);
    padding: 3rem 0 2.5rem;
}

.home-hero-text {
    text-align: center;
    margin-bottom: 1.75rem;
}

.home-hero-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--global-palette4);
    margin-bottom: 0.4rem;
    letter-spacing: 0.01em;
}

.home-hero-sub {
    font-size: 1rem;
    color: rgba(255,255,255,0.65);
    margin: 0;
}

.home-search-wrap {
    position: relative;
    max-width: 620px;
    margin: 0 auto;
}

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

.home-search-icon {
    position: absolute;
    left: 1rem;
    color: var(--global-palette6);
    font-size: 1.1rem;
    pointer-events: none;
}

.home-search-input {
    width: 100%;
    border: none;
    border-radius: 0.75rem;
    padding: 0.85rem 1rem 0.85rem 2.75rem;
    font-size: 1rem;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    outline: none;
    background: #fff;
}

.home-search-input:focus {
    box-shadow: 0 4px 24px rgba(0,0,0,0.22), 0 0 0 3px rgba(16,94,141,0.25);
}

/* Search results dropdown */

.search-results-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    z-index: 1050;
    overflow: hidden;
    max-height: 420px;
    overflow-y: auto;
}

.search-result-group-label {
    padding: 0.5rem 1rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--global-palette6);
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

.search-result-group-label:first-child {
    border-top: none;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.6rem 0.6rem 1rem;
    cursor: pointer;
    transition: background 0.1s;
}

.search-result-item:hover {
    background: var(--global-palette7);
}

.search-result-logo {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
}

.search-result-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.badge-comp {
    background: var(--global-palette7);
    color: var(--global-palette1);
    border: 1px solid var(--global-palette1);
}

.badge-club {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.search-result-name {
    font-size: 0.88rem;
    color: var(--global-palette5);
    flex: 1;
}

.search-result-fav {
    background: none;
    border: none;
    padding: 0.2rem 0.3rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: #ced4da;
    line-height: 1;
    flex-shrink: 0;
    border-radius: 0.25rem;
    transition: color 0.1s;
}

.search-result-fav:hover,
.search-result-fav.active {
    color: var(--global-palette4);
}

.search-result-empty {
    padding: 1rem;
    text-align: center;
    color: var(--global-palette6);
    font-size: 0.88rem;
}

/* ── Home: Sections ──────────────────────────────────────────────────────── */

.home-section {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
    overflow: hidden;
}

.home-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
}

.home-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--global-palette5);
}

.home-section-link {
    font-size: 0.8rem;
    color: var(--global-palette1);
    text-decoration: none;
    cursor: pointer;
}

.home-section-link:hover {
    text-decoration: underline;
}

.home-empty-state {
    padding: 2rem 1.25rem;
    text-align: center;
}

/* Favorites chips */

.fav-chips-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
}

.fav-chip {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border-radius: 2rem;
    font-size: 0.82rem;
    font-weight: 600;
    transition: filter 0.15s, transform 0.1s;
    overflow: hidden;
}

.fav-chip:hover {
    filter: brightness(0.93);
    transform: translateY(-1px);
}

.fav-chip-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.5rem 0.35rem 0.75rem;
    text-decoration: none;
    color: inherit;
    flex: 1;
}

.fav-chip-link:hover {
    text-decoration: none;
    color: inherit;
}

.fav-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.55rem;
    background: none;
    border: none;
    border-left: 1px solid rgba(0,0,0,0.12);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    opacity: 0.55;
    align-self: stretch;
    transition: opacity 0.1s, background 0.1s;
}

.fav-chip-remove:hover {
    opacity: 1;
    background: rgba(0,0,0,0.08);
}

.fav-chip--comp {
    background: var(--global-palette7);
    color: var(--global-palette2);
    border: 1px solid #c8dde9;
}

.fav-chip--club {
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #a5d6a7;
}

.fav-chip-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

/* ── Favorite pair cards (home page) ────────────────────────────────────── */

.fav-pairs-list {
    padding: 1rem 1.25rem;
}

.fav-pair-card {
    background: #fff;
    border: 1px solid #cfe2f3;
    border-radius: 0.625rem;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(8,47,71,.07);
    margin-bottom: 1.25rem;
}

.fav-pair-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--global-palette2);
    padding: 0.6rem 1rem;
}

.fav-pair-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.fav-pair-comp {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--global-palette4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fav-pair-group {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255,255,255,.75);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fav-pair-team {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fav-pair-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.fav-pair-link,
.fav-pair-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.15);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.85rem;
    transition: background .15s;
}

.fav-pair-link:hover,
.fav-pair-remove:hover {
    background: rgba(255,255,255,.28);
    color: #fff;
}

.fav-pair-body {
    display: flex;
}

.fav-pair-matches {
    width: 50%;
    flex-shrink: 0;
    padding: 0.5rem 0.875rem;
    border-right: 1px solid #e4eef7;
    min-width: 0;
}

.fav-pair-classif {
    flex: 1;
    padding: 0.25rem 0.5rem;
    overflow-x: auto;
    min-width: 0;
}

@media (max-width: 576px) {
    .fav-pair-body       { flex-direction: column; }
    .fav-pair-matches    { border-right: none; border-bottom: 1px solid #e4eef7; }
    .fav-pair-classif    { width: 100%; }
}

/* Mini match rows */

.fav-mini-match {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid #f0f5fa;
    font-size: 0.8rem;
}

.fav-mini-match:last-child { border-bottom: none; }
.fav-mini-match--past  { color: #6c757d; }
.fav-mini-match--upcoming { font-weight: 500; }

.fav-mini-date {
    font-size: 0.68rem;
    color: #8a9bb0;
    white-space: nowrap;
    flex-shrink: 0;
    text-align: right;
    min-width: 3.4rem;
    line-height: 1.3;
}

.fav-mini-time {
    color: #aab6c4;
}

.fav-mini-teams {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    overflow: hidden;
}

.fav-mini-team {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex: 1;
}

.fav-mini-team--mine { font-weight: 600; color: var(--global-palette2); }
.fav-mini-match--past .fav-mini-team--mine { color: #495057; }

.fav-mini-vs {
    font-size: 0.7rem;
    color: #aab6c4;
    flex-shrink: 0;
}

.fav-mini-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}

.fav-mini-logo-placeholder {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.fav-mini-result {
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    color: var(--global-palette2);
    flex-shrink: 0;
}

.fav-mini-match--past .fav-mini-result { color: #495057; }

.fav-mini-empty {
    padding: 0.75rem 0;
    color: #aab6c4;
    font-size: 0.82rem;
    text-align: center;
}

/* Mini classification table */

.fav-classif-table {
    width: 100%;
    font-size: 0.74rem;
    border-collapse: collapse;
}

.fav-classif-table th {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #8a9bb0;
    padding: 0.2rem 0.2rem 0.3rem;
    text-align: center;
    border-bottom: 1px solid #e2eef6;
}

.fav-classif-table th:nth-child(2) { text-align: left; }

.fav-classif-table td {
    padding: 0.2rem 0.2rem;
    text-align: center;
    border-bottom: 1px solid #f0f5fa;
    vertical-align: middle;
}

.fav-classif-table td:nth-child(2) {
    text-align: left;
}

.fav-classif-table tr:last-child td { border-bottom: none; }

.fav-classif-name {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    max-width: 210px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.fav-classif-logo {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex-shrink: 0;
}

.fav-classif-highlight {
    background: #e8f2fc;
}

.fav-classif-highlight td { font-weight: 600; color: var(--global-palette2); }

/* ── Favorite star in group section header ───────────────────────────────── */

.comp-group-fav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1.5px solid #ccdde9;
    border-radius: 50%;
    background: transparent;
    color: #8a9bb0;
    cursor: pointer;
    font-size: 0.75rem;
    margin-left: 0.25rem;
    transition: color .15s, border-color .15s, background .15s;
    flex-shrink: 0;
}

.comp-group-fav-btn:hover,
.comp-group-fav-btn.active {
    color: #fdc300;
    border-color: #fdc300;
    background: rgba(253,195,0,.08);
}

/* ── Favorite star in classification row ─────────────────────────────────── */

.btn-classif-fav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1.5px solid #dee2e6;
    border-radius: 50%;
    background: transparent;
    color: #adb5bd;
    cursor: pointer;
    font-size: 0.68rem;
    padding: 0;
    transition: color .15s, border-color .15s, background .15s;
}

.btn-classif-fav:hover,
.btn-classif-fav.active {
    color: #fdc300;
    border-color: #fdc300;
    background: rgba(253,195,0,.1);
}

/* ── Subscriptions modal panel ───────────────────────────────────────────── */

.subs-modal-dialog {
    max-width: 480px;
}

.subs-modal-header {
    background: linear-gradient(135deg, #082f47 0%, #105e8d 100%);
    color: #fff;
    border-bottom: 3px solid #fdc300;
    padding: 1rem 1.25rem;
    border-radius: 0.375rem 0.375rem 0 0;
}

.subs-modal-header .modal-title {
    color: #fff;
}

.subs-modal-header .text-muted {
    color: rgba(255,255,255,0.6) !important;
}

.subs-modal-header .btn-close {
    filter: invert(1) grayscale(1) brightness(2);
}

.subs-modal-icon {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background: rgba(253,195,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fdc300;
    font-size: 1rem;
    flex-shrink: 0;
}

.subs-legend {
    display: flex;
    justify-content: flex-end;
    gap: 1.25rem;
    padding: 0.4rem 1rem;
    font-size: 0.72rem;
    color: #6c757d;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.subs-comp-header {
    display: flex;
    align-items: center;
    padding: 0.45rem 1rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #0c3a5c;
    background: #f0f6fb;
    border-bottom: 1px solid #c9dff0;
    border-top: 1px solid #c9dff0;
}

.subs-comp-section:first-child .subs-comp-header {
    border-top: none;
}

.subs-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.08s;
}

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

.subs-item:hover {
    background: #fafbfc;
}

.subs-item-name {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
}

.subs-item-group {
    display: block;
    font-size: 0.72rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subs-item-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.subs-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: #6c757d;
    font-size: 0.8rem;
    cursor: pointer;
    margin: 0;
    user-select: none;
}

.subs-toggle-label .form-check-input {
    cursor: pointer;
}

.btn-sub-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: none;
    background: none;
    color: #adb5bd;
    border-radius: 4px;
    cursor: pointer;
    transition: color 0.1s, background 0.1s;
}

.btn-sub-delete:hover {
    color: #dc3545;
    background: #fff0f0;
}

/* ── Home page subscriptions list (widget, not modal) ────────────────────── */

.subs-list {
    display: flex;
    flex-direction: column;
}

.subs-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid #f5f5f5;
    text-decoration: none;
    color: inherit;
    transition: background 0.1s;
}

.subs-list-item:last-child {
    border-bottom: none;
}

.subs-list-item:hover {
    background: var(--global-palette7);
    text-decoration: none;
    color: inherit;
}

.subs-list-bell {
    color: var(--global-palette1);
    font-size: 0.9rem;
    flex-shrink: 0;
    width: 1.5rem;
    text-align: center;
}

.subs-list-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.subs-list-team {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--global-palette5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subs-list-comp {
    font-size: 0.75rem;
    color: var(--global-palette6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subs-list-arrow {
    color: var(--global-palette6);
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* ── Home: Login CTA ─────────────────────────────────────────────────────── */

.home-cta-login {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
    overflow: hidden;
}

.home-cta-inner {
    padding: 3rem 2rem;
    text-align: center;
    max-width: 440px;
    margin: 0 auto;
}

.home-cta-icon {
    font-size: 3rem;
    color: var(--global-palette1);
    display: block;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.home-cta-title {
    font-weight: 700;
    color: var(--global-palette2);
    margin-bottom: 0.5rem;
}

.home-cta-text {
    color: var(--global-palette6);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* ── Cookie Banner ───────────────────────────────────────────────────────── */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    background: var(--global-palette2);
    border-top: 3px solid var(--global-palette4);
    padding: 0.85rem 1rem;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.cookie-banner--hidden {
    animation: slideDown 0.25s ease forwards;
}

@keyframes slideDown {
    from { transform: translateY(0);    opacity: 1; }
    to   { transform: translateY(100%); opacity: 0; }
}

.cookie-banner-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.cookie-banner-text {
    flex: 1;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.85);
    min-width: 200px;
}

.cookie-banner-link {
    color: var(--global-palette4);
}

.cookie-banner-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

@media (max-width: 576px) {
    .cookie-banner-inner {
        flex-direction: column;
        align-items: stretch;
    }
    .cookie-banner-actions {
        justify-content: flex-end;
    }
}

/* ── Branded modal header (generic, reusable) ────────────────────────────── */

.modal-header-branded {
    background: var(--global-palette2);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
}

.modal-title-branded {
    color: var(--global-palette4);
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.02em;
}

/* ── Calendar match-row favorite star ───────────────────────────────────── */

.btn-match-fav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
    font-size: 0.75rem;
    color: #adb5bd;
    flex-shrink: 0;
    line-height: 1;
    vertical-align: middle;
    transition: color 0.15s, background 0.15s;
}

.btn-match-fav:hover {
    color: var(--global-palette4);
    background: rgba(253,195,0,0.1);
}

.btn-match-fav.active {
    color: var(--global-palette4);
}

/* ── Favorite team name highlight ───────────────────────────────────────── */

.team-name--fav {
    font-weight: 700;
    color: var(--global-palette2);
}

/* ── Subscription toggles inside favorite pair cards ───────────────────── */

.fav-pair-subs {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 1rem;
    border-top: 1px solid #e4eef7;
    background: #f8fafc;
    border-radius: 0 0 0.5rem 0.5rem;
}

.fav-pair-subs-label {
    color: #6c757d;
    font-size: 0.78rem;
    white-space: nowrap;
    flex-shrink: 0;
}
