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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 40px;
}

.section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 25px;
    border: 1px solid #e0e0e0;
}

.section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.section h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.25em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

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

label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

input[type="text"],
input[type="date"],
select,
.date-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="date"]:focus,
select:focus,
.date-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

button {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: background 0.3s;
}

button:hover {
    background: #764ba2;
}

button.secondary {
    background: #e0e0e0;
    color: #333;
}

button.secondary:hover {
    background: #d0d0d0;
}

button.danger {
    background: #dc3545;
}

button.danger:hover {
    background: #c82333;
}

button.success {
    background: #28a745;
}

button.success:hover {
    background: #218838;
}

.list-item {
    background: white;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #667eea;
}

.list-item.male {
    border-left-color: #0066ff;
}

.list-item.female {
    border-left-color: #ff1493;
}

.item-content {
    flex: 1;
}

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

.item-info {
    font-size: 0.9em;
    color: #666;
    margin-top: 4px;
}

.item-actions {
    display: flex;
    gap: 8px;
}

.item-actions button {
    padding: 6px 12px;
    font-size: 0.9em;
}

.full-width {
    grid-column: 1 / -1;
}

.performance-item {
    background: white;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    border-left: 4px solid #28a745;
}

.performance-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.performance-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
}

.dancer-assignment {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 10px;
}

.dancer-group h4 {
    color: #667eea;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.assigned-dancers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dancer-badge {
    background: #667eea;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    display: inline-block;
}

.dancer-badge.male {
    background: #0066ff;
}

.dancer-badge.female {
    background: #ff1493;
}

.dancer-badge.unavailable {
    background: #ffc107;
    color: #333;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.button-group button {
    flex: 1;
}

.unavailability-list {
    margin-top: 15px;
}

.unavailability-item {
    background: white;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
}

.date-range {
    color: #666;
}

.stats {
    background: white;
    padding: 15px;
    border-radius: 4px;
    margin-top: 15px;
    border-left: 4px solid #ffc107;
}

.stats h4 {
    color: #333;
    margin-bottom: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 0.9em;
}

.stat-label {
    color: #666;
}

.stat-value {
    font-weight: 600;
    color: #333;
}

.empty-state {
    text-align: center;
    padding: 20px;
    color: #999;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.modal-actions button {
    flex: 1;
}

@media (max-width: 1024px) {
    .content {
        grid-template-columns: 1fr;
    }
}

.flatpickr-calendar {
    box-shadow: 0 3px 13px rgba(0, 0, 0, 0.08);
    border-radius: 4px;
}

.assignment-button {
    padding: 4px 16px;
    font-size: 0.8em;
    border-radius: 10px;
}

.refresh-icon {
    display: inline-block;
    margin-left: 5px;
}

.color-picker-group {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

input[type="color"] {
    width: 50px;
    height: 44px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.location-item {
    background: white;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.location-color-box {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    margin-right: 10px;
}

.location-name {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gender-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.gender-section h4 {
    color: #667eea;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.gender-section.male h4 {
    color: #0066ff;
    border-bottom-color: #0066ff;
}

.gender-section.female h4 {
    color: #ff1493;
    border-bottom-color: #ff1493;
}

.dancer-item {
    background: white;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 4px;
    border-left: 3px solid #667eea;
}

.dancer-item.male {
    border-left-color: #0066ff;
}

.dancer-item.female {
    border-left-color: #ff1493;
}

.dancer-item-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dancer-item-name {
    font-weight: 500;
}

.dancer-item-actions button {
    padding: 4px 10px;
    font-size: 0.85em;
}

.dancer-badge-clickable {
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s;
}

.dancer-badge-clickable:hover {
    border: 2px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

.swap-modal-option {
    background: white;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid #e0e0e0;
    transition: all 0.2s;
}

.swap-modal-option:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

.swap-modal-option.unavailable {
    opacity: 0.6;
}

.download-upload-section {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.download-upload-section button {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    font-size: 0.9em;
}

.export-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.performance-expandable {
    cursor: pointer;
    user-select: none;
}

.performance-expandable:hover {
    background: #f5f5f5;
}

.expand-icon {
    display: inline-block;
    transition: transform 0.3s;
    margin-right: 8px;
}

.performance-expandable.expanded .expand-icon {
    transform: rotate(180deg);
}

.dancer-pool {
    margin-top: 15px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.dancer-column {
    background: #f0f0f0;
    padding: 15px;
    border-radius: 6px;
}

.dancer-column h5 {
    margin-bottom: 12px;
    font-size: 0.95em;
    color: #333;
}

.dancer-in-pool {
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    background: white;
    font-size: 0.9em;
}

.dancer-in-pool:hover {
    transform: translateX(4px);
}

.dancer-in-pool.assigned {
    background: #e3f2fd;
    border-left: 4px solid #0066ff;
}

.dancer-in-pool.assigned.female {
    background: #fce4ec;
    border-left: 4px solid #ff1493;
}

.dancer-in-pool.available {
    background: white;
    border: 2px solid #e0e0e0;
}

.dancer-in-pool.available:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

.dancer-in-pool.unavailable {
    background: #fff3cd;
    opacity: 0.7;
    cursor: not-allowed;
}

.dancer-in-pool.selected {
    border: 2px solid #667eea;
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.3);
}

.swap-arrow {
    position: fixed;
    pointer-events: none;
    z-index: 999;
}

.unavailability-reason {
    font-size: 0.8em;
    color: #999;
    margin-top: 2px;
}

.all-unavailabilities {
    background: #fff9e6;
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
    border-left: 4px solid #ffc107;
}

.unavailability-entry {
    padding: 8px;
    margin-bottom: 6px;
    background: white;
    border-radius: 4px;
    font-size: 0.9em;
}

.unavailability-entry strong {
    color: #333;
}

.unavailability-entry .date-range {
    color: #666;
}

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

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

    .dancer-pool {
        grid-template-columns: 1fr;
    }
}