/* GormaticaWeb · panel del cliente (app.gormaticaweb.es) sobre Bootstrap 5.3 */
:root {
  --gw-acento: #0f6b63;
  --gw-acento-2: #ee6f5c;
  --gw-fondo: #f5f6f4;
  --gw-borde: #e4e6e2;
  --gw-texto: #1d2321;
  --gw-suave: #6b736f;
  --gw-lateral: 248px;
  --bs-primary: #0f6b63;
  --bs-primary-rgb: 15, 107, 99;
  --bs-link-color: #0f6b63;
  --bs-link-hover-color: #0a4c46;
  --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-border-radius: .6rem;
  --bs-border-radius-lg: .85rem;
}
.btn-primary { --bs-btn-bg: var(--gw-acento); --bs-btn-border-color: var(--gw-acento); --bs-btn-hover-bg: #0a544e; --bs-btn-hover-border-color: #0a544e; --bs-btn-active-bg: #08443f; --bs-btn-disabled-bg: var(--gw-acento); --bs-btn-disabled-border-color: var(--gw-acento); }
.btn-outline-primary { --bs-btn-color: var(--gw-acento); --bs-btn-border-color: var(--gw-acento); --bs-btn-hover-bg: var(--gw-acento); --bs-btn-hover-border-color: var(--gw-acento); --bs-btn-active-bg: var(--gw-acento); }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--gw-acento); box-shadow: 0 0 0 .2rem rgb(15 107 99 / .18); }
.form-check-input:checked { background-color: var(--gw-acento); border-color: var(--gw-acento); }
body.gw { background: var(--gw-fondo); color: var(--gw-texto); }
.marca-punto { display: inline-block; width: .6em; height: .6em; border-radius: 99px; background: var(--gw-acento-2); margin-right: .45em; box-shadow: 0 0 0 .2em rgb(238 111 92 / .2); }

