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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f0f0f0;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */

.header {
    background: white;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header h1 {
    color: #333;
    margin-bottom: 10px;
}

.header p {
    color: #666;
    font-size: 14px;
}

.last-updated {
    color: #999;
    font-size: 12px;
    margin-top: 10px;
}

/* ── Metric cards ────────────────────────────────────────────────────────────── */

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

.metric-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.metric-card h3 {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.metric-card .value {
    font-size: 36px;
    font-weight: bold;
    color: #333;
}

.metric-card .label {
    color: #999;
    font-size: 12px;
    margin-top: 5px;
}

/* ── Status colours ──────────────────────────────────────────────────────────── */

.success  { color: #10b981; }
.warning  { color: #f59e0b; }
.danger   { color: #ef4444; }

/* ── Charts ──────────────────────────────────────────────────────────────────── */

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

.chart-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.chart-card h3 {
    color: #333;
    margin-bottom: 15px;
}

/* ── Sessions list ───────────────────────────────────────────────────────────── */

.sessions-list {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.sessions-list h3 {
    color: #333;
    margin-bottom: 15px;
}

.session-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.session-item:last-child {
    border-bottom: none;
}

.session-item .status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 10px;
}

.status-running   { background: #dbeafe; color: #1e40af; }
.status-exit      { background: #d1fae5; color: #065f46; }
.status-error     { background: #fee2e2; color: #991b1b; }

.session-item .time {
    color: #999;
    font-size: 12px;
    margin-top: 5px;
}

/* ── Feedback ────────────────────────────────────────────────────────────────── */

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.error {
    background: #fee2e2;
    color: #991b1b;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

/* ── Settings panel ──────────────────────────────────────────────────────────── */

.settings-panel {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.settings-panel summary {
    cursor: pointer;
    font-weight: 600;
    color: #333;
    font-size: 14px;
    user-select: none;
}

.settings-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.settings-fields label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    font-weight: 500;
}

.settings-fields input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    font-family: monospace;
}

.settings-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    align-items: center;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 500;
}

.btn-primary          { background: #111; color: white; }
.btn-primary:hover    { background: #333; }
.btn-secondary        { background: #f3f4f6; color: #374151; }
.btn-secondary:hover  { background: #e5e7eb; }

/* ── Data source badge ───────────────────────────────────────────────────────── */

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.dot-live   { background: #10b981; }
.dot-cached { background: #f59e0b; }
.dot-none   { background: #9ca3af; }

.data-source-badge {
    font-size: 11px;
    color: #666;
    margin-left: auto;
}
