/* ===== Qualifica CNPJ CRM — Estilos ===== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

:root {
    --bg: #f4f5f7;
    --card: #fff;
    --border: #e2e5ea;
    --text: #1a1d23;
    --text-secondary: #5a6270;
    --text-muted: #8b919a;
    --accent: #ff6d00;
    --accent-light: #fff3e0;
    --green: #16a34a;
    --green-bg: #ecfdf5;
    --blue: #ff6d00;
    --blue-bg: #eff6ff;
    --yellow: #ca8a04;
    --yellow-bg: #fefce8;
    --red: #dc2626;
    --red-bg: #fef2f2;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh
}

.topbar {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 14px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow)
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px
}

.topbar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.topbar-logo img {
    max-height: 38px;
    width: auto;
}

.topbar h1 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text)
}

.topbar h1 span {
    color: var(--accent)
}

.topbar-right {
    display: flex;
    gap: 10px;
    align-items: center
}

.last-update {
    font-size: 11px;
    color: var(--text-muted)
}

.btn {
    padding: 8px 18px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    border: 1px solid var(--border)
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent)
}

.btn-primary:hover {
    background: #1d4ed8
}

.btn:disabled {
    opacity: .5;
    cursor: wait
}

.container {
    max-width: 1480px;
    margin: 0 auto;
    padding: 20px 28px
}

.stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin-bottom: 20px
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: var(--shadow);
    transition: box-shadow .2s
}

.stat-card:hover {
    box-shadow: var(--shadow-md)
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1
}

.stat-pct {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px
}

.stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%
}

.dot-green { background: var(--green) }
.dot-blue  { background: var(--blue) }
.dot-yellow{ background: var(--yellow) }
.dot-red   { background: var(--red) }

.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center
}

.search-box {
    flex: 1;
    min-width: 240px;
    padding: 10px 14px 10px 36px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    color: var(--text);
    outline: none;
    transition: border .15s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' fill='%238b919a' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85-.017.016zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center
}

.search-box:focus { border-color: var(--accent) }
.search-box::placeholder { color: var(--text-muted) }

.filter-select {
    padding: 10px 32px 10px 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 12px;
    color: var(--text);
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238b919a' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 0 1 .708 0L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    min-width: 150px
}

.table-wrapper {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow)
}

.modern-grid-header {
    display: grid;
    padding: 12px 16px;
    background: var(--bg);
    border-bottom: 2px solid var(--border);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    gap: 16px;
    align-items: center;
}

.modern-grid-row {
    display: grid;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--card);
    transition: all 0.2s ease;
    cursor: pointer;
    gap: 16px;
    align-items: center;
}

.tab-ligacao .modern-grid-header,
.tab-ligacao .modern-grid-row {
    grid-template-columns: minmax(180px, 1fr) 90px 140px 110px 150px 2fr 180px;
}

.tab-followup .modern-grid-header,
.tab-followup .modern-grid-row {
    grid-template-columns: minmax(180px, 1fr) 90px 140px 110px 130px 150px 2fr 180px;
}

.tab-agendados .modern-grid-header,
.tab-agendados .modern-grid-row,
.tab-perdidos .modern-grid-header,
.tab-perdidos .modern-grid-row {
    grid-template-columns: minmax(180px, 1fr) 90px 140px 110px 150px 2fr;
}

/* Login Overlay Styles */
#loginOverlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box img { max-width: 150px; margin-bottom: 24px; }
.login-box h2 { margin: 0 0 24px; color: var(--text); font-size: 20px; }

.login-form { display: flex; flex-direction: column; gap: 16px; }

