/* ═══════════════════════════════════════════════════════════════
   CRM IMOB — Design System v2
   Dark-first. Tokens mapeados sobre os nomes antigos para zero
   quebra de referências JS/HTML existentes.
   ═══════════════════════════════════════════════════════════════ */

/* ── TOKENS: DARK (padrão) ─────────────────────────────────── */
:root {
  /* superfícies */
  --bg:    #0D0F14;
  --panel: #1C2030;
  --white: #141720;
  --bg-hover: #222640;
  --border: #2A2F45;
  --border-subtle: #1E2338;

  /* texto */
  --ink:   #F0F2FF;
  --ink2:  #8B91B0;
  --muted: #565D7A;

  /* brand / accent-primary */
  --brand:       #6C63FF;
  --brand-hover: #7C74FF;
  --brand-50:    rgba(108,99,255,.10);
  --brand-100:   rgba(108,99,255,.15);
  --brand-200:   rgba(108,99,255,.25);
  --brand-300:   #565D7A;
  --brand-400:   #8B7FFF;
  --brand-500:   #6C63FF;
  --brand-600:   #6C63FF;
  --brand-700:   #7C74FF;
  --gold:  #6C63FF;
  --gold2: #8B7FFF;

  /* semânticas */
  --green:        #22C984; --green-bg:  rgba(34,201,132,.12); --green-border: rgba(34,201,132,.25);
  --amber:        #FF8C42; --amber-bg:  rgba(255,140,66,.12);  --amber-border: rgba(255,140,66,.25);
  --red:          #FF4D6A; --red-bg:    rgba(255,77,106,.12);  --red-border:   rgba(255,77,106,.25);
  --blue:         #3B9EFF; --blue-bg:   rgba(59,158,255,.12);  --blue-border:  rgba(59,158,255,.25);
  --yellow:       #FFD166; --yellow-bg: rgba(255,209,102,.12);

  /* sombras */
  --shadow-sm: 0 2px 8px  rgba(0,0,0,.35);
  --shadow-md: 0 4px 20px rgba(0,0,0,.45);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.55);
  --shadow-glow: 0 4px 24px rgba(108,99,255,.35);

  /* raios */
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  14px;
  --r-xl:  16px;
  --r-full: 999px;

  /* fontes */
  --font-display: 'Sora', -apple-system, sans-serif;
  --font-sans:    'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* sidebar */
  --sidebar-nav-w: 220px;
  --sidebar-icon-w: 60px;
}

/* ── TOKENS: LIGHT ─────────────────────────────────────────── */
[data-theme="light"] {
  --bg:    #F4F6FB;
  --panel: #EEF1FA;
  --white: #FFFFFF;
  --bg-hover: #E8ECFA;
  --border: #D8DDF0;
  --border-subtle: #E8ECF8;

  --ink:   #0D0F1E;
  --ink2:  #4A5070;
  --muted: #8A90AA;

  --brand:       #5B52F0;
  --brand-hover: #4B42E0;
  --brand-50:    rgba(91,82,240,.07);
  --brand-100:   rgba(91,82,240,.11);
  --brand-200:   rgba(91,82,240,.18);
  --brand-300:   #8A90AA;
  --brand-400:   #7B73F5;
  --brand-500:   #5B52F0;
  --brand-600:   #5B52F0;
  --brand-700:   #4B42E0;
  --gold:  #5B52F0;
  --gold2: #7B73F5;

  --green:  #18B576; --green-bg:  rgba(24,181,118,.10); --green-border: rgba(24,181,118,.22);
  --amber:  #F07A32; --amber-bg:  rgba(240,122,50,.10);  --amber-border: rgba(240,122,50,.22);
  --red:    #E83A55; --red-bg:    rgba(232,58,85,.10);   --red-border:   rgba(232,58,85,.22);
  --blue:   #2D8EF0; --blue-bg:   rgba(45,142,240,.10);  --blue-border:  rgba(45,142,240,.22);
  --yellow: #F0C040; --yellow-bg: rgba(240,192,64,.10);

  --shadow-sm: 0 2px 8px  rgba(0,0,0,.07);
  --shadow-md: 0 4px 20px rgba(0,0,0,.11);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.14);
  --shadow-glow: 0 4px 24px rgba(91,82,240,.28);
}

/* ── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%; overflow: hidden;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -.01em;
  transition: background 300ms ease, color 200ms ease;
}
body { display: flex; }

/* inputs herdam esquema de cores no dark mode */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: rgba(255,255,255,0.05) !important;
  color: var(--ink) !important;
  border-color: rgba(255,255,255,0.12) !important;
}
[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
  background: rgba(255,255,255,0.08) !important;
  border-color: var(--brand-600) !important;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.18) !important;
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: var(--muted) !important; }
[data-theme="dark"] .modal      { background: var(--white); }
[data-theme="dark"] .modal-head { background: var(--white); }
[data-theme="dark"] .modal-foot { background: var(--white); }
[data-theme="dark"] .modal-overlay { background: rgba(0,0,0,.7); }
[data-theme="dark"] .tbl thead tr  { background: var(--panel); }
[data-theme="dark"] .tbl tbody tr:hover { background: var(--bg-hover) !important; }
[data-theme="dark"] .cal-chip    { filter: brightness(.85); }
[data-theme="dark"] #btn-efetivar { background: var(--green-bg) !important; color: var(--green) !important; border: 1px solid var(--green-border) !important; }
[data-theme="dark"] #gerar-contrato-menu { background: var(--panel) !important; }
[data-theme="dark"] .alert-item:hover   { background: var(--panel) !important; }
[data-theme="dark"] .sb-inner { background: var(--white); border-right-color: var(--border-subtle); }

/* ══════════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════════ */
.sidebar {
  flex-shrink: 0;
  position: relative;
  z-index: 100;
  transition: width 250ms ease;
}
.sb-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
  backdrop-filter: blur(2px);
}
.sidebar.open .sb-overlay { display: block; }

.sb-inner {
  width: var(--sidebar-nav-w);
  background: var(--white);
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid var(--border-subtle);
  overflow: hidden;
  position: relative; z-index: 100;
  transition: width 250ms ease;
}
.sidebar.sb-collapsed .sb-inner { width: var(--sidebar-icon-w); }

.nav-scroll { flex: 1; overflow-y: auto; min-height: 0; }

/* ── sb-header (logo) ── */
.sb-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0; min-height: 64px;
}
.rail-logo {
  width: 32px; height: 32px; min-width: 32px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--brand-600), var(--blue));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700;
  font-size: 14px; color: #fff;
  box-shadow: 0 4px 12px rgba(108,99,255,.35);
  flex-shrink: 0;
}
.sb-logo-text {
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  color: var(--ink); white-space: nowrap; overflow: hidden;
  margin-left: 10px; flex: 1;
}
.sb-logo-text span { color: var(--brand-600); }
.sb-close {
  display: none;
  background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 4px 8px;
  border-radius: var(--r-sm); line-height: 1; transition: all .15s;
}
.sb-close:hover { background: var(--bg-hover); color: var(--ink); }

/* collapse button — inline no cabeçalho da seção Principal */
.sb-collapse-btn {
  width: 22px; height: 22px; border-radius: 6px;
  background: transparent; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted);
  transition: all 150ms; flex-shrink: 0;
}
.sb-collapse-btn:hover { background: var(--brand-50); color: var(--brand-600); border-color: var(--brand-600); }
.sb-collapse-btn svg { width: 12px; height: 12px; stroke-width: 2.5; }
@media (max-width: 768px) { .sb-collapse-btn { display: none; } }

/* collapsed: hide labels, sections labels, user info */
.sidebar.sb-collapsed .nav-item-label,
.sidebar.sb-collapsed .nav-section-label,
.sidebar.sb-collapsed .nav-user-info,
.sidebar.sb-collapsed .sb-logo-text,
.sidebar.sb-collapsed .nav-count,
.sidebar.sb-collapsed .btn-logout-label { display: none; }
.sidebar.sb-collapsed .nav-item { justify-content: center; padding: 10px; }
.sidebar.sb-collapsed .nav-section { padding-top: 8px; padding-bottom: 2px; }
.sidebar.sb-collapsed .nav-user { justify-content: center; padding: 12px 8px; }
.sidebar.sb-collapsed .nav-user-row { justify-content: center; }

/* collapsed: logo centralizado, esconde texto e breadcrumb */
.sidebar.sb-collapsed .sb-logo-info { display: none; }
.sidebar.sb-collapsed .sb-header-btns { display: none; }
.sidebar.sb-collapsed .sb-breadcrumb { display: none; }
.sidebar.sb-collapsed .sb-header {
  align-items: center !important;
  flex-direction: row !important;
  justify-content: center;
  padding: 14px 8px !important;
  gap: 0 !important;
}

/* ── nav-user ── */
.nav-user {
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.nav-user-row { display: flex; align-items: center; gap: 10px; }
.nav-user-avatar {
  width: 36px; height: 36px; min-width: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-600), var(--blue));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 13px; font-weight: 700;
  color: #fff; flex-shrink: 0;
}
.nav-user-info { overflow: hidden; min-width: 0; }
.nav-user-name  { font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-user-email { font-size: 11px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── nav sections ── */
.nav-section { padding: 14px 10px 4px; }
.nav-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 6px 8px; gap: 6px;
}
.nav-section-label {
  font-size: 10px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--muted); white-space: nowrap; overflow: hidden; flex: 1;
}
/* collapsed: oculta label mas mantém botão de expandir centralizado */
.sidebar.sb-collapsed .nav-section-header { justify-content: center; padding: 0 0 8px; }
.sidebar.sb-collapsed .nav-section:not(:first-child) .nav-section-header { display: none; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px;
  font-size: 13px; font-weight: 400;
  color: var(--ink2); cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
  border: none; background: none; width: 100%; text-align: left;
  margin-bottom: 2px; position: relative;
  font-family: var(--font-sans);
  animation: slideInLeft 300ms ease both;
}
.nav-item:hover { background: var(--bg-hover); color: var(--ink); }
.nav-item.active {
  background: var(--brand-50);
  color: var(--brand-600);
  border-left: 3px solid var(--brand-600);
  padding-left: 7px;
  font-weight: 500;
}
.nav-item.disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }

.nav-item-icon {
  display: flex; align-items: center; justify-content: center;
  width: 16px; min-width: 16px; flex-shrink: 0;
}
.nav-item-icon svg { width: 16px; height: 16px; stroke-width: 1.8; }
.nav-item-label { flex: 1; white-space: nowrap; overflow: hidden; }

