/* Core Design Tokens & Variables - Red & Dark Mode / White & Red Light Mode */
:root, [data-theme="dark"] {
    --bg-main: #090a10;
    --bg-gradient-1: rgba(239, 68, 68, 0.12);
    --bg-gradient-2: rgba(220, 38, 38, 0.08);
    --bg-gradient-3: rgba(15, 16, 24, 0.98);
    
    --bg-card: rgba(17, 18, 28, 0.85);
    --bg-card-hover: rgba(26, 28, 42, 0.95);
    --bg-input: rgba(10, 11, 18, 0.7);
    --border-color: rgba(239, 68, 68, 0.2);
    --border-glow: rgba(239, 68, 68, 0.4);
    
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    --color-primary: #ef4444;
    --color-primary-hover: #dc2626;
    --color-primary-glow: rgba(239, 68, 68, 0.45);

    --color-emerald: #10b981;
    --color-emerald-glow: rgba(16, 185, 129, 0.4);
    --color-violet: #ef4444;
    --color-violet-glow: rgba(239, 68, 68, 0.45);
    
    --color-warning: #f59e0b;
    --color-warning-glow: rgba(245, 158, 11, 0.3);
    --color-danger: #ef4444;
    --color-danger-glow: rgba(239, 68, 68, 0.3);
    --color-info: #3b82f6;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    
    --shadow-main: 0 10px 35px 0 rgba(0, 0, 0, 0.6);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-main: #ffffff;
    --bg-gradient-1: rgba(239, 68, 68, 0.05);
    --bg-gradient-2: rgba(254, 226, 226, 0.6);
    --bg-gradient-3: #f8fafc;
    
    --bg-card: #ffffff;
    --bg-card-hover: #fef2f2;
    --bg-input: #ffffff;
    --border-color: rgba(220, 38, 38, 0.18);
    --border-glow: rgba(220, 38, 38, 0.3);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --color-primary: #dc2626;
    --color-primary-hover: #b91c1c;
    --color-primary-glow: rgba(220, 38, 38, 0.25);

    --color-emerald: #16a34a;
    --color-emerald-glow: rgba(22, 163, 74, 0.3);
    --color-violet: #dc2626;
    --color-violet-glow: rgba(220, 38, 38, 0.3);
    
    --color-warning: #d97706;
    --color-warning-glow: rgba(217, 119, 6, 0.2);
    --color-danger: #dc2626;
    --color-danger-glow: rgba(220, 38, 38, 0.2);
    --color-info: #2563eb;

    --shadow-main: 0 10px 30px 0 rgba(220, 38, 38, 0.08), 0 2px 10px 0 rgba(0, 0, 0, 0.04);
}

/* Reset and Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 0% 0%, var(--bg-gradient-1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, var(--bg-gradient-2) 0px, transparent 50%),
        radial-gradient(at 50% 100%, var(--bg-gradient-3) 0px, transparent 80%);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    overflow: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* App Container Layout */
.app-container {
    width: 100%;
    max-width: 1600px;
    height: 100vh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    animation: fadeIn 0.4s ease-out;
    overflow: hidden;
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #ef4444, #991b1b);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 0 18px rgba(239, 68, 68, 0.45);
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-primary);
}

header .subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-toggle-btn {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-fast);
}

.theme-toggle-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--color-primary);
    transform: translateY(-1px);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
}

.user-badge i {
    color: var(--color-primary);
    width: 15px;
    height: 15px;
}

/* Main Content Grid */
main {
    flex: 1;
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 1.5rem;
    min-height: 0;
}

/* Sidebar Section (Sessions) */
.sessions-section {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-main);
    height: 100%;
}

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

.section-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.section-header h2 i {
    color: var(--color-violet);
}

.badge {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #c084fc;
    padding: 2px 10px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.sessions-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Scrollbars */
.sessions-list::-webkit-scrollbar,
.detail-body::-webkit-scrollbar {
    width: 6px;
}
.sessions-list::-webkit-scrollbar-track,
.detail-body::-webkit-scrollbar-track {
    background: transparent;
}
.sessions-list::-webkit-scrollbar-thumb,
.detail-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Session Items */
.session-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    cursor: pointer;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.session-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: transparent;
    transition: var(--transition-fast);
}

.session-item:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}

.session-item.active {
    background: rgba(139, 92, 246, 0.04);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.05);
}

.session-item.active::before {
    background: var(--color-violet);
}

.session-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.session-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.session-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Status Pills */
.status-pill {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.status-pill::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.status-pill.connected {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-emerald);
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.status-pill.connected::before {
    background: var(--color-emerald);
    box-shadow: 0 0 8px var(--color-emerald);
    animation: pulse 1.5s infinite alternate;
}

.status-pill.connecting {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-info);
    border: 1px solid rgba(59, 130, 246, 0.2);
}
.status-pill.connecting::before {
    background: var(--color-info);
}

.status-pill.pairing_code {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}
.status-pill.pairing_code::before {
    background: var(--color-warning);
    animation: pulse 1.5s infinite alternate;
}

.status-pill.disconnected, .status-pill.offline {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.status-pill.disconnected::before, .status-pill.offline::before {
    background: var(--text-muted);
}

/* Workspace Section */
.workspace-section {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.workspace-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    flex: 1;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-main);
    overflow: hidden;
}

