/* Sistema CK — tema escuro, mesmo padrão visual do app de estoque antigo */
:root {
  --bg: #0b0d11; --card: #171a21; --card2: #21252e; --linha: #262b36;
  --accent: #e8542e; --accent-2: #ff8a3d; --ember: #ffb020;
  --text: #f4f4f5; --muted: #949aa6;
  --green: #35c26a; --red: #e8542e; --yellow: #ffb020; --blue: #4aa3ff;
  --raio: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 15px; }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; width: 100%; padding: 12px; border-radius: 12px; border: 1px solid #2f3542;
  background: var(--card2); color: var(--text); margin-bottom: 12px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232,84,46,.15); }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }

.botao { border: none; border-radius: 12px; padding: 13px 16px; font-weight: 700; color: var(--text); background: var(--card2); }
.botao.primario { background: linear-gradient(96deg, var(--accent), var(--accent-2)); color: #fff; width: 100%; }
.botao.fantasma { background: transparent; border: 1px solid #2f3542; color: var(--muted); width: 100%; padding: 10px; }
.botao:disabled { opacity: .6; cursor: default; }
.botao-icone { border: none; background: none; color: var(--text); padding: 6px; display: inline-flex; }

/* ---------- entrada ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(900px 500px at 50% -10%, rgba(232,84,46,.18), transparent 60%), var(--bg); }
.login-cartao { width: 100%; max-width: 380px; background: var(--card); border: 1px solid #21252e; border-radius: 20px; padding: 28px 22px; }
.login-logo { display: block; width: 72px; margin: 0 auto 10px; }
.login h1 { text-align: center; margin: 0; font-size: 24px; }
.login-sub { text-align: center; color: var(--muted); font-size: 13px; margin: 6px 0 22px; line-height: 1.45; }
.aviso { background: rgba(255,176,32,.10); border: 1px solid rgba(255,176,32,.3); color: var(--ember);
  border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; line-height: 1.45; }
.aviso.erro { background: rgba(232,84,46,.10); border-color: rgba(232,84,46,.35); color: #ff9d85; }

/* ---------- estrutura ---------- */
.app { display: flex; min-height: 100vh; }
.menu { width: 248px; flex: none; background: #0f1218; border-right: 1px solid #1b1f27; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.menu-topo { display: flex; align-items: center; gap: 10px; padding: 18px 16px 14px; }
.menu-logo { width: 34px; }
.menu-topo b { display: block; font-size: 15px; }
.menu-topo span { display: block; font-size: 11.5px; color: var(--muted); }
#menuLista { flex: 1; padding: 4px 10px; }
.menu-grupo { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #6c7280; margin: 16px 8px 6px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border-radius: 10px; color: var(--muted);
  text-decoration: none; font-weight: 600; font-size: 14px; }
.menu-item:hover { background: var(--card); color: var(--text); }
.menu-item.ativo { background: rgba(232,84,46,.14); color: var(--text); }
.menu-item.ativo svg { color: var(--accent); }
.menu-item span { flex: 1; min-width: 0; }
.menu-item small { flex: none; font-size: 10px; font-weight: 700; color: #6c7280; white-space: nowrap; }
.menu-rodape { padding: 14px 16px 18px; border-top: 1px solid #1b1f27; }
.quem { font-size: 12px; color: var(--muted); margin-bottom: 10px; line-height: 1.4; }
.quem b { display: block; color: var(--text); font-size: 13.5px; }

.principal { flex: 1; min-width: 0; }
.topo { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 16px 28px 12px;
  background: rgba(11,13,17,.92); backdrop-filter: blur(10px); border-bottom: 1px solid #1b1f27; }
.topo h1 { font-size: 18px; margin: 0; flex: 1; }
.topo-data { font-size: 12px; color: var(--muted); }
.conteudo { padding: 22px 28px 48px; max-width: 1400px; }
.so-celular { display: none; }

@media (max-width: 899px) {
  .menu { position: fixed; left: 0; top: 0; z-index: 30; transform: translateX(-100%); transition: transform .2s ease; }
  .menu.aberto { transform: none; }
  .fundo-menu { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 20; }
  .so-celular { display: inline-flex; }
  .topo { padding: 12px 16px 10px; }
  .topo-data { display: none; }
  .conteudo { padding: 16px 16px 40px; }
}

/* ---------- blocos ---------- */
.cartao { background: var(--card); border: 1px solid #21252e; border-radius: var(--raio); padding: 18px; }
.ola { margin: 0 0 4px; font-size: 22px; }
.ola-sub { color: var(--muted); margin: 0 0 20px; font-size: 13.5px; }
.grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 14px; }
.modulo { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; min-height: 132px;
  transition: border-color .14s ease, transform .14s ease; }
.modulo:hover { border-color: rgba(232,84,46,.45); transform: translateY(-1px); }
.modulo-topo { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.modulo-topo svg { color: var(--accent); flex: none; }
.modulo p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.etiqueta { align-self: flex-start; margin-top: auto; font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 7px;
  background: rgba(255,255,255,.07); color: var(--muted); }
.etiqueta.pronto { background: rgba(53,194,106,.14); color: var(--green); }
.etiqueta.fase { background: rgba(74,163,255,.12); color: #8cc4ff; }
.secao-titulo { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 26px 2px 10px; }

.vazio { text-align: center; padding: 40px 18px; }
.vazio svg { color: var(--muted); margin-bottom: 10px; }
.vazio h2 { margin: 0 0 8px; font-size: 18px; }
.vazio p { margin: 0 auto; color: var(--muted); max-width: 520px; line-height: 1.5; font-size: 14px; }
.vazio ul { text-align: left; max-width: 520px; margin: 16px auto 0; color: var(--muted); font-size: 13.5px; line-height: 1.7; padding-left: 20px; }

.carregando { position: fixed; inset: 0; display: grid; place-items: center; color: var(--muted); background: var(--bg); z-index: 50; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1f2430; color: var(--text);
  border: 1px solid #2f3542; padding: 12px 16px; border-radius: 12px; font-size: 14px; z-index: 60; max-width: calc(100% - 32px); }
.toast.erro { border-color: rgba(232,84,46,.5); color: #ffb3a1; }

/* ---------- comuns ---------- */
.abas { display: flex; gap: 6px; background: var(--card2); padding: 4px; border-radius: 12px; margin-bottom: 16px; max-width: 560px; overflow-x: auto; }
.abas button { flex: 1; border: none; background: none; color: var(--muted); padding: 10px 12px; border-radius: 9px; font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.abas button.on { background: var(--accent); color: #fff; }
.botao.mini { padding: 7px 11px; font-size: 12.5px; border-radius: 9px; }
.botao.mini.primario { width: auto; }
.botao.ok { background: rgba(53,194,106,.18); color: var(--green); }
.botao.perigo { background: rgba(232,84,46,.14); color: #ff9d85; margin-right: auto; }
.botao-link { border: none; background: none; color: var(--accent-2); font-weight: 700; font-size: 13px; padding: 4px 6px; }
.sub { font-size: 12.5px; color: var(--muted); line-height: 1.45; margin: 4px 0 0; }
.spinner-linha { color: var(--muted); padding: 30px 0; text-align: center; }
textarea { resize: vertical; }

.modal-fundo { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 40; display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--card); border: 1px solid #2a2f3a; border-radius: 18px; padding: 20px; }
.modal h3 { margin: 0 0 16px; font-size: 17px; }
.modal-botoes { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.modal-botoes .botao.primario { width: auto; }
.dois { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dois > * { min-width: 0; }

/* ---------- equipe ---------- */
.eq-barra { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.eq-semana { display: flex; align-items: center; gap: 6px; font-size: 15px; flex-wrap: wrap; }
.eq-semana .botao-icone { font-size: 24px; line-height: 1; padding: 2px 10px; border-radius: 9px; background: var(--card2); }
.eq-acoes { display: flex; gap: 8px; flex-wrap: wrap; }
.eq-acoes .botao { padding: 10px 14px; font-size: 13.5px; }
.eq-acoes .botao.primario { width: auto; }
.eq-legenda { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin: 4px 0 12px; }
.eq-legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.cor-cozinha { background: #e8542e; } .cor-salao { background: #4aa3ff; } .cor-motoboy { background: #b06bff; }
.cor-falta { background: #ffb020; } .cor-fds { background: #35c26a; }
.eq-quadro { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.eq-dia { background: var(--card); border: 1px solid #21252e; border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.eq-dia.fds { border-top: 3px solid rgba(53,194,106,.7); }
.eq-dia.hoje { border-color: rgba(232,84,46,.6); box-shadow: 0 0 0 1px rgba(232,84,46,.25) inset; }
.eq-dia-topo { display: flex; justify-content: space-between; align-items: flex-start; }
.eq-dia-topo span { display: block; font-size: 12px; color: var(--muted); font-weight: 700; }
.eq-dia-topo strong { font-size: 22px; }
.eq-dia-topo em { font-style: normal; font-size: 9.5px; font-weight: 800; letter-spacing: .06em; color: var(--muted); }
.eq-dia.hoje .eq-dia-topo em { color: var(--accent); }
.eq-setor h4 { margin: 0 0 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; justify-content: space-between; }
.eq-setor { border-left: 3px solid #e8542e; padding-left: 7px; }
.eq-setor.s1 { border-left-color: #4aa3ff; } .eq-setor.s2 { border-left-color: #b06bff; }
.eq-pessoa { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; background: var(--card2); border: 1px solid transparent;
  border-radius: 9px; padding: 7px 8px; margin-bottom: 5px; color: var(--text); }
.eq-pessoa:not([disabled]):hover { border-color: rgba(232,84,46,.5); }
.eq-pessoa[disabled] { cursor: default; opacity: 1; }
.eq-pessoa .n { font-weight: 700; font-size: 12.5px; }
.eq-pessoa .f, .eq-pessoa .o { font-size: 11px; color: var(--muted); }
.eq-pessoa .v { font-size: 11px; color: var(--green); font-weight: 700; }
.eq-pessoa .t { font-size: 11px; color: var(--yellow); font-weight: 700; }
.eq-pessoa.falta { background: rgba(255,176,32,.10); border-color: rgba(255,176,32,.35); }
.eq-pessoa.falta .n { text-decoration: line-through; }
.eq-mais { width: 100%; border: 1px dashed #343a46; background: none; color: var(--muted); border-radius: 9px; padding: 6px; font-size: 11.5px; font-weight: 700; }
.eq-mais:hover { color: var(--text); border-color: var(--accent); }
.eq-vazio { font-size: 12px; color: #6c7280; margin: 0 0 4px; }
.eq-folga { font-size: 11.5px; color: var(--muted); background: rgba(255,255,255,.04); border-radius: 8px; padding: 6px 8px; }
.eq-folga b { color: var(--text); }
.eq-resumo { margin-top: auto; padding-top: 8px; border-top: 1px solid #262b36; font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.eq-resumo strong { color: var(--text); font-size: 12.5px; }
.eq-resumo small { color: var(--muted); font-weight: 400; margin-left: 4px; }
.eq-rodape { font-size: 12px; color: var(--muted); }
.eq-escolha { display: flex; gap: 18px; margin-bottom: 12px; }
.eq-escolha label, .eq-dias label, .eq-check { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-size: 14px; margin: 0; }
.eq-escolha input, .eq-dias input, .eq-check input { width: auto; margin: 0; }
.eq-dias { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 14px; }
.eq-check { margin: 4px 0 10px; }
.eq-duas { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 14px; align-items: start; }
.eq-duas h3 { margin: 0 0 12px; font-size: 16px; }
.eq-cab { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.eq-cab h3 { margin: 0; }
.eq-cab span { font-size: 12px; color: var(--muted); }
.eq-item { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid #21252e; font-size: 13.5px; }
.eq-item:last-of-type { border-bottom: none; }
.eq-item-acoes { display: flex; gap: 6px; align-items: flex-start; flex: none; }
.etq { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 7px; text-transform: uppercase; letter-spacing: .03em; background: rgba(255,255,255,.07); color: var(--muted); align-self: flex-start; }
.etq.pendente { background: rgba(255,176,32,.14); color: var(--yellow); }
.etq.aprovado { background: rgba(53,194,106,.14); color: var(--green); }
.etq.recusado { background: rgba(232,84,46,.14); color: #ff9d85; }
.eq-ficha { display: flex; flex-direction: column; gap: 4px; text-align: left; color: var(--text); cursor: pointer; }
.eq-ficha:hover { border-color: rgba(232,84,46,.45); }
.eq-ficha b { font-size: 15px; }
.eq-ficha span { font-size: 12.5px; color: var(--muted); }
.eq-ficha .v { color: var(--text); font-weight: 600; }
.eq-ficha.inativo { opacity: .55; }

@media (max-width: 899px) {
  .eq-quadro { grid-template-columns: 1fr; overflow: visible; }
  .eq-pessoa { flex-direction: row; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
  .dois { grid-template-columns: 1fr; gap: 0; }
}

/* ---------- impressão da escala ---------- */
#areaImpressao { display: none; }
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff !important; color: #000 !important; }
  body > *:not(#areaImpressao) { display: none !important; }
  #areaImpressao { display: block !important; }
  .folha-imprimir { font-family: Arial, sans-serif; color: #000; }
  .folha-imprimir h2 { font-size: 16px; margin: 0 0 8px; }
  .folha-imprimir table { width: 100%; border-collapse: collapse; font-size: 11px; }
  .folha-imprimir th, .folha-imprimir td { border: 1px solid #999; padding: 4px 5px; vertical-align: top; text-align: left; }
  .folha-imprimir thead th { background: #eee; }
  .folha-imprimir tr.folgas td { background: #f6f6f6; }
  .folha-imprimir p { font-size: 9px; color: #555; }
}
