:root {
  --fundo: #f4f6f5;
  --cartao: #ffffff;
  --texto: #1d2724;
  --sutil: #5f6d68;
  --borda: #dde3e0;
  --marca: #1f6b4f;
  --marca-escura: #164d39;
  --perigo: #b3261e;
  --raio: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fundo: #121715;
    --cartao: #1b2220;
    --texto: #e6ece9;
    --sutil: #9aa8a3;
    --borda: #2c3633;
    --marca: #3fa37b;
    --marca-escura: #2f8763;
    --perigo: #f2867e;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fundo);
  color: var(--texto);
}
h1, h2, h3 { margin: 0 0 .6rem; line-height: 1.25; }
h2 { font-size: 1.15rem; }
h3 { font-size: .95rem; margin-top: 1.2rem; color: var(--sutil); text-transform: uppercase; letter-spacing: .04em; }

.topo {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem 1rem; background: var(--cartao); border-bottom: 1px solid var(--borda);
}
.marca { display: flex; align-items: center; gap: .6rem; }
.marca small { display: block; color: var(--sutil); font-size: .8rem; }
.logo {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px;
  background: var(--marca); color: #fff; font-weight: 700;
}
.topo-dir { display: flex; align-items: center; gap: .8rem; font-size: .9rem; }
.executor { color: var(--sutil); cursor: help; }
.executor.online { color: #2e9d62; }
.executor.offline { color: var(--perigo); }

.central { display: grid; place-items: center; padding: 3rem 1rem; }
.grade {
  display: grid; gap: 1rem; padding: 1rem; max-width: 1200px; margin: 0 auto;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
}
@media (max-width: 820px) { .grade { grid-template-columns: minmax(0, 1fr); } }

.cartao {
  background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio);
  padding: 1.2rem; min-width: 0;
}
.login { width: 100%; max-width: 380px; }

form { display: grid; gap: .8rem; }
label { display: grid; gap: .3rem; font-weight: 600; font-size: .9rem; }
.opcional { font-weight: 400; color: var(--sutil); }
input, select, textarea {
  font: inherit; color: inherit; background: var(--fundo);
  border: 1px solid var(--borda); border-radius: 8px; padding: .55rem .65rem; width: 100%;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--marca); outline-offset: 1px; }

button { font: inherit; cursor: pointer; border-radius: 8px; padding: .55rem 1rem; border: 1px solid transparent; }
button:disabled { opacity: .6; cursor: progress; }
.primario { background: var(--marca); color: #fff; font-weight: 600; }
.primario:hover:not(:disabled) { background: var(--marca-escura); }
.perigo { background: transparent; color: var(--perigo); border-color: var(--perigo); }
.link { background: none; color: var(--marca); padding: .2rem .4rem; }

.sutil { color: var(--sutil); font-size: .88rem; margin: 0; }
.aviso { margin: 0; padding: .6rem .75rem; border-radius: 8px; background: var(--fundo); font-size: .9rem; }
.aviso.erro { color: var(--perigo); }

.cab-lista { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-bottom: .6rem; }
.cab-lista select { width: auto; }
.lista { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.lista li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3rem .8rem; align-items: center;
  padding: .7rem .8rem; border: 1px solid var(--borda); border-radius: 8px; cursor: pointer;
}
.lista li:hover { border-color: var(--marca); }
.lista .resumo { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lista .meta { grid-column: 1 / -1; color: var(--sutil); font-size: .82rem; }
.vazio { padding: 1rem 0; text-align: center; }

.selo { font-size: .75rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; white-space: nowrap; }
.selo.aguardando_aprovacao { background: #fff1d6; color: #8a5a00; }
.selo.pendente            { background: #e6eefc; color: #2d4f9e; }
.selo.em_andamento        { background: #e3f4ff; color: #075985; }
.selo.concluido           { background: #dcf3e6; color: #17603b; }
.selo.erro                { background: #fde2e0; color: #9b1c14; }
.selo.recusado            { background: #ececec; color: #555; }

dialog {
  width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  border: 1px solid var(--borda); border-radius: var(--raio); padding: 0;
  background: var(--cartao); color: var(--texto);
}
dialog::backdrop { background: rgb(0 0 0 / .45); }
dialog article { padding: 1.2rem; }
.cab-detalhe { display: flex; justify-content: space-between; gap: 1rem; }
.texto { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.resposta { background: var(--fundo); border-radius: 8px; padding: .8rem; }
.arquivos { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.arquivos a {
  display: inline-block; padding: .35rem .7rem; border: 1px solid var(--borda); border-radius: 8px;
  color: var(--marca); text-decoration: none; font-size: .88rem; overflow-wrap: anywhere;
}
.acoes-admin { display: flex; gap: .6rem; margin-top: 1.2rem; }
