:root, :root[data-tema=dark] {
  --tinta: #f3f0f7; --tinta-2: #cfc9d9; --suave: #9b94a8; --linea: #2a2733; --linea-2: #3a3645; --fondo: #0d0c11; --tarjeta: #17151d;
  --sup: #17151d; --sup-2: #1e1b26; --sup-3: #2a2733; --boton: #f3f0f7; --boton-txt: #17151d;
  --acento: #ee7a5c; --acento-osc: #f39a82; --acento-claro: rgba(238,122,92,.14); --ok: #4cc38a; --ok-bg: rgba(76,195,138,.14); --err: #ff7b72; --err-bg: rgba(255,123,114,.13); --aviso: #f0b45a; --aviso-bg: rgba(240,180,90,.14);
  --sombra: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35); --radio: 14px; color-scheme: dark;
  --serif: 'Cormorant Garamond', Georgia, serif; --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
:root[data-tema=light] {
  --tinta: #2b2433; --tinta-2: #4a4255; --suave: #7a7385; --linea: #e8e3dc; --linea-2: #d9d2c8; --fondo: #f7f4ef; --tarjeta: #ffffff;
  --sup: #ffffff; --sup-2: #fcfaf7; --sup-3: #eee9e2; --boton: #2b2433; --boton-txt: #ffffff;
  --acento: #d9603f; --acento-osc: #b84a2c; --acento-claro: #fbe9e3; --ok: #1f7a4d; --ok-bg: #e4f4eb; --err: #b3261e; --err-bg: #fbe9e7; --aviso: #8a5a00; --aviso-bg: #fff3d6;
  --sombra: 0 1px 2px rgba(43,36,51,.06), 0 8px 24px rgba(43,36,51,.06); color-scheme: light;
}
* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font: 400 15px/1.5 var(--sans); color: var(--tinta); background: var(--fondo); transition: background .2s, color .2s; -webkit-font-smoothing: antialiased; min-height: 100vh; }
h1, h2, h3 { line-height: 1.2; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--acento-osc); }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
[hidden] { display: none !important; }
.ico { flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cargando-pagina { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--linea); border-top-color: var(--acento); border-radius: 50%; animation: gira .8s linear infinite; display: inline-block; }
@keyframes gira { to { transform: rotate(360deg); } }
.texto-suave { color: var(--suave); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- Botones ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--linea); background: var(--sup); font-weight: 500; font-size: 14px; cursor: pointer; text-decoration: none; color: var(--tinta); transition: background .15s, border-color .15s, transform .1s; white-space: nowrap; }
.btn:hover { background: var(--sup-2); border-color: #d8d1c7; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primario { background: var(--boton); color: var(--boton-txt); border-color: var(--boton); }
.btn-primario:hover { opacity: .88; }
.btn-acento { background: linear-gradient(135deg, #f0845f, #e5527a); color: #fff; border-color: transparent; box-shadow: 0 6px 18px rgba(229,82,122,.28); } .btn-acento:hover { filter: brightness(1.08); }
.btn-peligro { background: var(--err); color: #fff; border-color: var(--err); } .btn-peligro:hover { background: #8f1f18; border-color: #8f1f18; }
.btn-fantasma { background: transparent; border-color: transparent; } .btn-fantasma:hover { background: rgba(43,36,51,.06); border-color: transparent; }
.btn-chico { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-grande { padding: 12px 22px; font-size: 15px; border-radius: 12px; }
.btn-icono { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; color: var(--tinta-2); }
.btn-icono:hover { background: rgba(43,36,51,.08); }
.btn-icono.peligro:hover { background: var(--err-bg); color: var(--err); }

/* ---- Formularios ---- */
.campo { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; min-width: 0; }
.campo > label { font-weight: 600; font-size: 13px; color: var(--tinta-2); }
.ayuda { color: var(--suave); font-size: 12.5px; line-height: 1.4; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=tel], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--linea-2); border-radius: 10px; background: var(--sup); font-size: 15px; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; min-height: 84px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acento); box-shadow: 0 0 0 3px rgba(180,130,106,.2); }
input[type=color] { width: 44px; height: 38px; padding: 2px; border: 1px solid var(--linea-2); border-radius: 10px; background: var(--sup); cursor: pointer; }
.fila { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.fila-2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; } @media (max-width: 520px) { .fila-2 { grid-template-columns: 1fr; } }
.interruptor { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; padding: 6px 0; }
.interruptor input { position: absolute; opacity: 0; }
.pista { flex: none; width: 40px; height: 24px; border-radius: 99px; background: var(--linea-2); position: relative; transition: background .2s; margin-top: 1px; }
.pista::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--sup); transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.interruptor input:checked + .pista { background: var(--acento); } .interruptor input:checked + .pista::after { transform: translateX(16px); }
.interruptor input:focus-visible + .pista { outline: 2px solid var(--acento); outline-offset: 2px; }
.interruptor-txt { font-weight: 500; font-size: 14px; } .interruptor-txt small { display: block; font-weight: 400; color: var(--suave); font-size: 12.5px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--sup-3); color: var(--tinta-2); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.err { background: var(--err-bg); color: var(--err); } .chip.alerta { background: var(--aviso-bg); color: var(--aviso); } .chip.acento { background: var(--acento-claro); color: var(--acento-osc); }

/* ---- Avisos y modales ---- */
.avisos { position: fixed; z-index: 400; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; width: calc(100% - 32px); max-width: 420px; pointer-events: none; }
.aviso { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 12px; background: var(--boton); color: var(--boton-txt); font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); opacity: 0; transform: translateY(8px); transition: .25s; }
.aviso.ver { opacity: 1; transform: none; } .aviso.error { background: var(--err); color: #fff; }
.modal-fondo { position: fixed; inset: 0; z-index: 300; background: rgba(30,24,40,.55); display: flex; align-items: center; justify-content: center; padding: 16px; backdrop-filter: blur(2px); }
.modal { width: 100%; max-height: 92vh; overflow: auto; background: var(--sup); border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.modal-cab { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 0; } .modal-cab h3 { font-size: 18px; }
.modal-cuerpo { padding: 14px 20px; } .modal-pie { display: flex; justify-content: flex-end; gap: 10px; padding: 6px 20px 18px; flex-wrap: wrap; }

/* ---- Utilidades de página ---- */
.cab-pagina { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.cab-pagina h1 { font: 700 26px/1.2 var(--sans); letter-spacing: -.02em; } .cab-pagina p { color: var(--suave); margin-top: 4px; }
.acciones { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.error-form { background: var(--err-bg); color: var(--err); padding: 10px 12px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; }

/* ---- Tarjetas ---- */
.tarjeta { background: var(--tarjeta); border: 1px solid var(--linea); border-radius: var(--radio); box-shadow: var(--sombra); }
.tarjeta-p { padding: 20px; } .tarjeta h2 { font-size: 16px; margin-bottom: 12px; } .tarjeta h3 { font-size: 15px; }
.rejilla { display: grid; gap: 16px; } .rejilla-auto { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 20px; }
.kpi { padding: 16px 18px; } .kpi small { color: var(--suave); font-size: 13px; font-weight: 500; display: block; } .kpi b { display: block; font-size: 30px; line-height: 1.15; margin-top: 4px; letter-spacing: -.02em; } .kpi span { font-size: 12.5px; color: var(--suave); }
.inv-card { display: flex; flex-direction: column; overflow: hidden; }
.inv-card-img { height: 150px; background: #2b2433 center/cover; position: relative; display: grid; place-items: center; color: #fff; }
.inv-card-img .nombres { font: 600 26px/1.1 var(--serif); text-align: center; text-shadow: 0 2px 12px rgba(0,0,0,.5); padding: 0 12px; }
.inv-card-img .chip { position: absolute; top: 10px; left: 10px; }
.inv-card-cuerpo { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; } .inv-card-cuerpo small { color: var(--suave); }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; padding: 10px 0; border-block: 1px solid var(--linea); } .mini-stats b { display: block; font-size: 19px; } .mini-stats small { font-size: 11.5px; }
.inv-card-pie { margin-top: auto; display: flex; gap: 8px; }
.vacio { text-align: center; padding: 48px 20px; color: var(--suave); } .vacio h3 { color: var(--tinta); margin: 10px 0 4px; font-size: 18px; } .vacio p { max-width: 42ch; margin: 0 auto 16px; }
.vacio-ico { width: 60px; height: 60px; margin: 0 auto; border-radius: 50%; background: var(--acento-claro); color: var(--acento); display: grid; place-items: center; }
.plantilla-card { overflow: hidden; cursor: pointer; text-align: left; padding: 0; transition: transform .15s, box-shadow .15s; } .plantilla-card:hover { transform: translateY(-3px); }
.plantilla-card .img { height: 190px; background: #1a1620 center/cover no-repeat; }
.plantilla-card .t { padding: 16px 18px 18px; } .plantilla-card .t b { font-size: 17px; } .plantilla-card .t p { color: var(--suave); font-size: 13.5px; margin: 4px 0 12px; }

/* ---- Pestañas ---- */
.pestanas { display: flex; gap: 4px; border-bottom: 1px solid var(--linea); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.pestana { padding: 10px 14px; text-decoration: none; color: var(--suave); font-weight: 500; font-size: 14.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; gap: 7px; align-items: center; }
.pestana:hover { color: var(--tinta); } .pestana.activa { color: var(--tinta); border-bottom-color: var(--acento); font-weight: 600; }

/* ---- Resumen de invitación ---- */
.dos-col { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } @media (max-width: 1000px) { .dos-col { grid-template-columns: 1fr; } }
.enlace-caja { display: flex; gap: 8px; align-items: center; background: var(--sup-2); border-radius: 10px; padding: 8px 8px 8px 14px; } .enlace-caja code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.lista-tareas { list-style: none; padding: 0; display: grid; gap: 8px; } .lista-tareas li { display: flex; gap: 10px; align-items: center; font-size: 14px; } .lista-tareas .marca { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--sup-3); color: transparent; flex: none; } .lista-tareas li.hecho .marca { background: var(--ok); color: #fff; } .lista-tareas li.hecho span { color: var(--suave); }
.qr-caja { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; } .qr-caja img { width: 140px; height: 140px; border: 1px solid var(--linea); border-radius: 10px; padding: 6px; background: var(--sup); }
.barras { display: flex; align-items: flex-end; gap: 6px; height: 90px; } .barras div { flex: 1; background: var(--acento-claro); border-radius: 5px 5px 0 0; position: relative; min-height: 3px; } .barras div.hoy { background: var(--acento); } .barras-ejes { display: flex; gap: 6px; font-size: 10.5px; color: var(--suave); margin-top: 4px; } .barras-ejes span { flex: 1; text-align: center; }

/* ---- Editor ---- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
@media (max-width: 1180px) { .editor { grid-template-columns: 1fr; } .editor-vista { display: none; } }
.editor-vista { position: sticky; top: 16px; }
.telefono { width: 372px; max-width: 100%; margin: 0 auto; border-radius: 42px; padding: 11px; background: #17131c; box-shadow: 0 30px 60px rgba(43,36,51,.3); }
.telefono-pantalla { border-radius: 32px; overflow: hidden; background: #000; height: min(740px, calc(100vh - 150px)); position: relative; }
.telefono iframe { width: 100%; height: 100%; border: 0; display: block; background: #0d0b0b; }
.vista-barra { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; font-size: 13px; color: var(--suave); }
.guardado { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--suave); } .guardado.ok { color: var(--ok); } .guardado.err { color: var(--err); }
.guardado .spinner { width: 12px; height: 12px; border-width: 2px; }
.acordeon { margin-bottom: 12px; overflow: hidden; }
.acordeon > summary { list-style: none; cursor: pointer; padding: 16px 20px; display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 15.5px; user-select: none; }
.acordeon > summary::-webkit-details-marker { display: none; }
.acordeon > summary .ico:first-child { color: var(--acento); } .acordeon > summary .cheb { margin-left: auto; transition: transform .2s; color: var(--suave); } .acordeon[open] > summary .cheb { transform: rotate(180deg); }
.acordeon-cuerpo { padding: 4px 20px 20px; border-top: 1px solid var(--linea); padding-top: 18px; }
.sub-titulo { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--suave); margin: 18px 0 10px; } .sub-titulo:first-child { margin-top: 0; }
.items { display: grid; gap: 10px; margin-bottom: 12px; }
.item { display: grid; gap: 8px; grid-template-columns: 1fr auto; align-items: start; padding: 12px; border: 1px solid var(--linea); border-radius: 12px; background: var(--sup-2); }
.item-campos { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); } .item-campos > * { margin: 0 !important; } .item-acc { display: flex; flex-direction: column; gap: 2px; }
.drop { border: 2px dashed var(--linea-2); border-radius: 14px; padding: 22px; text-align: center; background: var(--sup-2); cursor: pointer; transition: .15s; color: var(--suave); } .drop:hover, .drop.sobre { border-color: var(--acento); background: var(--acento-claro); color: var(--acento-osc); }
.drop b { display: block; color: var(--tinta); margin-bottom: 2px; }
.portada-prev { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; } .portada-prev img { width: 110px; height: 140px; object-fit: cover; border-radius: 10px; border: 1px solid var(--linea); }
.galeria-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin: 12px 0; }
.foto-item { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 3/4; background: #eee; border: 2px solid transparent; cursor: grab; } .foto-item.arrastrando { opacity: .4; } .foto-item.destino { border-color: var(--acento); }
.foto-item img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.foto-item .quitar { position: absolute; top: 5px; right: 5px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; display: grid; place-items: center; cursor: pointer; }
.foto-item .num { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; }
.opciones-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.opcion { border: 2px solid var(--linea); border-radius: 12px; padding: 12px; background: var(--sup); cursor: pointer; text-align: center; transition: .15s; } .opcion:hover { border-color: var(--linea-2); } .opcion.sel { border-color: var(--acento); background: var(--acento-claro); }
.opcion .muestra { font-size: 24px; line-height: 1.2; margin-bottom: 4px; } .opcion small { color: var(--suave); display: block; font-size: 12px; }
.muestras { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; } .muestra-color { width: 38px; height: 38px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--linea); cursor: pointer; padding: 0; } .muestra-color.sel { box-shadow: 0 0 0 2px var(--tinta); }
.fondo-op { width: 92px; } .fondo-op .col { height: 52px; border-radius: 8px; margin-bottom: 6px; border: 1px solid rgba(0,0,0,.15); }
.audio-caja { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; } .audio-caja audio { height: 38px; max-width: 100%; }
.vista-movil-btn { display: none; } @media (max-width: 1180px) { .vista-movil-btn { display: inline-flex; } }
.vista-overlay { position: fixed; inset: 0; z-index: 250; background: #17131c; display: flex; flex-direction: column; } .vista-overlay iframe { flex: 1; border: 0; width: 100%; background: #0d0b0b; } .vista-overlay .cab { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; color: #fff; }

/* ---- Tablas ---- */
.tabla-caja { overflow-x: auto; } table { width: 100%; border-collapse: collapse; font-size: 14px; } th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--suave); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--linea); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--linea-2); vertical-align: middle; } tr:last-child td { border-bottom: 0; } tbody tr:hover { background: var(--sup-2); }
.td-acc { white-space: nowrap; text-align: right; } td small { color: var(--suave); display: block; }
.filtros { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; } .filtros input[type=search] { max-width: 280px; } .filtros select { width: auto; }
.segmento { display: inline-flex; background: var(--sup-3); border-radius: 10px; padding: 3px; } .segmento button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--suave); cursor: pointer; } .segmento button.sel { background: var(--acento); color: #fff; }
.progreso { height: 8px; background: var(--sup-3); border-radius: 99px; overflow: hidden; display: flex; } .progreso span { display: block; height: 100%; } .p-ok { background: var(--ok); } .p-no { background: #c9564b; } .p-pend { background: var(--linea-2); }
.leyenda { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--suave); margin-top: 8px; } .leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.mensaje-item { padding: 14px 0; border-bottom: 1px solid var(--linea); display: flex; gap: 14px; align-items: flex-start; } .mensaje-item:last-child { border: 0; } .mensaje-item p { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; } .mensaje-item.oculto { opacity: .55; } .mensaje-item > div:first-child { flex: 1; min-width: 0; }
.clave-temporal { background: var(--sup-2); border: 1px dashed var(--linea-2); border-radius: 10px; padding: 12px 14px; font: 600 18px ui-monospace, Menlo, monospace; text-align: center; letter-spacing: .04em; user-select: all; margin: 10px 0; }
.lista-act { list-style: none; padding: 0; display: grid; gap: 10px; font-size: 14px; } .lista-act li { display: flex; gap: 10px; justify-content: space-between; } .lista-act small { color: var(--suave); white-space: nowrap; }
.aviso-caja { padding: 12px 14px; border-radius: 12px; font-size: 14px; background: var(--aviso-bg); color: var(--aviso); margin-bottom: 16px; } .aviso-caja.info { background: #eaf1fb; color: #1d4f91; }
