/* Panel de oficina al estilo Linear, en blanco y negro: barra lateral sobre el fondo y la vista
   en un marco con borde, cabecera fina con migas, barra de vista con pestañas y listas densas. */
html, body { height: 100%; overflow: hidden; }
.app { display: grid; grid-template-columns: 232px 1fr; height: 100vh; }

/* — barra lateral — */
.sb { display: flex; flex-direction: column; padding: 8px 8px 10px; min-width: 0; }
.sb-top { display: flex; align-items: center; gap: 4px; padding: 4px 2px 10px; }
.espacio { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: var(--radio-s); font-weight: 600; flex: 1; min-width: 0; }
.sb-ico { width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--radio-s); border: 0; background: transparent; color: var(--texto-2); cursor: pointer; }
.sb-ico:hover { background: var(--bg-hover); color: var(--texto); }
.sb-ico.borde { border: 1px solid var(--borde-fuerte); background: var(--bg-elev); }
.sb-ico .icono { width: 15px; height: 15px; }
.sb-buscar { display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 8px; margin: 0 0 6px; border-radius: var(--radio-s); border: 1px solid var(--borde);
  background: var(--bg-panel); color: var(--texto-3); cursor: pointer; width: 100%; text-align: left; }
.sb-buscar:hover { border-color: var(--borde-fuerte); color: var(--texto-2); }
.sb-buscar .icono { width: 14px; height: 14px; } .sb-buscar kbd { margin-left: auto; }
.menu { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; flex: 1; }
.menu .grupo { font-size: 11.5px; color: var(--texto-3); margin: 14px 8px 4px; font-weight: 500; }
.menu a { display: flex; align-items: center; gap: 9px; height: 28px; padding: 0 8px; border-radius: var(--radio-s); color: var(--texto-2); font-weight: 500; }
.menu a .icono { width: 15px; height: 15px; color: var(--texto-3); }
.menu a:hover { background: var(--bg-hover); color: var(--texto); }
.menu a.activo { background: var(--bg-sel); color: var(--texto); }
.menu a.activo .icono { color: var(--texto); }
.menu a .cuenta { margin-left: auto; color: var(--texto-3); font-size: 12px; font-weight: 500; }
.sb-pie { display: flex; flex-direction: column; gap: 1px; padding-top: 8px; }
.menu-btn { display: flex; align-items: center; gap: 9px; height: 28px; padding: 0 8px; border-radius: var(--radio-s); border: 0; background: transparent;
  color: var(--texto-2); cursor: pointer; font-weight: 500; text-align: left; width: 100%; }
.menu-btn:hover { background: var(--bg-hover); color: var(--texto); }
.menu-btn .icono { width: 15px; height: 15px; color: var(--texto-3); }
.menu-btn kbd { margin-left: auto; }
.yo { display: flex; align-items: center; gap: 8px; padding: 6px 8px; margin-top: 4px; border-top: 1px solid var(--borde); padding-top: 10px; }

