/* Canonical color tokens — generated from jarvis/design-tokens.json.
   Edit the source JSON, then run jarvis/scripts/generate-css-tokens.py
   to regenerate tokens.css. Do not redefine these here. */
@import url('tokens.css');

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
}

.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    width: 600px;
    height: 600px;
    filter: blur(120px);
    border-radius: 50%;
    opacity: 0.15;
}

.blob-1 {
    background: var(--accent);
    top: -200px;
    right: -200px;
}

.blob-2 {
    background: #8b5cf6;
    bottom: -200px;
    left: -200px;
}

.dashboard-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo h1 span {
    color: var(--accent);
    margin-left: 2px;
}

.pulse {
    width: 12px;
    height: 12px;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--green);
    animation: pulse 2s infinite;
}

.pulse-error {
    background: var(--red) !important;
    box-shadow: 0 0 10px var(--red) !important;
    animation: pulse-red 2s infinite !important;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulse-red {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.status-badge {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-dim);
    transition: all 0.3s ease;
}

.status-error {
    border-color: var(--red) !important;
    color: var(--red) !important;
}

/* Error banner */
.error-banner {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--red);
    border-radius: 12px;
    padding: 12px 20px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: var(--red);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    padding: 30px;
    border-radius: 24px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.stat-card h3 {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card .value {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.stat-card .trend {
    font-size: 0.9rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    margin-top: 15px;
    overflow: hidden;
}

.progress-bar .fill {
    height: 100%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
    transition: width 1s ease;
}

.bar-label {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Table area */
.data-view {
    background: var(--card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 30px;
}

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

.table-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.table-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-controls select {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
}

.table-controls select:focus {
    outline: none;
    border-color: var(--accent);
}

.update-timer {
    font-size: 0.8rem;
    color: var(--text-dim);
}

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

th {
    text-align: left;
    padding: 15px;
    font-size: 0.8rem;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
}

th.sortable {
    cursor: pointer;
    user-select: none;
}

th.sortable:hover {
    color: var(--accent);
}

td {
    padding: 16px 15px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
}

.market-name {
    font-weight: 600;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-open {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
}

.status-closed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--green);
}

.dir-badge {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    font-size: 0.65rem;
}

.pos { color: var(--green); }
.neg { color: var(--red); }
.dim { color: var(--text-dim); opacity: 0.6; }

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-dim);
    font-size: 0.9rem;
}
