*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #0f172a 0, #020617 40%, #000000 100%);
    color: #e5e7eb;
    -webkit-font-smoothing: antialiased;
}

.app-shell {
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 14px 40px;
}

/* Topbar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-radius: 14px;
    border: 1px solid rgba(31, 41, 55, 0.9);
    background: linear-gradient(130deg, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.98));
    margin-bottom: 18px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.8);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: conic-gradient(from 140deg, #22c55e, #22d3ee, #a855f7, #22c55e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    color: #0f172a;
}

.brand-title {
    font-size: 15px;
    font-weight: 600;
}

.brand-subtitle {
    font-size: 11px;
    color: #9ca3af;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
}

.tag {
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(55, 65, 81, 0.9);
    background: rgba(15, 23, 42, 0.9);
}

.tag-live {
    color: #a5b4fc;
}

.last-updated span {
    color: #e5e7eb;
    font-weight: 500;
}

/* Hero */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.8fr);
    gap: 18px;
    margin-bottom: 20px;
}

.hero-text h1 {
    font-size: 26px;
    line-height: 1.25;
    margin-bottom: 8px;
}

.grad-text {
    background: linear-gradient(120deg, #22c55e, #22d3ee, #a855f7);
    -webkit-background-clip: text;
    color: transparent;
    font-weight: 700;
}

.hero-text p {
    font-size: 13px;
    color: #9ca3af;
    max-width: 420px;
    margin-bottom: 10px;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(55, 65, 81, 0.9);
    font-size: 11px;
    color: #e5e7eb;
    background: rgba(15, 23, 42, 0.9);
}

/* Hero Card */
.hero-card {
    border-radius: 16px;
    border: 1px solid rgba(31, 41, 55, 1);
    background: radial-gradient(circle at top, rgba(30, 64, 175, 0.6), rgba(15, 23, 42, 0.98));
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hero-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #cbd5f5;
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}

.metric-card {
    background: rgba(15, 23, 42, 0.9);
    border-radius: 12px;
    border: 1px solid rgba(30, 64, 175, 0.9);
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metric-label {
    font-size: 11px;
    color: #9ca3af;
}

.metric-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metric-value {
    font-size: 20px;
    font-weight: 700;
}

.metric-chip {
    font-size: 10px;
    border-radius: 999px;
    padding: 2px 7px;
    border: 1px solid rgba(34, 197, 94, 0.7);
    color: #bbf7d0;
    background: rgba(22, 101, 52, 0.6);
}

.metric-chip.bad {
    border-color: rgba(248, 113, 113, 0.8);
    color: #fecaca;
    background: rgba(127, 29, 29, 0.7);
}

.metric-sub {
    font-size: 11px;
    color: #9ca3af;
}

/* Filters */
.filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.filters-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    color: #9ca3af;
}

.filters-group select,
.filters-group input {
    background: rgba(15, 23, 42, 0.98);
    border-radius: 10px;
    border: 1px solid rgba(31, 41, 55, 1);
    padding: 6px 8px;
    font-size: 12px;
    color: #e5e7eb;
    outline: none;
}

.filters-group select:focus,
.filters-group input:focus {
    border-color: rgba(59, 130, 246, 0.9);
}

.filters-search input {
    width: 100%;
}

/* Table */
.table-section {
    border-radius: 16px;
    border: 1px solid rgba(31, 41, 55, 1);
    background: rgba(15, 23, 42, 0.98);
    padding: 10px 10px 14px;
    margin-bottom: 18px;
}

.table-header h2 {
    font-size: 16px;
    margin-bottom: 2px;
}

.table-header p {
    font-size: 11px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.legend.best-buy {
    background: #22c55e;
}

.legend.best-sell {
    background: #f97316;
}

.table-wrapper {
    margin-top: 10px;
    max-height: 320px;
    overflow: auto;
    border-radius: 10px;
    border: 1px solid rgba(31, 41, 55, 1);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

thead {
    background: rgba(15, 23, 42, 0.98);
    position: sticky;
    top: 0;
    z-index: 5;
}

th,
td {
    padding: 7px 8px;
    border-bottom: 1px solid rgba(31, 41, 55, 1);
}

th {
    text-align: left;
    font-weight: 500;
    color: #9ca3af;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.99);
}

tbody tr:nth-child(odd) {
    background: rgba(15, 23, 42, 0.96);
}

tbody tr:hover {
    background: rgba(30, 64, 175, 0.3);
}

.badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid rgba(55, 65, 81, 0.9);
    background: rgba(15, 23, 42, 0.95);
}

.badge.buy {
    margin-left: 4px;
    border-color: rgba(34, 197, 94, 0.9);
    color: #bbf7d0;
}

.badge.sell {
    margin-left: 4px;
    border-color: rgba(249, 115, 22, 0.9);
    color: #fed7aa;
}

.price {
    font-variant-numeric: tabular-nums;
}

.spread-good {
    color: #22c55e;
}

.spread-bad {
    color: #f97316;
}

.text-muted {
    color: #6b7280;
}

/* History & chart */
.history-section {
    border-radius: 16px;
    border: 1px solid rgba(31, 41, 55, 1);
    background: rgba(15, 23, 42, 0.98);
    padding: 10px 10px 14px;
    margin-bottom: 18px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}

.history-header h2 {
    font-size: 16px;
    margin-bottom: 3px;
}

.history-header p {
    font-size: 11px;
    color: #9ca3af;
}

.history-filters {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.history-chart-wrapper {
    width: 100%;
    height: 260px;
    background: rgba(15, 23, 42, 0.95);
    border-radius: 12px;
    border: 1px solid rgba(31, 41, 55, 1);
    padding: 8px 10px;
}

/* Stats Panel */
.stats-panel {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.stat-card {
    background: rgba(15, 23, 42, 0.98);
    border-radius: 12px;
    border: 1px solid rgba(31, 41, 55, 0.9);
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.stat-label {
    font-size: 11px;
    color: #9ca3af;
}

.stat-value {
    font-size: 15px;
    font-weight: 600;
}

.stat-sub {
    font-size: 11px;
    color: #6b7280;
}

/* Footer */
.footer {
    font-size: 11px;
    color: #6b7280;
    text-align: center;
    margin-top: 6px;
}

/* Responsive */
@media (max-width: 900px) {
    .hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .history-header {
        flex-direction: column;
    }

    .history-filters {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .filters {
        grid-template-columns: minmax(0, 1fr);
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .history-chart-wrapper {
        height: 220px;
    }
}


