:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #171a1f;
  --muted: #5f6672;
  --line: #e2e5ea;
  --accent: #2f6fed;
  --accent-text: #ffffff;
  --ok-bg: #e5f6ec; --ok: #136c3a;
  --bad-bg: #fde8e8; --bad: #a3231f;
  --warn-bg: #fff4dc; --warn: #8a5a00;
  --chip-bg: #eef0f4;
  --radius: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115; --card: #181b21; --text: #e8eaee; --muted: #9aa1ad; --line: #2a2f38;
    --accent: #5b8cff; --accent-text: #0b0d11;
    --ok-bg: #12301f; --ok: #6fd99b; --bad-bg: #3a1615; --bad: #ff8f8a; --warn-bg: #352708; --warn: #f3c463;
    --chip-bg: #232731;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 1.4rem; margin: 0 0 4px; }
h2 { font-size: 1.1rem; margin: 24px 0 10px; }
h3 { font-size: 1rem; margin: 0; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

.topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; z-index: 5; }
.marca { font-weight: 700; color: var(--text); font-size: 1.05rem; }
.status-maquinas { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; font-size: .8rem; }
.ponto { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; background: var(--muted); }
.ponto.on { background: #22a35a; }

main { max-width: 920px; margin: 0 auto; padding: 20px 16px 80px; }
.cabecalho { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.voltar { display: inline-block; margin-bottom: 8px; font-size: .9rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.lista-projetos { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.lista-projetos a.card { color: var(--text); display: block; }
.lista-projetos a.card:hover { border-color: var(--accent); }

button, .botao { font: inherit; border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 8px 14px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
button:hover, .botao:hover { border-color: var(--accent); }
button.primario, .botao.primario { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
button.perigo { color: var(--bad); }
button.mini { padding: 4px 10px; font-size: .85rem; }
button:disabled { opacity: .5; cursor: default; }
.acoes { display: flex; gap: 8px; flex-wrap: wrap; }

input, textarea, select { font: inherit; width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); }
textarea { min-height: 120px; resize: vertical; }
label { display: block; font-weight: 600; font-size: .9rem; margin: 12px 0 4px; }
.dica { font-weight: 400; color: var(--muted); font-size: .82rem; }

.abas { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.abas button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 10px 12px; color: var(--muted); white-space: nowrap; }
.abas button.ativa { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px 16px; text-align: center; background: var(--card); cursor: pointer; }
.drop.sobre { border-color: var(--accent); background: var(--chip-bg); }
.drop strong { display: block; margin-bottom: 4px; }
.arquivos-sel { margin: 10px 0 0; padding: 0; list-style: none; font-size: .85rem; color: var(--muted); text-align: left; }

.chip { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--chip-bg); color: var(--muted); white-space: nowrap; }
.chip.dentro, .chip.pronto, .chip.transcrito, .chip.feita { background: var(--ok-bg); color: var(--ok); }
.chip.fora, .chip.erro, .chip.alta { background: var(--bad-bg); color: var(--bad); }
.chip.avaliar, .chip.transcrevendo, .chip.extraindo, .chip.media { background: var(--warn-bg); color: var(--warn); }

.demanda { border-left: 4px solid var(--line); }
.demanda.dentro { border-left-color: var(--ok); }
.demanda.fora { border-left-color: var(--bad); }
.demanda.avaliar { border-left-color: var(--warn); }
.demanda.feita, .demanda.descartada { opacity: .6; }
.demanda-topo { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }
.demanda ul { margin: 4px 0 8px; padding-left: 20px; }
.origem { font-size: .85rem; color: var(--muted); border-left: 2px solid var(--line); padding-left: 10px; margin: 6px 0; }
.origem b { color: var(--text); font-weight: 600; }
details summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.justificativa { font-size: .85rem; color: var(--muted); }

.filtros { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filtros select { width: auto; }

.audio-linha { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.audio-linha:last-child { border-bottom: 0; }
.transcricao { white-space: pre-wrap; font-size: .9rem; background: var(--bg); border-radius: 8px; padding: 10px; margin-top: 8px; max-height: 360px; overflow: auto; }
.seg-tempo { color: var(--accent); font-variant-numeric: tabular-nums; margin-right: 6px; }

.progresso { height: 6px; background: var(--chip-bg); border-radius: 99px; overflow: hidden; margin: 8px 0; }
.progresso > div { height: 100%; background: var(--accent); transition: width .3s; }

.aviso { padding: 12px 14px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); margin-bottom: 12px; font-size: .9rem; }
.aviso.erro { background: var(--bad-bg); color: var(--bad); }

.login { max-width: 360px; margin: 12vh auto 0; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: .9rem; z-index: 20; max-width: calc(100% - 32px); }

@media (max-width: 560px) {
  .demanda-topo { flex-direction: column; }
  h1 { font-size: 1.2rem; }
}
