:root {
  --fundo: #f4f5f7; --cartao: #ffffff; --texto: #1c2230; --suave: #667085; --borda: #e2e5ea;
  --marca: #4f46e5; --marca-2: #eef0ff; --ok: #12805c; --ok-2: #e6f6ef; --alerta: #b54708; --alerta-2: #fff4e5;
  --erro: #c0262d; --erro-2: #fdecec; --raio: 12px; --sombra: 0 1px 2px rgba(16, 24, 40, .06);
}
@media (prefers-color-scheme: dark) {
  :root { --fundo: #0f1217; --cartao: #171b22; --texto: #e7e9ee; --suave: #9aa3b2; --borda: #2a303b;
    --marca: #8b85ff; --marca-2: #23224a; --ok: #3ccf91; --ok-2: #12301f; --alerta: #f4a543; --alerta-2: #3a2a12;
    --erro: #ff6b6b; --erro-2: #3a1717; --sombra: none; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fundo); color: var(--texto); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { overflow-x: hidden; }
a { color: var(--marca); }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 20px; margin: 0 0 12px; }
h2 { font-size: 16px; margin: 0 0 10px; }
.suave { color: var(--suave); font-size: 13px; }
.topo { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--cartao); border-bottom: 1px solid var(--borda); }
.topo .marca { font-weight: 700; white-space: nowrap; }
.topo .marca b { color: var(--marca); }
.topo select { max-width: 46vw; }
.topo .espaco { flex: 1; }
.conteudo { max-width: 980px; margin: 0 auto; padding: 16px 16px 96px; }
.abas { position: fixed; bottom: 0; left: 0; right: 0; z-index: 6; display: flex; background: var(--cartao); border-top: 1px solid var(--borda); padding-bottom: env(safe-area-inset-bottom); }
.abas a { flex: 1; text-align: center; padding: 8px 2px 9px; font-size: 11px; color: var(--suave); text-decoration: none; }
.abas a span { display: block; font-size: 19px; line-height: 1.2; }
.abas a.ativa { color: var(--marca); font-weight: 600; }
@media (min-width: 900px) {
  .abas { top: 57px; bottom: 0; right: auto; width: 150px; flex-direction: column; border-top: 0; border-right: 1px solid var(--borda); }
  .abas a { flex: 0; display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-size: 14px; text-align: left; }
  .abas a span { font-size: 18px; }
  .conteudo { padding-left: 166px; padding-bottom: 32px; max-width: 1146px; }
}
.cartao { background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio); padding: 14px; margin-bottom: 12px; box-shadow: var(--sombra); }
.linha { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.linha > .cresce { flex: 1; min-width: 0; }
.grade-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
label.campo { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--suave); }
input, select, textarea { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--borda); border-radius: 10px; background: var(--cartao); }
textarea { min-height: 90px; resize: vertical; }
input[type=checkbox], input[type=range] { width: auto; min-height: 0; }
.botao { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--borda); background: var(--cartao); cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--texto); }
.botao.primario { background: var(--marca); border-color: var(--marca); color: #fff; }
.botao.perigo { color: var(--erro); }
.botao.pequeno { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.botao:disabled { opacity: .5; cursor: default; }
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--borda); }
.lista li:last-child { border-bottom: 0; }
.lista .nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lista .nome small { display: block; color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.selo { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; background: var(--marca-2); color: var(--marca); white-space: nowrap; }
.selo.ok { background: var(--ok-2); color: var(--ok); }
.selo.alerta { background: var(--alerta-2); color: var(--alerta); }
.selo.erro { background: var(--erro-2); color: var(--erro); }
.vazio { text-align: center; color: var(--suave); padding: 24px 8px; }
.subabas { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; scrollbar-width: none; }
.subabas::-webkit-scrollbar { display: none; }
.subabas button { flex: 0 0 auto; border: 1px solid var(--borda); background: var(--cartao); border-radius: 99px; padding: 6px 14px; cursor: pointer; }
.subabas button.ativa { background: var(--marca); border-color: var(--marca); color: #fff; }
.aviso { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 20; max-width: calc(100vw - 32px); background: var(--texto); color: var(--fundo); padding: 10px 16px; border-radius: 10px; font-size: 14px; }
.aviso.erro { background: var(--erro); color: #fff; }
.modal-fundo { position: fixed; inset: 0; z-index: 15; background: rgba(0, 0, 0, .45); display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--cartao); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 16px 16px 0 0; padding: 16px; }
@media (min-width: 640px) { .modal-fundo { align-items: center; } .modal { border-radius: 16px; } }
.modal .acoes { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.tabela-grade { overflow-x: auto; }
.tabela-grade table { border-collapse: collapse; font-size: 12px; min-width: 640px; width: 100%; }
.tabela-grade th, .tabela-grade td { border: 1px solid var(--borda); padding: 0; text-align: center; }
.tabela-grade th { padding: 4px; background: var(--fundo); position: sticky; left: 0; }
.tabela-grade td button { width: 100%; min-height: 30px; border: 0; background: transparent; cursor: pointer; font-size: 11px; padding: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 90px; }
.tabela-grade td.marcada { outline: 2px solid var(--marca); outline-offset: -2px; }
.item-relogio { display: flex; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--borda); }
.item-relogio select { flex: 1; min-width: 0; }
.item-relogio input { width: 64px; }
.progresso { height: 6px; background: var(--borda); border-radius: 99px; overflow: hidden; }
.progresso div { height: 100%; background: var(--marca); width: 0; transition: width .2s; }
.login { max-width: 360px; margin: 12vh auto; padding: 16px; }
.cor-musica { color: var(--marca); } .cor-voz { color: var(--alerta); }
code { font-size: 12px; word-break: break-all; }