/* — marco de la vista — */
.marco { margin: 8px 8px 8px 0; background: var(--bg-panel); border: 1px solid var(--borde); border-radius: 10px; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
#vista { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.tb { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--borde); flex: none; }
.migas { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 500; }
.migas a { color: var(--texto-2); } .migas a:hover { color: var(--texto); }
.migas .sep { color: var(--texto-3); font-weight: 400; }
.migas .icono { width: 15px; height: 15px; color: var(--texto-3); }
.migas .ultimo { color: var(--texto); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb .acciones { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.vb { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 12px 6px 14px; border-bottom: 1px solid var(--borde); flex: none; flex-wrap: wrap; }
.vb .buscador { width: 240px; } .vb .buscador input { height: 26px; }
.vb select { height: 26px; width: auto; padding: 0 6px; font-size: 12.5px; }
.vb .der { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.cont { flex: 1; overflow: auto; min-height: 0; }
.cont.pad { padding: 22px 28px 60px; }
.sub { color: var(--texto-3); }

/* — listas — */
.g-cab { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 16px 0 18px; background: var(--bg-sutil); border-bottom: 1px solid var(--borde);
  position: sticky; top: 0; z-index: 2; font-weight: 500; }
.g-cab .n { color: var(--texto-3); font-weight: 400; }
.g-cab .der { margin-left: auto; }
.l { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 4px 16px 4px 18px; border-bottom: 1px solid var(--borde); cursor: pointer; }
.l:hover { background: var(--bg-hover); }
.l .id { font-size: 12px; color: var(--texto-3); width: 76px; flex: none; font-variant-numeric: tabular-nums; }
.l .tit { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; overflow: hidden; }
.l .tit b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; max-width: 70%; }
.l .tit span { color: var(--texto-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l .meta { display: flex; align-items: center; gap: 8px; flex: none; color: var(--texto-3); font-size: 12px; }
.l .imp { width: 96px; text-align: right; font-variant-numeric: tabular-nums; flex: none; font-weight: 500; }
.l .fecha { width: 70px; text-align: right; flex: none; color: var(--texto-3); font-size: 12px; }
.l .acc { display: flex; gap: 4px; }
.l .acc.hover { opacity: 0; transition: opacity .1s; } .l:hover .acc.hover { opacity: 1; }
.l .foto { width: 26px; height: 26px; }
.mini-av { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 8.5px; font-weight: 600; flex: none;
  color: var(--texto-2); background: var(--bg-sel); border: 1px solid var(--borde-fuerte); }

/* — inicio — */
.franja { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--borde); }
.franja > div { padding: 16px 20px; border-right: 1px solid var(--borde); cursor: pointer; }
.franja > div:last-child { border-right: 0; }
.franja > div:hover { background: var(--bg-hover); }
.franja .eti { color: var(--texto-3); font-size: 12px; }
.franja .val { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.franja .fdet { color: var(--texto-3); font-size: 12px; margin-top: 2px; }
.sube { color: var(--texto); font-weight: 500; } .baja { color: var(--rojo); font-weight: 500; }
.dos { display: grid; grid-template-columns: minmax(0, 1fr) 380px; }
.dos > .izq { border-right: 1px solid var(--borde); min-width: 0; }
.dos > .dcha { min-width: 0; }
.bloque { border-bottom: 1px solid var(--borde); }
.bloque > .t { display: flex; align-items: center; gap: 8px; padding: 14px 18px 8px; font-weight: 500; }
.bloque > .t .der { margin-left: auto; }
.bloque > .c { padding: 0 18px 16px; }

/* gráfico: una sola serie, gris; hoy en el tono fuerte */
.grafico { position: relative; }
.grafico svg { display: block; width: 100%; height: 150px; overflow: visible; }
.grafico .eje { font-size: 10.5px; fill: var(--texto-3); }
.grafico .rej { stroke: var(--borde); stroke-width: 1; }
.grafico .barra-g { fill: var(--borde-fuerte); }
.grafico .barra-g.hoy { fill: var(--texto); }
.grafico .barra-g.encima { fill: var(--texto-2); }
.grafico .bocadillo { position: absolute; pointer-events: none; background: var(--bg-elev); color: var(--texto); padding: 5px 8px; border-radius: 6px; font-size: 12px;
  white-space: nowrap; transform: translate(-50%, -100%); margin-top: -8px; box-shadow: var(--sombra-flot); }
.barras-h { display: flex; flex-direction: column; gap: 9px; }
.barras-h .b { display: grid; grid-template-columns: minmax(100px, 170px) 1fr 84px; gap: 10px; align-items: center; font-size: 12.5px; }
.barras-h .pista { height: 6px; background: var(--bg-sel); border-radius: 3px; overflow: hidden; }
.barras-h .relleno { height: 100%; background: var(--texto); border-radius: 0 3px 3px 0; }
.barras-h .nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--texto-2); }
.progreso { height: 4px; background: var(--bg-sel); border-radius: 2px; overflow: hidden; }
.progreso > i { display: block; height: 100%; background: var(--texto); border-radius: 2px; }

/* — detalle con panel de propiedades — */
.det { display: grid; grid-template-columns: minmax(0, 1fr) 300px; min-height: 100%; }
.det > .principal { padding: 28px 36px 60px; min-width: 0; }
.det > .props { border-left: 1px solid var(--borde); padding: 14px 14px 40px; }
.det h1 { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.props .sec { font-size: 12px; color: var(--texto-3); font-weight: 500; margin: 18px 6px 6px; }
.props .sec:first-child { margin-top: 2px; }
.prop { display: grid; grid-template-columns: 96px 1fr; align-items: center; min-height: 32px; padding: 0 6px; border-radius: var(--radio-s); gap: 6px; }
.prop > span { color: var(--texto-3); font-size: 12.5px; }
.prop > div { min-width: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; }
.prop select { border-color: transparent; background: transparent; height: 28px; padding: 0 4px; box-shadow: none; }
.prop select:hover { background: var(--bg-hover); }
.acciones-v { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; padding: 0 6px; }
.acciones-v .btn { justify-content: flex-start; }
.seccion { margin-top: 30px; }
.seccion > .t { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 500; }
.seccion > .t .der { margin-left: auto; }
.caja-l { border: 1px solid var(--borde); border-radius: var(--radio); overflow: hidden; }
.caja-l > .l:last-child, .caja-l .tabla tr:last-child td { border-bottom: 0; }
.totales { margin-left: auto; width: min(300px, 100%); margin-top: 12px; }
.totales .t { display: flex; justify-content: space-between; padding: 3px 0; font-variant-numeric: tabular-nums; color: var(--texto-2); }
.totales .t.grande { font-size: 15px; font-weight: 600; color: var(--texto); border-top: 1px solid var(--borde); margin-top: 6px; padding-top: 8px; }
.actividad { list-style: none; margin: 0; padding: 0; position: relative; }
.actividad::before { content: ''; position: absolute; left: 6px; top: 10px; bottom: 10px; width: 1px; background: var(--borde); }
.actividad li { display: flex; gap: 10px; align-items: baseline; padding: 5px 0; color: var(--texto-2); position: relative; }
.actividad li::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--borde-fuerte); margin: 0 3px; flex: none; position: relative; top: -1px; box-shadow: 0 0 0 3px var(--bg-panel); }
.actividad li b { color: var(--texto); font-weight: 500; }
.actividad li .tenue { margin-left: auto; font-size: 12px; white-space: nowrap; }
.firma-img { max-width: 240px; max-height: 100px; border: 1px solid var(--borde); border-radius: var(--radio); background: #fff; }
.boton-estado { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px; margin-left: -6px; border-radius: var(--radio-s); border: 0; background: transparent; cursor: pointer; }
.boton-estado:hover { background: var(--bg-hover); }

/* menú flotante */
.menu-flot { position: fixed; z-index: 60; background: var(--bg-elev); border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra-flot); padding: 4px; min-width: 210px; }
.menu-flot button { display: flex; align-items: center; gap: 8px; width: 100%; height: 30px; padding: 0 8px; border: 0; background: transparent; border-radius: var(--radio-s); cursor: pointer; text-align: left; }
.menu-flot button:hover { background: var(--bg-sel); }
.menu-flot button .ok { margin-left: auto; color: var(--texto-2); }

/* — tarifas — */
.reglas { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--borde); }
.reglas > div { padding: 14px 18px; border-right: 1px solid var(--borde); }
.reglas > div:last-child { border-right: 0; }
.reglas .n { font-size: 11px; color: var(--texto-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.reglas h3 { margin: 2px 0; font-weight: 500; }
.tarifas-tira { display: flex; border-bottom: 1px solid var(--borde); overflow-x: auto; }
.tarifas-tira > div { padding: 12px 18px; border-right: 1px solid var(--borde); min-width: 180px; }
.tarifas-tira .margen { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--texto-3); }
.tarifas-tira .margen input { width: 64px; height: 26px; text-align: right; }
.matriz td input { width: 80px; height: 26px; text-align: right; padding: 0 7px; font-variant-numeric: tabular-nums; }
.matriz td input.calc { color: var(--texto-3); border-color: transparent; background: transparent; }
.matriz td input.calc:hover { border-color: var(--borde-fuerte); }
.matriz td input.fijo { color: var(--texto); font-weight: 600; border-color: var(--texto-3); background: var(--bg-sel); }

/* — constructor de pedido — */
.constructor { display: grid; grid-template-columns: minmax(0, 1fr) 360px; height: 100%; min-height: 0; }
.constructor > .izq { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--borde); }
.constructor .catalogo-lista { flex: 1; overflow: auto; }
.prod-fila { display: flex; gap: 12px; align-items: center; padding: 6px 16px; border-bottom: 1px solid var(--borde); min-height: 44px; }
.prod-fila:hover { background: var(--bg-hover); }
.cant { display: inline-flex; align-items: center; border: 1px solid var(--borde-fuerte); border-radius: var(--radio-s); overflow: hidden; background: var(--bg-panel); }
.cant button { width: 26px; height: 26px; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; color: var(--texto-2); }
.cant button:hover { background: var(--bg-hover); color: var(--texto); }
.cant button .icono { width: 13px; height: 13px; }
.cant input { width: 48px; height: 26px; border: 0; border-radius: 0; text-align: center; padding: 0; font-weight: 500; background: transparent; }
.cant input:focus { box-shadow: none; }
.cant.con input { color: var(--texto); font-weight: 600; } .cant.con { border-color: var(--texto-3); }
.carrito { display: flex; flex-direction: column; min-height: 0; }
.carrito .lineas { flex: 1; overflow: auto; padding: 4px 14px; }
.carrito .linea { display: flex; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--borde); font-size: 12.5px; }
.carrito .linea input { width: 52px; height: 24px; padding: 0 6px; font-size: 12px; }
.carrito .pie-c { border-top: 1px solid var(--borde); padding: 12px 14px; }
.carrito .totales { width: 100%; margin: 0 0 10px; }

/* — tablero de tareas — */
.tablero { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 10px; padding: 12px; align-items: start; }
.col-t { background: var(--bg-sutil); border-radius: 10px; padding: 6px; border: 1px solid var(--borde); }
.col-t > .cab { display: flex; align-items: center; gap: 8px; padding: 6px 6px 8px; font-weight: 500; }
.col-t > .cab .n { color: var(--texto-3); font-weight: 400; }
.tj { background: var(--bg-panel); border: 1px solid var(--borde); border-radius: var(--radio); padding: 9px 10px; margin-bottom: 6px; }
.tj:hover { border-color: var(--borde-fuerte); }
.tj .id { font-size: 11.5px; color: var(--texto-3); display: flex; justify-content: space-between; }
.tj .tt { font-weight: 500; margin: 3px 0 8px; }
.tj .mt { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--texto-3); font-size: 12px; }
.tj .acc { display: flex; gap: 4px; margin-top: 8px; }

/* — formularios en página — */
.form-p { max-width: 760px; }
.form-p .sec-t { font-weight: 500; margin: 28px 0 8px; }
.form-p .sec-t:first-child { margin-top: 0; }
.ajuste-l { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--borde); }
.ajuste-l:last-child { border-bottom: 0; }
.ajuste-l b { font-weight: 500; }
.interruptor { appearance: none; width: 30px; height: 18px; border-radius: 9px; background: var(--borde-fuerte); position: relative; cursor: pointer; flex: none; transition: background .15s; margin: 1px 0 0; }
.interruptor::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg-panel); transition: transform .15s; }
.interruptor:checked { background: var(--texto); } .interruptor:checked::after { transform: translateX(12px); }

