:root {
    --bg: #05060a;
    --bg-elevated: #10121a;
    --bg-elevated-soft: #151827;
    --accent: #ff8b3d;
    --accent-soft: rgba(255, 139, 61, 0.18);
    --accent-strong: #ffb36f;
    --text: #f5f5f7;
    --text-muted: #9a9fb5;
    --danger: #ff4b5c;
    --success: #4cd964;
    --border-subtle: #26293a;
    --radius-lg: 18px;
    --radius-md: 12px;
    --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.55);
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: radial-gradient(circle at top, #151827 0, #05060a 55%);
    color: var(--text);
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 16px;
    max-width: 1100px;
    margin: 0 auto;
}

.header {
    display: flex;
    align-items: center;
    margin-bottom: 18px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fox-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 20%, #ffcf9f, #ff8b3d);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    font-size: 24px;
}

.title-block h1 {
    margin: 0;
    font-size: 1.4rem;
    letter-spacing: 0.03em;
}

.title-block p {
    margin: 2px 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card {
    background: linear-gradient(145deg, rgba(255, 139, 61, 0.04), rgba(10, 12, 20, 0.98));
    border-radius: var(--radius-lg);
    padding: 16px 14px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(18px);
}

.add-bot-card h2,
.bots-card h2 {
    margin: 0 0 10px;
    font-size: 1.1rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.field label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.field input {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: rgba(5, 6, 10, 0.9);
    padding: 8px 10px;
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    transition: border 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(255, 139, 61, 0.4);
    background: rgba(10, 12, 20, 0.95);
}

.btn {
    border-radius: 999px;
    border: none;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease, color 0.15s ease;
}

.btn.primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #1b0f06;
    box-shadow: 0 10px 25px rgba(255, 139, 61, 0.45);
}

.btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(255, 139, 61, 0.6);
}

.btn.ghost {
    background: transparent;
    color: var(--accent-strong);
    border: 1px solid rgba(255, 139, 61, 0.4);
}

.btn.ghost:hover {
    background: var(--accent-soft);
}

.btn.small {
    padding: 5px 10px;
    font-size: 0.75rem;
}

.btn.danger {
    background: var(--danger);
    color: #fff;
}

.btn.danger:hover {
    box-shadow: 0 10px 25px rgba(255, 75, 92, 0.5);
}

.status-text {
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.bots-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.bots-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bot-card {
    background: var(--bg-elevated-soft);
    border-radius: var(--radius-md);
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.bot-name {
    font-size: 0.95rem;
    font-weight: 500;
}

.bot-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.badge {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 500;
}

.badge.running {
    background: rgba(76, 217, 100, 0.12);
    color: var(--success);
}

.badge.stopped {
    background: rgba(255, 75, 92, 0.12);
    color: var(--danger);
}

.badge.unknown {
    background: rgba(154, 159, 181, 0.12);
    color: var(--text-muted);
}

.badge.inactive {
    background: rgba(255, 75, 92, 0.12);
    color: var(--danger);
}

.bot-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.console-toggle {
    margin-top: 4px;
}

.console {
    margin-top: 6px;
    border-radius: var(--radius-md);
    background: #05060a;
    border: 1px solid #26293a;
    padding: 8px;
    max-height: 220px;
    overflow: auto;
    font-family: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    white-space: pre-wrap;
    color: #e5e5f0;
}

.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.console-body {
    border-top: 1px solid #26293a;
    padding-top: 4px;
}

@media (min-width: 720px) {
    .main {
        flex-direction: row;
        align-items: flex-start;
    }

    .add-bot-card {
        flex: 0 0 320px;
    }

    .bots-card {
        flex: 1;
    }
}
