* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: #0d0a14;
    color: #e0e6ed;
    min-height: 100vh;
    padding: 1.5rem 2.5rem;
    overflow-x: hidden;
}

/* Glassmorphism utility */
.glass {
    background: rgba(31, 19, 26, 0.75);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Top Navigation */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #ffffff;
}

.brand h1 span {
    color: #ff2a6d;
}

.logo-pulse {
    width: 12px;
    height: 12px;
    background: #ff2a6d;
    border-radius: 50%;
    box-shadow: 0 0 12px #ff2a6d;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 42, 109, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(255, 42, 109, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 42, 109, 0); }
}

.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-target {
    background: rgba(255, 140, 0, 0.2);
    color: #ffba49;
    border: 1px solid rgba(255, 140, 0, 0.4);
}

.badge-mode {
    background: rgba(255, 42, 109, 0.15);
    color: #ff2a6d;
    border: 1px solid rgba(255, 42, 109, 0.4);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #10b981;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 42, 109, 0.3);
}

.kpi-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
}

.kpi-sub {
    font-size: 0.8rem;
    color: #64748b;
}

.text-emerald {
    color: #10b981;
}

.net-tag {
    font-size: 0.7rem;
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: middle;
}

.net-tag.negative {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Quality Grid */
.quality-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
    margin-bottom: 2.5rem;
}

.quality-card {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quality-icon {
    font-size: 1.5rem;
}

.quality-info {
    display: flex;
    flex-direction: column;
}

.q-label {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
}

.q-val {
    font-size: 1.4rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.border-green { border-left: 4px solid #10b981; }
.border-yellow { border-left: 4px solid #f59e0b; }
.border-red { border-left: 4px solid #ef4444; }
.border-purple { border-left: 4px solid #a855f7; }

.text-green { color: #10b981; }
.text-yellow { color: #f59e0b; }
.text-red { color: #ef4444; }
.text-purple { color: #a855f7; }

/* Tabs Container */
.tabs-container {
    margin-bottom: 3rem;
}

.tabs-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.tab-btn {
    background: rgba(31, 19, 26, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: #ffffff;
    background: rgba(31, 19, 26, 0.9);
}

.tab-btn.active {
    background: #ff2a6d;
    color: #0d0a14;
    border-color: #ff2a6d;
    box-shadow: 0 0 20px rgba(255, 42, 109, 0.4);
}

.tab-content {
    display: none;
    padding: 1.5rem;
}

.tab-content.active {
    display: block;
}

/* Data Tables */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    padding: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 1.2rem 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.data-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.market-link {
    color: #ff2a6d;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.market-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.outcome-tag {
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.75rem;
}

.outcome-yes { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.outcome-no { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

.price-mono {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

.net-highlight {
    font-weight: 700;
    color: #10b981;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(16, 185, 129, 0.15);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.empty-row td {
    text-align: center;
    color: #64748b;
    padding: 3rem !important;
    font-style: italic;
}

/* Grouping and Expandable Rows */
.badge-group {
    cursor: pointer;
    background: rgba(255, 42, 109, 0.15);
    color: #ff2a6d;
    border: 1px solid rgba(255, 42, 109, 0.4);
    transition: all 0.2s ease;
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 0.7rem;
    border-radius: 12px;
}

.badge-group:hover {
    background: #ff2a6d;
    color: #0d0a14;
    box-shadow: 0 0 10px rgba(255, 42, 109, 0.5);
}

.group-details-row {
    background: rgba(0, 0, 0, 0.45);
}

.sub-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0;
    background: rgba(31, 19, 26, 0.95);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.sub-table th {
    padding: 0.6rem 0.8rem;
    font-size: 0.7rem;
    color: #ff2a6d;
    background: rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
}

.sub-table td {
    padding: 0.6rem 0.8rem;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.btn-sim-win {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.2s;
    font-weight: 600;
}
.btn-sim-win:hover {
    background: #10b981;
    color: #0d0a14;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.btn-sim-lose {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    cursor: pointer;
    margin-left: 4px;
    transition: all 0.2s;
    font-weight: 600;
}
.btn-sim-lose:hover {
    background: #ef4444;
    color: #0d0a14;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    margin-left: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.btn-danger:hover {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}



/* ==========================================================================
   MOBILE RESPONSIVENESS
   ========================================================================== */
@media screen and (max-width: 768px) {
    body {
        padding: 1rem 1rem;
    }
    
    .top-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding-bottom: 1.5rem;
    }

    .brand {
        flex-wrap: wrap;
    }

    .brand h1 {
        font-size: 1.2rem;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .badge {
        font-size: 0.65rem;
        padding: 4px 8px;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .kpi-card {
        padding: 1rem;
    }

    .kpi-value {
        font-size: 2rem;
    }

    .tabs {
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .tab-btn {
        flex: 1 1 calc(50% - 0.5rem);
        text-align: center;
        justify-content: center;
        font-size: 0.8rem;
        padding: 0.8rem;
    }

    .data-table th, .data-table td {
        padding: 0.8rem 0.5rem;
        font-size: 0.8rem;
    }
    
    /* Optimize the sub-table layout for small screens */
    .sub-table th, .sub-table td {
        font-size: 0.7rem;
        padding: 0.4rem;
    }
}