.welcome-card {
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
}

.welcome-icon {
    width: 64px;
    height: 64px;
    color: var(--color-emerald);
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.2));
}

.welcome-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.welcome-card p {
    color: var(--text-secondary);
    max-width: 540px;
    line-height: 1.6;
    font-size: 0.95rem;
}

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

.detail-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.status-badge-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-body {
    flex: 1;
    overflow-y: auto;
    height: auto;
    padding: 2rem;
}

.card-group {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-group h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-group h4 i {
    color: var(--color-emerald);
}

.group-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

/* Switch Styles (Individuals vs Groups Toggles) */
.toggle-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.toggle-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.toggle-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.toggle-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.toggle-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    flex-shrink: 0;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border: 1px solid var(--border-color);
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--color-emerald);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
    border-color: rgba(16, 185, 129, 0.5);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Forms */
.form-control {
    margin-bottom: 1.25rem;
}

.form-control label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-control input,
.form-control textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.form-control input:focus,
.form-control textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 12px var(--color-primary-glow);
}

.form-control small {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.35);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(239, 68, 68, 0.5);
}

.btn-secondary {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--color-primary);
    color: var(--text-primary);
}

.btn-success {
    background: linear-gradient(135deg, var(--color-emerald), #047857);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}
.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: transparent;
    border: 1px solid var(--color-danger);
    color: var(--color-danger);
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.btn-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
}
.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: var(--transition-normal);
    overflow-y: auto;
    padding: 2rem 1rem;
}


.modal {
    background: #0f172a;
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 520px;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}
.btn-close:hover {
    color: white;
}

.modal-body {
    padding: 1.5rem;
}

.code-display {
    animation: fadeIn 0.3s ease-out;
}

.divider {
    height: 1px;
    background: var(--border-color);
    margin: 1.5rem 0;
}

.instruction-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.pairing-code-container {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

#pairing-code-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--color-emerald);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.status-update-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Authentication Screen Overlay */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-main);
    background-image: 
        radial-gradient(at 0% 0%, rgba(139, 92, 246, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.12) 0px, transparent 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    transition: var(--transition-normal);
    overflow-y: auto;
    padding: 2rem 1rem;
}


.auth-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-main);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-icon-lg {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--color-emerald), var(--color-violet));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin: 0 auto 1.25rem;
    font-size: 1.8rem;
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.3);
}

.auth-header h2 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 0.25rem;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.auth-switch {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 1.5rem;
}

.auth-switch a {
    color: var(--color-violet);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-fast);
}

.auth-switch a:hover {
    color: #a78bfa;
    text-decoration: underline;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-top: 1rem;
}
.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--color-emerald);
}
.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--color-danger);
}

/* Spinners */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-top: 3px solid var(--color-violet);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 2rem auto 1rem;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.05);
    border-top: 2px solid var(--color-emerald);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.hidden {
    display: none !important;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    100% { transform: scale(1.1); opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

.diagnostics-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.diagnostics-actions .btn {
    flex: 1;
    min-width: 160px;
}

.api-key-sidebar {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
}

.api-key-header {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.api-key-header i {
    color: var(--color-violet);
    width: 14px;
    height: 14px;
}

.api-key-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.api-key-container input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-primary);
    outline: none;
}

.btn-api-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-api-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.method-selector button {
    flex: 1;
    text-align: center;
    border-radius: 4px !important;
    transition: var(--transition-fast);
}

.method-selector button.active {
    background: var(--color-violet) !important;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
    color: white !important;
    border-color: rgba(139, 92, 246, 0.3) !important;
}

/* Statistics Grid and Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: var(--transition-normal);
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i {
    width: 20px;
    height: 20px;
}

.stat-icon.sent {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-emerald);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.stat-icon.received {
    background: rgba(139, 92, 246, 0.1);
    color: var(--color-violet);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.stat-details {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

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

/* Responsive Design & Mobile Scrolling Fixes */
@media (max-width: 900px) {
    body {
        overflow-x: hidden;
        overflow-y: auto;
        height: auto;
        min-height: 100vh;
    }

    .app-container {
        height: auto;
        min-height: 100vh;
        padding: 1rem;
        overflow: visible;
    }

    main {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
        gap: 1.5rem;
    }

    .sessions-section {
        height: auto;
        max-height: 450px;
    }

    .workspace-section {
        height: auto;
    }

    .workspace-card {
        height: auto;
        min-height: auto;
        overflow: visible;
    }

    .detail-body {
        overflow-y: visible;
        height: auto;
        padding: 1.5rem 1rem;
    }
}

@media (max-height: 640px) {
    .auth-overlay, .modal-overlay {
        align-items: flex-start;
    }
}

/* Admin Dashboard Table & Additional Styles */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-top: 1rem;
}

.admin-sessions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.admin-sessions-table th, 
.admin-sessions-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.admin-sessions-table th {
    background: rgba(255, 255, 255, 0.02);
    font-weight: 600;
    color: var(--text-secondary);
}

.admin-sessions-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-sessions-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.01);
}

.btn-warning {
    background: linear-gradient(135deg, var(--color-amber), #d97706);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.2);
}

.btn-warning:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
}

.badge-admin-client-item {
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
}

