/* ============ Diseño estilo Odoo · un color de marca por negocio ============ */
:root {
  --marca: #E4572E;
  --marca-suave: color-mix(in srgb, var(--marca) 12%, #fff);
  --marca-borde: color-mix(in srgb, var(--marca) 35%, #fff);
  --marca-osc: color-mix(in srgb, var(--marca) 80%, #000);
  --fondo: #f5f6f8;
  --hoja: #ffffff;
  --borde: #e2e5ea;
  --borde-f: #cdd2d9;
  --texto: #1f2430;
  --texto-2: #454b57;
  --suave: #6b7280;
  --muy-suave: #9aa1ac;
  --ok: #15803d; --ok-bg: #dcfce7;
  --alerta: #b45309; --alerta-bg: #fef3c7;
  --error: #c0262d; --error-bg: #fee2e2;
  --info: #1d4ed8; --info-bg: #dbeafe;
  --morado: #6d28d9; --morado-bg: #ede9fe;
  --radio: 8px;
  --sombra: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --sombra-alta: 0 10px 30px rgba(16, 24, 40, .18);
  --barra: 52px;
  font-size: 15px;
}
@media (max-width: 760px) { :root { font-size: 16px; } }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--fondo); color: var(--texto);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.45; }
body { padding-bottom: env(safe-area-inset-bottom); }
a { color: var(--marca-osc); }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }

.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round;
  stroke-linejoin: round; flex: none; vertical-align: middle; }
.ico.s { width: 16px; height: 16px; }
.ico.l { width: 26px; height: 26px; }
.ico.xl { width: 38px; height: 38px; stroke-width: 1.7; }

/* ---------- Barra superior ---------- */
#barra { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 4px;
  min-height: calc(var(--barra) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 8px 0;
  background: var(--hoja); border-bottom: 1px solid var(--borde); }
.barra-izq, .barra-der { display: flex; align-items: center; gap: 2px; min-width: 0; }
.barra-izq { flex: 0 1 auto; }
.barra-der { margin-left: auto; }
.bbtn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0;
  background: none; color: var(--texto-2); border-radius: 8px; cursor: pointer; }
.bbtn:hover { background: #f0f1f4; }
#marca { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--texto); min-width: 0; padding: 0 6px; }
#marcaLogo img { height: 30px; max-width: 110px; object-fit: contain; display: block; }
#marcaLogo .inic { width: 30px; height: 30px; border-radius: 7px; background: var(--marca); color: #fff; font-weight: 800;
  display: flex; align-items: center; justify-content: center; font-size: 13px; }
#marcaTexto { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#marcaTexto small { display: block; font-weight: 500; color: var(--suave); font-size: 12px; margin-top: -2px; }
#menuApp { display: flex; align-items: stretch; height: var(--barra); margin-left: 10px; overflow-x: auto; scrollbar-width: none; }
#menuApp a { display: flex; align-items: center; gap: 6px; padding: 0 12px; color: var(--texto-2); text-decoration: none;
  font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; }
#menuApp a:hover { color: var(--texto); background: #f7f8fa; }
#menuApp a.activo { color: var(--texto); border-bottom-color: var(--marca); font-weight: 600; }
#menuApp .globo { position: static; margin-left: 2px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--marca); color: #fff; font-weight: 700;
  font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; margin-left: 4px; }
