﻿.alert,
#alert-failure,
#alert-success {
    position: fixed;
    top: 50px;
    left: calc((100vw - 400px) /2);
    width: 400px;
    z-index: 9999;
}

/*-----------CSS FORM-----------*/
.form-group.row {
    gap: 6px;
    margin-bottom: 8px;
}

input.form-control,
.form-select{
    height: 36px;
    display: flex;
    align-items: center;
}

.form-control:focus,
.form-select:focus {
    box-shadow: none;
}

button, .btn {
    height: 36px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 4px;
}

span.field-validation-error {
    color: red;
    font-size: 13px;
}

span.required {
    color: red;
}

a.btn.btn-filter {
    height: 28px;
    width: 28px;
    justify-content: center;
    background: #ddd;
    border-radius: 50%;
    color: #666666;
}

    a.btn.btn-filter:hover {
        background: #6e6e6e;
        color: #fff;
    }

.field-value.field-checkbox {
    display: flex;
    align-items: center;
    justify-content: start;
}

    .field-value.field-checkbox input {
        margin: 0;
    }

.select2-container--default .select2-selection--single {
    border-color: #dee2e6!important;
}
/*----------CSS PAGE------------*/
.page-box {
    background: #f8f8f8;
    border: 1px solid #ddd;
    padding: 16px;
    border-radius: 4px;
    position: relative;
}

.icon-module {
    display: flex;
    width: 32px;
    height: 32px;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    background: #3261c5;
    color: #fff;
}

.icon-product {
    background: #f7782b !important;
}

.icon-order {
    background: #3dbb4e;
}

.icon-ticket {
    background: #ad4fff;
}

.filter-layout .form-group.row {
    margin-bottom: 0;
}
/*---------CSS TABLE-------------*/
a.btn.btn-act-tb {
    width: 26px;
    height: 26px;
    justify-content: center;
    font-size: 14px;
    border-radius: 4px;
}

.app-pagination {
    height: 48px;
}

.paging-product .app-pagination {
    border-top: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
}

@media (max-width: 576px) {
    .app-pagination {
        border-top: 1px solid #dee2e6 !important;
        border-radius: 8px !important;
    }
}

.w-search {
    width: 250px;
}
@media (max-width: 576px) {
    .w-search {
        width: 185px;
    }
}

.btn-pagination {
    border-radius: 50%;
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
    border-color: #cccccc !important;
}

    .btn-pagination:hover {
        background: #e9e9e9;
    }

    .btn-pagination.disabled {
        opacity: .6;
    }

        .btn-pagination.disabled:hover {
            background: white;
        }
a.selected-asc:link,
a.selected-asc:visited,
a.selected-asc:hover,
a.selected-asc:active {
    padding-right: 20px;
    background: url(/img/arrow-down.png) no-repeat center right;
}

a.selected-desc:link,
a.selected-desc:visited,
a.selected-desc:hover,
a.selected-desc:active {
    padding-right: 20px;
    background: url(/img/arrow-up.png) no-repeat center right;
}

a.selected-none {
    padding-right: 20px;
    background: url(/img/arrow-none.png) no-repeat center right;
}