/* ------------------------------------------------------------- acceso */
.gw-acceso { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(80% 60% at 100% 0%, #dcefeb, transparent 60%), radial-gradient(60% 50% at 0% 100%, #fde3dd, transparent 60%), #f7f8f6; }
.acceso-caja { width: 100%; max-width: 430px; background: #fff; border-radius: 22px; padding: 36px 32px; box-shadow: 0 30px 60px -30px rgb(0 0 0 / .25); }
.acceso-marca { display: inline-flex; align-items: center; font-weight: 800; font-size: 1.15rem; text-decoration: none; color: var(--gw-texto); margin-bottom: 26px; letter-spacing: -.02em; }
.acceso-caja h1 { font-size: 1.6rem; font-weight: 750; letter-spacing: -.03em; margin-bottom: 18px; }
.acceso-caja .form-label { display: block; width: 100%; font-weight: 600; font-size: .9rem; }
.acceso-caja .form-label .form-control { margin-top: 6px; font-weight: 400; }
.acceso-pie { margin: 16px 0 0; text-align: center; font-size: .93rem; }
.codigo { text-align: center; font-size: 2rem; letter-spacing: .5em; font-weight: 700; }

/* ------------------------------------------------------------- carcasa */
.gw-lateral { position: fixed; inset: 0 auto 0 0; width: var(--gw-lateral); background: #fff; border-right: 1px solid var(--gw-borde); display: flex; flex-direction: column; padding: 18px 14px; z-index: 1040; overflow-y: auto; }
.gw-marca { display: flex; align-items: center; font-weight: 800; letter-spacing: -.02em; color: var(--gw-texto); text-decoration: none; padding: 4px 10px 18px; font-size: 1.08rem; }
.gw-web-activa { display: flex; align-items: center; gap: 8px; padding: 10px; margin-bottom: 10px; background: var(--gw-fondo); border-radius: 12px; font-size: .9rem; }
.gw-web-activa strong, .gw-web-activa select { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gw-nav { display: flex; flex-direction: column; gap: 2px; }
.gw-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: #3b4340; text-decoration: none; font-weight: 500; font-size: .94rem; }
.gw-nav a i { font-size: 1.05rem; color: #7d8682; width: 1.25em; }
.gw-nav a:hover { background: var(--gw-fondo); }
.gw-nav a.activo { background: #e7f2f0; color: var(--gw-acento); }
.gw-nav a.activo i { color: var(--gw-acento); }
.gw-nav hr { margin: 8px 6px; color: var(--gw-borde); opacity: 1; }
.gw-cuenta { margin-left: auto; background: var(--gw-acento-2); color: #fff; border-radius: 99px; font-size: .72rem; padding: 1px 7px; font-weight: 700; }
.gw-nav-pie { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--gw-borde); }
.gw-principal { margin-left: var(--gw-lateral); min-height: 100vh; display: flex; flex-direction: column; }
.gw-barra { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: rgb(245 246 244 / .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--gw-borde); min-height: 64px; }
.gw-titulo { font-size: 1.15rem; font-weight: 700; margin: 0; letter-spacing: -.02em; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gw-barra-acciones { display: flex; align-items: center; gap: 8px; }
.gw-estado { font-size: .8rem; color: var(--gw-suave); white-space: nowrap; }
.gw-estado .punto { display: inline-block; width: 8px; height: 8px; border-radius: 99px; margin-right: 6px; background: #c4c9c6; }
.gw-estado.publicada .punto { background: #2a9d63; }
.gw-estado.cambios .punto { background: #f0a43a; }
.gw-burger { display: none; }
.gw-vista { padding: 24px; flex: 1; }
.gw-velo { display: none; }
@media (max-width: 991px) {
  .gw-lateral { transform: translateX(-100%); transition: transform .25s; box-shadow: 0 0 40px rgb(0 0 0 / .2); }
  .lateral-abierto .gw-lateral { transform: none; }
  .lateral-abierto .gw-velo { display: block; position: fixed; inset: 0; background: rgb(0 0 0 / .3); z-index: 1030; }
  .gw-principal { margin-left: 0; }
  .gw-burger { display: inline-flex; }
  .gw-vista { padding: 16px; }
  .gw-barra { padding: 10px 16px; }
  .gw-estado { display: none; }
}

/* ------------------------------------------------------------- piezas */
.tarjeta-gw { background: #fff; border: 1px solid var(--gw-borde); border-radius: 16px; padding: 22px; }
.tarjeta-gw + .tarjeta-gw { margin-top: 16px; }
.tarjeta-gw h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: 14px; letter-spacing: -.01em; }
.tarjeta-gw .ayuda, .ayuda { color: var(--gw-suave); font-size: .86rem; }
.vacio-gw { text-align: center; padding: 48px 20px; color: var(--gw-suave); }
.vacio-gw i { font-size: 2.2rem; margin-bottom: 12px; color: #b6bdb9; }
.cargando-gw { display: grid; place-items: center; min-height: 40vh; color: var(--gw-suave); }
.rejilla-gw { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ancho-gw { max-width: 860px; }
.etq { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 6px; background: var(--gw-fondo); color: var(--gw-suave); }
.etq.verde { background: #e3f4ea; color: #1f7a4d; } .etq.naranja { background: #fdf0dc; color: #9a5a00; } .etq.rojo { background: #fde4e1; color: #a5281c; }

/* Inicio */
.inicio-cab { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.pasos-gw { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.pasos-gw li { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--gw-fondo); }
.pasos-gw li.hecho { opacity: .6; } .pasos-gw li.hecho i { color: #2a9d63; }
.pasos-gw li a { margin-left: auto; }
.mini-preview { position: relative; height: 320px; border-radius: 14px; overflow: hidden; border: 1px solid var(--gw-borde); background: #fff; }
.mini-preview iframe { width: 1280px; height: 1000px; transform: scale(.36); transform-origin: 0 0; border: 0; pointer-events: none; }
@media (max-width: 991px) { .inicio-cab { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------- editor */
.editor-gw { display: grid; grid-template-columns: minmax(320px, 400px) 1fr; gap: 20px; align-items: start; }
.editor-lista { position: sticky; top: 88px; max-height: calc(100vh - 112px); overflow: auto; padding-right: 4px; }
.pagina-gw { background: #fff; border: 1px solid var(--gw-borde); border-radius: 14px; margin-bottom: 12px; overflow: hidden; }
.pagina-gw > header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; font-weight: 650; }
.pagina-gw > header .slug { color: var(--gw-suave); font-weight: 400; font-size: .8rem; }
.pagina-gw > header .acciones { margin-left: auto; display: flex; gap: 2px; }
.pagina-gw.cerrada .secciones-gw, .pagina-gw.cerrada .anadir-gw { display: none; }
.secciones-gw { list-style: none; margin: 0; padding: 0 8px 4px; }
.seccion-gw { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 10px; cursor: pointer; font-size: .93rem; }
.seccion-gw:hover { background: var(--gw-fondo); }
.seccion-gw.oculta { opacity: .5; }
.seccion-gw .asa { cursor: grab; color: #b0b7b3; padding: 0 2px; }
.seccion-gw .ico-tipo { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: #e7f2f0; color: var(--gw-acento); flex: none; }
.seccion-gw .txt { min-width: 0; flex: 1; }
.seccion-gw .txt b { display: block; font-weight: 600; font-size: .88rem; }
.seccion-gw .txt small { display: block; color: var(--gw-suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seccion-gw .btn-icono { opacity: 0; } .seccion-gw:hover .btn-icono, .seccion-gw .btn-icono:focus { opacity: 1; }
.btn-icono { border: 0; background: none; width: 30px; height: 30px; border-radius: 8px; color: var(--gw-suave); display: inline-grid; place-items: center; }
.btn-icono:hover { background: #e9ecea; color: var(--gw-texto); }
.anadir-gw { margin: 2px 14px 12px; }
.preview-gw { background: #fff; border: 1px solid var(--gw-borde); border-radius: 16px; overflow: hidden; position: sticky; top: 88px; }
.preview-gw .barra-preview { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--gw-borde); font-size: .82rem; color: var(--gw-suave); }
.preview-gw .barra-preview .url { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-marco { height: calc(100vh - 160px); background: #eceeec; display: flex; justify-content: center; }
.preview-marco iframe { width: 100%; height: 100%; border: 0; background: #fff; transition: width .3s; }
.preview-marco.movil iframe { width: 390px; border-left: 1px solid var(--gw-borde); border-right: 1px solid var(--gw-borde); }
@media (max-width: 1100px) { .editor-gw { grid-template-columns: 1fr; } .editor-lista { position: static; max-height: none; } .preview-gw { display: none; } }

/* ------------------------------------------------------------- hoja lateral */
.gw-hoja { --bs-offcanvas-width: min(560px, 100vw); }
.gw-hoja .offcanvas-body { padding-bottom: 90px; }
.gw-hoja-pie { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; justify-content: flex-end; padding: 14px 18px; background: #fff; border-top: 1px solid var(--gw-borde); }
.gw-hoja-pie:empty { display: none; }
.campo-gw { margin-bottom: 18px; }
.campo-gw > label, .campo-gw > .etiqueta { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.campo-gw .contador { float: right; font-weight: 400; color: var(--gw-suave); font-size: .78rem; }
.campo-gw .ayuda { margin-top: 4px; }
.campo-gw.invalido .form-control { border-color: #dc3545; }
.campo-gw .error-campo { color: #b02a37; font-size: .82rem; margin-top: 4px; }
.lista-gw { display: grid; gap: 10px; }
.item-gw { border: 1px solid var(--gw-borde); border-radius: 12px; background: #fafbfa; }
.item-gw > header { display: flex; align-items: center; gap: 6px; padding: 8px 10px; cursor: pointer; font-weight: 600; font-size: .9rem; }
.item-gw > header .resumen { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-gw > .cuerpo { padding: 4px 12px 2px; border-top: 1px solid var(--gw-borde); }
.item-gw.cerrado > .cuerpo { display: none; }
.fotos-gw { display: flex; flex-wrap: wrap; gap: 8px; }
.foto-gw { position: relative; width: 96px; height: 72px; border-radius: 10px; overflow: hidden; background: #e9ecea; border: 1px solid var(--gw-borde); }
.foto-gw img { width: 100%; height: 100%; object-fit: cover; }
.foto-gw .quitar { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 99px; border: 0; background: rgb(0 0 0 / .6); color: #fff; font-size: .7rem; display: grid; place-items: center; }
.foto-gw.anadir { display: grid; place-items: center; color: var(--gw-suave); cursor: pointer; border-style: dashed; background: #fff; }
.galeria-elegir { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.galeria-elegir button { border: 2px solid transparent; padding: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 4/3; background: #e9ecea; position: relative; }
.galeria-elegir button img { width: 100%; height: 100%; object-fit: cover; }
.galeria-elegir button.sel { border-color: var(--gw-acento); }
.galeria-elegir button .muestra { position: absolute; left: 4px; bottom: 4px; font-size: .64rem; background: rgb(255 255 255 / .9); padding: 1px 5px; border-radius: 4px; }
.tipos-gw { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.tipos-gw button { text-align: left; border: 1px solid var(--gw-borde); background: #fff; border-radius: 12px; padding: 12px; display: flex; gap: 10px; }
.tipos-gw button:hover { border-color: var(--gw-acento); }
.tipos-gw button i { color: var(--gw-acento); font-size: 1.2rem; margin-top: 2px; }
.tipos-gw button b { display: block; font-size: .92rem; }
.tipos-gw button small { color: var(--gw-suave); font-size: .8rem; line-height: 1.3; display: block; }
.horario-fila { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 10px; border: 1px solid var(--gw-borde); border-radius: 12px; margin-bottom: 8px; background: #fafbfa; }
.dias-gw { display: flex; flex-wrap: wrap; gap: 4px; }
.dias-gw label { padding: 4px 9px; border-radius: 8px; border: 1px solid var(--gw-borde); font-size: .8rem; cursor: pointer; background: #fff; }
.dias-gw input { display: none; }
.dias-gw input:checked + span { color: var(--gw-acento); font-weight: 700; }
.horas-gw { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .85rem; }
.horas-gw input { width: 110px; }

/* Diseños */
.disenos-gw { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.diseno-gw { border: 2px solid var(--gw-borde); border-radius: 14px; padding: 14px; background: #fff; text-align: left; }
.diseno-gw.sel { border-color: var(--gw-acento); box-shadow: 0 0 0 3px rgb(15 107 99 / .15); }
.diseno-gw .muestras { display: flex; gap: 6px; margin-bottom: 10px; }
.diseno-gw .muestras span { width: 26px; height: 26px; border-radius: 99px; border: 1px solid rgb(0 0 0 / .08); }
.diseno-gw b { display: block; }
.diseno-gw small { color: var(--gw-suave); display: block; line-height: 1.35; margin-top: 4px; }

/* Plantillas (nueva web) */
.plantillas-gw { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.plantilla-gw { background: #fff; border: 2px solid var(--gw-borde); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.plantilla-gw.sel { border-color: var(--gw-acento); }
.plantilla-gw .foto { aspect-ratio: 16/10; background: #e9ecea center/cover; }
.plantilla-gw .cuerpo { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.plantilla-gw .cuerpo p { color: var(--gw-suave); font-size: .86rem; margin: 0; }
.plantilla-gw .botones { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; }
.asistente-pasos { display: flex; gap: 8px; margin-bottom: 18px; }
.asistente-pasos span { flex: 1; height: 5px; border-radius: 99px; background: var(--gw-borde); }
.asistente-pasos span.on { background: var(--gw-acento); }
.nombre-url { display: flex; align-items: center; border: 1px solid #ced4da; border-radius: .6rem; overflow: hidden; background: #fff; }
.nombre-url input { border: 0; box-shadow: none !important; font-weight: 600; }
.nombre-url span { padding: 0 12px; color: var(--gw-suave); white-space: nowrap; }

/* Bandeja */
.mensaje-gw { background: #fff; border: 1px solid var(--gw-borde); border-radius: 14px; padding: 16px; margin-bottom: 10px; }
.mensaje-gw.nuevo { border-left: 4px solid var(--gw-acento-2); }
.mensaje-gw .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .84rem; color: var(--gw-suave); margin-bottom: 8px; }
.mensaje-gw dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: .9rem; margin: 6px 0; }
.mensaje-gw dt { color: var(--gw-suave); font-weight: 500; }
.mensaje-gw dd { margin: 0; }
.estrellas-gw { color: #f2b01e; letter-spacing: 1px; }

/* Chat IA */
.chat-gw { display: flex; flex-direction: column; height: calc(100vh - 140px); max-width: 900px; background: #fff; border: 1px solid var(--gw-borde); border-radius: 16px; overflow: hidden; }
.chat-mensajes { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.burbuja { max-width: 82%; padding: 12px 16px; border-radius: 16px; line-height: 1.5; white-space: pre-wrap; font-size: .95rem; }
.burbuja.yo { align-self: flex-end; background: var(--gw-acento); color: #fff; border-bottom-right-radius: 4px; }
.burbuja.ia { align-self: flex-start; background: var(--gw-fondo); border-bottom-left-radius: 4px; }
.burbuja .cambios-gw { margin-top: 8px; font-size: .84rem; opacity: .85; }
.chat-entrada { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--gw-borde); }
.chat-entrada textarea { resize: none; }

/* Estadísticas */
.grafica-gw { display: flex; align-items: flex-end; gap: 2px; height: 160px; padding-top: 10px; }
.grafica-gw div { flex: 1; background: #cfe5e1; border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.grafica-gw div:hover { background: var(--gw-acento); }
.cifras-gw { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.cifras-gw div { background: #fff; border: 1px solid var(--gw-borde); border-radius: 14px; padding: 16px; }
.cifras-gw b { display: block; font-size: 1.8rem; letter-spacing: -.03em; }
.cifras-gw span { color: var(--gw-suave); font-size: .85rem; }
.barra-top { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; padding: 6px 0; border-bottom: 1px solid var(--gw-borde); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--gw-acento); --bs-nav-link-color: #3b4340; --bs-nav-link-hover-color: var(--gw-acento); }
.nav-pills .nav-link { font-weight: 500; }
