﻿:root {
    --soft-shadow: 0 6px 22px rgba(18, 38, 63, .08);
    --chip-bg: #f5f7fb;
}

body {
    background: #f7f8fb
}

.card-elevated {
    box-shadow: var(--soft-shadow);
    border: 0
}

/* Header */
.entity-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #e9f2ff, #f5f8ff);
    border: 1px solid #e4ecff;
    color: var(--primary);
}

.entity-icon-setting {
    width: 36px;
    height: 36px;
}

.meta-chip {
    background: var(--chip-bg);
    border: 1px solid #edf1f7;
    color: #445;
    padding: .4rem .6rem;
    border-radius: 10px;
    font-size: .9rem
}

.btn-kebab {
    border-radius: 12px
}

.app-alert-host {
    position: fixed;
    top: 18px;
    right: 18px;
    width: min(calc(100vw - 36px), 360px);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1400;
    pointer-events: none;
}

.app-alert {
    --app-alert-accent: #f59e0b;
    --app-alert-shell-bg: color-mix(in srgb, var(--app-alert-accent) 12%, #ffffff);
    --app-alert-icon-bg: var(--app-alert-accent);
    --app-alert-eyebrow-color: color-mix(in srgb, var(--app-alert-accent) 74%, #475569);
    --app-alert-title-color: #12263f;
    --app-alert-message-color: #586174;
    --app-alert-border: color-mix(in srgb, var(--app-alert-accent) 18%, #dbe4f0);
    --app-alert-duration: 3000ms;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(248, 250, 252, .96)),
        radial-gradient(circle at top right, color-mix(in srgb, var(--app-alert-accent) 10%, transparent), transparent 48%);
    border: 1px solid var(--app-alert-border);
    border-radius: 18px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, .11);
    opacity: 0;
    transform: translate3d(0, -10px, 0) scale(.98);
    transition: opacity .22s ease, transform .22s ease, box-shadow .22s ease;
    pointer-events: auto;
    backdrop-filter: blur(10px);
}

.app-alert.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    box-shadow: 0 18px 36px rgba(15, 23, 42, .14);
}

.app-alert.is-leaving {
    opacity: 0;
    transform: translate3d(0, -10px, 0) scale(.98);
}

.app-alert__body {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px 18px;
}

.app-alert__icon-shell {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--app-alert-shell-bg);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55);
}

.app-alert__icon {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--app-alert-icon-bg);
    color: #ffffff;
    font-size: 12px;
    box-shadow: 0 8px 14px color-mix(in srgb, var(--app-alert-icon-bg) 24%, transparent);
}

.app-alert__content {
    flex: 1;
    min-width: 0;
    padding-top: 1px;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.app-alert__title {
    color: var(--app-alert-title-color);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 3px;
}

.app-alert__message {
    color: var(--app-alert-message-color);
    font-size: 12px;
    line-height: 1.4;
    word-break: break-word;
}

.app-alert__close {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .72);
    color: #94a3b8;
    cursor: pointer;
    font-size: 12px;
    margin-top: 0;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.app-alert__close:hover {
    background: rgba(241, 245, 249, .95);
    color: #64748b;
    transform: rotate(90deg);
}

.app-alert__close:focus-visible {
    outline: 2px solid rgba(59, 130, 246, .35);
    outline-offset: 2px;
}

.app-alert__progress {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 6px;
    height: 3px;
    border-radius: 999px;
    background: rgba(226, 232, 240, .72);
    overflow: hidden;
}

.app-alert__progress-bar {
    width: 100%;
    height: 100%;
    transform-origin: left center;
    transform: scaleX(1);
    background: var(--app-alert-accent);
    transition-property: transform;
    transition-timing-function: linear;
}

.app-alert--success {
    --app-alert-accent: #22c55e;
    --app-alert-title-color: #14532d;
    --app-alert-message-color: #46615a;
}

.app-alert--warning {
    --app-alert-accent: #f59e0b;
    --app-alert-title-color: #9a6700;
    --app-alert-message-color: #6e5b31;
}

.app-alert--danger {
    --app-alert-accent: #ef4444;
    --app-alert-title-color: #991b1b;
    --app-alert-message-color: #6f4951;
}

@media (max-width: 576px) {
    .app-alert-host {
        top: 12px;
        right: 12px;
        left: 12px;
        width: calc(100vw - 24px);
    }

    .app-alert__body {
        gap: 10px;
        padding: 11px 12px 17px;
    }

    .app-alert__icon-shell {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .app-alert__progress {
        left: 12px;
        right: 12px;
    }
}

.app-toast-host {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1350;
    width: min(calc(100vw - 36px), 340px);
    pointer-events: none;
}

.app-toast {
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(248, 250, 252, .96)),
        radial-gradient(circle at top right, rgba(37, 99, 235, .08), transparent 48%);
    border: 1px solid rgba(191, 219, 254, .8);
    box-shadow: 0 14px 30px rgba(15, 23, 42, .12);
    color: #12263f;
    pointer-events: auto;
}

.app-toast__body {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
}

.app-toast__icon-shell {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(219, 234, 254, .9);
}

.app-toast__icon {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #2563eb;
    color: #ffffff;
    font-size: 12px;
    box-shadow: 0 8px 14px rgba(37, 99, 235, .24);
}

.app-toast__content {
    flex: 1;
    min-width: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.app-toast__title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 3px;
    color: #0f2f57;
}

.app-toast__message {
    padding: 0;
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    color: #586174;
    word-break: break-word;
}

.app-toast__close {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .72);
    color: #94a3b8;
    cursor: pointer;
    font-size: 12px;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.app-toast__close:hover {
    background: rgba(241, 245, 249, .95);
    color: #64748b;
    transform: rotate(90deg);
}

.app-toast__close:focus-visible {
    outline: 2px solid rgba(59, 130, 246, .35);
    outline-offset: 2px;
}

@media (max-width: 576px) {
    .app-toast-host {
        right: 12px;
        left: 12px;
        bottom: 12px;
        width: calc(100vw - 24px);
    }

    .app-toast__body {
        gap: 10px;
        padding: 11px 12px;
    }

    .app-toast__icon-shell {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }
}

.modal-content {
    top: 48px;
}

.modal-fullscreen-lg-down .modal-content,
.modal-fullscreen-sm-down .modal-content,
.modal-fullscreen .modal-content {
    top: 0;
}

/*--------------------------------------------
-------------------FORM-----------------------
--------------------------------------------*/
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;
}

