﻿/* app/static/css/custom.css

   CSS customizado do projeto PropCITZ.

   Objetivos:
   - Aplicar paleta aprovada
   - Refinar visual dos cards e tabelas
   - Garantir boa leitura no mobile
*/

:root {
  --color-primary: #3B82F6;
  --color-primary-strong: #2563EB;
  --color-ink: #0B0F19;
  --color-ink-soft: #111827;
  --color-bg: #EEF4FB;
  --color-bg-soft: #F7F9FC;
  --color-text: #0B0F19;
  --color-card: #FFFFFF;
  --color-muted: #6B7280;
  --border-soft: #E5E7EB;
  --shadow-soft: 0 8px 20px rgba(15, 23, 42, 0.08);
  --shadow-hard: 0 14px 30px rgba(15, 23, 42, 0.12);
  --radius-lg: 14px;
  --radius-md: 10px;
}

body {
  background: var(--color-page-bg);
  color: var(--color-text-primary);
  font-family: var(--font-family);
  font-size: var(--font-size-md);
}

main.container {
  max-width: 1200px;
}

/* Estilos de .navbar removidos — substituídos pelo app-header em navbar.css */

.badge.bg-primary {
  background-color: var(--color-primary) !important;
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
}

.card {
  background-color: var(--color-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.card-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: 0.2px;
  margin-bottom: 0;
}

.form-label {
  color: var(--color-muted);
  font-size: var(--font-size-md);
  font-weight: 500;
}

.text-muted.small,
.text-muted small {
  font-size: var(--font-size-md) !important;
}

.form-control, .form-select {
  font-size: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background-color: #F3F4F6;
}

.form-control:focus, .form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.2);
  background-color: #FFFFFF;
}

.btn-primary {
  background: linear-gradient(180deg, #111827 0%, #0B0F19 100%);
  border-color: #0B0F19;
  font-weight: 600;
  color: #FFFFFF;
}

.btn-primary:hover {
  background: linear-gradient(180deg, #0B0F19 0%, #05070C 100%);
  border-color: #05070C;
  color: #FFFFFF;
}

.btn-outline-primary {
  border-color: var(--border-soft);
  color: var(--color-ink-soft);
  font-weight: 600;
}

.btn-outline-primary:hover {
  background-color: #EEF2F7;
  color: var(--color-ink-soft);
}

.btn-save-session {
  background: linear-gradient(180deg, #16A34A 0%, #15803D 100%);
  border-color: #15803D;
  color: #FFFFFF;
  font-weight: 600;
}

.btn-save-session:hover {
  background: linear-gradient(180deg, #15803D 0%, #166534 100%);
  border-color: #166534;
  color: #FFFFFF;
}

.btn-cv-sync {
  background-color: #00B389;
  border-color: #00B389;
  color: #FFFFFF;
  font-weight: 600;
}

.btn-cv-sync:hover,
.btn-cv-sync:focus,
.btn-cv-sync:active {
  background-color: #009a76;
  border-color: #009a76;
  color: #FFFFFF;
}

.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  display: inline-block;
}

.table-responsive {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  overflow-x: auto;
  overflow-y: hidden;
}

.unidades-table-wrap {
  -webkit-overflow-scrolling: touch;
}

.unidades-table {
  min-width: 1900px;
}

.unidades-table td,
.unidades-table th {
  white-space: nowrap;
}

.table thead th {
  white-space: nowrap;
  background: var(--color-bg-soft);
  color: var(--color-text);
  font-weight: 600;
  border-bottom: 1px solid var(--border-soft);
}

.table td, .table th {
  font-size: 0.92rem;
}

.alert {
  border-radius: var(--radius-md);
}

.editable-field {
  border: 2px solid #FACC15;
  background-color: #FFFDF0;
}

.editable-field:focus {
  border-color: #EAB308;
  box-shadow: 0 0 0 0.2rem rgba(234, 179, 8, 0.2);
  background-color: #FFFFFF;
}

.form-label-fixed-2l {
  min-height: 3rem;
}

.modal-content {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hard);
}

.condicoes-tabela-grid th,
.condicoes-tabela-grid td {
  white-space: nowrap;
  vertical-align: middle;
}

.condicoes-table-scroll {
  max-height: 620px;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.condicoes-table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--color-bg-soft);
}

/* Congela as 3 primeiras colunas (Empreendimento, Bloco, Unidade) */
.condicoes-tabela-grid th:nth-child(1),
.condicoes-tabela-grid td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
}

.condicoes-tabela-grid th:nth-child(2),
.condicoes-tabela-grid td:nth-child(2) {
  position: sticky;
  left: 220px;
  z-index: 3;
  background: #fff;
}

.condicoes-tabela-grid th:nth-child(3),
.condicoes-tabela-grid td:nth-child(3) {
  position: sticky;
  left: 400px;
  z-index: 3;
  background: #fff;
}

.condicoes-tabela-grid thead th:nth-child(1),
.condicoes-tabela-grid thead th:nth-child(2),
.condicoes-tabela-grid thead th:nth-child(3) {
  z-index: 4;
  background: var(--color-bg-soft);
}

.condicoes-tabela-grid th:nth-child(1),
.condicoes-tabela-grid td:nth-child(1) {
  min-width: 220px;
}

.condicoes-tabela-grid th:nth-child(2),
.condicoes-tabela-grid td:nth-child(2) {
  min-width: 180px;
}

