/* ============================================
   Meet Panel — Design System
   ============================================ */

/* -- Reset -- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif; line-height: 1.5; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img, video { max-width: 100%; display: block; }
table { border-collapse: collapse; width: 100%; }

/* -- Dark Theme (default) -- */
[data-theme="dark"] {
    --bg: #0f0f14;
    --bg-surface: #16161d;
    --bg-surface-2: #1e1e28;
    --bg-surface-3: #262633;
    --bg-hover: #2a2a3a;
    --border: #2e2e3e;
    --border-light: #383848;
    --text: #e8e8ef;
    --text-secondary: #9d9db5;
    --text-muted: #6b6b82;
    --accent: #6c5ce7;
    --accent-hover: #7c6ef0;
    --accent-subtle: rgba(108, 92, 231, 0.15);
    --success: #00b894;
    --success-bg: rgba(0, 184, 148, 0.12);
    --danger: #ff6b6b;
    --danger-bg: rgba(255, 107, 107, 0.12);
    --danger-hover: #ff5252;
    --warning: #ffc048;
    --warning-bg: rgba(255, 192, 72, 0.12);
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
    --sidebar-bg: #12121a;
    --sidebar-hover: #1e1e2a;
    --sidebar-active: rgba(108, 92, 231, 0.18);
    --input-bg: #1e1e28;
    --modal-overlay: rgba(0,0,0,0.6);
    --scrollbar-track: #1e1e28;
    --scrollbar-thumb: #3a3a4a;
}

/* -- Light Theme -- */
[data-theme="light"] {
    --bg: #f5f5fa;
    --bg-surface: #ffffff;
    --bg-surface-2: #f0f0f6;
    --bg-surface-3: #e8e8f0;
    --bg-hover: #eeeef4;
    --border: #d8d8e4;
    --border-light: #e4e4ee;
    --text: #1a1a2e;
    --text-secondary: #5a5a72;
    --text-muted: #8888a0;
    --accent: #6c5ce7;
    --accent-hover: #5a4bd6;
    --accent-subtle: rgba(108, 92, 231, 0.1);
    --success: #00a884;
    --success-bg: rgba(0, 168, 132, 0.1);
    --danger: #e74c3c;
    --danger-bg: rgba(231, 76, 60, 0.1);
    --danger-hover: #c0392b;
    --warning: #e6a817;
    --warning-bg: rgba(230, 168, 23, 0.1);
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --sidebar-bg: #ffffff;
    --sidebar-hover: #f0f0f6;
    --sidebar-active: rgba(108, 92, 231, 0.1);
    --input-bg: #f5f5fa;
    --modal-overlay: rgba(0,0,0,0.3);
    --scrollbar-track: #f0f0f6;
    --scrollbar-thumb: #c8c8d4;
}

/* -- Body -- */
body {
    background: var(--bg);
    color: var(--text);
}

/* ============================================
   Login Page
   ============================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--bg);
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-lg);
    text-align: center;
}
.login-logo { margin-bottom: 1.5rem; }
.login-logo svg { margin: 0 auto; }
.login-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.25rem; }
.login-subtitle { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 2rem; }
.login-form { text-align: left; }
.login-footer { margin-top: 1.5rem; }
.lang-switch { color: var(--text-muted); font-size: 0.813rem; }
.lang-switch:hover { color: var(--accent); }

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    max-height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.2s ease;
    overflow-y: auto;
}
.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
}
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.sidebar-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
}
.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0.5rem;
    overflow-y: auto;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s;
    margin-bottom: 2px;
}
.nav-item:hover { background: var(--sidebar-hover); color: var(--text); }
.nav-item.active { background: var(--sidebar-active); color: var(--accent); }
.nav-item svg { flex-shrink: 0; }

.sidebar-footer {
    padding: 0.75rem 0.5rem;
    border-top: 1px solid var(--border);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
}
.sidebar-user-info { min-width: 0; }
.sidebar-user-name { display: block; font-size: 0.813rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { display: block; font-size: 0.688rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.nav-logout { color: var(--danger) !important; }
.nav-logout:hover { background: var(--danger-bg) !important; }

/* ============================================
   Main Content
   ============================================ */
.main-content {
    margin-left: 240px;
    padding: 2rem;
    min-height: 100vh;
}

