﻿:root {
    --bg: #eef2f7;
    --bg-strong: #dce4f0;
    --surface: #ffffff;
    --surface-soft: #f8fbff;
    --line: #d6dee9;
    --line-strong: #c1ccdb;
    --text: #0f172a;
    --muted: #5a667a;
    --brand: #0f766e;
    --brand-strong: #115e59;
    --brand-soft: #d8f4ef;
    --accent: #0f4c81;
    --danger: #b42318;
    --danger-soft: #fee4e2;
    --warning: #b54708;
    --warning-soft: #fef0c7;
    --ok: #027a48;
    --ok-soft: #dcfae6;
    --shadow: 0 18px 40px rgba(15, 23, 42, 0.1);
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: "Manrope", "Segoe UI", sans-serif;
    color: var(--text);
    background: radial-gradient(circle at 10% 0%, #f6fbff 0%, var(--bg) 55%, var(--bg-strong) 100%);
}

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

a:hover {
    text-decoration: underline;
}

.topbar {
    background: linear-gradient(135deg, #0f172a 0%, #14213d 55%, #0f4c81 100%);
    color: #fff;
    padding: 16px 28px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.topbar strong {
    font-size: 20px;
    letter-spacing: 0.2px;
}

.topbar nav {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.topbar a {
    color: rgba(255, 255, 255, 0.92);
    font-weight: 600;
}

.page {
    width: min(1320px, calc(100% - 34px));
    margin: 24px auto 48px;
}

.embedded-page {
    background: transparent;
}

.embedded-page .page {
    width: min(1240px, calc(100% - 20px));
    margin: 14px auto 22px;
}

.section {
    margin-bottom: 22px;
}

.panel,
.pick,
.stat,
table {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.panel {
    padding: 20px;
}

h1,
h2,
h3,
h4 {
    margin: 0 0 8px;
    line-height: 1.2;
}

p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

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

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

input,
select,
textarea,
button {
    width: 100%;
    min-height: 42px;
    border-radius: 10px;
    border: 1px solid var(--line-strong);
    padding: 9px 12px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
}

textarea {
    min-height: 92px;
}

input:focus,
select:focus,
textarea:focus,
button:focus {
    outline: 2px solid rgba(15, 118, 110, 0.26);
    outline-offset: 1px;
}

button,
.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: auto;
    min-height: 42px;
    border-radius: 10px;
    border: 1px solid var(--brand);
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    padding: 10px 16px;
    text-decoration: none;
}

button:hover,
.button:hover {
    background: var(--brand-strong);
    border-color: var(--brand-strong);
    text-decoration: none;
}

.button.secondary,
button.secondary {
    background: #e7edf6;
    color: #233246;
    border-color: #c7d4e6;
}

.button.secondary:hover,
button.secondary:hover {
    background: #d9e4f3;
    border-color: #b6c8e2;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 10px;
}

.checks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.checks label {
    display: flex;
    align-items: start;
    gap: 8px;
    font-weight: 600;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

.checks input[type="checkbox"] {
    width: 16px;
    min-height: 16px;
    margin-top: 2px;
}

.api-checks label small {
    display: block;
    margin-top: 4px;
    font-weight: 500;
    color: var(--muted);
}

.notice {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #b8d6ef;
    color: #0e4f82;
    background: #eaf5ff;
    margin-bottom: 12px;
}

.notice.error {
    background: var(--danger-soft);
    border-color: #f4b4ae;
    color: #8a1d15;
}

.notice.warning {
    background: var(--warning-soft);
    border-color: #f2d792;
    color: #8a4b00;
}

.notice.success {
    background: var(--ok-soft);
    border-color: #98e3bd;
    color: #0f5e3a;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin: 14px 0;
}

.stat {
    padding: 18px 14px;
    text-align: center;
}

.stat .number {
    display: block;
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.stat .number.success {
    color: var(--ok);
}

.stat .number.error {
    color: var(--danger);
}

.stat .label {
    font-size: 12px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--muted);
}

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

.pick {
    padding: 16px;
}

.meta {
    color: var(--muted);
    font-size: 13px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 12px;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid #d5deea;
    padding: 4px 9px;
    background: #f2f6fb;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
}

.badge.rank {
    min-width: 36px;
}

.rank-aplus,
.rank-a {
    background: var(--ok-soft);
    color: #0f5e3a;
    border-color: #9edeb9;
}

.rank-b {
    background: #fff7dc;
    color: #9a6400;
    border-color: #f2d380;
}

.rank-c {
    background: #ffe9e7;
    color: #a2261c;
    border-color: #efb6af;
}

.status-ok {
    background: var(--ok-soft);
    color: #0f5e3a;
    border-color: #9edeb9;
}

.status-erro,
.status-erro_http {
    background: #ffe9e7;
    color: #a2261c;
    border-color: #efb6af;
}

.status-sem_token,
.status-desativado,
.status-sem_testador {
    background: #fff7dc;
    color: #9a6400;
    border-color: #f2d380;
}

.odd-line {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.metric {
    border: 1px solid #d7e2f0;
    border-radius: 10px;
    background: #f8fbff;
    padding: 10px;
}

.metric span {
    display: block;
    font-size: 12px;
    color: var(--muted);
}

.metric strong {
    display: block;
    margin-top: 4px;
    font-size: 16px;
    overflow-wrap: anywhere;
}

table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
}

th,
td {
    padding: 10px;
    border-bottom: 1px solid #e6edf7;
    text-align: left;
    font-size: 13px;
    vertical-align: top;
}

th {
    background: #f4f8ff;
    color: #1f2b40;
    font-weight: 800;
}

tr:hover td {
    background: #f9fcff;
}

.api-shape {
    margin-top: 10px;
    background: #0f172a;
    color: #f8fafc;
    padding: 12px;
    border-radius: 12px;
    overflow-x: auto;
    font-size: 12px;
}

/* Shell */
.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 300px;
}

.panel-stage {
    padding: 18px;
}

.panel-header {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.panel-header h1 {
    margin: 0;
    font-size: 22px;
}

.panel-header p {
    font-size: 13px;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--brand-soft);
    color: #0b5d56;
    border: 1px solid #9fd9cf;
    border-radius: 999px;
    padding: 8px 11px;
    font-size: 13px;
    font-weight: 700;
}

.panel-viewport {
    background: #f4f8ff;
    border: 1px solid #ccdaec;
    border-radius: var(--radius);
    min-height: calc(100vh - 132px);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.panel-viewport iframe {
    width: 100%;
    height: calc(100vh - 132px);
    border: 0;
    background: transparent;
}

.panel-menu {
    background: linear-gradient(180deg, #0f172a 0%, #13243f 50%, #0f4c81 100%);
    color: #fff;
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 0;
    min-height: 100vh;
}

.panel-brand {
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.05);
}

.panel-brand strong {
    display: block;
    font-size: 20px;
}

.panel-brand span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.78);
}

.menu-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 11px;
    color: #e9f2ff;
    border: 1px solid transparent;
    font-weight: 700;
    text-decoration: none;
}

.menu-link:hover,
.menu-link.active {
    text-decoration: none;
    background: rgba(212, 239, 255, 0.17);
    border-color: rgba(173, 219, 255, 0.38);
}

.menu-link i {
    width: 20px;
    text-align: center;
}

.menu-footer {
    margin-top: auto;
    display: grid;
    gap: 10px;
}

.menu-footer a {
    color: #d2e6ff;
    font-size: 13px;
}

/* Login */
.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    background: linear-gradient(135deg, #0f172a 0%, #0f4c81 100%);
}

.auth-hero {
    color: #fff;
    padding: 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
}

.auth-hero h1 {
    font-size: 40px;
    margin: 0;
}

.auth-hero p {
    color: rgba(255, 255, 255, 0.86);
    max-width: 560px;
}

.auth-feature {
    display: grid;
    gap: 10px;
    margin-top: 6px;
}

.auth-feature span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.auth-panel {
    background: var(--surface);
    padding: 56px 44px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-card {
    width: min(430px, 100%);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 26px;
    box-shadow: var(--shadow);
    background: #fff;
}

.auth-card h2 {
    margin: 0 0 6px;
}

.auth-card p {
    margin: 0 0 18px;
}

.auth-card .field {
    margin-bottom: 12px;
}

.auth-card .actions {
    margin-top: 12px;
}

.auth-links {
    margin-top: 14px;
    font-size: 13px;
}

.bet-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(8, 21, 42, 0.58);
    backdrop-filter: blur(3px);
}

.bet-loading-overlay.is-visible {
    display: flex;
}

.bet-loading-card {
    width: min(430px, 92vw);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 18px;
    padding: 24px;
    text-align: center;
    color: #fff;
    background: rgba(12, 28, 54, 0.94);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.bet-loading-spinner {
    width: 46px;
    height: 46px;
    margin: 0 auto 14px;
    border: 4px solid rgba(255, 255, 255, 0.25);
    border-top-color: #2dd4bf;
    border-radius: 50%;
    animation: bet-spin 0.85s linear infinite;
}

@keyframes bet-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 1100px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .panel-menu {
        position: static;
        min-height: auto;
    }

    .panel-viewport,
    .panel-viewport iframe {
        min-height: 70vh;
        height: 70vh;
    }

    .auth-page {
        grid-template-columns: 1fr;
    }

    .auth-hero {
        padding: 26px;
    }

    .auth-panel {
        padding: 24px 16px 40px;
    }
}

@media (max-width: 860px) {
    .grid,
    .picks,
    .odd-line {
        grid-template-columns: 1fr;
    }

    .checks {
        grid-template-columns: 1fr;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }
}
