:root {
    --bg-dark: #000000;
    --panel-bg: #0d0d0d;
    --row-hover: #161616;
    --text-main: #f5f5f5;
    --text-muted: #888;
    --btn-bg: #161a1d;
    --btn-hover: #2a2a2a;
    --success: #03A695;
    --danger: #ff4444;
    --border: #222;
    --radius: 8px;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--bg-dark);
    color: var(--text-main);
    margin: 0;
    padding: 30px 20px 80px;
    overflow-x: hidden;
}

.main-wrapper {
    max-width: 1550px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 25px;
}

h1 {
    color: var(--text-main);
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

header p {
    color: var(--text-muted);
    font-size: .95rem;
    margin: 0;
}

.dashboard {
    background: var(--panel-bg);
    padding: 25px;
    border-radius: var(--radius);
    margin-bottom: 30px;
    border: 1px solid var(--border);
}

.filter-row-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.filter-item {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.filter-item label {
    font-size: .65rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    white-space: nowrap;
}

.filter-item input[type="number"],
.filter-item select {
    background: #161a1d;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 12px;
    border-radius: 6px;
    outline: none;
    font-family: 'Montserrat', sans-serif;
    font-size: .65rem;
    transition: border-color .2s;
    width: 100%;
    box-sizing: border-box;
}

.filter-item input:focus,
.filter-item select:focus {
    border-color: #555;
}

.filter-grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.dashboard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 15px;
}

.toggles-container {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    margin: 0 !important;
    background: #161a1d;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid var(--border);
    transition: border-color .2s;
}

.toggle-label:hover {
    border-color: #444;
}

.toggle-label input {
    cursor: pointer;
    width: 14px;
    height: 14px;
    margin: 0;
}

.save-controls {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.btn {
    background: var(--btn-bg);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    font-size: .85rem;
    font-family: 'Montserrat', sans-serif;
    transition: all .2s;
    text-transform: uppercase;
    letter-spacing: .5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
}

.btn:hover {
    background: var(--btn-hover);
    border-color: #555;
}

.btn-save {
    color: var(--success);
    border-color: var(--success);
    background: #0c1614;
}

.btn-save:hover {
    background: #152925;
    border-color: #04d9c4;
}

.btn-delete {
    color: var(--danger);
    border-color: var(--danger);
    background: #1a0808;
    padding: 10px 15px;
}

.btn-delete:hover {
    background: #2a0b0b;
    border-color: #f66;
}

.search-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #000;
    border-radius: 22px 22px 0 0;
    padding: 14px 16px;
    z-index: 10000;
    box-shadow: 0 -5px 25px rgba(3, 166, 149, .35), 0 -2px 10px rgba(3, 166, 149, .25);
    overflow: visible;
}

#match-search {
    width: 100%;
    padding: 14px 20px;
    border-radius: var(--radius);
    background: #000;
    border: 1px solid #000;
    color: var(--text-main);
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color .2s;
}

#match-search:focus {
    border-color: #555;
    outline: none;
}

.search-results {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
    z-index: 10001;
    max-height: 350px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, .9);
}

.search-item {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background .2s;
}

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

.search-item:hover {
    background: var(--row-hover);
}

.search-team {
    font-weight: 600;
    color: var(--text-main);
}

.search-league {
    font-size: .65rem;
    color: var(--text-muted);
    font-weight: 500;
}

#status {
    text-align: center;
    margin-bottom: 20px;
    font-weight: 600;
    color: var(--text-muted);
    font-size: .9rem;
}

.results-container {
    overflow-x: auto;
    padding-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--panel-bg);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

th,
td {
    padding: 14px 15px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    font-size: .85rem;
}

th {
    background: #050505;
    color: var(--text-muted);
    font-size: .7rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: .5px;
    cursor: pointer;
    transition: color .2s;
    user-select: none;
}

th:hover {
    color: var(--text-main);
}

