/*
 * Estilo del sistema anterior (AdminLTE + FontAwesome 4 + hoja «convenios») para las pantallas de itinerarios.
 * Todo vive bajo .lg para no afectar al resto de la aplicación. Colores tomados de las vistas originales.
 */
.lg { font-family: "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; color: #333; line-height: 1.42857; }
.lg *, .lg *::before, .lg *::after { box-sizing: border-box; }
.lg a { color: #2c6ecb; text-decoration: none; }
.lg a:hover { color: #1f4e94; text-decoration: none; filter: none; box-shadow: none; }
.lg h1, .lg h2, .lg h3, .lg h4 { font-family: inherit; margin: 0; }
.lg p { margin: 0 0 10px; }

/* Paneles */
.lg-panel { background: #fff; border: 1px solid #e2e8f0; border-radius: 4px; box-shadow: 0 1px 3px rgba(0, 0, 0, .05); margin: 0 0 20px; overflow: hidden; color: #333; }
.lg-head { background: #1f2d3d; color: #fff; padding: 14px 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.lg-head.azul { background: #2c6ecb; }
.lg-head.claro { background: #f7f9fb; color: #24292e; border-bottom: 1px solid #e2e8f0; }
.lg-title { font-size: 17px; font-weight: 600; margin: 0; color: inherit; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lg-sub { font-size: 12px; opacity: .8; margin: 2px 0 0; color: inherit; }
.lg-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lg-count { display: inline-block; background: rgba(255, 255, 255, .22); color: #fff; border-radius: 10px; padding: 1px 9px; font-size: 12px; font-weight: 600; }
.lg-body { padding: 20px; }
.lg-body.sin-pad { padding: 0; }
.lg-foot { border-top: 1px solid #e2e8f0; padding: 14px 20px; background: #fff; }
.lg-box { border: 1px solid #e2e8f0; border-radius: 4px; background: #fff; }
.lg-box-head { padding: 12px 15px; border-bottom: 1px solid #f1f5f9; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lg-box-title { font-size: 15px; font-weight: 600; color: #24292e; margin: 0; }
.lg-box-title .fa { color: #8a94a3; margin-right: 6px; }

/* Botones (cb-btn-*) */
.lg .lg-btn, .lg a.lg-btn, .lg button.lg-btn { display: inline-flex; align-items: center; gap: 5px; margin: 0; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 500; line-height: 1.4; border: 1px solid #cbd5e1; border-radius: 4px; background: #fff; color: #334155; cursor: pointer; text-decoration: none; box-shadow: none; filter: none; transition: background .15s, border-color .15s, color .15s; }
.lg .lg-btn:hover { background: #f1f5f9; border-color: #94a3b8; color: #1f2d3d; }
.lg .lg-btn:disabled { opacity: .5; cursor: not-allowed; }
.lg .lg-btn-primary, .lg a.lg-btn-primary, .lg button.lg-btn-primary { background: #2c6ecb; border-color: #2c6ecb; color: #fff; }
.lg .lg-btn-primary:hover { background: #245aa6; border-color: #245aa6; color: #fff; }
.lg .lg-btn-ghost { background: #fff; }
.lg .lg-btn-danger { background: #fff; border-color: #f1c6c1; color: #c0392b; }
.lg .lg-btn-danger:hover { background: #fdf1f1; border-color: #e6a8a1; color: #a93226; }
.lg .lg-btn-xs { padding: 2px 7px; font-size: 12px; }
.lg .lg-btn-sm { padding: 5px 10px; font-size: 12.5px; }
.lg .lg-head .lg-btn { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .3); color: #fff; }
.lg .lg-head .lg-btn:hover { background: rgba(255, 255, 255, .26); color: #fff; }
.lg .lg-head.claro .lg-btn { background: #fff; border-color: #cbd5e1; color: #334155; }
.lg .lg-btn-group { display: inline-flex; gap: 2px; }

/* Formularios (cb-label, form-control input-sm) */
.lg .lg-label { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: #5a6472; margin: 0 0 4px; }
.lg .lg-input, .lg select.lg-input, .lg input.lg-input { display: block; width: 100%; height: 30px; padding: 5px 10px; font: inherit; font-size: 13px; color: #333; background: #fff; border: 1px solid #d2d6de; border-radius: 3px; box-shadow: none; margin: 0; }
.lg .lg-input:focus { outline: none; border-color: #2c6ecb; box-shadow: 0 0 0 2px rgba(44, 110, 203, .15); }
.lg textarea.lg-input { height: auto; }
.lg-row { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.lg-col { flex: 1 1 180px; min-width: 0; }
.lg-help { font-size: 11.5px; color: #8a94a3; margin: 3px 0 0; }

/* Tablas (table table-hover cb-table) */
.lg-table-wrap { overflow-x: auto; }
.lg table.lg-table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
.lg table.lg-table th { background: #f7f9fb; color: #5a6472; font-size: 12px; font-weight: 600; text-align: left; padding: 9px 8px; border-bottom: 2px solid #e2e8f0; white-space: nowrap; vertical-align: bottom; }
.lg table.lg-table td { padding: 8px; border-top: 1px solid #eef0f2; vertical-align: middle; color: #333; }
.lg table.lg-table tbody tr:hover { background: #f5f9ff; }
.lg table.lg-table th.centro, .lg table.lg-table td.centro { text-align: center; }
.lg table.lg-table th.ord { cursor: pointer; user-select: none; }
.lg table.lg-table th[aria-sort="ascending"]::after { content: " \f0de"; font-family: FontAwesome; color: #2c6ecb; }
.lg table.lg-table th[aria-sort="descending"]::after { content: " \f0dd"; font-family: FontAwesome; color: #2c6ecb; }
.lg table.lg-table tr.marcada { background: #fdf1f1; }
.lg table.lg-table tr.sin-punto { opacity: .55; }
.lg-bold { font-weight: 700; }
.lg-red { color: #dd4b39; }
.lg-muted { color: #8a94a3; }
.lg-nw { white-space: nowrap; }

/* Etiquetas */
.lg .label { display: inline-block; padding: .2em .65em .3em; font-size: 75%; font-weight: 700; line-height: 1; color: #fff; text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: .25em; text-transform: uppercase; background: #777; }
.lg .lg-pill { display: inline-block; background: #eef1f4; color: #5a6472; border-radius: 10px; padding: 2px 8px; font-size: 11.5px; font-weight: 600; }
.lg .lg-pill-accent { background: #e7f0fd; color: #2c6ecb; }
.lg .lg-badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 600; background: #f0fdf4; color: #16a34a; border: 1px solid #dcfce7; }
.lg .status-badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 10.5px; font-weight: 600; }

/* Avisos y vacíos */
.lg-alert { padding: 12px 16px; border-radius: 4px; margin: 0 0 14px; border: 1px solid transparent; }
.lg-alert h4 { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.lg-alert.peligro { background: #fdf1f1; border-color: #f1c6c1; color: #a93226; }
.lg-alert.aviso { background: #fff8e6; border-color: #f5e0a3; color: #8a6d1a; }
.lg-empty { text-align: center; padding: 34px 12px; color: #8a94a3; }
.lg-empty .fa { font-size: 34px; display: block; margin-bottom: 8px; opacity: .6; }

/* Pestañas (cb-tabs) */
.lg-tabs { display: flex; border-bottom: 1px solid #e2e8f0; background: #fff; margin: 0; padding: 0; list-style: none; }
.lg-tabs button { flex: 1; margin: 0; padding: 12px 10px; border: 0; border-top: 3px solid transparent; border-bottom: 0; background: #fff; color: #5a6472; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; border-radius: 0; }
.lg-tabs button:hover { background: #f7f9fb; box-shadow: none; filter: none; }
.lg-tabs button.activa { color: #2c6ecb; border-top-color: #2c6ecb; background: #fff; }
.lg-tabs .fa { margin-right: 5px; }

/* Ficha de datos (cb-info-grid) */
.lg-info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.lg-info-item { padding: 12px 15px; border-bottom: 1px solid #f1f5f9; border-right: 1px solid #f1f5f9; }
.lg-info-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: #8a94a3; margin-bottom: 3px; }
.lg-info-value { font-size: 14px; font-weight: 600; color: #24292e; }

/* Botonera del pie */
.lg-flex-btns { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; }
.lg-divider { border-left: 1px solid #cbd5e1; height: 20px; margin: 0 6px; }

/* Iconos de acción de la tabla */
.lg .ic-acc { cursor: pointer; margin: 0 3px; }
.lg .ic-verde { color: #006666; }
.lg .ic-azul { color: #2c6ecb; }
.lg .ic-ok { color: #00a65a; }
.lg .ic-no { color: #dd4b39; }
.lg .ic-ban { color: #8a94a3; }

/* Menú «Acciones» */
.lg-dropdown { position: relative; display: inline-block; }
.lg-dropdown > div { position: absolute; right: 0; top: 100%; z-index: 1300; min-width: 200px; margin-top: 4px; background: #fff; border: 1px solid #e2e8f0; border-radius: 4px; box-shadow: 0 6px 12px rgba(0, 0, 0, .175); padding: 5px 0; display: none; }
.lg-dropdown.abierto > div { display: block; }

/* Filtros en una sola linea que se ajustan al ancho: desde 1180 px los campos se achican para seguir en una linea; en tablet pasan a filas y en el
   movil queda un campo por fila. Uso: <div class="lg-filtros"> con .lg-col (y .fecha para las fechas) y un .lg-btns con los botones. */
.lg .lg-filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.lg .lg-filtros > .lg-col { flex: 1 1 150px; min-width: 0; max-width: none; }
.lg .lg-filtros .lg-btns { flex: 0 0 auto; display: flex; gap: 8px; }
.lg .lg-filtros .lg-btns .lg-btn { height: 34px; box-sizing: border-box; justify-content: center; }   /* misma altura que los campos */
.lg .lg-filtros .lg-btns a.lg-btn.solo-icono { width: 34px; padding: 0; }
@media (min-width: 1180px) {
    .lg .lg-filtros { flex-wrap: nowrap; gap: 6px; }
    .lg .lg-filtros > .lg-col { flex: 1 1 0; min-width: 84px; }
    .lg .lg-filtros > .lg-col.fecha { flex: 1.35 1 0; min-width: 112px; }   /* dd-mm-aaaa y el icono del calendario */
    .lg .lg-filtros > .lg-col.hora { flex: .8 1 0; min-width: 84px; }
    .lg .lg-filtros .lg-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .lg .lg-filtros .lg-input { padding-left: 6px; padding-right: 4px; font-size: 12.5px; text-overflow: ellipsis; }
}
@media (max-width: 1179px) { .lg .lg-filtros .lg-btns { flex: 1 1 100%; } .lg .lg-filtros .lg-btns .lg-btn-primary { flex: 1; } }
@media (max-width: 520px) { .lg .lg-filtros > .lg-col { flex-basis: 100%; } }
/* Variante compacta, para filtros con pocos campos: los campos no se estiran por todo el ancho. */
.lg .lg-filtros.compacto > .lg-col { flex: 0 1 200px; }
@media (min-width: 1180px) { .lg .lg-filtros.compacto { flex-wrap: wrap; gap: 10px; } .lg .lg-filtros.compacto > .lg-col, .lg .lg-filtros.compacto > .lg-col.fecha { flex: 0 1 200px; min-width: 150px; } .lg .lg-filtros.compacto > .lg-col[style*="flex:1 1"] { flex: 1 1 220px; max-width: 460px; } .lg .lg-filtros.compacto .lg-label, .lg .lg-filtros.compacto .lg-input { font-size: 13px; padding-left: 10px; } }
@media (max-width: 1179px) { .lg .lg-filtros.compacto > .lg-col { flex: 1 1 150px; } .lg .lg-filtros.compacto .lg-btns { flex: 0 0 auto; } }
@media (max-width: 520px) { .lg .lg-filtros.compacto > .lg-col { flex-basis: 100%; } .lg .lg-filtros.compacto .lg-btns { flex: 1 1 100%; } }
.lg-dropdown > div a, .lg-dropdown > div button { display: block; width: 100%; text-align: left; padding: 7px 16px; color: #333; background: none; border: 0; font: inherit; font-size: 13px; cursor: pointer; border-radius: 0; margin: 0; box-shadow: none; }
.lg-dropdown > div a:hover, .lg-dropdown > div button:hover { background: #f4f4f4; color: #262626; }

/* Diálogo de confirmación (cb-confirm) */
dialog.lg-confirm { border: 0; border-radius: 8px; padding: 28px 26px 22px; width: 340px; max-width: calc(100vw - 40px); text-align: center; background: #fff; color: #333; box-shadow: 0 16px 40px rgba(15, 23, 32, .3); }
dialog.lg-confirm::backdrop { background: rgba(15, 23, 32, .5); }
dialog.lg-confirm .ic { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%; background: #fdf1f1; color: #c0392b; font-size: 22px; display: flex; align-items: center; justify-content: center; }
dialog.lg-confirm h4 { font-size: 16px; font-weight: 700; color: #1f2d3d; margin: 0 0 8px; }
dialog.lg-confirm p { font-size: 13px; color: #6b7684; line-height: 1.55; margin: 0 0 22px; white-space: pre-line; }
dialog.lg-confirm .acc { display: flex; gap: 10px; }
dialog.lg-confirm .acc .lg-btn { flex: 1; justify-content: center; padding: 8px 14px; font-weight: 600; }

/* Avisos tipo toastr */
.lg-toast { position: fixed; right: 20px; top: 70px; z-index: 3000; min-width: 260px; max-width: 360px; padding: 14px 18px 14px 50px; border-radius: 3px; color: #fff; background: rgba(0, 0, 0, .8); box-shadow: 0 2px 10px rgba(0, 0, 0, .3); font-size: 13px; }
.lg-toast.ok, .lg-toast.error { background: rgba(0, 0, 0, .8); }
.lg-toast::before { font-family: FontAwesome; position: absolute; left: 18px; top: 50%; transform: translateY(-50%); font-size: 20px; content: "\f05a"; }
.lg-toast.ok::before { content: "\f00c"; }
.lg-toast.error::before { content: "\f071"; }

/* Mapas (Leaflet) */
.lg-mapa { border-radius: 4px; border: 1px solid #e3e6ea; box-shadow: 0 1px 3px rgba(0, 0, 0, .05); }
.lg .leaflet-tooltip { padding: 6px 10px; font-size: 11px; font-weight: 500; border: 0; color: #2c3e50; border-radius: 6px; box-shadow: 0 4px 15px rgba(0, 0, 0, .1); }
.lg-pin { width: 26px; height: 26px; border-radius: 50%; background: #2c6ecb; color: #fff; font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.lg-pin.nuevo, .lg-pin.vehiculo { background: #dd4b39; }

@media print { .lg .no-print { display: none !important; } .lg-panel { border: 0; box-shadow: none; } }

.lg table.lg-table tr.fila-oscura td { background: #333; color: #fff; }
.lg table.lg-table tr.fila-oscura:hover td { background: #333; }

/* Recálculo de valor de rutas (reporte de servicios): botón flotante, avisos oscuros y resumen del lote */
.lg-flotante { position: fixed; right: 28px; bottom: 28px; z-index: 1500; }
.lg-flotante > button { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; margin: 0; border: 1px solid #2559a8; border-radius: 10px; background: #2c6ecb; color: #fff; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; box-shadow: 0 6px 20px rgba(44, 110, 203, .35), 0 2px 6px rgba(0, 0, 0, .1); transition: all .2s ease-in-out; }
.lg-flotante > button:hover { transform: translateY(-2px); background: #2559a8; box-shadow: 0 10px 24px rgba(44, 110, 203, .45); }
.lg-flotante > div { position: absolute; right: 0; bottom: calc(100% + 8px); min-width: 230px; background: #fff; border: 1px solid rgba(0, 0, 0, .1); border-radius: 10px; box-shadow: 0 12px 28px rgba(0, 0, 0, .15); padding: 8px 0; display: none; }
.lg-flotante.abierto > div { display: block; }
.lg-flotante > div button { display: block; width: 100%; margin: 0; padding: 8px 16px; border: 0; background: none; text-align: left; font: inherit; font-size: 14px; color: #333; cursor: pointer; border-radius: 0; }
.lg-flotante > div button:hover { background: #f8f9fa; color: #2c6ecb; }
.lg-flotante > div button.detener, .lg-flotante > div button.detener:hover { color: #ef4444; }
#rc-toasts { position: fixed; top: 64px; left: 16px; z-index: 5000; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.rc-toast { position: relative; padding: 12px 34px 12px 16px; border-radius: 3px; background: rgba(0, 0, 0, .8); color: #fff; border: 1px solid rgba(255, 255, 255, .15); box-shadow: 0 2px 10px rgba(0, 0, 0, .35); font-size: 13px; line-height: 1.45; }
.rc-toast a { color: #7cb4ff; text-decoration: underline; }
.rc-toast button { position: absolute; top: 4px; right: 8px; margin: 0; padding: 0; background: none; border: 0; color: #94a3b8; font-size: 20px; cursor: pointer; line-height: 1; }
.rc-toast.warning { border-left: 4px solid #f39c12; }
.rc-toast.success { border-left: 4px solid #00a65a; }
.rc-toast.error { border-left: 4px solid #dd4b39; }
.rc-toast.info { border-left: 4px solid #3c8dbc; }
dialog#rc-resumen { width: 95%; max-width: 1100px; padding: 0; border: 0; border-radius: 6px; box-shadow: 0 16px 40px rgba(15, 23, 32, .3); color: #333; }
dialog#rc-resumen::backdrop { background: rgba(15, 23, 32, .5); }
dialog#rc-resumen .rc-head { display: flex; justify-content: space-between; align-items: center; background: #1f2d3d; color: #fff; padding: 12px 18px; }
dialog#rc-resumen .rc-head h4 { margin: 0; font-size: 16px; }
dialog#rc-resumen .rc-head small { font-size: 13px; opacity: .8; font-weight: 400; }
dialog#rc-resumen .rc-head button { margin: 0; background: none; border: 0; color: #fff; font-size: 24px; cursor: pointer; opacity: .8; }
dialog#rc-resumen .rc-cuerpo { max-height: 70vh; overflow: auto; }
dialog#rc-resumen .rc-pie { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid #e2e8f0; }
.lg-tip { position: fixed; z-index: 6000; max-width: 280px; padding: 5px 10px; border-radius: 3px; background: #000; color: #fff; font-size: 12px; line-height: 1.4; pointer-events: none; opacity: .9; }
.lg .texto-truncado { display: inline-block; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.lg-head.claro .lg-count { background: #e7f0fd; color: #2c6ecb; }
.lg table.lg-table tfoot td { background: #f7f9fb; font-weight: 700; border-top: 2px solid #e2e8f0; }

.lg .lg-label .fa { margin-right: 5px; color: #8a94a3; }

/* Controles de la tabla (TablaLegacy: mostrar N, buscar, info y paginación) */
.lg .dt-barra { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 10px; font-size: 13px; color: #333; }
.lg .dt-barra label { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; text-transform: none; letter-spacing: 0; color: #333; font-size: 13px; }
.lg .dt-barra select.lg-input { width: auto; }
.lg .dt-barra input.lg-input { width: 200px; }
.lg .dt-pie { margin: 10px 0 0; }
.lg .dt-info { color: #5a6472; }
.lg .dt-pager { display: flex; gap: 4px; flex-wrap: wrap; }
.lg .dt-pag { margin: 0; padding: 4px 10px; font: inherit; font-size: 13px; border: 1px solid #ddd; border-radius: 3px; background: #fff; color: #2c6ecb; cursor: pointer; }
.lg .dt-pag:hover:not(:disabled) { background: #eee; }
.lg .dt-pag.activo { background: #2c6ecb; border-color: #2c6ecb; color: #fff; }
.lg .dt-pag:disabled { color: #999; cursor: default; }
.lg table.lg-table.dt-orden th.ord:not([aria-sort])::after { content: " \f0dc"; font-family: FontAwesome; color: #cbd5e1; font-size: 11px; float: right; margin-left: 8px; }
.lg table.lg-table.dt-orden th[aria-sort]::after { float: right; margin-left: 8px; }
.lg table.lg-table td.id-itinerario { background: #fafcff; text-align: center; }
.lg table.lg-table td.id-itinerario span { color: #2c6ecb; font-weight: 600; cursor: pointer; }
.lg table.lg-table td.id-itinerario span:hover { text-decoration: underline; }

/* Modal (cb-modal) */
dialog.lg-modal { border: 0; border-radius: 6px; padding: 0; width: 520px; max-width: calc(100vw - 30px); box-shadow: 0 16px 40px rgba(15, 23, 32, .3); color: #333; }
dialog.lg-modal::backdrop { background: rgba(15, 23, 32, .5); }
dialog.lg-modal .mh { display: flex; justify-content: space-between; align-items: center; background: #1f2d3d; color: #fff; padding: 14px 18px; }
dialog.lg-modal .mh h4 { margin: 0; font-size: 16px; }
dialog.lg-modal .mh .x { margin: 0; background: none; border: 0; color: #fff; font-size: 24px; cursor: pointer; opacity: .8; line-height: 1; }
dialog.lg-modal .mb { padding: 18px; }
dialog.lg-modal .mf { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid #e2e8f0; }

/* Chips de selección (cb-chip) */
.lg .cb-chip { display: inline-flex; align-items: center; gap: 6px; margin: 0 6px 8px 0; padding: 6px 12px; border: 1px solid #d2d6de; border-radius: 4px; background: #fff; color: #333; font-size: 13px; font-weight: 400; text-transform: none; letter-spacing: 0; cursor: pointer; }
.lg .cb-chip:hover { background: #f5f9ff; border-color: #2c6ecb; }
.lg .cb-chip input { margin: 0; width: auto; height: auto; }
.lg .cb-nota { display: flex; gap: 10px; padding: 12px 14px; border-radius: 4px; background: #eaf6fb; border: 1px solid #bfe3f1; color: #31708f; margin-bottom: 18px; }