button:focus {
    box-shadow: none !important;
}

/*--------------------------------------------
-------------------TABLE----------------------
--------------------------------------------*/
table {
    min-width: max-content;
    width: 100%;
}

.btn.btn-act-tb {
    width: 26px;
    height: 26px;
    justify-content: center;
    font-size: 14px;
    border-radius: 4px;
}

.app-pagination {
    border-radius: 0 0 8px 8px;
}

.btn-pagination {
    border-radius: 50%;
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
    border-color: #efefef !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,
td a {
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}

tr.tr-filter input.form-control,
tr.tr-filter .btn {
    height: 32px;
}

td {
    max-width: 350px;
}

/* Cố định cột cuối cùng */
.table .sticky-last {
    position: sticky;
    right: 0;
    z-index: 5;
    /*border-right: 1px solid #fff;*/
}

.app-pagination .page-link {
    padding: 3px 11px;
}

.app-pagination li.page-item.disabled a {
    background: #f5f5f5;
}

.app-line:last-child {
    display: none;
}

.btn-pagination:disabled {
    background: #e9e9e9;
}

.app-pagination {
    border-top: 0 !important;
}

@media (max-width: 768px) {
    .app-pagination {
        border-top: 1px solid #dee2e6 !important;
        border-radius: 4px;
    }
}

.overflow-auto::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.overflow-auto::-webkit-scrollbar-track {
    background: transparent;
}

.overflow-auto::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, .55);
    border-radius: 999px;
    border: 3px solid transparent;
    background-clip: content-box;
}

.overflow-auto::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, .65);
    border: 3px solid transparent;
    background-clip: content-box;
}

/*--------------------------------------------
-------------------TIEN ICH-------------------
--------------------------------------------*/
.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;
    padding: 2px 0;
}

.w-0 {
    width: 0 !important;
}

.h-0 {
    height: 0 !important;
}

.h-36 {
    height: 36px;
}

.cursor-pointer {
    cursor: pointer;
}


/*--------------------------------------------
-------------------MODAL----------------------
--------------------------------------------*/
/* Shared dialog polish */
.modal-content {
    border: 0;
    border-radius: 18px;
    box-shadow: var(--shadow)
}

.modal-header {
    border: 0
}

.modal-footer {
    border: 0
}

/* === EFFECT: ZOOM === */
.modal.fx-zoom .modal-dialog {
    transform: scale(.92);
    opacity: 0;
    transition: transform .28s ease, opacity .28s ease;
}

.modal.show.fx-zoom .modal-dialog {
    transform: scale(1);
    opacity: 1
}

/* === EFFECT: SLIDE-UP === */
.modal.fx-slide .modal-dialog {
    transform: translateY(16px);
    opacity: 0;
    transition: transform .28s ease, opacity .28s ease;
}

.modal.show.fx-slide .modal-dialog {
    transform: translateY(0);
    opacity: 1
}

/* === EFFECT: FLIP === */
.modal.fx-flip .modal-dialog {
    transform: perspective(800px) rotateX(-12deg) translateY(6px);
    opacity: 0;
    transition: transform .32s cubic-bezier(.2, .75, .2, 1), opacity .26s ease;
    transform-origin: 50% -10%;
}

.modal.show.fx-flip .modal-dialog {
    transform: perspective(800px) rotateX(0) translateY(0);
    opacity: 1
}

/* Little pulse on the primary button when modal shows */
.modal.show .btn-primary.pulse {
    animation: pulse .8s ease .25s 1
}

body::-webkit-scrollbar {
    width: 0;
}

@keyframes pulse {
    0% {
        transform: scale(1)
    }

    50% {
        transform: scale(1.035)
    }

    100% {
        transform: scale(1)
    }
}

@media (max-width: 576px) {
    .w-80-on-mobile {
        max-width: 80px;
    }

    .w-180-on-mobile {
        max-width: 180px;
    }

    .w-sm-100 {
        width: 100%!important;
    }
}

@media (max-width: 767.98px) {
    .w-flex-wrap {
        width: 100%;
    }
}

@media (min-width: 768) {
    .w-flex-wrap {
        width: auto;
    }
}

/*-----------------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;
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
    -webkit-user-drag: none;
    user-select: none;
}

/* ===== 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);
}

.btn-24px {
    width: 24px;
    height: 24px;
    padding: 0 4px;
}

.h-36 {
    height: 36px;
}

@media (max-width: 576px) {
    #imgModal .pz-hint {
        display: none;
    }
    #imgModal img#previewImg {
        width: 100%;
    }
}

.layout-shell {
    width: 100%;
    max-width: 1680px;
    margin-left: auto;
    margin-right: auto;
}
