@media screen {
 body{font-size:16px;background:#f1f5f3;color:#173127}
 header{min-height:68px;height:auto;padding:12px 20px}
 main{padding-top:24px}
 .brand b{font-size:18px}.brand small,.sidebrand small{font-size:13px}
 .box,.overviewKpi,.overviewChartBox,.topClientsBox{border-color:#d4e2da;border-radius:16px;box-shadow:0 3px 14px #17312708}
 .box{padding:18px;margin-top:16px}
 .head{gap:12px;flex-wrap:wrap}.head h2{font-size:20px}
 .field label,.status,.badge,.day,.day small,.topstat small,.overviewKpi small,.overviewKpi span,.overviewLegend,.overviewPeriod button,.catalogCount,.manageinfo small,.closingbox small,.orderbox small{font-size:14px}
 button,input,select{font-family:inherit}button{cursor:pointer}
 button:disabled{cursor:default;opacity:.55}
 input:not(.qty),select{font-size:16px;min-height:44px;border-radius:9px}
 button{min-height:44px;font-size:14px}
 button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #d68e12;outline-offset:2px}
 .overviewKpi{padding:22px}.overviewKpi b{font-size:32px;line-height:1.15}
 .orderhead{top:68px;padding:10px 0}.controls{gap:12px;padding:14px}
 .topstat{padding:12px}.topstat b{font-size:20px}.saveState{font-size:14px;margin:10px 0}
 .stitle{font-size:14px;padding:10px}.swrap{max-height:65vh}
 table{font-size:14px}th.ch{min-width:56px;width:56px;height:125px}th.ch span{font-size:13px}
 th.ph{min-width:140px;width:140px;padding:8px}td{min-width:56px;width:56px;height:44px}.qty{height:43px;font-size:16px}
 .rtiNotice{position:relative;padding:16px 48px 16px 16px;background:#fff8e6;border:1px solid #e4bf65;border-radius:12px;margin:14px 0;color:#614510;font-size:15px;line-height:1.5}
 .rtiNotice[hidden]{display:none}.rtiNotice button{padding:8px 14px;border:1px solid #9d803c;border-radius:8px;background:white;color:#493300}.rtiNotice .rtiNoticeClose{position:absolute;right:10px;top:8px;width:32px;height:32px;padding:0;border:0;border-radius:50%;background:transparent;font-size:26px;line-height:30px;font-weight:900;color:#6a501c;cursor:pointer}.rtiNotice .rtiNoticeClose:hover{background:#f3e6bd}
 #cloudStatus{font-size:14px}nav button{font-size:14px}
 @media(max-width:800px){
  header{padding:10px;flex-wrap:wrap}.brand{flex:1}
  #authUserInfo{width:100%;max-width:none!important;justify-content:space-between;gap:10px!important}
  #cloudStatus{flex:1;min-width:0;max-width:none!important;line-height:1.4}
  main{padding:12px 10px 112px!important;margin-left:0!important}
  nav{display:flex!important;overflow-x:auto;gap:4px;padding:8px 6px calc(8px + env(safe-area-inset-bottom));}
  nav button{flex:0 0 94px;min-height:64px;font-size:13px;white-space:normal}nav .sidebrand,nav .sideLabel{display:none!important}
  .overviewKpis{grid-template-columns:1fr!important}.overviewKpi{min-height:100px}
  .controls .field{flex:1 1 145px}.controls .field input{max-width:100%;width:100%}
  .orderhead{position:static}.days{grid-template-columns:repeat(4,1fr)}
  .topsummary{grid-template-columns:repeat(3,minmax(0,1fr))}.topstat{padding:10px 4px}.topstat small{font-size:12px}.topstat b{font-size:17px}
  .managecard{flex-wrap:wrap}.actions{flex-wrap:wrap}.overviewChartHead{flex-wrap:wrap}
  .overviewDay{font-size:13px}.overviewDayValue{font-size:13px}
 }
}
/* V28: superfície de pedidos compacta; impressões preservadas. */
@media screen {
 #orders #matrix{zoom:var(--order-zoom,1)}
 .orderZoom{display:flex;align-items:center;gap:5px;flex-wrap:wrap;margin-left:auto;color:#214b37}
 .orderZoom>span{font-size:12px;font-weight:700}.orderZoom output{min-width:40px;text-align:center;font-size:13px;font-weight:700}
 #orders .orderZoom button{border:1px solid #b7cdbc;border-radius:6px;background:#fff;color:#14532d;min-width:32px;font-weight:800}
 #orders .controls{padding:8px;gap:8px}
 #orders .orderhead{padding:4px 0}
 #orders .days{gap:3px;margin:4px 0}
 #orders .day{padding:4px 2px;min-height:36px;font-size:12px}
 #orders .day small{font-size:12px}
 #orders .topstat{padding:5px;display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap}
 #orders .topstat small{font-size:12px}#orders .topstat b{font-size:16px}
 #orders .saveState{margin:4px 0;font-size:12px;line-height:1.3}
 #orders .sheet{margin-top:4px}
 #orders .stitle{padding:5px 8px;font-size:12px}
 #orders #matrix table{table-layout:fixed;width:max-content;font-size:12px}
 #orders #matrix th.ph{width:108px;min-width:108px;max-width:108px;padding:4px;white-space:normal}
 #orders #matrix th.ch{width:32px;min-width:32px;max-width:32px;height:96px}
 #orders #matrix th.ch span{font-size:12px;line-height:1.15;padding:3px 2px}
 #orders #matrix td{width:32px;min-width:32px;max-width:32px;height:30px}
 #orders #matrix .qty{height:29px;font-size:14px}
 #orders #matrix .swrap{max-height:calc(100dvh - 230px)}
 #orders .field label{font-size:12px}
 #orders .status{font-size:12px;min-width:140px}
 #orders .controls input{padding:4px 7px;min-height:32px;font-size:14px}
 #orders .controls button{min-height:32px;padding:6px 9px;font-size:12px}
 @media(min-width:900px){
  body:has(#orders.active) nav{width:176px;padding:12px 8px;gap:3px}
  body:has(#orders.active) nav button{min-height:40px;padding:8px;font-size:13px;gap:7px}
  body:has(#orders.active) nav .sidebrand{padding:4px 2px 12px;gap:7px}
  body:has(#orders.active) nav .sidebrand small{display:none}
  body:has(#orders.active) nav .sidebrand b{font-size:14px}
  body:has(#orders.active) nav .sideLabel{margin:8px 4px}
  body:has(#orders.active) header{margin-left:176px;min-height:48px;height:48px;padding:5px 12px}
  body:has(#orders.active) header .brand small{display:none}
  body:has(#orders.active) header button{min-height:32px;padding:6px 10px}
  body:has(#orders.active) main{margin-left:176px;padding:8px 10px 20px}
  #orders .orderhead{top:48px}
 }
 @media(max-width:800px){
  #orders #matrix th.ch,#orders #matrix td{width:38px;min-width:38px;max-width:38px}
  #orders #matrix td{height:38px}#orders #matrix .qty{height:37px;font-size:16px}
  #orders #matrix .swrap{max-height:65dvh}
 }
}
/* V29: compras compactas em 100%, sem alterar a grade ou os relatórios. */
@media screen {
 #purchasePlanner{padding:10px;margin-top:10px;border-radius:10px}
 #purchasePlanner .head{margin-bottom:5px;gap:6px;align-items:center}
 #purchasePlanner .head h2{font-size:17px}
 #purchasePlanner .subtitle{font-size:12px;margin-top:2px}
 #purchasePlanner .badge{padding:3px 7px;font-size:12px}
 #purchasePlanner .purchaseHelp{margin:4px 0;font-size:12px;color:#50614f}
 #purchasePlanner .purchaseHelp summary{cursor:pointer;padding:3px 0;width:fit-content}
 #purchasePlanner .purchaseHint{font-size:12px;padding:6px 8px;margin:3px 0}
 #purchasePlanner .purchasePlannerSummary{gap:4px;margin:5px 0}
 #purchasePlanner .purchaseMini{padding:5px 7px;display:flex;justify-content:center;align-items:center;gap:8px;flex-wrap:wrap;border-radius:6px}
 #purchasePlanner .purchaseMini small{font-size:11px;letter-spacing:0}
 #purchasePlanner .purchaseMini b{font-size:14px;margin:0}
 #purchasePlanner .purchaseTable{table-layout:fixed;min-width:800px;font-size:12px}
 #purchasePlanner .purchaseTable th,#purchasePlanner .purchaseTable td{padding:4px 5px;min-width:0;height:auto}
 #purchasePlanner .purchaseTable th{font-size:11px;letter-spacing:0}
 #purchasePlanner .purchaseTable th.num{white-space:normal;line-height:1.2}
 #purchasePlanner .purchaseTable th:nth-child(1){width:110px}
 #purchasePlanner .purchaseTable th:nth-child(2){width:90px}
 #purchasePlanner .purchaseTable th:nth-child(3){width:100px}
 #purchasePlanner .purchaseTable th:nth-child(4){width:100px}
 #purchasePlanner .purchaseProduct{min-width:0;font-size:12px}
 #purchasePlanner .purchaseDemand,#purchasePlanner .purchaseNeed{min-width:32px;padding:4px 5px;font-size:12px}
 #purchasePlanner .allocList{gap:3px;min-width:0}
 #purchasePlanner .allocRow{grid-template-columns:minmax(120px,1fr) 58px 70px 82px 28px;gap:4px}
 #purchasePlanner input,#purchasePlanner select{min-height:28px;height:28px;padding:3px 5px;font-size:13px;border-radius:5px}
 #purchasePlanner .purchaseStock{width:58px}
 #purchasePlanner button{min-height:28px;height:28px;padding:3px 7px;font-size:12px}
 #purchasePlanner .allocAdd{justify-self:start;margin-top:1px;min-width:115px}
 #purchasePlanner .allocTotal{font-size:12px}
 #purchasePlanner .purchaseStatus{margin-top:1px;font-size:11px;line-height:1.3}
 @media(pointer:coarse){
  #purchasePlanner input,#purchasePlanner select,#purchasePlanner button{min-height:36px;height:36px}
 }
}

/* Texto auxiliar de WhatsApp no cadastro de clientes */
#cadastros .manageinfo small.clientPhoneRTI { font-size:11px !important; line-height:1.25; }

/* Filtro de empresas compacto, separado do estilo de campos de texto. */
#cadastros .catalogTools .rtiAllCompaniesFilter { display:inline-flex; align-items:center; justify-content:flex-start; gap:7px; grid-column:1 / -1; justify-self:start; width:auto; max-width:100%; min-height:28px; margin:0; padding:2px 0; font-size:12px; line-height:1.3; cursor:pointer; }
#cadastros .catalogTools #showAllUnitClientsRTI { appearance:auto; display:inline-block; flex:0 0 16px; width:16px !important; height:16px !important; min-width:16px !important; min-height:16px !important; max-width:16px; max-height:16px; padding:0 !important; margin:0 !important; accent-color:#166534; vertical-align:middle; }

/* Cadastro: nomes completos e ações em uma linha própria. */
#clientList .managecard { flex-wrap:wrap; gap:12px; align-items:center; }
#clientList .manageinfo { flex:1 1 320px; min-width:0; }
#clientList .manageinfo b { white-space:normal; overflow:visible; text-overflow:clip; overflow-wrap:anywhere; font-size:16px; line-height:1.4; }
#clientList .manageinfo small { overflow-wrap:anywhere; }
#clientList .actions { flex:1 0 100%; display:flex; flex-wrap:wrap; justify-content:flex-end; padding-top:8px; border-top:1px solid #e5ece7; }
@media(max-width:600px) {
 #clientList .manageinfo { flex-basis:calc(100% - 90px); }
 #clientList .actions { justify-content:flex-start; }
}

/* Quantidades completas, inclusive valores com muitos dígitos. */
@media screen {
 #orders #matrix th.ch,#orders #matrix td {
  width:var(--quantity-column-width,52px);
  min-width:var(--quantity-column-width,52px);
  max-width:var(--quantity-column-width,52px);
 }
 #orders #matrix .qty { padding:0 5px; box-sizing:border-box; font-variant-numeric:tabular-nums; }
}
