/* ==========================================================================
   AURA ANALYTICS - ENTERPRISE PALETTE (Matte Obsidian, Charcoal, Slate)
   ========================================================================== */
:root {
  --bg-core: #090a0d;
  --bg-surface: #0e1017;
  --bg-surface-elevated: #131620;
  --bg-surface-hover: #191c28;
  --bg-card: rgba(14, 16, 23, 0.85);
  
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-active: rgba(56, 189, 248, 0.4);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-faint: #334155;
  
  --accent-steel: #38bdf8;
  --accent-muted: #0284c7;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-core);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
  position: relative;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* Fondo base limpio */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(14, 16, 23, 0.4) 0%, rgba(9, 10, 13, 0.95) 100%);
  pointer-events: none;
  z-index: 0;
}

/* Three.js Background Canvas */
#orb-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
}

/* ==========================================================================
   TOP NAVIGATION BAR
   ========================================================================== */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  z-index: 20;
  background: rgba(9, 10, 13, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-symbol {
  width: 36px;
  height: 36px;
  background: rgba(56, 189, 248, 0.05);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.12);
  transition: var(--transition);
  flex-shrink: 0;
}

.brand-symbol:hover {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.28);
}

.brand-text {
  display: flex;
  align-items: center;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--text-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.status-ready { background: var(--text-muted); }
.status-listening { background: var(--accent-emerald); box-shadow: 0 0 8px rgba(16, 185, 129, 0.6); }
.status-analyzing { background: var(--accent-steel); box-shadow: 0 0 8px rgba(56, 189, 248, 0.6); }
.status-speaking { background: #cbd5e1; box-shadow: 0 0 8px rgba(203, 213, 225, 0.6); }
.status-error { background: var(--accent-rose); }

.nav-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.nav-btn:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.nav-btn.icon-btn-nav {
  padding: 7px;
  border-radius: var(--radius-sm);
}

.nav-badge {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   CENTRAL INTERACTION HUB
   ========================================================================== */
.voice-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  z-index: 10;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 1150px) {
  body.has-open-dashboard .voice-center {
    transform: translate(calc(-50% - 240px), -50%);
  }
}

.orb-interaction-zone {
  position: relative;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stealth-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid rgba(56, 189, 248, 0.18);
  transition: var(--transition);
}

.stealth-ring.inner {
  width: 80%;
  height: 80%;
  border-color: rgba(56, 189, 248, 0.08);
}

.orb-interaction-zone:hover .stealth-ring {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.15);
}

/* Trigger pill */
.voice-trigger-pill {
  pointer-events: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  padding: 10px 24px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.voice-trigger-pill:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--accent-steel);
  color: var(--text-primary);
}

.voice-trigger-pill.is-active {
  border-color: var(--accent-steel);
  background: var(--bg-surface-elevated);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.2);
}

.mic-indicator {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
}

.voice-trigger-pill.is-active .mic-indicator {
  color: var(--accent-steel);
}

.trigger-label {
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.2px;
  color: var(--text-primary);
}

.frequency-bars {
  display: none;
  align-items: center;
  gap: 3px;
  height: 14px;
}

.frequency-bars span {
  width: 2px;
  height: 100%;
  background: var(--accent-steel);
  border-radius: 1px;
  animation: barPulse 1s ease-in-out infinite alternate;
}

.frequency-bars span:nth-child(2) { animation-delay: 0.15s; }
.frequency-bars span:nth-child(3) { animation-delay: 0.3s; }
.frequency-bars span:nth-child(4) { animation-delay: 0.1s; }
.frequency-bars span:nth-child(5) { animation-delay: 0.25s; }

@keyframes barPulse {
  0% { height: 3px; opacity: 0.4; }
  100% { height: 14px; opacity: 1; }
}

.voice-trigger-pill.is-active .frequency-bars {
  display: flex;
}

/* Prompt Chips */
.prompt-suggestions {
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 720px;
}

.prompt-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.prompt-chip svg {
  color: var(--text-muted);
}

.prompt-chip:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.prompt-chip:hover svg {
  color: var(--text-primary);
}

