/* ==========================================================================
   DESIGN SYSTEM - PAINEL IMPAR (VANILLA CSS - FLAT COLOR-GUIDED STYLE)
   ========================================================================== */

:root {
  /* Cores de Fundo Sólidas e Planas (Theme Claro Warm Stone / Linen) */
  --bg-primary: #FAF9F6;
  --bg-secondary: #F3EFEA;
  --bg-tertiary: #EAE4DC;
  
  /* Cores de Superfície e Componentes */
  --surface: #FFFFFF;
  --surface-hover: #F7F5F0;
  --border: #E2DCD5;
  --border-focus: rgba(147, 118, 78, 0.5);
  
  /* Cores Tipográficas (Alto Contraste) */
  --text-primary: #1A1C1E;
  --text-secondary: #4B525A;
  --text-muted: #59616B; /* Ajustado para taxa de contraste 5.5:1 (WCAG AA) */
  
  /* Cores de Destaque e Status (Guia por cores de análise imediata) */
  --accent-gold: #93764E; /* Dourado Corporativo Escuro para Contraste */
  --accent-gold-hover: #7E633F;
  --status-available: #5C6672; /* Cinza para disponível */
  --status-occupied: #059669; /* Verde esmeralda para ocupado/gerando receita */
  --status-occupied-light: #ECFDF5;
  --status-available-light: #F3F4F6;
  --error: #DC2626; /* Vermelho coral para despesas */
  --error-light: #FEF2F2;
  --info-blue: #1D4ED8; /* Azul para documentos */
  --info-blue-light: #EFF6FF;
  
  /* Tipografia */
  --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* Tamanhos e Arredondamento Flat */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --transition-fast: 0.12s ease;
  --transition-normal: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* Reset Geral */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  /* overflow-x: hidden removido — causa bloqueio de scroll no iOS Safari */
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Scrollbar corporativa e sutil */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ==========================================================================
   ESTILOS DE TELA - LOGIN
   ========================================================================== */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background-color: var(--bg-primary);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--accent-gold);
  margin-bottom: 4px;
}

.login-logo span {
  color: var(--text-primary);
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}

.auth-divider:not(:empty)::before {
  margin-right: .5em;
}

.auth-divider:not(:empty)::after {
  margin-left: .5em;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 11px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.btn-google:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--accent-gold);
}

.btn-google:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-control {
  width: 100%;
  height: 42px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 12px;
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color var(--transition-fast);
}

.input-control:focus {
  border-color: var(--accent-gold);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 42px;
  background-color: var(--accent-gold);
  color: var(--bg-primary);
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color var(--transition-fast);
  gap: 8px;
}

.btn-primary:hover {
  background-color: var(--accent-gold-hover);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 14px;
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 13px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color var(--transition-fast);
  border: 1px solid var(--border);
  gap: 6px;
}

.btn-secondary:hover {
  background-color: var(--surface-hover);
}

.btn-danger-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 14px;
  background-color: transparent;
  color: var(--error);
  font-weight: 600;
  font-size: 13px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color var(--transition-fast);
  border: 1px solid var(--error);
  gap: 6px;
}

.btn-danger-outline:hover {
  background-color: var(--error-light);
}

.form-error {
  background-color: var(--error-light);
  color: var(--error);
  padding: 10px;
  border-radius: var(--radius-md);
  font-size: 12px;
  margin-bottom: 14px;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ==========================================================================
   ESTILOS DE TELA - LAYOUT DENTRO DO APP (DASHBOARD)
   ========================================================================== */
.dashboard-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  min-height: 100vh;
}

/* Sidebar (Desktop) */
.sidebar {
  background-color: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.sidebar-header {
  margin-bottom: 24px;
}

.sidebar-logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-gold);
}

.sidebar-logo span {
  color: var(--text-primary);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 14px;
  transition: all var(--transition-fast);
  cursor: pointer;
  gap: 10px;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background-color: var(--bg-primary);
}

