@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600;700&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap');

:root {
  --bg-dark: #07090e;
  --bg-darker: #040609;
  --surface-0: rgba(13, 17, 26, 0.85);
  --surface-1: #0d121d;
  --surface-2: #141c2e;
  --surface-3: #1c263d;
  --border: rgba(255, 255, 255, 0.07);
  --border-light: rgba(255, 255, 255, 0.12);
  --border-glow: rgba(59, 130, 246, 0.35);

  --text: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --text-dim: #475569;

  --primary: #3b82f6;
  --primary-glow: rgba(59, 130, 246, 0.3);
  --primary-hover: #2563eb;
  --cyan: #06b6d4;
  --indigo: #6366f1;
  --purple: #a855f7;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  --local-accent: #8b5cf6;
  --local-glow: rgba(139, 92, 246, 0.25);
  --cloud-accent: #38bdf8;
  --cloud-glow: rgba(56, 189, 248, 0.25);

  --font-brand: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

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

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.07) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(6, 182, 212, 0.05) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* --- LOGIN OVERLAY --- */
.login-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 30%, #0f172a 0%, #040609 85%);
  backdrop-filter: blur(20px);
  z-index: 1000;
  padding: 1.5rem;
}

.login-card {
  width: min(440px, 100%);
  background: var(--surface-1);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 30px rgba(59, 130, 246, 0.15);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--local-accent), var(--primary), var(--cyan));
}

