/* ==========================================================================
   Complemento ao template base (shadcn) — apenas o que o base não tem:
   formulários, alerts, estado vazio. Usa as variáveis do style.css.
   ========================================================================== */

/* Formulários */
.label { display: block; font-size: 12.5px; font-weight: 500; color: var(--foreground); margin-bottom: 6px; }
.input, .select, .textarea {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  color: var(--foreground);
  font-size: 13.5px;
}
.textarea { height: auto; min-height: 90px; padding: 10px 11px; line-height: 1.55; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 25%, transparent); }
.input::placeholder, .textarea::placeholder { color: var(--muted-foreground); }
.help { font-size: 11.5px; color: var(--muted-foreground); margin-top: 4px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check input { width: 16px; height: 16px; }
.check .checkbox { margin-top: 0; }

/* Dropzone / escolher arquivo */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  padding: 20px 14px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--muted) 40%, transparent);
  color: var(--muted-foreground);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--ring); background: var(--muted); }
.dropzone .lucide { width: 22px; height: 22px; }
.dropzone__title { font-size: 13px; font-weight: 500; color: var(--foreground); }

/* Select no padrão (seta do shadcn) */
.select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6l6 -6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}

/* Select2 no padrão do template */
.select2-container { width: 100% !important; }
.select2-container--default .select2-selection--single {
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 34px;
  padding-left: 11px;
  color: var(--foreground);
  font-size: 13.5px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 34px; right: 8px; }
.select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: var(--muted-foreground) transparent transparent transparent;
  border-width: 5px 4px 0 4px;
}
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 25%, transparent);
}
.select2-dropdown {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--popover);
  color: var(--popover-foreground);
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: var(--accent);
  color: var(--accent-foreground);
}

/* Grid auxiliar de 12 colunas (o base só tem grid-3/grid-4) */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; }
.col-12 { grid-column: span 12; }
@media (max-width: 900px) {
  .col-2, .col-3, .col-4, .col-6, .col-8, .col-9 { grid-column: span 12; }
}

