* {
    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: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

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

.controls {
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.control-group {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.file-input-wrapper {
    position: relative;
    display: inline-block;
    margin-right: 15px;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-input-button {
    background: linear-gradient(135deg, #6f42c1 0%, #5a2d91 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(111, 66, 193, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 200px;
    justify-content: center;
}

.file-input-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(111, 66, 193, 0.4);
    background: linear-gradient(135deg, #7952cc 0%, #6239a3 100%);
}

.file-input-button:active {
    transform: translateY(0);
}

.file-upload-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.file-selected {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.file-selected:hover {
    background: linear-gradient(135deg, #2eb85c 0%, #26d0ce 100%);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.shift-config {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 2px solid #e9ecef;
}

.shift-config h3 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.time-config-group {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.time-config-group h4 {
    color: #6c757d;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.time-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.time-input {
    padding: 8px 12px;
    border: 2px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    width: 90px;
    text-align: center;
}

.time-input:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.time-label {
    font-weight: 600;
    color: #495057;
}

.config-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn-config {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    box-shadow: 0 3px 10px rgba(23, 162, 184, 0.3);
}

.btn-config:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(23, 162, 184, 0.4);
}

.config-status {
    color: #28a745;
    font-weight: 600;
    display: none;
}

.clock-icon {
    width: 24px;
    height: 24px;
    fill: #4a90e2;
}

.file-name-display {
    margin-top: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
    color: #495057;
    border-left: 4px solid #28a745;
    display: none;
}

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

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
    border-left: 4px solid #4a90e2;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.stat-card:nth-child(1) { border-left-color: #28a745; }
.stat-card:nth-child(2) { border-left-color: #007bff; }
.stat-card:nth-child(3) { border-left-color: #fd7e14; }
.stat-card:nth-child(4) { border-left-color: #6f42c1; }
.stat-card:nth-child(5) { border-left-color: #20c997; }
.stat-card:nth-child(6) { border-left-color: #e83e8c; }
.stat-card:nth-child(7) { border-left-color: #ffc107; }
.stat-card:nth-child(8) { border-left-color: #dc3545; }
.stat-card:nth-child(9) { border-left-color: #17a2b8; }
.stat-card:nth-child(10) { border-left-color: #6c757d; }
.stat-card:nth-child(11) { border-left-color: #343a40; }
.stat-card:nth-child(12) { border-left-color: #28a745; }

.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: #4a90e2;
    margin-bottom: 8px;
}

.stat-card:nth-child(1) .stat-number { color: #28a745; }
.stat-card:nth-child(2) .stat-number { color: #007bff; }
.stat-card:nth-child(3) .stat-number { color: #fd7e14; }
.stat-card:nth-child(4) .stat-number { color: #6f42c1; }
.stat-card:nth-child(5) .stat-number { color: #20c997; }
.stat-card:nth-child(6) .stat-number { color: #e83e8c; }
.stat-card:nth-child(7) .stat-number { color: #ffc107; }
.stat-card:nth-child(8) .stat-number { color: #dc3545; }
.stat-card:nth-child(9) .stat-number { color: #17a2b8; }
.stat-card:nth-child(10) .stat-number { color: #6c757d; }
.stat-card:nth-child(11) .stat-number { color: #343a40; }
.stat-card:nth-child(12) .stat-number { color: #28a745; }

.stat-card div:last-child {
    font-size: 0.9em;
    color: #6c757d;
    font-weight: 600;
}

.stat-highlight {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(32, 201, 151, 0.1) 100%);
}

.stat-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 152, 0, 0.1) 100%);
}

.stat-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(255, 87, 87, 0.1) 100%);
}

.calendar-container {
    padding: 30px;
}

.month-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
}

.month-title {
    font-size: 2em;
    color: #2c3e50;
    font-weight: 300;
}

.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    background: #dee2e6;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.calendar-header {
    background: #495057;
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: 600;
}

.calendar-day {
    background: white;
    padding: 15px;
    min-height: 120px;
    border: 1px solid #f8f9fa;
    position: relative;
    transition: all 0.3s;
}

.calendar-day:hover {
    background: #f8f9fa;
    transform: scale(1.02);
}

.calendar-day.weekend {
    background: #e3f2fd;
}

.calendar-day.other-month {
    color: #adb5bd;
    background: #f8f9fa;
}

.day-number {
    font-weight: bold;
    margin-bottom: 8px;
    color: #2c3e50;
}

.shift-info {
    font-size: 0.85em;
    line-height: 1.3;
}

.shift-time {
    color: #6c757d;
    margin-bottom: 5px;
    font-weight: 600;
}

.shift-person {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    margin: 2px 0;
    font-size: 0.8em;
}

.shift-person.network {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.shift-person.backup {
    background: linear-gradient(135deg, #ffc107 0%, #ff8f00 100%);
    border-left: 3px solid #ff6f00;
}

.shift-person.override {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    border-left: 3px solid #ef6c00;
}

.shift-person.emergency {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    border-left: 3px solid #c62828;
    color: white;
}

.assignment-warning {
    background: #fff3cd;
    color: #856404;
    padding: 10px;
    border-radius: 6px;
    margin: 5px 0;
    font-size: 0.85em;
    border-left: 4px solid #ffc107;
}

.assignment-info {
    background: #d1ecf1;
    color: #0c5460;
    padding: 8px;
    border-radius: 4px;
    margin: 3px 0;
    font-size: 0.8em;
    border-left: 3px solid #17a2b8;
}

.day-stats {
    font-size: 0.7em;
    color: #6c757d;
    margin-top: 5px;
    font-style: italic;
}

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

.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 20px 40px rgba(0,0,0,0.3);
}

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

.close:hover {
    color: #000;
}

.workload-summary {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.employee-workload {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    border-left: 4px solid #dc3545;
}

.warning-message {
    background: #fff3cd;
    color: #856404;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    border-left: 4px solid #ffc107;
    white-space: pre-line;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    border-left: 4px solid #28a745;
}

@media (max-width: 768px) {
    .calendar {
        grid-template-columns: 1fr;
    }
    
    .control-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .month-header {
        flex-direction: column;
        text-align: center;
    }

    .file-input-wrapper {
        margin-right: 0;
        margin-bottom: 15px;
        width: 100%;
    }

    .file-input-button {
        width: 100%;
        min-width: auto;
    }

    .time-config-grid {
        grid-template-columns: 1fr;
    }

    .time-inputs {
        justify-content: center;
    }

    .config-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-config {
        width: 100%;
        margin-bottom: 10px;
    }

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

    .stat-card {
        padding: 15px;
    }

    .stat-number {
        font-size: 1.5em;
    }

    .stat-card div:last-child {
        font-size: 0.8em;
    }
}

@media (max-width: 480px) {
    .stats {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-number {
        font-size: 1.3em;
    }

    .stat-card div:last-child {
        font-size: 0.75em;
        line-height: 1.2;
    }
}