/* Sales Pipeline Page Styles */

.pipeline-section {
    min-height: 100vh;
    padding: 120px 0 4rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%, #dee2e6 100%);
    position: relative;
    overflow: hidden;
}

/* Pipeline Header */
.pipeline-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: var(--bg-white);
    border-radius: 20px;
    border: 2px solid var(--primary-color);
    box-shadow: var(--shadow-xl), var(--shadow-blue);
}

.pipeline-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-weight: 800;
}

.pipeline-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Pipeline Statistics */
.pipeline-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-medium);
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.stat-card i {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.stat-card:nth-child(1) i {
    background: rgba(0, 86, 179, 0.1);
    color: #0056b3;
}

.stat-card:nth-child(2) i {
    background: rgba(200, 162, 74, 0.1);
    color: var(--primary-color);
}

.stat-card:nth-child(3) i {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.stat-card:nth-child(4) i {
    background: rgba(23, 162, 184, 0.1);
    color: #17a2b8;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-dark);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Pipeline Board Container */
.pipeline-board-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-white);
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.pipeline-board-container h3 {
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

/* Pipeline Board - Kanban Style */
.pipeline-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.pipeline-stage {
    background: var(--bg-light);
    border-radius: 12px;
    border: 2px solid var(--border-color);
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.stage-header {
    padding: 1rem;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid transparent;
}

.stage-header h4 {
    margin: 0;
    color: var(--bg-white);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stage-header i {
    font-size: 1.1rem;
}

.stage-count {
    background: rgba(255, 255, 255, 0.3);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--bg-white);
}

.lead-header {
    background: #6c757d;
    border-bottom-color: #5a6268;
}

.contacted-header {
    background: #17a2b8;
    border-bottom-color: #138496;
}

.proposal-header {
    background: #ffc107;
    border-bottom-color: #e0a800;
}

.negotiation-header {
    background: #fd7e14;
    border-bottom-color: #e56b00;
}

.won-header {
    background: #28a745;
    border-bottom-color: #218838;
}

.lost-header {
    background: #dc3545;
    border-bottom-color: #c82333;
}

.stage-deals {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
    max-height: 600px;
}

.deal-card {
    background: var(--bg-white);
    padding: 1rem;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    margin-bottom: 1rem;
    cursor: grab;
    transition: all 0.3s ease;
}

.deal-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.deal-card:active {
    cursor: grabbing;
}

.deal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.deal-name {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 1rem;
    margin: 0;
}

.deal-client {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.deal-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.deal-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.probability-badge {
    background: rgba(200, 162, 74, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
}

.expected-revenue {
    font-weight: 700;
    color: #28a745;
}

.deal-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.btn-deal-action {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    transition: all 0.3s ease;
}

.btn-edit {
    background: var(--primary-color);
    color: var(--bg-white);
}

.btn-edit:hover {
    background: var(--primary-dark);
}

.btn-delete-deal {
    background: #dc3545;
    color: white;
}

.btn-delete-deal:hover {
    background: #c82333;
}

/* Deals Table */
.deals-table-container {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 20px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.deals-table-container h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.deals-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
}

.deals-table thead {
    background: var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.deals-table th {
    padding: 1rem;
    text-align: left;
    border: 1px solid var(--border-color);
    color: var(--bg-white);
    font-weight: 700;
    white-space: nowrap;
}

.deals-table td {
    padding: 1rem;
    border: 1px solid var(--border-color);
    color: var(--text-dark);
}

.deals-table tbody tr {
    transition: all 0.3s ease;
}

.deals-table tbody tr:hover {
    background: rgba(200, 162, 74, 0.05);
}

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

.stage-badge.lead {
    background: #6c757d;
    color: white;
}

.stage-badge.contacted {
    background: #17a2b8;
    color: white;
}

.stage-badge.proposal {
    background: #ffc107;
    color: #000;
}

.stage-badge.negotiation {
    background: #fd7e14;
    color: white;
}

.stage-badge.won {
    background: #28a745;
    color: white;
}

.stage-badge.lost {
    background: #dc3545;
    color: white;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    overflow-y: auto;
}

.modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #FFFFFF;
    border-radius: 20px;
    border: 2px solid var(--primary-color);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

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

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: var(--primary-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    transition: all 0.3s ease;
}

.close-btn:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

#dealForm {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: #0B1A2A;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group label i {
    color: var(--primary-color);
    width: 20px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: #FFFFFF;
    color: #000000;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.3s ease;
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(200, 162, 74, 0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #666666;
    opacity: 1;
    font-weight: 600;
}

.form-group input:-ms-input-placeholder,
.form-group textarea:-ms-input-placeholder {
    color: #666666;
    font-weight: 600;
}

.form-group input::-ms-input-placeholder,
.form-group textarea::-ms-input-placeholder {
    color: #666666;
    font-weight: 600;
}

.form-group input[readonly],
.form-group textarea[readonly] {
    background: var(--bg-medium);
    cursor: not-allowed;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.modal-actions button {
    flex: 1;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Responsive */
@media (max-width: 1024px) {
    .pipeline-board {
        grid-template-columns: 1fr;
    }
    
    .pipeline-stage {
        min-height: 200px;
    }
}

@media (max-width: 768px) {
    .pipeline-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pipeline-board-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .deals-table {
        min-width: 800px;
        font-size: 0.85rem;
    }
}
