:root {
    --bg: #090c10;
    --surface: #0d1117;
    --card: #161b22;
    --border: #30363d;
    --accent: #58a6ff;
    --accent-glow: rgba(88, 166, 255, 0.15);
    --text: #e6edf3;
    --text-muted: #8b949e;
    --success: #3fb950;
    --error: #f85149;
    --warning: #d29922;
    --font: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
}

@media (max-width: 900px) {
    body { height: auto; overflow-y: auto; }
}

.app-container {
    display: flex;
    height: 100vh;
}

@media (max-width: 900px) {
    .app-container { flex-direction: column; height: auto; }
}

/* Sidebar Styling */
aside {
    width: 320px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px;
}

@media (max-width: 900px) {
    aside {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        height: auto;
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 30px;
    background: linear-gradient(90deg, #58a6ff, #bc8cff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Main Content Styling */
main {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

@media (max-width: 900px) {
    main { padding: 20px; overflow-y: visible; }
    header { flex-direction: column; align-items: flex-start; gap: 10px; }
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-summary {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: var(--border);
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge-live { color: var(--success); border: 1px solid var(--success); background: rgba(63, 185, 80, 0.1); }
.badge-working { color: var(--accent); border: 1px solid var(--accent); background: var(--accent-glow); }
.badge-strategy { color: #bc8cff; border: 1px solid #bc8cff; background: rgba(188, 140, 255, 0.1); }

/* Card Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    position: relative;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.card-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

.val {
    font-size: 28px;
    font-weight: 700;
}

.sub {
    font-size: 13px;
    color: var(--text-muted);
}

/* Input Fields */
.input-group {
    margin-bottom: 15px;
}

label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
}

input, select {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    border-color: var(--accent);
}

.custom-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238b949e' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}

button {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 0 15px var(--accent-glow); }

.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--border); }

/* History Table */
.data-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.section-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

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

th {
    background: var(--surface);
    text-align: left;
    padding: 12px 20px;
    font-size: 12px;
    color: var(--text-muted);
}

td {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    font-size: 13px;
}

.win-row { background: rgba(63, 185, 80, 0.02); }
.loss-row { background: rgba(248, 81, 73, 0.02); }

.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-accent { color: var(--accent); }
.val-small { font-size: 20px; font-weight: 700; }

/* Modern Odds Display */
.odds-chance-display {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.odds-pills {
    display: flex;
    gap: 8px;
}

.odds-pill {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    gap: 6px;
    min-width: 110px;
    justify-content: center;
}

.odds-up-pill {
    background: rgba(39, 190, 114, 0.1);
    color: #27be72;
    border: 1px solid rgba(39, 190, 114, 0.2);
}

.odds-down-pill {
    background: rgba(224, 22, 61, 0.1);
    color: #e0163d;
    border: 1px solid rgba(224, 22, 61, 0.2);
}

/* Active Highlight (Like in user photo) */
.odds-up-pill.active { background: #27be72; color: white; border: none; }
.odds-down-pill.active { background: #e0163d; color: white; border: none; }

.chance-delta {
    font-size: 13px;
    font-weight: 600;
}

@media (max-width: 900px) {
    .market-card { grid-column: span 1 !important; }
}

/* Archives Scroll */
.archive-list {
    flex: 1;
    overflow-y: auto;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.archive-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
}

.archive-item:hover { border-color: var(--accent); }

.archive-date { font-size: 11px; color: var(--text-muted); }
.archive-stats { display: flex; justify-content: space-between; margin-top: 5px; font-size: 13px; }

@media (max-width: 600px) {
    .card-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .price-side {
        text-align: left !important;
        padding-top: 10px;
        border-top: 1px solid var(--border);
    }

    .odds-pill {
        padding: 8px 12px;
        min-width: 90px;
        font-size: 14px;
    }

    .val {
        font-size: 24px;
    }
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Status Badges for Early Exit / SL */
.status-early { 
    background: rgba(210, 153, 34, 0.15); 
    color: var(--warning); 
    border: 1px solid rgba(210, 153, 34, 0.3); 
}