.sort-icon {
    font-size: .6rem;
    margin-left: 4px;
    color: var(--success);
}

.main-row {
    cursor: pointer;
    transition: background .2s;
}

.main-row:hover {
    background: var(--row-hover);
}

.team-col {
    text-align: left;
    font-weight: 600;
    font-size: .75rem;
    white-space: nowrap;
}

.league-info {
    font-size: .7rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 4px;
}

.market-tag {
    background: #161a1d;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #333;
    font-weight: 700;
    font-size: .8rem;
    white-space: nowrap;
    display: inline-block;
    min-width: 90px;
    text-align: center;
    box-sizing: border-box;
}

.high-prob {
    color: var(--success);
    font-weight: 700;
    font-size: .95rem;
}

.low-prob {
    color: var(--danger);
    font-weight: 600;
    font-size: .95rem;
}

.value-odd {
    background: #161a1d;
    border-radius: 6px;
    padding: 6px 10px;
    font-weight: 700;
    border: 1px solid var(--border);
    font-size: .85rem;
    display: inline-block;
    min-width: 56px;
    text-align: center;
    box-sizing: border-box;
}

.fav-btn {
    background: none;
    border: none;
    color: #555;
    font-size: 1.4rem;
    cursor: pointer;
    transition: color .2s, transform .2s;
    line-height: 1;
    padding: 0;
}

.fav-btn:hover {
    color: #f1c40f;
    transform: scale(1.1);
}

.fav-btn.active {
    color: #f1c40f;
    text-shadow: 0 0 8px rgba(241, 196, 15, .6);
}

/* ── Shared icon-button style (desktop table Actions + mobile cards) ── */
.mc-icon-btn {
    background: #2a2a2a;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    color: #aaa;
    padding: 0;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .2s, color .2s;
    text-decoration: none;
    vertical-align: middle;
}

