/* ══════════════════════════════════════════════════════════════
   Quicall Admin Dashboard — Unified Theme
   Color: Dark Teal (#1a3c34) + Teal Accent (#0d9488)
   ══════════════════════════════════════════════════════════════ */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --primary-light: #14b8a6;
  --primary-bg: #f0fdfa;
  --primary-50: #f0fdfa;
  --primary-100: #ccfbf1;
  --primary-200: #99f6e4;

  --sidebar-bg: #1a3c34;
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --sidebar-active: rgba(13, 148, 136, 0.25);
  --sidebar-border: rgba(255, 255, 255, 0.06);

  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;

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

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px rgba(0, 0, 0, 0.04);

  --sidebar-w: 250px;
  --font:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition-fast: 0.15s ease;
  --transition: 0.25s ease;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-900);
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Sidebar ─────────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1.5rem 1.4rem;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand h1 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--primary-light), #5eead4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-icon {
  font-size: 1.6rem;
}

.sidebar nav {
  flex: 1;
  padding: 0.6rem 0;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.75rem 1.4rem;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: rgba(255, 255, 255, 0.95);
}

.nav-item.active {
  color: #fff;
  background: var(--sidebar-active);
  border-left-color: var(--primary-light);
}

.nav-icon {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 1rem 1.4rem;
  border-top: 1px solid var(--sidebar-border);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Language toggle */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 0.8rem;
  margin: 0 1rem 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font);
}

.lang-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.lang-icon {
  font-size: 1rem;
}

.lang-current {
  background: var(--primary);
  color: #fff;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
}

/* ── Status Dot ──────────────────────────────────────────── */

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-400);
  flex-shrink: 0;
}

.status-dot.online,
.status-dot.ok {
  background: var(--success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  animation: pulse-dot 2s ease-in-out infinite;
}

.status-dot.fail {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

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

/* ── Main Content ────────────────────────────────────────── */

.content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 2rem 2.5rem;
  max-width: 1280px;
  min-height: 100vh;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.page-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.3px;
}

.refresh-hint {
  font-size: 0.78rem;
  color: var(--gray-400);
  font-weight: 500;
}

/* ── Tab Panels ──────────────────────────────────────────── */

.tab-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}
.tab-panel.active {
  display: block;
}

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

/* ── Stat Cards ──────────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.8rem;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

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

.stat-card.accent {
  border-left-color: var(--accent);
}
.stat-card.success {
  border-left-color: var(--success);
}
.stat-card.info {
  border-left-color: var(--info);
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--gray-500);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.5px;
}

/* ── Card ────────────────────────────────────────────────── */

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.6rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  border: 1px solid var(--gray-100);
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--gray-800);
}

/* ── Tables ──────────────────────────────────────────────── */

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--gray-500);
  padding: 0.75rem 0.85rem;
  border-bottom: 2px solid var(--gray-200);
  font-weight: 700;
}

.data-table td {
  padding: 0.7rem 0.85rem;
  font-size: 0.87rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}
.data-table tbody tr:hover {
  background: var(--primary-50);
}

.empty-msg {
  text-align: center;
  color: var(--gray-400);
  padding: 2.5rem !important;
  font-style: italic;
}

/* ── Badges ──────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.badge-active {
  background: #dcfce7;
  color: #166534;
}
.badge-completed {
  background: var(--gray-100);
  color: var(--gray-700);
}
.badge-ringing {
  background: #fef3c7;
  color: #92400e;
}
.badge-failed {
  background: #fee2e2;
  color: #991b1b;
}
.badge-pending {
  background: var(--gray-100);
  color: var(--gray-500);
}
.badge-ok {
  background: #dcfce7;
  color: #166534;
}

/* ── Buttons ─────────────────────────────────────────────── */

.btn {
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

/* ── Accordion (FAQ) ─────────────────────────────────────── */

.accordion-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.accordion-item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  border: 1px solid var(--gray-100);
  transition: box-shadow var(--transition-fast);
}

.accordion-item:hover {
  box-shadow: var(--shadow);
}

