:root {
  --bg-base: #0b0f19;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(24, 32, 50, 0.85);
  --bg-input: #0e1422;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  /* Entity colors */
  --badge-person: rgba(139, 92, 246, 0.2);
  --badge-person-border: rgba(139, 92, 246, 0.5);
  --badge-person-text: #c4b5fd;

  --badge-cedula: rgba(16, 185, 129, 0.2);
  --badge-cedula-border: rgba(16, 185, 129, 0.5);
  --badge-cedula-text: #6ee7b7;

  --badge-address: rgba(245, 158, 11, 0.2);
  --badge-address-border: rgba(245, 158, 11, 0.5);
  --badge-address-text: #fcd34d;

  --badge-phone: rgba(59, 130, 246, 0.2);
  --badge-phone-border: rgba(59, 130, 246, 0.5);
  --badge-phone-text: #93c5fd;

  --badge-email: rgba(6, 182, 212, 0.2);
  --badge-email-border: rgba(6, 182, 212, 0.5);
  --badge-email-text: #67e8f9;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-base);
  background-image: 
    radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(124, 58, 237, 0.08) 0px, transparent 50%);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  gap: 1.25rem;
}

/* Navbar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.logo-badge {
  background: var(--primary-gradient);
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-text h1 span {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-cyan);
  border-radius: 9999px;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-emerald);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Main Grid */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  flex: 1;
}

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

/* Cards */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}

/* Dropzone */
.dropzone {
  margin: 1rem 1.25rem 0.5rem;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(0, 0, 0, 0.15);
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.08);
}

.dropzone-icon {
  color: var(--text-dim);
  margin-bottom: 0.35rem;
}

.dropzone-title {
  font-size: 0.85rem;
  color: var(--text-main);
}

.dropzone-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.browse-link {
  color: var(--accent-cyan);
  text-decoration: underline;
  cursor: pointer;
}

/* Text Editors */
.editor-container, .viewer-container {
  flex: 1;
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  min-height: 260px;
}

textarea#inputText {
  width: 100%;
  height: 100%;
  min-height: 250px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  resize: vertical;
  line-height: 1.6;
}

textarea#inputText:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.text-preview {
  width: 100%;
  height: 100%;
  min-height: 250px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #e5e7eb;
  padding: 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  white-space: pre-wrap;
  overflow-y: auto;
  line-height: 1.6;
}

/* Highlight tags in preview */
.pill-person { background: var(--badge-person); color: var(--badge-person-text); border: 1px solid var(--badge-person-border); padding: 0.1rem 0.35rem; border-radius: 4px; font-weight: 600; }
.pill-cedula { background: var(--badge-cedula); color: var(--badge-cedula-text); border: 1px solid var(--badge-cedula-border); padding: 0.1rem 0.35rem; border-radius: 4px; font-weight: 600; }
.pill-address { background: var(--badge-address); color: var(--badge-address-text); border: 1px solid var(--badge-address-border); padding: 0.1rem 0.35rem; border-radius: 4px; font-weight: 600; }
.pill-phone { background: var(--badge-phone); color: var(--badge-phone-text); border: 1px solid var(--badge-phone-border); padding: 0.1rem 0.35rem; border-radius: 4px; font-weight: 600; }
.pill-email { background: var(--badge-email); color: var(--badge-email-text); border: 1px solid var(--badge-email-border); padding: 0.1rem 0.35rem; border-radius: 4px; font-weight: 600; }

/* Engine Bar */
.engine-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
  gap: 1rem;
}

.engine-selector-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.engine-selector-group label {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.form-select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  flex: 1;
  max-width: 380px;
}

.form-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Metrics Banner */
.metrics-banner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.65rem 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-color);
}

.metric-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.metric-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.metric-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.text-accent {
  color: var(--accent-cyan);
}

.metric-badge-warning {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fda4af;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
}

/* Supervision Panel */
.supervision-panel {
  border-top: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
  background: rgba(0, 0, 0, 0.15);
  max-height: 320px;
  display: flex;
  flex-direction: column;
}

.supervision-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.supervision-header h2,
.supervision-header h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0;
}

.supervision-counter {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  color: var(--text-muted);
}

.table-container {
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.entity-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  text-align: left;
}

