/* Maquinaria y almacén. Solo lo que no cubren los componentes comunes.
   Componentes: TagHelpers/Maquinaria (maq-mantenimiento, maq-aviso, maq-chip). */

/* Ficha de máquina: "Uso y valor" (ancho) + "Mantenimiento" (estrecho).
   Con flex-wrap y min-width: 0 nada se desborda: si no caben, el segundo baja. */
.maq-resumen { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; margin-bottom: 16px; }
.maq-resumen > .panel { margin: 0; min-width: 0; display: flex; flex-direction: column; }
.maq-resumen > .maq-uso { flex: 2 1 520px; }
.maq-resumen > .maq-mant-panel { flex: 1 1 300px; }
.maq-resumen > .panel > .panel-body { flex: 1; display: flex; flex-direction: column; gap: 12px; }

/* Cifras dentro del panel: rejilla que reparte sin desbordar */
.maq-uso .cifras { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); row-gap: 12px; }
.maq-uso .cifra:first-child { padding-left: 0; }
.maq-uso .cifra-valor { overflow: hidden; text-overflow: ellipsis; }

.maq-implementos { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--linea-suave); }
.maq-implementos-titulo { font-size: 12px; font-weight: 600; color: var(--texto-2); margin-right: 4px; }

.maq-chip {
    display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 4px 10px; border-radius: 5px;
    background: var(--fondo-app); border: 1px solid var(--linea); color: var(--texto); text-decoration: none; max-width: 100%;
}
a.maq-chip:hover { border-color: var(--brand-600); color: var(--brand-600); }
.maq-chip-nota { color: var(--texto-2); white-space: nowrap; }
.maq-chip-inactivo { color: var(--texto-3); text-decoration: line-through; }
.maq-chip-anadir { background: #fff; border-style: dashed; border-color: var(--linea-fuerte); color: var(--brand-600); font-weight: 600; }

/* Mantenimiento */
.maq-mant { display: flex; flex-direction: column; gap: 10px; }
.maq-mant-cifra { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.maq-mant-valor { font-family: var(--fuente-numeros); font-variant-numeric: tabular-nums; font-size: 26px; font-weight: 700; white-space: nowrap; }
.maq-mant-texto { font-size: 12.5px; color: var(--texto-2); }
.maq-mant-barra { height: 8px; border-radius: 4px; background: var(--linea-suave); overflow: hidden; }
.maq-mant-barra > span { display: block; height: 100%; background: var(--texto-3); }
.maq-mant-nota { font-size: 12px; color: var(--texto-2); }
.maq-tono-ok .maq-mant-valor { color: var(--tono-ok-fg); }
.maq-tono-ok .maq-mant-barra > span { background: var(--tono-ok-fg); }
.maq-tono-aviso .maq-mant-valor { color: var(--tono-aviso-fg); }
.maq-tono-aviso .maq-mant-barra > span { background: var(--tono-aviso-fg); }
.maq-tono-peligro .maq-mant-valor { color: var(--tono-peligro-fg); }
.maq-tono-peligro .maq-mant-barra > span { background: var(--tono-peligro-fg); }
.maq-mant-acciones { margin-top: auto; }

/* Avisos en línea */
.maq-aviso { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; padding: 9px 12px; border-radius: 6px; margin-bottom: 12px; font-weight: 600; }
.maq-aviso > .bi { font-size: 15px; line-height: 1.2; }
.maq-aviso ul { margin: 4px 0 0; padding-left: 18px; font-weight: 400; }
.maq-aviso-aviso { background: var(--tono-aviso-bg); color: var(--tono-aviso-fg); }
.maq-aviso-peligro { background: var(--tono-peligro-bg); color: var(--tono-peligro-fg); }
.maq-aviso-info { background: var(--tono-info-bg); color: var(--tono-info-fg); }

/* Tablas: tarifa distinta de la de referencia, fila de asignación solapada */
.maq-tarifa-distinta { color: var(--tono-aviso-fg); font-weight: 700; }
.maq-tarifa-nota { display: block; font-family: inherit; font-size: 11px; font-weight: 400; color: var(--tono-aviso-fg); }
.table-app tr.maq-solapada > td { --bs-table-bg-state: var(--tono-peligro-bg); }
.table-app tr.maq-solapada > td:first-child { border-left: 3px solid var(--tono-peligro-fg); }
.maq-fotos { display: flex; flex-wrap: wrap; gap: 4px 10px; justify-content: flex-end; }
.maq-texto-largo { white-space: pre-wrap; }

/* Formularios: casilla de confirmación y ayuda bajo un campo */
.maq-check { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.maq-check .form-check-input { margin: 0; }
.maq-ayuda { font-size: 11.5px; color: var(--texto-3); margin-top: 3px; }
