:root {
  --green-900: #0C1F14;
  --green-700: #1F6B3F;
  --green-100: #E6F2EA;
  --gold: #C8912E;
  --text: #1a2420;
  --muted: #6B7A72;
  --line: #dfe6e2;
  --bg: #f6f8f7;
  --danger: #b3261e;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
}
main { max-width: 1180px; margin: 0 auto; padding: 24px 20px 64px; }
h1 { font-size: 26px; margin: 8px 0 20px; }
h2 { font-size: 17px; margin: 0 0 10px; }
/* h2 que abre um card não empurra o topo; entre seções, ele respira. */
:not(h2) + h2 { margin-top: 28px; }
a { color: var(--green-700); }

.topbar {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  background: var(--green-900); color: #fff; padding: 12px 20px;
}
.brand { color: #fff; font-weight: 700; text-decoration: none; font-size: 18px; }
.brand span { color: var(--gold); }
.topbar nav { display: flex; gap: 16px; flex-wrap: wrap; }
.topbar nav a { color: #cfe0d6; text-decoration: none; font-size: 14px; }
.topbar nav a:hover { color: #fff; }
.logout { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.logout span { color: #9fb3a8; font-size: 13px; }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 20px; margin-bottom: 20px;
}
.card.narrow { max-width: 420px; margin: 48px auto; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .row { grid-template-columns: 1fr; } }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.stat .label { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.stat strong { display: block; font-size: 26px; line-height: 1.2; margin-top: 4px; }
.stat small { color: var(--muted); }
/* Cards que também são filtro (tela de reprovados): sem sublinhado de link. */
a.stat { text-decoration: none; color: inherit; transition: border-color .15s; }
a.stat:hover { border-color: var(--green-700); }
a.stat.active { border-color: var(--green-700); box-shadow: inset 0 0 0 1px var(--green-700); }

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
td.actions form { display: inline; }
.small { font-size: 13px; color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

label { display: block; margin-bottom: 12px; font-size: 14px; }
label.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=file], select {
  display: block; width: 100%; margin-top: 4px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 16px; }
/* Switch: checkbox real (acessível e enviado no form) com aparência de toggle. */
.switch { display: flex; align-items: flex-start; gap: 12px; margin: 4px 0 16px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  flex: none; width: 42px; height: 24px; margin-top: 2px; border-radius: 999px;
  background: #cfd8d3; transition: background .15s; position: relative;
}
.switch .thumb {
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: transform .15s;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.switch input:checked + .track { background: var(--green-700); }
.switch input:checked + .track .thumb { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--green-700); outline-offset: 2px; }
.switch-text { font-size: 14px; line-height: 1.4; }
.switch-text small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters input, .filters select { width: auto; margin-top: 0; }
/* Formulário embutido em célula de tabela: campo e botão lado a lado. */
.inline-form { display: flex; gap: 6px; align-items: center; }
.inline-form input { width: auto; min-width: 150px; margin-top: 0; padding: 5px 8px; font-size: 13px; }
.inline-form button { padding: 5px 10px; font-size: 13px; }

button, .button {
  display: inline-block; padding: 8px 14px; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; color: var(--text);
  font: inherit; cursor: pointer; text-decoration: none;
}
button:hover, .button:hover { border-color: var(--green-700); }
button.primary, .button.primary { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.button.disabled { color: var(--muted); border-color: var(--line); background: #f4f6f5; cursor: default; opacity: .6; }

/* Anterior à esquerda, próxima à direita — com espaço entre elas. */
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 16px 0 8px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: #eceeed; color: #444; }
.badge.sent, .badge.done { background: var(--green-100); color: var(--green-700); }
.badge.failed { background: #fde8e6; color: var(--danger); }
.badge.pending, .badge.queued, .badge.uploaded { background: #fdf3e0; color: #8a6516; }
.badge.processing, .badge.running { background: #e6efff; color: #1c4c9c; }
.badge.suppressed, .badge.bounce, .badge.complaint, .badge.user_optout, .badge.manual { background: #efe9f7; color: #5b3b8c; }

.alert { padding: 10px 14px; border-radius: 8px; background: var(--green-100); border: 1px solid #c8e0d3; }
.alert.error { background: #fde8e6; border-color: #f3c7c2; color: var(--danger); }
.alert.warn { background: #fdf3e0; border-color: #eddcb8; color: #8a6516; }
.hint { color: var(--muted); font-size: 13px; }

.progress { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 10px 0; display: none; }
.progress .bar { height: 100%; width: 40%; background: var(--green-700); animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