.accordion-header {
  padding: 1rem 1.3rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.accordion-header:hover {
  background: var(--primary-50);
}

.accordion-header .category-tag {
  font-size: 0.68rem;
  background: var(--primary-100);
  color: var(--primary-dark);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  font-weight: 600;
}

.accordion-header .question {
  flex: 1;
  font-weight: 500;
  font-size: 0.92rem;
}

.accordion-header .toggle {
  font-size: 0.85rem;
  color: var(--gray-400);
  transition: transform 0.2s ease;
}

.accordion-item.open .toggle {
  transform: rotate(180deg);
}

.accordion-body {
  display: none;
  padding: 0 1.3rem 1.2rem;
  font-size: 0.88rem;
  color: var(--gray-600);
  line-height: 1.65;
  white-space: pre-line;
}

.accordion-item.open .accordion-body {
  display: block;
}

/* ── Filter Select ───────────────────────────────────────── */

.filter-select {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--gray-700);
  background: var(--white);
  cursor: pointer;
  font-family: var(--font);
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

/* ── Settings ────────────────────────────────────────────── */

.setting-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.setting-row label {
  min-width: 210px;
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--gray-600);
}

.setting-row code {
  background: var(--gray-100);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  word-break: break-all;
  border: 1px solid var(--gray-200);
}

.help-text {
  margin-top: 0.9rem;
  font-size: 0.82rem;
  color: var(--gray-500);
  line-height: 1.55;
}

.help-text a {
  color: var(--primary);
  font-weight: 500;
}
.help-text a:hover {
  color: var(--primary-dark);
}

/* ── Test AI Page ────────────────────────────────────────── */

.test-ai-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 1.5rem;
  border: 1px solid var(--gray-100);
}

.context-fields-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  width: 100%;
}

.hero-divider {
  width: 100%;
  border: none;
  border-top: 1px solid var(--gray-200, #e5e7eb);
  margin: 0;
}

.actions-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 28rem;
}

.actions-stack .phone-input-group {
  width: 100%;
}

.actions-stack .phone-input {
  width: 100%;
  max-width: 100%;
}

.actions-stack .btn {
  width: 100%;
  max-width: 100%;
}


.actions-stack .divider-label {
  font-size: 0.75rem;
  color: var(--gray-500, #6b7280);
  text-align: center;
}

.avatar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  min-width: 200px;
}

.avatar-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: box-shadow 0.4s ease;
}

.avatar-ring::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--primary-light);
  animation: avatar-idle 3s linear infinite;
}

@keyframes avatar-idle {
  to {
    transform: rotate(360deg);
  }
}

.avatar-ring.ringing {
  box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.5);
  animation: ring-pulse 1.2s ease-out infinite;
}

@keyframes ring-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.5);
  }
  70% {
    box-shadow: 0 0 0 20px rgba(13, 148, 136, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(13, 148, 136, 0);
  }
}

.avatar-ring.active {
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.4);
}
.avatar-ring.active::before {
  border-top-color: var(--success);
  animation-duration: 1s;
}

.avatar-ring.listening {
  box-shadow: 0 0 20px rgba(13, 148, 136, 0.4);
}
.avatar-ring.listening::before {
  border-top-color: var(--primary-light);
  animation-duration: 2s;
}
.avatar-ring.listening .avatar-mouth {
  width: 20px;
  height: 4px;
  border-radius: 4px;
}

.avatar-ring.speaking {
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
  animation: speak-glow 0.8s ease-in-out infinite alternate;
}

@keyframes speak-glow {
  0% {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
  }
  100% {
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.6);
  }
}

.avatar-body {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sidebar-bg) 0%, #2d5a4e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.avatar-eyes {
  display: flex;
  gap: 20px;
}

.eye {
  width: 12px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  animation: blink 4s ease-in-out infinite;
}

@keyframes blink {
  0%,
  95%,
  100% {
    transform: scaleY(1);
  }
  97% {
    transform: scaleY(0.1);
  }
}

.avatar-mouth {
  width: 24px;
  height: 8px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 0 0 12px 12px;
  transition: all 0.2s ease;
}

.avatar-ring.active .avatar-mouth {
  height: 14px;
  width: 18px;
  border-radius: 50%;
  animation: talk 0.3s ease-in-out infinite alternate;
}

@keyframes talk {
  0% {
    transform: scaleY(0.6);
  }
  100% {
    transform: scaleY(1.2);
  }
}

.avatar-label {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--gray-900);
}

.avatar-sublabel {
  font-size: 0.82rem;
  color: var(--gray-500);
  font-weight: 500;
}
.avatar-sublabel.calling {
  color: var(--accent);
  font-weight: 600;
}
.avatar-sublabel.active {
  color: var(--success);
  font-weight: 600;
}
.avatar-sublabel.error {
  color: var(--danger);
  font-weight: 600;
}

/* Call Controls */

.call-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
}

