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

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f4f6f9;
    color: #2c3e50;
}

/* ── Навигация ─────────────────────────── */
.navbar {
    display: flex;
    align-items: center;
    background: #2c3e50;
    padding: 0 24px;
    height: 56px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
    position: relative;
    z-index: 100;
}

.brand {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
    margin-right: 40px;
}

.nav-menu {
    display: flex;
    list-style: none;
    height: 100%;
}

.nav-item {
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
}

.nav-link {
    color: #dfe6ed;
    text-decoration: none;
    padding: 0 18px;
    line-height: 56px;
    display: block;
    transition: background .2s;
}

.nav-link:hover {
    background: #34495e;
    color: #fff;
}

/* ── Выпадающее меню ───────────────────── */
.dropdown-menu {
    list-style: none;
    position: absolute;
    top: 56px;
    left: 0;
    min-width: 220px;
    background: #fff;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all .2s ease;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 12px 18px;
    color: #2c3e50;
    text-decoration: none;
    border-bottom: 1px solid #eef1f4;
    transition: background .15s;
}

.dropdown-menu li:last-child a {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background: #eaf1f8;
    color: #1a6bb5;
}

/* ── Контент ───────────────────────────── */
.content {
    max-width: 1500px;
    margin: 32px auto;
    padding: 0 24px;
}

.content h1 {
    margin-bottom: 20px;
    font-size: 26px;
}

/* ── Таблица ───────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.data-table th {
    background: #2c3e50;
    color: #fff;
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #eef1f4;
}

.data-table tbody tr:hover {
    background: #f5f9fd;
}

.empty {
    color: #7f8c8d;
    font-style: italic;
}

/* ── Кнопки ────────────────────────────── */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, transform .1s;
}

.btn-primary {
    background: #1a6bb5;
    color: #fff;
    margin-bottom: 20px;
}

.btn-primary:hover {
    background: #155a99;
}

.btn-secondary {
    background: #eef1f4;
    color: #2c3e50;
}

.btn-secondary:hover {
    background: #dde4ea;
}

.btn:active {
    transform: scale(.98);
}

.required {
    color: #e74c3c;
}

/* ── Модальное окно ────────────────────── */
.modal-toggle {
    display: none;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s;
    z-index: 200;
}

.modal-toggle:checked ~ .modal-overlay {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(44, 62, 80, .55);
    cursor: pointer;
}

.modal {
    position: relative;
    background: #fff;
    border-radius: 10px;
    padding: 28px 32px;
    width: 420px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .25);
    transform: translateY(16px) scale(.97);
    transition: transform .25s ease;
}

.modal-toggle:checked ~ .modal-overlay .modal {
    transform: translateY(0) scale(1);
}

.modal h2 {
    margin-bottom: 20px;
    font-size: 20px;
    color: #2c3e50;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 26px;
    line-height: 1;
    color: #95a5a6;
    cursor: pointer;
    transition: color .2s;
}

.modal-close:hover {
    color: #2c3e50;
}

/* ── Форма ─────────────────────────────── */
.form-group {
    margin-bottom: 14px;
}

.form-group label,
.form-check label {
    display: block;
    font-size: 14px;
    color: #5d6d7e;
    margin-bottom: 5px;
}

.form-group input[type="text"],
.form-group input[type="date"] {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d5dbe1;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color .2s, box-shadow .2s;
}

.form-group input:focus {
    outline: none;
    border-color: #1a6bb5;
    box-shadow: 0 0 0 3px rgba(26, 107, 181, .15);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.form-check input {
    width: 16px;
    height: 16px;
}

.form-check label {
    margin-bottom: 0;
}

/* ── Кнопки окна ───────────────────────── */
.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

.modal-actions .btn {
    margin-bottom: 0;
    flex: 0 0 auto;
}

.form-group input[type="date"]:disabled {
    background: #f4f6f9;
    color: #a5b1bb;
    cursor: not-allowed;
}

/* ── Кликабельное имя в таблице ────────── */
.edit-name {
    cursor: pointer;
    color: #1a6bb5;
}

.edit-name:hover {
    text-decoration: underline;
}

/* ── Удаление ──────────────────────────── */
.delete-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    color: #c0392b;
    cursor: pointer;
    transition: background .2s, color .2s;
    user-select: none;
}

.delete-icon:hover {
    background: #fdecea;
    color: #e74c3c;
}

.confirm-text {
    margin-bottom: 8px;
    color: #5d6d7e;
    line-height: 1.5;
}

.btn-danger {
    background: #c0392b;
    color: #fff;
}

