/* Visual comum das telas do Ciclico: preto e branco da marca.
   A única cor é a da etapa — o botão que envia leva a cor de onde a peça vai. */
:root {
  --papel: #F3F3F1; --cartao: #FFFFFF; --coluna: #E7E7E4; --tinta: #000000; --fraco: #5E5E5A; --linha: #CFCFCA;
  --acao: #000000; --acao-texto: #FFFFFF; --erro: #B4232F;
  --corte: #D9A21B; --costura: #B23A57; --embalagem: #8A5E33; --doca: #2F5C9E; --ecommerce: #1F7F55;
  --raio: 6px;
  /* as 5 etapas lado a lado: assinatura do Ciclico (barra do topo, login) */
  --faixa: linear-gradient(90deg, var(--corte) 0 20%, var(--costura) 0 40%, var(--embalagem) 0 60%, var(--doca) 0 80%, var(--ecommerce) 0);
  color-scheme: light;
}
.escuro {
  --papel: #000000; --cartao: #1A1A1A; --coluna: #0E0E0E; --tinta: #FFFFFF; --fraco: #A3A3A0; --linha: #383836;
  --acao: #FFFFFF; --acao-texto: #000000; --erro: #F0606A;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0; padding: 16px; background: var(--papel); color: var(--tinta);
  font-family: "Archivo", system-ui, sans-serif; font-size: 17px; line-height: 1.4;
}
/* marca d'água da Montio, quem desenvolveu o sistema */
.montio {
  position: fixed; right: 14px; bottom: 10px; z-index: 50;
  padding-left: 26px; background: url(montio.svg) no-repeat left center / 20px;
  font-size: 13px; font-weight: 700; letter-spacing: .04em; opacity: .35; text-decoration: none;
}
.montio:hover, .montio:focus-visible { opacity: .8;
}
h1, h2 { margin: 0; line-height: 1.1; font-stretch: 75%; font-weight: 800; }
a, button, input { font: inherit; color: inherit; }

[hidden] { display: none !important; }  /* botão tem display próprio; sem isso o hidden não esconde */

/* Marca: símbolo do logo + CICLICO condensado, como no logo */
.marca { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--tinta); }
.marca i { width: 28px; height: 28px; background: currentColor; -webkit-mask: url(logo.svg) center / contain no-repeat; mask: url(logo.svg) center / contain no-repeat; }
.marca b { font-weight: 800; font-stretch: 62%; font-size: 1.7rem; letter-spacing: .01em; line-height: 1; }
/* ESPORTES embaixo e ® ao lado, como no logo (vale também para o logo grande do login) */
.marca b, .grande b { position: relative; display: inline-block; text-align: center; }
.marca b::after, .grande b::after { content: "ESPORTES"; display: block; margin: .12em -.55em 0 0; font-size: .3em; font-weight: 700;
                                    font-stretch: 100%; letter-spacing: .55em; line-height: 1; }
.marca b::before, .grande b::before { content: "\00AE"; position: absolute; left: 100%; top: .3em; margin-left: .12em;
                                      font-size: .28em; font-weight: 600; font-stretch: 100%; line-height: 1; }

