/* OSA 0.6.43 | Capa global de legibilidad (WCAG 2.2) y diseño adaptable.
 * No altera lógica, permisos, mapas Leaflet ni la semántica de los datos.
 * Al final de la cadena CSS para reemplazar estilos anteriores pequeños.
 */
:root{
  --osa-font-body:1rem;
  --osa-font-support:.875rem;
  --osa-font-label:.875rem;
  --osa-font-heading:1.125rem;
  --osa-ink:#17313c;
  --osa-secondary:#475f6b;
  --osa-line:#d7e3e7;
  --osa-control-height:44px;
}
html{font-size:16px;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{font-size:var(--osa-font-body);line-height:1.5;color:var(--osa-ink)}
.main,.content,.card,.aq-modal-dialog{min-width:0}
.content{line-height:1.52}
.content :is(p,li,dd,dt){line-height:1.55}
.content :is(h1,h2,h3,h4){line-height:1.25;overflow-wrap:break-word}
.content .muted,.content .sub,.content .field-help{color:var(--osa-secondary)}
.content a:not(.btn):not(.leaflet-control-zoom-in):not(.leaflet-control-zoom-out){text-underline-offset:2px}
.content :is(.card,.notice,.empty-mini,.route-card){overflow-wrap:break-word}

/* Tipografía de apoyo universal de la interfaz, excluyendo marcadores de mapa. */
.content small:not(.leaflet-container *):not(.osa-story-phone-status *){font-size:.8125rem;line-height:1.45}
.content .label:not(.leaflet-container *),.content .sub:not(.leaflet-container *){font-size:.875rem;line-height:1.4}
.topbar .badge{font-size:.8125rem;line-height:1.3}

/* Navegación lateral: etiquetas visibles sin desbordes */
.sidebar{color:#e6f0f2}
.sidebar .tenant{font-size:.75rem;letter-spacing:.06em;color:#b2cbd0}
.sidebar .osa-nav-heading{font-size:.875rem;line-height:1.35;min-height:46px;padding:10px 10px;font-weight:750}
.sidebar .osa-nav-group-items a{font-size:.875rem;line-height:1.4;min-height:44px;padding:10px;gap:10px}
.sidebar .osa-nav-group-items .ico{font-size:1rem;line-height:1.4}
.sidebar .osa-nav-heading .osa-nav-symbol{font-size:1rem}
.sidebar .osa-nav-heading .osa-nav-toggle{width:26px;height:26px;flex-basis:26px;font-size:1.2rem}
.sidebar .sidebar-bottom{padding-top:14px}
.sidebar .userbox,.sidebar .userbox strong,.sidebar .userbox a{font-size:.875rem;line-height:1.5}
.sidebar .brand-copy em{font-size:.75rem;line-height:1.25}
.sidebar .brand small{font-size:.6875rem}

/* Encabezado de cada módulo */
.topbar{min-height:72px;height:auto;gap:12px}
.topbar h1{font-size:1.125rem;line-height:1.25;font-weight:800}
.topbar .top-actions{gap:10px;min-width:0}
.topbar .incident-switch{min-width:0}
.topbar .incident-switch select{font-size:.9375rem;min-height:44px;max-width:min(32vw,390px);line-height:1.35}
.topbar .topbar-product{font-size:.75rem}
.content .hero h2,.content .osa-page-head h2{font-size:clamp(1.625rem,2.2vw,2.125rem);line-height:1.18;letter-spacing:-.02em}
.content .hero p,.content .osa-page-head p{font-size:1rem;line-height:1.5}
.content .card-head h3,.content .card h3{font-size:1.125rem;line-height:1.3}
.content .card h4{font-size:1rem;line-height:1.35}
.content .card-head p,.content .card p{font-size:.9375rem;line-height:1.55}
.content .eyebrow{font-size:.8125rem;line-height:1.3;letter-spacing:.055em}
.content .field-help,.content .footer-note{font-size:.8125rem;line-height:1.5}
.content .badge,.content .pill{font-size:.8125rem;line-height:1.25;padding:6px 10px;white-space:normal}
.content .notice{font-size:.9375rem;line-height:1.55}
.content .empty-mini,.content .empty-state p{font-size:.9375rem}

/* Controles: objetivos táctiles, orden, foco teclado */
.content .btn,.aq-modal-dialog .btn,.topbar button,.content button:not(.leaflet-control-zoom-in):not(.leaflet-control-zoom-out){font-size:.9375rem;line-height:1.25;min-height:var(--osa-control-height)}
.content .btn,.aq-modal-dialog .btn{padding:10px 15px;white-space:normal;text-align:center}
.content .btn.small,.content .btn.tiny{font-size:.875rem;min-height:40px;padding:8px 12px}
.content .icon-btn{width:42px;height:42px;min-width:42px;font-size:1rem}
.content .button-row{align-items:center;gap:10px;row-gap:10px}
.content .button-row form{min-width:0}
:is(.main,.sidebar,.login-page,.osa-account-public) :is(a,button,input,select,textarea,summary):focus-visible{
  outline:3px solid #267cce;outline-offset:3px;box-shadow:0 0 0 2px #fff;
}
.content :is(input,select,textarea){max-width:100%;font-size:1rem;line-height:1.4}
.content :is(input:not([type=hidden]):not([type=checkbox]):not([type=radio]),select){min-height:44px}
.content :is(textarea){min-height:88px}
.content :is(.form-field label,.stack-form>label,.delivery-form label,.driver-selector label){font-size:.875rem;line-height:1.4;letter-spacing:.025em}
.content .form-field :is(input,select,textarea),.content .stack-form :is(input,select,textarea){padding:11px 12px}
.content :is(input[type=checkbox],input[type=radio]){width:18px;height:18px;accent-color:#087a76}
.content .searchbox input{font-size:1rem}
.content .filterbar{gap:10px}

/* Tarjetas e indicadores: jerarquía clara, sin números blancos sobre blanco */
.content .card{padding:20px}
.content .card-head{gap:16px;align-items:flex-start}
.content .grid{gap:16px}
.content .kpi .label,.content .saving .label{font-size:.8125rem;line-height:1.4;letter-spacing:.05em}
.content .kpi .value{font-size:clamp(1.625rem,2vw,2rem);line-height:1.12;font-variant-numeric:tabular-nums}
.content .kpi .sub{font-size:.875rem;line-height:1.5}
.content .mini-stat-card{padding:17px 18px;min-width:0}
.content .mini-stat-card .label{font-size:.875rem;line-height:1.4;color:#475f6b}
.content .mini-stat-card .value{font-size:clamp(1.5rem,1.9vw,1.875rem);line-height:1.15;word-break:normal;overflow-wrap:anywhere;color:#152f3d;font-variant-numeric:tabular-nums}
.content .mini-stat-card .sub{font-size:.875rem;line-height:1.45;color:#4f6873}
/* Corrige la herencia color:white de la tarjeta verde sobre las estadísticas blancas */
.content .control-room-saving .mini-stat-card{background:#fff;color:#17313c}
.content .control-room-saving .mini-stat-card :is(.label,.value,.sub){color:#17313c}
.content .control-room-saving .mini-stat-card .sub{color:#4f6873}
.content .control-room-saving .big{font-size:clamp(2.25rem,4vw,3.25rem);font-variant-numeric:tabular-nums}
.content .control-room-saving p{font-size:.9375rem}
.content .control-room-saving .alert-strip{font-size:.875rem;line-height:1.4;flex-wrap:wrap}
.content .status-inline-box{min-width:0;padding:15px}
.content .status-inline-box .label{font-size:.875rem}
.content .status-inline-box strong{font-size:1.875rem;line-height:1.1}
.content .status-inline-box span{font-size:.875rem;line-height:1.4}
.content .incident-summary-card .eyebrow{font-size:.8125rem}
.content .incident-summary-card h3{font-size:1.0625rem}
.content .incident-summary-card p,.content .incident-summary-card .summary-foot{font-size:.9375rem}
.content .metric-row,.content .metric-row strong{font-size:.9375rem;line-height:1.5}
.content .alert-item strong{font-size:.9375rem;line-height:1.35}
.content .alert-item small{font-size:.8125rem;line-height:1.45}
.content .activity-item strong,.content .activity-item time{font-size:.875rem}
.content .activity-item small{font-size:.8125rem}

/* Flujo de emergencia y acciones de navegación */
.content .incident-step-assistant,.content .incident-step-number,.content .incident-step-copy p{line-height:1.5}
.content .incident-step-copy p,.content .incident-step-pending{font-size:.9375rem}
.content .incident-step-ready{font-size:.875rem}
.content .stage,.content .flowbar,.content .flow-step{font-size:.875rem}
.content .timeline-mini-main strong,.content .ops-sequence-item strong{font-size:1rem;line-height:1.4}
.content .timeline-mini-main small,.content .ops-sequence-item small{font-size:.875rem;line-height:1.45}
.content .timeline-mini-meta,.content .ops-sequence-item .eta{font-size:.875rem}
.content .timeline-mini-dot,.content .ops-sequence-item .step-no{min-width:38px;min-height:38px}
.content .quick-link-grid .btn{justify-content:center}

/* Tablas: texto mínimo 14px, scroll horizontal dentro del módulo en móvil */
.content .table-wrap,.content .master-table-wrap{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
.content .table{min-width:760px}
.content .table th{font-size:.8125rem;line-height:1.4;letter-spacing:.035em;padding:12px 14px}
.content .table td{font-size:.9375rem;line-height:1.5;padding:13px 14px;vertical-align:middle}
.content .table td small,.content .master-table td small{font-size:.8125rem;line-height:1.45}
.content .table td strong{font-size:.9375rem}
.content .master-table th{font-size:.8125rem;line-height:1.45}
.content .master-table td{font-size:.9375rem;line-height:1.5}
.content .ops-live-table .table td,.content .ops-live-table .table th{white-space:normal;min-width:105px}
.content .ops-live-table .table{min-width:860px}
.content .ops-status-pill{font-size:.8125rem;line-height:1.4}
.content .osa-user-actions{gap:10px}
.content .osa-user-actions .osa-user-invite-form .btn{min-height:42px}

/* Grupos operacionales e inventario */
.content .ops-column-head h3{font-size:1.0625rem}
.content .task-card,.content .task-facts{font-size:.9375rem}
.content .task-facts span{line-height:1.45}
.content .driver-stop strong,.content .driver-stop b{font-size:.9375rem}
.content .driver-stop small{font-size:.8125rem;line-height:1.45}
.content .driver-metrics span{font-size:.8125rem}
.content .driver-metrics strong{font-size:.9375rem}
.content .osa-tank-modal-dialog :is(p,span,label,small){line-height:1.45}

/* Prototipo y formularios ficticios: mejorar legibilidad sin tocar simulación o mapa */
.content .osa-story .pilot-hero-title p,.content .osa-story-instruction{font-size:.9375rem;line-height:1.55}
.content .osa-story-records small,.content .osa-story-records span{font-size:.8125rem;line-height:1.5}
.content .osa-story-records b{font-size:1rem}
.content .osa-story-level-form label{font-size:.875rem}
.content .osa-story-phone-role strong{font-size:.9375rem}
.content .osa-story-phone-role span,.content .osa-story-phone-notif p{font-size:.8125rem}
.content .pilot-panel-head h3{font-size:1.0625rem}
.content .pilot-action{min-height:44px;font-size:.9375rem;line-height:1.3}
.osa-story-dialog :is(input,select,textarea){font-size:1rem;min-height:44px}
.osa-story-dialog :is(label,p){font-size:.9375rem;line-height:1.45}
.osa-story-dialog .pilot-action{min-height:44px}

/* Modales y acceso */
.aq-modal-header h2{font-size:1.5rem;line-height:1.25}
.aq-modal-header p,.aq-modal-body p{font-size:.9375rem}
.aq-modal-form :is(input,select,textarea){font-size:1rem;min-height:44px}
.aq-modal-form label{font-size:.875rem;line-height:1.4}
.aq-modal-close{width:44px;height:44px;flex-basis:44px}
.osa-profile-grid .stack-form label,.osa-account-public .stack-form label{font-size:.9375rem}
.osa-profile-grid .stack-form input,.osa-account-public .stack-form input{font-size:1rem;min-height:44px}
.osa-account-public .muted{font-size:.9375rem}
.login-box :is(label,p){font-size:.9375rem;line-height:1.5}
.login-box input{font-size:1rem;min-height:44px}
.login-box h2{font-size:1.875rem}

/* Leaflet: no redimensionar marcadores, controles o labels dibujados sobre el mapa. */
.leaflet-container{font-size:12px;line-height:normal}
.leaflet-container :is(.leaflet-popup-content,.leaflet-popup-content a){font-size:13px;line-height:1.45}
.leaflet-container .leaflet-control-zoom a{width:34px;height:34px;line-height:34px;font-size:20px}

/* Desktop y tablet. Evita que tarjetas laterales queden estrechas */
@media (min-width:901px) and (max-width:1350px){
  .content{padding:22px}
  .content .ops-live-grid,.content .control-room-grid{grid-template-columns:minmax(0,1fr)}
  .content .incident-overview-grid{grid-template-columns:minmax(0,1fr)}
  .content .status-inline-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .content .grid.kpis{grid-template-columns:repeat(auto-fit,minmax(185px,1fr))}
  .content .ops-active-truck{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:900px){
  .topbar{padding:14px 18px;min-height:64px}
  .topbar .incident-switch select{max-width:100%}
  .content{padding:18px}
  .content .grid.kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .content .control-room-grid,.content .ops-live-grid,.content .incident-overview-grid,.content .osa-profile-grid{grid-template-columns:minmax(0,1fr)}
  .content .mini-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .content .status-inline-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .content .control-readiness{grid-template-columns:repeat(2,minmax(0,1fr))}
  .content .card{padding:18px}
  .content .map{max-width:100%}
  .content .ops-active-truck{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:600px){
  .content{padding:14px 12px 28px}
  .topbar{padding:12px;align-items:stretch}
  .topbar h1{font-size:1.0625rem}
  .topbar .top-actions{flex-wrap:wrap}
  .content .hero,.content .osa-page-head{gap:12px;flex-direction:column;align-items:stretch}
  .content .hero h2,.content .osa-page-head h2{font-size:1.625rem}
  .content .card{padding:16px;border-radius:14px}
  .content .card-head{gap:10px;flex-wrap:wrap}
  .content .card-head .btn{max-width:100%}
  .content .grid.kpis{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .content .mini-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .content .mini-stat-card{padding:13px}
  .content .mini-stat-card .value{font-size:1.5rem}
  .content .control-readiness,.content .incident-summary-grid,.content .quick-link-grid{grid-template-columns:minmax(0,1fr)}
  .content .status-inline-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  .content .status-inline-box{padding:12px}
  .content .status-inline-box strong{font-size:1.5rem}
  .content .ops-active-truck{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .content .ops-active-truck .truck-main{grid-column:1/-1}
  .content .button-row{gap:8px}
  .content .button-row>*{max-width:100%}
  .content .notice{padding:12px}
  .content .map{height:min(56vh,420px);min-height:300px}
  .content .timeline-mini-item,.content .ops-sequence-item{grid-template-columns:38px minmax(0,1fr);gap:10px}
  .content .timeline-mini-meta,.content .ops-sequence-item .eta{grid-column:2;justify-self:start;text-align:left}
  .content .ops-board{grid-template-columns:minmax(0,1fr)}
  .content .form-grid{grid-template-columns:minmax(0,1fr)}
  .content .form-grid .full{grid-column:1}
  .content .osa-story-layout{grid-template-columns:minmax(0,1fr)}
  .aq-modal{padding:10px}
  .aq-modal-dialog{max-width:calc(100vw - 20px)}
}
@media (max-width:370px){
  .content .grid.kpis,.content .mini-stat-grid,.content .status-inline-grid{grid-template-columns:minmax(0,1fr)}
  .content .card{padding:13px}
}
@media print{
  .content .card{box-shadow:none}
  .content p,.content td{font-size:11pt}
  .sidebar,.topbar{display:none!important}
}