.entity-table th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  padding: 0.5rem 0.65rem;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 2;
}

.entity-table td {
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.entity-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.entity-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

.badge-PERSON { background: var(--badge-person); color: var(--badge-person-text); border: 1px solid var(--badge-person-border); }
.badge-CEDULA, .badge-ID_DOC, .badge-NIT { background: var(--badge-cedula); color: var(--badge-cedula-text); border: 1px solid var(--badge-cedula-border); }
.badge-ADDRESS { background: var(--badge-address); color: var(--badge-address-text); border: 1px solid var(--badge-address-border); }
.badge-PHONE { background: var(--badge-phone); color: var(--badge-phone-text); border: 1px solid var(--badge-phone-border); }
.badge-EMAIL { background: var(--badge-email); color: var(--badge-email-text); border: 1px solid var(--badge-email-border); }
.badge-LOCATION { background: rgba(244, 63, 94, 0.2); color: #fda4af; border: 1px solid rgba(244, 63, 94, 0.4); }

.input-inline-pseudo {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-main);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  width: 100%;
}

.input-inline-pseudo:focus {
  outline: none;
  background: var(--bg-input);
  border-color: var(--primary);
}

.empty-row td {
  text-align: center;
  color: var(--text-dim);
  padding: 1.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  padding: 0.5rem 0.9rem;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
}

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

.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Footer */
.footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-dim);
  padding: 0.5rem 0;
}

.footer-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

/* ========================================================================= */
/* VISTAS Y NAVEGACIÓN PRINCIPAL                                            */
/* ========================================================================= */
.main-nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.3rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  color: #fff;
  background: rgba(79, 70, 229, 0.25);
  border-color: rgba(99, 102, 241, 0.45);
  font-weight: 600;
  box-shadow: 0 0 14px rgba(79, 70, 229, 0.3);
}

.view-panel {
  display: none;
  width: 100%;
}

.view-panel.active {
  display: block;
  animation: viewFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ========================================================================= */
/* MANUAL INTERACTIVO & ARQUITECTURA                                        */
/* ========================================================================= */
.manual-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.manual-hero {
  padding: 1.75rem 2rem;
  background: linear-gradient(135deg, rgba(20, 28, 48, 0.9) 0%, rgba(15, 20, 35, 0.95) 100%);
  border: 1px solid rgba(99, 102, 241, 0.2);
  position: relative;
  overflow: hidden;
}

.manual-hero::after {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.18);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.35);
  margin-bottom: 0.75rem;
}

.manual-hero h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(to right, #fff, #c7d2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 950px;
  line-height: 1.6;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tag-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.interface-selector-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.interface-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.interface-chip:hover {
  background: rgba(79, 70, 229, 0.2);
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

.interface-chip.highlight {
  border-color: rgba(6, 182, 212, 0.4);
  background: rgba(6, 182, 212, 0.1);
  color: #a5f3fc;
}

.interface-chip.highlight-mcp {
  border-color: rgba(6, 182, 212, 0.6);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(59, 130, 246, 0.15));
  color: #38bdf8;
  font-weight: 600;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
}

.interface-chip.highlight-mcp:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(59, 130, 246, 0.25));
  border-color: #38bdf8;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.3);
}

.manual-section {
  padding: 1.75rem;
  scroll-margin-top: 1rem;
}