.login-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.login-input:focus { border-color: #3b82f6; }

.login-btn {
    width: 100%;
    padding: 12px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}
.login-btn:hover { background: #2563eb; }

.login-error { color: #ef4444; font-size: 13px; margin-top: 12px; display: none; }

.table-scroll { overflow-x: auto; max-height: 68vh; overflow-y: auto }

table { width: 100%; border-collapse: collapse; font-size: 12px }

thead { position: sticky; top: 0; z-index: 10 }

th {
    background: #f8f9fb;
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: color .15s
}
th:hover { color: var(--accent) }

td {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f1f3;
    white-space: nowrap;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px
}

tr { transition: background .1s }
tr:hover td { background: #f8f9fb }
tr.clickable { cursor: pointer }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px
}

.badge.EXCELENTE { background: var(--green-bg); color: var(--green) }
.badge.BOA       { background: var(--yellow-bg); color: var(--yellow) }
.badge.MÉDIA,
.badge.MEDIA     { background: var(--blue-bg);  color: var(--blue) }
.badge.BAIXA     { background: var(--red-bg);   color: var(--red) }

.nota-bar   { display: flex; align-items: center; gap: 6px }
.nota-num   { font-weight: 700; font-size: 12px; min-width: 20px }
.nota-track { height: 4px; border-radius: 2px; width: 50px; background: #edf0f3; overflow: hidden }
.nota-fill  { height: 100%; border-radius: 2px; transition: width .5s ease }

.phone-link, .link { color: var(--accent); text-decoration: none; font-weight: 500; transition: opacity .15s }
.phone-link:hover, .link:hover { opacity: .7 }

.loading-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px;
    gap: 14px;
    color: var(--text-muted)
}

.spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite
}
@keyframes spin { to { transform: rotate(360deg) } }

.empty-state { text-align: center; padding: 60px; color: var(--text-muted); font-size: 13px }

.count-info {
    font-size: 12px;
    color: var(--text-muted);
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    z-index: 200;
    align-items: center;
    justify-content: center
}
.modal-overlay.active { display: flex }

.modal {
    background: #fff;
    border-radius: 16px;
    width: 90%; max-width: 740px; max-height: 85vh;
    overflow-y: auto;
    padding: 28px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15)
}

.modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px }
.modal h2 { font-size: 18px; font-weight: 700; color: var(--text) }
.modal .modal-sub { color: var(--text-muted); font-size: 12px; margin-top: 2px }

.modal-close {
    background: #f4f5f7; border: none; color: var(--text-muted);
    width: 30px; height: 30px; border-radius: 8px; font-size: 16px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all .15s
}
.modal-close:hover { background: #e8eaed; color: var(--text) }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px }
.detail-item .dl { font-size: 9px; text-transform: uppercase; color: var(--text-muted); letter-spacing: .8px; font-weight: 600; margin-bottom: 2px }
.detail-item .dv { font-size: 13px; color: var(--text); word-break: break-word }

.detail-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border) }
.detail-section h3 { font-size: 11px; font-weight: 700; color: var(--text-secondary); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 1px }

