/* ============================================
   OwazLab - Redesigned UI
   Clean, Modern Design System
   ============================================ */

:root {
  /* Brand Colors */
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #93c5fd;
  --primary-50: #eff6ff;
  --secondary: #f59e0b;
  --secondary-dark: #d97706;
  --accent: #8b5cf6;

  /* Status Colors */
  --success: #10b981;
  --success-light: #34d399;
  --warning: #f59e0b;
  --warning-light: #fbbf24;
  --danger: #ef4444;
  --danger-light: #f87171;
  --info: #06b6d4;
  --info-light: #22d3ee;

  /* Neutral Colors */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Theme Variables */
  --background: #f1f5f9;
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --surface-light: #f8fafc;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --border-color: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  /* Sidebar */
  --sidebar-bg: #0f172a;
  --sidebar-border: #1e293b;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  --sidebar-nav-hover: #1e293b;
  --sidebar-nav-active: var(--primary);

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;

  /* Transitions */
  --transition: all 0.2s ease;
  --transition-fast: all 0.15s ease;
  --transition-slow: all 0.3s ease;

  /* Typography */
  --font-family: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Sidebar Width */
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;
}

/* Dark Theme */
[data-theme="dark"] {
  --background: #0f172a;
  --surface: #1e293b;
  --surface-hover: #334155;
  --surface-light: #1e293b;
  --border: #334155;
  --border-light: #1e293b;
  --border-color: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;

  --sidebar-bg: #020617;
  --sidebar-border: #1e293b;
  --sidebar-text: #64748b;
  --sidebar-text-active: #f1f5f9;
  --sidebar-nav-hover: #1e293b;

  --gray-50: #1e293b;
  --gray-100: #334155;
  --gray-200: #475569;
}

/* ============================================
   SVG Icon Base
   ============================================ */

.icon {
  width: 1.125em;
  height: 1.125em;
  display: inline-block;
  vertical-align: -0.15em;
  flex-shrink: 0;
}

.icon-sm {
  width: 0.875em;
  height: 0.875em;
}

.icon-lg {
  width: 1.5em;
  height: 1.5em;
}

.icon-xl {
  width: 2em;
  height: 2em;
}

/* ============================================
   Base Styles
   ============================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Layout Components
   ============================================ */

.dashboard-container {
  display: flex;
  min-height: 100vh;
  background: var(--background);
}

/* ============================================
   Sidebar Styles
   ============================================ */

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 1000;
  transition: width 0.25s ease;
  border-right: 1px solid var(--sidebar-border);
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--sidebar-border);
  min-height: 65px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--sidebar-text-active);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.3px;
  text-decoration: none;
}

.logo .icon {
  width: 32px;
  height: 32px;
  color: white;
  padding: 6px;
  background: var(--primary);
  border-radius: 8px;
  flex-shrink: 0;
}

.sidebar.collapsed .logo span {
  display: none;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--sidebar-text);
  font-size: 1.125rem;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle .icon {
  width: 20px;
  height: 20px;
}

.sidebar-toggle:hover {
  background: var(--sidebar-nav-hover);
  color: var(--sidebar-text-active);
}

.sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  color: var(--sidebar-text);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 6px;
}

.sidebar-close-btn .icon {
  width: 20px;
  height: 20px;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
}

.nav-list {
  list-style: none;
}

.nav-item {
  margin-bottom: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.25rem;
  margin: 0 0.75rem;
  color: var(--sidebar-text);
  text-decoration: none;
  transition: var(--transition-fast);
  border-radius: var(--radius-md);
  position: relative;
  font-size: 0.875rem;
  font-weight: 450;
}

.nav-link .icon {
  width: 20px;
  height: 20px;
  opacity: 0.7;
  flex-shrink: 0;
}

.nav-link:hover {
  background: var(--sidebar-nav-hover);
  color: var(--sidebar-text-active);
}

.nav-link:hover .icon {
  opacity: 1;
}

.nav-link.active {
  background: rgba(37, 99, 235, 0.15);
  color: var(--primary-light);
  font-weight: 500;
}

.nav-link.active .icon {
  opacity: 1;
  color: var(--primary-light);
}