/* Barra do topo, igual em todas as telas: marca, telas, quem está logado */
.barra { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 28px; margin: -16px -16px 22px; padding: 0 16px;
        min-height: 60px; background: #000; color: #fff; border-bottom: 4px solid; border-image: var(--faixa) 1; }
.barra .marca { color: #fff; margin-right: 4px; }
.barra nav { display: flex; align-self: stretch; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.barra nav a { display: flex; align-items: center; padding: 0 .8em; color: #A3A3A0; text-decoration: none; font-weight: 600;
              white-space: nowrap; box-shadow: inset 0 -3px 0 transparent; }
.barra nav a:hover { color: #fff; }
.barra nav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -3px 0 #fff; }
/* Quem está logado: nome numa pílula com ícone de pessoa; botões discretos com contorno; Sair com ícone */
.conta { display: flex; align-items: center; gap: 8px; font-size: .9em; color: #A3A3A0; }
.conta span { display: inline-block; max-width: 16em; padding: .4em .95em .4em .7em; margin-right: 4px;
              border-radius: 99px; background: #1A1A1A; box-shadow: inset 0 0 0 1px #2E2E2C; color: #fff; font-weight: 600;
              white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conta span:empty { display: none; }
.conta span::before { content: ""; display: inline-block; vertical-align: -.22em; margin-right: 8px; width: 1.15em; height: 1.15em; background: currentColor;
                      -webkit-mask: var(--i-usuarios) center / contain no-repeat; mask: var(--i-usuarios) center / contain no-repeat; }
.conta button { display: inline-flex; align-items: center; gap: 6px; padding: .45em .85em; border-radius: 99px; background: transparent;
                color: #C9C9C5; font-weight: 600; box-shadow: inset 0 0 0 1px #2E2E2C; white-space: nowrap; }
.conta button:hover { color: #fff; background: #1F1F1E; box-shadow: inset 0 0 0 1px #4A4A47; }
.conta button[onclick^="sair"]::before { content: ""; width: 1.05em; height: 1.05em; background: currentColor;
  --sair: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpath d='m16 17 5-5-5-5'/%3E%3Cpath d='M21 12H9'/%3E%3C/svg%3E");
  -webkit-mask: var(--sair) center / contain no-repeat; mask: var(--sair) center / contain no-repeat; }
.conta button[onclick^="sair"]:hover { color: #fff; background: #3A1518; box-shadow: inset 0 0 0 1px #6B2A30; }
@media (max-width: 1220px) {
  .barra { padding-top: 8px; }
  .barra nav { order: 3; flex-basis: 100%; min-height: 44px; margin: 0 -.8em; }
  .conta { margin-left: auto; }
}
@media (max-width: 480px) { .conta { gap: 6px; } .conta span { max-width: 8.5em; margin-right: 0; } .conta button { padding: .45em .7em; } }

/* Título da tela + ações dela */
.titulo { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 18px; }
.titulo h1 { font-size: 2.1em; margin-right: auto; }

button, .botao {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .6em 1em; border: 0; border-radius: var(--raio); background: var(--acao); color: var(--acao-texto);
  font-weight: 700; text-decoration: none; cursor: pointer; touch-action: manipulation;
}
button.sec, .botao.sec { background: transparent; color: var(--tinta); box-shadow: inset 0 0 0 1.5px var(--linha); }
button:disabled { opacity: .4; cursor: default; }
button:active:not(:disabled) { transform: translateY(1px); }
:focus-visible { outline: 3px solid var(--doca); outline-offset: 2px; }

input {
  padding: .55em .7em; border-radius: var(--raio); border: 1.5px solid var(--linha); background: var(--papel);
  font-size: 1.1em; width: 100%;
}
input:focus { border-color: var(--tinta); outline: none; }
label { display: flex; flex-direction: column; gap: 5px; font-size: .9em; font-weight: 600; color: var(--fraco); }
label input { color: var(--tinta); font-weight: 400; }
select { font: inherit; font-size: 1.1em; padding: .55em .7em; border-radius: var(--raio); border: 1.5px solid var(--linha);
         background: var(--papel); color: var(--tinta); font-weight: 400; }

dialog {
  border: 0; border-radius: 10px; padding: 22px; width: min(440px, calc(100vw - 32px));
  background: var(--cartao); color: var(--tinta); box-shadow: 0 20px 60px #0007;
}
dialog::backdrop { background: #000B; }
dialog form { display: flex; flex-direction: column; gap: 12px; }
dialog h2 { font-size: 1.6em; }
dialog p { margin: 0; }
.botoes { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.erroTxt { color: var(--erro); min-height: 1.2em; margin: 0; font-weight: 600; }

/* Situação da conexão (Ao vivo / Sem conexão) como selo, com ponto que pulsa */
.status { display: inline-flex; align-items: center; gap: 8px; padding: .35em .85em; border-radius: 99px; font-size: .85em; font-weight: 700;
          color: var(--ecommerce); background: color-mix(in srgb, var(--ecommerce) 12%, transparent); white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulsa 2s infinite; }
.status.off { color: var(--erro); background: color-mix(in srgb, var(--erro) 12%, transparent); }
.status.off::before { animation: none; }
@keyframes pulsa { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 50%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }

/* Número de peças: grande e condensado, lê de longe */
.num { font-weight: 800; font-stretch: 75%; font-variant-numeric: tabular-nums; line-height: 1; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ============ Ícones (Lucide, licença ISC) ============
   Desenhados com máscara: pegam a cor do texto (currentColor) ou a de --c. Use: class="ic" + --ic. */
:root {
  --i-corte: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='6' cy='6' r='3'/%3E%3Cpath d='M8.12 8.12 12 12'/%3E%3Cpath d='M20 4 8.12 15.88'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Cpath d='M14.8 14.8 20 20'/%3E%3C/svg%3E");
  --i-costura: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.38 3.46 16 2a4 4 0 0 1-8 0L3.62 3.46a2 2 0 0 0-1.34 2.23l.58 3.47a1 1 0 0 0 .99.84H6v10c0 1.1.9 2 2 2h8a2 2 0 0 0 2-2V10h2.15a1 1 0 0 0 .99-.84l.58-3.47a2 2 0 0 0-1.34-2.23z'/%3E%3C/svg%3E");
  --i-embalagem: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7.5 4.27 9 5.15'/%3E%3Cpath d='M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z'/%3E%3Cpath d='m3.3 7 8.7 5 8.7-5'/%3E%3Cpath d='M12 22V12'/%3E%3C/svg%3E");
  --i-doca: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 8.35V20a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8.35A2 2 0 0 1 3.26 6.5l8-3.2a2 2 0 0 1 1.48 0l8 3.2A2 2 0 0 1 22 8.35Z'/%3E%3Cpath d='M6 18h12'/%3E%3Cpath d='M6 14h12'/%3E%3Crect width='12' height='12' x='6' y='10'/%3E%3C/svg%3E");
  --i-ecommerce: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='21' r='1'/%3E%3Ccircle cx='19' cy='21' r='1'/%3E%3Cpath d='M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12'/%3E%3C/svg%3E");
  --i-perda: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
  --i-producao: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='7' height='9' x='3' y='3' rx='1'/%3E%3Crect width='7' height='5' x='14' y='3' rx='1'/%3E%3Crect width='7' height='9' x='14' y='12' rx='1'/%3E%3Crect width='7' height='5' x='3' y='16' rx='1'/%3E%3C/svg%3E");
  --i-resumo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12h.01'/%3E%3Cpath d='M3 18h.01'/%3E%3Cpath d='M3 6h.01'/%3E%3Cpath d='M8 12h13'/%3E%3Cpath d='M8 18h13'/%3E%3Cpath d='M8 6h13'/%3E%3C/svg%3E");
  --i-relatorios: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v16a2 2 0 0 0 2 2h16'/%3E%3Cpath d='M18 17V9'/%3E%3Cpath d='M13 17V5'/%3E%3Cpath d='M8 17v-3'/%3E%3C/svg%3E");
  --i-usuarios: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E");
  --i-ok: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  --i-relogio: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E");
}
.corte { --ic: var(--i-corte); } .costura { --ic: var(--i-costura); } .embalagem { --ic: var(--i-embalagem); }
.doca { --ic: var(--i-doca); } .ecommerce { --ic: var(--i-ecommerce); } .perda { --ic: var(--i-perda); }
.ic, .barra nav a::before { display: inline-block; flex: none; width: 1.1em; height: 1.1em; background: currentColor;
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
.barra nav a::before { content: ""; width: 1em; height: 1em; margin-right: .5em; opacity: .85; }
.barra nav a[href^="index"] { --ic: var(--i-producao); } .barra nav a[href^="entrada"] { --ic: var(--i-corte); }
.barra nav a[href^="resumo"] { --ic: var(--i-resumo); } .barra nav a[href^="relatorios"] { --ic: var(--i-relatorios); }
.barra nav a[href^="usuarios"] { --ic: var(--i-usuarios); }
.barra nav a[href^="ajuda"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M9.1 9a3 3 0 0 1 5.8 1c0 2-3 3-3 3'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E"); }

/* Aviso que sobe da base depois de um lançamento (avisar() em dados.js) */
#aviso { position: fixed; left: 50%; bottom: 24px; z-index: 10; display: flex; align-items: center; gap: .7em; max-width: calc(100vw - 32px);
         padding: .85em 1.3em .85em 1em; border-radius: 12px; background: #111; color: #fff; font-weight: 700;
         box-shadow: 0 14px 40px #0008, inset 4px 0 0 var(--ecommerce); transform: translateX(-50%); animation: subir .25s ease-out; }
#aviso::before { content: ""; flex: none; width: 1.6em; height: 1.6em; border-radius: 50%;
                 background: var(--ecommerce) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 60% no-repeat; }
#aviso.erro { box-shadow: 0 14px 40px #0008, inset 4px 0 0 var(--erro); }
#aviso.erro::before { background: var(--erro) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v8'/%3E%3Cpath d='M12 19h.01'/%3E%3C/svg%3E") center / 60% no-repeat; }
#aviso button { margin-left: .6em; padding: .35em .8em; border-radius: 8px; background: #fff; color: #000; font-size: .9em; }
#aviso button:hover { background: var(--corte); }
@keyframes subir { from { opacity: 0; transform: translate(-50%, 14px); } }

/* Botão "Desfazer meu último lançamento" no título das telas de lançamento */
button.desfazer { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 14 4 9l5-5'/%3E%3Cpath d='M4 9h10.5a5.5 5.5 0 0 1 0 11H11'/%3E%3C/svg%3E");
                  font-size: .85em; padding: .5em .9em; }
button.desfazer::before { content: ""; width: 1.1em; height: 1.1em; background: currentColor; -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
