/* ========================================================
   tecnolarsender - panel de control
   Sin dependencias externas: el servidor puede no tener salida a internet.
   ======================================================== */
:root {
  --bg-app: #0a0d18;
  --bg-card: rgba(22, 27, 46, 0.72);
  --bg-inset: rgba(0, 0, 0, 0.28);
  --border: rgba(255, 255, 255, 0.09);
  --border-fuerte: rgba(255, 255, 255, 0.18);

  --texto: #eef1f6;
  --texto-tenue: #98a2b3;

  --azul: #3b82f6;
  --verde: #10b981;
  --ambar: #f59e0b;
  --rojo: #ef4444;
  --violeta: #8b5cf6;
  --cyan: #06b6d4;

  --radio: 12px;
  --transicion: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  --fuente: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
}

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

body {
  background: var(--bg-app);
  color: var(--texto);
  font-family: var(--fuente);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Halos de fondo */
.glow {
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.2;
  z-index: 0;
  pointer-events: none;
}
.glow-violeta { top: -160px; right: -140px; background: var(--violeta); }
.glow-cyan { bottom: -200px; left: -140px; background: var(--cyan); }

.contenedor {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

/* ---------------- Encabezado ---------------- */
.encabezado {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.encabezado h1 {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.encabezado .subtitulo {
  color: var(--texto-tenue);
  font-size: 13px;
  margin-top: 2px;
}

/* ---------------- Tarjetas ---------------- */
.tarjeta {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radio);
  padding: 22px;
  margin-bottom: 20px;
  backdrop-filter: blur(12px);
}
.tarjeta h2 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--texto);
}

.grilla {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 820px) {
  .grilla { grid-template-columns: 1fr; }
}

/* ---------------- Estado de conexion ---------------- */
.estado {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 550;
}
.punto {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--texto-tenue);
}
.punto.conectado { background: var(--verde); box-shadow: 0 0 10px var(--verde); }
.punto.esperando { background: var(--ambar); box-shadow: 0 0 10px var(--ambar); animation: latido 1.4s infinite; }
.punto.desconectado { background: var(--rojo); box-shadow: 0 0 10px var(--rojo); }

@keyframes latido {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.detalle-estado {
  color: var(--texto-tenue);
  font-size: 13px;
  margin-top: 8px;
}

.qr-caja {
  margin-top: 18px;
  text-align: center;
}
.qr-caja img {
  width: 260px;
  max-width: 100%;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}
.qr-ayuda {
  color: var(--texto-tenue);
  font-size: 13px;
  margin-top: 12px;
  line-height: 1.6;
}

.oculto { display: none !important; }

/* ---------------- Formularios ---------------- */
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--texto-tenue);
  margin-bottom: 6px;
}
input[type="text"],
input[type="password"],
input[type="file"],
textarea {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-inset);
  color: var(--texto);
  font-size: 14px;
  font-family: inherit;
  transition: var(--transicion);
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--azul);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
textarea { min-height: 88px; resize: vertical; }

.boton {
  display: inline-block;
  padding: 11px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transicion);
}
.boton:disabled { opacity: 0.45; cursor: not-allowed; }
.boton-primario { background: var(--azul); color: #fff; }
.boton-primario:not(:disabled):hover { background: #2f74e8; }
.boton-peligro {
  background: transparent;
  color: var(--rojo);
  border: 1px solid rgba(239, 68, 68, 0.4);
}
.boton-peligro:not(:disabled):hover { background: rgba(239, 68, 68, 0.12); }
.boton-bloque { width: 100%; }

.nota {
  color: var(--texto-tenue);
  font-size: 12px;
  margin-top: 9px;
  text-align: center;
}

/* Pares etiqueta/valor de la configuracion SMTP */
.datos {
  margin: 16px 0 18px;
  font-size: 13px;
}
.datos div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}
.datos div:last-child { border-bottom: none; }
.datos dt { color: var(--texto-tenue); white-space: nowrap; }
.datos dd { text-align: right; word-break: break-all; }

.aviso {
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  margin-bottom: 14px;
}
.aviso-ok { background: rgba(16, 185, 129, 0.13); color: #6ee7b7; }
.aviso-error { background: rgba(239, 68, 68, 0.13); color: #fca5a5; }
.aviso-info { background: rgba(59, 130, 246, 0.13); color: #93c5fd; }

/* ---------------- Tabla de envios ---------------- */
.tabla-scroll { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--texto-tenue);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  vertical-align: top;
}
tr:last-child td { border-bottom: none; }
td.id { font-family: var(--mono); font-size: 12px; color: var(--texto-tenue); }

.etiqueta {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.etiqueta.done { background: rgba(16, 185, 129, 0.16); color: #6ee7b7; }
.etiqueta.pending, .etiqueta.processing { background: rgba(245, 158, 11, 0.16); color: #fcd34d; }
.etiqueta.partial { background: rgba(139, 92, 246, 0.16); color: #c4b5fd; }
.etiqueta.failed { background: rgba(239, 68, 68, 0.16); color: #fca5a5; }

.error-celda {
  color: #fca5a5;
  font-size: 12px;
  max-width: 320px;
  word-break: break-word;
}
.vacio {
  color: var(--texto-tenue);
  font-size: 13.5px;
  text-align: center;
  padding: 26px 0;
}

/* ---------------- Login ---------------- */
.login-pantalla {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-tarjeta {
  width: 100%;
  max-width: 370px;
  text-align: center;
  margin: 0;
}
.login-tarjeta h1 {
  font-size: 19px;
  margin-bottom: 4px;
}
.login-tarjeta p.sub {
  color: var(--texto-tenue);
  font-size: 13px;
  margin-bottom: 22px;
}