.nav-link.active {
  border-left: 3px solid var(--accent-gold);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* Container de Conteúdo */
.content-area {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* Scroll suave no iOS */
  overscroll-behavior-y: contain;   /* Evita scroll de bounce vazar para o pai */
}

.header {
  height: 60px;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.main-content {
  padding: 24px;
  flex-grow: 1;
}

/* ==========================================================================
   COMPONENTES DO DASHBOARD
   ========================================================================== */

/* Filtros */
.filters-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
  background-color: var(--surface);
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-sizing: border-box;
  width: 100%;
}

.central-filters-bar {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.5fr 1.5fr;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 16px;
  background-color: var(--surface);
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-sizing: border-box;
  width: 100%;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: flex-end;
  width: 100%;
}

.filter-item .form-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

/* Padronização visual unificada de controles de formulário e filtros */
.input-control,
.select-control,
.search-control,
.month-stepper {
  width: 100%;
  height: 40px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-primary);
  box-sizing: border-box;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-control {
  padding: 0 12px;
}

.input-control:focus,
.select-control:focus,
.search-control:focus {
  border-color: var(--accent-gold);
  outline: none;
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.15);
}

.select-control {
  padding: 0 32px 0 12px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-control option {
  background-color: var(--surface);
  color: var(--text-primary);
}

.search-control-container {
  position: relative;
  width: 100%;
}

.search-control-container i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
}

.search-control {
  padding-left: 34px;
  padding-right: 12px;
}

/* Month Stepper Padronizado */
.month-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.stepper-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--accent-gold);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.stepper-btn:hover {
  background-color: var(--surface-hover);
}

.stepper-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  text-align: center;
  flex-grow: 1;
}

/* Grid de 3 KPIs para Centrais */
.kpis-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
  width: 100%;
}

@media (max-width: 900px) {
  .central-filters-bar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .kpis-grid-3 {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 600px) {
  .central-filters-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
  }
}

/* Cards de KPIs e Agrupamentos Compactos */
.kpi-group-section {
  margin-bottom: 12px;
}

.kpi-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.kpi-group-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.kpi-group-title i {
  color: var(--accent-gold);
  font-size: 11px;
}

.kpis-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 4px;
}

.kpi-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 72px;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 2px;
  line-height: 1.2;
  gap: 6px;
  overflow: hidden;
}

.kpi-header span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.kpi-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--accent-gold);
  flex-shrink: 0;
}

.kpi-value {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.kpi-value.positive {
  color: var(--status-occupied);
}

.kpi-value.negative {
  color: var(--error);
}

.kpi-footer {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  max-width: 100%;
}

/* DRE do Grupo */
.group-dre-container {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
}

.group-dre-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.group-dre-header h3 {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Grade de Imóveis - Design Centralizado no Card */
.properties-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.properties-section-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.properties-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

/* Estilo Flat do Cartão do Imóvel */
.property-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
  cursor: pointer;
  /* Sem transform no estado base — evita stacking context que bloqueia scroll iOS */
  -webkit-tap-highlight-color: transparent;
}

/* Hover apenas em dispositivos que suportam hover real (não touch) */
@media (hover: hover) and (pointer: fine) {
  .property-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--accent-gold);
  }
}

/* Borda lateral de status (Guiado por Cores) */
.property-card.ocupado {
  border-left: 4px solid var(--status-occupied);
}

.property-card.disponivel,
.property-card.disponível {
  border-left: 4px solid var(--status-available);
}

.property-card.na_planta,
.property-card.na-planta {
  border-left: 4px solid #0284C7; /* Azul Turquesa / Obra */
}

.property-card.em_reforma,
.property-card.em-reforma {
  border-left: 4px solid #D97706; /* Âmbar / Reforma */
}

.property-card.uso_proprio,
.property-card.uso-proprio {
  border-left: 4px solid #7C3AED; /* Roxo / Uso Próprio */
}

.property-photo-container {
  height: 120px;
  background-color: var(--bg-tertiary);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.property-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.property-photo-placeholder {
  font-size: 24px;
  color: var(--text-muted);
}

.property-status-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  z-index: 10;
}

.property-status-badge.disponivel,
.property-status-badge.disponível {
  background-color: #1E293B; /* Slate Escuro Sólido */
  color: #FFFFFF;
  border: 1.5px solid #64748B; /* Borda de contraste */
}

.property-status-badge.ocupado {
  background-color: #065F46; /* Verde Escuro Sólido */
  color: #FFFFFF;
  border: 1.5px solid #34D399; /* Borda de contraste */
}

