body {
    background: #f5f6f8;
}

.card {
    border-radius: 14px;
}

.form-label {
    font-weight: 600;
}

.json-preview {
    font-size: 12px;
    background: #111827;
    color: #d1d5db;
    border-radius: 8px;
    padding: 12px;
    min-height: 70px;
    white-space: pre-wrap;
}

.select2-container--bootstrap-5 .select2-selection {
    min-height: 38px;
}

.select2-result-partida,
.select2-selection-partida,
.select2-result-jogador,
.select2-selection-jogador {
    display: flex;
    align-items: center;
    gap: 8px;
}

.select2-result-partida img,
.select2-selection-partida img,
.select2-result-jogador img,
.select2-selection-jogador img {
    object-fit: cover;
    flex: 0 0 auto;
}

.select2-result-partida img,
.select2-selection-partida img {
    width: 26px;
    height: 26px;
    border-radius: 7px;
}

.select2-result-jogador img,
.select2-selection-jogador img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.select2-partida-images {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.select2-partida-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.select2-partida-data {
    font-size: 11px;
    opacity: .7;
}

.image-preview-wrapper {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.image-preview {
    width: 112px;
    height: 86px;
    border-radius: 12px;
    border: 1px solid #dee2e6;
    object-fit: cover;
    background: #fff;
}


.select2-result-plataforma,
.select2-selection-plataforma {
    display: flex;
    align-items: center;
    gap: 8px;
}

.select2-result-plataforma img,
.select2-selection-plataforma img {
    width: 36px;
    height: 24px;
    border-radius: 6px;
    object-fit: cover;
    flex: 0 0 auto;
}

.plataforma-logo-card {
    width: 52px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #dee2e6;
    background: #fff;
}


/* Evita o dropdown do Select2 ficar escondido atrás de cards ou outros elementos */
.select2-container--open {
    z-index: 999999 !important;
}

.select2-dropdown {
    z-index: 999999 !important;
}

/* Garante altura confortável para selects múltiplos */
.select2-container--bootstrap-5 .select2-selection--multiple {
    min-height: 44px;
}


/* V9: reforço visual e prevenção do dropdown escondido */
.select2-container--open,
.select2-dropdown {
    z-index: 999999 !important;
}

.select2-container--bootstrap-5 .select2-selection--multiple {
    min-height: 44px;
}


/* V10 */
.select2-container--open,
.select2-dropdown {
    z-index: 999999 !important;
}

.select2-container--bootstrap-5 .select2-selection--multiple {
    min-height: 44px;
}

.select2-results__option {
    min-height: 34px;
}


/* V11 - Select custom de partidas */
.partidas-custom-select {
    position: relative;
    width: 100%;
}

.partidas-custom-button {
    width: 100%;
    min-height: 48px;
    border: 1px solid #ced4da;
    background: #fff;
    border-radius: .375rem;
    padding: 7px 42px 7px 10px;
    text-align: left;
    position: relative;
}

.partidas-custom-button:focus {
    outline: 0;
    border-color: #86b7fe;
    box-shadow: 0 0 0 .25rem rgba(13,110,253,.25);
}

.partidas-custom-arrow {
    position: absolute;
    right: 14px;
    top: 12px;
    font-size: 16px;
}

.partidas-custom-dropdown {
    position: absolute;
    z-index: 999999;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: .375rem;
    box-shadow: 0 10px 30px rgba(0,0,0,.12);
    max-height: 360px;
    overflow: hidden;
}

.partidas-custom-lista {
    max-height: 300px;
    overflow-y: auto;
}

.partida-custom-option {
    width: 100%;
    border: 0;
    background: #fff;
    display: grid;
    grid-template-columns: 28px 34px minmax(70px, 120px) 1fr 34px minmax(70px, 120px) auto;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #f1f1f1;
    text-align: left;
}

.partida-custom-option:hover {
    background: #f8f9fa;
}

.partida-custom-option.selected {
    background: #fff8e1;
}

.partida-check {
    width: 22px;
    height: 22px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #198754;
    background: #fff;
}

.partida-team-img {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #dee2e6;
}

.partida-team-name {
    font-size: 13px;
    color: #495057;
}

.partida-title {
    font-size: 14px;
    color: #212529;
}

.partida-date {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    color: #495057;
    font-size: 13px;
    white-space: nowrap;
}

.partida-calendar-icon {
    font-size: 15px;
}

.partida-selected-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 999px;
    padding: 4px 8px;
    margin: 2px 4px 2px 0;
    font-size: 13px;
}

.partida-selected-pill img {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    object-fit: cover;
}

@media (max-width: 768px) {
    .partida-custom-option {
        grid-template-columns: 28px 34px 1fr 34px auto;
    }

    .partida-team-name {
        display: none;
    }

    .partida-title {
        font-size: 13px;
    }

    .partida-date {
        font-size: 12px;
    }
}


/* V12 - Selects customizados */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-button {
    width: 100%;
    min-height: 48px;
    border: 1px solid #ced4da;
    background: #fff;
    border-radius: .375rem;
    padding: 7px 42px 7px 10px;
    text-align: left;
    position: relative;
}

.custom-select-button:focus {
    outline: 0;
    border-color: #86b7fe;
    box-shadow: 0 0 0 .25rem rgba(13,110,253,.25);
}

.custom-select-arrow {
    position: absolute;
    right: 14px;
    top: 12px;
    font-size: 16px;
}

.custom-select-dropdown {
    position: absolute;
    z-index: 999999;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: .375rem;
    box-shadow: 0 10px 30px rgba(0,0,0,.12);
    max-height: 390px;
    overflow: hidden;
}

.custom-select-lista {
    max-height: 320px;
    overflow-y: auto;
}

.custom-option {
    width: 100%;
    border: 0;
    background: #fff;
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #f1f1f1;
    text-align: left;
}

.custom-option:hover {
    background: #f8f9fa;
}

.custom-option.selected {
    background: #fff8e1;
}

.custom-check {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #198754;
    background: #fff;
}

.custom-main-text {
    font-weight: 600;
}

.custom-img {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #dee2e6;
}

.custom-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #dee2e6;
}