.mc-icon-btn:hover { background: #333; color: #fff; }

.mc-fav {
    background: #2a2a2a;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    color: #555;
    padding: 0;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .2s, color .2s;
}

.mc-fav:hover { background: #333; color: #f1c40f; }
.mc-fav.active { color: #f1c40f; background: #2a2a2a; text-shadow: 0 0 6px rgba(241,196,15,.5); }

.link-btn {
    color: var(--text-muted);
    text-decoration: none;
    font-size: .75rem;
    font-weight: 700;
    border: 1px solid var(--border);
    background: #161a1d;
    padding: 6px 12px;
    border-radius: 4px;
    display: inline-block;
    transition: all .2s;
    text-transform: uppercase;
}

.link-btn:hover {
    background: var(--text-main);
    color: var(--bg-dark);
    border-color: var(--text-main);
}

.team-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    border-radius: 3px;
}

.team-logo-lg {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 4px;
}

.teams-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.team-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.panel-teams-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    line-height: 1.3;
}

.panel-vs-sep {
    color: var(--text-muted);
    font-size: .72rem;
    font-weight: 500;
}

.ev-positive {
    color: var(--success);
    font-weight: 700;
}

.ev-negative {
    color: var(--danger);
    font-weight: 700;
}

.ev-cell {
    font-size: .9rem;
    letter-spacing: .5px;
}

.stat-card {
    background: #161a1d;
    border-radius: 14px;
    cursor: pointer;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: box-shadow 0.25s;
}

.stat-card:hover {
    box-shadow: 7px 7px 16px #0a0c0e, -7px -7px 16px #222729, 0 0 0 1px #03A69588;
}

.stat-card.selected {
    box-shadow: inset 4px 4px 10px #0a0c0e, inset -4px -4px 10px #222729;
}

.stat-name {
    font-size: .75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #ffffff;
    opacity: 0.7;
    font-weight: 600;
    background: #161a1d;
    box-shadow: inset 2px 2px 5px #0a0c0e, inset -2px -2px 5px #222729;
    border-radius: 8px;
    padding: 4px 10px;
    width: 100%;
    text-align: center;
}

.stat-val {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    background: #161a1d;
    box-shadow: inset 3px 3px 7px #0a0c0e, inset -3px -3px 7px #222729;
    border-radius: 10px;
    padding: 6px 16px;
    width: 100%;
    text-align: center;
}

.stat-odd {
    font-size: .7rem;
    color: #03A695;
    letter-spacing: 1px;
    background: #161a1d;
    box-shadow: inset 2px 2px 5px #0a0c0e, inset -2px -2px 5px #222729;
    border-radius: 8px;
    padding: 4px 10px;
    width: 100%;
    text-align: center;
}

.stat-card>div[style*="font-size:.65rem"] {
    background: #161a1d;
    box-shadow: inset 2px 2px 4px #0a0c0e, inset -2px -2px 4px #222729;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: .65rem;
    color: #555;
    width: 100%;
    text-align: center;
    margin-bottom: 2px;
}

.add-bet-btn {
    background: #161a1d;
    box-shadow: 3px 3px 7px #0a0c0e, -3px -3px 7px #222729;
    border: none;
    border-radius: 10px;
    color: #03A695;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: 2px;
    width: 100%;
    padding: 8px 0;
    cursor: pointer;
    transition: box-shadow 0.2s, color 0.2s;
    margin-top: 4px;
}

.add-bet-btn:hover {
    box-shadow: inset 2px 2px 5px #0a0c0e, inset -2px -2px 5px #222729;
    color: #ffffff;
}








.multi-select-wrapper {
    position: relative;
}

.multi-select-btn {
    background: #161a1d;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 12px;
    border-radius: 6px;
    width: 100%;
    text-align: left;
    font-family: 'Montserrat', sans-serif;
    font-size: .65rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .2s;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.multi-select-btn:hover {
    border-color: #555;
}

.multi-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 280px;
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    z-index: 100;
    max-height: 350px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 15px 30px rgba(0, 0, 0, .8);
}

.multi-select-dropdown.active {
    display: block;
}

.multi-select-item {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background .2s;
}

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

.multi-select-item:hover {
    background: var(--row-hover);
}

.multi-select-item input {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--success);
}

.multi-select-item label {
    flex: 1;
    cursor: pointer;
    margin: 0;
    font-size: .9rem;
    font-weight: 500;
}

.add-bet-btn {
    background: #1a3a2e;
    border: 1px solid var(--success);
    color: var(--success);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: .7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-left: 6px;
}

.add-bet-btn:hover {
    background: #0c1614;
    border-color: #04d9c4;
}

.floating-bet-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--success);
    color: #000;
    border: none;
    padding: 14px 24px;
    border-radius: 50px;
    font-size: .95rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 5px 25px rgba(3, 166, 149, .4);
    z-index: 990;
    display: none;
    align-items: center;
    gap: 10px;
    transition: transform .2s, background .2s;
}

.floating-bet-btn:hover {
    transform: scale(1.05);
    background: #04d9c4;
}

.floating-bet-btn .badge {
    background: #000;
    color: var(--success);
    border-radius: 50%;
    padding: 2px 8px;
    font-size: .85rem;
}

.bet-slip-container {
    position: fixed;
    top: 0;
    right: -450px;
    width: 400px;
    height: 100vh;
    background: var(--bg-dark);
    border-left: 1px solid var(--border);
    box-shadow: -10px 0 40px rgba(0, 0, 0, .9);
    display: flex;
    flex-direction: column;
    z-index: 1222000;
    transition: right .3s ease-in-out;
}

.bet-slip-container.active {
    right: 0;
}