.nav-count {
  margin-left: auto; font-size: 10px; font-weight: 600;
  background: var(--brand-100); color: var(--brand-600);
  padding: 2px 7px; border-radius: 20px; flex-shrink: 0;
}
.nav-count.red   { background: var(--red-bg);   color: var(--red); }
.nav-count.gold  { background: var(--brand-100); color: var(--brand-600); }
.nav-coming { margin-left: auto; font-size: 9px; color: var(--muted); background: var(--panel); padding: 1px 5px; border-radius: 3px; }

/* wa badge */
#nav-wa-badge {
  display: inline-flex !important; align-items: center; justify-content: center;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green) !important; margin-left: auto;
  flex-shrink: 0;
}

/* ── footer ── */
.nav-footer { margin-top: auto; padding: 10px; border-top: 1px solid var(--border-subtle); flex-shrink: 0; }
.btn-logout {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 10px; border-radius: 8px;
  border: none; background: none; font-family: var(--font-sans);
  font-size: 13px; color: var(--muted); cursor: pointer; transition: all .15s;
}
.btn-logout:hover { background: var(--red-bg); color: var(--red); }
.btn-logout .nav-item-icon svg { stroke-width: 1.8; }

/* ══════════════════════════════════════════════════════════════
   HEADER / TOPBAR
   ══════════════════════════════════════════════════════════════ */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  height: 56px;
  background: var(--panel);
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center;
  gap: 0; padding: 0 16px 0 0;
  flex-shrink: 0; position: relative;
}

/* ── Logo ── */
.tb-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 0 18px;
  height: 100%;
  flex-shrink: 0;
}
.tb-logo-mark {
  width: 30px; height: 30px; border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--brand-600), var(--blue));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  color: #fff; box-shadow: 0 4px 12px rgba(108,99,255,.35); flex-shrink: 0;
}
.tb-logo-info { display: flex; flex-direction: column; gap: 1px; }
.tb-logo-name {
  font-family: var(--font-display); font-size: 14px; font-weight: 600;
  color: var(--ink); line-height: 1; white-space: nowrap;
}
.tb-logo-badge {
  font-size: 9px; font-weight: 600; letter-spacing: .08em;
  color: var(--brand-600); line-height: 1; white-space: nowrap;
  text-transform: uppercase;
}

/* ── Divisor vertical ── */
.tb-sep {
  width: 1px; height: 28px;
  background: var(--border); flex-shrink: 0; margin-right: 4px;
}

/* ── Hamburger / toggle sidebar ── */
.hamburger {
  background: none; border: none; cursor: pointer;
  color: var(--ink2); padding: 7px; border-radius: 8px;
  flex-shrink: 0; margin-right: 4px;
  display: flex; align-items: center; justify-content: center;
  transition: all 150ms;
}
.hamburger:hover { background: var(--bg-hover); color: var(--ink); }
.hamburger svg { width: 17px; height: 17px; stroke-width: 2; display: block; }

/* Hamburger FAB — botao flutuante que aparece so em mobile pra reabrir
   a sidebar quando ela esta fechada (topbar foi removida em v9.9.2). */
.hamburger-fab {
  display: none;
  position: fixed;
  top: 12px; left: 12px;
  width: 42px; height: 42px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  color: var(--ink);
  align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  z-index: 50; /* abaixo do sb-overlay (99) pra ficar escondido quando sidebar abre */
  transition: transform .15s ease, box-shadow .15s ease;
}
.hamburger-fab:active { transform: scale(.94); }
.hamburger-fab svg { width: 22px; height: 22px; stroke-width: 2.2; }
@media (max-width: 768px) { .hamburger-fab { display: flex; } }

/* ── Topbar Left (hamburger + breadcrumb) ── */
.topbar-left { display: flex; align-items: center; gap: 2px; }

/* ── Breadcrumb ── */
.tb-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px;
}
.tb-crumb {
  color: var(--muted); font-weight: 400;
  cursor: default; white-space: nowrap;
}
.tb-crumb-sep { color: var(--border); font-size: 14px; user-select: none; }
.tb-crumb-active {
  color: var(--ink); font-weight: 600; white-space: nowrap;
}

/* ── Topbar Right ── */
.topbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* ── Search bar ── */
.tb-search {
  display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 10px 0 12px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-md); cursor: text;
  transition: border-color 150ms, box-shadow 150ms;
  min-width: 240px; max-width: 360px;
}
.tb-search:focus-within {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px var(--brand-50);
}
.tb-srch-icon { width: 14px; height: 14px; color: var(--muted); flex-shrink: 0; stroke-width: 2; }
.tb-search input {
  flex: 1; background: none; border: none; outline: none;
  font-family: var(--font-sans); font-size: 12.5px; color: var(--ink);
  min-width: 0;
}
.tb-search input::placeholder { color: var(--muted); }
.tb-kbd {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  color: var(--muted); background: var(--bg); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 5px; white-space: nowrap; flex-shrink: 0;
  line-height: 16px;
}

/* ── Icon buttons ── */
.btn-icon-header {
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--border); background: transparent;
  color: var(--ink2); display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 150ms; position: relative; flex-shrink: 0;
}
.btn-icon-header:hover { background: var(--bg-hover); color: var(--ink); border-color: var(--brand-600); }
.btn-icon-header svg { width: 15px; height: 15px; stroke-width: 1.8; }
.notif-dot-hdr {
  position: absolute; top: 5px; right: 5px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); border: 2px solid var(--panel);
  pointer-events: none;
}

/* ── "+ Novo processo" button ── */
.btn-novo {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  background: var(--brand-600); color: #fff;
  border: none; border-radius: var(--r-md);
  font-family: var(--font-sans); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 200ms;
  white-space: nowrap; box-shadow: var(--shadow-sm); flex-shrink: 0;
}
.btn-novo:hover { background: var(--brand-hover); transform: translateY(-1px); box-shadow: var(--shadow-glow); }
.btn-novo:active { transform: translateY(0); }
.btn-novo svg { width: 15px; height: 15px; stroke-width: 2.5; }

/* ══════════════════════════════════════════════════════════════
   CONTENT
   ══════════════════════════════════════════════════════════════ */
.content { flex: 1; overflow-y: auto; padding: 24px 28px 40px; }

/* ── PAGE HEADER ── */
.page-header { margin-bottom: 24px; }
.page-header h1 {
  font-family: var(--font-display); font-size: 34px; font-weight: 300;
  color: var(--ink); line-height: 1.05; letter-spacing: -.02em;
}
.page-header h1 em { font-style: italic; font-weight: 700; color: var(--brand-600); }
.page-header p { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ── IA STRIP ── */
.ia-strip {
  display: none; align-items: center; gap: 8px;
  padding: 7px 28px; font-size: 12px;
  background: var(--brand-50); border-bottom: 1px solid var(--brand-200);
  color: var(--brand-600); flex-shrink: 0;
}
.ia-strip-clear {
  margin-left: auto; cursor: pointer; font-size: 11px; font-weight: 600;
  color: var(--muted); padding: 2px 8px; border-radius: var(--r-sm);
  border: none; background: none; font-family: var(--font-sans); transition: all .12s;
}
.ia-strip-clear:hover { background: var(--brand-100); color: var(--brand-600); }

/* ── SECTION LABEL ── */
.section-label {
  font-size: 11px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border-subtle); }

/* ══════════════════════════════════════════════════════════════
   KPI / STAT CARDS
   ══════════════════════════════════════════════════════════════ */
.stats-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 28px; }

.stat-card {
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl); padding: 20px 22px;
  position: relative; overflow: hidden;
  cursor: pointer;
  transition: transform 250ms ease, box-shadow 250ms ease;
  animation: fadeUpIn 400ms ease both;
}
.stat-card:nth-child(1) { animation-delay: 0ms; }
.stat-card:nth-child(2) { animation-delay: 80ms; }
.stat-card:nth-child(3) { animation-delay: 160ms; }
.stat-card:nth-child(4) { animation-delay: 240ms; }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

/* topo colorido */
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}
.stat-card.total::before     { background: var(--brand-600); }
.stat-card.andamento::before { background: var(--blue); }
.stat-card.concluido::before { background: var(--green); }
.stat-card.cancelado::before { background: var(--amber); }

