/* Ficha de la orden de trabajo (/ordenes-trabajo/{id}) y piezas comunes de trabajos y servicios. Colores del tema (orvi-theme). */

.ot-migas { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--o-muted); margin: 0 0 10px; }
.ot-migas a { color: var(--o-muted); text-decoration: none; }
.ot-migas a:hover { color: var(--o-text); text-decoration: underline; }
.ot-migas b { color: var(--o-text); font-weight: 600; }

.ot-cabecera { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; background: var(--o-surface); border: 1px solid var(--o-border); border-radius: 16px; padding: 20px 22px; box-shadow: var(--o-shadow); }
.ot-cab-izq { min-width: 0; flex: 1; }
.ot-cab-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.ot-num { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 700; color: var(--o-text-2,#334155); background: var(--o-bg); border: 1px solid var(--o-border); border-radius: 8px; padding: 3px 9px; }
.ot-cabecera h1 { margin: 0 0 8px; font-size: 22px; line-height: 1.25; color: var(--o-text); font-weight: 700; overflow-wrap: anywhere; }
.ot-cab-sub { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--o-muted); font-size: 13px; }
.ot-cab-sub span { display: inline-flex; gap: 6px; align-items: center; }
.ot-cab-acc { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.ot-cab-acc .btn-primary, .ot-cab-acc .btn-secondary { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.ot-cab-acc .acc-mas { height: 38px; width: 38px; }

.ot-prio { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-radius: 999px; padding: 3px 10px; border: 1px solid var(--o-border); color: var(--o-muted); background: var(--o-surface,#fff); }
.ot-prio-alta { color: var(--o-warn); background: var(--o-warn-bg); border-color: var(--o-warn-b); }
.ot-prio-urgente { color: #fff; background: var(--o-bad); border-color: var(--o-bad); }
.ot-prio-baja { color: var(--o-faint); }

.ot-aviso { margin: 12px 0 0; cursor: pointer; }
.ot-banda { display: flex; gap: 8px; align-items: center; margin-top: 12px; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 600; }
.ot-banda-mal { background: var(--o-bad-bg); color: var(--o-bad); border: 1px solid var(--o-bad-b); }

.ot-resumen { display: grid; grid-template-columns: minmax(220px, 1.6fr) repeat(auto-fit, minmax(120px, 1fr)); gap: 1px; margin-top: 14px; background: var(--o-border); border: 1px solid var(--o-border); border-radius: 14px; overflow: hidden; }
.ot-resumen > div { background: var(--o-surface); padding: 12px 16px; min-width: 0; }
.ot-dato span, .ot-avance-txt span { display: block; color: var(--o-muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.ot-dato b { display: block; margin-top: 4px; font-size: 15px; color: var(--o-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ot-dato.mal b { color: var(--o-bad); }
.ot-dato.bien b { color: var(--o-ok); }
.ot-avance-txt { display: flex; align-items: baseline; gap: 10px; }
.ot-avance-txt b { font-size: 22px; color: var(--o-text); }
.ot-avance-txt span { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 500; }
.ot-barra { height: 8px; border-radius: 99px; background: var(--o-bg); margin-top: 8px; overflow: hidden; }
.ot-barra i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #3B82B6, #047857); transition: width .3s; }

.ot-tabs { display: flex; gap: 4px; margin: 18px 0 12px; border-bottom: 1px solid var(--o-border); overflow-x: auto; }
.ot-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; font-size: 14px; font-weight: 600; color: var(--o-muted); cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.ot-tabs button:hover { color: var(--o-text); }
.ot-tabs button.on { color: var(--o-text); border-bottom-color: var(--o-text); }
.ot-tabs small { background: var(--o-bg); border: 1px solid var(--o-border); border-radius: 99px; font-size: 11px; padding: 0 7px; color: var(--o-muted); }

.ot-trabajos { display: grid; gap: 0; }
.ot-tarea { display: grid; grid-template-columns: 40px 1fr; gap: 12px; }
.ot-tarea-linea { display: flex; flex-direction: column; align-items: center; }
.ot-tarea-linea i { flex: 1; width: 2px; background: var(--o-border); margin: 4px 0; }
.ot-tarea-n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--o-surface,#fff); border: 2px solid var(--o-border-strong); color: var(--o-muted); flex: 0 0 auto; }
.ot-tarea.est-ok .ot-tarea-n { background: var(--o-ok); border-color: var(--o-ok); color: #fff; }
.ot-tarea.est-info .ot-tarea-n { border-color: var(--o-info); color: var(--o-info); }
.ot-tarea.est-bad .ot-tarea-n { border-color: var(--o-bad); color: var(--o-bad); }
.ot-tarea.est-warn .ot-tarea-n { border-color: var(--o-warn); color: var(--o-warn); }
.ot-tarea-cuerpo { background: var(--o-surface); border: 1px solid var(--o-border); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--o-shadow); min-width: 0; }
.ot-tarea-cuerpo > header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.ot-tarea-cuerpo h3 { margin: 0 0 6px; font-size: 15.5px; color: var(--o-text); }
.ot-tarea-cuerpo h3 small { font-weight: 500; color: var(--o-muted); font-size: 13px; }
.ot-tarea-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 12.5px; color: var(--o-muted); }
.ot-tarea-meta > span:not(.badge-estado) { display: inline-flex; gap: 5px; align-items: center; }
.ot-tarea-acc { flex: 0 0 auto; }
.ot-nota { display: flex; gap: 6px; align-items: center; margin-top: 10px; font-size: 12.5px; padding: 6px 10px; border-radius: 8px; background: var(--o-bg); color: var(--o-muted); }
.ot-nota.warn { background: var(--o-warn-bg); color: var(--o-warn); }
.ot-nota.mal { background: var(--o-bad-bg); color: var(--o-bad); }
.ot-tarea-datos { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--o-border); }
.ot-tarea-datos > div { min-width: 120px; }
.ot-tarea-datos span { display: block; font-size: 11px; color: var(--o-muted); text-transform: uppercase; font-weight: 600; letter-spacing: .03em; }
.ot-tarea-datos b { font-size: 13.5px; color: var(--o-text); font-weight: 600; }
.ot-tarea-datos b small { color: var(--o-muted); font-weight: 500; }
.ot-tarea-datos b.mal { color: var(--o-bad); }
.ot-mini-barra { width: 140px; height: 5px; border-radius: 9px; background: var(--o-bg); margin-top: 5px; overflow: hidden; }
.ot-mini-barra i { display: block; height: 100%; background: var(--o-ok); }
.ot-mini-barra.mal i { background: var(--o-bad); }
.ot-check { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; color: var(--o-text-2,#334155); }
.ot-check li b { font-weight: 700; margin-right: 6px; }
.ot-check li.mal { color: var(--o-bad); }
.ot-fotos { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; }
.ot-fotos-grupo > span { display: block; font-size: 11px; color: var(--o-muted); text-transform: uppercase; font-weight: 600; margin-bottom: 4px; }
.ot-fotos-grupo > div { display: flex; flex-wrap: wrap; gap: 6px; }
.ot-fotos-grupo img { width: 88px; height: 66px; object-fit: cover; border-radius: 8px; border: 1px solid var(--o-border); background: var(--o-bg); }
.ot-obs { margin: 10px 0 0; font-size: 13px; color: var(--o-text-2,#334155); white-space: pre-line; }

.ot-pie { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 4px; }
.ot-pie > div { background: var(--o-surface); border: 1px solid var(--o-border); border-radius: 14px; padding: 14px 16px; }
.ot-pie span { display: block; font-size: 11px; color: var(--o-muted); text-transform: uppercase; font-weight: 600; margin-bottom: 6px; }
.ot-pie p { margin: 0; font-size: 13.5px; white-space: pre-line; }
.ot-firma img { max-width: 220px; max-height: 90px; display: block; margin-bottom: 6px; }

.ot-panel { background: var(--o-surface); border: 1px solid var(--o-border); border-radius: 14px; padding: 6px 4px; box-shadow: var(--o-shadow); overflow-x: auto; }
.ot-panel .data-table { width: 100%; }
.ot-panel tfoot td { font-weight: 600; border-top: 2px solid var(--o-border); padding: 10px; }
.ot-tachada td { color: var(--o-faint); text-decoration: line-through; }
.ot-neg { color: var(--o-bad); }
.ot-ayuda { margin: 10px 14px; color: var(--o-muted); font-size: 12.5px; }

.ot-historial { list-style: none; margin: 0; padding: 10px 16px; }
.ot-historial li { display: grid; grid-template-columns: 130px 1fr; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--o-border); }
.ot-historial li:last-child { border-bottom: 0; }
.ot-historial time { color: var(--o-muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ot-historial b { font-size: 13.5px; }
.ot-historial p { margin: 4px 0 0; font-size: 13px; color: var(--o-text-2,#334155); }
.ot-historial small { display: block; margin-top: 2px; color: var(--o-faint); font-size: 12px; }

.ot-vacio { display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; text-align: center; padding: 48px 20px; color: var(--o-muted); background: var(--o-surface); border: 1px dashed var(--o-border-strong); border-radius: 14px; }
.ot-vacio strong { color: var(--o-text); font-size: 16px; }
.ot-vacio.pequeno { padding: 22px; flex-direction: row; flex-wrap: wrap; border-style: dashed; }

.ot-modal { width: min(560px, calc(100vw - 24px)); }
.ot-subir { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; border: 1px dashed var(--o-border-strong); border-radius: 10px; padding: 10px 14px; color: var(--o-text-2,#334155); font-weight: 600; font-size: 13.5px; position: relative; }
.ot-subir:hover { background: var(--o-bg); }
.ot-subir input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ot-checklist { display: grid; gap: 8px; }
.ot-check-fila { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--o-border); border-radius: 10px; }
.ot-check-fila.mal { border-color: var(--o-bad-b); background: var(--o-bad-bg); }
.ot-check-fila > span { font-size: 13.5px; }
.ot-check-fila input { grid-column: 1 / -1; }
.ot-seg { display: inline-flex; border: 1px solid var(--o-border-strong); border-radius: 9px; overflow: hidden; }
.ot-seg button { border: 0; background: var(--o-surface,#fff); padding: 6px 10px; font-size: 12.5px; font-weight: 600; color: var(--o-muted); cursor: pointer; }
.ot-seg button + button { border-left: 1px solid var(--o-border); }
.ot-seg button.on { background: var(--o-primary); color: #fff; }
.ot-seg button.on.ok { background: var(--o-ok); }
.ot-seg button.on.mal { background: var(--o-bad); }
.ot-firma-lienzo { position: relative; border: 1px solid var(--o-border-strong); border-radius: 12px; background: var(--o-surface,#fff); margin-bottom: 12px; }
.ot-firma-lienzo canvas { width: 100%; height: 180px; display: block; touch-action: none; }
.ot-firma-lienzo .btn-link-sm { position: absolute; right: 10px; top: 8px; }

@media (max-width: 1100px) {
  .ot-resumen { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ot-resumen .ot-avance { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .ot-cabecera { flex-direction: column; padding: 16px; }
  .ot-cab-acc { justify-content: flex-start; }
  .ot-cabecera h1 { font-size: 18px; }
  .ot-resumen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ot-resumen > .ot-dato:last-child:nth-child(even) { grid-column: 1 / -1; }
  .ot-tarea { grid-template-columns: 30px 1fr; gap: 8px; }
  .ot-tarea-n { width: 26px; height: 26px; font-size: 12px; }
  .ot-tarea-cuerpo > header { flex-direction: column; }
  .ot-historial li { grid-template-columns: 1fr; gap: 2px; }
  .ot-check-fila { grid-template-columns: 1fr; }
}

/* ═══════════════ Mi jornada (operario, móvil primero) ═══════════════ */
.mj { max-width: 880px; margin: 0 auto; display: grid; gap: 16px; padding-bottom: 40px; }
.mj-hero { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 20px 22px; border-radius: 16px; color: #fff;
  background: linear-gradient(120deg, #16355b 0%, #1f4f7f 60%, #2b6a8f 100%); box-shadow: 0 10px 26px rgba(22, 53, 91, .22); }
.mj-hero-txt { position: relative; z-index: 1; min-width: 0; }
.mj-fecha { font-size: 12.5px; opacity: .75; font-weight: 600; letter-spacing: .02em; }
.mj-hero h1 { margin: 4px 0 6px; font-size: 22px; font-weight: 700; color: #fff; }
.mj-hero p { margin: 0 0 12px; opacity: .9; font-size: 14.5px; max-width: 46ch; }
.mj-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mj-chips span { display: inline-flex; gap: 6px; align-items: center; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; padding: 5px 11px; font-size: 12.5px; font-weight: 600; backdrop-filter: blur(4px); }
.mj-chips span.bien { background: rgba(52, 211, 153, .22); border-color: rgba(52, 211, 153, .45); }
.mj-anillo { position: relative; z-index: 1; width: 112px; height: 112px; flex: 0 0 auto; }
.mj-anillo svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.mj-anillo circle { fill: none; stroke-width: 11; }
.mj-anillo .fondo { stroke: rgba(255, 255, 255, .14); }
.mj-anillo .valor { stroke: #34d399; stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.mj-anillo > div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.mj-anillo b { font-size: 26px; font-weight: 700; line-height: 1; }
.mj-anillo span { font-size: 12px; opacity: .75; }
.mj-cargando { min-height: 150px; display: grid; gap: 12px; align-content: center; }
.mj-esqueleto { height: 22px; width: 60%; border-radius: 8px; background: linear-gradient(90deg, rgba(255,255,255,.1), rgba(255,255,255,.25), rgba(255,255,255,.1)); background-size: 200% 100%; animation: mj-brillo 1.2s infinite; }
.mj-esqueleto.corto { width: 35%; }
@keyframes mj-brillo { to { background-position: -200% 0; } }

.mj-toast { background: var(--o-ok-bg); color: var(--o-ok); border: 1px solid var(--o-ok-b); padding: 11px 14px; border-radius: 14px; font-weight: 600; font-size: 14px; cursor: pointer; animation: mj-entra .35s ease; }
.mj-toast.mal { background: var(--o-bad-bg); color: var(--o-bad); border-color: var(--o-bad-b); }
@keyframes mj-entra { from { opacity: 0; transform: translateY(-6px); } }

.mj-ahora { background: var(--o-surface); border-radius: 16px; padding: 18px 20px; border: 1px solid var(--o-ok-b); box-shadow: var(--o-shadow); position: relative; overflow: hidden; }
.mj-ahora::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--o-ok); }
.mj-ahora.pausa { border-color: var(--o-warn-b); }
.mj-ahora.pausa::before { background: #f59e0b; }
.mj-ahora.pasado .mj-reloj b { color: var(--o-bad); }
.mj-ahora-cab { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.mj-etiqueta { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--o-ok); }
.mj-ahora .mj-etiqueta::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: mj-latido 1.6s infinite; }
.mj-ahora.pausa .mj-etiqueta { color: var(--o-warn); }
.mj-ahora.pausa .mj-etiqueta::before { animation: none; }
@keyframes mj-latido { 0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); } 50% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); } }
.mj-ot { font-size: 12.5px; color: var(--o-muted); font-family: ui-monospace, monospace; text-decoration: none; }
.mj-ahora-cuerpo { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.mj-ahora h2 { margin: 8px 0 6px; font-size: 19px; font-weight: 700; color: var(--o-text); }
.mj-placa { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 800; font-size: 20px; letter-spacing: .06em; padding: 4px 12px 4px 16px; border-radius: 8px; background: var(--o-surface,#fff); border: 2px solid var(--o-text); color: var(--o-text); box-shadow: inset 6px 0 0 #1d4ed8; }
.mj-placa.peque { font-size: 12.5px; padding: 1px 8px 1px 11px; border-width: 1.5px; box-shadow: inset 4px 0 0 #1d4ed8; }
.mj-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--o-muted); font-size: 13px; }
.mj-meta span { display: inline-flex; gap: 5px; align-items: center; }
.mj-reloj { text-align: right; }
.mj-reloj b { display: block; font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--o-text); line-height: 1; letter-spacing: -.02em; }
.mj-reloj span { font-size: 12.5px; color: var(--o-muted); }
.mj-barra { width: 180px; height: 7px; border-radius: 9px; background: var(--o-bg); margin: 8px 0 0 auto; overflow: hidden; }
.mj-barra i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, #34d399, #059669); transition: width 1s linear; }
.mj-ahora.pasado .mj-barra i { background: var(--o-bad); }
.mj-ahora-acc { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.mj-ahora-acc .grande { flex: 1 1 200px; }

.mj-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--o-border-strong); background: var(--o-surface,#fff); color: var(--o-text); font-weight: 700; font-size: 14.5px; cursor: pointer; transition: transform .08s, box-shadow .15s, background .15s; white-space: nowrap; }
.mj-btn:hover:not(:disabled) { box-shadow: 0 4px 14px rgba(15, 23, 42, .1); }
.mj-btn:active:not(:disabled) { transform: scale(.97); }
.mj-btn:disabled { opacity: .45; cursor: not-allowed; }
.mj-btn.grande { min-height: 54px; font-size: 16.5px; border-radius: 16px; background: var(--o-primary); border-color: var(--o-primary); color: #fff; }
.mj-btn.verde { background: var(--o-ok); border-color: var(--o-ok); color: #fff; }
.mj-btn.rojo { background: var(--o-bad); border-color: var(--o-bad); color: #fff; }
.mj-btn.suave { background: var(--o-bg); border-color: transparent; color: var(--o-muted); }

.mj-seccion > header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 6px 4px 10px; }
.mj-seccion h3 { margin: 0; font-size: 17px; font-weight: 800; color: var(--o-text); display: flex; gap: 8px; align-items: center; }
.mj-seccion h3 small { font-size: 12px; background: var(--o-surface); border: 1px solid var(--o-border); border-radius: 99px; padding: 1px 9px; color: var(--o-muted); font-weight: 700; }
.mj-sub { color: var(--o-muted); font-size: 12.5px; }
.mj-vacio { background: var(--o-surface); border: 1px dashed var(--o-border-strong); border-radius: 16px; padding: 18px; text-align: center; color: var(--o-muted); font-size: 14px; }
.mj-tarjeta { display: flex; justify-content: space-between; align-items: center; gap: 14px; background: var(--o-surface); border: 1px solid var(--o-border); border-left: 5px solid var(--o-border-strong); border-radius: 16px; padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--o-shadow); transition: transform .15s, box-shadow .15s; }
.mj-tarjeta:hover { border-color: var(--o-border-strong); }
.mj-tarjeta.prio-alta { border-left-color: #f59e0b; }
.mj-tarjeta.prio-urgente { border-left-color: var(--o-bad); }
.mj-tarjeta.prio-baja { border-left-color: var(--o-border-strong,#cbd5e1); }
.mj-tarjeta.siguiente { border-color: var(--o-info-b); border-left-color: var(--o-info); }
.mj-tarjeta.siguiente .mj-etiqueta { color: var(--o-info); margin-bottom: 4px; }

.mj-tarjeta-txt { min-width: 0; flex: 1; display: grid; gap: 6px; }
.mj-tarjeta-tit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mj-tarjeta-tit b { font-size: 15.5px; color: var(--o-text); }
.mj-tarjeta-acc { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.mj-enlace { font-size: 12px; color: var(--o-muted); text-decoration: none; }
.mj-enlace:hover { text-decoration: underline; }
.mj-prio { color: var(--o-warn); font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: .04em; }
.prio-urgente .mj-prio { color: var(--o-bad); }
.mj-afin { color: var(--o-info); font-weight: 600; }
.mj-aviso { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--o-warn); background: var(--o-warn-bg); border-radius: 8px; padding: 4px 9px; width: fit-content; }
.mj-aviso.mal { color: var(--o-bad); background: var(--o-bad-bg); }
.mj-mas { width: 100%; background: none; border: 1px dashed var(--o-border-strong); border-radius: 14px; padding: 10px; color: var(--o-muted); font-weight: 700; cursor: pointer; }
.mj-mini-spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--o-border); border-top-color: var(--o-muted); animation: mj-gira .8s linear infinite; }
@keyframes mj-gira { to { transform: rotate(360deg); } }

.mj-hechas { list-style: none; margin: 0; padding: 4px 12px; background: var(--o-surface); border: 1px solid var(--o-border); border-radius: 16px; }
.mj-hechas li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--o-border); }
.mj-hechas li:last-child { border-bottom: 0; }
.mj-ok { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--o-ok-bg); color: var(--o-ok); }
.mj-hechas b { display: block; font-size: 14px; color: var(--o-text); }
.mj-hechas span { font-size: 12.5px; color: var(--o-muted); }
.mj-hechas em { font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--o-muted); background: var(--o-bg); border-radius: 99px; padding: 2px 9px; }
.mj-hechas em.bien { color: var(--o-ok); background: var(--o-ok-bg); }
.mj-hechas em.tarde { color: var(--o-warn); background: var(--o-warn-bg); }

/* hoja inferior: empezar / terminar / problema, paso a paso */
.mj-capa { position: fixed; inset: 0; z-index: 1100; background: rgba(15, 23, 42, .5); display: flex; align-items: flex-end; justify-content: center; animation: mj-fundido .2s ease; }
@keyframes mj-fundido { from { opacity: 0; } }
.mj-hoja { width: min(620px, 100%); max-height: 92vh; overflow: auto; background: var(--o-surface); border-radius: 24px 24px 0 0; padding: 10px 20px 20px; box-shadow: 0 -20px 50px rgba(15, 23, 42, .25); animation: mj-sube .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes mj-sube { from { transform: translateY(40px); opacity: .6; } }
@media (min-width: 760px) { .mj-capa { align-items: center; } .mj-hoja { border-radius: 24px; } }
.mj-hoja-asa { width: 44px; height: 5px; border-radius: 9px; background: var(--o-border-strong); margin: 0 auto 12px; }
.mj-hoja > header { display: grid; gap: 4px; margin-bottom: 12px; justify-items: start; }
.mj-hoja > header h2 { margin: 0; font-size: 21px; font-weight: 800; }
.mj-hoja > header .mj-etiqueta { color: var(--o-info); }
.mj-pasos { display: flex; gap: 6px; margin-bottom: 14px; }
.mj-pasos i { flex: 1; height: 5px; border-radius: 9px; background: var(--o-bg); transition: background .2s; }
.mj-pasos i.hecho { background: var(--o-ok); }
.mj-pasos i.actual { background: var(--o-info); }
.mj-paso h3 { font-size: 16px; margin: 0 0 12px; font-weight: 800; }
.mj-paso h3 small { color: var(--o-muted); font-weight: 600; font-size: 13px; }
.mj-camara { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 150px; border: 2px dashed var(--o-border-strong); border-radius: 18px; color: var(--o-text); font-weight: 700; cursor: pointer; background: var(--o-bg); transition: border-color .15s, background .15s; }
.mj-camara:hover { border-color: var(--o-info); background: var(--o-info-bg); }
.mj-camara input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.mj-fotos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.mj-fotos img { width: 96px; height: 72px; object-fit: cover; border-radius: 10px; border: 1px solid var(--o-border); animation: mj-entra .3s ease; }
.mj-checklist { display: grid; gap: 8px; }
.mj-punto { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--o-border); transition: border-color .15s, background .15s; }
.mj-punto.actual { border-color: var(--o-info); box-shadow: 0 0 0 3px var(--o-info-bg); }
.mj-punto.ok { background: var(--o-ok-bg); border-color: var(--o-ok-b); }
.mj-punto.mal { background: var(--o-bad-bg); border-color: var(--o-bad-b); }
.mj-punto.na { background: var(--o-bg); }
.mj-punto > span { font-size: 15px; font-weight: 600; }
.mj-punto input { grid-column: 1 / -1; }
.mj-punto-acc { display: flex; gap: 6px; }
.mj-punto-acc button { width: 46px; height: 42px; border-radius: 12px; border: 1px solid var(--o-border-strong); background: var(--o-surface,#fff); color: var(--o-muted); font-weight: 800; font-size: 12px; cursor: pointer; display: grid; place-items: center; }
.mj-punto-acc button:nth-child(1).on { background: var(--o-ok); border-color: var(--o-ok); color: #fff; }
.mj-punto-acc button:nth-child(2).on { background: var(--o-bad); border-color: var(--o-bad); color: #fff; }
.mj-punto-acc button:nth-child(3).on { background: var(--o-muted); border-color: var(--o-muted); color: #fff; }
.mj-rapidos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mj-rapidos button { border: 1px solid var(--o-border-strong); background: var(--o-surface,#fff); border-radius: 99px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.mj-rapidos button:hover { background: var(--o-bg); }
.mj-error { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--o-bad-bg); color: var(--o-bad); font-weight: 600; font-size: 13.5px; }
.mj-hoja > footer { display: flex; gap: 10px; margin-top: 18px; position: sticky; bottom: -20px; background: var(--o-surface); padding: 10px 0 4px; }
.mj-hoja > footer .grande { flex: 1; }

@media (max-width: 640px) {
  .mj-hero { padding: 18px; border-radius: 18px; }
  .mj-hero h1 { font-size: 21px; }
  .mj-anillo { width: 88px; height: 88px; }
  .mj-anillo b { font-size: 24px; }
  .mj-reloj { text-align: left; width: 100%; }
  .mj-reloj b { font-size: 34px; }
  .mj-barra { margin-left: 0; width: 100%; }
  .mj-tarjeta { flex-direction: column; align-items: stretch; }
  .mj-tarjeta-acc { flex-direction: row; justify-content: space-between; align-items: center; }
  .mj-tarjeta-acc .mj-btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .mj * { animation: none !important; transition: none !important; } }

/* ═══════════════ Órdenes de trabajo: lista, tablero y asistente de nueva orden ═══════════════ */
.otl-vista { display: inline-flex; border: 1px solid var(--o-border-strong); border-radius: 10px; overflow: hidden; background: var(--o-surface,#fff); }
.otl-vista button { border: 0; background: none; padding: 8px 14px; font-weight: 600; font-size: 13.5px; color: var(--o-muted); cursor: pointer; }
.otl-vista button + button { border-left: 1px solid var(--o-border); }
.otl-vista button.on { background: var(--o-primary); color: #fff; }

.otl-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 4px 0 14px; }
.otl-kpi { position: relative; text-align: left; background: var(--o-surface); border: 1px solid var(--o-border); border-radius: 16px; padding: 14px 16px 12px; cursor: pointer; overflow: hidden; transition: transform .12s, box-shadow .15s, border-color .15s; box-shadow: var(--o-shadow); font: inherit; color: inherit; }
.otl-kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--o-accent); }
.otl-kpi.info::before { background: var(--o-info); }
.otl-kpi.mal::before { background: var(--o-bad); }
.otl-kpi.warn::before { background: #f59e0b; }
.otl-kpi.ok::before { background: var(--o-ok); }
.otl-kpi:hover { border-color: var(--o-border-strong); }
.otl-kpi.on { border-color: var(--o-text); box-shadow: 0 0 0 2px rgba(15, 23, 42, .08); }
.otl-kpi span { display: block; font-size: 12px; color: var(--o-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.otl-kpi b { display: block; font-size: 28px; font-weight: 800; color: var(--o-text); margin: 2px 0; line-height: 1.1; }
.otl-kpi.mal b { color: var(--o-bad); }
.otl-kpi small { color: var(--o-faint); font-size: 12px; }

.otl-tabla .otl-fila td:first-child { border-left: 4px solid transparent; }
.otl-tabla .otl-fila.prio-alta td:first-child { border-left-color: #f59e0b; }
.otl-tabla .otl-fila.prio-urgente td:first-child { border-left-color: var(--o-bad); }
.otl-origen { display: block; color: var(--o-faint); font-size: 11.5px; margin-top: 2px; }
.otl-desc { display: block; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--o-text); }
.otl-avance { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.otl-avance small { color: var(--o-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.otl-barra { flex: 1; height: 7px; border-radius: 9px; background: var(--o-bg); overflow: hidden; min-width: 60px; }
.otl-barra i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, #3b82b6, #60a5fa); }
.otl-barra i.ok { background: linear-gradient(90deg, #10b981, #047857); }
.otl-retraso { color: var(--o-bad) !important; font-weight: 700; display: inline-flex; gap: 4px; align-items: center; }
.otl-sin { color: var(--o-faint); font-style: italic; font-size: 13px; }
.otl-persona { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; white-space: nowrap; }
.otl-persona i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #3b82b6, #16355b); flex: 0 0 auto; }
.otl-estado { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.otl-prio { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; border-radius: 99px; padding: 2px 8px; }
.otl-prio.p-alta { color: var(--o-warn); background: var(--o-warn-bg); }
.otl-prio.p-urgente { color: #fff; background: var(--o-bad); }
.otl-vacio { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 20px; color: var(--o-muted); }
.otl-vacio strong { color: var(--o-text); }
.otl-ayuda { color: var(--o-muted); font-size: 12.5px; text-align: center; }
.otl-esqueleto { display: grid; gap: 10px; }
.otl-esqueleto div { height: 56px; border-radius: 12px; background: linear-gradient(90deg, #eef2f7, #f8fafc, #eef2f7); background-size: 200% 100%; animation: mj-brillo 1.2s infinite; }

.otl-tablero { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.otl-col { background: var(--o-surface-3,#eef2f7); border-radius: 16px; padding: 10px; min-height: 200px; }
.otl-col > header { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; }
.otl-col > header i { width: 10px; height: 10px; border-radius: 50%; background: var(--o-faint); }
.otl-col.t-info > header i { background: var(--o-info); }
.otl-col.t-bad > header i { background: var(--o-bad); }
.otl-col.t-ok > header i { background: var(--o-ok); }
.otl-col > header b { font-size: 14px; color: var(--o-text); }
.otl-col > header small { margin-left: auto; background: var(--o-surface,#fff); border-radius: 99px; padding: 1px 9px; font-weight: 700; color: var(--o-muted); font-size: 12px; }
.otl-col-cuerpo { display: grid; gap: 8px; max-height: 70vh; overflow-y: auto; padding-right: 2px; }
.otl-col-vacia { text-align: center; color: var(--o-faint); font-size: 13px; padding: 18px; border: 1px dashed var(--o-border-strong); border-radius: 12px; }
.otl-tarjeta { display: grid; gap: 8px; text-align: left; width: 100%; background: var(--o-surface,#fff); border: 1px solid var(--o-border); border-left: 4px solid var(--o-border-strong); border-radius: 12px; padding: 11px 12px; cursor: pointer; font: inherit; color: inherit; transition: transform .12s, box-shadow .15s; }
.otl-tarjeta:hover { border-color: var(--o-border-strong); box-shadow: 0 4px 12px rgba(15, 23, 42, .06); }
.otl-tarjeta.prio-alta { border-left-color: #f59e0b; }
.otl-tarjeta.prio-urgente { border-left-color: var(--o-bad); }
.otl-tarjeta-cab { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--o-muted); }
.otl-tarjeta-tit { font-size: 14px; color: var(--o-text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.otl-tarjeta-veh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.otl-tarjeta-veh small { color: var(--o-muted); font-size: 12px; }
.otl-tarjeta-pie { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--o-muted); }

.nt { width: min(980px, calc(100vw - 24px)); padding: 0 !important; overflow: hidden; display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.nt-cab { display: flex; justify-content: space-between; align-items: flex-start; padding: 20px 24px 10px; }
.nt-paso-txt { font-size: 12px; color: var(--o-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.nt-cab h2 { margin: 4px 0 0; font-size: 22px; font-weight: 800; }
.nt-x { border: 0; background: var(--o-bg); width: 36px; height: 36px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; color: var(--o-muted); }
.nt-pasos { display: flex; gap: 6px; padding: 0 24px 14px; }
.nt-pasos i { flex: 1; height: 4px; border-radius: 9px; background: var(--o-bg); transition: background .2s; }
.nt-pasos i.on { background: var(--o-info); }
.nt > .alert-error { margin: 0 24px 10px; }
.nt-buscar { display: flex; align-items: center; gap: 10px; margin: 0 24px; padding: 4px 14px; border: 2px solid var(--o-border-strong); border-radius: 14px; color: var(--o-muted); }
.nt-buscar:focus-within { border-color: var(--o-info); box-shadow: 0 0 0 4px var(--o-info-bg); }
.nt-buscar input { border: 0; outline: 0; flex: 1; font-size: 17px; padding: 10px 0; background: transparent; color: var(--o-text); }
.nt-ayuda { color: var(--o-muted); font-size: 13px; padding: 8px 0; }
.nt-margen { padding: 8px 24px 0; }
.nt-vehiculos { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; padding: 14px 24px; overflow-y: auto; }
.nt-vehiculos > .nt-ayuda { grid-column: 1 / -1; }
.nt-vehiculo { display: grid; gap: 4px; justify-items: start; text-align: left; border: 1px solid var(--o-border); background: var(--o-surface,#fff); border-radius: 14px; padding: 12px 14px; cursor: pointer; font: inherit; transition: border-color .12s, box-shadow .15s; }
.nt-vehiculo:hover, .nt-vehiculo.on { border-color: var(--o-info); box-shadow: 0 0 0 3px var(--o-info-bg); }
.nt-vehiculo b { font-size: 14.5px; color: var(--o-text); }
.nt-vehiculo small { color: var(--o-muted); font-size: 12px; }
.nt-trabajos { display: grid; grid-template-columns: 1fr 330px; gap: 0; min-height: 0; flex: 1; overflow: hidden; border-top: 1px solid var(--o-border); }
.nt-trabajos > div { padding: 14px 18px 14px 24px; overflow-y: auto; }
.nt-cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.nt-cats button { border: 1px solid var(--o-border-strong); background: var(--o-surface,#fff); border-radius: 99px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--o-muted); cursor: pointer; }
.nt-cats button.on { background: var(--o-primary); border-color: var(--o-primary); color: #fff; }
.nt-filtro { margin-bottom: 12px; }
.nt-catalogo { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.nt-servicio { position: relative; display: grid; gap: 4px; text-align: left; padding: 14px 40px 12px 14px; border: 1px solid var(--o-border); border-radius: 14px; background: var(--o-surface,#fff); cursor: pointer; font: inherit; min-height: 74px; transition: border-color .12s, transform .1s, box-shadow .15s; }
.nt-servicio:hover { border-color: var(--o-info); box-shadow: 0 6px 16px rgba(15, 23, 42, .07); }
.nt-servicio:active { transform: scale(.98); }
.nt-servicio.on { border-color: var(--o-ok); background: var(--o-ok-bg); }
.nt-servicio b { font-size: 13.5px; color: var(--o-text); }
.nt-servicio span { font-size: 12px; color: var(--o-muted); }
.nt-servicio i, .nt-servicio em { position: absolute; right: 10px; top: 10px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 800; }
.nt-servicio i { background: var(--o-bg); color: var(--o-muted); }
.nt-servicio em { background: var(--o-ok); color: #fff; }
.nt-elegidos { background: var(--o-surface-2,#f8fafc); border-left: 1px solid var(--o-border); padding: 14px 16px; overflow-y: auto; }
.nt-elegidos h4 { margin: 0 0 10px; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.nt-elegidos h4 small { background: var(--o-surface,#fff); border: 1px solid var(--o-border); border-radius: 99px; padding: 0 8px; color: var(--o-muted); }
.nt-linea { display: grid; grid-template-columns: 24px 1fr 24px; gap: 8px; align-items: start; padding: 10px; background: var(--o-surface,#fff); border: 1px solid var(--o-border); border-radius: 12px; margin-bottom: 8px; animation: mj-entra .25s ease; }
.nt-n { width: 22px; height: 22px; border-radius: 50%; background: var(--o-info); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.nt-linea-txt { display: grid; gap: 6px; min-width: 0; }
.nt-linea-txt b { font-size: 13.5px; }
.nt-cantidad { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--o-muted); flex-wrap: wrap; }
.nt-cantidad button { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--o-border-strong); background: var(--o-surface,#fff); cursor: pointer; font-weight: 800; }
.nt-precio { width: 72px; height: 28px; border: 1px solid var(--o-border-strong); border-radius: 8px; padding: 0 6px; text-align: right; margin-left: auto; }
.nt-material { height: 32px; font-size: 12.5px; }
.nt-material.falta { border-color: var(--o-bad); background: var(--o-bad-bg); }
.nt-nota { color: var(--o-info); font-size: 11.5px; }
.nt-quitar { border: 0; background: none; cursor: pointer; color: var(--o-faint); padding: 2px; }
.nt-quitar:hover { color: var(--o-bad); }
.nt-plan { display: grid; grid-template-columns: 1fr 300px; gap: 20px; padding: 6px 24px 10px; overflow-y: auto; }
.nt-prioridad { display: flex; gap: 6px; }
.nt-prioridad button { flex: 1; border: 1px solid var(--o-border-strong); background: var(--o-surface,#fff); border-radius: 10px; padding: 9px 6px; font-weight: 700; font-size: 13px; cursor: pointer; color: var(--o-muted); }
.nt-prioridad button.on { color: #fff; background: var(--o-primary); border-color: var(--o-primary); }
.nt-prioridad button.on.p-alta { background: #f59e0b; border-color: #f59e0b; }
.nt-prioridad button.on.p-urgente { background: var(--o-bad); border-color: var(--o-bad); }
.nt-resumen { display: grid; gap: 6px; align-content: start; background: linear-gradient(180deg, #f8fafc, #fff); border: 1px solid var(--o-border); border-radius: 16px; padding: 16px; justify-items: start; }
.nt-resumen > b { font-size: 15px; }
.nt-resumen > small { color: var(--o-muted); }
.nt-resumen ul { list-style: none; padding: 0; margin: 8px 0 0; width: 100%; display: grid; gap: 6px; }
.nt-resumen li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.nt-resumen li em { font-style: normal; font-weight: 700; white-space: nowrap; }
.nt-total { display: flex; justify-content: space-between; width: 100%; border-top: 1px solid var(--o-border); padding-top: 8px; margin-top: 4px; font-size: 13px; color: var(--o-muted); }
.nt-total b { color: var(--o-text); font-size: 16px; }
.nt-pie { display: flex; gap: 10px; align-items: center; padding: 14px 24px; border-top: 1px solid var(--o-border); background: var(--o-surface,#fff); }
.nt-pie > span { flex: 1; }
.nt-pie .btn-primary { min-width: 140px; }

@media (max-width: 1100px) { .otl-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .otl-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .otl-kpi b { font-size: 22px; }
  .otl-tablero { grid-template-columns: repeat(4, 82vw); }
  .nt-trabajos, .nt-plan { grid-template-columns: 1fr; }
  .nt-elegidos { border-left: 0; border-top: 1px solid var(--o-border); }
  .nt-trabajos { overflow-y: auto; }
}

/* ═══════════════ Centro de control (supervisor) ═══════════════ */
.cc-vivo { display: inline-flex; align-items: center; gap: 7px; }
.cc-vivo i { width: 8px; height: 8px; border-radius: 50%; background: var(--o-ok); animation: mj-latido 1.6s infinite; }
.cc-vivo i.mal { background: var(--o-bad); animation: none; }
.cc-kpis { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.cc-kpi { display: block; text-align: left; text-decoration: none; background: var(--o-surface); border: 1px solid var(--o-border); border-radius: 14px; padding: 12px 14px; box-shadow: var(--o-shadow); font: inherit; color: inherit; cursor: default; border-top: 3px solid var(--o-border-strong); }
button.cc-kpi, a.cc-kpi { cursor: pointer; transition: transform .12s, box-shadow .15s; }
button.cc-kpi:hover, a.cc-kpi:hover { border-color: var(--o-border-strong); }
.cc-kpi span { display: block; font-size: 11.5px; font-weight: 700; color: var(--o-muted); text-transform: uppercase; letter-spacing: .03em; }
.cc-kpi b { display: block; font-size: 26px; font-weight: 800; color: var(--o-text); margin-top: 4px; line-height: 1.1; }
.cc-kpi.info { border-top-color: var(--o-info); }
.cc-kpi.ok { border-top-color: var(--o-ok); }
.cc-kpi.warn { border-top-color: #f59e0b; }
.cc-kpi.warn b { color: var(--o-warn); }
.cc-kpi.mal { border-top-color: var(--o-bad); background: linear-gradient(180deg, var(--o-bad-bg), #fff 60%); }
.cc-kpi.mal b { color: var(--o-bad); }
.cc-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; margin-bottom: 16px; align-items: start; }
.cc-panel { background: var(--o-surface); border: 1px solid var(--o-border); border-radius: 16px; padding: 16px; box-shadow: var(--o-shadow); min-width: 0; }
.cc-panel > header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cc-panel h3 { margin: 0; font-size: 16px; font-weight: 800; }
.cc-panel > header small { color: var(--o-muted); font-size: 12.5px; }
.cc-equipo { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; max-height: 560px; overflow-y: auto; }
.cc-persona { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--o-border); border-radius: 14px; background: var(--o-surface,#fff); }
.cc-persona.est-trabaja { border-color: var(--o-ok-b,#a7f3d0); background: linear-gradient(90deg, #ecfdf5, #fff 50%); }
.cc-persona.est-pausa { border-color: var(--o-warn-b,#fde68a); background: linear-gradient(90deg, #fffbeb, #fff 50%); }
.cc-persona.est-tarde { border-color: var(--o-bad-b); background: linear-gradient(90deg, var(--o-bad-bg), #fff 50%); }
.cc-avatar { position: relative; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #3b82b6, #16355b); color: #fff; font-weight: 800; font-size: 14px; }
.cc-avatar i { position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--o-border,#fff); background: #cbd5e1; }
.est-trabaja .cc-avatar i { background: var(--o-ok); animation: mj-latido 1.6s infinite; }
.est-pausa .cc-avatar i { background: #f59e0b; }
.est-tarde .cc-avatar i { background: var(--o-bad); }
.cc-persona-txt { min-width: 0; display: grid; gap: 3px; }
.cc-persona-txt > b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-tarea { font-size: 12.5px; color: var(--o-text-2,#334155); text-decoration: none; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cc-tarea:hover { text-decoration: underline; }
.cc-tiempo { display: flex; align-items: center; gap: 8px; }
.cc-tiempo small { font-size: 11.5px; color: var(--o-muted); white-space: nowrap; }
.otl-barra i.mal { background: var(--o-bad); }
.cc-libre { font-size: 12.5px; color: var(--o-faint); }
.cc-hechas { text-align: center; min-width: 40px; }
.cc-hechas b { display: block; font-size: 20px; font-weight: 800; color: var(--o-ok); line-height: 1; }
.cc-hechas small { font-size: 10.5px; color: var(--o-muted); text-transform: uppercase; }
.cc-tabs { margin: 0 0 10px; }
.cc-lista { display: grid; gap: 8px; max-height: 520px; overflow-y: auto; }
.cc-item { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--o-border); border-left: 4px solid var(--o-border-strong); border-radius: 12px; text-decoration: none; color: inherit; transition: background .12s; }
.cc-item:hover { background: var(--o-bg); }
.cc-item.mal { border-left-color: var(--o-bad); }
.cc-item.mal > svg { color: var(--o-bad); }
.cc-item.warn { border-left-color: #f59e0b; }
.cc-item.warn > svg { color: var(--o-warn); }
.cc-item b { font-size: 13.5px; }
.cc-item p { margin: 2px 0; font-size: 13px; color: var(--o-text-2,#334155); }
.cc-item small { color: var(--o-muted); font-size: 12px; }
.cc-ir { font-size: 12.5px; font-weight: 700; color: var(--o-info); align-self: center; }
.cc-bien { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 22px; color: var(--o-ok); font-weight: 600; background: var(--o-ok-bg); border-radius: 12px; }
.cc-zonas { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.cc-zona { border: 1px solid var(--o-border); border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; }
.cc-zona.llena { border-color: var(--o-bad-b); background: var(--o-bad-bg); }
.cc-zona small { color: var(--o-muted); font-size: 12px; }
.cc-actividad { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 360px; overflow-y: auto; }
.cc-actividad li { display: grid; grid-template-columns: 46px 1fr; gap: 8px; padding: 7px 4px; border-bottom: 1px solid var(--o-border); font-size: 13px; }
.cc-actividad time { color: var(--o-muted); font-variant-numeric: tabular-nums; }
.cc-actividad a { color: var(--o-info); text-decoration: none; }
@media (max-width: 1280px) { .cc-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 980px) { .cc-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .cc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cc-equipo { grid-template-columns: 1fr; } }

/* ═══════════════ Catálogo de servicios ═══════════════ */
.ms-catalogo { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.ms-servicio { --c: #64748b; position: relative; background: var(--o-surface); border: 1px solid var(--o-border); border-radius: 16px; box-shadow: var(--o-shadow); overflow: hidden; transition: transform .12s, box-shadow .15s; display: flex; flex-direction: column; }
.ms-servicio::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--c); }
.ms-servicio:hover { border-color: var(--o-border-strong); }
.ms-servicio.off { opacity: .6; }
.ms-servicio.cat-lavado { --c: #0ea5e9; } .ms-servicio.cat-bateria { --c: #f59e0b; } .ms-servicio.cat-neumatico { --c: #475569; }
.ms-servicio.cat-repostaje { --c: #ef4444; } .ms-servicio.cat-reparacion { --c: #8b5cf6; } .ms-servicio.cat-peritacion { --c: #ec4899; }
.ms-servicio.cat-preparacion { --c: #10b981; }
.ms-servicio > header { display: flex; align-items: center; gap: 8px; padding: 12px 12px 0 16px; }
.ms-servicio > header .acc-fila { margin-left: auto; }
.ms-cat { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--c); }
.ms-rapido { font-size: 11px; font-weight: 700; color: var(--o-warn,#b45309); background: var(--o-warn-bg,#fffbeb); border-radius: 99px; padding: 1px 8px; }
.ms-cuerpo { display: grid; gap: 8px; text-align: left; padding: 6px 16px 14px; background: none; border: 0; cursor: pointer; font: inherit; color: inherit; flex: 1; align-content: start; }
.ms-cuerpo h3 { margin: 0; font-size: 16px; font-weight: 800; color: var(--o-text); }
.ms-precio { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.ms-precio b { font-size: 20px; font-weight: 800; }
.ms-precio span { color: var(--o-muted); font-size: 12.5px; }
.ms-precio em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--o-ok); background: var(--o-ok-bg); border-radius: 99px; padding: 1px 8px; }
.ms-precio em.mal { color: var(--o-bad); background: var(--o-bad-bg); }
.ms-datos, .ms-requisitos { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12.5px; color: var(--o-muted); }
.ms-datos span, .ms-requisitos span { display: inline-flex; gap: 4px; align-items: center; }
.ms-requisitos span { background: var(--o-bg); border-radius: 8px; padding: 3px 8px; color: var(--o-text-2,#334155); }
.ms-editor { width: min(820px, calc(100vw - 24px)); }
.ms-sec { border: 1px solid var(--o-border); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; }
.ms-sec h4 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--o-muted); }
.ms-sec .form-grid.tres { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ms-margen { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--o-ok-bg); color: var(--o-ok); font-size: 13.5px; }
.ms-margen.mal { background: var(--o-bad-bg); color: var(--o-bad); }
.ms-margen small { display: block; color: var(--o-muted); margin-top: 2px; }
.ms-opciones { display: grid; gap: 8px; margin-top: 12px; }
.ms-label { display: block; font-size: 12px; font-weight: 700; color: var(--o-muted,#475569); margin: 14px 0 6px; }
.ms-label small { font-weight: 500; color: var(--o-muted); }
.ms-checklist { list-style: none; counter-reset: punto; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.ms-checklist li { counter-increment: punto; display: grid; grid-template-columns: 1fr auto auto auto; gap: 6px; align-items: center; padding: 8px 10px; border: 1px solid var(--o-border); border-radius: 10px; background: var(--o-surface-2,#f8fafc); font-size: 13.5px; }
.ms-checklist li span::before { content: counter(punto) ". "; color: var(--o-muted); font-weight: 700; }
.ms-checklist button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--o-border-strong); background: var(--o-surface,#fff); cursor: pointer; }
.ms-checklist button:disabled { opacity: .3; cursor: default; }
.ms-checklist button.quitar:hover { color: var(--o-bad); border-color: var(--o-bad-b); }
.ms-punto-nuevo { display: flex; gap: 8px; }
.ms-sugeridos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ms-sugeridos button { border: 1px dashed var(--o-border-strong); background: var(--o-surface,#fff); border-radius: 99px; padding: 4px 10px; font-size: 12.5px; color: var(--o-muted); cursor: pointer; }
.ms-sugeridos button:hover { border-style: solid; color: var(--o-text); }
.ms-activo { margin: 4px 0; }
@media (max-width: 640px) { .ms-sec .form-grid.tres { grid-template-columns: 1fr; } }
.ms-cargando { grid-column: 1 / -1; }

.op-motivo { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; width: 100%; margin-top: 8px; padding: 10px; border: 1px solid var(--o-warn-b); background: var(--o-warn-bg); border-radius: 10px; }
.op-motivo label { font-weight: 700; font-size: 13px; }
.op-motivo input { flex: 1; min-width: 200px; }

.periodicos-acciones { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.ot-panel-acc { display: flex; justify-content: flex-end; padding: 8px 10px 0; }

/* ═══════════════ Planificación del día ═══════════════ */
.pl-dia { display: inline-flex; align-items: center; border: 1px solid var(--o-border-strong); border-radius: 10px; background: var(--o-surface,#fff); overflow: hidden; }
.pl-dia button { border: 0; background: none; height: 36px; min-width: 34px; font-size: 18px; color: var(--o-muted); cursor: pointer; }
.pl-dia button:hover { background: var(--o-soft, var(--o-surface-3,#f1f5f9)); color: var(--o-text); }
.pl-dia input { border: 0; border-left: 1px solid var(--o-border); border-right: 1px solid var(--o-border); height: 36px; padding: 0 8px; font: inherit; font-size: 13.5px; color: var(--o-text); background: var(--o-surface,#fff); }
.pl-dia .pl-hoy { font-size: 13px; font-weight: 700; padding: 0 12px; color: var(--o-info); border-left: 1px solid var(--o-border); }
.pl-filtros { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 4px 0 12px; }
.pl-filtros .filter-client { width: min(360px, 100%); }
.pl-filtro-on { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--o-info-b,#bfdbfe); background: var(--o-info-bg,#eff6ff); color: var(--o-info); border-radius: 999px; padding: 6px 12px; font-weight: 600; font-size: 13px; cursor: pointer; }
.pl-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.pl-kpi-fijo { cursor: default; }
.pl-tablero { display: flex; gap: 14px; overflow-x: auto; padding: 2px 2px 14px; align-items: flex-start; scroll-snap-type: x proximity; }
.pl-col { flex: 0 0 320px; scroll-snap-align: start; background: var(--o-surface-2,#f8fafc); border: 1px solid var(--o-border); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.pl-col.sin { background: var(--o-bad-bg,#fff7f7); border-color: var(--o-bad-b,#fecaca); }
.pl-col.libra { opacity: .7; }
.pl-col.sobre { border-color: var(--o-bad-b,#fca5a5); }
.pl-col header, .pl-vehiculo header { display: flex; align-items: center; gap: 10px; }
.pl-avatar { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #16355b; color: #fff; font-weight: 700; font-size: 13px; }
.pl-col.sin .pl-avatar { background: #dc2626; }
.pl-avatar.coche { background: var(--o-info-bg,#e0ecf8); color: var(--o-heading,#16355b); }
.pl-col-nombre { min-width: 0; flex: 1; }
.pl-col-nombre b { display: block; font-size: 14.5px; color: var(--o-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-col-nombre small { display: block; color: var(--o-muted); font-size: 12px; }
.pl-cuenta { min-width: 28px; height: 24px; padding: 0 8px; border-radius: 999px; background: var(--o-surface,#fff); border: 1px solid var(--o-border); display: grid; place-items: center; font-weight: 700; font-size: 12.5px; color: var(--o-text); }
.pl-carga small { display: block; margin-top: 4px; color: var(--o-muted); font-size: 12px; }
.pl-barra { height: 7px; border-radius: 999px; background: var(--o-surface-3,#e2e8f0); overflow: hidden; }
.pl-barra span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #2b6a8f, #16355b); transition: width .4s ease; }
.pl-barra span.alto { background: #d97706; }
.pl-barra span.mal { background: #dc2626; }
.pl-tareas { display: flex; flex-direction: column; gap: 8px; }
.pl-vacio { text-align: center; color: var(--o-faint); font-size: 13px; padding: 18px 8px; border: 1px dashed var(--o-border-strong); border-radius: 12px; }
.pl-tarea { position: relative; display: flex; gap: 10px; background: var(--o-surface,#fff); border: 1px solid var(--o-border); border-left: 4px solid #94a3b8; border-radius: 12px; padding: 10px 10px 10px 10px; }
.pl-tarea.ready { border-left-color: #2b6a8f; }
.pl-tarea.unassigned { border-left-color: #dc2626; }
.pl-tarea.running { border-left-color: var(--o-info); background: var(--o-info-bg,#f5f9ff); }
.pl-tarea.done { border-left-color: var(--o-ok); opacity: .7; }
.pl-tarea.issue, .pl-tarea.blocked { border-left-color: #f59e0b; background: var(--o-warn-bg,#fffbeb); }
.pl-hora { flex: 0 0 48px; text-align: center; }
.pl-hora b { display: block; font-size: 15px; font-weight: 800; color: var(--o-text); font-variant-numeric: tabular-nums; }
.pl-hora small { color: var(--o-faint); font-size: 11.5px; }
.pl-cuerpo { min-width: 0; flex: 1; }
.pl-titulo { display: flex; justify-content: space-between; gap: 6px; align-items: flex-start; padding-right: 26px; }
.pl-titulo strong { font-size: 13.5px; color: var(--o-text); line-height: 1.3; }
.pl-titulo .badge-estado { flex: 0 0 auto; }
.pl-sub { color: var(--o-muted); font-size: 12.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.pl-chips span, .pl-chips a { display: inline-flex; gap: 4px; align-items: center; background: var(--o-surface-3,#f1f5f9); color: var(--o-muted,#475569); border-radius: 999px; padding: 2px 8px; font-size: 11.5px; text-decoration: none; }
.pl-chips span.urg { background: var(--o-bad-bg,#fee2e2); color: var(--o-bad,#b91c1c); font-weight: 700; }
.pl-chips .pl-orden { background: var(--o-info-bg,#e0ecf8); color: var(--o-heading,#16355b); font-weight: 600; }
.pl-mover { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--o-muted); display: grid; place-items: center; cursor: pointer; }
.pl-mover:hover, .pl-tarea:hover .pl-mover { border-color: var(--o-border); background: var(--o-surface,#fff); color: var(--o-info); }
.pl-vehiculo { background: var(--o-surface); border: 1px solid var(--o-border); border-radius: 16px; padding: 12px 14px; box-shadow: var(--o-shadow); }
.pl-secuencia { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; margin-top: 10px; }
@media (max-width: 1100px) { .pl-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .pl-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pl-col { flex-basis: 86vw; } .pl-dia input { width: 128px; } }

/* ═══════════════ Productividad del equipo ═══════════════ */
.prod-operator { width: 230px; }
.prod-fechas { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 0 0 12px; }
.prod-fechas label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--o-muted); }
.prod-aviso { background: var(--o-warn-bg,#fff7ed); border: 1px solid var(--o-warn-b,#fed7aa); color: var(--o-warn,#9a3412); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; font-size: 13.5px; }
.prod-kpis .otl-kpi { cursor: default; }
.prod-grid { display: grid; grid-template-columns: minmax(320px, .8fr) minmax(0, 1.2fr); gap: 14px; align-items: start; }
.prod-panel { background: var(--o-surface); border: 1px solid var(--o-border); border-radius: 16px; padding: 16px 18px; box-shadow: var(--o-shadow); }
.prod-panel > header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.prod-panel h2 { margin: 0; font-size: 16px; font-weight: 700; color: var(--o-text); }
.prod-panel > header small { color: var(--o-faint); font-size: 12px; }
.prod-columnas { display: flex; gap: 6px; align-items: stretch; height: 220px; overflow-x: auto; }
.prod-columna { flex: 1 0 30px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.prod-columna b { font-size: 12px; color: var(--o-text); font-variant-numeric: tabular-nums; }
.prod-columna small { font-size: 11px; color: var(--o-faint); }
.prod-pista { flex: 1; width: 70%; max-width: 34px; display: flex; align-items: flex-end; background: var(--o-surface-3,#f1f5f9); border-radius: 8px; overflow: hidden; }
.prod-pista span { display: block; width: 100%; background: linear-gradient(180deg, #2b6a8f, #16355b); border-radius: 8px 8px 0 0; transition: height .4s ease; }
.prod-columna.hoy .prod-pista span { background: linear-gradient(180deg, #34d399, #047857); }
.prod-columna.hoy small { color: var(--o-ok); font-weight: 700; }
.prod-equipo { display: flex; flex-direction: column; gap: 12px; max-height: 520px; overflow: auto; padding-right: 4px; }
.prod-persona { display: flex; gap: 12px; align-items: flex-start; }
.prod-persona-cuerpo { flex: 1; min-width: 0; }
.prod-persona-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 5px; }
.prod-persona-top b { font-size: 14px; color: var(--o-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prod-total { font-weight: 800; font-size: 15px; color: var(--o-text); white-space: nowrap; }
.prod-total small { font-weight: 500; font-size: 12px; color: var(--o-faint); }
.prod-desglose { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; font-size: 12px; color: var(--o-muted); }
.prod-desglose span { display: inline-flex; gap: 4px; align-items: center; }
.prod-desglose .abiertas { color: var(--o-warn,#b45309); font-weight: 600; }
.prod-desglose .ultima { margin-left: auto; color: var(--o-faint); }
.prod-linea { display: flex; flex-direction: column; max-height: 420px; overflow: auto; }
.prod-evento { display: grid; grid-template-columns: 92px 14px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--o-border); font-size: 13px; }
.prod-evento:last-child { border-bottom: 0; }
.prod-hora { font-variant-numeric: tabular-nums; color: var(--o-faint); font-size: 12px; }
.prod-punto { width: 9px; height: 9px; border-radius: 50%; background: #2b6a8f; box-shadow: 0 0 0 3px #e0ecf8; }
.prod-evento-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prod-evento-txt span { color: var(--o-muted); }
@media (max-width: 900px) { .prod-grid { grid-template-columns: 1fr; } .prod-operator { width: 100%; } .prod-evento { grid-template-columns: 80px 14px minmax(0, 1fr); } .prod-evento .btn-link-sm { grid-column: 3; justify-self: start; } }

/* ═══════════════ Tareas operativas (gestor) ═══════════════ */
.to-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.to-gps { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; font-weight: 600; color: var(--o-muted); padding: 6px 10px; border-radius: 999px; background: var(--o-surface-3,#f1f5f9); }
.to-gps i { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; }
.to-gps.ok { color: var(--o-ok); background: var(--o-ok-bg,#ecfdf5); }
.to-gps.ok i { background: var(--o-ok); box-shadow: 0 0 0 3px rgba(16, 185, 129, .2); }
.to-filtros { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.to-ambito { display: inline-flex; border: 1px solid var(--o-border-strong); border-radius: 10px; overflow: hidden; background: var(--o-surface,#fff); }
.to-ambito button { border: 0; background: none; padding: 8px 14px; font-weight: 600; font-size: 13.5px; color: var(--o-muted); cursor: pointer; }
.to-ambito button + button { border-left: 1px solid var(--o-border); }
.to-ambito button.on { background: var(--o-primary); color: #fff; }
.to-buscar { margin-left: auto; min-width: 280px; }
.to-vacio { display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; padding: 40px 20px; background: var(--o-surface); border: 1px dashed var(--o-border-strong); border-radius: 16px; color: var(--o-muted); }
.to-vacio b { color: var(--o-text); font-size: 15px; }
a.to-ficha { color: var(--o-info); font-weight: 600; text-decoration: none; }
a.to-ficha:hover { text-decoration: underline; }
@media (max-width: 900px) { .to-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .to-buscar { margin-left: 0; min-width: 0; width: 100%; } }

/* ═══════════════ Yard Care ═══════════════ */
.yc-cuidados { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.yc-cuidado { --yc: #64748b; --yc-bg: #f1f5f9; background: var(--o-surface); border: 1px solid var(--o-border); border-radius: 16px; padding: 14px 16px; box-shadow: var(--o-shadow); position: relative; overflow: hidden; opacity: .65; transition: opacity .15s; }
.yc-cuidado.on { opacity: 1; }
.yc-cuidado::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--yc); }
.yc-cuidado.bateria { --yc: #d97706; --yc-bg: #fef3c7; } .yc-cuidado.ev { --yc: #059669; --yc-bg: #d1fae5; } .yc-cuidado.neumaticos { --yc: #2b6a8f; --yc-bg: #e0ecf8; }
.yc-cuidado header { display: flex; gap: 10px; align-items: flex-start; }
.yc-cuidado header > div { flex: 1; min-width: 0; }
.yc-cuidado header b { display: block; font-size: 15px; color: var(--o-text); }
.yc-cuidado header small { color: var(--o-muted); font-size: 12.5px; }
.yc-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--yc); background: var(--yc-bg); flex: 0 0 auto; }
.yc-cifra { display: flex; align-items: baseline; gap: 8px; margin: 12px 0 8px; }
.yc-cifra b { font-size: 30px; font-weight: 800; color: var(--o-text); line-height: 1; }
.yc-cifra span { color: var(--o-muted); font-size: 13px; }
.yc-umbral { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--o-muted); }
.yc-umbral input { width: 64px; height: 30px; border: 1px solid var(--o-border-strong); border-radius: 8px; padding: 0 8px; font: inherit; text-align: center; }
.yc-switch { position: relative; width: 38px; height: 22px; flex: 0 0 auto; cursor: pointer; }
.yc-switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.yc-switch span { position: absolute; inset: 0; border-radius: 999px; background: #cbd5e1; transition: background .15s; }
.yc-switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--o-surface,#fff); transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.yc-switch input:checked + span { background: var(--yc); }
.yc-switch input:checked + span::after { transform: translateX(16px); }
.yc-barra { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--o-surface); border: 1px solid var(--o-border); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; }
.yc-barra.activa { border-color: var(--o-info-b,#93c5fd); background: var(--o-info-bg,#f5f9ff); }
.yc-barra-acc { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.yc-barra-acc select { width: 260px; }
.yc-lista { display: flex; flex-direction: column; gap: 8px; }
.yc-fila { display: grid; grid-template-columns: auto 100px minmax(180px, 1.3fr) minmax(160px, 1.4fr) 110px 190px auto; gap: 12px; align-items: center; background: var(--o-surface); border: 1px solid var(--o-border); border-radius: 12px; padding: 10px 14px; }
.yc-fila.sin-check { grid-template-columns: 100px minmax(180px, 1.3fr) minmax(160px, 1.4fr) 110px 190px auto; }
.yc-fila.critica { border-left: 4px solid #dc2626; }
.yc-fila.marcada { border-color: var(--o-info-b,#93c5fd); background: var(--o-info-bg,#f5f9ff); }
.yc-tipo { justify-self: start; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--o-surface-3,#f1f5f9); color: var(--o-muted,#475569); }
.yc-tipo.bateria { background: var(--o-warn-bg,#fef3c7); color: var(--o-warn,#92400e); } .yc-tipo.ev { background: var(--o-ok-bg,#d1fae5); color: var(--o-ok,#065f46); } .yc-tipo.neumaticos { background: var(--o-info-bg,#e0ecf8); color: var(--o-heading,#16355b); }
.yc-veh { min-width: 0; } .yc-veh b { display: block; color: var(--o-text); } .yc-veh small { display: block; color: var(--o-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yc-motivo { color: var(--o-text); font-size: 13px; }
.yc-dato { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--o-muted); }
@media (max-width: 1000px) { .yc-cuidados { grid-template-columns: 1fr; } .yc-fila, .yc-fila.sin-check { grid-template-columns: auto 1fr; } .yc-fila > :nth-child(n+3) { grid-column: 2; } .yc-barra-acc select { width: 100%; } }

/* ═══════════════ Taller ═══════════════ */
.tl-filtros { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.tl-buscar { flex: 1; min-width: 240px; max-width: 420px; }
.tl-mas { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; background: var(--o-surface); border: 1px solid var(--o-border); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.tl-mas .form-group { margin: 0; width: 170px; }
.tl-mas .tl-vins { flex: 1; min-width: 220px; width: auto; }
.tl-mas .tl-vins textarea { min-height: 36px; height: 36px; resize: vertical; }
.tl-mas-acc { display: flex; gap: 8px; margin-left: auto; }
.page-body .campaign-row { border-radius: 12px; padding: 12px 14px; }
.tl-camp { display: flex; flex-direction: column; gap: 3px; width: 100%; min-width: 0; }
.tl-camp-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tl-camp-top em { font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--o-surface-3,#f1f5f9); color: var(--o-muted,#475569); }
.tl-camp-top em.ok { background: var(--o-ok-bg,#dcfce7); color: var(--o-ok,#166534); }
.tl-titulo { color: var(--o-text) !important; font-size: 13px !important; }
.tl-barra { margin: 6px 0 2px; height: 6px; }
.tl-barra span { background: linear-gradient(90deg, #34d399, #047857); }
.tl-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 12px 0; }
.tl-kpis .otl-kpi { cursor: default; }
.tl-salida { font-size: 20px !important; }
@media (max-width: 1100px) { .tl-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .tl-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tl-mas .form-group { width: 100%; } }

/* ═══════════════ Campañas y plantillas ═══════════════ */
.cf-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 4px 0 12px; }
.cf-tabs button { display: flex; gap: 12px; align-items: flex-start; text-align: left; background: var(--o-surface); border: 1px solid var(--o-border); border-radius: 14px; padding: 12px 14px; cursor: pointer; font: inherit; color: inherit; box-shadow: var(--o-shadow); transition: border-color .15s; }
.cf-tabs button:hover { border-color: var(--o-border-strong); }
.cf-tabs button.on { border-color: #16355b; box-shadow: 0 0 0 2px rgba(22, 53, 91, .12); }
.cf-tabs b { display: flex; gap: 8px; align-items: center; font-size: 14.5px; color: var(--o-text); }
.cf-tabs b em { font-style: normal; font-size: 12px; font-weight: 700; background: var(--o-surface-3,#f1f5f9); color: var(--o-muted); border-radius: 999px; padding: 1px 8px; }
.cf-tabs button.on b em { background: #16355b; color: #fff; }
.cf-tabs small { display: block; color: var(--o-muted); font-size: 12.5px; margin-top: 2px; }
.cf-ico { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; background: var(--o-info-bg,#e0ecf8); color: var(--o-heading,#16355b); }
.cf-tabs button.on .cf-ico { background: #16355b; color: #fff; }
.cf-filtros { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.cf-buscar { flex: 1; min-width: 260px; max-width: 520px; }
@media (max-width: 900px) { .cf-tabs { grid-template-columns: 1fr; } .cf-tabs small { display: none; } }

/* ═══════════════ Habilidades ═══════════════ */
.hb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.hb-card { display: flex; flex-direction: column; gap: 10px; background: var(--o-surface); border: 1px solid var(--o-border); border-radius: 16px; padding: 14px 16px; box-shadow: var(--o-shadow); }
.hb-card.off { opacity: .6; }
.hb-card header { display: flex; gap: 10px; align-items: center; }
.hb-ico { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, #2b6a8f, #16355b); color: #fff; font-weight: 800; font-size: 16px; }
.hb-nombre { flex: 1; min-width: 0; }
.hb-nombre b { display: block; color: var(--o-text); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-nombre small { color: var(--o-faint); font-size: 11.5px; }
.hb-card p { margin: 0; color: var(--o-muted); font-size: 13px; line-height: 1.45; flex: 1; }
.hb-card footer { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--o-border); padding-top: 10px; }
.hb-avatares { display: inline-flex; }
.hb-avatares i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--o-info-bg,#e0ecf8); color: var(--o-heading,#16355b); font-size: 10.5px; font-weight: 700; border: 2px solid var(--o-border,#fff); margin-left: -6px; }
.hb-avatares i:first-child { margin-left: 0; }
.hb-avatares i.mas { background: var(--o-surface-3,#f1f5f9); color: var(--o-muted); }
.hb-cuantos { color: var(--o-muted); font-size: 12.5px; }
.hb-nadie { color: var(--o-faint); font-size: 12.5px; font-style: italic; }

/* ═══════════════ Operarios ═══════════════ */
.op-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.op-filtros { margin-bottom: 12px; }
.op-buscar { max-width: 460px; width: 100%; }
.op-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.op-card { display: flex; flex-direction: column; gap: 10px; background: var(--o-surface); border: 1px solid var(--o-border); border-radius: 16px; padding: 14px 16px; box-shadow: var(--o-shadow); cursor: pointer; transition: border-color .15s; }
.op-card:hover { border-color: #16355b; }
.op-card.baja { opacity: .6; }
.op-card header { display: flex; gap: 10px; align-items: center; }
.op-avatar { position: relative; width: 42px; height: 42px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #2b6a8f, #16355b); color: #fff; font-weight: 700; }
.op-avatar i { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: #cbd5e1; border: 2px solid var(--o-border,#fff); }
.op-avatar i.on { background: #10b981; }
.op-nombre { flex: 1; min-width: 0; }
.op-nombre b { display: block; color: var(--o-text); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-nombre small { display: block; color: var(--o-muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-habs { display: flex; flex-wrap: wrap; gap: 5px; min-height: 24px; }
.op-habs span { background: var(--o-info-bg,#e0ecf8); color: var(--o-heading,#16355b); border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 600; }
.op-habs span.vacia { background: var(--o-warn-bg,#fff7ed); color: var(--o-warn,#9a3412); font-weight: 500; }
.op-datos { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--o-muted); font-size: 12.5px; }
.op-datos span { display: inline-flex; gap: 5px; align-items: center; }
.op-card footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--o-border); padding-top: 10px; }
.op-carga { font-weight: 700; font-size: 13px; color: var(--o-info,#1d4ed8); }
.op-carga.libre { color: var(--o-ok); }
.op-card footer small { color: var(--o-faint); font-size: 12px; }
@media (max-width: 900px) { .op-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ═══════════════ Compras: órdenes a proveedor ═══════════════ */
.cp-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cp-fijo { cursor: default; }
.cp-filtros { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.cp-buscar { flex: 1; min-width: 220px; max-width: 360px; }
.cp-fecha { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--o-muted); }
.cp-fecha input { width: 150px; }
.cp-lista { display: flex; flex-direction: column; gap: 8px; }
.cp-fila { display: grid; grid-template-columns: 140px minmax(200px, 1.5fr) 230px 130px 120px 120px; gap: 14px; align-items: center; background: var(--o-surface); border: 1px solid var(--o-border); border-radius: 12px; padding: 10px 14px; cursor: pointer; transition: border-color .15s; }
.cp-fila:hover { border-color: #16355b; }
.cp-fila.validar { border-left: 4px solid #f59e0b; }
.cp-fila b { color: var(--o-text); }
.cp-fila small { display: block; color: var(--o-muted); font-size: 12px; }
.cp-num b, .cp-prov b { display: block; }
.cp-prov { min-width: 0; } .cp-prov small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-pasos { display: flex; align-items: center; gap: 4px; }
.cp-pasos i { width: 18px; height: 5px; border-radius: 999px; background: var(--o-surface-3,#e2e8f0); }
.cp-pasos i.hecho { background: #10b981; }
.cp-pasos i.actual { background: #16355b; }
.cp-pasos i.mal { background: #fca5a5; }
.cp-pasos .badge-estado { margin-left: 6px; }
.cp-imp { text-align: right; } .cp-imp b { font-variant-numeric: tabular-nums; }
.cp-acc { text-align: right; }
@media (max-width: 1100px) { .cp-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cp-fila { grid-template-columns: 1fr 1fr; } .cp-imp, .cp-acc { text-align: left; } }
@media (max-width: 640px) { .cp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cp-fila { grid-template-columns: 1fr; } }
.yc-mas { align-self: center; margin-top: 6px; }

/* asistente: varios vehículos */
.nt-modo { margin: 0 0 12px; }
.nt-lote { display: flex; flex-direction: column; gap: 10px; }
.nt-origen { flex-wrap: wrap; }
.nt-vins { min-height: 120px; }
.nt-lote-res { display: flex; flex-direction: column; gap: 6px; background: var(--o-surface-2,#f8fafc); border: 1px solid var(--o-border); border-radius: 12px; padding: 10px 12px; }
.nt-lote-res b { color: var(--o-text); }
.nt-aviso { color: var(--o-warn,#9a3412); font-size: 12.5px; }
.nt-lote-lista { display: flex; flex-wrap: wrap; gap: 4px; max-height: 120px; overflow: auto; }
.nt-lote-lista span { font-family: ui-monospace, monospace; font-size: 11.5px; background: var(--o-info-bg,#e0ecf8); color: var(--o-heading,#16355b); border-radius: 6px; padding: 2px 6px; }
.nt-lote-lista span.rep { background: var(--o-surface-3,#f1f5f9); color: var(--o-faint); text-decoration: line-through; }
.nt-lote-lista span.mas { background: none; color: var(--o-muted); }

/* ═══════════════ Verifactu (AEAT) ═══════════════ */
.vf-cadena { display: flex; gap: 10px; align-items: center; border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; font-size: 13.5px; }
.vf-cadena.ok { background: var(--o-ok-bg,#ecfdf5); border: 1px solid var(--o-ok-b,#a7f3d0); color: var(--o-ok,#065f46); }
.vf-cadena.mal { background: var(--o-bad-bg,#fef2f2); border: 1px solid var(--o-bad-b,#fecaca); color: var(--o-bad,#991b1b); }
.vf-empresas { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; margin-bottom: 16px; }
.vf-empresa { display: flex; flex-direction: column; gap: 10px; background: var(--o-surface); border: 1px solid var(--o-border); border-radius: 16px; padding: 14px 16px; box-shadow: var(--o-shadow); }
.vf-empresa.off { opacity: .75; }
.vf-empresa header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.vf-empresa header b { display: block; font-size: 15px; color: var(--o-text); }
.vf-empresa header small { color: var(--o-muted); font-size: 12.5px; }
.vf-entorno { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--o-warn-bg,#fef3c7); color: var(--o-warn,#92400e); white-space: nowrap; }
.vf-entorno.prod { background: var(--o-ok-bg,#dcfce7); color: var(--o-ok,#166534); }
.vf-nota { margin: 0; color: var(--o-muted); font-size: 13px; }
.vf-cifras { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.vf-cifras div { background: var(--o-surface-2,#f8fafc); border-radius: 10px; padding: 8px; text-align: center; }
.vf-cifras b { display: block; font-size: 20px; color: var(--o-text); }
.vf-cifras span { font-size: 11.5px; color: var(--o-muted); }
.vf-cifras .warn b { color: var(--o-warn,#b45309); } .vf-cifras .mal b { color: var(--o-bad,#b91c1c); } .vf-cifras .ok b { color: var(--o-ok,#047857); }
.vf-cert { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; border-radius: 10px; padding: 8px 10px; }
.vf-cert.ok { background: var(--o-ok-bg,#f0fdf4); color: var(--o-ok,#166534); } .vf-cert.warn { background: var(--o-warn-bg,#fffbeb); color: var(--o-warn,#92400e); } .vf-cert.mal { background: var(--o-bad-bg,#fef2f2); color: var(--o-bad,#991b1b); }
.vf-envio { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--o-text); }
.vf-switch { --yc: #047857; }
.vf-ultimo { color: var(--o-faint); font-size: 12px; }
.vf-empresa footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--o-border); padding-top: 10px; }
.vf-filtros { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.vf-filtros .to-ambito em { font-style: normal; font-size: 11.5px; opacity: .75; margin-left: 4px; }
.vf-buscar { max-width: 280px; }
.vf-registros { display: flex; flex-direction: column; gap: 6px; }
.vf-registro { display: grid; grid-template-columns: minmax(170px, 1fr) 110px minmax(220px, 2fr) 130px auto; gap: 12px; align-items: center; background: var(--o-surface); border: 1px solid var(--o-border); border-radius: 12px; padding: 9px 14px; }
.vf-registro.mal { border-left: 4px solid #dc2626; } .vf-registro.warn { border-left: 4px solid #f59e0b; }
.vf-reg-num b { display: block; color: var(--o-text); } .vf-reg-num small, .vf-reg-estado small { display: block; color: var(--o-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vf-reg-imp { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.vf-reg-estado { min-width: 0; }
.vf-reg-huella { color: var(--o-faint); font-size: 11.5px; }
.vf-xml-modal { width: min(960px, 94vw); }
.vf-xml { max-height: 60vh; overflow: auto; background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 12px; font-size: 11.5px; white-space: pre; }
@media (max-width: 900px) { .vf-empresas { grid-template-columns: 1fr; } .vf-registro { grid-template-columns: 1fr auto; } .vf-reg-imp, .vf-reg-huella { display: none; } }

/* ═══════════════ Conciliación bancaria ═══════════════ */
.cb-subir { position: relative; display: inline-flex; gap: 6px; align-items: center; cursor: pointer; overflow: hidden; }
.cb-subir input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.cb-ayuda { background: var(--o-surface); border: 1px solid var(--o-border); border-radius: 16px; padding: 18px 22px; box-shadow: var(--o-shadow); color: var(--o-text); max-width: 820px; }
.cb-ayuda ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; color: var(--o-muted); font-size: 14px; }
.cb-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cb-barra { display: flex; gap: 14px; align-items: center; justify-content: flex-end; flex-wrap: wrap; background: var(--o-surface); border: 1px solid var(--o-border); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; position: sticky; top: 0; z-index: 2; }
.cb-barra .check-inline { margin-right: auto; }
.cb-total { color: var(--o-muted); font-size: 13.5px; } .cb-total b { color: var(--o-text); }
.cb-lista { display: flex; flex-direction: column; gap: 6px; }
.cb-mov { display: grid; grid-template-columns: 28px 92px minmax(220px, 2fr) 120px minmax(260px, 2fr); gap: 12px; align-items: center; background: var(--o-surface); border: 1px solid var(--o-border); border-radius: 12px; padding: 9px 14px; }
.cb-mov.marcado { border-color: var(--o-info-b,#93c5fd); background: var(--o-info-bg,#f5f9ff); }
.cb-mov.hecho { opacity: .6; } .cb-mov.hecho .cb-check { color: var(--o-ok); }
.cb-mov.cargo { opacity: .55; }
.cb-fecha { font-variant-numeric: tabular-nums; color: var(--o-muted); font-size: 13px; }
.cb-concepto { min-width: 0; } .cb-concepto b { display: block; font-weight: 600; font-size: 13px; color: var(--o-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-concepto small { display: block; color: var(--o-muted); font-size: 12px; }
.cb-importe { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--o-ok,#047857); } .cb-importe.neg { color: var(--o-bad,#b91c1c); }
.cb-factura { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cb-conf { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--o-surface-3,#f1f5f9); color: var(--o-muted,#475569); }
.cb-conf.alta { background: var(--o-ok-bg,#dcfce7); color: var(--o-ok,#166534); } .cb-conf.media { background: var(--o-info-bg,#e0ecf8); color: var(--o-heading,#16355b); } .cb-conf.baja { background: var(--o-warn-bg,#fef3c7); color: var(--o-warn,#92400e); }
.cb-fac { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--o-border-strong); border-radius: 8px; padding: 3px 4px 3px 8px; font-family: ui-monospace, monospace; font-size: 12px; background: var(--o-surface,#fff); }
.cb-fac small { color: var(--o-muted); font-family: inherit; }
.cb-fac button { border: 0; background: none; color: var(--o-faint); cursor: pointer; display: grid; place-items: center; }
.cb-elegir { max-width: 300px; height: 32px; font-size: 12.5px; }
@media (max-width: 1000px) { .cb-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cb-mov { grid-template-columns: 28px 1fr auto; } .cb-concepto { grid-column: 2 / 4; grid-row: 2; } .cb-factura { grid-column: 1 / 4; } }

/* ═══════════════ Diseño de factura ═══════════════ */
.df-empresa { width: 240px; }
.df { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 18px; align-items: start; }
.df-panel { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 0; max-height: calc(100vh - 140px); overflow: auto; padding-right: 4px; }
.df-panel section { background: var(--o-surface); border: 1px solid var(--o-border); border-radius: 14px; padding: 14px 16px; box-shadow: var(--o-shadow); display: flex; flex-direction: column; gap: 10px; }
.df-panel h3 { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--o-muted); }
.df-plantillas { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.df-plantilla { display: flex; flex-direction: column; gap: 4px; text-align: left; background: var(--o-surface,#fff); border: 1.5px solid var(--o-border); border-radius: 12px; padding: 8px; cursor: pointer; font: inherit; color: inherit; transition: border-color .15s; }
.df-plantilla:hover { border-color: var(--o-border-strong); }
.df-plantilla.on { border-color: var(--p, #16355b); box-shadow: 0 0 0 3px rgba(22, 53, 91, .12); }
.df-plantilla strong { font-size: 13px; color: var(--o-text); }
.df-plantilla small { font-size: 11px; color: var(--o-muted); line-height: 1.3; }
.df-mini { position: relative; display: block; height: 74px; border-radius: 6px; background: var(--o-surface,#fff); border: 1px solid var(--o-border,#e2e8f0); overflow: hidden; }
.df-mini i, .df-mini b, .df-mini em, .df-mini u { position: absolute; display: block; }
.df-mini.moderna i { left: 0; right: 0; top: 0; height: 26px; background: var(--p); }
.df-mini.moderna b { right: 8px; top: 16px; width: 34px; height: 20px; background: var(--o-surface,#fff); border-radius: 4px; box-shadow: 0 2px 4px rgba(0,0,0,.15); }
.df-mini.moderna em { left: 8px; right: 8px; top: 44px; height: 6px; background: var(--p); border-radius: 3px; opacity: .85; }
.df-mini.moderna u { right: 8px; bottom: 6px; width: 30px; height: 8px; background: var(--p); border-radius: 3px; }
.df-mini.corporativa i { left: 0; top: 0; bottom: 0; width: 26px; background: var(--p); border-right: 2px solid var(--a); }
.df-mini.corporativa b { left: 34px; top: 8px; width: 34px; height: 7px; background: var(--p); border-radius: 2px; }
.df-mini.corporativa em { left: 34px; right: 6px; top: 34px; height: 6px; background: var(--p); border-radius: 3px; }
.df-mini.corporativa u { right: 6px; bottom: 6px; width: 30px; height: 8px; background: var(--p); border-radius: 3px; }
.df-mini.clasica i { left: 6px; right: 6px; top: 6px; height: 2px; background: var(--p); box-shadow: 0 3px 0 -1px var(--a); }
.df-mini.clasica b { right: 6px; top: 16px; width: 36px; height: 16px; border: 1px solid var(--p); }
.df-mini.clasica em { left: 6px; right: 6px; top: 40px; height: 6px; background: var(--p); }
.df-mini.clasica u { right: 6px; bottom: 6px; width: 30px; height: 8px; background: var(--p); }
.df-mini.minimal i { left: 6px; top: 8px; width: 30px; height: 7px; background: #111827; border-radius: 2px; }
.df-mini.minimal b { left: 6px; right: 6px; top: 24px; height: 1px; background: #111827; }
.df-mini.minimal em { left: 6px; right: 6px; top: 40px; height: 1px; background: #cbd5e1; box-shadow: 0 8px 0 #e2e8f0, 0 16px 0 #e2e8f0; }
.df-mini.minimal u { right: 6px; bottom: 6px; width: 26px; height: 6px; background: var(--a); border-radius: 2px; }
.df-colores { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.df-colores label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--o-muted); }
.df-colores span { display: flex; gap: 8px; align-items: center; }
.df-colores input[type=color] { width: 38px; height: 32px; border: 1px solid var(--o-border-strong); border-radius: 8px; padding: 2px; background: var(--o-surface,#fff); cursor: pointer; }
.df-colores code { font-size: 12px; color: var(--o-text); }
.df-paletas { display: flex; flex-wrap: wrap; gap: 6px; }
.df-paletas button { display: inline-flex; border: 1.5px solid var(--o-border); border-radius: 999px; padding: 3px; background: var(--o-surface,#fff); cursor: pointer; }
.df-paletas button.on { border-color: var(--o-text); }
.df-paletas i { width: 16px; height: 16px; border-radius: 50%; display: block; }
.df-paletas i + i { margin-left: -4px; box-shadow: 0 0 0 2px #fff; }
.df-dos { width: 100%; }
.df-dos button { flex: 1; }
.df-fila { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--o-muted); }
.df-fila .df-dos { width: 200px; }
.df-checks { display: grid; grid-template-columns: 1fr; gap: 6px; }
.df-nota { margin: 0; font-size: 12px; color: var(--o-muted); }
.df-vista { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.df-vista-barra { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.df-estado { font-size: 12.5px; color: var(--o-muted); }
.df-hoja { position: relative; background: var(--o-surface-3,#e2e8f0); border-radius: 16px; padding: 18px; box-shadow: inset 0 1px 3px rgba(15, 23, 42, .08); }
.df-hoja iframe { display: block; width: 100%; aspect-ratio: 595 / 842; max-height: calc(100vh - 190px); border: 0; border-radius: 6px; background: var(--o-surface,#fff); box-shadow: 0 10px 30px rgba(15, 23, 42, .18); }
.df-cargando { position: absolute; top: 26px; right: 26px; background: var(--o-surface,#fff); border-radius: 999px; padding: 6px; box-shadow: var(--o-shadow); }
@media (max-width: 1100px) { .df { grid-template-columns: 1fr; } .df-panel { position: static; max-height: none; } }

/* centro de control: validar, riesgo, recursos y automatismos */
.cc-acciones { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.cc-rechazo { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.cc-rechazo .form-input { flex: 1 1 220px; min-width: 0; }
.cc-nota { margin: 10px 0 0; font-size: 12.5px; color: var(--text-muted, var(--o-muted,#6b7280)); }
.cc-auto { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cc-auto li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--surface-2, var(--o-info-bg,#f7f8fa)); }
.cc-auto li > i { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; background: #9ca3af; }
.cc-auto li.ok > i { background: #16a34a; }
.cc-auto li.mal { background: var(--o-bad-bg,#fef2f2); }
.cc-auto li.mal > i { background: #dc2626; }
.cc-auto b { display: block; font-size: 13.5px; }
.cc-auto small { color: var(--text-muted, var(--o-muted,#6b7280)); }
.cc-auto-error { margin: 4px 0 0; font-size: 12px; color: var(--o-bad,#b91c1c); word-break: break-word; }
.btn-xs { padding: 5px 10px !important; font-size: 12.5px !important; min-height: 0 !important; }

/* recursos operativos */
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.rec-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.rec-card.inactivo { opacity: .6; }
.rec-uso { font-weight: 700; font-size: 15px; padding: 3px 10px; border-radius: 999px; background: var(--o-ok-bg,#ecfdf5); color: var(--o-ok,#047857); }
.rec-uso.lleno { background: var(--o-bad-bg,#fef2f2); color: var(--o-bad,#b91c1c); }
.rec-trabajo { display: block; padding: 7px 0; border-top: 1px solid var(--border, var(--o-border,#e5e7eb)); color: inherit; text-decoration: none; }
.rec-trabajo small { display: block; color: var(--text-muted, var(--o-muted,#6b7280)); }
.rec-card footer { display: flex; gap: 6px; margin-top: 10px; }

/* chips de la tarea: obligatorio antes de salir, incluido en contrato, calidad, recurso */
.ot-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--o-info-bg,#eef2ff); color: var(--o-purple,#3730a3); }
.ot-chip.ok { background: var(--o-ok-bg,#ecfdf5); color: var(--o-ok,#047857); }
.ot-chip.warn { background: var(--o-warn-bg,#fffbeb); color: var(--o-warn,#b45309); }
.ot-chip.mal { background: var(--o-bad-bg,#fef2f2); color: var(--o-bad,#b91c1c); }

/* Mi jornada: sin cobertura y salidas */
.mj-sin-red { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; margin: 0 0 10px; background: var(--o-warn-bg,#fffbeb); color: var(--o-warn,#92400e); font-size: 14px; }
.mj-sin-red.enviando { background: var(--o-info-bg,#eff6ff); color: var(--o-info,#1e40af); }
.mj-sin-red.mal { background: var(--o-bad-bg,#fef2f2); color: var(--o-bad,#991b1b); }
.mj-sin-red span { flex: 1; min-width: 0; }
.mj-sale { color: var(--o-muted,#475569); }
.mj-sale.pronto { color: var(--o-warn,#b45309); font-weight: 600; }
.mj-sale.obligatorio { color: var(--o-bad,#b91c1c); font-weight: 600; }

/* trabajos pendientes antes de la salida */
.tsal { border-radius: 12px; padding: 12px 14px; margin: 12px 0; border: 1px solid var(--o-bad-b,#fecaca); background: var(--o-bad-bg,#fef2f2); }
.tsal.excepcion { border-color: var(--o-warn-b,#fde68a); background: var(--o-warn-bg,#fffbeb); }
.tsal.ok { border-color: var(--o-ok-b,#bbf7d0); background: var(--o-ok-bg,#f0fdf4); }
.tsal header { display: flex; align-items: center; gap: 8px; }
.tsal ul { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; }
.tsal li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13.5px; }
.tsal li.oblig span { font-weight: 600; }
.tsal li small { color: var(--o-muted,#6b7280); }
.tsal li a { margin-left: auto; font-size: 12.5px; }
.tsal-exc { margin: 6px 0 0; font-size: 13px; }
.tsal-form { display: grid; gap: 8px; margin-top: 6px; }
.tsal-form > div { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* preparación de una salida prevista */
.prep { border: 1px solid var(--border, var(--o-border,#e5e7eb)); border-radius: 14px; padding: 14px 16px; margin: 0 0 14px; background: var(--surface, var(--o-surface,#fff)); }
.prep header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.prep h3 { margin: 0; font-size: 15px; }
.prep header small { color: var(--text-muted, var(--o-muted,#6b7280)); }
.prep-riesgo { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--o-info-bg,#eef2ff); color: var(--o-purple,#3730a3); white-space: nowrap; }
.prep.ok .prep-riesgo { background: var(--o-ok-bg,#ecfdf5); color: var(--o-ok,#047857); }
.prep.warn .prep-riesgo { background: var(--o-warn-bg,#fffbeb); color: var(--o-warn,#b45309); }
.prep.mal { border-color: var(--o-bad-b,#fecaca); }
.prep.mal .prep-riesgo { background: var(--o-bad-bg,#fef2f2); color: var(--o-bad,#b91c1c); }
.prep ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.prep li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 13.5px; }
.prep-txt { flex: 1; min-width: 0; display: flex; gap: 4px 10px; flex-wrap: wrap; }
.prep-txt .mal { color: var(--o-bad,#b91c1c); }
.prep li > small { color: var(--text-muted, var(--o-muted,#6b7280)); }

/* Yard Care: mediciones y políticas */
.yc-nota { color: var(--text-muted, var(--o-muted,#6b7280)); font-size: 13px; margin: 6px 0 12px; }
.yc-acc { display: flex; gap: 8px; }
.yc-medir { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 14px; margin: -4px 0 8px; border-radius: 0 0 12px 12px; background: var(--o-surface-2,#f8fafc); border: 1px solid var(--o-border,#e5e7eb); border-top: 0; }
.yc-medir .form-input, .yc-medir .form-select { width: auto; min-width: 120px; }
.yc-medir small { color: var(--o-muted,#64748b); flex-basis: 100%; }

/* productividad real de los trabajos */
.prod-real { margin-bottom: 14px; }
.prod-real header { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.prod-real-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.prod-real-kpis > div { border: 1px solid var(--border, var(--o-border,#e5e7eb)); border-radius: 12px; padding: 10px 12px; }
.prod-real-kpis span { display: block; font-size: 12px; color: var(--o-muted,#64748b); }
.prod-real-kpis b { display: block; font-size: 22px; }
.prod-real-kpis small { color: var(--o-muted,#64748b); }
.prod-real-kpis .ok b, .prod-real td.ok { color: var(--o-ok,#047857); }
.prod-real-kpis .warn b, .prod-real td.warn { color: var(--o-warn,#b45309); }
.prod-real-kpis .mal b, .prod-real td.mal { color: var(--o-bad,#b91c1c); }
.prod-real td.text-right, .prod-real th.text-right { white-space: nowrap; }
/* cabecera de los modales nuevos (recursos, replanificar, políticas de Yard Care) */
.modal-card > .modal-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.modal-card > .modal-header h3 { margin: 0; font-size: 18px; }
.modal-card > .modal-header .modal-close { border: 0; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: var(--o-muted,#64748b); padding: 4px 8px; border-radius: 8px; }
.modal-card > .modal-header .modal-close:hover { background: var(--o-surface-3,#f1f5f9); }
.modal-card.modal-lg { width: min(920px, calc(100vw - 32px)); max-width: none; }
.modal-card .modal-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* selector de tipo de recurso (RecursoTipoPicker) */
.rtp { display: grid; gap: 8px; margin-top: 4px; }
.rtp-chips { display: flex; width: fit-content; max-width: 100%; }
.form-grid > .field-label.wide { grid-column: 1 / -1; }

/* Mi jornada: maniobra para sacar el coche (qué mover, en qué orden y dónde dejarlo) */
.mj-maniobra summary { cursor: pointer; list-style: none; }
.mj-maniobra summary::-webkit-details-marker { display: none; }
.mj-maniobra ol { margin: 6px 0 2px 22px; padding: 0; font-size: 12px; }
.mj-maniobra small { display: block; font-size: 11px; opacity: .8; }

/* Mi jornada: la plaza del coche lleva al mapa 3D */
.mj-meta a.mj-llevame { display: inline-flex; align-items: center; gap: 4px; color: var(--o-info,#1d4ed8); font-weight: 700; text-decoration: none; }
.mj-meta a.mj-llevame:hover { text-decoration: underline; }
