/* ════════════════════════════════════════════════════════════════════════
   IVONE · Monitor no celular (CELULAR.html) e tela de login do servidor_celular.ps1
   18/11/2026. Carrega depois de iv.pedidos.css. Tudo preso em html.iv-cel (a página do celular)
   ou em body.cel-login (a página de login), para não mexer na TV nem na plataforma.
   ════════════════════════════════════════════════════════════════════════ */
@font-face{font-family:'Nunito';src:url('fonts/Nunito-800.woff2') format('woff2');font-weight:800;font-style:normal;font-display:swap}
@font-face{font-family:'Nunito';src:url('fonts/Nunito-900.woff2') format('woff2');font-weight:900;font-style:normal;font-display:swap}
@font-face{font-family:'Nunito Sans';src:url('fonts/NunitoSans-400.woff2') format('woff2');font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:'Nunito Sans';src:url('fonts/NunitoSans-700.woff2') format('woff2');font-weight:700;font-style:normal;font-display:swap}

/* ───────── página: rola em vez de encolher ───────── */
html.iv-cel body.tv-body{overflow:auto;overflow-x:hidden;min-height:100vh;-webkit-text-size-adjust:100%}
html.iv-cel .tv-raiz{height:auto;overflow:visible;padding:0 12px calc(24px + env(safe-area-inset-bottom));max-width:1680px;margin:0 auto}
html.iv-cel .tv-raiz.com-alertas{padding-bottom:calc(24px + env(safe-area-inset-bottom))}
html.iv-cel .tv-raiz .pp{display:flex;flex-direction:column;gap:12px;padding-top:58px}

