.warehouse_page {
    width: 100%;
    box-sizing: border-box;
}

.warehouse {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.warehouse_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
}

.warehouse_title {
    font-size: 30px;
    font-weight: 600;
}

.warehouse_add_button {
    display: none;
    padding: 10px 18px;
    border-radius: 8px;

    background: transparent;
    color: #222;
    border: 1px solid #007bff;

    cursor: pointer;

    transition: all .3s ease;
}

.warehouse_add_button:hover {
    background: #007bff;
    color: #fff;
    border: 1px solid transparent;
}

.warehouse_controls {
    width: 100%;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.warehouse_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;
}
.warehouse_search:hover {
    border-color: #007bff;
    max-width: 500px;
}

.warehouse_search:focus {
    border-color: #007bff;
    max-width: 500px;
}

.warehouse_list {
    display: grid;
    grid-template-columns: repeat(
        auto-fill,
        minmax(250px, 1fr)
    );

    gap: 20px;
}

.warehouse_empty {
    display: none;

    text-align: center;
    margin-top: 40px;

    color: #777;
}

.warehouse_table_wrapper {
    width: 100%;

    overflow-x: auto;

    background: #fff;

    border: 1px solid #ddd;
    border-radius: 10px;
}

.warehouse_table {
    display: grid;

    grid-template-columns:
        140px
        minmax(200px, 2fr)
        minmax(150px, 1fr)
        120px
        140px;

    align-items: center;

    min-width: 750px;

    padding: 0 20px;

    box-sizing: border-box;
}

.warehouse_table_header {
    min-height: 50px;

    background: #f5f5f5;

    border-bottom: 1px solid #ddd;

    font-size: 13px;
    font-weight: 600;

    color: #666;
}

.warehouse_table_body {
    width: 100%;
}

.warehouse_table_body .warehouse_table {
    min-height: 60px;

    cursor: pointer;

    border-bottom: 1px solid #eee;

    transition:
        background-color .2s ease;
}

.warehouse_table_body .warehouse_table:hover {
    background-color: #f7f9fc;
}

.warehouse_table_body .warehouse_table:last-child {
    border-bottom: none;
}

.warehouse_empty {
    display: none;

    padding: 40px 20px;

    text-align: center;

    color: #777;
}

.warehouse_pagination {
    display: flex;

    justify-content: center;
    align-items: center;

    gap: 6px;

    margin-top: 25px;
}

.warehouse_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;
}

.warehouse_pagination_button:hover {
    border-color: #007bff;
    color: #007bff;
}

.warehouse_pagination_button.active {
    background: #007bff;
    border-color: #007bff;

    color: #fff;
}

.warehouse_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);
}

.warehouse_modal.open {
    display: flex;
}

.warehouse_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);
}

.warehouse_modal_header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 25px;
}

.warehouse_modal_header h2 {
    font-size: 22px;
    font-weight: 600;
}

.warehouse_modal_close {
    width: 35px;
    height: 35px;

    border: none;

    background: transparent;

    font-size: 30px;
    line-height: 1;

    color: #555;

    cursor: pointer;
    transition: all .5s ;
}

.warehouse_modal_close:hover {
    color: red;
}

.warehouse_modal_body {
    display: flex;

    flex-direction: column;

    gap: 15px;
}

.warehouse_modal_row {
    display: flex;

    justify-content: space-between;

    gap: 20px;

    padding-bottom: 10px;

    border-bottom: 1px solid #eee;
}

.warehouse_modal_row span {
    color: #777;
}

.warehouse_modal_row strong {
    text-align: right;
}

.warehouse_modal_actions {
    display: flex;

    justify-content: flex-end;

    gap: 10px;

    margin-top: 25px;
}

.warehouse_modal_actions button {
    padding: 9px 16px;

    border-radius: 7px;

    cursor: pointer;

    transition: all .3s ease;
}

.warehouse_modal_edit {
    border: 1px solid #007bff;

    background: #007bff;

    color: #fff;
}
.warehouse_modal_edit.hidden {
    display: none;
}

.warehouse_modal_edit:hover {
    background: transparent;

    color: #222;
}

.warehouse_modal_cancel {
    border: 1px solid #ddd;

    background: #f5f5f5;

    color: #222;
}

.warehouse_modal_cancel:hover {
    background: #e5e5e5;
}

.warehouse_modal_edit_form {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 15px;
}

.warehouse_modal_field {
    display: flex;

    flex-direction: column;

    gap: 6px;
}

