/* swap.css — Auto-Swap dashboard page styles */

/* ── Page card width ───────────────────────────────────────────────────── */

.swap-page-card {
    width: min(100%, 68rem);
}

/* ── Section panels ────────────────────────────────────────────────────── */

.panel {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.panel h2 {
    margin: 0 0 1rem;
    font-size: 1rem;
    color: var(--text-primary);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.panel-header h2 {
    margin: 0;
}

.panel-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* ── Stat card grid (status items, indicators, portfolio) ──────────────── */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.6rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.6rem 0.75rem;
    background: var(--surface-1);
    border-radius: 0.4rem;
    border: 1px solid var(--border-subtle, var(--border));
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}

.stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: monospace;
}

/* ── Indicators grid (slightly more compact) ───────────────────────────── */

.indicators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

/* ── Signal colours ────────────────────────────────────────────────────── */

.signal-positive { color: #4ade80; }
.signal-negative { color: #f87171; }

/* ── Table helpers ─────────────────────────────────────────────────────── */

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

table th,
table td {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-subtle, var(--border));
    white-space: nowrap;
}

table th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

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

.reason-cell {
    max-width: 260px;
    font-size: 0.8rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Portfolio / wallet extras ─────────────────────────────────────────── */

.portfolio-meta {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ── Form grid (config panel) ──────────────────────────────────────────── */

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.form-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 500;
}

.form-grid input,
.form-grid select {
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem 0.6rem;
    font-size: 0.9rem;
}

/* ── Muted helper ──────────────────────────────────────────────────────── */

.muted { color: var(--text-muted); }

/* ── Mobile ────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .stat-grid,
    .indicators-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
