/* GIROX — interface mobile-first. Base branca/grafite/preta com verde GIROX como destaque. */
:root {
  --verde: #0B7F40;          /* ações e texto em verde (contraste AA sobre branco) */
  --verde-vivo: #16C060;     /* realces, gráfico, ícone ativo */
  --verde-claro: #E7F7EE;
  --verde-borda: #BFE8D0;
  --grafite: #111418;
  --grafite-2: #1B2026;
  --texto: #14181C;
  --suave: #5F6B76;
  --fraco: #8A949D;
  --borda: #E3E7EA;
  --fundo: #F4F6F5;
  --card: #FFFFFF;
  --alta: #0B7F40;
  --queda: #C2410C;
  --aviso: #8A5A00;
  --aviso-fundo: #FFF6DE;
  --erro: #B42318;
  --erro-fundo: #FEECEB;
  --info-fundo: #EEF4FB;
  --raio: 14px;
  --raio-p: 10px;
  --sombra: 0 1px 2px rgba(17, 20, 24, .05), 0 2px 8px rgba(17, 20, 24, .04);
  --nav-h: 64px;
  --topo-h: 56px;
  --seguro-baixo: env(safe-area-inset-bottom, 0px);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--texto);
  background: var(--fundo);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--fundo); font-size: 15px; line-height: 1.45; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: contain; }
img { max-width: 100%; }
a { color: var(--verde); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 22px; font-weight: 750; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 8px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid rgba(22, 192, 96, .45); outline-offset: 2px; }

/* ------------------------------------------------------------ estrutura */
.app { min-height: 100vh; min-height: 100dvh; }
.lateral { display: none; }
.topo { position: sticky; top: 0; z-index: 30; height: var(--topo-h); display: flex; align-items: center; gap: 10px; padding: 0 12px; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--borda); backdrop-filter: saturate(1.4) blur(8px); }
.topo .logo { height: 22px; display: block; }
.topo .titulo { font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.topo .voltar { margin-left: -6px; }
.topo .espaco { flex: 1; }
.conteudo { padding: 12px 12px calc(var(--nav-h) + 24px + var(--seguro-baixo)); max-width: 1200px; margin: 0 auto; }
.navbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(4, 1fr); height: calc(var(--nav-h) + var(--seguro-baixo)); padding-bottom: var(--seguro-baixo); background: #fff; border-top: 1px solid var(--borda); }
.navbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--suave); font-size: 12px; font-weight: 600; position: relative; }
.navbar a svg { width: 24px; height: 24px; }
.navbar a.ativo { color: var(--verde); }
.navbar a.ativo::before { content: ""; position: absolute; top: 0; width: 36px; height: 3px; border-radius: 0 0 3px 3px; background: var(--verde-vivo); }
.selo { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--verde); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.selo[hidden] { display: none; }