/* ==========================================================================
   BOTTOM CONSOLE BAR & TRANSCRIPT
   ========================================================================== */
.bottom-console-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 740px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 15;
}

.transcript-box {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  line-height: 1.5;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
}

.transcript-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.transcript-role {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.transcript-content {
  color: var(--text-primary);
}

.terminal-input-form {
  width: 100%;
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2px 8px 2px 14px;
  transition: var(--transition);
}

.terminal-input-form:focus-within {
  border-color: var(--border-medium);
  background: var(--bg-surface-elevated);
}

.terminal-prefix {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-right: 8px;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  padding: 10px 0;
  outline: none;
}

.terminal-input::placeholder {
  color: var(--text-muted);
}

.terminal-btn-submit {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.terminal-btn-submit:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

/* ==========================================================================
   EXECUTIVE DASHBOARD OVERLAY (SLIDE-IN)
   ========================================================================== */
.dashboard-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}

.dashboard-overlay.hidden {
  display: none;
}

.dashboard-backdrop {
  display: none !important;
}

.dashboard-panel {
  position: fixed;
  top: 76px;
  right: 24px;
  bottom: 84px;
  width: 560px;
  max-width: calc(100vw - 48px);
  pointer-events: auto;
  background: rgba(14, 16, 23, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(56, 189, 248, 0.08);
  transform: translateX(0);
  opacity: 1;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.dashboard-overlay.hidden .dashboard-panel {
  transform: translateX(110%);
  opacity: 0;
  pointer-events: none;
}

.dashboard-header {
  height: 68px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface-elevated);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.viz-type-badge {
  width: 34px;
  height: 34px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.dashboard-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.2px;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timestamp-badge {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.header-tool-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.header-tool-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.dashboard-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Panel Sections */
.panel-section {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
}

.empty-section {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  text-align: center;
}

.empty-state-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
}

.empty-state-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.empty-state-desc {
  font-size: 0.78rem;
  max-width: 280px;
  line-height: 1.5;
  color: var(--text-muted);
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 320px;
}

.viz-analysis-box {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.section-header-bar {
  margin-bottom: 14px;
}

.section-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

/* KPI Cards */
.kpi-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: var(--transition);
}

.kpi-card:hover {
  border-color: var(--border-medium);
}

.kpi-header {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--font-mono);
}

.kpi-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.kpi-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
}

.kpi-change.up { color: var(--accent-emerald); font-family: var(--font-mono); font-weight: 600; }
.kpi-change.down { color: var(--accent-rose); font-family: var(--font-mono); font-weight: 600; }
.kpi-change.neutral { color: var(--text-muted); font-family: var(--font-mono); }
.kpi-sub { color: var(--text-muted); }

/* Corporate Table */
.table-responsive {
  max-height: 380px;
  overflow-y: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.corporate-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  font-family: var(--font-mono);
}

.corporate-table th {
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-medium);
  position: sticky;
  top: 0;
}

.corporate-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.corporate-table tr:hover td {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-dialog {
  width: 100%;
  max-width: 520px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface-elevated);
}

.modal-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}

.modal-header-title h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.modal-close-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-dialog {
  max-width: 620px;
  width: 94vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.modal-icon-badge {
  width: 28px;
  height: 28px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-steel);
}

/* Modal Tabs Navigation Bar */
.modal-tabs-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
}

.modal-tabs-bar::-webkit-scrollbar {
  display: none;
}

.modal-tab-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.modal-tab-pill:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.modal-tab-pill.is-active {
  color: var(--accent-steel);
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.3);
  font-weight: 600;
}

