:root {
  --bg: #F7F5FA;
  --surface: #FFFFFF;
  --border: #E3DFEA;
  --text-primary: #262626;
  --text-secondary: #6B6B6B;
  --accent: #5B2A86;
  --accent-light: #EEEDFE;
  --success-bg: #EAF3DE;
  --success-text: #3B6D11;
  --radius: 8px;
}
* { box-sizing: border-box; }
body {
  font-family: -apple-system, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  margin: 0;
  padding: 2rem;
}
.wrap { max-width: 760px; margin: 0 auto; }
h1 { font-size: 22px; font-weight: 600; color: var(--accent); margin: 0 0 4px; }
.sub { color: var(--text-secondary); font-size: 14px; margin: 0 0 1.5rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.card h2 { font-size: 16px; font-weight: 600; margin: 0 0 1rem; }
label.field-label { font-size: 13px; color: var(--text-secondary); display: block; margin-bottom: 4px; }
input[type=text], select {
  width: 100%; height: 36px; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0 10px; font-size: 14px; background: #fff; color: var(--text-primary);
}
.row { display: flex; gap: 12px; margin-bottom: 14px; }
.row > div { flex: 1; }
.field { margin-bottom: 14px; }
#mod-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: 8px; margin-top: 6px; }
.mod-option {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 10px; font-size: 13px; cursor: pointer;
}
.mod-option i { font-size: 16px; color: var(--text-secondary); }
button#add-biz-btn {
  width: 100%; height: 40px; border: none; border-radius: var(--radius);
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
}
button#add-biz-btn:hover { background: #471f6c; }
#biz-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap: 12px; }
.biz-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem; }
.biz-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.biz-card-top p { font-weight: 600; font-size: 15px; margin: 0; }
.badge-active { background: var(--success-bg); color: var(--success-text); font-size: 11px; padding: 2px 8px; border-radius: var(--radius); text-transform: capitalize; }
.biz-meta { font-size: 13px; color: var(--text-secondary); margin: 0 0 10px; }
.pill { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-light); color: var(--accent); border-radius: var(--radius); padding: 3px 8px; font-size: 12px; margin: 0 4px 4px 0; }
.pill i { font-size: 13px; }
.empty-state { color: var(--text-secondary); font-size: 13px; padding: 1rem 0; }

.whatsapp-estado { font-size: 12px; margin: 4px 0 10px; display: flex; align-items: center; gap: 6px; }
.whatsapp-estado .dot { width: 8px; height: 8px; border-radius: 50%; background: #999; display: inline-block; }
.whatsapp-estado.conectado .dot { background: #3B6D11; }
.whatsapp-estado.pendiente .dot { background: #B08900; }
.btn-conectar-wa {
  width: 100%; height: 32px; border: 1px solid var(--accent); border-radius: var(--radius);
  background: #fff; color: var(--accent); font-size: 13px; font-weight: 600; cursor: pointer;
}
.btn-conectar-wa:hover { background: var(--accent-light); }

.btn-configurar-bot {
  width: 100%; height: 32px; margin-top: 8px; border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; color: var(--text-secondary); font-size: 13px; font-weight: 600; cursor: pointer;
}
.btn-configurar-bot:hover { background: var(--bg); }

.modal-box-ancho { max-width: 520px; text-align: left; }
.modal-box-ancho textarea {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 10px; font-size: 14px; font-family: inherit; color: var(--text-primary); resize: vertical;
}
.bot-opcion-fila {
  display: grid; grid-template-columns: 50px 140px 1fr 28px; gap: 6px; margin-bottom: 8px; align-items: start;
}
.bot-opcion-fila input, .bot-opcion-fila textarea {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 8px; font-size: 13px; font-family: inherit;
}
.bot-opcion-quitar {
  border: none; background: none; color: var(--text-secondary); font-size: 18px; line-height: 1; cursor: pointer;
}
.bot-opcion-quitar:hover { color: #b3261e; }
.btn-agregar-opcion {
  border: 1px dashed var(--border); background: none; color: var(--accent); border-radius: var(--radius);
  padding: 6px 10px; font-size: 13px; cursor: pointer; margin-top: 4px;
}
#bot-guardar-btn {
  width: 100%; height: 38px; margin-top: 1rem; border: none; border-radius: var(--radius);
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
}
#bot-guardar-btn:hover { background: #471f6c; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal-overlay[hidden] { display: none; }
.modal-box {
  background: var(--surface); border-radius: 12px; padding: 1.5rem; max-width: 320px; width: 90%;
  text-align: center;
}
.modal-box h3 { margin: 0 0 0.5rem; font-size: 16px; }
.modal-box p { font-size: 13px; color: var(--text-secondary); margin: 0 0 1rem; }
.modal-box img { width: 220px; height: 220px; border: 1px solid var(--border); border-radius: var(--radius); }
.modal-cerrar {
  margin-top: 1rem; border: none; background: none; color: var(--text-secondary);
  font-size: 13px; cursor: pointer; text-decoration: underline;
}