.stat-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.stat-label { font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.stat-top .stat-label { margin-bottom: 0; }

.stat-chip {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.stat-chip svg { width: 20px; height: 20px; stroke-width: 1.8; }
.stat-card.total     .stat-chip { background: var(--brand-50);  color: var(--brand-600); }
.stat-card.andamento .stat-chip { background: var(--blue-bg);   color: var(--blue); }
.stat-card.concluido .stat-chip { background: var(--green-bg);  color: var(--green); }
.stat-card.cancelado .stat-chip { background: var(--amber-bg);  color: var(--amber); }

.stat-num {
  font-family: var(--font-display); font-size: 44px; font-weight: 700;
  line-height: 1; letter-spacing: -2px; margin-bottom: 10px;
}
.stat-card.total     .stat-num { color: var(--brand-600); }
.stat-card.andamento .stat-num { color: var(--blue); }
.stat-card.concluido .stat-num { color: var(--green); }
.stat-card.cancelado .stat-num { color: var(--amber); }

.stat-foot { font-size: 11px; color: var(--muted); margin-top: 2px; }
.stat-sub  { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.stat-sub-item       { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.stat-sub-item::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.stat-sub-item.green { color: var(--green); }
.stat-sub-item.green::before { background: var(--green); }
.stat-sub-item.blue  { color: var(--blue); }
.stat-sub-item.blue::before  { background: var(--blue); }
.stat-sub-item.red   { color: var(--red); }
.stat-sub-item.red::before   { background: var(--red); }
.stat-sub-sep { font-size: 11px; color: var(--border); }

/* ── FUNIL ── */
.funil-row { display: flex; flex-direction: column; gap: 10px; padding: 16px 20px; }
.funil-item { display: flex; flex-direction: column; gap: 5px; }
.funil-meta { display: flex; justify-content: space-between; align-items: center; }
.funil-label { font-size: 12px; font-weight: 500; color: var(--ink2); }
.funil-val   { font-size: 12px; font-weight: 600; color: var(--muted); font-family: var(--font-mono); }
.funil-bar-bg   { height: 6px; background: var(--panel); border-radius: 99px; overflow: hidden; }
.funil-bar-fill { height: 100%; border-radius: 99px; transition: width .6s cubic-bezier(.4,0,.2,1); }
.funil-bar-fill.brand { background: linear-gradient(90deg, var(--brand-500), #9B8FFF); }
.funil-bar-fill.green { background: var(--green); }
.funil-bar-fill.red   { background: var(--red); }
.funil-bar-fill.amber { background: var(--amber); }

/* ══════════════════════════════════════════════════════════════
   GRID / CARDS
   ══════════════════════════════════════════════════════════════ */
.grid-main { display: grid; grid-template-columns: 1fr 300px; gap: 16px; }

.card {
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border-subtle);
}
.card-head h2 { font-size: 13px; font-weight: 500; color: var(--ink); }
.btn-sm {
  font-size: 11.5px; color: var(--muted); background: none; border: none;
  cursor: pointer; font-family: var(--font-sans); transition: all .15s;
  padding: 4px 8px; border-radius: var(--r-sm);
}
.btn-sm:hover { color: var(--brand-600); background: var(--brand-50); }

/* ── Dashboard — Cards de imóveis ── */
/* Dashboard — grid de imóveis recentes (reutiliza classes .im-card da tela de imóveis) */
.dash-im-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  padding: 16px;
}
@media (max-width: 700px) {
  .dash-im-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; padding: 10px; }
}
.dash-im-empty {
  grid-column: 1/-1; text-align: center;
  padding: 32px; color: var(--muted); font-size: 13px;
}

.cp-tab { border: 1px solid var(--border) !important; color: var(--muted) !important; }
.cp-tab.active { background: var(--brand-50) !important; color: var(--brand-600) !important; border-color: var(--brand-200) !important; font-weight: 600 !important; }

/* ══════════════════════════════════════════════════════════════
   SEARCH / FILTER
   ══════════════════════════════════════════════════════════════ */
.tbl-wrap { overflow-x: auto; }

.search-inp {
  padding: 8px 13px; border: 1.5px solid var(--border); border-radius: var(--r-md);
  font-size: 13px; font-family: var(--font-sans); background: var(--panel);
  color: var(--ink); outline: none; width: 210px; transition: border-color .15s, box-shadow .15s;
}
.search-inp:focus { border-color: var(--brand-600); box-shadow: 0 0 0 4px var(--brand-50); background: var(--white); }
.sel-filt {
  padding: 8px 13px; border: 1.5px solid var(--border); border-radius: var(--r-md);
  font-size: 13px; font-family: var(--font-sans); background: var(--panel);
  color: var(--ink); outline: none; cursor: pointer; transition: border-color .15s;
}
.sel-filt:focus { border-color: var(--brand-600); box-shadow: 0 0 0 4px var(--brand-50); }

/* ══════════════════════════════════════════════════════════════
   PAGINAÇÃO
   ══════════════════════════════════════════════════════════════ */
.pag-ctrl { display:flex; align-items:center; gap:8px; padding:10px 0; justify-content:flex-end; flex-wrap:wrap; }
.pag-btn  { padding:5px 12px; border:1px solid var(--border); border-radius:6px; background:var(--panel); cursor:pointer; font-size:13px; color:var(--ink2); font-family:var(--font-sans); transition:all .15s; }
.pag-btn:hover:not([disabled]) { background:var(--brand-50); border-color:var(--brand-400); color:var(--brand-600); }
.pag-btn[disabled] { opacity:.4; cursor:default; }
.pag-pg   { font-size:13px; color:var(--muted); padding:0 4px; }
.pag-info { font-size:12px; color:var(--muted); margin-right:auto; }

/* ══════════════════════════════════════════════════════════════
   TABLE
   ══════════════════════════════════════════════════════════════ */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  font-size: 10.5px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted); padding: 10px 18px; text-align: left;
  border-bottom: 1px solid var(--border-subtle); background: var(--panel);
  white-space: nowrap;
}
.tbl td {
  padding: 12px 18px; font-size: 13px;
  border-bottom: 1px solid var(--border-subtle); vertical-align: middle;
  color: var(--ink2);
}
.tbl tbody tr { cursor: pointer; transition: background 120ms; }
.tbl tbody tr:hover { background: var(--bg-hover); }
.tbl tr:last-child td { border-bottom: none; }
.tbl-main { font-weight: 500; color: var(--ink); font-size: 13px; }
.tbl-sub  { font-size: 11.5px; color: var(--muted); margin-top: 2px; font-family: var(--font-mono); }

/* ══════════════════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 500; border: 1px solid transparent;
  font-family: var(--font-sans);
}
.b-and { background: var(--brand-50);  color: var(--brand-600); border-color: var(--brand-200); }
.b-con { background: var(--green-bg);  color: var(--green);     border-color: var(--green-border); }
.b-can { background: var(--red-bg);    color: var(--red);       border-color: var(--red-border); }
.b-res { background: var(--brand-50);  color: var(--brand-600); border-color: var(--brand-200); }
.b-com { background: var(--green-bg);  color: var(--green);     border-color: var(--green-border); }
.b-tem { background: var(--amber-bg);  color: var(--amber);     border-color: var(--amber-border); }
.b-ind { background: var(--blue-bg);   color: var(--blue);      border-color: var(--blue-border); }

/* ponto pulsante para "em andamento" */
.b-and::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand-600);
  animation: pulse-dot 1.8s ease-in-out infinite;
}

/* ══════════════════════════════════════════════════════════════
   PROGRESS
   ══════════════════════════════════════════════════════════════ */
