/* Panel administrativo (usa los colores de styles.css) */
body.admin { padding-bottom: 0; }

.ad-centro { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.ad-tarjeta {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 20px; width: min(420px, 100%); box-shadow: var(--shadow);
}
.ad-tarjeta h1 { margin: 0; font-size: 22px; }
.ad-tarjeta h2 { margin: 0; font-size: 18px; }
.ad-tarjeta .enlace { text-align: center; text-decoration: none; }
.ad-ancho { width: min(620px, 100%); margin-bottom: 16px; }
.form label small { font-weight: 400; }

/* Encabezado */
.ad-top {
  position: sticky; top: 0; z-index: 10; background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; flex-wrap: wrap;
}
.ad-marca { display: flex; flex-direction: column; line-height: 1.2; }
.ad-marca b { font-size: 17px; }
.ad-marca a { font-size: 12px; color: var(--brand); text-decoration: none; }
.ad-tabs { display: flex; gap: 4px; background: var(--bg); border-radius: 12px; padding: 4px; overflow-x: auto; flex: 1; min-width: 0; }
.ad-tabs button { border: 0; background: none; border-radius: 9px; padding: 8px 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.ad-tabs button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.ad-yo { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.ad-yo #yoCorreo { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) {
  .ad-tabs { order: 3; flex-basis: 100%; }
  .ad-yo { margin-left: auto; }
  .ad-yo #yoCorreo { display: none; }
}
.rol {
  display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand);
}
.rol.administrador { background: var(--rol-admin-bg); color: var(--rol-admin-fg); }
.rol.operador { background: var(--rol-op-bg); color: var(--rol-op-fg); }
.btn-mini {
  border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 6px 12px; font-size: 13px; font-weight: 600;
}
.btn-mini:disabled { opacity: .45; cursor: not-allowed; }
.btn-mini.peligro { color: var(--danger); }

/* Contenido */
.ad-main { max-width: 1300px; margin: 0 auto; padding: 16px; }
.ad-barra { display: flex; gap: 8px; flex-wrap: wrap; }
.ad-barra input, .ad-barra select, .ad-fila input, .ad-fila select {
  border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 10px;
  padding: 10px 12px; font-size: 15px;
}
.ad-barra input { flex: 1 1 280px; }
.ad-barra select { flex: 0 1 220px; }
.ad-fila { display: flex; gap: 8px; flex-wrap: wrap; }
.ad-fila input { flex: 1 1 220px; }
.ad-fila .btn-principal { padding: 10px 18px; }
.ad-resumen { color: var(--muted); font-size: 13px; margin: 12px 0 8px; }

.ad-tabla-caja { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.ad-tabla { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ad-tabla th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted);
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--bg);
}
.ad-tabla td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ad-tabla tr:last-child td { border-bottom: 0; }
.ad-tabla tbody tr[data-id] { cursor: pointer; }
.ad-tabla tbody tr[data-id]:hover { background: var(--brand-soft); }
.ad-tabla .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ad-tabla .mini-foto { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 6px; border: 1px solid var(--line); display: block; }
.ad-tabla .nom { min-width: 220px; font-weight: 600; }
.ad-tabla .sub { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.ad-tabla select { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 8px; padding: 5px 8px; }
.ad-vacio { padding: 30px; text-align: center; color: var(--muted); }
.estado { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.estado.activo { background: var(--brand-soft); color: var(--brand); }
.estado.agotado, .estado.bloqueado { background: var(--err-bg); color: var(--err-fg); }
.candado { font-size: 12px; }

.ad-pag { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 14px 0 30px; font-size: 13px; color: var(--muted); }

.ad-roles { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 0 0 16px; }
.ad-roles div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 13px; color: var(--muted); }
.ad-roles b { display: block; color: var(--text); margin-bottom: 2px; }

/* Editor lateral */
.ad-editor { width: min(560px, 100%); z-index: 22; }
.ad-editor .panel-body { gap: 10px; align-content: start; }
.ad-editor fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 0; display: grid; gap: 10px; min-width: 0; }
.ad-editor .panel-body { overflow-x: hidden; }
.ad-editor label { min-width: 0; }
.ad-editor input, .ad-editor select, .ad-editor textarea { width: 100%; min-width: 0; }
.ad-editor select {
  border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 10px; padding: 11px; font-size: 16px;
}
.ad-editor legend { font-weight: 700; font-size: 13px; padding: 0 6px; }
.ad-editor .dos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ad-editor .tres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ad-editor fieldset > div:not([class]) { display: grid; }
@media (max-width: 480px) { .ad-editor .tres { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ad-editor label.cambiado input, .ad-editor label.cambiado select, .ad-editor label.cambiado textarea { border-color: #e0a100; background: var(--warn-bg); }
.ad-cabecera { display: flex; gap: 12px; align-items: center; }
.ad-cabecera img { width: 72px; height: 72px; object-fit: contain; background: #fff; border-radius: 10px; border: 1px solid var(--line); }
.ad-cabecera small { color: var(--muted); }
.ad-precios { font-size: 13px; background: var(--bg); border-radius: 10px; padding: 10px 12px; color: var(--muted); }
.ad-precios b { color: var(--text); }
.ad-aviso { font-size: 12.5px; color: var(--muted); background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.check { display: flex !important; align-items: center; gap: 8px; color: var(--text) !important; font-size: 14px !important; }
.check input { width: 18px; height: 18px; }

/* ---------- Búsqueda con escáner ---------- */
.ad-buscar {
  flex: 1 1 280px; display: flex; align-items: center;
  border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding-right: 8px;
}
.ad-buscar:focus-within { border-color: var(--brand); }
.ad-buscar input { flex: 1; border: 0 !important; background: none !important; outline: none; min-width: 0; }

/* ---------- Selección múltiple ---------- */
.ad-tabla .chk { width: 36px; padding-right: 0; }
.ad-tabla .chk input { width: 17px; height: 17px; cursor: pointer; accent-color: var(--brand); }
.ad-tabla tbody tr.sel { background: var(--brand-soft); }
.ad-seleccion {
  position: sticky; top: 64px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--brand); border-radius: 12px; padding: 8px 10px; margin-bottom: 10px;
  box-shadow: var(--shadow); font-size: 14px; font-weight: 600;
}
.ad-seleccion #pSelTexto { margin-right: auto; }
.ad-seleccion .btn-principal { padding: 8px 14px; font-size: 14px; }

/* ---------- Página editable ---------- */
.ad-irpag { display: flex; align-items: center; gap: 6px; }
.ad-irpag input {
  width: 70px; text-align: center; border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 8px; padding: 6px; font-size: 14px; -moz-appearance: textfield;
}
.ad-irpag b { color: var(--text); }

/* ---------- Editor: campos especiales ---------- */
.ad-editor .uno { display: grid; }
.ad-editor label.lectura input { opacity: 1; background: var(--brand-soft); border-color: transparent; color: var(--text); font-weight: 600; cursor: default; }
.ad-editor .nota { font-size: 11.5px; color: var(--muted); }
/* Campo con el ícono del escáner adentro (igual que el buscador) */
.con-boton {
  display: flex; align-items: center; border: 1px solid var(--line); background: var(--bg);
  border-radius: 10px; padding-right: 4px;
}
.con-boton:focus-within { border-color: var(--brand); }
.ad-editor .con-boton input { flex: 1; border: 0 !important; background: none !important; outline: none; }
.con-boton .scan-btn { margin: 0; flex: none; width: 38px; height: 38px; }
.ad-editor label.cambiado .con-boton { border-color: #e0a100; background: var(--warn-bg); }
.ad-cabecera button { margin-top: 6px; }
.ad-escalas { display: grid; gap: 8px; border-top: 1px dashed var(--line); padding-top: 10px; }
.ad-escalas p { margin: 0; }
.escala { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 6px; align-items: end; }
.escala label { font-size: 11.5px !important; }
.escala select, .escala input { padding: 8px !important; font-size: 14px !important; }
.escala .btn-mini { height: 38px; }
@media (max-width: 480px) { .escala { grid-template-columns: 1fr 1fr; } }
.ad-tabla .sub { white-space: normal; }

/* Placeholder del precio previsto */
.ad-editor input::placeholder { color: var(--muted); opacity: .85; }

/* ---------- Inventario ---------- */
.inv-resumen { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.inv-chip {
  display: flex; flex-direction: column; align-items: flex-start; min-width: 110px;
  border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 8px 12px;
  font-size: 12.5px; color: var(--muted); text-align: left;
}
.inv-chip b { font-size: 20px; color: var(--text); line-height: 1.1; }
.inv-chip.falta b { color: var(--err-fg); }
.inv-chip.sobra b { color: #b07c00; }
.inv-chip.cuadra b { color: var(--brand); }
.inv-chip.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.inv-acciones { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 0; }
.inv-acciones .btn-principal { padding: 9px 16px; font-size: 14px; }
.inv-res { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.inv-res.falta { background: var(--err-bg); color: var(--err-fg); }
.inv-res.sobra { background: var(--warn-bg); color: #b07c00; }
.inv-res.cuadra { background: var(--brand-soft); color: var(--brand); }
.inv-res.gris { background: var(--bg); color: var(--muted); }
.inv-sistema {
  width: 110px; text-align: right; border: 1px solid var(--line); background: var(--bg); color: var(--text);
  border-radius: 8px; padding: 7px 8px; font-size: 14px;
}
.inv-sistema:focus { outline: none; border-color: var(--brand); }
.ad-tabla td.obs { max-width: 220px; color: var(--muted); font-size: 12.5px; }

/* ---------- Por revisar ---------- */
#pRevision { flex: 0 1 260px; }
.ad-tabla .alerta { display: block; font-size: 11px; font-weight: 700; color: var(--err-fg); white-space: nowrap; }
.ad-alerta {
  background: var(--err-bg); color: var(--err-fg); border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.5;
}
.ad-alerta .btn-mini { margin-top: 6px; }

/* Botón de producto nuevo */
.ad-nuevo { padding: 10px 16px; font-size: 14px; white-space: nowrap; }


/* Descripción en la tabla y código editable en el editor */
.ad-tabla td.desc { min-width: 200px; max-width: 320px; font-size: 12.5px; color: var(--muted); }
.cod-edit { display: grid; gap: 2px; min-width: 0; flex: 1; }
.cod-edit label { font-size: 12px; }
.cod-edit input { font-weight: 700; padding: 8px 10px !important; }

/* ---------- Tienda: mapa 2D, filas y niveles ---------- */
.t-cabecera { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.t-cabecera b { font-size: 18px; }
.t-herr { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-left: auto; }
.t-herr .btn-principal { padding: 8px 14px; font-size: 14px; }
.t-lienzo { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0; margin-top: 10px;
  overflow: hidden; height: min(72vh, 760px); min-height: 360px; cursor: grab; touch-action: none; }
.t-lienzo.moviendo { cursor: grabbing; }
#tMapa { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; }
.t-piso { fill: var(--bg); stroke: var(--text); stroke-width: 0.08; }
.t-grid { stroke: var(--line); stroke-width: 0.02; }
.t-grid5 { stroke-width: 0.05; }
.t-el { cursor: pointer; }
.t-el.editable { cursor: grab; }
.t-el.editable:active { cursor: grabbing; }
.t-cuerpo { stroke: rgba(0,0,0,.35); stroke-width: 0.04; }
.t-el:hover .t-cuerpo { stroke: var(--text); stroke-width: 0.07; }
.t-nivel { stroke: rgba(255,255,255,.45); stroke-width: 0.025; stroke-dasharray: 0.12 0.08; pointer-events: none; }
.t-txt, .t-sub { fill: #fff; text-anchor: middle; dominant-baseline: middle; font-weight: 700; pointer-events: none; }
.t-sub { font-weight: 500; opacity: .92; }
.t-asa { fill: rgba(255,255,255,.85); stroke: rgba(0,0,0,.4); stroke-width: 0.02; cursor: nwse-resize; }
.t-alerta { fill: #ff3b30; stroke: #fff; stroke-width: 0.03; }
.t-recorrido { margin: 14px 0 30px; display: grid; gap: 8px; }
.t-recorrido h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.t-fila { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.t-fila > b { min-width: 70px; }
.t-paso {
  display: grid; text-align: left; gap: 1px; border: 1px solid var(--line); border-left: 5px solid var(--c);
  background: var(--bg); border-radius: 8px; padding: 5px 9px; font-size: 13px; font-weight: 600;
}
.t-paso span { display: none; }
.t-paso small { font-weight: 400; color: var(--muted); font-size: 11.5px; }
.t-paso small i { font-style: normal; color: var(--err-fg); font-weight: 700; }
.t-flecha { color: var(--muted); }
.t-leyenda { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
.t-leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.t-leyenda i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.t-leyenda i.t-alerta-ley { background: #ff3b30; border-radius: 50%; }
.t-nivel-tit { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin-top: 6px; }
.t-acciones { display: flex; gap: 8px; }
.t-productos { display: grid; gap: 6px; border-top: 1px dashed var(--line); padding-top: 10px; }
.t-productos p { margin: 0; }
.t-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.t-lista li { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 8px; background: var(--bg); font-size: 12.5px; }
.t-lista li.agotado { opacity: .75; }
.t-lista img, .t-sinfoto { width: 36px; height: 36px; object-fit: contain; background: #fff; border-radius: 6px; flex: none; }
.t-puesto { flex: none; width: 26px; text-align: center; font-weight: 700; color: var(--muted); }
.t-prod { flex: 1; min-width: 0; }
.t-prod small { display: block; color: var(--muted); }

/* Rol Técnico y extracción de la base de datos */
.rol.tecnico { background: #fff1d6; color: #9a5b00; }
:root[data-theme="dark"] .rol.tecnico { background: #3a2c12; color: #ffc36b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rol.tecnico { background: #3a2c12; color: #ffc36b; } }
.exp-tablas { display: flex; flex-wrap: wrap; gap: 6px; }
.exp-tablas span { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 12.5px; color: var(--muted); }
.exp-tablas b { color: var(--text); }

/* Inventario: fecha de modificación */
.inv-mod { white-space: nowrap; font-size: 12.5px; }

/* Tienda: seleccionar varios estantes */
.t-el.sel .t-cuerpo { stroke: var(--text); stroke-width: 0.09; stroke-dasharray: 0.18 0.1; }
.t-el.sel { filter: drop-shadow(0 0 0.08px rgba(0,0,0,.5)); }
.t-paso.sel { outline: 2px dashed var(--text); outline-offset: 2px; }
#tSelBtn.on { background: var(--text); color: var(--bg); }
.t-selbar { border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 12px; margin: 0 0 12px;
  display: grid; gap: 10px; }
.t-selbar-tit { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.t-selbar-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 12px; align-items: end; }
.t-selbar-campos label { display: grid; gap: 4px; font-size: 13px; min-width: 0; }
.t-selbar-campos select, .t-selbar-campos input:not([type=checkbox]) { min-width: 0; width: 100%; }
.t-selbar-check { display: flex !important; align-items: center; gap: 6px; }
.t-selbar-botones { display: flex; flex-wrap: wrap; gap: 8px; }

/* Tienda: mapa a la izquierda y recorrido a la derecha */
.t-zona { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 14px; align-items: start; margin-top: 10px; }
.t-zona .t-lienzo { margin-top: 0; }
.t-zona .t-recorrido { margin: 0 0 30px; position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow-y: auto; }
.t-zona .t-fila { flex-direction: column; align-items: stretch; }
.t-zona .t-fila > b { min-width: 0; }
.t-zona .t-paso { text-align: left; }
.t-zona .t-flecha { align-self: center; transform: rotate(90deg); line-height: 1; }
@media (max-width: 900px) {
  .t-zona { grid-template-columns: 1fr; }
  .t-zona .t-recorrido { position: static; max-height: none; }
}
.t-escalon { stroke: rgba(255,255,255,.7); stroke-width: 0.04; }
#tCandado.on { background: #b7791f; border-color: #b7791f; color: #fff; }
.t-lienzo.bloqueado .t-el.editable { cursor: pointer; }

/* Inventario: filtro por fecha de conteo */
.inv-fechas { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.inv-fechas label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.ad-barra .inv-fechas input { flex: none; width: auto; }

/* Columna: elemento fijo del local (no lleva productos) */
.t-el[data-tipo="columna"] .t-cuerpo { stroke: rgba(0,0,0,.35); stroke-width: 0.04; }

/* Planograma del estante: columnas × planchas, solo fotos */
.t-plano { display: grid; gap: 8px; }
.t-plano-grid { display: grid; gap: 4px; overflow-x: auto; }
.t-plano-cab { font-size: 11px; color: var(--muted); text-align: center; font-weight: 600; }
.t-plano-lat { font-size: 11px; color: var(--muted); font-weight: 700; display: grid; place-items: center;
  background: var(--bg); border-radius: 6px; }
.t-celda { min-height: 64px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 4px;
  display: flex; flex-wrap: wrap; gap: 4px; align-content: flex-start; }
.t-celda.destino { border: 2px dashed var(--brand); cursor: pointer; }
.t-celda.destino:hover { background: var(--brand-soft, rgba(15,122,85,.08)); }
.t-vacia { font-size: 11px; color: var(--muted); margin: auto; }
.t-foto { width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #fff;
  display: grid; place-items: center; overflow: hidden; cursor: pointer; position: relative; }
.t-foto img { width: 100%; height: 100%; object-fit: contain; }
.t-foto span { font-size: 9px; color: #555; word-break: break-all; padding: 2px; }
.t-foto.agotado { border: 2px solid var(--err-fg, #c0392b); }
.t-foto.agotado img { opacity: .45; }
.t-foto.manual { outline: 2px dashed var(--muted); outline-offset: 1px; }
.t-foto.elegido { outline: 3px solid var(--brand); outline-offset: 1px; transform: scale(1.08); z-index: 1; }
.t-plano-mover { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; background: var(--brand-soft, rgba(15,122,85,.08));
  border: 1px solid var(--brand); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.t-plano-mover span { flex: 1 1 200px; }
/* Lista de modelos de estante */
.t-modelos { display: grid; gap: 8px; margin: 10px 0; }
.t-modelo { text-align: left; display: grid; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.t-modelo:hover { border-color: var(--brand); }
.t-modelo small { color: var(--muted); font-size: 12px; }

/* Navegar entre los estantes del mismo departamento */
.t-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; font-size: 13px; }
.t-nav span { color: var(--muted); text-align: center; flex: 1 1 140px; }
.t-nav button[disabled] { opacity: .4; cursor: default; }

/* Ficha del producto en el planograma */
.t-det { position: relative; border: 1px solid var(--brand); background: var(--card); border-radius: 12px; padding: 12px; display: grid; gap: 10px; }
.t-det-cerrar { position: absolute; top: 6px; right: 6px; border: 0; background: none; font-size: 16px; color: var(--muted); cursor: pointer; padding: 4px 8px; }
.t-det-cab { display: flex; gap: 12px; align-items: flex-start; padding-right: 24px; }
.t-det-cab img, .t-det-sinfoto { width: 84px; height: 84px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; flex: none; }
.t-det-cab small { color: var(--muted); display: block; margin-top: 4px; }
.t-det-botones { display: flex; flex-wrap: wrap; gap: 6px; }
.t-det-botones .btn-mini.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.t-det-datos { display: grid; gap: 4px; background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.t-det-datos div { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.t-det-datos span { color: var(--muted); }
.t-det-datos small { color: var(--muted); font-size: 12px; }
/* Notificaciones */
.t-avisos-btn b { background: #d93025; color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; margin-left: 4px; }
.t-avisos { display: grid; gap: 6px; margin-top: 10px; }
.t-aviso { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13px; background: var(--card); }
.t-aviso.nuevo { border-color: var(--brand); background: var(--brand-soft, rgba(15,122,85,.08)); }
.t-aviso img, .t-aviso .t-det-sinfoto { width: 40px; height: 40px; flex: none; }
.t-aviso small { display: block; color: var(--muted); margin-top: 2px; }
.t-aviso-precio { color: #1a7f37; }
.t-aviso-stock { color: #9a5b00; }

/* Tienda: Mapa / Notificaciones */
.t-vistas { display: inline-flex; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.t-vistas button { border: 0; background: none; border-radius: 9px; padding: 7px 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.t-vistas button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.t-tipos { display: flex; flex-wrap: wrap; gap: 8px; }
.n-acciones { white-space: nowrap; }
.n-acciones .btn-mini { margin: 2px 0; }
/* Ficha del producto (ventana aparte) */
.pd-velo { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.5); display: grid; place-items: center; padding: 16px; }
.pd-velo[hidden] { display: none; }
.pd-caja { position: relative; width: min(480px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--card);
  border-radius: 16px; padding: 18px; display: grid; gap: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.pd-cerrar { position: absolute; top: 8px; right: 8px; border: 0; background: var(--bg); border-radius: 50%; width: 34px; height: 34px; cursor: pointer; font-size: 15px; }
.pd-cab { display: flex; gap: 14px; align-items: flex-start; padding-right: 36px; }
.pd-cab img, .pd-cab .t-det-sinfoto { width: 120px; height: 120px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 10px; flex: none; }
.pd-cab h3 { margin: 0 0 6px; font-size: 16px; }
.pd-datos { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 13.5px; }
.pd-datos dt { color: var(--muted); }
.pd-datos dd { margin: 0; overflow-wrap: anywhere; }
.pd-avisar { display: grid; gap: 8px; background: var(--bg); border-radius: 12px; padding: 12px; }
.pd-avisar textarea { width: 100%; box-sizing: border-box; }
.pd-botones { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Zoom del mapa */
.t-zoom { position: absolute; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 2px; background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 3px; box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 2; }
.t-zoom button { border: 0; background: none; width: 34px; height: 34px; border-radius: 8px; font-size: 17px; cursor: pointer; color: var(--text); }
.t-zoom button:hover { background: var(--bg); }
.t-zoom span { min-width: 46px; text-align: center; font-size: 12px; color: var(--muted); }
/* Planograma por planchas */
.t-planchas { display: grid; gap: 6px; }
.t-plancha { display: grid; grid-template-columns: 52px 1fr; gap: 6px; }
.t-plancha-lat { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: var(--bg);
  border-radius: 8px; padding: 4px 2px; font-size: 12px; }
.t-plancha-lat small { color: var(--muted); font-size: 10.5px; }
.t-plancha-mover { display: flex; flex-direction: column; gap: 2px; }
.t-plancha-mover button { border: 1px solid var(--line); background: var(--card); border-radius: 6px; width: 30px; height: 22px; font-size: 10px; cursor: pointer; color: var(--text); }
.t-plancha-mover button:disabled { opacity: .3; cursor: default; }
