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

body {
  font-family: 'Inter', sans-serif;
  background: #f0f2f5;
  color: #1e293b;
  min-height: 100vh;
}

/* HEADER */
header {
  background: #1e293b;
  color: #fff;
  padding: 0 20px;
}
.header-inner {
  max-width: 900px;
  margin: 0 auto;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header h1 { font-size: 1.15rem; font-weight: 700; }
.desconto-badge {
  background: #f59e0b;
  color: #1e293b;
  font-size: .75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
}

/* ABAS */
.abas {
  background: #fff;
  border-bottom: 2px solid #e2e8f0;
  display: flex;
  gap: 0;
  overflow-x: auto;
}
.aba {
  padding: 14px 22px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all .2s;
  white-space: nowrap;
}
.aba:hover { color: #1e293b; }
.aba.ativa {
  color: #6366f1;
  border-bottom-color: #6366f1;
}

/* MAIN */
main { max-width: 900px; margin: 0 auto; padding: 24px 16px 60px; }

/* SEÇÕES */
.secao { display: none; }
.secao.ativa { display: block; }

.secao h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 16px;
}

/* CARDS */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}
.card {
  background: #fff;
  border-radius: 12px;
  padding: 18px 16px;
  border-left: 5px solid #ccc;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.card-titulo {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b;
  margin-bottom: 8px;
}
.card-valor {
  font-size: 1.3rem;
  font-weight: 800;
  color: #1e293b;
}
.card.verde  { border-left-color: #10b981; }
.card.laranja{ border-left-color: #f59e0b; }
.card.azul   { border-left-color: #3b82f6; }
.card.vermelho{ border-left-color: #ef4444; }
.card.roxo   { border-left-color: #8b5cf6; }
.card.cinza  { border-left-color: #6366f1; }

/* FORM BOX */
.form-box {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.campo label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.campo input,
.campo select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: .92rem;
  font-family: inherit;
  color: #1e293b;
  background: #fff;
  outline: none;
  transition: border-color .2s;
}
.campo input:focus,
.campo select:focus { border-color: #6366f1; }

/* PREVIEW */
.preview {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 18px;
  flex-wrap: wrap;
}
.preview-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.preview-item span {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #64748b;
}
.preview-item strong { font-size: 1.1rem; font-weight: 800; color: #1e293b; }
.vermelho-txt strong { color: #ef4444; }
.verde-txt strong    { color: #10b981; }
.seta { font-size: 1.1rem; color: #94a3b8; font-weight: 700; }

/* BOTÕES */
.btn {
  padding: 11px 20px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
  display: inline-block;
  text-align: center;
  align-self: flex-start;
}
.btn:hover   { opacity: .88; }
.btn:active  { transform: scale(.97); }
.btn.verde   { background: #10b981; color: #fff; }
.btn.vermelho{ background: #ef4444; color: #fff; }
.btn.roxo    { background: #8b5cf6; color: #fff; }
.btn.cinza-btn { background: #e2e8f0; color: #1e293b; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* TABELA */
.tabela-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  font-size: .88rem;
}
thead tr { background: #f1f5f9; }
th {
  padding: 11px 14px;
  text-align: left;
  font-size: .73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b;
  border-bottom: 2px solid #e2e8f0;
}
td {
  padding: 11px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }
.vazio { text-align: center; color: #94a3b8; padding: 28px !important; }

/* Botão excluir na tabela */
.btn-del {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: .85rem;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 700;
  transition: background .2s;
}
.btn-del:hover { background: #fee2e2; }

/* TOAST */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e293b;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 600;
  opacity: 0;
  transition: all .3s;
  pointer-events: none;
  z-index: 999;
  white-space: nowrap;
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#toast.ok  { background: #10b981; }
#toast.err { background: #ef4444; }

/* MODAL */
.modal-fundo {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
  width: 300px;
}
.modal-box p { font-size: .95rem; font-weight: 600; margin-bottom: 20px; color: #1e293b; }
.modal-btns { display: flex; gap: 10px; justify-content: center; }

/* RESPONSIVO */
@media (max-width: 600px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .preview { flex-direction: column; align-items: flex-start; }
  .seta { display: none; }
}
@media (max-width: 380px) {
  .cards { grid-template-columns: 1fr; }
}