.sidebar.collapsed .nav-link span {
  display: none;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.header-theme-switch {
  display: flex;
  align-items: center;
  margin: 0;
}

/* Language Selector in Sidebar */
.language-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: var(--sidebar-nav-hover);
  border-radius: var(--radius);
  margin-bottom: 0.25rem;
}

.language-selector-wrapper select {
  background: transparent;
  border: none;
  color: var(--sidebar-text);
  font-size: 0.8125rem;
  cursor: pointer;
  font-family: inherit;
  outline: none;
  flex: 1;
}

.sidebar.collapsed .language-selector-wrapper {
  justify-content: center;
  padding: 0.375rem;
}

.sidebar.collapsed .language-selector-wrapper select {
  display: none;
}

.support-btn,
.logout-btn {
  width: 100%;
  background: none;
  border: 1px solid var(--sidebar-border);
  color: var(--sidebar-text);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.625rem;
  justify-content: center;
  font-size: 0.8125rem;
  font-family: inherit;
  white-space: nowrap;
}

.support-btn .icon,
.logout-btn .icon {
  width: 16px;
  height: 16px;
}

.support-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-inverse);
}

.logout-btn:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--text-inverse);
}

.sidebar.collapsed .support-btn span,
.sidebar.collapsed .logout-btn span {
  display: none;
}

.sidebar.collapsed .support-btn,
.sidebar.collapsed .logout-btn {
  width: auto;
  padding: 0.5rem;
}

/* ============================================
   Main Content Styles
   ============================================ */

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  background: var(--background);
  transition: margin-left 0.25s ease;
}

.sidebar.collapsed + .main-content {
  margin-left: var(--sidebar-collapsed-width);
}

.top-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 65px;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 6px;
}

.mobile-menu-btn .icon {
  width: 24px;
  height: 24px;
}

.header-left h1 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.header-left p {
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.375rem 0.625rem;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.user-info:hover {
  background: var(--surface-hover);
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-inverse);
  font-weight: 600;
  font-size: 0.875rem;
}

.user-avatar .icon {
  width: 20px;
  height: 20px;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============================================
   Content Wrapper
   ============================================ */

.content-wrapper {
  padding: 1.5rem 2rem;
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
  animation: fadeSlideIn 0.3s ease;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Section Header
   ============================================ */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.section-header .header-left h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.125rem;
}

.section-header .header-left p {
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
}

/* ============================================
   Stats Grid (Overview)
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: var(--transition);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card .stat-icon .icon {
  width: 22px;
  height: 22px;
}

.stat-card .stat-icon.blue {
  background: var(--primary-50);
  color: var(--primary);
}

.stat-card .stat-icon.green {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.stat-card .stat-icon.purple {
  background: rgba(139, 92, 246, 0.1);
  color: var(--accent);
}

.stat-card .stat-icon.amber {
  background: rgba(245, 158, 11, 0.1);
  color: var(--secondary);
}

.stat-card .stat-content {
  flex: 1;
}

.stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 0.125rem;
}

/* ============================================
   Overview Grid (Charts, Recent, Leaderboard)
   ============================================ */

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.overview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-content {
  padding: 1.25rem;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
}

.btn .icon {
  width: 16px;
  height: 16px;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

.btn-sm .icon {
  width: 14px;
  height: 14px;
}

.btn-primary {
  background: var(--primary);
  color: var(--text-inverse);
  border: none;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  text-decoration: none;
}

.btn-primary .icon {
  width: 18px;
  height: 18px;
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border);
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
}

.btn-secondary .icon {
  width: 18px;
  height: 18px;
}

.btn-secondary:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-inverse);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: inherit;
  text-decoration: none;
}

.btn-outline .icon {
  width: 16px;
  height: 16px;
}

.btn-outline:hover {
  background: var(--surface-hover);
  border-color: var(--gray-300);
  color: var(--text-primary);
}

.btn-success {
  background: var(--success);
  color: var(--text-inverse);
  border: none;
}

.btn-success:hover {
  background: #059669;
}

