:root {
    --primary: #25d366;
    --primary-hover: #1da851;
    --bg-black: #000000;
    --bg-dark: #0a0a0a;
    --bg-card: #141414;
    --sidebar-width: 280px;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --border: #222222;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-hover: rgba(255, 255, 255, 0.06);
}

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

body {
    background: var(--bg-black);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; }

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-black);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
}

.sidebar-header {
    padding: 1rem 2rem 2.5rem;
}

.logo-big {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.logo-big i { color: var(--primary); }

.sidebar-nav { flex: 1; }

.sidebar-nav ul { list-style: none; }

.sidebar-nav a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.sidebar-nav a i { font-size: 1.1rem; width: 24px; text-align: center; }

.sidebar-nav a:hover {
    color: white;
    background: var(--glass-hover);
}

.sidebar-nav a.active {
    color: white;
    background: rgba(37, 211, 102, 0.08);
}

.sidebar-nav a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--primary);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
}

.user-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: black;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 3rem;
    background: radial-gradient(circle at top right, #111 0%, #000 50%);
}

.page-header { margin-bottom: 3rem; }
.page-header h2 { font-size: 2.2rem; font-weight: 700; margin-bottom: 0.5rem; }
.page-header p { color: var(--text-muted); }

/* Glass Panel */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    transition: transform 0.3s ease;
}

/* Grid Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-label { color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }
.stat-value { font-size: 2rem; font-weight: 800; }
.stat-trend { font-size: 0.8rem; color: var(--primary); display: flex; align-items: center; gap: 0.3rem; }

/* Pairing Screen */
.pairing-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2.5rem;
}

.steps-list { display: flex; flex-direction: column; gap: 2rem; }
.step-row { display: flex; gap: 1.5rem; align-items: flex-start; }
.step-idx {
    width: 36px;
    height: 36px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.qr-wrapper {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 350px;
}

.qr-image { width: 100%; max-width: 250px; }

/* Console */
.terminal {
    background: #000;
    border: 1px solid #222;
    border-radius: 12px;
    padding: 1.2rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    margin-top: 2rem;
    height: 200px;
    overflow-y: auto;
}

.term-line { margin-bottom: 0.4rem; color: #555; }
.term-line .time { color: #333; margin-right: 0.8rem; }
.term-line .msg { color: #888; }

/* Buttons */
.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.btn-primary { background: var(--primary); color: black; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); }

.btn-outline { background: transparent; border: 1px solid var(--border); color: white; }
.btn-outline:hover { background: var(--glass-hover); }

/* Tables */
.table-wrapper { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 1.2rem; color: var(--text-muted); font-weight: 500; font-size: 0.85rem; border-bottom: 1px solid var(--border); }
td { padding: 1.2rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
tr:hover td { background: var(--glass); }

/* Status Badges */
.badge { padding: 0.3rem 0.8rem; border-radius: 6px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; }
.badge-success { background: rgba(37, 211, 102, 0.1); color: var(--primary); }
.badge-pending { background: rgba(255, 193, 7, 0.1); color: #ffc107; }

/* Inputs */
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; color: var(--text-muted); font-size: 0.9rem; }
.form-input {
    width: 100%;
    background: #0a0a0a;
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: 10px;
    color: white;
    outline: none;
    transition: border-color 0.3s;
}
.form-input:focus { border-color: var(--primary); }

/* Loader */
.loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
