:root {
  --bg-negro: #05070C;
  --panel-oscuro: #0B101B;
  --panel-cristal: rgba(15, 23, 42, 0.78);
  --blanco: #FFFFFF;
  --gris-texto: #94A3B8;
  --azul-claro: #38BDF8;
  --azul-intenso: #0EA5E9;
  --borde-azul: rgba(56, 189, 248, 0.28);
  --borde-sutil: rgba(255, 255, 255, 0.09);
}

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

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-negro);
  background-image: radial-gradient(circle at 15% 15%, rgba(56, 189, 248, 0.12), transparent 35%),
                    radial-gradient(circle at 85% 25%, rgba(14, 165, 233, 0.09), transparent 40%);
  color: var(--blanco);
  line-height: 1.5;
  min-height: 100vh;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.topbar {
  background: rgba(5, 7, 12, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--borde-sutil);
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--blanco);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.5px;
}

.brand-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #38BDF8, #0284C7);
  color: #05070C;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 19px;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.45);
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-azul {
  background: var(--azul-claro);
  color: #05070C;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.35);
}

.btn-azul:hover {
  background: #7DD3FC;
  transform: translateY(-1px);
}

.btn-blanco {
  background: var(--blanco);
  color: #05070C;
}

.btn-blanco:hover {
  background: #E2E8F0;
}

.btn-glass {
  background: rgba(255, 255, 255, 0.05);
  color: var(--blanco);
  border: 1px solid var(--borde-sutil);
}

.btn-glass:hover {
  border-color: var(--azul-claro);
  color: var(--azul-claro);
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 52px 24px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 44px;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--azul-claro);
  border: 1px solid var(--borde-azul);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.hero-title {
  font-size: 46px;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -1.2px;
  background: linear-gradient(180deg, #FFFFFF 45%, #7DD3FC 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 18px;
}

.card-glass {
  background: var(--panel-cristal);
  border: 1px solid var(--borde-sutil);
  border-radius: 22px;
  padding: 26px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

.card-neon {
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.14), rgba(11, 16, 27, 0.92));
  border: 1px solid var(--azul-claro);
  border-radius: 22px;
  padding: 26px;
  box-shadow: 0 0 35px rgba(56, 189, 248, 0.18);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.escenario-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--borde-sutil);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
}

.escenario-optimo {
  background: var(--azul-claro);
  color: #05070C;
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  font-weight: 800;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.4);
}

.app-layout {
  display: grid;
  grid-template-columns: 275px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #080C16;
  border-right: 1px solid var(--borde-sutil);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.nav-item {
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border-radius: 12px;
  background: transparent;
  color: var(--gris-texto);
  font-weight: 600;
  font-size: 13px;
  border: 1px solid transparent;
  cursor: pointer;
  margin-bottom: 6px;
  transition: 0.2s;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(56, 189, 248, 0.14);
  color: var(--azul-claro);
  border-color: var(--borde-azul);
  font-weight: 700;
}

.input-field,
select {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #05070C;
  font-size: 13px;
  color: var(--blanco);
  outline: none;
}

.input-field:focus,
select:focus {
  border-color: var(--azul-claro);
}

.chat-window {
  height: 440px;
  overflow-y: auto;
  padding: 20px;
  background: #05070C;
  border-radius: 16px;
  border: 1px solid var(--borde-sutil);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg-ia {
  background: #0F172A;
  border: 1px solid var(--borde-azul);
  padding: 14px 18px;
  border-radius: 16px;
  max-width: 86%;
  font-size: 14px;
  color: #E2E8F0;
}

.msg-user {
  background: var(--azul-claro);
  color: #05070C;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: 16px;
  max-width: 80%;
  align-self: flex-end;
  font-size: 14px;
}

.hidden {
  display: none !important;
}

/* =========================================================
   ADAPTACIÓN MÓVIL Y TABLET (RESPONSIVE)
   ========================================================= */
@media (max-width: 900px) {
  .topbar {
    padding: 14px 16px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
  }

  .brand {
    justify-content: center;
    width: 100%;
  }

  .topbar nav,
  .topbar > div {
    justify-content: center !important;
    width: 100%;
    flex-wrap: wrap;
    gap: 8px !important;
  }

  .container {
    padding: 28px 16px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero-title {
    font-size: 31px;
    line-height: 1.14;
    letter-spacing: -0.6px;
  }

  .grid-3 {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--borde-sutil);
    padding: 16px;
    gap: 14px;
    align-items: center;
    text-align: center;
  }

  .sidebar nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .nav-item {
    margin-bottom: 0;
    padding: 10px 12px;
    font-size: 12px;
    text-align: center;
  }

  .card-glass,
  .card-neon {
    padding: 18px;
    border-radius: 18px;
  }

  .chat-window {
    height: 340px;
    padding: 14px;
  }

  .msg-ia,
  .msg-user {
    max-width: 94%;
    font-size: 13px;
  }

  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  section, div {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .brand {
    font-size: 17px;
  }

  .brand-badge {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .btn {
    padding: 10px 16px;
    font-size: 12px;
  }

  .hero-title {
    font-size: 27px;
  }

  .sidebar nav {
    grid-template-columns: 1fr;
  }
}
