/* CRM Mejores Arrendamientos */

/* METRIC CARDS */
.metric-card {
    background: #1e293b;
    border: 1px solid rgba(148,163,184,0.15);
    border-radius: 12px;
    padding: 16px;
    transition: transform 0.2s, border-color 0.2s;
}
.metric-card.clickable { cursor: pointer; }
.metric-card.clickable:hover { transform: scale(1.03); border-color: rgba(203,157,84,0.5); }
.metric-icon { font-size: 20px; margin-bottom: 8px; }
.metric-value { font-size: 24px; font-weight: 800; margin-bottom: 2px; }
.metric-label { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; }
.metric-amber .metric-icon { color: #f59e0b; }
.metric-blue .metric-icon { color: #3b82f6; }
.metric-indigo .metric-icon { color: #6366f1; }
.metric-emerald .metric-icon { color: #10b981; }
.metric-gold .metric-icon, .metric-gold .metric-value { color: #cb9d54; }
.metric-gold-dark .metric-icon { color: #a07c3c; }
.metric-gold-dark .metric-value { color: #e2bd75; }

/* ALERTS */
.alert-badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 16px; border-radius: 8px;
    font-size: 13px; font-weight: 500;
}
.alert-orange { background: rgba(249,115,22,0.15); color: #fb923c; border: 1px solid rgba(249,115,22,0.3); }
.alert-yellow { background: rgba(234,179,8,0.15); color: #facc15; border: 1px solid rgba(234,179,8,0.3); }
.alert-blue { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }
.alert-orange i { animation: pulse-icon 2s infinite; }
@keyframes pulse-icon { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* TABLE */
.lead-row { cursor: pointer; transition: background 0.15s; }
.lead-row:hover { background: rgba(203,157,84,0.05); }
.lead-row.expanded { background: rgba(203,157,84,0.08); }
.lead-row td { padding: 12px 16px; white-space: nowrap; }
.empty-state { text-align: center; padding: 48px 16px !important; color: #64748b; font-size: 14px; }
.empty-state i { font-size: 32px; display: block; margin-bottom: 12px; }

/* BADGES */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 600; letter-spacing: 0.03em;
}
.badge-por_contactar { background: rgba(59,130,246,0.2); color: #60a5fa; }
.badge-en_proceso { background: rgba(245,158,11,0.2); color: #fbbf24; }
.badge-cliente { background: rgba(16,185,129,0.2); color: #34d399; border: 1px solid rgba(16,185,129,0.3); }
.badge-completado { background: rgba(16,185,129,0.2); color: #34d399; }
.badge-archivado { background: rgba(100,116,139,0.2); color: #94a3b8; }
.badge-plan-investigacion { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }
.badge-plan-combo { background: rgba(203,157,84,0.2); color: #e2bd75; border: 1px solid rgba(203,157,84,0.3); }
.badge-repeat { background: rgba(139,92,246,0.2); color: #a78bfa; border: 1px solid rgba(139,92,246,0.3); font-size: 0.7rem; padding: 2px 6px; border-radius: 10px; margin-left: 6px; font-weight: 600; }
.badge-tx-pagado { background: rgba(16,185,129,0.2); color: #34d399; }
.badge-tx-pendiente { background: rgba(245,158,11,0.2); color: #fbbf24; }

/* TIME COLORS */
.time-green { color: #10b981; font-weight: 600; }
.time-yellow { color: #f59e0b; font-weight: 600; }
.time-red { color: #ef4444; font-weight: 700; }

/* WHATSAPP LINK */
.wa-link { color: #25d366; text-decoration: none; transition: opacity 0.15s; }
.wa-link:hover { opacity: 0.8; }

/* DOCS INDICATOR */
.docs-indicator { display: inline-flex; gap: 3px; }
.doc-dot-filled { font-size: 7px; color: #10b981; }
.doc-dot-empty { font-size: 7px; color: #334155; }
.docs-none { color: #475569; font-size: 12px; }

/* ACTION BUTTONS */
.btn-action {
    width: 32px; height: 32px; border: none; border-radius: 8px;
    cursor: pointer; font-size: 13px; transition: all 0.15s;
    display: inline-flex; align-items: center; justify-content: center;
    margin: 0 2px;
}
.btn-wa { background: rgba(37,211,102,0.15); color: #25d366; }
.btn-wa:hover { background: rgba(37,211,102,0.3); }
.btn-contact { background: rgba(59,130,246,0.15); color: #60a5fa; }
.btn-contact:hover { background: rgba(59,130,246,0.3); }
.btn-archive { background: rgba(100,116,139,0.15); color: #94a3b8; }
.btn-archive:hover { background: rgba(100,116,139,0.3); }
.btn-approve { background: rgba(16,185,129,0.15); color: #34d399; }
.btn-approve:hover { background: rgba(16,185,129,0.3); }
.btn-reject { background: rgba(239,68,68,0.15); color: #f87171; }
.btn-reject:hover { background: rgba(239,68,68,0.3); }
.btn-restore { background: rgba(99,102,241,0.15); color: #818cf8; }
.btn-restore:hover { background: rgba(99,102,241,0.3); }

/* EXPANDED PANEL */
.expanded-panel-row td { padding: 0 !important; background: #0f172a; }
.panel-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 20px; padding: 20px 24px;
}
@media (max-width: 768px) { .panel-grid { grid-template-columns: 1fr; } }
.panel-section {
    background: #1e293b; border-radius: 12px; padding: 16px;
    border: 1px solid rgba(148,163,184,0.1);
}
.panel-section h4 { font-size: 13px; font-weight: 700; color: #cbd5e1; margin-bottom: 12px; }
.panel-section h4 i { color: #cb9d54; margin-right: 6px; }
.panel-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 2px; }
.field-label { font-size: 10px; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; }
.field span:not(.field-label) { font-size: 13px; }
.session-id { font-family: monospace; color: #cb9d54; font-size: 12px !important; }
.text-muted { color: #475569; font-size: 13px; }

/* DOCS GRID */
.docs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.doc-slot {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; border-radius: 8px;
    background: rgba(203,157,84,0.08); border: 1px solid rgba(203,157,84,0.15);
    color: #e2bd75; text-decoration: none; font-size: 12px;
    transition: all 0.15s;
}
.doc-slot:hover { background: rgba(203,157,84,0.15); border-color: rgba(203,157,84,0.3); }
.doc-slot i { font-size: 16px; flex-shrink: 0; }
.doc-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-slot-ok { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.2); }
.doc-slot-ok:hover { background: rgba(16,185,129,0.15); border-color: rgba(16,185,129,0.3); }
.doc-check { color: #10b981; font-size: 12px; margin-left: auto; }
.doc-slot-pending {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; border-radius: 8px; font-size: 12px;
    background: rgba(100,116,139,0.08); border: 1px dashed rgba(100,116,139,0.3);
    color: #64748b; cursor: default;
}

/* SUB-TABLE (payments) */
.sub-table { width: 100%; font-size: 12px; }
.sub-table th { color: #64748b; text-align: left; padding: 6px 8px; font-weight: 600; text-transform: uppercase; font-size: 10px; }
.sub-table td { padding: 6px 8px; border-top: 1px solid rgba(148,163,184,0.08); }

/* NOTAS */
.notas-container { max-height: 200px; overflow-y: auto; margin-bottom: 8px; }
.nota-item { padding: 8px 0; border-bottom: 1px solid rgba(148,163,184,0.08); }
.nota-content { font-size: 13px; margin-bottom: 4px; }
.nota-meta { display: flex; justify-content: space-between; align-items: center; }
.nota-meta span { font-size: 11px; color: #64748b; }
.btn-delete-nota { background: none; border: none; color: #64748b; cursor: pointer; font-size: 12px; }
.btn-delete-nota:hover { color: #ef4444; }
.nota-input-row { display: flex; gap: 8px; }
.nota-input {
    flex: 1; background: #0f172a; border: 1px solid #334155; border-radius: 8px;
    padding: 8px 12px; font-size: 13px; color: #f8fafc;
}
.nota-input:focus { outline: none; border-color: #cb9d54; }
.btn-add-nota { background: rgba(203,157,84,0.15); color: #cb9d54; border: none; border-radius: 8px; width: 36px; cursor: pointer; }
.btn-add-nota:hover { background: rgba(203,157,84,0.3); }

/* NOTIFICATION OPTIONS (SweetAlert) */
.notif-options { text-align: left; }
.notif-options p { margin-bottom: 12px; color: #94a3b8; font-size: 14px; }
.notif-btn {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 10px 14px; margin-bottom: 8px;
    border-radius: 8px; border: none; cursor: pointer;
    font-size: 13px; font-weight: 500; text-decoration: none;
    transition: opacity 0.15s;
}
.notif-btn:hover { opacity: 0.85; }
.notif-wa { background: rgba(37,211,102,0.15); color: #25d366; }
.notif-wa-partner { background: rgba(37,211,102,0.1); color: #22c55e; }
.notif-email { background: rgba(99,102,241,0.15); color: #818cf8; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* NOTAS LOADING */
.notas-loading { text-align: center; padding: 12px; color: #64748b; }
