@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
    --bg: #0f1419;
    --bg-elev: #171d25;
    --bg-soft: #1e2630;
    --line: #2a3441;
    --text: #e8eef5;
    --muted: #8b9aab;
    --accent: #d4a017;
    --accent-2: #2bb8a8;
    --danger: #e05757;
    --ok: #3cba7a;
    --warn: #e0a24a;
    --radius: 10px;
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    --font: 'IBM Plex Sans', sans-serif;
    --mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: var(--font);
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(212, 160, 23, 0.12), transparent 55%),
        radial-gradient(900px 500px at 100% 0%, rgba(43, 184, 168, 0.10), transparent 50%),
        var(--bg);
    color: var(--text);
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: linear-gradient(180deg, #141a22 0%, #10151b 100%);
    border-right: 1px solid var(--line);
    padding: 1.4rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    font-weight: 700;
    letter-spacing: 0.02em;
    font-size: 1.15rem;
    margin-bottom: 0.25rem;
}

.brand span { color: var(--accent); }

.brand-sub {
    color: var(--muted);
    font-size: 0.78rem;
    margin-bottom: 1.5rem;
}

.nav a {
    display: block;
    padding: 0.65rem 0.8rem;
    border-radius: 8px;
    color: var(--text);
    margin-bottom: 0.25rem;
    text-decoration: none;
    font-weight: 500;
}

.nav a:hover,
.nav a.active {
    background: var(--bg-soft);
    text-decoration: none;
}

.nav a.active {
    border-left: 3px solid var(--accent);
    padding-left: calc(0.8rem - 3px);
}

.main {
    padding: 1.5rem 1.75rem 2.5rem;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

h1 {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 700;
}

.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

.grid-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
    margin-bottom: 1.25rem;
}

.stat {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    box-shadow: var(--shadow);
}

.stat .label {
    color: var(--muted);
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
}

.stat .value {
    font-size: 1.55rem;
    font-weight: 700;
    font-family: var(--mono);
}

.panel {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.panel-h {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
}

.panel-h h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.panel-b { padding: 1rem 1.1rem; }

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

table.data th,
table.data td {
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

table.data th {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

table.data tr:hover td { background: rgba(255, 255, 255, 0.02); }

tr.hot td {
    background: rgba(212, 160, 23, 0.08);
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--mono);
}

.badge-ok { background: rgba(60, 186, 122, 0.15); color: var(--ok); }
.badge-err { background: rgba(224, 87, 87, 0.15); color: var(--danger); }
.badge-warn { background: rgba(224, 162, 74, 0.15); color: var(--warn); }
.badge-muted { background: rgba(139, 154, 171, 0.15); color: var(--muted); }
.badge-hot { background: rgba(212, 160, 23, 0.18); color: var(--accent); }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid var(--line);
    background: var(--bg-soft);
    color: var(--text);
    border-radius: 8px;
    padding: 0.5rem 0.85rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover { filter: brightness(1.08); text-decoration: none; }

.btn-primary {
    background: linear-gradient(180deg, #e0b12a, #c49210);
    border-color: #b8870c;
    color: #1a1405;
}

.btn-accent {
    background: rgba(43, 184, 168, 0.18);
    border-color: rgba(43, 184, 168, 0.4);
    color: #7fe0d4;
}

.btn-danger {
    background: rgba(224, 87, 87, 0.15);
    border-color: rgba(224, 87, 87, 0.35);
    color: #ff9b9b;
}

.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.82rem; }

.flash {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid;
}

.flash-ok {
    background: rgba(60, 186, 122, 0.12);
    border-color: rgba(60, 186, 122, 0.35);
    color: #9be4bc;
}

.flash-error {
    background: rgba(224, 87, 87, 0.12);
    border-color: rgba(224, 87, 87, 0.35);
    color: #ffb0b0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.form-grid .full { grid-column: 1 / -1; }

label {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 0.35rem;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    font: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: 2px solid rgba(43, 184, 168, 0.35);
    border-color: var(--accent-2);
}

.check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    margin-top: 1.55rem;
}

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.login-card {
    width: min(420px, 100%);
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.login-card h1 {
    margin-bottom: 0.35rem;
}

.login-card .field { margin-bottom: 1rem; }

.password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrap input {
    padding-right: 2.75rem;
}

.password-toggle {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 6px;
    display: grid;
    place-items: center;
    padding: 0;
}

.password-toggle:hover,
.password-toggle.is-on {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.04);
}

.eye-icon {
    font-size: 1.05rem;
    line-height: 1;
    filter: grayscale(0.2);
}

.remember-row {
    margin-top: 0.25rem;
    user-select: none;
}

.fold > .fold-summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.fold > .fold-summary::-webkit-details-marker {
    display: none;
}

.fold > .fold-summary::marker {
    content: '';
}

.fold-meta {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.88rem;
}

.fold-chevron {
    width: 0.55rem;
    height: 0.55rem;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
    flex-shrink: 0;
    margin-left: 0.35rem;
}

.fold[open] > .fold-summary {
    border-bottom: 1px solid var(--line);
}

.fold[open] .fold-chevron {
    transform: rotate(45deg);
    margin-top: -0.2rem;
}

.fold-sep {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 1.1rem 0;
}

.book-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem 0.65rem;
    border-bottom: 1px solid var(--line);
}

.book-key {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.28rem 0.7rem 0.28rem 0.35rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
    line-height: 1.2;
}

.book-key .book-badge {
    gap: 0.45rem;
}

.book-key .book-badge-name {
    max-width: none;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
}

.book-key--best {
    margin-left: 0.15rem;
    border-color: rgba(212, 160, 23, 0.35);
    background: rgba(212, 160, 23, 0.08);
}

.book-key-star {
    background: rgba(212, 160, 23, 0.25) !important;
    color: var(--accent) !important;
    font-size: 0.72rem;
}

.book-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    vertical-align: middle;
}

