/* CRM Imobiliário - Estilos Especializados */
.crm-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.crm-header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

.crm-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.crm-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.crm-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.crm-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.crm-stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.crm-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.crm-stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
}

.crm-stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.crm-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .crm-sections {
        grid-template-columns: 1fr;
    }
}

.crm-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    min-height: 400px;
}

.crm-section-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.crm-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.crm-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.crm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.crm-btn.secondary {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
}

.crm-btn.success {
    background: linear-gradient(45deg, #48dbfb, #0abde3);
}

/* Property Cards */
.property-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.property-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.property-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.property-title {
    font-weight: bold;
    color: #333;
    font-size: 1.1rem;
}

.property-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
}

.property-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-available {
    background: #d4edda;
    color: #155724;
}

.status-sold {
    background: #f8d7da;
    color: #721c24;
}

.status-reserved {
    background: #fff3cd;
    color: #856404;
}

.status-rented {
    background: #cce5ff;
    color: #004085;
}

.property-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 10px 0;
    font-size: 0.9rem;
    color: #666;
}

.property-detail {
    display: flex;
    align-items: center;
    gap: 5px;
}

.property-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.property-action-btn {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.property-action-btn:hover {
    background: #f8f9fa;
    border-color: #667eea;
    color: #667eea;
}

/* Client Cards */
.client-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.client-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.client-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.client-name {
    font-weight: bold;
    color: #333;
    font-size: 1.1rem;
}

.client-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-lead {
    background: #e3f2fd;
    color: #1565c0;
}

.status-active {
    background: #e8f5e8;
    color: #2e7d32;
}

.status-visiting {
    background: #fff3e0;
    color: #f57c00;
}

.status-negotiating {
    background: #fce4ec;
    color: #c2185b;
}

.client-contact {
    display: flex;
    gap: 15px;
    margin: 8px 0;
    font-size: 0.9rem;
    color: #666;
}

.client-info {
    margin: 10px 0;
    font-size: 0.9rem;
    color: #666;
}

.client-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

/* Visit Cards */
.visit-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #667eea;
}

.visit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.visit-date-time {
    font-weight: bold;
    color: #333;
}

.visit-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-scheduled {
    background: #e3f2fd;
    color: #1565c0;
}

.status-completed {
    background: #e8f5e8;
    color: #2e7d32;
}

.status-cancelled {
    background: #ffebee;
    color: #c62828;
}

.visit-details {
    margin: 10px 0;
    font-size: 0.9rem;
    color: #666;
}

.visit-feedback {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    font-style: italic;
    color: #666;
}

/* Negotiation Cards */
.negotiation-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #ff6b6b;
}

.negotiation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.negotiation-type {
    font-weight: bold;
    color: #333;
}

.negotiation-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-ongoing {
    background: #fff3e0;
    color: #f57c00;
}

.status-closed {
    background: #e8f5e8;
    color: #2e7d32;
}

.status-failed {
    background: #ffebee;
    color: #c62828;
}

.price-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin: 10px 0;
    text-align: center;
}

.price-item {
    padding: 8px;
    border-radius: 5px;
    background: #f8f9fa;
}

.price-label {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 3px;
}

.price-value {
    font-weight: bold;
    color: #333;
}

/* Search and Filters */
.crm-search-container {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.crm-search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.crm-search-group {
    display: flex;
    flex-direction: column;
}

.crm-search-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
}

.crm-search-input,
.crm-search-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
}

.crm-search-input:focus,
.crm-search-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.crm-search-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Modal Styles */
.crm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.crm-modal-content {
    background: white;
    border-radius: 15px;
    padding: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.crm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.crm-modal-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.crm-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.crm-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

@media (max-width: 768px) {
    .crm-form-grid {
        grid-template-columns: 1fr;
    }
}

.crm-form-group {
    display: flex;
    flex-direction: column;
}

.crm-form-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
}

.crm-form-input,
.crm-form-select,
.crm-form-textarea {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
}

.crm-form-textarea {
    resize: vertical;
    min-height: 80px;
}

.crm-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .crm-title {
        font-size: 2rem;
    }
    
    .crm-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .crm-dashboard {
        grid-template-columns: 1fr;
    }
    
    .crm-controls {
        justify-content: center;
    }
    
    .crm-btn {
        font-size: 0.9rem;
        padding: 8px 16px;
    }
}

/* Dark theme adjustments */
[data-theme="dark"] .crm-section,
[data-theme="dark"] .property-card,
[data-theme="dark"] .client-card,
[data-theme="dark"] .visit-card,
[data-theme="dark"] .negotiation-card,
[data-theme="dark"] .crm-search-container,
[data-theme="dark"] .crm-modal-content {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

[data-theme="dark"] .crm-form-input,
[data-theme="dark"] .crm-form-select,
[data-theme="dark"] .crm-form-textarea,
[data-theme="dark"] .crm-search-input,
[data-theme="dark"] .crm-search-select {
    background: #4a5568;
    border-color: #718096;
    color: #e2e8f0;
}

[data-theme="dark"] .property-title,
[data-theme="dark"] .client-name,
[data-theme="dark"] .visit-date-time,
[data-theme="dark"] .negotiation-type {
    color: #e2e8f0;
}