.property-status-badge.na-planta,
.property-status-badge.na_planta {
  background-color: #0369A1; /* Azul Obra Sólido */
  color: #FFFFFF;
  border: 1.5px solid #38BDF8; /* Borda ciano */
}

.property-status-badge.em-reforma,
.property-status-badge.em_reforma {
  background-color: #B45309; /* Âmbar Reforma Sólido */
  color: #FFFFFF;
  border: 1.5px solid #FBBF24;
}

.property-status-badge.uso-proprio,
.property-status-badge.uso_proprio {
  background-color: #5B21B6; /* Roxo Sólido */
  color: #FFFFFF;
  border: 1.5px solid #A78BFA;
}

.property-card-body {
  padding: 16px;
  display: flex;
  flex-grow: 1;
  flex-direction: column;
}

.property-address {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
}

.property-owner-tag {
  font-size: 11px;
  color: var(--accent-gold);
  background-color: rgba(197, 168, 128, 0.08);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 12px;
  font-weight: 600;
}

/* Tabela Plana de Dados Administrativos */
.property-admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  background-color: var(--bg-primary);
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.admin-item {
  display: flex;
  flex-direction: column;
}

.admin-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-val {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Mini DRE do Mês no Card */
.property-mini-dre {
  background-color: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 16px;
}

.mini-dre-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}

.mini-dre-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  padding: 2px 0;
}

.mini-dre-row.total {
  font-weight: 700;
  font-size: 12px;
  border-top: 1px dashed var(--border);
  margin-top: 4px;
  padding-top: 4px;
}

.mini-dre-row .val.pos {
  color: var(--status-occupied);
}

.mini-dre-row .val.neg {
  color: var(--error);
}

/* Botões do Card (Barra de Ações no Rodapé) */
.property-actions-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.card-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 42px;
  border-radius: var(--radius-md);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border);
  gap: 3px;
  transition: all var(--transition-fast);
}

.card-action-btn.receita {
  color: var(--status-occupied);
  background-color: rgba(16, 185, 129, 0.04);
  border-color: rgba(16, 185, 129, 0.12);
}

.card-action-btn.receita:hover {
  background-color: rgba(16, 185, 129, 0.12);
}

.card-action-btn.despesa {
  color: var(--error);
  background-color: rgba(239, 68, 68, 0.04);
  border-color: rgba(239, 68, 68, 0.12);
}

.card-action-btn.despesa:hover {
  background-color: rgba(239, 68, 68, 0.12);
}

.card-action-btn.docs {
  color: var(--info-blue);
  background-color: rgba(59, 130, 246, 0.04);
  border-color: rgba(59, 130, 246, 0.12);
}

.card-action-btn.docs:hover {
  background-color: rgba(59, 130, 246, 0.12);
}

.card-edit-gear-btn {
  background: none;
  border: none;
  padding: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.card-edit-gear-btn:hover {
  color: var(--accent-gold);
  background-color: var(--bg-tertiary);
  transform: rotate(45deg);
}

/* ==========================================================================
   ESTILOS DE MODAIS PLANOS (TASK-BASED MODALS)
   ========================================================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
  visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: visibility var(--transition-fast);
}

.modal.open {
  visibility: visible;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.modal.open .modal-overlay {
  opacity: 1;
}

.modal-content {
  position: relative;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 500px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  opacity: 0;
  transition: all var(--transition-fast);
  z-index: 101;
}

.modal.open .modal-content {
  transform: scale(1);
  opacity: 1;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-close-btn {
  font-size: 22px;
  cursor: pointer;
  color: var(--text-secondary);
  background: none;
  border: none;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* Scroll suave no iOS */
  flex-grow: 1;
}

/* Área de Upload / Drag & Drop */
.upload-zone {
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
  cursor: pointer;
  background-color: var(--bg-primary);
  transition: border-color var(--transition-fast);
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent-gold);
}

.upload-zone-icon {
  font-size: 22px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.upload-zone-text {
  font-size: 12px;
  color: var(--text-secondary);
}

.upload-zone-text span {
  color: var(--accent-gold);
  font-weight: 600;
}

.upload-preview {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.upload-preview-info {
  flex-grow: 1;
  font-size: 11px;
  overflow: hidden;
}

.upload-preview-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-preview-remove {
  cursor: pointer;
  color: var(--error);
  font-size: 14px;
}

/* Tabelas e Containers Planos */
.table-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--bg-primary);
  margin-bottom: 16px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.data-table th {
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.01);
}