.avatar.chico { width: 26px; height: 26px; font-size: 11px; margin: 0; cursor: default; }
.avatar.gris { background: #cdd2d9; color: #374151; }
@media (max-width: 860px) {
  #menuApp { display: none; }
  #menuMovil:not([hidden]) { display: inline-flex; }
}
@media (min-width: 861px) { #menuMovil { display: none !important; } }

#vista { max-width: 1240px; margin: 0 auto; padding: 14px 16px 24px; min-height: calc(100vh - var(--barra) - 60px); }
#vista.estrecha { max-width: 760px; }

/* ---------- Encabezado de pantalla (migas + acciones) ---------- */
.encab { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 2px 0 14px; }
.migas { flex: 1; min-width: 0; }
.migas .ruta { font-size: 13px; color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.migas .ruta a { color: var(--suave); text-decoration: none; }
.migas .ruta a:hover { color: var(--marca-osc); text-decoration: underline; }
.migas h1 { font-size: 21px; font-weight: 700; line-height: 1.25; }
.encab .acciones { display: flex; gap: 8px; flex-wrap: wrap; }
.panel-control { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.panel-control .buscar { flex: 1; min-width: 200px; position: relative; }
.panel-control .buscar .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muy-suave); }
.panel-control .buscar input { padding-left: 38px; }

/* ---------- Bloques ---------- */
.tarjeta { background: var(--hoja); border: 1px solid var(--borde); border-radius: var(--radio); padding: 16px; margin-bottom: 14px; }
.tarjeta.sin-pad { padding: 0; overflow: hidden; }
.tarjeta > h3, .titulo-bloque { font-size: 15px; font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.seccion { font-size: 12px; font-weight: 700; color: var(--suave); text-transform: uppercase; letter-spacing: .06em; margin: 20px 2px 8px;
  display: flex; align-items: center; gap: 8px; }
.fila { display: flex; gap: 10px; align-items: center; }
.fila.envuelve { flex-wrap: wrap; }
.crece { flex: 1; min-width: 0; }
.entre { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.suave { color: var(--suave); }
.peq { font-size: 13px; }
.centro { text-align: center; }
.der { text-align: right; }
.negrita { font-weight: 700; }
.nowrap { white-space: nowrap; }
.oculto { display: none !important; }
.vacio { text-align: center; color: var(--suave); padding: 36px 12px; }
.vacio .ico { color: var(--muy-suave); margin-bottom: 8px; }
.vacio b { display: block; color: var(--texto-2); font-size: 16px; margin-bottom: 4px; }
hr { border: 0; border-top: 1px solid var(--borde); margin: 14px 0; }
.cargando { text-align: center; color: var(--suave); padding: 48px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }
.columnas { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .columnas { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 14px;
  border-radius: 7px; border: 1px solid var(--borde-f); background: var(--hoja); color: var(--texto); font-size: 15px;
  font-weight: 600; cursor: pointer; text-decoration: none; font-family: inherit; line-height: 1.2; white-space: nowrap; }
.btn:hover { background: #f6f7f9; }
.btn.primario { background: var(--marca); border-color: var(--marca); color: #fff; }
.btn.primario:hover { background: var(--marca-osc); }
.btn.verde { background: #16a34a; border-color: #16a34a; color: #fff; }
.btn.whatsapp { background: #25D366; border-color: #22c55e; color: #053b1b; }
.btn.peligro { color: var(--error); border-color: #f3b4b4; }
.btn.plano { border-color: transparent; background: none; color: var(--marca-osc); padding-left: 8px; padding-right: 8px; }
.btn.chico { min-height: 32px; padding: 5px 10px; font-size: 13px; }
.btn.grande { min-height: 52px; font-size: 17px; padding: 12px 18px; }
.btn.bloque { display: flex; width: 100%; }
.btn.bloque + .btn.bloque { margin-top: 10px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn .globo { position: static; }
@media (max-width: 760px) { .btn { min-height: 44px; } .btn.chico { min-height: 36px; } }
.botones { display: flex; gap: 8px; flex-wrap: wrap; }
.botones.bloque > .btn { flex: 1; }

/* ---------- Formularios ---------- */
label.campo { display: block; margin-bottom: 14px; }
label.campo > span { display: block; font-size: 13px; font-weight: 600; color: var(--texto-2); margin-bottom: 5px; }
input, select, textarea { width: 100%; font-size: 16px; padding: 9px 11px; border: 1px solid var(--borde-f); border-radius: 7px;
  background: #fff; color: var(--texto); font-family: inherit; min-height: 42px; }
textarea { min-height: 86px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--marca) 22%, transparent); border-color: var(--marca); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; accent-color: var(--marca); }
input.placa { text-transform: uppercase; font-size: 24px; font-weight: 800; letter-spacing: 2px; text-align: center; min-height: 54px; }
input.grande { font-size: 24px; font-weight: 700; }
.dos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.tres { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .tres { grid-template-columns: 1fr 1fr; } }
.check { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; cursor: pointer; font-weight: 500; }
.ayuda { font-size: 13px; color: var(--suave); margin-top: -8px; margin-bottom: 12px; }

/* ---------- Chips y segmentos ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--borde-f); background: #fff; border-radius: 99px;
  padding: 6px 13px; font-size: 14px; font-weight: 500; cursor: pointer; color: var(--texto); font-family: inherit; text-decoration: none; }
.chip.si { background: var(--marca); border-color: var(--marca); color: #fff; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips.scroll .chip { white-space: nowrap; }
.seg { display: inline-flex; border: 1px solid var(--borde-f); border-radius: 7px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; padding: 7px 11px; cursor: pointer; color: var(--suave); display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 14px; }
.seg button + button { border-left: 1px solid var(--borde); }
.seg button.si { background: var(--marca-suave); color: var(--marca-osc); font-weight: 600; }

/* ---------- Etiquetas de estado ---------- */
.estado { display: inline-flex; align-items: center; gap: 4px; border-radius: 99px; padding: 2px 9px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.e-recibida, .e-solicitado, .e-gris, .e-borrador { background: #eef0f3; color: #4b5563; }
.e-diagnostico, .e-cotizado, .e-info, .e-confirmada { background: var(--info-bg); color: var(--info); }
.e-esperando_aprobacion, .e-pedido, .e-morado { background: var(--morado-bg); color: var(--morado); }
.e-esperando_repuesto, .e-en_camino, .e-alerta, .e-pendiente { background: var(--alerta-bg); color: var(--alerta); }
.e-en_reparacion { background: #ffedd5; color: #c2410c; }
.e-lista, .e-recibido, .e-ok, .e-atendida, .e-pagada { background: var(--ok-bg); color: var(--ok); }
.e-entregada { background: #e5e7eb; color: #374151; }
.e-cancelada, .e-cancelado, .e-error, .e-anulada { background: var(--error-bg); color: var(--error); }
.globo { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 99px; background: var(--marca); color: #fff; font-size: 12px; font-weight: 700; }
.globo.rojo { background: var(--error); }

/* ---------- Inicio: accesos y cuadrícula de apps ---------- */
.saludo { font-size: 22px; font-weight: 700; margin: 6px 2px 2px; }
.saludo + .suave { margin: 0 2px 16px; }
.accesos { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 26px; }
.acceso { display: flex; align-items: center; gap: 12px; padding: 13px 14px; background: var(--hoja); border: 1px solid var(--borde);
  border-radius: 10px; text-decoration: none; color: var(--texto); font-weight: 600; box-shadow: var(--sombra); position: relative; }
.acceso:hover { border-color: var(--marca-borde); }
.acceso .ico { color: var(--marca); }
.acceso.principal { background: var(--marca); border-color: var(--marca); color: #fff; }
.acceso.principal .ico { color: #fff; }
.acceso .globo { margin-left: auto; }
.acceso.principal .globo { background: #fff; color: var(--marca-osc); }
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 20px 10px; max-width: 860px; margin: 0 auto; }
.app { display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; color: var(--texto);
  font-size: 13.5px; font-weight: 500; text-align: center; position: relative; padding: 4px; border-radius: 12px; }
.app:hover .app-ico { transform: translateY(-2px); box-shadow: var(--sombra-alta); }
.app-ico { width: 68px; height: 68px; border-radius: 16px; display: flex; align-items: center; justify-content: center; color: #fff;
  box-shadow: var(--sombra); transition: transform .15s, box-shadow .15s; position: relative; }
.app-ico .ico { width: 34px; height: 34px; stroke-width: 1.8; }
.app .globo { position: absolute; top: -4px; right: calc(50% - 44px); background: var(--error); border: 2px solid var(--fondo); }
@media (max-width: 520px) { .apps { grid-template-columns: repeat(4, 1fr); gap: 18px 4px; } .app-ico { width: 60px; height: 60px; border-radius: 14px; }
  .app-ico .ico { width: 30px; height: 30px; } .app { font-size: 12.5px; } .app .globo { right: calc(50% - 38px); } }

/* ---------- Kanban ---------- */
.kanban { display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; padding-bottom: 10px; scroll-snap-type: x proximity; }
.kcol { flex: 1 0 205px; min-width: 0; scroll-snap-align: start; }
.kcol.vacia { flex: 0 0 150px; }
.kcol.vacia .kcol-tit { color: var(--muy-suave); }
.kcol-tit { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 8px; font-weight: 700; font-size: 14px; }
.kcol-tit .n { color: var(--suave); font-weight: 600; }
.kcol-tit .barra-c { height: 3px; border-radius: 3px; background: var(--borde); margin-top: 6px; }
.kcard { display: block; background: var(--hoja); border: 1px solid var(--borde); border-radius: 8px; padding: 11px 12px; margin-bottom: 8px;
  text-decoration: none; color: inherit; box-shadow: var(--sombra); position: relative; }
.kcard:hover { border-color: var(--marca-borde); }
.kcard .k1 { display: flex; gap: 10px; }
.kcard img.k-foto { width: 54px; height: 54px; border-radius: 7px; object-fit: cover; flex: none; background: #eef0f3; }
.kcard .k-sinfoto { width: 54px; height: 54px; border-radius: 7px; background: #eef0f3; display: flex; align-items: center; justify-content: center; color: var(--muy-suave); flex: none; }
.kcard .k-pie { display: flex; align-items: center; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.kcard .k-pie .avatar { margin-left: auto; }
.kcard.nueva { border-left: 3px solid var(--marca); }
.placa-txt { font-size: 17px; font-weight: 800; letter-spacing: .5px; }
@media (max-width: 760px) { .kcol, .kcol.vacia { flex: 0 0 84vw; } }

/* ---------- Lista (tabla) ---------- */
.tabla { width: 100%; border-collapse: collapse; background: var(--hoja); font-size: 14.5px; }
.tabla th { text-align: left; font-size: 12.5px; color: var(--suave); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--borde); background: #fafbfc; white-space: nowrap; }
.tabla td { padding: 10px 12px; border-bottom: 1px solid #eef0f3; vertical-align: middle; }
.tabla tr.clic { cursor: pointer; }
.tabla tr.clic:hover td { background: #f8f9fb; }
.tabla td.num, .tabla th.num { text-align: right; white-space: nowrap; }
.tabla tfoot td { font-weight: 700; background: #fafbfc; }
.tabla-env { border: 1px solid var(--borde); border-radius: var(--radio); overflow: auto; background: var(--hoja); margin-bottom: 14px; }
@media (max-width: 760px) {
  .tabla.responsiva thead { display: none; }
  .tabla.responsiva tr { display: block; border-bottom: 1px solid var(--borde); padding: 10px 12px; }
  .tabla.responsiva td { display: flex; justify-content: space-between; gap: 10px; border: 0; padding: 2px 0; }
  .tabla.responsiva td::before { content: attr(data-t); color: var(--suave); font-size: 13px; flex: none; }
  .tabla.responsiva td > span { text-align: right; min-width: 0; }
  .tabla.responsiva td.prin > span { text-align: left; }
  .tabla.responsiva td[data-t=""]::before { content: none; }
  .tabla.responsiva td.prin { font-weight: 700; font-size: 15.5px; }
  .tabla.responsiva td.prin::before { content: none; }
}

/* ---------- Líneas (filas simples) ---------- */
.linea { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #eef0f3; text-decoration: none; color: inherit; }
.linea:last-child { border-bottom: 0; }
.linea .monto { font-weight: 700; white-space: nowrap; }
a.linea:hover { background: #fafbfc; }
.lista-lineas { padding: 2px 16px; }
.quitar { background: none; border: 0; color: var(--muy-suave); padding: 6px; cursor: pointer; border-radius: 6px; display: inline-flex; }
.quitar:hover { background: #f1f2f4; color: var(--error); }

/* ---------- Formulario estilo Odoo ---------- */
.form-barra { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.form-barra .botones { flex: 1; }
@media (max-width: 760px) { .form-barra .botones { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; } .form-barra .estados { width: 100%; } }
.estados { display: flex; overflow-x: auto; scrollbar-width: none; border-radius: 7px; max-width: 100%; }
.estados button { position: relative; border: 1px solid var(--borde-f); border-left: 0; background: #fff; color: var(--suave); font: inherit; font-size: 13px;
  font-weight: 600; padding: 7px 14px 7px 20px; white-space: nowrap; cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%, 9px 50%); margin-left: -7px; }
.estados button:first-child { clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%); margin-left: 0; padding-left: 13px; border-left: 1px solid var(--borde-f); border-radius: 7px 0 0 7px; }
.estados button.hecho { color: var(--texto-2); background: #f4f5f7; }
.estados button.si { background: var(--marca); color: #fff; border-color: var(--marca); }
.estados button:disabled { cursor: default; }
.hoja-doc { background: var(--hoja); border: 1px solid var(--borde); border-radius: 10px; box-shadow: var(--sombra); padding: 20px 22px; margin-bottom: 16px; }
@media (max-width: 760px) { .hoja-doc { padding: 16px 14px; border-radius: 8px; } }
.doc-tit { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.doc-tit img, .doc-tit .k-sinfoto { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; flex: none; background: #eef0f3;
  display: flex; align-items: center; justify-content: center; color: var(--muy-suave); cursor: pointer; }
.doc-tit h2 { font-size: 24px; font-weight: 800; letter-spacing: .5px; }
.campos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 28px; }
@media (max-width: 760px) { .campos { grid-template-columns: minmax(0, 1fr); } }
.cmp { display: grid; grid-template-columns: 140px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px dashed #eef0f3; align-items: baseline; }
.cmp > span:first-child { color: var(--suave); font-size: 13.5px; font-weight: 500; }
.cmp > span:last-child { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 760px) { .cmp { grid-template-columns: 120px 1fr; } }
.pestanas { display: flex; gap: 2px; border-bottom: 1px solid var(--borde); margin: 18px 0 14px; overflow-x: auto; scrollbar-width: none; }
.pestanas button { border: 0; background: none; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--suave); cursor: pointer;
  border-bottom: 2px solid transparent; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.pestanas button.si { color: var(--texto); border-bottom-color: var(--marca); }
.totales { margin-left: auto; max-width: 340px; }
.totales .entre { padding: 4px 0; }
.totales .grande { font-size: 20px; font-weight: 800; }

/* ---------- Bitácora (chatter) ---------- */
.bitacora .nota-form { display: flex; gap: 8px; margin-bottom: 14px; }
.bitacora .nota-form input { flex: 1; }
.evento { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f1f2f4; }
.evento:last-child { border-bottom: 0; }
.evento .quien { font-weight: 600; font-size: 14px; }
.evento .cuando { color: var(--muy-suave); font-size: 12.5px; margin-left: 6px; font-weight: 400; }
.evento .que { font-size: 14px; color: var(--texto-2); white-space: pre-wrap; }
.evento.nota .que { background: #fffbea; border: 1px solid #fde68a; padding: 6px 9px; border-radius: 7px; margin-top: 3px; color: var(--texto); }

/* ---------- Indicadores ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--hoja); border: 1px solid var(--borde); border-radius: var(--radio); padding: 14px 16px; }
.kpi .v { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.kpi .t { color: var(--suave); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi.ok .v { color: var(--ok); } .kpi.mal .v { color: var(--error); }
.barras .b { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center; padding: 5px 0; font-size: 14px; }
.barras .b .pista { height: 10px; background: #eef0f3; border-radius: 6px; overflow: hidden; }
.barras .b .pista i { display: block; height: 100%; background: var(--marca); border-radius: 6px; }

/* ---------- Fotos ---------- */
.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.foto { position: relative; aspect-ratio: 1; border: 2px dashed var(--borde-f); border-radius: 10px; background: #fff; display: flex;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px; overflow: hidden; cursor: pointer; font-weight: 600; font-size: 13.5px;
  color: var(--texto-2); text-align: center; padding: 4px; }
.foto .ico { color: var(--muy-suave); }
.foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.foto .etq { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.58); color: #fff; font-size: 12px; padding: 3px; }
.foto.lista { border: 2px solid #16a34a; }
.foto .marca-ok { position: absolute; top: 6px; right: 6px; background: #16a34a; color: #fff; border-radius: 99px; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center; z-index: 2; }
.foto input { display: none; }
.foto.subiendo::after { content: "Subiendo…"; position: absolute; inset: 0; background: rgba(255,255,255,.85); display: flex; align-items: center; justify-content: center; z-index: 3; }
.mini { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; cursor: pointer; }

/* ---------- Firma ---------- */
canvas.firma { width: 100%; height: 220px; background: #fff; border: 2px dashed var(--borde-f); border-radius: 10px; touch-action: none; display: block; }

/* ---------- Hoja inferior / diálogo ---------- */
#hoja { position: fixed; inset: 0; z-index: 50; background: rgba(17, 24, 39, .45); display: flex; align-items: flex-end; justify-content: center; }
#hoja[hidden] { display: none; }
#hoja .panel { background: var(--fondo); width: 100%; max-width: 620px; max-height: 90vh; overflow-y: auto; border-radius: 16px 16px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); box-shadow: var(--sombra-alta); }
#hoja .panel-tit { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
#hoja .panel-tit h2 { font-size: 18px; }
@media (min-width: 761px) { #hoja { align-items: center; } #hoja .panel { border-radius: 12px; max-height: 84vh; } }
.menu-lista a, .menu-lista button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 12px; border: 0; background: var(--hoja);
  border-bottom: 1px solid var(--borde); font: inherit; font-weight: 600; color: var(--texto); text-decoration: none; cursor: pointer; text-align: left; }
.menu-lista { border: 1px solid var(--borde); border-radius: 10px; overflow: hidden; }
.menu-lista > :last-child { border-bottom: 0; }
.menu-lista .ico { color: var(--suave); }
.menu-lista .globo { margin-left: auto; }

/* ---------- Aviso ---------- */
#aviso { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(150%);
  background: #1f2430; color: #fff; padding: 11px 18px; border-radius: 10px; font-weight: 600; z-index: 60; max-width: 92vw;
  transition: transform .25s, visibility .25s; text-align: center; visibility: hidden; box-shadow: var(--sombra-alta); }
#aviso.ver { transform: translateX(-50%) translateY(0); visibility: visible; }
#aviso.error { background: var(--error); }

/* ---------- Entrada (login) ---------- */
.login { max-width: 400px; margin: 7vh auto 0; }
.login .logo-grande { display: flex; justify-content: center; margin-bottom: 14px; }
.login .logo-grande img { max-height: 90px; max-width: 240px; object-fit: contain; }
.login .logo-grande .inic { width: 72px; height: 72px; border-radius: 16px; background: var(--marca); color: #fff; font-size: 28px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; }
.login h1 { text-align: center; font-size: 22px; margin-bottom: 4px; }
body.sin-barra #barra { display: none; }

/* ---------- Visor de PDF ---------- */
.pdf-hojas img { display: block; width: 100%; max-width: 760px; margin: 12px auto 0; height: auto; background: #fff; border-radius: 6px; box-shadow: var(--sombra); }
@media print {
  @page { margin: 0; }
  #barra, #aviso, #hoja, .pdf-acciones, .encab { display: none !important; }
  body, #vista { background: #fff !important; padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .pdf-hojas img { margin: 0; max-width: none; border-radius: 0; box-shadow: none; page-break-after: always; }
}

/* ---------- Escáner de código de barras ---------- */
.escaner { position: relative; background: #000; border-radius: 10px; overflow: hidden; aspect-ratio: 4/3; }
.escaner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.escaner .mira { position: absolute; left: 10%; right: 10%; top: 40%; height: 20%; border: 2px solid rgba(255,255,255,.9); border-radius: 8px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }

/* Pie de página: marca del desarrollador */
#pie { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
  font-size: 11.5px; color: var(--muy-suave); }
#pie b { font-weight: 600; color: var(--suave); }
#pie img { height: 16px; width: auto; opacity: .85; }
@media print { #pie { display: none; } }
body.sin-barra #pie { display: none; }
