/* Mayoristas y KKAA reutilizan los tokens y las tablas de Tiempo de visitas. */
#pantalla .tvs .tvr-section-title { align-items:center; }
#pantalla .tvs .tvs-index { min-width:21px; padding:2px 4px; color:#fff; background:#165ccb; border-radius:5px; font-size:11px; font-weight:750; text-align:center; }
#pantalla .tvs .tvs-panel-dot { display:inline-block; flex:0 0 9px; width:9px; height:9px; margin-block:4px; border-radius:50%; background:var(--tvs-color,var(--tvr-accent,#2789e5)); }
#pantalla .tvs .tvr-kpi-title { min-height:25px; }
#pantalla .tvs .tvr-kpi > :is(strong,small) { padding-inline-start:16px; }
#pantalla .tvs .tvr-kpi > strong { font-size:clamp(20px,1.75vw,29px); overflow-wrap:anywhere; }
#pantalla .tvs .tvs-panel-body { min-width:0; display:flex; flex-direction:column; flex:1; gap:4px; }
#pantalla .tvs .tvs-panel-body > .tym-ec { width:100%; }
#pantalla .tvs .tvs-panel-body > .tvr-control { align-self:flex-start; }
#pantalla .tvs .tvr-grid .tvs-panel-body > .tvr-table-scroll { max-height:242px; }
#pantalla .tvs .tvr-grid .tvs-panel-body > .tvr-note:last-child { margin-top:auto; }
#pantalla .tvs .tvr-grid > .tvs-panel .tvr-empty { margin-block:auto; min-height:84px; }
#pantalla .tvs .tvs-segment { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:4px; margin-block:2px 4px; }
#pantalla .tvs .tvs-segment button { padding:4px 9px; border:1px solid var(--tv-edge); border-radius:6px; background:var(--tv-tint); color:var(--ink); }
#pantalla .tvs .tvs-segment button[aria-pressed="true"] { color:white; background:#165ccb; border-color:#165ccb; }
#pantalla .tvs .tvs-region-overview { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); align-items:center; gap:8px; padding:8px; border-radius:7px; background:var(--tv-tint); }
#pantalla .tvs .tvs-outline { position:relative; width:min(100%,190px); margin-inline:auto; }
#pantalla .tvs .tvs-outline img { display:block; width:100%; height:auto; }
#pantalla .tvs .tvs-region-badge { position:absolute; top:32%; left:3%; display:grid; gap:0; transform:translateY(-50%); border:1px solid #5baaff; border-radius:6px; padding:2px 5px; background:#edf6ff; color:#143257; font-size:10px; line-height:1.25; }
#pantalla .tvs .tvs-region-badge[data-tvs-hub="UIO"] { top:65.5%; left:auto; right:3%; }
body[data-t="dark"] #pantalla .tvs .tvs-region-badge { background:#163454; color:#ecf6ff; }
#pantalla .tvs .tvs-region-badge[aria-pressed="true"] { box-shadow:0 0 0 2px #5baaff; }
#pantalla .tvs .tvs-region-metrics { display:grid; gap:8px; padding-inline-start:8px; border-inline-start:1px dashed var(--tv-blue); font-size:11px; }
#pantalla .tvs .tvs-region-metrics > div { display:grid; grid-template-columns:1fr auto; align-items:baseline; gap:2px 4px; }
#pantalla .tvs .tvs-region-metrics small { grid-column:1/-1; color:var(--soft); }
#pantalla .tvs .tvs-geozones summary { padding:4px 0; color:var(--tv-blue); font-size:11px; }
#pantalla .tvs .tvs-leaflet { min-height:185px; border-radius:7px; isolation:isolate; }
#pantalla .tvs .tvs-map-marker span { display:block; width:16px; height:16px; background:var(--tvs-color); border:2px solid white; border-radius:50%; box-shadow:0 2px 5px #0005; }
#pantalla .tvs .tvs-hub-label { border-color:var(--tv-edge); border-radius:6px; background:var(--tv-surface); color:var(--ink); font-size:10px; font-weight:700; }
#pantalla .tvs .tvs-hub-label::before { border-right-color:var(--tv-surface); }
#pantalla .tvs .tvs-regions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; margin-top:4px; }
#pantalla .tvs .tvs-region { display:block; width:100%; min-width:0; padding:6px; border:1px solid color-mix(in srgb,var(--tvs-color) 27%,var(--tv-edge)); background:color-mix(in srgb,var(--tvs-color) 8%,var(--tv-surface)); border-radius:7px; color:var(--ink); text-align:left; }
#pantalla .tvs .tvs-region[aria-pressed="true"] { border-color:var(--tvs-color); box-shadow:0 0 0 1px var(--tvs-color); }
#pantalla .tvs .tvs-region .ini-regh { display:grid; gap:2px; }
#pantalla .tvs .tvs-region small { color:var(--soft); font-size:10px; }
#pantalla .tvs .tvs-region .ini-regk { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:3px 4px; font-size:10px; color:var(--soft); }
#pantalla .tvs .tvs-region .ini-regk b { display:block; color:var(--ink); font-size:11px; overflow-wrap:anywhere; }
#pantalla .tvs .tvs-timeline-scroll { overflow:auto; border:1px solid var(--tv-edge); border-radius:7px; }
#pantalla .tvs :is(.tvs-timeline-head,.tvs-timeline-line) { display:grid; grid-template-columns:minmax(125px,1fr) minmax(245px,4fr) minmax(165px,1.35fr); min-width:595px; align-items:center; gap:10px; padding:6px 8px; }
#pantalla .tvs .tvs-timeline-head { background:var(--tv-tint); }
#pantalla .tvs .tvs-timeline-head > div { display:flex; justify-content:space-between; gap:4px; color:var(--soft); font-size:10px; }
#pantalla .tvs .tvs-timeline-line + .tvs-timeline-line { border-top:1px solid var(--tv-edge); }
#pantalla .tvs .tvs-timeline-line small { display:block; color:var(--soft); font-size:10px; }
#pantalla .tvs .tvs-timeline-track { height:16px; position:relative; border-radius:4px; background:var(--tv-tint); }
#pantalla .tvs .tvs-timeline-track i { position:absolute; inset-block:1px; border-radius:2px; background:#687f9e; }
#pantalla .tvs .tvs-timeline-track [data-kind="pre"] { background:#277fea; }
#pantalla .tvs .tvs-timeline-track [data-kind="bees"] { background:#8558e5; }
#pantalla .tvs .tvs-timeline-track [data-kind="post"] { background:#0aa8a0; }
#pantalla .tvs .tvs-timeline-track [data-kind="partial"] { background:repeating-linear-gradient(120deg,#8757b2,#8757b2 4px,#ba82e6 4px,#ba82e6 8px); }
#pantalla .tvs .tvs-timeline-track em { position:absolute; inset-block:0; width:1px; background:var(--ink); }
#pantalla .tvs .tvs-visit-actions { display:flex; align-items:center; gap:7px; }
#pantalla .tvs .tvs-route-summary { display:flex; flex-wrap:wrap; align-items:center; gap:6px 14px; padding:7px; margin-bottom:5px; border-radius:6px; background:var(--tv-tint); }
#pantalla .tvs .tvs-route-summary b { padding-inline-start:3px; }
#pantalla .tvs [data-tvs-slot] { min-width:0; scroll-margin-top:135px; }
#pantalla .tvs .tvr-tools input[type="search"] { width:min(230px,100%); }
#pantalla .tvs .tvr-tools select { max-width:min(235px,78vw); }
#pantalla .tvs .tvr-table-scroll :is(th,td) { max-width:240px; }
#pantalla .tvs .tvs-vehicle-review { display:grid; flex:1; grid-template-rows:auto 1fr auto; gap:7px; min-width:0; }
#pantalla .tvs .tvs-vehicle-review .tvr-control { justify-self:start; }
#pantalla .tvs .tvs-vehicle-review .tvr-table-scroll { max-height:none; }
#pantalla .tvs .tvs-vehicle-review table { height:100%; }
#pantalla .tvs .tvs-vehicle-review td { vertical-align:middle; }
#pantalla .tvs .tvs-kk-overview { display:grid; grid-template-columns:minmax(0,1.8fr) minmax(0,1fr) minmax(0,1fr); gap:7px; }
#pantalla .tvs .tvs-kk-overview > .tvr-section { grid-template-rows:auto 1fr; padding:7px; border:1px solid var(--tv-edge); border-radius:12px; }
#pantalla .tvs .tvs-kk-overview .tvr-kpis { grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; }
#pantalla .tvs .tvs-kk-overview .tvr-kpi { padding:7px; }
#pantalla .tvs .tvs-kk-overview .tvr-kpi > :is(strong,small) { padding-inline-start:0; }
#pantalla .tvs .tvs-kk-overview .tvr-kpi > strong { font-size:clamp(17px,1.35vw,24px); }
#pantalla .tvs .tvs-kk-overview .tvs-region-overview { gap:6px; }
#pantalla .tvs .tvs-kk-overview .tvs-region { display:grid; grid-template-rows:auto 1fr; gap:6px; }
#pantalla .tvs .tvs-kk-overview .ini-regk { grid-auto-rows:1fr; gap:4px; }
#pantalla .tvs .tvs-kk-overview .ini-regk > span { display:flex; flex-direction:column; justify-content:center; padding:3px 4px; border-radius:5px; background:color-mix(in srgb,var(--tv-surface) 68%,transparent); }
#pantalla .tvs .tvs-avg-events, #pantalla .tvs .tvs-avg-durations { display:grid; gap:5px; list-style:none; margin:0; padding:0; text-align:center; }
#pantalla .tvs .tvs-avg-events { flex:2; align-content:center; grid-template-columns:repeat(4,minmax(0,1fr)); padding-block:8px; }
#pantalla .tvs .tvs-avg-events li { display:grid; justify-items:center; align-content:start; gap:3px; min-width:0; }
#pantalla .tvs .tvs-avg-events li > span { display:grid; place-items:center; width:35px; height:35px; border-radius:50%; color:var(--phase); background:color-mix(in srgb,var(--phase) 15%,var(--tv-surface)); border:1px solid color-mix(in srgb,var(--phase) 29%,var(--tv-edge)); }
#pantalla .tvs .tvs-avg-events svg { width:19px; height:19px; }
#pantalla .tvs .tvs-avg-events [data-event="arrival"] { --phase:var(--tv-bad); }
#pantalla .tvs .tvs-avg-events [data-event="start"] { --phase:var(--tv-blue); }
#pantalla .tvs .tvs-avg-events [data-event="finish"] { --phase:var(--tv-good); }
#pantalla .tvs .tvs-avg-events [data-event="leave"] { --phase:#8e58db; }
#pantalla .tvs .tvs-avg-events time { color:var(--soft); font-variant-numeric:tabular-nums; }
#pantalla .tvs .tvs-avg-durations { flex:1; grid-template-columns:repeat(3,minmax(0,1fr)); }
#pantalla .tvs .tvs-avg-durations li { display:grid; align-content:center; min-width:0; padding:7px 4px; border-radius:6px; background:var(--tv-tint); }
#pantalla .tvs .tvs-avg-durations li:first-child { background:color-mix(in srgb,var(--tv-warn) 16%,var(--tv-surface)); }
#pantalla .tvs .tvs-avg-durations li:nth-child(2) { background:color-mix(in srgb,var(--tv-blue) 16%,var(--tv-surface)); }
#pantalla .tvs .tvs-avg-durations strong, #pantalla .tvs .tvs-avg-durations span { display:block; }
#pantalla .tvs .tvs-avg-durations span { color:var(--soft); font-size:10px; }
#pantalla .tvs .tvs-avg-events li { position:relative; }
#pantalla .tvs .tvs-avg-events li:not(:last-child)::after { position:absolute; z-index:0; top:17px; left:calc(50% + 19px); width:calc(100% - 33px); height:1px; background:var(--tv-edge); content:""; }
@media(max-width:1180px) {
  #pantalla .tvs .tvs-kk-overview { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #pantalla .tvs .tvs-kk-overview > :first-child { grid-column:1/-1; }
  #pantalla .tvs .tvs-kk-overview .tvr-kpis { grid-template-columns:repeat(6,minmax(0,1fr)); }
}
@media(max-width:700px) {
  #pantalla .tvs .tvs-kk-overview { grid-template-columns:minmax(0,1fr); }
  #pantalla .tvs .tvs-kk-overview .tvr-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
#pantalla .tvs[data-tvs-mode="may"] [data-tvs-slot="tools"] :is(input[type="search"],select:not([data-tvs-field="order"])) {
  border-color:color-mix(in srgb,var(--tv-blue) 45%,var(--tv-edge));
  background:var(--tv-tint);
  color:var(--tv-blue);
}
#pantalla .tvs[data-tvs-mode="may"] [data-tvs-slot="tools"] :is(input[type="search"]:not(:placeholder-shown),select:not([data-tvs-field="order"]):has(option:checked:not([value=""]))) {
  border-color:var(--tv-blue);
  background:color-mix(in srgb,var(--tv-blue) 15%,var(--tv-surface));
  font-weight:700;
}
@media(max-width:700px) {
  #pantalla .tvs .tvr-kpi > :is(strong,small) { padding-inline-start:0; }
}
