/* assets/quotes.css - Layout Responsivo Perfeito Sem Emojis */

/* Barra Lateral */
.nav-link.nav-link-orcamentos.active {
  background-color: var(--primary-light);
  color: var(--primary);
  transform: translate(4px);
}

/* Proteção Global contra vazamentos */
.main-content {
  box-sizing: border-box;
}

#form-orcamento {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Área de Upload de Foto com Ícone SVG Limpo */
.orc-photo-upload-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.orc-photo-preview-box {
  position: relative;
  width: 72px;
  height: 72px;
  min-width: 72px;
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg-color);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.orc-photo-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.orc-photo-btn-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  min-width: 72px;
  background: var(--bg-color);
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  padding: 4px;
}

.orc-photo-btn-add:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.orc-photo-btn-add span {
  font-size: 0.65rem;
  font-weight: 600;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.orc-photo-btn-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.orc-photo-btn-del:hover {
  background: #dc2626;
}

/* Card Mobile para Itens do Orçamento */
.orc-mobile-item-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.orc-mobile-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.65rem;
}

.orc-mobile-item-num {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-remove-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}

.btn-remove-item:hover {
  background: var(--danger-light);
}

/* Visibilidade Desktop vs Mobile */
.orc-desktop-table {
  display: none;
  width: 100%;
}

.orc-mobile-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

@media (min-width: 820px) {
  .orc-desktop-table {
    display: table;
  }
  .orc-mobile-items {
    display: none;
  }
}

/* Badges de Status */
.badge-status {
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
}
.badge-status.Pendente {
  background-color: var(--warning-light);
  color: var(--warning);
  border: 1px solid var(--warning);
}
.badge-status.Aprovado {
  background-color: var(--success-light);
  color: var(--success);
  border: 1px solid var(--success);
}
.badge-status.Concluido {
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary);
}
.badge-status.Em-Negociacao {
  background-color: rgba(168, 85, 247, 0.15);
  color: #a855f7;
  border: 1px solid #a855f7;
}

/* Card de Totais */
.orc-totals-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-sizing: border-box;
}

.orc-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.orc-total-highlight {
  border-top: 2px solid var(--border);
  padding-top: 1rem;
  margin-top: 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
}

/* Ações Inferiores */
.orc-form-actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 1rem;
  margin-top: 2rem;
}

@media (min-width: 640px) {
  .orc-form-actions {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* ========================================================
   REGRAS ESPECÍFICAS DE CELULAR (SEM VAZAMENTOS / ZERO OVERFLOW)
   ======================================================== */
@media (max-width: 767px) {
  .main-content {
    padding: 1rem 0.85rem !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  .card {
    padding: 1.25rem 1rem !important;
    border-radius: 14px !important;
    margin-bottom: 1.25rem !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .top-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 1rem !important;
    margin-bottom: 1.25rem !important;
  }

  .top-bar .btn, .top-bar button {
    width: 100% !important;
    justify-content: center !important;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }

  .form-group {
    margin-bottom: 1rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  input, select, textarea {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    font-size: 0.95rem !important;
    padding: 0.75rem 0.85rem !important;
  }

  .orc-total-row input {
    width: 120px !important;
    max-width: 45% !important;
  }

  .orc-form-actions button, .orc-form-actions .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  .mobile-invoice-actions .btn {
    padding: 0.55rem 0.75rem !important;
    font-size: 0.82rem !important;
  }
}
