/* Emich Trucking v9.8.0 — integration/stability layer over v6.10.22 */
:root{--v98-wine:#8f2441;--v98-text:#22292d;--v98-muted:#6d777d;--v98-line:#e3e4e1;--v98-soft:#faf9f7}
.v98-op-summary{display:grid;grid-template-columns:minmax(0,1fr) repeat(3,minmax(120px,170px));gap:12px;align-items:stretch;margin:8px 0 18px;padding:18px 20px;border:1px solid var(--v98-line);border-radius:20px;background:#fff;box-shadow:0 14px 34px rgba(29,37,40,.045)}
.v98-op-summary>div{min-width:0}.v98-op-summary>div:first-child{display:flex;flex-direction:column;justify-content:center;padding-right:10px}.v98-op-summary>div:first-child>b{font-size:18px;line-height:1.25;margin:0 0 5px;color:var(--v98-text)}.v98-op-summary>div:first-child>span{font-size:13px;line-height:1.5;color:var(--v98-muted)}
.v98-op-summary>div:not(:first-child){display:flex;flex-direction:column;justify-content:center;padding:12px 15px;border:1px solid #eceae7;border-radius:15px;background:#fcfbfa}.v98-op-summary small{font-size:10px;font-weight:850;letter-spacing:.11em;color:#7c858a}.v98-op-summary>div:not(:first-child)>b{font-size:24px;margin-top:5px}

/* Make primary/secondary text visually separate everywhere. */
.v98-primary,.v94-primary{display:flex!important;flex-direction:column!important;align-items:flex-start!important;gap:5px!important;min-width:0!important}.v98-primary>b,.v94-primary>b,.v98-mainline{display:block!important;margin:0!important;line-height:1.3!important;overflow-wrap:anywhere!important}.v98-primary>small,.v94-primary>small,.v98-subline{display:block!important;margin:0!important;line-height:1.4!important;color:#7b858b!important;font-size:11.5px!important;overflow-wrap:anywhere!important}
.v9-table td>b+small,.table td>b+small,.v9-list-row b+small{display:block!important;margin-top:5px!important}.v9-table td small,.table td small{line-height:1.4!important}

/* Fiscal summaries / linked equipment. */
.v98-client-summary,.v98-equipment-summary,.v98-invoice-trip-note{display:flex;flex-direction:column;gap:4px;margin:12px 0 0;padding:11px 13px;border:1px solid #eadfe2;border-radius:13px;background:#faf7f8;min-width:0}.v98-client-summary b,.v98-equipment-summary b,.v98-invoice-trip-note b{font-size:12px;color:var(--v98-wine)}.v98-client-summary span,.v98-equipment-summary span,.v98-invoice-trip-note span{font-size:12.5px;line-height:1.5;color:#606a70;overflow-wrap:anywhere}
.v98-location-action{display:flex;align-items:center;gap:12px;margin-top:10px}.v98-location-action .v9-btn{min-height:40px!important;padding:8px 13px!important;white-space:nowrap}.v98-loc-status{display:flex;flex-direction:column;gap:2px;min-width:0;font-size:11.5px;line-height:1.4;color:#717b80}.v98-loc-status b{color:#30383d;font-size:12px}.v98-resolve-btn{margin-top:10px!important;align-self:flex-start!important}

/* Do not let date/time controls become huge or fall behind the modal. */
.modal{z-index:1000000!important}.modalbox{z-index:1000001!important;isolation:isolate!important;overflow-y:auto!important;overflow-x:hidden!important}.v98-date-input,.modalbox input[type="date"],.modalbox input[type="datetime-local"],.modalbox input[type="time"]{position:relative!important;z-index:5!important;max-width:240px!important;min-width:160px!important;width:100%!important}.v94-cp-location input[type="datetime-local"]{max-width:220px!important}.v6112-datetime-control{position:relative!important;z-index:6!important;max-width:220px!important;min-width:160px!important;width:100%!important;min-height:46px!important}.v6112-datetime-control .v6112-dt-main{min-width:0!important}.v6112-datetime-control [data-dt-date]{white-space:nowrap!important;font-size:12.5px!important}.v6112-datetime-control [data-dt-time]{font-size:11px!important}
#v6112DateTimeSheet{z-index:2147483000!important}#v6112DateTimeSheet .v6112-dt-backdrop{z-index:2147483000!important}#v6112DateTimeSheet .v6112-dt-panel{z-index:2147483001!important;position:fixed!important}

/* Process / diagnostics. */
.v98-process-card{margin:12px 0 16px;padding:16px 18px;border:1px solid var(--v98-line);border-radius:18px;background:#fff;box-shadow:0 9px 28px rgba(31,38,42,.035)}.v98-process-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}.v98-process-head>div{display:flex;flex-direction:column;gap:4px}.v98-process-head b{font-size:15px}.v98-process-head span{font-size:12.5px;color:var(--v98-muted)}.v98-process-steps{display:flex;gap:7px;flex-wrap:wrap;margin-top:13px}.v98-process-steps span{padding:7px 10px;border:1px solid #e6e4e2;border-radius:999px;background:#faf9f8;color:#747d82;font-size:11.5px;font-weight:750}.v98-process-steps .active{border-color:#d8b6c0;background:#fbf3f5;color:var(--v98-wine)}.v98-process-steps .done{border-color:#cfe8db;background:#f0faf5;color:#1b7955}
.v98-diag-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:14px 0}.v98-diag-kpis>div{padding:13px 14px;border:1px solid var(--v98-line);border-radius:14px;background:#faf9f8}.v98-diag-kpis small{display:block;font-size:10px;font-weight:850;letter-spacing:.08em;color:#7b858a}.v98-diag-kpis b{display:block;margin-top:4px;font-size:23px}.v98-diag-list{display:flex;flex-direction:column;gap:8px;max-height:52vh;overflow:auto}.v98-diag{display:grid;grid-template-columns:120px minmax(0,1fr);gap:10px;padding:10px 12px;border-radius:12px;border:1px solid #eceae7;background:#fff}.v98-diag b{font-size:11px}.v98-diag span{font-size:12.5px;line-height:1.45}.v98-diag.bad{border-color:#efc8c8;background:#fff8f8}.v98-diag.warn{border-color:#ead9b7;background:#fffbf3}.v98-diag.info{background:#f8fafb}.v98-diagnostics-card{margin-top:18px!important}

/* Party location fields and form containment. */
.v98-party-address{min-width:0}.v98-party-status{padding:9px 11px;border:1px solid #ece8e5;border-radius:11px;background:#fbfaf9;color:#6e787e;font-size:11.5px;line-height:1.45;overflow-wrap:anywhere}.span2{grid-column:1/-1}
.v94-cp-location,.v94-good-row,.v94-concept-row,.v9-doc-section{min-width:0!important;max-width:100%!important}.v94-location-grid>*{min-width:0!important}.v94-cp-location [data-k="mapUrl"],.v94-cp-location [data-k="address"]{min-width:0!important}

/* Preserve legacy operation controls in the new shell. */
#tripForm .fuel-entry{min-width:0!important}#tripForm .fuel-entry input{min-width:0!important}.v6116-quick-card,.v6116-tank-list,.v699-mini-grid{max-width:100%!important}.v6116-quick-card input,.v6116-quick-card select{max-width:100%!important}.v699-inline-live{min-width:0!important}.v699-mini-grid>div{min-width:0!important}

@media(max-width:1200px){.v98-op-summary{grid-template-columns:minmax(0,1fr) repeat(3,minmax(105px,140px))}.v94-cp-location .v94-location-grid{grid-template-columns:1fr 1fr!important}.v98-location-action{align-items:flex-start;flex-direction:column}}
@media(max-width:900px){.v98-op-summary{grid-template-columns:1fr 1fr!important}.v98-op-summary>div:first-child{grid-column:1/-1}.v98-process-head{flex-direction:column}.v98-process-head .v9-btn{width:100%}.v98-diag{grid-template-columns:1fr;gap:3px}.v94-cp-location .v94-location-grid{grid-template-columns:1fr!important}.v98-date-input,.modalbox input[type="date"],.modalbox input[type="datetime-local"],.modalbox input[type="time"],.v6112-datetime-control{max-width:100%!important;width:100%!important}.v98-location-action .v9-btn{width:100%}.v98-diag-kpis{grid-template-columns:repeat(3,1fr)}}
@media(max-width:560px){.v98-op-summary{padding:14px;grid-template-columns:1fr 1fr!important}.v98-op-summary>div:first-child>b{font-size:16px}.v98-op-summary>div:first-child>span{font-size:12.5px}.v98-process-steps{display:grid;grid-template-columns:1fr 1fr}.v98-process-steps span{text-align:center}.v98-diag-kpis{grid-template-columns:1fr}.v9-formgrid,.formgrid.two-col{grid-template-columns:1fr!important}.span2{grid-column:auto!important}.modalbox{width:100%!important;max-width:100%!important}.v94-location-grid{grid-template-columns:1fr!important}}

/* v9.8 expedition timeline */
.v98-timeline-card{margin:0 0 16px;padding:16px 18px;border:1px solid var(--v98-line);border-radius:18px;background:#fff;box-shadow:0 9px 28px rgba(31,38,42,.035)}
.v98-timeline{display:flex;flex-direction:column;margin-top:12px;border-left:2px solid #eee7e9;padding-left:16px;max-height:360px;overflow:auto}
.v98-event{position:relative;display:grid;grid-template-columns:132px minmax(0,1fr);gap:12px;padding:9px 4px}.v98-event:before{content:'';position:absolute;left:-22px;top:16px;width:10px;height:10px;border-radius:50%;background:#c9cdd0;border:2px solid #fff;box-shadow:0 0 0 1px #ddd}
.v98-event.operacion:before{background:#8f2441}.v98-event.fiscal:before{background:#316b9e}.v98-event.combustible:before{background:#b68025}.v98-event.cobranza:before{background:#27805b}.v98-event.planeacion:before{background:#7b6b91}
.v98-event time{font-size:11px;color:#858e93;line-height:1.4}.v98-event>div{display:flex;flex-direction:column;gap:3px;min-width:0}.v98-event b{font-size:12.5px;color:#30383d}.v98-event span{font-size:11.8px;color:#717b80;line-height:1.4;overflow-wrap:anywhere}
@media(max-width:560px){.v98-event{grid-template-columns:1fr;gap:2px}.v98-timeline{padding-left:14px}.v98-event:before{left:-20px}}
.v98-process-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.v98-process-actions .v9-btn{white-space:nowrap}
@media(max-width:700px){.v98-process-actions{width:100%;display:grid;grid-template-columns:1fr 1fr}.v98-process-actions .v9-btn{width:100%}}

/* Carta Porte location layout: keep date/time compact and prevent fields from escaping the modal. */
.v94-cp-location .v94-location-grid{display:grid!important;grid-template-columns:minmax(240px,1.45fr) minmax(100px,.42fr) minmax(145px,.62fr) minmax(220px,1fr)!important;gap:12px!important;align-items:end!important}
.v94-cp-location .v94-location-grid>.v9-field:nth-child(5){grid-column:1/4!important}.v94-cp-location .v94-location-grid>.v9-field:nth-child(6){grid-column:4!important;max-width:220px!important;width:100%!important}.v94-cp-location .v94-location-grid>.v9-field:nth-child(6) .v6112-datetime-control{max-width:220px!important;width:100%!important}
@media(max-width:1200px){.v94-cp-location .v94-location-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important}.v94-cp-location .v94-location-grid>.v9-field:nth-child(5),.v94-cp-location .v94-location-grid>.v9-field:nth-child(6){grid-column:auto!important;max-width:none!important}.v94-cp-location .v94-location-grid>.v9-field:nth-child(6) .v6112-datetime-control{max-width:100%!important}}
@media(max-width:700px){.v94-cp-location .v94-location-grid{grid-template-columns:1fr!important}}

/* v9.8.1: compact date/time controls inside fiscal modals */
.v94-cp-location .v6112-datetime-control,
.v9-doc-section .v6112-datetime-control,
.modalbox .v6112-datetime-control{
  height:44px!important;
  min-height:44px!important;
  max-width:190px!important;
  padding:0 11px!important;
  align-items:center!important;
}
.v94-cp-location .v6112-dt-main,
.v9-doc-section .v6112-dt-main,
.modalbox .v6112-dt-main{
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  gap:6px!important;
}
.v94-cp-location .v6112-dt-main b,
.v9-doc-section .v6112-dt-main b,
.modalbox .v6112-dt-main b{font-size:12.5px!important;max-width:92px!important}
.v94-cp-location .v6112-dt-main small,
.v9-doc-section .v6112-dt-main small,
.modalbox .v6112-dt-main small{font-size:10.5px!important;margin:0!important;white-space:nowrap!important}
@media(max-width:900px){.v94-cp-location .v6112-datetime-control,.v9-doc-section .v6112-datetime-control,.modalbox .v6112-datetime-control{max-width:100%!important;width:100%!important}}