/* Alerts (padrão shadcn) */
.alert {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--foreground);
  font-size: 13px;
}
.alert__icon { width: 17px; height: 17px; flex-shrink: 0; margin-top: 2px; color: var(--muted-foreground); }
.alert__content { min-width: 0; line-height: 1.5; }
.alert__title { font-weight: 600; }
.alert__desc { font-size: 12.5px; color: var(--muted-foreground); margin-top: 2px; }
.alert-danger { background: color-mix(in srgb, var(--destructive) 8%, var(--card)); border-color: color-mix(in srgb, var(--destructive) 40%, var(--border)); }
.alert-danger .alert__icon { color: var(--destructive); }
.alert-success { border-color: #86efac; }
.alert-success .alert__icon { color: #16a34a; }
.alert-info .alert__icon { color: #3b82f6; }
.alert-warning { background: color-mix(in srgb, #f59e0b 18%, var(--card)); border-color: color-mix(in srgb, #f59e0b 40%, var(--border)); }
.alert-warning .alert__icon { color: #b45309; }
.alert-danger--solid { background: var(--destructive); border-color: var(--destructive); color: #fff; }
.alert-danger--solid .alert__icon, .alert-danger--solid .alert__content { color: #fff; }

/* Estado vazio */
.empty-state { text-align: center; padding: 48px 16px; color: var(--muted-foreground); font-size: 13px; }
.empty-state h3 { font-size: 15px; font-weight: 600; color: var(--foreground); margin-bottom: 6px; }

/* ---------- DataTables no padrão do template ---------- */
.table-card .dataTables_wrapper { display: flex; flex-direction: column; }
.table-card .table-toolbar .dataTables_filter { float: none; text-align: left; width: 100%; }
.table-card .table-toolbar .dataTables_filter label { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; font-size: 13px; color: var(--muted-foreground); }
.table-card .table-toolbar .dataTables_filter input { height: 34px; margin: 0; padding: 0 11px; min-width: 240px; border: 1px solid var(--border); border-radius: 8px; background: var(--background); color: var(--foreground); font-size: 13px; outline: none; }
.table-card .table-toolbar .dataTables_filter input:focus { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 25%, transparent); }
.table-card .table-scroll { overflow-x: auto; }
.table-card .dataTables_info { float: none; margin-right: auto; padding: 0; font-size: 13px; color: var(--muted-foreground); }
.table-card .dataTables_length { float: none; padding: 0; font-size: 13px; color: var(--muted-foreground); }
.table-card .dataTables_length select { height: 30px; margin: 0 6px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--background); color: var(--foreground); font-size: 12.5px; }
.table-card .dataTables_paginate { float: none; display: inline-flex; align-items: center; gap: 4px; padding: 0; }
.table-card .dataTables_paginate .paginate_button {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 30px; padding: 0 8px; margin: 0;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--background); color: var(--foreground);
  font-size: 12.5px; cursor: pointer;
}
.table-card .dataTables_paginate .paginate_button:hover { background: var(--muted); color: var(--foreground) !important; }
.table-card .dataTables_paginate .paginate_button.current { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground) !important; }
.table-card .dataTables_paginate .paginate_button.disabled { opacity: .5; cursor: not-allowed; }
.table-card .dataTables_paginate .ellipsis { padding: 0 6px; color: var(--muted-foreground); }

/* Pills extras */
.pill-gold { background: color-mix(in srgb, #eab308 20%, transparent); color: #a16207; border: 1px solid color-mix(in srgb, #eab308 45%, transparent); }
.pill-purple { background: color-mix(in srgb, #8b5cf6 16%, transparent); color: #6d28d9; border: 1px solid color-mix(in srgb, #8b5cf6 38%, transparent); }
html.dark .pill-gold { color: #fcd34d; }
html.dark .pill-purple { color: #c4b5fd; }

/* Badges de origem do lead */
.badge--site { background: color-mix(in srgb, #3b82f6 15%, transparent); color: #1d4ed8; }
.badge--whatsapp { background: color-mix(in srgb, #16a34a 15%, transparent); color: #15803d; }
.badge--instagram { background: color-mix(in srgb, #ec4899 15%, transparent); color: #be185d; }
.badge--facebook { background: color-mix(in srgb, #6366f1 15%, transparent); color: #4338ca; }
.badge--google { background: color-mix(in srgb, #ef4444 15%, transparent); color: #b91c1c; }
html.dark .badge--site { color: #93c5fd; }
html.dark .badge--whatsapp { color: #86efac; }
html.dark .badge--instagram { color: #f9a8d4; }
html.dark .badge--facebook { color: #a5b4fc; }
html.dark .badge--google { color: #fca5a5; }

/* Alternador de visualização (lista / grade) */
.view-toggle { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 9px; background: var(--muted); }
.view-toggle button { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--muted-foreground); cursor: pointer; transition: background .12s ease, color .12s ease; }
.view-toggle button:hover { color: var(--foreground); }
.view-toggle button.is-active { background: var(--background); color: var(--foreground); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.view-toggle .lucide { width: 16px; height: 16px; }

/* Segmented (alternador de período) */
.segmented { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--muted); }
.segmented button { padding: 7px 16px; border: 0; border-radius: 7px; background: transparent; color: var(--muted-foreground); font-size: 13px; font-weight: 500; cursor: pointer; transition: background .12s ease, color .12s ease; }
.segmented button:hover { color: var(--foreground); }
.segmented button.is-active { background: var(--background); color: var(--foreground); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.segmented__save { margin-left: 6px; color: #16a34a; font-size: 11.5px; font-weight: 600; }

/* Grade de imóveis (miniaturas) */
.imoveis-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.imovel-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--card); color: var(--card-foreground); cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.imovel-card:hover { border-color: var(--ring); box-shadow: 0 10px 26px rgba(0, 0, 0, .12); transform: translateY(-2px); }
.imovel-card__thumb { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--muted); }
.imovel-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.imovel-card__noimg { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--muted-foreground); }
.imovel-card__noimg .lucide { width: 30px; height: 30px; }
.imovel-card__badge { position: absolute; top: 8px; left: 8px; }
.imovel-card__body { flex: 1; padding: 12px; }
.imovel-card__code { font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted-foreground); }
.imovel-card__title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 4px 0 6px; font-size: 13.5px; font-weight: 600; }
.imovel-card__meta { font-size: 12px; color: var(--muted-foreground); text-transform: capitalize; }
.imovel-card__price { margin-top: 8px; font-size: 14px; font-weight: 700; }
.imovel-card__price small { font-size: 11px; font-weight: 500; color: var(--muted-foreground); }
.imovel-card__actions { display: flex; gap: 2px; justify-content: flex-end; padding: 6px 8px; border-top: 1px solid var(--border); }
