/* Handymanes CRM Admin Styles */
.hm-crm-wrap {
    margin: 20px 20px 0 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1e293b;
}

.hm-crm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 20px 25px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
}

.hm-crm-title-area h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hm-badge-pro {
    font-size: 12px;
    background: #0a84ff;
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.hm-crm-subtitle {
    margin: 5px 0 0 0;
    color: #64748b;
    font-size: 13px;
}

.hm-crm-header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.hm-badge-role {
    background: #10b981;
    color: white;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
}

.hm-badge-montador {
    background: #f59e0b;
}

/* KPIs */
.hm-kpis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.hm-kpi-card {
    background: white;
    padding: 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    border-left: 4px solid #0a84ff;
    transition: transform 0.2s ease;
}

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

.hm-kpi-warning { border-left-color: #f59e0b; }
.hm-kpi-info { border-left-color: #8b5cf6; }
.hm-kpi-success { border-left-color: #10b981; }

.hm-kpi-icon {
    font-size: 30px;
}

.hm-kpi-val {
    display: block;
    font-size: 26px;
    font-weight: 700;
    color: #0f172a;
}

.hm-kpi-label {
    font-size: 13px;
    color: #64748b;
}

/* Filtros */
.hm-filters-bar {
    background: white;
    padding: 16px 20px;
    border-radius: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    margin-bottom: 20px;
}

.hm-input, .hm-select {
    padding: 9px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.hm-input:focus, .hm-select:focus {
    border-color: #0a84ff;
}

.hm-input { min-width: 250px; }

/* Botones */
.hm-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    border: none;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hm-btn-primary { background: #0a84ff; color: white; }
.hm-btn-primary:hover { background: #0070e0; }

.hm-btn-secondary { background: #f1f5f9; color: #334155; }
.hm-btn-secondary:hover { background: #e2e8f0; }

.hm-btn-text { background: transparent; color: #64748b; }
.hm-btn-text:hover { color: #0f172a; text-decoration: underline; }

.hm-btn-sm { padding: 4px 8px; font-size: 11px; border-radius: 6px; }
.hm-btn-whatsapp { background: #25d366; color: white; text-decoration: none; }
.hm-btn-whatsapp:hover { background: #20ba5a; }
.hm-btn-danger { background: #ef4444; color: white; }
.hm-btn-danger:hover { background: #dc2626; }

/* Tabla */
.hm-table-container {
    background: white;
    border-radius: 16px;
    overflow-x: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.hm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.hm-table th {
    background: #f8fafc;
    color: #475569;
    padding: 14px 18px;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
}

.hm-table td {
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.hm-table tr:hover {
    background: #f8fafc;
}

.hm-lead-name {
    font-weight: 600;
    color: #0f172a;
    display: block;
}

.hm-lead-contact {
    font-size: 11px;
    color: #64748b;
}

/* Badges de Estado */
.hm-status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}

.status-por_contactar { background: #dbeafe; color: #1e40af; }
.status-en_espera_ruta { background: #fef3c7; color: #92400e; }
.status-contactado { background: #ede9fe; color: #6b21a8; }
.status-presupuestado { background: #ffedd5; color: #9a3412; }
.status-asignado { background: #cffafe; color: #155e75; }
.status-trabajo_realizado { background: #d1fae5; color: #065f46; }
.status-descartado_bot { background: #f1f5f9; color: #64748b; text-decoration: line-through; }

/* Modal Estilo Dark Glassmorphism */
.hm-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.hm-modal-content {
    background-color: #1e293b;
    color: #f8fafc;
    border: 1px solid #334155;
    margin: 4% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 820px;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.65);
    position: relative;
    box-sizing: border-box;
}

.hm-modal-content h2,
.hm-modal-content h3 {
    color: #ffffff !important;
    font-weight: 700;
}

.hm-modal-content p,
.hm-modal-content span,
.hm-modal-content label {
    color: #cbd5e1;
}

.hm-modal-content strong {
    color: #ffffff;
}

.hm-modal-close {
    position: absolute;
    right: 25px;
    top: 20px;
    font-size: 30px;
    font-weight: bold;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
}

.hm-modal-close:hover { 
    color: #ffffff;
    transform: scale(1.15);
}

.hm-info-card {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 16px;
    color: #f8fafc;
}

.hm-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.hm-photo-thumb {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #334155;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

.hm-photo-thumb:hover { 
    transform: scale(1.03); 
    border-color: #0a84ff;
}

/* Formularios en Modales de Creación */
.hm-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 640px) {
    .hm-form-row {
        grid-template-columns: 1fr;
    }
}

.hm-form-group {
    margin-bottom: 16px;
}

.hm-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 6px;
}

.hm-form-control {
    width: 100%;
    padding: 10px 14px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.hm-form-control:focus {
    border-color: #0a84ff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.25);
}

.hm-btn-success {
    background: #10b981;
    color: #ffffff;
}

.hm-btn-success:hover {
    background: #059669;
}
