.users_page {
    width: 100%;
    box-sizing: border-box;
}
.users_add_button {
    display: none;
}
.users {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.users_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
}

.users_title {
    font-size: 30px;
    font-weight: 600;
}

.users_add_button {
    padding: 10px 18px;
    border-radius: 8px;
    color: #222;
    border: 1px solid #007bff;
    cursor: pointer;
    transition: all .3s ease;
}

.users_add_button:hover {
    border: 1px solid transparent;
    background: #007bff;
    color: #fff;

}

.users_controls {
    width: 100%;
    margin-bottom: 25px;
}

.users_search {
    width: 100%;
    max-width: 300px;

    padding: 12px 15px;

    box-sizing: border-box;

    border: 1px solid #aaa;
    border-radius: 8px;

    outline: none;

    transition: all .5s ease;
}

.users_search:hover,
.users_search:focus {
    max-width: 500px;
    border-color: #007bff;
}

.users_table_wrapper {
    width: 100%;

    overflow-x: auto;

    background: #fff;

    border: 1px solid #ddd;
    border-radius: 10px;
}

.users_table {
    display: grid;

    grid-template-columns:
        80px
        minmax(200px, 2fr)
        minmax(200px, 2fr)
        minmax(150px, 1fr)
        minmax(150px, 1fr);

    align-items: center;

    min-width: 800px;

    padding: 0 20px;

    box-sizing: border-box;
}

.users_table_header {
    min-height: 50px;

    background: #f5f5f5;

    border-bottom: 1px solid #ddd;

    font-size: 13px;
    font-weight: 600;

    color: #666;
}

.users_table_body {
    width: 100%;
}

.users_table_body .users_table {
    min-height: 60px;

    cursor: pointer;

    border-bottom: 1px solid #eee;

    transition: background-color .2s ease;
}

.users_table_body .users_table:hover {
    background-color: #f7f9fc;
}

.users_table_body .users_table:last-child {
    border-bottom: none;
}

.users_empty {
    display: none;

    padding: 40px 20px;

    text-align: center;

    color: #777;
}

.users_pagination {
    display: flex;

    justify-content: center;
    align-items: center;

    gap: 6px;

    margin-top: 25px;
}

.users_pagination_button {
    min-width: 36px;
    height: 36px;

    padding: 0 10px;

    border: 1px solid #ddd;
    border-radius: 6px;

    background: #fff;

    cursor: pointer;

    transition: all .2s ease;
}

.users_pagination_button:hover {
    border-color: #007bff;
    color: #007bff;
}

.users_pagination_button.active {
    background: #007bff;
    border-color: #007bff;

    color: #fff;
}

.users_modal {
    display: none;

    position: fixed;

    inset: 0;

    z-index: 2000;

    align-items: center;
    justify-content: center;

    padding: 20px;

    box-sizing: border-box;

    background: rgba(0, 0, 0, 0.45);
}

.users_modal.open {
    display: flex;
}

.users_modal_content {
    width: 100%;
    max-width: 500px;

    max-height: 90vh;

    overflow-y: auto;

    padding: 25px;

    box-sizing: border-box;

    background: #fff;

    border-radius: 12px;

    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.2);
}

.users_modal_header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 25px;
}

.users_modal_header h2 {
    margin: 0;

    font-size: 22px;
    font-weight: 600;
}

.users_modal_close {
    width: 35px;
    height: 35px;

    border: none;

    background: transparent;

    font-size: 30px;
    line-height: 1;

    color: #555;

    cursor: pointer;

    transition: all .3s ease;
}

.users_modal_close:hover {
    color: red;
}

.users_modal_body {
    display: flex;

    flex-direction: column;

    gap: 15px;
}

.users_modal_row {
    display: flex;

    justify-content: space-between;

    gap: 20px;

    padding-bottom: 10px;

    border-bottom: 1px solid #eee;
}

.users_modal_row span {
    color: #777;
}

.users_modal_row strong {
    text-align: right;
}

.users_modal_actions {
    display: flex;

    justify-content: flex-end;

    gap: 10px;

    margin-top: 25px;
}

.users_modal_actions button {
    padding: 9px 16px;

    border-radius: 7px;

    cursor: pointer;

    transition: all .3s ease;
}

.users_modal_edit {
    border: 1px solid #007bff;

    background: #007bff;

    color: #fff;
}

.users_modal_edit:hover {
    background: transparent;

    color: #222;
}

.users_modal_cancel {
    border: 1px solid #ddd;

    background: #f5f5f5;

    color: #222;
}

.users_modal_cancel:hover {
    background: #e5e5e5;
}

.users_modal_edit_form {
    display: none;

    flex-direction: column;

    gap: 15px;
}

.users_modal_edit_form.open {
    display: flex;
}
.users_modal_edit_form {
    display: none;

    flex-direction: column;

    gap: 18px;

    width: 100%;
}

.users_modal_edit_form.open {
    display: flex;
}


.users_modal_field {
    display: flex;

    flex-direction: column;

    gap: 7px;

    width: 100%;
}