.btn-danger:hover {
    background: #a93226;
}

/* ── Фильтры графика ───────────────────── */
.filter-bar {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;   /* прижат влево */
    gap: 20px;
    margin-bottom: 28px;          /* отступ только снизу */
    padding: 18px 24px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
    max-width: 1010px;              /* чтобы не растягивался на весь экран */
}

.filter-item {
    display: flex;
    flex-direction: column;
}

.filter-item label {
    font-size: 13px;
    color: #5d6d7e;
    margin-bottom: 5px;
    text-align: left;              /* подпись строго слева */
}

.filter-item select {
    padding: 9px 14px;
    border: 1px solid #d5dbe1;
    border-radius: 6px;
    font-size: 15px;
    min-width: 190px;
    background: #fff;
    color: #2c3e50;
    transition: border-color .2s, box-shadow .2s;
}

.filter-item select:hover {
    border-color: #9fb6cb;
}

.filter-item select:focus {
    outline: none;
    border-color: #1a6bb5;
    box-shadow: 0 0 0 3px rgba(26, 107, 181, .15);
}

.btn-filter {
    margin-bottom: 0;
    padding: 9px 24px;
}

/* ── Таблицы графика ───────────────────── */
.calendar-block {
    margin-bottom: 32px;
}

.calendar-block h2 {
    font-size: 18px;
    margin-bottom: 12px;
}

.calendar-wrap {
    overflow-x: auto;
}

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
    font-size: 13px;
}

.calendar-table th {
    background: #2c3e50;
    color: #fff;
    padding: 8px 6px;
    text-align: center;
    font-weight: 600;
    min-width: 30px;
}

.calendar-table .emp-col {
    text-align: left;
    padding: 8px 12px;
    min-width: 170px;
    white-space: nowrap;
}

.calendar-table td {
    padding: 8px 6px;
    border-bottom: 1px solid #eef1f4;
    text-align: center;
}

.calendar-table tbody tr:hover {
    background: #f5f9fd;
}

.shift-cell {
    font-weight: 600;
    color: #1a6bb5;
}

.empty + .btn {
    margin-top: 8px;
}

/* ── Страница создания графика ─────────── */
.hint {
    color: #5d6d7e;
    font-size: 14px;
    margin-bottom: 16px;
}

.employee-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
    margin-bottom: 28px;
}

.check-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 15px;
    cursor: pointer;
}

.check-item input {
    width: 17px;
    height: 17px;
    accent-color: #1a6bb5;
}

.employee-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
    padding: 18px 22px;
    margin-bottom: 20px;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card-head h3 {
    margin: 0;
    font-size: 17px;
}

.add-shift-form {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    margin-bottom: 14px;
}

.add-shift-form .form-group {
    margin-bottom: 0;
}

.add-shift-form input,
.add-shift-form select {
    padding: 9px 12px;
    border: 1px solid #d5dbe1;
    border-radius: 6px;
    font-size: 15px;
}

.shifts-list {
    width: 100%;
    max-width: 420px;
    border-collapse: collapse;
    font-size: 14px;
}

.shifts-list th {
    text-align: left;
    color: #5d6d7e;
    font-size: 13px;
    padding: 6px 10px;
    border-bottom: 2px solid #eef1f4;
}

.shifts-list td {
    padding: 7px 10px;
    border-bottom: 1px solid #eef1f4;
}
/* ── Создание графика ─────────────────── */
.search-bar {
    max-width: 420px;
    margin-bottom: 20px;
}

.search-bar input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d5dbe1;
    border-radius: 8px;
    font-size: 15px;
}

.search-bar input:focus {
    outline: none;
    border-color: #1a6bb5;
    box-shadow: 0 0 0 3px rgba(26, 107, 181, .15);
}
/* ── Кнопки действий на странице создания графика ─────────── */
.create-actions {
    display: flex;
    align-items: flex-start;;
    gap: 12px;
    margin-bottom: 24px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    height: 48px;
    line-height: 1;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #1a6bb5;
    color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
    background-color: #145692;
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background-color: #cccccc;
    color: #888888;
    cursor: not-allowed;
    transform: none;
}

.btn-outline {
    background-color: transparent;
    color: #2c3e50;
    border: 2px solid #d5dbe1;
}

.btn-outline:hover:not(:disabled) {
    background-color: #f5f9fd;
    border-color: #1a6bb5;
    color: #1a6bb5;
}