/* ============================================
   Mobile Header & Nav
   ============================================ */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 0 1rem;
    align-items: center;
    justify-content: space-between;
    z-index: 90;
}
.mobile-logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1rem; }
.mobile-menu-btn {
    background: none;
    border: none;
    color: var(--text);
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 8px;
}
.mobile-menu-btn:hover { background: var(--bg-hover); }

.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    align-items: center;
    justify-content: space-around;
    z-index: 90;
}
.mobile-nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    color: var(--text-muted);
}
.mobile-nav-item.active { color: var(--accent); background: var(--accent-subtle); }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--modal-overlay);
    z-index: 99;
}

/* ============================================
   Page Header
   ============================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.page-header h1 { font-size: 1.5rem; font-weight: 700; }

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}
.card-title { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }

/* ============================================
   Stats Grid
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow);
}
.stat-value { font-size: 2rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.813rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ============================================
   Meeting Panel (Dashboard)
   ============================================ */
.meeting-panel { margin-bottom: 1.5rem; }
.meeting-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}
.meeting-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.meeting-title { font-size: 1.125rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }
.live-dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--danger);
    animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.meeting-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.813rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}
.meeting-meta span { display: flex; align-items: center; gap: 0.35rem; }

.participants-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.participant-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: var(--bg-surface-2);
    border-radius: 8px;
    font-size: 0.875rem;
}
.participant-info { display: flex; align-items: center; gap: 0.5rem; }

/* Start meeting form */
.start-meeting-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
}
.start-meeting-card h3 { font-size: 1.125rem; margin-bottom: 0.5rem; }
.start-meeting-card p { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1.5rem; }
.start-form { max-width: 400px; margin: 0 auto; text-align: left; }
.start-form .form-group { margin-bottom: 1rem; }

/* ============================================
   Forms
   ============================================ */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.813rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 0.375rem; }
.form-input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.875rem;
    transition: border-color 0.15s;
}
.form-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
.form-input::placeholder { color: var(--text-muted); }
.form-error { color: var(--danger); font-size: 0.813rem; margin-top: 0.5rem; padding: 0.5rem 0.75rem; background: var(--danger-bg); border-radius: 6px; }
.form-msg { font-size: 0.813rem; margin-top: 0.5rem; padding: 0.5rem 0.75rem; border-radius: 6px; }
.form-msg.success { color: var(--success); background: var(--success-bg); }
.form-msg.error { color: var(--danger); background: var(--danger-bg); }

/* ============================================
   Buttons
   ============================================ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-full { width: 100%; }

.btn-ghost {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1.125rem;
    border-radius: 6px;
}
.btn-ghost:hover { color: var(--text); background: var(--bg-hover); }

.btn-sm {
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
}
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-success { background: var(--success-bg); color: var(--success); }
.btn-success:hover { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning-bg); color: var(--warning); }
.btn-warning:hover { background: var(--warning); color: #fff; }

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-surface-2);
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
}
.btn-icon:hover { background: var(--bg-hover); }
.btn-icon.muted { color: var(--danger); border-color: var(--danger); background: var(--danger-bg); }

/* ============================================
   Avatar
   ============================================ */
.avatar-sm, .avatar-md, .avatar-lg {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent-subtle);
    color: var(--accent);
    font-weight: 700;
    flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-md { width: 40px; height: 40px; font-size: 0.875rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.5rem; }

/* ============================================
   Table
   ============================================ */
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    text-align: left;
    padding: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 0.75rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--bg-hover); }
.text-center { text-align: center; }

/* Status badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    font-size: 0.688rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.badge-active { background: var(--success-bg); color: var(--success); }
.badge-inactive { background: var(--danger-bg); color: var(--danger); }
.badge-admin { background: var(--accent-subtle); color: var(--accent); }

/* ============================================
   Modal
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-backdrop { position: absolute; inset: 0; background: var(--modal-overlay); }
.modal-content {
    position: relative;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.modal-header h3 { font-size: 1.125rem; font-weight: 600; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1rem; }

/* ============================================
   Video Meeting Page
   ============================================ */
.meeting-container {
    min-height: calc(100vh - 4rem);
}