.btn-danger {
  background: var(--danger);
  color: var(--text-inverse);
  border: none;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-text {
  flex: 1;
}

.btn-icon {
  transition: transform 0.2s ease;
}

.btn-icon .icon {
  width: 16px;
  height: 16px;
}

.btn-primary:hover .btn-icon,
.btn-secondary:hover .btn-icon {
  transform: translateX(2px);
}

/* ============================================
   Recording Section
   ============================================ */

.record-container {
  max-width: 680px;
  margin: 0 auto;
}

.daily-stats-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 2rem;
  margin-bottom: 1.5rem;
}

.daily-stat-item {
  text-align: center;
}

.daily-stat-item .stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.daily-stat-item .stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.125rem;
}

.daily-stat-item.accepted .stat-value {
  color: var(--success);
}

.daily-stat-item.processing .stat-value {
  color: var(--secondary);
}

.stat-separator {
  color: var(--text-muted);
  font-weight: 400;
}

.stat-total {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 1rem;
}

.daily-stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

/* Progress Tracker */
.progress-tracker {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 0;
  margin-bottom: 1.5rem;
  gap: 0;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  position: relative;
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  transition: var(--transition);
  border: 2px solid transparent;
}

.step-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: var(--transition);
}

.progress-step.active .step-number {
  background: var(--primary);
  color: white;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.progress-step.active .step-label {
  color: var(--primary);
  font-weight: 600;
}

.progress-step.completed .step-number {
  background: var(--success);
  color: white;
}

.progress-step.completed .step-label {
  color: var(--success);
}

.progress-line {
  width: 60px;
  height: 2px;
  background: var(--gray-200);
  margin: 0 0.5rem;
  margin-bottom: 1.5rem;
  transition: var(--transition);
}

.progress-line.completed {
  background: var(--success);
}

/* Recording Steps */
.recording-steps {
  position: relative;
}

.step-container {
  display: none;
}

.step-container.active {
  display: block;
  animation: fadeSlideIn 0.3s ease;
}

.record-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1rem;
}

.record-card .card-header h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.record-card .card-header .icon {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.text-display {
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  text-align: center;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.record-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.record-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  color: white;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3);
}

.record-btn .icon {
  width: 28px;
  height: 28px;
}

.record-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.4);
}

