/* KDDEmprende — tema global dark + glassmorphism */
:root {
  --bg-deep: #0a0a0f;
  --purple: #7b2ff7;
  --cyan: #00d4ff;
  --glass: rgba(18, 18, 28, 0.55);
  --glass-border: rgba(255, 255, 255, 0.12);
  --text: #e8e8f0;
  --muted: rgba(232, 232, 240, 0.65);
  --radius-lg: 26px;
  --radius-pill: 50px;
  --shadow-neon: 0 0 32px rgba(123, 47, 247, 0.25), 0 20px 50px rgba(0, 0, 0, 0.45);
  --blur: 18px;
}

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

html {
  scroll-behavior: smooth;
}

body.ed-body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-weight: 400;
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% -10%, rgba(123, 47, 247, 0.35), transparent),
    radial-gradient(900px 500px at 90% 10%, rgba(0, 212, 255, 0.22), transparent), var(--bg-deep);
  line-height: 1.55;
}

body.ed-body a {
  color: inherit;
}

.ed-bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
}

/* Foto de fondo en index / login (capa bajo partÃ­culas si hay canvas) */
.ed-auth-photo-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0.14;
  filter: saturate(0.9) brightness(0.95);
}

.ed-auth-photo-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 100% 80% at 50% 20%,
    transparent 0%,
    rgba(10, 10, 15, 0.65) 70%,
    rgba(10, 10, 15, 0.92) 100%
  );
  pointer-events: none;
}

body.ed-auth-entry-page .ed-bg-canvas {
  z-index: 1;
}

body.ed-auth-entry-page .ed-auth-wrap {
  position: relative;
  z-index: 2;
}

.ed-shell {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}

.ed-sidebar {
  width: 260px;
  flex-shrink: 0;
  padding: 22px 18px;
  background: var(--glass);
  border-right: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--blur));
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ed-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ed-brand span {
  background: linear-gradient(120deg, var(--purple), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 1.05rem;
}

.ed-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px;
  border-radius: 16px;
  text-decoration: none;
  color: var(--muted);
  transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease;
  font-size: 0.95rem;
}

.ed-nav a i {
  font-size: 1.25rem;
  opacity: 0.9;
}

.ed-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(2px);
}

.ed-nav a.is-active {
  color: var(--text);
  background: linear-gradient(120deg, rgba(123, 47, 247, 0.35), rgba(0, 212, 255, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-neon);
}

.ed-main {
  flex: 1;
  padding: 22px 22px 48px;
  max-width: 1200px;
  width: 100%;
}

.ed-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.ed-menu-btn {
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
  backdrop-filter: blur(var(--blur));
  cursor: pointer;
  transition: 0.3s ease;
}

.ed-menu-btn:hover {
  box-shadow: var(--shadow-neon);
}

.ed-offcanvas {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ed-offcanvas.is-open {
  pointer-events: auto;
  opacity: 1;
}

.ed-offcanvas-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.ed-offcanvas-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(88vw, 300px);
  background: rgba(12, 12, 18, 0.92);
  border-right: 1px solid var(--glass-border);
  padding: 18px;
  transform: translateX(-100%);
  transition: transform 0.35s ease;
}

.ed-offcanvas.is-open .ed-offcanvas-panel {
  transform: translateX(0);
}

.ed-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 22px 22px 24px;
  backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow-neon);
  animation: edFadeUp 0.55s ease both;
}

.ed-card + .ed-card {
  margin-top: 18px;
}

.ed-grid {
  display: grid;
  gap: 18px;
}

@media (min-width: 900px) {
  .ed-grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ed-grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.ed-h1 {
  margin: 0 0 8px;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 600;
}

.ed-h2 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  font-weight: 600;
}

.ed-muted {
  color: var(--muted);
  margin: 0 0 16px;
}

.ed-label {
  display: block;
  margin: 12px 0 6px;
  font-size: 0.9rem;
  color: var(--muted);
}

.ed-input,
.ed-textarea,
.ed-select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 10, 15, 0.55);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.ed-textarea {
  min-height: 120px;
  resize: vertical;
}

.ed-input:focus,
.ed-textarea:focus,
.ed-select:focus {
  border-color: rgba(123, 47, 247, 0.65);
  box-shadow: 0 0 0 3px rgba(123, 47, 247, 0.22), 0 0 24px rgba(0, 212, 255, 0.12);
  background: rgba(10, 10, 15, 0.75);
}

.ed-pass-wrap {
  position: relative;
}

.ed-pass-wrap .ed-input {
  padding-right: 3rem;
}

.ed-pass-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 12px;
  line-height: 1;
  transition: color 0.2s ease, background 0.2s ease;
}

.ed-pass-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.ed-pass-toggle:focus-visible {
  outline: 2px solid rgba(123, 47, 247, 0.6);
  outline-offset: 2px;
}

.ed-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  font-size: 1rem;
}

