:root {
  --bg-top: #f6f7f9;
  --bg-bottom: #eef0f3;
  --card: #ffffff;
  --accent: #d94f45;
  --accent-hover: #c4443b;
  --success: #23a06a;
  --success-hover: #1d8a5c;
  --text: #2b2f36;
  --muted: #8a9099;
  --border: #e2e5e9;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

.wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.topbar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 16px;
}

/* Stepper */
.stepper {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin: 0 0 28px;
  padding: 0;
  position: relative;
}

.stepper::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 5%;
  right: 5%;
  height: 1px;
  background: var(--border);
  z-index: 0;
}

.step {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.step-label {
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.step.step-active .step-circle {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.step.step-active .step-label,
.step.step-done .step-label {
  color: var(--accent);
}

.step.step-done .step-circle {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.step-inert { opacity: .55; }

/* Card */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
  padding: 28px 32px;
}

.card-wide { max-width: none; }

.card h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 4px;
}

.subtitle {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 20px;
}

.field-row { margin-bottom: 24px; }

.field-row input[type="date"] {
  font-family: inherit;
  font-size: 14px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  width: 240px;
}

.error-msg {
  background: #fdecea;
  color: #b3261e;
  border: 1px solid #f5c6c3;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin: 0 0 16px;
}

.resultado-msg {
  background: #eafaf1;
  color: #1d8a5c;
  border: 1px solid #bfe8d3;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin: 0 0 16px;
}

.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.actions-end { justify-content: flex-end; }

.btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background-color .15s ease;
}

.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: #f2f3f5; }

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover:not(:disabled) { background: var(--success-hover); }

/* Chips (modalidades) */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  background: #fff;
}

.chip input { accent-color: var(--accent); }

.chip.chip-off {
  color: var(--muted);
  border-color: var(--border);
}

/* Tabela de contatos */
.table-scroll {
  max-height: 60vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  position: sticky;
  top: 0;
  background: #fafbfc;
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.col-check { width: 40px; }

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

tbody tr:last-child td { border-bottom: none; }

tbody tr.row-disabled { color: var(--muted); }

.resumo {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 20px;
}

/* Relatório: resumo por status */
.status-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.status-card {
  flex: 1 1 150px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
}

.status-card .status-count {
  display: block;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.status-card .status-label {
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

.status-card.status-accent .status-count { color: var(--accent); }
.status-card.status-success .status-count { color: var(--success); }
.status-card.status-muted .status-count { color: var(--muted); }

/* Relatório: badge de status na tabela */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-accent { background: rgba(217, 79, 69, .12); color: var(--accent); }
.badge-success { background: rgba(35, 160, 106, .12); color: var(--success); }
.badge-muted { background: rgba(138, 144, 153, .12); color: var(--muted); }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 32px;
  max-width: 420px;
  width: 100%;
}

.modal h2 {
  font-size: 18px;
  margin: 0 0 12px;
}

.modal-note {
  color: var(--muted);
  font-size: 12px;
}

[hidden] { display: none !important; }
