body {
    font-family: Arial, sans-serif;
    font-size: 14px;
    margin: 0;
    padding: 20px;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
}

h1, h2 {
    color: #007bff;
}

a, .back-link {
    color: #007bff;
    text-decoration: none;
}

a:hover, .back-link:hover {
    text-decoration: underline;
    color: #0056b3;
}

button, .button, input[type=submit], .back-link {
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 5px;
    background-color: #007BFF;
    color: white;
    border: 1px solid #007bff;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    text-align: center;
    display: inline-block;
    margin: 5px 0; /* Applies to all buttons and button-like links */
}

button:hover, .button:hover, input[type=submit]:hover, .back-link:hover {
    background-color: #0056b3;
}

input[type=text], input[type=checkbox] {
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
}

/* Specific styles */
.button-clear {
    background-color: #dc3545;
    border-color: #dc3545;
}

.button-clear:hover {
    background-color: #c82333;
}

/* Container styles */
.container, .team-selection-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    max-width: 800px;
    margin: 20px auto;
}

.team-selection-container {
    max-width: 400px; /* Override for specific container */
}

/* Worker list styles */
.workers-list, .completed-works-list, .team-members-list {
    list-style-type: none;
    padding-left: 0;
    margin: 20px 0;
}

.worker-item, .completed-work-item, .team-member-item {
    background: #e9e9e9;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 5px;
}

.worker-item:nth-child(even), .completed-work-item:nth-child(even), .team-member-item:nth-child(even) {
    background: #f9f9f9;
}

/* Tree list styles */
.tree-list, .nested-list, .nested-list-lvl1, .nested-list-lvl2 {
    list-style-type: none;
    padding-left: 0;
}

.nested-list, .nested-list-lvl1, .nested-list-lvl2 {
    display: none;
}

.toggle-button, .toggle-button-lvl1, .toggle-button-lvl2 {
    margin-right: 5px;
    background-color: #f0f0f0;
    color: #333;
}

.toggle-button.active, .toggle-button-lvl1.active, .toggle-button-lvl2.active {
    background-color: #007bff;
    color: white;
}

/* Стили для темной темы */
@media (prefers-color-scheme: dark) {
    body, h1, h2 {
        color: #FFFFFF;
    }

    body {
        background-color: #121212;
    }

    button, .button, input[type=submit], input[type=text], .back-link {
        background-color: #BB86FC;
        color: #121212;
    }

    button:hover, .button:hover, input[type=submit]:hover, .back-link:hover {
        background-color: #3700B3;
        color: #FFFFFF;
    }

    a, .back-link {
        color: #BB86FC;
    }

    a:hover, .back-link:hover {
        color: #FFFFFF;
        text-decoration: underline;
    }

    input[type=text], input[type=checkbox] {
        background-color: #333;
        border-color: #BB86FC;
        color: #FFF;
    }

    .container, .team-selection-container {
        background-color: #242424;
        box-shadow: 0 2px 5px rgba(255,255,255,0.1);
    }

    /* Обновленные стили для элементов списка в темной теме */
    .worker-item, .completed-work-item, .team-member-item, .worker-item label {
        background-color: #424242;
        color: #FFF;
        border: none;
    }

    .worker-item:nth-child(even), .completed-work-item:nth-child(even), .team-member-item:nth-child(even) {
        background-color: #333;
    }
}

/* Адаптивные стили */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    h1, h2 {
        font-size: 18px;
    }

    button, .button, input[type=submit] {
        font-size: 14px;
    }

    input[type=text], input[type=checkbox] {
        font-size: 14px;
    }

    .container, .team-selection-container {
        padding: 15px;
        max-width: 100%;
    }
}