.warehouse_modal_field label {
    font-size: 14px;

    color: #666;
}

.warehouse_modal_field input {
    width: 100%;

    padding: 10px 12px;

    box-sizing: border-box;

    border: 1px solid #aaa;
    border-radius: 7px;

    outline: none;
}

.warehouse_modal_field input:focus {
    border-color: #007bff;
}

.warehouse_modal_field textarea {
    width: 100%;
    max-height: 90px;
    padding: 11px 12px;

    border: 1px solid #ddd;
    border-radius: 7px;

    box-sizing: border-box;
    font-size: 15px;
    font-family: inherit;
    transition: all .5s;
    resize: none;
    margin-bottom: 10px;
}
.warehouse_modal_field textarea:focus {
    border-color: #007bff;
    outline: none;
}
.warehouse_modal_field select {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;

    box-sizing: border-box;

    border: 1px solid #aaa;
    border-radius: 7px;

    background: #fff;
    font-size: 14px;
    outline: none;
}

.warehouse_modal_field select:focus {
    border-color: #007bff;
}

.warehouse_modal_save {
    display: none;

    padding: 9px 16px;
    border: 1px solid #007bff;
    border-radius: 7px;

    background: #007bff;
    color: #fff;

    cursor: pointer;
    transition: all .3s ease;
}

.warehouse_modal_save.open {
    display: block;
}

.warehouse_modal_save:hover {
    background: transparent;
    color: #007bff;
}

.warehouse_modal_view {
    display: block;
}

.warehouse_modal_view.hidden {
    display: none;
}

.warehouse_filter {
    min-width: 200px;
    padding: 12px 15px;

    border: 1px solid #007bff;
    border-radius: 8px;

    background-color: #fff;
    color: #333;

    font-size: 14px;
    font-family: inherit;

    outline: none;
    cursor: pointer;

    transition: all .3s ease;
}

.warehouse_filter:hover {
    border-color: #0056b3;
}

.warehouse_filter:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.25);
}

.warehouse_filter option {
    padding: 10px;
}
.price_filter {
    min-width: 200px;
    padding: 12px 15px;

    border: 1px solid #007bff;
    border-radius: 8px;

    background-color: #fff;
    color: #333;

    font-size: 14px;
    font-family: inherit;

    outline: none;
    cursor: pointer;

    transition: all .3s ease;
}

.price_filter:hover {
    border-color: #0056b3;
}

.price_filter:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.25);
}

.price_filter option {
    padding: 10px;
}

#warehouseAddModal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;

    align-items: center;
    justify-content: center;

    background: rgba(0, 0, 0, 0.5);
}

#warehouseAddModal.open {
    display: flex;
}

#warehouseAddModal .modal_content {
    position: relative;

    width: min(500px, calc(100% - 32px));

    padding: 24px;

    background: #fff;
    border-radius: 12px;

    box-sizing: border-box;
}

#warehouseAddModal h2 {
    margin-top: 0;
}

#warehouseAddModal form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#warehouseAddModal label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#warehouseAddModal input {
    width: 100%;
    padding: 10px 12px;

    border: 1px solid #ccc;
    border-radius: 6px;

    box-sizing: border-box;
}

#warehouseAddModalClose {
    position: absolute;
    top: 10px;
    right: 12px;

    border: none;
    background: none;

    font-size: 24px;
    cursor: pointer;
}

#warehouseAddModal .modal_actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;

    margin-top: 8px;
}

#warehouseAddModal .modal_actions button {
    padding: 10px 16px;

    border: none;
    border-radius: 6px;

    cursor: pointer;
}


.products_stock_toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    cursor: pointer;
    user-select: none;
}

.products_stock_toggle input {
    display: none;
}

.products_stock_slider {
    position: relative;

    width: 42px;
    height: 24px;

    flex-shrink: 0;

    border-radius: 20px;

    background: #d1d5db;

    transition: background 0.2s ease;
}

.products_stock_slider::before {
    content: "";

    position: absolute;

    width: 18px;
    height: 18px;

    top: 3px;
    left: 3px;

    border-radius: 50%;

    background: #ffffff;

    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);

    transition: transform 0.2s ease;
}

.products_stock_toggle input:checked
+ .products_stock_slider {
    background: #007bff;
}

.products_stock_toggle input:checked
+ .products_stock_slider::before {
    transform: translateX(18px);
}

.products_stock_text {
    font-size: 14px;
    color: #374151;
}