.section-badge-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.badge-role {
  color: var(--accent-cyan);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-tech {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.section-title-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  background: rgba(79, 70, 229, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  flex-shrink: 0;
}

.section-title-row h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.section-title-row .subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.section-content-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.75rem;
  align-items: start;
}

.feature-col h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.feature-col p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.feature-list {
  list-style: none;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.feature-list li {
  font-size: 0.85rem;
  color: var(--text-main);
  padding-left: 1.25rem;
  position: relative;
  line-height: 1.5;
}

.feature-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}

.quick-action-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.code-box-inline {
  background: #080c14;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.code-box-inline .code-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}

.code-box-inline code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: #a5b4fc;
}

/* Marcos de Ventana Estilo macOS */
.os-window-frame {
  background: #0d121f;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.os-titlebar {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.85rem;
  background: #080c14;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 0.4rem;
}

.traffic-light {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.traffic-light.red { background: #ff5f56; }
.traffic-light.yellow { background: #ffbd2e; }
.traffic-light.green { background: #27c93f; }

.os-title {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-left: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.os-image-wrap {
  width: 100%;
  background: #000;
  overflow: hidden;
}

.showcase-img {
  width: 100%;
  height: auto;
  aspect-ratio: 1376 / 768;
  display: block;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.showcase-img:hover {
  transform: scale(1.015);
}

.web-preview-sample {
  padding: 1rem;
}

.sample-split-view {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.sample-pane {
  background: #080c14;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  line-height: 1.5;
  border: 1px solid var(--border-color);
}

.sample-pane.anon {
  border-color: rgba(99, 102, 241, 0.3);
}

.pane-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}

.badge-entity {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-entity.person { background: var(--badge-person); color: var(--badge-person-text); }
.badge-entity.cedula { background: var(--badge-cedula); color: var(--badge-cedula-text); }
.badge-entity.address { background: var(--badge-address); color: var(--badge-address-text); }

.sample-table-mini {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: #080c14;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
}

.sample-table-mini .toggle-on {
  color: var(--accent-emerald);
  font-weight: bold;
}

/* Infografía del Pipeline de 7 Tareas */
.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.pipeline-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.pipeline-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.05);
}

.pipeline-card.highlight-card {
  border-color: rgba(6, 182, 212, 0.4);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.08) 0%, rgba(79, 70, 229, 0.08) 100%);
}

.p-num {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-cyan);
  letter-spacing: 0.8px;
  margin-bottom: 0.4rem;
}

.pipeline-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.pipeline-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.p-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
  margin-top: 0.85rem;
}

.curl-guide-box {
  background: #080c14;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: 0.75rem;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.85rem;
  background: #0d121f;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.code-pre {
  padding: 0.85rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: #a5f3fc;
  overflow-x: auto;
  line-height: 1.5;
}

/* ========================================================================= */
/* LABORATORIO MULTI-INTERFAZ (PLAYGROUND)                                  */
/* ========================================================================= */
.playground-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sub-nav-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: var(--bg-card);
  padding: 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.sub-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.sub-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.sub-tab-btn.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.4);
}

.playground-pane {
  display: none;
}

.playground-pane.active {
  display: block;
  animation: viewFadeIn 0.2s ease;
}

.play-card {
  padding: 1.5rem;
}

.endpoint-url-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent-cyan);
}

.badge-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.2);
  color: #c7d2fe;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid rgba(99, 102, 241, 0.4);
  margin-right: 0.4rem;
}

/* cURL Playground Grid */
.curl-builder-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.65rem 0.85rem;
  font-size: 0.85rem;
  font-family: inherit;
  resize: vertical;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
}

.code-font {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.8rem !important;
}

.curl-action-buttons {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
}

.terminal-panel, .response-panel {
  background: #080c14;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 0.85rem;
}

.terminal-header, .response-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  background: #0d121f;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.72rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
}

.terminal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27c93f; }

.terminal-title {
  margin-left: 0.35rem;
}

.terminal-body, .response-body {
  padding: 0.85rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: #e2e8f0;
  line-height: 1.5;
  overflow-x: auto;
  max-height: 240px;
}

.status-badge-http {
  margin-left: auto;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
}

.status-badge-http.success {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.status-badge-http.error {
  background: rgba(244, 63, 94, 0.2);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.latency-badge {
  font-size: 0.7rem;
  color: var(--accent-cyan);
}

/* API REST Explorer Grid */
.api-explorer-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.25rem;
  margin-top: 1rem;
}

.api-list-col {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.endpoint-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.78rem;
  font-family: 'JetBrains Mono', monospace;
}

.endpoint-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(99, 102, 241, 0.4);
}

.endpoint-item.active {
  background: rgba(79, 70, 229, 0.15);
  border-color: var(--primary);
  color: #fff;
}