.record-btn.recording {
  background: var(--danger);
  animation: pulse-record 1.5s infinite;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

@keyframes pulse-record {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  70% { box-shadow: 0 0 0 16px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.btn-label {
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.text-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.skip-hint {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* Recording Status */
.recording-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.recording-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--danger);
  font-weight: 500;
  font-size: 0.875rem;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  background: var(--danger);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.recording-pulse {
  animation: pulse 1.5s infinite;
}

/* Review */
.review-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1rem;
}

.audio-preview-container {
  margin-bottom: 1rem;
}

.recording-info {
  margin-top: 0.5rem;
}

.recording-status-text {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  color: var(--success);
}

.recording-status-text .icon {
  width: 18px;
  height: 18px;
  margin-right: 0.5rem;
}

/* Success Animation */
.success-card {
  text-align: center;
}

.success-animation {
  padding: 2.5rem 1.5rem;
}

.success-icon {
  margin-bottom: 1rem;
}

.success-icon .icon {
  width: 64px;
  height: 64px;
  color: var(--success);
  animation: success-bounce 0.6s ease-out;
}

@keyframes success-bounce {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.1); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

.success-animation h3 {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.success-animation p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

/* ============================================
   Validation Embedded Container
   ============================================ */

.validation-embedded-container {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.validation-processing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.validation-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 28px;
}

.wave-bar {
  width: 4px;
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  animation: wave 1.2s ease-in-out infinite;
}

.wave-bar:nth-child(2) { animation-delay: -1.1s; }
.wave-bar:nth-child(3) { animation-delay: -1.0s; }
.wave-bar:nth-child(4) { animation-delay: -0.9s; }
.wave-bar:nth-child(5) { animation-delay: -0.8s; }

@keyframes wave {
  0%, 40%, 100% { transform: scaleY(0.4); }
  20% { transform: scaleY(1); }
}

.validation-result-card {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.result-header {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.result-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
}

.result-title .icon {
  width: 20px;
  height: 20px;
}

.result-body {
  padding: 0 1.25rem 1.25rem;
  display: flex;
  align-items: stretch;
  gap: 1rem;
}

.comparison-box {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.comparison-box h4 {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.comparison-box h4 .icon {
  width: 14px;
  height: 14px;
}

.comparison-box p {
  font-size: 0.875rem;
  color: var(--text-primary);
  line-height: 1.5;
}

.match-score-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem;
}

.match-score-circle {
  width: 64px;
  height: 64px;
}

.circular-chart {
  width: 100%;
  height: 100%;
}

.circle-bg {
  fill: none;
  stroke: var(--gray-200);
  stroke-width: 3;
}

.circle {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray 0.6s ease;
}

.percentage {
  fill: var(--text-primary);
  font-size: 0.5em;
  text-anchor: middle;
  font-weight: 700;
}

.match-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.result-actions {
  padding: 0 1.25rem 1.25rem;
  display: flex;
  gap: 0.75rem;
}

/* ============================================
   Data Table
   ============================================ */

.data-table-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background: var(--gray-50);
  padding: 0.75rem 1.25rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table td {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.data-table tbody tr:hover {
  background: var(--surface-hover);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Action Buttons (Table) */
.action-buttons {
  display: flex;
  gap: 0.375rem;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
}

.action-buttons .btn {
  min-width: 75px;
  white-space: nowrap;
}

.action-buttons .btn-sm {
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  min-width: 72px;
  width: 72px;
}

.check-recording-btn,
.delete-recording-btn {
  width: 90px !important;
  min-width: 72px;
  text-align: center;
  justify-content: center;
}

/* ============================================
   Leaderboard
   ============================================ */

.leaderboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
}

.leaderboard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
}

.leaderboard-item:last-child {
  border-bottom: none;
}

.leaderboard-item:hover {
  background: var(--surface-hover);
}

.leaderboard-item.top-3 {
  border-left: 3px solid var(--secondary);
}

.leader-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.leader-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.leaderboard-item.top-3:nth-child(1) .leader-rank {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
}

.leaderboard-item.top-3:nth-child(2) .leader-rank {
  background: linear-gradient(135deg, #cbd5e1, #94a3b8);
  color: white;
}

.leaderboard-item.top-3:nth-child(3) .leader-rank {
  background: linear-gradient(135deg, #fdba74, #f97316);
  color: white;
}

.leader-name {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.leader-stats {
  text-align: right;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.leaderboard-stats,
.leaderboard-stats-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.stat-item .stat-icon {
  width: 42px;
  height: 42px;
  background: var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-inverse);
  flex-shrink: 0;
}

.stat-item .stat-icon .icon {
  width: 20px;
  height: 20px;
}

.stat-info {
  flex: 1;
}

.stat-info .stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-info .stat-label {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

/* ============================================
   Filter Tabs
   ============================================ */

.filter-tabs {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
}

.filter-tab {
  background: transparent;
  border: none;
  padding: 0.375rem 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.8125rem;
  font-family: inherit;
  font-weight: 500;
}

.filter-tab:hover {
  background: var(--surface-hover);
}

.filter-tab.active {
  background: var(--primary);
  color: var(--text-inverse);
}

.filter-tab:not(:last-child) {
  border-right: 1px solid var(--border);
}

/* Leaderboard Filter Panel */
.leaderboard-filter-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.filter-row {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.filter-group-search {
  flex: 1;
  min-width: 180px;
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.filter-group label .icon {
  width: 14px;
  height: 14px;
}

.filter-input {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 0.8125rem;
  transition: var(--transition);
  font-family: inherit;
}

.filter-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-actions {
  display: flex;
  gap: 0.375rem;
}

/* Silent Type Tabs */
.silent-type-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.silent-tab {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.silent-tab .icon {
  width: 16px;
  height: 16px;
}

.silent-tab:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.silent-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.leaderboard-main-content {
  display: flex;
  flex-direction: column;
}

.leaderboard-grid .leaderboard-card.tab-content {
  grid-column: 1 / -1;
  animation: fadeSlideIn 0.3s ease;
  display: block;
}

/* ============================================
   Profile Styles
   ============================================ */

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.profile-avatar {
  text-align: center;
  margin-bottom: 1.5rem;
}

.avatar-circle {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
}

.avatar-circle .icon {
  width: 40px;
  height: 40px;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-group {
  margin-bottom: 0.75rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.375rem;
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-control {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: var(--transition);
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control:read-only {
  background: var(--gray-50);
  color: var(--text-secondary);
}

.stats-list {
  display: flex;
  flex-direction: column;
}

.stats-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-light);
}

.stats-item:last-child {
  border-bottom: none;
}

.stats-label {
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.stats-value {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.preferences-list {
  display: flex;
  flex-direction: column;
}

.preference-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-light);
}

.preference-item:last-child {
  border-bottom: none;
}

.preference-info label {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.875rem;
  margin-bottom: 0.125rem;
}

.preference-info p {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  margin: 0;
}

/* ============================================
   Theme Toggle
   ============================================ */

.theme-toggle {
  display: inline-block;
  height: 28px;
  position: relative;
  width: 52px;
}

.theme-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--gray-300);
  transition: 0.3s;
  border-radius: 28px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

.slider .sun-icon,
.slider .moon-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transition: 0.3s;
}

.slider .sun-icon {
  left: 6px;
  color: var(--warning);
  opacity: 1;
}

.slider .moon-icon {
  right: 6px;
  color: #1e293b;
  opacity: 0;
}

.slider .sun-icon .icon,
.slider .moon-icon .icon {
  width: 14px;
  height: 14px;
}

input:checked + .slider .sun-icon {
  opacity: 0;
}

input:checked + .slider .moon-icon {
  opacity: 1;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--gray-300);
  transition: 0.3s;
  border-radius: 22px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--primary);
}

input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

/* ============================================
   Alerts
   ============================================ */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  border: 1px solid transparent;
}

.alert .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
  color: #92400e;
}

.alert-success {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
  color: #065f46;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
  color: #991b1b;
}

.alert-info {
  background: rgba(6, 182, 212, 0.08);
  border-color: rgba(6, 182, 212, 0.2);
  color: #155e75;
}

/* ============================================
   Toast Notifications
   ============================================ */

.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  pointer-events: none;
  max-width: 380px;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 0.875rem 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  pointer-events: auto;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--info); }
.toast.warning { border-left: 3px solid var(--warning); }

.toast-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-icon .icon {
  width: 18px;
  height: 18px;
}

.toast.success .toast-icon { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.toast.error .toast-icon { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.toast.info .toast-icon { background: rgba(6, 182, 212, 0.1); color: var(--info); }
.toast.warning .toast-icon { background: rgba(245, 158, 11, 0.1); color: var(--warning); }

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.8125rem;
  margin-bottom: 1px;
}

.toast-message {
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-close .icon {
  width: 16px;
  height: 16px;
}

.toast-close:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}

/* ============================================
   Loading Overlay
   ============================================ */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.loading-overlay.show {
  display: flex;
  animation: overlayFadeIn 0.3s ease;
}

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.loading-content {
  background: var(--surface);
  border-radius: var(--radius-xl, 1rem);
  padding: 2.5rem 3rem;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.05);
  min-width: 220px;
  animation: loadingCardIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes loadingCardIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Bouncing dots loader */
.loading-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 1.25rem;
  height: 40px;
}

.loading-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  display: block;
  animation: loadingBounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0s;
}

@keyframes loadingBounce {
  0%, 80%, 100% {
    transform: scale(0.4);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Legacy spinner fallback */
.loading-spinner {
  background: var(--surface);
  border-radius: var(--radius-xl, 1rem);
  padding: 2.5rem 3rem;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.spinner,
.loading-content .loading-spinner,
.loading-spinner .spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 0.75rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-spinner p,
.loading-content p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin: 0;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ============================================
   Modal Styles
   ============================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s ease;
}

.modal-overlay.show .modal-content {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
  padding: 4px;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--gray-100);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding-top: 1rem;
}

.text-display-modal {
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem;
  font-size: 0.875rem;
  line-height: 1.6;
  min-height: 80px;
  max-height: 180px;
  overflow-y: auto;
}

/* ============================================
   Customer Support / Chat
   ============================================ */

.chat-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.message-view-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--gray-50);
}

.message-view-header h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  flex: 1;
}

.message-list {
  padding: 1.25rem;
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.message-reply-form {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--gray-50);
}

.message-reply-form form {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.message-reply-form textarea {
  flex: 1;
  resize: none;
  min-height: 40px;
  max-height: 120px;
}

/* ============================================
   Authentication Styles
   ============================================ */

.auth-body {
  background: var(--gray-900);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(37, 99, 235, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 110%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 1.5rem;
}

.auth-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.register-card {
  max-width: 640px !important;
}

.auth-container:has(.register-card) {
  max-width: 640px;
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  position: relative;
}

.auth-header {
  padding: 2rem 2rem 1.25rem;
  text-align: center;
}

.brand-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.75rem;
}

.brand-logo .icon {
  width: 48px;
  height: 48px;
  color: white;
  padding: 10px;
  background: var(--primary);
  border-radius: 14px;
}

.brand-logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.5px;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0 auto;
  max-width: 300px;
}

.language-selector {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  justify-content: center;
  padding: 0.5rem 0;
}

.auth-language-selector {
  margin: 0 2rem;
  padding: 0.5rem 0.75rem;
  background: var(--gray-50);
  border-radius: var(--radius);
  justify-content: center;
}

.language-selector .icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.language-selector select {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  cursor: pointer;
  font-family: inherit;
  outline: none;
}

.auth-form {
  padding: 1.25rem 2rem 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0;
}

.form-field {
  margin-bottom: 0.875rem;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.8125rem;
  margin-bottom: 0.375rem;
}

.field-label .icon {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--gray-50);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: var(--transition);
  font-family: inherit;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: 12px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.875rem;
  z-index: 2;
}

.input-group .form-input {
  padding-left: 56px;
}

.password-input {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle .icon {
  width: 18px;
  height: 18px;
}

.password-toggle:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}

.select-wrapper {
  position: relative;
}

.form-select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  padding-right: 2rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--gray-50);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.875rem;
  transition: var(--transition);
  appearance: none;
  font-family: inherit;
}