.settings-body {
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.modal-tab-pane {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.modal-tab-pane.is-active {
  display: flex;
}

/* Active Dataset Status Banner */
.active-dataset-banner {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dataset-status-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.banner-tag {
  font-size: 0.62rem;
  font-family: var(--font-mono);
  color: var(--accent-steel);
  letter-spacing: 0.6px;
  font-weight: 600;
}

.banner-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-clear-dataset {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: var(--accent-rose);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-clear-dataset:hover {
  background: rgba(244, 63, 94, 0.22);
  border-color: var(--accent-rose);
}

/* Hero Upload Dropzone */
.upload-dropzone-hero {
  background: rgba(14, 16, 23, 0.85);
  border: 1.5px dashed rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.upload-dropzone-hero:hover, .upload-dropzone-hero.dragover {
  border-color: var(--accent-steel);
  background: rgba(56, 189, 248, 0.04);
}

.upload-hero-icon {
  color: var(--accent-steel);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: rgba(56, 189, 248, 0.08);
  border-radius: 50%;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.upload-hero-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.upload-hero-body .dropzone-primary {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}

.upload-hero-body .dropzone-secondary {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.btn-browse-trigger {
  margin-top: 8px;
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  color: #040507;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25);
}

.btn-browse-trigger:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.4);
}

.formats-pill {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-top: 4px;
}

/* Datasets Repository List */
.datasets-repository {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.datasets-repository .repository-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 2px;
}

.repo-title {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

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

.datasets-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dataset-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition);
}

.dataset-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  background: var(--bg-surface-hover);
}

.dataset-card.is-active {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.05);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.08);
}

.dataset-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dataset-type-badge {
  font-size: 0.65rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 3px 7px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-steel);
  border: 1px solid rgba(56, 189, 248, 0.25);
  flex-shrink: 0;
}

.dataset-card.is-active .dataset-type-badge {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.25);
}

.dataset-card-info {
  flex: 1;
  overflow: hidden;
}

.dataset-card-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dataset-card-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}

.dataset-card-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.col-pill {
  font-size: 0.66rem;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.col-pill.more {
  color: var(--accent-steel);
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.2);
}

.dataset-select-btn {
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.dataset-select-btn:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border-color: var(--accent-steel);
}

.dataset-select-btn.is-active {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
  font-weight: 600;
}

.empty-list-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 12px 0;
  text-align: center;
}

/* Tab 2: Dashboard Hero Card */
.tab-card-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 16px;
  gap: 14px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.card-icon-big {
  color: var(--accent-steel);
  width: 54px;
  height: 54px;
  background: rgba(56, 189, 248, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 440px;
}

.primary-glow-btn {
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  color: #040507;
  font-weight: 600;
  border: none;
  padding: 10px 20px;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25);
}

.primary-glow-btn:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.4);
}

/* Configuration Modal Form */
.config-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.config-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.4px;
}

.corporate-select {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  outline: none;
  transition: var(--transition);
}

.corporate-select:focus {
  border-color: var(--accent-steel);
}

.corporate-select option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.system-spec-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
}

.spec-indicator {
  width: 8px;
  height: 8px;
  background: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.spec-details {
  display: flex;
  flex-direction: column;
}

.spec-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.spec-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* PWA mobile box */
.pwa-install-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pwa-install-box h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

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

.pwa-install-btn {
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  color: #090a0d;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25);
}

.pwa-install-btn:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.4);
}