.file-link {
  color: var(--info-blue);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.file-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   ELEMENTOS GLOBAIS (LOADERS, TOASTS)
   ========================================================================== */

/* Loaders Skeletons */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--surface-hover) 37%, var(--bg-tertiary) 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.2s ease infinite;
}

@keyframes skeleton-loading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.skeleton-text {
  height: 12px;
  border-radius: 2px;
  margin-bottom: 6px;
  width: 100%;
}

.skeleton-title {
  height: 18px;
  border-radius: 2px;
  margin-bottom: 12px;
  width: 50%;
}

.skeleton-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  height: 280px;
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  max-width: 300px;
}

.toast {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transform: translateY(15px);
  opacity: 0;
  animation: toast-in var(--transition-fast) forwards;
}

@keyframes toast-in {
  to { transform: translateY(0); opacity: 1; }
}

.toast-icon {
  font-size: 14px;
  margin-top: 1px;
}

.toast.success .toast-icon { color: var(--status-occupied); }
.toast.error .toast-icon { color: var(--error); }
.toast.info .toast-icon { color: var(--accent-gold); }

.toast-content {
  flex-grow: 1;
}

.toast-title {
  font-size: 12px;
  font-weight: 700;
}

.toast-desc {
  font-size: 11px;
  color: var(--text-secondary);
}

.toast-close {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 12px;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: all var(--transition-fast);
}

.loading-overlay.active {
  visibility: visible;
  opacity: 1;
}

.loader-content {
  text-align: center;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 12px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   OTIMIZAÇÃO MOBILE (VERSÃO APLICATIVO)
   ========================================================================== */
.bottom-nav {
  display: none;
}

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

.form-grid .full-width {
  grid-column: span 2;
}

@media (max-width: 767px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
    padding-bottom: calc(60px + var(--safe-area-bottom));
  }

  .sidebar {
    display: none;
  }

  .header {
    padding: 0 16px;
    height: 54px;
  }

  .main-content {
    padding: 16px;
  }

  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(56px + var(--safe-area-bottom));
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 50;
    align-items: center;
    justify-content: space-around;
    padding-bottom: var(--safe-area-bottom);
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    flex-grow: 1;
    height: 100%;
    gap: 2px;
  }

  .bottom-nav-item i {
    font-size: 16px;
  }

  .bottom-nav-item.active {
    color: var(--accent-gold);
  }

  .kpis-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 2px;
  }

  .kpi-card {
    padding: 8px 10px;
    min-height: 66px;
    overflow: hidden;
  }

  .kpi-value {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .kpi-header {
    font-size: 10px;
    gap: 4px;
    overflow: hidden;
  }

  .kpi-header span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }

  .kpi-footer {
    font-size: 9px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .filters-bar {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
  }

  .properties-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .form-grid .full-width {
    grid-column: span 1;
  }

  .modal-content {
    width: 95%;
    max-height: 90vh;
  }
}

/* ==========================================================================
   ESTILOS DE DRE CONSOLIDADA E ENDEREÇO DETALHADO (NOVO LAYOUT)
   ========================================================================== */
.group-dre-statement {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.dre-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 14px;
}

.dre-line.positive {
  color: var(--status-occupied);
  background-color: var(--status-occupied-light);
}

.dre-line.negative {
  color: var(--error);
  background-color: var(--error-light);
}

.dre-line .dre-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dre-line .dre-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dre-divider {
  height: 1px;
  background-color: var(--border);
  margin: 4px 0;
}

.dre-line.total {
  font-weight: 700;
  font-size: 15px;
  border: 1px solid var(--border);
  padding: 12px 14px;
}

.dre-line.total.positive {
  border-color: rgba(5, 150, 105, 0.3);
}

.dre-line.total.negative {
  border-color: rgba(220, 38, 38, 0.3);
}

.property-address-sub {
  font-size: 11px;
  color: var(--text-secondary);
  display: block;
  margin-top: 4px;
  font-weight: normal;
}

/* ==========================================================================
   ESTILOS DO SELETOR DE PERÍODO (MONTH STEPPER)
   ========================================================================== */