.calendar-table .cell-select {
    width: 100%;
    padding: 4px 2px;
    border: none;
    background: transparent;
    text-align: center;
    font-weight: 600;
    color: #1a6bb5;
    font-size: 13px;
    cursor: pointer;
}

.calendar-table .cell-select:focus {
    outline: none;
    background: #f5f9fd;
}

.emp-col .remove-emp {
    color: #c0392b;
    text-decoration: none;
    font-weight: 600;
    margin-left: 6px;
}

.emp-col .remove-emp:hover {
    color: #96281b;
}

.shift-cell {
    position: relative;
    height: 40px;
}

.cell-select {
    width: 100%;
    padding: 4px 2px;
    border: none;
    background: transparent;
    text-align: center;
    font-weight: 600;
    color: #1a6bb5;
    font-size: 13px;
    cursor: pointer;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.cell-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    pointer-events: none; /* чтобы клик проходил сквозь текст на селект */
    color: #888;
    font-size: 12px;
    line-height: 1;
}
.search-wrapper {
    position: relative;
    max-width: 420px;
    margin-bottom: 20px;
}

#emp-search {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d5dbe1;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
}

#emp-search:focus {
    outline: none;
    border-color: #1a6bb5;
    box-shadow: 0 0 0 3px rgba(26, 107, 181, .15);
}

.autocomplete-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #d5dbe1;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
    z-index: 10;
    display: none; /* скрыто по умолчанию */
}

.autocomplete-results.visible {
    display: block;
}

.autocomplete-results li {
    padding: 10px 14px;
    cursor: pointer;
    transition: background .2s;
    color: #2c3e50;
    font-size: 14px;
}

.autocomplete-results li:hover {
    background: #f5f9fd;
    color: #1a6bb5;
}

.autocomplete-results li.highlight {
    background: #eef5ff;
    font-weight: 600;
}

.edit-actions {
    margin-bottom: 20px;
}
/* ── Расчет зарплаты ──────────────────── */
.salary-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.salary-tabs .tab {
    padding: 8px 18px;
    border-radius: 8px;
    background: #fff;
    color: #2c3e50;
    font-size: 15px;
    border: 1px solid #e2e8ee;
}

.salary-tabs .tab.active {
    background: #1a6bb5;
    color: #fff;
    border-color: #1a6bb5;
    font-weight: 600;
}

.salary-tabs .tab.disabled {
    color: #a5b1bd;
    cursor: default;
}

.fix-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.fixed-note {
    color: #1e7e34;
    font-size: 14px;
}

.salary-table .num-cell {
    text-align: right;
    padding: 8px 10px;
    white-space: nowrap;
}

.salary-table .advance-cell {
    color: #1a6bb5;
    font-weight: 600;
}

.salary-table .total-cell {
    font-weight: 700;
    background: #f5f9fd;
}

.salary-table thead th[colspan] {
    border-bottom: none;
}
.bonus-cell {
    padding: 4px 8px;
}

.bonus-input {
    width: 90px;
    padding: 6px 8px;
    border: 1px solid #d5dbe1;
    border-radius: 6px;
    font-size: 14px;
    text-align: right;
    box-sizing: border-box;
}

.bonus-input:focus {
    outline: none;
    border-color: #1a6bb5;
}

.salary-table .column-total {
    font-weight: 600;
    background: #f5f9fd;
}

.salary-table .grand-total {
    font-weight: 700;
    background: #e3effb;
}

.salary-table tfoot td {
    border-top: 2px solid #1a6bb5;
}

.manager-mark {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 8px;
    background: #1a6bb5;
    color: #fff;
    font-size: 11px;
    vertical-align: middle;
}
.deduction-total {
    color: #c0392b;
}

.salary-tabs .tab {
    text-decoration: none;
    display: inline-block;
}

.settings-bar {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    margin-bottom: 20px;
}

.settings-bar input[type="text"] {
    width: 140px;
    padding: 6px 8px;
    border: 1px solid #d5dbe1;
    border-radius: 6px;
    font-size: 14px;
    text-align: right;
}

.settings-bar input:disabled {
    background: #f2f4f6;
    color: #8a95a1;
}

.salary-table .month-total-cell {
    font-weight: 700;
    color: #1e7e34;
}

.filter-bar-salary {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;   /* прижат влево */
    gap: 20px;
    margin-bottom: 28px;          /* отступ только снизу */
    padding: 18px 24px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
    max-width: 590px;              /* чтобы не растягивался на весь экран */
}

.salary-summary-block {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 12px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8ee;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-label {
    font-size: 13px;
    color: #475569;
    white-space: nowrap;
}

.summary-value {
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
}