.contact-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 14px; border-radius: 6px; text-decoration: none; font-size: 11px; font-weight: 600; transition: all .15s }
.contact-btn.tel   { background: var(--green-bg); color: var(--green) }
.contact-btn.tel:hover { background: #dcfce7 }
.contact-btn.email { background: var(--blue-bg); color: var(--blue) }
.contact-btn.email:hover { background: #dbeafe }
.contact-btn.web   { background: #f5f3ff; color: #7c3aed }
.contact-btn.web:hover { background: #ede9fe }

@media(max-width:768px) {
    .container { padding: 14px }
    .stats { grid-template-columns: repeat(2, 1fr) }
    .stats .stat-card:first-child { grid-column: span 2 }
    .filters { flex-direction: column }
    .detail-grid { grid-template-columns: 1fr }
}

.layout { display: flex; min-height: calc(100vh - 61px); }
.main-content { flex: 1; min-width: 0; overflow-x: auto; }

/* Sidebar */
.sidebar { width: 240px; background: var(--card); border-right: 1px solid var(--border); display: flex; flex-direction: column; transition: width 0.3s ease; position: relative; }
.sidebar.collapsed { width: 70px; }
.sidebar.collapsed .menu-item-text { display: none; }

.sidebar-toggle {
    position: absolute; top: 20px; right: -14px;
    background: var(--card); border: 1px solid var(--border); border-radius: 50%;
    width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 10; color: var(--text-muted);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); transition: all 0.2s;
}
.sidebar-toggle:hover { color: var(--blue); border-color: var(--blue); }
.sidebar.collapsed .sidebar-toggle svg { transform: rotate(180deg); }

.menu-items-wrapper { padding-top: 60px; flex: 1; }

.menu-item {
    padding: 14px 24px; color: var(--text-secondary); font-size: 13px; font-weight: 600;
    cursor: pointer; border-left: 3px solid transparent; transition: all .15s;
    display: flex; align-items: center; gap: 12px; white-space: nowrap; overflow: hidden;
}
.menu-item:hover { background: #f8f9fb; color: var(--text); }
.menu-item.active { background: var(--blue-bg); color: var(--blue); border-left-color: var(--blue); }

.obs-area { width: 100%; min-height: 80px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; font-size: 13px; resize: vertical; margin-bottom: 10px; background: #fff; }
.obs-area:focus { border-color: var(--accent); outline: none; }

.action-bars { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; padding: 16px; background: #f8f9fb; border-radius: 8px; border: 1px solid var(--border); }
.action-bars h4 { width: 100%; font-size: 11px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }

/* Grid Moderno */
.modern-grid-table {
    background: #fff; border-radius: 12px; border: 1px solid var(--border);
    overflow-y: auto; overflow-x: auto; max-height: calc(100vh - 220px); width: 100%; margin-top: 10px;
}

.modern-grid-row, .modern-grid-header {
    display: grid;
    grid-template-columns: 1.8fr 0.8fr 1.2fr 0.8fr 0.8fr 1fr 1.6fr 1.8fr;
    align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); gap: 12px;
}

.modern-grid-header {
    background: #f8f9fb; font-size: 10px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .8px; color: var(--text-muted); position: sticky; top: 0; z-index: 10;
}

.modern-grid-row { border-bottom: 1px solid var(--border); transition: background-color 0.2s ease; }
.modern-grid-row:last-child { border-bottom: none; }
.modern-grid-row:hover { background-color: #f8fafc; cursor: pointer; }

.header-col { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.header-col svg { width: 12px; height: 12px; opacity: 0.5; }

.cell-company strong { font-weight: 600; font-size: 14px; color: var(--text); }
.cell-phone { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.cell-phone svg { width: 14px; height: 14px; color: #3b82f6; }

.badge-count {
    display: inline-flex; align-items: center; justify-content: center;
    background-color: #f1f5f9; color: var(--text-secondary);
    width: 26px; height: 26px; border-radius: 50%; font-size: 12px; font-weight: 600;
}

.input-note {
    width: 100%; padding: 8px 12px; background-color: #f8fafc;
    border: 1px solid transparent; border-radius: 6px; font-size: 12px;
    color: var(--text); font-family: inherit; transition: all 0.2s ease;
}
.input-note:focus { outline: none; background-color: #ffffff; border-color: #cbd5e1; box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.1); }

.cell-actions { display: flex; gap: 6px; justify-content: flex-start; }

.btn-action {
    display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 6px;
    font-size: 11px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; border: 1px solid; background: none;
}
.btn-action.blue   { color: #0ea5e9; background: #f0f9ff; border-color: #e0f2fe; }
.btn-action.blue:hover { background: #e0f2fe; }
.btn-action.orange { color: #ea580c; background: #fff7ed; border-color: #ffedd5; }
.btn-action.orange:hover { background: #ffedd5; }
.btn-action.red    { color: #e11d48; background: #fff1f2; border-color: #ffe4e6; }
.btn-action.red:hover { background: #ffe4e6; }

.dropdown-responsavel {
    width: 100%; padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 6px;
    font-size: 13px; background-color: #f8fafc; color: #334155; outline: none;
    appearance: none; cursor: pointer; transition: all 0.2s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 0 1 .708 0L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 8px center;
}
.dropdown-responsavel:focus { border-color: #3b82f6; background-color: #fff; box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1); }

/* Toast Notification */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    border-left: 4px solid var(--accent);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    min-width: 300px;
    max-width: 440px;
    animation: toastIn 0.35s ease forwards;
    transition: all 0.3s ease;
}

.toast.toast-out {
    animation: toastOut 0.3s ease forwards;
}

.toast-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: var(--accent-light);
    color: var(--accent);
}

.toast-body {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 2px;
}

.toast-msg {
    font-size: 12px;
    color: var(--text-secondary);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(60px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(60px); }
}

/* ===== Kanban ===== */
.kanban-wrapper {
    width: 100%;
    margin-top: 10px;
}

.kanban-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 12px;
}



.kanban-board {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 2px 2px 8px 2px;
}

.kanban-column {
    flex: 0 0 280px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    min-height: 360px;
}

.kanban-column.dragover,
.kanban-column.kanban-dragover {
    border-color: var(--accent);
    box-shadow: 0 10px 20px rgba(255, 109, 0, 0.12);
    background: var(--accent-light);
}

.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: #f8f9fb;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.kanban-column-body {
    padding: 12px 12px 14px 12px;
    overflow-y: auto;
    max-height: calc(100vh - 300px);
}

.kanban-card {
    border: 1px solid rgba(226, 229, 234, 1);
    background: #fff;
    border-radius: 12px;
    padding: 12px 12px 10px 12px;
    margin-bottom: 10px;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.kanban-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
    border-color: rgba(59, 130, 246, 0.3);
}

.kanban-grip {
    color: #e2e8f0;
    transition: color 0.2s ease;
}

.kanban-card:hover .kanban-grip {
    color: #94a3b8;
}

.sortable-ghost {
    opacity: 0.5;
    background-color: #f8f9fb;
    border: 2px dashed #cbd5e1;
}

.sortable-drag {
    background-color: #ffffff !important;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.1) !important;
    cursor: grabbing !important;
    transform: scale(1.02);
}


.kanban-card-title {
    font-size: 13px;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 2px;
}

.kanban-card-sub {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* ===== Kanban Drag-and-Drop States ===== */
.kanban-dragover {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 2px rgba(255, 109, 0, 0.2), 0 8px 24px rgba(255, 109, 0, 0.1) !important;
    background: #fff8f0 !important;
    transition: all 0.15s ease;
}

.kanban-card[draggable="true"] {
    cursor: grab;
}

.kanban-card[draggable="true"]:active {
    cursor: grabbing;
}

.kanban-card:hover {
    transform: translateY(-2px);
}

/* Funil KPI row color coding */
.funil-row-lead       { color: #64748b; }
.funil-row-morno      { color: #ca8a04; }
.funil-row-quente     { color: #ea580c; }
.funil-row-frio       { color: #0284c7; }
.funil-row-convertido { color: #16a34a; }
.funil-row-perdido    { color: #dc2626; }

/* Kanban scrollbar elegante */
.kanban-board::-webkit-scrollbar {
    height: 6px;
}
.kanban-board::-webkit-scrollbar-track {
    background: transparent;
}
.kanban-board::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
.kanban-board::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.kanban-column-body::-webkit-scrollbar {
    width: 4px;
}
.kanban-column-body::-webkit-scrollbar-track {
    background: transparent;
}
.kanban-column-body::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 2px;
}

@media (max-width: 900px) {
    .kanban-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .kanban-supabase-panel {
        min-width: 0;
    }
}

/* ===== Cards de Discagem ===== */
.discagem-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

.lead-card-discagem {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.2s, box-shadow 0.2s, grid-column 0.3s ease;
}

.lead-card-discagem.expanded-card {
    /* Removido grid-column: 1 / -1; para não descer de linha */
}

.lead-card-discagem.expanded-card .anotacao-resumo {
    display: none !important;
}

.lead-card-discagem.expanded-card .status-buttons-container {
    display: flex !important;
}

.expand-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f8f9fb;
    color: var(--text-muted);
    transition: all 0.2s;
}

.expand-arrow:hover {
    background: #e2e8f0;
    color: var(--text);
}

.expand-arrow svg {
    transition: transform 0.3s ease;
}

.expand-arrow.expanded svg {
    transform: rotate(180deg);
}

.lead-card-expanded-content {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    margin-top: 4px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.lead-card-discagem:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.lead-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.lead-card-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 4px;
}

.lead-card-segmento {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lead-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.lead-card-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.lead-card-badge svg {
    width: 12px;
    height: 12px;
}

.badge-blue { background: #eff6ff; color: #2563eb; }
.badge-orange { background: #fff7ed; color: #ea580c; }
.badge-green { background: #f0fdf4; color: #16a34a; }
.badge-red { background: #fef2f2; color: #dc2626; }

.lead-card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lead-card-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: #f8fafc;
    padding: 10px;
    border-radius: 8px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-label {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
}

.info-value {
    font-size: 12px;
    color: var(--text);
    font-weight: 600;
}

.lead-card-notes {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    background: #fff8f1;
    padding: 10px;
    border-left: 3px solid #f97316;
    border-radius: 4px 8px 8px 4px;
    max-height: 80px;
    overflow-y: auto;
}

.lead-card-notes::-webkit-scrollbar {
    width: 4px;
}
.lead-card-notes::-webkit-scrollbar-thumb {
    background: #fed7aa;
    border-radius: 2px;
}

.lead-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.btn-dial, .btn-wpp {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-dial {
    background: #eff6ff;
    color: #2563eb;
}

.btn-dial:hover {
    background: #dbeafe;
}

.btn-wpp {
    background: #f0fdf4;
    color: #16a34a;
}

.btn-wpp:hover {
    background: #dcfce7;
}

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

.select-status, .input-date {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text);
    background: #fff;
    outline: none;
}

.select-status:focus, .input-date:focus {
    border-color: var(--accent);
}

 / *   E x p a n d e d   C a r d   L a y o u t   * / 
 . l e a d - c a r d - d i s c a g e m . e x p a n d e d   { 
         g r i d - c o l u m n :   1   /   - 1 ; 
         b o r d e r - c o l o r :   v a r ( - - a c c e n t ) ; 
         b o x - s h a d o w :   0   8 p x   2 4 p x   r g b a ( 0 , 0 , 0 , 0 . 1 ) ; 
 } 
 . l e a d - c a r d - d e t a i l s   { 
         d i s p l a y :   n o n e ; 
         m a r g i n - t o p :   1 6 p x ; 
         p a d d i n g - t o p :   1 6 p x ; 
         b o r d e r - t o p :   1 p x   d a s h e d   v a r ( - - b o r d e r ) ; 
 } 
 . l e a d - c a r d - d i s c a g e m . e x p a n d e d   . l e a d - c a r d - d e t a i l s   { 
         d i s p l a y :   b l o c k ; 
         a n i m a t i o n :   f a d e I n   0 . 3 s   e a s e ; 
 } 
 . l e a d - c a r d - t o g g l e   { 
         b a c k g r o u n d :   n o n e ; 
         b o r d e r :   n o n e ; 
         c o l o r :   v a r ( - - t e x t - m u t e d ) ; 
         c u r s o r :   p o i n t e r ; 
         p a d d i n g :   4 p x ; 
         b o r d e r - r a d i u s :   4 p x ; 
         t r a n s i t i o n :   a l l   0 . 2 s ; 
         d i s p l a y :   f l e x ; 
         a l i g n - i t e m s :   c e n t e r ; 
         j u s t i f y - c o n t e n t :   c e n t e r ; 
 } 
 . l e a d - c a r d - t o g g l e : h o v e r   { 
         b a c k g r o u n d :   # f 1 f 5 f 9 ; 
         c o l o r :   v a r ( - - t e x t ) ; 
 } 
 . l e a d - c a r d - d i s c a g e m . e x p a n d e d   . l e a d - c a r d - t o g g l e   s v g   { 
         t r a n s f o r m :   r o t a t e ( 1 8 0 d e g ) ; 
 } 
 . q s a - g r i d   { 
         d i s p l a y :   g r i d ; 
         g r i d - t e m p l a t e - c o l u m n s :   r e p e a t ( a u t o - f i l l ,   m i n m a x ( 2 0 0 p x ,   1 f r ) ) ; 
         g a p :   1 0 p x ; 
         m a r g i n - t o p :   1 0 p x ; 
 } 
 . q s a - c a r d   { 
         b a c k g r o u n d :   # f 8 f a f c ; 
         b o r d e r :   1 p x   s o l i d   v a r ( - - b o r d e r ) ; 
         p a d d i n g :   1 0 p x ; 
         b o r d e r - r a d i u s :   6 p x ; 
 } 
 . q s a - n a m e   {   f o n t - s i z e :   1 2 p x ;   f o n t - w e i g h t :   7 0 0 ;   c o l o r :   v a r ( - - t e x t ) ;   } 
 . q s a - q u a l   {   f o n t - s i z e :   1 0 p x ;   c o l o r :   v a r ( - - t e x t - s e c o n d a r y ) ;   t e x t - t r a n s f o r m :   u p p e r c a s e ;   } 
  
 . l e a d - c a r d - t o g g l e   s v g   {   t r a n s i t i o n :   t r a n s f o r m   0 . 2 s   e a s e ;   }  
 