/* MRKT Terminal — Web Dashboard styles */
:root {
    --bg-sidebar: #09090b;
    --bg-main:    #0f0f12;
    --card:       #16161a;
    --accent:     #6366f1;
    --accent-glow:#818cf8;
    --text:       #f4f4f5;
    --muted:      #a1a1aa;
    --success:    #10b981;
    --danger:     #f43f5e;
    --border:     #27272a;
}

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

html, body {
    background: var(--bg-main);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    min-height: 100vh;
}

header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
}
.brand h1 { font-size: 1.1rem; font-weight: 600; }
.badge {
    font-size: 0.7rem; background: var(--accent); padding: 2px 8px;
    border-radius: 4px; vertical-align: middle; margin-left: 6px;
}
nav { display: flex; gap: 0.5rem; align-items: center; }

button, .tab {
    background: var(--card); color: var(--text);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem; border-radius: 6px;
    cursor: pointer; font-size: 0.85rem;
    transition: background 0.15s;
}
button:hover, .tab:hover { background: #1f1f24; }
button.primary { background: var(--accent); border-color: var(--accent); }
button.primary:hover { background: var(--accent-glow); }
button.danger { background: var(--danger); border-color: var(--danger); }
button.ghost { background: transparent; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.tab.active { background: var(--accent); border-color: var(--accent); }

main { padding: 1.5rem; max-width: 1200px; margin: 0 auto; }
.tab-content { display: none; }
.tab-content.active { display: block; }

.toolbar { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 1rem; }
.muted { color: var(--muted); font-size: 0.85rem; }
.hint { color: var(--muted); font-size: 0.8rem; margin-top: 0.75rem; line-height: 1.5; }
.hint code { background: #18181b; padding: 1px 6px; border-radius: 3px; color: var(--accent-glow); }

/* ── Bots grid ────────────────────────────────────────────────────────── */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.bot-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 8px; padding: 1rem;
    display: flex; flex-direction: column; gap: 0.75rem;
}
.bot-card h3 { font-size: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.dot.running { background: var(--success); box-shadow: 0 0 8px var(--success); }
.dot.crashed { background: var(--danger); }
.bot-card .desc { color: var(--muted); font-size: 0.8rem; min-height: 2.2em; }
.bot-card .actions { display: flex; gap: 0.5rem; margin-top: 0.25rem; }
.bot-card .meta { font-family: monospace; font-size: 0.75rem; color: var(--muted); }

/* ── Config ──────────────────────────────────────────────────────────── */
#cfg-editor {
    width: 100%; min-height: 480px;
    background: #0a0a0d; color: #e4e4e7;
    border: 1px solid var(--border); border-radius: 8px;
    padding: 1rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.85rem; line-height: 1.5;
}

/* ── Logs ────────────────────────────────────────────────────────────── */
#logs-viewer {
    background: #0a0a0d; color: #c4c4c8;
    border: 1px solid var(--border); border-radius: 8px;
    padding: 1rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.75rem; line-height: 1.45;
    height: 70vh; overflow-y: auto; white-space: pre-wrap; word-break: break-all;
}

/* ── Stats ───────────────────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.stat-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 8px; padding: 1rem;
}
.stat-card .label { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-card .value { font-size: 1.5rem; font-weight: 600; margin-top: 0.5rem; }

/* ── Login page ──────────────────────────────────────────────────────── */
.login-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
}
.login-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 12px; padding: 2rem;
    max-width: 420px; text-align: center;
    box-shadow: 0 0 60px rgba(99, 102, 241, 0.1);
}
.login-card h1 { font-size: 1.4rem; margin-bottom: 0.5rem; }
.login-card .muted { margin-bottom: 1.5rem; display: block; }
#tg-widget { margin: 1rem 0; min-height: 50px; display: flex; justify-content: center; }