.column-value {
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

th a {
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
tr.tr-filter input.form-control,
tr.tr-filter .btn {
    height: 32px;
}
/*-----------CSS ULTI------------*/
.min-h-32px {
    min-height: 32px;
}

.min-w-120px {
    min-width: 120px;
}

.w-40px {
    width: 40px;
}
.text-ellipsis {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.w-0 { width: 0!important; }
.h-0 { height: 0 !important; }
/*-------------Select2-------------*/
.select2-container--open .select2-dropdown {
    left: 0;
    box-shadow: 0 2px 6px #00000052;
    border-color: #e2e4e9 !important;
    border-radius: 4px !important;
}

span.select2.select2-container {
    width: 100% !important;
}

span.selection {
    width: 100%;
}

span.select2-selection {
    height: 36px !important;
    border-color: #d3d3d3 !important;
    padding: 0;
}

span.select2-selection__arrow {
    display: none;
}

.select2-selection__rendered {
    height: 34px;
    padding: 0 38px 0 12px !important;
    display: flex !important;
    align-items: center;
    width: calc(100% - 38px);
}

button.select2-selection__clear {
    display: none;
}

input.select2-search__field {
    outline: none;
    border: none !important;
    padding: 0 12px !important;
}

span.select2-search.select2-search--dropdown {
    padding: 0 !important;
    border-bottom: 1px solid #d3d3d3;
}

li.select2-results__option {
    padding: 6px 12px;
    color: #212529;
    border-bottom: 1px dashed #e3e3e3;
}

    li.select2-results__option:last-child {
        border-bottom: none;
    }

input.select2-search__field {
    height: 36px;
}

/*----------------CSS FORM EDIT---------------*/
.form-edit .field-label {
    width: 120px;
    display: flex;
    gap: 4px;
    align-items: center;
    height: 36px;
}

    .form-edit .field-label label {
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.form-edit .field-value {
    width: calc(100% - 128px);
}

@media (max-width: 992px) {
    .form-edit .field-label {
        width: 100%;
        height: auto;
    }

    .form-edit .field-value {
        width: 100%;
    }
}

/*-----------------CSS ModalPreviewImage---------------*/
#imgModal .modal-content {
    background: radial-gradient(1200px 800px at 50% 10%, #111c33 0%, #0b1220 55%, #070b14 100%);
    border: 0;
    overflow: hidden;
}

#imgModal .modal-header {
    border: 0;
    padding: .75rem 1rem;
    background: rgba(15,23,42,.78);
    color: #e2e8f0;
    backdrop-filter: blur(10px);
}

#imgModal .modal-title {
    font-weight: 600;
    letter-spacing: .2px;
}

#imgModal .btn-close {
    filter: invert(1) grayscale(100%);
    opacity: .85;
}

    #imgModal .btn-close:hover {
        opacity: 1;
    }

#imgModal .modal-body {
    padding: 0;
    position: relative;
}

/* ===== Workspace ===== */
#imgModal .pz-wrap {
    position: relative;
    width: 100%;
    height: calc(100dvh - 56px - env(safe-area-inset-bottom));
    overflow: hidden;
    display: grid;
    place-items: center;
    user-select: none;
}

/* Click-outside-to-close layer */
#imgModal .backdrop-close {
    position: absolute;
    inset: 0;
    border: 0;
    background: transparent;
    cursor: zoom-out;
    z-index: 1;
}

/* Panzoom area */
#imgModal .pz-inner {
    position: relative;
    z-index: 2;
    touch-action: none;
    cursor: grab;
    will-change: transform;
}

    #imgModal .pz-inner:active {
        cursor: grabbing;
    }

/* IMPORTANT: để JS “fit” chính xác, không ép max-width/max-height ở CSS nữa */
#imgModal img#previewImg {
    display: block;
    -webkit-user-drag: none;
    user-select: none;
    width: 100vw;
    max-width: 650px;
    height: auto;
}

/* ===== Toolbar ===== */
#imgModal .pz-toolbar {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(2,6,23,.55);
    border: 1px solid rgba(148,163,184,.22);
    border-radius: 14px;
    backdrop-filter: blur(10px);
    box-shadow: 0 12px 30px rgba(0,0,0,.35);
}

    #imgModal .pz-toolbar .btn {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        display: grid;
        place-items: center;
        padding: 0;
    }

#imgModal .pz-hint {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    font-size: 12px;
    color: rgba(226,232,240,.9);
    background: rgba(2,6,23,.45);
    border: 1px solid rgba(148,163,184,.18);
    border-radius: 12px;
    padding: 8px 10px;
    backdrop-filter: blur(10px);
}

@media (max-width: 576px) {
    #imgModal .pz-hint {
        display: none;
    }
}