.book-badge--compact {
    gap: 0;
}

.book-badge-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 6px;
    background: var(--book-color, #5b6b7c);
    color: #fff;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.book-badge-logo {
    width: 1.45rem;
    height: 1.45rem;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
    background: #fff;
}

.book-badge-name {
    font-size: 0.78rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 7rem;
}

.flash-warn {
    background: rgba(224, 162, 74, 0.12);
    border: 1px solid rgba(224, 162, 74, 0.35);
    color: var(--warn);
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.table-wrap {
    padding: 0;
    overflow-x: auto;
}

table.data.om-table {
    font-size: 0.84rem;
    table-layout: fixed;
    width: 100%;
}

table.data.om-table th,
table.data.om-table td {
    padding: 0.55rem 0.5rem;
}

table.data.om-table .col-match { width: 22%; }
table.data.om-table .col-sport {
    width: 3.6rem;
    max-width: 4.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.78rem;
}
table.data.om-table .col-meta { width: 9%; }
table.data.om-table .col-market { width: 13%; }
table.data.om-table .col-sel { width: 15%; }
table.data.om-table .col-odds {
    width: 4.5rem;
    text-align: center;
}
table.data.om-table .col-diff {
    width: 4.2rem;
    text-align: center;
}
table.data.om-table .col-best {
    width: 2.6rem;
    text-align: center;
}

table.data.om-table th.col-odds,
table.data.om-table td.col-odds,
table.data.om-table th.col-best,
table.data.om-table td.col-best {
    text-align: center;
}

table.data td.is-best {
    background: rgba(60, 186, 122, 0.12);
    font-weight: 700;
}

.om-hint {
    font-size: 0.72rem;
    margin-top: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.om-match {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.om-sub {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.om-cell-main {
    position: relative;
}

.om-row-toggle {
    display: none;
}

.om-mobile-summary {
    display: none;
}

.om-detail {
    display: none;
}

.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1.1rem;
    border-top: 1px solid var(--line);
}

.pager-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.pager-size {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pager-size select {
    width: auto;
    min-width: 4.5rem;
    padding: 0.35rem 0.5rem;
}

.btn.is-disabled,
.btn.is-disabled:hover {
    opacity: 0.4;
    pointer-events: none;
}

.om-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.om-detail-grid > div {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.om-detail-odd {
    flex-direction: row !important;
    align-items: center;
    gap: 0.45rem !important;
}

.score-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--text);
    font-family: var(--mono);
    font-weight: 600;
    text-decoration: none;
}

.chip:hover {
    border-color: var(--accent);
    text-decoration: none;
}

.chip-active {
    background: rgba(212, 160, 23, 0.18);
    border-color: var(--accent);
    color: var(--accent);
}

.setup-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1rem;
}

.setup-nav a {
    display: block;
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    color: var(--text);
    margin-bottom: 0.2rem;
}

.setup-nav a.active,
.setup-nav a:hover {
    background: var(--bg-soft);
    text-decoration: none;
}

.setup-steps {
    counter-reset: step;
    list-style: none;
    padding: 0;
    margin: 0;
}

.setup-steps li {
    position: relative;
    padding: 0.85rem 0.85rem 0.85rem 3rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 0.65rem;
    background: var(--bg);
}

.setup-steps li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0.75rem;
    top: 0.85rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: rgba(212, 160, 23, 0.2);
    color: var(--accent);
    display: grid;
    place-items: center;
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 600;
}

.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

.nav-toggle {
    display: none;
    border: 1px solid var(--line);
    background: var(--bg-soft);
    color: var(--text);
    border-radius: 8px;
    padding: 0.45rem 0.7rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

@media (max-width: 1200px) {
    .om-hide-md { display: none !important; }
    table.data.om-table .col-match { width: 28%; }
    table.data.om-table .col-sel { width: 20%; }
}

@media (max-width: 1100px) {
    .grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid { grid-template-columns: 1fr; }
    .setup-layout { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .om-hide-sm { display: none !important; }

    .shell { grid-template-columns: 1fr; }
    .sidebar {
        position: relative;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        padding: 0.9rem 1rem;
    }
    .sidebar .brand-sub { display: none; }
    .nav-toggle { display: inline-flex; margin-bottom: 0.65rem; }
    .sidebar:not(.is-open) .nav,
    .sidebar:not(.is-open) .sidebar-foot { display: none; }
    .nav {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    .nav a {
        margin: 0;
        padding: 0.45rem 0.65rem;
        font-size: 0.88rem;
    }
    .main { padding: 1rem; }

    /* Cards estilo Taskforce */
    .table-wrap { overflow: visible; }

    table.data.om-cards {
        display: block;
        table-layout: auto;
        font-size: 0.9rem;
    }

    table.data.om-cards thead { display: none; }

    table.data.om-cards tbody { display: block; width: 100%; }

    table.data.om-cards tbody tr.om-row {
        display: block;
        width: 100%;
        margin: 0 0 0.65rem;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: var(--bg);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }

    table.data.om-cards tbody tr.om-row.hot {
        border-color: rgba(212, 160, 23, 0.45);
        background: rgba(212, 160, 23, 0.06);
    }

    table.data.om-cards tbody tr.om-row > td {
        display: none;
        border: 0;
        width: 100% !important;
        padding: 0.7rem 0.8rem;
    }

    table.data.om-cards tbody tr.om-row > td.om-cell-main {
        display: block;
    }

    table.data.om-cards .om-hide-mobile { display: none !important; }

    .om-cell-main {
        display: flex !important;
        align-items: flex-start;
        gap: 0.55rem;
    }

    .om-row-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 1.8rem;
        height: 1.8rem;
        flex-shrink: 0;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--bg-soft);
        color: var(--text);
        cursor: pointer;
        margin-top: 0.1rem;
    }

    .om-row-toggle::before {
        content: '';
        width: 0.45rem;
        height: 0.45rem;
        border-right: 2px solid var(--muted);
        border-bottom: 2px solid var(--muted);
        transform: rotate(-45deg);
        margin-left: -0.1rem;
        transition: transform 0.15s ease;
    }

    tr.om-row.is-open .om-row-toggle::before {
        transform: rotate(45deg);
        margin-top: -0.15rem;
    }

    .om-main-body { min-width: 0; flex: 1; }

    .om-mobile-summary {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.45rem;
        margin-top: 0.45rem;
    }

    .om-match { white-space: normal; }

    table.data.om-cards tbody tr.om-detail {
        display: none;
        width: 100%;
        margin: -0.45rem 0 0.75rem;
        border: 1px solid var(--line);
        border-top: 0;
        border-radius: 0 0 var(--radius) var(--radius);
        background: var(--bg-elev);
    }

    table.data.om-cards tbody tr.om-row.is-open + tr.om-detail {
        display: block;
    }

    table.data.om-cards tbody tr.om-row.is-open {
        margin-bottom: 0;
        border-radius: var(--radius) var(--radius) 0 0;
    }

    table.data.om-cards tbody tr.om-detail > td {
        display: block;
        border: 0;
        padding: 0.85rem;
    }

    .pager {
        flex-direction: column;
        align-items: stretch;
    }

    .pager-nav { justify-content: center; }
}

@media (max-width: 520px) {
    .grid-stats { grid-template-columns: 1fr; }
    .topbar { flex-direction: column; align-items: flex-start; }
}
