/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
    --ink: #12181d;
    --ink-soft: #4b5563;
    --ink-faint: #8b93a1;
    --paper: #f4f5f1;
    --surface: #ffffff;
    --border: #e3e1d9;
    --border-strong: #cfccc0;

    --primary: #0e7c66;
    --primary-dark: #0a5f4d;
    --primary-soft: #e3f1ec;

    --accent: #c98a3a;
    --accent-soft: #f7ead4;

    --danger: #b3432b;
    --danger-soft: #f7e3dd;

    --info: #35618c;
    --info-soft: #e1eaf2;

    --violet: #7d5ba6;
    --violet-soft: #ece3f5;

    --font-display: "Fraunces", ui-serif, Georgia, serif;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 2px rgba(18, 24, 29, 0.06);
    --shadow: 0 4px 16px rgba(18, 24, 29, 0.08);
    --shadow-lg: 0 12px 32px rgba(18, 24, 29, 0.14);
}

* { box-sizing: border-box; }

body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 14.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .font-display {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink);
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

::selection { background: var(--accent-soft); }

*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ==========================================================================
   App shell — sidebar + content
   ========================================================================== */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 248px;
    flex-shrink: 0;
    background: var(--ink);
    color: #cfd6d3;
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-close { display: none; }

/* ==========================================================================
   Mobile: sidebar vira gaveta (off-canvas)
   ========================================================================== */
.mobile-topbar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--ink);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1050;
}

.mobile-topbar .hamburger {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    padding: 4px;
    cursor: pointer;
}

.mobile-topbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
}
.mobile-topbar-brand .mark {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, var(--accent), var(--primary) 70%);
    flex-shrink: 0;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 20, 24, 0.5);
    z-index: 1090;
}

@media (max-width: 900px) {
    .mobile-topbar { display: flex; }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: 82vw;
        max-width: 300px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 1100;
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open { transform: translateX(0); }

    .sidebar-close {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        background: none;
        border: none;
        color: #cfd6d3;
        font-size: 1.1rem;
        padding: 4px;
        cursor: pointer;
    }

    .sidebar-backdrop.open { display: block; }

    .app-shell { min-height: calc(100vh - 53px); }

    .content-area { padding: 18px 16px 40px; }

    .topbar { flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 22px; }
    .topbar .btn-pro { width: 100%; justify-content: center; }
    .page-title { font-size: 1.35rem; }
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 22px;
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.18rem;
    font-weight: 600;
}

.sidebar-brand .mark {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, var(--accent), var(--primary) 70%);
    flex-shrink: 0;
    position: relative;
}
.sidebar-brand .mark::after {
    content: "";
    position: absolute;
    inset: 9px;
    border-radius: 50%;
    background: #fff;
}

.sidebar-section-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7570;
    padding: 14px 12px 6px;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #c4ccc8;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.89rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }

.sidebar-nav a.active {
    background: rgba(14, 124, 102, 0.35);
    color: #fff;
}

.sidebar-nav a i { width: 18px; text-align: center; opacity: 0.85; }

.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.sidebar-user .avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-user .meta { line-height: 1.25; overflow: hidden; }
.sidebar-user .meta .name { color: #fff; font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .meta .role { font-size: 0.72rem; color: #8b968f; }

.sidebar-logout {
    display: block;
    width: 100%;
    margin-top: 10px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.14);
    color: #c4ccc8;
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    font-size: 0.8rem;
    text-align: center;
    cursor: pointer;
}
.sidebar-logout:hover { background: rgba(255,255,255,0.06); color: #fff; }

.content-area {
    flex: 1;
    min-width: 0;
    padding: 34px 40px 60px;
}

.topbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.page-eyebrow {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-faint);
    font-weight: 600;
    margin-bottom: 4px;
}