.ios-install-hint {
  background: var(--bg-surface-elevated);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.ios-install-hint .hint-title {
  display: block;
  font-weight: 600;
  color: var(--accent-steel);
  margin-bottom: 3px;
}

.mobile-sheet-drag-handle {
  display: none;
}

.hidden { display: none !important; }

/* ==========================================================================
   MOBILE RESPONSIVENESS & PWA ADAPTATION (iOS & Android)
   ========================================================================== */

/* Tablets & Small Laptops (<= 960px) */
@media (max-width: 960px) {
  .top-nav {
    padding: 0 18px;
  }

  .active-dataset-pill {
    max-width: 180px;
  }
  
  .pill-text-id {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .dashboard-panel {
    width: 480px;
    right: 16px;
  }
}

/* Mobile Devices (<= 768px) */
@media (max-width: 768px) {
  :root {
    --radius-md: 14px;
  }

  /* Safe Area & Top Nav */
  .top-nav {
    height: 52px;
    padding: max(env(safe-area-inset-top), 6px) 14px 6px 14px;
    justify-content: space-between;
    gap: 8px;
  }

  .nav-brand {
    gap: 10px;
  }

  .brand-symbol {
    width: 32px;
    height: 32px;
  }

  .brand-symbol svg {
    width: 20px;
    height: 20px;
  }

  .brand-title {
    font-size: 0.88rem;
    letter-spacing: 1.2px;
  }

  .brand-accent {
    font-size: 0.62rem;
    padding: 1px 5px;
  }

  .status-badge {
    padding: 4px 8px;
    font-size: 0.64rem;
    gap: 6px;
  }

  .status-badge .status-dot {
    width: 6px;
    height: 6px;
  }

  .nav-btn.icon-btn-nav {
    padding: 6px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Central Voice Hub */
  .voice-center {
    gap: 16px;
    width: 100%;
    padding: 0 16px;
  }

  .orb-interaction-zone {
    width: 210px;
    height: 210px;
  }

  .voice-trigger-pill {
    padding: 9px 20px;
    font-size: 0.82rem;
  }

  /* Carousel horizontal táctil de sugerencias */
  .prompt-suggestions {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100vw;
    padding: 6px 16px;
    justify-content: flex-start;
    scrollbar-width: none;
  }

  .prompt-suggestions::-webkit-scrollbar {
    display: none;
  }

  .prompt-chip {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 6px 12px;
    font-size: 0.74rem;
  }

  /* Bottom Console & Transcript */
  .bottom-console-bar {
    bottom: max(env(safe-area-inset-bottom), 12px);
    width: calc(100vw - 24px);
    gap: 8px;
  }

  .transcript-box {
    padding: 9px 14px;
    font-size: 0.8rem;
  }

  .terminal-input-form {
    padding: 2px 6px 2px 10px;
  }

  .terminal-input {
    font-size: 0.82rem;
    padding: 8px 0;
  }

  /* MOBILE BOTTOM SHEET (Panel Analítico en celular) */
  .dashboard-panel {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    height: 80vh;
    max-height: 80vh;
    border-radius: 20px 20px 0 0;
    border: none;
    border-top: 1px solid var(--border-medium);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
    transform: translateY(0);
    opacity: 1;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .dashboard-overlay.hidden .dashboard-panel {
    transform: translateY(110%);
    opacity: 0;
  }

  .mobile-sheet-drag-handle {
    display: block;
    width: 44px;
    height: 4px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    margin: 10px auto 4px auto;
  }

  .dashboard-header {
    height: 54px;
    padding: 0 16px;
  }

  .dashboard-title {
    font-size: 0.92rem;
  }

  .chart-wrapper {
    height: 230px;
  }

  .dashboard-content {
    padding: 14px;
    padding-bottom: max(env(safe-area-inset-bottom), 30px);
    gap: 14px;
  }

  .kpi-cards-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .kpi-card {
    padding: 12px;
  }

  .kpi-value {
    font-size: 1.25rem;
  }

  .corporate-table {
    font-size: 0.74rem;
  }

  /* Modales en Móvil (Bottom Sheet) */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .modal-dialog {
    max-width: 100vw;
    width: 100%;
    border-radius: 22px 22px 0 0;
    border-bottom: none;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    padding-bottom: max(env(safe-area-inset-bottom), 12px);
  }

  .modal-tabs-bar {
    padding: 6px 12px;
    gap: 4px;
  }

  .modal-tab-pill {
    padding: 6px 10px;
    font-size: 0.72rem;
  }

  .settings-body {
    padding: 14px;
    max-height: calc(88vh - 105px);
  }

  .upload-dropzone-hero {
    padding: 18px 14px;
  }

  .btn-browse-trigger {
    width: 100%;
    justify-content: center;
  }
}

/* Small SmartPhones (<= 380px) */
@media (max-width: 380px) {
  .orb-interaction-zone {
    width: 175px;
    height: 175px;
  }

  .voice-trigger-pill {
    padding: 8px 16px;
    font-size: 0.78rem;
  }

  .kpi-cards-grid {
    grid-template-columns: 1fr;
  }

  .modal-tab-pill span {
    display: none;
  }

  .modal-tab-pill {
    padding: 8px 12px;
  }
}

/* ==========================================================================
   AURA AUTHENTICATION & LOGIN PORTAL
   ========================================================================== */
body:not(.is-authenticated) .top-nav,
body:not(.is-authenticated) .voice-center,
body:not(.is-authenticated) .bottom-console-bar {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body .top-nav,
body .voice-center,
body .bottom-console-bar {
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.auth-lock-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #090a0d;
  background: radial-gradient(circle at 50% 30%, #131620 0%, #090a0d 85%);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-lock-screen.unlocked {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.02);
  pointer-events: none;
}

.auth-lock-screen.hidden {
  display: none !important;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: #0e1017;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 38px 28px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.85),
              0 0 45px rgba(56, 189, 248, 0.07);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-steel), transparent);
}

.auth-card.shake {
  animation: authShake 0.45s ease-in-out;
}

@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-9px); }
  40%, 80% { transform: translateX(9px); }
}

.auth-brand-badge {
  margin-bottom: 16px;
  position: relative;
}

.auth-brand-badge .brand-symbol.large {
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.14) 0%, rgba(9, 10, 13, 0) 70%);
  border-radius: 50%;
  filter: drop-shadow(0 0 16px rgba(56, 189, 248, 0.35));
}

