/* ========================================
   DashImobi Kanban — Premium Compacto
   ======================================== */

.dashimobi-kanban { padding: 0; font-family: 'Inter', sans-serif; }

/* ---- Toolbar ---- */
.kanban-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }

.kanban-search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid #e5e7eb; border-radius: 10px; padding: 8px 14px; flex: 1; min-width: 200px; transition: border-color .2s; }
.kanban-search:focus-within { border-color: #d97706; }
.dark .kanban-search { background: #1f2937; border-color: #374151; }
.kanban-search svg { width: 15px; height: 15px; color: #9ca3af; flex-shrink: 0; }
.kanban-search input { background: transparent; border: none; outline: none; color: #111827; font-size: 13px; width: 100%; }
.dark .kanban-search input { color: #f3f4f6; }
.kanban-search input::placeholder { color: #9ca3af; }

.kanban-view-toggle { display: flex; background: #f3f4f6; border-radius: 10px; padding: 3px; gap: 2px; border: 1.5px solid #e5e7eb; }
.dark .kanban-view-toggle { background: #1f2937; border-color: #374151; }
.kanban-view-toggle button { display: flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 7px; border: none; background: transparent; color: #6b7280; font-size: 12px; font-weight: 500; cursor: pointer; transition: all .2s; }
.kanban-view-toggle button svg { width: 14px; height: 14px; }
.kanban-view-toggle button.active { background: #fff; color: #92400e; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.dark .kanban-view-toggle button.active { background: #374151; color: #fbbf24; }

.kanban-btn-novo { display: flex; align-items: center; gap: 6px; padding: 8px 16px; background: linear-gradient(135deg,#d97706,#b45309); color: #fff; border-radius: 10px; font-size: 13px; font-weight: 600; text-decoration: none; transition: all .2s; white-space: nowrap; box-shadow: 0 2px 8px rgba(217,119,6,.3); }
.kanban-btn-novo:hover { background: linear-gradient(135deg,#b45309,#92400e); color: #fff; }
.kanban-btn-novo svg { width: 14px; height: 14px; }

/* ---- Board ---- */
.kanban-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 16px; align-items: flex-start; }
.kanban-board::-webkit-scrollbar { height: 4px; }
.kanban-board::-webkit-scrollbar-track { background: #f3f4f6; border-radius: 2px; }
.kanban-board::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }
.dark .kanban-board::-webkit-scrollbar-track { background: #1f2937; }
.dark .kanban-board::-webkit-scrollbar-thumb { background: #4b5563; }

/* ---- Coluna ---- */
.kanban-column { min-width: 260px; max-width: 260px; background: #f9fafb; border-radius: 12px; border: 1px solid #e5e7eb; overflow: hidden; flex-shrink: 0; }
.dark .kanban-column { background: #111827; border-color: #1f2937; }

.kanban-column-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; }
.kanban-column-title { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; color: #6b7280; letter-spacing: .05em; text-transform: uppercase; }
.dark .kanban-column-title { color: #9ca3af; }
.kanban-column-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.kanban-column-count { background: #fff; color: #9ca3af; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 20px; border: 1px solid #e5e7eb; }
.dark .kanban-column-count { background: #1f2937; border-color: #374151; }

/* ---- Cards container ---- */
.kanban-cards { padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 60px; }

/* ---- Card compacto ---- */
.kanban-card {
    background: #fff;
    border: 1px solid #f3f4f6;
    border-radius: 10px;
    cursor: grab;
    transition: all .18s;
    user-select: none;
    overflow: hidden;
    position: relative;
}
.dark .kanban-card { background: #1f2937; border-color: #374151; }
.kanban-card:hover { border-color: #fbbf24; box-shadow: 0 2px 10px rgba(0,0,0,.07); transform: translateY(-1px); }
.dark .kanban-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.kanban-card:active { cursor: grabbing; }

.kanban-card-ghost { opacity: .15; border: 1px dashed rgba(251,191,36,.4) !important; background: rgba(254,249,195,.1) !important; }
.kanban-card-drag { box-shadow: 0 8px 24px rgba(0,0,0,.15); transform: rotate(1deg) scale(1.02); }

/* Color bar bottom */
.kanban-card-bar { height: 2px; width: 100%; }

/* Card row layout */
.kanban-card-row { display: flex; flex-direction: column; gap: 0; padding: 10px 10px 8px; }

.kanban-card-avatar { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg,#fef3c7,#fde68a); color: #92400e; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex-shrink: 0; border: 1px solid #fde68a; }
.dark .kanban-card-avatar { background: linear-gradient(135deg,#451a03,#78350f); color: #fbbf24; border-color: #78350f; }

.kanban-card-main { flex: 1; min-width: 0; }
.kanban-card-nome { font-size: 13px; font-weight: 700; color: #111827; margin: 0 0 6px; white-space: normal; overflow: visible; line-height: 1.3; }
.dark .kanban-card-nome { color: #f9fafb; }
.kanban-card-valor { font-size: 11px; font-weight: 700; color: #059669; margin: 1px 0 0; min-height: 15px; }
.dark .kanban-card-valor { color: #34d399; }

/* Icons */
.kanban-card-icons { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }

.kicon { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 5px; color: #d1d5db; transition: all .15s; flex-shrink: 0; }
.kicon svg { width: 13px; height: 13px; }
.kicon-active { color: #059669; }
.dark .kicon { color: #4b5563; }
.dark .kicon-active { color: #34d399; }

.kicon-wa { color: #15803d; text-decoration: none; }
.kicon-wa:hover { background: #f0fdf4; color: #15803d; }
.dark .kicon-wa { color: #4ade80; }
.dark .kicon-wa:hover { background: rgba(74,222,128,.1); }

.kicon-edit { color: #9ca3af; text-decoration: none; }
.kicon-edit:hover { background: #f3f4f6; color: #374151; }
.dark .kicon-edit { color: #6b7280; }
.dark .kicon-edit:hover { background: #374151; color: #e5e7eb; }

.kanban-empty { text-align: center; padding: 20px 10px; color: #d1d5db; font-size: 11px; }

/* ---- Lista ---- */
.kanban-lista { display: flex; flex-direction: column; gap: 12px; }
.lista-grupo { background: #fff; border: 1.5px solid #e5e7eb; border-radius: 12px; overflow: hidden; }
.dark .lista-grupo { background: #1f2937; border-color: #374151; }
.lista-grupo-header { display: flex; align-items: center; justify-content: space-between; padding: 9px 16px; background: #f9fafb; border-bottom: 1px solid #f3f4f6; }
.dark .lista-grupo-header { background: #111827; border-bottom-color: #374151; }
.lista-grupo-nome { font-size: 11px; font-weight: 700; color: #6b7280; padding-left: 8px; letter-spacing: .05em; text-transform: uppercase; }
.dark .lista-grupo-nome { color: #9ca3af; }
.lista-grupo-count { background: #fff; color: #9ca3af; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 20px; border: 1px solid #e5e7eb; }
.dark .lista-grupo-count { background: #1f2937; border-color: #374151; }
.lista-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid #f9fafb; transition: background .15s; }
.dark .lista-row { border-bottom-color: #1f2937; }
.lista-row:last-child { border-bottom: none; }
.lista-row:hover { background: #fffbeb; }
.dark .lista-row:hover { background: rgba(217,119,6,.05); }
.lista-avatar { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; flex-shrink: 0; }
.lista-info { flex: 1; min-width: 0; }
.lista-nome { font-size: 13px; font-weight: 600; color: #111827; margin: 0 0 1px; }
.dark .lista-nome { color: #f9fafb; }
.lista-sub { font-size: 11px; color: #9ca3af; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lista-imovel { min-width: 160px; max-width: 180px; }
.lista-imovel p { margin: 0; font-size: 11px; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lista-valor { font-size: 11px; font-weight: 800; color: #059669 !important; }
.dark .lista-valor { color: #34d399 !important; }
.lista-badges { display: flex; gap: 4px; flex-wrap: wrap; min-width: 90px; }
.lista-actions { display: flex; gap: 5px; flex-shrink: 0; }
.lista-btn { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 7px; border: 1px solid #e5e7eb; background: #f9fafb; color: #6b7280; text-decoration: none; transition: all .18s; }
.dark .lista-btn { border-color: #374151; background: #111827; color: #9ca3af; }
.lista-btn:hover { background: #f3f4f6; color: #374151; }
.lista-btn-whatsapp { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.dark .lista-btn-whatsapp { background: rgba(21,128,61,.15); border-color: rgba(74,222,128,.3); color: #4ade80; }
.lista-btn-whatsapp:hover { background: #dcfce7; }

.badge { display: inline-flex; align-items: center; font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 5px; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-info { background: #dbeafe; color: #1e40af; }

/* ========================================
   MODAL
   ======================================== */
#lead-modal-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}

#lead-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%; max-width: 480px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    overflow: hidden;
    animation: modal-in .18s ease;
}
.dark #lead-modal { background: #1f2937; }

@keyframes modal-in { from { opacity:0; transform: scale(.96) translateY(8px); } to { opacity:1; transform: scale(1) translateY(0); } }

#lead-modal-header {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid #f3f4f6;
    background: #fafafa;
}
.dark #lead-modal-header { background: #111827; border-bottom-color: #374151; }

#lead-modal-avatar {
    width: 40px; height: 40px; border-radius: 10px;
    background: linear-gradient(135deg,#fef3c7,#fde68a);
    color: #92400e; font-size: 16px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    border: 1.5px solid #fde68a; flex-shrink: 0;
}
.dark #lead-modal-avatar { background: linear-gradient(135deg,#451a03,#78350f); color: #fbbf24; border-color: #78350f; }

#lead-modal-title { flex: 1; min-width: 0; }
#lead-modal-nome { font-size: 15px; font-weight: 700; color: #111827; margin: 0 0 4px; }
.dark #lead-modal-nome { color: #f9fafb; }

#lead-modal-estagio {
    display: inline-block; font-size: 10px; font-weight: 700;
    padding: 2px 8px; border-radius: 5px; border: 1px solid;
    letter-spacing: .04em; text-transform: uppercase;
}

#lead-modal-close {
    width: 30px; height: 30px; border-radius: 7px;
    border: 1px solid #e5e7eb; background: #fff;
    color: #9ca3af; cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    transition: all .15s; flex-shrink: 0;
}
.dark #lead-modal-close { background: #1f2937; border-color: #374151; color: #6b7280; }
#lead-modal-close:hover { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }
#lead-modal-close svg { width: 14px; height: 14px; }

#lead-modal-body { padding: 16px 18px; }

.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.modal-item { display: flex; flex-direction: column; gap: 2px; }
.modal-item-full { grid-column: 1 / -1; }
.modal-label { font-size: 10px; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: .05em; }
.modal-val { font-size: 13px; color: #374151; font-weight: 500; }
.dark .modal-val { color: #d1d5db; }
.modal-val-green { color: #059669 !important; font-weight: 700; }
.dark .modal-val-green { color: #34d399 !important; }

.modal-toggles { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid #f3f4f6; }
.dark .modal-toggles { border-top-color: #374151; }

.modal-toggle-btn {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 12px; border-radius: 8px;
    border: 1.5px solid #e5e7eb; background: #f9fafb;
    color: #6b7280; font-size: 12px; font-weight: 500;
    cursor: pointer; transition: all .15s;
}
.dark .modal-toggle-btn { border-color: #374151; background: #111827; color: #9ca3af; }
.modal-toggle-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.modal-toggle-btn:hover { border-color: #d1d5db; background: #f3f4f6; }
.modal-toggle-btn.active { background: #d1fae5; border-color: #6ee7b7; color: #065f46; font-weight: 700; }
.dark .modal-toggle-btn.active { background: rgba(6,95,70,.2); border-color: #34d399; color: #34d399; }

#lead-modal-footer {
    display: flex; gap: 8px;
    padding: 12px 18px 16px;
    border-top: 1px solid #f3f4f6;
}
.dark #lead-modal-footer { border-top-color: #374151; }

.modal-action-btn {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 16px; border-radius: 9px;
    font-size: 13px; font-weight: 600; text-decoration: none;
    transition: all .15s;
}
.modal-action-btn svg { width: 15px; height: 15px; }

.modal-btn-wa { background: #f0fdf4; border: 1.5px solid #86efac; color: #15803d; }
.modal-btn-wa:hover { background: #dcfce7; color: #166534; }

.modal-btn-edit { background: linear-gradient(135deg,#d97706,#b45309); color: #fff; border: none; box-shadow: 0 2px 8px rgba(217,119,6,.3); }
.modal-btn-edit:hover { background: linear-gradient(135deg,#b45309,#92400e); color: #fff; }

/* Mobile */
@media (max-width: 768px) {
    .kanban-column { min-width: 260px; max-width: 260px; }
    .lista-imovel, .lista-badges { display: none; }
    #lead-modal { max-width: 100%; border-radius: 12px; }
    .modal-grid { grid-template-columns: 1fr; }
}

/* Filtros */
.kanban-filter {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    color: #374151;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: border-color .2s;
    max-width: 150px;
    appearance: auto;
}
.kanban-filter:focus { border-color: #d97706; }
.dark .kanban-filter { background: #1f2937; border-color: #374151; color: #f3f4f6; }

/* Ícone IA */
.kicon-ia:hover { background: #ede9fe !important; color: #6366f1 !important; }
.kicon-ia svg { color: #8b5cf6; }



/* Ícones de origem */
.kicon-origem {
    width: 22px !important;
    height: 22px !important;
    border-radius: 5px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background-color: transparent !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 14px 14px !important;
}
.kicon-src-instagram { background-color: #e1306c20 !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e1306c'%3E%3Cpath d='M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z'/%3E%3C/svg%3E") !important; }
.kicon-src-facebook { background-color: #1877f220 !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231877f2'%3E%3Cpath d='M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z'/%3E%3C/svg%3E") !important; }
.kicon-src-site { background-color: #3b82f620 !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='1.8'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'/%3E%3C/svg%3E") !important; }
.kicon-src-indicacao { background-color: #10b98120 !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='1.8'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E") !important; }
.kicon-src-api { background-color: #8b5cf620 !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b5cf6' stroke-width='1.8'%3E%3Cpolyline points='16 18 22 12 16 6'/%3E%3Cpolyline points='8 6 2 12 8 18'/%3E%3C/svg%3E") !important; }
.kicon-src-csv { background-color: #f59e0b20 !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f59e0b' stroke-width='1.8'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='16' y1='13' x2='8' y2='13'/%3E%3Cline x1='16' y1='17' x2='8' y2='17'/%3E%3C/svg%3E") !important; }
.kicon-src-manual, .kicon-src-outro { background-color: #6b728020 !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='1.8'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z'/%3E%3C/svg%3E") !important; }

/* Ícone IA */
.kicon-ia:hover { background: #ede9fe !important; }
