/* SmallPopups — panel estilo ChatGPT: sidebar oscura + área clara */
* { box-sizing: border-box; margin: 0; }
:root {
  --oscuro: #171717; --oscuro-hover: #2b2b2b; --claro: #ffffff;
  --borde: #e5e5e5; --texto: #171717; --gris: #6b6b6b; --fondo-suave: #f7f7f8;
}
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  color: var(--texto); background: var(--claro); font-size: 14px;
}
.oculto { display: none !important; }
.hint { font-size: 12px; color: var(--gris); }
.centro { text-align: center; }
code { background: var(--fondo-suave); padding: 1px 5px; border-radius: 5px; font-size: 12px; }

/* ── Auth ── */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--fondo-suave); }
.auth-caja { background: #fff; border: 1px solid var(--borde); border-radius: 16px; padding: 40px 36px; width: 380px; max-width: calc(100vw - 32px); box-shadow: 0 8px 40px rgba(0,0,0,.06); }
.logo-grande { font-size: 24px; font-weight: 800; text-align: center; letter-spacing: -.5px; }
.auth-sub { text-align: center; color: var(--gris); margin: 8px 0 24px; }
.auth-alt { text-align: center; margin-top: 16px; color: var(--gris); font-size: 13px; }
.auth-alt a { color: var(--texto); font-weight: 600; }

/* ── Controles ── */
.campo { width: 100%; padding: 10px 12px; border: 1px solid var(--borde); border-radius: 10px; font: inherit; margin: 4px 0 12px; background: #fff; }
.campo:focus { outline: 2px solid #111; outline-offset: -1px; }
.campo.color { padding: 3px; height: 40px; cursor: pointer; }
.lbl { font-size: 12px; font-weight: 600; color: #444; }
.btn-negro { background: #111; color: #fff; border: none; border-radius: 10px; padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; }
.btn-negro:hover { background: #333; }
.btn-negro:disabled { opacity: .5; cursor: default; }
.btn-gris { background: #fff; border: 1px solid var(--borde); border-radius: 10px; padding: 10px 16px; font: inherit; cursor: pointer; }
.btn-gris:hover { background: var(--fondo-suave); }
.ancho { width: 100%; }
.error { background: #fdecec; color: #b3261e; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; }
.fila2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Layout app ── */
.app { display: flex; height: 100vh; }
.sidebar { width: 262px; min-width: 262px; background: var(--oscuro); color: #ececec; display: flex; flex-direction: column; padding: 12px; }
.btn-nueva { background: transparent; color: #fff; border: 1px solid #444; border-radius: 10px; padding: 11px 12px; font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.btn-nueva:hover { background: var(--oscuro-hover); }
.lista-campanas { flex: 1; overflow-y: auto; margin-top: 12px; }
.camp-item { display: flex; align-items: center; gap: 8px; width: 100%; background: transparent; border: none; color: #ececec; padding: 10px 10px; border-radius: 8px; font: inherit; cursor: pointer; text-align: left; }
.camp-item:hover { background: var(--oscuro-hover); }
.camp-item.activa-sel { background: #343434; }
.camp-item .icono { opacity: .7; }
.camp-item .nombre { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.camp-item .punto { width: 7px; height: 7px; border-radius: 50%; background: #565656; }
.camp-item .punto.on { background: #2eea8a; }
.sidebar-pie { border-top: 1px solid #333; padding-top: 10px; }
.sitio-selector { display: flex; gap: 6px; margin-bottom: 8px; }
.sitio-selector select { flex: 1; background: var(--oscuro-hover); color: #ececec; border: 1px solid #444; border-radius: 8px; padding: 8px; font: inherit; }
.sitio-selector button { background: var(--oscuro-hover); color: #ececec; border: 1px solid #444; border-radius: 8px; width: 36px; cursor: pointer; }
.pie-item { display: block; color: #ececec; text-decoration: none; padding: 9px 10px; border-radius: 8px; font-size: 13px; }
.pie-item:hover { background: var(--oscuro-hover); }
.pie-email { color: #8a8a8a; font-size: 11px; padding: 6px 10px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.principal { flex: 1; overflow-y: auto; }

/* ── Estado vacío ── */
.vacio { max-width: 860px; margin: 0 auto; padding: 9vh 24px 40px; text-align: center; }
.logo-centro { font-size: 30px; font-weight: 800; letter-spacing: -.5px; }
.vacio-sub { color: var(--gris); margin: 10px 0 42px; }
.vacio-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; text-align: center; }
.vacio-col h4 { font-size: 14px; margin-bottom: 14px; font-weight: 700; }
.tarjeta { display: block; width: 100%; background: var(--fondo-suave); border: 1px solid transparent; border-radius: 12px; padding: 13px 14px; font: inherit; font-size: 12.5px; color: #444; cursor: pointer; margin-bottom: 10px; line-height: 1.45; }
.tarjeta:hover { border-color: var(--borde); background: #f0f0f1; }
@media (max-width: 760px) { .vacio-grid { grid-template-columns: 1fr; } .sidebar { min-width: 220px; width: 220px; } }

/* ── Editor ── */
.editor { max-width: 980px; margin: 0 auto; padding: 26px 28px 60px; }
.editor-cab { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.c-nombre { flex: 1; font-size: 20px; font-weight: 700; border: none; padding: 6px 2px; font-family: inherit; }
.c-nombre:focus { outline: none; border-bottom: 2px solid #111; }
.editor-acciones { display: flex; gap: 10px; align-items: center; }
.switch { display: flex; align-items: center; gap: 7px; cursor: pointer; font-size: 12px; color: var(--gris); }
.switch input { display: none; }
.switch span { width: 38px; height: 22px; background: #ccc; border-radius: 999px; position: relative; transition: .15s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: #2eea8a; }
.switch input:checked + span::after { left: 19px; }
.switch em { font-style: normal; min-width: 52px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--borde); margin-bottom: 22px; }
.tab { background: none; border: none; padding: 10px 16px; font: inherit; font-weight: 600; color: var(--gris); cursor: pointer; border-bottom: 2px solid transparent; }
.tab.activa { color: var(--texto); border-bottom-color: #111; }
.editor-2col { display: grid; grid-template-columns: 1fr 380px; gap: 34px; }
@media (max-width: 980px) { .editor-2col { grid-template-columns: 1fr; } }
.tipos { display: flex; gap: 8px; margin: 6px 0 16px; }
.tipos button { flex: 1; padding: 10px 6px; border: 1px solid var(--borde); background: #fff; border-radius: 10px; font: inherit; font-size: 12.5px; cursor: pointer; }
.tipos button.sel { border-color: #111; background: #111; color: #fff; }
.seccion { margin: 22px 0 10px; font-size: 13px; font-weight: 700; }
.editor-preview { position: sticky; top: 26px; align-self: start; }
.preview-marco { border: 1px solid var(--borde); border-radius: 14px; background: repeating-linear-gradient(45deg, #fafafa, #fafafa 12px, #f4f4f5 12px, #f4f4f5 24px); height: 420px; overflow: hidden; position: relative; }
.preview-lienzo { position: absolute; inset: 0; }

/* ── Resultados ── */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 10px; }
.stat { border: 1px solid var(--borde); border-radius: 14px; padding: 18px; }
.stat b { display: block; font-size: 26px; font-weight: 800; }
.stat span { color: var(--gris); font-size: 12px; }
.respuestas { border: 1px solid var(--borde); border-radius: 14px; overflow: hidden; }
.respuesta { display: flex; justify-content: space-between; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--borde); font-size: 13px; }
.respuesta:last-child { border-bottom: none; }
.respuesta .quien { color: var(--gris); font-size: 12px; white-space: nowrap; }
.sin-datos { padding: 22px; text-align: center; color: var(--gris); }

/* ── Modales ── */
.velo { position: fixed; inset: 0; background: rgba(15,15,15,.5); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 18px; }
.modal { background: #fff; border-radius: 16px; padding: 26px; width: 440px; max-width: 100%; max-height: 92vh; overflow-y: auto; }
.modal.ancha { width: 620px; }
.modal h3 { margin-bottom: 14px; }
.modal-pie { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.codigo { background: #171717; color: #2eea8a; border-radius: 10px; padding: 14px; font-size: 12px; overflow-x: auto; margin: 10px 0 16px; font-family: ui-monospace, Menlo, monospace; white-space: pre-wrap; word-break: break-all; }
.planes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 14px 0; }
.plan-card { border: 1px solid var(--borde); border-radius: 14px; padding: 16px; cursor: pointer; }
.plan-card:hover { border-color: #111; }
.plan-card.actual { border-color: #2eea8a; background: #f4fef8; cursor: default; }
.plan-card b { font-size: 17px; }
.plan-card .precio { font-size: 22px; font-weight: 800; margin: 6px 0 2px; }
.plan-card .precio small { font-size: 12px; color: var(--gris); font-weight: 400; }
.plan-card ul { margin: 8px 0 0 16px; color: var(--gris); font-size: 12px; }