.prog-wrap  { display: flex; align-items: center; gap: 8px; }
.prog-bar   { height: 6px; width: 70px; background: var(--panel); border-radius: 99px; overflow: hidden; }
.prog-fill  { height: 100%; background: linear-gradient(90deg, var(--brand-500), #9B8FFF); border-radius: 99px; }
.prog-label { font-size: 11px; color: var(--muted); font-family: var(--font-mono); }

/* ══════════════════════════════════════════════════════════════
   IA SEARCH (topbar search box)
   ══════════════════════════════════════════════════════════════ */
.ia-search-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  flex: 1; max-width: 480px; margin: 0 16px;
}
.ia-search-box {
  display: flex; align-items: center;
  background: var(--panel); border: 1.5px solid var(--border);
  border-radius: var(--r-full); padding: 0 4px 0 12px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.ia-search-box:focus-within { border-color: var(--brand-600); box-shadow: 0 0 0 4px var(--brand-50); background: var(--white); }
.ia-sparkle { font-size: 13px; margin-right: 6px; flex-shrink: 0; opacity: .7; }
.ia-input {
  flex: 1; border: none; background: transparent;
  font-family: var(--font-sans); font-size: 13px; color: var(--ink);
  outline: none; padding: 8px 0; min-width: 0;
}
.ia-input::placeholder { color: var(--muted); }
.ia-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; flex-shrink: 0; }
.ia-sel { border: none; background: transparent; font-family: var(--font-sans); font-size: 12px; color: var(--muted); outline: none; cursor: pointer; padding: 4px; flex-shrink: 0; }
.ia-btn {
  padding: 5px 14px; background: var(--brand-600); color: #fff;
  border: none; border-radius: var(--r-full);
  font-family: var(--font-sans); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: background .15s; white-space: nowrap; margin: 3px; flex-shrink: 0;
}
.ia-btn:hover { background: var(--brand-hover); }
.ia-btn:disabled { opacity: .6; cursor: not-allowed; }
@media (max-width: 700px) { .ia-search-wrap { display: none; } }

/* ══════════════════════════════════════════════════════════════
   IA CHAT PAGE
   ══════════════════════════════════════════════════════════════ */
.content.ia-mode { padding: 0; overflow: hidden; display: flex; }
#page-ia { display: flex; width: 100%; height: 100%; overflow: hidden; position: relative; }

.ia-backdrop { display: none; position: absolute; inset: 0; background: rgba(0,0,0,.4); z-index: 49; }

@media (max-width: 700px) {
  #page-ia { flex-direction: column; }
  .ia-sidebar { position: absolute; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .25s; z-index: 50; }
  .ia-sidebar.open { transform: translateX(0); }
  .ia-backdrop.open { display: block; }
}

.ia-sidebar {
  width: 240px; min-width: 240px; background: var(--white);
  border-right: 1px solid var(--border-subtle); display: flex; flex-direction: column;
  height: 100%; overflow: hidden;
}
.ia-sidebar-head {
  padding: 14px 14px 10px; border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-shrink: 0;
}
.ia-new-btn {
  flex: 1; display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; background: var(--brand-50); color: var(--brand-600);
  border: 1px solid var(--brand-200); border-radius: 8px;
  font-family: var(--font-sans); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.ia-new-btn:hover { background: var(--brand-100); }
.ia-mob-back {
  display: none; background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 6px; border-radius: 6px;
}
@media (max-width: 700px) { .ia-mob-back { display: flex; } }

.ia-conv-list { flex: 1; overflow-y: auto; padding: 6px; }
.ia-conv-group,
.ia-conv-group-label { font-size: 10px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); padding: 4px 8px 6px; margin-bottom: 2px; display: block; }
.ia-conv-item {
  display: block; padding: 8px 10px; border-radius: 8px; cursor: pointer;
  font-size: 12px; color: var(--ink2); transition: all .15s;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: none; background: none; width: 100%; text-align: left; font-family: var(--font-sans);
}
.ia-conv-titulo { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ia-conv-item:hover  { background: var(--bg-hover); color: var(--ink); }
.ia-conv-item.active { background: var(--brand-50); color: var(--brand-600); font-weight: 500; }
.ia-conv-data { font-size: 10px; color: var(--muted); margin-top: 2px; display: block; }

.ia-main {
  flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100%;
  background: var(--bg);
}
.ia-msgs-wrap { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }

.ia-welcome {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 40px; text-align: center;
}
.ia-welcome-icon { font-size: 40px; }
.ia-welcome h2 { font-family: var(--font-display); font-size: 24px; font-weight: 600; color: var(--ink); }
.ia-welcome p  { font-size: 13px; color: var(--muted); max-width: 360px; line-height: 1.6; }

.ia-msg { display: flex; gap: 10px; max-width: 82%; }
.ia-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.ia-msg.assistant { align-self: flex-start; }
.ia-msg-avatar {
  width: 28px; height: 28px; min-width: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.ia-msg.user .ia-msg-avatar { background: var(--brand-50); color: var(--brand-600); }
.ia-msg.assistant .ia-msg-avatar { background: linear-gradient(135deg, var(--brand-600), var(--blue)); color: #fff; font-size: 10px; }
.ia-msg-bubble {
  padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.6;
  max-width: 100%;
}
.ia-msg.user .ia-msg-bubble { background: var(--brand-600); color: #fff; border-radius: 12px 4px 12px 12px; }
.ia-msg.assistant .ia-msg-bubble { background: var(--white); color: var(--ink); border: 1px solid var(--border-subtle); border-radius: 4px 12px 12px 12px; }
.ia-msg-bubble p { margin-bottom: 8px; }
.ia-msg-bubble p:last-child { margin-bottom: 0; }
.ia-msg-bubble strong { font-weight: 600; }
.ia-msg-bubble em { font-style: italic; }
.ia-msg-bubble code { font-family: var(--font-mono); font-size: 11.5px; background: var(--panel); padding: 1px 5px; border-radius: 4px; }
.ia-link { color: var(--brand-600); text-decoration: underline; cursor: pointer; }

.ia-typing { display: flex; align-items: center; gap: 4px; padding: 10px 14px; background: var(--white); border: 1px solid var(--border-subtle); border-radius: 4px 12px 12px 12px; width: fit-content; }
.ia-typing-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: iaBounce .9s infinite; }
.ia-typing-dot:nth-child(2) { animation-delay: .15s; }
.ia-typing-dot:nth-child(3) { animation-delay: .30s; }
@keyframes iaBounce { 0%,60%,100% { transform: translateY(0); opacity:.6; } 30% { transform: translateY(-5px); opacity:1; } }

.ia-input-area {
  padding: 12px 20px 16px; border-top: 1px solid var(--border-subtle);
  background: var(--white); flex-shrink: 0;
}
.ia-input-row { display: flex; gap: 8px; align-items: flex-end; }
.ia-textarea {
  flex: 1; min-height: 44px; max-height: 180px;
  padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 10px;
  font-family: var(--font-sans); font-size: 13px; color: var(--ink);
  background: var(--panel); outline: none; resize: none; line-height: 1.5;
  transition: border-color .15s, box-shadow .15s;
}
.ia-textarea:focus { border-color: var(--brand-600); box-shadow: 0 0 0 4px var(--brand-50); background: var(--white); }
.ia-textarea::placeholder { color: var(--muted); }
.ia-send-btn {
  width: 42px; height: 42px; border-radius: 10px; border: none;
  background: var(--brand-600); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s; flex-shrink: 0;
}
.ia-send-btn:hover { background: var(--brand-hover); transform: translateY(-1px); }
.ia-send-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.ia-send-btn svg { width: 18px; height: 18px; stroke-width: 2; }

.ia-input-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.ia-provedor-sel { font-size: 12px; color: var(--muted); background: none; border: none; font-family: var(--font-sans); cursor: pointer; padding: 2px 4px; }

/* ── IA: aliases para classes usadas no HTML/JS atual ─────────── */

/* Painel esquerdo (histórico) */
.ia-left {
  width: 260px; min-width: 260px; background: var(--white);
  border-right: 1px solid var(--border-subtle);
  display: flex; flex-direction: column;
  height: 100%; overflow: hidden;
  transition: width .25s, min-width .25s, transform .25s;
  flex-shrink: 0;
}
.ia-left.ia-left-hidden { width: 0; min-width: 0; }
.ia-left-head {
  padding: 14px 14px 10px; border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-shrink: 0;
}
.ia-nova-btn {
  flex: 1; display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; background: var(--brand-50); color: var(--brand-600);
  border: 1px solid var(--brand-200); border-radius: 8px;
  font-family: var(--font-sans); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.ia-nova-btn:hover { background: var(--brand-100); }
/* Botão para recolher painel — mesmo estilo do sb-collapse-btn do menu lateral */
.ia-panel-close {
  width: 26px; height: 26px;
  background: transparent; border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer; color: var(--muted);
  transition: all .15s; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.ia-panel-close:hover { background: var(--brand-50); color: var(--brand-600); border-color: var(--brand-600); }
.ia-panel-close svg { width: 14px; height: 14px; stroke-width: 2.5; }

/* ── Busca de conversas (nome único pra não conflitar com .ia-search-wrap do topbar) ── */
.ia-conv-search-wrap {
  padding: 8px 12px 0;
  flex: 0 0 auto;          /* não cresce, não encolhe — altura natural */
  display: block;          /* sobrescreve flex herdado */
  max-width: none;
  margin: 0;
}
.ia-conv-search {
  width: 100%;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  padding: 0 12px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.ia-conv-search:focus {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px var(--brand-100);
}
.ia-conv-search::placeholder { color: var(--muted); }

/* ── Header de pastas ── */
.ia-pastas-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px 4px 14px;
  font-family: var(--font-sans);
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--muted);
  flex: 0 0 auto;
}
.ia-btn-ico {
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  color: var(--brand-600);
  width: 22px; height: 22px; border-radius: 6px;
  cursor: pointer;
  font-size: 14px; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.ia-btn-ico:hover { background: var(--brand-100); transform: scale(1.08); }

/* ── Pastas e conversas ── */
.ia-pasta-grupo { margin: 4px 8px 0; }
.ia-pasta-head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 8px; border-radius: 6px;
  cursor: pointer; transition: background .12s;
  user-select: none;
}
.ia-pasta-head:hover { background: var(--bg-hover); }
.ia-pasta-icone {
  width: 18px; height: 18px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; flex-shrink: 0; color: #fff; font-weight: 700;
}
.ia-pasta-caret {
  font-size: 9px; color: var(--muted); transition: transform .15s;
  width: 10px; flex-shrink: 0;
}
.ia-pasta-grupo.collapsed .ia-pasta-caret { transform: rotate(-90deg); }
.ia-pasta-nome {
  flex: 1; font-size: 13px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ia-pasta-count {
  font-size: 10px; color: var(--muted); font-weight: 600;
  background: var(--bg); border-radius: 99px;
  padding: 1px 7px; flex-shrink: 0;
}
.ia-pasta-actions {
  display: flex; gap: 2px; opacity: 0; transition: opacity .15s;
}
.ia-pasta-head:hover .ia-pasta-actions { opacity: 1; }
.ia-pasta-actions button {
  background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 2px 4px;
  font-size: 12px; line-height: 1; border-radius: 4px;
}
.ia-pasta-actions button:hover { background: var(--border); color: var(--ink); }
.ia-pasta-conversas {
  max-height: 1000px; overflow: hidden;
  transition: max-height .25s ease;
}
.ia-pasta-grupo.collapsed .ia-pasta-conversas { max-height: 0; }

/* ── Item de conversa ── */
.ia-conv-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px 7px 22px; margin: 1px 8px;
  border-radius: 6px; cursor: pointer;
  font-size: 12.5px; color: var(--ink2);
  transition: background .12s, color .12s;
  position: relative;
}
.ia-pasta-conversas .ia-conv-item { padding-left: 30px; }
.ia-conv-item:hover { background: var(--bg-hover); color: var(--ink); }
.ia-conv-item.active { background: var(--brand-50); color: var(--brand-600); font-weight: 600; }
.ia-conv-titulo {
  flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ia-conv-actions {
  display: flex; gap: 2px; opacity: 0; transition: opacity .15s;
}
.ia-conv-item:hover .ia-conv-actions { opacity: 1; }
.ia-conv-actions button {
  background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 2px 4px; line-height: 1;
  font-size: 11px; border-radius: 4px;
}
.ia-conv-actions button:hover { background: var(--border); color: var(--ink); }

/* ── "Sem pasta" agrupador ── */
.ia-sem-pasta-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.2px;
  color: var(--muted); text-transform: uppercase;
  padding: 12px 14px 4px;
}

/* ── Empty state busca ── */
.ia-busca-vazio {
  padding: 24px 14px; text-align: center;
  color: var(--muted); font-size: 12.5px; line-height: 1.5;
}

/* ── Pasta vazia (zona de drop) ── */
.ia-pasta-vazia {
  padding: 8px 30px;
  color: var(--muted); font-size: 11.5px; font-style: italic;
  border: 1px dashed transparent;
  border-radius: 6px;
  margin: 2px 8px 2px 22px;
  transition: all .15s;
}

/* ── Drag & Drop visual feedback ── */
.ia-conv-item[draggable="true"] { cursor: grab; }
.ia-conv-item[draggable="true"]:active { cursor: grabbing; }
.ia-pasta-grupo[draggable="true"] > .ia-pasta-head { cursor: grab; }

.ia-dragging {
  opacity: .4;
  transform: scale(.97);
}
.ia-dragging * { pointer-events: none; }

.ia-drop-target {
  outline: 2px dashed var(--brand-600);
  outline-offset: -2px;
  background: var(--brand-50) !important;
  border-radius: 8px;
  transition: all .12s;
}
.ia-drop-target.ia-pasta-grupo .ia-pasta-head {
  background: var(--brand-100);
}
.ia-drop-target.ia-pasta-vazia {
  border-color: var(--brand-600);
  background: var(--brand-50);
  color: var(--brand-600);
  font-weight: 600;
}
.ia-sem-pasta-label.ia-drop-target {
  background: var(--brand-50);
  color: var(--brand-600);
  padding: 8px 14px;
}

/* Painel direito (chat) */
.ia-right {
  flex: 1; display: flex; flex-direction: column;
  min-width: 0; height: 100%; background: var(--bg);
}
.ia-msgs {
  flex: 1; overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
}

/* Botão para abrir painel de histórico — mesmo estilo do sb-collapse-btn do menu lateral */
.ia-panel-open-btn {
  align-self: flex-start; margin: 14px 0 0 16px;
  width: 26px; height: 26px;
  background: transparent; border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer; color: var(--muted);
  font-family: var(--font-sans); transition: all .15s;
  display: none; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ia-panel-open-btn:hover { background: var(--brand-50); color: var(--brand-600); border-color: var(--brand-600); }
.ia-panel-open-btn svg { width: 14px; height: 14px; stroke-width: 2.5; }

/* Welcome screen */
.ia-welcome-av {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-600), var(--blue));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 14px; font-weight: 700;
  box-shadow: var(--shadow-glow);
}
.ia-welcome-name {
  font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--ink);
}

/* Suggestion chips */
.ia-chips {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 4px;
}
.ia-chip {
  padding: 7px 14px; background: var(--white);
  border: 1.5px solid var(--border); border-radius: 20px;
  font-size: 12.5px; color: var(--ink2); cursor: pointer;
  font-family: var(--font-sans); transition: all .15s;
}
.ia-chip:hover { border-color: var(--brand-600); color: var(--brand-600); background: var(--brand-50); }

/* Input box */
.ia-input-box { display: flex; gap: 8px; align-items: flex-end; }
.ia-msg-input {
  flex: 1; min-height: 44px; max-height: 180px;
  padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 10px;
  font-family: var(--font-sans); font-size: 13px; color: var(--ink);
  background: var(--panel); outline: none; resize: none; line-height: 1.5;
  transition: border-color .15s, box-shadow .15s;
}
.ia-msg-input:focus { border-color: var(--brand-600); box-shadow: 0 0 0 4px var(--brand-50); background: var(--white); }
.ia-msg-input::placeholder { color: var(--muted); }
.ia-hint { font-size: 11px; color: var(--muted); margin-top: 6px; }

/* Select de provedor dentro do input */
.ia-sel {
  border: none; background: transparent; font-family: var(--font-sans);
  font-size: 12px; color: var(--muted); outline: none; cursor: pointer; padding: 4px;
}

/* Mensagens — classes geradas pelo JS */
.ia-msg-ai {
  align-self: flex-start; max-width: 82%; display: flex; gap: 10px;
}
.ia-msg-user {
  align-self: flex-end; max-width: 82%; display: flex; gap: 10px; flex-direction: row-reverse;
}
.ia-bubble {
  padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.6; max-width: 100%;
}
.ia-bubble-ai {
  background: var(--white); color: var(--ink);
  border: 1px solid var(--border-subtle); border-radius: 4px 12px 12px 12px;
}
.ia-bubble-user {
  background: var(--brand-600); color: #fff; border-radius: 12px 4px 12px 12px;
}
.ia-bubble p { margin-bottom: 8px; }
.ia-bubble p:last-child { margin-bottom: 0; }
.ia-bubble strong { font-weight: 600; }
.ia-bubble em { font-style: italic; }
.ia-bubble code {
  font-family: var(--font-mono); font-size: 11.5px;
  background: var(--panel); padding: 1px 5px; border-radius: 4px;
}
.ia-bubble-user code { background: rgba(255,255,255,.2); }

/* Typing animation — filhos diretos de .ia-typing */
.ia-typing span {
  display: block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted); animation: iaBounce .9s infinite;
}
.ia-typing span:nth-child(2) { animation-delay: .15s; }
.ia-typing span:nth-child(3) { animation-delay: .30s; }

/* Responsive IA */
@media (max-width: 700px) {
  .ia-left {
    position: absolute; left: 0; top: 0; bottom: 0; z-index: 50;
    width: 260px; min-width: 260px;
    transform: translateX(0); transition: transform .25s;
  }
  .ia-left.ia-left-hidden { transform: translateX(-100%); width: 260px; min-width: 260px; }
  .ia-panel-close { display: flex !important; }
  .ia-panel-open-btn { display: flex !important; }
  .ia-backdrop { display: block !important; }
}

/* ── chips / características ── */
.carac-chip {
  display: inline-flex; align-items: center; padding: 4px 10px;
  border: 1.5px solid var(--border); border-radius: 20px;
  font-size: 12px; cursor: pointer; transition: all .15s; font-family: var(--font-sans);
  color: var(--ink2); background: var(--panel);
}
.carac-chip.sel { background: var(--brand-50); border-color: var(--brand-600); color: var(--brand-600); font-weight: 500; }
.carac-chip:hover:not(.sel) { border-color: var(--brand-600); color: var(--brand-600); }

/* ══════════════════════════════════════════════════════════════
   ALERTAS
   ══════════════════════════════════════════════════════════════ */
.alert-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 18px; border-bottom: 1px solid var(--border-subtle);
  cursor: pointer; transition: background .1s;
}
.alert-item:last-child { border-bottom: none; }
.alert-item:hover { background: var(--bg-hover); }
.alert-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.alert-dot.amber { background: var(--amber); }
.alert-dot.red   { background: var(--red); }
.alert-dot.blue  { background: var(--blue); }
.a-t { font-size: 13px; font-weight: 500; color: var(--ink); }
.a-s { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ══════════════════════════════════════════════════════════════
   ATALHOS
   ══════════════════════════════════════════════════════════════ */
.atalhos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px; }

/* ── Ícone colorido dos atalhos ── */
.atalho-i {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-bottom: 6px;
}
.atalho-i svg { width: 17px; height: 17px; stroke-width: 1.8; }
.ai-purple { background: var(--brand-50);  color: var(--brand-600); }
.ai-blue   { background: var(--blue-bg);   color: var(--blue); }
.ai-green  { background: var(--green-bg);  color: var(--green); }
.ai-amber  { background: var(--amber-bg);  color: var(--amber); }
.ai-red    { background: var(--red-bg);    color: var(--red); }

.atalho {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px; border: 1px solid var(--border-subtle); border-radius: 10px;
  background: var(--panel); cursor: pointer; text-align: left;
  font-family: var(--font-sans); transition: all .15s;
}
.atalho:hover { border-color: var(--brand-600); background: var(--brand-50); transform: scale(1.02); }
.atalho-l { font-size: 12px; font-weight: 500; color: var(--ink); }
.atalho-s { font-size: 11px; color: var(--muted); }

/* ══════════════════════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════════════════════ */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; gap: 10px; }
.empty-i { font-size: 36px; opacity: .6; }
.empty-t { font-size: 14px; font-weight: 500; color: var(--ink2); }
.empty-s { font-size: 12px; color: var(--muted); text-align: center; }

