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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    padding: 20px;
}

.container {
    margin: 0 auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #4d0c30 0%, #4b75a2 100%);
    color: white;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

header h1 {
    font-size: 28px;
    font-weight: 600;
}

.controls {
    display: flex;
    gap: 10px;
}

.nav-btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.dashboard {
    padding: 20px;
    overflow-x: auto;
    overflow-y: visible;
    min-height: 100vh;
}

.legend {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    padding: 10px 15px;
    background-color: #f9f9f9;
    border-radius: 4px;
    border-left: 3px solid #667eea;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    display: inline-block;
}

.legend-color.holiday {
    background-color: #ff4444;
}

.color-block {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    display: inline-block;
}

.week-header {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.week-column-header {
    width: 45px;
    min-width: 45px;
    max-width: 45px;
    text-align: center;
    padding: 5px 0;
    font-weight: 600;
    font-size: 10px;
    color: #666;
    border-right: 1px solid #eee;
    flex-shrink: 0;
    box-sizing: border-box;
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.timeline-row {
    display: flex;
    gap: 0;
    align-items: stretch;
}

.row-label {
    min-width: 320px;
    padding: 10px 12px;
    background-color: #f9f9f9;
    border-right: 2px solid #ddd;
    font-weight: 500;
    font-size: 12px;
    color: #333;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-shrink: 0;
}

.row-label-container {
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    padding: 6px 8px;
    background-color: #f9f9f9;
    border-right: 2px solid #ddd;
    font-weight: 500;
    font-size: 12px;
    color: #333;
    display: flex;
    gap: 5px;
    align-items: flex-start;
    flex-shrink: 0;
    min-height: 32px;
    overflow: visible;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
    position: relative;
}

.row-label.editable-label {
    cursor: text;
}

.row-label.editable-label:hover {
    background-color: #fffacd;
}

.row-label.editable-label:focus {
    background-color: #fffacd;
    outline: 1px solid #FFD700;
}

.delete-subproject-btn {
    background: transparent;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-subproject-btn:hover {
    color: #ff4444;
}

.row-label.category {
    background-color: #FFD700;
    color: black;
    font-weight: 600;
}

.row-label.category-header {
    background-color: #FFD700;
    color: black;
    font-weight: 600;
    font-size: 13px;
}

.row-label.category-header.category-intern {
    background-color: #87CEEB;
    color: white;
}

.row-label.category-header.category-services {
    background-color: #90EE90;
    color: black;
}

.category-header-row {
    margin-top: 15px;
    margin-bottom: 0;
}

.row-label.category-intern {
    background-color: #87CEEB;
    color: white;
    font-weight: 600;
}

.row-label.category-services {
    background-color: #90EE90;
    color: black;
    font-weight: 600;
}

.row-content {
    display: flex;
    flex: 1;
    gap: 0;
}

.row-content.category-bar {
    border: none !important;
}

.row-content.category-bar > div {
    border: none !important;
}

.day-cell {
    width: 45px;
    min-width: 45px;
    max-width: 45px;
    border-right: 1px solid #eee;
    padding: 4px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    position: relative;
    font-size: 9px;
    background-color: white;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
    outline: none;
    box-sizing: border-box;
}

.day-cell[contenteditable="true"] {
    cursor: text;
}

.day-cell[contenteditable="true"]:hover {
    background-color: #fffacd;
}

.day-cell[contenteditable="true"]:focus {
    background-color: #fffacd;
    outline: 1px solid #FFD700;
}

.day-cell-toggle {
    cursor: pointer;
    user-select: none;
}

.day-cell-toggle:hover {
    background-color: #e8f4f8;
    font-weight: bold;
}

.add-row-btn {
    margin-top: 10px;
    transition: all 0.2s ease;
}

.add-row-btn:hover {
    opacity: 0.8;
}

.add-row-btn:hover .row-label {
    background-color: #e8e8e8;
    color: #333;
}

.day-cell.weekend {
    background-color: #e8e8e8;
}

.day-cell:not(.weekend):not(.holiday):not(.vacation):not(.travel):not(.active):hover {
    background-color: #f0f0f0;
}

.day-cell.holiday {
    background-color: #FFB6C1;
    font-weight: 600;
}

.day-cell.active {
    background-color: #87CEEB;
    font-weight: 500;
}

.day-cell.travel {
    background-color: #FFD700;
    font-weight: 500;
}

.day-cell.vacation {
    background-color: #90EE90;
    font-weight: 500;
}

.day-marker {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    background-color: rgba(0, 0, 0, 0.1);
}

.project-info {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
    text-align: center;
}

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



@media (max-width: 1200px) {
    .day-cell {
        min-width: 45px;
        font-size: 11px;
    }

    .week-column-header {
        min-width: 45px;
        font-size: 11px;
    }
}

@media (max-width: 768px) {
    .dashboard {
        padding: 15px;
    }

    .row-label {
        min-width: 150px;
        font-size: 12px;
    }

    .day-cell {
        min-width: 30px;
        font-size: 10px;
    }

    header {
        flex-direction: column;
        text-align: center;
    }

    .controls {
        width: 100%;
        justify-content: center;
    }
}
