/* TacoBot Platform Orchestrator - Super Admin Styles */

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-card: #1c2128;
    --border: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent-green: #3fb950;
    --accent-red: #f85149;
    --accent-blue: #58a6ff;
    --accent-orange: #d29922;
    --accent-purple: #bc8cff;
    --accent-teal: #39d353;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --radius: 8px;
    --radius-lg: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

/* ── Login ───────────────────────────────────────────────────── */
.login-overlay {
    position: fixed; inset: 0;
    background: var(--bg-primary);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}
.login-overlay.hidden { display: none; }
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 380px;
    text-align: center;
}
.login-logo { font-size: 28px; margin-bottom: 6px; }
.login-subtitle { color: var(--text-secondary); font-size: 13px; margin-bottom: 24px; }
.login-error { color: var(--accent-red); font-size: 12px; margin: 8px 0; display: none; }

/* ── Header ──────────────────────────────────────────────────── */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 14px 24px;
    display: flex; align-items: center; justify-content: space-between;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-title { font-size: 18px; font-weight: 600; }
.header-title span { color: var(--accent-orange); }
.header-right { display: flex; align-items: center; gap: 12px; }

/* ── Layout ──────────────────────────────────────────────────── */
.main { max-width: 1100px; margin: 0 auto; padding: 24px; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
}
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}
.card-title { font-size: 16px; font-weight: 600; }
.card-badge {
    font-size: 11px; padding: 3px 10px; border-radius: 12px;
    font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}

/* ── MDS Card ────────────────────────────────────────────────── */
.mds-row {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
}
.mds-info { display: flex; align-items: center; gap: 16px; }
.mds-label { color: var(--text-secondary); font-size: 13px; }
.mds-value { font-size: 14px; font-weight: 500; }

/* ── Bot Grid ────────────────────────────────────────────────── */
.bot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.bot-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: border-color 0.2s;
}
.bot-card:hover { border-color: var(--accent-blue); }
.bot-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.bot-name { font-size: 16px; font-weight: 600; }
.bot-id { color: var(--text-muted); font-size: 11px; font-family: monospace; }
.bot-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; font-size: 13px; }
.bot-meta-label { color: var(--text-secondary); }
.bot-meta-value { text-align: right; }
.bot-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Status badges ───────────────────────────────────────────── */
.status-healthy  { background: rgba(63,185,80,0.15); color: var(--accent-green); }
.status-running  { background: rgba(88,166,255,0.15); color: var(--accent-blue); }
.status-stopped  { background: rgba(110,118,129,0.15); color: var(--text-muted); }
.status-crashed  { background: rgba(248,81,73,0.15); color: var(--accent-red); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
    border: none; border-radius: 6px; padding: 8px 16px;
    font-size: 13px; font-weight: 500; cursor: pointer;
    transition: opacity 0.15s; display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { opacity: 0.85; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-green  { background: var(--accent-green); color: #fff; }
.btn-red    { background: var(--accent-red); color: #fff; }
.btn-blue   { background: var(--accent-blue); color: #fff; }
.btn-orange { background: var(--accent-orange); color: #fff; }
.btn-muted  { background: var(--bg-tertiary); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; text-align: left; }
.form-group label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.form-group input, .form-group select {
    width: 100%; padding: 9px 12px; border-radius: 6px;
    border: 1px solid var(--border); background: var(--bg-tertiary);
    color: var(--text-primary); font-size: 13px;
}
.form-group input:focus, .form-group select:focus {
    outline: none; border-color: var(--accent-blue);
}

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center;
    z-index: 500;
}
.modal-overlay.hidden { display: none; }
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 420px;
    max-width: 90vw;
}
.modal-title { font-size: 18px; font-weight: 600; margin-bottom: 20px; }

/* ── Log viewer ──────────────────────────────────────────────── */
.log-viewer {
    background: #000;
    color: #ccc;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 11px;
    padding: 12px;
    border-radius: 6px;
    max-height: 350px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.5;
}

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
    text-align: center; padding: 40px;
    color: var(--text-muted); font-size: 14px;
}
.empty-state .icon { font-size: 40px; margin-bottom: 12px; }

/* ── Refresh indicator ───────────────────────────────────────── */
.refresh-dot {
    width: 8px; height: 8px; border-radius: 50%;
    display: inline-block; margin-left: 6px;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
    .main { padding: 12px; }
    .bot-grid { grid-template-columns: 1fr; }
    .login-card { width: 95vw; padding: 24px; }
}
