/* Emich Trucking v9.9.24 · UI consolidada sin capas heredadas */
:root{
  --v9924-wine:#8f1f3d;--v9924-wine-dark:#74192f;--v9924-soft:#f7f8f9;
  --v9924-line:#e3e7e9;--v9924-ink:#252b2f;--v9924-muted:#737c82;
  --v9924-shadow:0 8px 24px rgba(40,28,33,.045);
}
body.v9924-clean{background:#fafaf9!important;color:var(--v9924-ink)!important}
body.v9924-clean .main{background:#fafaf9!important}
body.v9924-clean #view{display:flex;flex-direction:column;gap:14px;min-width:0}

/* La cabecera superior es la única cabecera de módulo. Se retiran títulos/contextos repetidos. */
body.v9924-clean #view>.v9-pagebar,
body.v9924-clean #view>.v9-context{display:none!important}
.v9924-page-actions{display:flex;justify-content:flex-end;align-items:center;min-width:0;margin:0 0 2px}
.v9924-page-actions .v9-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;width:auto}
.v9924-summary-strip{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin:0 0 2px;min-width:0}
.v9924-summary-stat{min-width:0;border:1px solid var(--v9924-line);background:#fff;border-radius:13px;padding:10px 12px}
.v9924-summary-stat small,.v9924-summary-stat b{display:block}
.v9924-summary-stat small{font-size:.66rem;color:var(--v9924-muted);line-height:1.2}
.v9924-summary-stat b{margin-top:3px;font-size:1.1rem;color:#6f1933;line-height:1.15;overflow-wrap:anywhere}

/* Operación: no repetir el título “Operación” dentro de la propia pestaña. */
body.v9924-clean .v9919-top h2{display:none!important}
body.v9924-clean .v9919-top{min-height:42px;margin-bottom:0;align-items:center}
body.v9924-clean .v9919-top>div{display:flex;align-items:center;min-height:40px}
body.v9924-clean .v9919-top>div>span{margin:0!important;font-size:.75rem;color:var(--v9924-muted)}

/* GPS: el hero viejo deja de ser una “máscara” y pasa a una barra de acciones compacta. */
body.v9924-clean .v69-hero{background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;margin:0 0 10px!important;min-height:0!important;display:flex!important;justify-content:flex-end!important;align-items:center!important}
body.v9924-clean .v69-hero>div:first-child{display:none!important}
body.v9924-clean .v69-hero .actions{margin:0!important;display:flex!important;gap:8px!important;justify-content:flex-end!important;flex-wrap:wrap!important}
body.v9924-clean #v69Status.notice{margin:0 0 10px!important}

/* Retira banners explicativos de generaciones previas que quedaron montados bajo la UI nueva. */
body.v9924-clean .v97-op-context,
body.v9924-clean .v98-op-summary,
body.v9924-clean .v9915-method-banner,
body.v9924-clean .v9915-method-note,
body.v9924-clean .v9923-legacy-note{display:none!important}

/* Una sola familia visual para tarjetas/paneles de todas las generaciones. */
body.v9924-clean #view .card,
body.v9924-clean #view .v9-card,
body.v9924-clean #view .v5-module,
body.v9924-clean #view .v69-map-card,
body.v9924-clean #view .v69-unit-card,
body.v9924-clean #view .v6103-unit-card,
body.v9924-clean #view .v9919-trip,
body.v9924-clean #view .v9923-distance-panel,
body.v9924-clean #modalbox .card{
  border-color:var(--v9924-line)!important;
  border-radius:16px!important;
  box-shadow:var(--v9924-shadow)!important;
  background:#fff!important;
}
body.v9924-clean #view .section.card{margin-top:0!important}
body.v9924-clean #view .section-title{margin-bottom:12px!important}
body.v9924-clean #view .section-title .sub{max-width:760px}

/* Tabs: mismo aspecto en toda la aplicación, independientemente de la capa que los creó. */
body.v9924-clean #view .v9-tabs,
body.v9924-clean #view .v5-tabs,
body.v9924-clean #view .catalog-tabs,
body.v9924-clean #view .admin-tabs,
body.v9924-clean #view .v61-config-tabs{
  display:flex!important;align-items:center!important;gap:4px!important;
  width:max-content!important;max-width:100%!important;overflow-x:auto!important;
  padding:4px!important;margin:0 0 12px!important;background:#efefee!important;
  border:1px solid #e5e6e5!important;border-radius:13px!important;box-shadow:none!important;
  -webkit-overflow-scrolling:touch!important;
}
body.v9924-clean #view .v9-tabs button,
body.v9924-clean #view .v5-tabs button,
body.v9924-clean #view .catalog-tabs button,
body.v9924-clean #view .admin-tabs button,
body.v9924-clean #view .v61-config-tabs button{
  flex:0 0 auto!important;min-height:36px!important;height:auto!important;
  border:0!important;border-radius:9px!important;background:transparent!important;
  padding:8px 12px!important;color:#697277!important;font-size:.76rem!important;font-weight:780!important;
  white-space:nowrap!important;box-shadow:none!important;
}
body.v9924-clean #view .v9-tabs button.active,
body.v9924-clean #view .v5-tabs button.active,
body.v9924-clean #view .catalog-tabs button.active,
body.v9924-clean #view .admin-tabs button.active,
body.v9924-clean #view .v61-config-tabs button.active{
  background:#fff!important;color:var(--v9924-wine)!important;box-shadow:0 2px 8px rgba(40,28,33,.06)!important;
}

