html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #0f172a;
  background-color: #f8fafc;
  max-width: 100vw;
  overflow-x: hidden;
}
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.auth-card {
  background-color: #fff;
  border: 1px solid #e2e8f0;
  transition: background-color .35s ease, border-color .35s ease, color .35s ease;
}
.auth-tabs { background: #f1f5f9; transition: background-color .35s ease; }
.auth-tab { padding: .7rem .35rem; border-radius: .6rem; color: #64748b; transition: color .25s ease, background-color .25s ease, box-shadow .25s ease; }
.auth-tab:hover { color: #0f172a; }
.auth-tab.is-active { color: #0f172a; background: #fff; box-shadow: 0 1px 3px #0f172a15; }
.auth-card.is-plan { background-color: #065f46; border-color: #059669; color: #fff; }
.auth-card.is-plan .auth-title { color: #fff; }
.auth-card.is-plan #auth-subtitle { color: #d1fae5; }
.auth-card.is-plan .auth-logo { background: #fff; color: #065f46; box-shadow: none; }
.auth-card.is-plan .auth-tabs { background: #ffffff19; }
.auth-card.is-plan .auth-tab { color: #d1fae5; }
.auth-card.is-plan .auth-tab:hover { color: #fff; }
.auth-card.is-plan .auth-tab.is-active { background: #fff; color: #065f46; }
.plan-content { animation: auth-content-in .3s ease both; }
.plan-heading { margin-top: .25rem; }
.plan-eyebrow { color: #a7f3d0; font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.plan-price { margin-top: .35rem; font-size: 2rem; font-weight: 800; letter-spacing: -.04em; line-height: 1.15; }
.plan-price span { color: #d1fae5; font-size: .8rem; font-weight: 500; letter-spacing: normal; }
.plan-heading p { margin-top: .5rem; color: #d1fae5; font-size: .75rem; }
.plan-features { display: grid; gap: .7rem; margin: 1.25rem 0; font-size: .78rem; color: #ecfdf5; }
.plan-features li { display: flex; align-items: center; gap: .7rem; }
.plan-features svg { width: 1.1rem; height: 1.1rem; flex: none; color: #a7f3d0; }
.plan-extras { padding: 1rem; border: 1px solid #ffffff30; border-radius: 1rem; background: #ffffff10; }
.plan-extras-row, .plan-total { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.plan-extras-title { font-size: .8rem; font-weight: 700; }
.plan-extras-caption { margin-top: .25rem; font-size: .65rem; color: #d1fae5; }
.plan-counter { display: flex; align-items: center; gap: .45rem; flex: none; }
.plan-counter button { width: 2rem; height: 2rem; border: 1px solid #ffffff40; border-radius: .6rem; font-size: 1.1rem; line-height: 1; transition: background-color .2s ease; }
.plan-counter button:hover { background: #ffffff24; }
.plan-counter span { min-width: 1.25rem; text-align: center; font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.plan-total { border-top: 1px solid #ffffff30; margin-top: .9rem; padding-top: .9rem; font-size: .7rem; color: #d1fae5; }
.plan-total strong { color: #fff; font-size: .9rem; }
.plan-cta { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; margin-top: 1rem; padding: .9rem; border-radius: .8rem; background: #fff; color: #065f46; font-size: .8rem; font-weight: 700; transition: background-color .2s ease, transform .2s ease; }
.plan-cta:hover { background: #ecfdf5; transform: translateY(-1px); }
.plan-cta svg { width: 1rem; height: 1rem; }
.plan-note { margin-top: .65rem; text-align: center; color: #d1fae5; font-size: .65rem; }
@keyframes auth-content-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .auth-card, .auth-tabs, .auth-tab, .plan-cta { transition: none; }
  .plan-content { animation: none; }
}

/* CABEÇALHO 100% OPACO (ELIMINA O EMBAÇAMENTO DO TOPO DO CELULAR) */
#app-header {
  background-color: #ffffff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.nav-pill {
  background-color: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-pill:hover { border-color: #cbd5e1; color: #0f172a; transform: translateY(-1px); }
.nav-pill.active {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
  border-color: #059669;
  box-shadow: 0 4px 12px -2px rgba(16, 185, 129, 0.35);
}
.nav-pill.active .pill-badge { background-color: rgba(255, 255, 255, 0.25); color: #ffffff; }

.msg-bubble-client {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-top-left-radius: 4px;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.msg-bubble-broker {
  background-color: #dcfce7;
  border: 1px solid #bbf7d0;
  border-top-right-radius: 4px;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.chat-property-card { border-radius: 12px; overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,0.06); border: 1px solid #cbd5e1; background: #ffffff; }
.kanban-column { min-width: 265px; max-width: 265px; }

/* CAIXA DE RESUMO DA IA: FECHADA (1 LINHA) vs EXPANDIDA AO CLICAR */
#ai-realtime-bar {
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}
#ai-summary-text.ai-collapsed {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#ai-summary-text.ai-expanded {
  white-space: normal !important;
  overflow: visible !important;
  display: block !important;
  line-height: 1.5;
  padding-top: 4px;
}

@media (max-width: 767px) {
  #app-header {
    padding-top: max(22px, calc(env(safe-area-inset-top) + 10px)) !important;
    padding-bottom: 10px !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  .nav-pill {
    font-size: 13.5px !important;
    padding: 8px 12px !important;
    border-radius: 14px !important;
  }
  #mobile-chat-section {
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  #chat-messages-container .day-group > div:not(.day-sep) {
    max-width: 84% !important;
    font-size: 13.5px !important;
    line-height: 1.45 !important;
  }
}

/* CONVERSAS: FUNDO POR ETAPA DO FUNIL */
.lead-card { background-color: #ffffff; touch-action: pan-y; user-select: none; -webkit-user-select: none; transition: transform 0.2s ease; will-change: transform; }
.lead-card:hover { filter: brightness(0.97); }
.lead-card.is-selected { box-shadow: inset 4px 0 0 #059669, inset 0 0 0 1px rgba(5, 150, 105, 0.35); }
.lead-bg-new { background-color: #a7f3d0; }
.lead-bg-active { background-color: #ecfdf5; }
.lead-bg-visit { background-color: #fef9c3; }
.lead-bg-proposal { background-color: #ffedd5; }
.lead-bg-closed { background-color: #fee2e2; }
.lead-bg-lost { background-color: #d8c1a8; }

/* CRONÔMETRO DE 1º CONTATO */
.fc-bar { height: 4px; border-radius: 9999px; background: rgba(0, 0, 0, 0.1); overflow: hidden; margin-top: 3px; }
.fc-bar-fill { height: 100%; width: 100%; border-radius: 9999px; transition: width 1s linear, background-color 0.3s; }
.fc-clock { font-variant-numeric: tabular-nums; font-size: 12px; }
.fc-ok .fc-label, .fc-ok .fc-clock { color: #065f46; }
.fc-ok .fc-bar-fill { background: #059669; }
.fc-warn .fc-label, .fc-warn .fc-clock { color: #b45309; }
.fc-warn .fc-bar-fill { background: #f59e0b; }
.fc-danger .fc-label, .fc-danger .fc-clock { color: #b91c1c; }
.fc-danger .fc-bar-fill { background: #dc2626; }
.fc-danger .fc-clock { animation: fc-pulse 1s ease-in-out infinite; }
.fc-paused .fc-label, .fc-paused .fc-clock { color: #64748b; }
.fc-paused .fc-bar-fill { background: #94a3b8; }
@keyframes fc-pulse { 50% { opacity: 0.45; } }

/* CHAT: DATA FLUTUANTE POR DIA (ESTILO WHATSAPP) */
.day-sep { position: sticky; top: 4px; z-index: 5; display: flex; justify-content: center; pointer-events: none; }
.day-sep span { background: rgba(255, 255, 255, 0.95); color: #475569; font-size: 11px; font-weight: 600; padding: 3px 12px; border-radius: 8px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }

/* CHAT: ANEXOS */
.kl-thumb { display: block; width: 220px; max-width: 100%; min-height: 120px; max-height: 260px; object-fit: cover; border-radius: 10px; background: #e2e8f0; }
.kl-att-img, .kl-att-video, .kl-att-file { display: block; cursor: pointer; text-align: left; }
.kl-att-video { position: relative; width: 220px; max-width: 100%; height: 130px; border-radius: 10px; background: #0f172a; color: #fff; }
.kl-att-video .kl-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 34px; opacity: 0.9; }
.kl-att-video .kl-att-meta { position: absolute; left: 8px; right: 8px; bottom: 6px; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kl-att-file { display: flex; align-items: center; gap: 10px; min-width: 200px; max-width: 100%; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.75); }
