/* Panel de control · estilo minimalista con la paleta de la marca.
   Sin sombras ni degradados: líneas finas, mucho aire y un solo color de acento (el azul) para la acción principal.
   Todo sale de estas variables: para cambiar un color se toca solo aquí.
   El naranja da solo 2.5:1 sobre blanco: se usa para rellenar (con texto carbón) o como línea, no para escribir. */
:root {
  /* Paleta (Paleta de colores.pdf) */
  --fondo: #ffffff;                 /* fondo principal */
  --tinta: #242424;                 /* botones principales y texto */
  --acento: #ff7e33;                /* marca, progreso, subrayado: relleno o línea, nunca texto */
  --popup: rgba(208, 215, 219, .8); /* pop-ups: #d0d7db al 80 % */
  /* Neutros y estados */
  --suave: #6b6b6b; --tenue: #8a8a8a; --linea: #e7e7e7; --campo: #d4d4d4; --hueco: #f4f4f4;
  --suave-popup: #4b5258; --campo-popup: #aeb6bc;
  --ok: #1f7a4d; --error: #b3261e; --error-suave: #fdf0ef;
  --r: 6px;
  font-family: "Figtree", "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fondo); color: var(--tinta); line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--tinta); outline-offset: 2px; }
a { color: var(--tinta); text-decoration-color: var(--acento); text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* ---------- Estructura ---------- */
.barra { display: flex; justify-content: space-between; align-items: center; padding: 1rem 28px; border-bottom: 1px solid var(--linea); }
.marca { display: inline-flex; align-items: center; gap: 1rem; color: var(--tinta); text-decoration: none; }
.marca img { display: block; height: 20px; width: auto; }
.marca .seccion { padding-left: 1rem; border-left: 1px solid var(--linea); font-size: .85rem; font-weight: 500; color: var(--suave); }
main { max-width: 1040px; margin: 0 auto; padding: 2.5rem 28px 5rem; }
h1 { margin: 0 0 1.6rem; font-size: 1.5rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
h2 { margin: 2.8rem 0 1rem; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--suave); }
.meta, .cargando, .vacio { color: var(--suave); }
.vacio { padding: 1.2rem 0; }

/* ---------- Botones ---------- */
button, .boton {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 38px; padding: .35rem 1rem;
  border: 1px solid var(--campo); border-radius: var(--r); background: transparent; color: var(--tinta);
  font-weight: 500; font-size: .9rem; cursor: pointer; transition: border-color .15s, background .15s;
}
button:hover, .boton:hover { border-color: var(--tinta); }
button:disabled { opacity: .45; cursor: default; }
button:disabled:hover { border-color: var(--campo); }
button[hidden] { display: none; } /* el display de los botones anularía el atributo hidden */
.acceso-galeria .meta:empty { display: none; }
.primario { background: var(--tinta); border-color: var(--tinta); color: var(--fondo); }
.primario:hover { background: #000; border-color: #000; color: var(--fondo); }
.enlace { border: 0; background: none; color: var(--suave); min-height: 0; padding: 0; font-weight: 400; }
.enlace:hover { color: var(--tinta); text-decoration: underline; }
.centrado { display: flex; margin: 2rem auto 0; }

.fila { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: .8rem 0; }
.fila.centrada { justify-content: center; }

/* ---------- Campos ---------- */
input:not([type="file"]):not([type="checkbox"]), select {
  display: block; width: 100%; min-height: 42px; padding: .5rem .75rem; border: 1px solid var(--campo);
  border-radius: var(--r); background: var(--fondo); font-size: .95rem; font-weight: 400;
}
input::placeholder { color: var(--tenue); }
input:not([type="file"]):hover, select:hover { border-color: #aab0bb; }
input:not([type="file"]):focus, select:focus { outline: 0; border-color: var(--tinta); box-shadow: 0 0 0 1px var(--tinta); }
select {
  appearance: none; -webkit-appearance: none; padding-right: 2.2rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .8rem center;
}
.fila input { flex: 1; min-width: 220px; }

/* ---------- Tabla de eventos (solo líneas) ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .95rem .5rem; border-bottom: 1px solid var(--linea); }
th { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--tenue); padding-top: .4rem; }
td a { font-weight: 500; text-decoration: none; }
td a:hover { text-decoration: underline; }

/* ---------- Diálogos ---------- */
.dialogo {
  border: 1px solid rgba(255, 255, 255, .6); border-radius: 10px; padding: 2rem; width: min(440px, calc(100vw - 32px));
  background: var(--popup); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); box-shadow: 0 18px 50px rgba(36, 36, 36, .18);
}
.dialogo::backdrop { background: rgba(36, 36, 36, .15); }
.dialogo input:not([type="file"]):not([type="checkbox"]), .dialogo select { background: #fff; border-color: var(--campo-popup); }
.dialogo input::placeholder { color: #6b7278; }
.dialogo button:not(.primario) { border-color: #8b949a; }
.dialogo h2 { margin: 0 0 1.5rem; font-size: 1.15rem; font-weight: 600; text-transform: none; letter-spacing: -.005em; color: var(--tinta); }
.dialogo label { display: grid; gap: .4rem; margin: 0 0 1.15rem; font-size: .78rem; font-weight: 500; color: var(--suave-popup); }
.acciones { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.8rem; }

.aviso { padding: .7rem .9rem; border-radius: var(--r); margin: .8rem 0; font-size: .88rem; }
.aviso.ok { background: #eef7f2; color: var(--ok); }
.aviso.error { background: var(--error-suave); color: var(--error); }

/* ---------- Detalle del evento ---------- */
.enlace-galeria { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; padding: .9rem 0; border-top: 1px solid var(--linea); border-bottom: 1px solid var(--linea); font-size: .88rem; color: var(--suave); }
.enlace-galeria code { word-break: break-all; color: var(--tinta); font-size: .85rem; }
.pestanas { display: flex; gap: 1.4rem; flex-wrap: wrap; margin-bottom: 1rem; border-bottom: 1px solid var(--linea); }
.pestanas button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; min-height: 40px; padding: 0 .1rem; color: var(--suave); font-weight: 500; }
.pestanas button:hover { color: var(--tinta); }
.pestanas button[aria-selected="true"] { color: var(--tinta); border-bottom-color: var(--acento); }

/* ---------- Subida ---------- */
.zona { margin-top: 1.4rem; padding: 2.2rem 1rem; text-align: center; border: 1px dashed #b9bfca; border-radius: var(--r); display: grid; gap: .5rem; justify-items: center; }
.zona.sobre { border-color: var(--tinta); background: var(--hueco); }
.zona span, .zona small { color: var(--suave); }
.progreso { margin-top: 1.4rem; padding: 1.1rem 0; border-top: 1px solid var(--linea); }
.progreso p { margin: 0 0 .6rem; font-size: .92rem; }
progress { width: 100%; height: 6px; accent-color: var(--acento); }
.progreso details { margin-top: .6rem; color: var(--error); font-size: .85rem; }

/* ---------- Fotos ---------- */
.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.baldosa { margin: 0; }
.baldosa.es-portada img { outline: 3px solid var(--acento); outline-offset: -3px; }
.baldosa img, .baldosa .pendiente { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 4px; display: grid; place-items: center; background: var(--hueco); color: var(--suave); font-size: .8rem; }
.baldosa figcaption { display: grid; gap: .35rem; padding: .5rem 0 0; font-size: .75rem; color: var(--suave); }
.baldosa figcaption span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.baldosa { position: relative; }
.marco-foto { position: relative; cursor: pointer; }
.marca-foto { position: absolute; top: 8px; left: 8px; z-index: 1; display: grid; width: 26px; height: 26px; cursor: pointer; }
.marca-foto input { position: absolute; opacity: 0; width: 0; height: 0; }
.casilla { width: 22px; height: 22px; border-radius: 4px; background: rgba(255,255,255,.85); border: 1.5px solid var(--suave); display: grid; place-items: center; }
.baldosa:hover .casilla, .baldosa.marcada .casilla { border-color: var(--acento); }
.baldosa.marcada .casilla { background: var(--acento); }
.baldosa.marcada .casilla::after { content: ""; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.baldosa.marcada img { outline: 3px solid var(--acento); outline-offset: -3px; opacity: .85; }
.etiqueta-portada { position: absolute; right: 8px; bottom: 8px; background: var(--tinta); color: #fff; font-size: .7rem; padding: .15rem .5rem; border-radius: 999px; }
.barra-seleccion { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: .6rem .8rem; margin: .5rem 0 1rem; border-radius: 6px; background: var(--hueco); font-size: .85rem; }
.barra-seleccion.activa { background: #fff; box-shadow: 0 1px 8px rgba(0,0,0,.15); }
.barra-seleccion .cuenta-sel { font-weight: 600; }
.barra-seleccion .ayuda-sel { color: var(--suave); }
.acciones-sel { margin-left: auto; display: flex; flex-wrap: wrap; gap: .5rem; }
.miniaturas-borrado { display: flex; flex-wrap: wrap; gap: 6px; margin: .75rem 0; align-items: center; }
.miniaturas-borrado img { width: 64px; height: 44px; object-fit: cover; border-radius: 3px; }
.mas-fotos { color: var(--suave); font-size: .85rem; padding: 0 .5rem; }
.palabra-seguridad { width: 100%; margin-bottom: .5rem; }

@media (max-width: 600px) { main { padding: 1.6rem 16px 3.5rem; } .barra { padding: .9rem 16px; } th, td { padding: .75rem .3rem; } }

/* ---------- Pantalla de acceso ---------- */
.acceso { max-width: 360px; margin: 0 auto; padding: 14vh 24px 5rem; }
.acceso h1 { margin: 0 0 .35rem; font-size: 1.5rem; }
.acceso .sub { margin: 0 0 1.6rem; color: var(--suave); font-size: .92rem; }
.logo-acceso { display: block; height: 28px; width: auto; max-width: 100%; margin-bottom: 2.4rem; }
.acceso label { display: grid; gap: .4rem; margin: 0 0 1.1rem; font-size: .78rem; font-weight: 500; color: var(--suave); }
.acceso .primario { width: 100%; margin-top: .3rem; min-height: 42px; }
.acceso .enlaces { margin: 1.2rem 0 0; text-align: center; }
.acceso .ayuda { margin: -.4rem 0 1rem; font-size: .78rem; color: var(--suave); }
.acceso .exito { background: #eef7f2; color: var(--ok); }
.pie-acceso { margin-top: 3rem; text-align: center; font-size: .75rem; color: var(--tenue); }
.clave { position: relative; }
.clave input { padding-right: 5rem; }
.clave .mostrar { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); min-height: 30px; padding: 0 .6rem; border: 0; color: var(--suave); font-size: .78rem; font-weight: 500; background: transparent; }
.clave .mostrar:hover { color: var(--tinta); }

/* ---------- Lista de galerías y estado ---------- */
.cabecera-pagina { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.cabecera-pagina h1 { margin: 0; }
.cabecera-pagina .meta { margin: .3rem 0 0; font-size: .9rem; }
.acciones-pagina { display: flex; gap: .6rem; flex-wrap: wrap; }
.filtros { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: .8rem; }
.filtros input { flex: 1 1 240px; width: auto; max-width: 340px; }
.filtros select { width: auto; min-width: 170px; }
.tabla-galerias td { vertical-align: middle; }
a.galeria { display: flex; align-items: center; gap: .9rem; text-decoration: none; }
.galeria img, .sin-portada { width: 64px; height: 44px; border-radius: 4px; object-fit: cover; background: var(--hueco); flex: none; }
.galeria .nombre { display: grid; min-width: 0; }
.galeria .nombre b { font-weight: 500; }
.galeria .nombre small { color: var(--tenue); font-size: .78rem; }
tr.clicable { cursor: pointer; }
tr.clicable:hover { background: #fafafa; }
.pendientes { display: block; color: var(--suave); font-size: .72rem; }
.estado { display: inline-flex; align-items: center; gap: .45rem; font-size: .82rem; color: var(--suave); white-space: nowrap; }
.estado::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--tenue); }
.estado.pub::before { background: var(--ok); }
.vacio-grande { text-align: center; padding: 4rem 1rem; color: var(--suave); }
.vacio-grande b { display: block; margin-bottom: .3rem; font-size: 1.1rem; color: var(--tinta); }
.encabezado-evento { margin: .2rem 0 1rem; gap: .8rem; }
.encabezado-evento .meta { margin: 0 .4rem 0 0; }
.texto-dialogo { margin: 0 0 .4rem; color: var(--suave-popup); font-size: .92rem; }
.ayuda-dialogo { margin: -.2rem 0 1rem; font-size: .78rem; color: var(--suave-popup); }
.peligro { background: var(--error); border-color: var(--error); color: #fff; }
.peligro:hover { background: #8f1e18; border-color: #8f1e18; color: #fff; }
@media (max-width: 700px) { .col-tipo, .col-fecha { display: none; } .cabecera-pagina { align-items: flex-start; } }

/* ---------- Detalle de una galería ---------- */
.migas { margin: 0 0 1rem; font-size: .8rem; color: var(--tenue); }
.migas a { color: var(--suave); text-decoration: none; }
.migas a:hover { text-decoration: underline; }
.encabezado-galeria { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.portada-mini { width: 104px; aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: var(--hueco); flex: none; }
.portada-mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.texto-galeria { flex: 1; min-width: 240px; }
.texto-galeria h1 { margin: 0; font-size: 1.4rem; }
.meta-linea { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .9rem; margin-top: .35rem; font-size: .86rem; color: var(--suave); }
.acciones-galeria { display: flex; gap: .6rem; flex-wrap: wrap; }
.aviso-borrador { margin: 0 0 1.2rem; padding: .7rem .9rem; border: 1px solid var(--linea); border-left: 3px solid var(--acento); border-radius: var(--r); font-size: .88rem; color: var(--suave); }
.pest-barra { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 1.4rem; border-bottom: 1px solid var(--linea); margin-bottom: 1.4rem; }
.pest-lista { display: flex; gap: 1.6rem; overflow-x: auto; max-width: 100%; }
.acciones-pest { display: flex; gap: 1.2rem; align-items: center; font-size: .86rem; }
.pest { min-height: 44px; padding: 0 .1rem; border: 0; border-bottom: 2px solid transparent; border-radius: 0; margin-bottom: -1px; background: none; color: var(--suave); font-weight: 500; white-space: nowrap; }
.pest:hover { color: var(--tinta); border-color: transparent; }
.pest[aria-selected="true"] { color: var(--tinta); border-bottom-color: var(--acento); }
.pest small { margin-left: .4rem; color: var(--tenue); font-weight: 400; }
.pest:disabled { opacity: 1; cursor: default; color: var(--tenue); }
.pest .pronto { padding: .05rem .4rem; border-radius: 99px; background: #f0f0f0; font-size: .65rem; }
.colecs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.pildora { min-height: 34px; padding: .2rem .9rem; border-radius: 999px; border-color: var(--linea); color: var(--suave); font-size: .85rem; }
.pildora small { margin-left: .4rem; color: var(--tenue); font-weight: 400; }
.pildora[aria-pressed="true"] { border-color: var(--tinta); color: var(--tinta); }
.ayuda-seccion { margin: 0 0 1rem; font-size: .88rem; color: var(--suave); max-width: 46rem; }
a.boton { text-decoration: none; }

/* ---------- Gestión de colecciones ---------- */
.lista-colecciones { list-style: none; margin: 1rem 0 0; padding: 0; border-top: 1px solid var(--linea); }
.coleccion { display: flex; align-items: center; gap: 1rem; padding: .85rem .3rem; border-bottom: 1px solid var(--linea); flex-wrap: wrap; }
.nombre-coleccion { flex: 1 1 200px; font-weight: 500; }
.cuenta-coleccion { flex: 0 0 150px; font-size: .88rem; color: var(--suave); }
.cuenta-coleccion small { display: block; font-size: .72rem; color: var(--tenue); }
.acciones-coleccion { display: flex; gap: .4rem; flex-wrap: wrap; }
.acciones-coleccion button, .acciones-coleccion .boton { min-height: 32px; font-size: .8rem; padding: 0 .75rem; }
.acciones-coleccion .icono { width: 32px; padding: 0; }
.acciones-coleccion .borrar:not(:disabled) { color: var(--error); }
.acciones-coleccion .borrar:not(:disabled):hover { border-color: var(--error); color: var(--error); }
.coleccion.editando { display: block; }
.coleccion.editando form { margin: 0; }

/* Barra flotante de subida (visible en todo el panel mientras haya fotos en la cola) */
#cargas { position: fixed; z-index: 20; right: 16px; bottom: 16px; width: min(460px, calc(100vw - 32px)); background: var(--fondo); border: 1px solid var(--campo); border-top: 3px solid var(--acento); border-radius: var(--r); font-size: .85rem; }
#cargas.terminada { border-top-color: var(--ok); }
#cargas.con-errores { border-top-color: var(--error); }
.cargas-cabecera { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; justify-content: space-between; padding: .7rem .8rem .5rem; }
.cargas-resumen { display: grid; gap: .1rem; min-width: 0; }
.cargas-resumen small { color: var(--suave); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cargas-botones { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.cargas-botones button:not(.enlace) { min-height: 32px; font-size: .8rem; padding: 0 .7rem; }
#cargas > progress { display: block; width: calc(100% - 1.6rem); margin: 0 .8rem .7rem; }
.cargas-detalle { border-top: 1px solid var(--linea); max-height: 42vh; overflow-y: auto; padding: .4rem .8rem .8rem; }
.cargas-detalle ul { list-style: none; margin: 0; padding: 0; }
.carga-fila { display: grid; grid-template-columns: 1fr auto; gap: .1rem .6rem; padding: .45rem 0; border-bottom: 1px solid var(--linea); }
.carga-nombre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carga-destino, .carga-estado { color: var(--suave); }
.carga-fila.error .carga-estado { color: var(--error); }
.carga-fila progress { grid-column: 1 / -1; width: 100%; height: 6px; }
.carga-acciones { grid-column: 2; grid-row: 1 / span 2; align-self: center; display: flex; gap: .6rem; }
.cargas-pie { display: flex; justify-content: space-between; gap: .6rem; margin-top: .7rem; }
@media (max-width: 560px) { #cargas { right: 8px; bottom: 8px; width: calc(100vw - 16px); } }

.borrar-galeria:hover { color: var(--error); }
.col-acc { text-align: right; white-space: nowrap; }
.solo-lectores { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Vista previa de la galería */
.cabecera-previa { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-end; margin-bottom: 1rem; }
.cabecera-previa .meta { max-width: 52ch; }
.caja-previa { margin: 0 auto; border: 1px solid var(--campo); border-radius: var(--r); overflow: hidden; background: var(--fondo); }
.marco-previa { display: block; width: 100%; height: 78vh; border: 0; }

/* Pestaña Ajustes */
.ajustes { max-width: 520px; }
.ajustes h2 { font-size: 1.05rem; margin: 1.6rem 0 .8rem; }
.form-ajustes { display: grid; gap: .9rem; }
.form-ajustes label { display: grid; gap: .3rem; font-size: .88rem; color: var(--suave); }
.peligro-titulo { margin-top: 2.4rem; }
.zona-peligro { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; padding: 1rem; border: 1px solid var(--error); border-radius: var(--r); }
.zona-peligro p { margin: .2rem 0 0; }

.zona-archivar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; padding: 1rem; border: 1px solid var(--campo); border-radius: var(--r); }
.zona-archivar p { margin: 0; }

.muestra-fuente { margin: .6rem 0; font-size: 1.8rem; line-height: 1.2; font-weight: 400; word-break: break-word; }
.campo-archivo { display: grid; gap: .3rem; margin: .8rem 0 .4rem; font-size: .88rem; color: var(--suave); }
.casilla-licencia { display: flex; gap: .5rem; align-items: flex-start; font-size: .88rem; margin: .4rem 0 .8rem; }
.casilla-licencia input { margin-top: .2rem; }

.pareja-logos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 1rem; margin-top: .8rem; }
.tarjeta-logo { display: grid; gap: .5rem; align-content: start; min-width: 0; padding: 1rem; border: 1px solid var(--linea); border-radius: var(--r); }
.tarjeta-logo > * { min-width: 0; max-width: 100%; }
.tarjeta-logo p { margin: 0; overflow-wrap: anywhere; }
.tarjeta-logo input[type="file"] { width: 100%; }
.tarjeta-logo .acciones { justify-content: flex-start; }
.vista-logo { display: grid; place-items: center; height: 120px; padding: .8rem; overflow: hidden; border: 1px solid var(--linea); border-radius: 4px; }
.vista-logo img { width: auto; height: auto; max-width: 100%; max-height: 92px; object-fit: contain; }
.sin-logo { color: var(--tenue); font-size: .8rem; }

.acciones-guardar { margin-top: 1.4rem; }

/* Selector de diseño de la portada y de rejilla, con dibujos pequeños */
.campo-diseno { display: grid; gap: .4rem; }
.etiqueta-campo { font-size: .88rem; color: var(--suave); }
.opciones-diseno { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: .6rem; }
.opcion-diseno { position: relative; display: grid; gap: .25rem; align-content: start; padding: .55rem; border: 1px solid var(--campo); border-radius: var(--r); cursor: pointer; background: var(--fondo); color: var(--tinta); }
.opcion-diseno input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.opcion-diseno:has(input:checked) { border-color: var(--tinta); box-shadow: inset 0 0 0 1px var(--tinta); }
.opcion-diseno:has(input:focus-visible) { outline: 3px solid var(--acento); outline-offset: 2px; }
.opcion-diseno b { font-size: .82rem; font-weight: 600; }
.opcion-diseno small { font-size: .72rem; color: var(--suave); line-height: 1.25; }
.dibujo { display: grid; height: 54px; gap: 3px; padding: 4px; border-radius: 4px; background: var(--hueco); }
.dibujo i { display: block; background: #c9ccd1; border-radius: 2px; }
.dibujo i:nth-child(n+4) { display: none; }
.dibujo-clasico { grid-template-rows: 1fr 6px 6px; } .dibujo-clasico i:nth-child(2), .dibujo-clasico i:nth-child(3) { background: #5b6068; width: 60%; margin: 0 auto; }
.dibujo-centrado { grid-template-rows: 6px 4px 1fr; } .dibujo-centrado i:nth-child(1), .dibujo-centrado i:nth-child(2) { background: #5b6068; width: 60%; margin: 0 auto; } .dibujo-centrado i:nth-child(3) { grid-row: 3; }
.dibujo-dividido { grid-template-columns: 1fr 1.4fr; grid-template-rows: 6px 4px 1fr; } .dibujo-dividido i:nth-child(1), .dibujo-dividido i:nth-child(2) { background: #5b6068; grid-column: 1; } .dibujo-dividido i:nth-child(3) { grid-column: 2; grid-row: 1 / span 3; }
.dibujo-sobre-foto { position: relative; grid-template-rows: 1fr; } .dibujo-sobre-foto i:nth-child(1) { grid-row: 1; } .dibujo-sobre-foto i:nth-child(2) { position: absolute; left: 22%; right: 22%; bottom: 10px; height: 6px; background: #5b6068; } .dibujo-sobre-foto i:nth-child(3) { display: none; }
.dibujo-mosaico { grid-template-columns: repeat(3, 1fr); } .dibujo-mosaico i { display: block !important; } .dibujo-mosaico i:nth-child(1) { height: 70%; } .dibujo-mosaico i:nth-child(2) { height: 100%; } .dibujo-mosaico i:nth-child(3) { height: 55%; } .dibujo-mosaico i:nth-child(n+4) { height: 40%; align-self: end; }
.dibujo-cuadricula { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); } .dibujo-cuadricula i { display: block !important; }

.enlace-accion { margin-right: 1rem; color: var(--suave); font-size: .9rem; text-decoration: none; }
.enlace-accion:hover { color: var(--tinta); text-decoration: underline; }

/* Sección Acceso (contraseña y expiración) */
.acceso-galeria { display: grid; gap: .6rem; }
.campo-acceso { display: grid; gap: .3rem; font-size: .88rem; color: var(--suave); }
.fila-campo { display: flex; gap: .5rem; }
.fila-campo input { flex: 1; min-width: 0; }

.aviso-fecha { margin: 0; padding: .6rem .8rem; border-radius: var(--r); background: var(--error-suave); color: var(--error); font-size: .85rem; }

.aviso-clave p { margin: 0 0 .6rem; }
.aviso-clave .clave { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 1rem; padding: .1rem .4rem; background: #fff; border-radius: 4px; user-select: all; }
.fila-botones { display: flex; flex-wrap: wrap; gap: .5rem; }
.fila-botones button, .fila-botones .boton { min-height: 34px; font-size: .82rem; }

/* Sección App instalable */
.app-instalable { display: grid; gap: .6rem; }
.opciones-icono { display: grid; gap: .5rem; }
.opcion-icono { display: flex; gap: .7rem; align-items: flex-start; padding: .7rem .8rem; border: 1px solid var(--campo); border-radius: var(--r); cursor: pointer; }
.opcion-icono:has(input:checked) { border-color: var(--tinta); box-shadow: inset 0 0 0 1px var(--tinta); }
.opcion-icono input { margin-top: .2rem; accent-color: var(--tinta); }
.opcion-icono b, .opcion-icono small { display: block; }
.opcion-icono small { color: var(--suave); font-size: .8rem; margin-top: .15rem; }

/* ---------- Estadísticas ---------- */
.estadisticas h3 { margin: 2rem 0 .3rem; font-size: 1rem; }
.est-tarjetas { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-top: 1rem; }
.est-tarjeta { padding: 1rem 1.1rem; border: 1px solid var(--linea); border-radius: var(--r); }
.est-titulo { margin: 0; font-size: .85rem; color: var(--suave); }
.est-valor { margin: .1rem 0 .2rem; font-size: 2rem; font-weight: 600; line-height: 1.2; }
.est-tarjeta .meta { margin: 0; }
.est-grafica { display: flex; align-items: flex-end; gap: 3px; height: 110px; margin-top: .8rem; padding-bottom: 1px; border-bottom: 1px solid var(--campo); }
.est-barra { flex: 1; min-width: 3px; background: var(--acento); border-radius: 2px 2px 0 0; }
.est-barra[data-vacia] { background: var(--linea); }
.est-fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .8rem; margin-top: 1rem; }
.est-foto { margin: 0; }
.est-foto img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r); background: var(--hueco); }
.est-foto figcaption { display: flex; gap: .4rem; align-items: baseline; margin-top: .3rem; font-size: .8rem; }
.est-cuenta { flex: none; white-space: nowrap; padding: 0 .5rem; border-radius: 999px; background: var(--acento); color: var(--tinta); font-weight: 600; }
.est-nombre { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--suave); }
.acciones-correos { display: flex; flex-wrap: wrap; gap: .6rem; }
.casilla-ajuste { display: flex; align-items: center; gap: .5rem; margin-top: 1rem; }
.casilla-ajuste input { width: auto; }

/* ---------- Activar la app autenticadora ---------- */
.pasos-activar { margin: .8rem 0; padding-left: 1.3rem; color: var(--suave); line-height: 1.5; }
.pasos-activar li { margin-bottom: .4rem; }
.qr-activar { display: block; margin: .6rem auto; image-rendering: pixelated; border: 1px solid var(--linea); border-radius: var(--r); }
.clave-activar { margin: 0 0 .6rem; text-align: center; font-size: .9rem; }
.clave-activar code { letter-spacing: .08em; word-break: break-all; }

.barra-fotos { margin: .5rem 0 1rem; }
.baldosa:not(.seleccionable) .marco-foto { cursor: default; }
.baldosa.seleccionable .marco-foto { cursor: pointer; }

/* ---------- Pantalla de acceso en computadora: foto a la izquierda, formulario a la derecha ----------
   En celular y tableta angosta solo se ve el formulario (minimalista, como siempre). La foto se pone en --imagen-acceso
   (por ejemplo none); mientras no haya foto queda un fondo liso. */
.acceso-imagen { display: none; }
@media (min-width: 960px) {
  :root { --imagen-acceso: none; }
  .acceso-pagina { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); min-height: 100vh; }
  .acceso-imagen { display: block; background: var(--hueco) var(--imagen-acceso) center / cover no-repeat; }
  .acceso-pagina .acceso { align-self: center; width: 100%; max-width: 420px; padding: 4rem 48px; }
}

/* ---------- Menú del encabezado y consola de usuarios (solo superadmin) ---------- */
.menu-barra { display: flex; align-items: center; gap: 1.4rem; }
.enlace-menu { font-size: .9rem; text-decoration: none; color: var(--suave); }
.enlace-menu:hover { color: var(--tinta); text-decoration: underline; text-decoration-color: var(--acento); }
.tabla-usuarios td { vertical-align: middle; }
.tabla-usuarios .correo { display: grid; min-width: 0; overflow-wrap: anywhere; }
.tabla-usuarios .correo small { color: var(--tenue); font-size: .78rem; }
.tabla-usuarios .col-acc { text-align: right; white-space: nowrap; }
.tabla-usuarios .col-acc button { margin-left: .9rem; }
.estado.susp::before { background: var(--error); }
.etiqueta-rol { display: inline-block; margin-left: .5rem; padding: 0 .5rem; border-radius: 999px; background: var(--acento); color: var(--tinta); font-size: .7rem; font-weight: 600; vertical-align: middle; }
.casilla-linea { display: flex; align-items: flex-start; gap: .6rem; margin: .8rem 0; font-size: .9rem; }
.casilla-linea input { width: auto; margin-top: .25rem; }
@media (max-width: 700px) { .col-creada { display: none; } .tabla-usuarios .col-acc { white-space: normal; } .tabla-usuarios .col-acc button { display: block; margin: .3rem 0 0 auto; } }

/* ---------- Clientes ---------- */
.fila-cliente { cursor: pointer; }
.fila-cliente:hover td { background: var(--hueco); }
.embudo-cliente { display: flex; margin: 0 0 1.8rem; font-size: .85rem; overflow-x: auto; }
.embudo-cliente .etapa { flex: 1; min-width: 96px; text-align: center; padding: .5rem .4rem; border: 1px solid var(--campo); margin-left: -1px; color: var(--tenue); }
.embudo-cliente .etapa.hecha { background: var(--hueco); color: var(--tinta); }
.embudo-cliente .etapa.act { background: var(--acento); border-color: var(--acento); color: var(--tinta); font-weight: 600; }
.lista-contactos, .lista-notas { list-style: none; margin: 0 0 1rem; padding: 0; }
.lista-contactos li, .lista-notas li { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--linea); align-items: center; flex-wrap: wrap; }
.lista-notas li { display: block; }
.lista-notas p { margin: .2rem 0 0; white-space: pre-wrap; }
.acciones-fila { display: flex; gap: .9rem; flex-wrap: wrap; }
.nueva-nota { display: grid; gap: .6rem; margin-bottom: 1rem; justify-items: start; }
.nueva-nota textarea { width: 100%; font: inherit; padding: .6rem .7rem; border: 1px solid var(--campo); border-radius: var(--r); resize: vertical; }
.col-acc { white-space: nowrap; text-align: right; }
.col-acc .enlace + .enlace { margin-left: 1rem; }

/* ---------- Cotizaciones ---------- */
.editor-cot { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 2.5rem; align-items: start; }
.rejilla-datos { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 1rem; margin-bottom: 1.2rem; }
.rejilla-datos input, .rejilla-datos select { min-width: 0; width: 100%; }
.rejilla-datos label { display: grid; gap: .35rem; font-size: .78rem; color: var(--suave); margin-bottom: 1rem; }
.envolver-tabla { overflow-x: auto; }
.tabla-conceptos { width: 100%; border-collapse: collapse; }
.tabla-conceptos th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--suave); font-weight: 600; text-align: left; padding: .5rem .4rem; border-bottom: 1px solid var(--campo); }
.tabla-conceptos td { padding: .45rem .4rem; border-bottom: 1px solid var(--linea); vertical-align: top; }
.tabla-conceptos input { width: 100%; min-width: 0; }
.tabla-conceptos input.num { text-align: right; max-width: 110px; margin-left: auto; display: block; }
.tabla-conceptos td:first-child { min-width: 220px; }
.tabla-conceptos td.importe { padding-top: 1rem; white-space: nowrap; }
.th.der, .tabla-conceptos .der { text-align: right; }
.totales-cot { margin: 1.2rem 0 .5rem auto; width: min(340px, 100%); }
.totales-cot div { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .3rem 0; }
.totales-cot .total { border-top: 2px solid var(--tinta); margin-top: .4rem; padding-top: .6rem; font-weight: 700; font-size: 1.1rem; }
.totales-cot span { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.totales-cot span input { width: 64px; text-align: right; }
.editor-cot textarea { width: 100%; font: inherit; padding: .6rem .7rem; border: 1px solid var(--campo); border-radius: var(--r); resize: vertical; }
.lista-catalogo { max-height: 50vh; overflow-y: auto; margin-bottom: .6rem; }
.casilla-linea { display: flex !important; grid-template-columns: none; align-items: center; gap: .6rem; margin: 0 0 .6rem !important; font-size: .92rem !important; color: var(--tinta) !important; }
@media (max-width: 900px) { .editor-cot { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; } }
.editor-cot > div { min-width: 0; }

/* ---------- Barra superior en celular: el menú pasa a una segunda línea ---------- */
@media (max-width: 760px) {
  .barra { flex-wrap: wrap; gap: .6rem 1rem; padding: .8rem 16px; }
  .marca .seccion { display: none; }
  .menu-barra { flex-wrap: wrap; gap: .4rem 1.1rem; width: 100%; }
  main { padding-left: 16px; padding-right: 16px; }
}
.tabla-conceptos input.num { min-width: 78px; }
.tabla-conceptos td:first-child { min-width: 200px; }