.page-title {
    font-size: 1.6rem;
    margin: 0;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn-pro {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: var(--radius-sm);
    padding: 9px 16px;
    font-size: 0.86rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
    text-decoration: none;
    line-height: 1.2;
}
.btn-pro:active { transform: translateY(1px); }

.btn-pro-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-pro-primary:hover { background: var(--primary-dark); color: #fff; }

.btn-pro-ghost { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn-pro-ghost:hover { background: var(--paper); color: var(--ink); }

.btn-pro-outline { background: transparent; color: var(--ink-soft); border-color: var(--border-strong); }
.btn-pro-outline:hover { background: var(--surface); color: var(--ink); }

.btn-pro-sm { padding: 5px 11px; font-size: 0.78rem; }

/* ==========================================================================
   Cards & stats
   ========================================================================== */
.card-pro {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card-pro-pad { padding: 24px; }
@media (max-width: 640px) { .card-pro-pad { padding: 16px; } }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-grid-6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1200px) { .stat-grid-6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .stat-grid-6 { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
@media (max-width: 380px) { .stat-grid-6 { grid-template-columns: 1fr; } }

.stat-card-link {
    text-decoration: none;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.stat-card-link:hover { transform: translateY(-1px); }
.stat-card-link.stat-card-warn { border-color: #ecd6ae; }
.stat-card-link.stat-card-warn .stat-value { color: #8a5a1f; }
.stat-card-link.stat-card-danger { border-color: #edc9be; }
.stat-card-link.stat-card-danger .stat-value { color: var(--danger); }

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
}

.stat-card .stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--ink-faint);
    font-weight: 600;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-family: var(--font-mono);
    font-size: 1.9rem;
    font-weight: 600;
    color: var(--ink);
}

.stat-card .stat-value small { font-size: 1rem; color: var(--ink-faint); font-weight: 500; }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-pro-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 640px) {
    .table-pro thead th, .table-pro tbody td { padding: 10px 10px; font-size: 0.82rem; }

    /* Tabela "Últimas buscas" do painel: esconde Novos/Criada em no
       mobile pra caber sem precisar rolar; continuam disponíveis no
       desktop e via scroll horizontal se precisar. */
    .buscas-table th:nth-child(5), .buscas-table td:nth-child(5),
    .buscas-table th:nth-child(6), .buscas-table td:nth-child(6) {
        display: none;
    }
}

.table-pro {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.87rem;
}

.table-pro thead th {
    text-align: left;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--ink-faint);
    font-weight: 600;
    padding: 0 14px 10px;
    border-bottom: 1px solid var(--border);
}

.table-pro tbody td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--ink);
}

.table-pro tbody tr:last-child td { border-bottom: none; }
.table-pro tbody tr:hover { background: var(--paper); }

.table-pro .cell-muted { color: var(--ink-faint); }
.table-pro .cell-mono { font-family: var(--font-mono); font-weight: 600; color: var(--primary-dark); }
.table-pro .cell-empty { text-align: center; color: var(--ink-faint); padding: 48px 14px; }

/* ==========================================================================
   Badges & status
   ========================================================================== */
.badge-pro {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-neutral { background: var(--paper); color: var(--ink-soft); border: 1px solid var(--border-strong); }
.badge-success { background: var(--primary-soft); color: var(--primary-dark); }
.badge-warn { background: var(--accent-soft); color: #8a5a1f; }
.badge-danger { background: var(--danger-soft); color: var(--danger); }

.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* Elemento de assinatura: pulso de radar pro status "rodando" */
.status-radar { position: relative; width: 9px; height: 9px; flex-shrink: 0; }
.status-radar::before, .status-radar::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--accent);
}
.status-radar::before {
    animation: radar-ping 1.8s cubic-bezier(0,0,0.2,1) infinite;
}
@keyframes radar-ping {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(3.2); opacity: 0; }
}

/* ==========================================================================
   Formulários
   ========================================================================== */
.field-pro { margin-bottom: 18px; }

.field-pro label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 6px;
}

.field-pro .form-text { font-size: 0.75rem; color: var(--ink-faint); margin-top: 5px; }
.field-pro .text-danger { font-size: 0.75rem; margin-top: 5px; }

.field-pro input[type="text"],
.field-pro input[type="password"],
.field-pro input[type="email"],
.field-pro input[type="number"],
.field-pro select,
.field-pro textarea,
input.form-control,
select.form-select {
    width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 0.88rem;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field-pro input:focus,
.field-pro select:focus,
input.form-control:focus,
select.form-select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-soft);
}

/* ==========================================================================
   Login
   ========================================================================== */
.login-shell {
    min-height: 100vh;
    display: flex;
}

.login-side {
    flex: 1.1;
    background: var(--ink);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    position: relative;
    overflow: hidden;
}

.login-side::before {
    content: "";
    position: absolute;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(14,124,102,0.35), transparent 70%);
    top: -120px;
    right: -140px;
}

.login-side::after {
    content: "";
    position: absolute;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201,138,58,0.25), transparent 70%);
    bottom: -100px;
    left: -100px;
}

.login-side .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; position: relative; }
.login-side .brand .mark {
    width: 36px; height: 36px; border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, var(--accent), var(--primary) 70%);
    position: relative;
}
.login-side .brand .mark::after { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: var(--ink); }
.login-side .brand span { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; }

.login-side h1 {
    font-size: 2.1rem;
    color: #fff;
    max-width: 420px;
    position: relative;
    line-height: 1.2;
}

.login-side p { color: #a9b3ae; max-width: 380px; position: relative; font-size: 0.95rem; }

.login-form-col {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 1.4rem; margin-bottom: 6px; }
.login-card .subtitle { color: var(--ink-faint); font-size: 0.88rem; margin-bottom: 26px; }

@media (max-width: 860px) {
    .login-side { display: none; }
}

/* ==========================================================================
   Kanban
   ========================================================================== */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(220px, 1fr));
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
}
@media (max-width: 1100px) { .kanban-board { grid-template-columns: repeat(5, 260px); } }

.kanban-col {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    min-height: 200px;
}

.kanban-col-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 0 2px;
}

.kanban-col-head h6 {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    color: var(--ink-soft);
    font-weight: 700;
    margin: 0;
}

.kanban-count {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--ink-faint);
    background: var(--paper);
    border-radius: 99px;
    padding: 1px 8px;
}

.lead-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 13px;
    margin-bottom: 10px;
    background: var(--paper);
    cursor: grab;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.lead-card:hover { box-shadow: var(--shadow-sm); border-color: var(--border-strong); }
.lead-card:active { cursor: grabbing; }

.lead-card .lead-nome { font-weight: 700; font-size: 0.88rem; color: var(--ink); margin-bottom: 3px; }
.lead-card .lead-tel { font-family: var(--font-mono); color: var(--primary-dark); font-weight: 600; font-size: 0.82rem; display: flex; align-items: center; gap: 5px; }
.lead-card .lead-meta { font-size: 0.78rem; color: var(--ink-faint); margin-top: 3px; }
.lead-card .lead-link { font-size: 0.78rem; display: inline-block; margin-top: 6px; }

.kanban-col.drag-over { outline: 2px dashed var(--primary); outline-offset: -4px; background: var(--primary-soft); }

/* ==========================================================================
   Alerts
   ========================================================================== */
