/* Modern SaaS Dashboard Styles */
/* Professional Color Palette */
:root {
    /* Primary Colors */
    --primary-50: #f0f9ff;
    --primary-100: #e0f2fe;
    --primary-500: #0ea5e9;
    --primary-600: #0284c7;
    --primary-700: #0369a1;
    --primary-900: #0c4a6e;

    /* Success Colors (WhatsApp Green) */
    --success-50: #f0fdf4;
    --success-100: #dcfce7;
    --success-500: #22c55e;
    --success-600: #25d366;
    --success-700: #15803d;

    /* Warning Colors */
    --warning-50: #fffbeb;
    --warning-100: #fef3c7;
    --warning-500: #f59e0b;
    --warning-600: #d97706;

    /* Danger Colors */
    --danger-50: #fef2f2;
    --danger-100: #fee2e2;
    --danger-500: #ef4444;
    --danger-600: #dc2626;

    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout */
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 64px;
    --header-height: 72px;
}

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

body.dashboard-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Authentication Styles */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-900) 100%);
    padding: 2rem;
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: white;
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--gray-200);
}

.auth-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    background: var(--primary-50);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-600);
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--gray-600);
    margin-bottom: 2rem;
}

.auth-actions {
    display: flex;
    gap: 1rem;
    flex-direction: column;
}

/* Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    height: 100vh;
    background: var(--gray-50);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-normal);
    z-index: 10;
    position: relative;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: opacity var(--transition-fast);
}

.sidebar.collapsed .sidebar-brand .brand-text {
    display: none;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: var(--success-600);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-name {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--gray-900);
}

.brand-sub {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-toggle {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.sidebar-toggle:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.nav-list {
    list-style: none;
    padding: 0 1rem;
}

.nav-item {
    margin-bottom: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--gray-600);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.nav-link:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.nav-item.active .nav-link {
    background: var(--primary-50);
    color: var(--primary-700);
}

.nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1.125rem;
}

.sidebar.collapsed .nav-text {
    display: none;
}

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

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    transition: background var(--transition-fast);
}

.user-profile:hover {
    background: var(--gray-50);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-600);
    font-size: 0.875rem;
}

.user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.sidebar.collapsed .user-info {
    display: none;
}

.user-email {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-900);
}

.user-role {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.logout-btn {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.logout-btn:hover {
    background: var(--danger-100);
    color: var(--danger-600);
}

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

/* Top Header */
.top-header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-xs);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.mobile-menu-btn:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    text-align: right;
}

.stat-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-end;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background: var(--success-500);
}

.status-dot.offline {
    background: var(--gray-400);
}

.status-dot.connecting {
    background: var(--warning-500);
    animation: pulse 2s infinite;
}

/* Content Wrapper */
.content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

/* Content Sections */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

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

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.stat-card-icon.success {
    background: var(--success-500);
}

.stat-card-icon.primary {
    background: var(--primary-500);
}

.stat-card-icon.warning {
    background: var(--warning-500);
}

.stat-card-icon.danger {
    background: var(--danger-500);
}

