
:root {
    --background: #081e18;
    --sidebar: #061610;
    --panel: #102c23;
    --border: #244638;
    --primary: #087b55;
    --green: #25df83;
    --yellow: #f5dc42;
    --red: #ef5350;
    --text: #f4f7f5;
    --muted: #9ab3a8;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--background);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    color-scheme: dark;
}

h1, h2, h3, p {
    margin-top: 0;
}

h1 {
    font-size: 28px;
}

h2 {
    font-size: 18px;
}

h3 {
    font-size: 14px;
    color: var(--muted);
}

p {
    color: var(--muted);
}

button, input, select, textarea {
    font: inherit;
}

button {
    background: var(--primary);
    color: white;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 12px 18px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

button:hover {
    background: #09976a;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
}

input, select, textarea {
    width: 100%;
    min-width: 0;
    background: #091e17;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
}

textarea {
    min-height: 90px;
    resize: vertical;
}

label {
    display: block;
    color: var(--muted);
    font-weight: 600;
}

form {
    display: grid;
    gap: 12px;
}

#login-screen {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(
        ellipse at top,
        #14543a,
        #061610 75%
    );
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--panel);
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 15px 45px #0005;
}

.login-card h1 {
    font-size: 42px;
    margin-bottom: 0;
    text-align: center;
}

.login-card > p {
    text-align: center;
    margin-bottom: 30px;
}

.brand span,
.login-card h1 span {
    color: var(--yellow);
}

#app {
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 245px minmax(0, 1fr);
}

.sidebar {
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    position: sticky;
    top: 0;
    height: 100dvh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.brand {
    padding: 12px;
    margin-bottom: 24px;
}

.brand h1 {
    font-size: 32px;
    margin-bottom: 0;
}

.brand p {
    letter-spacing: 5px;
    font-size: 11px;
}

.sidebar nav {
    display: grid;
    gap: 8px;
}

.sidebar nav button {
    text-align: left;
    background: transparent;
    color: var(--muted);
    width: 100%;
    padding: 13px;
}

.sidebar nav button:hover,
.sidebar nav button.active {
    background: var(--primary);
    color: white;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 30px;
    font-size: 12px;
}

.sidebar-footer button {
    width: 100%;
    background: transparent;
    border-color: var(--border);
}

.main-content {
    min-width: 0;
    padding: 30px;
    width: 100%;
    max-width: 1700px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 25px;
}

.page-header h1 {
    margin-bottom: 5px;
}

.page-header p {
    margin-bottom: 0;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card,
.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    min-width: 0;
}

.metric-card strong {
    display: block;
    font-size: clamp(20px, 2vw, 30px);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.metric-card p {
    margin: 8px 0 0;
    font-size: 12px;
}

#current-bankroll {
    color: var(--green);
}

#target-odds {
    color: var(--yellow);
}

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

.panel {
    margin-bottom: 20px;
}

.panel h2 {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

canvas {
    max-width: 100%;
    max-height: 280px;
}

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

.stake-grid > div {
    background: var(--background);
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    color: var(--muted);
}

.stake-grid strong {
    display: block;
    color: var(--text);
    font-size: 22px;
    margin-top: 8px;
}

.table-wrapper {
    overflow-x: auto;
    margin-top: 18px;
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

th, td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--background);
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

td {
    font-size: 13px;
}

tbody tr:hover {
    background: #ffffff05;
}

td button {
    padding: 7px 10px;
    margin: 3px;
    font-size: 12px;
}

#history-search,
#history-filter {
    margin-bottom: 12px;
}

.positive, .won {
    color: var(--green);
}

.negative, .lost {
    color: var(--red);
}

.pending {
    color: var(--yellow);
}

.void {
    color: var(--muted);
}

.status-badge {
    display: inline-block;
    border: 1px solid currentColor;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.bet-card,
.league-card,
.movement-card {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
}

.danger-button {
    background: #672b2b;
    color: #fff;
}

.danger-button:hover {
    background: #913b3b;
}

#bet-form,
#settings-form,
#movement-form,
#league-form {
    max-width: 800px;
}

[role="status"] {
    margin: 0;
    font-size: 14px;
    overflow-wrap: anywhere;
}

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

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

@media (max-width: 768px) {
    #app {
        display: block;
    }

    .sidebar {
        position: static;
        height: auto;
        padding: 12px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .brand {
        padding: 4px;
        margin-bottom: 10px;
    }

    .brand h1 {
        font-size: 25px;
    }

    .brand p {
        margin-bottom: 5px;
    }

    .sidebar nav {
        display: flex;
        overflow-x: auto;
        gap: 6px;
        padding-bottom: 8px;
    }

    .sidebar nav button {
        width: auto;
        white-space: nowrap;
        font-size: 12px;
        padding: 10px;
    }

    .sidebar-footer {
        padding-top: 8px;
    }

    .sidebar-footer p {
        display: none;
    }

    .sidebar-footer button {
        width: auto;
        padding: 8px 12px;
        font-size: 12px;
    }

    .main-content {
        padding: 16px;
    }

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

    h1 {
        font-size: 23px;
    }

    .metrics-grid {
        gap: 10px;
    }

    .metric-card, .panel {
        padding: 14px;
    }

    .metric-card strong {
        font-size: 21px;
    }

    .metric-card h3 {
        font-size: 12px;
    }

    .stake-grid {
        gap: 6px;
    }

    .stake-grid > div {
        padding: 10px 5px;
        font-size: 11px;
    }

    .stake-grid strong {
        font-size: 17px;
    }

    input, select, textarea {
        font-size: 16px;
    }
}