/* When in a call, take over the full screen — hide all chrome */
body.in-meeting .sidebar { display: none !important; }
body.in-meeting .mobile-header { display: none !important; }
body.in-meeting .mobile-nav { display: none !important; }
body.in-meeting .sidebar-overlay { display: none !important; }
body.in-meeting .main-content {
    margin-left: 0 !important;
    padding: 0 !important;
}
body.in-meeting .meeting-container {
    margin: 0 !important;
}

/* In-call header bar */
.call-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.75rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.call-header-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}
.call-header-title svg { flex-shrink: 0; }
.call-header-back {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}
.call-header-back:hover { background: var(--bg-hover); color: var(--text); }

/* Pre-join — normal layout with sidebar visible */
.pre-join {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 4rem);
    padding: 1rem;
}
.pre-join-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    width: 100%;
    max-width: 520px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}
.pre-join-card h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }

.preview-video {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    max-height: 25vh;
    background: var(--bg-surface-3);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.preview-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}
.preview-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--text-muted);
}
.pre-join-controls {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.pre-join-controls .btn-icon { width: 38px; height: 38px; }

/* Device selectors */
.device-selectors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 0.5rem;
    text-align: left;
    margin-bottom: 0.5rem;
}
.device-row label {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.1rem;
}
.form-input-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}
.volume-slider-wrap {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.vol-range {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--bg-surface-3);
    border-radius: 3px;
    outline: none;
}
.vol-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 2px solid var(--bg-surface);
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.vol-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 2px solid var(--bg-surface);
}
.vol-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 3rem;
    text-align: right;
}

/* Participants bar (top of in-call) */
.participants-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    overflow-x: auto;
    flex-shrink: 0;
    min-height: 40px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
}
.participants-bar:empty { display: none; }
.participants-bar::-webkit-scrollbar { height: 3px; }

.pbar-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.625rem;
    background: var(--bg-surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
}
.pbar-chip.has-hand {
    border-color: var(--warning);
    background: var(--warning-bg);
}
.pbar-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent-subtle);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 700;
    flex-shrink: 0;
}
.pbar-name { color: var(--text); }
.pbar-you { color: var(--text-muted); font-size: 0.688rem; }
.pbar-hand {
    display: inline-flex;
    color: var(--warning);
    animation: hand-wave 1s ease-in-out infinite alternate;
}
.pbar-mic-status {
    display: inline-flex;
    color: var(--text-muted);
}
.pbar-mic-status.is-muted { color: var(--danger); }
.pbar-mute-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: var(--bg-surface-3);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}
.pbar-mute-btn:hover { background: var(--accent); color: #fff; }
.pbar-mute-btn.is-muted { background: var(--danger); color: #fff; }
.pbar-mute-btn.is-allow { background: var(--success); color: #fff; }
.pbar-mute-btn.is-allow:hover { background: var(--success); filter: brightness(1.15); }

/* In-call — body.in-meeting removes all chrome, so 100dvh = full screen */
.in-call {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    position: relative;
    background: var(--bg);
}
.video-grid {
    flex: 1;
    min-height: 0;
    display: grid;
    gap: 0.375rem;
    padding: 0.375rem;
    grid-template-columns: 1fr;
    overflow-y: auto;
    align-content: start;
}

/* Spotlight view */
.video-grid.view-spotlight {
    grid-template-columns: 1fr auto;
    grid-template-rows: 1fr;
}
.video-grid.view-spotlight .video-tile:first-child {
    grid-row: 1 / -1;
    aspect-ratio: auto;
    min-height: 0;
}
.video-grid.view-spotlight .spotlight-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 200px;
    overflow-y: auto;
}
.video-grid.view-spotlight .spotlight-sidebar .video-tile {
    aspect-ratio: 16/9;
    width: 100%;
    flex-shrink: 0;
}

.video-tile {
    position: relative;
    background: var(--bg-surface-2);
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16/9;
}
.video-tile video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.video-tile.local video { transform: scaleX(-1); }
.video-tile-label {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    padding: 0.25rem 0.625rem;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.video-tile-avatar {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.video-tile .avatar-lg { width: 80px; height: 80px; font-size: 2rem; }

.mic-off-icon {
    display: inline-flex;
    color: var(--danger);
}

/* Hand raised badge */
.hand-raised-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--warning);
    color: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: hand-wave 1s ease-in-out infinite alternate;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
@keyframes hand-wave { 0% { transform: rotate(-8deg) scale(1); } 100% { transform: rotate(8deg) scale(1.1); } }

/* Admin mute button on tile */
.tile-mute-btn {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 2;
}
.video-tile:hover .tile-mute-btn { opacity: 1; }
.tile-mute-btn.is-muted { background: var(--danger); opacity: 1; }
.tile-mute-btn.is-allow { background: var(--success); opacity: 1; }
.tile-mute-btn.is-allow:hover { filter: brightness(1.15); }
.tile-mute-btn:hover { background: var(--accent); opacity: 1; }

/* Fullscreen mode */
.meeting-container:fullscreen,
.meeting-container:-webkit-full-screen {
    background: var(--bg);
    width: 100vw;
    height: 100vh;
}
.meeting-container:fullscreen .in-call,
.meeting-container:-webkit-full-screen .in-call {
    height: 100vh;
}

/* Call controls wrap (bottom of in-call) */
.call-controls-wrap {
    flex-shrink: 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    position: relative;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.call-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 0.5rem 1rem;
}
/* Call settings panel (pops up from controls) */
.call-settings-panel {
    position: absolute;
    bottom: 100%;
    right: 1rem;
    z-index: 70;
    width: 560px;
    max-width: calc(100vw - 2rem);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px 12px 0 0;
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
}
.call-settings-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.25rem;
    font-weight: 600;
    font-size: 0.875rem;
}
.ctrl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border-radius: 50%;
    border: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--bg-surface-2);
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
}
.ctrl-btn:hover { background: var(--bg-hover); }
.ctrl-btn.muted { color: var(--danger); border-color: var(--danger); background: var(--danger-bg); }
.ctrl-btn.active { color: var(--accent); border-color: var(--accent); background: var(--accent-subtle); }
.ctrl-btn-leave { background: var(--danger); color: #fff; border-color: var(--danger); }
.ctrl-btn-leave:hover { background: var(--danger-hover); }

/* No meeting */
.no-meeting {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 4rem);
}
.no-meeting-card {
    text-align: center;
    padding: 3rem;
}
.no-meeting-card h2 { color: var(--text-muted); font-size: 1.125rem; margin: 1rem 0 1.5rem; }

/* ============================================
   Settings
   ============================================ */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1rem;
}
.theme-options { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.theme-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--bg-surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.theme-btn:hover { border-color: var(--accent); color: var(--text); }
.theme-btn.active { border-color: var(--accent); background: var(--accent-subtle); color: var(--accent); }

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 767px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar.open + .mobile-header + .mobile-nav + .sidebar-overlay { display: block; }
    .mobile-header { display: flex; }
    .mobile-nav { display: flex; }
    .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-top: calc(56px + 1rem);
        padding-bottom: calc(56px + 1rem);
    }
    .page-header h1 { font-size: 1.25rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
    .participants-list { grid-template-columns: 1fr; }
    .meeting-meta { flex-direction: column; gap: 0.5rem; }

    .video-grid { padding: 0; gap: 2px; }
    .video-grid.grid-2, .video-grid.grid-3, .video-grid.grid-4 {
        grid-template-columns: 1fr;
    }
    .call-controls { padding: 0.375rem; gap: 0.25rem; }
    .ctrl-btn { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
    .ctrl-btn svg { width: 18px; height: 18px; }
    .call-settings-panel { grid-template-columns: 1fr; width: 300px; }
    .pre-join { min-height: calc(100vh - 8rem); padding: 0.5rem; }
    .sidebar-footer { flex-shrink: 0; padding-bottom: 1rem; }
    .sidebar-nav { flex: 1; min-height: 0; overflow-y: auto; }
    .data-table th, .data-table td { padding: 0.5rem 0.375rem; font-size: 0.75rem; }
    .modal-content { max-width: 100%; border-radius: 12px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .pre-join-card { padding: 1rem; max-width: 100%; }
    .pre-join-card h2 { font-size: 1rem; margin-bottom: 0.5rem; }
    .preview-video { max-height: 22vh; }
    .device-selectors { grid-template-columns: 1fr; gap: 0.375rem; }
    .login-card { padding: 1.5rem 1.25rem; }
}