.condicoes-tabela-grid th:nth-child(3),
.condicoes-tabela-grid td:nth-child(3) {
  min-width: 160px;
}

@media (max-width: 1200px) {
  .condicoes-tabela-grid th:nth-child(1),
  .condicoes-tabela-grid td:nth-child(1) {
    min-width: 180px;
  }

  .condicoes-tabela-grid th:nth-child(2),
  .condicoes-tabela-grid td:nth-child(2) {
    left: 180px;
    min-width: 150px;
  }

  .condicoes-tabela-grid th:nth-child(3),
  .condicoes-tabela-grid td:nth-child(3) {
    left: 330px;
    min-width: 130px;
  }
}

.filter-multi {
  min-height: 2.5rem;
  max-height: 7rem;
  overflow-y: auto;
}

.advanced-filter.collapse:not(.show) {
  display: none;
}

.multi-check-dropdown {
  position: relative;
}

.multi-check-dropdown .multi-check-btn {
  width: 100%;
  text-align: left;
  background: #f8f9fa;
  border: 1px solid #ced4da;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
}

.multi-check-dropdown .multi-check-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow: auto;
  background: #fff;
  border: 1px solid #ced4da;
  border-radius: 0.5rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  padding: 0.5rem;
  display: none;
}

.multi-check-dropdown.open .multi-check-menu {
  display: block;
}

.multi-check-dropdown .form-check {
  margin-bottom: 0.25rem;
}

.tabela-preco-grid th,
.tabela-preco-grid td {
  white-space: nowrap;
  vertical-align: middle;
}

#tabela-preco-feedback .alert {
  margin-bottom: 0;
}

.bloco-form-align {
  margin-top: 8px;
}

@media (max-width: 768px) {
  .condicoes-tabela-grid th:nth-child(1),
  .condicoes-tabela-grid td:nth-child(1),
  .condicoes-tabela-grid th:nth-child(2),
  .condicoes-tabela-grid td:nth-child(2),
  .condicoes-tabela-grid th:nth-child(3),
  .condicoes-tabela-grid td:nth-child(3) {
    position: static !important;
    left: auto !important;
    min-width: auto !important;
  }

  .table td, .table th {
    font-size: 0.85rem;
  }

  .navbar .nav-link {
    padding-left: 0;
  }

  .bloco-form-align {
    margin-top: 0;
  }
}

@media (max-width: 1024px) {
  .condicoes-tabela-grid th:nth-child(1),
  .condicoes-tabela-grid td:nth-child(1),
  .condicoes-tabela-grid th:nth-child(2),
  .condicoes-tabela-grid td:nth-child(2),
  .condicoes-tabela-grid th:nth-child(3),
  .condicoes-tabela-grid td:nth-child(3) {
    position: static !important;
    left: auto !important;
  }
}


/* ── Section badge (numbered circle) ────────────────────── */
.section-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--color-primary-cta);
  color: #fff;
  font-size: var(--font-size-xs);
  font-weight: 700;
  margin-right: 8px;
  flex-shrink: 0;
  vertical-align: middle;
}

/* ── Required star ───────────────────────────────────────── */
.req-star {
  color: #EF4444;
  margin-left: 2px;
}

/* ── Total potencial box ─────────────────────────────────── */
.total-potencial-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--color-success-bg);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  gap: 2px;
}

.total-potencial-label {
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--color-success-text);
}

.total-potencial-hint {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 400;
  color: var(--color-success-text);
  opacity: 0.70;
  margin-top: 1px;
}

.total-potencial-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-success-text);
  white-space: nowrap;
  margin-top: 6px;
}

/* ── Tipo de venda — radio estilizado ────────────────────── */
.tipo-venda-group {
  display: flex;
  gap: 8px;
  padding-top: 4px;
}

.tipo-venda-option {
  cursor: pointer;
  margin: 0;
}

.tipo-venda-option input[type="radio"] {
  display: none;
}

.tipo-venda-label {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: var(--font-size-md);
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
}

.tipo-venda-option input[type="radio"]:checked + .tipo-venda-label {
  background: var(--color-info-bg);
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 600;
}

.tipo-venda-group.is-invalid-group .tipo-venda-label {
  border-color: #EF4444;
}

/* Variante azul destacada — opção recomendada */
.tipo-venda-label--destaque {
  background: #DBEAFE;
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 600;
}

.tipo-venda-option input[type="radio"]:checked + .tipo-venda-label--destaque {
  background: var(--color-primary);
  border-color: var(--color-primary-strong);
  color: #FFFFFF;
}

/* Variante cinza — seleção manual */
.tipo-venda-option input[type="radio"]:checked + .tipo-venda-label--cinza {
  background: #F3F4F6;
  border-color: #9CA3AF;
  color: #374151;
  font-weight: 600;
}

/* Variante amarela — tipologia alternativa */
.tipo-venda-option input[type="radio"]:checked + .tipo-venda-label--amarelo {
  background: #FEF9C3;
  border-color: #EAB308;
  color: #854D0E;
  font-weight: 600;
}

/* ── Ato parcelas section ────────────────────────────────── */
.ato-parcelas-section {
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
}

/* ── Page layout ─────────────────────────────────────────── */
.page-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
  line-height: 1.25;
}

.page-subtitle {
  font-size: var(--font-size-md);
  color: var(--color-text-secondary);
  margin: 2px 0 0;
}

.section-desc {
  font-size: var(--font-size-md);
  color: var(--color-text-secondary);
  margin: 6px 0 12px;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
