/* ===== ADMIN DASHBOARD STYLES ===== */
/* Using the same CSS custom properties from your original CSS */

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

:root {
    /* Primary Color Palette */
    --primary-dark: #071a27;
    --primary-blue: #0e6b88;
    --primary-darker: #05121c;
    --primary-light: #f0f9ff;
    
    /* Accent Colors */
    --accent-teal: #66d0e8;
    --accent-light: #8fe6ff;
    --accent-bright: #bff3ff;
    --accent-dark: #4a9fb5;
    
    /* Neutral Colors */
    --text-light: #f6ded4;
    --text-lighter: #eaf6ff;
    --text-muted: #a8c5d6;
    --text-dark: #2c3e50;
    
    /* Semantic Colors */
    --success-green: #28a745;
    --success-light: #34ce57;
    --danger-red: #dc3545;
    --danger-light: #e74c3c;
    --warning-orange: #ffc107;
    --warning-light: #ffd54f;
    --info-blue: #17a2b8;
    --info-light: #5bc0de;
    
    /* Background Colors */
    --bg-body: var(--primary-dark);
    --bg-surface: rgba(255, 255, 255, 0.05);
    --bg-surface-hover: rgba(255, 255, 255, 0.08);
    --bg-card: rgba(255, 255, 255, 0.08);
    --bg-header: rgba(7, 26, 39, 0.9);
    --bg-input: rgba(0, 0, 0, 0.2);
    
    /* Border Colors */
    --border-primary: rgba(143, 230, 255, 0.2);
    --border-secondary: rgba(143, 230, 255, 0.1);
    --border-light: rgba(255, 255, 255, 0.1);
    
    /* Text Colors */
    --text-primary: var(--text-lighter);
    --text-secondary: var(--text-light);
    --text-accent: var(--accent-light);
    --text-inverse: var(--primary-dark);
    
    /* Gradient Definitions */
    --gradient-primary: linear-gradient(135deg, var(--accent-teal), var(--primary-blue));
    --gradient-primary-hover: linear-gradient(135deg, var(--accent-light), var(--accent-teal));
    --gradient-dark: linear-gradient(180deg, var(--primary-blue), var(--primary-dark));
    --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    --gradient-surface: var(--gradient-card);
    
    /* Shadow System */
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 6px 20px rgba(0, 0, 0, 0.15);
    --shadow-strong: 0 10px 30px rgba(102, 208, 232, 0.25);
    --shadow-glow: 0 0 20px rgba(143, 230, 255, 0.3);
    --shadow-hover: 0 8px 25px rgba(102, 208, 232, 0.35);
    --shadow-card: 0 4px 15px rgba(0, 0, 0, 0.1);
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Borders */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-pill: 50px;
    --radius-full: 50%;
    
    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout */
    --header-height: 70px;
    --sidebar-width: 250px;
    --container-max-width: 1200px;
    --container-padding: var(--space-lg);
}

/* LIGHT MODE OVERRIDES */
[data-theme="light"] {
    /* Backgrounds */
    --bg-body: #f3f4f6;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f9fafb;
    --bg-card: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.9);
    --bg-input: #f9fafb;

    /* Text */
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --text-accent: #0e6b88;
    --text-inverse: #ffffff;

    /* Borders & Shadows */
    --border-primary: #e5e7eb;
    --border-secondary: #f3f4f6;
    --border-light: #e5e7eb;
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-strong: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Gradients */
    --gradient-surface: linear-gradient(145deg, #ffffff, #f9fafb);
    --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.8), rgba(255,255,255,0.6));
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border: 2px solid transparent;
    border-radius: var(--radius-pill);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
    font-size: 0.9rem;
}

.btn i {
    font-size: 1em;
}

/* Primary Button (Create Signal) */
.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
    background: var(--gradient-primary-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

/* Outline Button (Logout) */
.btn-outline {
    background: transparent;
    border-color: var(--border-primary);
    color: var(--text-accent);
}

.btn-outline:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: white;
}

.btn-small {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.875rem;
}

body {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-body);
    overflow-x: hidden;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== DASHBOARD HEADER ===== */
.dashboard-header {
    background: var(--bg-header);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-primary);
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
}

.nav-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    text-decoration: none;
    color: inherit;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    color: white;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-text h2 {
    font-size: 1rem;
    color: var(--accent-light);
    margin: 0;
    line-height: 1.2;
}

.logo-text small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dashboard-nav {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.notification-badge {
    background: var(--danger-red);
    color: white;
    border-radius: var(--radius-full);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    position: relative;
}

/* ===== DASHBOARD LAYOUT ===== */
.dashboard-wrapper {
    display: flex;
    min-height: calc(100vh - var(--header-height));
}

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0; /* ADD THIS: Prevents sidebar from squashing */
    background: var(--bg-surface);
    border-right: 1px solid var(--border-primary);
    position: sticky; /* Optional: keeps sidebar visible while scrolling */
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--transition-fast);
    position: relative;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: var(--bg-surface-hover);
    color: var(--text-accent);
    border-left-color: var(--accent-teal);
}