@media (min-width: 1024px) {
  .app { display: grid; grid-template-columns: 248px 1fr; }
  .lateral { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; background: var(--grafite); color: #E8ECEF; padding: 18px 12px; overflow-y: auto; }
  .lateral .logo { height: 30px; margin: 4px 10px 4px; align-self: flex-start; }
  .lateral .sub { color: #9AA5AF; font-size: 12px; margin: 0 10px 18px; }
  .lateral .grupo { color: #7D8892; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin: 16px 10px 6px; }
  .lateral a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; color: #D4DAE0; font-weight: 550; position: relative; }
  .lateral a svg { width: 20px; height: 20px; opacity: .9; }
  .lateral a:hover { background: var(--grafite-2); color: #fff; }
  .lateral a.ativo { background: rgba(22, 192, 96, .14); color: #fff; }
  .lateral a.ativo svg { color: var(--verde-vivo); opacity: 1; }
  .lateral a .selo { position: static; margin-left: auto; }
  .lateral .rodape { margin-top: auto; padding: 12px 10px 4px; font-size: 12px; color: #8D98A2; border-top: 1px solid #262C33; }
  .lateral .rodape .ponto { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--verde-vivo); margin-right: 6px; }
  .topo { height: 64px; padding: 0 24px; }
  .topo .logo { display: none; }
  .topo .titulo { font-size: 20px; }
  .conteudo { padding: 20px 24px 40px; }
  .navbar { display: none; }
  .so-movel { display: none !important; }
}
@media (max-width: 1023px) { .so-desktop { display: none !important; } }

/* ------------------------------------------------------------ componentes */
.cartao { background: var(--card); border: 1px solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra); padding: 14px; }
.cartao + .cartao, .bloco + .bloco { margin-top: 12px; }
.cartao h2 { margin-bottom: 10px; }
.cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cab h2 { margin: 0; }
.grade { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .md-g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 719px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .lg-2-1 { grid-template-columns: 2fr 1fr; } .lg-1-1 { grid-template-columns: 1fr 1fr; } }
.linha { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.linha.fim { justify-content: flex-end; }
.entre { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.muted { color: var(--suave); }
.peq { font-size: 13px; }
.mini { font-size: 12px; }
.forte { font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
.alta { color: var(--alta); }
.queda { color: var(--queda); }
.trunc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
hr.div { border: 0; border-top: 1px solid var(--borda); margin: 12px 0; }

.kpi { background: var(--card); border: 1px solid var(--borda); border-radius: var(--raio); padding: 12px 14px; box-shadow: var(--sombra); min-width: 0; }
.kpi .rot { font-size: 12.5px; color: var(--suave); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi .rot svg { width: 16px; height: 16px; color: var(--verde); }
.kpi .val { font-size: 22px; font-weight: 750; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .nota { font-size: 12.5px; margin-top: 2px; color: var(--suave); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--borda); background: #fff; color: var(--texto); font-weight: 650; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; user-select: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { border-color: #C9D0D5; }
.btn:active { transform: translateY(1px); }
.btn.prim { background: var(--verde); border-color: var(--verde); color: #fff; }
.btn.prim:hover { background: #096D37; }
.btn.escuro { background: var(--grafite); border-color: var(--grafite); color: #fff; }
.btn.perigo { color: var(--erro); border-color: #F3C7C3; }
.btn.perigo.cheio { background: var(--erro); color: #fff; border-color: var(--erro); }
.btn.leve { border-color: transparent; background: transparent; }
.btn.bloco { width: 100%; }
.btn.p { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icone { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; color: var(--texto); cursor: pointer; flex: none; }
.icone:hover { background: #F0F2F3; }
.icone svg { width: 22px; height: 22px; }
.icone.on { color: #E8A100; }

.campo { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.campo > span { font-size: 13px; font-weight: 650; color: var(--suave); }
input[type=text], input[type=search], input[type=password], input[type=number], input[type=date], input[type=file], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #D5DBDF; border-radius: var(--raio-p); background: #fff; font-size: 16px; /* 16px evita zoom no iOS */
  outline: none; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--verde-vivo); box-shadow: 0 0 0 3px rgba(22, 192, 96, .18); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235F6B76' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 36px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--verde); }

.busca-caixa { position: relative; }
.busca-caixa svg.lupa { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--fraco); pointer-events: none; }
.busca-caixa input { padding-left: 42px; padding-right: 44px; min-height: 50px; border-radius: 14px; }
.busca-caixa .limpar { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); }
.busca-caixa.com-camera input { padding-right: 92px; }
.busca-caixa .camera { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); color: var(--verde); }
.busca-caixa.com-camera .limpar { right: 47px; }
.busca-caixa input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; } /* [v1.3] evita dois "x" (o do navegador e o do GIROX) */
.busca-fixa { position: sticky; top: calc(var(--topo-h) + 0px); z-index: 20; background: var(--fundo); padding: 4px 0 10px; }
@media (min-width: 1024px) { .busca-fixa { top: 64px; } }

.seg { display: inline-flex; background: #ECEFF1; border-radius: 12px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: transparent; min-height: 36px; padding: 0 12px; border-radius: 9px; font-weight: 650; font-size: 14px; color: var(--suave); cursor: pointer; white-space: nowrap; }
.seg button.on { background: #fff; color: var(--texto); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.seg.bloco { display: flex; }
.seg.bloco button { flex: 1; }

.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border-radius: 15px; background: #EEF1F3; color: var(--texto); font-size: 13px; font-weight: 600; border: 0; max-width: 100%; }
.chip.verde { background: var(--verde-claro); color: var(--verde); }
.chip.aviso { background: var(--aviso-fundo); color: var(--aviso); }
.chip.erro { background: var(--erro-fundo); color: var(--erro); }
.chip svg { width: 14px; height: 14px; }

.filtro-barra { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filtro-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--borda); background: #fff; font-weight: 650; font-size: 14px; cursor: pointer; max-width: 100%; }
.filtro-btn svg { width: 18px; height: 18px; color: var(--verde); flex: none; }
.filtro-btn .trunc { max-width: 52vw; }
.base-dados { font-size: 12.5px; color: var(--suave); display: inline-flex; align-items: center; gap: 5px; }
.base-dados svg { width: 14px; height: 14px; }

.alerta { border-radius: 12px; padding: 10px 12px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; background: var(--aviso-fundo); color: var(--aviso); }
.alerta svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alerta.erro { background: var(--erro-fundo); color: var(--erro); }
.alerta.info { background: var(--info-fundo); color: #1F4E79; }
.alerta.ok { background: var(--verde-claro); color: var(--verde); }
.alerta + .alerta { margin-top: 8px; }
.alerta ul { margin: 0; padding-left: 18px; }

.lista { list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1px solid #EEF1F2; min-height: 56px; }
.item:last-child { border-bottom: 0; }
.item .corpo { flex: 1; min-width: 0; cursor: pointer; }
.item .nome { font-weight: 650; font-size: 15px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.item .meta { font-size: 12.5px; color: var(--suave); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .lado { text-align: right; font-variant-numeric: tabular-nums; flex: none; }
.item .lado b { display: block; font-size: 15px; }
.item .lado small { color: var(--suave); font-size: 12px; }
.pos { width: 28px; height: 28px; border-radius: 50%; background: #EEF1F3; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: none; }
.pos.p1 { background: #FFE9A8; } .pos.p2 { background: #E5E8EB; } .pos.p3 { background: #F6D9C2; }

.atalhos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.atalho { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 14px 6px; border-radius: var(--raio); background: #fff; border: 1px solid var(--borda); color: var(--texto); font-weight: 650; font-size: 13px; text-align: center; min-height: 88px; box-shadow: var(--sombra); }
.atalho svg { width: 26px; height: 26px; color: var(--verde); }
.atalho small { color: var(--suave); font-weight: 500; font-size: 11.5px; }
@media (max-width: 380px) { .atalhos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.tabela-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -14px; padding: 0 14px; }
table.tab { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tab th { text-align: left; font-size: 12px; color: var(--suave); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 8px 8px; border-bottom: 1px solid var(--borda); white-space: nowrap; }
table.tab td { padding: 10px 8px; border-bottom: 1px solid #EEF1F2; vertical-align: top; }
table.tab td.n, table.tab th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tab tr:last-child td { border-bottom: 0; }

.grafico { width: 100%; height: 180px; display: block; }
.grafico text { font-size: 10px; fill: var(--fraco); }
.grafico .grade-l { stroke: #EEF1F2; }
@media (min-width: 1024px) { .grafico { height: 230px; } }

.passo { display: flex; align-items: center; border: 1px solid #D5DBDF; border-radius: 12px; overflow: hidden; background: #fff; }
.passo button { width: 46px; min-height: 46px; border: 0; background: #F4F6F7; font-size: 22px; cursor: pointer; }
.passo input { border: 0; border-radius: 0; text-align: center; min-height: 46px; width: 90px; font-weight: 700; box-shadow: none !important; }

.vazio { text-align: center; padding: 28px 12px; color: var(--suave); }
.vazio svg { width: 40px; height: 40px; color: #B9C2C9; margin-bottom: 6px; }
.vazio h3 { color: var(--texto); margin-bottom: 4px; }
.esqueleto { background: linear-gradient(90deg, #EEF1F3 0%, #F7F8F9 50%, #EEF1F3 100%); background-size: 200% 100%; animation: brilho 1.2s infinite; border-radius: 10px; min-height: 16px; }
@keyframes brilho { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.girando { display: inline-block; width: 22px; height: 22px; border: 3px solid #D7DEE3; border-top-color: var(--verde-vivo); border-radius: 50%; animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.carregando { display: flex; justify-content: center; padding: 30px; }

/* folha (bottom sheet no celular, diálogo no desktop) */
.veu { position: fixed; inset: 0; background: rgba(17, 20, 24, .45); z-index: 80; display: flex; align-items: flex-end; justify-content: center; animation: aparece .15s; }
.folha { background: #fff; width: 100%; max-height: 90vh; max-height: 90dvh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 8px 16px calc(16px + var(--seguro-baixo)); animation: sobe .2s ease-out; }
.folha .alca { width: 40px; height: 4px; border-radius: 2px; background: #D5DBDF; margin: 4px auto 10px; }
.folha .fcab { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.folha .fcab h2 { font-size: 18px; }
.folha .acoes { display: flex; gap: 8px; margin-top: 16px; position: sticky; bottom: calc(-16px - var(--seguro-baixo)); background: #fff; padding: 10px 0 0; }
.folha .acoes .btn { flex: 1; }
@media (min-width: 720px) { .veu { align-items: center; } .folha { width: 560px; border-radius: 18px; padding: 16px 20px 20px; max-height: 86vh; } .folha .alca { display: none; } .folha.larga { width: 860px; } }
@keyframes sobe { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes aparece { from { opacity: 0; } to { opacity: 1; } }
.form { display: grid; gap: 12px; }

.avisos-toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 14px + var(--seguro-baixo)); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 440px); pointer-events: none; }
@media (min-width: 1024px) { .avisos-toast { bottom: 24px; } }
.toast { background: var(--grafite); color: #fff; padding: 12px 14px; border-radius: 12px; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); animation: sobe .2s; pointer-events: auto; display: flex; gap: 10px; align-items: center; }
.toast.erro { background: #8E1B12; }
.toast.ok svg { color: var(--verde-vivo); }
.toast svg { width: 18px; height: 18px; flex: none; }

.menu-lista a, .menu-lista button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 0 6px; border: 0; background: none; color: var(--texto); font-weight: 600; border-bottom: 1px solid #EEF1F2; cursor: pointer; text-align: left; }
.menu-lista svg { width: 22px; height: 22px; color: var(--verde); }
.menu-lista .grupo { font-size: 12px; text-transform: uppercase; color: var(--fraco); font-weight: 700; letter-spacing: .05em; margin: 14px 6px 4px; }

.produto-cab { display: flex; gap: 12px; align-items: flex-start; }
.produto-cab .ic { width: 52px; height: 52px; border-radius: 14px; background: var(--verde-claro); color: var(--verde); display: flex; align-items: center; justify-content: center; flex: none; }
.produto-cab .ic svg { width: 28px; height: 28px; }
.produto-cab h1 { font-size: 19px; }
.sugestao { background: linear-gradient(180deg, #F2FBF6, #fff); border-color: var(--verde-borda); }

.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--verde); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 750; font-size: 15px; border: 0; cursor: pointer; flex: none; }
.login { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(1200px 500px at 0% 0%, #E9F8F0 0%, transparent 60%), var(--fundo); }
.login .cartao { width: 100%; max-width: 400px; padding: 26px 22px; }
.login .logo { height: 40px; display: block; margin: 0 auto 6px; }
.login .lema { text-align: center; color: var(--suave); margin-bottom: 20px; font-size: 14px; }

.drop { border: 2px dashed #CBD3D8; border-radius: var(--raio); padding: 22px; text-align: center; background: #FAFBFB; cursor: pointer; }
.drop.arrastando { border-color: var(--verde-vivo); background: var(--verde-claro); }
.etiqueta { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 8px; background: #EEF1F3; color: var(--suave); white-space: nowrap; }
.etiqueta.verde { background: var(--verde-claro); color: var(--verde); }
.etiqueta.amarela { background: var(--aviso-fundo); color: var(--aviso); }
.etiqueta.vermelha { background: var(--erro-fundo); color: var(--erro); }
pre.log { background: var(--grafite); color: #D5DCE2; font-size: 12px; padding: 12px; border-radius: 12px; overflow: auto; max-height: 60vh; white-space: pre-wrap; word-break: break-word; }
.mais-carregar { display: flex; justify-content: center; margin-top: 10px; }
.cobert { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cobert button { border: 1px solid var(--borda); background: #fff; border-radius: 12px; padding: 8px 4px; cursor: pointer; text-align: center; }
.cobert button b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.cobert button small { color: var(--suave); font-size: 12px; }
.cobert button.on { border-color: var(--verde); background: var(--verde-claro); box-shadow: inset 0 0 0 1px var(--verde); }
.grade > .cartao + .cartao, .grade > .kpi + .kpi { margin-top: 0; }
