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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

#backgroundCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 50px;
    color: #333;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    animation: fadeInDown 0.8s ease;
    color: #000000;
}

header .subtitle {
    font-size: 1.2em;
    opacity: 0.9;
    animation: fadeInUp 0.8s ease;
    color: white;
}

.step-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: fadeInUp 0.6s ease;
    backdrop-filter: blur(10px);
}

.step-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.step-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #D52B1E 0%, #A01F15 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
    margin-right: 15px;
}

.step-header h2 {
    color: #333;
    font-size: 1.8em;
}

.upload-area {
    border: 3px dashed #D52B1E;
    border-radius: 10px;
    padding: 50px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(213, 43, 30, 0.05);
}

.upload-area:hover {
    border-color: #A01F15;
    background: rgba(118, 75, 162, 0.1);
    transform: scale(1.02);
}

.upload-area.dragover {
    border-color: #A01F15;
    background: rgba(118, 75, 162, 0.2);
}

.upload-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.upload-text {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 20px;
}

.btn {
    padding: 12px 30px;
    font-size: 1em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, #D52B1E 0%, #A01F15 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(213, 43, 30, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(213, 43, 30, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #D52B1E 0%, #A01F15 100%);
    color: white;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(213, 43, 30, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(213, 43, 30, 0.5);
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    margin-left: 10px;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(245, 87, 108, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #ffa726 0%, #ff6f00 100%);
    color: white;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 167, 38, 0.4);
}

.file-info {
    margin-top: 20px;
    padding: 20px;
    background: rgba(213, 43, 30, 0.1);
    border-radius: 8px;
    border-left: 4px solid #D52B1E;
}

.file-info p {
    margin: 8px 0;
    color: #333;
}

.hint {
    color: #666;
    margin-bottom: 20px;
    font-size: 1.05em;
}

.minimums-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.minimum-item {
    padding: 15px;
    background: rgba(213, 43, 30, 0.05);
    border-radius: 8px;
    border: 2px solid rgba(213, 43, 30, 0.2);
}

.minimum-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.minimum-item input {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.minimum-item input:focus {
    outline: none;
    border-color: #D52B1E;
}

.legend {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(213, 43, 30, 0.05);
    border-radius: 8px;
}

.legend h3 {
    margin-bottom: 15px;
    color: #333;
}

.legend-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
}

.color-box {
    width: 30px;
    height: 30px;
    border-radius: 5px;
    margin-right: 10px;
    border: 1px solid #ddd;
}

.color-red {
    background: #ffcccc;
}

.color-yellow {
    background: #fff9cc;
}

.color-white {
    background: white;
}

.color-green {
    background: #ccffcc;
}

.table-controls {
    margin-bottom: 20px;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#resultsTable {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

#resultsTable th {
    background: #D52B1E;
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

#resultsTable td {
    padding: 12px 15px;
    border: 1px solid #ddd;
}

#resultsTable tbody tr:hover {
    background: rgba(213, 43, 30, 0.05);
}

.cell-red {
    background-color: #ffcccc !important;
}

.cell-yellow {
    background-color: #fff9cc !important;
}

.cell-white {
    background-color: white !important;
}

.cell-green {
    background-color: #ccffcc !important;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Loading spinner */
.loading {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #D52B1E;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Room cards */
.room-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

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

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

.room-header h3 {
    color: #D52B1E;
    margin: 0;
    font-size: 1.4em;
}

.room-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f0f0f0;
}

.btn-icon:hover {
    transform: scale(1.1);
}

.btn-open:hover {
    background: #D52B1E;
}

.btn-delete:hover {
    background: #ff6b6b;
}

.room-details p {
    margin: 8px 0;
    color: #666;
}

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

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: fadeInUp 0.3s ease;
}

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

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

.modal-close {
    font-size: 2em;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 30px;
}

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

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

.modal-body .form-group input,
.modal-body .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
}

.modal-body .form-group input:focus,
.modal-body .form-group textarea:focus {
    outline: none;
    border-color: #D52B1E;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 2px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    background: linear-gradient(135deg, #D52B1E 0%, #A01F15 100%);
    border-radius: 8px;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(213, 43, 30, 0.3);
}

.back-link:hover {
    background: linear-gradient(135deg, #A01F15 0%, #D52B1E 100%);
    transform: translateX(-5px);
    box-shadow: 0 6px 20px rgba(213, 43, 30, 0.5);
}

/* Animations */
@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* Header with dates */
header {
    background: linear-gradient(135deg, #D52B1E 0%, #A01F15 100%);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(213, 43, 30, 0.3);
    margin-bottom: 30px;
    color: white;
}

/* AXES logo */
.axes-logo {
    height: 50px;
    filter: brightness(0) invert(1); /* Белый в светлой теме */
}

.axes-logo:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease; /* Анимация только при hover */
}

header h1 {
    color: white;
    margin: 0;
}

header small {
    color: rgba(255,255,255,0.9) !important;
}

header strong {
    color: white !important;
}

/* End date editing */
#endDateInput {
    background: white;
    border: 2px solid #D52B1E;
    color: #333;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.95em;
    transition: all 0.3s ease;
}

#endDateInput:focus {
    outline: none;
    border-color: #A01F15;
    box-shadow: 0 0 0 3px rgba(213, 43, 30, 0.2);
}

#saveEndDateBtn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.3);
}

#saveEndDateBtn:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f8a5d 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}

#cancelEndDateBtn {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(245, 101, 101, 0.3);
}

#cancelEndDateBtn:hover {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.4);
}

.edit-date-btn {
    background: none;
    border: none;
    color: rgba(213, 43, 30, 0.8);
    cursor: pointer;
    font-size: 1.2em;
    margin-left: 10px;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 4px;
}

.edit-date-btn:hover {
    color: #D52B1E;
    background: rgba(213, 43, 30, 0.1);
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }
    
    .step-card {
        padding: 20px;
    }
    
    .minimums-container {
        grid-template-columns: 1fr;
    }
    
    .legend-items {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .room-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .room-actions {
        margin-top: 10px;
    }
}