.match-row {
    display: grid;
    width: 100%;
    grid-template-columns: 34px minmax(70px, 120px) 1fr 34px minmax(70px, 120px) auto;
    gap: 8px;
    align-items: center;
}

.team-name {
    font-size: 13px;
    color: #495057;
}

.match-title {
    font-size: 14px;
    color: #212529;
}

.date-info {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    color: #495057;
    font-size: 13px;
    white-space: nowrap;
}

.calendar-icon {
    font-size: 15px;
}

.player-row {
    display: flex;
    align-items: center;
    gap: 9px;
}

.player-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.player-text small {
    color: #6c757d;
    margin-top: 2px;
}

.platform-row {
    display: flex;
    align-items: center;
    gap: 9px;
}

.platform-logo {
    width: 42px;
    height: 28px;
    border-radius: 7px;
    object-fit: cover;
    border: 1px solid #dee2e6;
}

.custom-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    font-weight: 700;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    color: #343a40;
}

.custom-empty {
    padding: 12px;
    color: #6c757d;
}

.custom-selected-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 999px;
    padding: 4px 8px;
    margin: 2px 4px 2px 0;
    font-size: 13px;
}

.custom-selected-pill img {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    object-fit: cover;
}

@media (max-width: 768px) {
    .match-row {
        grid-template-columns: 34px 1fr 34px auto;
    }

    .team-name {
        display: none;
    }

    .match-title {
        font-size: 13px;
    }

    .date-info {
        font-size: 12px;
    }
}


/* V13 - X para remover itens selecionados */
.custom-pill-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 4px;
    border-radius: 50%;
    background: #dc3545;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}

.custom-pill-remove:hover {
    background: #bb2d3b;
}

.custom-selected-pill {
    padding-right: 5px;
}


/* V14 - Local/fase/grupo nas partidas e status das plataformas */
.match-extra {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 4px;
    color: #6c757d;
    font-size: 12px;
}

.custom-selected-pill-match {
    align-items: flex-start;
    border-radius: 14px;
    flex-wrap: wrap;
}

.selected-meta {
    display: inline-flex;
    color: #6c757d;
    font-size: 12px;
    margin-left: 2px;
}

.platform-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.platform-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.platform-badges-inline {
    display: inline-flex;
    margin-left: 4px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    border-radius: 999px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
}

.status-badge.ok {
    background: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.status-badge.no {
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}


/* V16 - Mercados customizados */
.market-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px;
    align-items: start;
    width: 100%;
}

.market-category,
.market-mini-category {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    border-radius: 999px;
    padding: 3px 8px;
    background: #e7f1ff;
    color: #084298;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid #b6d4fe;
}

.market-mini-category {
    margin-right: 2px;
}

.market-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.market-text small {
    color: #6c757d;
    margin-top: 2px;
}

.market-description {
    font-style: italic;
}

.probabilidade-item[data-origem="manual"] {
    border-left: 4px solid #198754;
}

.probabilidade-item[data-origem="lista"] {
    border-left: 4px solid #0d6efd;
}

@media (max-width: 768px) {
    .market-row {
        grid-template-columns: 1fr;
    }
}


/* V16 - Linhas geradas conforme partida/jogador */
.probabilidade-item[data-idjogador]:not([data-idjogador=""]) {
    border-left-color: #6f42c1;
}

.market-text small:first-of-type {
    font-weight: 600;
    color: #495057;
}


/* V17 - Login */
.login-page {
    background:
        radial-gradient(circle at top left, rgba(13, 110, 253, .15), transparent 30%),
        radial-gradient(circle at bottom right, rgba(25, 135, 84, .18), transparent 30%),
        #f8f9fa;
}


/* V20 - Bloqueio de mercado de jogador sem jogador selecionado */
.custom-option.disabled,
.custom-option:disabled {
    opacity: .55;
    cursor: not-allowed;
    background: #f8f9fa;
}

.custom-option.disabled:hover,
.custom-option:disabled:hover {
    background: #f8f9fa;
}

.market-blocked {
    color: #dc3545 !important;
    font-weight: 700;
}


/* V21 - Listagem e edição de bilhetes */
.bilhetes-actions {
    gap: .5rem;
}

.bilhete-thumb {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid #dee2e6;
    background: #fff;
}

.table td,
.table th {
    vertical-align: middle;
}


/* V22 - Logs e reversão */
.log-json {
    background: #111827;
    color: #e5e7eb;
    border-radius: 10px;
    padding: 15px;
    font-size: 12px;
    min-height: 300px;
}

#tabelaLogs td {
    vertical-align: top;
}


/* V24 - Gestão de usuários */
#tabelaUsuarios td,
#tabelaUsuarios th {
    vertical-align: middle;
}
