/* Agent Referral Manager Styles */

/* Smaller logo for agent portal */
.navbar .logo img {
    height: 35px !important;
    width: auto;
}

.manager-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 100px 20px 40px;
    min-height: calc(100vh - 200px);
}

.manager-header {
    text-align: center;
    margin-bottom: 60px;
}

.manager-header h1 {
    font-size: 2.5rem;
    color: #0A2540;
    margin-bottom: 10px;
}

.manager-header h1 i {
    color: #C9A961;
    margin-right: 10px;
}

.manager-header p {
    font-size: 1.1rem;
    color: #666;
}

/* Login Section */
.login-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    max-width: 450px;
    width: 100%;
}

.login-card h2 {
    color: #0A2540;
    margin-bottom: 10px;
}

.login-card p {
    color: #666;
    margin-bottom: 30px;
}

/* Dashboard Section */
.dashboard-section {
    animation: fadeIn 0.3s ease-in;
}

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

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.agent-info h2 {
    color: #0A2540;
    margin: 0;
}

.agent-info p {
    color: #666;
    margin: 5px 0 0 0;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: #F0F0F0;
    color: #666;
}

.stat-icon.active {
    background: #FFF3CD;
    color: #856404;
}

.stat-icon.success {
    background: #D4EDDA;
    color: #155724;
}

.stat-icon.pending {
    background: #D1ECF1;
    color: #0C5460;
}

.stat-info h3 {
    font-size: 2rem;
    color: #0A2540;
    margin: 0 0 5px 0;
}

.stat-info p {
    color: #666;
    margin: 0;
    font-size: 0.9rem;
}

/* Referrals Section */
.referrals-section {
    margin-top: 40px;
}

.referrals-section h2 {
    color: #0A2540;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.referrals-section h2 i {
    color: #C9A961;
    margin-right: 10px;
}

.referrals-list {
    display: grid;
    gap: 20px;
}

/* Referral Card */
.referral-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.3s;
}

.referral-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.referral-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #F0F0F0;
}

.referral-title {
    flex: 1;
}

.referral-title h3 {
    color: #0A2540;
    margin: 0 0 10px 0;
    font-size: 1.5rem;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-accepted {
    background: #FFF3CD;
    color: #856404;
}

.status-contacted {
    background: #D1ECF1;
    color: #0C5460;
}

.status-appointment_set {
    background: #D4EDDA;
    color: #155724;
}

.status-listed {
    background: #CCE5FF;
    color: #004085;
}

.status-pending {
    background: #F8D7DA;
    color: #721C24;
}

.status-closed {
    background: #D4EDDA;
    color: #155724;
}

.status-paid {
    background: #C9E8D4;
    color: #0A5826;
}

.btn-update {
    background: #C9A961;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-update:hover {
    background: #B39651;
    transform: translateY(-2px);
}

.btn-update i {
    margin-right: 5px;
}

/* Referral Details */
.referral-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-row .label {
    color: #666;
    font-weight: 600;
    min-width: 140px;
}

.detail-row .label i {
    margin-right: 5px;
    color: #C9A961;
}

.referral-contact {
    background: #F8F9FA;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.referral-contact h4 {
    color: #0A2540;
    margin: 0 0 10px 0;
}

.referral-contact h4 i {
    color: #C9A961;
    margin-right: 5px;
}

.referral-contact p {
    margin: 5px 0;
    color: #333;
}

.referral-contact a {
    color: #0A2540;
    text-decoration: none;
    font-weight: 600;
}

.referral-contact a:hover {
    color: #C9A961;
}

.referral-description {
    background: #F0F7FF;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #C9A961;
}

.referral-description h4 {
    color: #0A2540;
    margin: 0 0 10px 0;
}

.referral-description h4 i {
    color: #C9A961;
    margin-right: 5px;
}

.referral-description p {
    color: #333;
    line-height: 1.6;
    margin: 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
}

.empty-state i {
    font-size: 4rem;
    color: #C9A961;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: #0A2540;
    margin-bottom: 10px;
}

.empty-state p {
    color: #666;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background: white;
    margin: 50px auto;
    padding: 0;
    width: 90%;
    max-width: 700px;
    border-radius: 12px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.2);
    animation: slideDown 0.3s;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    background: #0A2540;
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    margin: 0;
    color: white;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.close-modal:hover {
    transform: rotate(90deg);
}

#updateForm {
    padding: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #0A2540;
    font-weight: 600;
}

/* Hide the email label in login form */
#loginForm .form-group label {
    display: none;
}

/* Hide labels in update modal form EXCEPT date fields */
#updateModal .form-group label {
    display: none;
}

/* Show labels for date fields */
#updateModal .form-group label[for="contactDate"],
#updateModal .form-group label[for="nextActionDate"],
#updateModal .form-group label[for="expectedCloseDate"] {
    display: block;
    margin-bottom: 4px;
    color: #0A2540;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Style for helper text under date labels */
#updateModal .form-group small {
    font-size: 0.875rem;
    font-weight: 400;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'DM Sans', sans-serif;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #C9A961;
}

.form-group textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: #C9A961;
    color: white;
}

.btn-primary:hover {
    background: #B39651;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Responsive */
@media (max-width: 768px) {
    .manager-header h1 {
        font-size: 2rem;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .referral-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .referral-details {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px auto;
    }
}
