/* ============================================
   MI ADAYA — Hoja de identidad global v1
   Calida, redondeada, tactil. Variables
   personalizables por tenant via --primario.
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

:root {
  --primario: #6366f1;          /* indigo por defecto; el tenant lo puede pisar */
  --primario-suave: color-mix(in srgb, var(--primario) 12%, white);
  --primario-borde: color-mix(in srgb, var(--primario) 35%, white);
  --primario-oscuro: color-mix(in srgb, var(--primario) 75%, black);
  --fondo: #fdfbf7;             /* crema calido, no gris frio */
  --tarjeta: #ffffff;
  --tinta: #2d2a26;
  --tinta-suave: #8a8580;
  --borde: #eeeae3;
  --exito: #16a34a;  --exito-suave: #ecfdf3;
  --alerta: #d97706; --alerta-suave: #fffbeb;
  --peligro: #dc2626; --peligro-suave: #fef2f2;
  --radio: 1.25rem;
  --sombra: 0 4px 16px rgba(45,42,38,.06), 0 1px 3px rgba(45,42,38,.04);
  --sombra-alta: 0 12px 32px rgba(45,42,38,.12);
}

* { font-family: 'Nunito', system-ui, sans-serif; }
body { background: var(--fondo); color: var(--tinta); }

/* --- Tarjetas --- */
.tarjeta {
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  transition: transform .15s ease, box-shadow .15s ease;
}
.tarjeta-tactil { cursor: pointer; }
.tarjeta-tactil:hover { transform: translateY(-2px); box-shadow: var(--sombra-alta); }
.tarjeta-tactil:active { transform: scale(.98); }

/* --- Botones --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border-radius: 1rem; padding: .65rem 1.4rem;
  font-weight: 700; font-size: .9rem;
  transition: transform .12s ease, filter .12s ease, background .12s ease;
  cursor: pointer; border: none;
}
.btn:active { transform: scale(.96); }
.btn-primario { background: var(--primario); color: #fff; }
.btn-primario:hover { filter: brightness(1.08); }
.btn-suave { background: var(--primario-suave); color: var(--primario-oscuro); }
.btn-fantasma { background: transparent; color: var(--tinta-suave); border: 1.5px solid var(--borde); }
.btn-peligro { background: var(--peligro-suave); color: var(--peligro); border: 1px solid #fecaca; }
.btn-bloque { width: 100%; padding: .8rem 1.4rem; }

/* --- Campos --- */
.campo {
  width: 100%; border: 1.5px solid var(--borde); border-radius: .9rem;
  padding: .65rem .9rem; font-size: .95rem; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.campo:focus { outline: none; border-color: var(--primario); box-shadow: 0 0 0 3px var(--primario-suave); }
.etiqueta { display: block; font-size: .82rem; font-weight: 700; color: var(--tinta); margin-bottom: .35rem; }
.ayuda { font-size: .74rem; color: var(--tinta-suave); margin-top: .3rem; }

/* --- Chips / estados --- */
.chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 700;
        padding: .25rem .7rem; border-radius: 999px; }
.chip-exito { background: var(--exito-suave); color: var(--exito); }
.chip-alerta { background: var(--alerta-suave); color: var(--alerta); }
.chip-peligro { background: var(--peligro-suave); color: var(--peligro); }
.chip-neutro { background: var(--primario-suave); color: var(--primario-oscuro); }

