/* CRM Open 7 — tema escuro, sem framework (PRD §5, §11).
 * Escuro por ser o que o rodapé da casa espera (o logo é a versão clara,
 * ver /opt/marca-open7/LEIA.md). Sem paleta nova: poucas cores, alto
 * contraste, foco em texto legível numa lista longa. */

:root {
  --fundo: #14181d;
  --fundo-elevado: #1c222a;
  --borda: #2a323c;
  --texto: #e6e9ed;
  --texto-fraco: #9aa4b2;
  --acento: #4f9dde;
  --acento-forte: #6fb3ea;
  --perigo: #e5686b;
  --sucesso: #5cb87a;
  --aviso: #d8a94e;
  --raio: 6px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--fundo);
  color: var(--texto);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--acento-forte);
}

h1,
h2,
h3 {
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.barra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--fundo-elevado);
  border-bottom: 1px solid var(--borda);
  flex-wrap: wrap;
}

.barra nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.barra nav a {
  text-decoration: none;
  color: var(--texto-fraco);
  padding: 0.3rem 0.1rem;
  border-bottom: 2px solid transparent;
}

.barra nav a.atual {
  color: var(--texto);
  border-bottom-color: var(--acento);
}

main {
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem;
}

.cartao {
  background: var(--fundo-elevado);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  padding: 1rem;
  margin-bottom: 1rem;
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--texto-fraco);
  margin-bottom: 0.25rem;
}

input,
select,
textarea,
button {
  font: inherit;
  color: var(--texto);
}

input,
select,
textarea {
  width: 100%;
  background: var(--fundo);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  padding: 0.5rem 0.6rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--acento);
  outline-offset: 1px;
}

.campo {
  margin-bottom: 0.75rem;
}

.linha {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.linha > * {
  flex: 1;
  min-width: 160px;
}

button {
  cursor: pointer;
  background: var(--acento);
  color: #0b1115;
  border: none;
  border-radius: var(--raio);
  padding: 0.55rem 1rem;
  font-weight: 600;
}

button:hover {
  background: var(--acento-forte);
}

button.secundario {
  background: transparent;
  color: var(--texto);
  border: 1px solid var(--borda);
}

button.secundario:hover {
  background: var(--fundo);
}

button.perigo {
  background: var(--perigo);
  color: #200608;
}

.erro {
  color: var(--perigo);
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

.vazio {
  color: var(--texto-fraco);
  font-style: italic;
  padding: 1rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid var(--borda);
  font-size: 0.9rem;
}

th {
  color: var(--texto-fraco);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.tabela-scroll {
  overflow-x: auto;
}

.etiqueta {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid var(--borda);
  color: var(--texto-fraco);
  white-space: nowrap;
}

.lista-simples {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lista-simples li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--borda);
}

.lista-simples li:last-child {
  border-bottom: none;
}

.lista-simples a {
  text-decoration: none;
  color: var(--texto);
  font-weight: 600;
}

.lista-simples .meta {
  color: var(--texto-fraco);
  font-size: 0.85rem;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--borda);
}

.timeline li {
  position: relative;
  padding: 0 0 1rem 1rem;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.35rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--acento);
}

.timeline .data {
  color: var(--texto-fraco);
  font-size: 0.8rem;
}

/* Tela de login: caixa centralizada (PRD §10.1). */
.tela-login {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.caixa-login {
  width: 100%;
  max-width: 340px;
}

.caixa-login h1 {
  text-align: center;
  font-size: 1.3rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 480px) {
  .barra {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Link com cara de botão secundário (ex.: Exportar CSV). */
.acoes {
  margin: 0 0 1rem;
  text-align: right;
}

.botao-link {
  display: inline-block;
  padding: 0.55rem 1rem;
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  color: var(--texto);
  text-decoration: none;
  font-weight: 600;
}

.botao-link:hover {
  background: var(--fundo);
}
