* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  background: #0f172a;
  color: #e5e7eb;
  min-height: 100vh;
}

/* TOPO */
.topbar {
  padding: 1.5rem 1rem;
  text-align: center;
  background: linear-gradient(135deg, #1f2937, #020617);
  border-bottom: 1px solid #111827;
}

.topbar h1 {
  font-size: 1.8rem;
  margin-bottom: 0.25rem;
}

.subtitle {
  font-size: 0.9rem;
  color: #9ca3af;
}

/* LAYOUT PRINCIPAL */
.container {
  max-width: 1100px;
  margin: 1.5rem auto;
  padding: 0 1rem 2rem;
}

/* CARDS */
.card {
  background: #020617;
  border: 1px solid #111827;
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.card h2 {
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
}

/* FORMULÁRIOS */
.form-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .form-grid {
    grid-template-columns: 1.5fr 1.5fr 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

label {
  font-size: 0.85rem;
  color: #9ca3af;
}

input,
textarea {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border: 1px solid #1f2937;
  background: #020617;
  color: #e5e7eb;
  font-size: 0.95rem;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #facc15;
  box-shadow: 0 0 0 1px #facc15;
}

/* GRID DE PEÇAS */
.parts-grid {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
  .parts-grid {
    grid-template-columns: 1.3fr 0.4fr 0.7fr;
  }
}

/* BOTÕES */
.btn {
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.2rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: transform 0.1s, box-shadow 0.1s, opacity 0.1s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.btn:active {
  transform: scale(0.97);
  box-shadow: none;
}

.primary {
  background: #facc15;
  color: #1f2937;
  box-shadow: 0 8px 20px rgba(250, 204, 21, 0.3);
}

.secondary {
  background: #111827;
  color: #e5e7eb;
  border: 1px solid #1f2937;
}

.success {
  background: #22c55e;
  color: #022c22;
  box-shadow: 0 8px 20px rgba(34, 197, 94, 0.35);
}

.danger {
  background: #ef4444;
  color: #f9fafb;
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

.actions-card .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* TABELA */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin-top: 0.75rem;
}

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

thead {
  background: #020617;
}

th,
td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid #111827;
  text-align: left;
}

th {
  font-weight: 600;
  color: #9ca3af;
}

tr:nth-child(even) {
  background: #020617;
}

/* TOTAIS */
.totals-row {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.95rem;
}

/* ORÇAMENTO FINAL */
.orcamento-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed #1f2937;
}

@media (min-width: 600px) {
  .orcamento-header {
    flex-direction: row;
    justify-content: space-between;
  }
}

.orcamento-totals {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-end;
}

.orcamento-totals p {
  font-size: 0.95rem;
}

.grand-total {
  margin-top: 0.5rem;
  font-size: 1.1rem;
}

/* MENSAGENS */
.error-msg {
  color: #f97316;
  font-size: 0.85rem;
  margin-top: 0.4rem;
  min-height: 1rem;
}

.info-msg {
  color: #a5b4fc;
  font-size: 0.85rem;
  margin-top: 0.4rem;
  min-height: 1rem;
}

/* FOOTER */
.footer {
  text-align: center;
  padding: 1.25rem;
  font-size: 0.8rem;
  color: #6b7280;
  border-top: 1px solid #111827;
  background: #020617;
}

/* ABAS */
.tabs{
  display:flex;
  flex-wrap:wrap;
  gap:0.5rem;
  margin-bottom: 1rem;
}
.tab-btn{
  border: 1px solid #1f2937;
  background:#111827;
  color:#e5e7eb;
  border-radius: 999px;
  padding: 0.55rem 1.2rem;
  cursor:pointer;
  font-size:0.9rem;
  font-weight:600;
  transition: transform 0.1s, box-shadow 0.1s, opacity 0.1s;
}
.tab-btn:active{ transform: scale(0.97); }
.tab-btn.active{
  background:#facc15;
  color:#1f2937;
  box-shadow: 0 8px 20px rgba(250, 204, 21, 0.3);
  border-color: transparent;
}
.tab-content[hidden]{ display:none !important; }