.phone-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.phone-input-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-600);
}

.phone-input {
  padding: 0.75rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font);
  color: var(--gray-900);
  transition: border-color var(--transition-fast);
  max-width: 320px;
}

.phone-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.input-hint {
  font-size: 0.72rem;
  color: var(--gray-400);
}

.btn-call {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.85rem 2rem;
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-dark) 100%
  );
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  max-width: 220px;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.3);
  font-family: var(--font);
}

.btn-call:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.4);
}
.btn-call:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-call-icon {
  font-size: 1.2rem;
}

.btn-hangup {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.85rem 2rem;
  background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  max-width: 220px;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
  font-family: var(--font);
}

.btn-hangup:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.hidden {
  display: none !important;
}

/* Browser voice-chat */

.browser-chat-section {
  margin-top: 1.5rem;
  text-align: center;
}

.divider-label {
  color: var(--gray-400);
  font-size: 0.82rem;
  font-weight: 500;
}

.btn-talk {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.85rem 2rem;
  background: linear-gradient(
    135deg,
    var(--primary-light) 0%,
    var(--primary) 100%
  );
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  max-width: 220px;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.3);
  font-family: var(--font);
}

.btn-talk:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.4);
}

.btn-talk.active {
  background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
  animation: pulse-mic 1.5s ease-in-out infinite;
}

@keyframes pulse-mic {
  0%,
  100% {
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
  }
  50% {
    box-shadow: 0 4px 24px rgba(239, 68, 68, 0.6);
  }
}

.browser-status {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--gray-500);
}

/* Health Grid */

.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
}

.health-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  transition: all var(--transition-fast);
}

.health-item.ok {
  background: #dcfce7;
  border-color: #86efac;
}
.health-item.fail {
  background: #fee2e2;
  border-color: #fca5a5;
}
.health-icon {
  font-size: 1.1rem;
}
.health-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--gray-700);
}

/* Log Stream */

.log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}
.log-header h3 {
  margin-bottom: 0;
}

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.72rem;
  border-radius: var(--radius-sm);
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
  cursor: pointer;
  font-family: var(--font);
  font-weight: 600;
}

.btn-sm:hover {
  background: var(--gray-200);
}

.log-stream {
  max-height: 350px;
  overflow-y: auto;
  background: var(--sidebar-bg);
  border-radius: var(--radius);
  padding: 1rem;
  font-family: "Fira Code", "Cascadia Code", monospace;
  font-size: 0.78rem;
  line-height: 1.75;
}

.log-empty {
  color: var(--gray-500);
  text-align: center;
  padding: 2rem;
}

.log-line {
  display: flex;
  gap: 0.8rem;
  padding: 0.15rem 0;
}
.log-time {
  color: #6b8a80;
  white-space: nowrap;
}

.log-level {
  min-width: 54px;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 0.7rem;
}
.log-level.info {
  color: #60a5fa;
}
.log-level.success {
  color: #34d399;
}
.log-level.warning {
  color: #fbbf24;
}
.log-level.error {
  color: #f87171;
}

.log-msg {
  color: #d1e0da;
  word-break: break-word;
}
.log-sid {
  color: #5eead4;
  font-size: 0.72rem;
}

/* System status */

.system-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--gray-500);
  font-weight: 500;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 800px) {
  .sidebar {
    width: 60px;
  }
  .sidebar-brand h1,
  .nav-item span:not(.nav-icon),
  .sidebar-footer span:not(.status-dot),
  .lang-toggle span:not(.lang-icon) {
    display: none;
  }
  .nav-item {
    justify-content: center;
    padding: 0.85rem;
  }
  .lang-toggle {
    justify-content: center;
    margin: 0 0.5rem 0.5rem;
    padding: 0.5rem;
  }
  .content {
    margin-left: 60px;
    padding: 1.2rem;
  }
  .context-fields-grid {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Voice Settings ─────────────────────────────────────── */

.voice-select-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  flex-wrap: wrap;
}

.voice-select {
  flex: 1;
  min-width: 200px;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--gray-700);
  background: var(--white);
  font-family: var(--font);
  cursor: pointer;
}

.voice-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.voice-id-code {
  font-size: 0.75rem;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  font-family: monospace;
  margin-left: 0.5rem;
}

.voice-feedback {
  margin-top: 0.75rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  transition: opacity var(--transition);
}

.voice-feedback.hidden {
  display: none;
}

.voice-feedback.success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.voice-feedback.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.voice-feedback.info {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.voice-current {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
}