.alert-pro {
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 0.87rem;
    margin-bottom: 16px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.alert-pro-success { background: var(--primary-soft); color: var(--primary-dark); border-color: #bfe2d6; }
.alert-pro-error { background: var(--danger-soft); color: var(--danger); border-color: #edc9be; }
.alert-pro-info { background: var(--accent-soft); color: #8a5a1f; border-color: #ecd6ae; }
.alert-pro button {
    background: none; border: none; font-size: 1.1rem; line-height: 1; cursor: pointer; color: inherit; opacity: 0.6;
}
.alert-pro button:hover { opacity: 1; }

/* ==========================================================================
   Modal de detalhe do lead
   ========================================================================== */
.lead-modal-overlay {
    display: flex;
    position: fixed;
    inset: 0;
    background: rgba(15, 20, 24, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.lead-modal-overlay.open { opacity: 1; visibility: visible; }

@media (max-width: 560px) {
    .lead-modal-overlay { padding: 0; align-items: flex-end; }
    .lead-modal {
        max-width: 100%;
        max-height: 92vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        transform: translateY(100%);
    }
    .lead-modal-overlay.open .lead-modal { transform: translateY(0); }
}

.lead-modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.lead-modal-overlay.open .lead-modal { transform: scale(1) translateY(0); }

.lead-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 22px 22px 18px;
    border-bottom: 1px solid var(--border);
    position: relative;
    background: linear-gradient(180deg, var(--paper) 0%, var(--surface) 100%);
}

.lead-modal-title { display: flex; align-items: center; gap: 12px; }

.lead-modal-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    flex-shrink: 0;
    background: radial-gradient(circle at 35% 35%, var(--accent), var(--primary) 75%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    box-shadow: var(--shadow-sm);
}

.lead-modal-nome { font-family: var(--font-display); font-size: 1.18rem; font-weight: 600; color: var(--ink); line-height: 1.25; }
.lead-modal-sub { font-size: 0.78rem; color: var(--ink-faint); margin-top: 2px; }

.lead-modal-close {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    line-height: 1;
    color: var(--ink-faint);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
    flex-shrink: 0;
}
.lead-modal-close:hover { background: var(--paper); color: var(--ink); transform: rotate(90deg); }

.lead-modal-body { padding: 20px 22px 22px; overflow-y: auto; }

.lead-modal-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
@media (max-width: 420px) { .lead-modal-info { grid-template-columns: 1fr; } }

.lm-info-item {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 11px;
    font-size: 0.84rem;
    color: var(--ink);
    min-width: 0;
}
.lm-info-item i { color: var(--primary); margin-top: 2px; flex-shrink: 0; }
.lm-info-item > div { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.lm-info-item span:not(.lm-info-label) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lm-info-label {
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-faint);
    font-weight: 700;
    margin-bottom: 1px;
}

.lead-modal-timeline-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--ink-faint);
    font-weight: 700;
    margin: 22px 0 10px;
}

.lead-modal-timeline {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
    margin-bottom: 14px;
    padding-right: 2px;
}
.lead-modal-timeline::-webkit-scrollbar { width: 6px; }
.lead-modal-timeline::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }

.lead-modal-timeline-empty {
    color: var(--ink-faint);
    font-size: 0.82rem;
    padding: 18px 0;
    text-align: center;
}

.timeline-item {
    display: flex;
    gap: 10px;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 11px;
    transition: opacity 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.timeline-item:hover { border-color: var(--border-strong); }

.timeline-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.timeline-content { flex: 1; min-width: 0; }

.timeline-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.72rem;
    color: var(--ink-faint);
    margin-bottom: 4px;
}
.timeline-meta strong { color: var(--ink-soft); font-weight: 600; }
.timeline-texto { font-size: 0.85rem; color: var(--ink); white-space: pre-wrap; line-height: 1.4; }

.timeline-remove {
    background: none;
    border: none;
    color: var(--ink-faint);
    cursor: pointer;
    padding: 1px 3px;
    font-size: 0.82rem;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}
.timeline-item:hover .timeline-remove { opacity: 1; }
.timeline-remove:hover { color: var(--danger); }

.lead-modal-add { display: flex; gap: 8px; align-items: flex-end; }
.lead-modal-add textarea {
    flex: 1;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 9px 11px;
    font-size: 0.85rem;
    font-family: var(--font-body);
    resize: vertical;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.lead-modal-add textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-soft);
}

/* Botão "abrir detalhe" nos cards e linhas de tabela */
.lead-detalhe-btn {
    background: none;
    border: none;
    color: var(--ink-faint);
    cursor: pointer;
    padding: 2px 4px;
    font-size: 0.9rem;
}
.lead-detalhe-btn:hover { color: var(--primary); }

/* ==========================================================================
   Campo de data (próximo contato)
   ========================================================================== */
.date-field {
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    height: 42px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.date-field:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.date-field.has-value { background: var(--primary-soft); border-color: #bfe2d6; }
.date-field.has-value .date-field-icon { color: var(--primary-dark); }

.date-field-icon {
    color: var(--ink-faint);
    font-size: 0.95rem;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.date-field input[type="date"] {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0;
    font-family: var(--font-mono);
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--ink);
    height: 100%;
    accent-color: var(--primary);
}
.date-field input[type="date"]:focus { outline: none; box-shadow: none; }

/* Cor/estilo do ícone de calendário nativo (Chrome/Edge) */
.date-field input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(48%) sepia(15%) saturate(1200%) hue-rotate(115deg) brightness(90%);
    cursor: pointer;
    border-radius: 6px;
    padding: 4px;
    transition: background 0.15s ease;
}
.date-field input[type="date"]::-webkit-calendar-picker-indicator:hover {
    background: rgba(14, 124, 102, 0.12);
}

.date-field-clear {
    background: none;
    border: none;
    color: var(--ink-faint);
    font-size: 0.95rem;
    cursor: pointer;
    display: none;
    align-items: center;
    padding: 2px;
    flex-shrink: 0;
    transition: color 0.15s ease, transform 0.15s ease;
}
.date-field.has-value .date-field-clear { display: flex; }
.date-field-clear:hover { color: var(--danger); transform: scale(1.1); }

/* ==========================================================================
   Dados extras importados (grid no modal do lead)
   ========================================================================== */
.lm-extras-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 4px;
}

.lm-extra-item {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    font-size: 0.8rem;
    color: var(--ink);
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}
.lm-extra-item span:not(.lm-info-label) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================================
   Paginação
   ========================================================================== */
.paginacao {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.paginacao-info {
    font-size: 0.82rem;
    color: var(--ink-soft);
}

.paginacao-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

@media (max-width: 480px) {
    .paginacao { justify-content: center; text-align: center; }
    .paginacao-nav { justify-content: center; }
    .paginacao-btn, .paginacao-num { min-width: 38px; height: 38px; }
}

.paginacao-btn, .paginacao-num {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink-soft);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.paginacao-btn:hover, .paginacao-num:hover {
    background: var(--paper);
    color: var(--ink);
    border-color: var(--border-strong);
}

.paginacao-btn.disabled {
    opacity: 0.35;
    pointer-events: none;
}

.paginacao-num.atual {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.paginacao-ellipsis {
    color: var(--ink-faint);
    padding: 0 4px;
    font-size: 0.82rem;
}

/* ==========================================================================
   Cores das etiquetas customizáveis
   ========================================================================== */
.etq-teal { background: var(--primary-soft); color: var(--primary-dark); }
.etq-copper { background: var(--accent-soft); color: #8a5a1f; }
.etq-danger { background: var(--danger-soft); color: var(--danger); }
.etq-blue { background: var(--info-soft); color: var(--info); }
.etq-purple { background: var(--violet-soft); color: var(--violet); }
.etq-neutral { background: var(--paper); color: var(--ink-soft); border: 1px solid var(--border-strong); }

/* ==========================================================================
   Contatos pendentes (painel do consultor)
   ========================================================================== */
.pendentes-lista {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pendente-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    cursor: pointer;
    font-size: 0.83rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.pendente-item:hover { border-color: var(--border-strong); background: var(--surface); }
.pendente-nome { font-weight: 600; color: var(--ink); }

.proximo-contato-wrap:empty { display: none; }
.proximo-contato-wrap { margin-top: 3px; }

/* ==========================================================================
   Filtros da tela de Leads
   ========================================================================== */
.filtros-leads {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 18px;
}

.filtro-busca {
    position: relative;
    flex: 1 1 220px;
    max-width: 280px;
}
.filtro-busca i {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-faint);
    font-size: 0.85rem;
}
.filtro-busca input { padding-left: 32px; width: 100%; }

.filtros-leads .form-select { width: auto; flex: 0 0 auto; }
.filtro-acoes { display: flex; gap: 8px; }

@media (max-width: 640px) {
    .filtros-leads { flex-direction: column; align-items: stretch; }
    .filtro-busca { max-width: none; }
    .filtros-leads .form-select { width: 100%; }
    .filtro-acoes { width: 100%; }
    .filtro-acoes .btn-pro { flex: 1; justify-content: center; }
}

/* ==========================================================================
   Lista de leads em cards (mobile)
   ========================================================================== */
.lead-row-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 10px;
}

.lead-row-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.lead-row-nome {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--ink);
    text-decoration: none;
    display: block;
}

.lead-row-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.lead-row-badges:empty { display: none; }
.lead-row-badges .etiqueta-cell:empty, .lead-row-badges .proximo-contato-cell:empty { display: none; }

.lead-row-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 10px;
    font-size: 0.83rem;
}
.lead-row-meta i { width: 14px; color: var(--ink-faint); }

.lead-row-footer {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.lead-row-footer .select-consultor { flex: 1; }


/* ==========================================================================
   Trial / planos / assinatura
   ========================================================================== */
.trial-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--accent-soft);
    border: 1px solid #ecd6ae;
    color: #8a5a1f;
    border-radius: var(--radius-sm);
    padding: 9px 14px;
    font-size: 0.84rem;
    margin-bottom: 16px;
}
.trial-banner a {
    color: #8a5a1f;
    font-weight: 700;
    text-decoration: underline;
    white-space: nowrap;
}

.login-side-lista {
    list-style: none;
    padding: 0;
    margin: 22px 0 0;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.login-side-lista li {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #cfd6d3;
    font-size: 0.88rem;
}
.login-side-lista i { color: var(--accent); }

.planos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.plano-card { display: flex; flex-direction: column; }
.plano-nome {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ink);
}
.plano-preco {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 600;
    color: var(--ink);
    margin: 10px 0 4px;
}
.plano-moeda { font-size: 1rem; color: var(--ink-faint); margin-right: 2px; }
.plano-periodo { font-size: 0.9rem; color: var(--ink-faint); font-weight: 500; }

.plano-lista {
    list-style: none;
    padding: 0;
    margin: 14px 0 20px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    flex: 1;
}
.plano-lista li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--ink-soft);
}
.plano-lista i { color: var(--primary); }