/* =====================================================================
   Equipo, chat, desplegables, agrupación por paciente y línea de tiempo
   ===================================================================== */

/* ---------- desplegable propio (reemplaza al select nativo) ---------- */
.desp { position: relative; display: block; min-width: 0; }
.desp-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; color: var(--tinta);
  background-color: #fff; background-image: linear-gradient(180deg, #fff, #f4f6fb); border: 1px solid var(--linea); border-radius: 12px; padding: 6px 12px 6px 14px; min-height: 46px; box-shadow: var(--relieve); }
.desp-btn:hover { box-shadow: var(--relieve-h); }
.desp-btn.abierto { box-shadow: var(--relieve), 0 0 0 2px var(--azul); }
.desp-textos { display: grid; min-width: 0; line-height: 1.25; }
.desp-textos small { color: var(--tinta-3); font-size: 11px; font-weight: 500; }
.desp-textos b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desp-btn > svg.ico { width: 16px; height: 16px; fill: none; color: var(--tinta-3); transition: transform .15s; }
.desp-btn.abierto > svg.ico { transform: rotate(180deg); color: var(--azul); }
.desp:not(.con-valor) .desp-textos b { color: var(--tinta-2); font-weight: 500; }
.desp.con-valor .desp-btn { border-color: var(--azul-borde); background-image: linear-gradient(180deg, #fff, #eaf1fe); }
.desp-menu { position: fixed; z-index: 80; background: #fff; border: 1px solid var(--linea); border-radius: 14px; padding: 6px; overflow-y: auto; display: grid; gap: 2px; align-content: start;
  box-shadow: 0 2px 4px rgba(14,30,61,.08), 0 18px 36px -10px rgba(14,30,61,.4); scrollbar-width: thin; scrollbar-color: #c1cbe0 transparent; animation: desp-in .12s ease-out; }
@keyframes desp-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.desp-op { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; background: none; border: 0; color: var(--tinta); padding: 9px 12px; border-radius: 9px; font-size: 14px; }
.desp-op:hover, .desp-op:focus-visible { background: #eef3fd; outline: none; }
.desp-op.sel { background: var(--azul-claro); color: #1f56c4; font-weight: 600; }
.desp-op svg.ico { width: 16px; height: 16px; fill: none; }
.filtros-fila .desp { min-width: 150px; }
.barra-filtros { overflow: visible; }
.barra-filtros > :first-child { border-radius: 14px 0 0 14px; }
.barra-filtros > :last-child { border-radius: 0 14px 14px 0; }
.barra-filtros .desp { flex: 1 1 150px; border-left: 1px solid var(--linea); }
.barra-filtros .desp-btn { background: none; box-shadow: none; border: 0; border-radius: 0; height: 100%; min-height: 52px; }
.barra-filtros .desp-btn:hover { background: #f4f7fd; }
.barra-filtros .desp-btn.abierto { box-shadow: inset 0 0 0 2px var(--azul); }
.barra-filtros .desp.con-valor .desp-btn { background: #eef3fd; }
.desp.campo .desp-btn { box-shadow: none; background: #fff; border-color: var(--linea-2); border-radius: 10px; }

/* ---------- puntos de estado que laten ---------- */
.punto { --pc: #a3aec4; position: relative; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--pc); flex: none; vertical-align: middle; }
.punto::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--pc); animation: latido 1.6s ease-out infinite; }
@keyframes latido { 0% { transform: scale(1); opacity: .65; } 100% { transform: scale(2.8); opacity: 0; } }
.punto.rojo { --pc: #e5384f; } .punto.verde, .punto.trabajando { --pc: #1fb86a; } .punto.amarillo { --pc: #f0a50f; }
.punto.conectado { --pc: #6fb6e8; } .punto.fuera { --pc: #b4bdd0; }
.punto.conectado::after, .punto.fuera::after { display: none; }
@media (prefers-reduced-motion: reduce) { .punto::after { animation: none; display: none; } }
.av-estado { position: relative; display: inline-flex; flex: none; }
.av-estado .punto { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; box-shadow: 0 0 0 2px #fff; }

/* ---------- Panel: columna derecha con el equipo conectado ---------- */
.col-derecha { display: flex; flex-direction: column; gap: 14px; min-width: 0; min-height: 0; }
.col-derecha > .detalle { flex: 1 1 0; }
.presencia { flex: none; padding: 12px 14px 10px; }
.pres-cab { display: flex; align-items: center; gap: 10px; }
.pres-cab h2 { margin: 0; font-size: 16px; font-weight: 600; flex: 1; }
.pres-plegar { background: none; border: 0; color: var(--tinta-3); width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; padding: 0; }
.pres-plegar:hover { background: #eef2f9; }
.pres-plegar svg.ico { fill: none; transition: transform .15s; } .presencia.plegada .pres-plegar svg.ico { transform: rotate(-90deg); }
.pres-lista { display: grid; gap: 2px; margin-top: 8px; max-height: 176px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #c1cbe0 transparent; }
.presencia.plegada .pres-lista { display: none; }
.pres-fila { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; }
.pres-fila .avatar { width: 34px; height: 34px; font-size: 12px; }
.pres-fila.ir { cursor: pointer; } .pres-fila.ir:hover { background: #eefaf3; }
.pres-fila.fuera { opacity: .55; }
.pres-txt { min-width: 0; display: grid; line-height: 1.25; }
.pres-txt b { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pres-txt small { color: var(--tinta-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pres-fila.trabajando .pres-txt small { color: #14764a; font-weight: 600; }
.pres-txt em { font-style: normal; font-weight: 400; color: var(--tinta-3); }
@media (max-height: 800px) { .pres-lista { max-height: 112px; } .presencia { padding: 8px 12px; } }

/* ---------- chat interno ---------- */
.chat-btn { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); color: #fff; padding: 10px 14px; border-radius: 12px; font-weight: 500;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 6px 12px -8px rgba(0,0,0,.5); }
.chat-btn:hover, .chat-btn.activo { background: rgba(255,255,255,.18); }
.chat-btn svg.ico { width: 1.3em; height: 1.3em; fill-opacity: .22; }
.insignia { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: #ff4d63; color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px rgba(10,42,102,.9); }
.chat-caja { position: fixed; z-index: 40; left: calc(var(--lateral) + 12px); bottom: 14px; width: 348px; height: min(540px, calc(100vh - 28px)); display: flex; flex-direction: column; background: #fff; border: 1px solid var(--linea); border-radius: 18px; overflow: hidden;
  box-shadow: 0 2px 6px rgba(14,30,61,.12), 0 28px 50px -14px rgba(14,30,61,.5); }
.chat-cab { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: #fff; background: linear-gradient(135deg, var(--navy-2), var(--navy-1)); }
.chat-cab svg.ico { width: 1.5em; height: 1.5em; } .chat-cab b { display: block; line-height: 1.2; } .chat-cab small { color: rgba(255,255,255,.7); font-size: 12px; }
.chat-cab .chat-x { margin-left: auto; color: #fff; }
.chat-x { background: none; border: 0; color: var(--tinta-2); width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; padding: 0; flex: none; }
.chat-x:hover { background: rgba(120,140,180,.18); } .chat-x svg.ico { fill: none; }
.chat-lista { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 3px; background: #f2f5fa; scrollbar-width: thin; scrollbar-color: #c1cbe0 transparent; }
.chat-dia { text-align: center; margin: 10px 0 6px; } .chat-dia span { background: #e2e8f4; color: var(--tinta-2); border-radius: 99px; padding: 2px 12px; font-size: 11.5px; font-weight: 600; }
.burbuja { max-width: 82%; padding: 7px 11px 5px; border-radius: 14px; margin-top: 8px; line-height: 1.35; overflow-wrap: anywhere; white-space: pre-wrap; box-shadow: 0 1px 2px rgba(14,30,61,.1); }
.burbuja.seguida { margin-top: 2px; }
.burbuja.otra { align-self: flex-start; background: #fff; border-bottom-left-radius: 4px; }
.burbuja.mia { align-self: flex-end; background: linear-gradient(180deg, #3478f0, var(--azul)); color: #fff; border-bottom-right-radius: 4px; }
.burbuja-quien { display: block; font-weight: 700; font-size: 11.5px; color: #1f56c4; margin-bottom: 1px; }
.burbuja-hora { display: block; text-align: right; font-size: 10.5px; opacity: .65; margin-top: 1px; }
.chat-pie { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--linea); background: #fff; align-items: flex-end; }
.chat-pie textarea { flex: 1; min-height: 40px; max-height: 110px; resize: none; padding: 9px 12px; }
.chat-pie button { padding: 10px 14px; height: 40px; }
.chat-pie button svg.ico { fill: none; }
@media (max-width: 900px) { .chat-caja { left: 8px; right: 8px; width: auto; } }

/* ---------- controles varios ---------- */
.seg { display: inline-flex; background: #e9eef7; border-radius: 11px; padding: 3px; margin-left: auto; gap: 2px; }
.seg button { display: inline-flex; align-items: center; gap: 7px; background: none; border: 0; border-radius: 9px; padding: 6px 12px; color: var(--tinta-2); font-weight: 500; font-size: 13px; }
.seg button.activo { background: #fff; color: #1f56c4; font-weight: 600; box-shadow: 0 1px 3px rgba(14,30,61,.16); }
.seg button svg.ico { fill: none; }
button.sec.activo { background-image: linear-gradient(180deg, #eaf1fe, #dce8fc); border-color: var(--azul-borde); color: #1f56c4; }
.blanca-cab .sec { margin-left: auto; }
.interruptor { position: relative; display: flex; align-items: center; gap: 10px; color: var(--tinta); font-size: 13.5px; font-weight: 500; cursor: pointer; width: fit-content; }
.interruptor input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.interruptor .iz { position: relative; flex: none; width: 38px; height: 22px; border-radius: 99px; background: #c4cde0; transition: background .15s; }
.interruptor .iz::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(14,30,61,.3); transition: transform .15s; }
.interruptor input:checked + .iz { background: var(--azul); } .interruptor input:checked + .iz::after { transform: translateX(16px); }
.interruptor input:focus-visible + .iz { outline: 2px solid var(--azul); outline-offset: 2px; }
.interruptor input:disabled + .iz { opacity: .5; } .interruptor.off { cursor: default; }
.campo-txt { display: grid; gap: 5px; color: var(--tinta-2); font-size: 12px; font-weight: 500; }
.panel-cab-fila { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel.ancho { width: min(760px, 100%); }
.icono-btn { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border-radius: 10px; flex: none; }
.icono-btn svg.ico { fill: none; }

/* ---------- Autorizaciones agrupadas por paciente (recuadro azul) ---------- */
.sit { display: inline-grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 8px; font-weight: 600; font-size: 12.5px; line-height: 1.25; }
.sit small { grid-column: 2; font-weight: 500; color: var(--tinta-2); font-size: 11.5px; }
.sit.rojo { color: #a3263d; } .sit.verde { color: #14764a; } .sit.amarillo { color: #8a5a00; }
.chip .punto { width: 8px; height: 8px; }
.grupo-pac { background: #fff; border: 2px solid #86aef0; border-radius: 18px; overflow: hidden; box-shadow: var(--sombra), 0 0 0 4px rgba(134,174,240,.14); margin-top: 12px; }
.grupo-cab { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 18px; background: linear-gradient(180deg, #eef4ff, #dce8fc); border-bottom: 1px solid #b9d0f6; }
.grupo-cab.ir { cursor: pointer; } .grupo-cab.ir:hover { background: linear-gradient(180deg, #e4eeff, #cfe0fb); }
.grupo-cab .avatar { width: 44px; height: 44px; font-size: 14px; }
.grupo-nombre { min-width: 0; } .grupo-nombre h3 { margin: 0; font-size: 17px; font-weight: 700; color: var(--navy-1); letter-spacing: -.005em; }
.grupo-nombre p { margin: 1px 0 0; color: var(--tinta-2); font-size: 13px; } .grupo-nombre p b { color: #1f56c4; font-weight: 700; }
.grupo-chips { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.grupo-abrir { display: inline-flex; align-items: center; gap: 4px; color: #1f56c4; } .grupo-abrir svg.ico { fill: none; }
.grupo-filas { display: grid; gap: 6px; padding: 10px 14px 14px; }
.grupo-filas .orden { padding: 9px 14px; border-radius: 12px; box-shadow: 0 1px 2px rgba(14,30,61,.1); }
.grupo-filas .orden.cab { padding: 0 14px; }
.cobertura-mini { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #c9d8f5; border-radius: 99px; padding: 3px 12px 3px 4px; }
.cobertura-mini i { display: block; width: 58px; height: 8px; border-radius: 99px; background: linear-gradient(90deg, #1fb86a var(--p), #dfe6f3 var(--p)); }
.cobertura-mini small { font-weight: 700; color: var(--tinta-2); }

/* ---------- panel del paciente: pestañas y línea de tiempo ---------- */
.pestanas { display: flex; gap: 4px; background: #e2e8f4; border-radius: 12px; padding: 4px; }
.pestana { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: none; border: 0; border-radius: 9px; padding: 8px 12px; color: var(--tinta-2); font-weight: 500; }
.pestana.activo { background: #fff; color: #1f56c4; font-weight: 600; box-shadow: 0 1px 3px rgba(14,30,61,.18); } .pestana svg.ico { fill: none; }
.pac-ordenes { display: grid; gap: 12px; }
.tl-raiz { display: grid; gap: 12px; }
.tl-resumen { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tl-resumen .chip svg.ico { width: 14px; height: 14px; fill: none; }
.leyenda { display: inline-flex; gap: 14px; flex-wrap: wrap; color: var(--tinta-2); font-size: 12px; margin-left: auto; } .leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.tl-bandeja { background: #eaf0fb; border: 1.5px dashed #a9c0ea; border-radius: 14px; padding: 10px 12px; display: grid; gap: 8px; }
.tl-bandeja-cab { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; } .tl-bandeja-cab small { color: var(--tinta-2); }
.tl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tl-chip { display: inline-flex; align-items: center; gap: 10px; text-align: left; background: #fff; border: 1px solid var(--linea); border-left-width: 4px; border-radius: 10px; padding: 7px 12px; cursor: grab; box-shadow: var(--relieve); color: var(--tinta); }
.tl-chip:disabled { cursor: default; opacity: 1; }
.tl-chip small { display: block; color: var(--tinta-2); max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.tl-chip.verde { border-left-color: #1fb86a; } .tl-chip.amarillo { border-left-color: #f0a50f; } .tl-chip.rojo { border-left-color: #e5384f; }
.tl-chip.elegida { outline: 2px solid var(--azul); outline-offset: 1px; background: #eef3fd; }
.tl { position: relative; background: #fff; border: 1px solid var(--linea); border-radius: 14px; overflow: hidden; box-shadow: var(--sombra); }
.tl-dia { height: 48px; display: grid; grid-template-columns: 118px minmax(0, 1fr); align-items: center; border-bottom: 1px solid #edf0f6; }
.tl-dia:last-child { border-bottom: 0; }
.tl-fecha { height: 100%; padding: 0 12px; display: flex; flex-direction: column; justify-content: center; line-height: 1.2; background: #f4f7fc; border-right: 1px solid var(--linea); }
.tl-fecha b { font-size: 13px; } .tl-fecha small { color: var(--tinta-2); }
.tl-hueco { padding-left: 14px; color: var(--tinta-3); font-size: 12px; }
.tl-dia.libre { background: repeating-linear-gradient(135deg, #fff8e8 0 8px, #fffdf6 8px 16px); } .tl-dia.libre .tl-hueco { color: #a85d00; font-weight: 600; }
.tl-dia.fuera { background: #eef0f5; opacity: .6; }
.tl-dia.destino { cursor: copy; } .tl-dia.destino:hover, .tl-dia.sobre { background: #e3edff; } .tl-dia.destino .tl-hueco { color: #1f56c4; font-weight: 600; }
.tl-capa { position: absolute; left: 118px; right: 0; top: 0; pointer-events: none; }
.tl-bloque { position: absolute; pointer-events: auto; overflow: hidden; border: 1px solid; border-left-width: 5px; border-radius: 10px; padding: 5px 30px 5px 10px; touch-action: none; user-select: none;
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 3px 8px -2px rgba(14,30,61,.3); transition: box-shadow .12s; }
.tl-bloque.mov { cursor: grab; } .tl-bloque.mov:hover { box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 6px 14px -3px rgba(14,30,61,.4); }
.tl-bloque.arrastrando { cursor: grabbing; z-index: 5; box-shadow: 0 12px 24px -6px rgba(14,30,61,.5); }
.tl-bloque.verde { background: #dff4e8; border-color: #6cc392; color: #14583a; } .tl-bloque.amarillo { background: #fff1cf; border-color: #efbd4d; color: #6f4a00; } .tl-bloque.rojo { background: #fde4e8; border-color: #e9879a; color: #8c1f33; }
.tl-b-cab { display: flex; align-items: center; gap: 8px; line-height: 1.25; } .tl-b-cab small { margin-left: auto; opacity: .75; font-weight: 600; }
.tl-b-pie { font-size: 12px; opacity: .85; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-quitar { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; padding: 0; display: grid; place-items: center; background: rgba(255,255,255,.7); border: 0; border-radius: 7px; color: inherit; opacity: 0; }
.tl-bloque:hover .tl-quitar, .tl-bloque:focus-within .tl-quitar, .tl-bloque:focus .tl-quitar { opacity: 1; } .tl-quitar svg.ico { width: 13px; height: 13px; fill: none; }
.tl-asa { position: absolute; left: 0; right: 0; bottom: 0; height: 12px; cursor: ns-resize; }
.tl-asa::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 28px; height: 4px; margin-left: -14px; border-radius: 3px; background: currentColor; opacity: .35; }

/* ---------- Guardias: secciones por clasificación ---------- */
.grupos-g { display: grid; gap: 12px; margin-top: 8px; }
.seccion-g { border: 1px solid var(--linea); border-radius: 16px; background: #f7f9fd; overflow: hidden; }
.seccion-g-cab { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; background: linear-gradient(180deg, #fff, #eef2f9); border: 0; padding: 11px 16px; color: var(--tinta); }
.seccion-g-cab:hover { background: #eef3fd; } .seccion-g-cab small { color: var(--tinta-2); margin-left: auto; }
.seccion-g-cab > svg.ico { fill: none; transition: transform .15s; } .seccion-g.plegada .seccion-g-cab > svg.ico { transform: rotate(-90deg); }
.seccion-g-cuerpo { display: grid; gap: 8px; padding: 6px 12px 14px; }

/* ---------- Internados: formulario debajo del paciente ---------- */
.int-item { display: grid; }
.orden.abierta { border-color: var(--azul-borde); background-image: linear-gradient(180deg, #f2f7ff, #e4eeff); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.flecha-int svg.ico { fill: none; transition: transform .15s; color: var(--tinta-3); } .orden.abierta .flecha-int svg.ico { transform: rotate(180deg); color: var(--azul); }
.orden .recorte { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.int-form { display: grid; gap: 14px; padding: 16px 18px 18px; background: #f2f7ff; border: 1px solid var(--azul-borde); border-top: 0; border-radius: 0 0 14px 14px; box-shadow: var(--relieve); animation: desp-in .15s ease-out; }
.int-campos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.int-pie { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding-top: 12px; border-top: 1px dashed var(--azul-borde); }
.int-alta { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; } .int-alta > b { align-self: center; color: var(--tinta-2); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
@media (max-width: 900px) { .int-campos { grid-template-columns: 1fr; } }

/* ---------- Estadísticas: indicadores que se pueden tocar ---------- */
.kpi.clic { cursor: pointer; transition: transform .12s, box-shadow .12s; } .kpi.clic:hover { transform: translateY(-2px); box-shadow: var(--relieve-h), var(--sombra); }
.kpi-ver { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--p-fg, #1f56c4); } .kpi-ver svg.ico { fill: none; width: 14px; height: 14px; }
.cuenta-lista { color: var(--tinta-2); }
.casos { display: grid; gap: 10px; }
.caso { background: #fff; border: 1px solid var(--linea); border-radius: 14px; padding: 12px 14px; display: grid; gap: 8px; cursor: pointer; box-shadow: var(--relieve); }
.caso:hover { box-shadow: var(--relieve-h); transform: translateY(-1px); }
.caso-cab { display: flex; align-items: center; gap: 10px; } .caso-cab > div { min-width: 0; } .caso-cab small { display: block; color: var(--tinta-2); }
.caso-cab .sit, .caso-cab .chip { margin-left: auto; flex: none; }
.caso-txt { color: var(--tinta-2); font-size: 13px; } .caso-txt b { color: var(--tinta); }
.caso .ord-chips { justify-content: flex-start; }

/* ---------- vista Equipo ---------- */
.eq-barra { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.eq-barra > .desp { min-width: 190px; }
.eq-resumen { display: flex; gap: 12px; flex: 1; flex-wrap: wrap; }
.kpi-mini { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 14px; padding: 10px 18px 10px 10px; box-shadow: var(--relieve); border: 1px solid rgba(255,255,255,.8); }
.kpi-mini b { display: block; font-size: 24px; line-height: 1.1; } .kpi-mini small { color: var(--tinta-2); }
.eq-cuerpo { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.eq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.eq-card { cursor: pointer; display: grid; gap: 11px; padding: 14px 16px; transition: transform .12s, box-shadow .12s; }
.eq-card:hover { transform: translateY(-2px); box-shadow: var(--relieve-h), var(--sombra); }
.eq-card.fuera { opacity: .8; } .eq-card.trabajando { border-color: #9fdcb9; box-shadow: var(--sombra), 0 0 0 3px rgba(31,184,106,.14); }
.eq-cab { display: flex; align-items: center; gap: 12px; } .eq-cab .avatar { width: 44px; height: 44px; font-size: 14px; }
.eq-nombre { min-width: 0; display: grid; line-height: 1.3; } .eq-nombre b { font-size: 15.5px; }
.eq-estado { color: var(--tinta-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.eq-card.trabajando .eq-estado { color: #14764a; font-weight: 600; } .eq-estado em { font-style: normal; font-weight: 400; color: var(--tinta-3); }
.eq-datos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; background: #f4f7fc; border-radius: 10px; padding: 8px 10px; }
.eq-datos small { display: block; color: var(--tinta-3); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; } .eq-datos b { font-size: 15px; white-space: nowrap; }
.eq-card .progreso { position: relative; height: 18px; border-radius: 99px; background: #e6ebf5; overflow: hidden; }
.eq-card .progreso i { position: absolute; inset: 0 auto 0 0; width: var(--p); background: linear-gradient(90deg, #7fa6f0, #3478f0); border-radius: 99px; }
.eq-card .progreso small { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #0e1e3d; }
.eq-card .progreso.vacio-obj { background: #f1f4f9; } .eq-card .progreso.vacio-obj small { color: var(--tinta-3); font-weight: 500; }
.eq-horas { display: flex; align-items: flex-end; gap: 2px; height: 36px; }
.eq-horas i { flex: 1; height: max(3px, var(--a)); background: #e1e7f2; border-radius: 2px; } .eq-horas i.on { background: linear-gradient(180deg, #5b9bff, var(--azul)); }
.eq-horas-eje { display: flex; justify-content: space-between; margin-top: -6px; } .eq-horas-eje small { color: var(--tinta-3); font-size: 10.5px; }
.eq-dias { display: flex; align-items: flex-end; gap: 6px; height: 90px; padding-top: 6px; }
.eq-dias > div { flex: 1; display: grid; grid-template-rows: 1fr auto; justify-items: center; height: 100%; gap: 3px; min-width: 14px; }
.eq-dias i { align-self: end; width: 100%; height: max(4px, var(--a)); background: linear-gradient(180deg, #5b9bff, var(--azul)); border-radius: 4px 4px 0 0; } .eq-dias small { color: var(--tinta-3); font-size: 10.5px; }
.eq-feed { position: sticky; top: 12px; } .feed-lista { display: grid; gap: 0; max-height: 560px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #c1cbe0 transparent; }
.feed-fila { display: grid; grid-template-columns: 46px 10px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 4px; border-bottom: 1px solid #edf0f6; font-size: 13px; line-height: 1.35; }
.feed-hora { display: grid; line-height: 1.15; } .feed-hora small { color: var(--tinta-3); font-size: 10.5px; }
.feed-punto { width: 9px; height: 9px; border-radius: 50%; background: #b4bdd0; margin-top: 5px; } .feed-punto.ok { background: #1fb86a; } .feed-punto.proceso { background: #3478f0; } .feed-punto.mal { background: #e5384f; }
.feed-txt em { font-style: normal; color: var(--tinta-2); }
.sesion { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; background: #fff; border: 1px solid var(--linea); border-radius: 12px; padding: 8px 12px; }
.sesion small { grid-column: 1 / 3; color: var(--tinta-2); } .sesion span { color: var(--tinta-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .sesion .chip { grid-row: 1 / 3; grid-column: 3; }
@media (max-width: 1180px) { .eq-cuerpo { grid-template-columns: 1fr; } .eq-feed { position: static; } }

/* ---------- Usuarios ---------- */
.orden.usr.inactivo { opacity: .6; }
.perm-chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.perm-chip { background: #eef3fd; color: #1f56c4; border-radius: 7px; padding: 1px 9px; font-size: 12px; font-weight: 600; }
.perm-lista { display: grid; gap: 8px; }
.interruptor.perm { background: #fff; border: 1px solid var(--linea); border-radius: 12px; padding: 10px 12px; align-items: flex-start; width: auto; box-shadow: var(--relieve); }
.interruptor.perm .iz { margin-top: 1px; } .perm-txt { display: grid; } .perm-txt small { color: var(--tinta-2); font-weight: 400; font-size: 12px; }
.perm-pie { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- menú lateral compacto para que entren todos los ítems sin desplazarse ---------- */
@media (max-height: 1000px) {
  .lateral { gap: 10px; padding-top: 14px; }
  #menu { gap: 2px; }
  #menu button { padding: 8px 14px; }
  #menu button.sub { padding: 5px 10px 5px 40px; font-size: 12.5px; }
  .chat-btn { padding: 8px 14px; }
}

/* ---------- línea de tiempo: cuántos días cubre la orden ---------- */
.tl-largo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #fff; border: 1px solid var(--linea); border-radius: 10px; padding: 6px 10px; font-weight: 600; font-size: 13px; }
.tl-largo input { width: 64px; text-align: center; padding: 6px; font-weight: 700; }
.tl-largo button.sec { padding: 4px 12px; font-size: 16px; line-height: 1; }
.tl-largo small { color: var(--tinta-2); font-weight: 400; flex-basis: 100%; }
.tl-dias-btn { position: absolute; right: 28px; top: 3px; display: inline-flex; gap: 2px; opacity: 0; }
.tl-bloque:hover .tl-dias-btn, .tl-bloque:focus-within .tl-dias-btn, .tl-bloque:focus .tl-dias-btn { opacity: 1; }
.tl-dias-btn button { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 7px; background: rgba(255,255,255,.75); color: inherit; font-weight: 700; line-height: 1; }
.tl-dias-btn button:hover:not(:disabled) { background: #fff; }
.tl-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: #fff; border: 1px solid var(--linea); border-radius: 12px; padding: 8px 12px; font-size: 13px; }
.tl-nav button.sec { padding: 6px 12px; }
.tl-ir { display: flex; flex-direction: row; align-items: center; gap: 8px; } .tl-ir input { padding: 5px 8px; }
.tl-ini { width: 100%; padding: 2px 4px; font-size: 11.5px; border-radius: 7px; border: 1px solid var(--azul-borde); background: #eef3fd; color: #1f56c4; font-weight: 600; margin-top: 1px; }
.tl-ini::-webkit-calendar-picker-indicator { padding: 0; margin: 0 0 0 2px; }
