/* Bot Manager — custom styles (layered on Bootstrap 5) */

:root {
    --sidebar-width: 250px;
    --sidebar-bg: #212529;
    --sidebar-active: #0d6efd;
}

body {
    min-height: 100vh;
    background: #f8f9fa;
}

/* ── Sidebar ──────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    color: #ced4da;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1030;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 1.25rem 1rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    display: flex;
    align-items: center;
    gap: .5rem;
}

.sidebar .nav-link {
    color: #adb5bd;
    padding: .65rem 1rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .9rem;
    border-left: 3px solid transparent;
    transition: all .15s;
}

.sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .05);
}

.sidebar .nav-link.active {
    color: #fff;
    background: rgba(13, 110, 253, .15);
    border-left-color: var(--sidebar-active);
}

.sidebar .nav-link .bi {
    font-size: 1.1rem;
    width: 1.4rem;
    text-align: center;
}

/* ── Main content area ────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.top-bar {
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: .75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.top-bar h1 {
    font-size: 1.2rem;
    margin: 0;
    font-weight: 600;
}

.content-area {
    padding: 1.5rem;
}

/* ── Dashboard cards ──────────────────────────────────── */
.stat-card {
    border: none;
    border-radius: .5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.stat-card .card-body {
    padding: 1.25rem;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: .5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: .8rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* ── Tables ───────────────────────────────────────────── */
.table-card {
    border: none;
    border-radius: .5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    overflow: hidden;
}

.table-card .card-header {
    background: #fff;
    font-weight: 600;
    border-bottom: 1px solid #dee2e6;
}

/* ── Status badges ────────────────────────────────────── */
.badge-running {
    background: #0dcaf0;
}

.badge-success {
    background: #198754;
}

.badge-failed {
    background: #dc3545;
}

.badge-stopped {
    background: #6c757d;
}

/* ── Login page ───────────────────────────────────────── */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #212529, #343a40);
}

.login-card {
    width: 100%;
    max-width: 400px;
    border: none;
    border-radius: .75rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .2);
}

/* ── Notification bell ────────────────────────────────── */
.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: .65rem;
    padding: .2em .5em;
}

/* ── Log output ───────────────────────────────────────── */
/* ── Log viewer ────────────────────────────────────────── */
.log-view {
    background: #0f172a;
    border-radius: .5rem;
    max-height: 560px;
    overflow-y: auto;
    padding: .4rem 0;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: .8rem;
    line-height: 1.5;
}

.log-line {
    display: flex;
    gap: .7rem;
    align-items: baseline;
    padding: .16rem 1rem;
    border-left: 3px solid transparent;
}

.log-line:hover {
    background: rgba(255, 255, 255, .04);
}

.log-time {
    color: #64748b;
    white-space: nowrap;
    flex-shrink: 0;
}

.log-level {
    flex-shrink: 0;
    text-transform: uppercase;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .04em;
    padding: .06rem .42rem;
    border-radius: .3rem;
    white-space: nowrap;
}

.log-msg {
    color: #e2e8f0;
    white-space: pre-wrap;
    word-break: break-word;
    flex: 1;
}

.log-level-info {
    color: #38bdf8;
    background: rgba(56, 189, 248, .14);
}

.log-level-warning {
    color: #fbbf24;
    background: rgba(251, 191, 36, .16);
}

.log-line-warning {
    border-left-color: #f59e0b;
}

.log-level-error,
.log-level-critical {
    color: #f87171;
    background: rgba(248, 113, 113, .16);
}

.log-line-error,
.log-line-critical {
    border-left-color: #ef4444;
    background: rgba(248, 113, 113, .06);
}

.log-raw {
    color: #94a3b8;
    white-space: pre-wrap;
    word-break: break-word;
    padding: .02rem 1rem .02rem 2.4rem;
}

.log-empty {
    color: #94a3b8;
    text-align: center;
    padding: 2.5rem 1rem;
}