.method-tag {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.method-tag.post { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.method-tag.get { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }

.api-detail-col {
  background: #080c14;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
}

.api-doc-box h4 {
  font-size: 1.05rem;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 0.3rem;
  color: #e2e8f0;
}

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

.timing-text {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-family: 'JetBrains Mono', monospace;
}

.api-result-box {
  background: #0c101a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.res-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.75rem;
  background: #111827;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.status-code-badge {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-emerald);
  font-weight: bold;
}

.res-pre {
  padding: 0.85rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: #e2e8f0;
  overflow-x: auto;
  max-height: 280px;
  line-height: 1.45;
}

/* Terminal CLI Emulator */
.cli-quick-cmds {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1rem 0;
}

.cli-cmd-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
}

.terminal-window {
  background: #060910;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}

.terminal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.85rem;
  background: #0d121f;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.traffic-lights {
  display: flex;
  gap: 0.35rem;
}

.traffic-lights .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.traffic-lights .dot.red { background: #ff5f56; }
.traffic-lights .dot.yellow { background: #ffbd2e; }
.traffic-lights .dot.green { background: #27c93f; }

.terminal-title-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.terminal-badge {
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-emerald);
}

.terminal-screen {
  padding: 1rem 1.25rem;
  min-height: 260px;
  max-height: 380px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  color: #f1f5f9;
}

.term-line {
  margin-bottom: 0.2rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.term-line.welcome {
  color: #818cf8;
  font-weight: 700;
}

.term-line.success {
  color: #34d399;
}

.term-line.cyan {
  color: #38bdf8;
}

.term-line.accent {
  color: #f472b6;
}

.term-line.prompt-line {
  margin-top: 0.5rem;
}

.prompt-user {
  color: #34d399;
  font-weight: 600;
}

.prompt-path {
  color: #60a5fa;
}

.term-cursor {
  animation: blink 1s infinite;
  color: #fff;
  font-weight: bold;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.terminal-input-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  background: #0b0f19;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.prompt-symbol {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-emerald);
  font-weight: bold;
}

.terminal-input-bar input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  outline: none;
}

/* Desktop Hotspot Explorer */
.desktop-hotspot-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 1.5rem;
  align-items: start;
  margin-top: 1rem;
}

.hotspot-wrapper {
  position: relative;
  width: 100%;
}

.hotspot-base-img {
  width: 100%;
  height: auto;
  aspect-ratio: 1376 / 768;
  display: block;
}

.hotspot-pin {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: 2px solid #fff;
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.85);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10;
}

.hotspot-pin:hover {
  transform: translate(-50%, -50%) scale(1.2);
}

.hotspot-pin.active {
  background: #ec4899;
  border-color: #fff;
  box-shadow: 0 0 24px rgba(236, 72, 153, 1);
  transform: translate(-50%, -50%) scale(1.25);
}

.detail-card {
  padding: 1.5rem;
  background: #0d121f;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.hotspot-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(236, 72, 153, 0.2);
  color: #f472b6;
  margin-bottom: 0.4rem;
}

.detail-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.detail-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.detail-law-note {
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid var(--accent-cyan);
  padding: 0.65rem 0.85rem;
  margin: 1rem 0;
  font-size: 0.8rem;
  color: var(--text-main);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.detail-command-box {
  background: #080c14;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.detail-command-box code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: #a5b4fc;
}

/* Casos de Estudio Web */
.case-studies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.case-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
  transition: all 0.2s ease;
}

.case-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
}

.case-category {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.35rem;
}

.case-category.salud { background: rgba(244, 63, 94, 0.15); color: #fda4af; }
.case-category.laboral { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
.case-category.penal { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }

.case-card h4 {
  font-size: 1rem;
  font-weight: 600;
}

.case-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.case-pii-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.pii-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
}

/* ========================================================================= */
/* AUDITORÍA & CUSTODIA CRIPTOGRÁFICA                                       */
/* ========================================================================= */
.audit-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.audit-card {
  padding: 1.5rem;
}

.hash-result-box {
  background: #080c14;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-top: 0.75rem;
}

.hash-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.hash-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  color: var(--accent-cyan);
  word-break: break-all;
  font-weight: 600;
}

.hash-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}

.revert-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.mandates-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.mandate-item {
  display: flex;
  gap: 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.m-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(79, 70, 229, 0.2);
  color: #a5b4fc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.mandate-item strong {
  font-size: 0.9rem;
  display: block;
  margin-bottom: 0.25rem;
}

.mandate-item p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ========================================================================= */
/* RESPONSIVIDAD                                                             */
/* ========================================================================= */
@media (max-width: 1024px) {
  .section-content-grid {
    grid-template-columns: 1fr;
  }
  .curl-builder-grid {
    grid-template-columns: 1fr;
  }
  .desktop-hotspot-grid {
    grid-template-columns: 1fr;
  }
  .api-explorer-grid {
    grid-template-columns: 1fr;
  }
  .revert-grid {
    grid-template-columns: 1fr;
  }
  .mandates-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }
  .main-nav-tabs {
    width: 100%;
    overflow-x: auto;
  }
  .header-controls {
    width: 100%;
    justify-content: space-between;
  }
}


/* Referencia normativa discreta junto a títulos */
.norma-ref {
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.2px;
}

/* MCP Explorer */
.mcp-icon {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
}

.mcp-explorer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.25rem;
}

@media (max-width: 900px) {
  .mcp-explorer-grid {
    grid-template-columns: 1fr;
  }
}

.mcp-config-col {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.tool-desc-box {
  padding: 0.9rem 1.1rem;
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-left: 3px solid #c084fc;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.tool-desc-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.tool-tag-pill {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background: rgba(192, 132, 252, 0.2);
  color: #c084fc;
}

.tool-desc-box strong {
  display: inline-block;
  font-size: 0.95rem;
  color: #e9d5ff;
  font-family: 'JetBrains Mono', monospace;
}

.tool-desc-box p {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.45;
}

/* Editor de Argumentos JSON Profesional */
.mcp-args-box {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.mcp-args-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.85rem;
  background: #111827;
  border: 1px solid var(--border-color);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.mcp-args-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.mcp-args-title label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.mcp-args-title label code {
  color: var(--accent-cyan);
  font-size: 0.76rem;
}

.json-status-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.12rem 0.5rem;
  border-radius: 9999px;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
}

.json-status-badge.valid {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.json-status-badge.invalid {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.mcp-args-actions {
  display: flex;
  gap: 0.4rem;
}

.btn-xs {
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  border-radius: var(--radius-sm);
}

.mcp-textarea-wrapper {
  width: 100%;
}

.mcp-code-editor {
  width: 100% !important;
  display: block;
  box-sizing: border-box;
  background: #080c14;
  border: 1px solid var(--border-color);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  color: #e2e8f0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.83rem;
  line-height: 1.5;
  padding: 0.75rem 0.9rem;
  min-height: 190px;
  max-height: 380px;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.mcp-code-editor:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.2);
}

.mcp-result-col {
  display: flex;
  flex-direction: column;
}

.mcp-result-col .result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.85rem;
  background: #111827;
  border: 1px solid var(--border-color);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
}

.result-header-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-primary);
}

.jsonrpc-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 9999px;
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.mcp-result-col .response-view {
  flex: 1;
  min-height: 310px;
  max-height: 520px;
  margin: 0;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  overflow-y: auto;
  background: #080c14;
}

/* =========================================================================
   Hub de Clientes MCP & Prompts para LLMs (Interactivo)
   ========================================================================= */
.mcp-clients-hub {
  margin: 1.5rem 0 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.mcp-client-tabs-nav {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  scrollbar-width: thin;
}

.mcp-client-tabs-nav::-webkit-scrollbar {
  height: 4px;
}
.mcp-client-tabs-nav::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.mcp-client-tab-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mcp-client-tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.mcp-client-tab-btn.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(59, 130, 246, 0.2));
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.2);
}

.mcp-client-pane {
  display: none;
  animation: mcpFadeIn 0.25s ease-out;
}

.mcp-client-pane.active {
  display: block;
}

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

.mcp-client-pane h5 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 1.05rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.prompt-bubble {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-left: 3px solid var(--accent-cyan);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  position: relative;
  transition: border-color 0.2s;
}

.prompt-bubble:hover {
  border-color: var(--accent-cyan);
}

.prompt-bubble-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-cyan);
}

.prompt-bubble pre {
  margin: 0;
  background: transparent;
  padding: 0;
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* =========================================================================

   WCAG 2.1 & PageSpeed-100: Accesibilidad, Teclado y Reducción de Movimiento
   ========================================================================= */
:focus-visible {
  outline: 2px solid var(--accent-cyan) !important;
  outline-offset: 2px !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

