* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #0f172a;
  color: #111827;
}

.sidebar {
  width: 250px;
  height: 100vh;
  background: #020617;
  color: #fff;
  position: fixed;
  left: 0;
  top: 0;
  padding: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
}

.logo {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f97316, #ef4444);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.brand small {
  display: block;
  color: #94a3b8;
  margin-top: 3px;
}

.sidebar a {
  display: block;
  color: #cbd5e1;
  text-decoration: none;
  padding: 13px 14px;
  border-radius: 12px;
  margin-bottom: 8px;
}

.sidebar a:hover {
  background: #1e293b;
  color: #fff;
}

.content {
  margin-left: 250px;
  min-height: 100vh;
  padding: 30px;
  background: #f1f5f9;
}

.login-content {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, #1e293b, #020617);
}

.login-box {
  width: 420px;
  background: #fff;
  padding: 35px;
  border-radius: 24px;
  box-shadow: 0 25px 70px rgba(0,0,0,.35);
}

.login-box h1 {
  margin-top: 0;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.top h1 {
  margin: 0;
  font-size: 32px;
}

.top p {
  margin: 7px 0 0;
  color: #64748b;
}

.cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.card {
  background: #fff;
  padding: 22px;
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(15,23,42,.08);
}

.card span {
  color: #64748b;
  font-size: 14px;
}

.card strong {
  display: block;
  font-size: 28px;
  margin-top: 8px;
}

.card.wide strong {
  color: #16a34a;
}

.panel {
  background: #fff;
  padding: 24px;
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(15,23,42,.08);
  margin-bottom: 22px;
}

.panel h2 {
  margin-top: 0;
}

label {
  display: block;
  font-weight: bold;
  margin: 14px 0 7px;
}

input, select, textarea {
  width: 100%;
  padding: 13px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  font-size: 15px;
  background: #fff;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

button, .btn {
  border: none;
  background: #ef4444;
  color: #fff;
  padding: 13px 18px;
  border-radius: 13px;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
  margin-top: 12px;
}

.btn:hover, button:hover {
  opacity: .92;
}

.secondary, .btn.secondary {
  background: #334155;
}

.danger {
  background: #991b1b;
}

.whatsapp {
  background: #16a34a;
}

.small {
  padding: 8px 12px;
  font-size: 13px;
  margin-top: 0;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.grid-form textarea,
.grid-form button {
  grid-column: 1 / -1;
}

.item-row {
  display: grid;
  grid-template-columns: 90px 1fr 170px 55px;
  gap: 10px;
  margin-bottom: 10px;
}

.total-box {
  background: #f8fafc;
  border: 1px dashed #94a3b8;
  padding: 18px;
  margin: 18px 0;
  border-radius: 16px;
  text-align: right;
  font-size: 22px;
}

.grand-total {
  text-align: right;
  font-size: 24px;
  font-weight: bold;
  margin-top: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  color: #475569;
  background: #f8fafc;
}

th, td {
  padding: 13px;
  border-bottom: 1px solid #e2e8f0;
}

.badge {
  display: inline-block;
  padding: 7px 10px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 13px;
  font-weight: bold;
}

.badge.em-produção,
.badge.pagamento-confirmado {
  background: #dcfce7;
  color: #166534;
}

.badge.enviado {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge.cancelado {
  background: #fee2e2;
  color: #991b1b;
}

.badge.orçamento-enviado {
  background: #fef3c7;
  color: #92400e;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.alert {
  background: #fee2e2;
  color: #991b1b;
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 15px;
}

.hint {
  color: #64748b;
}

.msgbox {
  min-height: 85px;
  background: #f8fafc;
}

@media (max-width: 900px) {
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
  }

  .content {
    margin-left: 0;
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-form,
  .item-row {
    grid-template-columns: 1fr;
  }

  .top {
    flex-direction: column;
    align-items: flex-start;
  }
}

.produto-row {
  grid-template-columns: 1.2fr 70px 1.5fr 110px 100px 110px 55px;
}

.total-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.resume-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-top: 22px;
}

.resume-grid div {
  background: #f8fafc;
  border-radius: 16px;
  padding: 18px;
  border: 1px solid #e2e8f0;
}

.resume-grid span {
  display: block;
  color: #64748b;
  font-size: 14px;
  margin-bottom: 8px;
}

.resume-grid strong {
  font-size: 24px;
  color: #111827;
}

@media (max-width: 1200px) {
  .produto-row {
    grid-template-columns: 1fr;
  }

  .total-grid,
  .resume-grid {
    grid-template-columns: 1fr;
  }
}

.message-card {
  background: #fff;
  padding: 22px;
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(15,23,42,.08);
  margin-bottom: 18px;
}

.message-card h2 {
  margin-top: 0;
  color: #111827;
}

.message-card textarea {
  min-height: 145px;
  font-size: 15px;
  line-height: 1.45;
  background: #f8fafc;
}

.variables {
  border-left: 6px solid #ef4444;
}

.var-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.var-list code {
  background: #020617;
  color: #fff;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
}

.save-messages {
  width: 100%;
  font-size: 16px;
  padding: 16px;
  margin-bottom: 30px;
}

.alert.success {
  background: #dcfce7;
  color: #166534;
}

.form-section-title {
  grid-column: 1 / -1;
  background: #f8fafc;
  border-left: 5px solid #ef4444;
  padding: 14px;
  border-radius: 12px;
  font-weight: bold;
  color: #111827;
  margin-top: 10px;
}

.logo-preview-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 18px;
  border-radius: 16px;
  margin-bottom: 18px;
}

.logo-preview {
  max-width: 260px;
  max-height: 120px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
}

.upload-logo-form {
  background: #f8fafc;
  border-radius: 16px;
  padding: 18px;
  border: 1px dashed #94a3b8;
}

.upload-logo-form input[type="file"] {
  background: #ffffff;
}