.bet-slip-header {
    padding: 25px;
    background: var(--panel-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bet-slip-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.bet-slip-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
}

.bet-slip-close:hover {
    color: var(--text-main);
}

.bet-slip-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.bet-slip-item {
    position: relative;
    background: #0f0f0f;
    border: 1px solid #272727;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
    color: #fff;
    transition: background .2s, border .2s;
}

.bet-slip-item:hover {
    background: #181818;
    border-color: #3a3a3a;
}

.bet-slip-remove {
    position: absolute;
    top: 8px;
    right: 10px;
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 50%;
    transition: background .2s, color .2s;
}

.bet-slip-remove:hover {
    background: #272727;
    color: #fff;
}

.bet-slip-item>span {
    display: block;
    font-size: 11px;
    color: #5e5e5e;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.bet-slip-match {
    font-size: 16px;
    padding: 8px 20px 8px 0;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
}

.bet-slip-odds {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1f1f1f;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #2a2a2a;
}

.bet-slip-market {
    font-size: 13px;
    color: #ccc;
}

.bet-slip-odds-val {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.bet-slip-footer {
    padding: 25px;
    background: #050505;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.bet-slip-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    font-size: .8rem;
}

.bet-slip-stat {
    background: #161a1d;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    text-align: center;
}

.bet-slip-stat-label {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: .7rem;
    letter-spacing: .5px;
}

.bet-slip-stat-value {
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.2rem;
    margin-top: 6px;
}

.bet-slip-stake-row {
    display: flex;
    gap: 15px;
    align-items: stretch;
}

.bet-slip-stake-row input {
    flex: 1;
    background: #161a1d;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 10px 15px;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    outline: none;
}

.bet-slip-clear-btn {
    background: #1a0808;
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 12px;
    border-radius: 6px;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    transition: all .2s;
    width: 100%;
    font-family: 'Montserrat', sans-serif;
}

.bet-slip-clear-btn:hover {
    background: #2a0b0b;
    border-color: #f66;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, .8);
    z-index: 998;
    display: none;
    opacity: 0;
    transition: opacity .3s;
}

.overlay.active {
    display: block;
    opacity: 1;
}

.side-panel {
    position: fixed;
    top: 0;
    right: -550px;
    width: 500px;
    height: 100vh;
    background: var(--bg-dark);
    z-index: 99999;
    box-shadow: -5px 0 25px rgba(0, 0, 0, .9);
    transition: right .3s ease-in-out;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border);
}

.side-panel.open {
    right: 0;
}

.panel-header {
    padding: 25px;
    background: var(--panel-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: column-reverse;
}

.panel-title-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
    justify-content: center;
    padding: 14px;
}

.panel-title {
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.panel-url {
    font-size: .75rem;
    color: var(--success);
    text-decoration: none;
    display: inline-block;
    margin-top: 6px;
    font-weight: 600;
    transition: color .2s;
}

.panel-url:hover {
    color: #fff;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    margin-left: 10px;
}

.close-btn:hover {
    color: var(--text-main);
}

.panel-controls {
    padding: 15px 25px;
    background: #080808;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.panel-controls select,
.panel-controls input {
    background: #161a1d;
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 8px 10px;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: .8rem;
    font-weight: 600;
    outline: none;
}

.panel-controls-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
    width: 100%;
}

.panel-save-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    margin-top: 6px;
}

.panel-controls .input-group {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-controls input[type="number"] {
    width: 100%;
}

.h2h-stat-box {
    background: #0c1614;
    border: 1px solid var(--success);
    border-radius: 6px;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 14px 0;
}

.h2h-stat-box span {
    font-size: .8rem;
    font-weight: 700;
    color: var(--success);
}

.h2h-stat-box div {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
}

.panel-tabs {
    display: flex;
    gap: 10px;
    padding: 15px 25px;
    background: var(--panel-bg);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    background: #161a1d;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 10px;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: .65rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
    text-align: center;
}

.tab-btn.active {
    color: var(--success);
    border-color: var(--success);
    background: #0c1614;
}

.tab-btn:hover:not(.active) {
    color: var(--text-main);
    border-color: #555;
}

.panel-content {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.team-history-section {
    margin-bottom: 10px;
}

.team-name-header {
    font-size: .95rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    display: flex;
    justify-content: space-between;
}

.h2h-header {
    color: var(--success);
    border-color: var(--success);
}

.hist-match {
    background: var(--panel-bg);
    border: 1px solid var(--border);
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: .85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hist-info {
    flex: 1;
    font-weight: 500;
}

.hist-date {
    color: var(--text-muted);
    font-size: .7rem;
    margin-bottom: 4px;
    font-weight: 600;
}

.score-box {
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 1px;
    min-width: 50px;
    text-align: center;
    background: #161a1d;
}

.score-success {
    color: var(--success);
    border: 1px solid var(--success);
}

.score-fail {
    color: var(--danger);
    border: 1px solid var(--danger);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.stat-card {
    background: #161a1d;
    border: 1px solid var(--border);
    padding: 15px 12px;
    border-radius: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    transition: transform .1s, border-color .2s, box-shadow .2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: #555;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .5);
}

.stat-name {
    font-size: .75rem;
    color: var(--text-muted);
    font-weight: 700;
    line-height: 1.3;
}

.stat-val {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-odd {
    font-size: .8rem;
    color: var(--text-main);
    font-weight: 700;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 6px;
    margin-top: 4px;
}

@media(max-width:900px) {
    .filter-row-container {
        grid-template-columns: 1fr 1fr;
    }
}

.filter-toggle-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    background: #161a1d;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: .65rem;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    transition: all .2s;
    white-space: nowrap;
    margin-bottom: 14px;
}

.filter-toggle-btn.open {
    border-color: var(--success);
    color: var(--success);
    background: #0c1614;
}

.filter-body {
    overflow: hidden;
    transition: max-height .35s ease, opacity .25s ease;
    max-height: 2000px;
    opacity: 1;
}

.filter-body.collapsed {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

.panel-filter-toggle-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: .68rem;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    transition: all .2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.panel-filter-toggle-btn.open {
    border-color: var(--success);
    color: var(--success);
}

.panel-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0 8px;
}

.panel-filter-header-label {
    font-size: .62rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.panel-controls-body {
    overflow: hidden;
    transition: max-height .35s ease, opacity .25s ease;
    max-height: 600px;
    opacity: 1;
}

.panel-controls-body.collapsed {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

.panel-teams-row {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    overflow: hidden;
    min-width: 0;
}

.panel-teams-row .ptn {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    font-size: clamp(.68rem, 2vw, 1rem);
    font-weight: 700;
}

.mobile-sort-bar {
    display: none;
}

#mobile-card-list {
    display: none;
}

@media(max-width:768px) {
    body {
        padding: 12px 10px 82px;
    }

    .floating-bet-btn {
        bottom: 78px;
        right: 12px;
        padding: 11px 18px;
        font-size: .85rem;
    }

    .filter-row-container {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 12px;
    }

    .dashboard {
        padding: 12px;
    }

    .dashboard-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .toggles-container {
        flex-wrap: wrap;
        gap: 6px;
    }

    .toggle-label {
        font-size: .7rem;
        padding: 7px 10px;
    }

    .save-controls {
        width: 100%;
    }

    #results-table {
        display: none !important;
    }

    #mobile-card-list {
        display: block !important;
    }

    .mobile-sort-bar {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 0 10px;
        flex-wrap: wrap;
    }

    .msb-label {
        font-size: .7rem;
        font-weight: 700;
        color: var(--text-muted);
        text-transform: uppercase;
    }

    .mobile-sort-bar select {
        background: #161a1d;
        color: var(--text-main);
        border: 1px solid var(--border);
        border-radius: 6px;
        padding: 6px 10px;
        font-family: 'Montserrat', sans-serif;
        font-size: .75rem;
        font-weight: 600;
        outline: none;
    }

    .msb-dir-btn {
        background: #161a1d;
        border: 1px solid var(--border);
        color: var(--text-muted);
        padding: 6px 12px;
        border-radius: 6px;
        font-family: 'Montserrat', sans-serif;
        font-size: .72rem;
        font-weight: 700;
        cursor: pointer;
        transition: all .2s;
        white-space: nowrap;
    }

    .msb-dir-btn:hover {
        border-color: var(--success);
        color: var(--success);
    }

    :root {
        --teal: #03A695;
        --teal-dim: #03A69588;
        --teal-glow: #03A69544;
        --teal-dark: #02564f;
        --bg: #161a1d;
        --bg-dark: #0a0c0e;
        --bg-light: #222729;
    }

    * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
    }


    .mc {
        border-radius: 12px;
        background: #121212;
        overflow: hidden;
        cursor: pointer;
        margin: 7px;
        padding: 14px;
    }

    .mc-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 6px 10px;
        background: #121212;
        border-bottom: none;
        gap: 8px;
    }

    .mc-league {
        font-size: 11px;
        color: #B4B2A9;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
        flex: 1;
        max-width: calc(100% - 110px);
    }

    .mc-top-actions {
        display: flex;
        gap: 6px;
        flex-shrink: 0;
    }

    .mc-icon-btn {
        background: #2a2a2a;
        border: none;
        border-radius: 6px;
        font-size: 16px;
        cursor: pointer;
        color: #aaa;
        padding: 0;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        transition: background .2s, color .2s;
    }

    .mc-icon-btn:hover {
        background: #333;
        color: #fff;
    }

    .mc-fav {
        background: #2a2a2a;
        border: none;
        border-radius: 6px;
        font-size: 16px;
        cursor: pointer;
        color: #555;
        padding: 0;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        transition: background .2s, color .2s;
    }

    .mc-fav:hover {
        background: #333;
        color: #f1c40f;
    }

    .mc-fav.active {
        color: #f1c40f;
        background: #2a2a2a;
        text-shadow: 0 0 6px rgba(241, 196, 15, .5);
    }

    .mc-main {
        padding: 10px 12px 6px;
    }

    .mc-teams {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 22px;
    }

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

    .mc-team.home {
        flex-direction: row-reverse;
        justify-content: flex-start;
        gap: 6px;
    }

    .mc-team.away {
        flex-direction: row;
        justify-content: flex-start;
        gap: 6px;
    }

    .mc-tname {
        font-size: 13px;
        font-weight: 500;
        color: #fff;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
    }

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

    .mc-time-wrap {
        flex: 0 0 60px;
        text-align: center;
        flex-shrink: 0;
    }

    .mc-time-val {
        font-size: 12px;
        font-weight: 500;
        color: #888780;
        background: #1e1e1e;
        border-radius: 4px;
        padding: 3px 8px;
        display: inline-block;
        white-space: nowrap;
    }

    .mc-stats {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 6px 12px 10px;
        margin-top: 6px;
    }

    .mc-stat {
        flex: 1;
        text-align: center;
    }

    .mc-slabel {
        font-size: 11px;
        color: #555;
    }

    .mc-sval {
        font-size: 13px;
        font-weight: 500;
    }

    .mc-market-col {
        flex: 0 0 90px;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
    }

    .mc-mval {
        font-size: 11px;
        color: #555;
    }

    .mc-odds {
        font-size: 16px;
        font-weight: 500;
        color: #fff;
    }



    .side-panel {
        width: 100%;
        right: -100%;
        height: calc(100vh - 82px);
    }

    .panel-header {
        flex-shrink: 0;
        padding: 12px 14px;
    }

    .panel-controls {
        flex-shrink: 0;
        padding: 8px 14px;
        overflow: visible;
    }

    .panel-tabs {
        flex-shrink: 0;
        padding: 8px 14px;
        gap: 6px;
    }

    .panel-content {
        flex: 1;
        overflow-y: auto;
        padding: 12px 14px;
        min-height: 0;
    }

    .bet-slip-container {
        width: 100%;
        right: -100%;
    }
}