:root {
    --bg: #0f1117;
    --card: #1a1d27;
    --border: #2a2d3a;
    --text: #e4e4e7;
    --muted: #71717a;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --green: #22c55e;
    --red: #ef4444;
    --yellow: #eab308;
    --orange: #f97316;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}
h1 { font-size: 1.8rem; margin-bottom: 8px; }
h2 { font-size: 1.3rem; margin-bottom: 12px; color: var(--accent); }
.subtitle { color: var(--muted); margin-bottom: 24px; }
.grid { display: grid; gap: 20px; margin-bottom: 24px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); }
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}
.stat-card { text-align: center; }
.stat-value { font-size: 2rem; font-weight: 700; margin: 8px 0; }
.stat-label { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card.green .stat-value { color: var(--green); }
.stat-card.red .stat-value { color: var(--red); }
.stat-card.yellow .stat-value { color: var(--yellow); }
.stat-card.accent .stat-value { color: var(--accent); }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.5px; }
tr:hover { background: rgba(99, 102, 241, 0.05); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }
.badge-prio-1 { background: var(--red); color: white; }
.badge-prio-2 { background: var(--yellow); color: black; }
.badge-hit { background: var(--green); color: white; }
.badge-miss { background: var(--muted); color: white; }
.form-row { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
input, select, button {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }
button { background: var(--accent); cursor: pointer; border: none; padding: 8px 16px; font-weight: 600; }
button:hover { background: var(--accent-hover); }
button.danger { background: var(--red); }
button.danger:hover { background: #dc2626; }
.key-display { font-family: monospace; font-size: 0.8rem; color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section { margin-bottom: 32px; }
.cost { color: var(--green); font-weight: 600; }
.muted { color: var(--muted); }
.progress-bar { width: 100%; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; background: var(--accent); transition: width 0.3s; }
.progress-fill.warn { background: var(--yellow); }
.progress-fill.crit { background: var(--red); }
.chart-container { position: relative; height: 250px; margin-top: 12px; }
.timeframe-buttons { display: flex; gap: 4px; margin-bottom: 16px; }
.timeframe-buttons button { padding: 6px 14px; font-size: 0.8rem; }
.timeframe-buttons button.active { background: var(--accent); }
.timeframe-buttons button:not(.active) { background: var(--card); border: 1px solid var(--border); }
.live-indicator { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 6px; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.live-badge { display: inline-flex; align-items: center; font-size: 0.8rem; color: var(--green); margin-left: 12px; }
details summary { cursor: pointer; color: var(--accent); margin-top: 16px; }
.tab-bar { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tab-bar button { background: transparent; border: none; border-bottom: 2px solid transparent; border-radius: 0; padding: 8px 16px; color: var(--muted); }
.tab-bar button.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; }
.center-screen { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 80vh; }
.nav-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.nav-bar a { color: var(--accent); text-decoration: none; margin-left: 16px; }
.nav-bar .nav-user { color: var(--muted); font-size: 0.85rem; }
.credit-display { font-size: 1.5rem; font-weight: 700; color: var(--green); }
.credit-low { color: var(--red); }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); display: flex; justify-content: center; align-items: center; z-index: 1000; }
.modal { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 24px; max-width: 500px; width: 90%; }
.modal h3 { margin-bottom: 16px; color: var(--accent); }
.modal .form-row { flex-direction: column; }
.modal input, .modal select { width: 100%; }
.json-key { font-family: monospace; font-size: 0.8rem; color: var(--muted); cursor: pointer; }
.json-key:hover { color: var(--accent); }
.modal label { display: block; margin-bottom: 4px; font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.modal .form-row { margin-bottom: 12px; }