:root {
  --magenta: #ff00ff;
  --magenta-light: #ff77ff;
  --purple: #7000ff;
  --purple-light: #a366ff;
  --violet: #240046;
  --bg: #05010a;
  --surface: rgba(15, 2, 28, 0.6);
  --surface-bright: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 0, 255, 0.2);
  --border-bright: rgba(255, 255, 255, 0.15);
  --text: #ffffff;
  --text-dim: #b8a9c9;
  --success: #00f2ff;
  --danger: #ff2d55;
  --font-head: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-head);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ── DYNAMIC BACKGROUND ── */
.bg-nebula {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: 
    radial-gradient(circle at 10% 10%, rgba(255, 0, 255, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 90% 10%, rgba(112, 0, 255, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 50% 90%, rgba(36, 0, 70, 0.4) 0%, transparent 60%),
    var(--bg);
}

.bg-nebula::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.04;
  pointer-events: none;
}

.app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

/* ── HEADER ── */
header {
  background: rgba(5, 1, 10, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo { display: flex; align-items: center; gap: 15px; }
.logo-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--magenta), var(--purple));
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 0 30px rgba(255, 0, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.logo-text h1 { font-size: 26px; font-weight: 900; letter-spacing: -1px; background: linear-gradient(to bottom, #fff, var(--magenta-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.logo-text p { font-size: 11px; text-transform: uppercase; letter-spacing: 4px; color: var(--magenta-light); opacity: 0.7; }

.header-stats { display: flex; gap: 2rem; }
.hstat { text-align: center; }
.hstat-val { font-size: 26px; font-weight: 800; font-family: var(--font-mono); color: #fff; }
.hstat-label { font-size: 9px; text-transform: uppercase; letter-spacing: 2px; color: var(--magenta-light); }

/* ── MAIN ── */
main { padding: 2.5rem; max-width: 1600px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 3rem; }

/* ── SUMMARY ── */
.summary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

.stat-card {
  background: rgba(20, 5, 40, 0.4);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 0, 255, 0.1);
  border-radius: 28px;
  padding: 2rem;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(255, 0, 255, 0.05);
}

.stat-card:hover {
  transform: translateY(-8px);
  border-color: var(--magenta);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 0, 255, 0.15);
}

.stat-card .icon { font-size: 38px; margin-bottom: 12px; display: block; filter: drop-shadow(0 0 10px rgba(255,255,255,0.2)); }
.stat-val { font-size: 42px; font-weight: 900; font-family: var(--font-mono); display: block; margin-bottom: 6px; letter-spacing: -1px; }
.stat-val.glow-magenta { color: #fff; text-shadow: 0 0 20px var(--magenta); }
.stat-val.glow-success { color: var(--success); text-shadow: 0 0 20px rgba(0, 242, 255, 0.4); }
.stat-val.glow-danger { color: var(--danger); text-shadow: 0 0 20px rgba(255, 45, 85, 0.4); }
.stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: 3px; color: var(--magenta-light); font-weight: 700; }

/* ── ADD BAR ── */
.add-bar {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  padding: 1rem;
  border-radius: 28px;
  display: flex;
  gap: 15px;
  align-items: center;
}

.add-bar input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 1.1rem 1.8rem;
  color: white;
  font-size: 16px;
  transition: all 0.3s;
}

.add-bar input:focus {
  outline: none;
  border-color: var(--magenta);
  box-shadow: 0 0 0 4px rgba(255, 0, 255, 0.1);
}

.btn-add {
  background: linear-gradient(135deg, var(--magenta), var(--purple));
  border: none;
  padding: 1.1rem 2.5rem;
  border-radius: 20px;
  color: white;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 10px 20px rgba(112, 0, 255, 0.3);
}

.btn-add:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(112, 0, 255, 0.4);
  filter: brightness(1.2);
}

/* ── GRID ── */
.pc-grid {
  display: grid;
  grid-template-columns: 1fr; /* Ocupa todo el ancho */
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ── PC CARD ── */
.pc-card {
  background: rgba(15, 2, 28, 0.7);
  backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 0, 255, 0.15);
  border-radius: 36px;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  animation: pcEnter 0.6s cubic-bezier(0.23, 1, 0.32, 1) both;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.pc-card:hover {
  border-color: rgba(255, 0, 255, 0.3);
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 30px rgba(255, 0, 255, 0.05);
}

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

.pc-header {
  width: 240px; /* Un poco más ancho para mayor impacto */
  padding: 2.5rem 2rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  flex-shrink: 0;
}

.pc-info { display: flex; flex-direction: column; gap: 20px; align-items: flex-start; width: 100%; }
.pc-num {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--purple), var(--magenta));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 26px;
  box-shadow: 0 15px 30px rgba(255, 0, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.pc-name { font-size: 24px; font-weight: 900; line-height: 1.1; color: #fff; text-shadow: 0 0 20px rgba(255,255,255,0.1); }
.pc-meta { font-size: 11px; text-transform: uppercase; color: #fff; letter-spacing: 2px; opacity: 0.9; font-weight: 700; }

.btn-del {
  background: rgba(255, 45, 85, 0.1);
  border: 1px solid rgba(255, 45, 85, 0.2);
  color: var(--danger);
  padding: 8px 15px; /* Botón más pequeño */
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  width: auto;
  margin-top: 1rem;
}

.btn-del:hover { background: var(--danger); color: white; }

/* ── BODY ── */
.pc-body {
  flex: 1;
  display: flex;
  flex-direction: column; 
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

/* ── CELULARES ── */
.cel-block {
  display: flex;
  flex-direction: row;
  min-width: 0;
  height: 100%;
}

/* header del dispositivo (izquierda) */
.cel-header {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  width: 140px;
  text-align: center;
}

.cel-header span[style*="font-size: 10px"] {
  font-size: 12px !important;
  color: var(--success) !important;
  text-shadow: 0 0 10px rgba(0, 242, 255, 0.3);
  margin-top: 5px;
}

/* sesiones a la derecha */
.cel-container {
  flex: 1;
  display: flex;
  flex-direction: column; /* Sesiones una debajo de otra */
  min-width: 0;
  background: rgba(0,0,0,0.2);
}

.cel-pill {
  background: rgba(163, 102, 255, 0.1);
  border: 1px solid rgba(163, 102, 255, 0.3);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 900;
  font-family: var(--font-mono);
  color: var(--purple-light);
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow: 0 0 15px rgba(163, 102, 255, 0.1);
}

.wa-row {
  padding: 0.5rem 1.8rem; /* Altura mínima: súper bajito */
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 25px;
  background: transparent;
  transition: all 0.3s;
  flex: 1;
}

.wa-badge { 
  display: flex; 
  align-items: center; 
  gap: 15px; 
  width: 250px; 
  flex-shrink: 0;
}
.wa-icon-box {
  width: 32px; /* Más pequeño para ahorrar espacio */
  height: 32px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 6px;
  color: var(--success);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.wa-icon-box.empty { opacity: 0.3; filter: grayscale(1); }

.wa-name { font-size: 13px; font-weight: 800; display: block; white-space: nowrap; color: #fff; }
.wa-status { font-size: 10px; color: #fff; text-transform: uppercase; opacity: 0.8; letter-spacing: 1px; }

.wa-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.6rem 1.2rem; /* Input más delgado */
  border-radius: 10px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 15px;
  transition: all 0.3s;
}

.wa-input:focus {
  border-color: var(--magenta);
  box-shadow: 0 0 30px rgba(255, 0, 255, 0.2), inset 0 2px 10px rgba(0,0,0,0.5);
  background: rgba(0, 0, 0, 0.6);
}

.wa-recarga-select {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.3s;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-width: 130px;
  appearance: none;
  text-align: center;
  font-family: var(--font-mono);
}

.wa-recarga-select:focus {
  outline: none;
  border-color: var(--magenta);
}

.wa-recarga-select.con {
  background: rgba(0, 242, 255, 0.1);
  color: var(--success);
  border-color: rgba(0, 242, 255, 0.3);
}

.wa-recarga-select.sin {
  background: rgba(255, 45, 85, 0.1);
  color: var(--danger);
  border-color: rgba(255, 45, 85, 0.3);
}

.wa-recarga-select option {
  background: #1a0a2e;
  color: white;
}

/* ── EXTRA FIELDS (Sesión / Computadora) ── */
.wa-extra-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.wa-field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wa-field-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: var(--magenta-light);
  opacity: 0.8;
  font-family: var(--font-mono);
  padding-left: 4px;
}

.wa-field-input {
  border-color: rgba(163, 102, 255, 0.2);
}

.wa-field-input:focus {
  border-color: var(--purple-light);
  box-shadow: 0 0 16px rgba(112, 0, 255, 0.15);
}

.wa-input::placeholder {
  color: rgba(255, 255, 255, 0.5) !important;
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(15px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal {
  background: #11051a;
  border: 1px solid var(--border);
  border-radius: 40px;
  width: 90%;
  max-width: 480px;
  padding: 3rem;
  text-align: center;
  transform: scale(0.9) translateY(30px);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }

.modal-icon { font-size: 60px; margin-bottom: 1.5rem; }
.modal-title { font-size: 28px; font-weight: 900; margin-bottom: 1rem; }
.modal-body { font-size: 16px; color: var(--text-dim); margin-bottom: 2.5rem; }

.modal-actions { display: flex; gap: 15px; }
.btn-modal { flex: 1; padding: 1.2rem; border-radius: 20px; font-weight: 800; cursor: pointer; transition: all 0.2s; border: none; }
.btn-modal-cancel { background: rgba(255, 255, 255, 0.05); color: white; }
.btn-modal-confirm { background: var(--danger); color: white; }

/* ── RESPONSIVE ── */
@media (max-width: 1300px) { .summary { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px) {
  header { flex-direction: column; gap: 1.5rem; padding: 1.5rem; }
  .summary { grid-template-columns: repeat(2, 1fr); }
  main { padding: 1.5rem; }
  .pc-grid { grid-template-columns: 1fr; }
}
@media (max-width: 500px) { .summary { grid-template-columns: 1fr; } }
