:root {
    --primary: #213874;
    --primary-light: #3a55a0;
    --secondary: #f3ab1b;
    --secondary-dark: #b45309;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --danger: #ef4444;
    --success: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.logo {
    padding: 24px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.logo i {
    color: var(--secondary);
    font-size: 1.8rem;
}

nav {
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 8px;
}

.nav-btn {
    background: transparent;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.nav-btn:hover {
    background: rgba(33, 56, 116, 0.05);
    color: var(--primary);
}

.nav-btn.active {
    background: var(--primary);
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

header {
    background: var(--surface);
    padding: 20px 32px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    font-weight: 600;
    color: var(--text-muted);
}

.view {
    display: none;
    padding: 32px;
}

.view.active {
    display: block;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.stat-card {
    background: linear-gradient(145deg, #ffffff, #f0f4f8);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid rgba(255,255,255,0.8);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: rgba(243, 171, 27, 0.1);
    color: var(--secondary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Cards & Layout */
.card {
    background: var(--surface);
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

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

.btn-primary {
    background: var(--primary);
    color: white;
}

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

.btn-secondary {
    background: #e2e8f0;
    color: var(--text);
}

.btn-secondary:hover {
    background: #cbd5e1;
}

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

.btn-danger:hover {
    opacity: 0.9;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

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

/* Session Item */
.session-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.session-id {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-badge.connected { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.status-badge.qr { background: rgba(243, 171, 27, 0.1); color: var(--secondary-dark); }
.status-badge.disconnected { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.status-badge.initializing { background: rgba(100, 116, 139, 0.1); color: var(--text-muted); }

.qr-container {
    text-align: center;
    padding: 10px;
    background: #f8fafc;
    border-radius: 8px;
    margin: 15px 0;
}

.qr-container img {
    max-width: 100%;
    border-radius: 8px;
}

/* Toasts */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.toast {
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-weight: 600;
    transition: all 0.3s ease;
}

.toast.error {
    background: var(--danger);
}
