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

:root {
    --bg: #050508;
    --surface: #0d0d14;
    --surface2: #111118;
    --border: #1e1e2e;
    --accent: #6366f1;
    --accent2: #10b981;
    --text: #e8e8f0;
    --muted: #5a5a7a;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
}

body {
    font-family: 'Syne', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse 60% 40% at 80% 0%, #6366f115, transparent);
    pointer-events: none;
}

.grid-bg {
    position: fixed;
    inset: 0;
    background-image: linear-gradient(var(--border) 1px, transparent 1px),
                      linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.2;
    pointer-events: none;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(5, 5, 8, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.logo span {
    color: var(--accent);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.vps-badge {
    font-family: 'DM Mono', monospace;
    font-size: 0.72rem;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 20px;
}

.btn-logout {
    background: none;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 5px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Syne', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-logout:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* Main */
.main {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    position: relative;
    z-index: 1;
}

.section-label {
    font-family: 'DM Mono', monospace;
    font-size: 0.65rem;
    color: var(--muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Grid Bot Cards */
.bots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.bot-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.25rem;
    transition: border-color 0.2s;
    position: relative;
    overflow: hidden;
}

.bot-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--card-color, var(--accent));
    opacity: 0.6;
}

.bot-card:hover {
    border-color: #2e2e42;
}

.bot-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.bot-info {}

.bot-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 3px;
}

.bot-svc {
    font-family: 'DM Mono', monospace;
    font-size: 0.68rem;
    color: var(--muted);
}

.bot-version {
    font-family: 'DM Mono', monospace;
    font-size: 0.68rem;
    color: var(--accent);
    margin-top: 3px;
}

/* Status Pill */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    font-family: 'DM Mono', monospace;
}

.status-pill.running {
    background: #0a2a1a;
    color: #6ee7b7;
    border: 1px solid #0d3d24;
}

.status-pill.stopped {
    background: #2a0a0a;
    color: #fca5a5;
    border: 1px solid #3d0d0d;
}

.status-pill.loading {
    background: #1a1a2a;
    color: var(--muted);
    border: 1px solid var(--border);
}

.status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

/* Buttons */
.btn-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.btn {
    border: 1px solid transparent;
    padding: 5px 12px;
    border-radius: 7px;
    cursor: pointer;
    font-family: 'Syne', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.15s;
    letter-spacing: 0.02em;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-start {
    background: #0a2a1a;
    color: #6ee7b7;
    border-color: #0d3d24;
}

.btn-start:hover {
    background: #0d3d24;
}

.btn-stop {
    background: #2a0a0a;
    color: #fca5a5;
    border-color: #3d0d0d;
}

.btn-stop:hover {
    background: #3d0d0d;
}

.btn-restart {
    background: #0a1a3a;
    color: #93c5fd;
    border-color: #0d2a52;
}

.btn-restart:hover {
    background: #0d2a52;
}

.btn-logs, .btn-detail, .btn-update {
    background: var(--surface2);
    color: var(--muted);
    border-color: var(--border);
}

.btn-logs:hover, .btn-detail:hover, .btn-update:hover {
    color: var(--text);
    border-color: #2e2e42;
}

.btn-delete {
    background: rgba(244, 114, 114, 0.15);
    color: #f67272;
    border-color: #6b2e2e;
}

.btn-delete:hover {
    background: rgba(244, 114, 114, 0.25);
    color: #ff6b6b;
    border-color: #a04040;
}

/* Actions Row */
.actions-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.btn-action {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 8px 16px;
    border-radius: 9px;
    cursor: pointer;
    font-family: 'Syne', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-action:hover {
    background: var(--surface2);
    color: var(--text);
    border-color: #2e2e42;
}

/* Logs */
.logs-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.25rem;
    margin-bottom: 2rem;
    display: none;
}

.logs-wrap.visible {
    display: block;
}

.logs-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.logs-title {
    font-family: 'DM Mono', monospace;
    font-size: 0.72rem;
    color: var(--muted);
    letter-spacing: 0.08em;
}

.btn-x {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
    padding: 0 4px;
}

.btn-x:hover {
    color: var(--text);
}

.logs-out {
    background: #020205;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 1rem;
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    color: #7878a0;
    max-height: 280px;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.7;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.7rem 1.25rem;
    font-size: 0.8rem;
    font-family: 'DM Mono', monospace;
    display: none;
    z-index: 999;
    animation: fadeIn 0.2s ease;
}

.toast.ok {
    border-color: #0d3d24;
    color: #6ee7b7;
}

.toast.err {
    border-color: #3d0d0d;
    color: #fca5a5;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