.sidebar-link.active {
    background: var(--bg-surface-hover);
    color: var(--text-accent);
    border-left-color: var(--accent-teal);
}

.sidebar-link i {
    width: 20px;
    text-align: center;
}

.sidebar-link .badge {
    margin-left: auto;
    background: var(--danger-red);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.dashboard-content {
    flex: 1;
    padding: var(--space-xl);
    overflow-y: auto;
}

.admin-section {
    display: block;
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-lg);
}

.page-title {
    color: var(--accent-light);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin: 0;
}

.page-title i {
    color: var(--accent-teal);
}

.filter-tabs {
    display: flex;
    gap: var(--space-xs);
    background: var(--bg-surface);
    padding: var(--space-xs);
    border-radius: var(--radius-lg);
}

.filter-btn {
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-accent);
}

.filter-btn.active {
    background: var(--accent-teal);
    color: var(--primary-dark);
    font-weight: 600;
}

/* ===== TABLE CONTAINER ===== */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    backdrop-filter: blur(10px);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th {
    background: var(--bg-surface);
    color: var(--text-accent);
    padding: var(--space-md);
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-light);
}

.data-table td {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.data-table tr:hover {
    background: var(--bg-surface-hover);
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: var(--space-2xs) var(--space-sm);
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.role-badge.admin {
    background: linear-gradient(135deg, var(--danger-red), var(--warning-orange));
    color: white;
}

.role-badge.member {
    background: linear-gradient(135deg, var(--accent-teal), var(--info-blue));
    color: var(--primary-dark);
}

.status-badge.status-active {
    background: var(--success-green);
    color: white;
}

.status-badge.status-disabled {
    background: var(--danger-red);
    color: white;
}

.status-badge.status-pending {
    background: var(--warning-orange);
    color: var(--text-dark);
}

/* ===== ACTIONS ===== */
.actions {
    display: flex;
    gap: var(--space-xs);
}

.actions .btn {
    padding: var(--space-2xs) var(--space-sm);
    font-size: 0.75rem;
    min-width: auto;
}

/* ===== FORM CONTAINER ===== */
.form-container {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    backdrop-filter: blur(10px);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: var(--space-md);
    background: var(--bg-input);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all var(--transition-fast);
    backdrop-filter: blur(10px);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-light);
    box-shadow: 0 0 0 3px rgba(143, 230, 255, 0.1);
    background: var(--bg-surface);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.checkbox-group input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-light);
}

.checkbox-group label {
    margin: 0;
    color: var(--text-muted);
    font-weight: normal;
}

/* ===== CHAT CONTAINER ===== */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 75vh; /* Fixed height relative to viewport */
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

/* Ensure messages can actually scroll */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Mobile View Simulation */
.chat-container.mobile-view {
    max-width: 375px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: 700px;
    border: 12px solid #1a1a1a;
    border-radius: 30px;
    box-shadow: 0 0 0 2px #333, 0 20px 40px rgba(0,0,0,0.4);
}

.chat-container.mobile-view .chat-users {
    display: none; /* Hide user list in phone view to focus on chat interface */
}

.chat-container.mobile-view .chat-box {
    border: none;
    border-radius: 0;
}

.chat-users {
    background: var(--bg-surface);
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: hidden;
    display: none; /* Hidden by default, toggled via button */
}

.chat-users-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-primary);
}

.chat-users-header h4 {
    color: var(--accent-light);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.chat-user-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-sm);
}

.chat-user-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: var(--space-xs);
}

.chat-user-item:hover {
    background: var(--bg-surface-hover);
}

.chat-user-item.active-user {
    background: rgba(102, 208, 232, 0.15);
    border-left: none;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.chat-box {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.chat-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-surface);
}

.chat-partner-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.chat-partner-info strong {
    color: var(--accent-light);
}

.chat-partner-info small {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.chat-messages {
    flex: 1;
    padding: var(--space-lg);
    overflow-y: auto;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 0;
    scroll-behavior: smooth;
}

/* Message Styles (Matched to User Chat) */
.message {
    display: flex;
    margin-bottom: 15px;
}

.message.sent {
    justify-content: flex-end;
}

.message.received {
    justify-content: flex-start;
}

.message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    font-size: 0.95rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.message.sent .message-content {
    background: var(--gradient-primary);
    color: white;
    border-top-right-radius: 0;
    border-bottom-right-radius: 18px;
}

.message.received .message-content {
    background: var(--bg-card);
    color: var(--text-primary);
    border-top-left-radius: 0;
    border-bottom-left-radius: 18px;
    border: none;
}

.message-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: right;
}