.brand-logo .logo-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.brand-logo h2 { font-family: var(--font-brand); font-size: 1.75rem; letter-spacing: -0.02em; font-weight: 800; color: #fff; }
.brand-logo .tagline { color: var(--text-muted); font-size: 0.875rem; margin-top: 0.25rem; }

.login-box { margin: 2rem 0 1rem; }
.login-desc { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1.25rem; }

/* Login por token: solo visible mientras no exista Client ID de Google. */
.token-login { display: flex; flex-direction: column; gap: 0.6rem; text-align: left; }
.login-label { color: var(--text-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.login-input {
  width: 100%;
  min-height: 44px;               /* objetivo táctil */
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: var(--text-primary, #e6edf7);
  font-family: inherit;
  font-size: 0.9rem;
}
.login-input:focus-visible { outline: 2px solid #6ea8fe; outline-offset: 2px; }
.btn-login-submit { min-height: 44px; width: 100%; justify-content: center; }
.login-hint { color: var(--text-muted); font-size: 0.75rem; line-height: 1.45; margin: 0; }
.login-hint code {
  background: rgba(255,255,255,0.07);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  font-size: 0.72rem;
}

/* --- BOTONES & CONTROLES --- */
.btn {
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.625rem 1.25rem;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.35);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-light);
}
.btn-secondary:hover {
  background: var(--surface-3);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.35);
}
.btn-danger:hover {
  background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover {
  background: rgba(59, 130, 246, 0.15);
  color: #fff;
}

.btn-sm { padding: 0.4rem 0.875rem; font-size: 0.8125rem; border-radius: 8px; }
.btn-xs { padding: 0.25rem 0.625rem; font-size: 0.75rem; border-radius: 6px; }
.btn-md { padding: 0.75rem 1.5rem; font-size: 0.9375rem; }

.btn-pill {
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-pill:hover {
  background: var(--surface-3);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}
.btn-pill.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--primary);
  color: #93c5fd;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
}

/* --- HEADER & NAVEGACIÓN --- */
.app-header {
  height: 64px;
  background: rgba(7, 9, 14, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left, .header-right { display: flex; align-items: center; gap: 1.5rem; }

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 1.125rem;
}
.brand-title { letter-spacing: -0.01em; background: linear-gradient(135deg, #fff 0%, #94a3b8 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.nav-tabs {
  display: flex;
  gap: 0.375rem;
  background: rgba(13, 18, 29, 0.6);
  padding: 0.25rem;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.nav-tab {
  background: transparent;
  color: var(--text-muted);
  border: 0;
  font-family: var(--font);
  font-weight: 500;
  font-size: 0.8125rem;
  padding: 0.45rem 0.875rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.nav-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav-tab.active { color: #fff; background: var(--surface-2); font-weight: 600; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); }

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-family: var(--mono);
}
.user-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); }

.badge-pulse {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.badge-pulse::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #34d399;
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.4; }
}

/* --- CONTENEDOR PRINCIPAL & PANELES --- */
.app-main {
  max-width: 1480px;
  margin: 1.5rem auto;
  padding: 0 1.5rem 3rem;
}

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

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

/* --- QUICKBAR DE MODELOS --- */
.model-quickbar {
  background: var(--surface-1);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 1.125rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.quickbar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.quickbar-title {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text);
}

.preset-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.quickbar-selectors-row {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1fr;
  gap: 0.875rem;
  align-items: center;
  background: var(--surface-2);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
}

@media (max-width: 900px) {
  .quickbar-selectors-row { grid-template-columns: 1fr; }
}

.quick-sel-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.quick-sel-item label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.form-select-sm {
  background: var(--surface-1);
  border: 1px solid var(--border-light);
  color: var(--text);
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.8125rem;
  outline: none;
  width: 100%;
  transition: all 0.15s ease;
}
.form-select-sm:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.quickbar-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.quickbar-summary strong { color: var(--text); font-family: var(--mono); }

/* --- TOTALIZADOR DEL PIPELINE EN TIEMPO REAL --- */
.pipeline-totalizer-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(8, 12, 22, 0.98) 100%);
  border: 1px solid var(--border-glow);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 20px rgba(59, 130, 246, 0.1);
  position: relative;
  overflow: hidden;
}

.totalizer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.totalizer-title-group {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}
.totalizer-title-group h4 {
  font-family: var(--font-brand);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}
.totalizer-icon {
  font-size: 1.25rem;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 0.4rem 0.6rem;
  border-radius: 10px;
}

.totalizer-badge-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pipeline-flow-chain {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr auto 1.3fr;
  align-items: center;
  gap: 0.5rem;
  background: rgba(6, 9, 16, 0.85);
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}

@media (max-width: 1080px) {
  .pipeline-flow-chain { grid-template-columns: 1fr; gap: 0.75rem; }
  .pipeline-arrow { transform: rotate(90deg); margin: 0 auto; }
}

.pipeline-node {
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 0.875rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.25rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.pipeline-node.node-active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
  transform: translateY(-2px);
}
.pipeline-node.node-total {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.25) 100%);
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.pipeline-node .node-icon { font-size: 1.25rem; }
.pipeline-node .node-name { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.04em; }
.pipeline-node .node-val { font-size: 1.25rem; font-family: var(--mono); font-weight: 700; color: #fff; }
.pipeline-node .node-sub { font-size: 0.6875rem; color: var(--text-muted); }

.pipeline-arrow {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 1.125rem;
  opacity: 0.5;
}

/* Latency Budget Bar */
.latency-budget-bar-container {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.budget-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.6875rem;
  font-family: var(--mono);
  color: var(--text-muted);
}
.target-marker-lbl { color: #34d399; font-weight: 600; }
.target-marker-sip-lbl { color: #38bdf8; font-weight: 600; }

.budget-progress-track {
  height: 12px;
  background: rgba(13, 18, 29, 0.9);
  border: 1px solid var(--border);
  border-radius: 999px;
  position: relative;
  display: flex;
  overflow: hidden;
}
.budget-seg { height: 100%; transition: width 0.3s ease; }
.seg-stt { background: #6366f1; }
.seg-vad { background: #8b5cf6; }
.seg-llm { background: #3b82f6; }
.seg-tts { background: #10b981; }

/* --- DUAL PLAYGROUND GRID --- */
.dual-playground-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

@media (max-width: 960px) {
  .dual-playground-grid { grid-template-columns: 1fr; }
}

.column-card {
  background: var(--surface-1);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
}

.column-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
}
.local-column::before { background: linear-gradient(90deg, var(--local-accent), #c084fc); }
.cloud-column::before { background: linear-gradient(90deg, var(--cloud-accent), var(--primary)); }

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.column-title-group {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}
.column-title-group h3 {
  font-family: var(--font-brand);
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
}
.transport-icon {
  font-size: 1.35rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.4rem 0.55rem;
  border-radius: 10px;
}
.transport-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.state-tag {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}
.state-disconnected { background: rgba(148, 163, 184, 0.1); color: var(--text-muted); border: 1px solid var(--border); }
.state-connecting { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.state-connected { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }

.column-actions {
  display: flex;
  gap: 0.75rem;
}
.column-actions .btn {
  flex: 1;
}

/* Audio Visualizer */
.visualizer-box {
  background: #040609;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
}
.visualizer-box canvas {
  width: 100%;
  height: 50px;
  border-radius: 8px;
}

/* Metrics Cards */
.metrics-container {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.metrics-header {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.625rem;
}
@media (max-width: 600px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}

.metric-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.625rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.metric-label { font-size: 0.6875rem; color: var(--text-muted); font-weight: 500; }
.metric-value { font-family: var(--mono); font-size: 1.125rem; font-weight: 700; color: #fff; }
.metric-sub { font-size: 0.625rem; color: var(--text-dim); }

/* Transcript Feed */
.transcript-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  flex: 1;
}
.transcript-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.transcript-feed {
  background: #040609;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.875rem;
  min-height: 180px;
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.turn-bubble {
  padding: 0.625rem 0.875rem;
  border-radius: 10px;
  font-size: 0.8125rem;
  max-width: 85%;
  line-height: 1.4;
  animation: fadeIn 0.15s ease;
}
.turn-bubble.user {
  align-self: flex-end;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #bfdbfe;
}
.turn-bubble.agent {
  align-self: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  color: var(--text);
}
.turn-author {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.empty-state {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--text-dim);
  font-size: 0.8125rem;
  text-align: center;
  padding: 2rem 0;
}

/* --- PANELS GENERALES & TABLAS --- */
.panel-card {
  background: var(--surface-1);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}
.panel-header h3 {
  font-family: var(--font-brand);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.models-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.model-group-card {
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.group-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.group-header h4 { font-family: var(--font-brand); font-size: 0.9375rem; font-weight: 700; color: #fff; }
.group-icon {
  font-size: 1.25rem;
  background: var(--surface-1);
  border: 1px solid var(--border);
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-select, .form-input, .code-textarea {
  background: var(--surface-1);
  border: 1px solid var(--border-light);
  color: var(--text);
  padding: 0.625rem 0.875rem;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.875rem;
  outline: none;
  width: 100%;
  transition: all 0.15s ease;
}
.form-select:focus, .form-input:focus, .code-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.label-with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-voice-preview {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #93c5fd;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-voice-preview:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: #60a5fa;
  color: #fff;
  transform: translateY(-1px);
}
.btn-voice-preview:active {
  transform: translateY(0);
}
.btn-voice-preview.is-playing {
  background: rgba(16, 185, 129, 0.2);
  border-color: #34d399;
  color: #34d399;
}

.voice-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.voice-input-row .form-input {
  flex: 1;
}

.btn-play-bubble {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  color: var(--primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.btn-play-bubble:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: scale(1.05);
}
.btn-play-bubble:active {
  transform: scale(0.95);
}
.btn-play-bubble.is-playing {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
}

.voice-sample-anim {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.6rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 8px;
  animation: fadeIn 0.2s ease;
}
.sound-wave-bar {
  display: inline-block;
  width: 3px;
  height: 12px;
  background: #34d399;
  border-radius: 2px;
  animation: soundWave 0.8s infinite ease-in-out alternate;
}
.sound-wave-bar:nth-child(2) { animation-delay: 0.2s; height: 16px; }
.sound-wave-bar:nth-child(3) { animation-delay: 0.4s; height: 10px; }
.sound-wave-bar:nth-child(4) { animation-delay: 0.1s; height: 14px; }

@keyframes soundWave {
  0% { transform: scaleY(0.4); opacity: 0.5; }
  100% { transform: scaleY(1.2); opacity: 1; }
}

.model-info-box {
  background: rgba(6, 9, 16, 0.6);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.625rem 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.75rem;
}
.info-row { display: flex; justify-content: space-between; }
.info-row strong { font-family: var(--mono); color: #fff; }

/* --- BENCHMARKS GRID & STATS --- */
.bench-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.bench-stat-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.bench-stat-card.primary {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.25) 100%);
  border-color: rgba(59, 130, 246, 0.4);
}
.stat-title { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }
.stat-big { font-family: var(--mono); font-size: 1.75rem; font-weight: 800; color: #fff; }
.stat-desc { font-size: 0.6875rem; color: var(--text-dim); }

.table-container {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.8125rem;
}
.data-table th, .data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
}
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.data-table code {
  font-family: var(--mono);
  background: rgba(255, 255, 255, 0.06);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.75rem;
}

.tag {
  font-size: 0.6875rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-weight: 600;
}
.tag-success { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.tag-warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

/* --- ESTADO DEL SERVIDOR VPS --- */
.server-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.auto-refresh-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  cursor: pointer;
}

.server-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.srv-stat-card {
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.srv-stat-card.highlight-card {
  border-color: rgba(59, 130, 246, 0.4);
  background: linear-gradient(180deg, var(--surface-2) 0%, rgba(30, 58, 138, 0.15) 100%);
}

.srv-stat-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.stat-icon {
  font-size: 1.25rem;
  background: var(--surface-1);
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.stat-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.stat-main-val {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--mono);
  color: #fff;
  line-height: 1;
}

.stat-sub-info {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.stat-sub-info strong { color: var(--text); font-family: var(--mono); }

.meter-bar-track {
  height: 8px;
  background: var(--surface-1);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.meter-bar-fill {
  height: 100%;
  background: #3b82f6;
  border-radius: 999px;
  transition: width 0.4s ease;
}
.meter-ram { background: #8b5cf6; }
.meter-disk { background: #10b981; }

.disk-speed-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.speed-box {
  background: var(--surface-1);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.speed-label { font-size: 0.6875rem; color: var(--text-muted); }
.speed-val { font-size: 1rem; font-family: var(--mono); color: #38bdf8; }

.containers-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-title-row h4 { font-family: var(--font-brand); font-size: 1rem; font-weight: 700; color: var(--text); }

/* --- TOOLS GRID --- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}
.tool-card {
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.tool-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.badge-get { background: #0284c7; color: #fff; font-size: 0.625rem; font-weight: 700; padding: 0.15rem 0.4rem; border-radius: 4px; }
.badge-rpc { background: #9333ea; color: #fff; font-size: 0.625rem; font-weight: 700; padding: 0.15rem 0.4rem; border-radius: 4px; }
.badge-server { background: rgba(148, 163, 184, 0.1); color: var(--text-muted); font-size: 0.6875rem; padding: 0.2rem 0.4rem; border-radius: 4px; }
.badge-client { background: rgba(59, 130, 246, 0.1); color: var(--primary); font-size: 0.6875rem; padding: 0.2rem 0.4rem; border-radius: 4px; }
.tool-desc { color: var(--text-muted); font-size: 0.8125rem; flex: 1; }

.tool-result-box {
  background: #040609;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
}
.tool-result-box pre { color: #38bdf8; overflow-x: auto; margin-top: 0.5rem; }

.code-textarea {
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  resize: vertical;
}

.input-disabled { opacity: 0.6; cursor: not-allowed; }
.env-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }

.alert {
  padding: 0.875rem 1.25rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
}
.alert-success { background: rgba(16, 185, 129, 0.15); border: 1px solid var(--success); color: #a7f3d0; }

.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-success { color: var(--success); }
.w-full { width: 100%; }

/* Aviso de procedencia del catálogo. Un dato sin procedencia invita a confiar
   en él; este dice de dónde salió y cuántos modelos están verificados. */
.catalogo-aviso {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.catalogo-aviso.es-advertencia {
  color: #ffd479;
  border-color: rgba(255, 212, 121, 0.35);
  background: rgba(255, 212, 121, 0.08);
}