/* --- Avisos --- */
.aviso { border-radius: 1rem; padding: .8rem 1.1rem; font-size: .87rem; font-weight: 600; margin-bottom: 1rem; }
.aviso-error { background: var(--peligro-suave); color: var(--peligro); border: 1px solid #fecaca; }
.aviso-exito { background: var(--exito-suave); color: var(--exito); border: 1px solid #bbf7d0; }

/* --- Navegacion app --- */
.barra { background: var(--tarjeta); border-bottom: 1px solid var(--borde);
         padding: .7rem 1.4rem; display: flex; align-items: center; justify-content: space-between; }
.marca-nombre { font-weight: 800; font-size: 1.05rem; color: var(--primario); text-decoration: none; }

/* --- Detalles amables --- */
::selection { background: var(--primario-suave); }
.animar-entrada { animation: entrada .35s ease both; }
@keyframes entrada { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .animar-entrada, .tarjeta-tactil, .btn { animation: none; transition: none; } }

/* --- ESCRITORIO AMPLIO: las pantallas de gestion aprovechan el monitor --- */
@media (min-width: 1280px) {
  main.max-w-xl, main.max-w-2xl { max-width: 56rem !important; }
  main.max-w-3xl { max-width: 72rem !important; }
  /* La cuadricula de niños pasa a 3 columnas en pantallas anchas */
  main.max-w-3xl .grid.sm\:grid-cols-2 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* Las pantallas del niño (max-w-md) quedan intactas: angostas a proposito */

/* ============ V3 — DARLE VIDA ============ */
:root {
  --grad: linear-gradient(135deg, var(--primario), color-mix(in srgb, var(--primario) 60%, #f59e0b));
}
/* Barra con firma de color del tenant */
.barra { border-bottom: none; box-shadow: 0 1px 0 var(--borde); position: relative; }
.barra::after { content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px;
  background: var(--grad); opacity: .85; }

/* Hero de pagina */
.hero { background: var(--grad); border-radius: var(--radio); padding: 1.4rem 1.6rem; color: #fff;
  box-shadow: var(--sombra-alta); margin-bottom: 1.25rem; }
.hero h1 { color: #fff; margin: 0; font-size: 1.5rem; font-weight: 800; }
.hero .sub { opacity: .9; font-size: .85rem; font-weight: 600; }

/* Avatares con inicial (color derivado del nombre via clase av-0..av-5) */
.avatar { width: 3rem; height: 3rem; border-radius: 1rem; display: inline-flex; align-items: center;
  justify-content: center; font-weight: 800; font-size: 1.2rem; color: #fff; flex-shrink: 0;
  box-shadow: var(--sombra); }
.avatar-lg { width: 3.6rem; height: 3.6rem; font-size: 1.45rem; border-radius: 1.2rem; }
.av-0 { background: linear-gradient(135deg, #f97316, #fb923c); }
.av-1 { background: linear-gradient(135deg, #0d9488, #2dd4bf); }
.av-2 { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.av-3 { background: linear-gradient(135deg, #ec4899, #f472b6); }
.av-4 { background: linear-gradient(135deg, #0ea5e9, #38bdf8); }
.av-5 { background: linear-gradient(135deg, #84cc16, #a3e635); }

/* Tarjetas de estadistica */
.stat { text-align: center; padding: 1rem .6rem; }
.stat .n { font-size: 1.7rem; font-weight: 800; color: var(--primario); line-height: 1.1; }
.stat .l { font-size: .72rem; font-weight: 700; color: var(--tinta-suave); }

/* Anillo de progreso (conic) */
.anillo { width: 3.2rem; height: 3.2rem; border-radius: 50%; display: inline-grid; place-items: center;
  background: conic-gradient(var(--exito) calc(var(--p) * 1%), var(--borde) 0); flex-shrink: 0; }
.anillo > span { width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--tarjeta);
  display: grid; place-items: center; font-size: .68rem; font-weight: 800; }

/* Barras de alerta con acento */
.alerta-caja { border-left: 4px solid var(--alerta); }
.peligro-caja { border-left: 4px solid var(--peligro); }

/* Estados vacios con corazon */
.vacio { text-align: center; padding: 2.5rem 1.5rem; }
.vacio .ico { font-size: 3rem; display: block; margin-bottom: .6rem; }

/* =========================================================
   v29 · VISTA PREVIA DE HOJA (componente global)
   Una hoja A4 a escala que muestra lo que se va a imprimir.
   La usa el Taller; sirve para cualquier imprimible.
   Toma los colores de la cara calida o del shell pro.
   ========================================================= */
.hoja-previa { --hp-borde: var(--borde, var(--p-borde, #e5e7eb)); --hp-suave: var(--tinta-suave, var(--p-tinta2, #6b7280)); }
.hoja-previa-pegada { position: sticky; top: 16px; }
.hoja-previa-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hoja-previa-estado { font-size: 12.5px; color: var(--hp-suave); }
.hoja-previa-escritorio { margin-top: 12px; padding: 14px; border-radius: 10px; background: color-mix(in srgb, var(--hp-borde) 55%, #f4f4f1); overflow: hidden; }
.hoja-previa-marco { position: relative; overflow: hidden; margin: 0 auto; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 10px 24px -14px rgba(0,0,0,.35); background: #fff; }
.hoja-previa-marco iframe { position: absolute; top: 0; left: 0; border: 0; display: block; background: transparent; transform-origin: 0 0; pointer-events: none; }
.hoja-previa-vacia { aspect-ratio: 210 / 297; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; color: var(--hp-suave); font-size: 14px; background: #fff; }
.hoja-previa-vacia.horizontal { aspect-ratio: 297 / 210; }
.hoja-previa-datos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.hoja-previa-dato { border: 1px solid var(--hp-borde); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.hoja-previa-dato b { display: block; font-size: 18px; line-height: 1.2; }
.hoja-previa-dato span { display: block; font-size: 12px; color: var(--hp-suave); }
.hoja-previa-avisos { margin: 10px 0 0; padding: 0; list-style: none; }
.hoja-previa-avisos li { font-size: 13px; color: var(--hp-suave); padding: 6px 0 6px 18px; position: relative; border-top: 1px solid var(--hp-borde); }
.hoja-previa-avisos li::before { content: ''; position: absolute; left: 4px; top: 13px; width: 6px; height: 6px; border-radius: 50%; background: var(--hp-suave); }
.hoja-previa-avisos li.ojo::before { background: #d97706; }
.hoja-previa-boton { border: 1px solid var(--hp-borde); background: #fff; border-radius: 8px; padding: 6px 12px; font-size: 13px; font-weight: 700; cursor: pointer; color: inherit; }
.hoja-previa.ampliada { position: fixed; inset: 12px; z-index: 60; overflow: auto; margin: 0; background: #fff; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
@media (max-width: 860px) { .hoja-previa-pegada { position: static; } .hoja-previa-datos { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* =========================================================
   v30 · EL TALLER (componente global): compositor de laminas.
   Pantalla completa en PC (3 columnas), 2 en tablet, 1 en celular.
   Toma el color de la cara calida (--primario) o del shell pro (--acento).
   ========================================================= */
.taller { --tl-acento: var(--primario, var(--acento, #1f7a4d)); --tl-borde: var(--borde, var(--p-borde, #e3e8e6));
  --tl-tinta: var(--tinta, var(--p-tinta, #16292e)); --tl-suave: var(--tinta-suave, var(--p-tinta2, #57696d));
  --tl-fondo: var(--fondo, var(--p-fondo, #fbfbf8)); --tl-suave-bg: color-mix(in srgb, var(--tl-acento) 8%, #fff);
  display: grid; gap: 16px; align-items: start; width: 100%; max-width: none; box-sizing: border-box; padding: 18px 22px 40px;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr) minmax(320px, 370px); grid-template-areas: "lib hoja blq"; color: var(--tl-tinta); }
.taller * { box-sizing: border-box; }
.taller-lib { grid-area: lib; } .taller-hoja { grid-area: hoja; } .taller-blq { grid-area: blq; }
.taller-panel { background: #fff; border: 1px solid var(--tl-borde); border-radius: 12px; padding: 16px; min-width: 0; }
.taller-lib, .taller-blq { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.taller-hoja { position: sticky; top: 12px; }
.taller [hidden] { display: none !important; }
.taller-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.taller-h { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.2; }
.taller-nota, .taller-ayuda { font-size: 13px; color: var(--tl-suave); margin: 0; }
.taller-ayuda { margin-top: 8px; }
.taller-et { display: block; font-size: 12.5px; font-weight: 700; color: var(--tl-suave); margin: 0 0 6px; text-transform: none; }
.taller-campo { display: block; margin-top: 14px; }
.taller-campo .campo, .taller-buscar { width: 100%; }
.taller-buscar { padding: 11px 13px; font-size: 15px; }
/* control segmentado */
.taller-seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; border: 1px solid var(--tl-borde); border-radius: 10px; background: var(--tl-fondo); }
.taller-seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 700; color: var(--tl-suave); cursor: pointer; }
.taller-seg button.on { background: #fff; color: var(--tl-acento); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.taller-seg button:disabled { opacity: .45; cursor: not-allowed; }
/* sugerencias y resultados */
.taller-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.taller-chips button { border: 1px solid var(--tl-borde); background: #fff; border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 12.5px; color: var(--tl-tinta); cursor: pointer; }
.taller-chips button:hover { border-color: var(--tl-acento); color: var(--tl-acento); }
.taller-res { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; margin-top: 12px; }
.taller-res button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px; border: 1px solid var(--tl-borde); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; min-width: 0; transition: transform .12s, border-color .12s; }
.taller-res button:hover { border-color: var(--tl-acento); }
.taller-res button.tocado { transform: scale(.92); border-color: var(--tl-acento); background: var(--tl-suave-bg); }
.taller-res img { width: 56px; height: 56px; object-fit: contain; }
.taller-res span { font-size: 11.5px; color: var(--tl-suave); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* hojas, orientacion y disposicion */
.taller-hojas { display: flex; flex-wrap: wrap; gap: 6px; }
.taller-hojas button { border: 1px solid var(--tl-borde); background: #fff; border-radius: 8px; padding: 7px 12px; font: inherit; font-size: 13px; font-weight: 700; color: var(--tl-suave); cursor: pointer; }
.taller-hojas button.on { border-color: var(--tl-acento); color: var(--tl-acento); background: var(--tl-suave-bg); }
.taller-disp { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.taller-disp button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 7px 8px; border: 1px solid var(--tl-borde); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; font-size: 11.5px; color: var(--tl-suave); }
.taller-disp button.on { border-color: var(--tl-acento); color: var(--tl-acento); background: var(--tl-suave-bg); }
.taller-disp svg { display: block; }
.taller-disp svg rect { fill: color-mix(in srgb, var(--tl-suave) 18%, #fff); stroke: var(--tl-suave); stroke-width: 1; }
.taller-disp button.on svg rect { fill: color-mix(in srgb, var(--tl-acento) 22%, #fff); stroke: var(--tl-acento); }
.taller-fila2 { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.taller-fila2 .campo { flex: 1 1 auto; min-width: 0; }
/* tipos de bloque */
.taller-tipos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.taller-tipos button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border: 1.5px solid var(--tl-borde); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--tl-tinta); }
.taller-tipos button svg { width: 24px; height: 24px; color: var(--tl-acento); }
.taller-tipos button.on { border-color: var(--tl-acento); background: var(--tl-suave-bg); }
.taller-checks { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; font-size: 14px; font-weight: 700; }
.taller-checks label { display: flex; align-items: center; gap: 7px; cursor: pointer; }
/* mapa de secciones */
.taller-mapa { position: relative; width: 46px; height: 62px; border: 1px solid var(--tl-borde); border-radius: 4px; background: #fff; flex: none; }
.taller-mapa.horizontal { width: 62px; height: 46px; }
.taller-mapa button { position: absolute; border: 1px solid var(--tl-suave); background: color-mix(in srgb, var(--tl-suave) 14%, #fff); border-radius: 2px; padding: 0; cursor: pointer; font-size: 9px; font-weight: 700; color: var(--tl-suave); }
.taller-mapa button.on { background: var(--tl-acento); border-color: var(--tl-acento); color: #fff; }
/* capacidad */
.taller-cap { margin-top: 14px; font-size: 13px; color: var(--tl-suave); }
.taller-barra { height: 7px; border-radius: 99px; background: var(--tl-fondo); border: 1px solid var(--tl-borde); overflow: hidden; margin-top: 5px; }
.taller-barra i { display: block; height: 100%; background: var(--tl-acento); border-radius: 99px; transition: width .2s; }
.taller-barra.lleno i { background: #d97706; } .taller-barra.excede i { background: #c0392b; }
/* lista de pictogramas de la seccion */
.taller-lista { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.taller-item { display: flex; align-items: center; gap: 6px; padding: 6px; border: 1px solid var(--tl-borde); border-radius: 10px; background: #fff; }
.taller-item .n { width: 20px; text-align: center; font-size: 12px; font-weight: 700; color: var(--tl-suave); flex: none; }
.taller-item img { width: 38px; height: 38px; object-fit: contain; flex: none; }
.taller-item input[type=text] { flex: 1 1 auto; min-width: 0; padding: 7px 9px; font-size: 14px; }
.taller-item select { width: 46px; flex: none; padding: 6px 4px; font-size: 12px; }
.taller-item button { width: 28px; height: 28px; border: 0; background: none; border-radius: 6px; color: var(--tl-suave); cursor: pointer; font-size: 14px; flex: none; }
.taller-item button:hover { background: var(--tl-fondo); color: var(--tl-tinta); }
/* datos vivos */
.taller-datos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.taller-dato { border: 1px solid var(--tl-borde); border-radius: 10px; padding: 9px 11px; min-width: 0; }
.taller-dato b { display: block; font-size: 19px; line-height: 1.2; }
.taller-dato span { display: block; font-size: 12px; color: var(--tl-suave); }
.taller-pie { position: sticky; bottom: -16px; margin: 16px -16px -16px; padding: 12px 16px; background: #fff; border-top: 1px solid var(--tl-borde); border-radius: 0 0 12px 12px; }
.taller-generar { width: 100%; }
.taller-pie .taller-nota { display: block; text-align: center; margin-top: 6px; }
.taller-aviso-flotante { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 70; background: var(--tl-tinta); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; max-width: calc(100vw - 32px); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
/* la hoja: zonas tocables sobre la vista previa */
.taller-capa { position: absolute; inset: 0; }
.taller-capa button { position: absolute; border: 2px dashed transparent; background: transparent; border-radius: 8px; cursor: pointer; padding: 0; }
.taller-capa button:hover { border-color: color-mix(in srgb, var(--tl-acento) 55%, transparent); }
.taller-capa button.on { border: 3px solid var(--tl-acento); background: color-mix(in srgb, var(--tl-acento) 5%, transparent); }
.taller-capa button.mal { border: 3px solid #c0392b; }
.taller-capa button em { position: absolute; left: 6px; top: -11px; background: var(--tl-acento); color: #fff; font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.taller-capa button.mal em { background: #c0392b; }
@media (max-width: 1279px) {
  .taller { grid-template-columns: minmax(290px, 380px) minmax(0, 1fr); grid-template-areas: "lib hoja" "blq hoja"; }
  .taller-lib, .taller-blq { position: static; max-height: none; overflow: visible; }
  .taller-hoja { position: sticky; top: 12px; }
}
@media (max-width: 860px) {
  .taller { grid-template-columns: minmax(0, 1fr); grid-template-areas: "hoja" "lib" "blq"; padding: 12px 12px 90px; }
  .taller-hoja { position: static; }
  .taller-datos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .taller-pie { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; border-radius: 0; z-index: 40; box-shadow: 0 -6px 20px rgba(0,0,0,.08); }
}


/* === v32 · Taller: arrastrar, soltar, vaciar y deshacer === */
.taller-fantasma { position: fixed; z-index: 90; pointer-events: none; transform: translate(-50%, -108%) rotate(-3deg); display: flex; flex-direction: column; align-items: center; gap: 2px; width: 92px; padding: 8px 6px 6px; background: #fff; border: 2px solid var(--primario, #2F6F63); border-radius: 12px; box-shadow: 0 16px 34px rgba(22,41,46,.28); font-family: inherit; transition: transform .12s, border-color .12s; }
.taller-fantasma img { width: 62px; height: 62px; object-fit: contain; }
.taller-fantasma span { font-size: 11.5px; font-weight: 700; color: #16292E; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.taller-fantasma.quitar { border-color: #c0392b; transform: translate(-50%, -108%) rotate(4deg) scale(.9); opacity: .85; }
body.tl-arrastrando, body.tl-arrastrando * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.taller-res button { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.taller-res img, .taller-item img { -webkit-user-drag: none; }
.taller-item .n, .taller-item img { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.taller-item .n { border-radius: 6px; padding: 6px 0; background: repeating-linear-gradient(0deg, transparent 0 3px, color-mix(in srgb, var(--tl-suave) 18%, transparent) 3px 4px); }
.taller-item .n:hover { color: var(--tl-acento); }
.taller-item.tl-origen { opacity: .35; }
.taller-item.drop-antes { box-shadow: 0 -3px 0 0 var(--tl-acento); }
.taller-item.drop-despues { box-shadow: 0 3px 0 0 var(--tl-acento); }
body.tl-arrastrando .taller-capa button { border: 2px dashed color-mix(in srgb, var(--tl-acento) 55%, transparent); background: color-mix(in srgb, var(--tl-acento) 4%, transparent); }
body.tl-arrastrando .taller-capa button::after { content: attr(data-n); position: absolute; right: 8px; bottom: 8px; padding: 4px 12px; border-radius: 99px; background: rgba(255,255,255,.94); border: 1px solid var(--tl-acento); color: var(--tl-acento); font-size: 12px; font-weight: 700; white-space: nowrap; }
.taller-capa button.drop-on { border: 3px solid var(--tl-acento) !important; background: color-mix(in srgb, var(--tl-acento) 14%, transparent) !important; }
.taller-capa button.drop-on::after { background: var(--tl-acento) !important; color: #fff !important; }
.taller-mapa button.drop-on, .taller-hojas button.drop-on { outline: 3px solid var(--tl-acento); outline-offset: 2px; }
.taller-blq.drop-on { box-shadow: inset 0 0 0 3px var(--tl-acento); }
.taller-lib.tl-papelera { position: relative; }
.taller-lib.tl-papelera::after { content: 'Suelta aquí para quitarlo'; position: absolute; inset: 8px; display: flex; align-items: center; justify-content: center; border: 2px dashed #c0392b; border-radius: 10px; background: rgba(255,255,255,.88); color: #c0392b; font-weight: 700; pointer-events: none; }
.taller-lib.tl-papelera.drop-on::after { background: #fdecea; }
.taller-listacab { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin: 10px 0 6px; }
.taller-listacab[hidden] { display: none; }
.taller-enlace { border: 0; background: none; padding: 4px 6px; font: inherit; font-size: 13px; font-weight: 700; color: var(--tl-suave, #57696D); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.taller-enlace:hover { color: #c0392b; }
.taller-pie .taller-enlace { display: block; margin: 2px auto 0; }
.taller-aviso-flotante button { margin-left: 12px; border: 0; background: #fff; color: #16292E; font: inherit; font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 6px; cursor: pointer; }
.taller-aviso-flotante { background: var(--tl-tinta, #16292E); }
@media (prefers-reduced-motion: reduce) { .taller-fantasma { transition: none; } }
.taller-pieza { position: absolute; z-index: 2; border-radius: 10px; cursor: grab; touch-action: manipulation; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; transition: box-shadow .12s, background .12s; }
.taller-pieza:hover { box-shadow: 0 0 0 2px var(--tl-acento); background: color-mix(in srgb, var(--tl-acento) 8%, transparent); }
.taller-pieza.tl-origen { background: rgba(255,255,255,.7); outline: 2px dashed var(--tl-acento); }
.taller-pieza.drop-antes[data-eje="x"] { box-shadow: -5px 0 0 0 var(--tl-acento); }
.taller-pieza.drop-despues[data-eje="x"] { box-shadow: 5px 0 0 0 var(--tl-acento); }
.taller-pieza.drop-antes[data-eje="y"] { box-shadow: 0 -5px 0 0 var(--tl-acento); }
.taller-pieza.drop-despues[data-eje="y"] { box-shadow: 0 5px 0 0 var(--tl-acento); }
body.tl-arrastrando .taller-pieza:not(.drop-antes):not(.drop-despues):not(.tl-origen) { box-shadow: none; background: transparent; }
.taller-item.tl-resaltada { border-color: var(--tl-acento); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tl-acento) 25%, transparent); }


/* === v34 · Taller: estudio de diseño (hoja libre) === */
.estudio { --es-acento: var(--primario, var(--acento, #2F6F63)); --es-tinta: #16292E; --es-suave: #57696D; --es-borde: #D5DDDA; --es-barra: #FFFFFF; --es-mesa: #D9DFDD;
  display: grid; grid-template-columns: 48px minmax(0, 1fr) 28px 300px; grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-areas: "doc doc doc doc" "props props props props" "herr mesa paleta panel" "pie pie pie panel";
  height: calc(100vh - 70px); min-height: 560px; background: var(--es-barra); border-top: 1px solid var(--es-borde); color: var(--es-tinta);
  font-family: 'Atkinson Hyperlegible', system-ui, sans-serif; font-size: 14px; position: relative; }
.estudio * { box-sizing: border-box; }
.estudio button { font: inherit; color: inherit; cursor: pointer; }
.estudio button:disabled { opacity: .35; cursor: default; }
/* barra del documento */
.estudio-doc { grid-area: doc; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--es-borde); min-width: 0; }
.estudio-volver { font-weight: 700; color: var(--es-suave); text-decoration: none; white-space: nowrap; }
.estudio-volver:hover { color: var(--es-acento); }
.estudio-doc #titulo { width: 260px; max-width: 32vw; padding: 7px 10px; font-size: 15px; font-weight: 700; }
.estudio-grupo { display: flex; gap: 4px; align-items: center; }
.estudio-der { margin-left: auto; }
.estudio-doc .estudio-grupo > button:not(.estudio-texto-btn) { width: 34px; height: 34px; border: 1px solid var(--es-borde); border-radius: 6px; background: #fff; display: inline-flex; align-items: center; justify-content: center; }
.estudio-doc svg { width: 18px; height: 18px; }
.estudio-texto-btn { height: 34px; padding: 0 14px; border: 1px solid var(--es-borde); border-radius: 6px; background: #fff; font-weight: 700 !important; }
.estudio-texto-btn:hover { border-color: var(--es-acento); }
.estudio-primario { background: var(--es-acento) !important; border-color: var(--es-acento) !important; color: #fff !important; }
.estudio-estado { font-size: 12.5px; color: var(--es-suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.estudio-solo-movil { display: none !important; }
/* barra de propiedades */
.estudio-props { grid-area: props; display: flex; align-items: center; gap: 6px; padding: 6px 12px; min-height: 46px; background: #F7F9F8; border-bottom: 1px solid var(--es-borde); overflow-x: auto; white-space: nowrap; scrollbar-width: thin; }
.pr-tit { font-weight: 700; margin-right: 6px; } .pr-tit small { font-weight: 400; color: var(--es-suave); }
.pr-nota { color: var(--es-suave); font-size: 12.5px; } .pr-der { margin-left: auto; }
.pr-sep { width: 1px; height: 24px; background: var(--es-borde); margin: 0 4px; flex: none; }
.pr-num { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--es-suave); font-weight: 700; }
.pr-num input[type=text] { width: 54px; height: 30px; padding: 0 6px; border: 1px solid var(--es-borde); border-radius: 5px; font: inherit; font-size: 13px; color: var(--es-tinta); background: #fff; text-align: right; }
.pr-num input[type=text]:focus { outline: 2px solid var(--es-acento); outline-offset: -1px; }
.pr-num input[type=range] { width: 84px; accent-color: var(--es-acento); }
.pr-chk { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; }
.pr-chk input { accent-color: var(--es-acento); }
.pr-seg { display: inline-flex; border: 1px solid var(--es-borde); border-radius: 6px; overflow: hidden; }
.pr-seg button { border: 0; background: #fff; padding: 6px 10px; font-size: 13px; font-weight: 700; }
.pr-seg button.on { background: var(--es-acento); color: #fff; }
.pr-btn { height: 30px; padding: 0 10px; border: 1px solid var(--es-borde); border-radius: 5px; background: #fff; font-size: 13px !important; font-weight: 700 !important; flex: none; }
.pr-btn:hover, .pr-ico:hover { border-color: var(--es-acento); }
.pr-peligro:hover { border-color: #c0392b !important; color: #c0392b !important; }
.pr-ico { width: 30px; height: 30px; border: 1px solid var(--es-borde); border-radius: 5px; background: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; padding: 0; }
.pr-ico svg { width: 17px; height: 17px; } .pr-ico.on { background: var(--es-acento); border-color: var(--es-acento); color: #fff; }
.pr-grupo { display: inline-flex; gap: 2px; }
.pr-sel { height: 30px; border: 1px solid var(--es-borde); border-radius: 5px; background: #fff; font: inherit; font-size: 13px; padding: 0 6px; }
/* caja de herramientas */
.estudio-herr { grid-area: herr; display: flex; flex-direction: column; gap: 2px; padding: 6px 4px; background: #F7F9F8; border-right: 1px solid var(--es-borde); overflow-y: auto; }
.estudio-herr button { position: relative; width: 40px; height: 40px; border: 1px solid transparent; border-radius: 7px; background: none; display: flex; align-items: center; justify-content: center; flex: none; }
.estudio-herr button:hover { background: #fff; border-color: var(--es-borde); }
.estudio-herr button.on { background: var(--es-acento); color: #fff; }
.estudio-herr svg { width: 21px; height: 21px; }
.estudio-herr span { position: absolute; right: 2px; bottom: 1px; font-size: 8.5px; font-weight: 700; opacity: .55; }
/* mesa con reglas */
.estudio-mesa { grid-area: mesa; display: grid; grid-template-columns: 22px minmax(0, 1fr); grid-template-rows: 22px minmax(0, 1fr); min-width: 0; min-height: 0; }
.estudio-regla-esq { background: #EEF1F0; border-right: 1px solid #C9D2CF; border-bottom: 1px solid #C9D2CF; width: 22px; height: 22px; }
.estudio-regla-h { width: 100%; height: 22px; display: block; }
.estudio-regla-v { width: 22px; height: 100%; display: block; }
.estudio-lienzo { position: relative; overflow: hidden; background: var(--es-mesa); min-width: 0; min-height: 0; }
.estudio-lienzo .canvas-container { position: absolute !important; inset: 0; }
.estudio-lienzo.soltando { box-shadow: inset 0 0 0 3px var(--es-acento); }
/* paleta vertical */
.estudio-paleta { grid-area: paleta; display: flex; flex-direction: column; gap: 3px; padding: 6px 3px; background: #F7F9F8; border-left: 1px solid var(--es-borde); overflow-y: auto; align-items: center; }
.estudio-paleta button, .estudio-paleta .otro { width: 21px; height: 21px; border-radius: 4px; border: 1px solid rgba(22,41,46,.2); flex: none; padding: 0; position: relative; }
.estudio-paleta button:hover { transform: scale(1.15); }
.estudio-paleta .nada { background: #fff linear-gradient(135deg, transparent 44%, #c0392b 44%, #c0392b 56%, transparent 56%); }
.estudio-paleta .otro { display: flex; align-items: center; justify-content: center; background: conic-gradient(#e74c3c, #f1c40f, #2ecc71, #3498db, #9b59b6, #e74c3c); color: #fff; font-weight: 700; font-size: 13px; overflow: hidden; cursor: pointer; }
.estudio-paleta .otro input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
/* panel */
.estudio-panel { grid-area: panel; border-left: 1px solid var(--es-borde); display: flex; flex-direction: column; min-height: 0; background: #fff; }
.estudio-pestanas { display: flex; border-bottom: 1px solid var(--es-borde); flex: none; }
.estudio-pestanas button { flex: 1; border: 0; border-bottom: 3px solid transparent; background: none; padding: 10px 4px; font-weight: 700; font-size: 13px; color: var(--es-suave); }
.estudio-pestanas button.on { color: var(--es-tinta); border-bottom-color: var(--es-acento); }
.estudio-sec { padding: 12px; overflow-y: auto; flex: 1; min-height: 0; }
.estudio-sec[hidden] { display: none; }
.estudio-sec .campo { width: 100%; padding: 9px 11px; }
.estudio-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
.estudio-chips button { border: 1px solid var(--es-borde); border-radius: 99px; background: #fff; padding: 4px 10px; font-size: 12.5px; }
.estudio-res { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.estudio-res button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 3px; border: 1px solid var(--es-borde); border-radius: 8px; background: #fff; cursor: grab; min-width: 0; }
.estudio-res button:hover { border-color: var(--es-acento); }
.estudio-res img { width: 54px; height: 54px; object-fit: contain; -webkit-user-drag: none; }
.estudio-res span { font-size: 11px; color: var(--es-suave); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.estudio-ayuda { font-size: 12.5px; color: var(--es-suave); margin: 8px 0; line-height: 1.45; }
.estudio-capas { display: flex; flex-direction: column; gap: 3px; }
.capa { display: flex; align-items: center; gap: 2px; border: 1px solid var(--es-borde); border-radius: 6px; padding: 2px; }
.capa.on { border-color: var(--es-acento); background: color-mix(in srgb, var(--es-acento) 8%, #fff); }
.capa.oculta .capa-nom { opacity: .45; text-decoration: line-through; }
.capa button { border: 0; background: none; height: 28px; min-width: 26px; border-radius: 4px; font-size: 12px; }
.capa button:hover { background: #F2F5F4; }
.capa .capa-nom { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 6px; font-weight: 700; font-size: 12.5px; }
.estudio-mias { display: flex; flex-direction: column; gap: 6px; }
.mia { display: flex; align-items: center; gap: 6px; border: 1px solid var(--es-borde); border-radius: 8px; padding: 6px; }
.mia.on { border-color: var(--es-acento); }
.mia a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.mia img, .mia .sin { width: 38px; height: 50px; object-fit: cover; border: 1px solid var(--es-borde); border-radius: 3px; background: #fff; flex: none; }
.mia b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .mia small { font-size: 12px; color: var(--es-suave); }
.mia button { border: 0; background: none; width: 28px; height: 28px; border-radius: 5px; color: var(--es-suave); } .mia button:hover { color: #c0392b; background: #fdecea; }
/* pie: hojas y estado */
.estudio-pie { grid-area: pie; display: flex; align-items: center; gap: 12px; padding: 5px 10px; border-top: 1px solid var(--es-borde); background: #F7F9F8; font-size: 12.5px; min-width: 0; }
.estudio-hojas { display: flex; gap: 3px; }
.estudio-hojas button { border: 1px solid var(--es-borde); background: #fff; border-radius: 5px; padding: 4px 10px; font-weight: 700; font-size: 12.5px; }
.estudio-hojas button.on { background: var(--es-acento); border-color: var(--es-acento); color: #fff; }
.estudio-info { color: var(--es-tinta); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.estudio-colores-act { display: inline-flex; gap: 4px; } .estudio-colores-act i { width: 16px; height: 16px; border-radius: 3px; border: 2px solid transparent; outline: 1px solid var(--es-borde); }
.estudio-cursor { margin-left: auto; color: var(--es-suave); white-space: nowrap; font-variant-numeric: tabular-nums; }
.estudio-zoom { display: inline-flex; align-items: center; gap: 3px; }
.estudio-zoom button { width: 26px; height: 26px; border: 1px solid var(--es-borde); border-radius: 5px; background: #fff; font-weight: 700; }
.estudio-zoom select { height: 26px; border: 1px solid var(--es-borde); border-radius: 5px; font: inherit; font-size: 12.5px; }
/* tablet y celular */
@media (max-width: 900px) {
  .estudio { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto auto auto; grid-template-areas: "doc" "props" "mesa" "paleta" "herr" "pie"; }
  .estudio-solo-movil { display: inline-flex !important; }
  .estudio-estado, .estudio-volver, .estudio-cursor, .estudio-colores-act { display: none; }
  .estudio-doc { flex-wrap: wrap; row-gap: 6px; padding: 6px 8px; }
  .estudio-doc #titulo { order: -1; flex: 1 1 100%; max-width: none; width: auto; min-width: 0; }
  .estudio-der { margin-left: auto; }
  .estudio-texto-btn { padding: 0 10px; }
  .estudio-info { display: none; }
  .estudio-mesa { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .estudio-regla-esq, .estudio-regla-h, .estudio-regla-v { display: none; }
  .estudio-herr { flex-direction: row; overflow-x: auto; border-right: 0; border-top: 1px solid var(--es-borde); }
  .estudio-herr button { width: 44px; height: 44px; }
  .estudio-paleta { flex-direction: row; overflow-x: auto; border-left: 0; border-top: 1px solid var(--es-borde); padding: 6px; }
  .estudio-paleta button, .estudio-paleta .otro { width: 28px; height: 28px; }
  .estudio-panel { position: fixed; right: 0; top: 0; bottom: 0; width: min(340px, 88vw); z-index: 60; transform: translateX(105%); transition: transform .2s; box-shadow: -10px 0 30px rgba(0,0,0,.18); }
  .estudio.panel-abierto .estudio-panel { transform: none; }
}

/* === v35 · Taller: pestañas Compositor / Hoja libre === */
.taller-modos { display: inline-flex; gap: 4px; padding: 4px; background: rgba(255,255,255,.9); border: 1px solid rgba(22,41,46,.12); border-radius: 12px; max-width: 100%; }
.taller-modos a { display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 12px; border-radius: 9px; color: #16292E; text-decoration: none; min-width: 0; transition: background .15s; }
.taller-modos a:not(.on):hover { background: #fff; box-shadow: 0 1px 4px rgba(22,41,46,.1); }
.taller-modos svg { width: 26px; height: 26px; flex: none; color: var(--primario, var(--acento, #2F6F63)); }
.taller-modos b { display: block; font-size: 15px; line-height: 1.2; }
.taller-modos small { display: block; font-size: 12px; line-height: 1.3; color: #57696D; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.taller-modos a.on { background: var(--primario, var(--acento, #2F6F63)); color: #fff; }
.taller-modos a.on svg, .taller-modos a.on small { color: rgba(255,255,255,.9); }
.pro-compat > .taller-modos, .pro-cuerpo > .taller-modos { margin: 0 0 14px; }
@media (max-width: 640px) { .taller-modos { display: flex; width: 100%; } .taller-modos a { flex: 1; padding: 8px 10px; } .taller-modos small { display: none; } }
