/* Janela de demonstração: copia o visual do app (tema escuro padrão). */
.app {
  --fundo: #0b1120; --lateral: #0d1426; --card: #131c31; --linha: rgba(148,163,184,.18); --txt: #e5e7eb; --mudo: #8a96b3;
  --az: #2563eb; --az2: #60a5fa;
  position: relative; height: 660px; display: flex; overflow: hidden;
  background: var(--fundo); color: var(--txt); font: 14px/1.45 "Inter", system-ui, sans-serif;
}
.app button { font-family: inherit; }
.app .ic { width: 18px; height: 18px; flex: none; }
.app .ic.girada { transform: rotate(180deg); }

/* ----- Menu lateral (computador) ----- */
.app-lateral {
  width: 230px; flex: none; display: flex; flex-direction: column; background: var(--lateral);
  border-right: 1px solid var(--linha); transition: transform .25s, margin .25s; z-index: 6;
}
.lat-logo { display: flex; align-items: center; gap: 8px; padding: 18px 18px 12px; }
.lat-logo svg { width: 30px; height: 30px; }
.lat-logo span { font: 800 22px "Poppins"; color: #F08A24; letter-spacing: -.3px; }
.lat-empresa {
  display: flex; align-items: center; gap: 8px; margin: 0 14px 12px; padding: 9px 12px;
  background: #111a2e; border: 1px solid var(--linha); border-radius: 12px; color: var(--txt); font-weight: 600; font-size: 13px; cursor: pointer; text-align: left;
}
.lat-nav { flex: 1; overflow-y: auto; padding: 8px 10px; border-top: 1px solid var(--linha); scrollbar-width: thin; }
.lat-sec, .lat-item {
  width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; color: #cbd5e1;
  padding: 10px 10px; border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 14px; text-align: left;
}
.lat-sec > svg:first-child { color: #60a5fa; }
.lat-sec span { flex: 1; }
.lat-sec .ic:last-child { width: 14px; height: 14px; opacity: .6; }
.lat-sec:hover, .lat-item:hover { background: rgba(96,165,250,.08); }
.lat-sec.ativo { background: rgba(37,99,235,.18); color: #fff; }
.lat-sub { margin: 2px 0 6px 18px; padding-left: 6px; border-left: 1px solid var(--linha); }
.lat-item { font-weight: 500; font-size: 13.5px; color: var(--mudo); padding: 8px 10px; }
.lat-item.ativo { background: #1b2540; color: #fff; font-weight: 700; box-shadow: inset 3px 0 0 #60a5fa; }
.lat-user { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--linha); }
.lat-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--az); color: #fff; display: grid; place-items: center; font-weight: 800; }
.lat-nome { flex: 1; font-weight: 700; line-height: 1.1; }
.lat-nome small { display: block; font-weight: 500; color: var(--mudo); font-size: 11.5px; }
.lat-user button { background: none; border: 0; color: var(--mudo); cursor: pointer; }

/* ----- Área principal ----- */
.app-principal { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topo {
  display: flex; align-items: center; gap: 14px; margin: 14px 16px 0; padding: 12px 16px; border-radius: 16px;
  background: linear-gradient(110deg, #2563eb, #60a5fa); box-shadow: 0 10px 24px rgba(37,99,235,.3);
}
.topo-menu { width: 40px; height: 40px; border-radius: 12px; border: 0; background: rgba(255,255,255,.18); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.topo-logo { display: none; width: 30px; height: 30px; }
.topo-tit small { display: block; font-size: 11.5px; color: rgba(255,255,255,.85); font-weight: 600; }
.topo-tit strong { font: 700 20px/1.15 "Poppins"; color: #fff; }

.app-conteudo { flex: 1; overflow-y: auto; padding: 14px 16px 24px; scrollbar-width: thin; scrollbar-color: #2a3561 transparent; }
.app-dica {
  background: rgba(240,138,36,.12); border: 1px dashed rgba(240,138,36,.55); color: #ffd4a8;
  padding: 9px 14px; border-radius: 12px; margin-bottom: 14px; font-size: 13px;
}
.app-dica b { color: #fff; }
.app-barra { display: none; }

/* ----- Peças comuns ----- */
.m-card { background: var(--card); border: 1px solid var(--linha); border-radius: 16px; padding: 16px; margin-bottom: 12px; }
.m-card h4 { margin: 0 0 8px; font: 700 15px "Poppins"; color: #fff; }
.card-tit { margin: 0 0 4px; font: 700 17px "Poppins"; color: #60a5fa; }
.mudo { color: var(--mudo); margin: 0 0 10px; font-size: 13px; }
.m-btn-primary, .m-btn-secondary, .m-btn-sucesso, .m-btn-whats {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 11px 16px; cursor: pointer; font-weight: 700; font-size: 14px; color: #fff; transition: filter .15s, transform .1s;
}
.m-btn-primary { background: linear-gradient(110deg, #2563eb, #60a5fa); box-shadow: 0 6px 16px rgba(37,99,235,.3); }
.m-btn-secondary { background: #1a2440; border: 1px solid #2c3a62; }
.m-btn-sucesso { background: linear-gradient(110deg, #16a34a, #15803d); padding: 15px; font-size: 16px; box-shadow: 0 6px 16px rgba(22,163,74,.3); }
.m-btn-whats { background: transparent; border: 1.5px solid #22c55e; color: #4ade80; margin-bottom: 12px; }
.app button:hover:not(:disabled) { filter: brightness(1.1); }
.app button:disabled { opacity: .45; cursor: not-allowed; }
.largo { width: 100%; }
.linha-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.linha-btns.fim { justify-content: flex-end; }
.m-form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.voltar { background: none; border: 0; color: #60a5fa; font-weight: 700; cursor: pointer; padding: 0 0 12px; }
.app-vazio { text-align: center; padding: 28px; color: var(--mudo); background: var(--card); border-radius: 16px; border: 1px dashed var(--linha); }
.app-vazio .m-btn-primary { margin-top: 12px; }
.app-vazio.pequeno { padding: 12px; font-size: 13px; }

/* ----- Dashboard ----- */
.dash-grade { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.dash-card {
  display: flex; gap: 14px; align-items: flex-start; background: var(--card); border: 1px solid var(--linha);
  border-left: 3px solid var(--c); border-radius: 16px; padding: 16px; position: relative; overflow: hidden;
}
.dash-card::before { content: ""; position: absolute; top: 0; left: 18px; right: 18px; height: 3px; background: #3b82f6; border-radius: 0 0 3px 3px; }
.dash-letra { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--c); color: #fff; display: grid; place-items: center; font: 800 16px "Inter"; }
.dash-card strong { display: block; font: 800 22px/1.15 "Inter"; color: #fff; }
.dash-card small { display: block; color: #cbd5e1; font-size: 12.5px; }
.dash-card em { font-style: normal; font-size: 11.5px; color: var(--mudo); }
.dash-parada {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left;
  background: #0f1729; border: 1px solid var(--linha); border-radius: 12px; padding: 10px 12px; margin-top: 8px; color: var(--txt); cursor: pointer;
}
.dash-parada small { display: block; color: var(--mudo); font-size: 12.5px; }

/* ----- Fila ----- */
.fila-abas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; max-width: 520px; }
.fila-abas button { border: 1px solid #2c3a62; background: #111a2e; color: var(--txt); padding: 11px 8px; border-radius: 12px; font-weight: 700; cursor: pointer; }
.fila-abas button.ativo { background: linear-gradient(110deg, #2563eb, #60a5fa); border-color: transparent; box-shadow: 0 6px 16px rgba(37,99,235,.3); }
.fila-resumo { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--mudo); margin: 0 0 10px; }
.fila-resumo strong { color: var(--txt); }
.fila-resumo .paradas { color: #ef4444; font-weight: 700; }
.fila-ordem { display: inline-flex; gap: 6px; margin-bottom: 14px; }
.fila-ordem button { border: 1px solid rgba(148,163,184,.35); background: transparent; color: var(--mudo); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; }
.fila-ordem button.ativo { background: #1e40af; border-color: #1e40af; color: #fff; }
.grupo-tit { font: 700 14px "Poppins"; margin: 14px 0 8px; color: #cbd5e1; }
.grupo-tit span { background: #1a2440; border-radius: 999px; padding: 1px 8px; font-size: 12px; margin-left: 4px; }

.app-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.m-fila-card { background: var(--card); border: 1px solid var(--linha); border-top: 3px solid; border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.borda-alta { border-top-color: #ef4444; }
.borda-media { border-top-color: #f59e0b; }
.borda-baixa { border-top-color: #22c55e; }
.borda-roxo { border-top-color: #8b5cf6; }
.borda-fin { border-top-color: #334155; }
.m-fila-card.novo { animation: novo 1.4s ease; }
@keyframes novo { 0% { transform: scale(.92); box-shadow: 0 0 0 0 rgba(96,165,250,.9); } 40% { transform: scale(1.02); box-shadow: 0 0 0 12px rgba(96,165,250,0); } }
.fc-topo { display: flex; align-items: center; gap: 12px; }
.fc-avatar { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; font: 800 15px "Inter"; color: #fff; background: linear-gradient(140deg, #2563eb, #60a5fa); }
.fc-avatar.roxo { background: linear-gradient(140deg, #6d28d9, #a78bfa); }
.fc-tit { flex: 1; min-width: 0; }
.fc-tit small { display: block; color: #60a5fa; font-weight: 700; font-size: 11.5px; }
.fc-tit strong { display: block; font: 700 16px "Inter"; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crit { padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.crit-alta { background: #dc2626; color: #fff; }
.crit-media { background: #f59e0b; color: #1f1300; }
.crit-baixa { background: #22c55e; color: #052e14; }
.m-fila-selos { display: flex; flex-wrap: wrap; gap: 6px; }
.m-fila-selos:empty { display: none; }
.fila-selo { display: inline-flex; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.fila-selo.perigo { background: #dc2626; color: #fff; }
.fila-selo.alerta { background: rgba(245,158,11,.18); color: #f59e0b; }
.fila-selo.neutro { background: rgba(100,116,139,.2); color: #a5b0c8; }
.fila-selo.atendendo { background: rgba(37,99,235,.2); color: #60a5fa; }
.fila-selo.sucesso { background: rgba(34,197,94,.16); color: #4ade80; }
.fc-def { margin: 0; font-size: 14.5px; }
.fc-info { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--linha); color: var(--mudo); font-size: 12.5px; }
.fc-info span { display: inline-flex; align-items: center; gap: 5px; background: #0f1729; padding: 4px 9px; border-radius: 8px; }
.fc-info .ic { width: 13px; height: 13px; }
.fc-sol { margin: 0; color: #86efac; font-size: 13px; }

/* ----- Formulários ----- */
.app label { display: block; color: var(--mudo); font-weight: 600; font-size: 13px; margin-bottom: 12px; }
.app select, .app textarea {
  display: block; width: 100%; margin-top: 6px; background: #0b1222; border: 1px solid #2c3a62; color: var(--txt);
  border-radius: 10px; padding: 10px 12px; font: inherit; resize: vertical;
}
.form-grade { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; margin-top: 12px; }
.form-grade .cheio { grid-column: 1 / -1; }
.rotulo { display: block; color: var(--mudo); font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.segmento { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.seg { margin: 0 !important; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span, .seg-btn {
  display: inline-block; min-width: 90px; text-align: center; border: 1px solid #2c3a62; background: #111a2e; color: #cbd5e1;
  padding: 9px 14px; border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 13px;
}
.seg input:checked + span, .seg-btn.ativo { background: #2563eb; border-color: #2563eb; color: #fff; }
.seg.crit-alta input:checked + span { background: #dc2626; border-color: #dc2626; }
.seg.crit-media input:checked + span { background: #f59e0b; border-color: #f59e0b; color: #1f1300; }
.seg.crit-baixa input:checked + span { background: #22c55e; border-color: #22c55e; color: #052e14; }
.seg input:focus-visible + span { outline: 2px solid #60a5fa; }
.seg.crit-alta, .seg.crit-media, .seg.crit-baixa { background: none; padding: 0; }

/* ----- Atendimento ----- */
.dados { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.dados div { background: #0f1729; border-radius: 10px; padding: 8px 10px; font-weight: 600; font-size: 13px; }
.dados small { display: block; color: var(--mudo); font-weight: 500; font-size: 11.5px; }
.cron { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #0f1a3d; border-color: #24357a; }
.cron small { color: var(--mudo); display: block; }
.cron strong { font: 800 36px/1.1 "Inter"; color: #fff; font-variant-numeric: tabular-nums; }
.cron em { display: block; font-style: normal; font-size: 11.5px; color: #7c89b3; }
.hist { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13px; }
.linha-add { display: flex; gap: 8px; align-items: stretch; }
.linha-add select { margin: 0; flex: 1; min-width: 0; }
.pecas { list-style: none; padding: 0; margin: 10px 0 14px; }
.pecas li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--linha); }
.pecas li span { flex: 1; }
.pecas li button { background: none; border: 0; color: #f87171; font-size: 18px; cursor: pointer; }
.pecas li.total { border: 0; color: #fdba74; }
.linha-add + .mudo { margin: 8px 0 14px; }

/* ----- Preventivas ----- */
.barra { height: 7px; border-radius: 999px; background: #0f1729; overflow: hidden; }
.barra i { display: block; height: 100%; background: linear-gradient(90deg, #8b5cf6, #c4b5fd); transition: width .4s; }
.check { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; }
.check li { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: #0f1729; }
.check li.ok { background: rgba(22,163,74,.14); }
.check li.reprovado { background: rgba(220,38,38,.16); }
.check-btns { display: flex; gap: 6px; }
.check-btns button { border: 1px solid #2f8f55; background: transparent; color: #86efac; border-radius: 9px; padding: 6px 10px; cursor: pointer; font-weight: 700; font-size: 12.5px; }
.check-btns button.rep { border-color: #a33; color: #fca5a5; }
.check-btns button.ativo { background: #16a34a; color: #fff; border-color: #16a34a; }
.check-btns button.rep.ativo { background: #dc2626; border-color: #dc2626; }

/* ----- KPIs ----- */
.barras { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.barras li { display: grid; grid-template-columns: 150px 1fr 100px; align-items: center; gap: 10px; font-size: 13px; }
.barras li div { height: 12px; background: #0f1729; border-radius: 999px; overflow: hidden; }
.barras li i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #2563eb, #60a5fa); }
.barras li b { text-align: right; }

/* ----- Celular: barra de baixo e menu por cima, como no app ----- */
@media (max-width: 860px) {
  .app { height: 640px; }
  .app-lateral { position: absolute; top: 0; bottom: 0; left: 0; transform: translateX(-100%); box-shadow: 10px 0 30px rgba(0,0,0,.5); }
  .app-lateral.aberto { transform: none; }
  .app-veu { position: absolute; inset: 0; background: rgba(0,0,0,.5); z-index: 5; }
  .app-topo { margin: 0; border-radius: 0 0 20px 20px; padding: 12px 14px; }
  .topo-logo { display: block; order: -1; }
  .topo-menu { order: 2; margin-left: auto; }
  .topo-tit small { display: none; }
  .topo-tit strong { font-size: 18px; }
  .app-conteudo { padding: 12px 12px 20px; }
  .app-barra {
    display: flex; justify-content: space-around; align-items: center; padding: 6px 4px 8px;
    background: #0e1428; border-top: 1px solid var(--linha);
  }
  .barra-item { display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; color: #cbd5e1; font-size: 11px; font-weight: 700; cursor: pointer; padding: 4px 8px; }
  .barra-item.ativo { color: #60a5fa; }
  .barra-mais { width: 52px; height: 52px; margin-top: -26px; border-radius: 50%; border: 0; background: linear-gradient(140deg, #2563eb, #60a5fa); color: #fff; font-size: 26px; cursor: pointer; box-shadow: 0 6px 18px rgba(37,99,235,.5); }
  .dash-grade { grid-template-columns: 1fr 1fr; }
  .dash-card { padding: 12px; gap: 10px; }
  .dash-letra { width: 34px; height: 34px; }
  .dash-card strong { font-size: 18px; }
  .app-lista { grid-template-columns: 1fr; }
  .form-grade { grid-template-columns: 1fr; }
  .dados { grid-template-columns: 1fr 1fr; }
  .barras li { grid-template-columns: 1fr 90px; }
  .barras li div { grid-column: 1 / -1; grid-row: 2; }
  .cron strong { font-size: 28px; }
}