.month-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px 6px;
  height: 42px;
  box-sizing: border-box;
  width: 100%;
}

.stepper-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.stepper-btn:hover {
  background-color: var(--bg-tertiary);
}

.stepper-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0 4px;
  min-width: 105px;
  text-align: center;
  user-select: none;
  white-space: nowrap;
}

/* ==========================================================================
   ESTILOS DE ETIQUETAS E INSIGHTS VISUAIS
   ========================================================================== */
.property-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.insight-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border: 1px solid transparent;
}

.insight-badge.superavit {
  background-color: var(--status-occupied-light);
  color: var(--status-occupied);
  border-color: rgba(5, 150, 105, 0.2);
}

.insight-badge.deficit {
  background-color: var(--error-light);
  color: var(--error);
  border-color: rgba(220, 38, 38, 0.2);
}

.insight-badge.neutral {
  background-color: var(--status-available-light);
  color: var(--status-available);
  border-color: var(--border);
}

.insight-badge.incomplete {
  background-color: #FEF3C7; /* Amarelo/Laranja claro */
  color: #B45309; /* Amarelo/Laranja escuro profissional */
  border-color: rgba(217, 119, 6, 0.2);
}

.insight-badge.complete {
  background-color: var(--info-blue-light);
  color: var(--info-blue);
  border-color: rgba(29, 78, 216, 0.2);
}

.insight-badge.quitado {
  background-color: var(--status-occupied-light);
  color: var(--status-occupied);
  border-color: rgba(5, 150, 105, 0.2);
}

.insight-badge.financiado {
  background-color: var(--error-light);
  color: var(--error);
  border-color: rgba(220, 38, 38, 0.2);
}

.insight-badge.consorcio {
  background-color: var(--warning-light);
  color: var(--warning);
  border-color: rgba(217, 119, 6, 0.2);
}

.insight-badge.acquisition {
  background-color: rgba(197, 168, 128, 0.08);
  color: var(--accent-gold);
  border-color: rgba(197, 168, 128, 0.25);
}

.insight-badge.na-planta,
.insight-badge.na_planta {
  background-color: rgba(14, 165, 233, 0.12);
  color: #0284C7;
  border-color: rgba(14, 165, 233, 0.35);
}

.insight-badge.em-reforma,
.insight-badge.em_reforma {
  background-color: rgba(245, 158, 11, 0.12);
  color: #D97706;
  border-color: rgba(245, 158, 11, 0.35);
}

.insight-badge.uso-proprio,
.insight-badge.uso_proprio {
  background-color: rgba(139, 92, 246, 0.12);
  color: #7C3AED;
  border-color: rgba(139, 92, 246, 0.35);
}

/* ==========================================================================
   ESTILOS ADICIONAIS DO PANORAMA DO ATIVO (SUMMARY MODAL)
   ========================================================================== */
.btn-primary-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 14px;
  background-color: transparent;
  color: var(--accent-gold);
  font-weight: 600;
  font-size: 13px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid var(--accent-gold);
  gap: 6px;
}

.btn-primary-outline:hover {
  background-color: rgba(147, 118, 78, 0.08);
}

.summary-tab-btn {
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 6px 12px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.summary-tab-btn:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.summary-tab-btn.active {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}



/* ==========================================================================
   ESTILOS DE BOTÃO DE SELEÇÃO DE TEMA NO CABEÇALHO
   ========================================================================== */
.header-theme-btn {
  background: none;
  border: none;
  font-size: 15px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: background-color var(--transition-fast);
  margin-right: 8px;
}

.header-theme-btn:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}


/* ==========================================================================
   ESTILOS DO INDICADOR DE CAMPOS CADASTRAIS (MODAIS)
   ========================================================================== */
