* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Georgia', serif;
  background: #f5f0eb;
  color: #333;
  min-height: 100vh;
}

/* ── HEADER ── */
.app-header {
  background: #2c2c2c;
  color: #d4a96a;
  padding: 16px 20px;
}
.header-content {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.app-header h1 { font-size: 1.3rem; letter-spacing: 1px; }
.app-header p  { font-size: 0.8rem; color: #aaa; margin-top: 2px; }

.btn-log {
  background: transparent;
  border: 1px solid #d4a96a;
  color: #d4a96a;
  padding: 6px 14px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-log:hover { background: rgba(212,169,106,0.15); }

/* ── STEP INDICATOR ── */
.steps-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-bottom: 1px solid #e0d8ce;
  padding: 14px 20px;
  gap: 0;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0.4;
  transition: opacity 0.2s;
}
.step.active, .step.done { opacity: 1; }
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e0d8ce;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: bold;
  font-family: sans-serif;
  transition: background 0.2s, color 0.2s;
}
.step.active .step-num {
  background: #d4a96a;
  color: #fff;
}
.step.done .step-num {
  background: #4caf50;
  color: #fff;
}
.step.done .step-num::before { content: '✓'; }
.step.done .step-num { font-size: 0; }
.step.done .step-num::before { font-size: 0.85rem; }
.step-label {
  font-size: 0.7rem;
  font-family: sans-serif;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.step.active .step-label { color: #d4a96a; font-weight: bold; }
.step.done .step-label   { color: #4caf50; }
.step-line {
  flex: 1;
  height: 2px;
  background: #e0d8ce;
  max-width: 80px;
  margin: 0 6px;
  margin-bottom: 18px;
}

/* ── BODY / SCREENS ── */
.app-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 16px;
}
.hidden { display: none !important; }
.screen.hidden { display: none !important; }
.screen-title {
  font-size: 1.1rem;
  color: #2c2c2c;
  margin-bottom: 20px;
  border-bottom: 2px solid #d4a96a;
  padding-bottom: 8px;
}

/* ── FORM ── */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: bold;
  color: #555;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.field select,
.field input,
.field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  transition: border 0.2s;
}
.field input:focus,
.field textarea:focus,
.field select:focus { outline: none; border-color: #d4a96a; }
.field small { display: block; margin-top: 5px; color: #888; font-size: 0.75rem; }

.codigo-row { display: flex; gap: 10px; }
.codigo-row input { flex: 1; }

/* ── TIPO TOGGLE ── */
.tipo-toggle-topo {
  display: flex;
  gap: 0;
  border: 1px solid #ccc;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 20px;
}
.tipo-btn {
  flex: 1;
  padding: 12px;
  border: none;
  background: #fff;
  color: #888;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.tipo-btn:first-child { border-right: 1px solid #ccc; }
.tipo-btn.active {
  background: #2c2c2c;
  color: #d4a96a;
  font-weight: bold;
}

/* ── FORM SECTIONS ── */
.form-section {
  border: 1px solid #e0d8ce;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  background: #fff;
}
.form-section-interna {
  background: #faf7f3;
  border-color: #d4a96a44;
}
.form-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #aaa;
  font-family: sans-serif;
  font-weight: bold;
  margin-bottom: 14px;
}
.form-section-interna .form-section-title { color: #b8904f; }
.form-section .field:last-child { margin-bottom: 0; }

/* ── GRID 2 COLUNAS ── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── TELEFONE ── */
.telefone-row {
  display: flex;
  gap: 6px;
}
.telefone-row input:first-child  { width: 64px;  flex-shrink: 0; }
.telefone-row input:nth-child(2) { width: 52px;  flex-shrink: 0; }
.telefone-row input:last-child   { flex: 1; }

/* ── BOTÕES ── */
.btn-primario {
  background: #d4a96a;
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-primario:hover  { background: #b8904f; }
.btn-primario:disabled { background: #ccc; cursor: not-allowed; }

.btn-secundario {
  background: #fff;
  color: #555;
  border: 1px solid #ccc;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: border 0.2s;
  white-space: nowrap;
}
.btn-secundario:hover { border-color: #d4a96a; color: #d4a96a; }

.btn-grande {
  width: 100%;
  padding: 16px;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  margin: 16px 0;
}

/* ── STEP 3: AÇÕES ── */
.acoes-principais { margin: 8px 0; }
.btn-acao {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  margin-bottom: 8px;
}
.btn-email { background: #4a7ebf; }
.btn-email:hover { background: #3a6aaa; }

.email-section {
  background: #fff;
  border: 1px solid #e0d8ce;
  border-radius: 8px;
  padding: 18px 20px;
  margin: 16px 0;
  text-align: left;
}
.email-section-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  margin-bottom: 14px;
  font-family: sans-serif;
}
.email-status {
  font-size: 0.9rem;
  padding: 8px 0;
  min-height: 24px;
  text-align: center;
  font-family: sans-serif;
}
.email-status.success { color: #4caf50; }
.email-status.error   { color: #e53935; }

/* ── NAV BUTTONS ── */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  gap: 12px;
}
.nav-buttons-step3 { margin-top: 8px; }

/* ── STATUS BAR ── */
.status-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.status-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f0ebe4;
  border: 1px solid #e0d8ce;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-family: sans-serif;
  color: #aaa;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.status-item.done {
  background: #edf7ed;
  border-color: #4caf50;
  color: #2e7d32;
  font-weight: bold;
}
.status-item.fail {
  background: #fdecea;
  border-color: #e53935;
  color: #c62828;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ccc;
  flex-shrink: 0;
  transition: background 0.3s;
}
.status-item.done .status-dot { background: #4caf50; }
.status-item.fail .status-dot { background: #e53935; }

/* ── STEP 3 ── */
.s3-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 520px) {
  .s3-grid { grid-template-columns: 1fr; }
}
.s3-card {
  background: #fff;
  border: 1px solid #e0d8ce;
  border-radius: 8px;
  padding: 14px 16px;
}
.s3-card-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #aaa;
  font-family: sans-serif;
  font-weight: bold;
  margin-bottom: 10px;
}
.s3-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 0.85rem;
  padding: 4px 0;
  border-bottom: 1px solid #f5f0eb;
}
.s3-row:last-of-type { border-bottom: none; }
.s3-row span { color: #888; white-space: nowrap; }
.s3-row strong { color: #2c2c2c; text-align: right; }
.s3-zoho-status {
  font-size: 0.75rem;
  margin-top: 8px;
  font-family: sans-serif;
  min-height: 16px;
}

/* ── VOUCHER ── */
.voucher {
  background: #fff;
  border: 1px solid #e0d8ce;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  font-family: 'Georgia', serif;
  width: 100%;
  display: flex;
  flex-direction: column;
}
.voucher-header-img {
  width: 100%;
  display: block;
  flex-shrink: 0;
  max-height: 18%;
  object-fit: cover;
}
.voucher-footer-img {
  width: 100%;
  flex-shrink: 0;
  height: 80px;
  background-image: url('public/images/footer.png');
  background-size: cover;
  background-position: top center;
}
.voucher-body {
  padding: 12px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.voucher-parabens {
  font-size: 1.5rem;
  color: #2c2c2c;
  letter-spacing: 3px;
}
.voucher-subtitulo {
  font-size: 0.78rem;
  color: #666;
  font-style: italic;
  margin-top: -4px;
}
.voucher-campos {
  text-align: left;
  background: #faf7f3;
  border-radius: 6px;
  padding: 10px 20px;
  border: 1px solid #ede6da;
}
.voucher-linha { margin-bottom: 6px; font-size: 0.78rem; line-height: 1.4; }
.voucher-linha:last-child { margin-bottom: 0; }
.voucher-inline { display: flex; align-items: baseline; gap: 4px; }
.voucher-label { font-weight: bold; color: #2c2c2c; margin-right: 4px; }
.voucher-valor { color: #444; white-space: pre-wrap; }
.voucher-italic { font-style: italic; }
.voucher-mensagem-bloco .voucher-valor::before { content: '"'; }
.voucher-mensagem-bloco .voucher-valor::after  { content: '"'; }
.voucher-codigo-bloco {
  background: #2c2c2c;
  color: #fff;
  border-radius: 6px;
  padding: 10px 14px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.voucher-codigo-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #d4a96a;
}
.voucher-codigo {
  font-size: 1.5rem;
  font-weight: bold;
  letter-spacing: 3px;
  color: #fff;
}
.voucher-codigo-obs {
  font-size: 0.55rem;
  color: #aaa;
  font-style: italic;
  text-align: center;
  line-height: 1.3;
}
.voucher-prepag-titulo {
  font-size: 1.1rem;
  color: #2c2c2c;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.voucher-valor-bloco {
  background: #f5f0eb;
  border: 2px solid #d4a96a;
  border-radius: 6px;
  padding: 10px 16px;
  text-align: center;
}
.voucher-valor-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
  margin-bottom: 2px;
}
.voucher-valor-num {
  font-size: 1.8rem;
  font-weight: bold;
  color: #2c2c2c;
  letter-spacing: 1px;
}
.voucher-rodape {
  background: #f5f0eb;
  text-align: center;
  padding: 8px 20px;
  font-size: 0.62rem;
  color: #777;
  line-height: 1.7;
  border-top: 1px solid #ede6da;
}
.voucher-rodape-fone { color: #555; font-weight: bold; }

/* ── LOG ── */
.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.log-header .screen-title { margin-bottom: 0; border: none; }
.log-table-wrap { overflow-x: auto; }
.log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.log-table th {
  background: #2c2c2c;
  color: #d4a96a;
  padding: 10px 14px;
  text-align: left;
  font-weight: bold;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.log-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0ebe4;
  color: #444;
  vertical-align: top;
}
.log-table tr:last-child td { border-bottom: none; }
.log-table tr:hover td { background: #faf7f3; }
.log-empty { text-align: center; color: #aaa; font-style: italic; padding: 32px; }

.btn-download-log {
  background: #d4a96a;
  color: #fff;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
}
.btn-download-log:hover { background: #b8904f; }

/* ── LOG: linhas clicáveis ── */
.log-row { cursor: pointer; }
.log-row:hover td { background: #faf7f3; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal {
  background: #fff;
  border-radius: 10px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #ede6da;
}
.modal-header h3 { font-size: 1.1rem; color: #2c2c2c; letter-spacing: 1px; }
.modal-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #999;
  padding: 4px 8px;
  border-radius: 4px;
}
.modal-close:hover { background: #f5f0eb; color: #333; }
.modal-body {
  overflow-y: auto;
  padding: 16px 20px;
  flex: 1;
}
.modal-section {
  background: #faf7f3;
  border: 1px solid #ede6da;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 12px;
}
.modal-field {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #f0ebe4;
  font-size: 0.9rem;
}
.modal-field:last-child { border-bottom: none; }
.modal-field-label { color: #888; white-space: nowrap; }
.modal-field-value { font-weight: 600; color: #2c2c2c; text-align: right; }
.modal-flags-view {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.modal-flag {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: bold;
}
.flag-on  { background: #e8f5e9; color: #2e7d32; }
.flag-off { background: #f5f5f5; color: #aaa; }

/* Modal edit */
.modal-edit-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
  font-size: 0.88rem;
}
.modal-edit-field label { color: #888; font-size: 0.8rem; }
.modal-edit-field input,
.modal-edit-field select,
.modal-edit-field textarea {
  padding: 7px 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-family: Georgia, serif;
  font-size: 0.88rem;
  background: #fff;
  width: 100%;
}
.modal-edit-field textarea { resize: vertical; }
.modal-flags-edit {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 10px 0 4px;
  font-size: 0.88rem;
}
.modal-flags-edit label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #555;
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-top: 1px solid #ede6da;
  gap: 8px;
}
.modal-footer-right { display: flex; gap: 8px; }
.btn-danger {
  background: #fff;
  color: #e53935;
  border: 1px solid #e53935;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: Georgia, serif;
}
.btn-danger:hover { background: #ffebee; }

.btn-pdf-log {
  background: #2c2c2c;
  color: #d4a96a;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
}
.btn-pdf-log:hover { background: #444; }
.btn-pdf-log:disabled { opacity: 0.6; cursor: default; }
