:root {
  --bg: #f4f5f9;
  --superficie: #ffffff;
  --borda: #e4e6ef;
  --texto: #1c1e2b;
  --texto-suave: #6b7089;
  --primaria: #6366f1;
  --primaria-escura: #4f46e5;
  --sucesso: #10b981;
  --aviso: #f59e0b;
  --erro: #ef4444;
  --info: #3b82f6;
  --sombra: 0 1px 3px rgba(20, 20, 40, 0.06), 0 1px 2px rgba(20, 20, 40, 0.04);
  --raio: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--texto);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--primaria-escura); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0 0 .5em 0; line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; color: var(--texto-suave); text-transform: uppercase; letter-spacing: .03em; font-weight: 600; }

.topbar { background: var(--superficie); border-bottom: 1px solid var(--borda); position: sticky; top: 0; z-index: 10; }
.topbar-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 24px; padding: 12px 20px; }
.marca { font-weight: 700; font-size: 1.05rem; color: var(--texto); }
.nav-principal { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav-principal a { padding: 8px 12px; border-radius: 8px; color: var(--texto-suave); font-weight: 500; }
.nav-principal a:hover { background: var(--bg); text-decoration: none; }
.nav-principal a.ativo { background: var(--primaria); color: white; }
.topbar-user { display: flex; align-items: center; gap: 10px; color: var(--texto-suave); }

.conteudo { max-width: 1200px; margin: 0 auto; padding: 24px 20px 60px; }

.cartao { background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio); padding: 20px; box-shadow: var(--sombra); }
.grade { display: grid; gap: 16px; }
.grade-stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grade-2 { grid-template-columns: 2fr 1fr; }
@media (max-width: 900px) { .grade-2 { grid-template-columns: 1fr; } }

.stat { text-align: left; }
.stat .valor { font-size: 1.9rem; font-weight: 700; }
.stat .rotulo { color: var(--texto-suave); font-size: .85rem; }

.botao {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  padding: 9px 16px; border-radius: 8px; border: 1px solid transparent;
  background: var(--primaria); color: white; font-weight: 600; cursor: pointer;
  font-size: .9rem;
}
.botao:hover { background: var(--primaria-escura); text-decoration: none; }
.botao-fantasma { background: transparent; color: var(--texto-suave); border-color: var(--borda); }
.botao-fantasma:hover { background: var(--bg); color: var(--texto); }
.botao-perigo { background: var(--erro); }
.botao-perigo:hover { background: #d73a3a; }
.botao-pequeno { padding: 5px 10px; font-size: .8rem; }

form.linha { display: flex; gap: 8px; align-items: center; }

label { display: block; font-weight: 600; margin-bottom: 4px; font-size: .85rem; }
input, select, textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--borda); border-radius: 8px;
  font-size: .9rem; font-family: inherit; background: var(--superficie); color: var(--texto);
}
textarea { resize: vertical; min-height: 70px; }
.campo { margin-bottom: 16px; }
.campo-ajuda { color: var(--texto-suave); font-size: .78rem; margin-top: 4px; }
fieldset { border: 1px solid var(--borda); border-radius: var(--raio); padding: 16px; margin: 0 0 16px; }
legend { padding: 0 6px; font-weight: 700; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--borda); vertical-align: top; }
th { color: var(--texto-suave); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
tr:hover td { background: #fafafe; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge-armazenado { background: #eef1f6; color: #4b5468; }
.badge-fila { background: #eef0ff; color: var(--primaria-escura); }
.badge-processando { background: #fff6e0; color: #b7791f; }
.badge-concluido { background: #e3faf0; color: #067a55; }
.badge-erro { background: #fde8e8; color: #b42318; }

.barra-progresso { background: var(--bg); border-radius: 999px; height: 8px; overflow: hidden; }
.barra-progresso > div { background: var(--primaria); height: 100%; transition: width .3s; }

.pill-cor { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }

.turno { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--borda); }
.turno .marcador { width: 4px; border-radius: 4px; flex-shrink: 0; }
.turno .conteudo-turno { flex: 1; }
.turno .cabecalho-turno { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; font-size: .82rem; color: var(--texto-suave); }
.turno .cabecalho-turno .falante { color: var(--texto); font-weight: 700; }
.turno .texto-turno { white-space: pre-wrap; }
.turno.baixa-confianca { background: #fffaf0; margin: 0 -12px; padding: 12px; border-radius: 8px; }
.aviso-confianca { color: #b7791f; font-weight: 600; font-size: .78rem; }
.tempo-link { cursor: pointer; font-variant-numeric: tabular-nums; color: var(--primaria-escura); }
.clicavel-audio { cursor: pointer; }
.clicavel-audio:hover { background: var(--bg); border-radius: 6px; }

.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border-radius: 999px; padding: 4px 10px; font-size: .8rem; margin: 2px; }

.lista-simples { list-style: none; padding: 0; margin: 0; }
.lista-simples li { padding: 10px 0; border-bottom: 1px solid var(--borda); }
.lista-simples li:last-child { border-bottom: none; }

.mensagem-erro { background: #fde8e8; color: #b42318; padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-weight: 600; }
.mensagem-vazia { color: var(--texto-suave); padding: 30px; text-align: center; }

.barra-cat { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.barra-cat .trilha { flex: 1; background: var(--bg); border-radius: 999px; height: 10px; overflow: hidden; }
.barra-cat .trilha > div { height: 100%; border-radius: 999px; }
.barra-cat .rotulo-cat { width: 140px; font-size: .85rem; }
.barra-cat .valor-cat { width: 30px; text-align: right; font-size: .85rem; color: var(--texto-suave); }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-caixa { width: 100%; max-width: 360px; }
.login-caixa h1 { text-align: center; margin-bottom: 24px; }

.oculto { display: none !important; }
.rodape-acoes { display: flex; gap: 8px; margin-top: 16px; }
.subtitulo { color: var(--texto-suave); margin-bottom: 20px; }
audio { width: 100%; }
