* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 2.5rem;
    color: #1e3c72;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.file-upload {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.file-upload-area {
    border: 3px dashed #2a5298;
    border-radius: 10px;
    padding: 40px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    background: #f8f9ff;
    border-color: #1e3c72;
}

.file-upload-area.dragover {
    background: #e8f2ff;
    border-color: #1e3c72;
    transform: scale(1.02);
}

.file-input {
    display: none;
}

.upload-icon {
    font-size: 3rem;
    color: #2a5298;
    margin-bottom: 15px;
}

.upload-text {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 10px;
}

.upload-subtext {
    color: #666;
    font-size: 0.9rem;
}

.file-info {
    background: #e8f5e8;
    border: 1px solid #4caf50;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    text-align: left;
}

.exclusions-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: none;
}

.exclusions-section.visible {
    display: block;
}

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

.exclusions-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: #1e3c72;
}

.client-search {
    position: relative;
    width: 300px;
}

.client-search input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
}

.client-search input:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.search-dropdown.visible {
    display: block;
}

.search-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-item:hover {
    background: #f8f9ff;
}

.search-item:last-child {
    border-bottom: none;
}

.excluded-clients {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 50px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

.excluded-client-tag {
    background: #dc3545;
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.excluded-client-tag .remove-btn {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background 0.2s ease;
}

.excluded-client-tag .remove-btn:hover {
    background: rgba(255, 255, 255, 0.5);
}

.excluded-placeholder {
    color: #999;
    font-style: italic;
    align-self: center;
}

.client-item.excluded {
    opacity: 0.5;
    background: #f5f5f5;
    border-left-color: #999;
    text-decoration: line-through;
}

.exclusion-stats {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    font-size: 0.9rem;
    color: #666;
}

.import-export-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: none;
}

.import-export-section.visible {
    display: block;
}

.import-export-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.import-export-btn {
    padding: 10px 20px;
    border: 2px solid #2a5298;
    background: white;
    color: #2a5298;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.import-export-btn:hover {
    background: #2a5298;
    color: white;
    transform: translateY(-2px);
}

.import-export-btn.primary {
    background: #2a5298;
    color: white;
}

.import-export-btn.primary:hover {
    background: #1e3c72;
}

.controls {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: none;
}

.controls.visible {
    display: block;
}

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

.control-group {
    display: flex;
    flex-direction: column;
}

.control-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.control-group input, .control-group select {
    padding: 10px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.control-group input:focus, .control-group select:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

.strategy-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.strategy-btn {
    padding: 12px 24px;
    border: 2px solid #2a5298;
    background: white;
    color: #2a5298;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 180px;
}

.strategy-btn:hover {
    background: #2a5298;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(42, 82, 152, 0.3);
}

.strategy-btn.active {
    background: #2a5298;
    color: white;
}

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

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #2a5298;
}

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

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

.teams-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.team-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.team-card:hover {
    transform: translateY(-5px);
}

.team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.team-title {
    font-size: 1.4rem;
    font-weight: bold;
    color: #1e3c72;
}

.team-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.team-stat {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.team-stat-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: #2a5298;
}

.team-stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 2px;
}

.client-list {
    max-height: 300px;
    overflow-y: auto;
}

.client-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: #f8f9fc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.client-item:hover {
    background: #e8f2ff;
    border-left-color: #2a5298;
    transform: translateX(5px);
}

.client-item.high-touch {
    border-left-color: #dc3545;
}

.client-item.medium-touch {
    border-left-color: #ffc107;
}

.client-item.low-touch {
    border-left-color: #28a745;
}

.client-name {
    font-weight: 600;
    color: #333;
}

.client-score {
    font-size: 0.9rem;
    color: #666;
}

.touch-badge {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
}

.touch-badge.high {
    background: #ffeaea;
    color: #dc3545;
}

.touch-badge.medium {
    background: #fff8e1;
    color: #ff8f00;
}

.touch-badge.low {
    background: #e8f5e8;
    color: #28a745;
}

.recommendation {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

.recommendation h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.recommendation-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.pros-cons {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
}

.pros-cons h4 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.pros-cons ul {
    list-style: none;
}

.pros-cons li {
    margin-bottom: 5px;
    padding-left: 20px;
    position: relative;
}

.pros-cons li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #4caf50;
    font-weight: bold;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #333;
}

.client-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.detail-group {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
}

.detail-label {
    font-weight: bold;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.detail-value {
    font-size: 1.1rem;
    color: #333;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2a5298;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background: #ffebee;
    border: 1px solid #e57373;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    color: #c62828;
}

.success-message {
    background: #e8f5e8;
    border: 1px solid #4caf50;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    color: #2e7d32;
}

.client-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.team-card.drag-over {
    border: 3px dashed #2a5298;
    background: #f8f9ff;
    transform: scale(1.02);
}

.drag-handle {
    cursor: move;
    color: #999;
    margin-right: 8px;
    font-size: 1.2rem;
}

.drag-handle:hover {
    color: #2a5298;
}

.manual-allocation-indicator {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    color: #856404;
    display: none;
}

.manual-allocation-indicator.visible {
    display: block;
}

.reset-allocation-btn {
    background: #6c757d;
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 15px;
}

.reset-allocation-btn:hover {
    background: #545b62;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .controls-grid {
        grid-template-columns: 1fr;
    }
    
    .strategy-buttons {
        flex-direction: column;
    }
    
    .teams-container {
        grid-template-columns: 1fr;
    }
    
    .recommendation-content {
        grid-template-columns: 1fr;
    }
}