.empty-chat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
}

.empty-chat i {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.chat-input {
    padding: var(--space-lg);
    border-top: 1px solid var(--border-primary);
    background: var(--bg-surface);
}

.input-group {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.input-group input {
    flex: 1;
    padding: 12px 20px;
    border-radius: 30px;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
}

.input-group .btn {
    border-radius: 50%;
    width: 42px;
    height: 42px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-upload-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.file-upload-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-accent);
}

.typing-indicator {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-style: italic;
}

.edit-msg-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 0.7rem;
    margin-left: 8px;
    padding: 2px;
}
.edit-msg-btn:hover { color: var(--accent-teal); }

.delete-msg-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 0.7rem;
    margin-left: 5px;
    padding: 2px;
}
.delete-msg-btn:hover { color: var(--danger-red); }

/* Chat View Toggling Classes */
.chat-container.show-users-list .chat-users {
    display: flex;
}

.chat-container.show-users-list .chat-box {
    display: none;
}


/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    animation: modalFadeIn var(--transition-normal);
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--gradient-glass);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    box-shadow: var(--shadow-strong);
    backdrop-filter: blur(20px);
    animation: modalSlideIn var(--transition-normal);
}

@keyframes modalSlideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content.small {
    max-width: 400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xl);
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-surface);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-header h3 {
    color: var(--accent-light);
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(220, 53, 69, 0.2);
    color: var(--danger-red);
}

.modal-body {
    padding: var(--space-xl);
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
    padding: var(--space-xl);
    border-top: 1px solid var(--border-primary);
    background: var(--bg-surface);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* File upload area */
.file-upload-area {
    border: 2px dashed var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: var(--space-md);
}

.file-upload-area:hover {
    border-color: var(--accent-light);
    background: var(--bg-surface);
}

.file-upload-area i {
    font-size: 2rem;
    color: var(--accent-teal);
    margin-bottom: var(--space-md);
}

.file-upload-area p {
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.image-preview {
    display: none;
    margin-top: var(--space-md);
}

.image-preview img {
    max-width: 200px;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-primary);
}

/* ===== TRADINGVIEW PANEL ===== */
.tv-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.quick-pairs {
    display: flex;
    gap: var(--space-sm);
}

.pair-input {
    display: flex;
    gap: var(--space-sm);
    min-width: 300px;
}

.tv-wrapper {
    background: var(--bg-body);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-primary);
    height: 80vh;
}

/* ===== TOAST NOTIFICATION ===== */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: var(--space-lg) var(--space-xl);
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-strong);
    z-index: 1001;
    max-width: 400px;
    transform: translateX(400px);
    transition: transform var(--transition-normal);
    backdrop-filter: blur(10px);
}

.toast.show {
    transform: translateX(0);
}

/* ===== MOBILE SIDEBAR ===== */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: var(--space-sm);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: var(--bg-header);
    border-right: 1px solid var(--border-primary);
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-strong);
}

.mobile-sidebar.active {
    transform: translateX(0);
}

.mobile-sidebar-header {
    padding: var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-primary);
}

.mobile-sidebar-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-nav {
    padding: var(--space-md);
    overflow-y: auto;
    flex: 1;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-xs);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.mobile-nav-link:hover, .mobile-nav-link.active {
    background: var(--bg-surface-hover);
    color: var(--accent-teal);
}

.mobile-nav-divider {
    height: 1px;
    background: var(--border-primary);
    margin: var(--space-md) 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .dashboard-wrapper {
        flex-direction: column;
    }

    /* Clean up Header on Mobile */
    .dashboard-nav #logoutAdmin,
    .dashboard-nav #themeToggle {
        display: none;
    }

    .logo-text h2 {
        font-size: 1rem;
    }

    .logo-text small {
        display: none;
    }

    .nav-container {
        padding: 0 var(--space-md);
    }

    .mobile-menu-btn {
        display: block;
    }
    
    .sidebar {
        display: none; /* Hide desktop sidebar on mobile */
    }
    
    .chat-container {
        display: flex;
        flex-direction: column;
        height: 80vh; 
    }

    .chat-box {
        flex: 1;
        min-height: 0;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tv-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .pair-input {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .dashboard-content {
        padding: var(--space-md);
    }
    
    .table-container,
    .form-container {
        padding: var(--space-md);
    }
    
    .modal-body {
        padding: var(--space-lg);
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--accent-teal);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--accent-light);
}

/* User List Scrollbar */
.chat-user-list::-webkit-scrollbar {
    width: 6px;
}

.chat-user-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.chat-user-list::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 3px;
}

.chat-user-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent-teal);
}