:root {
  --bg: #f4f5f7;
  --card-bg: #ffffff;
  --text: #1c1f26;
  --text-muted: #5b6270;
  --border: #e2e4e9;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success-bg: #e7f7ec;
  --success-text: #1a7f43;
  --error-bg: #fdecec;
  --error-text: #b3261e;
  --pending-bg: #fff6e0;
  --pending-text: #8a6100;
  --running-bg: #e8eefe;
  --running-text: #2350c9;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161b;
    --card-bg: #1c1f26;
    --text: #edeef1;
    --text-muted: #9aa0ac;
    --border: #2b2f38;
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --success-bg: #123420;
    --success-text: #4ade80;
    --error-bg: #3a1414;
    --error-text: #f87171;
    --pending-bg: #3a2f0d;
    --pending-text: #fbbf24;
    --running-bg: #10213f;
    --running-text: #93c5fd;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

header h1 {
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
}

.subtitle {
  color: var(--text-muted);
  margin-top: 0;
  line-height: 1.5;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.campo {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
  flex: 1;
}

.linha {
  display: flex;
  gap: 1rem;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

input {
  font-size: 1rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}

input:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

button {
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  border: none;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
}

button:hover {
  background: var(--primary-hover);
}

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

.mensagem {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.mensagem.sucesso {
  color: var(--success-text);
}

.mensagem.erro {
  color: var(--error-text);
}

.lista-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.lista-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge.pendente {
  background: var(--pending-bg);
  color: var(--pending-text);
}

.badge.executando {
  background: var(--running-bg);
  color: var(--running-text);
}

.badge.concluido {
  background: var(--success-bg);
  color: var(--success-text);
}

.badge.erro {
  background: var(--error-bg);
  color: var(--error-text);
}

.badge.cancelado {
  background: var(--border);
  color: var(--text-muted);
}

.link-cancelar {
  color: var(--error-text);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
  text-decoration: underline;
}

@media (max-width: 480px) {
  .linha {
    flex-direction: column;
  }
}