/* ══════════════════════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════════════════════ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fg        { display: flex; flex-direction: column; }
.fg.full   { grid-column: 1 / -1; }

/* Label padrão dos formulários */
.fl {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

/* Input e select padrão dos formulários */
.fi, .fs, .inp, .sel {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
  line-height: 1.4;
}
.fi:focus, .fs:focus, .inp:focus, .sel:focus {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px var(--brand-50);
  background: var(--white);
}
.fi::placeholder, .inp::placeholder { color: var(--muted); font-size: 13px; }
textarea.fi, textarea.inp { resize: vertical; min-height: 80px; line-height: 1.5; }

label { display: block; font-size: 12px; font-weight: 500; color: var(--ink2); margin-bottom: 5px; }

/* ══════════════════════════════════════════════════════════════
   MODAL
   ══════════════════════════════════════════════════════════════ */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 200;
  align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white); border-radius: var(--r-lg);
  width: 540px; max-width: 95vw; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,.4);
  animation: mIn .18s ease;
  border: 1px solid var(--border-subtle);
}
@keyframes mIn { from { opacity:0; transform: translateY(12px) scale(.98); } to { opacity:1; transform: none; } }
.modal-head {
  padding: 20px 24px 16px; border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: flex-start; justify-content: space-between;
  position: sticky; top: 0; background: var(--white); z-index: 1;
}
.modal-head h3 { font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--ink); letter-spacing: -.02em; }
.modal-head p  { font-size: 12px; color: var(--muted); margin-top: 2px; }
.modal-close   { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 18px; padding: 2px 6px; border-radius: 6px; line-height: 1; transition: all .15s; }
.modal-close:hover { background: var(--bg-hover); color: var(--ink); }
.modal-body { padding: 20px 24px; }
.modal-foot { padding: 14px 24px; border-top: 1px solid var(--border-subtle); display: flex; justify-content: flex-end; gap: 8px; position: sticky; bottom: 0; background: var(--white); }

/* ══════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--r-md);
  font-family: var(--font-sans); font-size: 13px; font-weight: 500;
  cursor: pointer; border: none; transition: all .15s;
}
.btn-primary {
  background: var(--brand-600); color: #fff;
  box-shadow: 0 4px 12px rgba(108,99,255,.28);
}
.btn-primary:hover { background: var(--brand-hover); transform: translateY(-1px); box-shadow: var(--shadow-glow); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary { background: var(--white); color: var(--ink2); border: 1.5px solid var(--border); }
.btn-secondary:hover { background: var(--panel); border-color: var(--brand-200); color: var(--brand-600); }
.btn-ghost { background: none; border: none; color: var(--muted); font-family: var(--font-sans); cursor: pointer; font-size: 12px; padding: 5px 9px; border-radius: var(--r-sm); transition: all .15s; }
.btn-ghost:hover { color: var(--red); background: var(--red-bg); }
.btn:disabled  { opacity: .5; cursor: not-allowed; transform: none !important; }
.btn-icon {
  background: none; border: 1px solid var(--border); color: var(--ink2);
  padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 14px;
  transition: all .12s; font-family: var(--font-sans);
}
.btn-icon:hover { background: var(--bg-hover); border-color: var(--brand-600); color: var(--brand-600); }

/* ══════════════════════════════════════════════════════════════
   ALERT BOX
   ══════════════════════════════════════════════════════════════ */
.abox {
  padding: 10px 14px; border-radius: var(--r-md); font-size: 12.5px; line-height: 1.5; margin-bottom: 14px;
  border: 1px solid;
}
.abox.error   { background: var(--red-bg);   color: var(--red);   border-color: var(--red-border); }
.abox.success { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
.abox.info    { background: var(--blue-bg);  color: var(--blue);  border-color: var(--blue-border); }
.abox.warn    { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-border); }

/* ══════════════════════════════════════════════════════════════
   TIMELINE HISTÓRICO
   ══════════════════════════════════════════════════════════════ */
.tl-list { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: flex; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border-subtle); }
.tl-item:last-child { border-bottom: none; }
.tl-icon-wrap { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.tl-icon { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; border: 2px solid var(--border); background: var(--white); }
.tl-line { width: 2px; flex: 1; background: var(--border-subtle); margin-top: 4px; min-height: 16px; }
.tl-content { flex: 1; min-width: 0; padding-top: 4px; }
.tl-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.tl-tipo  { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--brand-600); }
.tl-data  { font-size: 11px; color: var(--muted); }
.tl-autor { font-size: 11px; color: var(--muted); }
.tl-desc  { font-size: 13px; color: var(--ink2); line-height: 1.55; }
.tl-actions { display: flex; gap: 4px; margin-top: 6px; opacity: 0; transition: opacity .15s; }
.tl-item:hover .tl-actions { opacity: 1; }

/* ══════════════════════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════════════════════ */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--border);
  padding: 12px 18px; border-radius: var(--r-lg);
  font-size: 13px; font-family: var(--font-sans);
  box-shadow: var(--shadow-lg); z-index: 9999;
  transform: translateY(70px); opacity: 0;
  transition: all .25s; max-width: 320px;
}
.toast.show    { transform: none; opacity: 1; }
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }

/* ══════════════════════════════════════════════════════════════
   INATIVIDADE
   ══════════════════════════════════════════════════════════════ */
