/* TRANSBIOCOM SAP MOBILE PLUS 2026-07-09
   Mejora global para teléfono, iPhone, iPad y Android sin tocar lógica PHP. */
:root{
  --tb-safe-top: env(safe-area-inset-top,0px);
  --tb-safe-bottom: env(safe-area-inset-bottom,0px);
  --tb-sap-blue:#073763;
  --tb-sap-blue2:#005C97;
  --tb-sap-green:#51B800;
  --tb-sap-bg:#f4f8fc;
  --tb-sap-card:#ffffff;
  --tb-sap-ink:#0f172a;
  --tb-sap-muted:#64748b;
  --tb-sap-border:rgba(15,23,42,.12);
}
html.tb-installed #installBtn, body.tb-installed #installBtn,
html.tb-installed [data-tb-install], body.tb-installed [data-tb-install],
html.tb-installed .tb-mobile-install, body.tb-installed .tb-mobile-install{display:none!important;visibility:hidden!important;pointer-events:none!important}
.tb-install-logo{width:46px;height:46px;border-radius:15px;background:#fff;box-shadow:0 8px 22px rgba(2,6,23,.18);flex:0 0 auto}.tb-install-card-head{display:flex;gap:12px;align-items:center}.tb-install-card-head img{width:58px;height:58px;border-radius:18px;box-shadow:0 10px 30px rgba(7,55,99,.18)}
.tb-device-pill{display:inline-flex;align-items:center;gap:7px;border-radius:999px;padding:7px 11px;font-weight:950;background:#eef7ff;color:var(--tb-sap-blue);border:1px solid #dbeafe;font-size:12px}.tb-device-pill.green{background:#ecfdf5;color:#166534;border-color:#bbf7d0}.tb-mobile-only{display:none!important}
input,select,textarea,button{font-family:inherit}textarea{resize:vertical}.tb-autogrow{overflow:hidden}.tb-cardify-ready td[data-label]::before{content:attr(data-label)}
@media(max-width:900px){
  html,body{max-width:100%;overflow-x:hidden;-webkit-text-size-adjust:100%;text-size-adjust:100%;background:var(--tb-sap-bg)}
  body{font-size:14px!important;padding-bottom:max(0px,var(--tb-safe-bottom));}
  .tb-mobile-only{display:initial!important}.tb-desktop-only{display:none!important}
  input,select,textarea,.form-control,.form-select,.input-group-text,.swal2-input,.swal2-textarea,.swal2-select{font-size:16px!important;min-height:46px!important;border-radius:15px!important}
  textarea.form-control,textarea.swal2-textarea{min-height:96px!important;line-height:1.45!important}
  label,.form-label{font-size:12px!important;font-weight:950!important;color:#0b244f!important;letter-spacing:.01em;margin-bottom:5px!important}
  .form-help,.input-help,.text-muted{font-size:12px!important;line-height:1.35!important}
  .btn,.chip,.frame-btn,.round-btn,.action-btn,.btn-main,.btn-green,.btn-fel,.btn-darkblue{min-height:46px!important;border-radius:15px!important;font-weight:950!important;display:inline-flex;align-items:center;justify-content:center;gap:7px;white-space:normal!important}
  .btn-sm,.btn-xs{min-height:40px!important;border-radius:13px!important}
  .input-group{gap:6px;align-items:stretch}.input-group>.form-control,.input-group>.form-select{border-radius:15px!important}.input-group>.btn{border-radius:15px!important;min-width:48px!important}
  .row{--bs-gutter-x:.65rem!important;--bs-gutter-y:.65rem!important}.container,.container-fluid{padding-left:10px!important;padding-right:10px!important}
  .card,.soft-card,.filter-card,.table-card,.kpi-card,.mini-panel,.fel-card,.helper-panel{border-radius:20px!important;box-shadow:0 12px 34px rgba(2,6,23,.07)!important;border-color:rgba(15,23,42,.10)!important}
  .modal{padding:0!important}.modal-dialog,.modal-xl,.modal-lg{width:100vw!important;max-width:100vw!important;margin:0!important}.modal-content{min-height:100dvh!important;border-radius:0!important;border:0!important}.modal-header{position:sticky!important;top:0;z-index:15;padding-top:max(13px,var(--tb-safe-top))!important;border-radius:0!important}.modal-body{padding:12px!important;max-height:none!important;overflow:auto!important;-webkit-overflow-scrolling:touch!important}.modal-footer{position:sticky!important;bottom:0;z-index:14;background:#fff!important;padding:10px 12px max(10px,var(--tb-safe-bottom))!important;box-shadow:0 -12px 34px rgba(2,6,23,.08);gap:8px!important}.modal-footer .btn{flex:1 1 auto!important}
  .swal2-container{padding:0!important}.swal2-popup{border-radius:24px!important;width:calc(100vw - 14px)!important;max-width:calc(100vw - 14px)!important}.swal2-title{font-size:20px!important}.swal2-html-container{font-size:14px!important}.swal2-actions{width:100%;gap:8px!important}.swal2-confirm,.swal2-cancel,.swal2-deny{flex:1 1 auto!important;min-height:48px!important;border-radius:15px!important}
  .table-responsive{border-radius:18px!important;overflow:auto!important;-webkit-overflow-scrolling:touch!important;background:#fff}.table{font-size:12px!important;min-width:760px}.table th{font-size:10.5px!important;letter-spacing:.03em;white-space:nowrap}.table td{vertical-align:middle!important}
  .tb-card-table{min-width:0!important;border-collapse:separate!important;border-spacing:0 10px!important}.tb-card-table thead{display:none!important}.tb-card-table tbody,.tb-card-table tr,.tb-card-table td{display:block!important;width:100%!important}.tb-card-table tr{background:#fff;border:1px solid #e2e8f0;border-radius:18px!important;box-shadow:0 12px 28px rgba(2,6,23,.06);padding:10px!important;margin-bottom:10px}.tb-card-table td{border:0!important;padding:8px 7px!important;text-align:left!important;white-space:normal!important}.tb-card-table td[data-label]::before{display:block;color:#64748b;font-weight:950;font-size:10px;text-transform:uppercase;letter-spacing:.04em;margin-bottom:2px}.tb-card-table td:last-child{display:flex!important;gap:7px;flex-wrap:wrap;justify-content:flex-start!important}.tb-card-table td:last-child .btn,.tb-card-table td:last-child button,.tb-card-table td:last-child a{flex:1 1 44px!important;min-width:44px!important}
  .section-title{font-size:16px!important;line-height:1.2!important;gap:8px!important}.section-title span{width:36px!important;height:36px!important;border-radius:14px!important;flex:0 0 auto!important}.kpi-value{font-size:20px!important;line-height:1.1!important}.kpi-label{font-size:10.5px!important;font-weight:950!important}
  .tb-mobile-install{bottom:max(10px,var(--tb-safe-bottom))!important;left:10px!important;right:10px!important;border-radius:23px!important}.tb-mobile-install small{display:none!important}.tb-install-primary{min-height:42px!important}.tb-install-close{min-height:42px!important;width:42px!important}
  .app.module-open .topbar .chip#installBtn, .chip#installBtn{font-size:0!important;min-width:52px!important;padding:8px 10px!important}.chip#installBtn i{font-size:17px!important;margin:0!important}.chip#installBtn:after{content:'APP';font-size:12px!important;margin-left:3px}
  body.embed-mode{overflow:auto!important;background:#f4f8fc!important}.tb-compact-frame body{font-size:13px!important}
}
@media(max-width:560px){
  .modal-title{font-size:16px!important}.modal-header .btn-close{width:42px;height:42px;border-radius:14px;background-color:rgba(255,255,255,.15)}
  .btn,.btn-main,.btn-green,.btn-fel,.btn-darkblue{width:100%}.d-flex.gap-2,.d-flex.gap-3{gap:8px!important}.d-flex.flex-wrap>.btn{flex:1 1 100%!important}
  .table{min-width:680px}.swal2-popup{width:100vw!important;max-width:100vw!important;border-radius:0!important;min-height:100dvh!important}.swal2-actions{position:sticky!important;bottom:0;background:#fff;padding-top:8px!important}
}
/* VIAJES FEL: escritura y facturación cómoda en teléfono */
@media(max-width:900px){
  #modalFel .modal-dialog{margin:0!important;max-width:100vw!important}#modalFel .modal-content{min-height:100dvh!important;background:#f7fbff!important}#modalFel .modal-body{padding:10px!important}#modalFel .modal-header{background:linear-gradient(135deg,#06111f,#073763,#16810f)!important;color:#fff!important}#modalFel .modal-title{font-weight:1000!important}#modalFel .btn-close{filter:invert(1) grayscale(1) brightness(2)}
  #modalFel .section-title{position:relative;margin:10px 0!important;padding:10px 12px;border-radius:18px;background:#fff;border:1px solid #e2e8f0;box-shadow:0 10px 24px rgba(2,6,23,.05)}
  #modalFel .kpi-card,#modalFel .fel-card,#modalFel .mini-panel{background:#fff!important;border-radius:20px!important;padding:12px!important}
  #DescripcionFacturaFEL.tb-fel-desc-main{min-height:150px!important;font-size:16px!important;font-weight:900!important;letter-spacing:.01em;background:#fff!important;border:2px solid #bfdbfe!important;box-shadow:0 0 0 4px rgba(14,116,144,.07)!important}
  #DescripcionFacturaFEL:focus{border-color:#0b74b8!important;box-shadow:0 0 0 5px rgba(11,116,184,.12)!important}.tb-fel-desc-help{display:block!important;color:#075985!important;background:#eef7ff;border:1px solid #bfdbfe;border-radius:14px;padding:8px 10px;margin-top:6px!important}
  .tb-mobile-desc-btn{order:-5;width:100%!important;background:linear-gradient(135deg,#073763,#005C97)!important;color:#fff!important}.fel-items-wrap{border:0!important;background:transparent!important;overflow:visible!important}.fel-items-table{min-width:0!important;border-collapse:separate!important;border-spacing:0 12px!important}.fel-items-table thead{display:none!important}.fel-items-table tbody,.fel-items-table tr,.fel-items-table td{display:block!important;width:100%!important}.fel-items-table tr{border:1px solid #dbeafe!important;border-radius:20px!important;background:#fff!important;padding:10px!important;box-shadow:0 14px 30px rgba(7,55,99,.08)!important}.fel-items-table td{border:0!important;padding:6px!important;text-align:left!important}.fel-items-table td:nth-child(1)::before{content:'Tipo';}.fel-items-table td:nth-child(2)::before{content:'Descripción';}.fel-items-table td:nth-child(3)::before{content:'Cantidad / galones';}.fel-items-table td:nth-child(4)::before{content:'Precio';}.fel-items-table td:nth-child(5)::before{content:'Total';}.fel-items-table td::before{display:block;color:#64748b;font-size:10.5px;font-weight:950;text-transform:uppercase;letter-spacing:.04em;margin-bottom:3px}.fel-item-desc{min-height:120px!important;font-weight:850!important}.fel-remove{width:100%!important;min-height:46px!important}.fel-mobile-totalbar,#FelTotalItems{font-size:20px!important}.swal-desc-fel,.swal-item-desc-fel{width:100vw!important;max-width:100vw!important;height:100dvh!important;border-radius:0!important;padding:14px!important}.swal-desc-fel .swal2-html-container,.swal-item-desc-fel .swal2-html-container{height:calc(100dvh - 210px)!important;overflow:auto!important}.tb-desc-editor{width:100%!important;min-height:calc(100dvh - 330px)!important;border:2px solid #bfdbfe!important;border-radius:20px!important;padding:14px!important;font-size:17px!important;font-weight:900!important;line-height:1.45!important;outline:none!important;background:#fff!important}.tb-desc-editor:focus{border-color:#0b74b8!important;box-shadow:0 0 0 5px rgba(11,116,184,.13)!important}.tb-desc-count{text-align:right;font-weight:950;color:#64748b;margin-top:6px}.tb-desc-tools{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}.tb-desc-chip{border:1px solid #dbeafe;background:#f8fbff;color:#073763;border-radius:15px;min-height:44px;font-weight:950;padding:8px}.tb-desc-chip.primary{background:linear-gradient(135deg,#073763,#005C97);color:#fff;border:0}.swal-desc-fel .swal2-actions,.swal-item-desc-fel .swal2-actions{position:sticky!important;bottom:0;background:#fff!important;padding-top:8px!important}
}
/* Catálogos, clientes, rutas, CXC/CXP: lectura cómoda tipo app */
@media(max-width:900px){
  body:has(.catalog-sap-grid) .catalog-sap-grid, .catalog-sap-grid,.sap-quick-grid{grid-template-columns:1fr!important;gap:10px!important}.catalog-sap-grid .c12,.catalog-sap-grid .c8,.catalog-sap-grid .c6,.catalog-sap-grid .c4,.catalog-sap-grid .c3,.sap-quick-grid .q12,.sap-quick-grid .q8,.sap-quick-grid .q6,.sap-quick-grid .q4,.sap-quick-grid .q3{grid-column:span 1!important}
  [id*="cliente" i] .table-responsive,[id*="cxc" i] .table-responsive,[id*="cxp" i] .table-responsive{max-height:none!important}
}
