/* ════════════════════════════════
   SORA Dashboard — Design System
   ════════════════════════════════ */

:root {
    /* Palette */
    --bg: #090b10;
    --surface: #12151e;
    --raised: #181c28;
    --border: rgba(255, 255, 255, 0.06);
    --text: #e4e6ec;
    --dim: #717789;
    --sora: #6699ff;
    --m1: #2dd4a8;
    --m3: #a78bfa;
    --up: #34d399;
    --down: #f87171;
    --radius: 14px;
    --radius-sm: 10px;
}

/* ─── Reset ─── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    /* Ambient gradient */
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(102, 153, 255, 0.08), transparent),
        radial-gradient(ellipse 60% 40% at 80% 110%, rgba(167, 139, 250, 0.05), transparent);
}

/* ─── Layout ─── */
.app {
    max-width: 680px;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ══════════════════════════════
   Header
   ══════════════════════════════ */
.header {
    text-align: center;
    padding: 1.5rem 0 0.5rem;
    animation: fadeDown 0.6s ease both;
}

.pill {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--dim);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 0.25rem 0.85rem;
    margin-bottom: 0.9rem;
    background: var(--surface);
}

.title {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    color: #fff;
    line-height: 1;
}

.subtitle {
    font-size: 0.85rem;
    color: var(--dim);
    margin-top: 0.4rem;
    font-weight: 400;
}

/* Status */
.status {
    margin-top: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.72rem;
    color: var(--dim);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 0.35rem 0.9rem;
    transition: all 0.3s;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--dim);
    animation: blink 1.6s ease-in-out infinite;
}

.status.live .status-dot {
    background: var(--up);
    animation: none;
    box-shadow: 0 0 6px var(--up);
}

.status.error .status-dot {
    background: var(--down);
    animation: none;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.2;
    }
}

/* ══════════════════════════════
   Hero Rate Cards
   ══════════════════════════════ */
.rate-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    animation: fadeUp 0.5s 0.1s ease both;
}

.rate-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.9rem 0.8rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: border-color 0.25s, transform 0.25s;
}

.rate-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

/* Color accent bar at top */
.rate-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
}

.rc-sora::before {
    background: var(--sora);
}

.rc-1m::before {
    background: var(--m1);
}

.rc-3m::before {
    background: var(--m3);
}

.rc-label {
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--dim);
    margin-bottom: 0.35rem;
}

.rc-value {
    font-size: 1.55rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    color: #fff;
    line-height: 1.15;
}

.rc-change {
    font-size: 0.68rem;
    font-weight: 600;
    margin-top: 0.3rem;
    min-height: 1em;
}

.rc-change.up {
    color: var(--up);
}

.rc-change.down {
    color: var(--down);
}

/* ══════════════════════════════
   Panels
   ══════════════════════════════ */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    animation: fadeUp 0.5s 0.2s ease both;
}

.panel-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
}

.panel-bar h2 {
    font-size: 0.82rem;
    font-weight: 600;
}

/* Legend */
.legend {
    display: flex;
    gap: 0.75rem;
}

.lg {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--dim);
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.d-sora {
    background: var(--sora);
}

.d-1m {
    background: var(--m1);
}

.d-3m {
    background: var(--m3);
}

/* Chart */
.chart-area {
    padding: 0.75rem 0.5rem 0.25rem;
    height: 260px;
    position: relative;
}



/* ══════════════════════════════
   Table
   ══════════════════════════════ */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    table-layout: fixed;
}

thead th {
    padding: 0.6rem 0.7rem;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dim);
    text-align: right;
    border-bottom: 1px solid var(--border);
    background: var(--raised);
    position: sticky;
    top: 0;
    z-index: 2;
}

thead th:first-child {
    text-align: left;
}

tbody td {
    padding: 0.55rem 0.7rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    transition: background 0.12s;
}

tbody td:first-child {
    text-align: left;
    color: var(--dim);
}

tbody td:nth-child(2) {
    color: var(--sora);
}

tbody td:nth-child(3) {
    color: var(--m1);
}

tbody td:nth-child(4) {
    color: var(--m3);
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Collapsed state: show only first 20 rows */
.table-collapsed tbody tr:nth-child(n+21) {
    display: none;
}

.toggle-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--dim);
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 500;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn:hover {
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text);
}

/* ══════════════════════════════
   Footer
   ══════════════════════════════ */
.foot {
    text-align: center;
    font-size: 0.7rem;
    color: var(--dim);
    padding-top: 0.5rem;
}

.foot a {
    color: var(--sora);
    text-decoration: none;
}

.foot a:hover {
    text-decoration: underline;
}

/* ══════════════════════════════
   Animations
   ══════════════════════════════ */
@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ══════════════════════════════
   Mobile
   ══════════════════════════════ */
@media (max-width: 520px) {
    .app {
        padding: 1.25rem 0.7rem 2rem;
        gap: 0.75rem;
    }

    .title {
        font-size: 2.4rem;
    }

    .rate-cards {
        gap: 0.45rem;
    }

    .rate-card {
        padding: 0.7rem 0.5rem;
    }

    .rc-label {
        font-size: 0.55rem;
    }

    .rc-value {
        font-size: 1.25rem;
    }

    .rc-change {
        font-size: 0.6rem;
    }

    .chart-area {
        height: 200px;
        padding: 0.5rem 0.25rem 0.25rem;
    }



    .panel-bar {
        padding: 0.7rem 0.75rem;
    }

    thead th,
    tbody td {
        padding: 0.45rem 0.5rem;
        font-size: 0.72rem;
    }

    thead th {
        font-size: 0.55rem;
    }

    .legend {
        gap: 0.5rem;
    }

    .lg {
        font-size: 0.58rem;
    }
}