.form-select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.select-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.select-icon .icon {
  width: 16px;
  height: 16px;
}

.field-error {
  display: block;
  color: var(--danger);
  font-size: 0.75rem;
  margin-top: 0.25rem;
  min-height: 0;
  font-weight: 500;
}

.field-hint {
  display: block;
  color: var(--text-muted);
  font-size: 0.6875rem;
  margin-top: 0.25rem;
}

.password-strength {
  margin-top: 0.375rem;
}

.strength-bar {
  height: 3px;
  background: var(--gray-200);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.25rem;
}

.strength-fill {
  height: 100%;
  width: 0%;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.strength-fill.weak { width: 25%; background: var(--danger); }
.strength-fill.fair { width: 50%; background: var(--warning); }
.strength-fill.good { width: 75%; background: var(--info); }
.strength-fill.strong { width: 100%; background: var(--success); }

.strength-text {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.form-actions {
  margin-top: 1.25rem;
}

.form-actions .btn-primary {
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
}

.auth-divider {
  padding: 0 2rem;
  text-align: center;
  position: relative;
}

.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 2rem;
  right: 2rem;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.8125rem;
  padding: 0 0.75rem;
  position: relative;
  z-index: 1;
}

.auth-footer {
  padding: 0.75rem 2rem 1.5rem;
}

.auth-footer .btn-secondary {
  width: 100%;
}

.auth-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.bg-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gray-900);
}