/* — paleta ⌘K — */
.velo.arriba { place-items: start center; padding-top: 14vh; }
.paleta { width: min(620px, 100%); background: var(--bg-elev); border: 1px solid var(--borde); border-radius: 12px; box-shadow: var(--sombra-flot); overflow: hidden; }
.paleta .entrada-p { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--borde); }
.paleta .entrada-p .icono { color: var(--texto-3); }
.paleta input { border: 0 !important; box-shadow: none !important; background: transparent; height: 50px; font-size: 15px; padding: 0; }
.paleta .res { max-height: 380px; overflow: auto; padding: 6px; }
.paleta .gr { font-size: 11.5px; color: var(--texto-3); padding: 8px 10px 4px; }
.paleta .it { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--radio-s); cursor: pointer; }
.paleta .it .icono, .paleta .it .estado-ico { color: var(--texto-3); width: 15px; height: 15px; }
.paleta .it.act { background: var(--bg-sel); }
.paleta .it .tenue { margin-left: auto; font-size: 12px; white-space: nowrap; }
.paleta .pie-p { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--borde); color: var(--texto-3); font-size: 12px; }

/* — asistente — */
.ia-cajon { position: fixed; right: 8px; top: 8px; bottom: 8px; width: min(420px, calc(100vw - 16px)); z-index: 45; background: var(--bg-elev);
  border: 1px solid var(--borde); border-radius: 10px; box-shadow: var(--sombra-flot); display: flex; flex-direction: column; overflow: hidden; animation: entrar .16s; }
