/* Panel: tranquilo, letra grande, pocos colores. No usa los colores del cliente: es la herramienta, no el sitio.
   Lleva la marca de Playa Pixel (3 dic 2026): tinta y mar en vez de azul, coral en el botón de entrar. */
:root {
  --tinta: #0B2E35; --tinta-2: #4d6a70; --linea: #d9e4e2; --fondo: #F2F7F6; --papel: #fff;
  --azul: #0E5E6F; --azul-2: #0B2E35; --coral: #FF6A55; --turq: #2BB3B1; --verde: #1f8a44; --verde-2: #17703a; --ambar: #9a6700; --ambar-f: #fff8e1; --rojo: #b42318;
  --radio: 10px; --sombra: 0 10px 40px rgba(20, 24, 40, .22);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--fondo); color: var(--tinta); font-size: 16px; line-height: 1.45; display: flex; flex-direction: column; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.boton { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border: 1px solid var(--linea); border-radius: 8px; background: var(--papel); font-weight: 500; white-space: nowrap; }
.boton:hover { border-color: #b9c0cf; background: #fafbfc; }
.boton:disabled { opacity: .45; cursor: default; }
.boton.principal { background: var(--verde); border-color: var(--verde); color: #fff; font-weight: 600; padding: 0 22px; }
.boton.principal:hover:not(:disabled) { background: var(--verde-2); }
.boton.azul { background: var(--azul); border-color: var(--azul); color: #fff; }
.boton.azul:hover:not(:disabled) { background: var(--azul-2); }
.boton.peligro { background: var(--rojo); border-color: var(--rojo); color: #fff; }
.boton.plano { border-color: transparent; background: none; }
.boton.plano:hover { background: rgba(27, 34, 51, .07); }
:focus-visible { outline: 3px solid rgba(43, 179, 177, .6); outline-offset: 2px; }
.boton.coral { background: var(--coral); border: 2px solid var(--tinta); color: var(--tinta); font-weight: 700; box-shadow: 3px 3px 0 var(--tinta); }
.boton.coral:hover:not(:disabled) { background: #ff7d6b; border-color: var(--tinta); }
.boton.coral:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--tinta); }
.marca-barra { display: flex; flex: none; margin-right: 2px; }
.marca-barra img { display: block; }

/* --- Barra superior --- */
.barra { flex: none; display: flex; align-items: center; gap: 10px; padding: 9px 14px; background: var(--papel); border-bottom: 1px solid var(--linea); }
.barra .sitio { font-weight: 600; font-size: 17px; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra select { height: 42px; max-width: 30ch; padding: 0 34px 0 12px; border: 1px solid var(--linea); border-radius: 8px; background: var(--papel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2356607a' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center; appearance: none; }
.aparato { display: inline-flex; border: 1px solid var(--linea); border-radius: 8px; overflow: hidden; }
.aparato button { height: 40px; padding: 0 13px; border: 0; background: var(--papel); }
.aparato button[aria-pressed="true"] { background: var(--tinta); color: #fff; }
.barra .hueco { flex: 1; }
.estado { font-size: 15px; color: var(--tinta-2); display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.estado::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--verde); }
.estado.pendiente { color: var(--ambar); font-weight: 500; }
.estado.pendiente::before { background: #d4a106; }
.menu { position: relative; }
.menu-lista { position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; padding: 6px; background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); box-shadow: var(--sombra); z-index: 30; }
.menu-lista .quien { padding: 8px 12px 10px; font-size: 14px; color: var(--tinta-2); border-bottom: 1px solid var(--linea); margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; }
.menu-lista button, .menu-lista a { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-radius: 6px; background: none; color: inherit; text-decoration: none; }
.menu-lista button:hover, .menu-lista a:hover { background: var(--fondo); }

.pista { flex: none; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 9px 14px; background: var(--ambar-f); border-bottom: 1px solid #f0dfa8; font-size: 15px; }
.pista button { height: 32px; padding: 0 12px; border: 1px solid #d9c27a; border-radius: 6px; background: #fff; }

/* --- El sitio --- */
.lienzo { flex: 1; min-height: 0; display: flex; justify-content: center; background: var(--fondo); }
.lienzo iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.lienzo.celular { padding: 18px 0; }
.lienzo.celular iframe { width: 390px; max-width: 100%; border: 1px solid var(--linea); border-radius: 22px; box-shadow: var(--sombra); }

/* --- Avisos --- */
.avisos { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; z-index: 90; pointer-events: none; }
.aviso { max-width: min(92vw, 560px); padding: 12px 18px; border-radius: 9px; background: var(--tinta); color: #fff; box-shadow: var(--sombra); font-size: 15.5px; animation: sube .18s ease-out; }
.aviso.error { background: var(--rojo); }
.aviso.bien { background: var(--verde-2); }
@keyframes sube { from { opacity: 0; transform: translateY(8px); } }

/* --- Diálogos y paneles --- */
.velo { position: fixed; inset: 0; background: rgba(20, 24, 40, .45); display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 60; }
.dialogo { width: min(100%, 480px); max-height: 100%; display: flex; flex-direction: column; background: var(--papel); border-radius: 14px; box-shadow: var(--sombra); overflow: hidden; }
.dialogo.ancho { width: min(100%, 980px); height: min(100%, 760px); }
.dialogo.ancho.bajo { height: auto; }
.dialogo header { flex: none; display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--linea); }
.dialogo header h2 { flex: 1; margin: 0; font-size: 19px; font-weight: 600; }
.dialogo .cuerpo { flex: 1; min-height: 0; overflow: auto; padding: 18px 20px; }
.dialogo .cuerpo p { margin: 0 0 12px; }
.dialogo footer { flex: none; display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--linea); background: #fafbfc; }
.dialogo footer .izq { margin-right: auto; }
.x { width: 38px; height: 38px; border: 0; border-radius: 8px; background: none; font-size: 20px; line-height: 1; }
.x:hover { background: var(--fondo); }
.nota { color: var(--tinta-2); font-size: 14.5px; }
.campo { display: block; margin-bottom: 14px; }
.campo > span { display: block; margin-bottom: 5px; font-weight: 500; }
.campo input[type="text"], .campo input[type="email"], .campo input[type="password"], .campo input[type="url"], .campo input[type="tel"], .campo select {
  width: 100%; height: 46px; padding: 0 13px; border: 1px solid #c3c9d6; border-radius: 8px; background: #fff; }
.opciones { display: grid; gap: 4px; margin-bottom: 14px; }
.opciones label { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; }
.opciones label:hover { background: var(--fondo); }
.opciones input { width: 19px; height: 19px; accent-color: var(--azul); }

.lateral { position: fixed; top: 0; right: 0; bottom: 0; width: min(100%, 400px); display: flex; flex-direction: column; background: var(--papel); border-left: 1px solid var(--linea); box-shadow: var(--sombra); z-index: 50; animation: entra .16s ease-out; }
@keyframes entra { from { transform: translateX(24px); opacity: 0; } }
.lateral header { flex: none; display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--linea); }
.lateral header h2 { flex: 1; margin: 0; font-size: 18px; font-weight: 600; }
.lateral .cuerpo { flex: 1; overflow: auto; padding: 14px 16px; }
.lateral footer { flex: none; padding: 12px 16px; border-top: 1px solid var(--linea); }

/* --- Listas --- */
.items { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.items li { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border: 1px solid var(--linea); border-radius: 9px; background: #fff; }
.items li.marcado { border-color: var(--azul); box-shadow: 0 0 0 2px rgba(31, 111, 235, .18); }
.items .mini { flex: none; width: 54px; height: 40px; border-radius: 5px; object-fit: cover; background: var(--fondo); }
.items .texto { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: none; border: 0; text-align: left; padding: 6px 0; }
.items .acc { flex: none; display: flex; }
.items .acc button { width: 36px; height: 36px; border: 0; border-radius: 6px; background: none; font-size: 16px; }
.items .acc button:hover:not(:disabled) { background: var(--fondo); }
.items .acc button:disabled { opacity: .25; cursor: default; }

/* --- Historial --- */
.versiones { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.versiones li { padding: 12px 14px; border: 1px solid var(--linea); border-radius: 9px; }
.versiones .fecha { font-weight: 600; }
.versiones .detalle { color: var(--tinta-2); font-size: 14.5px; margin: 2px 0 8px; }
.versiones .ahora { display: inline-block; padding: 3px 9px; border-radius: 99px; background: #e6f4ea; color: var(--verde-2); font-size: 13.5px; font-weight: 600; }

/* --- Biblioteca de fotos --- */
.subida { display: flex; align-items: center; gap: 14px; padding: 14px; margin-bottom: 16px; border: 2px dashed #c3c9d6; border-radius: var(--radio); background: #fafbfc; }
.subida.sobre { border-color: var(--azul); background: #eef4ff; }
.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.foto { position: relative; padding: 0; border: 2px solid transparent; border-radius: 9px; background: var(--fondo); overflow: hidden; aspect-ratio: 4 / 3; }
.foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto:hover { border-color: #b9c0cf; }
.foto[aria-pressed="true"] { border-color: var(--azul); box-shadow: 0 0 0 3px rgba(31, 111, 235, .25); }
.foto .uso { position: absolute; left: 6px; top: 6px; padding: 2px 7px; border-radius: 99px; background: rgba(27, 34, 51, .78); color: #fff; font-size: 12px; }
.foto .quitar { position: absolute; right: 6px; top: 6px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); font-size: 14px; display: none; }
.foto:hover .quitar, .foto:focus-within .quitar { display: block; }
.recorte { position: relative; margin: 0 auto 14px; max-width: 100%; background: #111; overflow: hidden; border-radius: 8px; touch-action: none; cursor: grab; user-select: none; }
.recorte:active { cursor: grabbing; }
.recorte img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; pointer-events: none; }
.zoom { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.zoom input { flex: 1; accent-color: var(--azul); }
.alerta { padding: 9px 12px; border-radius: 8px; background: var(--ambar-f); color: #6b4a00; font-size: 14.5px; margin-bottom: 14px; }

/* --- Entrar --- */
body.entrar { align-items: center; justify-content: center; overflow: auto; padding: 20px; background: linear-gradient(#BFE9E4 0 34%, #F4FBF9 34% 36%, #2BB3B1 36% 60%, #0E5E6F 60% 82%, #0B2E35 82%); }
.tarjeta { width: min(100%, 420px); padding: 28px 26px 24px; background: #F4FBF9; border: 4px solid var(--tinta); border-radius: 0; box-shadow: 8px 8px 0 rgba(6, 27, 32, .55); }
.tarjeta .marca { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.tarjeta .marca b { font-size: 25px; letter-spacing: -.03em; }
.tarjeta .marca b span { color: var(--azul); }
.tarjeta .marca b i { display: inline-block; width: .2em; height: .2em; margin-left: .06em; background: var(--coral); }
.tarjeta h1 { margin: 0 0 22px; font-size: 22px; font-weight: 600; line-height: 1.25; }
.tarjeta .boton { width: 100%; justify-content: center; height: 48px; font-size: 17px; }
.tarjeta .error { margin: 0 0 14px; padding: 10px 12px; border-radius: 8px; background: #fdecea; color: var(--rojo); font-size: 15px; }
.tarjeta .pie { margin: 20px 0 0; padding-top: 14px; border-top: 2px solid #d5e6e3; display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.tarjeta .pie a { color: var(--azul); font-weight: 600; }
.tarjeta .pie button { border: 0; background: none; color: var(--tinta-2); text-decoration: underline; }

@media (max-width: 860px) {
  .barra { flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
  .barra .sitio, .aparato, .solo-ancho { display: none; }
  .barra select { flex: 1; max-width: none; min-width: 0; }
  .estado { order: 9; width: 100%; font-size: 14px; }
  .boton { height: 40px; padding: 0 12px; }
  .pista { font-size: 14px; text-align: left; }
  .lienzo.celular { padding: 0; }
  .lienzo.celular iframe { width: 100%; border: 0; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }
