:root {
    /* --- Azuis da marca (rampa única) --- */
    --navy: #0b2545;             /* confiança: navegação e texto */
    --primary-darker: #174a7c;
    --primary: #2563eb;          /* ação principal: azul CRM */
    --primary-dark: #174a7c;     /* alias legado */
    --primary-light: #60a5fa;    /* realces e estados ativos */

    /* --- Acento teal (usado com parcimônia: estados ativos, kickers) --- */
    --accent: #0f9d8a;
    --accent-light: #2dd4bf;
    --accent-soft: #e6f8f5;      /* fundo suave do acento */

    /* --- Neutros: TODOS com leve tinta azul, nada de cinza-zinco --- */
    --surface: #ffffff;          /* cards/painéis em branco */
    --surface-2: #f6f8fb;        /* fundo sutil: cabeçalho de tabela, hover, trilhos */
    --surface-3: #eaf0f7;        /* fundo sutil mais firme: chips, tiles neutros */
    --tint: #eaf1fb;             /* tinta azul: ícones/realces informativos */
    --tint-strong: #dce9fa;      /* tinta azul em hover/estado */
    --border: #e2e9f1;
    --border-strong: #cfdbe8;
    --text: #0b2545;             /* texto navy sobre branco */
    --muted: #5b7088;
    --muted-soft: #8fa3ba;       /* texto terciário / vazios */
    --sidebar-text: #b9c9dc;
    --on-navy: rgba(207,224,242,.72); /* texto secundário sobre o navy */
    --bg: #0b2545;               /* fundo navy */

    /* --- Semânticas (mesma saturação entre si) --- */
    --success: #0f9d8a; --success-soft: #dff7f2;
    --warning: #c47b09; --warning-soft: #fff4d6;
    --danger:  #dc2626; --danger-soft:  #fee2e2;
    --info:    #1d4ed8; --info-soft:    #dbeafe;
    --violet:  #6d28d9; --violet-soft:  #ede9fe;

    --radius: 12px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(0, 31, 63, .08), 0 1px 3px rgba(0, 31, 63, .05);
    --shadow-md: 0 6px 16px rgba(0, 31, 63, .12), 0 2px 4px rgba(0, 31, 63, .06);
    --shadow-lg: 0 16px 36px rgba(0, 31, 63, .20);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; max-width: 100%; }
.row > [class*="col-"] { min-width: 0; }

/* Scrollbar sutil */
* { scrollbar-width: thin; scrollbar-color: rgba(0,31,63,.25) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(0,31,63,.22); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,31,63,.38); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* Foco acessível */
a:focus-visible, button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px;
}
body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(155deg, #071d36 0%, #0b2545 52%, #174a7c 100%);
    background-attachment: fixed;
    color: var(--text);
}
/* Brilhos azuis atrás da UI — dão o que refratar no vidro da sidebar. */
body::before {
    content: '';
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(560px 560px at -4% -6%, rgba(37,99,235,.46), transparent 60%),
        radial-gradient(520px 520px at 6% 108%, rgba(15,157,138,.30), transparent 60%),
        radial-gradient(640px 640px at 100% 20%, rgba(23,74,124,.48), transparent 62%);
}

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }

:root {
    --sb-rail: 78px; --sb-full: 258px;
    --sb-inset: 10px;              /* respiro da sidebar flutuante até a borda */
    --sb-gap: 20px;                /* respiro entre a sidebar e o conteúdo */
    /* calha do conteúdo: acompanha a largura atual da sidebar */
    --gutter: calc(var(--sb-inset) + var(--sb-rail) + var(--sb-gap));   /* 108px */
    --gutter-open: calc(var(--sb-inset) + var(--sb-full) + var(--sb-gap)); /* 288px */
}
/* ao expandir, o conteúdo é EMPURRADO — a sidebar nunca cobre os cards */
.sidebar:hover ~ .main .topbar,
.sidebar:hover ~ .main .content,
.sidebar:hover ~ .main .app-footer { padding-left: var(--gutter-open); }

.sidebar {
    width: var(--sb-rail);
    background: linear-gradient(160deg, rgba(11,37,69,.90), rgba(7,29,54,.92));
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    backdrop-filter: blur(22px) saturate(180%);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    position: fixed;
    inset: 10px auto 10px 10px;
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: 0 20px 50px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.10);
    z-index: 40;
    transition: width .3s var(--ease), transform .25s ease, box-shadow .3s var(--ease);
    overflow: visible;
}
/* expande ao passar o mouse (sobre o conteúdo) */
/* expandida: mais opaca — como o conteúdo é empurrado, ela não precisa
   "deixar ver" o que está atrás (era isso que borrava os cards). */
.sidebar:hover {
    width: var(--sb-full);
    background: linear-gradient(160deg, rgba(11,37,69,.98), rgba(7,29,54,.99));
    box-shadow: 0 28px 70px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.12);
}

/* rótulos: largura colapsada no modo rail (não empurram o ícone), aparecem ao expandir */
.nav-label { white-space: nowrap; overflow: hidden; max-width: 0; opacity: 0;
    transition: max-width .24s var(--ease), opacity .18s var(--ease); }
.sidebar:hover .nav-label { max-width: 160px; opacity: 1; transition-delay: 0s, .05s; }

/* modo rail: ícones centralizados */
.sidebar:not(:hover) .nav-menu a,
.sidebar:not(:hover) .sidebar-footer a { justify-content: center; padding-left: 0; padding-right: 0; gap: 0; }
.sidebar:not(:hover) .brand { justify-content: center; padding-left: 0; padding-right: 0; gap: 0; }
.brand-name { white-space: nowrap; overflow: hidden; max-width: 160px;
    transition: max-width .24s var(--ease), opacity .18s var(--ease); }
.sidebar:not(:hover) .brand-name { max-width: 0; opacity: 0; }
/* brilho líquido no topo do vidro */
.sidebar::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 140px; pointer-events: none;
    background: linear-gradient(180deg, rgba(255,255,255,.10), transparent);
}
.brand { position: relative; display: flex; align-items: center; gap: 12px; padding: 6px 10px 20px; margin-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-page-context { display: flex; flex-direction: column; gap: 2px; padding: 0 10px 14px; margin-bottom: 4px; border-bottom: 1px solid rgba(255,255,255,.08); white-space: nowrap; overflow: hidden; }
.sidebar-page-context span { color: rgba(207,224,242,.58); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-page-context strong { color: #fff; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.sidebar:not(:hover) .sidebar-page-context { max-height: 0; padding-top: 0; padding-bottom: 0; margin: 0; border: 0; opacity: 0; }
.brand-mark {
    width: 38px; height: 38px; border-radius: 10px;
    background: linear-gradient(135deg, #2563eb, #0b2545);
    color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 19px;
}
.brand-name { color: #fff; font-weight: 700; font-size: 18px; }
.brand-name span { color: rgba(159,196,238,.8); }

.nav-menu {
    position: relative; display: flex; flex-direction: column; justify-content: flex-start; gap: 8px; flex: 1;
    min-height: 0; overflow-y: auto; overflow-x: hidden;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent;
}
.nav-menu::-webkit-scrollbar { width: 5px; }
.nav-menu::-webkit-scrollbar-track { background: transparent; }
.nav-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border-radius: 10px; }
.nav-menu a {
    display: flex; align-items: center; gap: 13px;
    padding: 13px 15px; border-radius: 13px;
    color: var(--sidebar-text); text-decoration: none; font-weight: 500; font-size: 14.5px;
    border: 1px solid transparent;
    transition: background .18s, color .18s, border-color .18s, box-shadow .18s;
}
.nav-menu a:hover { background: rgba(255,255,255,.06); color: var(--surface-2); border-color: rgba(255,255,255,.08); }
.nav-menu a.active {
    background: linear-gradient(135deg, rgba(20,184,166,.28), rgba(13,148,136,.12));
    color: #fff; border-color: rgba(20,184,166,.35);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 6px 16px rgba(0,0,0,.22);
}
.nav-menu a.active i { color: #5eead4; }
.nav-menu i { font-size: 17px; }

.sidebar-footer { position: relative; display: flex; flex-direction: column; gap: 6px; padding-top: 10px; margin-top: 6px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-footer a {
    display: flex; align-items: center; gap: 13px; padding: 12px 15px;
    color: var(--sidebar-text); text-decoration: none; border-radius: 13px; font-weight: 500; font-size: 14.5px;
    border: 1px solid transparent; transition: background .18s, color .18s, border-color .18s;
}
.sidebar-footer a:hover { background: rgba(255,255,255,.06); color: #fff; border-color: rgba(255,255,255,.08); }
.sidebar-footer a.active { background: linear-gradient(135deg, rgba(20,184,166,.28), rgba(13,148,136,.12)); color: #fff; border-color: rgba(20,184,166,.35); }
.sidebar-footer a.active i { color: #5eead4; }
.sidebar-footer a:last-child:hover { background: rgba(239,68,68,.14); color: #fca5a5; border-color: rgba(239,68,68,.2); }
.sidebar-utilities { position: relative; display: flex; align-items: center; gap: 7px; padding: 10px 8px; margin-top: 6px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-utilities .bell-btn { width: 38px; height: 38px; border-color: rgba(255,255,255,.12); color: var(--sidebar-text); background: rgba(255,255,255,.06); }
.sidebar-utilities .bell-btn:hover, .sidebar-utilities .bell-btn.has-unread { color: #fff; border-color: rgba(96,165,250,.65); background: rgba(37,99,235,.24); }
.sidebar-notifications .notif-menu {
    position: absolute;
    /* A barra de utilidades fica no rodapé da sidebar: o menu sobe para
       permanecer dentro da janela e não ficar atrás da barra do sistema. */
    inset: auto auto calc(100% + 12px) calc(100% + 12px);
    z-index: 1060;
    margin: 0;
    max-height: min(500px, calc(100vh - 24px));
}
.sidebar-user { display: flex; min-width: 0; align-items: center; gap: 9px; flex: 1; padding: 1px; color: var(--sidebar-text); text-decoration: none; border-radius: 12px; }
.sidebar-user:hover, .sidebar-user.active { color: #fff; }
.sidebar-user .avatar-img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.sidebar:not(:hover) .sidebar-utilities { justify-content: center; padding-left: 0; padding-right: 0; }
.sidebar:not(:hover) .sidebar-user { display: none; }

/* Profile */
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-avatar { width: 60px; height: 60px; border-radius: 50%; background: linear-gradient(135deg, #004080, #001f3f); color: #fff; display: grid; place-items: center; font-size: 26px; font-weight: 800; }

.profile-banner { height: 104px; background: linear-gradient(120deg, var(--primary-dark), var(--primary) 65%, #0066cc); border-radius: var(--radius) var(--radius) 0 0; }
/* avatar sobrepõe o banner; nome/cargo ficam ABAIXO, na área branca (legível) */
.profile-body { padding: 0 24px 22px; }
.profile-id { margin-top: 12px; }
.profile-name { font-weight: 800; font-size: 22px; color: var(--text); line-height: 1.2; }
.profile-pos { color: var(--muted); font-size: 14px; margin-top: 1px; }
.avatar-edit { position: relative; cursor: pointer; display: inline-block; margin-top: -54px; }
.avatar-preview {
    width: 104px; height: 104px; border-radius: 50%; border: 4px solid var(--surface);
    background: linear-gradient(135deg, #004080, #001f3f); background-size: cover; background-position: center;
    display: grid; place-items: center; color: #fff; font-size: 40px; font-weight: 800; box-shadow: var(--shadow);
}
.avatar-cam { position: absolute; right: 2px; bottom: 2px; width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; border: 3px solid var(--surface); font-size: 13px; }
.avatar-edit:hover .avatar-cam { background: var(--primary-dark); }
.profile-id { padding-bottom: 4px; }

/* Avatar no topbar */
.user-chip .avatar-img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }

/* main ocupa 100%; a sidebar de vidro flutua por cima (fixed) */
.main { flex: 1; margin-left: 0; min-width: 0; display: flex; flex-direction: column; padding-top: 0; }

/* topbar FIXA no topo em todas as telas, passando ATRÁS da sidebar de vidro */
.topbar {
    height: 68px; background: var(--surface); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 16px; padding: 0 28px 0 var(--gutter);
    transition: padding-left .3s var(--ease);
    position: fixed; top: 0; left: 0; right: 0; z-index: 30;
    box-shadow: 0 2px 10px rgba(0,31,63,.06);
}
.topbar { display: none; }
.menu-toggle { display: none; background: none; border: none; font-size: 24px; color: var(--text); cursor: pointer; }
.page-title { font-size: 21px; font-weight: 700; letter-spacing: -.01em; margin: 0; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* Sino de notificações */
.bell-btn {
    position: relative; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
    background: var(--surface); color: var(--muted); font-size: 18px; cursor: pointer;
    display: grid; place-items: center; transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.bell-btn:hover { background: #f4f7fb; color: var(--primary); border-color: var(--border-strong); }
.bell-btn.has-unread { color: var(--primary); border-color: var(--border-strong); }
/* animação de sino quando há novas */
.bell-btn.has-unread i { transform-origin: top center; animation: bellRing 2.4s var(--ease) infinite; }
@keyframes bellRing {
    0%, 55%, 100% { transform: rotate(0); }
    60% { transform: rotate(14deg); } 66% { transform: rotate(-12deg); }
    72% { transform: rotate(9deg); } 78% { transform: rotate(-7deg); }
    84% { transform: rotate(4deg); } 90% { transform: rotate(0); }
}
.bell-dot { position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: #ef4444; border: 2px solid var(--surface); box-shadow: 0 0 0 0 rgba(239,68,68,.5); animation: pulse 1.8s var(--ease) infinite; }
.bell-count { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--surface); }

.notif-menu { width: 360px; max-width: 92vw; padding: 0; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; }
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; font-weight: 700; font-size: 14px; border-bottom: 1px solid var(--border); }
.notif-badge { background: #ef4444; color: #fff; border-radius: 999px; padding: 0 7px; font-size: 11px; margin-left: 4px; }
.notif-readall { font-size: 12px; font-weight: 600; color: var(--primary); text-decoration: none; }
.notif-readall:hover { text-decoration: underline; }
.notif-scroll { max-height: min(380px, calc(100vh - 100px)); overflow-y: auto; }
.notif-empty { padding: 26px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.notif-item { position: relative; display: flex; gap: 11px; padding: 11px 16px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--border); transition: background .15s var(--ease); }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.is-new { background: var(--tint); }
.notif-item.is-new:hover { background: var(--tint-strong); }
.notif-newdot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); align-self: center; flex-shrink: 0; }
.notif-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--tint); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; font-size: 15px; }
.notif-ic.m-properties { background: var(--success-soft); color: var(--success); }
.notif-ic.m-users, .notif-ic.m-teams { background: var(--violet-soft); color: var(--violet); }
.notif-ic.m-roles { background: var(--warning-soft); color: var(--warning); }
.notif-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.notif-desc { font-size: 13px; line-height: 1.35; }
.notif-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.user-chip { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }
.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700;
}
.content { padding: 26px 28px 26px var(--gutter); flex: 1; transition: padding-left .3s var(--ease); }

/* Rodapé minimalista */
.app-footer { padding: 16px 28px 20px var(--gutter); transition: padding-left .3s var(--ease); display: flex; align-items: center; gap: 8px;
    color: var(--on-navy); font-size: 12.5px; }
.app-footer-sep { opacity: .5; }
.app-footer-link { color: var(--on-navy); text-decoration: none; margin-left: auto; font-weight: 600; }
.app-footer-link:hover { color: #fff; }

/* ---------- Cards & stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 26px; }
.card-x { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 32px; font-weight: 800; margin-top: 6px; }
.stat-icon { float: right; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--tint); color: var(--primary); }
.stat-sub { font-size: 16px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.stat-hint { font-size: 12.5px; margin-top: 6px; }

/* Funnel / source bars */
.funnel-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.funnel-row:last-child { margin-bottom: 0; }
.funnel-label { width: 110px; font-size: 13px; font-weight: 600; color: var(--text); flex-shrink: 0; }
.funnel-track { flex: 1; height: 12px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.funnel-fill { height: 100%; border-radius: 999px; transition: width .5s ease; }
.funnel-fill.s-new { background: #3b82f6; }
.funnel-fill.s-attempt { background: #f59e0b; }
.funnel-fill.s-in_service { background: #6366f1; }
.funnel-fill.s-attention { background: #f97316; }
.funnel-fill.s-bought { background: #22c55e; }
.funnel-fill.s-future { background: #14b8a6; }
.funnel-fill.s-owner { background: #06b6d4; }
.funnel-fill.s-visit { background: #8b5cf6; }
.funnel-fill.s-proposal { background: #ec4899; }
.funnel-fill.s-in_visit { background: #a855f7; }
.funnel-fill.s-redistribute { background: #64748b; }
.funnel-fill.s-lost { background: #ef4444; }
/* legado (ainda usado em telas antigas) */
.funnel-fill.s-contacted { background: #f59e0b; }
.funnel-fill.s-qualified { background: #6366f1; }
.funnel-fill.s-won { background: #22c55e; }
.funnel-value { width: 34px; text-align: right; font-weight: 700; font-size: 14px; flex-shrink: 0; }

/* ---------- Table ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: var(--surface-2); border-bottom: 1px solid var(--border); gap: 12px; flex-wrap: wrap; }
.panel-head h2 { min-width: 0; font-size: 17px; font-weight: 700; margin: 0; overflow-wrap: anywhere; }
table.data { width: 100%; border-collapse: collapse; }
table.data thead th { background: var(--surface-2); }
table.data th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 13px 20px; border-bottom: 1px solid var(--border); }
table.data td { padding: 14px 20px; border-bottom: 1px solid var(--border); font-size: 14px; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }

.badge-status { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid transparent; }
.s-new { background: var(--info-soft); color: var(--info); border-color: rgba(29,78,216,.14); }
.s-attempt { background: var(--warning-soft); color: var(--warning); border-color: rgba(180,83,9,.14); }
.s-in_service { background: #e0e7ff; color: #4338ca; border-color: rgba(67,56,202,.14); }
.s-attention { background: #ffedd5; color: #c2410c; border-color: rgba(194,65,12,.14); }
.s-bought { background: var(--success-soft); color: var(--success); border-color: rgba(21,128,61,.14); }
.s-future { background: #ccfbf1; color: #0f766e; border-color: rgba(15,118,110,.14); }
.s-owner { background: #cffafe; color: #0e7490; border-color: rgba(14,116,144,.14); }
.s-visit { background: #ede9fe; color: #6d28d9; border-color: rgba(109,40,217,.14); }
.s-proposal { background: #fce7f3; color: #be185d; border-color: rgba(190,24,93,.14); }
.s-in_visit { background: var(--violet-soft); color: #7e22ce; border-color: rgba(126,34,206,.14); }
.s-redistribute { background: #e2e8f0; color: #475569; border-color: rgba(71,85,105,.14); }
.s-lost { background: var(--danger-soft); color: var(--danger); border-color: rgba(185,28,28,.14); }
/* legado (badges de imóveis/logs) */
.s-contacted { background: var(--warning-soft); color: var(--warning); border-color: rgba(180,83,9,.14); }
.s-qualified { background: #e0e7ff; color: #4338ca; border-color: rgba(67,56,202,.14); }
.s-won { background: var(--success-soft); color: var(--success); border-color: rgba(21,128,61,.14); }

/* ---------- Buttons / forms ---------- */
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(0,31,63,.18); }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active { background: var(--primary-darker); border-color: var(--primary-darker); color: #fff; }
/* secundários com tinta azul (nunca cinza neutro) */
.btn-outline-primary { color: var(--primary); border-color: var(--border-strong); background: var(--surface); }
.btn-outline-primary:hover { background: var(--tint); border-color: var(--primary); color: var(--primary); }
.btn-light, .btn-outline-secondary { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn-light:hover, .btn-outline-secondary:hover { background: var(--tint); border-color: var(--border-strong); color: var(--primary); }
.btn-danger { background: #dc2626; border-color: #dc2626; }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); }
.form-label { font-weight: 600; font-size: 14px; }

/* ---------- Login (split-screen) ---------- */
.login-split { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 100vh; background: var(--surface); }

.login-aside {
    position: relative; overflow: hidden; color: #fff;
    padding: 46px 54px; display: flex; flex-direction: column; justify-content: space-between;
    background: radial-gradient(540px 420px at 0% 100%, rgba(45,212,191,.25), transparent 65%), linear-gradient(150deg, #0b2545 0%, #174a7c 52%, #2563eb 100%);
}
/* textura de pontos + marca d'água */
.login-aside::before {
    content: ''; position: absolute; inset: 0; opacity: .5; pointer-events: none;
    background-image: radial-gradient(rgba(255,255,255,.14) 1.4px, transparent 1.4px);
    background-size: 26px 26px;
}
.login-aside::after {
    content: ''; position: absolute; right: -120px; bottom: -140px; width: 460px; height: 460px; border-radius: 50%;
    border: 60px solid rgba(255,255,255,.06); pointer-events: none;
}
.login-aside-top { position: relative; display: flex; align-items: center; gap: 12px; }
.login-aside-top .brand-name { color: #fff; } .login-aside-top .brand-name span { color: #9fc4ee; }
.login-aside-mid { position: relative; max-width: 460px; }
.login-kicker { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 13px; color: #a7f3d0; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.login-aside-mid h1 { font-size: 40px; line-height: 1.12; font-weight: 800; margin: 0 0 14px; }
.login-aside-mid p { font-size: 16px; color: rgba(255,255,255,.82); margin: 0; }
.login-benefits { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }.login-benefits span { display: inline-flex; align-items: center; gap: 5px; padding: 7px 9px; border: 1px solid rgba(255,255,255,.15); border-radius: 999px; color: rgba(255,255,255,.9); background: rgba(255,255,255,.08); font-size: 12px; font-weight: 600; }.login-benefits i { color: #a7f3d0; }
.login-aside-foot { position: relative; font-size: 13px; color: rgba(255,255,255,.6); }

.login-form-side { display: grid; place-items: center; padding: 30px; background: linear-gradient(145deg, #f8fbff, #fff); }
.login-box { width: 100%; max-width: 400px; padding: 30px; border: 1px solid var(--border); border-radius: 18px; background: rgba(255,255,255,.92); box-shadow: var(--shadow-lg); animation: fadeUp .5s var(--ease) both; }
.login-product-mark { display: none; align-items: center; gap: 9px; margin-bottom: 26px; color: var(--text); font-weight: 800; }.login-product-mark .brand-mark { width: 34px; height: 34px; font-size: 16px; }
.login-title { font-weight: 800; font-size: 24px; margin: 0 0 4px; color: var(--text); }
.login-sub { color: var(--muted); font-size: 14px; margin-bottom: 26px; }
.login-box .input-group-text { background: var(--surface-2); border-color: var(--border); color: var(--muted); }
.login-legal { text-align: center; color: var(--muted); font-size: 12px; margin-top: 20px; }.login-legal i { color: var(--success); }

@media (max-width: 860px) {
    .login-split { grid-template-columns: 1fr; }
    .login-aside { display: none; }
    .login-form-side { padding: 20px; }.login-box { padding: 25px 22px; }.login-product-mark { display: flex; }
}

/* ---------- Pagination ---------- */
.katia-pager { display: flex; justify-content: center; }
.katia-pager .pagination { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.katia-pager .page-item .page-link {
    display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 12px;
    border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
    color: var(--text); font-weight: 600; font-size: 14px; text-decoration: none;
    transition: all .15s ease;
}
.katia-pager .page-item .page-link:hover { border-color: var(--primary); color: var(--primary); background: var(--surface-2); }
.katia-pager .page-item.active .page-link { background: var(--primary); border-color: var(--primary); color: #fff; }
.katia-pager .page-item.disabled .page-link { opacity: .45; pointer-events: none; }

/* ---------- Loading top bar ---------- */
#topbar-progress {
    position: fixed; top: 0; left: 0; height: 3px; width: 0;
    background: linear-gradient(90deg, #0066cc, #004080);
    z-index: 9999; transition: width .3s ease, opacity .4s ease; opacity: 0;
    box-shadow: 0 0 10px rgba(0,102,204,.35);
}
#topbar-progress.active { opacity: 1; }

/* ---------- Button loading state ---------- */
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
    content: ''; position: absolute; inset: 0; margin: auto;
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.5); border-top-color: #fff;
    animation: spin .6s linear infinite;
}
.btn-light.is-loading::after, .btn-outline-secondary.is-loading::after { border-color: rgba(24,24,27,.3); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Entrance & interaction effects ---------- */
:root { --ease: cubic-bezier(.22, 1, .36, 1); }

.content > * { animation: fadeUp .5s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* entrada em cascata para grades e colunas */
.kanban-col, .people-grid > *, .property-grid > *, .role-grid > *, .stat-grid > * {
    animation: popIn .5s var(--ease) both;
}
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.kanban-col:nth-child(1), .people-grid > *:nth-child(1), .property-grid > *:nth-child(1), .role-grid > *:nth-child(1), .stat-grid > *:nth-child(1) { animation-delay: .02s; }
.kanban-col:nth-child(2), .people-grid > *:nth-child(2), .property-grid > *:nth-child(2), .role-grid > *:nth-child(2), .stat-grid > *:nth-child(2) { animation-delay: .07s; }
.kanban-col:nth-child(3), .people-grid > *:nth-child(3), .property-grid > *:nth-child(3), .role-grid > *:nth-child(3), .stat-grid > *:nth-child(3) { animation-delay: .12s; }
.kanban-col:nth-child(4), .people-grid > *:nth-child(4), .property-grid > *:nth-child(4), .role-grid > *:nth-child(4), .stat-grid > *:nth-child(4) { animation-delay: .17s; }
.kanban-col:nth-child(5), .people-grid > *:nth-child(5), .property-grid > *:nth-child(5), .role-grid > *:nth-child(5) { animation-delay: .22s; }
.kanban-col:nth-child(6), .people-grid > *:nth-child(6), .property-grid > *:nth-child(6), .role-grid > *:nth-child(6) { animation-delay: .27s; }

.card-x { transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s var(--ease); }
.card-x:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

table.data tr td { transition: background .18s var(--ease); }
.btn { transition: transform .18s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease), filter .2s var(--ease); }
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(1px) scale(.99); }

.form-control, .form-select { transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,64,128,.14); }

.alert { animation: fadeUp .4s var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
}

/* backdrop when sidebar open on mobile */
.sidebar-backdrop {
    display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45);
    z-index: 35; opacity: 0; transition: opacity .25s ease;
}
.sidebar-backdrop.show { display: block; opacity: 1; }
.sidebar-mobile-toggle { display: none; }

/* ---------- Properties ---------- */
.section-title { font-size: 15px; font-weight: 700; margin: 0 0 16px; color: var(--text); border-left: 3px solid var(--accent); padding-left: 10px; line-height: 1.1; }

/* Barra de filtros */
.property-overview { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 20px 22px; margin: 0 0 16px; border: 1px solid var(--border); border-radius: 16px; background: linear-gradient(118deg, #fff, #f2f7ff); box-shadow: var(--shadow); }
.property-overview-copy { display: flex; flex: 1; flex-direction: column; gap: 4px; }
.property-overview-copy > strong { color: var(--text); font-size: 18px; letter-spacing: -.02em; }
.property-overview-copy > span:last-child { color: var(--muted); font-size: 13px; }
.property-overview-stats { display: grid; grid-template-columns: repeat(4, minmax(92px, 1fr)); gap: 8px; }
.property-overview-stat { min-width: 92px; padding: 10px 11px; border: 1px solid var(--border); border-top: 3px solid #60a5fa; border-radius: 10px; background: rgba(255,255,255,.82); }
.property-overview-stat.ps-reserved { border-top-color: var(--warning); }
.property-overview-stat.ps-sold { border-top-color: var(--success); }
.property-overview-stat.ps-rented { border-top-color: var(--violet); }
.property-overview-stat span { display: block; color: var(--muted); font-size: 11px; font-weight: 700; }
.property-overview-stat strong { display: block; margin-top: 3px; color: var(--text); font-size: 20px; line-height: 1; }
.filter-bar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.filter-search { flex: 1; min-width: 220px; position: relative; display: flex; align-items: center; }
.filter-search i { position: absolute; left: 13px; color: var(--muted); font-size: 15px; }
.filter-search input { width: 100%; padding: 10px 14px 10px 38px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: 14px; transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.filter-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,64,128,.14); }
.filter-bar .form-select { width: auto; min-width: 120px; }
.view-toggle { display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.view-toggle a { width: 40px; height: 40px; display: grid; place-items: center; color: var(--muted); text-decoration: none; transition: background .2s var(--ease), color .2s var(--ease); }
.view-toggle a.active { background: var(--primary); color: #fff; }

/* Página de integrações: quadros lado a lado */
.integration-hero { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 28px 30px; margin-bottom: 16px; border: 1px solid rgba(96,165,250,.28); border-radius: 18px; color: #eff6ff; background: radial-gradient(600px 220px at 0% 0%, rgba(45,212,191,.20), transparent 64%), linear-gradient(120deg, #0b2545, #174a7c); box-shadow: var(--shadow-md); }
.integration-hero h1 { max-width: 680px; margin: 8px 0; color: #fff; font-size: clamp(24px, 3vw, 34px); line-height: 1.15; letter-spacing: -.03em; }
.integration-hero p { max-width: 690px; margin: 0; color: rgba(239,246,255,.78); }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; color: #a7f3d0; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.integration-hero-state { display: inline-flex; align-items: center; gap: 9px; flex: 0 0 auto; padding: 10px 13px; border: 1px solid; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.integration-hero-state.is-ready { color: #d1fae5; border-color: rgba(110,231,183,.45); background: rgba(6,95,70,.35); }
.integration-hero-state.is-pending { color: #fef3c7; border-color: rgba(253,230,138,.45); background: rgba(146,64,14,.32); }
.meta-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.meta-metrics > div { position: relative; min-height: 96px; padding: 17px; overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.meta-metrics span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.meta-metrics strong { display: block; color: var(--text); font-size: 25px; line-height: 1.1; letter-spacing: -.025em; }
.meta-metrics .metric-date { font-size: 18px; padding-top: 5px; }
.meta-metrics i { position: absolute; right: 15px; bottom: 14px; color: var(--primary-light); font-size: 22px; opacity: .65; }
.meta-metrics .has-alert { border-color: rgba(220,38,38,.28); background: linear-gradient(135deg, #fff, var(--danger-soft)); }
.meta-metrics .has-alert i { color: var(--danger); }

.integrations-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.integrations-grid .panel { margin-bottom: 0; height: 100%; }
.integrations-grid .span-full { grid-column: 1 / -1; }
/* o <form> não deve virar caixa de layout: seus painéis participam do grid */
.integrations-form { display: contents; }

/* Cards de canais (integrações) — em linha, um ao lado do outro */
.channel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 4px; }
.channel-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 18px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.channel-card.is-disabled { opacity: .6; }
.channel-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; flex-shrink: 0; }
.channel-icon.ch-facebook { background: #e7f0fe; color: #1877f2; }
.channel-icon.ch-whatsapp { background: #e7f8ef; color: #25d366; }
.channel-icon.ch-whatsapp-web { background: var(--surface-3); color: var(--muted); }
.channel-info { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.channel-card .badge-status { margin-top: auto; white-space: nowrap; }

/* Painel de filtros avançados (offcanvas) */
.filter-panel { width: 420px; max-width: 92vw; z-index: 1090; }
.filter-panel .offcanvas-body { padding: 18px 22px; }
.filter-panel .form-label { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.filter-group-title { font-size: 14px; font-weight: 700; color: var(--text); margin: 18px 0 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.filter-purpose-tabs + .filter-group-title { border-top: none; padding-top: 0; margin-top: 16px; }
.filter-purpose-tabs { display: flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.filter-purpose-tabs button { flex: 1; padding: 9px 6px; background: var(--surface); border: none; border-right: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease); }
.filter-purpose-tabs button:last-child { border-right: none; }
.filter-purpose-tabs button.active { background: var(--primary); color: #fff; }
.filter-count-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }

/* Cabeçalho do painel de filtros */
.filter-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.filter-panel-head .offcanvas-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; margin: 0; }
.filter-head-actions { display: flex; align-items: center; gap: 14px; }
.filter-clear-link { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--primary); text-decoration: none; white-space: nowrap; }
.filter-clear-link:hover { text-decoration: underline; }
.filter-panel-head .btn-close { margin: 0; padding: 0; flex-shrink: 0; }

/* Grupos de botões (Todos · 1 · 2 · 3 · 4 · 5+) */
.count-toggle { display: flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.count-toggle button { flex: 1; padding: 8px 4px; background: var(--surface); border: none; border-right: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; transition: background .15s var(--ease), color .15s var(--ease); }
.count-toggle button:first-of-type { flex: 1.4; }
.count-toggle button:last-child { border-right: none; }
.count-toggle button:hover { background: var(--surface-2); }
.count-toggle button.active { background: var(--primary); color: #fff; }

/* Visualização em mapa dos imóveis */
.property-map-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
#propertiesMap { height: min(72vh, 680px); width: 100%; }
#propertiesMap a { color: var(--primary); font-weight: 600; }

/* Tags do card */
.property-tags { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.ptag { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 6px; color: #fff; text-transform: uppercase; letter-spacing: .02em; }
.ptag-sale { background: #004080; }
.ptag-rent { background: #7e22ce; }
.property-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.property-code { font-size: 12px; color: var(--muted); font-weight: 600; }
.property-acts { display: flex; gap: 2px; opacity: 0; transition: opacity .2s var(--ease); }
.property-card:hover .property-acts { opacity: 1; }

/* Visão em lista */
.property-list { display: flex; flex-direction: column; gap: 12px; }
.property-list .property-card { flex-direction: row; }
.property-list .property-thumb { width: 240px; height: auto; min-height: 150px; flex-shrink: 0; }
.property-list .property-body { flex: 1; }
@media (max-width: 640px) { .property-list .property-card { flex-direction: column; } .property-list .property-thumb { width: 100%; height: 170px; } }

.property-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.property-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s var(--ease); display: flex; flex-direction: column; }
.property-card:hover { transform: translateY(-4px); box-shadow: 0 12px 26px rgba(15,23,42,.12); }
.property-thumb { display: block; height: 170px; background-size: cover; background-position: center; position: relative; }
.property-thumb-wrap { height: 170px; position: relative; overflow: hidden; }
.property-list .property-thumb-wrap { width: 240px; flex-shrink: 0; }
.property-thumb-wrap .property-thumb { height: 100%; }
.property-carousel-btn { position: absolute; top: 50%; z-index: 2; transform: translateY(-50%); width: 30px; height: 30px; border: 0; border-radius: 50%; color: #fff; background: rgba(15,23,42,.62); opacity: 0; transition: opacity .2s, background .2s; }
.property-thumb-wrap:hover .property-carousel-btn, .property-carousel-btn:focus { opacity: 1; }
.property-carousel-btn:hover { background: rgba(15,23,42,.9); }
.property-carousel-prev { left: 8px; }
.property-carousel-next { right: 8px; }
.property-carousel-count { position: absolute; right: 9px; bottom: 8px; z-index: 2; padding: 2px 7px; border-radius: 10px; color: #fff; background: rgba(15,23,42,.65); font-size: 11px; }
.property-map-marker { background: transparent; border: 0; }
.property-map-marker svg { display: block; width: 32px; height: 42px; filter: drop-shadow(0 2px 2px rgba(15,23,42,.35)); }
.property-badge { position: absolute; top: 10px; left: 10px; }
.property-body { padding: 14px 16px; flex: 1; }
.property-price { font-size: 19px; font-weight: 800; color: var(--primary); }
.property-title { font-weight: 600; margin: 2px 0 6px; }
.property-loc { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 5px; }
.property-specs { display: flex; gap: 14px; margin-top: 10px; color: var(--muted); font-size: 13px; }
.property-specs i { color: var(--primary); }
.property-actions { display: flex; gap: 8px; padding: 0 16px 16px; }
.property-actions .btn:first-child { flex: 1; }

.property-map { height: 340px; border-radius: 12px; border: 1px solid var(--border); z-index: 1; }

/* Upload */
.upload-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    border: 2px dashed var(--border); border-radius: 12px; padding: 26px; cursor: pointer; color: var(--muted);
    text-align: center; transition: border-color .15s, background .15s; }
.upload-drop:hover { border-color: var(--primary); background: var(--tint); color: var(--primary); }
.upload-drop i { font-size: 30px; }

.img-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; }
.img-thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cover-tag { position: absolute; bottom: 4px; left: 4px; background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px; text-transform: uppercase; }
.img-del { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(220,38,38,.92); color: #fff; display: grid; place-items: center; text-decoration: none; font-size: 14px; }
.img-del:hover { background: var(--danger); color: #fff; }

/* Lista de imóveis vinculados no lead */
.prop-check-list { display: grid; gap: 8px; max-height: 260px; overflow-y: auto; }
.prop-check { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.prop-check:hover { border-color: var(--primary); background: var(--surface-2); }
.prop-check input { width: 17px; height: 17px; }

/* ---------- Kanban (funil de leads) ---------- */
.board-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
/* texto que fica direto sobre o fundo navy precisa ser claro */
.board-toolbar, .panel-head-bare { color: #cfe0f2; }
.board-toolbar .text-muted, .panel-head-bare .text-muted { color: var(--on-navy) !important; }

.kanban {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(240px, 1fr);
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 12px;
    align-items: start;
}
.kanban-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 120px; overflow: hidden; }
.kanban-col-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 13px 15px; font-weight: 600; font-size: 13.5px; color: var(--text);
    border-bottom: 1px solid var(--border);
}
.kanban-col-head > span:first-child { display: flex; align-items: center; gap: 8px; }
.kanban-col-head .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.kanban-col-head.s-new { background: rgba(59,130,246,.08); } .kanban-col-head.s-new .dot { background: #3b82f6; }
.kanban-col-head.s-attempt { background: rgba(245,158,11,.10); } .kanban-col-head.s-attempt .dot { background: #f59e0b; }
.kanban-col-head.s-in_service { background: rgba(99,102,241,.09); } .kanban-col-head.s-in_service .dot { background: #6366f1; }
.kanban-col-head.s-attention { background: rgba(249,115,22,.10); } .kanban-col-head.s-attention .dot { background: #f97316; }
.kanban-col-head.s-bought { background: rgba(34,197,94,.10); } .kanban-col-head.s-bought .dot { background: #22c55e; }
.kanban-col-head.s-future { background: rgba(20,184,166,.10); } .kanban-col-head.s-future .dot { background: #14b8a6; }
.kanban-col-head.s-owner { background: rgba(6,182,212,.09); } .kanban-col-head.s-owner .dot { background: #06b6d4; }
.kanban-col-head.s-visit { background: rgba(139,92,246,.09); } .kanban-col-head.s-visit .dot { background: #8b5cf6; }
.kanban-col-head.s-proposal { background: rgba(236,72,153,.09); } .kanban-col-head.s-proposal .dot { background: #ec4899; }
.kanban-col-head.s-in_visit { background: rgba(168,85,247,.09); } .kanban-col-head.s-in_visit .dot { background: #a855f7; }
.kanban-col-head.s-redistribute { background: rgba(100,116,139,.10); } .kanban-col-head.s-redistribute .dot { background: #64748b; }
.kanban-col-head.s-lost { background: rgba(239,68,68,.09); } .kanban-col-head.s-lost .dot { background: #ef4444; }
.kanban-col-head .bi { display: none; }
.kanban-count { background: var(--surface-3); color: var(--muted); border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 600; }

.kanban-stack { display: flex; flex-direction: column; gap: 10px; padding: 12px; min-height: 70px; border-radius: 0 0 var(--radius) var(--radius); transition: background .15s ease; }
.kanban-stack.drop-hover { background: #ececef; outline: 2px dashed #c4c4cc; outline-offset: -6px; }
.kanban-empty { text-align: center; color: var(--muted-soft); font-size: 13px; padding: 18px 6px; border: 1px dashed var(--border-strong); border-radius: 10px; }
.lead-card { cursor: grab; }
.lead-card.is-dragging { opacity: .5; cursor: grabbing; transform: rotate(1.5deg); }

.lead-card {
    display: block; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 13px; text-decoration: none; color: var(--text);
    box-shadow: var(--shadow);
    transition: transform .26s var(--ease), box-shadow .26s var(--ease), border-color .26s var(--ease);
}
.lead-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.lead-card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lead-name { font-weight: 700; font-size: 14px; }
.lead-source { font-size: 10px; text-transform: uppercase; letter-spacing: .03em; color: var(--primary); background: var(--surface-2); padding: 2px 7px; border-radius: 6px; font-weight: 700; white-space: nowrap; }
.lead-interest { font-size: 12.5px; color: var(--muted); margin: 8px 0 10px; display: flex; align-items: center; gap: 5px; }
.lead-interest i { color: var(--primary); }
.lead-card-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.lead-date { color: #94a3b8; }

/* ---------- Lead detail (modal / focus) ---------- */
.lead-detail-head { margin-bottom: 18px; }
.lead-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; margin-bottom: 16px; }
.ld-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.ld-value { font-size: 14px; font-weight: 500; }
.wa-link { color: #25d366; margin-left: 4px; }
.ld-notes { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; font-size: 14px; }
.ld-section-title { font-weight: 700; font-size: 14px; margin: 6px 0 12px; padding-top: 14px; border-top: 1px solid var(--border); }
.ld-props { display: grid; gap: 10px; }
.ld-prop { display: flex; gap: 12px; align-items: center; padding: 8px; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: var(--text); transition: border-color .15s, background .15s; }
.ld-prop:hover { border-color: var(--primary); background: var(--surface-2); }
.ld-prop-thumb { width: 62px; height: 46px; border-radius: 8px; background-size: cover; background-position: center; flex-shrink: 0; background-color: var(--surface-2); }
.ld-prop-info { display: flex; flex-direction: column; font-size: 13.5px; }

@media (max-width: 576px) { .lead-detail-grid { grid-template-columns: 1fr; } }

/* Timeline / histórico */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline-item { position: relative; display: flex; gap: 14px; padding: 6px 0 14px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; font-size: 14px; flex-shrink: 0; border: 2px solid var(--surface); }
.timeline-dot.act-created { background: var(--success-soft); color: var(--success); }
.timeline-dot.act-updated { background: var(--surface-3); color: var(--muted); }
.timeline-dot.act-status { background: var(--info-soft); color: #1d4ed8; }
.timeline-body { padding-top: 3px; }
.timeline-desc { font-size: 13.5px; font-weight: 500; }
.timeline-meta { font-size: 12px; color: var(--muted); margin-top: 1px; }

/* ---------- Users table ---------- */
.user-table td { vertical-align: middle; }
.user-cell { display: flex; align-items: center; gap: 12px; }
.user-avatar {
    width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, #004080, #001f3f); background-size: cover; background-position: center;
    color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px;
}
.user-name { font-weight: 600; font-size: 14px; }
.user-email { color: var(--muted); font-size: 12.5px; }
.you-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--muted); background: var(--surface-2); padding: 1px 6px; border-radius: 5px; margin-left: 4px; }

.role-badge { font-size: 12px; font-weight: 600; padding: 3px 11px; border-radius: 999px; }
.role-badge.r-admin { background: var(--violet-soft); color: var(--violet); }
.role-badge.r-manager { background: var(--info-soft); color: #1d4ed8; }
.role-badge.r-agent { background: var(--surface-2); color: var(--muted); }

.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 3px 11px; border-radius: 999px; }
.status-pill .status-dot { width: 7px; height: 7px; border-radius: 50%; }
.status-pill.on { background: var(--success-soft); color: var(--success); }
.status-pill.on .status-dot { background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.4); animation: pulse 2s var(--ease) infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.4); } 70% { box-shadow: 0 0 0 5px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
.status-pill.off { background: var(--danger-soft); color: var(--danger); }
.status-pill.off .status-dot { background: #ef4444; }

.icon-btn {
    display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
    color: var(--muted); text-decoration: none; transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease); font-size: 15px;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); transform: translateY(-1px); }
.icon-btn.text-danger:hover { background: var(--danger-soft); }

/* ---------- Section header (sem painel) ---------- */
.panel-head-bare { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }

/* Abas sobre o fundo navy: controle segmentado de vidro (mesma linguagem da sidebar) */
.panel-head-bare .nav-tabs {
    display: inline-flex; gap: 4px; padding: 5px; border: 1px solid rgba(255,255,255,.10);
    border-radius: 13px; background: rgba(255,255,255,.06);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.panel-head-bare .nav-tabs .nav-link {
    border: 1px solid transparent; border-radius: 9px; padding: 8px 15px;
    font-size: 13.5px; font-weight: 600; color: var(--on-navy);
    transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.panel-head-bare .nav-tabs .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.panel-head-bare .nav-tabs .nav-link.active {
    background: linear-gradient(135deg, rgba(20,184,166,.30), rgba(13,148,136,.14));
    border-color: rgba(20,184,166,.38); color: #fff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 6px 16px rgba(0,0,0,.20);
}
.panel-head-bare .nav-tabs .nav-link.active i { color: #5eead4; }

/* Estado vazio sobre o navy (evita a mancha azul “solta” embaixo do conteúdo) */
.empty-navy {
    display: grid; place-items: center; gap: 8px; padding: 46px 20px; text-align: center;
    border: 1px dashed rgba(255,255,255,.14); border-radius: 16px;
    background: rgba(255,255,255,.04); color: var(--on-navy); font-size: 13.5px;
}
.empty-navy i { font-size: 26px; color: rgba(94,234,212,.7); }

/* ---------- People grid (usuários em cards) ---------- */
/* Papéis lado a lado (colunas horizontais); os cards empilham dentro de cada coluna. */
/* Colunas com largura fixa e compacta, alinhadas à esquerda; esticam à mesma altura. */
.role-columns { display: flex; align-items: stretch; flex-wrap: wrap; gap: 18px; }
.role-column { flex: 0 1 280px; display: flex; flex-direction: column; }
.role-column .role-group-title { margin-top: 0; }
.role-column .people-grid { grid-template-columns: 1fr; grid-auto-rows: 1fr; gap: 12px; flex: 1; }
/* Cards menores dentro das colunas de papéis, nivelados (mesma altura) */
.role-column .person-card { padding: 20px 16px 16px; height: 100%; display: flex; flex-direction: column; }
.role-column .person-avatar { width: 62px; height: 62px; font-size: 25px; margin-bottom: 10px; }
.role-column .person-name { font-size: 14px; }
.role-column .person-meta { margin-top: 10px; padding-top: 10px; }
/* "Ativo/Inativo" sempre na base do card, para todos ficarem alinhados */
.role-column .person-card .status-pill { margin-top: auto; align-self: center; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.person-card {
    position: relative; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 26px 18px 20px; text-align: center;
    box-shadow: var(--shadow); transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s var(--ease);
}
.person-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.person-card.is-inactive { opacity: .62; }
.person-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 2px; opacity: 0; transition: opacity .15s ease; }
.person-card:hover .person-actions { opacity: 1; }
.person-avatar {
    width: 82px; height: 82px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center;
    background: linear-gradient(135deg, #004080, #001f3f); background-size: cover; background-position: center;
    color: #fff; font-size: 32px; font-weight: 800; box-shadow: 0 6px 16px rgba(24,24,27,.18);
}
.person-name { font-weight: 700; font-size: 15px; }
.person-role { color: var(--primary); font-weight: 600; font-size: 13px; margin-top: 2px; }
.person-email { color: var(--muted); font-size: 12px; margin-top: 3px; word-break: break-word; }
.person-meta { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); text-align: left; display: flex; flex-direction: column; gap: 4px; }
.person-meta div { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 7px; word-break: break-word; }
.person-meta i { color: var(--primary); font-size: 13px; flex-shrink: 0; }

.token-chip { font-size: 12px; background: var(--surface-3); color: var(--muted); padding: 3px 8px; border-radius: 6px; font-family: ui-monospace, monospace; }

/* ---------- System logs ---------- */
.log-pre { font-family: ui-monospace, monospace; font-size: 12.5px; white-space: pre-wrap; word-break: break-word; background: #14181f; color: #d6e0ec; padding: 12px 14px; border-radius: 8px; max-height: 420px; overflow: auto; margin: 0; }
.log-entry-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px 0; }

/* Modal de detalhes: acima de tudo e sempre alinhado à esquerda
   (herdava text-align do .text-end da célula da tabela). */
.modal { z-index: 1080; }
.modal-backdrop { z-index: 1070; }
.modal-content { text-align: left; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); }
.modal-header { background: var(--surface-2); border-bottom: 1px solid var(--border); border-radius: 14px 14px 0 0; }
.modal-header .modal-title code { color: var(--primary); font-weight: 700; }
.modal-footer { background: var(--surface-2); border-top: 1px solid var(--border); border-radius: 0 0 14px 14px; }

.log-meta { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; margin: 0 0 18px; font-size: 13.5px; }
.log-meta dt { color: var(--muted); font-weight: 600; }
.log-meta dd { margin: 0; color: var(--text); word-break: break-word; }
.log-meta dd.ld-mono { font-family: ui-monospace, monospace; font-size: 12.5px; }
.log-meta dd.ld-anon { color: var(--warning); font-weight: 600; }
.log-block-title { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 7px; }
.log-pre-error { background: #2a1416; color: #ffc9c9; margin-bottom: 16px; }
.log-anon { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-style: italic; }
.log-entry .log-pre { margin: 10px 16px 16px; }
.role-group-title { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 14px; color: #cfe0f2; margin: 4px 0 12px; }
.role-group-title .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); background: #4d9fff; }
.role-group-count { background: rgba(255,255,255,.12); color: #cfe0f2; border-radius: 999px; padding: 0 9px; font-size: 12px; font-weight: 600; }

/* ---------- Roles grid ---------- */
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.role-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s var(--ease); }
.role-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.role-card-head { display: flex; align-items: center; gap: 12px; }
.role-icon { width: 42px; height: 42px; border-radius: 11px; background: var(--surface-2); color: var(--primary); display: grid; place-items: center; font-size: 20px; flex-shrink: 0; }
.role-name { font-weight: 700; font-size: 15px; }
.role-perms { display: flex; flex-wrap: wrap; gap: 6px; min-height: 26px; }
.perm-chip { font-size: 11.5px; font-weight: 500; background: var(--surface-3); color: var(--muted); padding: 3px 9px; border-radius: 7px; }
.perm-chip.perm-all { background: var(--violet-soft); color: var(--violet); font-weight: 600; }
.role-card-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 12px; margin-top: auto; }

/* ---------- Permission checkboxes ---------- */
.perm-group { margin-bottom: 18px; }
.perm-group:last-child { margin-bottom: 0; }
.perm-group-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 8px; }
.perm-row { display: flex; align-items: flex-start; gap: 11px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; cursor: pointer; transition: border-color .15s, background .15s; }
.perm-row:hover { border-color: var(--primary); background: var(--surface-2); }
.perm-row input { width: 17px; height: 17px; margin-top: 1px; flex-shrink: 0; }
.perm-row span { display: flex; flex-direction: column; font-size: 14px; }
.perm-key { font-size: 11px; color: var(--muted); font-family: ui-monospace, monospace; }

/* ---------- Escala / plantão ---------- */
.duty-order { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.duty-order li { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; }
.duty-pos { width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }

/* ---------- Prioridade do dia ---------- */
.prio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.prio-list { display: flex; flex-direction: column; }
.prio-empty { padding: 22px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.prio-item { display: flex; align-items: center; gap: 11px; padding: 12px 16px; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); transition: background .15s var(--ease); }
.prio-item:last-child { border-bottom: 0; }
.prio-item:hover { background: var(--surface-2); }
.prio-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg,#004080,#001f3f); color: #fff; display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.prio-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.prio-name { font-weight: 600; font-size: 14px; }
.prio-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prio-act { width: 32px; height: 32px; border-radius: 9px; background: var(--tint); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.prio-act:hover { background: var(--primary); color: #fff; }

/* ---------- Operational pagination and dense Kanban ---------- */
.board-toolbar-card { background: rgba(255,255,255,.98); color: var(--text); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.board-toolbar-card .text-muted { color: var(--muted); }
.board-title-block { display: flex; flex-direction: column; line-height: 1.25; }
.board-title-block strong { font-size: 18px; display: flex; align-items: center; gap: 8px; }
.board-title-block small { color: var(--muted); margin-top: 3px; }
.board-kicker, .dashboard-kicker { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.lead-view-tabs { display: inline-flex; align-items: center; gap: 3px; max-width: 100%; overflow-x: auto; padding: 4px; margin-bottom: 12px; border-radius: 10px; background: rgba(255,255,255,.92); border: 1px solid var(--border); scrollbar-width: thin; }
.lead-view-tabs a, .lead-view-tabs span { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 7px; color: var(--muted); font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.lead-view-tabs a:hover { color: var(--primary); background: var(--tint); }
.lead-view-tabs a.active { color: #fff; background: var(--primary); }
.lead-view-tabs .is-disabled { opacity: .48; cursor: not-allowed; }
.board-actions-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.board-actions-main > strong { display: flex; align-items: center; gap: 7px; margin-right: 2px; font-size: 17px; }
.board-actions-main > small { display: none; }
.board-actions-main .btn { min-height: 38px; font-size: 12.5px; }
.board-actions-main .btn-icon { width: 40px; padding-left: 0; padding-right: 0; }
.board-actions-main .btn-icon.active { color: #fff; background: var(--primary); }
.kanban-shell.is-compact .lead-interest, .kanban-shell.is-compact .lead-agent { display: none; }
.kanban-shell.is-compact .lead-card { padding-top: 9px; padding-bottom: 9px; }
.lead-filter-bar { display: grid; grid-template-columns: minmax(260px, 1fr) 190px 190px auto auto; gap: 8px; align-items: center; padding: 10px; margin: -8px 0 12px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.lead-filter-search { height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--border); border-radius: 9px; color: var(--muted); }
.lead-filter-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,102,204,.1); }
.lead-filter-search input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 13px; }
.lead-filter-bar .form-select, .lead-filter-bar .btn { min-height: 40px; font-size: 12.5px; }
.kanban-shell { background: rgba(255,255,255,.98); border: 1px solid var(--border); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); overflow: hidden; }
.kanban-shell .kanban { grid-auto-columns: minmax(255px, 1fr); gap: 10px; padding-bottom: 4px; }
.kanban-shell .kanban-col { border-radius: 11px; box-shadow: none; }
.kanban-shell .kanban-stack { max-height: 65vh; overflow-y: auto; scrollbar-width: thin; }
.kanban-pager, .mini-pager { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 9px 10px; border-top: 1px solid var(--border); background: #fff; color: var(--muted); font-size: 12px; font-weight: 700; }
.kanban-pager a, .mini-pager a { width: 30px; height: 28px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 8px; color: var(--primary); text-decoration: none; }
.kanban-pager a:hover, .mini-pager a:hover { background: var(--tint); border-color: var(--primary); }
.kanban-pager a.disabled, .mini-pager a.disabled { opacity: .35; pointer-events: none; }
.is-loading-column { position: relative; pointer-events: none; opacity: .62; }
.is-loading-column::after { content: ''; position: absolute; inset: 0; margin: auto; width: 24px; height: 24px; border: 3px solid rgba(0,102,204,.18); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; z-index: 4; }
.lead-agent { display: flex; align-items: center; gap: 5px; margin-top: 7px; color: var(--muted); font-size: 11.5px; }

.prio-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; margin-bottom: 16px; background: linear-gradient(135deg,#003366,#0066cc); color: #fff; border-radius: 14px; box-shadow: var(--shadow-md); }
.prio-summary > div { display: flex; flex-direction: column; }
.prio-summary span { color: rgba(255,255,255,.78); font-size: 13px; }
.prio-summary-date { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.prio-panel { display: flex; flex-direction: column; min-height: 0; }
.prio-panel .prio-list { flex: 1; }
.prio-item { padding: 0; }
.prio-main { display: flex; align-items: center; gap: 11px; padding: 12px 10px 12px 16px; flex: 1; min-width: 0; color: var(--text); text-decoration: none; }
.prio-act { margin-right: 12px; }

/* ---------- Property Kanban ---------- */
.property-kanban { display: grid; grid-template-columns: repeat(4, minmax(270px, 1fr)); gap: 10px; overflow-x: auto; }
.property-kanban-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; min-width: 270px; overflow: hidden; }
.property-kanban-head { display: flex; justify-content: space-between; align-items: center; padding: 13px 14px; font-weight: 750; border-top: 3px solid #3b82f6; background: #fff; }
.property-kanban-head.ps-reserved { border-color: #f59e0b; }
.property-kanban-head.ps-sold { border-color: #22c55e; }
.property-kanban-head.ps-rented { border-color: #8b5cf6; }
.property-kanban-stack { display: flex; flex-direction: column; gap: 10px; padding: 10px; min-height: 180px; max-height: 68vh; overflow-y: auto; transition: background .15s; }
.property-kanban-stack.drop-hover { background: #e7eef8; outline: 2px dashed var(--primary); outline-offset: -6px; }
.property-k-card { flex: 0 0 auto; background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; box-shadow: 0 2px 7px rgba(15,23,42,.06); cursor: grab; }
.property-k-card.is-dragging { opacity: .55; }
.property-k-thumb { display: block; height: 118px; background-position: center; background-size: cover; }
.property-k-body { display: flex; flex-direction: column; gap: 5px; padding: 10px 11px 12px; font-size: 13px; }
.property-k-type, .property-k-location { color: var(--muted); font-size: 11.5px; }
.property-k-price { color: var(--primary); font-size: 15px; }
.property-k-specs { display: flex; gap: 12px; color: var(--muted); font-size: 11.5px; padding-top: 5px; border-top: 1px solid var(--border); }

/* ---------- Dashboard refinement ---------- */
.workday-hero { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 25px 27px; margin-bottom: 14px; border: 1px solid rgba(45,212,191,.28); border-radius: 18px; color: #eff6ff; background: radial-gradient(520px 240px at 0% 0%, rgba(45,212,191,.21), transparent 65%), linear-gradient(120deg, #0b2545, #174a7c); box-shadow: var(--shadow-md); }
.workday-hero h2 { margin: 7px 0 5px; color: #fff; font-size: clamp(23px, 3vw, 32px); letter-spacing: -.03em; }.workday-hero p { max-width: 670px; margin: 0; color: rgba(239,246,255,.8); font-size: 14px; }.workday-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.workday-stages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }.workday-stage { position: relative; display: flex; align-items: center; gap: 11px; min-height: 105px; padding: 16px; overflow: hidden; color: var(--text); text-decoration: none; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); transition: transform .18s var(--ease), box-shadow .18s var(--ease); }.workday-stage:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }.workday-stage-icon { display: grid; width: 39px; height: 39px; flex: 0 0 39px; place-items: center; border-radius: 11px; color: var(--primary); background: var(--tint); font-size: 18px; }.workday-stage small, .workday-stage em { display: block; color: var(--muted); font-size: 11px; font-style: normal; }.workday-stage small { font-weight: 700; }.workday-stage strong { display: block; margin: 1px 0; color: var(--text); font-size: 27px; line-height: 1; letter-spacing: -.04em; }.workday-stage-arrow { position: absolute; top: 13px; right: 13px; color: var(--muted-soft); font-size: 13px; }.workday-stage.is-teal .workday-stage-icon { color: var(--accent); background: var(--accent-soft); }.workday-stage.is-violet .workday-stage-icon { color: var(--violet); background: var(--violet-soft); }.workday-stage.is-green .workday-stage-icon { color: var(--success); background: var(--success-soft); }
.workday-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; margin-bottom: 14px; }.workday-priority-list { padding: 3px 20px 14px; }.workday-priority-item { display: grid; grid-template-columns: 39px 1fr 35px 14px; align-items: center; gap: 12px; padding: 13px 0; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }.workday-priority-item:last-child { border-bottom: 0; }.workday-priority-item:hover strong { color: var(--primary); }.priority-dot { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; color: var(--primary); background: var(--tint); }.priority-dot.is-orange { color: var(--warning); background: var(--warning-soft); }.priority-dot.is-violet { color: var(--violet); background: var(--violet-soft); }.workday-priority-item strong, .workday-priority-item small { display: block; }.workday-priority-item strong { font-size: 13px; }.workday-priority-item small { margin-top: 1px; color: var(--muted); font-size: 12px; }.workday-priority-item b { text-align: right; font-size: 17px; }.workday-priority-item > i { color: var(--muted-soft); font-size: 12px; }
.workday-pulse { padding-bottom: 16px; }.workday-pulse-value { padding: 6px 20px 14px; }.workday-pulse-value span, .workday-pulse-value small { display: block; color: var(--muted); font-size: 12px; }.workday-pulse-value strong { display: block; margin: 3px 0; color: var(--text); font-size: 26px; letter-spacing: -.035em; }.workday-sources { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; padding: 0 20px 13px; }.workday-sources div { padding: 8px 9px; border-radius: 9px; background: var(--surface-2); }.workday-sources span { display: block; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }.workday-sources strong { display: block; margin-top: 2px; font-size: 16px; }.workday-analytics-link { display: inline-flex; align-items: center; gap: 6px; margin: 0 20px; color: var(--primary); font-size: 12px; font-weight: 700; text-decoration: none; }
.workday-inbox { overflow: hidden; }.workday-lead-list { display: flex; flex-direction: column; }.workday-lead { display: grid; grid-template-columns: 38px minmax(180px, 1fr) 130px 120px 14px; align-items: center; gap: 12px; padding: 12px 20px; color: var(--text); text-decoration: none; border-top: 1px solid var(--border); }.workday-lead:hover { background: var(--surface-2); }.workday-lead-avatar { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: var(--primary); background: var(--tint); font-size: 12px; font-weight: 800; }.workday-lead-main { min-width: 0; }.workday-lead-main strong, .workday-lead-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.workday-lead-main strong { font-size: 13px; }.workday-lead-main small, .workday-lead-source { color: var(--muted); font-size: 12px; }.workday-lead > i { color: var(--muted-soft); font-size: 12px; }
.dashboard-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 26px; margin-bottom: 18px; border: 1px solid rgba(96,165,250,.3); border-radius: 18px; background: radial-gradient(540px 230px at 100% 0%, rgba(45,212,191,.17), transparent 65%), linear-gradient(120deg,#0b2545,#174a7c 68%,#2563eb); color: #fff; box-shadow: var(--shadow-md); }
.dashboard-hero h2 { margin: 3px 0 2px; font-size: 23px; font-weight: 800; }
.dashboard-hero p { margin: 0; color: rgba(255,255,255,.72); font-size: 13px; }
.dashboard-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.dashboard-cta { display: flex; gap: 8px; }
.dashboard-pulse { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.dashboard-pulse span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; color: rgba(255,255,255,.86); background: rgba(255,255,255,.10); font-size: 11px; font-weight: 700; }
.dashboard-kicker { color: #5eead4; }
.dashboard-cta { display: flex; gap: 8px; white-space: nowrap; }
.dashboard-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.dashboard-stats .card-x { min-height: 142px; }
.panel-link, .table-primary-link { color: var(--primary); font-weight: 700; text-decoration: none; font-size: 13px; }
.panel-link:hover, .table-primary-link:hover { text-decoration: underline; }

@media (max-width: 768px) {
    .workday-hero { align-items: flex-start; flex-direction: column; padding: 22px 20px; }.workday-actions { width: 100%; }.workday-actions .btn { flex: 1; }
    .workday-stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }.workday-grid { grid-template-columns: 1fr; }.workday-lead { grid-template-columns: 38px 1fr auto 12px; }.workday-lead-source { display: none; }
    .analytics-hero { align-items: flex-start; flex-direction: column; padding: 22px 20px; }
    .analytics-actions { width: 100%; }.analytics-actions .btn { flex: 1; }
    .analytics-kpis { grid-template-columns: 1fr; }
    .analytics-main-grid, .analytics-secondary-grid { grid-template-columns: 1fr; }
    .dashboard-hero, .prio-summary { align-items: flex-start; flex-direction: column; }
    .dashboard-actions, .dashboard-pulse { align-items: flex-start; justify-content: flex-start; }
    .dashboard-cta { width: 100%; }
    .dashboard-cta .btn { flex: 1; }
    .property-kanban { grid-template-columns: repeat(4, 84vw); }
    .lead-filter-bar { grid-template-columns: 1fr 1fr; }
    .lead-filter-search { grid-column: 1 / -1; }
    .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Gráfico de barras (analytics) ---------- */
.analytics-hero { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 24px 26px; margin-bottom: 14px; border: 1px solid rgba(96,165,250,.30); border-radius: 18px; color: #eff6ff; background: radial-gradient(500px 240px at 100% 0%, rgba(45,212,191,.20), transparent 68%), linear-gradient(120deg, #0b2545, #174a7c); box-shadow: var(--shadow-md); }
.analytics-hero h2 { margin: 7px 0 5px; color: #fff; font-size: clamp(23px, 3vw, 31px); letter-spacing: -.03em; }
.analytics-hero p { margin: 0; color: rgba(239,246,255,.78); font-size: 14px; }
.analytics-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.analytics-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.analytics-kpis article { position: relative; padding: 17px 18px; overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.analytics-kpis article::after { content: ''; position: absolute; right: -24px; bottom: -28px; width: 100px; height: 100px; border-radius: 50%; background: var(--tint); opacity: .7; }
.analytics-kpis article:nth-child(2)::after { background: var(--success-soft); }
.analytics-kpis article:nth-child(3)::after { background: var(--violet-soft); }
.analytics-kpis span, .analytics-kpis small { position: relative; z-index: 1; display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.analytics-kpis strong { position: relative; z-index: 1; display: block; margin: 4px 0; color: var(--text); font-size: 27px; letter-spacing: -.035em; }
.analytics-kpis small { font-weight: 500; }
.analytics-main-grid { display: grid; grid-template-columns: minmax(300px, .9fr) minmax(400px, 1.1fr); gap: 14px; margin-bottom: 14px; }
.analytics-secondary-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; }
.panel-kicker { display: block; margin-bottom: 2px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.analytics-focus-list { padding: 8px 20px 16px; }
.analytics-stage { display: grid; grid-template-columns: minmax(112px, 145px) 1fr 36px; align-items: center; gap: 11px; padding: 10px 0; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.analytics-stage:last-child { border-bottom: 0; }
.analytics-stage:hover .stage-name { color: var(--primary); }
.stage-name { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 650; }
.stage-name i { font-size: 8px; color: var(--primary); }
.stage-name i.s-attempt { color: var(--warning); } .stage-name i.s-attention { color: #f97316; } .stage-name i.s-in_service { color: #6366f1; } .stage-name i.s-visit { color: var(--violet); } .stage-name i.s-proposal { color: #ec4899; }
.stage-bar { height: 8px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.stage-bar span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.stage-bar .s-attempt { background: var(--warning); } .stage-bar .s-attention { background: #f97316; } .stage-bar .s-in_service { background: #6366f1; } .stage-bar .s-visit { background: var(--violet); } .stage-bar .s-proposal { background: #ec4899; }
.analytics-stage > strong { text-align: right; font-size: 13px; }
.analytics-map-panel { overflow: hidden; }
#analyticsMap { height: 294px; width: 100%; }
.analytics-map-caption { display: flex; align-items: center; gap: 7px; padding: 9px 14px; color: var(--muted); font-size: 12px; font-weight: 600; border-top: 1px solid var(--border); }
.analytics-map-caption i { color: var(--primary); }
.analytics-map-empty { min-height: 294px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; padding: 28px; text-align: center; color: var(--muted); }
.analytics-map-empty i { color: var(--primary-light); font-size: 36px; }.analytics-map-empty strong { color: var(--text); }.analytics-map-empty span { max-width: 330px; font-size: 13px; }
.analytics-chart-wrap { padding: 0 20px 14px; }.analytics-chart-wrap .bar-chart { height: 150px; }
.analytics-source-list { padding: 7px 20px 18px; }.analytics-source { display: grid; grid-template-columns: 130px 1fr 36px; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }.analytics-source:last-child { border-bottom: 0; }.analytics-source > div { height: 8px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }.analytics-source i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--accent)); }.analytics-source strong { text-align: right; }
.bar-chart { display: flex; align-items: flex-end; gap: 14px; height: 180px; padding-top: 10px; overflow-x: auto; }
.bar-col { flex: 1 0 34px; min-width: 34px; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bar-track { flex: 1; width: 100%; max-width: 46px; display: flex; align-items: flex-end; }
.bar-fill { width: 100%; background: linear-gradient(180deg, var(--primary), var(--primary-dark)); border-radius: 8px 8px 0 0; position: relative; min-height: 4px; transition: height .5s var(--ease); }
.bar-fill span { position: absolute; top: -20px; left: 0; right: 0; text-align: center; font-size: 12px; font-weight: 700; color: var(--text); }
.bar-label { font-size: 11.5px; color: var(--muted); margin-top: 8px; font-weight: 600; }

/* ---------- Busca inteligente (IA) ---------- */
.ai-search { position: relative; overflow: hidden; border-radius: 18px; padding: 30px 22px; margin-bottom: 18px; text-align: center;
    background: linear-gradient(135deg, #003366, #004080 55%, #0066cc); color: #fff;
    box-shadow: var(--shadow-md); }
.ai-search::before { content: ''; position: absolute; inset: 0; opacity: .5; pointer-events: none;
    background-image: radial-gradient(rgba(255,255,255,.10) 1.2px, transparent 1.2px); background-size: 22px 22px; }
.ai-search h3 { position: relative; font-size: 22px; font-weight: 800; margin: 0 0 4px; color: #fff; }
.ai-search p { position: relative; color: rgba(255,255,255,.82); font-size: 13.5px; margin: 0 0 16px; }
.ai-search form { position: relative; }
.ai-box { max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px; padding: 6px 6px 6px 18px; box-shadow: var(--shadow); }
.ai-box i.ai-spark { color: var(--primary); font-size: 18px; }
.ai-box input { flex: 1; border: 0; outline: none; font-size: 14.5px; background: transparent; }
.ai-box button { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; cursor: pointer; flex-shrink: 0; transition: background .2s var(--ease); }
.ai-box button:hover { background: var(--primary-dark); }
.ai-parsed { margin-top: 12px; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.ai-chip { font-size: 12px; font-weight: 600; background: var(--surface); border: 1px solid var(--border); color: var(--primary); padding: 3px 11px; border-radius: 999px; }

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
    .sidebar { width: var(--sb-full); transform: translateX(-115%); }
    .sidebar.open { transform: translateX(0); }
    /* no mobile o menu abre cheio (não em rail) */
    .sidebar .nav-label, .sidebar .brand-name,
    .sidebar:not(:hover) .nav-label, .sidebar:not(:hover) .brand-name { opacity: 1; max-width: 160px; }
    .sidebar-page-context, .sidebar:not(:hover) .sidebar-page-context { max-height: none; padding: 0 10px 14px; margin-bottom: 4px; border-bottom: 1px solid rgba(255,255,255,.08); opacity: 1; }
    .sidebar:not(:hover) .nav-menu a,
    .sidebar:not(:hover) .sidebar-footer a { justify-content: flex-start; gap: 13px; padding-left: 15px; padding-right: 15px; }
    .sidebar:not(:hover) .brand { justify-content: flex-start; gap: 12px; padding-left: 10px; padding-right: 10px; }
    .sidebar:not(:hover) .sidebar-user { display: flex; }
    .main { margin-left: 0; }
    /* no mobile o menu é gaveta sobreposta: não empurra o conteúdo */
    .topbar, .sidebar:hover ~ .main .topbar { padding: 0 18px; }
    .content, .sidebar:hover ~ .main .content { padding: 20px 18px; }
    .app-footer, .sidebar:hover ~ .main .app-footer { padding: 14px 18px 18px; }
    .sidebar-mobile-toggle { position: fixed; top: 14px; left: 14px; z-index: 34; display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-md); font-size: 21px; }
    /* tablets: stats em 2 colunas (evita 4 cards espremidos) */
    .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* tablets: barra de filtros deixa de ter colunas fixas que estouravam a largura */
    .lead-filter-bar { grid-template-columns: 1fr 1fr; }
    .lead-filter-bar .lead-filter-search { grid-column: 1 / -1; }
}

/* Tablets e telas médias: grids não deixam cards largos demais */
@media (max-width: 768px) {
    .prio-grid { grid-template-columns: 1fr; }
    .integrations-grid { grid-template-columns: 1fr; }
    .integration-hero { align-items: flex-start; flex-direction: column; padding: 23px 20px; }
    .meta-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-bar { gap: 8px; }
    .property-overview { align-items: flex-start; flex-direction: column; }
    .property-overview-stats { width: 100%; grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .filter-search { flex-basis: 100%; min-width: 0; order: -1; }
    .filter-bar .form-select { flex: 1 1 40%; min-width: 0; }
    .view-toggle { margin-left: auto; }
    .property-list .property-card { flex-direction: column; }
    .property-list .property-thumb { width: 100%; height: 180px; }
}

@media (max-width: 576px) {
    .content { padding: 16px 14px; }
    .main { padding-top: 0; }
    .topbar { height: 60px; padding: 0 14px; gap: 10px; }
    .page-title { font-size: 17px; }
    .stat-grid, .people-grid, .role-grid, .property-grid, .prio-grid { grid-template-columns: 1fr; gap: 12px; }
    /* telas estreitas: papéis voltam a empilhar verticalmente */
    .role-columns { flex-direction: column; overflow-x: visible; }
    .role-column { width: 100%; min-width: 0; }
    .board-toolbar, .panel-head, .panel-head-bare { gap: 10px; }
    .panel-head-bare { flex-direction: column; align-items: stretch; }
    .panel-head-bare .btn { width: 100%; }
    .modal-dialog { margin: 10px; }
    .user-chip .d-sm-inline { display: none !important; }
    /* alvos de toque maiores */
    .form-control, .form-select, .btn { min-height: 44px; }
    .icon-btn { width: 40px; height: 40px; }
    .ai-search { padding: 22px 16px; }
    .ai-search h3 { font-size: 18px; }
    .ai-box { padding: 5px 5px 5px 14px; }
    .funnel-label { width: 84px; font-size: 12px; }
    .lead-detail-grid { grid-template-columns: 1fr; }
    .kanban { grid-auto-columns: 84%; }
    .meta-metrics { grid-template-columns: 1fr; }
    .property-overview { padding: 18px; }
    .property-overview-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .analytics-actions { flex-direction: column; }.analytics-actions .btn { width: 100%; }
    .analytics-stage { grid-template-columns: minmax(100px, 1fr) 1fr 30px; gap: 8px; }
    .analytics-source { grid-template-columns: 105px 1fr 30px; gap: 7px; }
    .workday-actions { flex-direction: column; }.workday-actions .btn { width: 100%; }.workday-stages { grid-template-columns: 1fr; }.workday-lead { grid-template-columns: 34px 1fr 10px; gap: 9px; padding: 11px 14px; }.workday-lead .badge-status { display: none; }.workday-priority-list { padding-left: 14px; padding-right: 14px; }.workday-sources { padding-left: 14px; padding-right: 14px; }.workday-pulse-value { padding-left: 14px; padding-right: 14px; }
    .sidebar-notifications .notif-menu { position: fixed; inset: auto 14px 16px; width: auto; max-width: none; }
    .sidebar-notifications .notif-scroll { max-height: calc(100vh - 120px); }
}

/* ---------- Alertas aprimorados (ícone + fechar + auto-dismiss) ---------- */
.app-alert {
    display: flex; align-items: flex-start; gap: 10px;
    border: 0; border-left: 4px solid transparent;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    transition: opacity .3s ease, transform .3s ease;
}
.app-alert > i { font-size: 17px; line-height: 1.4; }
.app-alert > span { flex: 1; }
.app-alert.alert-success { border-left-color: #198754; }
.app-alert.alert-danger { border-left-color: #dc3545; }
.app-alert.is-leaving { opacity: 0; transform: translateY(-6px); }
.app-alert-close {
    background: none; border: 0; padding: 0 2px;
    font-size: 20px; line-height: 1; color: inherit; opacity: .55;
    cursor: pointer; transition: opacity .15s ease;
}
.app-alert-close:hover { opacity: 1; }

/* ---------- Modal de confirmação de ações destrutivas ---------- */
.confirm-modal { border: 0; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.confirm-modal .modal-body { padding: 28px 22px 14px; }
.confirm-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 52px; height: 52px; margin-bottom: 12px;
    border-radius: 50%; background: rgba(220, 53, 69, .1); color: #dc3545;
    font-size: 24px;
}
.confirm-text { color: var(--text); font-size: 15px; font-weight: 500; }
.confirm-footer { border-top: 0; padding: 10px 22px 22px; justify-content: center; gap: 8px; }
.confirm-footer .btn { min-width: 110px; }

/* ---------- Botão mostrar/ocultar senha ---------- */
.pw-toggle { cursor: pointer; }
/* Variante dentro de .input-group (login/reset): afordância clara e clicável */
.input-group-text.pw-toggle {
    color: var(--muted);
    transition: color .15s var(--ease), background .15s var(--ease);
}
.input-group-text.pw-toggle:hover { color: var(--primary); background: var(--tint); }
.input-group-text.pw-toggle:active { background: #dbe8f7; }
/* Variante em campos sem input-group (modais/perfil): botão sobreposto, alvo arredondado */
.pw-toggle-wrap { position: relative; display: block; }
.pw-toggle-wrap > .form-control { width: 100%; padding-right: 42px; }
.pw-toggle-abs {
    position: absolute; top: 50%; right: 5px; transform: translateY(-50%);
    width: 32px; height: 32px; border-radius: 8px;
    background: transparent; border: 0; color: var(--muted); padding: 0;
    display: grid; place-items: center; font-size: 15px;
    transition: color .15s var(--ease), background .15s var(--ease);
}
.pw-toggle-abs:hover { color: var(--primary); background: #f0f4f9; }
.pw-toggle-abs:active { background: #e6edf6; }

/* ---------- Caixa do link de redefinição (tela de Usuários) ---------- */
.reset-link-box {
    background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary);
    border-radius: var(--radius); padding: 16px 18px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.reset-link-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.reset-link-head > i { font-size: 20px; color: var(--primary); margin-top: 2px; }
.reset-link-head strong { display: block; font-size: 14.5px; }
.reset-link-head span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.reset-link-row { display: flex; gap: 8px; flex-wrap: wrap; }
.reset-link-row input {
    flex: 1; min-width: 220px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--surface-2); font-family: ui-monospace, monospace; font-size: 13px; color: var(--text);
}
.reset-link-row input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,64,128,.14); }
.reset-link-row .btn { white-space: nowrap; }

/* ============================================================
   Oferta do dia (ofertas ativas)
   ============================================================ */

/* O filtro tem quatro blocos nivelados; as datas precisam poder encolher
   dentro da coluna para não criar overflow horizontal. */
.offers-filter .row > [class*="col-"] { min-width: 0; }
.offer-date-range { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.offer-date-range .form-control { min-width: 0; width: 100%; }

/* Quatro indicadores ocupam a linha inteira em telas largas. */
.offer-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.offer-stats .card-x { min-width: 0; }

/* Cards de estatística: acento colorido no topo + barra de acento à esquerda do ícone */
.offer-stats .card-x { position: relative; overflow: hidden; }
.offer-stats .card-x::before {
    content: ""; position: absolute; inset: 0 auto 0 0; width: 4px;
    background: var(--accent-c, var(--primary)); opacity: .85;
}
.offer-stats .card-x.is-total   { --accent-c: #2563eb; }
.offer-stats .card-x.is-waiting { --accent-c: #d97706; }
.offer-stats .card-x.is-reserved{ --accent-c: #16a34a; }
.offer-stats .card-x.is-people  { --accent-c: #7c3aed; }

/* Chips de contagem por status na linha da tabela */
.offer-counts { display: flex; flex-wrap: wrap; gap: 6px; }
.offer-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
    line-height: 1.4; border: 1px solid transparent; white-space: nowrap;
}
.offer-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.offer-chip.is-total    { background: var(--surface-3); color: var(--muted); border-color: var(--border); }
.offer-chip.is-waiting  { background: rgba(217,119,6,.12);  color: #b45309; border-color: rgba(217,119,6,.22); }
.offer-chip.is-reserved { background: rgba(22,163,74,.12);  color: #15803d; border-color: rgba(22,163,74,.22); }
.offer-chip.is-attended { background: rgba(37,99,235,.12);  color: #1d4ed8; border-color: rgba(37,99,235,.22); }

/* Barra de progresso segmentada (proporção dos status) */
.offer-progress {
    display: flex; height: 7px; width: 100%; max-width: 260px;
    border-radius: 999px; overflow: hidden; background: var(--surface-3);
    margin-top: 8px;
}
.offer-progress span { display: block; height: 100%; transition: width .4s var(--ease); }
.offer-progress .seg-waiting  { background: #f59e0b; }
.offer-progress .seg-reserved { background: #22c55e; }
.offer-progress .seg-attended { background: #3b82f6; }

/* Avatares/badges de membros */
.offer-members { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.offer-member-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
    background: var(--tint); color: var(--primary); border: 1px solid var(--border);
}
.offer-member-badge i { font-size: 11px; opacity: .8; }
.offer-member-more { background: var(--surface-3); color: var(--muted); }

/* Linha da tabela de ofertas mais respirável */
.offer-table thead th { white-space: nowrap; }
.offer-table tbody tr { transition: background .15s var(--ease); }
.offer-table tbody tr:hover { background: var(--surface-2); }
.offer-name { font-weight: 600; color: var(--text); }
.offer-name:hover { color: var(--primary); text-decoration: underline; }
.offer-file-link { display: inline-flex; align-items: center; gap: 5px; color: var(--primary); }

/* Estado vazio */
.offer-empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.offer-empty .bi { font-size: 40px; color: var(--muted-soft); display: block; margin-bottom: 12px; }

/* Chips de telefone (tela de detalhe) */
.offer-phone {
    display: inline-flex; align-items: center; gap: 6px; margin: 0 6px 4px 0;
    padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600;
    background: rgba(22,163,74,.10); color: #15803d; border: 1px solid rgba(22,163,74,.20);
    text-decoration: none; transition: background .15s var(--ease), transform .15s var(--ease);
}
.offer-phone:hover { background: rgba(22,163,74,.18); color: #166534; transform: translateY(-1px); }

/* Pills de status (tela de detalhe) */
.offer-status-pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
}

/* --------- Responsividade: tabela vira cartões empilhados no mobile --------- */
@media (max-width: 640px) {
    .offer-table thead { display: none; }
    .offer-table, .offer-table tbody, .offer-table tr, .offer-table td { display: block; width: 100%; }
    .offer-table tbody tr {
        border: 1px solid var(--border); border-radius: var(--radius-sm);
        padding: 12px 14px; margin-bottom: 12px; box-shadow: var(--shadow);
    }
    .offer-table tbody tr:hover { background: var(--surface); }
    .offer-table td {
        border: 0 !important; padding: 6px 0 !important;
        display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
    }
    .offer-table td::before {
        content: attr(data-label); font-size: 11px; font-weight: 700;
        text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
        flex: none; padding-top: 3px;
    }
    .offer-table td[data-label]:empty { display: none; }
    .offer-table td > * { text-align: right; }
    .offer-table .offer-progress { margin-left: auto; }
    .offer-table td.text-end { justify-content: flex-end; }
    .offer-table td.text-end::before { display: none; }
    .offer-counts, .offer-members { justify-content: flex-end; }
}

@media (max-width: 768px) {
    .offer-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 576px) {
    .offer-stats { grid-template-columns: 1fr; }
}