.bg-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(37, 99, 235, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 90% 100%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 30% 30% at 10% 80%, rgba(6, 182, 212, 0.06) 0%, transparent 50%);
  animation: drift 40s ease-in-out infinite;
}

@keyframes drift {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.03) translateY(-5px); }
}

/* Form Field States */
.form-field.success .form-input,
.form-field.success .form-select {
  border-color: var(--success);
}

.form-field.error .form-input,
.form-field.error .form-select {
  border-color: var(--danger);
}

.form-field.error .field-label {
  color: var(--danger);
}

/* ============================================
   Waveform & Playback
   ============================================ */

.waveform-container {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.playback-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.75rem;
}

.playback-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  color: var(--text-inverse);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
}

.playback-btn .icon {
  width: 20px;
  height: 20px;
}

.playback-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

.time-info {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.separator {
  color: var(--text-muted);
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 1024px) {
  .overview-grid {
    grid-template-columns: 1fr 1fr;
  }

  .leaderboard-grid {
    grid-template-columns: 1fr;
  }

  .profile-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
    z-index: 1100;
    transition: transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }

  .main-content {
    margin-left: 0;
  }

  .sidebar.collapsed + .main-content {
    margin-left: 0;
  }

  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar-toggle {
    display: none;
  }

  .sidebar-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .top-header {
    padding: 0.75rem 1rem;
  }

  .content-wrapper {
    padding: 1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .overview-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .progress-tracker {
    padding: 0.75rem 0;
  }

  .progress-step {
    font-size: 0.6875rem;
  }

  .step-number {
    width: 30px;
    height: 30px;
    font-size: 0.8125rem;
  }

  .progress-line {
    width: 36px;
    margin: 0 0.25rem;
  }

  .record-btn {
    width: 64px;
    height: 64px;
  }

  .record-btn .icon {
    width: 24px;
    height: 24px;
  }

  .filter-tabs {
    width: 100%;
  }

  .filter-tab {
    flex: 1;
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
  }

  .toast-container {
    top: 0.5rem;
    right: 0.5rem;
    left: 0.5rem;
    max-width: none;
  }

  .toast {
    min-width: auto;
  }

  /* Mobile table */
  .data-table thead { display: none; }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table tr {
    margin-bottom: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 0;
  }

  .data-table td {
    padding: 0.375rem 0.75rem;
    padding-left: 45%;
    position: relative;
    text-align: right;
    border-bottom: none;
  }

  .data-table td::before {
    content: attr(data-label);
    position: absolute;
    left: 0;
    width: 42%;
    padding-left: 0.75rem;
    font-weight: 600;
    text-align: left;
    color: var(--text-secondary);
    font-size: 0.75rem;
  }

  .action-buttons {
    justify-content: flex-end;
    flex-wrap: nowrap;
  }

  .action-buttons .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.6875rem;
    min-width: 64px;
    width: 64px;
  }

  .check-recording-btn,
  .delete-recording-btn {
    width: 64px !important;
    min-width: 64px;
  }

  .auth-container {
    padding: 0;
    max-width: none;
  }

  .auth-card {
    border-radius: var(--radius-lg);
  }

  .auth-header,
  .auth-form,
  .auth-footer {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .auth-divider {
    padding: 0 1.25rem;
  }

  .auth-divider::before {
    left: 1.25rem;
    right: 1.25rem;
  }

  .auth-language-selector {
    margin: 0 1.25rem;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .brand-logo h1 {
    font-size: 1.25rem;
  }

  .result-body {
    flex-direction: column;
  }

  .filter-row {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .user-info .user-details {
    display: none;
  }

  .text-display {
    font-size: 1rem;
    padding: 1rem;
  }

  .review-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .review-actions .btn {
    width: 100%;
  }

  .preference-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .daily-stats-container {
    padding: 0.75rem 1rem;
    gap: 1rem;
  }
}

/* ============================================
   Utility Classes
   ============================================ */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.hidden { display: none !important; }
.visible { display: block !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 2rem !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 2rem !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 2rem !important; }

.flex { display: flex !important; }
.flex-col { flex-direction: column !important; }
.items-center { align-items: center !important; }
.justify-center { justify-content: center !important; }
.justify-between { justify-content: space-between !important; }
.w-full { width: 100% !important; }
.h-full { height: 100% !important; }
.font-bold { font-weight: 700 !important; }
.font-semibold { font-weight: 600 !important; }
.font-medium { font-weight: 500 !important; }
.text-sm { font-size: 0.875rem !important; }
.text-base { font-size: 1rem !important; }
.text-lg { font-size: 1.125rem !important; }
.text-xl { font-size: 1.25rem !important; }
.text-2xl { font-size: 1.5rem !important; }
.rounded { border-radius: var(--radius) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-full { border-radius: 9999px !important; }
.shadow { box-shadow: var(--shadow) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