@keyframes entrar { from { transform: translateX(12px); opacity: 0; } }
.ia-cajon > .cab { display: flex; justify-content: space-between; align-items: center; height: 44px; padding: 0 8px 0 14px; border-bottom: 1px solid var(--borde); font-weight: 500; }
.ia-mensajes { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.ia-msg { line-height: 1.5; }
.ia-msg.user { align-self: flex-end; background: var(--bg-sel); padding: 8px 11px; border-radius: 10px; max-width: 88%; white-space: pre-wrap; }
.ia-msg p, .ia-texto p { margin: 0 0 6px; } .ia-msg ul, .ia-texto ul { margin: 4px 0 6px; padding-left: 18px; } .ia-msg li, .ia-texto li { margin: 2px 0; }
.ia-msg b, .ia-texto b { font-weight: 600; }
.ia-hola p { margin-top: 0; color: var(--texto-2); }
.sug { display: flex; width: 100%; align-items: center; gap: 8px; min-height: 32px; padding: 6px 10px; border: 1px solid var(--borde); border-radius: var(--radio-s);
  background: transparent; cursor: pointer; text-align: left; color: var(--texto-2); margin-bottom: 6px; }
.sug:hover { background: var(--bg-hover); color: var(--texto); }
.ia-escribir { padding: 10px; border-top: 1px solid var(--borde); }
.ia-escribir .caja-esc { border: 1px solid var(--borde-fuerte); border-radius: var(--radio); background: var(--bg-panel); padding: 8px 8px 6px 10px; }
.ia-escribir textarea { border: 0 !important; box-shadow: none !important; padding: 0; min-height: 40px; background: transparent; resize: none; }
.ia-pensando { display: flex; align-items: center; gap: 10px; color: var(--texto-3); padding: 6px 0; }
.ia-puntos { display: inline-flex; gap: 4px; } .ia-puntos i { width: 5px; height: 5px; border-radius: 50%; background: var(--texto-2); animation: latir 1s infinite; }
.ia-puntos i:nth-child(2) { animation-delay: .15s; } .ia-puntos i:nth-child(3) { animation-delay: .3s; }
@keyframes latir { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
pre.leido { white-space: pre-wrap; background: var(--bg-sutil); border: 1px solid var(--borde); border-radius: var(--radio); padding: 10px; font-size: 12px; }
.rojo-txt { color: var(--rojo); }

@media (max-width: 1100px) {
  .dos, .det, .constructor { grid-template-columns: 1fr; }
  .dos > .izq, .constructor > .izq { border-right: 0; }
  .det > .props { border-left: 0; border-top: 1px solid var(--borde); }
  .franja { grid-template-columns: repeat(2, 1fr); }
  .tablero { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  html, body { overflow: auto; height: auto; }
  .app { grid-template-columns: 1fr; height: auto; }
  .sb { flex-direction: row; align-items: center; padding: 6px 8px; overflow-x: auto; }
  .sb-top { padding: 0; } .sb-buscar, .yo, .menu .grupo { display: none; }
  .menu { flex-direction: row; overflow-x: auto; flex: none; }
  .sb-pie { flex-direction: row; padding: 0; }
  .marco { margin: 0; border-radius: 0; border-width: 1px 0 0; }
  .l .meta, .l .fecha { display: none; }
  .det > .principal { padding: 18px 16px 40px; }
  .reglas { grid-template-columns: 1fr; }
}
@media print { .sb, .tb .acciones, .ia-cajon { display: none !important; } html, body { overflow: visible; height: auto; } }

/* ═════════ Modo fácil: pensado para alguien de oficina sin experiencia ═════════
   Letra más grande, filas de dos líneas con frases, un botón con el siguiente paso,
   una frase de ayuda en cada pantalla y nada de códigos ni atajos a la vista. */
.app { font-size: 14px; }
.app .btn { height: 32px; padding: 0 12px; font-size: 13.5px; }
.app .btn.grande { height: 40px; padding: 0 18px; font-size: 14.5px; }
.app .btn.mini { height: 28px; font-size: 13px; }
.app input[type=text], .app input[type=number], .app input[type=search], .app input[type=email], .app input[type=tel], .app input[type=date], .app input[type=password], .app select { height: 34px; font-size: 14px; }
.sb-nuevo { width: 100%; height: 36px; margin: 0 0 8px; justify-content: center; font-size: 14px; }
.menu a { height: 32px; font-size: 14px; }
.menu a .cuenta { background: var(--texto); color: var(--bg-panel); border-radius: 999px; padding: 0 7px; font-size: 11.5px; font-weight: 600; line-height: 18px; }
.menu a .cuenta:empty { display: none; }
.tb { height: 52px; } .migas { font-size: 15px; }
.ayuda { display: flex; align-items: center; gap: 8px; padding: 10px 20px; border-bottom: 1px solid var(--borde); color: var(--texto-2); background: var(--bg-sutil); font-size: 13.5px; }
.ayuda .icono { color: var(--texto-3); }
.vb { min-height: 52px; } .vb .buscador { width: 300px; }
.filtro { height: 32px; font-size: 13.5px; padding: 0 12px; }

/* filas de dos líneas */
.l2 { display: flex; align-items: center; gap: 14px; min-height: 62px; padding: 10px 20px; border-bottom: 1px solid var(--borde); cursor: pointer; }
.l2:hover { background: var(--bg-hover); }
.l2 .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.l2 .tx b { font-weight: 500; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.l2 .tx span { color: var(--texto-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.l2 .dr { display: flex; align-items: center; gap: 12px; flex: none; }
.l2 .dinero { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 90px; text-align: right; }
.l2 .estado-ico { width: 18px; height: 18px; }
.l2 .foto { width: 40px; height: 40px; }
.l2 .mini-av { width: 32px; height: 32px; font-size: 11px; }
.etiqueta { font-size: 12.5px; color: var(--texto-2); white-space: nowrap; }
.etiqueta.mal { color: var(--rojo); font-weight: 500; }
.g-cab { height: 40px; font-size: 13.5px; padding: 0 20px; }

/* inicio */
.inicio { padding: 26px 32px 60px; max-width: 1100px; }
.inicio h1 { font-size: 24px; } .inicio .hoy { color: var(--texto-3); margin-top: 2px; }
.inicio h2 { font-size: 15px; font-weight: 600; margin: 30px 0 12px; }
.que-hacer { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border: 1px solid var(--borde); border-radius: 10px; background: var(--bg-panel); cursor: pointer; text-align: left; color: var(--texto); }
.tile:hover { border-color: var(--texto-3); background: var(--bg-hover); }
.tile .ic { width: 36px; height: 36px; border-radius: 9px; background: var(--bg-sel); display: grid; place-items: center; flex: none; }
.tile .ic .icono { width: 18px; height: 18px; color: var(--texto); }
.tile.principal { background: var(--texto); color: var(--bg-panel); border-color: var(--texto); }
.tile.principal .ic { background: rgba(127, 127, 127, .25); } .tile.principal .ic .icono { color: var(--bg-panel); }
.tile.principal span { color: var(--bg-panel); opacity: .75; }
.tile b { display: block; font-weight: 600; font-size: 14.5px; }
.tile span { color: var(--texto-3); font-size: 13px; }
.pendientes { border: 1px solid var(--borde); border-radius: 10px; overflow: hidden; }
.pend { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--borde); }
.pend:last-child { border-bottom: 0; }
.pend .n { font-size: 20px; font-weight: 700; min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; }
.pend .n.mal { color: var(--rojo); }
.pend .crece { font-size: 14.5px; }
.todo-bien { padding: 18px; color: var(--texto-2); display: flex; gap: 10px; align-items: center; }
.cifras-f { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--borde); border-radius: 10px; overflow: hidden; }
.cifras-f > div { padding: 16px 18px; border-right: 1px solid var(--borde); }
.cifras-f > div:last-child { border-right: 0; }
.cifras-f .eti { color: var(--texto-3); font-size: 13px; } .cifras-f .val { font-size: 24px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.cifras-f .fdet { color: var(--texto-3); font-size: 12.5px; }
.pregunta { display: flex; gap: 8px; border: 1px solid var(--borde-fuerte); border-radius: 10px; padding: 8px; background: var(--bg-panel); }
.pregunta input { border: 0 !important; box-shadow: none !important; height: 38px !important; font-size: 15px !important; background: transparent; }

/* pasos del pedido */
.pasos-g { display: flex; gap: 6px; margin: 18px 0 6px; }
.pasos-g .p { flex: 1; }
.pasos-g .p i { display: block; height: 4px; border-radius: 2px; background: var(--bg-sel); }
.pasos-g .p.hecho i { background: var(--texto); }
.pasos-g .p span { display: block; font-size: 12.5px; color: var(--texto-3); margin-top: 6px; }
.pasos-g .p.hecho span { color: var(--texto); }
.pasos-g .p.actual span { font-weight: 600; }
.siguiente { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--borde-fuerte); border-radius: 10px; margin: 16px 0 6px; }
.siguiente .crece b { display: block; font-weight: 600; }
.siguiente .crece span { color: var(--texto-3); font-size: 13px; }
.paso-t { font-size: 12.5px; color: var(--texto-3); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.elegir-cliente { max-width: 760px; margin: 0 auto; padding: 30px 24px 60px; }
.elegir-cliente h1 { font-size: 22px; margin: 4px 0 16px; }
.elegir-cliente .buscador input { height: 46px !important; font-size: 16px !important; padding-left: 38px; }
.elegir-cliente .buscador .icono { top: 15px; left: 13px; }
.prod-fila { min-height: 60px; padding: 8px 20px; }
.prod-fila .foto { width: 40px; height: 40px; }
.cant button { width: 34px; height: 34px; } .cant input { width: 56px; height: 34px; font-size: 14.5px; }
.det h1 { font-size: 24px; }
.prop { min-height: 36px; grid-template-columns: 110px 1fr; } .prop > span { font-size: 13.5px; }
@media (max-width: 1000px) { .que-hacer { grid-template-columns: 1fr 1fr; } .cifras-f { grid-template-columns: 1fr; } .cifras-f > div { border-right: 0; border-bottom: 1px solid var(--borde); } }

/* ═════════ Color ═════════
   Cada sección tiene su tono (el mismo en el menú, en las tarjetas de Inicio y en sus avisos)
   para que se reconozca de un vistazo; el estado de cada pedido va en su color de siempre. */
.c-acento { --c: var(--acento); } .c-azul { --c: var(--azul); } .c-verde { --c: var(--verde); } .c-ambar { --c: var(--ambar); }
.c-naranja { --c: var(--naranja); } .c-morado { --c: var(--morado); } .c-rojo { --c: var(--rojo); } .c-rosa { --c: var(--rosa); } .c-turquesa { --c: var(--turquesa); }
.app { background: var(--bg); }
.mini-av { color: #fff; border: 0; background: var(--acento); }
.chip.naranja { color: var(--naranja); border-color: color-mix(in srgb, var(--naranja) 35%, transparent); background: color-mix(in srgb, var(--naranja) 10%, transparent); }

/* menú: cada sección con su icono de color */
.menu a .icono { color: var(--ic, var(--texto-3)); }
.menu a[data-ruta="inicio"] { --ic: var(--acento); } .menu a[data-ruta="pedidos"] { --ic: var(--azul); } .menu a[data-ruta="clientes"] { --ic: var(--rosa); }
.menu a[data-ruta="cobros"] { --ic: var(--verde); } .menu a[data-ruta="tareas"] { --ic: var(--ambar); } .menu a[data-ruta="productos"] { --ic: var(--naranja); }
.menu a[data-ruta="tarifas"] { --ic: var(--morado); } .menu a[data-ruta="almacen"] { --ic: var(--turquesa); } .menu a[data-ruta="compras"] { --ic: var(--naranja); }
.menu a[data-ruta="informes"] { --ic: var(--acento); } .menu a[data-ruta="equipo"] { --ic: var(--rosa); } .menu a[data-ruta="ajustes"] { --ic: var(--texto-3); }
.menu a.activo { background: var(--acento-suave); color: var(--acento-texto); }
.menu a.activo .icono { color: var(--ic, var(--acento)); }
.menu a .cuenta { background: var(--acento); color: #fff; }
.menu-btn .icono { color: var(--acento); }
.sb-pie #ia-abrir { color: var(--acento-texto); font-weight: 600; }

/* inicio */
.tile .ic { background: color-mix(in srgb, var(--c, var(--acento)) 14%, transparent); }
.tile .ic .icono { color: var(--c, var(--acento)); }
.tile:hover { border-color: color-mix(in srgb, var(--c, var(--acento)) 45%, var(--borde)); background: color-mix(in srgb, var(--c, var(--acento)) 5%, var(--bg-panel)); }
.tile.principal { background: var(--acento); border-color: var(--acento); color: #fff; }
.tile.principal:hover { background: var(--acento-hover); }
.tile.principal .ic { background: rgba(255, 255, 255, .18); } .tile.principal .ic .icono, .tile.principal span { color: #fff; }
.pend { border-left: 3px solid var(--c, var(--borde)); }
.pend .n { color: var(--c, var(--texto)); }
.cifras-f > div:nth-child(1) .val { color: var(--azul); } .cifras-f > div:nth-child(2) .val { color: var(--acento-texto); } .cifras-f > div:nth-child(3) .val { color: var(--ambar); }
.inicio h1 { background: linear-gradient(90deg, var(--texto), var(--acento-texto)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ayuda, pasos, gráficos */
.ayuda { background: var(--acento-suave); color: var(--acento-texto); border-bottom-color: color-mix(in srgb, var(--acento) 20%, var(--borde)); }
.ayuda .icono { color: var(--acento); }
.pasos-g .p.hecho i { background: var(--acento); }
.pasos-g .p.actual i { background: linear-gradient(90deg, var(--acento), color-mix(in srgb, var(--acento) 50%, transparent)); }
.siguiente { border-color: color-mix(in srgb, var(--acento) 35%, var(--borde)); background: color-mix(in srgb, var(--acento) 4%, var(--bg-panel)); }
.grafico .barra-g { fill: color-mix(in srgb, var(--acento) 35%, var(--bg-panel)); } .grafico .barra-g.hoy { fill: var(--acento); } .grafico .barra-g.encima { fill: var(--acento-hover); }
.barras-h .relleno { background: var(--acento); }
.progreso > i { background: var(--acento); }
.interruptor:checked { background: var(--acento); }
.matriz td input.fijo { border-color: color-mix(in srgb, var(--acento) 55%, var(--borde)); background: var(--acento-suave); color: var(--acento-texto); }
.cant.con { border-color: var(--acento); } .cant.con input { color: var(--acento-texto); }
.g-cab { background: var(--bg-sutil); }
.sube { color: var(--verde); }

/* — avisos en vivo de pedidos nuevos — */
.avisos-vivo { position: fixed; right: 16px; bottom: 16px; z-index: 70; display: flex; flex-direction: column; gap: 8px; width: min(400px, calc(100vw - 32px)); }
.aviso-vivo { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; background: var(--bg-elev); border: 1px solid color-mix(in srgb, var(--acento) 40%, var(--borde));
  border-left: 4px solid var(--acento); border-radius: 10px; box-shadow: var(--sombra-flot); animation: subir .2s; }
.aviso-vivo .ic { width: 34px; height: 34px; border-radius: 9px; background: var(--acento-suave); display: grid; place-items: center; flex: none; }
.aviso-vivo .ic .icono { color: var(--acento); }
.aviso-vivo b { display: block; font-weight: 600; } .aviso-vivo span { color: var(--texto-3); font-size: 13px; }

/* — bienvenida — */
.modal.bienvenida { width: min(460px, 100%); text-align: center; }
.modal.bienvenida > .cab { display: none; }
.modal.bienvenida > .cuerpo { padding: 30px 30px 18px; }
.modal.bienvenida h2 { font-size: 20px; margin: 14px 0 8px; }
.modal.bienvenida p { color: var(--texto-2); font-size: 15px; line-height: 1.55; margin: 0; }
.bv-ic { width: 60px; height: 60px; border-radius: 16px; margin: 0 auto; display: grid; place-items: center; background: var(--acento-suave); }
.bv-ic .icono { width: 28px; height: 28px; color: var(--acento); }
.bv-puntos { display: flex; gap: 6px; justify-content: center; margin-top: 20px; }
.bv-puntos i { width: 8px; height: 8px; border-radius: 50%; background: var(--borde-fuerte); } .bv-puntos i.on { background: var(--acento); width: 22px; border-radius: 4px; }
.modal.bienvenida > .pie { justify-content: space-between; }

/* — reparto — */
.ruta-cab { padding: 24px 28px 18px; }
.num-parada { width: 30px; height: 30px; border-radius: 50%; background: var(--acento); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; font-size: 13px; }
.menu a[data-ruta="reparto"] { --ic: var(--morado); }
.firma-hueco { display: none; }
@media print {
  .app { display: block; } .marco { margin: 0; border: 0; } .cont { overflow: visible; }
  .ayuda, .no-imprimir, .tb .acciones { display: none !important; }
  .firma-hueco { display: inline; color: #000; }
  .avisos-vivo, .tostada, .velo { display: none !important; }
  .cifras-f { grid-template-columns: repeat(3, 1fr) !important; } .cifras-f > div { border-right: 1px solid #ccc !important; border-bottom: 0 !important; padding: 8px 12px; }
  .l2 .tx span { white-space: normal; } .l2 { min-height: 0; padding: 8px 12px; } .ruta-cab { padding: 0 0 10px; }
  .parada { break-inside: avoid; }
  .num-parada { background: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body, .marco, .cont { background: #fff !important; color: #000 !important; }
}

/* — repartidores en directo — */
.menu a[data-ruta="flota"] { --ic: var(--turquesa); }
.flota { display: grid; grid-template-columns: 400px 1fr; height: 100%; min-height: 0; }
.flota-lista { overflow: auto; border-right: 1px solid var(--borde); background: var(--bg-sutil); padding: 10px; }
.flota-mapa { min-height: 0; background: var(--bg-sutil); }
.flota-mapa .leaflet-control-attribution { font-size: 10px; }
:root[data-theme="dark"] .flota-mapa .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); }
.ficha-r { background: var(--bg-panel); border: 1px solid var(--borde); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.ficha-r.abierta { border-color: color-mix(in srgb, var(--acento) 45%, var(--borde)); }
.fr-cab { display: flex; align-items: center; gap: 10px; padding: 12px 14px 6px; cursor: pointer; }
.fr-cab b { display: block; font-weight: 600; } .fr-cab .mini-av { width: 34px; height: 34px; font-size: 12px; }
.fr-vel { display: flex; align-items: baseline; gap: 6px; padding: 0 14px; }
.fr-vel .kmh { font-size: 34px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.fr-vel .der { margin-left: auto; }
.fr-prog { display: flex; align-items: center; gap: 10px; padding: 4px 14px 10px; } .fr-prog .progreso { flex: 1; height: 6px; } .fr-prog .progreso > i { background: var(--verde); }
.fr-sig { margin: 0 10px 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg-sutil); display: flex; flex-direction: column; gap: 1px; }
.fr-sig b { font-weight: 600; }
.fr-carga { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 14px; border: 0; border-top: 1px solid var(--borde); background: transparent; cursor: pointer; text-align: left; }
.fr-carga:hover { background: var(--bg-hover); } .fr-carga > .icono { color: var(--naranja); } .fr-carga b { display: block; font-weight: 600; }
.fr-detalle { border-top: 1px solid var(--borde); padding: 6px 14px 12px; }
.sec-t2 { font-size: 12px; font-weight: 600; color: var(--texto-3); text-transform: uppercase; letter-spacing: .04em; margin: 10px 0 6px; }
.fr-prod { display: flex; align-items: center; gap: 10px; padding: 4px 0; } .fr-prod .foto { width: 26px; height: 26px; }
.fr-parada { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--borde); }
.fr-parada:last-child { border-bottom: 0; } .fr-parada.hecha { opacity: .5; }
.num-p { width: 22px; height: 22px; border-radius: 50%; background: var(--c); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: none; margin-top: 1px; }
/* marcadores del mapa */
.pin-almacen { width: 30px; height: 30px; border-radius: 8px; background: var(--marca); display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.3); }
.pin-almacen .icono { width: 16px; height: 16px; color: var(--marca-tinta); }
.pin-parada { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 3px solid var(--c); color: #111; font-size: 11px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.pin-parada.hecha { background: var(--c); color: #fff; opacity: .55; }
.pin-furgo { position: relative; width: 44px; height: 44px; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 4px 16px rgba(0,0,0,.35); display: grid; place-items: center; color: #fff; font-size: 13px; }
.pin-furgo.exceso { box-shadow: 0 0 0 4px var(--rojo), 0 4px 16px rgba(0,0,0,.35); }
.pin-furgo .flecha { position: absolute; inset: -9px; pointer-events: none; }
.pin-furgo .flecha::before { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-bottom: 9px solid var(--c); border-top: 0; }
.pin-vel { margin-top: 3px; text-align: center; font-size: 11px; font-weight: 700; color: #111; background: #fff; border-radius: 6px; padding: 1px 5px; box-shadow: 0 2px 6px rgba(0,0,0,.2); white-space: nowrap; width: max-content; margin-left: auto; margin-right: auto; }
@media (max-width: 1000px) { .flota { grid-template-columns: 1fr; grid-template-rows: 340px 1fr; } .flota-mapa { order: -1; } }

/* — correo y facturas — */
.ic-tipo { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--c, var(--texto-3)) 14%, transparent); }
.ic-tipo .icono { width: 17px; height: 17px; color: var(--c, var(--texto-3)); }
.c-gris { --c: var(--texto-3); }
.l2.no-leido .tx b { font-weight: 700; }
.l2.no-leido { box-shadow: inset 3px 0 0 var(--acento); }
.texto-correo { white-space: pre-wrap; line-height: 1.6; font-size: 14.5px; padding: 14px 16px; border: 1px solid var(--borde); border-radius: 10px; background: var(--bg-sutil); }
.visor-pdf { width: 100%; height: 640px; border: 1px solid var(--borde); border-radius: 10px; background: #fff; }
.qr { width: 132px; height: 132px; flex: none; background: #fff; border-radius: 8px; padding: 4px; border: 1px solid var(--borde); }
.qr svg { width: 100%; height: 100%; display: block; }
.menu a[data-ruta="correo"] { --ic: var(--azul); } .menu a[data-ruta="facturas"] { --ic: var(--verde); }

/* Con todas las secciones el menú no cabía en un portátil de 900 px de alto */
.menu a { height: 29px; } .menu .grupo { margin: 10px 8px 3px; } .sb-top { padding-bottom: 8px; } .sb-buscar { margin-bottom: 4px; }
.yo { padding-top: 8px; margin-top: 2px; }

/* ═════════ Móvil (≤ 760 px) ═════════
   El panel de oficina también tiene que poder usarse desde el móvil del encargado: barra
   fija arriba (marca, buscar, preguntar), barra fija abajo con lo del día a día y un «+»
   grande para apuntar un pedido, tablas como tarjetas y ventanas como hojas que suben. */
.m-top, .m-tab { display: none; }
@media (max-width: 900px) {
  html, body { overflow: visible; height: auto; background: var(--bg-panel); }
  .app { display: block; height: auto; }
  .sb { display: none !important; }
  .marco { margin: 0; border: 0; border-radius: 0; overflow: visible; min-height: 100vh;
    padding-top: calc(52px + env(safe-area-inset-top)); padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  #vista { height: auto; display: block; }
  .cont { overflow: visible !important; }
  .cont.pad { padding: 16px 16px 40px; }

  .m-top { display: flex; align-items: center; gap: 4px; position: fixed; top: 0; left: 0; right: 0; z-index: 30;
    height: calc(52px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 8px 0 14px;
    background: color-mix(in srgb, var(--bg-panel) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--borde); }
  .m-top .marca { flex: 1; font-size: 16px; font-weight: 700; gap: 10px; }
  .m-top .marca .sello { width: 30px; height: 30px; border-radius: 8px; font-size: 15px; }
  .m-ico { width: 44px; height: 44px; border: 0; background: transparent; border-radius: 12px; display: grid; place-items: center; color: var(--texto-2); }
  .m-ico .icono { width: 21px; height: 21px; } #m-ia .icono { color: var(--acento); }
  .m-tab { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(64px + env(safe-area-inset-bottom)); padding: 4px 4px env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--bg-panel) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--borde); }
  .m-tab > a, .m-tab > button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: transparent;
    color: var(--texto-3); font-size: 11.5px; font-weight: 500; text-decoration: none; }
  .m-tab .icono { width: 22px; height: 22px; }
  .m-tab .activo { color: var(--acento-texto); } .m-tab .activo .icono { color: var(--acento); }
  .m-tab .m-mas { align-self: center; justify-self: center; width: 54px; height: 54px; border-radius: 18px; background: var(--acento); color: #fff;
    box-shadow: 0 8px 22px color-mix(in srgb, var(--acento) 45%, transparent); margin-top: -18px; }
  .m-tab .m-mas .icono { width: 26px; height: 26px; color: #fff; stroke-width: 2.2; }
  .m-cuenta { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--rojo);
    color: #fff; font-size: 10.5px; font-weight: 700; font-style: normal; display: grid; place-items: center; }
  .m-cuenta:empty { display: none; }

  /* cabecera de cada pantalla: título en una línea y botones debajo, deslizables */
  .tb { height: auto; flex-wrap: wrap; padding: 10px 16px; gap: 8px; }
  .migas { width: 100%; font-size: 17px; font-weight: 600; }
  .migas > :not(.ultimo):not(:nth-last-child(3)) { display: none; }
  .migas .sep { display: none; }
  .migas a:has(+ .sep + .ultimo)::before { content: '‹ '; }
  .migas a:has(+ .sep + .ultimo) { font-weight: 500; font-size: 14px; color: var(--acento-texto); margin-right: 6px; }
  .migas .icono { display: none; }
  .tb .acciones { margin: 0; width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; scrollbar-width: none; }
  .tb .acciones:empty { display: none; }
  .tb .acciones::-webkit-scrollbar { display: none; }
  .tb .acciones .btn { flex: none; height: 38px; }
  .ayuda { padding: 10px 16px; font-size: 13px; align-items: flex-start; }
  .vb { padding: 8px 16px; gap: 8px; min-height: 0; }
  .vb > .filtros, .vb .der > .filtros { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; margin: 0 -2px; }
  .vb .filtros::-webkit-scrollbar { display: none; }
  .vb .filtro { flex: none; height: 36px; }
  .vb .der { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .vb .buscador, .vb .der .buscador { width: 100%; flex: 1 1 100%; }
  .vb select { flex: 1; height: 38px; }
  .vb > .tenue.peq { display: none; }

  /* campos sin zoom de iOS y botones táctiles */
  .app input[type=text], .app input[type=number], .app input[type=search], .app input[type=email], .app input[type=tel], .app input[type=date],
  .app input[type=password], .app select, .app textarea, .velo input, .velo select, .velo textarea { font-size: 16px; min-height: 42px; }
  .app .btn, .velo .btn { min-height: 40px; } .app .btn.mini { min-height: 34px; }
  .rejilla, .rejilla.dos { grid-template-columns: 1fr !important; }

  /* filas de lista: lo de la derecha baja debajo del texto */
  .l2 { flex-wrap: wrap; gap: 8px 12px; padding: 12px 16px; min-height: 0; }
  .l2 .tx { flex: 1 1 calc(100% - 60px); }
  .l2 .tx b { white-space: normal; font-size: 15px; }
  .l2 .tx span { white-space: normal; }
  .l2 .dr { width: 100%; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding-left: 0; }
  .l2 .dr .dinero { margin-right: auto; text-align: left; min-width: 0; font-size: 15px; }
  .l2 .dr select { width: auto !important; flex: 1; }
  .l { padding: 8px 16px; min-height: 48px; flex-wrap: wrap; }
  .l .id { width: auto; } .l .tit { flex: 1 1 60%; } .l .tit b { white-space: normal; max-width: none; }
  .l .meta { display: flex !important; width: 100%; padding-left: 0; flex-wrap: wrap; }
  .l .fecha { display: block !important; width: auto; } .l .imp { width: auto; margin-left: auto; }
  .l .acc { opacity: 1 !important; }
  .g-cab { padding: 0 16px; height: auto; min-height: 40px; flex-wrap: wrap; gap: 6px; padding-top: 6px; padding-bottom: 6px; position: static; }
  .g-cab .der { margin-left: auto; flex-wrap: wrap; }

  /* tablas → tarjetas, con el nombre de cada columna delante del dato */
  .caja-l, .tabla-scroll { overflow: visible; max-height: none; border-radius: 10px; }
  .tabla:not(.matriz) thead { display: none; }
  .tabla:not(.matriz) tbody tr { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 12px 14px; border-bottom: 1px solid var(--borde); }
  .tabla:not(.matriz) tbody tr:last-child { border-bottom: 0; }
  .tabla:not(.matriz) td { display: block; height: auto; padding: 0; border: 0 !important; text-align: left !important; font-size: 14px; }
  .tabla:not(.matriz) td:first-child { flex: 1 1 100%; font-weight: 500; }
  .tabla:not(.matriz) td[data-label]:not(:first-child)::before { content: attr(data-label) ' '; color: var(--texto-3); font-size: 12px; font-weight: 400; margin-right: 2px; }
  .tabla:not(.matriz) td:empty { display: none; }
  .tabla:not(.matriz) td:last-child:not(:first-child) { margin-left: auto; font-weight: 600; }
  .tabla:not(.matriz) td input { width: 110px !important; }
  /* la tabla de precios por producto sí se desliza, con la columna del producto fija */
  .matriz { display: block; overflow-x: auto; white-space: nowrap; }
  .matriz td:first-child, .matriz th:first-child { position: sticky; left: 0; background: var(--bg-panel); z-index: 1; max-width: 170px; white-space: normal; }
  #tabla .fila { flex-wrap: wrap; } #tabla .buscador { width: 100% !important; }

  /* inicio y cifras */
  .inicio { padding: 18px 16px 30px; }
  .inicio h1 { font-size: 23px; } .inicio h2 { margin: 24px 0 10px; }
  .que-hacer { grid-template-columns: 1fr; gap: 8px; }
  .tile { padding: 12px 14px; align-items: center; }
  .tile .ic { width: 40px; height: 40px; }
  .pend { padding: 12px 14px; gap: 10px; flex-wrap: wrap; }
  .pend .crece { flex: 1 1 calc(100% - 60px); font-size: 14.5px; }
  .pend .btn { margin-left: 44px; }
  .cifras-f { grid-template-columns: 1fr; } .cifras-f > div { border-right: 0; border-bottom: 1px solid var(--borde); padding: 12px 16px; }
  .cifras-f > div:last-child { border-bottom: 0; } .cifras-f .val { font-size: 22px; }
  .franja { grid-template-columns: 1fr 1fr; } .franja > div { padding: 12px 14px; border-bottom: 1px solid var(--borde); }
  .franja .val { font-size: clamp(18px, 5.5vw, 22px); }
  .pregunta { flex-direction: column; } .pregunta .btn { width: 100%; }
  .dos { grid-template-columns: 1fr; } .dos > .izq { border-right: 0; }
  .barras-h .b { grid-template-columns: 1fr 74px; } .barras-h .b .pista { grid-column: 1 / -1; grid-row: 2; }

  /* fichas (pedido, cliente, producto, compra, factura) */
  .det { display: block; }
  .det > .principal { padding: 16px 16px 24px; }
  .det h1 { font-size: 22px; }
  .det > .props { border-left: 0; border-top: 8px solid var(--bg-sutil); padding: 8px 10px 24px; }
  .prop { grid-template-columns: 120px 1fr; min-height: 40px; }
  .prop > div { white-space: normal; } .prop .recorta { white-space: normal; }
  .acciones-v .btn { min-height: 44px; justify-content: center; }
  .pasos-g { gap: 4px; } .pasos-g .p span { font-size: 11px; line-height: 1.25; }
  .siguiente { flex-wrap: wrap; padding: 14px; } .siguiente .crece { flex: 1 1 calc(100% - 40px); }
  .siguiente .btn { width: 100%; min-height: 48px; }
  .totales { width: 100%; }
  .seccion { margin-top: 22px; }

  /* apuntar un pedido: el resumen va plegado en una barra fija sobre la barra de abajo */
  .elegir-cliente { padding: 18px 16px 30px; }
  .elegir-cliente .fila { flex-wrap: wrap; }
  .constructor { display: block; height: auto; }
  .constructor > .izq { border-right: 0; }
  .constructor .catalogo-lista { overflow: visible; padding-bottom: 150px; }
  .prod-fila { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .prod-fila .crece { flex: 1 1 calc(100% - 60px); } .prod-fila .crece .recorta { white-space: normal; font-weight: 500; }
  .prod-fila .cant { margin-left: auto; }
  .carrito { position: fixed; left: 8px; right: 8px; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 25; max-height: 70vh;
    background: var(--bg-elev); border: 1px solid var(--borde); border-radius: 16px; box-shadow: 0 -6px 30px rgba(0,0,0,.14); }
  .carrito .g-cab { border-radius: 16px 16px 0 0; cursor: pointer; justify-content: space-between; }
  .carrito .g-cab::after { content: 'Ver ▲'; font-size: 12.5px; color: var(--acento-texto); font-weight: 600; margin-left: auto; }
  .carrito.abierto .g-cab::after { content: 'Ocultar ▼'; }
  .carrito .lineas, .carrito .campo, .carrito .pie-c > .tenue { display: none; }
  .carrito.abierto .lineas { display: block; max-height: 34vh; } .carrito.abierto .campo { display: flex; }
  .carrito .pie-c { padding: 8px 14px 12px; } .carrito .totales { margin-bottom: 6px; }
  .carrito .totales .t:not(.grande) { display: none; } .carrito.abierto .totales .t { display: flex; }
  .carrito .totales .t.grande { margin: 0; padding-top: 0; border: 0; }
  .carrito #guardar { margin-top: 6px !important; }

  /* reparto, flota, tablero */
  .ruta-cab { padding: 16px; }
  .flota { display: block; height: auto; }
  .flota-mapa { height: 46vh; min-height: 280px; }
  .flota-lista { border-right: 0; padding: 10px; }
  .fr-vel .kmh { font-size: 30px; }
  .tablero { grid-template-columns: 1fr; padding: 10px; }
  .reglas { grid-template-columns: 1fr; } .reglas > div { border-right: 0; border-bottom: 1px solid var(--borde); }

  /* ventanas: hojas que suben desde abajo */
  .velo { place-items: end stretch; padding: 0; }
  .modal, .modal.ancho { width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); animation: hoja .2s ease-out; }
  .modal > .cab::before { content: ''; position: absolute; left: 50%; top: 8px; width: 40px; height: 5px; border-radius: 3px; background: var(--borde-fuerte); transform: translateX(-50%); }
  .modal > .cab { position: relative; padding-top: 22px; }
  .modal > .pie { flex-wrap: wrap; } .modal > .pie .btn { flex: 1; min-height: 46px; }
  @keyframes hoja { from { transform: translateY(40px); opacity: .4; } }
  .modal.bienvenida { border-radius: 18px 18px 0 0; }
  .hoja-menu .m-lista { display: flex; flex-direction: column; }
  .m-lista .grupo { font-size: 12px; color: var(--texto-3); font-weight: 600; margin: 14px 4px 4px; text-transform: uppercase; letter-spacing: .04em; }
  .m-lista a, .m-lista button { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 8px; border: 0; background: transparent; border-radius: 10px;
    font-size: 16px; color: var(--texto); text-align: left; }
  .m-lista a:active, .m-lista button:active { background: var(--bg-sel); }
  .m-lista .icono { width: 20px; height: 20px; color: var(--acento); }
  .m-lista .cuenta { margin-left: auto; background: var(--acento); color: #fff; border-radius: 10px; padding: 0 8px; font-size: 12px; font-weight: 700; line-height: 20px; }
  .m-lista .cuenta:empty { display: none; }
  .velo.arriba { place-items: start stretch; padding: calc(8px + env(safe-area-inset-top)) 8px 0; }
  .paleta { width: 100%; } .paleta .res { max-height: 60vh; }
  .ia-cajon { inset: 0; width: 100%; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .avisos-vivo { right: 8px; left: 8px; width: auto; bottom: calc(80px + env(safe-area-inset-bottom)); }
  .tostada { left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); }
  .entrada .caja { width: 100%; }
}
@media print { .m-top, .m-tab { display: none !important; } .marco { padding: 0 !important; } }
@media (max-width: 900px) {
  /* los botones de cabecera bajan de línea en vez de cortarse */
  .tb .acciones { flex-wrap: wrap; overflow: visible; }
  .tb .acciones .btn { flex: 1 1 auto; justify-content: center; white-space: normal; text-align: center; line-height: 1.2; padding: 6px 12px; }
  .l2 .dr .btn { flex: 1 1 auto; justify-content: center; }
  .l2 .dr select { flex: 1 1 100% !important; order: -1; }
  .l .meta { width: auto; } .l .tit { flex: 1 1 55%; }
  .carrito .g-cab .n { margin-left: 6px; }
}
@media (max-width: 900px) {
  /* avisos de pedido nuevo: arriba, de uno en uno y compactos, sin tapar la pantalla */
  .avisos-vivo { top: calc(58px + env(safe-area-inset-top)); bottom: auto; }
  .aviso-vivo:not(:last-child) { display: none; }
  .aviso-vivo { padding: 8px 8px 8px 12px; gap: 10px; background: var(--bg-elev); }
  .aviso-vivo .ic { width: 30px; height: 30px; }
  .aviso-vivo b { font-size: 14px; } .aviso-vivo span { font-size: 12.5px; }
}

/* ═════════ Colores del logo de L'Arrak ═════════
   Verde botella para todo lo principal y dorado para los detalles; los iconos del menú y
   las tarjetas de Inicio alternan verdes y dorados de la misma familia. */
.marca .emblema { width: 30px; height: 30px; object-fit: contain; flex: none; }
.sb .marca { gap: 10px; } .sb .marca span { font-weight: 700; color: var(--verde-marca); letter-spacing: .01em; line-height: 1.1; }
.sb .marca small { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--oro-oscuro); margin-top: 2px; }
:root[data-theme="dark"] .sb .marca span { color: var(--texto); }
.m-top .marca .emblema { width: 34px; height: 34px; } .m-top .marca span { color: var(--verde-marca); }
:root[data-theme="dark"] .m-top .marca span { color: var(--texto); }
.logo-entrada { text-align: center; } .logo-entrada img { width: min(300px, 80%); height: auto; }
:root[data-theme="dark"] .logo-entrada img { background: #fff; border-radius: 16px; padding: 14px 18px; }
.logo-entrada small { display: block; color: var(--texto-3); margin-top: 18px; font-size: 14px; }
.entrada { background: radial-gradient(ellipse at top, color-mix(in srgb, var(--oro) 10%, var(--bg)), var(--bg) 60%); }
.usuario:hover, .usuario.activo { background: var(--acento-suave); }

/* menú: verdes y dorados */
.menu a[data-ruta] { --ic: var(--acento); }
.menu a[data-ruta="clientes"], .menu a[data-ruta="tareas"], .menu a[data-ruta="flota"], .menu a[data-ruta="tarifas"], .menu a[data-ruta="compras"],
.menu a[data-ruta="facturas"], .menu a[data-ruta="equipo"] { --ic: var(--oro-oscuro); }
.menu a.activo { background: var(--acento-suave); color: var(--acento-texto); box-shadow: inset 3px 0 0 var(--oro); }
.menu a .cuenta { background: var(--acento); }
.menu-btn .icono, .sb-pie #ia-abrir { color: var(--acento-texto); } .sb-pie #ia-abrir .icono { color: var(--oro); }

/* inicio */
.inicio h1 { background: linear-gradient(90deg, var(--verde-marca), var(--acento) 55%, var(--oro-oscuro)); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-theme="dark"] .inicio h1 { background: linear-gradient(90deg, var(--texto), var(--oro-claro)); -webkit-background-clip: text; background-clip: text; }
.tile.principal { background: linear-gradient(135deg, var(--acento), var(--verde-marca)); border-color: var(--verde-marca); }
.tile.principal .ic { background: rgba(242, 201, 122, .22); } .tile.principal .ic .icono { color: var(--oro-claro); }
.tile.c-verde { --c: var(--acento); } .tile.c-azul { --c: var(--oro-oscuro); } .tile.c-ambar { --c: var(--acento); }
.tile.c-naranja { --c: var(--oro-oscuro); } .tile.c-morado { --c: var(--acento); }
.cifras-f > div:nth-child(1) .val { color: var(--acento-texto); } .cifras-f > div:nth-child(2) .val { color: var(--oro-oscuro); } .cifras-f > div:nth-child(3) .val { color: var(--texto); }
.ayuda { background: var(--acento-suave); color: var(--acento-texto); } .ayuda .icono { color: var(--oro-oscuro); }
.pasos-g .p.hecho i { background: var(--acento); } .pasos-g .p.actual i { background: linear-gradient(90deg, var(--acento), var(--oro)); }
.siguiente { border-color: color-mix(in srgb, var(--oro) 45%, var(--borde)); background: color-mix(in srgb, var(--oro) 6%, var(--bg-panel)); }
.chip.oro { color: var(--oro-oscuro); border-color: color-mix(in srgb, var(--oro) 45%, transparent); background: var(--oro-suave); } .chip.oro::before { background: var(--oro); }
.grafico .barra-g { fill: color-mix(in srgb, var(--acento) 30%, var(--bg-panel)); } .grafico .barra-g.hoy { fill: var(--oro); }
.progreso > i { background: linear-gradient(90deg, var(--acento), var(--oro)); }
.bv-ic { background: var(--oro-suave); } .bv-ic .icono { color: var(--acento); } .bv-puntos i.on { background: var(--oro); }
.num-parada, .num-p { background: var(--acento); }
.pin-almacen { background: var(--acento); } .pin-almacen .icono { color: var(--oro-claro); }
.aviso-vivo { border-left-color: var(--oro); } .aviso-vivo .ic { background: var(--oro-suave); } .aviso-vivo .ic .icono { color: var(--acento); }
@media (max-width: 900px) {
  .m-tab .m-mas { background: linear-gradient(135deg, var(--acento), var(--verde-marca)); box-shadow: 0 8px 22px color-mix(in srgb, var(--acento) 40%, transparent), inset 0 0 0 2px var(--oro); }
  .m-tab .m-mas .icono { color: var(--oro-claro); }
  .m-tab .activo { color: var(--acento-texto); } .m-tab .activo .icono { color: var(--acento); }
  #m-ia .icono { color: var(--oro-oscuro); }
  .m-lista .icono { color: var(--acento); } .m-lista .ic-clientes .icono, .m-lista .ic-tareas .icono, .m-lista .ic-tarifas .icono, .m-lista .ic-compras .icono,
  .m-lista .ic-flota .icono, .m-lista .ic-facturas .icono, .m-lista .ic-equipo .icono { color: var(--oro-oscuro); }
  .m-lista .cuenta { background: var(--acento); }
}
.sb .marca .emblema { width: 34px; height: 34px; }
.sb .marca small { font-size: 9.5px; letter-spacing: .07em; white-space: nowrap; }
.pend.c-azul { --c: var(--acento); } .pend.c-morado { --c: var(--oro-oscuro); } .pend.c-naranja { --c: var(--oro); }
.usuario { min-height: 44px; padding: 8px 10px; font-size: 14.5px; } .usuario .avatar { width: 28px; height: 28px; font-size: 11px; }