.auth-header {
  margin-bottom: 24px;
}

.auth-brand-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  font-weight: 700;
  color: var(--accent-steel);
  margin-bottom: 6px;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.45;
  max-width: 320px;
  margin: 0 auto;
}

.auth-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  text-align: left;
}

.auth-field-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding-left: 2px;
}

.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-input-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  transition: var(--transition);
}

.auth-input-container:focus-within {
  border-color: var(--accent-steel);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.auth-input-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 14px;
  color: var(--text-muted);
}

.auth-input {
  width: 100%;
  background: transparent;
  border: none;
  padding: 14px 12px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-primary);
  outline: none;
  letter-spacing: 0.05em;
}

.auth-input::placeholder {
  color: var(--text-faint);
  font-family: var(--font-sans);
}

.auth-toggle-btn {
  background: transparent;
  border: none;
  padding: 10px 14px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.auth-toggle-btn:hover {
  color: var(--text-primary);
}

.auth-toggle-btn .icon-eye-hide {
  display: none;
}

.auth-toggle-btn.is-visible .icon-eye-show {
  display: none;
}

.auth-toggle-btn.is-visible .icon-eye-hide {
  display: block;
  color: var(--accent-steel);
}

.auth-error-banner {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  text-align: left;
  line-height: 1.4;
  animation: fadeIn 0.25s ease;
}

.auth-error-banner.is-error {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fda4af;
}

.auth-error-banner.is-notice {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #7dd3fc;
}

.auth-error-banner.hidden {
  display: none;
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
}

.auth-remember-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.auth-remember-label input[type="checkbox"] {
  display: none;
}

.custom-checkbox-indicator {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--border-medium);
  background: var(--bg-surface-elevated);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.auth-remember-label input[type="checkbox"]:checked + .custom-checkbox-indicator {
  background: var(--accent-steel);
  border-color: var(--accent-steel);
}

.auth-remember-label input[type="checkbox"]:checked + .custom-checkbox-indicator::after {
  content: '';
  width: 4px;
  height: 8px;
  border: solid #090a0d;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.auth-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 20px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  color: #090a0d;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.25);
  transition: var(--transition);
  margin-top: 4px;
}

.auth-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(56, 189, 248, 0.38);
}

.auth-submit-btn:active {
  transform: translateY(0);
}

.auth-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(9, 10, 13, 0.25);
  border-top-color: #090a0d;
  border-radius: 50%;
  animation: authSpin 0.7s linear infinite;
}

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

.btn-spinner.hidden {
  display: none;
}

.auth-footer {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.auth-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

@media (max-width: 480px) {
  .auth-card {
    padding: 30px 20px;
  }
  .auth-title {
    font-size: 1.25rem;
  }
}