/* Toolbars/acciones: una única fila limpia y botones coherentes. */
body.v9924-clean #view .v9-toolbar,
body.v9924-clean #view .toolbar,
body.v9924-clean #view .v94-fiscal-toolbar{
  gap:8px!important;margin-bottom:12px!important;min-width:0!important;
}
body.v9924-clean #view button,
body.v9924-clean #modalbox button{box-sizing:border-box;max-width:100%;overflow-wrap:anywhere;word-break:normal}
body.v9924-clean .btn,
body.v9924-clean .v9-btn,
body.v9924-clean .v9919-mini,
body.v9924-clean .v9919-program,
body.v9924-clean .v9920-primary,
body.v9924-clean .v9920-secondary,
body.v9924-clean .v9923-distance-action{
  border-radius:10px!important;min-height:38px;line-height:1.15!important;
}
body.v9924-clean .btn.primary,
body.v9924-clean .v9-btn.primary,
body.v9924-clean .v9919-mini.primary,
body.v9924-clean .v9919-program,
body.v9924-clean .v9920-primary{background:var(--v9924-wine)!important;border-color:var(--v9924-wine)!important;color:#fff!important}

/* Tablas y grids: sin capas de fondo anidadas, sin desbordes de viewport. */
body.v9924-clean #view .tablewrap,
body.v9924-clean #view .v9-tablewrap,
body.v9924-clean #view .v9921-table-wrap{max-width:100%!important;min-width:0!important;overflow:auto!important;border-radius:13px!important}
body.v9924-clean #view table{max-width:100%}
body.v9924-clean #view .grid{gap:10px!important}
body.v9924-clean #view .metric{box-shadow:none!important}

/* Formularios y modales */
body.v9924-clean #view input,
body.v9924-clean #view select,
body.v9924-clean #view textarea,
body.v9924-clean #modalbox input,
body.v9924-clean #modalbox select,
body.v9924-clean #modalbox textarea{min-width:0;max-width:100%;box-sizing:border-box}
body.v9924-clean #modalbox{max-width:min(980px,calc(100vw - 28px))!important}

/* Navegación limpia, sin capas/etiquetas heredadas. */
body.v9924-clean .mobilebar:not(.v9-mobilebar){display:none!important}
body.v9924-clean #nav button span:last-child,
body.v9924-clean .v9-mobilebar button small{white-space:nowrap!important}

@media(max-width:900px){
  body.v9924-clean #view{gap:11px}
  .v9924-page-actions{justify-content:stretch}
  .v9924-page-actions .v9-actions{width:100%;display:grid;grid-template-columns:1fr}
  .v9924-page-actions .v9-actions>*{width:100%!important}
  .v9924-summary-strip{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
  body.v9924-clean .v69-hero{justify-content:stretch!important}
  body.v9924-clean .v69-hero .actions{width:100%!important;display:grid!important;grid-template-columns:1fr 1fr!important}
  body.v9924-clean .v69-hero .actions>*{width:100%!important}
}
@media(max-width:720px){
  .v9924-summary-strip{grid-template-columns:1fr 1fr}
  .v9924-summary-stat:last-child:nth-child(odd){grid-column:1/-1}
  body.v9924-clean #view .v9-tabs,
  body.v9924-clean #view .v5-tabs,
  body.v9924-clean #view .catalog-tabs,
  body.v9924-clean #view .admin-tabs,
  body.v9924-clean #view .v61-config-tabs{
    width:100%!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    overflow:visible!important;gap:5px!important;
  }
  body.v9924-clean #view .v9-tabs button,
  body.v9924-clean #view .v5-tabs button,
  body.v9924-clean #view .catalog-tabs button,
  body.v9924-clean #view .admin-tabs button,
  body.v9924-clean #view .v61-config-tabs button{
    width:100%!important;min-width:0!important;white-space:normal!important;text-align:center!important;justify-content:center!important;
  }
  body.v9924-clean #view .actions,
  body.v9924-clean #modalbox .actions{display:grid!important;grid-template-columns:1fr 1fr!important;width:100%!important}
  body.v9924-clean #view .actions>* ,body.v9924-clean #modalbox .actions>*{width:100%!important}
}
@media(max-width:460px){
  .v9924-summary-strip{grid-template-columns:1fr}
  .v9924-summary-stat:last-child:nth-child(odd){grid-column:auto}
  body.v9924-clean .v69-hero .actions{grid-template-columns:1fr!important}
  body.v9924-clean #view .actions,
  body.v9924-clean #modalbox .actions{grid-template-columns:1fr!important}
  body.v9924-clean #view .v9-tabs,
  body.v9924-clean #view .v5-tabs,
  body.v9924-clean #view .catalog-tabs,
  body.v9924-clean #view .admin-tabs,
  body.v9924-clean #view .v61-config-tabs{grid-template-columns:1fr 1fr!important}
}
@media(max-width:340px){
  body.v9924-clean #view .v9-tabs,
  body.v9924-clean #view .v5-tabs,
  body.v9924-clean #view .catalog-tabs,
  body.v9924-clean #view .admin-tabs,
  body.v9924-clean #view .v61-config-tabs{grid-template-columns:1fr!important}
}