.stat-card-content {
    flex: 1;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.25rem;
    color: var(--gray-900);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.stat-change {
    font-size: 0.75rem;
    font-weight: 500;
}

.stat-change.positive {
    color: var(--success-600);
}

.stat-change.negative {
    color: var(--danger-600);
}

.stat-change.neutral {
    color: var(--gray-500);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.dashboard-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.dashboard-card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 1.5rem 1.5rem 0;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.card-body {
    padding: 1.5rem;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.quick-action-btn {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--gray-700);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.quick-action-btn:hover {
    background: var(--primary-50);
    border-color: var(--primary-200);
    color: var(--primary-700);
}

.quick-action-btn i {
    font-size: 1.25rem;
}

.quick-action-btn span {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Health Metrics */
.health-metrics {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.health-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.health-item:last-child {
    border-bottom: none;
}

.health-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

.health-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

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

.status-indicator.online {
    background: var(--success-500);
}

.status-indicator.offline {
    background: var(--gray-400);
}

.status-indicator.checking {
    background: var(--warning-500);
    animation: pulse 2s infinite;
}

/* Connection Section */
.connection-container {
    max-width: 800px;
    margin: 0 auto;
}

.connection-card {
    background: white;
    border-radius: 16px;
    padding: 3rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    text-align: center;
}

.connection-header {
    margin-bottom: 3rem;
}

.connection-icon {
    width: 80px;
    height: 80px;
    background: var(--success-600);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
}

.connection-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.connection-subtitle {
    color: var(--gray-600);
    font-size: 1.125rem;
}

.connection-status {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    text-align: left;
}

.status-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.status-icon.offline {
    background: var(--gray-400);
}

.status-icon.connecting {
    background: var(--warning-500);
    animation: pulse 2s infinite;
}

.status-icon.online {
    background: var(--success-500);
}

.status-content {
    flex: 1;
}

.status-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.status-description {
    color: var(--gray-600);
}

/* QR Code Section */
.qr-section {
    margin-top: 2rem;
}

.qr-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.qr-code-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
}

.qr-code {
    max-width: 280px;
    border: 3px solid var(--success-600);
    border-radius: 12px;
    padding: 1rem;
    background: white;
    box-shadow: var(--shadow-lg);
}

.qr-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    pointer-events: none;
}

.scanning-animation {
    position: relative;
    width: 100%;
    height: 100%;
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--success-500), transparent);
    animation: scan 2s linear infinite;
}

@keyframes scan {
    0% { transform: translateY(0); }
    100% { transform: translateY(280px); }
}

.qr-instructions {
    text-align: left;
}

.qr-instructions h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.instruction-steps {
    list-style: none;
    padding: 0;
}

.instruction-steps li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.instruction-steps li:last-child {
    border-bottom: none;
}

.instruction-steps li::before {
    content: counter(step-counter);
    counter-increment: step-counter;
    background: var(--primary-500);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.instruction-steps {
    counter-reset: step-counter;
}

/* Success Section */
.success-section {
    margin-top: 2rem;
}

.success-animation {
    width: 80px;
    height: 80px;
    background: var(--success-500);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
    animation: successPulse 1s ease-out;
}

@keyframes successPulse {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Messaging Section */
.messaging-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.messaging-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

/* Modern Form Styles */
.modern-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 1rem;
    color: var(--gray-500);
    font-weight: 500;
    z-index: 2;
    pointer-events: none;
}

.form-control-modern {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    background: white;
    color: var(--gray-900);
}

.input-group .form-control-modern {
    padding-left: 2.5rem;
}

.form-control-modern:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgb(14 165 233 / 0.1);
}

.form-control-modern::placeholder {
    color: var(--gray-400);
}

.form-help {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.character-count {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-align: right;
}

.contact-stats {
    font-size: 0.875rem;
    color: var(--primary-600);
    font-weight: 500;
}

/* Range Slider */
.options-grid {
    display: grid;
    gap: 1rem;
}

.option-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-item label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

.range-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--gray-200);
    outline: none;
    -webkit-appearance: none;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-500);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.range-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-500);
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-sm);
}

.range-value {
    font-size: 0.875rem;
    color: var(--primary-600);
    font-weight: 600;
}

/* Buttons */
.btn-primary-modern,
.btn-secondary-modern,
.btn-warning-modern,
.btn-connect-primary {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--transition-fast);
    text-decoration: none;
    min-height: 44px;
}

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

.btn-primary-modern:hover:not(:disabled) {
    background: var(--primary-700);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary-modern {
    background: transparent;
    color: var(--primary-600);
    border: 1px solid var(--primary-600);
}

.btn-secondary-modern:hover:not(:disabled) {
    background: var(--primary-50);
}

.btn-warning-modern {
    background: var(--warning-500);
    color: white;
}

.btn-warning-modern:hover:not(:disabled) {
    background: var(--warning-600);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-connect-primary {
    background: var(--success-600);
    color: white;
    font-size: 1rem;
    padding: 1rem 2rem;
}

.btn-connect-primary:hover:not(:disabled) {
    background: var(--success-700);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* Bulk Results */
.bulk-results {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}

.results-card {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.results-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.results-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
}

.close-results {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.close-results:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.results-summary {
    padding: 1.5rem;
    background: var(--primary-50);
    border-bottom: 1px solid var(--primary-200);
}

.results-details {
    padding: 1.5rem;
    max-height: 50vh;
    overflow-y: auto;
}

.message-result {
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.message-result:last-child {
    margin-bottom: 0;
}

.message-result.message-success {
    background: var(--success-50);
    color: var(--success-700);
    border: 1px solid var(--success-200);
}

.message-result.message-error {
    background: var(--danger-50);
    color: var(--danger-700);
    border: 1px solid var(--danger-200);
}

/* Feature Notes */
.feature-note {
    text-align: center;
    color: var(--gray-500);
    font-style: italic;
    padding: 4rem 2rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-left-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading-overlay p {
    color: var(--gray-600);
    font-weight: 500;
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        z-index: 20;
        transition: left var(--transition-normal);
    }
    
    .sidebar.mobile-open {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .content-wrapper {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .messaging-container {
        grid-template-columns: 1fr;
    }
    
    .qr-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .connection-card {
        padding: 2rem;
    }
    
    .header-stats {
        display: none;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .auth-card {
        padding: 2rem 1.5rem;
    }
    
    .auth-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .content-wrapper {
        padding: 0.5rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .connection-card {
        padding: 1.5rem;
    }
    
    .top-header {
        padding: 0 1rem;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
}