:root {
    --bg-dark: #09090b;
    --card-bg: rgba(24, 24, 27, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --text-main: #f4f4f5;
    --text-dim: #a1a1aa;
    --error: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden; /* App scrolls inside .content */
}

/* ── LAYOUT ───────────────────────────────────────────────────── */

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    background: radial-gradient(circle at 50% 50%, #111116 0%, #09090b 100%);
    position: relative;
    z-index: 10;
}

.sidebar {
    width: 260px;
    background: rgba(15, 15, 20, 0.8);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--glass-border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    position: relative;
}

/* ── SIDEBAR ──────────────────────────────────────────────────── */

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 3rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.icon-box {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--accent-blue));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
}

.logo small {
    font-size: 0.6rem;
    background: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

.sidebar nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar nav a {
    text-decoration: none;
    color: var(--text-dim);
    padding: 12px 14px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: 0.2s;
}

.sidebar nav a:hover, .sidebar nav a.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.sidebar nav a.active {
    border-left: 3px solid var(--primary);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.green { background: var(--success); box-shadow: 0 0 8px var(--success); }
.dot.red { background: var(--error); box-shadow: 0 0 8px var(--error); }

/* ── TOP BAR ──────────────────────────────────────────────────── */

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.search-box {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    padding: 10px 18px;
    border-radius: 12px;
    width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box input {
    background: none;
    border: none;
    color: var(--text-main);
    width: 100%;
    outline: none;
}

.avatar {
    background: var(--primary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

/* ── DASHBOARD GRID ───────────────────────────────────────────── */

.dashboard-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    grid-template-rows: auto auto 1fr;
    gap: 1.5rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    backdrop-filter: blur(12px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-header h3 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── SEARCH PANEL ─────────────────────────────────────────────── */

.search-panel {
    grid-row: span 2;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.input-group input {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    padding: 12px;
    border-radius: 10px;
    color: white;
    outline: none;
}

.input-group input:focus {
    border-color: var(--primary);
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--accent-blue));
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.3);
}

/* ── STATS CARDS ──────────────────────────────────────────────── */

.stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.stats-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
}

.stats-card h2 { font-size: 2rem; margin-top: 4px; }
.stats-card i { font-size: 1.5rem; opacity: 0.5; color: var(--primary); }

/* ── TERMINAL ─────────────────────────────────────────────────── */

.console-card {
    grid-column: span 1;
}

.terminal-body {
    background: #000;
    height: 300px;
    border-radius: 12px;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.1);
}

.terminal-body p { margin-bottom: 4px; line-height: 1.4; }
.sys-msg { color: var(--text-dim); font-style: italic; }
.log-info { color: #818cf8; }
.log-warn { color: #fbbf24; }
.log-err { color: #f87171; }
.log-success { color: #34d399; }

/* ── TABLE ────────────────────────────────────────────────────── */

.table-card {
    grid-column: span 2;
}

.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 12px;
    color: var(--text-dim);
    font-size: 0.85rem;
    border-bottom: 1px solid var(--glass-border);
}

td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--glass-border);
}

.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-score { background: rgba(139, 92, 246, 0.2); color: var(--primary); }
.tag-hot { background: rgba(239, 68, 68, 0.2); color: var(--error); border: 1px solid rgba(239, 68, 68, 0.3);}

/* ── BACKGROUND ───────────────────────────────────────────────── */

.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.blob {
    position: absolute;
    width: 600px;
    height: 600px;
    background: var(--primary);
    filter: blur(140px);
    opacity: 0.15;
    border-radius: 50%;
    animation: move 20s infinite alternate;
}

.blob-1 { top: -100px; right: -100px; background: #6366f1; }
.blob-2 { bottom: -100px; left: -100px; background: #a855f7; animation-delay: -10s; }

@keyframes move {
    from { transform: translate(0, 0) scale(1.1); }
    to { transform: translate(50px, 50px) scale(0.9); }
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }
