/*============================================================================
 *  云启系统 v2.0 — 大厂级企业设计系统
 *  Design inspired by Linear / Vercel / Stripe
 *============================================================================ */

/* ==========================================================================
   1. Design Tokens (CSS Variables)
   ========================================================================== */
:root {
  /* Primary — Indigo-Violet (Linear-inspired) */
  --accent: #5b5fe3;
  --accent-hover: #4a4ed4;
  --accent-soft: #f0f0ff;
  --accent-ring: rgba(91, 95, 227, 0.22);

  /* Semantic Colors */
  --green: #0caf60;
  --green-soft: #ecfdf5;
  --green-border: #a7f3d0;
  --red: #e5484d;
  --red-soft: #fef2f2;
  --red-border: #fecaca;
  --amber: #f5a623;
  --amber-soft: #fffbeb;
  --amber-border: #fde68a;
  --sky: #0ea5e9;
  --sky-soft: #f0f9ff;
  --sky-border: #bae6fd;

  /* Neutrals — Slate-based */
  --gray-50: #fafafa;
  --gray-75: #f5f5f5;
  --gray-100: #f0f0f0;
  --gray-150: #ebebeb;
  --gray-200: #e4e4e4;
  --gray-300: #d4d4d4;
  --gray-400: #a3a3a3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-700: #404040;
  --gray-800: #262626;
  --gray-900: #171717;
  --gray-950: #0a0a0a;

  /* Backgrounds */
  --bg-body: #fafafa;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --bg-hover: #f5f5f5;
  --bg-active: #f0f0ff;

  /* Text */
  --text-primary: #171717;
  --text-secondary: #525252;
  --text-tertiary: #737373;
  --text-muted: #a3a3a3;
  --text-inverse: #ffffff;

  /* Borders */
  --border-light: #ededed;
  --border-default: #e4e4e4;
  --border-strong: #d4d4d4;

  /* Shadows — Layered soft shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.10), 0 8px 16px rgba(0, 0, 0, 0.04);

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 9999px;

  /* Spacing scale (4px grid) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  --font-mono: 'SF Mono', 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Menlo, Monaco, monospace;
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 16px;
  --text-xl: 18px;
  --text-2xl: 20px;
  --text-3xl: 24px;

  /* Layout */
  --sider-width: 248px;

  /* Sidebar */
  --sidebar-bg: #0f0f23;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active: rgba(91, 95, 227, 0.18);
  --sidebar-text: rgba(255, 255, 255, 0.55);
  --sidebar-text-hover: rgba(255, 255, 255, 0.85);
  --sidebar-text-active: #ffffff;
  --sidebar-divider: rgba(255, 255, 255, 0.06);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 150ms;
  --duration-normal: 200ms;
  --duration-slow: 300ms;

  /* Deprecated variable mapping for backwards compat */
  --primary-color: var(--accent);
  --primary-hover: var(--accent-hover);
  --danger-color: var(--red);
  --danger-hover: #dc2626;
  --text-main: var(--text-primary);
  --text-secondary: var(--text-secondary);
  --text-muted: var(--text-tertiary);
  --bg-body: var(--bg-body);
  --bg-card: var(--bg-card);
  --border-color: var(--border-light);
  --shadow-base: var(--shadow-sm);
  --border-radius: var(--radius-lg);
  --border-radius-sm: var(--radius-md);
}

/* ==========================================================================
   2. Reset & Base Typography
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--bg-body);
  letter-spacing: -0.01em;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}
a:hover { color: var(--accent-hover); }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  outline: none;
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* Selection */
::selection {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ==========================================================================
   3. Admin Layout (Sidebar + Header + Content)
   ========================================================================== */
.admin-layout {
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ---- Sidebar ---- */
.admin-sider {
  width: var(--sider-width);
  background: var(--sidebar-bg);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  z-index: 20;
  position: relative;
  border-right: 1px solid var(--sidebar-divider);
  transition: width var(--duration-slow) var(--ease-out);
}

/* Sidebar subtle top gradient accent */
.admin-sider::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(91, 95, 227, 0.5), transparent);
  z-index: 1;
}

/* Logo */
.admin-logo {
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  overflow: hidden;
  flex-shrink: 0;
  border-bottom: 1px solid var(--sidebar-divider);
}
.admin-logo-icon {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.admin-logo-icon svg { width: 34px; height: 34px; }
.admin-logo-text {
  font-size: var(--text-lg);
  font-weight: 650;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

/* Navigation Menu */
.admin-menu {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3) 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.menu-section-label {
  padding: var(--space-5) 20px var(--space-2);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.28);
  user-select: none;
}
.menu-section-label:first-child { padding-top: var(--space-2); }

.admin-menu-item {
  display: flex;
  align-items: center;
  padding: 9px 16px;
  margin: 0 var(--space-2);
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: var(--radius-md);
  gap: 10px;
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--duration-fast) var(--ease-out);
  position: relative;
}
.admin-menu-item svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: 0.55;
  transition: opacity var(--duration-fast) var(--ease-out);
}
.admin-menu-item:hover {
  color: var(--sidebar-text-hover);
  background: var(--sidebar-hover);
}
.admin-menu-item:hover svg { opacity: 0.85; }
.admin-menu-item.is-active {
  color: var(--sidebar-text-active);
  background: var(--sidebar-active);
  font-weight: 600;
}
.admin-menu-item.is-active svg { opacity: 1; }
.admin-menu-item.is-active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--accent);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}

/* Sidebar Footer */
.sider-footer {
  border-top: 1px solid var(--sidebar-divider);
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.sider-telegram {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: all var(--duration-fast) var(--ease-out);
  background: rgba(255, 255, 255, 0.03);
}
.sider-telegram:hover {
  background: #2aabee;
  color: #fff;
}
.sider-telegram svg { width: 18px; height: 18px; flex-shrink: 0; }

.sider-version {
  text-align: center;
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.18);
  user-select: none;
}

/* ---- Main Container ---- */
.admin-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-body);
}

/* Header */
.admin-header {
  height: 60px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  z-index: 10;
  flex-shrink: 0;
}

.admin-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.admin-breadcrumb {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.admin-breadcrumb strong {
  color: var(--text-primary);
  font-weight: 600;
}

.admin-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.admin-user-dropdown {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
  color: var(--text-primary);
  font-size: var(--text-sm);
  text-decoration: none;
}
.admin-user-dropdown:hover { background: var(--bg-hover); }

.admin-avatar {
  width: 30px; height: 30px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 600;
}

/* Content Area */
.admin-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6);
  scroll-behavior: smooth;
}

/* ==========================================================================
   4. Enterprise Components
   ========================================================================== */

/* ---- Card ---- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
  margin-bottom: var(--space-5);
  overflow: hidden;
  transition: box-shadow var(--duration-normal) var(--ease-out);
}
.card:hover {
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.card-body {
  padding: var(--space-6);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 500;
  font-size: var(--text-sm);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  height: 36px;
  padding: 0 var(--space-4);
  transition: all var(--duration-fast) var(--ease-out);
  letter-spacing: -0.01em;
  text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.btn-primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  color: var(--text-primary);
  background: var(--bg-card);
  border-color: var(--border-default);
}
.btn-secondary:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.btn-accent {
  color: #fff;
  background: #6366f1;
  border-color: #6366f1;
}
.btn-accent:hover {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #fff;
}

.btn-danger {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}
.btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

.btn-ghost {
  color: var(--text-secondary);
  background: transparent;
  border-color: transparent;
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.btn-sm {
  height: 28px;
  padding: 0 var(--space-3);
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
}
.btn-lg {
  height: 42px;
  padding: 0 var(--space-6);
  font-size: var(--text-md);
}

/* ---- Input / Select / Textarea ---- */
.form-group {
  margin-bottom: var(--space-5);
}
.form-label {
  display: block;
  margin-bottom: var(--space-1);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
}

.input, .select, .textarea {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-out);
  line-height: 1.5;
}
.input { height: 36px; }
.select { height: 36px; cursor: pointer; }
.textarea { min-height: 80px; resize: vertical; }

.input:hover, .select:hover, .textarea:hover {
  border-color: var(--gray-300);
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.input[readonly] {
  background: var(--gray-50);
  cursor: not-allowed;
  color: var(--text-tertiary);
}

/* ---- Table ---- */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-sm);
}

.table th {
  background: var(--gray-50);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
  text-align: left;
  white-space: nowrap;
  user-select: none;
}

.table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--gray-75);
  color: var(--text-primary);
}

.table tbody tr {
  transition: background var(--duration-fast) var(--ease-out);
}
.table tbody tr:hover { background: var(--gray-50); }
.table tbody tr:last-child td { border-bottom: none; }

/* ---- Tags ---- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  white-space: nowrap;
  gap: 4px;
}

.tag-success {
  color: #067647;
  background: var(--green-soft);
  border-color: var(--green-border);
}
.tag-error {
  color: #b91c1c;
  background: var(--red-soft);
  border-color: var(--red-border);
}
.tag-processing {
  color: #1557b0;
  background: var(--sky-soft);
  border-color: var(--sky-border);
}
.tag-warning {
  color: #92400e;
  background: var(--amber-soft);
  border-color: var(--amber-border);
}
.tag-default {
  color: var(--text-secondary);
  background: var(--gray-75);
  border-color: var(--border-default);
}

/* ---- Alert ---- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: var(--text-sm);
  line-height: 1.5;
}

.alert-success {
  color: #067647;
  background: var(--green-soft);
  border-color: var(--green-border);
}
.alert-error {
  color: #b91c1c;
  background: var(--red-soft);
  border-color: var(--red-border);
}
.alert-info {
  color: #1557b0;
  background: var(--sky-soft);
  border-color: var(--sky-border);
}
.alert-warning {
  color: #92400e;
  background: var(--amber-soft);
  border-color: var(--amber-border);
}

/* ---- Badge ---- */
.badge {
  display: inline-block;
  padding: 2px 10px;
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  color: var(--text-secondary);
}
.badge-success {
  background: var(--green-soft);
  color: #067647;
  border: 1px solid var(--green-border);
}
.badge-error {
  background: var(--red-soft);
  color: #b91c1c;
  border: 1px solid var(--red-border);
}

/* ---- Stat Cards ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.stat-card.accent-blue::after { background: var(--accent); }
.stat-card.accent-green::after { background: var(--green); }
.stat-card.accent-red::after { background: var(--red); }
.stat-card.accent-amber::after { background: var(--amber); }
.stat-card.accent-sky::after { background: var(--sky); }

.stat-title {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  margin-bottom: var(--space-2);
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* ---- Section / Panel ---- */
.panel {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  padding: var(--space-6);
  margin-bottom: var(--space-5);
}
.panel-title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-4);
  letter-spacing: -0.01em;
}

.list-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---- Toolbar ---- */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-light);
  gap: var(--space-4);
}

/* ---- Misc ---- */
.hint {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

.meeting-code {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
  color: var(--accent);
}

.build-progress {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  overflow: hidden;
}
.build-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #818cf8);
  border-radius: var(--radius-full);
  transition: width 0.5s var(--ease-out);
}

.build-result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}
.build-result-item {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--gray-50);
  padding: var(--space-3) var(--space-4);
}
.build-result-label {
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  margin-bottom: var(--space-1);
}
.build-result-value {
  color: var(--text-primary);
  font-size: var(--text-md);
  font-weight: 600;
}

.empty {
  color: var(--text-muted);
  padding: var(--space-5) 0;
  text-align: center;
  font-size: var(--text-sm);
}

/* ==========================================================================
   5. Login Page — Enterprise Split Layout
   ========================================================================== */
.login-layout {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  background: linear-gradient(135deg, #f0f0ff 0%, #fafafa 30%, #f0f5ff 70%, #f5f0ff 100%);
  position: relative;
}

/* Subtle grid pattern background */
.login-layout::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(91, 95, 227, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(99, 102, 241, 0.04) 0%, transparent 50%);
  pointer-events: none;
}

.login-card {
  display: flex;
  width: 100%;
  max-width: 920px;
  min-height: 540px;
  background: var(--bg-card);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  position: relative;
  z-index: 1;
  border: 1px solid var(--border-light);
}

/* Left brand panel */
.login-sider {
  flex: 1;
  background: linear-gradient(160deg, #0f0f23 0%, #1a1a3e 40%, #0f0f23 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-12);
  position: relative;
  overflow: hidden;
  min-width: 0;
}

/* Decorative glow blobs */
.login-sider::before {
  content: '';
  position: absolute;
  top: -60px; left: -60px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(91, 95, 227, 0.15), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.login-sider::after {
  content: '';
  position: absolute;
  bottom: -40px; right: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.1), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.login-sider-content {
  position: relative;
  z-index: 1;
}
.login-sider-title {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  margin-bottom: var(--space-3);
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.login-sider-desc {
  font-size: var(--text-md);
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.6;
  max-width: 280px;
}

/* Right form panel */
.login-main {
  width: 440px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-12);
  background: var(--bg-card);
  position: relative;
  z-index: 1;
}

.login-header { margin-bottom: var(--space-8); }
.login-header h2 {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
  letter-spacing: -0.02em;
}
.login-header p {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.login-form .form-group { margin-bottom: var(--space-5); }
.login-form .form-label {
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--space-1);
}
.login-form .input {
  height: 42px;
  font-size: var(--text-md);
  padding: var(--space-2) var(--space-3);
}
.login-form .btn {
  width: 100%;
  height: 42px;
  font-size: var(--text-md);
  font-weight: 600;
  margin-top: var(--space-2);
}

@media (max-width: 800px) {
  .login-card {
    flex-direction: column;
    max-width: 440px;
    min-height: auto;
  }
  .login-sider {
    padding: var(--space-8) var(--space-6);
    text-align: center;
  }
  .login-sider-desc { max-width: none; }
  .login-main {
    width: 100%;
    padding: var(--space-8) var(--space-6);
  }
}

/* ==========================================================================
   6. Dashboard
   ========================================================================== */

/* Overview stat cards */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.overview-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  box-shadow: var(--shadow-xs);
  transition: all var(--duration-normal) var(--ease-out);
  cursor: default;
}
.overview-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.ov-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.ov-icon.blue   { background: var(--accent-soft); color: var(--accent); }
.ov-icon.green  { background: var(--green-soft); color: var(--green); }
.ov-icon.orange { background: var(--amber-soft); color: var(--amber); }
.ov-icon.red    { background: var(--red-soft); color: var(--red); }
.ov-icon.purple { background: #f3f0ff; color: #7c3aed; }
.ov-icon.cyan   { background: var(--sky-soft); color: var(--sky); }
.ov-icon.pink   { background: #fdf2f8; color: #db2777; }

.ov-info { line-height: 1.3; min-width: 0; }
.ov-value { font-size: 22px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.02em; }
.ov-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

/* Chart grid */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  text-align: center;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--duration-normal) var(--ease-out);
}
.chart-card:hover { box-shadow: var(--shadow-sm); }
.chart-card h3 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}

/* ==========================================================================
   7. Meeting Room (Legacy layout + V2 layout)
   ========================================================================== */

/* ---- Legacy Meeting Layout ---- */
body:has(.meeting-layout) { overflow: hidden; }

.meeting-layout {
  display: flex;
  flex-direction: column;
  position: relative;
  height: 100vh;
  height: 100dvh;
  background: #1a1a1a;
  color: #ffffff;
  overflow: hidden;
}

/* Header bar */
.meeting-layout .meeting-header {
  height: 52px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 30;
  flex-shrink: 0;
}

.meeting-header-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Global voice status */
.global-voice-status {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s ease;
}
.global-voice-status .status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 6px #ef4444;
}
.global-voice-status.is-connected .status-dot {
  background: #4ade80;
  box-shadow: 0 0 6px #4ade80;
}

.meeting-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
}
.meeting-subtitle {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
}

/* Main stage area */
.meeting-main {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: flex-start;
  overflow: hidden;
  min-height: 0;
}

/* ---- Video Stage ---- */
.video-stage {
  order: 2;
  flex: 1 1 auto;
  min-width: 0; min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  align-items: stretch;
  background: #0a0a0a;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.video-stage-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.25);
  font-size: 13px;
  text-align: center;
  padding: 24px;
}

.video-stage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  grid-auto-rows: minmax(220px, 1fr);
  grid-auto-flow: dense;
  flex: 1 1 auto;
  width: 100%;
  gap: 1px;
  padding: 0;
  height: 100%;
  min-height: 0;
  background: rgba(255, 255, 255, 0.04);
}
.video-stage-grid.feed-count-1 {
  grid-template-columns: 1fr;
}

.video-stage-grid.has-screen-share {
  display: flex;
  background: #fff;
}
.video-stage-grid.has-screen-share .video-feed-card.source-screen_share {
  display: flex;
  flex: 1 1 auto;
  width: 100%; height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  border-radius: 0;
  background: #fff;
  border: none;
  box-shadow: none;
}

/* Video feed card */
.video-feed-card {
  position: relative;
  display: flex;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
}
.video-feed-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
}
.video-feed-card.source-screen_share {
  aspect-ratio: auto;
  grid-column: 1 / -1;
  min-height: 0;
}

.video-feed-slot {
  flex: 1 1 auto;
  width: 100%; height: 100%;
  min-height: 0;
  background: #000;
}
.video-feed-slot video {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}
.video-feed-slot video.is-mirrored { transform: scaleX(-1); }

.video-stage-grid.has-screen-share .video-feed-slot,
.video-stage-grid.has-screen-share .video-feed-slot video {
  background: #fff;
}

.video-feed-label {
  position: absolute;
  left: 10px; bottom: 10px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(26, 26, 26, 0.8);
  backdrop-filter: blur(8px);
  color: #fff;
  z-index: 2;
  pointer-events: none;
}

.video-feed-card:fullscreen {
  width: 100vw; height: 100vh;
  max-width: none;
  aspect-ratio: auto;
  border-radius: 0;
  border: none;
  background: #000;
}
.video-feed-card:fullscreen .video-feed-slot video {
  object-fit: contain;
  background: #000;
}

/* ---- Participant Rail ---- */
.participant-grid {
  order: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 74px;
  min-width: 74px;
  max-width: 74px;
  min-height: 0;
  padding: 8px 4px 8px 8px;
  overflow-x: hidden;
  overflow-y: auto;
  align-items: stretch;
  justify-content: flex-start;
  scrollbar-width: none;
}
.participant-grid::-webkit-scrollbar { display: none; }
.participant-grid-remote {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.participant-card {
  background: linear-gradient(160deg, rgba(40, 40, 40, 0.95), rgba(26, 26, 26, 0.98));
  border-radius: 12px;
  aspect-ratio: 3 / 4;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
}
.participant-card.is-self {
  border-color: rgba(37, 99, 235, 0.4);
}
.participant-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.avatar-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.3);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.participant-name {
  position: absolute;
  bottom: 3px; left: 3px; right: 3px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  padding: 2px 4px;
  border-radius: 6px;
  font-size: 9px;
  display: flex;
  align-items: center;
  gap: 3px;
  justify-content: space-between;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(255, 255, 255, 0.85);
}

/* ---- Mic Icon ---- */
.mic-icon {
  width: 14px; height: 18px;
  position: relative;
  border: 1px solid #4ade80;
  border-radius: 7px;
  background: transparent;
}
.mic-icon::before {
  content: '';
  position: absolute;
  bottom: -4px; left: 2px;
  width: 8px; height: 6px;
  border-bottom: 1px solid #4ade80;
  border-radius: 0 0 4px 4px;
}
.mic-icon.muted { border-color: #ef4444; }
.mic-icon.muted::before { border-color: #ef4444; }
.mic-icon.muted::after {
  content: '';
  position: absolute;
  top: 8px; left: -2px;
  width: 16px; height: 1px;
  background: #ef4444;
  transform: rotate(45deg);
}

/* ---- Footer Control Bar ---- */
.meeting-footer {
  height: 62px;
  background: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 30;
  flex-shrink: 0;
}

.footer-left, .footer-center, .footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-center {
  flex: 1;
  justify-content: center;
}

.control-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 52px;
  cursor: pointer;
  border-radius: 8px;
  padding: 4px;
  transition: all 0.2s ease;
}
.control-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}
.control-btn.is-active,
.control-btn.btn-primary {
  background: rgba(37, 99, 235, 0.25);
  color: #93bbfd;
}
.control-btn.is-danger { color: #ef4444; }
.control-btn.is-danger:hover { background: rgba(229, 72, 77, 0.15); }

.control-label {
  font-size: 10px;
  font-weight: 500;
}

/* ---- Icon Classes ---- */
.icon-mic-on, .icon-mic-off, .icon-speaker, .icon-members, .icon-chat, .icon-camera, .icon-screen {
  width: 22px; height: 22px;
  background-color: currentColor;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}
.icon-mic-on   { mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"/><path d="M19 10v2a7 7 0 0 1-14 0v-2"/><line x1="12" y1="19" x2="12" y2="22"/></svg>'); -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"/><path d="M19 10v2a7 7 0 0 1-14 0v-2"/><line x1="12" y1="19" x2="12" y2="22"/></svg>'); }
.icon-mic-off  { mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="2" y1="2" x2="22" y2="22"/><path d="M18.89 13.23A7.12 7.12 0 0 0 19 12v-2"/><path d="M5 10v2a7 7 0 0 0 12 5"/><path d="M15 9.34V5a3 3 0 0 0-5.68-1.33"/><path d="M9 9v3a3 3 0 0 0 5.12 1.56"/><line x1="12" y1="19" x2="12" y2="22"/></svg>'); -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="2" y1="2" x2="22" y2="22"/><path d="M18.89 13.23A7.12 7.12 0 0 0 19 12v-2"/><path d="M5 10v2a7 7 0 0 0 12 5"/><path d="M15 9.34V5a3 3 0 0 0-5.68-1.33"/><path d="M9 9v3a3 3 0 0 0 5.12 1.56"/><line x1="12" y1="19" x2="12" y2="22"/></svg>'); }
.icon-speaker  { mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/><path d="M19.07 4.93a10 10 0 0 1 0 14.14"/><path d="M15.54 8.46a5 5 0 0 1 0 7.07"/></svg>'); -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/><path d="M19.07 4.93a10 10 0 0 1 0 14.14"/><path d="M15.54 8.46a5 5 0 0 1 0 7.07"/></svg>'); }
.icon-members  { mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/></svg>'); -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/></svg>'); }
.icon-chat     { mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>'); -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>'); }
.icon-camera   { mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M23 7l-7 5 7 5V7z"/><rect x="1" y="5" width="15" height="14" rx="2" ry="2"/></svg>'); -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M23 7l-7 5 7 5V7z"/><rect x="1" y="5" width="15" height="14" rx="2" ry="2"/></svg>'); }
.icon-screen   { mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/></svg>'); -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/></svg>'); }

/* Leave button */
.leave-btn {
  background: #ef4444;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease;
}
.leave-btn:hover { background: #dc2626; color: #fff; }

/* ---- Meeting Sidebar ---- */
.meeting-sidebar {
  position: absolute;
  top: 52px; right: 0; bottom: 62px;
  width: 340px;
  background: #fff;
  color: #333;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #e5e7eb;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
  z-index: 25;
  border-radius: 14px 0 0 0;
  overflow: hidden;
}

.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid #e5e7eb;
  padding: 0 16px;
  align-items: center;
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 14px 0;
  font-size: 13px;
  font-weight: 500;
  color: #9ca3af;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}
.tab-btn.is-active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  font-weight: 600;
}

.tab-close-btn {
  background: none;
  border: none;
  font-size: 22px;
  color: #6b7280;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.2s ease;
}
.tab-close-btn:hover { color: #333; }

.sidebar-panel {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-panel.is-active { display: flex; }

/* Chat */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-item {
  padding: 8px 0;
  border-bottom: 1px solid #f5f5f5;
}
.chat-meta {
  color: #9ca3af;
  font-size: 11px;
  margin-bottom: 4px;
}

.chat-input-area {
  padding: 16px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-textarea {
  width: 100%;
  min-height: 70px;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 13px;
  resize: none;
  transition: border-color 0.2s ease;
}
.chat-textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}
.chat-actions {
  display: flex;
  justify-content: flex-end;
}

/* Members */
.member-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.member-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  gap: 12px;
  transition: background 0.2s ease;
}
.member-item:hover { background: #f9fafb; }

.member-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.member-info { flex: 1; min-width: 0; }
.member-name {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}
.member-role {
  font-size: 11px;
  color: #9ca3af;
}
.member-actions {
  display: flex;
  gap: 4px;
}
.member-actions .btn {
  font-size: 11px;
  padding: 4px 8px;
}

/* ==========================================================================
   8. Meeting Room V2 Layout — Complete Desktop Redesign
   ========================================================================== */

/* ---- Base Grid ---- */
.meeting-layout.meeting-layout-v2 {
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr) 72px;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #0d1117;
  color: #c9d1d9;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ---- Header Bar (Compact Top Bar) ---- */
.meeting-layout-v2 .meeting-header {
  height: 48px;
  min-height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  background: #161b22;
  border-bottom: 1px solid #21262d;
  z-index: 40;
  flex-shrink: 0;
  gap: 12px;
}
.meeting-layout-v2 .meeting-header-main {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
  height: 100%;
}

/* Header inline info chips */
.meeting-layout-v2 .meeting-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.meeting-layout-v2 .meeting-title {
  font-size: 14px;
  font-weight: 600;
  color: #e6edf3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}
.meeting-layout-v2 .meeting-code {
  font-size: 11px;
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
  color: #58a6ff;
  background: rgba(88, 166, 255, 0.1);
  border: 1px solid rgba(88, 166, 255, 0.2);
  border-radius: 6px;
  padding: 3px 10px;
  white-space: nowrap;
}

/* Meeting detail panel — collapsed toggle + dropdown */
.meeting-layout-v2 .meeting-detail-panel {
  position: relative;
  display: flex;
  align-items: center;
}
.meeting-layout-v2 .meeting-detail-summary { display: flex; align-items: center; }
.meeting-layout-v2 .meeting-detail-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid #30363d;
  border-radius: 6px;
  background: transparent;
  color: #8b949e;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.meeting-layout-v2 .meeting-detail-toggle:hover {
  color: #e6edf3;
  border-color: #484f58;
  background: #21262d;
}
.meeting-layout-v2 .meeting-detail-toggle::after {
  content: '▾';
  font-size: 10px;
  margin-left: 2px;
  transition: transform 0.2s;
}
.meeting-layout-v2 .meeting-detail-badge-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: 9px;
  background: rgba(63, 185, 80, 0.2);
  color: #3fb950;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
}
.meeting-layout-v2 .meeting-detail-panel.is-expanded .meeting-detail-toggle::after {
  transform: rotate(180deg);
}
.meeting-layout-v2 .meeting-detail-toggle-text { font-size: 12px; }

/* Dropdown body */
.meeting-layout-v2 .meeting-detail-body {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 8px;
  width: 520px;
  max-width: 90vw;
  padding: 14px 16px;
  border: 1px solid #30363d;
  border-radius: 10px;
  background: #161b22;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  z-index: 50;
}
.meeting-layout-v2 .meeting-detail-body[hidden] { display: none; }
.meeting-layout-v2 .meeting-detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #0d1117;
  border: 1px solid #21262d;
}
.meeting-layout-v2 .meeting-detail-label {
  font-size: 10px;
  font-weight: 500;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.meeting-layout-v2 .meeting-detail-value {
  font-size: 13px;
  font-weight: 500;
  color: #e6edf3;
  display: flex;
  align-items: center;
  gap: 6px;
}
.meeting-layout-v2 .meeting-copy-btn {
  font-size: 10px;
  padding: 1px 8px;
  border: 1px solid #30363d;
  border-radius: 4px;
  background: #21262d;
  color: #8b949e;
  cursor: pointer;
  transition: all 0.15s;
}
.meeting-layout-v2 .meeting-copy-btn:hover { color: #e6edf3; border-color: #484f58; }
.meeting-layout-v2 .meeting-detail-badge {
  background: rgba(63, 185, 80, 0.15);
  color: #3fb950;
  border: 1px solid rgba(63, 185, 80, 0.3);
  border-radius: 10px;
  padding: 1px 10px;
  font-size: 11px;
  font-weight: 600;
  width: fit-content;
}
.meeting-layout-v2 .meeting-detail-item-status,
.meeting-layout-v2 .meeting-detail-item-devices,
.meeting-layout-v2 .meeting-detail-item-full { grid-column: 1 / -1; }
.meeting-layout-v2 .meeting-detail-item-full {
  background: rgba(88, 166, 255, 0.06);
  border-color: rgba(88, 166, 255, 0.15);
}

/* Global voice status in detail panel */
.meeting-layout-v2 .global-voice-status {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 11px;
  color: #8b949e;
}
.meeting-layout-v2 .global-voice-status .status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #f85149;
  box-shadow: 0 0 6px #f85149;
}
.meeting-layout-v2 .global-voice-status.is-connected .status-dot {
  background: #3fb950;
  box-shadow: 0 0 6px #3fb950;
}

/* ---- Content Shell (Rail + Main) ---- */
.meeting-layout-v2 .meeting-shell {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ---- Participant Rail (Left) ---- */
.meeting-layout-v2 .meeting-rail {
  width: 70px;
  min-width: 70px;
  max-width: 70px;
  border-right: 1px solid #21262d;
  background: #0d1117;
  display: flex;
  flex-direction: column;
}
.meeting-layout-v2 .participant-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 6px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  scrollbar-width: none;
}
.meeting-layout-v2 .participant-grid::-webkit-scrollbar { display: none; }
.meeting-layout-v2 .participant-grid-remote {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.meeting-layout-v2 .participant-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px 6px;
  border-radius: 10px;
  background: #161b22;
  border: 1px solid #21262d;
  gap: 4px;
  transition: all 0.15s;
  min-height: 72px;
  cursor: default;
}
.meeting-layout-v2 .participant-card.is-self {
  border-color: rgba(88, 166, 255, 0.35);
  background: rgba(88, 166, 255, 0.06);
}
.meeting-layout-v2 .participant-card:hover { border-color: #30363d; }
.meeting-layout-v2 .avatar-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #58a6ff, #3fb950);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.meeting-layout-v2 .participant-name {
  font-size: 10px;
  font-weight: 500;
  color: #8b949e;
  text-align: center;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

/* Mic icon in rail */
.meeting-layout-v2 .mic-icon {
  width: 10px; height: 13px;
  position: relative;
  border: 1px solid #3fb950;
  border-radius: 5px;
  background: transparent;
  flex-shrink: 0;
}
.meeting-layout-v2 .mic-icon::before {
  content: '';
  position: absolute;
  bottom: -3px; left: 1px;
  width: 6px; height: 4px;
  border-bottom: 1px solid #3fb950;
  border-radius: 0 0 3px 3px;
}
.meeting-layout-v2 .mic-icon.muted { border-color: #f85149; }
.meeting-layout-v2 .mic-icon.muted::before { border-color: #f85149; }
.meeting-layout-v2 .mic-icon.muted::after {
  content: '';
  position: absolute;
  top: 6px; left: -1px;
  width: 10px; height: 1px;
  background: #f85149;
  transform: rotate(45deg);
}

/* ---- Main Stage Area ---- */
.meeting-layout-v2 .meeting-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #010409;
}
.meeting-layout-v2 .meeting-stage-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.meeting-layout-v2 .video-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #010409;
  overflow: hidden;
}
.meeting-layout-v2 .video-stage-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #30363d;
  font-size: 14px;
  text-align: center;
  padding: 40px;
  user-select: none;
}

/* Video grid */
.meeting-layout-v2 .video-stage-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  grid-auto-rows: minmax(200px, 1fr);
  gap: 6px;
  padding: 6px;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #010409;
}
.meeting-layout-v2 .video-stage-grid.feed-count-1 {
  grid-template-columns: 1fr;
  padding: 0;
  gap: 0;
}
.meeting-layout-v2 .video-stage-grid.feed-count-2 {
  grid-template-columns: repeat(2, 1fr);
}
.meeting-layout-v2 .video-stage-grid.feed-count-3 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.meeting-layout-v2 .video-stage-grid.feed-count-4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

/* Screen Share — takes full stage */
.meeting-layout-v2 .video-stage-grid.has-screen-share {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  background: #010409;
}
.meeting-layout-v2 .video-stage-grid.has-screen-share .video-feed-card.source-screen_share {
  flex: 1;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  border-radius: 0;
  border: none;
  background: #0d1117;
  display: flex;
  align-items: center;
  justify-content: center;
}
.meeting-layout-v2 .video-stage-grid.has-screen-share .video-feed-slot {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #010409;
}
.meeting-layout-v2 .video-stage-grid.has-screen-share .video-feed-slot video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #010409;
}

/* Video feed card */
.meeting-layout-v2 .video-feed-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #0d1117;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #21262d;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.meeting-layout-v2 .video-feed-card:hover {
  border-color: #30363d;
}
.meeting-layout-v2 .video-feed-slot {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #010409;
  min-height: 0;
}
.meeting-layout-v2 .video-feed-slot video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #010409;
}
.meeting-layout-v2 .video-feed-slot video.is-mirrored { transform: scaleX(-1); }
.meeting-layout-v2 .video-feed-label {
  position: absolute;
  left: 10px; bottom: 10px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(6px);
  color: #e6edf3;
  z-index: 2;
  pointer-events: none;
}

/* Fullscreen */
.meeting-layout-v2 .video-feed-card:fullscreen {
  width: 100vw; height: 100vh;
  border-radius: 0;
  border: none;
  background: #000;
}
.meeting-layout-v2 .video-feed-card:fullscreen .video-feed-slot video {
  object-fit: contain;
  background: #000;
}

/* ---- Footer Control Bar ---- */
.meeting-layout-v2 .meeting-footer {
  height: 72px;
  min-height: 72px;
  background: #161b22;
  border-top: 1px solid #21262d;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 30;
  flex-shrink: 0;
  gap: 16px;
}
.meeting-layout-v2 .footer-left,
.meeting-layout-v2 .footer-center,
.meeting-layout-v2 .footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.meeting-layout-v2 .footer-center {
  flex: 1;
  justify-content: center;
}
.meeting-layout-v2 .footer-right {
  flex-shrink: 0;
}
.meeting-layout-v2 .audio-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Control buttons — larger, visible */
.meeting-layout-v2 .control-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 60px;
  height: 56px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #8b949e;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.meeting-layout-v2 .control-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e6edf3;
}
.meeting-layout-v2 .control-btn.is-active {
  background: rgba(88, 166, 255, 0.15);
  color: #58a6ff;
  border-color: rgba(88, 166, 255, 0.3);
}
.meeting-layout-v2 .control-btn.is-danger {
  color: #f85149;
}
.meeting-layout-v2 .control-btn.is-danger:hover {
  background: rgba(248, 81, 73, 0.12);
}
.meeting-layout-v2 .control-btn.btn-primary {
  background: rgba(63, 185, 80, 0.15);
  color: #3fb950;
  border-color: rgba(63, 185, 80, 0.3);
}
.meeting-layout-v2 .control-label {
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
}

/* Icon sizes in V2 */
.meeting-layout-v2 .icon-mic-on,
.meeting-layout-v2 .icon-mic-off,
.meeting-layout-v2 .icon-speaker,
.meeting-layout-v2 .icon-members,
.meeting-layout-v2 .icon-chat,
.meeting-layout-v2 .icon-camera,
.meeting-layout-v2 .icon-screen {
  width: 24px; height: 24px;
  background-color: currentColor;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

/* Leave button */
.meeting-layout-v2 .leave-btn {
  background: #da3633;
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  min-width: 80px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.meeting-layout-v2 .leave-btn:hover { background: #f85149; color: #fff; }

/* Footer tips */
.meeting-layout-v2 .meeting-footer-tips {
  display: flex;
  gap: 16px;
}
.meeting-layout-v2 .footer-tip {
  font-size: 11px;
  color: #484f58;
  white-space: nowrap;
}

/* ---- Sidebar (Chat / Members) ---- */
.meeting-layout-v2 .meeting-sidebar {
  position: absolute;
  top: 48px; right: 0; bottom: 72px;
  width: 360px;
  max-width: 100vw;
  background: #161b22;
  color: #c9d1d9;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #21262d;
  box-shadow: -6px 0 20px rgba(0, 0, 0, 0.4);
  z-index: 35;
  overflow: hidden;
}
.meeting-layout-v2 .sidebar-tabs {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #21262d;
  padding: 0 12px;
}
.meeting-layout-v2 .tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 12px 0;
  font-size: 13px;
  font-weight: 500;
  color: #8b949e;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}
.meeting-layout-v2 .tab-btn.is-active {
  color: #58a6ff;
  border-bottom-color: #58a6ff;
  font-weight: 600;
}
.meeting-layout-v2 .tab-btn:hover { color: #e6edf3; }
.meeting-layout-v2 .tab-close-btn {
  background: none;
  border: none;
  font-size: 22px;
  color: #8b949e;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.15s;
  border-radius: 6px;
}
.meeting-layout-v2 .tab-close-btn:hover { color: #e6edf3; background: #21262d; }
.meeting-layout-v2 .sidebar-panel {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}
.meeting-layout-v2 .sidebar-panel.is-active { display: flex; }

/* Chat panel */
.meeting-layout-v2 .chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.meeting-layout-v2 .chat-messages::-webkit-scrollbar { width: 4px; }
.meeting-layout-v2 .chat-messages::-webkit-scrollbar-thumb { background: #30363d; border-radius: 2px; }

/* Empty state */
.meeting-layout-v2 .chat-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  gap: 8px;
  color: #484f58;
}
.meeting-layout-v2 .chat-empty-icon { font-size: 36px; opacity: 0.5; }
.meeting-layout-v2 .chat-empty-text { font-size: 14px; font-weight: 500; color: #8b949e; }
.meeting-layout-v2 .chat-empty-hint { font-size: 12px; }

/* Message row */
.meeting-layout-v2 .chat-msg-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  max-width: 100%;
}
.meeting-layout-v2 .chat-msg-row.is-mine {
  flex-direction: row-reverse;
}

/* Avatar */
.meeting-layout-v2 .chat-msg-avatar {
  width: 34px; height: 34px;
  min-width: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #58a6ff, #bc8cff);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}
.meeting-layout-v2 .chat-msg-row.is-mine .chat-msg-avatar {
  background: linear-gradient(135deg, #3fb950, #58a6ff);
}

/* Bubble */
.meeting-layout-v2 .chat-msg-bubble {
  background: #21262d;
  border-radius: 14px 14px 14px 4px;
  padding: 10px 14px;
  max-width: 75%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.meeting-layout-v2 .chat-msg-row.is-mine .chat-msg-bubble {
  background: #1f6feb22;
  border: 1px solid #1f6feb44;
  border-radius: 14px 14px 4px 14px;
}
.meeting-layout-v2 .chat-msg-bubble.is-image {
  padding: 6px;
  background: transparent;
  border: none;
}

/* Header */
.meeting-layout-v2 .chat-msg-header {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.meeting-layout-v2 .chat-msg-name {
  font-size: 12px;
  font-weight: 600;
  color: #58a6ff;
}
.meeting-layout-v2 .chat-msg-row.is-mine .chat-msg-name {
  color: #7ee787;
}

/* Enterprise badge */
.meeting-layout-v2 .chat-enterprise-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border-radius: 10px;
  background: rgba(63, 185, 80, 0.1);
  border: 1px solid rgba(63, 185, 80, 0.3);
  color: #3fb950;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

/* Message body */
.meeting-layout-v2 .chat-msg-body {
  font-size: 13px;
  line-height: 1.6;
  color: #e6edf3;
  word-break: break-word;
}

/* Footer */
.meeting-layout-v2 .chat-msg-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
}
.meeting-layout-v2 .chat-msg-row.is-mine .chat-msg-footer {
  justify-content: flex-end;
}
.meeting-layout-v2 .chat-msg-time {
  font-size: 10px;
  color: #484f58;
}

/* Read status */
.meeting-layout-v2 .chat-read-status {
  font-size: 10px;
  color: #484f58;
}
.meeting-layout-v2 .chat-read-status.is-read {
  color: #3fb950;
}

/* Image in chat */
.meeting-layout-v2 .chat-image-content {
  max-width: 240px;
  max-height: 240px;
  border-radius: 8px;
  cursor: pointer;
  display: block;
  object-fit: contain;
  transition: transform 0.15s;
}
.meeting-layout-v2 .chat-image-content:hover {
  transform: scale(1.02);
}
.meeting-layout-v2 .chat-image-link {
  display: block;
  line-height: 0;
}

/* Input area */
.meeting-layout-v2 .chat-input-area {
  padding: 10px 12px;
  border-top: 1px solid #21262d;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #161b22;
}
.meeting-layout-v2 .chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.meeting-layout-v2 .chat-textarea {
  flex: 1;
  min-height: 44px;
  max-height: 100px;
  padding: 8px 12px;
  border: 1px solid #30363d;
  border-radius: 10px;
  font-size: 13px;
  resize: none;
  background: #0d1117;
  color: #c9d1d9;
  transition: border-color 0.15s;
  line-height: 1.5;
  font-family: inherit;
}
.meeting-layout-v2 .chat-textarea:focus {
  border-color: #58a6ff;
  box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.15);
  outline: none;
}

/* Input actions */
.meeting-layout-v2 .chat-input-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Image upload button */
.meeting-layout-v2 .chat-image-btn {
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid #30363d;
  background: #21262d;
  color: #8b949e;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.meeting-layout-v2 .chat-image-btn:hover {
  color: #58a6ff;
  border-color: #58a6ff;
  background: rgba(88, 166, 255, 0.1);
}

/* Send button */
.meeting-layout-v2 .btn.btn-send {
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  background: #238636;
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
.meeting-layout-v2 .btn.btn-send:hover { background: #2ea043; }
.meeting-layout-v2 .btn.btn-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Image preview */
.meeting-layout-v2 .chat-image-preview {
  position: relative;
  display: inline-block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #30363d;
}
.meeting-layout-v2 .chat-image-preview img {
  max-width: 160px;
  max-height: 120px;
  display: block;
  object-fit: cover;
}
.meeting-layout-v2 .chat-remove-image {
  position: absolute;
  top: 4px; right: 4px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: none;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.meeting-layout-v2 .chat-remove-image:hover { background: #da3633; }

/* Members panel */
.meeting-layout-v2 .member-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}
.meeting-layout-v2 .member-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  gap: 12px;
  transition: background 0.15s;
}
.meeting-layout-v2 .member-item:hover { background: #21262d; }
.meeting-layout-v2 .member-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #58a6ff, #bc8cff);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.meeting-layout-v2 .member-info { flex: 1; min-width: 0; }
.meeting-layout-v2 .member-name {
  font-size: 13px;
  font-weight: 600;
  color: #e6edf3;
}
.meeting-layout-v2 .member-role {
  font-size: 11px;
  color: #8b949e;
}
.meeting-layout-v2 .member-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.meeting-layout-v2 .member-actions .btn {
  font-size: 11px;
  padding: 3px 10px;
  height: 26px;
  border-radius: 5px;
  border: 1px solid #30363d;
  background: #21262d;
  color: #c9d1d9;
  cursor: pointer;
  transition: all 0.15s;
}
.meeting-layout-v2 .member-actions .btn:hover {
  background: #30363d;
  border-color: #484f58;
}
.meeting-layout-v2 .empty {
  color: #484f58;
  text-align: center;
  padding: 24px 0;
  font-size: 13px;
}

/* ---- Screen Share Fullscreen Mode (Desktop) ---- */
.meeting-layout-v2.desktop-screen-share-active .meeting-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: linear-gradient(180deg, rgba(13, 17, 23, 0.95), rgba(13, 17, 23, 0.6));
  border-bottom: none;
  pointer-events: none;
}
.meeting-layout-v2.desktop-screen-share-active .meeting-header > * { pointer-events: auto; }
.meeting-layout-v2.desktop-screen-share-active .meeting-footer {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  background: linear-gradient(0deg, rgba(13, 17, 23, 0.95), rgba(13, 17, 23, 0.6));
  border-top: none;
  pointer-events: none;
}
.meeting-layout-v2.desktop-screen-share-active .meeting-footer > * { pointer-events: auto; }
.meeting-layout-v2.desktop-screen-share-active .meeting-rail { display: none; }
.meeting-layout-v2.desktop-screen-share-active .video-stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: #000;
}
.meeting-layout-v2.desktop-screen-share-active .video-stage-grid.has-screen-share {
  position: absolute;
  inset: 0;
  display: flex !important;
}
.meeting-layout-v2.desktop-screen-share-active .video-feed-label {
  bottom: 80px;
}

/* ---- Mobile Layout Override ---- */
.meeting-layout-v2.is-mobile-layout {
  grid-template-rows: auto minmax(0, 1fr) 66px 72px;
}
.meeting-layout-v2.is-mobile-layout .meeting-header {
  height: auto;
  min-height: 44px;
  padding: 6px 10px;
  flex-wrap: wrap;
  gap: 6px;
}
.meeting-layout-v2.is-mobile-layout .meeting-header-main {
  flex-wrap: wrap;
  gap: 6px;
}
.meeting-layout-v2.is-mobile-layout .meeting-title {
  font-size: 13px;
  max-width: 200px;
}
.meeting-layout-v2.is-mobile-layout .meeting-detail-body {
  width: calc(100vw - 20px);
  left: 0;
  grid-template-columns: repeat(2, 1fr);
  max-height: calc(100dvh - 72px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.meeting-layout-v2.is-mobile-layout .meeting-shell {
  flex-direction: column;
}
.meeting-layout-v2.is-mobile-layout .meeting-rail {
  display: none;
}
.meeting-layout-v2.is-mobile-layout .meeting-main {
  flex: 1;
  min-height: 0;
}
.meeting-layout-v2.is-mobile-layout .video-stage {
  flex: 1;
  min-height: 0;
}
.meeting-layout-v2.is-mobile-layout .video-stage-grid {
  grid-template-columns: 1fr;
  gap: 3px;
  padding: 3px;
}
.meeting-layout-v2.is-mobile-layout .video-stage-grid.feed-count-2 {
  grid-template-columns: 1fr 1fr;
}
.meeting-layout-v2.is-mobile-layout .video-feed-card {
  aspect-ratio: 16/10;
  border-radius: 6px;
}
/* Mobile screen share — maximize display area */
.meeting-layout-v2.is-mobile-layout .video-stage-grid.has-screen-share {
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 0;
  background: #000;
}
.meeting-layout-v2.is-mobile-layout .video-stage-grid.has-screen-share .video-feed-card.source-screen_share {
  flex: 1;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
  border: none;
  background: #000;
}
.meeting-layout-v2.is-mobile-layout .video-stage-grid.has-screen-share .video-feed-slot {
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.meeting-layout-v2.is-mobile-layout .video-stage-grid.has-screen-share .video-feed-slot video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.meeting-layout-v2.is-mobile-layout .meeting-footer {
  height: 72px;
  min-height: 72px;
  padding: 0 4px;
  gap: 2px;
  overflow-x: auto;
  justify-content: flex-start;
}
.meeting-layout-v2.is-mobile-layout .footer-left,
.meeting-layout-v2.is-mobile-layout .footer-center,
.meeting-layout-v2.is-mobile-layout .footer-right {
  gap: 2px;
  flex-shrink: 0;
}
.meeting-layout-v2.is-mobile-layout .footer-center { display: none; }
.meeting-layout-v2.is-mobile-layout .audio-controls {
  gap: 2px;
}
.meeting-layout-v2.is-mobile-layout .control-btn {
  min-width: 46px;
  height: 48px;
  padding: 3px 4px;
  gap: 2px;
  border-radius: 8px;
}
.meeting-layout-v2.is-mobile-layout .control-label {
  font-size: 9px;
}
.meeting-layout-v2.is-mobile-layout .leave-btn {
  padding: 6px 10px;
  font-size: 11px;
  min-width: 56px;
  height: 34px;
}
.meeting-layout-v2.is-mobile-layout .meeting-sidebar {
  width: 100%;
  max-width: 100vw;
  top: 0;
  bottom: 0;
  z-index: 60;
  border-radius: 0;
  border-left: none;
}
/* Mobile participant strip below video */
.meeting-layout-v2.is-mobile-layout .mobile-participant-strip {
  display: flex;
  gap: 4px;
  padding: 4px 6px;
  background: #161b22;
  border-top: 1px solid #21262d;
  border-bottom: 1px solid #21262d;
  overflow-x: auto;
  scrollbar-width: none;
  height: 66px;
  min-height: 66px;
  align-items: center;
}
.meeting-layout-v2.is-mobile-layout .mobile-participant-strip::-webkit-scrollbar { display: none; }
.meeting-layout-v2.is-mobile-layout .mobile-participant-strip .participant-card {
  flex: 0 0 54px;
  min-width: 54px;
  min-height: 54px;
  padding: 4px;
  border-radius: 10px;
  gap: 2px;
}
.meeting-layout-v2.is-mobile-layout .mobile-participant-strip .avatar-circle {
  width: 26px; height: 26px;
  font-size: 11px;
}
.meeting-layout-v2.is-mobile-layout .mobile-participant-strip .participant-name {
  font-size: 8px;
  gap: 1px;
}

/* ==========================================================================
   9. Responsive / Mobile Styles
   ========================================================================== */

/* ---- Admin Sidebar Mobile ---- */
@media (max-width: 768px) {
  .admin-sider {
    position: fixed;
    left: calc(-1 * 256px);
    height: 100vh;
    height: 100dvh;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
    transition: left 0.3s ease;
  }
  .admin-sider.is-open { left: 0; }
  .admin-container { width: 100%; }
  .admin-header { padding: 0 16px; }
  .admin-content { padding: 16px; }
}

/* ---- Meeting Layout Mobile ---- */
.meeting-layout.is-mobile-layout { background: #1a1a1a; }
.meeting-layout.is-mobile-layout .meeting-header {
  height: auto;
  min-height: 64px;
  padding: 10px 12px;
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
}
.meeting-layout.is-mobile-layout .meeting-header-info,
.meeting-layout.is-mobile-layout .header-right {
  width: 100%;
}
.meeting-layout.is-mobile-layout .header-right {
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.meeting-layout.is-mobile-layout .meeting-title {
  font-size: 15px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.meeting-layout.is-mobile-layout .global-voice-status,
.meeting-layout.is-mobile-layout .online-status {
  max-width: 100%;
}
.meeting-layout.is-mobile-layout .meeting-sidebar {
  width: 100%;
  z-index: 35;
  top: 0;
  border-radius: 0;
}
.meeting-layout.is-mobile-layout .meeting-main {
  padding: 0;
  margin-right: 0 !important;
  gap: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
}
.meeting-layout.is-mobile-layout .participant-grid {
  display: flex;
  order: 2;
  flex-direction: row;
  align-items: stretch;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
  min-width: 0;
  max-width: none;
  height: 86px;
  min-height: 86px;
  padding: 6px 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: rgba(26, 26, 26, 0.95);
}
.meeting-layout.is-mobile-layout .participant-grid-remote {
  display: flex;
  flex-direction: row;
  gap: 6px;
}
.meeting-layout.is-mobile-layout .video-stage {
  order: 1;
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  border-radius: 0;
  aspect-ratio: auto;
  max-height: none;
  background: #000;
  border: none;
  box-shadow: none;
  overflow: hidden;
  margin: 0;
}
.meeting-layout.is-mobile-layout .video-stage-empty {
  min-height: 0;
  height: 100%;
  font-size: 12px;
  padding: 16px;
  color: rgba(255, 255, 255, 0.4);
  background: #0a0a0a;
}
.meeting-layout.is-mobile-layout .video-stage-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: transparent;
}
.meeting-layout.is-mobile-layout .participant-card {
  flex: 0 0 72px;
  width: 72px;
  min-width: 72px;
  aspect-ratio: 1;
  min-height: 72px;
  border-radius: 14px;
  scroll-snap-align: start;
}
.meeting-layout.is-mobile-layout .avatar-circle {
  width: 28px; height: 28px;
  font-size: 12px;
}
.meeting-layout.is-mobile-layout .participant-name {
  font-size: 9px;
  padding: 2px 4px;
  bottom: 3px; left: 3px; right: 3px;
  gap: 3px;
  justify-content: space-between;
}
.meeting-layout.is-mobile-layout .video-feed-card {
  flex: 1 1 auto;
  aspect-ratio: 9 / 16;
  min-height: 0;
  border-radius: 0;
  border: none;
}
.meeting-layout.is-mobile-layout .video-feed-slot video {
  object-fit: contain;
}
.meeting-layout.is-mobile-layout .video-feed-label {
  left: 8px; right: 8px; bottom: 8px;
  font-size: 10px;
  text-align: center;
}
.meeting-layout.is-mobile-layout .meeting-footer {
  padding: 0 6px;
  height: 66px;
}
.meeting-layout.is-mobile-layout .footer-left,
.meeting-layout.is-mobile-layout .footer-center,
.meeting-layout.is-mobile-layout .footer-right {
  gap: 4px;
}
.meeting-layout.is-mobile-layout .footer-left {
  flex: 1;
  min-width: 0;
}
.meeting-layout.is-mobile-layout .audio-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  max-width: 100%;
}
.meeting-layout.is-mobile-layout .footer-center {
  flex: 0 0 auto;
}
.meeting-layout.is-mobile-layout .control-btn {
  min-width: 44px;
  padding: 4px;
}
.meeting-layout.is-mobile-layout .control-label { font-size: 10px; }
.meeting-layout.is-mobile-layout .leave-btn {
  padding: 6px 10px;
  font-size: 12px;
}
.meeting-layout.is-mobile-layout .participant-grid::-webkit-scrollbar,
.meeting-layout.is-mobile-layout .audio-controls::-webkit-scrollbar { display: none; }

/* ---- General Responsive ---- */
@media (max-width: 1100px) {
  .app-shell, .room-shell, .grid-3, .grid-2, .form-grid, .video-grid {
    grid-template-columns: 1fr;
  }
  .sidebar { display: none; }
  .content { padding: 18px; }
  .page-header { flex-direction: column; }
}

/* ==========================================================================
   10. Dark Mode (for remote_devices & theme toggle)
   ========================================================================== */
[data-theme="dark"] {
  --bg-body: #0f0f16;
  --bg-card: #1a1a26;
  --bg-elevated: #22222f;
  --bg-hover: #252536;
  --bg-active: #2a2a3d;
  --text-primary: #f0f0f5;
  --text-secondary: #a0a0b5;
  --text-tertiary: #787890;
  --text-muted: #5a5a70;
  --border-light: #2a2a3a;
  --border-default: #33334a;
  --border-strong: #40405a;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5), 0 4px 8px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
  --accent-soft: rgba(91, 95, 227, 0.15);
  --accent-ring: rgba(91, 95, 227, 0.3);
}

[data-theme="dark"] .table th {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-color: var(--border-default);
}
[data-theme="dark"] .table td {
  color: var(--text-primary);
  border-color: var(--border-light);
}
[data-theme="dark"] .table tbody tr:hover { background: var(--bg-hover); }

[data-theme="dark"] .input,
[data-theme="dark"] .select,
[data-theme="dark"] .textarea {
  background: var(--bg-elevated);
  border-color: var(--border-default);
  color: var(--text-primary);
}
[data-theme="dark"] .input:hover,
[data-theme="dark"] .select:hover,
[data-theme="dark"] .textarea:hover { border-color: var(--border-strong); }
[data-theme="dark"] .input[readonly] {
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .btn-secondary {
  background: var(--bg-elevated);
  border-color: var(--border-default);
  color: var(--text-primary);
}

[data-theme="dark"] .empty { color: var(--text-muted); }
[data-theme="dark"] .hint { color: var(--text-tertiary); }

[data-theme="dark"] .chat-textarea {
  background: var(--bg-elevated);
  border-color: var(--border-default);
  color: var(--text-primary);
}

/* ==========================================================================
   11. Legacy / Utility Classes (preserved for backward compat)
   ========================================================================== */

/* Legacy room styles */
.room-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
}
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.video-card { padding: 18px; }
.video-placeholder {
  width: 100%; height: 280px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gray-100), var(--gray-50));
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}
.video-title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.side-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.chat-box {
  height: 360px;
  overflow-y: auto;
  padding: 8px 0;
}

.room-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

/* Voice grid */
.voice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.voice-grid-remote { display: contents; }
.voice-card {
  min-height: 136px;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--gray-50) 100%);
}
.voice-card.is-self {
  border-color: rgba(91, 95, 227, 0.25);
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--bg-card) 100%);
}
.voice-name {
  font-size: var(--text-md);
  font-weight: 700;
  margin-bottom: 8px;
}
.voice-meta {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
  margin-bottom: 14px;
}
.voice-state {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  background: var(--gray-75);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: 600;
}

/* ---- Page specific overrides are in each PHP file's <style> block ---- */

/* ==========================================================================
   12. Animations & Keyframes
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-fade-in { animation: fadeIn var(--duration-slow) var(--ease-out) forwards; }
.animate-slide-up { animation: slideUp var(--duration-slow) var(--ease-out) forwards; }
.animate-scale-in { animation: scaleIn var(--duration-normal) var(--ease-out) forwards; }

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-75) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

/* Toast / Notification */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  z-index: 1000;
  animation: slideUp var(--duration-normal) var(--ease-out);
}

/* SPA loading overlay */
.spa-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(250, 250, 250, 0.6);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.spa-loading-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