.modal-field-indicator {
  font-size: 9px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.modal-field-indicator.filled {
  color: var(--status-occupied);
}

.modal-field-indicator.empty {
  color: #D97706; /* Amarelo/Laranja Escuro */
}

/* ==========================================================================
   TRANSICÕES E ANIMAÇÕES
   ========================================================================== */
.slide-in {
  animation: stepper-slide 0.15s ease-out forwards;
}

@keyframes stepper-slide {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Animações direcionais do Stepper de Período */
.slide-next {
  animation: slide-next-keyframes 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.slide-prev {
  animation: slide-prev-keyframes 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slide-next-keyframes {
  0% {
    opacity: 0;
    transform: translateX(12px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slide-prev-keyframes {
  0% {
    opacity: 0;
    transform: translateX(-12px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Efeito Premium de Carregamento dos Cards */
.property-card {
  opacity: 0;
  animation: card-fade-in-premium 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Em mobile, usa fade simples sem translateY para não criar stacking context */
@media (max-width: 767px) {
  .property-card {
    animation: card-fade-in-simple 0.25s ease forwards;
  }
}

@keyframes card-fade-in-premium {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-fade-in-simple {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Chave Seletora Switch no Rodapé da Sidebar */
.sidebar-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.theme-toggle-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: .3s ease;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: var(--surface);
  transition: .3s ease;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

input:checked + .slider {
  background-color: var(--accent-gold);
}

input:checked + .slider:before {
  transform: translateX(14px);
  background-color: #FFFFFF;
}

/* Mobile Collapsible Filters */
.mobile-only-btn {
  display: none !important;
}

.collapsible-filters-container {
  display: contents;
}

@media (max-width: 768px) {
  .mobile-only-btn {
    display: flex !important;
  }
  
  .collapsible-filters-container {
    display: none;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    grid-column: span 1;
  }
  
  .collapsible-filters-container.expanded {
    display: flex;
  }
  
  .filters-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
}

/* ==========================================================================
   ESTILOS DE LOGS DE AUDITORIA
   ========================================================================== */
.audit-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-align: center;
}

.badge-success {
  background-color: var(--status-occupied-light);
  color: var(--status-occupied);
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.badge-warning {
  background-color: #FFFBEB;
  color: #D97706;
  border: 1px solid rgba(217, 119, 6, 0.2);
}

.badge-danger {
  background-color: var(--error-light);
  color: var(--error);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.badge-info {
  background-color: var(--info-blue-light);
  color: var(--info-blue);
  border: 1px solid rgba(29, 78, 216, 0.2);
}

.audit-resource-tag {
  display: inline-block;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Lightbox de Visualização de Arquivos (File Previewer Overlay) */
.file-previewer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(18, 18, 18, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100000;
  display: flex;
  flex-direction: column;
  animation: fade-in 0.2s ease forwards;
}

.preview-header {
  height: 56px;
  background-color: rgba(30, 30, 30, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  color: #FFFFFF;
}

.preview-title {
  font-weight: 700;
  font-size: 15px;
  max-width: 80%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-close-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 28px;
  cursor: pointer;
  transition: color var(--transition-fast);
  line-height: 1;
}

.preview-close-btn:hover {
  color: #FFFFFF;
}

.preview-body {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
}

.preview-media-img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-media-pdf {
  width: 100%;
  max-width: 1000px;
  height: 85vh;
  border: none;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  background-color: #FFFFFF;
}

.preview-fallback-container {
  text-align: center;
  padding: 48px;
  background-color: rgba(30, 30, 30, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  max-width: 480px;
  color: #FFFFFF;
}

/* Animações de Fade */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ==========================================================================
   ESTILOS DE CONSULTA DE CLIENTES (TENANT SCREENING)
   ========================================================================== */
/* Hover apenas em dispositivos com ponteiro real (não touch) */
@media (hover: hover) and (pointer: fine) {
  .screening-card:hover {
    border-color: var(--accent-gold) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
    background-color: var(--surface-hover) !important;
  }
}

.score-indicator.positive {
  color: #4caf50 !important;
}

.score-indicator.warning {
  color: #ffa726 !important;
}

.score-indicator.negative {
  color: #ef5350 !important;
}

.step-card {
  transition: all var(--transition-fast) ease;
}

.step-card.locked {
  border-color: var(--border) !important;
}

.step-card.active {
  border-color: var(--accent-gold) !important;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.15);
}

.step-card.done {
  border-color: #4caf50 !important;
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.1);
}

.tenant-screening-detail select:disabled, 
.tenant-screening-detail input:disabled, 
.tenant-screening-detail textarea[readonly] {
  opacity: 0.8;
  cursor: not-allowed;
  background-color: var(--bg-tertiary) !important;
  border-color: var(--border) !important;
}

.copy-field-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  padding: 2px;
  transition: color 0.15s ease;
  display: inline-flex;
  align-items: center;
}
.copy-field-icon:hover {
  color: var(--accent-gold);
}

/* Botoes de Acao Unificados - Supertriagem */
.btn-item-action {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-muted);
  font-size: 12px;
  background-color: var(--surface);
}

.btn-item-action:hover {
  background-color: var(--surface-hover);
  border-color: var(--text-muted);
}

.btn-item-action.approve-btn.active {
  background-color: var(--status-occupied-light);
  border-color: var(--status-occupied);
  color: var(--status-occupied);
}

.btn-item-action.reject-btn.active {
  background-color: var(--error-light);
  border-color: var(--error);
  color: var(--error);
}

.btn-item-action.skip-btn.active {
  background-color: var(--bg-tertiary);
  border-color: var(--text-muted);
  color: var(--text-secondary);
}

/* Reutilização de estilos de blocos e etapas da triagem */
.screening-step-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  background-color: var(--surface);
}

.screening-step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.sub-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}
.sub-item-row:last-child {
  margin-bottom: 0;
}

.sub-item-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding-right: 8px;
}

.sub-item-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}

.sub-item-divider {
  width: 1px;
  height: 16px;
  background-color: var(--border);
  margin: 0 2px;
}

/* Botão de Notificação do WhatsApp por Etapa */
.btn-wa-notify {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #25d366 !important;
  background-color: rgba(37, 211, 102, 0.08);
  border: 1px solid rgba(37, 211, 102, 0.3);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast) ease;
}

.btn-wa-notify:hover {
  background-color: rgba(37, 211, 102, 0.15) !important;
  border-color: #25d366 !important;
  box-shadow: 0 1px 4px rgba(37, 211, 102, 0.2);
  transform: translateY(-0.5px);
}

/* Custom Supertriagem Modal Width Sizing */
.modal-content:has(.tenant-screening-detail) {
  max-width: 950px;
  width: 95%;
}

/* Screening Card Layout & Responsive Alignment */
.screening-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.screening-card-main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.screening-card-meta {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.screening-card-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-shrink: 0;
}

.del-screening-btn {
  background-color: rgba(239, 83, 80, 0.08);
  border: 1px solid rgba(239, 83, 80, 0.25);
  color: var(--error);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  font-size: 13px;
  position: relative;
  z-index: 2;
}

.del-screening-btn:hover {
  background-color: var(--error);
  color: #ffffff;
  border-color: var(--error);
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(239, 83, 80, 0.3);
}

.del-screening-btn:active {
  transform: scale(0.96);
}

/* Responsive Screening Card Rules */
@media (max-width: 768px) {
  .screening-card {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px;
  }
  
  .screening-card-main {
    width: 100%;
  }
  
  .screening-card-actions {
    width: 100%;
    justify-content: space-between;
    border-top: 1px dashed var(--border);
    padding-top: 10px;
    gap: 12px;
  }
  
  .screening-card-actions > div {
    text-align: left;
  }
  
  .screening-card-actions > div:nth-child(2) {
    text-align: right;
  }
  
  .screening-card-meta {
    gap: 8px !important;
  }
}

/* Modal Responsive Grid helper */
.modal-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 576px) {
  .modal-grid-2 {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* ==========================================================================
   ESTILOS PARA AS CENTRAIS (DESPESAS & RECEITAS)
   ========================================================================== */
.btn-action-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  white-space: nowrap;
}

.badge-rec {
  background: rgba(212, 160, 23, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(212, 160, 23, 0.3);
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-holding {
  background: rgba(100, 181, 246, 0.15);
  color: #1976d2;
  border: 1px solid rgba(100, 181, 246, 0.3);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
}

.badge-pago {
  background-color: var(--status-occupied-light);
  color: var(--status-occupied);
  border: 1px solid rgba(46, 125, 50, 0.3);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.badge-a-pagar {
  background-color: var(--error-light);
  color: var(--error);
  border: 1px solid rgba(239, 83, 80, 0.3);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.btn-icon-file {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--accent-gold);
  transition: all var(--transition-fast);
}

.btn-icon-file:hover {
  background: var(--accent-gold);
  color: #ffffff;
  transform: scale(1.08);
}
