/* =============================================
   Tech Corretor – Modern SaaS UI
   ============================================= */

/* ===== Tokens ===== */
:root {
  --bg:          #f4f6fb;
  --sidebar-bg:  #0f172a;
  --sidebar-w:   228px;
  --topbar-h:    64px;
  --white:       #ffffff;
  --border:      #e5e7eb;
  --text:        #111827;
  --text-muted:  #6b7280;
  --text-light:  #9ca3af;
  --primary:     #4f46e5;
  --primary-h:   #4338ca;
  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   14px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow:      0 4px 16px rgba(0,0,0,.08);
  --transition:  .18s ease;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
}

/* Logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.logo-icon { font-size: 1.4rem; }
.logo-text  { color: #fff; font-size: 1.05rem; letter-spacing: .3px; }
.logo-text strong { color: #818cf8; }

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.nav-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #475569;
  padding: 14px 8px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: #94a3b8;
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-item:hover  { background: rgba(255,255,255,.06); color: #e2e8f0; }
.nav-item.active { background: var(--primary); color: #fff; }

/* Footer */
.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 34px; height: 34px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.user-info { display: flex; flex-direction: column; }
.user-name { color: #e2e8f0; font-size: .82rem; font-weight: 600; }
.user-role { color: #64748b; font-size: .72rem; }

/* =============================================
   APP CONTAINER + MAIN WRAPPER
   ============================================= */
#app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* =============================================
   TOPBAR
   ============================================= */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-left { display: flex; flex-direction: column; gap: 1px; }
.page-title  { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.page-sub    { font-size: .77rem; color: var(--text-muted); }
.topbar-right { display: flex; gap: 10px; }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  white-space: nowrap;
}
.btn:hover  { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79,70,229,.35);
}
.btn-primary:hover { background: var(--primary-h); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-outline-sm {
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .78rem;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
}
.btn-outline-sm:hover { border-color: var(--primary); color: var(--primary); background: #f0f0ff; }

/* =============================================
   KPI ROW
   ============================================= */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 24px 28px 0;
}

.kpi-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.kpi-card-clickable {
  cursor: pointer;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.kpi-card-clickable:hover { box-shadow: var(--shadow); border-color: #c7d2fe; }

.kpi-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.kpi-icon svg { width: 20px; height: 20px; }

.kpi-blue   { background: #eff6ff; color: #2563eb; }
.kpi-red    { background: #fef2f2; color: #dc2626; }
.kpi-green  { background: #f0fdf4; color: #16a34a; }
.kpi-purple { background: #f5f3ff; color: #7c3aed; }

.kpi-info { display: flex; flex-direction: column; }
.kpi-value { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.kpi-label { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }

.kpi-badge {
  position: absolute;
  top: 12px; right: 14px;
  font-size: .68rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 99px;
}
.kpi-badge-red    { background: #fef2f2; color: #dc2626; }
.kpi-badge-purple { background: #f5f3ff; color: #7c3aed; }

/* =============================================
   TOOLBAR
   ============================================= */
.toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 20px 28px 0;
}

/* Search */
.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 380px;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-light);
  pointer-events: none;
}
.search-box input {
  width: 100%;
  padding: 9px 36px 9px 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .875rem;
  font-family: inherit;
  background: var(--white);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.search-box input::placeholder { color: var(--text-light); }
.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: .85rem;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
}
.search-clear:hover { color: var(--text); background: var(--bg); }

/* Filter chips */
.filter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.chips-label { font-size: .78rem; color: var(--text-muted); margin-right: 2px; }

.chip {
  padding: 6px 14px;
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.chip-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.chip-red.chip-active    { background: #dc2626; border-color: #dc2626; color: #fff; }
.chip-red:hover          { border-color: #dc2626; color: #dc2626; }
.chip-purple.chip-active { background: #7c3aed; border-color: #7c3aed; color: #fff; }
.chip-purple:hover       { border-color: #7c3aed; color: #7c3aed; }

/* Report actions */
/* =============================================
   TABLE
   ============================================= */
.table-section { padding: 16px 28px 40px; }

.table-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: relative;
}

/* Scroll fade nas laterais da tabela */
.table-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 32px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,.85));
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  z-index: 1;
}
.table-card.is-scrollable::after {
  opacity: 1;
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  position: relative;
  width: 100%;
  min-width: 0;
}

.table-wrapper::-webkit-scrollbar {
  height: 6px;
}
.table-wrapper::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}
.table-wrapper::-webkit-scrollbar-thumb {
  background: #c1c7cd;
  border-radius: 3px;
}
.table-wrapper::-webkit-scrollbar-thumb:hover {
  background: #a0a7ae;
}
.table-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.table-count {
  background: #eff6ff;
  color: #2563eb;
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 99px;
}

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

thead th {
  background: #f9fafb;
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f9fafb; }

tbody td {
  padding: 13px 16px;
  font-size: .845rem;
  color: var(--text);
  white-space: nowrap;
}

/* Primeira coluna – nome em destaque */
tbody td:first-child {
  font-weight: 600;
  color: var(--primary);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Status badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .7;
}
.badge-active  { background: #f0fdf4; color: #16a34a; }
.badge-expired { background: #fef2f2; color: #dc2626; }
.badge-bday    { background: #f5f3ff; color: #7c3aed; }

/* Row highlights */
tbody tr.vencido td:first-child { color: #dc2626; }
tbody tr.aniversariante td:first-child { color: #7c3aed; }

/* Sem resultados */
.sem-resultados {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 56px 20px;
  color: var(--text-light);
}
.sem-resultados p { font-size: .9rem; }

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  animation: modalIn .2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1rem; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-box > p,
#modalTexto {
  padding: 14px 24px 0;
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.modal-lista {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 24px;
}
.modal-lista a {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
  padding: 10px 14px;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: .83rem;
  font-weight: 600;
  transition: background var(--transition);
}
.modal-lista a:hover { background: #dcfce7; }
.modal-footer {
  padding: 14px 24px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}



/* =============================================
   TOAST
   ============================================= */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e293b;
  color: #fff;
  padding: 10px 22px;
  border-radius: 99px;
  font-size: .84rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 999;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =============================================
   SIDEBAR WHATSAPP NAV ITEM
   ============================================= */
.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,.07);
  margin: 8px 12px;
}

.nav-item-wa {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  margin: 0 0 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}
.nav-item-wa:hover { background: rgba(255,255,255,.06); }

.nav-item-wa-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.nav-item-wa-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: rgba(37,211,102,.15);
  color: #25d366;
  transition: background var(--transition);
}
.nav-item-wa-icon svg { width: 16px; height: 16px; }

.nav-item-wa-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.nav-item-wa-label {
  font-size: .8rem;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item-wa-status {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
  overflow: hidden;
}

.nav-item-wa-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background .3s;
}
.nav-item-wa-dot.red    { background: #ef4444; }
.nav-item-wa-dot.green  { background: #22c55e; }
.nav-item-wa-dot.yellow { background: #f59e0b; animation: pulse-dot 1.8s infinite; }

#sidebar-wa-text {
  font-size: .7rem;
  color: #64748b;
  transition: color .3s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item-wa-btn {
  padding: 4px 10px;
  border-radius: 99px;
  border: none;
  font-size: .68rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition);
  background: #25d366;
  color: #fff;
  white-space: nowrap;
}
.nav-item-wa-btn:hover { background: #1ebe5d; }

/* Estado conectado: botão vira ghost */
.nav-item-wa.connected .nav-item-wa-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,.12);
  color: #94a3b8;
  font-size: .65rem;
  padding: 3px 9px;
}
.nav-item-wa.connected .nav-item-wa-btn:hover {
  background: rgba(255,255,255,.06);
  color: #e2e8f0;
}

/* =============================================
   HAMBURGER MENU
   ============================================= */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 4px;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
}

/* Sidebar overlay on mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
}

/* =============================================
   RESPONSIVE — Full mobile-first approach
   ============================================= */

/* ── Extra small / mobile (< 600px) ── */
@media (max-width: 600px) {
  :root {
    --sidebar-w: 220px;
    --topbar-h: 52px;
  }

  body { overflow-x: hidden; }

  .sidebar {
    display: flex;
    transform: translateX(-100%);
    transition: transform .3s ease;
    z-index: 100;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .hamburger { display: flex; }

  /* Sidebar mais compacta no mobile */
  .sidebar-logo { padding: 16px 14px 14px; }
  .sidebar-nav { padding: 10px 8px; }
  .nav-item { padding: 7px 10px; font-size: .8rem; }
  .nav-item svg { width: 15px; height: 15px; }
  .nav-item-wa { padding: 7px 10px; }
  .nav-item-wa-btn { font-size: .62rem; padding: 3px 8px; }
  .nav-item-wa-icon { width: 28px; height: 28px; }
  .nav-item-wa-icon svg { width: 14px; height: 14px; }
  .nav-item-wa-label { font-size: .75rem; }
  #sidebar-wa-text { font-size: .65rem; }

  .main-wrapper { margin-left: 0; }

  .topbar {
    padding: 0 10px;
    height: var(--topbar-h);
  }
  .topbar-left { flex-direction: row; align-items: center; gap: 6px; }
  .topbar-left > div { display: flex; flex-direction: column; gap: 0; min-width: 0; }
  .page-title { font-size: .85rem; }
  .page-sub { font-size: .65rem; }
  .topbar-right .btn-ghost { display: none; }
  .topbar-right { gap: 4px; }
  .topbar-right .btn-primary svg { margin: 0; }
  .topbar-right .btn-primary span { display: none; }

  .kpi-row {
    padding: 10px 10px 0;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .kpi-card { padding: 10px; gap: 8px; border-radius: var(--radius); }
  .kpi-icon { width: 30px; height: 30px; border-radius: var(--radius-sm); }
  .kpi-icon svg { width: 13px; height: 13px; }
  .kpi-value { font-size: 1.05rem; }
  .kpi-label { font-size: .62rem; }
  .kpi-badge { display: none; }

  .toolbar {
    padding: 8px 10px 0;
    gap: 6px;
  }
  .filter-chips { order: 2; width: 100%; }
  .search-box { min-width: 0; max-width: 100%; flex: 1 1 auto; order: 1; }
  .search-box input { padding: 7px 28px 7px 30px; font-size: .78rem; }
  .search-icon { width: 13px; height: 13px; left: 9px; }

  .table-section { padding: 6px 10px 16px; }
  .table-header { padding: 8px 10px; }
  .table-title { font-size: .78rem; }
  .table-header .btn-sm-icon { font-size: .68rem; padding: 4px 7px; }

  /* Mobile: só colunas essenciais (nome, apto, status, ações) */
  thead th:nth-child(2),
  thead th:nth-child(4),
  thead th:nth-child(5),
  thead th:nth-child(6),
  thead th:nth-child(7) { display: none; }
  tbody td:nth-child(2),
  tbody td:nth-child(4),
  tbody td:nth-child(5),
  tbody td:nth-child(6),
  tbody td:nth-child(7) { display: none; }

  thead th { padding: 5px 4px; font-size: .55rem; letter-spacing: .02em; }
  tbody td { padding: 6px 4px; font-size: .68rem; white-space: nowrap; }
  tbody td:first-child { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
  tbody td:nth-child(3) { max-width: 50px; overflow: hidden; text-overflow: ellipsis; }
  td.td-actions { padding-right: 4px !important; }
  .row-actions { opacity: 1; }

  .btn { font-size: .65rem; padding: 3px 6px; }
  .btn-sm-icon { font-size: .65rem; padding: 3px 6px; }
  .btn-primary { box-shadow: none; }

  /* Badges mais compactos no mobile */
  .badge { font-size: .6rem; padding: 1px 6px; gap: 3px; }
  .badge::before { width: 4px; height: 4px; }

  /* Actions icons menores no mobile */
  .btn-icon { width: 24px; height: 24px; }
  .btn-icon svg { width: 11px; height: 11px; }

  .modal-box { max-width: calc(100vw - 16px); margin: 0; }
  .modal-header { padding: 12px 14px 8px; }
  .modal-header h2 { font-size: .82rem; }
  .client-form { padding: 10px 14px 0; }
  .prop-form { padding: 10px 14px 0; }
  .form-row { gap: 6px; margin-bottom: 6px; }
  .form-group { min-width: 100%; flex: 1 1 100%; }
  .form-col-2 { min-width: 100%; }
  .form-group input { padding: 6px 7px; font-size: .78rem; }
  .form-group label { font-size: .68rem; }

  .modal-footer { padding: 8px 14px 12px; }
  .modal-footer .btn { font-size: .72rem; padding: 5px 10px; }

  .props-section { padding: 10px 10px 16px; }
  .props-grid { grid-template-columns: 1fr; gap: 10px; }
  .prop-img, .prop-carousel { height: 150px; }
  .prop-body { padding: 9px; }
  .prop-titulo { font-size: .82rem; }
  .prop-tipo { font-size: .63rem; }
  .prop-detail-item { font-size: .7rem; }
  .prop-desc { font-size: .73rem; }
  .prop-endereco { font-size: .72rem; }
  .prop-footer { flex-wrap: wrap; gap: 4px; }

  .modal-wa { max-width: calc(100vw - 16px); }
  .wa-qr-wrapper { width: 180px; height: 180px; }
  .wa-steps { font-size: .72rem; padding: 8px 10px; }
  .wa-state { padding: 12px; }
  .wa-state h3 { font-size: .85rem; }

  .disparo-lista { max-height: 140px; }
  .disparo-item { padding: 5px 5px; gap: 6px; }

  .confirm-body { padding: 12px 12px 2px; }
  .confirm-icon { font-size: 1.6rem; }

  .modal-lista { padding: 8px 14px; }
  .modal-lista a { font-size: .74rem; padding: 7px 9px; }

  .prop-form textarea { min-height: 50px; font-size: .78rem; }
  .prop-form select { font-size: .78rem; padding: 6px 7px; }
  .modal-prop { max-width: calc(100vw - 16px); }
  .foto-add-btn { min-height: 64px; }
  .fotos-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 5px; }

  .disparo-suggestions { padding: 8px 14px 0; gap: 4px; }
  .sug-btn { font-size: .68rem; padding: 4px 8px; gap: 3px; }

  .disparo-preview { margin: 0 14px 10px; padding: 8px 10px; }
  .disparo-preview textarea { min-height: 70px; font-size: .74rem; }
  .disparo-placeholders-list code { font-size: .62rem; }
  .disparo-clientes-header { padding: 0 14px 4px; }
  .disparo-lista { padding: 0 14px; }
  .disparo-counter { padding: 4px 14px 0; font-size: .72rem; }

  .send-progress { padding: 0 14px; }
  .send-item { padding: 6px 8px; font-size: .76rem; }

  .login-card { padding: 28px 20px 24px; }
  .login-card .login-title { font-size: 1.05rem; }
  .login-card .login-subtitle { font-size: .76rem; margin: 2px 0 16px; }
}

/* ── Small tablets / large phones (600px - 900px) ── */
@media (min-width: 601px) and (max-width: 900px) {
  :root { --topbar-h: 56px; }

  .hamburger { display: flex; }

  .sidebar {
    display: flex;
    transform: translateX(-100%);
    transition: transform .3s ease;
    z-index: 100;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }

  .main-wrapper { margin-left: 0; }

  .topbar {
    padding: 0 16px;
    height: var(--topbar-h);
  }
  .topbar-left { flex-direction: row; align-items: center; gap: 10px; }
  .topbar-left > div { display: flex; flex-direction: column; gap: 0; min-width: 0; }
  .page-title { font-size: .95rem; }
  .page-sub { font-size: .7rem; }
  .topbar-right { gap: 8px; }

  .kpi-row {
    padding: 16px 16px 0;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .kpi-card { padding: 14px; border-radius: var(--radius); }
  .kpi-icon { width: 36px; height: 36px; }
  .kpi-icon svg { width: 16px; height: 16px; }
  .kpi-value { font-size: 1.3rem; }
  .kpi-label { font-size: .7rem; }
  .kpi-badge { display: none; }

  .toolbar {
    padding: 12px 16px 0;
    gap: 10px;
  }
  .filter-chips { order: 2; width: 100%; }
  .search-box { min-width: 0; max-width: 100%; flex: 1 1 auto; order: 1; }

  .table-section { padding: 10px 16px 24px; }
  .table-header { padding: 10px 14px; }

  /* Esconde colunas menos importantes no tablet */
  thead th:nth-child(4),
  thead th:nth-child(5),
  thead th:nth-child(6) { display: none; }
  tbody td:nth-child(4),
  tbody td:nth-child(5),
  tbody td:nth-child(6) { display: none; }

  thead th { padding: 8px 10px; font-size: .66rem; }
  tbody td { padding: 9px 10px; font-size: .78rem; white-space: nowrap; }
  tbody td:first-child { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
  td.td-actions { padding-right: 8px !important; }
  .row-actions { opacity: 1; }

  .btn { font-size: .75rem; padding: 5px 10px; }
  .btn-primary { box-shadow: none; }

  .modal-box { max-width: calc(100vw - 32px); }
  .modal-header { padding: 14px 18px 10px; }
  .modal-header h2 { font-size: .9rem; }
  .client-form { padding: 14px 18px 0; }
  .prop-form { padding: 14px 18px 0; }
  .form-row { gap: 8px; margin-bottom: 8px; }
  .form-group { min-width: calc(50% - 8px); flex: 1 1 auto; }
  .form-col-2 { min-width: 100%; }
  .form-group input { padding: 7px 9px; font-size: .82rem; }
  .form-group label { font-size: .7rem; }

  .modal-footer { padding: 10px 18px 14px; }
  .modal-footer .btn { font-size: .74rem; padding: 6px 12px; }

  .props-section { padding: 14px 16px 28px; }
  .props-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .prop-img, .prop-carousel { height: 160px; }
  .prop-body { padding: 10px; }
  .prop-titulo { font-size: .88rem; }
  .prop-footer { flex-wrap: wrap; gap: 6px; }

  .modal-wa { max-width: calc(100vw - 32px); }
  .wa-qr-wrapper { width: 220px; height: 220px; }

  .disparo-lista { max-height: 180px; }

  .modal-prop { max-width: calc(100vw - 32px); }
  .fotos-grid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
}

/* ── Tablets landscape / small desktop (901px - 1200px) ── */
@media (min-width: 901px) and (max-width: 1200px) {
  :root { --sidebar-w: 200px; }

  .topbar { padding: 0 20px; }

  .kpi-row {
    padding: 20px 20px 0;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }
  .kpi-card { padding: 16px; }
  .kpi-value { font-size: 1.35rem; }

  .toolbar { padding: 16px 20px 0; }

  .search-box { max-width: 340px; }

  .table-section { padding: 12px 20px 30px; }

  /* Até 1400px: esconde colunas menos importantes */
  thead th:nth-child(4),
  thead th:nth-child(5),
  thead th:nth-child(6) { display: none; }
  tbody td:nth-child(4),
  tbody td:nth-child(5),
  tbody td:nth-child(6) { display: none; }

  thead th { padding: 9px 12px; font-size: .68rem; }
  tbody td { padding: 10px 12px; font-size: .8rem; white-space: nowrap; }

  .props-section { padding: 20px 20px 32px; }
  .props-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
}

/* ── Desktop padrão (1201px - 1400px) ── */
@media (min-width: 1201px) and (max-width: 1400px) {
  .topbar { padding: 0 24px; }

  .kpi-row {
    padding: 20px 24px 0;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }
  .kpi-card { padding: 16px; }

  .search-box { max-width: 340px; }

  .table-section { padding: 14px 24px 32px; }

  /* 6 colunas mais confortáveis */
  thead th:nth-child(4),
  thead th:nth-child(5),
  thead th:nth-child(6) { display: none; }
  tbody td:nth-child(4),
  tbody td:nth-child(5),
  tbody td:nth-child(6) { display: none; }

  thead th { padding: 8px 12px; font-size: .68rem; }
  tbody td { padding: 10px 12px; font-size: .82rem; white-space: nowrap; }

  .props-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
  .props-section { padding: 20px 24px 32px; }
}

/* ── Desktop (1401px - 1600px) ── */
@media (min-width: 1401px) and (max-width: 1600px) {
  .topbar { padding: 0 28px; }

  .kpi-row {
    padding: 24px 28px 0;
    gap: 16px;
  }
  .kpi-card { padding: 20px; }

  .search-box { max-width: 380px; }

  .table-section { padding: 16px 28px 40px; }
  thead th { padding: 10px 14px; font-size: .7rem; }
  tbody td { padding: 11px 14px; font-size: .84rem; white-space: nowrap; }

  .props-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
  .props-section { padding: 24px 28px 40px; }
}

/* ── Desktop wide (1601px+) ── */
@media (min-width: 1601px) {
  :root { --sidebar-w: 256px; }

  .topbar { padding: 0 36px; }

  .kpi-row {
    padding: 28px 36px 0;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
  }
  .kpi-card { padding: 24px; }
  .kpi-value { font-size: 1.8rem; }
  .kpi-label { font-size: .8rem; }

  .toolbar { padding: 20px 36px 0; }

  .search-box { max-width: 440px; }

  .table-section { padding: 20px 36px 48px; }
  .table-header { padding: 16px 24px; }
  thead th { padding: 12px 20px; font-size: .75rem; }
  tbody td { padding: 14px 20px; font-size: .88rem; }

  .props-section { padding: 28px 36px 48px; }
  .props-grid { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 24px; }
  .prop-img, .prop-carousel { height: 200px; }
  .prop-body { padding: 18px; }
  .prop-titulo { font-size: 1.05rem; }
  .prop-preco { font-size: 1.15rem; }

  .modal-box { max-width: 580px; }
  .modal-prop { max-width: 720px; }
  .modal-form { max-width: 620px; }
}

/* =============================================
   TABLE HEADER ACTIONS
   ============================================= */
.table-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.btn-sm-icon {
  padding: 7px 14px;
  font-size: .8rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Row actions */
td.td-actions {
  white-space: nowrap;
  width: 1%;
  padding-right: 12px !important;
}
.row-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity var(--transition);
}
tbody tr:hover .row-actions { opacity: 1; }

.btn-icon {
  width: 30px; height: 30px;
  border: none;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--transition);
  background: transparent;
}
.btn-icon svg { width: 14px; height: 14px; }
.btn-icon-edit  { color: var(--primary); }
.btn-icon-edit:hover  { background: #eff6ff; }
.btn-icon-del   { color: #dc2626; }
.btn-icon-del:hover   { background: #fef2f2; }

/* =============================================
   CLIENT FORM MODAL
   ============================================= */
.modal-form  { max-width: 560px; }
.modal-confirm { max-width: 400px; }

.client-form { padding: 20px 24px 0; }

.form-row {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 140px;
}
.form-col-2 { flex: 2; min-width: 200px; }

.form-group label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.req { color: #ef4444; }

.form-group input {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}
.form-group input::placeholder { color: var(--text-light); }
.form-group input.input-error { border-color: #ef4444; }

/* Confirm modal */
.confirm-body {
  padding: 24px 24px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.confirm-icon { font-size: 2.4rem; }
.confirm-body p       { font-size: .9rem; color: var(--text); }
.confirm-body .confirm-sub { font-size: .8rem; color: var(--text-muted); }

.btn-danger {
  background: #dc2626;
  color: #fff;
  border: none;
}
.btn-danger:hover { background: #b91c1c; }

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.4); opacity: .6; }
}

/* =============================================
   WHATSAPP MODAL
   ============================================= */
.modal-wa { max-width: 420px; }

.wa-state {
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.wa-state h3 { font-size: 1rem; font-weight: 700; color: var(--text); }
.wa-state p  { font-size: .85rem; color: var(--text-muted); max-width: 320px; line-height: 1.5; }

/* Illustration */
.wa-illustration {
  width: 80px; height: 80px;
  background: #f0fdf4;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}

/* Steps */
.wa-steps {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wa-steps p {
  font-size: .82rem;
  color: var(--text-muted);
  max-width: none;
}
.wa-steps strong { color: var(--text); }

/* QR */
.wa-qr-wrapper {
  width: 280px; height: 280px;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  position: relative;
}
#wa-qr-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius);
}
.wa-qr-hint { font-size: .75rem !important; color: var(--text-light) !important; }

/* Spinner */
.wa-spinner {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: .82rem;
}
.spinner-ring {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.spinner-green { border-top-color: #25d366; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Connecting */
.wa-connecting {
  display: flex; flex-direction: column;
  align-items: center; gap: 16px;
  padding: 16px 0;
}
.wa-connecting .spinner-ring { width: 56px; height: 56px; }
.wa-connecting h3 { font-size: 1rem; font-weight: 700; }
.wa-connecting p  { font-size: .85rem; color: var(--text-muted); }

/* Connected */
.wa-connected {
  display: flex; flex-direction: column;
  align-items: center; gap: 12px;
  padding: 8px 0;
}
.wa-check {
  width: 64px; height: 64px;
  background: #f0fdf4;
  border: 2px solid #86efac;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  color: #16a34a;
}

/* Error */
.wa-error {
  display: flex; flex-direction: column;
  align-items: center; gap: 12px;
}
.wa-error-icon {
  width: 56px; height: 56px;
  background: #fef2f2;
  border: 2px solid #fca5a5;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  color: #dc2626;
}

/* Buttons */
.btn-wa-lg {
  background: #25d366;
  color: #fff;
  border: none;
  padding: 11px 28px;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-wa-lg:hover { background: #1ebe5d; }
.btn-sm { padding: 6px 14px; font-size: .78rem; }

/* Status bar */
.wa-status-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: var(--text-muted);
}
.wa-dot-sm {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #d1d5db;
  flex-shrink: 0;
}
.wa-dot-sm.green  { background: #22c55e; }
.wa-dot-sm.yellow { background: #f59e0b; animation: pulse-dot 1.8s infinite; }
.wa-dot-sm.red    { background: #ef4444; }

/* =============================================
   SEND MODAL – progress
   ============================================= */
.send-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 24px;
  max-height: 280px;
  overflow-y: auto;
}
.send-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--bg);
  font-size: .82rem;
}
.send-item-name  { flex: 1; color: var(--text); }
.send-item-status { font-size: .75rem; font-weight: 600; white-space: nowrap; }
.send-ok      { color: #16a34a; }
.send-err     { color: #dc2626; }
.send-pending { color: var(--text-light); }

/* Linha de detalhe do erro de cada item */
.send-item-error-detail {
  font-size: .74rem;
  color: #dc2626;
  background: #fef2f2;
  border-left: 3px solid #fca5a5;
  padding: 4px 12px 4px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: -2px 0 2px 0;
}

/* Banners de resumo */
.send-error-banner,
.send-summary-ok,
.send-summary-warn,
.send-summary-err {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: .84rem;
  font-weight: 600;
  margin-top: 2px;
}
.send-error-banner,
.send-summary-err  { background: #fef2f2; color: #dc2626; }
.send-summary-ok   { background: #f0fdf4; color: #16a34a; }
.send-summary-warn { background: #fffbeb; color: #b45309; }

/* Toast variantes */
.toast.toast-ok  { background: #166534; }
.toast.toast-err { background: #991b1b; }

/* =============================================
   PAGES – sistema de navegação
   ============================================= */
.page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100vh;
}

/* =============================================
   PROPERTIES PAGE
   ============================================= */
.props-section {
  flex: 1;
  padding: 24px 28px 40px;
}

.props-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 80px 20px;
  text-align: center;
  color: var(--text-light);
  min-height: 360px;
}
.props-empty p    { font-size: 1rem; font-weight: 600; color: var(--text-muted); }
.props-empty span { font-size: .85rem; color: var(--text-light); }
.props-empty svg  { opacity: .35; }

/* Grid */
.props-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* Card */
.prop-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), transform var(--transition);
}
.prop-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.prop-img {
  width: 100%; height: 180px;
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.prop-img img { width: 100%; height: 100%; object-fit: cover; }
.prop-img-placeholder { color: #818cf8; opacity: .5; }

.prop-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 7px;
}

/* Tipo badge */
.prop-tipo {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .69rem;
  font-weight: 700;
  background: #eff6ff;
  color: #2563eb;
}
.prop-tipo-casa      { background: #f0fdf4; color: #16a34a; }
.prop-tipo-cobertura { background: #fdf4ff; color: #9333ea; }
.prop-tipo-comercial { background: #fff7ed; color: #ea580c; }
.prop-tipo-terreno   { background: #fefce8; color: #ca8a04; }

.prop-titulo {
  font-size: .95rem; font-weight: 700;
  color: var(--text); line-height: 1.3;
}
.prop-endereco {
  font-size: .79rem; color: var(--text-muted);
}
.prop-details {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.prop-detail-item {
  display: flex; align-items: center; gap: 3px;
  font-size: .77rem; color: var(--text-muted); font-weight: 500;
}
.prop-desc {
  font-size: .8rem; color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.prop-footer {
  display: flex; align-items: center;
  justify-content: space-between; gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.prop-preco {
  font-size: 1.05rem; font-weight: 800; color: var(--primary);
}
.prop-actions { display: flex; gap: 4px; align-items: center; }

/* =============================================
   PROPERTY FORM MODAL
   ============================================= */
.modal-prop { max-width: 660px; }

.prop-form { padding: 20px 24px 0; }

.prop-form textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  outline: none;
  resize: vertical;
  min-height: 80px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.prop-form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}

.prop-form select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
  appearance: auto;
}
.prop-form select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}

.foto-add-btn {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px;
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  color: var(--text-light); font-size: .78rem;
  aspect-ratio: 1;
  min-height: 96px;
}
.foto-add-btn:hover { border-color: var(--primary); background: #f0f0ff; color: var(--primary); }

/* =============================================
   DISPARO MODAL
   ============================================= */
.modal-disparo { max-width: 560px; }

/* Suggestions bar */
.disparo-suggestions {
  display: flex;
  gap: 8px;
  padding: 12px 24px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.disparo-suggestions::-webkit-scrollbar { display: none; }

.sug-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 99px;
  border: 1.5px solid var(--border);
  background: var(--white);
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  flex-shrink: 0;
}
.sug-btn:hover { border-color: var(--primary); color: var(--primary); background: #f0f0ff; }
.sug-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.sug-icon { font-size: 1rem; line-height: 1; }

.disparo-preview {
  margin: 0 24px 16px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  padding: 14px 16px;
}
.disparo-preview-title {
  font-size: .75rem; font-weight: 700;
  color: #16a34a;
  text-transform: uppercase; letter-spacing: .04em;
  margin-bottom: 8px;
}
.disparo-preview textarea {
  width: 100%; background: none;
  border: none; outline: none;
  font-size: .83rem; color: var(--text);
  font-family: inherit;
  resize: vertical; min-height: 110px;
  line-height: 1.6;
}

/* Placeholders hint */
.disparo-placeholders {
  margin-top: 8px;
  border-top: 1px solid #bbf7d0;
  padding-top: 6px;
  cursor: pointer;
  user-select: none;
}
.disparo-placeholders-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .7rem;
  color: #16a34a;
  font-weight: 600;
}
.disparo-placeholders-arrow {
  transition: transform .2s;
}
.disparo-placeholders.open .disparo-placeholders-arrow {
  transform: rotate(180deg);
}
.disparo-placeholders-list {
  display: none;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.disparo-placeholders.open .disparo-placeholders-list {
  display: flex;
}
.disparo-placeholders-list code {
  font-family: 'Inter', 'SF Mono', monospace;
  font-size: .7rem;
  background: rgba(22,163,74,.1);
  color: #15803d;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.disparo-clientes-header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 24px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.disparo-clientes-header > span {
  font-size: .82rem; font-weight: 700; color: var(--text);
}
.disparo-clientes-header-btns { display: flex; gap: 6px; }
.disparo-clientes-header-btns .btn { font-size: .74rem; padding: 4px 10px; }

.disparo-lista {
  max-height: 240px; overflow-y: auto;
  padding: 4px 24px;
  display: flex; flex-direction: column; gap: 2px;
}

.disparo-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  user-select: none;
}
.disparo-item:hover { background: var(--bg); }
.disparo-item input[type=checkbox] {
  width: 16px; height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.disparo-item-info { flex: 1; }
.disparo-item-nome { font-size: .84rem; font-weight: 600; color: var(--text); }
.disparo-item-sub  { font-size: .74rem; color: var(--text-muted); }

.disparo-counter {
  font-size: .8rem; color: var(--text-muted);
  padding: 10px 24px 0;
}
.disparo-counter strong { color: var(--primary); }

/* =============================================
   FOTOS GRID – formulário de propriedade
   ============================================= */
.fotos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.foto-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: var(--bg);
}
.foto-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.foto-thumb-remove {
  position: absolute;
  top: 4px; right: 4px;
  width: 20px; height: 20px;
  background: rgba(0,0,0,.55);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: .72rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
  transition: background var(--transition);
}
.foto-thumb-remove:hover { background: #dc2626; }
.foto-thumb-badge {
  position: absolute;
  bottom: 4px; left: 4px;
  background: var(--primary);
  color: #fff;
  font-size: .6rem; font-weight: 700;
  padding: 1px 5px;
  border-radius: 99px;
  pointer-events: none;
}

/* =============================================
   CARROSSEL – card da propriedade
   ============================================= */
.prop-carousel {
  position: relative;
  width: 100%; height: 180px;
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  overflow: hidden;
}
.prop-carousel-track {
  display: flex;
  height: 100%;
  transition: transform .3s ease;
}
.prop-carousel-slide {
  min-width: 100%; height: 100%;
  flex-shrink: 0;
}
.prop-carousel-slide img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.prop-carousel-btn {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.45);
  color: #fff;
  border: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: .9rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
  z-index: 2;
}
.prop-carousel-btn:hover { background: rgba(0,0,0,.7); }
.prop-carousel-btn.prev { left: 8px; }
.prop-carousel-btn.next { right: 8px; }
.prop-carousel-dots {
  position: absolute;
  bottom: 7px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 5px;
  z-index: 2;
}
.prop-carousel-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.55);
  border: none; cursor: pointer;
  transition: background var(--transition);
  padding: 0;
}
.prop-carousel-dot.active { background: #fff; }
.prop-carousel-counter {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(0,0,0,.5);
  color: #fff;
  font-size: .68rem; font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
  z-index: 2;
}

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-page {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  z-index: 9999;
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 40px 36px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  animation: modalIn .4s ease;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 8px;
}
.login-logo { font-size: 2rem; }
.login-brand-text { font-size: 1.2rem; color: var(--text); letter-spacing: .3px; }
.login-brand-text strong { color: var(--primary); }
.login-title {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  margin-top: 16px;
}
.login-subtitle {
  text-align: center;
  font-size: .82rem;
  color: var(--text-muted);
  margin: 4px 0 24px;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.login-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.login-field label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.login-field input {
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.login-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}
.login-error {
  background: #fef2f2;
  color: #dc2626;
  font-size: .8rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  text-align: center;
}
.login-btn {
  width: 100%;
  justify-content: center;
  padding: 11px 16px;
  font-size: .9rem;
  margin-top: 4px;
}
.login-toggle {
  text-align: center;
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: 16px;
}
.login-toggle a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.login-toggle a:hover { text-decoration: underline; }

/* Logout button */
.btn-logout {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.btn-logout:hover {
  background: rgba(255,255,255,.08);
  color: #ef4444;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 14px 16px;
}

/* ==============================================
   CONFIGURAÇÕES
   ============================================== */
.cfg-badge {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 20px;
}
.cfg-badge-local { background: #e0f2fe; color: #0369a1; }
.cfg-badge-cloud { background: #ede9fe; color: #6d28d9; }

.cfg-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.cfg-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.cfg-card-desc {
  font-size: .875rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

.cfg-radio-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.cfg-radio-label:has(input:checked) {
  border-color: var(--primary);
  background: #f5f3ff;
}
.cfg-radio-label input[type="radio"] { margin-top: 3px; accent-color: var(--primary); }
.cfg-radio-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.cfg-radio-icon { font-size: 1.4rem; line-height: 1; }
.cfg-radio-content div { display: flex; flex-direction: column; gap: 2px; }
.cfg-radio-content strong { font-size: .9rem; color: var(--text); }
.cfg-radio-content span { font-size: .8rem; color: var(--text-muted); }

.cfg-input-label { font-size: .85rem; font-weight: 600; color: var(--text); }
.cfg-input {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  width: 100%;
  outline: none;
  transition: border-color var(--transition);
}
.cfg-input:focus { border-color: var(--primary); }
.cfg-input-hint { font-size: .78rem; color: var(--text-muted); }

.cfg-steps {
  font-size: .875rem;
  color: var(--text);
  line-height: 1.8;
  padding-left: 20px;
  margin: 12px 0;
}
.cfg-steps li { margin-bottom: 4px; }
.cfg-code {
  background: #1e293b;
  color: #7dd3fc;
  font-family: 'Courier New', monospace;
  font-size: .8rem;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 8px 0;
  white-space: pre-wrap;
  word-break: break-all;
}