.ed-btn-primary {
  color: #0a0a0f;
  background: linear-gradient(120deg, var(--purple), var(--cyan));
  box-shadow: 0 0 26px rgba(123, 47, 247, 0.45);
}

.ed-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 34px rgba(0, 212, 255, 0.35);
}

.ed-btn-ghost {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
}

.ed-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

.ed-btn-lg {
  padding: 16px 28px;
  font-size: 1.05rem;
}

.ed-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.ed-alert {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  margin-bottom: 14px;
}

.ed-alert-error {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.1);
}

.ed-alert-success {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.1);
}

.ed-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

.ed-stat {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.ed-stat strong {
  display: block;
  font-size: 1.6rem;
  font-weight: 600;
  margin-top: 6px;
  background: linear-gradient(120deg, var(--purple), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Metas de ventas en escritorio: nÃºmeros mÃ¡s visibles */
.ed-stat-goal strong {
  font-size: clamp(2rem, 5vw, 2.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  filter: drop-shadow(0 0 18px rgba(123, 47, 247, 0.35));
}

.ed-stat-goal .ed-stat-sub {
  display: block;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ed-dash-goals-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.ed-dash-goals-head .ed-h2 {
  margin-bottom: 0;
}

.ed-dash-goals-micro {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 14px;
  max-width: 44rem;
}

.ed-calc-goals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
  min-width: 0;
}

.ed-calc-goals > .ed-stat-goal {
  min-width: 0;
}

.ed-calc-goals .ed-stat-goal {
  text-align: center;
}

.ed-calc-goals .ed-stat-goal strong {
  font-size: clamp(1.65rem, 6vw, 2.35rem);
}

.ed-table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

table.ed-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.ed-table th,
.ed-table td {
  padding: 12px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  font-size: 0.92rem;
}

.ed-table th {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ed-badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.b-nuevo {
  border-color: rgba(0, 212, 255, 0.45);
  color: #7dd3fc;
}
.b-contactado {
  border-color: rgba(123, 47, 247, 0.55);
  color: #d8b4fe;
}
.b-calificado {
  border-color: rgba(250, 204, 21, 0.45);
  color: #fde047;
}
.b-ganado {
  border-color: rgba(52, 211, 153, 0.55);
  color: #6ee7b7;
}
.b-perdido {
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
}

.ed-loader-wrap {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
}

.ed-loader-wrap.is-visible {
  display: flex;
}

.ed-loader {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--purple);
  border-right-color: var(--cyan);
  animation: edSpin 0.9s linear infinite;
}

.ed-chat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 520px;
  overflow: auto;
  padding: 8px 4px;
}

.ed-bubble {
  max-width: 92%;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
  animation: edFadeUp 0.45s ease both;
}

.ed-bubble.ai {
  align-self: flex-start;
  border-color: rgba(123, 47, 247, 0.35);
}

.ed-bubble.me {
  align-self: flex-end;
  background: linear-gradient(120deg, rgba(123, 47, 247, 0.35), rgba(0, 212, 255, 0.2));
}

.ed-auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.ed-auth-card {
  width: min(460px, 100%);
  animation: edFadeUp 0.6s ease both;
}

.ed-auth-logo {
  text-align: center;
  margin-bottom: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 1.25rem;
  background: linear-gradient(120deg, var(--purple), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Marca KDDEmprende (logo + icono) */
.ed-brand-logo-img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Cabecera auth: sin flex en el enlace del logo (evita min-width:auto del img gigante) */
.ed-auth-header {
  margin: 0 0 1.25rem;
  padding: 0;
  text-align: center;
  overflow: hidden;
}

.ed-auth-brand-link {
  display: inline-block;
  max-width: 220px;
  margin: 0 auto;
  padding: 0;
  line-height: 0;
  vertical-align: top;
  text-decoration: none;
}

.ed-auth-brand-link:hover {
  opacity: 0.92;
}

.ed-brand-logo-auth {
  display: block;
  width: 200px;
  max-width: 100%;
  height: auto;
  max-height: 44px;
  margin: 0 auto;
  object-fit: contain;
  object-position: center center;
}

.ed-auth-brand-title {
  margin: 0.85rem 0 0;
  padding: 0;
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--text, #e8e8f0);
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1.35;
}

.ed-auth-brand-title--admin {
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.85;
}

.ed-auth-header--admin .ed-brand-logo-auth {
  width: 180px;
  max-height: 40px;
}

.ed-auth-intro,
.ed-auth-card > .ed-muted.ed-auth-intro {
  text-align: center;
  width: 100%;
  margin-top: 0;
}

.ed-auth-card > .ed-auth-header + .ed-muted {
  margin-top: 0;
}

.ed-auth-card > form,
.ed-auth-card form {
  width: 100%;
  text-align: left;
}

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

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

@media (max-width: 960px) {
  .ed-sidebar {
    display: none;
  }
  .ed-topbar {
    display: flex;
  }
}

@media (min-width: 961px) {
  .ed-offcanvas {
    display: none;
  }
}