.inact-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 999; align-items: center; justify-content: center; backdrop-filter: blur(8px); }
.inact-overlay.show { display: flex; }
.inact-box { background: var(--white); border-radius: var(--r-xl); padding: 36px 44px; text-align: center; max-width: 340px; box-shadow: var(--shadow-lg); border: 1px solid var(--border-subtle); }
.inact-box h3 { font-family: var(--font-display); font-size: 24px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.inact-box p  { font-size: 13px; color: var(--muted); margin-bottom: 18px; line-height: 1.5; }
.inact-num { font-family: var(--font-display); font-size: 64px; font-weight: 700; color: var(--brand-600); line-height: 1; margin-bottom: 20px; letter-spacing: -2px; }

/* ══════════════════════════════════════════════════════════════
   DETALHE DO IMÓVEL
   ══════════════════════════════════════════════════════════════ */
.pd-crumbs { display:flex; align-items:center; gap:8px; margin-bottom:20px; flex-wrap:wrap; }
.pd-crumb-link { display:inline-flex; align-items:center; gap:5px; font-size:13px; color:var(--brand-600); cursor:pointer; background:none; border:none; font-family:var(--font-sans); padding:0; transition:color .15s; }
.pd-crumb-link:hover { color:var(--brand-hover); }
.pd-crumb-sep  { color:var(--muted); font-size:14px; }
.pd-crumb-curr { font-size:13px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:300px; }
.pd-crumb-actions { margin-left:auto; display:flex; gap:8px; }
.pd-header { display:grid; grid-template-columns:1fr auto; gap:20px; align-items:start; margin-bottom:24px; }
.pd-chips  { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:10px; }
.pd-title  { font-family:var(--font-display); font-size:30px; font-weight:600; line-height:1.1; letter-spacing:-.02em; color:var(--ink); margin-bottom:8px; }
.pd-addr   { display:flex; align-items:center; gap:6px; font-size:13px; color:var(--muted); }
.pd-price-card { background:var(--white); border:1px solid var(--border-subtle); border-radius:var(--r-lg); padding:18px 22px; min-width:200px; box-shadow:var(--shadow-sm); }
.pd-price-lbl  { font-size:11px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); margin-bottom:6px; }
.pd-price-val  { font-family:var(--font-display); font-size:28px; font-weight:700; color:var(--brand-600); letter-spacing:-1px; line-height:1.1; }
.pd-price-sub  { font-size:12px; color:var(--muted); margin-top:4px; }
.pd-body  { display:grid; grid-template-columns:1fr 320px; gap:20px; }
.pd-gallery { background:var(--white); border:1px solid var(--border-subtle); border-radius:var(--r-lg); overflow:hidden; box-shadow:var(--shadow-sm); margin-bottom:16px; }
.pd-hero  { position:relative; height:340px; background:var(--panel); overflow:hidden; }
.pd-hero img { width:100%; height:100%; object-fit:cover; display:block; transition:opacity .2s; }
.pd-hero-placeholder { width:100%; height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; color:var(--muted); }
.pd-hero-placeholder span { font-size:48px; }
.pd-hero-nav { position:absolute; top:50%; transform:translateY(-50%); background:rgba(0,0,0,.5); color:#fff; border:none; width:36px; height:36px; border-radius:50%; cursor:pointer; font-size:18px; display:flex; align-items:center; justify-content:center; transition:background .15s; }
.pd-hero-nav:hover { background:rgba(0,0,0,.8); }
.pd-hero-nav.prev { left:12px; }
.pd-hero-nav.next { right:12px; }
.pd-hero-pager { position:absolute; bottom:12px; left:50%; transform:translateX(-50%); background:rgba(0,0,0,.6); color:#fff; font-size:11px; padding:4px 10px; border-radius:var(--r-full); white-space:nowrap; }
.pd-thumbs { display:flex; gap:8px; padding:10px 12px; overflow-x:auto; }
.pd-thumb  { width:72px; height:52px; border-radius:var(--r-sm); overflow:hidden; cursor:pointer; border:2px solid transparent; flex-shrink:0; transition:border-color .15s; }
.pd-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.pd-thumb.active { border-color:var(--brand-600); }
.pd-thumb-more { width:72px; height:52px; border-radius:var(--r-sm); background:rgba(0,0,0,.6); color:#fff; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:600; flex-shrink:0; }
.pd-specs { background:var(--white); border:1px solid var(--border-subtle); border-radius:var(--r-lg); padding:18px 20px; margin-bottom:16px; box-shadow:var(--shadow-sm); }
.pd-specs-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.pd-spec { display:flex; flex-direction:column; gap:3px; }
.pd-spec-icon { font-size:18px; margin-bottom:2px; }
.pd-spec-val  { font-size:14px; font-weight:600; color:var(--ink); font-family:var(--font-display); }
.pd-spec-lbl  { font-size:11px; color:var(--muted); }
.pd-desc { background:var(--white); border:1px solid var(--border-subtle); border-radius:var(--r-lg); padding:18px 20px; margin-bottom:16px; box-shadow:var(--shadow-sm); }
.pd-desc p { font-size:13.5px; color:var(--ink2); line-height:1.7; white-space:pre-wrap; }
.pd-rail     { display:flex; flex-direction:column; gap:16px; }
.pd-prop-card { background:var(--white); border:1px solid var(--border-subtle); border-radius:var(--r-lg); padding:18px 20px; box-shadow:var(--shadow-sm); }
.pd-prop-row  { display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.pd-prop-avatar { width:44px; height:44px; border-radius:50%; background:var(--brand-50); color:var(--brand-600); display:flex; align-items:center; justify-content:center; font-size:16px; font-weight:700; flex-shrink:0; }
.pd-prop-name { font-size:14px; font-weight:600; color:var(--ink); line-height:1.2; }
.pd-prop-tipo { font-size:11px; color:var(--muted); margin-top:2px; }
.pd-prop-info { display:flex; flex-direction:column; gap:6px; }
.pd-prop-line { display:flex; align-items:center; gap:7px; font-size:12px; color:var(--ink2); }
.pd-prop-line svg { flex-shrink:0; color:var(--muted); }
.pd-timeline { background:var(--white); border:1px solid var(--border-subtle); border-radius:var(--r-lg); padding:18px 20px; box-shadow:var(--shadow-sm); }
.pd-tl-item { display:flex; gap:12px; padding-bottom:16px; position:relative; }
.pd-tl-item:last-child { padding-bottom:0; }
.pd-tl-item:not(:last-child)::before { content:''; position:absolute; left:14px; top:28px; bottom:0; width:1px; background:var(--border-subtle); }
.pd-tl-dot { width:28px; height:28px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:12px; flex-shrink:0; }
.pd-tl-dot.brand { background:var(--brand-50);  color:var(--brand-600); }
.pd-tl-dot.green { background:var(--green-bg);  color:var(--green); }
.pd-tl-dot.amber { background:var(--amber-bg);  color:var(--amber); }
.pd-tl-dot.red   { background:var(--red-bg);    color:var(--red); }
.pd-tl-dot.gray  { background:var(--panel);     color:var(--muted); border:1.5px dashed var(--border); }
.pd-tl-content  { flex:1; min-width:0; }
.pd-tl-label { font-size:13px; font-weight:600; color:var(--ink); }
.pd-tl-sub   { font-size:11.5px; color:var(--muted); margin-top:2px; line-height:1.4; }
.pd-tl-date  { font-size:11px; color:var(--muted); margin-top:3px; }
.pd-tl-empty { text-align:center; padding:20px; font-size:13px; color:var(--muted); }
@media(max-width:900px){ .pd-body{ grid-template-columns:1fr; } .pd-header{ grid-template-columns:1fr; } }
@media(max-width:600px){ .pd-specs-grid{ grid-template-columns:repeat(2,1fr); } .pd-title{ font-size:22px; } }

/* ── FOTOS ── */
.foto-section { border-top: 1px solid var(--border-subtle); padding-top: 20px; margin-top: 4px; }
.foto-section-label { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.foto-grid  { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.foto-thumb { position: relative; width: 96px; height: 72px; border-radius: var(--r-md); overflow: hidden; border: 1.5px solid var(--border); background: var(--panel); flex-shrink: 0; box-shadow: var(--shadow-sm); }
.foto-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-thumb-del { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; border: none; cursor: pointer; font-size: 11px; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.foto-thumb-del:hover { background: var(--red); }
.foto-add { width: 96px; height: 72px; border-radius: var(--r-md); border: 1.5px dashed var(--brand-200); background: var(--brand-50); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; transition: all .15s; flex-shrink: 0; font-size: 11px; color: var(--brand-600); font-family: var(--font-sans); }
.foto-add:hover { border-color: var(--brand-600); background: var(--brand-100); }
.foto-add svg { width: 20px; height: 20px; stroke: var(--brand-600); }
.foto-cnt { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); background: var(--panel); padding: 2px 7px; border-radius: var(--r-full); }

/* ── MARCADORES ── */
code.mk      { background: var(--panel); padding: 2px 8px; border-radius: 4px; color: var(--ink2); font-size: 11.5px; font-family: var(--font-mono); display: inline-block; width: fit-content; border: 1px solid var(--border-subtle); }
code.mk-cond { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-border); }

/* ══════════════════════════════════════════════════════════════
   SCROLLBAR
   ══════════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ══════════════════════════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════════════════════════ */
@keyframes fadeUpIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulse-dot {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .5; transform: scale(1.5); }
}
@keyframes shimmer {
  from { background-position: -400px 0; }
  to   { background-position:  400px 0; }
}
@keyframes lbIn { from { transform:scale(.95); opacity:.5; } to { transform:scale(1); opacity:1; } }

/* table rows stagger */
.tbl tbody tr { animation: fadeIn 200ms ease both; }
.tbl tbody tr:nth-child(1)  { animation-delay: 30ms; }
.tbl tbody tr:nth-child(2)  { animation-delay: 55ms; }
.tbl tbody tr:nth-child(3)  { animation-delay: 80ms; }
.tbl tbody tr:nth-child(4)  { animation-delay: 105ms; }
.tbl tbody tr:nth-child(5)  { animation-delay: 130ms; }
.tbl tbody tr:nth-child(n+6){ animation-delay: 150ms; }

/* ══════════════════════════════════════════════════════════════
   CALENDÁRIO
   ══════════════════════════════════════════════════════════════ */

/* ── Layout principal ── */
.cal-layout{display:flex;height:100%;overflow:hidden;}
.cal-side{width:220px;min-width:220px;flex-shrink:0;padding:16px;border-right:1px solid var(--border-subtle);display:flex;flex-direction:column;gap:16px;overflow-y:auto;background:var(--white);}
.cal-main{flex:1;display:flex;flex-direction:column;overflow:hidden;background:var(--white);}

/* ── Cabeçalho da área principal ── */
.cal-hdr,.cal-header{display:flex;align-items:center;gap:8px;padding:10px 16px;border-bottom:1px solid var(--border-subtle);flex-shrink:0;flex-wrap:wrap;}
.cal-nav-btn,.cal-nav{background:none;border:1px solid var(--border);border-radius:var(--r-sm);cursor:pointer;color:var(--ink2);width:30px;height:30px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .12s;}
.cal-nav-btn:hover,.cal-nav:hover{background:var(--bg-hover);border-color:var(--brand-600);color:var(--brand-600);}
.cal-hdr-titulo,.cal-title{font-size:15px;font-weight:600;color:var(--ink);min-width:180px;}
.cal-hoje-btn,.cal-today-btn{padding:4px 12px;font-size:12px;font-family:var(--font-sans);border:1px solid var(--border);background:var(--panel);color:var(--ink2);border-radius:var(--r-sm);cursor:pointer;transition:all .12s;}
.cal-hoje-btn:hover,.cal-today-btn:hover{border-color:var(--brand-600);color:var(--brand-600);}
.cal-views,.cal-view-btns{display:flex;border:1px solid var(--border);border-radius:var(--r-sm);overflow:hidden;margin-left:auto;}
.cal-view-btn{padding:5px 14px;font-size:12px;font-family:var(--font-sans);border:none;border-right:1px solid var(--border);background:var(--panel);color:var(--ink2);cursor:pointer;transition:all .12s;}
.cal-view-btn:last-child{border-right:none;}
.cal-view-btn.active{background:var(--brand-50);color:var(--brand-600);font-weight:600;}
.cal-month{flex:1;overflow-y:auto;display:flex;flex-direction:column;}
.cal-wk-hdr{display:grid;grid-template-columns:repeat(7,1fr);border-bottom:1px solid var(--border-subtle);flex-shrink:0;}
.cal-wh{padding:6px 8px;text-align:right;font-size:11px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;}
.cal-month-body{display:grid;grid-template-columns:repeat(7,1fr);flex:1;grid-auto-rows:minmax(110px,1fr);}
.cal-day{border-right:1px solid var(--border-subtle);border-bottom:1px solid var(--border-subtle);padding:4px 6px;cursor:pointer;transition:background .12s;overflow:hidden;}
.cal-day:hover{background:var(--brand-50);}
.cal-day.cal-out{background:var(--bg);}
.cal-day.cal-out .cal-dn{color:var(--muted);}
.cal-dn{width:26px;height:26px;display:flex;align-items:center;justify-content:center;font-size:13px;border-radius:50%;margin-bottom:3px;font-weight:400;margin-left:auto;}
.cal-day.cal-today .cal-dn{background:var(--brand-600);color:#fff;font-weight:700;}
.cal-chip{font-size:11px;padding:2px 6px;border-radius:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;margin-bottom:2px;display:block;line-height:1.5;transition:filter .1s;}
.cal-chip:hover{filter:brightness(.9);}
.cal-chip.tarefa{background:var(--brand-50);color:var(--brand-600);}
.cal-chip.tarefa.urgente,.cal-chip.tarefa.alta{background:var(--red-bg);color:var(--red);}
.cal-chip.cobranca{background:var(--amber-bg);color:var(--amber);}
.cal-chip.cobranca.atrasado{background:var(--red-bg);color:var(--red);}
.cal-chip.contrato{background:var(--blue-bg);color:var(--blue);}
.cal-chip.conta_pagar{background:var(--red-bg);color:var(--red);}
.cal-chip.conta_pagar.vencido{background:#fde8e8;color:#991b1b;}
.cal-chip.hoje-chip{font-weight:700;}
.cal-more{font-size:11px;color:var(--muted);cursor:pointer;padding:1px 4px;border-radius:3px;display:inline-block;}
.cal-more:hover{background:var(--panel);color:var(--ink);}
.cal-week{flex:1;overflow:auto;display:flex;flex-direction:column;}
.cal-week-cols{display:grid;grid-template-columns:repeat(7,1fr);flex:1;border-top:1px solid var(--border-subtle);}
.cal-wcol{border-right:1px solid var(--border-subtle);min-height:300px;}
.cal-wcol-hdr{text-align:center;padding:8px 4px;border-bottom:1px solid var(--border-subtle);position:sticky;top:0;background:var(--white);z-index:1;}
.cal-wcol-wd{font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);}
.cal-wcol-num{font-size:26px;font-weight:300;line-height:1.1;border-radius:50%;width:40px;height:40px;display:flex;align-items:center;justify-content:center;margin:2px auto 0;font-family:var(--font-display);}
.cal-wcol.cal-today .cal-wcol-num{background:var(--brand-600);color:#fff;}
.cal-wcol-body{padding:4px;}
.cal-mini-hdr{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px;}
.cal-mini-mes{font-size:12px;font-weight:600;color:var(--ink2);}
.cal-mini-nav{background:none;border:none;cursor:pointer;color:var(--muted);font-size:14px;padding:2px;border-radius:50%;line-height:1;}
.cal-mini-nav:hover{background:var(--panel);}
.cal-mini-grid{display:grid;grid-template-columns:repeat(7,1fr);}
.cal-mini-wh{font-size:9px;color:var(--muted);text-align:center;padding:2px 0;font-weight:600;}
.cal-mini-d{font-size:11px;text-align:center;padding:3px 0;cursor:pointer;border-radius:50%;line-height:1.6;}
.cal-mini-d:hover{background:var(--brand-50);}
.cal-mini-d.today{background:var(--brand-600);color:#fff;font-weight:700;}
.cal-mini-d.sel{background:var(--brand-100);color:var(--brand-600);font-weight:600;}
.cal-mini-d.out{color:var(--border);}
.cal-filtro{display:flex;align-items:center;gap:8px;font-size:12px;padding:3px 0;cursor:pointer;user-select:none;}
.cal-filtro input{accent-color:var(--brand-600);}
.cal-filtro-dot{width:10px;height:10px;border-radius:2px;flex-shrink:0;}
.cal-pop-head{padding:12px 14px 10px;display:flex;align-items:flex-start;gap:10px;}
.cal-pop-dot{width:12px;height:12px;border-radius:3px;flex-shrink:0;margin-top:3px;}
.cal-pop-body{padding:0 14px 12px;}
.cal-pop-titulo{font-size:15px;font-weight:600;color:var(--ink);line-height:1.3;}
.cal-pop-sub{font-size:12px;color:var(--muted);margin-top:2px;}
.cal-pop-meta{font-size:12px;color:var(--ink2);margin-top:8px;display:flex;flex-direction:column;gap:3px;}
.cal-pop-foot{padding:10px 14px;border-top:1px solid var(--border-subtle);display:flex;gap:8px;justify-content:flex-end;}
.cal-pop-close{position:absolute;top:8px;right:10px;background:none;border:none;cursor:pointer;color:var(--muted);font-size:16px;line-height:1;}
.cal-day-pop-titulo{font-size:13px;font-weight:600;margin-bottom:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;}
.cal-criar-btn{display:flex;align-items:center;gap:6px;padding:7px 16px;border-radius:24px;border:1px solid var(--border);background:var(--white);color:var(--ink);font-size:14px;cursor:pointer;box-shadow:var(--shadow-sm);transition:box-shadow .15s;}
.cal-criar-btn:hover{box-shadow:var(--shadow-md);}
.cal-criar-btn span{font-size:20px;color:var(--brand-600);line-height:1;}

/* ── Popovers flutuantes ── */
#cal-pop,#cal-day-pop{display:none;position:fixed;z-index:3000;background:var(--white);border:1px solid var(--border-subtle);border-radius:var(--r-md);box-shadow:var(--shadow-lg);min-width:260px;max-width:340px;}
#cal-pop{position:fixed;}
#cal-day-pop{padding:14px;max-width:300px;max-height:380px;overflow-y:auto;}
#cal-new-pop{display:none;position:fixed;z-index:3000;background:var(--white);border:1px solid var(--border-subtle);border-radius:var(--r-md);box-shadow:var(--shadow-lg);width:340px;}

/* ── Quick-create (cnp) ── */
.cnp-head{display:flex;align-items:center;justify-content:space-between;padding:12px 14px 8px;}
.cnp-tipos{display:flex;gap:4px;}
.cnp-tipo-btn{background:none;border:1px solid transparent;border-radius:var(--r-sm);cursor:pointer;padding:4px 6px;font-size:16px;transition:all .12s;opacity:.55;}
.cnp-tipo-btn:hover{opacity:1;border-color:var(--border);}
.cnp-tipo-btn.ativo{opacity:1;border-color:var(--brand-300);background:var(--brand-50);}
.cnp-body{padding:0 14px 10px;display:flex;flex-direction:column;gap:8px;}
.cnp-titulo-inp{width:100%;border:none;border-bottom:2px solid var(--border-subtle);padding:6px 0;font-size:15px;font-family:var(--font-sans);color:var(--ink);outline:none;background:transparent;transition:border-color .15s;}
.cnp-titulo-inp:focus{border-bottom-color:var(--brand-600);}
.cnp-row{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--ink2);}
.cnp-row-icon{font-size:14px;}
.cnp-date-inp,.cnp-time-inp{border:1px solid var(--border);border-radius:var(--r-sm);padding:3px 7px;font-size:12px;font-family:var(--font-sans);color:var(--ink);background:var(--panel);cursor:pointer;}
.cnp-allday{display:flex;align-items:center;gap:4px;cursor:pointer;user-select:none;font-size:12px;color:var(--ink2);}
.cnp-foot{display:flex;align-items:center;justify-content:space-between;padding:8px 14px 12px;}
.cnp-mais{background:none;border:none;font-size:12px;color:var(--brand-600);cursor:pointer;padding:4px;border-radius:var(--r-sm);}
.cnp-mais:hover{background:var(--brand-50);}

@media(max-width:700px){
  .cal-month-body{grid-auto-rows:minmax(70px,1fr);}
  .cal-chip{display:none;}
  .cal-more{display:block;}
  .cal-side{display:none;}
}

/* ── Lightbox ── */
.lb-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.88);z-index:9000;align-items:center;justify-content:center;}
.lb-overlay.open{display:flex;}
.lb-img{max-width:92vw;max-height:88vh;object-fit:contain;border-radius:var(--r-md);animation:lbIn .2s ease;}
.lb-close{position:absolute;top:16px;right:20px;background:rgba(255,255,255,.12);border:none;color:#fff;width:36px;height:36px;border-radius:50%;font-size:20px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .15s;}
.lb-close:hover{background:rgba(255,255,255,.24);}
.lb-nav{position:absolute;top:50%;transform:translateY(-50%);background:rgba(255,255,255,.12);border:none;color:#fff;width:44px;height:44px;border-radius:50%;font-size:22px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .15s;}
.lb-nav:hover{background:rgba(255,255,255,.24);}
.lb-nav.prev{left:16px;}
.lb-nav.next{right:16px;}
.lb-counter{position:absolute;bottom:16px;left:50%;transform:translateX(-50%);background:rgba(0,0,0,.5);color:#fff;font-size:12px;padding:4px 12px;border-radius:var(--r-full);}

/* ══════════════════════════════════════════════════════════════
   DARK TOGGLE (configurações)
   ══════════════════════════════════════════════════════════════ */
#dark-toggle {
  width: 44px; height: 24px; border-radius: 12px;
  background: var(--border); cursor: pointer; border: none;
  position: relative; transition: background .2s; flex-shrink: 0;
}
#dark-toggle-dot {
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; position: absolute; top: 3px; left: 3px;
  transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3);
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  html, body { height: auto; overflow: auto; }
  .sidebar { width: 0; min-width: 0; position: static; }
  .hamburger { display: flex; }
  .sb-close  { display: flex; align-items: center; justify-content: center; }
  .sb-inner {
    position: fixed; top: 0; left: 0;
    width: var(--sidebar-nav-w); height: 100dvh;
    transform: translateX(-100%); transition: transform .25s ease; z-index: 100;
  }
  .sidebar.open .sb-inner   { transform: translateX(0); }
  .sidebar.open .sb-overlay { display: block; }
  .main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
  .content { flex: 1; overflow-y: visible; }
}
@media (max-width: 768px) {
  .tb-logo { padding: 0 12px; }
  .tb-logo-info { display: none; }
  .tb-search { min-width: 160px; max-width: 160px; }
  .tb-crumb:not(.tb-crumb-active) { display: none; }
  .tb-crumb-sep { display: none; }
  .tb-crumb-sep:last-of-type { display: none; }
}
@media (max-width: 600px) {
  .topbar { padding: 0 8px 0 0; gap: 0; }
  .tb-logo { padding: 0 10px; }
  .tb-search { display: none; }
  .tb-sep { display: none; }
  .tb-breadcrumb { display: none; }
  .btn-novo { padding: 8px 12px; font-size: 12px; }
  .content { padding: 16px 12px 40px; }
}
@media (max-width: 380px) {
  .btn-novo svg + * { display: none; }
  .btn-novo { padding: 8px; }
}
@media (max-width: 900px) { .stats-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .stats-row { grid-template-columns: 1fr 1fr; } .stat-num { font-size: 32px; letter-spacing: -1px; } }
@media (max-width: 900px) { .grid-main { grid-template-columns: 1fr; } }
@media (max-width: 768px) { .rel-grid { grid-template-columns: 1fr !important; } }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } .fg.full { grid-column: 1; } }
@media (max-width: 600px) { .modal { border-radius: 10px; max-width: calc(100vw - 16px); width: calc(100vw - 16px) !important; margin: 8px; } .modal-head,.modal-body,.modal-foot { padding-left: 16px; padding-right: 16px; } }
@media (max-width: 700px) { #page-whatsapp > div[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; } }
@media (max-width: 600px) {
  .card-head { flex-wrap: wrap; gap: 8px; }
  .page-header h1 { font-size: 26px; }
  .tbl th, .tbl td { padding: 10px 12px; }
  table:has(#dash-tb) th:nth-child(2), table:has(#dash-tb) td:nth-child(2),
  table:has(#dash-tb) th:nth-child(4), table:has(#dash-tb) td:nth-child(4) { display: none; }
  table:has(#proc-tb) th:nth-child(2), table:has(#proc-tb) td:nth-child(2),
  table:has(#proc-tb) th:nth-child(4), table:has(#proc-tb) td:nth-child(4),
  table:has(#proc-tb) th:nth-child(5), table:has(#proc-tb) td:nth-child(5) { display: none; }
  table:has(#tk-tbody) th:nth-child(3), table:has(#tk-tbody) td:nth-child(3),
  table:has(#tk-tbody) th:nth-child(6), table:has(#tk-tbody) td:nth-child(6),
  table:has(#tk-tbody) th:nth-child(7), table:has(#tk-tbody) td:nth-child(7) { display: none; }
  table:has(#usr-tb) th:nth-child(2), table:has(#usr-tb) td:nth-child(2),
  table:has(#usr-tb) th:nth-child(5), table:has(#usr-tb) td:nth-child(5) { display: none; }
  table:has(#cli-tb) th:nth-child(2), table:has(#cli-tb) td:nth-child(2),
  table:has(#cli-tb) th:nth-child(4), table:has(#cli-tb) td:nth-child(4),
  table:has(#cli-tb) th:nth-child(5), table:has(#cli-tb) td:nth-child(5) { display: none; }
  table:has(#im-tb) th:nth-child(2), table:has(#im-tb) td:nth-child(2),
  table:has(#im-tb) th:nth-child(4), table:has(#im-tb) td:nth-child(4) { display: none; }
  table:has(#fin-cob-tb) th:nth-child(2), table:has(#fin-cob-tb) td:nth-child(2),
  table:has(#fin-cob-tb) th:nth-child(4), table:has(#fin-cob-tb) td:nth-child(4),
  table:has(#fin-cob-tb) th:nth-child(5), table:has(#fin-cob-tb) td:nth-child(5) { display: none; }
  table:has(#fin-rep-tb) th:nth-child(3), table:has(#fin-rep-tb) td:nth-child(3),
  table:has(#fin-rep-tb) th:nth-child(4), table:has(#fin-rep-tb) td:nth-child(4),
  table:has(#fin-rep-tb) th:nth-child(5), table:has(#fin-rep-tb) td:nth-child(5) { display: none; }
  table:has(#wa-logs-tbody) th:nth-child(2), table:has(#wa-logs-tbody) td:nth-child(2),
  table:has(#wa-logs-tbody) th:nth-child(4), table:has(#wa-logs-tbody) td:nth-child(4) { display: none; }
}

/* ══════════════════════════════════════════════════════════════════
   VIEW TOGGLE  (Lista ↔ Kanban)
══════════════════════════════════════════════════════════════════ */
.view-toggle {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 3px;
  gap: 2px;
}
.view-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  border-radius: calc(var(--r-md) - 2px);
  cursor: pointer;
  color: var(--muted);
  transition: background .15s, color .15s;
}
.view-toggle-btn:hover { background: var(--bg-hover); color: var(--ink); }
.view-toggle-btn.active {
  background: var(--white);
  color: var(--brand-600);
  box-shadow: var(--shadow-sm);
}
.view-toggle-btn svg { width: 15px; height: 15px; stroke-width: 2; }

/* ══════════════════════════════════════════════════════════════════
   KANBAN BOARD
══════════════════════════════════════════════════════════════════ */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  align-items: start;
}
.kanban-col {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  min-height: 180px;
  transition: background .15s, border-color .15s;
}
.kanban-col.drag-over {
  background: var(--brand-50);
  border-color: var(--brand-400);
}
.kanban-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
}
.kanban-col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.kanban-col-cnt {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  background: var(--white);
  color: var(--muted);
  border-radius: 10px;
  padding: 1px 7px;
  border: 1px solid var(--border);
}
.kanban-cards {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 60px;
}
.kanban-empty {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 20px 12px;
  opacity: .6;
}
.kanban-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 12px 10px;
  cursor: pointer;
  border-left: 3px solid var(--border);
  transition: transform .12s, box-shadow .12s, opacity .12s;
  position: relative;
  user-select: none;
}
.kanban-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.kanban-card.dragging {
  opacity: .35;
  transform: scale(.96);
  box-shadow: none;
}
.kcard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.kcard-tipo   { font-size: 13px; }
.kcard-prior  { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.kcard-titulo {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
  margin-bottom: 5px;
  word-break: break-word;
}
.kcard-titulo.done { text-decoration: line-through; color: var(--muted); }
.kcard-vinc   { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.kcard-venc   { margin-bottom: 5px; }
.kcard-date   { font-size: 11px; color: var(--muted); }
.kcard-date.overdue { color: var(--red);   font-weight: 600; }
.kcard-date.today   { color: var(--amber); font-weight: 600; }
.kcard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}
.kcard-resp    { font-size: 11px; color: var(--muted); }
.kcard-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.kanban-card:hover .kcard-actions { opacity: 1; }

@media (max-width: 1100px) { .kanban-board { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .kanban-board { grid-template-columns: 1fr; } }

/* ── IMÓVEIS — GRID DE CARDS ─────────────────────────────────────── */
.im-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  padding: 16px;
}
.im-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .18s, transform .18s;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}
.im-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,.10);
  transform: translateY(-2px);
}
.im-card-photo {
  position: relative;
  height: 160px;
  background: var(--surface-2, #f4f5f7);
  flex-shrink: 0;
  overflow: hidden;
}
.im-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}
.im-card:hover .im-card-photo img { transform: scale(1.04); }
.im-card-nophoto {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--muted);
  background: var(--surface-2, #f4f5f7);
}
.im-card-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.im-card-fotocnt {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 11px;
  color: #fff;
  background: rgba(0,0,0,.45);
  border-radius: 99px;
  padding: 2px 7px;
  backdrop-filter: blur(4px);
}
.im-card-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.im-card-tipo {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--brand-600, #7c3aed);
  margin-bottom: 4px;
}
.im-card-end {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.im-card-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.im-card-specs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.im-card-spec {
  font-size: 11px;
  color: var(--muted);
  border-radius: 6px;
  padding: 2px 7px;
  border: 1px solid var(--border);
}
.im-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
  padding-top: 8px;
}
.im-card-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.im-card-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity .15s;
}
.im-card:hover .im-card-actions { opacity: 1; }

@media (max-width: 700px) {
  .im-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; padding: 10px; }
  .im-card-photo { height: 120px; }
}

/* ── MODAL FILTROS — BARRAS ──────────────────────────────────────── */
.flt-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.flt-bar label {
  width: 130px;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink2, #374151);
}
.btn.has-filters {
  background: var(--brand-50, #f5f3ff);
  border-color: var(--brand-400, #a78bfa);
  color: var(--brand-600, #7c3aed);
}

/* ── Ficha do Lead (Funil) ─────────────────────────────────────── */
.ficha-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  margin: 0 0 8px;
}
