/* Общие стили */

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

h2, h3 {
    text-align: center;
    color: #444;
}

/* Контейнеры */
.login-container, .dashboard-container, .tasks-container, .users-container, .requests-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px;
    margin: 20px;
}

/* Формы */
form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: #f1f1f1;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

label {
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 5px;
}

input[type="text"], input[type="email"], input[type="password"], textarea, select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 0.9rem;
    transition: border-color 0.3s;
}

input:focus, textarea:focus, select:focus {
    border-color: #007BFF;
    outline: none;
}

button {
    padding: 12px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 1rem;
}

button:hover {
    background-color: #0056b3;
}

/* Таблицы */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.9rem;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #007BFF;
    color: white;
    font-weight: bold;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

tr:hover {
    background-color: #f1f1f1;
}

/* Кнопки и ссылки */
a {
    color: #007BFF;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #0056b3;
}

.logout-button, .back-button {
    display: inline-block;
    padding: 8px 12px;
    background-color: #dc3545;
    color: white;
    border-radius: 5px;
    text-align: center;
    margin: 10px 0;
}

.logout-button:hover, .back-button:hover {
    background-color: #c82333;
}

/* Сообщения об ошибках */
.error {
    color: #d9534f;
    background-color: #f2dede;
    border: 1px solid #ebccd1;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    font-size: 0.85rem;
}
.task-row {
    background-color: #f9f9f9;
}


.task-info {
    flex: 1; /* Заполняет доступное пространство */
    padding-right: 10px;
    font-weight: bold;
    word-break: break-word;
}

.task-actions {
    display: flex;
    gap: 10px; /* Расстояние между кнопками */
    align-items: center;
    flex-shrink: 0;
}

.action-btn {
    padding: 8px 12px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    text-decoration: none;
}

.action-btn:hover {
    background-color: #0056b3;
}

.comment-form {
    margin: 10px 0;
    padding: 10px;
    background-color: #f1f1f1;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.comment-form textarea {
    width: 100%;
    height: 60px;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ccc;
    resize: vertical;
}

.comment-form button {
    margin-top: 5px;
    padding: 8px 12px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.comment-form button:hover {
    background-color: #218838;
}
.hidden {
    display: none;
}
/* Модальное окно */
.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: #fff;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
}

/* Иконки-кнопки */
.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.5;
    transition: opacity 0.3s;
    padding: 4px;
}
.icon-btn:hover {
    opacity: 1;
}


/* Таблицы */
.checklist-container table {
    width: 100%;
    max-width: 800px;
    margin: auto;
    border-collapse: collapse;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.checklist-container th, .checklist-container td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

/* Вложенная таблица задач */
.checklist-container table .task-row td {
    vertical-align: middle;
}

/* Скрытие разворачиваемой части */
.hidden {
    display: none;
}
/* Объединённая таблица чек-листов */
.checklist-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}


.task-subtable {
    width: 100%;
    border-collapse: collapse;
}


.task-block.hidden {
    display: none;
}

.task-row.completed {
    opacity: 0.5;
    background-color: #f1f1f1;
}

.task-row.pending {
    background-color: #fff9e6;
}

/* Иконки */
.icon-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    opacity: 0.5;
    cursor: pointer;
    transition: 0.2s;
    padding: 4px;
}
.icon-btn:hover {
    opacity: 1;
}

/* Модальное окно */
.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: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
}

.modal-content textarea {
    width: 100%;
    min-height: 80px;
    margin-top: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    padding: 10px;
}

.modal-content button {
    margin-top: 10px;
    padding: 10px 15px;
    border: none;
    background: #007BFF;
    color: white;
    border-radius: 5px;
    cursor: pointer;
}
.modal-content button:hover {
    background: #0056b3;
}
.task-wrapper {
    width: 100%;
    overflow-x: auto;
}

.task-subtable {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin: 0;
}



-----------

/* Единая таблица чек-листов и задач */
.checklist-table,
.task-subtable {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin: 0;
}

/* Заголовки и ячейки */
.checklist-table th,
.checklist-table td,
.task-subtable th,
.task-subtable td {
    padding: 10px 12px;
    border: 1px solid #ccc;
    text-align: left;
    vertical-align: middle;
    word-wrap: break-word;
}

/* Заголовок основной таблицы */
.checklist-table th {
    background-color: #007bff;
    color: white;
}

/* Заголовок подтаблицы (задачи) */
.task-subtable th {
    background-color: #0056b3;
    color: white;
}

/* Визуальный стиль строк */
.month-row {
    background-color: #f8f9fa;
    font-weight: bold;
}

.task-block td {
    padding: 0;
    border: none;
}

/* Состояния задач */
.task-row.completed {
    background-color: #f1f1f1;
    opacity: 0.7;
}

.task-row.pending {
    background-color: #fffce8;
}
/* Убираем внешние отступы и делаем таблицы идентичными */
.task-block td {
    padding: 0;
    border: none;
}

/* Вложенная таблица задач — точно как основная */
.task-subtable {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

/* Чтобы ширина была строго как у .checklist-table */
.checklist-table,
.task-subtable {
    min-width: 100%;
}
.task-block td[colspan="4"] {
    padding: 0;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}