.users_modal_field label {
    font-size: 14px;

    font-weight: 500;

    color: #666;
}


.users_modal_field input,
.users_modal_field select {
    width: 100%;

    min-height: 42px;

    padding: 10px 12px;

    box-sizing: border-box;

    border: 1px solid #ccc;

    border-radius: 8px;

    background: #fff;

    color: #222;

    font-size: 15px;

    outline: none;

    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}


.users_modal_field input:hover,
.users_modal_field select:hover {
    border-color: #999;
}


.users_modal_field input:focus,
.users_modal_field select:focus {
    border-color: #007bff;

    box-shadow:
        0 0 0 3px rgba(0, 123, 255, .1);
}


.users_modal_save {
    display: none;

    padding: 9px 16px;

    border: 1px solid #007bff;

    border-radius: 7px;

    background: #007bff;

    color: #fff;

    cursor: pointer;

    transition: all .3s ease;
}


.users_modal_save:hover {
    background: transparent;

    color: #222;
}

.users_modal_field input[type="password"] {
    width: 100%;

    min-height: 42px;

    padding: 10px 12px;

    box-sizing: border-box;

    border: 1px solid #ccc;

    border-radius: 8px;

    background: #fff;

    color: #222;

    font-size: 15px;

    outline: none;

    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}

.users_modal_field input[type="password"]:focus {
    border-color: #007bff;

    box-shadow:
        0 0 0 3px rgba(0, 123, 255, .1);
}

.user_role_cell {
    display: flex;
    align-items: center;
}


.user_role_badge {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    padding: 5px 10px;

    border-radius: 999px;

    font-size: 12px;
    font-weight: 600;

    line-height: 1;

    white-space: nowrap;
}


/* Администратор */

.user_role_admin {
    background: #e8f1ff;
    color: #0066cc;
}


/* Менеджер */

.user_role_manager {
    background: #e9f8ef;
    color: #198754;
}


/* Кладовщик */

.user_role_warehouse {
    background: #fff3e0;
    color: #d97706;
}


/* Водитель */

.user_role_driver {
    background: #f0e9ff;
    color: #7048b6;
}


/* Неизвестная роль */

.user_role_unknown {
    background: #f1f1f1;
    color: #666;
}


.create_user_overlay {
    display: none;

    position: fixed;

    inset: 0;

    z-index: 2000;

    align-items: center;
    justify-content: center;

    padding: 20px;

    box-sizing: border-box;

    background: rgba(0, 0, 0, 0.45);
}

.create_user_overlay.active {
    display: flex;
}


.create_user_modal {
    width: 100%;

    max-width: 500px;

    max-height: 90vh;

    overflow-y: auto;

    padding: 25px;

    box-sizing: border-box;

    background: #fff;

    border-radius: 12px;

    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.2);
}


/* Заголовок */

.create_user_header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 25px;
}

.create_user_header h2 {
    margin: 0;

    font-size: 22px;

    font-weight: 600;
}

.create_user_close {
    width: 35px;
    height: 35px;

    border: none;

    background: transparent;

    font-size: 30px;

    line-height: 1;

    color: #555;

    cursor: pointer;

    transition: all .3s ease;
}

.create_user_close:hover {
    color: red;
}


/* Поля */

.create_user_field {
    display: flex;

    flex-direction: column;

    gap: 7px;

    width: 100%;

    margin-bottom: 18px;
}

.create_user_field label {
    font-size: 14px;

    font-weight: 500;

    color: #666;
}

.create_user_field input,
.create_user_field select {
    width: 100%;

    min-height: 42px;

    padding: 10px 12px;

    box-sizing: border-box;

    border: 1px solid #ccc;

    border-radius: 8px;

    background: #fff;

    color: #222;

    font-size: 15px;

    outline: none;

    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}

.create_user_field input:hover,
.create_user_field select:hover {
    border-color: #999;
}

.create_user_field input:focus,
.create_user_field select:focus {
    border-color: #007bff;

    box-shadow:
        0 0 0 3px rgba(0, 123, 255, .1);
}


/* Кнопки */

.create_user_actions {
    display: flex;

    justify-content: flex-end;

    gap: 10px;

    margin-top: 25px;
}

.create_user_actions button {
    padding: 9px 16px;

    border-radius: 7px;

    cursor: pointer;

    transition: all .3s ease;
}

.create_user_submit {
    border: 1px solid #007bff;

    background: #007bff;

    color: #fff;
}

.create_user_submit:hover {
    background: transparent;

    color: #222;
}

.create_user_cancel {
    border: 1px solid #ddd;

    background: #f5f5f5;

    color: #222;
}

.create_user_cancel:hover {
    background: #e5e5e5;
}

.users_modal_delete {
    padding: 9px 16px;

    border: 1px solid #dc3545;
    border-radius: 7px;

    background: #dc3545;
    color: #fff;

    cursor: pointer;

    transition: all .3s ease;
}

.users_modal_delete:hover {
    background: transparent;
    color: #dc3545;
}