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

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

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 25px;
}

h1 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #1e2a3a;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* ─── Фильтры ─── */
.filter-area {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 25px;
    padding: 15px 0;
    border-bottom: 1px solid #e2e8f0;
}

.filter-area label {
    font-weight: 600;
    color: #2d3748;
}

.filter-area select,
.filter-area input {
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid #cbd5e0;
    font-size: 14px;
    background: #fff;
}

.filter-area select {
    min-width: 160px;
}

.filter-area input {
    min-width: 200px;
}

/* ─── Таблица ─── */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th {
    background: #2d3748;
    color: #fff;
    padding: 12px 10px;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 10;
}

td {
    padding: 10px;
    border-bottom: 1px solid #edf2f7;
    vertical-align: middle;
}

tr:hover td {
    background: #f7fafc;
}

/* ─── Бейджи статусов ─── */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 12px;
    text-align: center;
    min-width: 40px;
}

.badge-danger  { background: #fed7d7; color: #9b2c2c; }
.badge-warning { background: #fefcbf; color: #975a16; }
.badge-success { background: #c6f6d5; color: #276749; }

/* ─── Кнопка «Подробнее» ─── */
.btn-detail {
    background: #3182ce;
    color: #fff;
    border: none;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-detail:hover {
    background: #2b6cb0;
}

.count-cell {
    font-weight: 600;
    text-align: center;
}

/* ─── Модальное окно ─── */
#modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

#modal.active {
    display: flex;
}

#modalContent {
    background: #fff;
    max-width: 700px;
    width: 95%;
    max-height: 85vh;
    border-radius: 12px;
    padding: 25px 30px;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    position: relative;
}

#closeModal {
    position: sticky;
    top: 0;
    float: right;
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    color: #718096;
    transition: color 0.2s;
}

#closeModal:hover {
    color: #1a202c;
}

#modalEmployee {
    margin-bottom: 20px;
    font-size: 22px;
    color: #1a202c;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

/* ─── Список тренировок в модалке ─── */
.training-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.training-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 6px;
    background: #f7fafc;
    border-left: 4px solid #a0aec0;
}

.training-item .status {
    font-weight: 600;
}

.status-done     { border-left-color: #48bb78; }
.status-progress { border-left-color: #ecc94b; background: #fffff0; }
.status-notdone  { border-left-color: #fc8181; background: #fff5f5; }

/* ─── Спойлер категорий ─── */
.category-title {
    font-weight: 700;
    margin: 12px 0 6px 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-title .count-badge {
    font-size: 13px;
    font-weight: 400;
    background: #e2e8f0;
    padding: 0 10px;
    border-radius: 12px;
}

.spoiler-btn {
    background: #edf2f7;
    border: none;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    margin: 8px 0;
}

.spoiler-btn:hover {
    background: #e2e8f0;
}

.spoiler-content {
    display: none;
    margin-top: 8px;
}

.spoiler-content.open {
    display: block;
}

/* ─── Итоги в модалке ─── */
.summary-row {
    margin-top: 15px;
    display: flex;
    gap: 25px;
    font-weight: 600;
    padding: 12px;
    background: #edf2f7;
    border-radius: 8px;
    flex-wrap: wrap;
}

.summary-row span { margin-right: 10px; }

.text-danger  { color: #9b2c2c; }
.text-warning { color: #975a16; }
.text-success { color: #276749; }

.no-data {
    text-align: center;
    padding: 40px;
    color: #718096;
    font-size: 16px;
}

/* ─── Адаптив ─── */
@media (max-width: 768px) {
    .filter-area { flex-direction: column; align-items: stretch; }
    table { font-size: 12px; }
    th, td { padding: 6px 4px; }
}

/* ─── Авторизация ─── */
.auth-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.auth-box {
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.auth-box h1 {
    justify-content: center;
    margin-bottom: 10px;
}

.auth-hint {
    color: #718096;
    margin-bottom: 20px;
    font-size: 16px;
}

.pin-input {
    width: 100%;
    padding: 14px;
    font-size: 24px;
    text-align: center;
    letter-spacing: 8px;
    border: 2px solid #cbd5e0;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s;
}

.pin-input:focus {
    border-color: #3182ce;
}

.pin-btn {
    margin-top: 15px;
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: #3182ce;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.pin-btn:hover {
    background: #2b6cb0;
}

.pin-error {
    color: #e53e3e;
    margin-top: 12px;
    font-size: 14px;
    min-height: 20px;
}

/* ─── Выбор смены ─── */
.shift-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.shift-btn {
    padding: 16px;
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    background: #edf2f7;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.shift-btn:hover {
    background: #3182ce;
    color: #fff;
    border-color: #3182ce;
}

/* ─── Кнопки статуса в модалке ─── */
.btn-mark-done {
    background: #3182ce;
    color: #fff;
    border: none;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-mark-done:hover {
    background: #2b6cb0;
}

.btn-undo {
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-undo:hover {
    background: #cbd5e0;
}

/* ─── Кнопка логов ─── */
.btn-logs {
    background: #718096;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-logs:hover {
    background: #4a5568;
}

/* ─── Логи ─── */
.logs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.logs-table th {
    background: #4a5568;
    padding: 10px 8px;
    text-align: left;
}

.logs-table td {
    padding: 8px;
    border-bottom: 1px solid #edf2f7;
}

.logs-table tr:hover td {
    background: #f7fafc;
}

/* ─── Модалка логов ─── */
#logsModal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

#logsModal.active {
    display: flex;
}

#logsModalContent {
    background: #fff;
    max-width: 900px;
    width: 95%;
    max-height: 85vh;
    border-radius: 12px;
    padding: 25px 30px;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    position: relative;
}

#closeLogsModal {
    position: sticky;
    top: 0;
    float: right;
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    color: #718096;
    transition: color 0.2s;
}

#closeLogsModal:hover {
    color: #1a202c;
}