/* ───────── menu: faixa fixa no topo, rola de lado ───────── */
html.iv-cel .tv-nav{top:0;bottom:auto;height:auto;min-height:50px;padding:6px 10px calc(6px) 10px;padding-top:calc(6px + env(safe-area-inset-top));
  border-top:0;border-bottom:1px solid #EADDE6;box-shadow:0 2px 10px rgba(76,40,80,.08);flex-wrap:nowrap}
html.iv-cel .tv-nav-abas{flex:1;min-width:0;display:flex;gap:4px;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}
html.iv-cel .tv-nav-abas::-webkit-scrollbar{display:none}
html.iv-cel .tv-nav span{font-size:13.5px;padding:9px 13px;white-space:nowrap;flex:none}
html.iv-cel .tv-nav-r{display:flex;align-items:center;gap:8px;flex:none}
html.iv-cel .tv-nav-r em,html.iv-cel .tv-nav-r .tv-dica,html.iv-cel .tv-nav-r time{display:none}
.cel-sair{display:flex;align-items:center;gap:8px;margin:0}
.cel-sair span{font:700 12px/1 'Nunito',system-ui,sans-serif;color:#6A5B6C;max-width:90px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cel-sair button{border:1px solid #9E0A34;background:#fff;color:#9E0A34;font:800 13px/1 'Nunito',system-ui,sans-serif;border-radius:999px;padding:9px 14px;cursor:pointer}
.cel-sair button:active{background:#9E0A34;color:#fff}
html.iv-cel .tv-espera{min-height:80vh;padding:24px}
html.iv-cel .tv-espera img{height:140px}
html.iv-cel .tv-espera h1{font-size:26px}
html.iv-cel .tv-espera .cel-sair{margin-top:18px}

/* ───────── alertas: bloco no topo do painel, não faixa fixa ───────── */
html.iv-cel .tv-alertas{position:static;height:auto;flex-wrap:wrap;padding:10px 12px;border-radius:14px;gap:6px;margin-top:12px}
html.iv-cel .tv-alertas b{width:100%}
html.iv-cel .tv-alertas span{font-size:13px;white-space:normal;line-height:1.3}

@media (max-width:900px){
  /* cabeçalho do painel */
  html.iv-cel .pp-head{padding:16px 16px 14px;gap:10px;min-height:0!important;border-radius:16px}
  html.iv-cel .pp-head h1,html.iv-cel .pp-tv .pp-head h1{font-size:24px}
  html.iv-cel .pp-leao,html.iv-cel .tv-raiz .pp-leao{display:none}
  html.iv-cel .pp-tit{border-left:0;padding-left:0;min-width:0}
  html.iv-cel .pp-head-r{width:100%;gap:6px}
  html.iv-cel .tv-per-chip{margin-right:0;padding:9px 12px}

  /* números do topo em duas colunas; o resto empilha */
  html.iv-cel .pp > section{grid-template-columns:1fr!important}
  html.iv-cel .pp > section.pp-kpis{grid-template-columns:1fr 1fr!important;gap:8px}
  html.iv-cel .pp-kpis .pp-k.hero{grid-column:1/-1}
  html.iv-cel .tv-raiz .pp-k{padding:12px 12px;min-width:0}
  html.iv-cel .tv-raiz .pp-k .v,html.iv-cel .pp-tv .pp-k .v{font-size:22px;margin:4px 0;white-space:nowrap}
  html.iv-cel .pp-k .l{font-size:10.5px}
  html.iv-cel .pp-k .f{font-size:11.5px;line-height:1.3}

  /* cards e tabelas */
  html.iv-cel .pp-card{padding:14px 12px;min-width:0}
  html.iv-cel .pp-card h3,html.iv-cel .pp-card-t{font-size:15px}
  html.iv-cel .pp-card > *{max-width:100%}
  html.iv-cel .tv-tab{font-size:12.5px}
  html.iv-cel .tv-tab th,html.iv-cel .tv-tab td{padding:6px 5px}
  html.iv-cel .tv-barras{gap:6px}
  html.iv-cel .tv-graf{width:100%;height:auto}
  html.iv-cel .pp-pe{font-size:11px;line-height:1.4}

  /* detalhe: tela cheia */
  html.iv-cel .tv-det-fundo{padding:0;align-items:stretch}
  html.iv-cel .tv-det{border-radius:0;width:100%;max-height:none;height:100%}
  html.iv-cel .tv-det header{flex-wrap:wrap;padding:10px 12px;padding-top:calc(10px + env(safe-area-inset-top));gap:8px}
  html.iv-cel .tv-det-t{flex:1 1 calc(100% - 100px);order:1}
  html.iv-cel .tv-det-t h2{font-size:17px;white-space:normal}
  html.iv-cel .tv-det-b{order:2}
  html.iv-cel .tv-det-lupa{order:3;flex:1 1 100%;min-width:0}
  html.iv-cel .tv-det-xls{order:4}
  html.iv-cel .tv-det-corpo{padding:10px 8px;-webkit-overflow-scrolling:touch}
  html.iv-cel .tv-det-tab{font-size:12px}
  html.iv-cel .tv-det-2,html.iv-cel .tv-det-resumo{grid-template-columns:1fr!important}
  html.iv-cel .tv-det footer{padding:6px 12px calc(6px + env(safe-area-inset-bottom))}
}

/* ═══════════ login (servidor_celular.ps1) ═══════════ */
body.cel-login{margin:0;min-height:100vh;display:flex;align-items:center;justify-content:center;padding:20px;box-sizing:border-box;
  background:linear-gradient(160deg,#4C2850 0%,#3B1239 55%,#9E0A34 100%);font-family:'Nunito Sans','Nunito',system-ui,sans-serif;color:#2A1A2C}
.cel-cx{background:#fff;border-radius:22px;box-shadow:0 20px 60px rgba(0,0,0,.35);width:100%;max-width:380px;padding:28px 24px 22px;box-sizing:border-box;position:relative}
.cel-cx::after{content:"";position:absolute;inset:8px;border:1.5px dashed rgba(228,0,58,.35);border-radius:16px;pointer-events:none}
.cel-cx img{display:block;height:84px;margin:0 auto 6px}
.cel-cx h1{font:900 24px/1.1 'Nunito',system-ui,sans-serif;color:#4C2850;text-align:center;margin:0 0 4px}
.cel-cx h1 b{color:#E4003A}
.cel-cx p{font-size:13.5px;color:#6A5B6C;text-align:center;margin:0 0 18px}
.cel-cx label{display:block;font:800 12px/1 'Nunito',system-ui,sans-serif;letter-spacing:.06em;text-transform:uppercase;color:#6A5B6C;margin:12px 0 6px}
.cel-cx input{display:block;width:100%;box-sizing:border-box;font:400 17px/1.2 'Nunito Sans',system-ui,sans-serif;padding:13px 14px;border:1.5px solid #D9C9D6;border-radius:12px;background:#FBF8FA;color:#2A1A2C}
.cel-cx input:focus{outline:0;border-color:#9E0A34;background:#fff}
.cel-cx button{display:block;width:100%;margin-top:20px;border:0;border-radius:12px;padding:14px;font:900 16px/1 'Nunito',system-ui,sans-serif;color:#fff;background:#9E0A34;cursor:pointer;position:relative;z-index:1}
.cel-cx button:active{background:#7A0828}
.cel-erro{background:#FDECEF;color:#9E0A34;border-radius:10px;padding:10px 12px;font-size:13.5px;font-weight:700;margin:0 0 6px}
.cel-cx small{display:block;text-align:center;font-size:11.5px;color:#9A8E9C;margin-top:16px}
.cel-cx input,.cel-cx label{position:relative;z-index:1}

/* ───────── ajustes do que passava da largura do celular (18/11/2026) ───────── */
@media (max-width:900px){
  html.iv-cel .pp-card{overflow-x:auto;-webkit-overflow-scrolling:touch}
  html.iv-cel .tv-fils{grid-template-columns:1fr}
  html.iv-cel .tv-fil-v{font-size:22px}
  html.iv-cel .tv-cols{gap:2px;height:180px}
  html.iv-cel .tv-col{min-width:0}
  html.iv-cel .tv-col span{font-size:8px;letter-spacing:-.02em}
  html.iv-cel .pp-feed div b{white-space:normal;overflow-wrap:anywhere}
  html.iv-cel .pp-feed li{grid-template-columns:46px minmax(0,1fr) auto;gap:8px}
  html.iv-cel .tv-tab{min-width:0}
  html.iv-cel .tv-tab td,html.iv-cel .tv-tab th{white-space:nowrap}
  html.iv-cel .tv-tab td:first-child{white-space:normal;min-width:110px}
}
@media (max-width:900px){
  /* cabeçalho mais baixo: logo pequeno ao lado do título */
  html.iv-cel .pp-head{flex-wrap:wrap;align-items:flex-start}
  html.iv-cel .pp-logo{height:26px;order:0}
  html.iv-cel .pp-tit{flex:1 1 100%;order:1}
  html.iv-cel .pp-sub{font-size:12px;line-height:1.35}
  html.iv-cel .pp-head-r{order:2}
  /* barra: nome numa linha, barra e valor embaixo */
  html.iv-cel .tv-barra{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;column-gap:10px;row-gap:3px;align-items:center}
  html.iv-cel .tv-barra-l{grid-column:1/-1;white-space:normal!important;overflow:visible!important;font-size:12.5px;line-height:1.25}
  html.iv-cel .tv-barra-t{grid-column:1;min-width:0;width:auto!important}
  html.iv-cel .tv-barra b{grid-column:2;font-size:12.5px;white-space:nowrap}
}
@media (max-width:900px){
  /* detalhe: nome quebra linha para os valores caberem na tela; busca e Excel na mesma linha */
  html.iv-cel .tv-det-tab th,html.iv-cel .tv-det-tab td{white-space:normal!important;padding:6px 4px;min-width:0;font-size:11.5px;letter-spacing:0}
  html.iv-cel .tv-det-tab td:first-child,html.iv-cel .tv-det-tab th:first-child{min-width:0}
  html.iv-cel .tv-det-tab td:nth-child(2){min-width:130px}
  html.iv-cel .tv-det-tab td.n{white-space:nowrap!important}
  html.iv-cel .tv-det-lupa{flex:1 1 60%;order:3}
  html.iv-cel .tv-det-xls{order:4;flex:none}
  html.iv-cel .tv-det-xls{width:auto;padding:0 10px;font-size:13px}
}

/* iPhone (18/11/2026: "os celulares que irão abrir sao todos ios"): campo com menos de 16px faz o Safari
   dar zoom ao tocar; e o toque não pisca cinza nos números clicáveis */
html.iv-cel input,html.iv-cel select,html.iv-cel textarea{font-size:16px!important}
html.iv-cel [data-det],html.iv-cel [data-k],html.iv-cel button{-webkit-tap-highlight-color:rgba(158,10,52,.12)}
