:root{--bg:#f5f7fa;--card:#fff;--text:#17202a;--muted:#667085;--border:#d9dee5;--primary:#149447;--ok:#087a55;--warn:#b54708;--danger:#b42318;--soft:#eef4ff;--shadow:0 2px 12px rgba(16,24,40,.07)}
*{box-sizing:border-box}html{background:var(--bg)}body{margin:0;font-family:Arial,Helvetica,sans-serif;background:var(--bg);color:var(--text)}
.topbar{background:#101828;color:#fff;padding:13px 18px;display:flex;align-items:center;justify-content:space-between;gap:12px}.brand strong{font-size:18px}.brand small{display:block;color:#cfd4dc;margin-top:3px}
.nav{background:#fff;border-bottom:1px solid var(--border);padding:9px 16px;display:flex;gap:5px;flex-wrap:wrap}.nav a{color:#344054;text-decoration:none;padding:9px 11px;border-radius:8px}.nav a:hover{background:#f2f4f7}
.container{max-width:1180px;margin:20px auto;padding:0 16px}.footer{text-align:center;color:var(--muted);padding:24px 12px 34px}h1{font-size:25px;margin:0 0 17px}h2{font-size:19px;margin:0 0 13px}h3{font-size:16px;margin:0 0 10px}.muted{color:var(--muted)}
.grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:14px}.col-3{grid-column:span 3}.col-4{grid-column:span 4}.col-5{grid-column:span 5}.col-6{grid-column:span 6}.col-7{grid-column:span 7}.col-8{grid-column:span 8}.col-12{grid-column:span 12}
.card{background:var(--card);border:1px solid var(--border);border-radius:13px;padding:16px;box-shadow:var(--shadow)}.metric b{font-size:29px;display:block;margin-top:6px}.metric span{color:var(--muted);font-size:13px}
.btn{display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:9px 14px;border-radius:9px;border:1px solid transparent;background:var(--primary);color:#fff;text-decoration:none;cursor:pointer;font-size:14px;font-weight:700}.btn.secondary{background:#fff;color:#344054;border-color:var(--border)}.btn.ok{background:var(--ok)}.btn.warn{background:var(--warn)}.btn.danger{background:var(--danger)}.btn.ghost{background:transparent;border-color:#475467}.btn.small{min-height:36px;padding:7px 11px}.btn.disabled{opacity:.48;pointer-events:none}.actions{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}
table{width:100%;border-collapse:collapse;background:#fff}.table-wrap{overflow:auto;border:1px solid var(--border);border-radius:10px}th,td{text-align:left;padding:11px 10px;border-bottom:1px solid #eaecf0;white-space:nowrap}th{font-size:12px;text-transform:uppercase;color:#667085;background:#f9fafb}
label{display:block;font-size:13px;font-weight:700;margin-bottom:6px}input,select,textarea{width:100%;min-height:44px;border:1px solid #cfd4dc;border-radius:9px;padding:9px 10px;font-size:16px;background:#fff;color:var(--text)}textarea{min-height:92px;resize:vertical}.field{margin-bottom:13px}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.form-grid .full{grid-column:1/-1}
.badge{display:inline-block;padding:5px 9px;border-radius:999px;font-size:12px;font-weight:700;background:#eef2f6}.badge.ok{color:#05603a;background:#ecfdf3}.badge.warn{color:#93370d;background:#fffaeb}.badge.danger{color:#912018;background:#fef3f2}.badge.info{color:#1849a9;background:#eff8ff}.badge.new{background:#e0f2fe;color:#075985}
.flash{background:#ecfdf3;border:1px solid #abefc6;color:#05603a;padding:12px 14px;border-radius:9px;margin-bottom:15px}.notice{padding:12px 14px;border-radius:9px;background:#fffaeb;border:1px solid #fedf89;color:#7a2e0e;margin-bottom:15px}.info-box{padding:12px 14px;border-radius:9px;background:#eff8ff;border:1px solid #b2ddff;color:#1849a9;margin-bottom:15px}
.timeline{border-left:3px solid #d0d5dd;padding-left:16px}.timeline .item{margin:0 0 15px}.timeline small{color:var(--muted)}.login{max-width:420px;margin:8vh auto;background:#fff;border:1px solid var(--border);border-radius:14px;padding:24px;box-shadow:var(--shadow)}.kv{display:grid;grid-template-columns:165px 1fr;gap:9px 12px}.kv div:nth-child(odd){color:var(--muted)}
.order-card{background:#fff;border:1px solid var(--border);border-radius:14px;padding:15px;box-shadow:var(--shadow);position:relative}.order-card.selected{outline:2px solid #84adff;background:#f8fbff}.order-head{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}.order-number{font-weight:800;color:#344054}.order-client{font-size:17px;font-weight:800;margin:7px 0 3px}.order-address{line-height:1.4;color:#344054;margin:6px 0 10px}.order-meta{display:flex;gap:7px;flex-wrap:wrap;margin:9px 0}.order-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.check-big{width:24px;height:24px;min-height:auto;accent-color:var(--primary)}
.driver-section{margin-bottom:24px}.driver-section-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:11px}.driver-action{position:sticky;bottom:10px;z-index:20;background:#101828;color:#fff;border-radius:14px;padding:12px;box-shadow:0 8px 28px rgba(16,24,40,.25);display:flex;align-items:center;justify-content:space-between;gap:12px;margin:16px 0}.driver-action strong{display:block}.driver-action small{color:#cfd4dc}.driver-action .btn{white-space:nowrap}
.upload-box{border:2px dashed #b8c2cf;border-radius:12px;padding:18px;background:#fafbfc}.preview{max-width:100%;max-height:420px;border:1px solid var(--border);border-radius:10px}.split{display:grid;grid-template-columns:minmax(260px,.8fr) minmax(0,1.2fr);gap:16px}.pill-tabs{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:14px}.pill-tabs .tab{padding:8px 11px;border-radius:999px;background:#eef2f6;color:#344054;font-size:13px;font-weight:700}.toast{display:none;padding:12px 14px;background:#101828;color:#fff;border-radius:10px;margin-bottom:14px}.toast.show{display:flex;justify-content:space-between;align-items:center;gap:10px}.mini{font-size:12px}.nowrap{white-space:nowrap}
@media(max-width:800px){.container{margin-top:13px;padding:0 11px}.nav{overflow:auto;flex-wrap:nowrap;padding:8px 10px}.nav a{white-space:nowrap}.col-3,.col-4,.col-6,.col-8{grid-column:span 12}.form-grid,.split{grid-template-columns:1fr}.topbar{align-items:flex-start}.kv{grid-template-columns:1fr}.kv div:nth-child(odd){font-weight:700;margin-top:5px}h1{font-size:22px}.card{padding:14px}.order-actions .btn{flex:1;min-width:130px}.driver-action{align-items:stretch;flex-direction:column}.driver-action .btn{width:100%;font-size:16px;min-height:50px}.metric b{font-size:25px}}


/* V2.1 - edição e lixeira */
.danger-zone{border:1px solid #fecdca;background:#fff7f6}
.trash-row{opacity:.9}
.action-group{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.inline-form{display:inline}
.small-note{font-size:12px;color:var(--muted)}


/* V2.2 - PWA / modo aplicativo */
.topbar-actions{display:flex;gap:7px;align-items:center}
.pwa-login-brand{display:flex;align-items:center;gap:13px;margin-bottom:18px}
.pwa-login-brand img{width:58px;height:58px;border-radius:14px;flex:0 0 auto}
.pwa-login-brand h1{margin:0 0 4px}.pwa-login-brand p{margin:0}
.pwa-login-install{border-top:1px solid var(--border);margin-top:18px;padding-top:16px;text-align:center}
.pwa-login-install small{display:block;margin-top:8px;line-height:1.4}

.pwa-sheet[hidden]{display:none}
.pwa-sheet{position:fixed;inset:0;z-index:1000;display:flex;align-items:flex-end;justify-content:center;padding:14px}
.pwa-sheet-backdrop{position:absolute;inset:0;background:rgba(16,24,40,.58)}
.pwa-sheet-card{position:relative;width:min(520px,100%);background:#fff;border-radius:18px;padding:18px;box-shadow:0 18px 50px rgba(16,24,40,.3);padding-bottom:calc(18px + env(safe-area-inset-bottom))}
.pwa-sheet-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;border-bottom:1px solid var(--border);padding-bottom:13px}
.pwa-sheet-head strong{font-size:19px}.pwa-sheet-head small{display:block;color:var(--muted);margin-top:4px}
.pwa-close{border:0;background:#eef2f6;color:#344054;width:38px;height:38px;border-radius:10px;font-size:24px;line-height:1;cursor:pointer}
.pwa-steps{padding-left:24px;line-height:1.55;margin:17px 0}.pwa-steps li{margin:9px 0}
.pwa-share{display:inline-block;font-size:18px;font-weight:700;color:var(--primary)}
.pwa-tip{background:#eff8ff;color:#1849a9;border:1px solid #b2ddff;border-radius:10px;padding:11px 12px;line-height:1.45}
body.pwa-sheet-open{overflow:hidden}

@media (display-mode: standalone){
  .topbar{padding-top:calc(13px + env(safe-area-inset-top));padding-left:calc(18px + env(safe-area-inset-left));padding-right:calc(18px + env(safe-area-inset-right))}
  .container{padding-left:calc(16px + env(safe-area-inset-left));padding-right:calc(16px + env(safe-area-inset-right))}
  .footer{padding-bottom:calc(24px + env(safe-area-inset-bottom))}
  [data-pwa-install]{display:none!important}
  .login-page{padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}
}
@media(max-width:800px){
  .topbar-actions{gap:5px}
  .topbar-actions .btn{padding-left:10px;padding-right:10px}
  .login-page .login{margin:5vh 12px}
  .pwa-sheet{padding:9px}
  .pwa-sheet-card{border-radius:18px 18px 12px 12px}
}


/* V2.3 - Fluxo de aceite e carregamento */
.driver-tabs{
  display:grid;
  grid-template-columns:repeat(5,minmax(110px,1fr));
  gap:7px;
  margin:0 0 16px;
  overflow-x:auto;
  padding-bottom:3px;
}
.driver-tabs a{
  min-width:110px;
  min-height:58px;
  border:1px solid var(--border);
  border-radius:11px;
  background:#fff;
  color:#344054;
  text-decoration:none;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  font-size:12px;
  font-weight:700;
  box-shadow:var(--shadow);
}
.driver-tabs a b{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:25px;
  min-height:25px;
  padding:0 7px;
  border-radius:999px;
  background:#eef2f6;
  font-size:12px;
}
.driver-tabs a.active{
  border-color:var(--primary);
  background:#eff8ff;
  color:var(--primary);
}
.driver-tabs a.active b{background:var(--primary);color:#fff}
.loading-card{border-left:5px solid #f79009}
.loaded-card{border-left:5px solid #12b76a}
.load-summary{
  margin:10px 0;
  padding:10px 12px;
  border-radius:9px;
  background:#f9fafb;
  border:1px solid var(--border);
  font-weight:700;
}
.driver-big-button{width:100%;min-height:54px;font-size:16px;font-weight:800}
.order-document-preview{
  display:block;
  max-width:100%;
  height:auto;
  margin:0 auto;
  border:1px solid var(--border);
  border-radius:10px;
}
@media(max-width:800px){
  .driver-tabs{
    display:flex;
    gap:7px;
    margin-left:-2px;
    margin-right:-2px;
  }
  .driver-tabs a{flex:0 0 112px}
}


/* V2.3.1 - correção de layout mobile da tela "Ver pedido" */
@media(max-width:800px){
  .col-5,.col-7{grid-column:span 12}
  .grid{grid-template-columns:1fr}
  .card,.order-card{min-width:0;width:100%}
  .kv{
    grid-template-columns:1fr;
    gap:4px;
  }
  .kv > div{
    min-width:0;
    max-width:100%;
    overflow-wrap:anywhere;
    word-break:break-word;
  }
  .kv > div:nth-child(odd){
    margin-top:10px;
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:.02em;
    color:var(--muted);
  }
  .kv > div:nth-child(even){
    margin-bottom:4px;
    font-size:16px;
  }
  .order-actions{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
  }
  .order-actions .btn,
  .driver-big-button{
    width:100%;
    min-width:0;
    white-space:normal;
    text-align:center;
    line-height:1.25;
  }
  .container{overflow-x:hidden}
  body{overflow-x:hidden}
  h1{overflow-wrap:anywhere}
}


/* V2.3.2 - foto/PDF visível ao abrir "Ver pedido" */
.order-document-card{
  overflow:hidden;
}
.document-title-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}
.document-title-row h2{margin:0 0 4px}
.document-title-row p{margin:0}
.document-image-link{
  display:block;
  background:#eef2f6;
  border:1px solid var(--border);
  border-radius:12px;
  overflow:hidden;
  text-align:center;
}
.order-document-preview{
  display:block;
  width:auto;
  max-width:100%;
  max-height:900px;
  height:auto;
  margin:0 auto;
  object-fit:contain;
  background:#fff;
}
.pdf-preview-wrap{
  width:100%;
}
.order-pdf-preview{
  display:block;
  width:100%;
  height:720px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
}
.pdf-preview-fallback{
  display:none;
  margin-top:10px;
  padding:12px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#f9fafb;
}
.pdf-preview-fallback p{margin:0 0 10px;color:var(--muted)}

@media(max-width:800px){
  .document-title-row{
    display:grid;
    grid-template-columns:1fr;
  }
  .document-title-row .btn{
    width:100%;
  }
  .order-document-preview{
    width:100%;
    max-height:none;
  }
  .order-pdf-preview{
    height:620px;
  }
  .pdf-preview-fallback{
    display:block;
  }
}
@media(max-width:420px){
  .order-pdf-preview{
    height:540px;
  }
}


/* V2.3.3 - correção definitiva das colunas 7/5 */
@media(min-width:801px){
  .grid > .col-7{grid-column:span 7;min-width:0}
  .grid > .col-5{grid-column:span 5;min-width:0}
}
@media(max-width:800px){
  .grid > .col-7,
  .grid > .col-5{grid-column:1 / -1;min-width:0;width:100%}
}


/* V2.3.4 - tela "Ver pedido" compacta para o motorista */
.driver-review-card h2{margin-bottom:14px}
.driver-review-summary{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.review-item{
  min-width:0;
  padding:11px 12px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#f9fafb;
}
.review-item.review-full{grid-column:1 / -1}
.review-item span{
  display:block;
  margin-bottom:5px;
  color:var(--muted);
  font-size:12px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.02em;
}
.review-item strong{
  display:block;
  min-width:0;
  font-size:16px;
  line-height:1.35;
  overflow-wrap:anywhere;
}
.review-observation{
  background:#fffaeb;
  border-color:#fedf89;
}
.driver-primary-action{
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid var(--border);
}
.driver-primary-action small{
  display:block;
  margin-top:8px;
  color:var(--muted);
  text-align:center;
  line-height:1.35;
}
.driver-stage-label{
  margin-top:14px;
  margin-bottom:10px;
}
@media(max-width:800px){
  .driver-review-summary{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
  }
  .review-item{padding:10px}
  .review-item strong{font-size:15px}
  .order-pdf-preview{height:340px}
  .pdf-preview-fallback{padding:10px}
}
@media(max-width:420px){
  .order-pdf-preview{height:300px}
}


/* V2.4 - digitalização de produtos e conferência de carga */
.items-editor-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px}
.items-editor{display:grid;gap:8px}
.item-edit-row{
  display:grid;
  grid-template-columns:110px minmax(240px,2fr) 110px 80px 110px 120px 42px;
  gap:7px;
  align-items:center;
}
.item-edit-row input{min-width:0}
.driver-products-preview{margin-top:12px;border:1px solid var(--border);border-radius:10px;overflow:hidden}
.driver-products-preview>strong{display:block;padding:10px 12px;background:#f9fafb}
.driver-products-preview>div{display:flex;justify-content:space-between;gap:12px;padding:9px 12px;border-top:1px solid var(--border)}
.driver-products-preview span{min-width:0;overflow-wrap:anywhere}
.driver-products-preview b{white-space:nowrap}
.driver-action-note{display:block;text-align:center;color:var(--muted);margin-top:8px}
.load-progress-card{margin-bottom:14px}
.load-progress-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.load-progress-head div{min-width:0}.load-progress-head small{display:block;color:var(--muted);margin-top:3px}
.load-progress{height:12px;background:#e9eef4;border-radius:999px;overflow:hidden;margin-top:12px}
.load-progress span{display:block;height:100%;background:#12b76a;border-radius:inherit}
.load-items{display:grid;gap:12px}
.load-item-card{background:#fff;border:1px solid var(--border);border-left:5px solid #f79009;border-radius:12px;padding:14px;box-shadow:var(--shadow)}
.load-item-card.status-conferido{border-left-color:#2e90fa}
.load-item-card.status-carregado{border-left-color:#12b76a}
.load-item-card.status-divergencia{border-left-color:#f04438}
.load-item-top{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.load-item-top h2{font-size:17px;margin:3px 0 0;line-height:1.3}
.load-qty{display:flex;justify-content:space-between;gap:12px;padding:10px 12px;background:#f9fafb;border-radius:9px;margin:12px 0}
.load-item-form{display:grid;gap:8px}
.load-item-form label{font-size:12px;font-weight:800;color:var(--muted);text-transform:uppercase}
.load-item-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.load-confirmed-info{padding:11px 12px;border-radius:9px;background:#ecfdf3;margin:12px 0;color:#067647}
.final-load-action{margin-top:16px}
.mini-load-progress{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;padding:9px 11px;background:#f9fafb;border-radius:9px;margin-top:10px;font-size:13px}
.mini-load-progress b{color:#b42318}

@media(max-width:900px){
  .item-edit-row{grid-template-columns:1fr 2fr 90px 70px 42px}
  .item-edit-row input:nth-of-type(5),.item-edit-row input:nth-of-type(6){display:none}
}
@media(max-width:600px){
  .items-editor-head{display:grid;grid-template-columns:1fr}
  .item-edit-row{grid-template-columns:88px minmax(0,1fr) 78px 58px 42px}
  .item-edit-row .btn{padding:8px}
  .load-item-actions{grid-template-columns:1fr}
  .load-progress-head{align-items:flex-start}
  .driver-products-preview>div{display:grid;grid-template-columns:1fr auto}
}


/* V2.4.5 TESTE LOCAL - Identidade visual TELHAÇO */
:root{
  --telhaco-green:#16a34a;
  --telhaco-dark:#0b3f25;
  --telhaco-deep:#082d1b;
}
.topbar{
  background:linear-gradient(135deg,var(--telhaco-deep),var(--telhaco-dark));
}
.nav a:hover{background:#effbf3}
.telhaco-login-brand{
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  gap:12px;
  margin-bottom:19px;
}
.telhaco-login-brand>img{
  width:min(100%,340px);
  max-height:160px;
  object-fit:contain;
  display:block;
}
.telhaco-login-copy h1{
  margin:0 0 4px;
  font-size:23px;
}
.telhaco-login-copy p{margin:0}
.login-page .login{
  max-width:460px;
  border-top:5px solid var(--telhaco-green);
}
.telhaco-top-brand{
  display:flex;
  align-items:center;
  gap:11px;
  min-width:0;
}
.telhaco-top-brand>img{
  display:block;
  width:135px;
  height:42px;
  object-fit:contain;
  object-position:left center;
  background:#fff;
  border-radius:8px;
  padding:3px 6px;
  flex:0 0 auto;
}
.telhaco-top-brand>div{min-width:0}
.telhaco-top-brand strong{
  display:block;
  font-size:17px;
}
.telhaco-top-brand small{
  color:#d7f4e0;
}
.btn{background:var(--primary)}
.check-big{accent-color:var(--primary)}
@media(max-width:600px){
  .login-page .login{margin:3vh 10px}
  .telhaco-login-brand>img{width:min(100%,310px)}
  .telhaco-top-brand>img{width:105px;height:36px}
  .telhaco-top-brand strong{font-size:14px}
  .telhaco-top-brand small{font-size:11px}
}


/* V2.4.7 - rastreamento de rota */
.route-tracking-card{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:11px;
  background:#fff;
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px 14px;
  margin-bottom:14px;
  box-shadow:var(--shadow);
}
.route-tracking-card strong{display:block}
.route-tracking-card small{display:block;color:var(--muted);margin-top:2px}
.route-tracking-dot{
  width:13px;height:13px;border-radius:50%;
  background:#f79009;
  box-shadow:0 0 0 4px rgba(247,144,9,.13);
}
.route-tracking-card[data-state="active"] .route-tracking-dot{
  background:#12b76a;
  box-shadow:0 0 0 4px rgba(18,183,106,.14);
}
.route-tracking-card[data-state="blocked"] .route-tracking-dot{
  background:#f04438;
  box-shadow:0 0 0 4px rgba(240,68,56,.13);
}
.route-tracking-card[data-state="warning"] .route-tracking-dot{background:#f79009}

.admin-route-card{margin:14px 0}
.route-admin-stats{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:9px;
  margin:14px 0;
}
.route-admin-stats>div{
  padding:11px 12px;
  background:#f8fafc;
  border:1px solid var(--border);
  border-radius:10px;
}
.route-admin-stats span{
  display:block;
  font-size:12px;
  color:var(--muted);
  font-weight:700;
  text-transform:uppercase;
}
.route-admin-stats strong{display:block;margin-top:4px;font-size:17px}
.route-map-canvas{
  width:100%;
  height:430px;
  border:1px solid var(--border);
  border-radius:12px;
  overflow:hidden;
  background:#eef2f6;
}
.leaflet-container{font-family:inherit}

@media(max-width:700px){
  .route-tracking-card{grid-template-columns:auto 1fr}
  .route-tracking-card .btn{grid-column:1/-1;width:100%}
  .route-admin-stats{grid-template-columns:1fr}
  .route-map-canvas{height:330px}
}


/* V2.4.8 - OCR no servidor + menu mobile */
.mobile-nav-toggle{display:none}

.ocr-status{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:10px;
  padding:11px 12px;
  border:1px solid var(--border);
  border-radius:11px;
  margin-bottom:12px;
  background:#f8fafc;
}
.ocr-status.ready{background:#ecfdf3;border-color:#abefc6}
.ocr-status.manual{background:#fffaeb;border-color:#fedf89}
.ocr-status strong{display:block;font-size:14px}
.ocr-status small{display:block;color:var(--muted);margin-top:3px;line-height:1.35}
.ocr-dot{width:12px;height:12px;border-radius:50%;background:#f79009;box-shadow:0 0 0 4px rgba(247,144,9,.12)}
.ocr-status.ready .ocr-dot{background:#12b76a;box-shadow:0 0 0 4px rgba(18,183,106,.12)}
.ocr-health-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.ocr-health-grid>div{padding:13px;border:1px solid var(--border);border-left:5px solid #f04438;border-radius:10px;background:#fff}
.ocr-health-grid>div.ok{border-left-color:#12b76a}
.ocr-health-grid span{display:block;color:var(--muted);font-size:12px;font-weight:800;text-transform:uppercase}
.ocr-health-grid strong{display:block;margin:4px 0}
.ocr-health-grid small{display:block;color:var(--muted);overflow-wrap:anywhere}

@media(max-width:800px){
  .topbar{
    align-items:center;
    padding:11px 12px;
  }
  .topbar-actions{
    flex:0 0 auto;
  }
  .mobile-nav-toggle{display:inline-flex}
  .topbar-actions [data-pwa-install]{display:none!important}

  .nav.mobile-menu-ready{
    display:none;
    overflow:visible;
    flex-wrap:wrap;
    padding:10px 12px;
    gap:7px;
    box-shadow:0 8px 18px rgba(16,24,40,.08);
  }
  .nav.mobile-menu-ready.is-open{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .nav.mobile-menu-ready a{
    display:flex;
    min-height:45px;
    align-items:center;
    justify-content:center;
    text-align:center;
    white-space:normal;
    border:1px solid var(--border);
    background:#fff;
    font-weight:700;
  }
  .nav.mobile-menu-ready a:first-child{
    background:#effbf3;
    border-color:#abefc6;
  }
  .ocr-status{
    grid-template-columns:auto 1fr;
  }
  .ocr-status .btn{
    grid-column:1/-1;
    width:100%;
  }
  .ocr-health-grid{grid-template-columns:1fr}
}
@media(max-width:440px){
  .telhaco-top-brand>img{width:88px;height:34px}
  .telhaco-top-brand strong{font-size:13px}
  .telhaco-top-brand small{font-size:10px}
  .topbar-actions .btn{min-height:38px;padding:7px 9px}
}


/* V2.4.8.1 - feedback do upload/OCR */
.upload-progress-notice{
  display:grid;
  grid-template-columns:auto 1fr;
  align-items:center;
  gap:11px;
  margin-top:13px;
  padding:12px 13px;
  border:1px solid #abefc6;
  border-radius:10px;
  background:#ecfdf3;
}
.upload-progress-notice[hidden]{display:none!important}
.upload-progress-notice strong{display:block}
.upload-progress-notice small{display:block;color:var(--muted);margin-top:2px}
.upload-spinner{
  width:22px;
  height:22px;
  border:3px solid #bbf7d0;
  border-top-color:#16a34a;
  border-radius:50%;
  animation:uploadSpin .8s linear infinite;
}
@keyframes uploadSpin{to{transform:rotate(360deg)}}


/* V2.4.8.2 - localização obrigatória para saída/entrega */
.route-start-gate{
  display:grid;
  grid-template-columns:auto 1fr;
  align-items:center;
  gap:11px;
  padding:12px 14px;
  margin:14px 0 0;
  border:1px solid #fedf89;
  border-radius:12px;
  background:#fffaeb;
}
.route-start-gate strong{display:block}
.route-start-gate small{display:block;color:var(--muted);margin-top:3px;line-height:1.35}
.route-start-gate[data-state="active"]{background:#ecfdf3;border-color:#abefc6}
.route-start-gate[data-state="active"] .route-tracking-dot{background:#12b76a;box-shadow:0 0 0 4px rgba(18,183,106,.14)}
.route-start-gate[data-state="blocked"]{background:#fff1f0;border-color:#fda29b}
.route-start-gate[data-state="blocked"] .route-tracking-dot{background:#f04438;box-shadow:0 0 0 4px rgba(240,68,56,.13)}


/* V2.4.8.3 - tipografia compacta e tabelas mais leves */
body{
  font-size:14px;
  line-height:1.38;
}

.container{
  max-width:1240px;
  margin:16px auto;
}

h1{
  font-size:22px;
  margin-bottom:14px;
  line-height:1.2;
}
h2{
  font-size:17px;
  margin-bottom:10px;
  line-height:1.25;
}
h3{
  font-size:15px;
}

.brand strong{font-size:16px}
.nav a{
  font-size:13px;
  padding:8px 9px;
}

.card{
  padding:14px;
}

.btn{
  min-height:38px;
  padding:8px 12px;
  font-size:13px;
}

.btn.small{
  min-height:32px;
  padding:6px 9px;
  font-size:12px;
}

label{
  font-size:12px;
  margin-bottom:5px;
}

/*
 * Mantemos 16px nos campos no iPhone para o Safari não aplicar zoom
 * automático quando o usuário toca no input.
 */
input,select,textarea{
  min-height:40px;
  padding:8px 9px;
  font-size:14px;
}

table{
  font-size:13px;
}
th,td{
  padding:8px 8px;
  line-height:1.3;
  vertical-align:top;
}
th{
  font-size:11px;
}
td{
  white-space:normal;
}
td .btn,
td .badge{
  white-space:nowrap;
}

.order-client{
  font-size:15px;
}
.order-address{
  font-size:13px;
}
.metric b{
  font-size:25px;
}
.driver-big-button{
  min-height:48px;
  font-size:14px;
}

@media(max-width:800px){
  body{font-size:13px}
  .container{
    margin-top:10px;
    padding:0 9px;
  }
  h1{font-size:20px}
  h2{font-size:16px}
  .card{padding:12px}
  .btn{
    min-height:38px;
    font-size:13px;
  }

  /* iOS: 16px evita zoom ao focar campos */
  input,select,textarea{
    font-size:16px;
    min-height:42px;
  }

  .nav.mobile-menu-ready a{
    min-height:40px;
    font-size:13px;
    padding:7px 8px;
  }

  .driver-action .btn{
    min-height:46px;
    font-size:14px;
  }

  table{
    font-size:12px;
  }
  th,td{
    padding:7px 7px;
  }
  th{
    font-size:10px;
  }

  .order-client{font-size:14px}
  .order-address{font-size:12px}
  .driver-big-button{
    min-height:46px;
    font-size:14px;
  }
}
