/* POS BKY v1.5 - Backend */

.dashboard-stat {
    height: 100%;

    padding: 18px;

    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);

    box-shadow: var(--app-shadow);
}

.dashboard-stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;
}

.dashboard-stat-label {
    color: var(--app-muted);

    font-size: .84rem;
    font-weight: 600;
}

.dashboard-stat-icon {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: var(--app-primary-soft);
    color: var(--app-primary);

    font-size: 1.15rem;
}

.dashboard-stat-value {
    margin-top: 14px;

    font-size: 1.7rem;
    line-height: 1;
    font-weight: 750;
}

.dashboard-stat-note {
    margin-top: 8px;

    color: var(--app-muted);

    font-size: .75rem;
}

.select2-container {
    width: 100% !important;
}

.select2-container .select2-selection--single {
    min-height: 38px;

    display: flex;
    align-items: center;

    border: 1px solid #dee2e6;
    border-radius: .375rem;
}

.select2-container--default
.select2-selection--single
.select2-selection__rendered {
    padding-left: 12px;
    padding-right: 32px;
}

.select2-container--default
.select2-selection--single
.select2-selection__arrow {
    height: 36px;
}

div.dt-container .dt-search input,
div.dt-container .dt-length select {
    border: 1px solid #dee2e6;
    border-radius: .375rem;
}

.table > :not(caption) > * > * {
    vertical-align: middle;
}

/* POS BKY STEP 3 */
.table-card { overflow: hidden; }
.table-card .table { margin-bottom: 0; }
.status-dot { display:inline-block; width:8px; height:8px; margin-right:6px; border-radius:50%; }
.status-dot.is-active { background:#198754; }
.status-dot.is-inactive { background:#adb5bd; }
.app-action-group { display:inline-flex; gap:6px; flex-wrap:wrap; }
.btn-icon { width:35px; height:35px; display:inline-flex; align-items:center; justify-content:center; padding:0; }
.event-summary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.event-summary-item { padding:14px; background:#fff; border:1px solid var(--app-border); border-radius:12px; }
.event-summary-item small { display:block; color:var(--app-muted); margin-bottom:5px; }
.event-summary-item strong { font-size:1rem; }
.setup-menu-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.setup-menu-card { display:block; height:100%; padding:18px; color:var(--app-text); text-decoration:none; background:#fff; border:1px solid var(--app-border); border-radius:14px; transition:border-color .15s ease,transform .15s ease,box-shadow .15s ease; }
.setup-menu-card:hover { color:var(--app-text); border-color:#b9cef1; transform:translateY(-2px); box-shadow:var(--app-shadow); }
.setup-menu-icon { width:46px; height:46px; display:flex; align-items:center; justify-content:center; margin-bottom:13px; border-radius:13px; color:var(--app-primary); background:var(--app-primary-soft); font-size:1.25rem; }
.setup-menu-card h3 { margin:0 0 7px; font-size:1rem; font-weight:700; }
.setup-menu-card p { margin:0; color:var(--app-muted); font-size:.82rem; line-height:1.45; }
.promotion-tier-row { display:grid; grid-template-columns:140px minmax(180px,1fr) 42px; gap:8px; margin-bottom:8px; }
@media (max-width:991.98px) { .event-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .setup-menu-grid { grid-template-columns:1fr; } }
@media (max-width:575.98px) { .promotion-tier-row { grid-template-columns:1fr 1fr 40px; } }

/* ============================================================
   Event Location / Live Map Preview v1.8.2
   ============================================================ */

.event-location-modal .modal-dialog {
    max-width: 1120px;
    height: calc(100% - 2rem);
    margin: 1rem auto;
}

.event-location-modal .modal-content {
    max-height: 100%;
    overflow: hidden;
}

.event-location-modal .modal-body {
    overflow-y: auto;
    overscroll-behavior: contain;
}

.event-location-modal .modal-footer {
    flex: 0 0 auto;
    position: relative;
    z-index: 5;
    background: #fff;
}

.event-location-section {
    padding: 16px;
    border: 1px solid var(--app-border);
    border-radius: 14px;
    background: #fbfcfe;
}

.event-location-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-weight: 700;
}

.event-map-preview {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: #f7f8fa;
}

.event-map-preview iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.event-map-preview-empty,
.event-map-preview-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
}

.event-map-preview-loading {
    background: rgba(255,255,255,.88);
    z-index: 2;
}

.event-map-status {
    min-height: 22px;
}

@media (max-width: 991.98px) {
    .event-location-modal .modal-dialog {
        max-width: calc(100% - 1rem);
        height: calc(100% - 1rem);
        margin: .5rem auto;
    }

    .event-map-preview {
        height: 260px;
    }
}

/* ========================================================================== */
/* POS BKY v1.41.31.4 - Compact Event Product card grid                       */
/* ========================================================================== */

.event-product-bulk-modal .modal-dialog {
    max-width: min(1500px, calc(100vw - 1.5rem));
}

.event-product-bulk-body {
    padding: 12px;
    background: #f4f7fb;
}

.event-product-bulk-table-head {
    display: none;
}

.event-product-bulk-rows {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.event-product-bulk-row,
.event-product-bulk-rows > .event-product-bulk-row:first-child {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    padding: 10px;
    gap: 9px;
    border: 1px solid #dce3ed;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 7px rgba(15, 23, 42, .04);
}

.event-product-bulk-row:hover {
    border-color: #b9c8dc;
    background: #fff;
    box-shadow: 0 5px 14px rgba(15, 23, 42, .08);
}

.event-product-bulk-card-head {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) 34px;
    gap: 8px;
    align-items: center;
}

.event-product-bulk-thumb {
    width: 54px;
    height: 54px;
    border-radius: 10px;
}

.event-product-bulk-packaging {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: .75rem;
    line-height: 1.25;
    color: #64748b;
}

.event-product-bulk-label {
    display: block;
    margin-bottom: 4px;
    font-size: .75rem;
    line-height: 1.2;
    font-weight: 700;
    color: #475569;
}

.event-product-bulk-sale-units {
    gap: 6px;
    padding: 8px;
    border: 1px solid #e5eaf1;
    border-radius: 10px;
    background: #f8fafc;
}

.event-product-bulk-sale-row {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 5px;
}

.event-product-bulk-sale-row .form-check-label,
.event-product-bulk-default-unit,
.event-product-bulk-card-status {
    font-size: .72rem;
}

.event-product-bulk-default-unit {
    justify-content: space-between;
    gap: 5px;
}

.event-product-bulk-default-unit .form-select {
    width: 94px;
}

.event-product-bulk-request-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
}

.event-product-bulk-request-grid label {
    min-width: 0;
    margin: 0;
}

.event-product-bulk-request-grid label span {
    display: block;
    margin-bottom: 2px;
    text-align: center;
    font-size: .68rem;
    color: #64748b;
}

.event-product-bulk-request-grid input {
    padding-left: 4px;
    padding-right: 4px;
    text-align: center;
}

.event-product-bulk-row .form-control,
.event-product-bulk-row .form-select,
.event-product-bulk-row .select2-container .select2-selection--single {
    min-height: 34px;
    font-size: .78rem;
}

.event-product-bulk-row .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: 8px;
    padding-right: 24px;
    line-height: 32px;
    font-size: .76rem;
}

.event-product-bulk-row .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 32px;
}

.event-product-bulk-row .input-group-text {
    padding: .25rem .35rem;
    font-size: .68rem;
}

.event-product-bulk-remove-wrap .btn {
    width: 32px;
    height: 32px;
    padding: 0;
}

.event-product-bulk-card-status {
    margin-top: auto;
    color: #0f8a4b;
}

@media (max-width: 1199.98px) {
    .event-product-bulk-rows {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .event-product-bulk-modal .modal-dialog {
        max-width: calc(100vw - .5rem);
        margin: .25rem auto;
    }
    .event-product-bulk-body {
        padding: 7px;
        overflow-x: hidden;
    }
    .event-product-bulk-rows {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }
    .event-product-bulk-row,
    .event-product-bulk-rows > .event-product-bulk-row:first-child {
        min-width: 0;
        padding: 7px;
        gap: 7px;
        border-radius: 10px;
    }
    .event-product-bulk-card-head {
        grid-template-columns: 44px minmax(0, 1fr) 28px;
        gap: 5px;
    }
    .event-product-bulk-thumb {
        width: 44px;
        height: 44px;
    }
    .event-product-bulk-remove-wrap .btn {
        width: 28px;
        height: 28px;
    }
    .event-product-bulk-sale-units {
        padding: 5px;
    }
    .event-product-bulk-sale-row {
        grid-template-columns: 55px minmax(0, 1fr);
    }
    .event-product-bulk-row .input-group-text {
        display: none;
    }
    .event-product-bulk-card-status {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .event-location-section {
        padding: 12px;
    }

    .event-map-preview {
        height: 220px;
    }

    .event-location-modal .modal-footer {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .event-location-modal .modal-footer .btn {
        width: 100%;
    }
}


/* ========================================================================== */
/* POS BKY v1.8.4 - Product Image                                             */
/* ========================================================================== */

.product-table-thumb {
    width: 56px;
    height: 56px;
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    background: #f8fafc;
}

.product-table-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-table-thumb.is-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--app-muted);
    font-size: 1.3rem;
}

.product-image-editor {
    position: sticky;
    top: 0;
}

.product-image-editor__preview {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: 16px;
    background: #f8fafc;
}

.product-image-editor__preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--app-muted);
    text-align: center;
}

.product-image-placeholder i {
    font-size: 2.4rem;
}

@media (max-width: 991.98px) {
    .product-image-editor {
        position: static;
    }

    .product-image-editor__preview {
        max-width: 340px;
        margin: 0 auto;
    }
}


/* POS BKY v1.8.4.3 - Product / Event Image */

.product-table-thumb {
    width: 64px;
    height: 64px;
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: #f8fafc;
}

.product-table-thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.product-table-thumb.is-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--app-muted);
    font-size: 1.35rem;
}


.event-product-preview-card {
    position: sticky;
    top: 0;
}

.event-product-preview-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: 16px;
    background: #f8fafc;
}

.event-product-preview-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.event-product-preview-name {
    margin-top: 12px;
    font-weight: 700;
}


.event-product-select-result {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 68px;
}

.event-product-select-result .product-table-thumb {
    flex: 0 0 auto;
}

.event-product-select-copy {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.event-product-select-name,
.event-product-select-code {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


@media (max-width: 991.98px) {

    .event-product-preview-card {
        position: static;
    }

    .event-product-preview-image {
        max-width: 320px;
        margin: 0 auto;
    }

    .event-product-preview-name,
    .event-product-preview-card > .small {
        text-align: center;
    }
}



/* ========================================================================== */
/* POS BKY v1.8.4.4 - Event Product Modal Image Fix                           */
/* ========================================================================== */

.event-product-modal .modal-content {
    overflow: hidden;
}

.event-product-modal .modal-body {
    overflow-x: hidden;
}

.event-product-modal-layout {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    min-width: 0;
}

.event-product-modal-product {
    min-width: 0;
}

.event-product-modal-thumb {
    width: 160px;
    height: 160px;
    max-width: 100%;
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: 14px;
    background: #f8fafc;
}

.event-product-modal-thumb img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
}

.event-product-modal-thumb .product-image-placeholder {
    width: 100%;
    height: 100%;
    min-height: 0;
}

.event-product-modal-product-info {
    width: 160px;
    max-width: 100%;
}

.event-product-modal-fields {
    min-width: 0;
}

.event-product-modal .select2-container {
    max-width: 100% !important;
}

.event-product-modal .select2-selection {
    max-width: 100%;
}

.event-product-modal .modal-footer {
    flex: 0 0 auto;
}

@media (max-width: 767.98px) {

    .event-product-modal .modal-dialog {
        max-width: calc(100% - 1rem);
        margin: .5rem auto;
    }

    .event-product-modal-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .event-product-modal-product {
        display: grid;
        grid-template-columns: 120px minmax(0, 1fr);
        gap: 14px;
        align-items: center;
    }

    .event-product-modal-thumb {
        width: 120px;
        height: 120px;
    }

    .event-product-modal-product-info {
        width: auto;
        min-width: 0;
    }

    .event-product-modal .event-product-preview-name {
        margin-top: 0;
        text-align: left;
        overflow-wrap: anywhere;
    }

    .event-product-modal-product-info .small {
        text-align: left;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 420px) {

    .event-product-modal-product {
        grid-template-columns: 92px minmax(0, 1fr);
    }

    .event-product-modal-thumb {
        width: 92px;
        height: 92px;
        border-radius: 12px;
    }

    .event-product-modal-thumb .product-image-placeholder i {
        font-size: 1.6rem;
    }

    .event-product-modal-thumb .product-image-placeholder span {
        font-size: .75rem;
    }
}


/* ========================================================================== */
/* POS BKY v1.9.2 - Promotion Modal Scroll Fix                                */
/* ========================================================================== */

/*
 * Promotion modal มี form ครอบ modal-body + modal-footer
 * Bootstrap modal-dialog-scrollable เดิมจึงไม่สามารถจัด flex/scroll
 * ให้ modal-body ได้สมบูรณ์
 *
 * โครงสร้างใหม่:
 *
 * modal-content
 * ├─ modal-header     = fixed
 * └─ form             = flex column
 *    ├─ modal-body    = scroll
 *    └─ modal-footer  = fixed
 */

.promotion-config-modal {
    --promotion-modal-space: 16px;
}


.promotion-config-modal .modal-dialog {
    width: auto;
    max-width: 1180px;

    height: calc(100vh - (var(--promotion-modal-space) * 2));
    height: calc(100dvh - (var(--promotion-modal-space) * 2));

    margin: var(--promotion-modal-space) auto;
}


.promotion-config-modal .modal-content {
    width: 100%;
    height: 100%;
    max-height: 100%;

    display: flex;
    flex-direction: column;

    overflow: hidden;
}


.promotion-config-modal .modal-header {
    flex: 0 0 auto;

    position: relative;
    z-index: 5;

    background: #fff;
}


.promotion-config-modal .promotion-config-form {
    flex: 1 1 auto;

    min-width: 0;
    min-height: 0;

    display: flex;
    flex-direction: column;

    overflow: hidden;
}


.promotion-config-modal .modal-body {
    flex: 1 1 auto;

    min-width: 0;
    min-height: 0;

    overflow-x: hidden !important;
    overflow-y: auto !important;

    overscroll-behavior: contain;

    -webkit-overflow-scrolling: touch;
}


.promotion-config-modal .modal-footer {
    flex: 0 0 auto;

    position: relative;
    z-index: 5;

    margin: 0;

    background: #fff;

    border-top: 1px solid var(--app-border);
}


/*
 * Step 1–10 อยู่ในพื้นที่ Scroll เท่านั้น
 * ไม่ให้ card หรือ input ดันความกว้าง Modal
 */
.promotion-config-modal #tierRates,
.promotion-config-modal #tierRows,
.promotion-config-modal .promotion-tier-row,
.promotion-config-modal .input-group,
.promotion-config-modal .form-control,
.promotion-config-modal .form-select,
.promotion-config-modal .select2-container {
    min-width: 0;
    max-width: 100%;
}


.promotion-config-modal #tierRates {
    overflow: hidden;
}


.promotion-config-modal #tierRates .app-card-body {
    padding-bottom: 12px;
}


/*
 * Scrollbar ให้ดูเรียบร้อยบน Desktop
 */
.promotion-config-modal .modal-body {
    scrollbar-width: thin;
}

.promotion-config-modal .modal-body::-webkit-scrollbar {
    width: 8px;
}

.promotion-config-modal .modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.promotion-config-modal .modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}


/* --------------------------------------------------------------------------
   Promotion Template Picker
   -------------------------------------------------------------------------- */

.promotion-picker-modal .modal-dialog {
    max-width: 1180px;

    height: calc(100vh - 2rem);
    height: calc(100dvh - 2rem);

    margin: 1rem auto;
}

.promotion-picker-modal .modal-content {
    max-height: 100%;

    overflow: hidden;
}

.promotion-picker-modal .modal-body {
    overflow-y: auto;

    overscroll-behavior: contain;

    -webkit-overflow-scrolling: touch;
}


/* --------------------------------------------------------------------------
   Tablet
   -------------------------------------------------------------------------- */

@media (max-width: 1199.98px) {

    .promotion-config-modal .modal-dialog,
    .promotion-picker-modal .modal-dialog {
        max-width: calc(100% - 2rem);
    }
}


/* --------------------------------------------------------------------------
   Mobile
   -------------------------------------------------------------------------- */

@media (max-width: 767.98px) {

    .promotion-config-modal {
        --promotion-modal-space: 8px;
    }

    .promotion-config-modal .modal-dialog,
    .promotion-picker-modal .modal-dialog {
        width: calc(100% - 1rem);
        max-width: calc(100% - 1rem);

        height: calc(100vh - 1rem);
        height: calc(100dvh - 1rem);

        margin: .5rem auto;
    }

    .promotion-config-modal .modal-content,
    .promotion-picker-modal .modal-content {
        border-radius: 14px;
    }

    .promotion-config-modal .modal-header,
    .promotion-config-modal .modal-body,
    .promotion-config-modal .modal-footer {
        padding-left: 14px;
        padding-right: 14px;
    }

    .promotion-config-modal .modal-footer {
        display: grid;
        grid-template-columns: 1fr 1fr;

        gap: 8px;
    }

    .promotion-config-modal .modal-footer .btn {
        width: 100%;
        margin: 0;
    }

    .promotion-config-modal .promotion-tier-row {
        grid-template-columns: 78px minmax(0, 1fr) 40px;
    }
}


/* --------------------------------------------------------------------------
   Very small mobile
   -------------------------------------------------------------------------- */

@media (max-width: 420px) {

    .promotion-config-modal .modal-footer {
        grid-template-columns: 1fr;
    }

    .promotion-config-modal .promotion-tier-row {
        grid-template-columns: 68px minmax(0, 1fr) 38px;

        gap: 6px;
    }

    .promotion-config-modal .promotion-tier-row .input-group-text {
        padding-left: 8px;
        padding-right: 8px;
    }
}



/* ==========================================================================
   POS BKY v1.14.1 - Report Table Spacing Fix
   ========================================================================== */

/*
 * Report tables intentionally use app-card-body.p-0 so the horizontal
 * separators can run full width.  Give the actual table content its own
 * comfortable inner spacing instead of letting text hug the card edge.
 */
.report-table-card .report-table > :not(caption) > * > * {
    padding: 13px 16px;
}

.report-table-card .report-table > thead > tr > th {
    padding-top: 12px;
    padding-bottom: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.report-table-card .report-table > tbody > tr > td {
    line-height: 1.45;
}

/*
 * Keep the first / last columns away from the rounded card boundary.
 */
.report-table-card .report-table > :not(caption) > * > *:first-child {
    padding-left: 18px;
}

.report-table-card .report-table > :not(caption) > * > *:last-child {
    padding-right: 18px;
}

/*
 * DataTables v2 puts length/search/info/pagination outside the <table>.
 * Add matching horizontal breathing room to those control rows.
 */
.report-table-card .dt-container > .dt-layout-row:not(.dt-layout-table) {
    margin: 0;
    padding: 12px 16px;
    gap: 12px;
}

.report-table-card .dt-container > .dt-layout-row:first-child {
    padding-top: 14px;
    padding-bottom: 10px;
}

.report-table-card .dt-container > .dt-layout-row:last-child {
    padding-top: 10px;
    padding-bottom: 14px;
}

/*
 * The table itself should still use the full available width.
 */
.report-table-card .dt-container .dt-layout-table,
.report-table-card .dt-container .dt-layout-cell {
    margin: 0;
}

.report-table-card .dt-container .dt-search,
.report-table-card .dt-container .dt-length,
.report-table-card .dt-container .dt-info,
.report-table-card .dt-container .dt-paging {
    margin: 0;
}

/*
 * Slightly softer hover cue makes wide report rows easier to follow.
 */
.report-table-card .report-table > tbody > tr:hover > * {
    background-color: rgba(13, 110, 253, .035);
}

@media (max-width: 767.98px) {

    .report-table-card .report-table > :not(caption) > * > * {
        padding: 11px 12px;
    }

    .report-table-card .report-table > :not(caption) > * > *:first-child {
        padding-left: 14px;
    }

    .report-table-card .report-table > :not(caption) > * > *:last-child {
        padding-right: 14px;
    }

    .report-table-card .dt-container > .dt-layout-row:not(.dt-layout-table) {
        padding-left: 12px;
        padding-right: 12px;
    }
}


/* ========================================================================== */
/* POS BKY v1.16 - User / Role / Permission Management                       */
/* ========================================================================== */

.user-permission-page .nav-tabs .nav-link {
    font-weight: 600;
}

.user-manage-card .table > :not(caption) > * > * {
    padding: 12px 14px;
}

.permission-matrix-wrap {
    max-height: calc(100vh - 300px);
    max-height: calc(100dvh - 300px);
}

.permission-matrix {
    min-width: 820px;
}

.permission-matrix > :not(caption) > * > * {
    padding: 11px 14px;
}

.permission-matrix thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #fff;
    white-space: nowrap;
    box-shadow: inset 0 -1px 0 var(--app-border);
}

.permission-matrix thead th:not(:first-child),
.permission-matrix tbody td:not(:first-child) {
    text-align: center;
    min-width: 92px;
}

.permission-matrix tbody td:first-child {
    min-width: 210px;
}

.permission-matrix .form-check-input {
    width: 1.15rem;
    height: 1.15rem;
    cursor: pointer;
}

.permission-matrix .user-override-select {
    min-width: 118px;
    font-size: .78rem;
}

.user-assignment-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-assignment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    background: #f8fafc;
}

.user-config-modal .modal-dialog {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    margin-top: 12px;
    margin-bottom: 12px;
}

.user-config-modal .modal-content,
.user-config-modal .user-config-form {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
}

.user-config-modal .user-config-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.user-config-modal .modal-header,
.user-config-modal .modal-footer {
    flex: 0 0 auto;
}

.user-config-modal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

@media (max-width: 767.98px) {
    .permission-matrix-wrap {
        max-height: calc(100dvh - 250px);
    }

    .user-config-modal .modal-dialog {
        height: 100dvh;
        max-height: 100dvh;
        margin: 0;
    }

    .user-config-modal .modal-content,
    .user-config-modal .user-config-form {
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }
}


/* ========================================================================== */
/* POS BKY v1.16.1 - Simple User Permission + System Settings                 */
/* ========================================================================== */
.permission-matrix .user-permission-toggle {
    min-width: 82px;
    padding: 6px 12px;
    border: 0;
    border-radius: 5px;
    font-weight: 600;
    font-size: .82rem;
    color: #fff;
    box-shadow: none;
    transition: transform .12s ease, opacity .12s ease, background-color .12s ease;
}
.permission-matrix .user-permission-toggle.is-allow { background: #28a745; }
.permission-matrix .user-permission-toggle.is-deny { background: #dc3545; }
.permission-matrix .user-permission-toggle:hover:not(:disabled) { color:#fff; transform:translateY(-1px); opacity:.92; }
.permission-matrix .user-permission-toggle:focus-visible { outline:3px solid rgba(13,110,253,.18); outline-offset:2px; }
.permission-matrix .user-permission-toggle:disabled { opacity:.72; }
.system-setting-card { overflow:hidden; }
.system-setting-icon {
    width:52px;height:52px;display:inline-flex;align-items:center;justify-content:center;
    border-radius:14px;background:rgba(13,110,253,.10);color:var(--bs-primary);font-size:1.45rem;
}
.system-setting-card .app-card-body { min-height:250px; }


/* ========================================================================== */
/* POS BKY v1.16.2 - Main Event Hub                                          */
/* ========================================================================== */

.main-event-hub .main-summary-value {
    margin-top: 4px;

    font-size: 1.9rem;
    font-weight: 750;
    line-height: 1.15;

    color: var(--app-text);
}

.main-current-shift {
    border-color: rgba(25, 135, 84, .28);

    background:
        linear-gradient(
            135deg,
            rgba(25, 135, 84, .055),
            rgba(25, 135, 84, .015)
        ),
        #fff;
}

.main-my-assignment {
    padding: 16px;

    border: 1px solid var(--app-border);
    border-radius: 14px;

    background: #fff;
}

.main-my-assignment:hover {
    border-color: rgba(13, 110, 253, .28);

    box-shadow:
        0 8px 22px rgba(15, 23, 42, .045);
}

.main-event-table > :not(caption) > * > * {
    padding: 14px 16px;
}

.main-event-table thead th {
    white-space: nowrap;

    font-size: .84rem;
    font-weight: 700;

    color: #475569;

    background: #f8fafc;
}

.main-event-table tbody td {
    vertical-align: top;
}

.main-event-table tbody tr:hover > * {
    background: rgba(13, 110, 253, .025);
}

.main-event-date-cell {
    min-width: 180px;
}

.main-team-list {
    display: flex;
    flex-direction: column;
    gap: 10px;

    min-width: 240px;
}

.main-team-booth {
    padding-bottom: 8px;

    border-bottom: 1px dashed #e2e8f0;
}

.main-team-booth:last-child {
    padding-bottom: 0;

    border-bottom: 0;
}

.main-team-users {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;

    margin-top: 6px;
}

.main-team-user {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;

    padding: 4px 8px;

    border: 1px solid #e2e8f0;
    border-radius: 999px;

    background: #fff;

    font-size: .78rem;
    line-height: 1.2;

    color: #334155;
}

.main-team-user small {
    padding-left: 5px;

    border-left: 1px solid #e2e8f0;

    color: #64748b;
}

.main-empty-state {
    padding: 46px 20px;

    text-align: center;

    color: #64748b;
}

.main-empty-state > i {
    font-size: 2.4rem;

    color: #94a3b8;
}

@media (max-width: 1199.98px) {

    .main-event-table > :not(caption) > * > * {
        padding: 12px 14px;
    }
}

@media (max-width: 767.98px) {

    .main-event-hub .app-page-header {
        gap: 14px;
    }

    .main-event-hub .app-page-header > .d-flex {
        width: 100%;
    }

    .main-event-hub .app-page-header > .d-flex .btn {
        flex: 1 1 auto;
    }

    .main-event-table {
        min-width: 1050px;
    }

    .main-event-hub .main-summary-value {
        font-size: 1.55rem;
    }
}



/* ========================================================================== */
.merchant-upload-box { background:#f8fafc; border-color:#dbe4ee !important; }
.merchant-upload-status { display:flex; align-items:center; padding:12px 14px; border-radius:10px; background:#e7f1ff; color:#0b5ed7; font-size:.9rem; }
.merchant-upload-status.d-none { display:none !important; }
.merchant-advanced summary { cursor:pointer; user-select:none; }
.merchant-advanced[open] { padding-top:8px; border-top:1px dashed #d7dee8; }
#merchantDecodedBox code { word-break:break-all; }


/* ========================================================================== */
/* POS BKY v1.16.5 - Merchant QR Payload Only                                */
/* ========================================================================== */

.merchant-payload-box {
    background: #f8fafc;
    border-color: #dbe4ee !important;
}

.merchant-payload-box textarea {
    min-height: 120px;
    resize: vertical;
}

#merchantDecodedBox code {
    word-break: break-all;
}


/* ========================================================================== */
/* POS BKY v1.16.6 - PromptPay Modal Fixed Header / Scroll Body / Fixed Footer */
/* ========================================================================== */

.promptpay-profile-modal .promptpay-profile-dialog {
    height: calc(100dvh - 32px);
    margin: 16px auto;
}

.promptpay-profile-modal .modal-content {
    height: 100%;
    max-height: 100%;

    display: flex;
    flex-direction: column;

    overflow: hidden;
}

.promptpay-profile-modal .modal-header {
    flex: 0 0 auto;
}

.promptpay-profile-modal .promptpay-profile-form {
    min-height: 0;
    flex: 1 1 auto;

    display: flex;
    flex-direction: column;

    overflow: hidden;
}

.promptpay-profile-modal .promptpay-profile-body {
    min-height: 0;
    flex: 1 1 auto;

    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;

    padding-bottom: 24px;
}

.promptpay-profile-modal .promptpay-profile-footer {
    flex: 0 0 auto;

    position: relative;
    z-index: 3;

    background: #fff;
    border-top: 1px solid #e9ecef;

    box-shadow:
        0 -8px 20px rgba(15, 23, 42, .06);
}

.promptpay-profile-modal .promptpay-profile-footer .btn {
    min-width: 110px;
}

@media (max-width: 767.98px) {

    .promptpay-profile-modal .promptpay-profile-dialog {
        width: 100%;
        max-width: none;
        height: 100dvh;

        margin: 0;
    }

    .promptpay-profile-modal .modal-content {
        height: 100dvh;
        max-height: 100dvh;

        border: 0;
        border-radius: 0;
    }

    .promptpay-profile-modal .promptpay-profile-body {
        padding:
            16px
            14px
            24px;
    }

    .promptpay-profile-modal .promptpay-profile-footer {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;

        padding:
            12px
            14px
            calc(12px + env(safe-area-inset-bottom));
    }

    .promptpay-profile-modal .promptpay-profile-footer > * {
        width: 100%;
        margin: 0 !important;
    }

    .promptpay-profile-modal .promptpay-profile-footer .btn {
        min-width: 0;
    }
}

@media (max-height: 650px) and (min-width: 768px) {

    .promptpay-profile-modal .promptpay-profile-dialog {
        height: calc(100dvh - 16px);
        margin: 8px auto;
    }
}


/* ========================================================================== */
/* POS BKY v1.17 - System Settings + Audit Log                               */
/* ========================================================================== */

.settings-section {
    scroll-margin-top: 82px;
}

.settings-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 12px;

    margin-bottom: 18px;
}

.settings-section-heading h3 {
    margin: 0 0 3px;

    font-size: 1rem;
    font-weight: 700;

    color: var(--app-text);
}

.settings-section-heading p {
    margin: 0;

    font-size: .84rem;

    color: #64748b;
}

.settings-section-icon {
    width: 38px;
    height: 38px;

    flex: 0 0 38px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: rgba(13, 110, 253, .09);
    color: var(--bs-primary);

    font-size: 1rem;
}

.settings-divider {
    margin: 26px 0;

    border-color: #e7edf3;
    opacity: 1;
}

.settings-payment-grid {
    display: grid;
    grid-template-columns:
        repeat(
            5,
            minmax(0, 1fr)
        );
    gap: 10px;
}

.settings-payment-item {
    min-width: 0;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 12px;

    border: 1px solid #e2e8f0;
    border-radius: 12px;

    background: #fff;

    cursor: pointer;
}

.settings-payment-item:hover {
    border-color: rgba(13, 110, 253, .32);
}

.settings-payment-item strong,
.settings-payment-item small {
    display: block;
}

.settings-payment-item small {
    margin-top: 2px;

    font-size: .72rem;

    color: #64748b;
}

.settings-payment-icon {
    width: 34px;
    height: 34px;

    flex: 0 0 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background: #f1f5f9;
    color: #334155;
}

.audit-table > :not(caption) > * > * {
    padding: 11px 12px;
}

.audit-table thead th {
    white-space: nowrap;

    font-size: .82rem;
    font-weight: 700;

    color: #475569;

    background: #f8fafc;
}

.audit-detail-cell {
    min-width: 220px;
    max-width: 420px;

    white-space: normal;
    word-break: break-word;
}

.audit-user-agent {
    min-width: 230px;
    max-width: 420px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: #64748b;

    font-size: .78rem;
}

@media (max-width: 1199.98px) {

    .settings-payment-grid {
        grid-template-columns:
            repeat(
                3,
                minmax(0, 1fr)
            );
    }
}

@media (max-width: 767.98px) {

    .settings-payment-grid {
        grid-template-columns:
            1fr;
    }

    .audit-table {
        min-width: 1050px;
    }
}


/* ========================================================================== */
/* POS BKY v1.17.2 - System Settings Card Footer                              */
/* ========================================================================== */

.system-settings-page .system-settings-footer {
    padding: 14px 18px;
    border-top: 1px solid #e7edf3;
    background: #f8fafc;
}

@media (max-width: 575.98px) {
    .system-settings-page .system-settings-footer {
        padding: 12px 14px;
    }

    .system-settings-page .system-settings-footer .btn {
        width: 100%;
    }
}


/* ========================================================================== */
/* POS BKY v1.18 - System Health                                              */
/* ========================================================================== */

.system-health-page .health-metric {
    margin-top: 4px;

    font-size: 1.8rem;
    font-weight: 750;
    line-height: 1.15;

    color: var(--app-text);
}

.system-health-page .health-info-box {
    height: 100%;

    padding: 12px;

    border: 1px solid #e2e8f0;
    border-radius: 12px;

    background: #f8fafc;
}

.system-health-page .health-info-box span,
.system-health-page .health-info-box strong {
    display: block;
}

.system-health-page .health-info-box span {
    margin-bottom: 4px;

    font-size: .75rem;
    color: #64748b;
}

.system-health-page .health-info-box strong {
    font-size: .95rem;
    color: #0f172a;
}


/* ========================================================================== */
/* POS BKY v1.19 - Event Readiness / Operations Dashboard                     */
/* ========================================================================== */

.event-readiness-page .readiness-summary-value {
    margin-top: 4px;

    font-size: 1.9rem;
    font-weight: 750;
    line-height: 1.15;

    color: var(--app-text);
}

.readiness-event-grid {
    display: grid;
    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );
    gap: 12px;
}

.readiness-event-card {
    display: block;

    padding: 14px;

    border: 1px solid #e2e8f0;
    border-radius: 14px;

    background: #fff;

    color: inherit;
    text-decoration: none;

    transition:
        border-color .15s ease,
        box-shadow .15s ease,
        transform .15s ease;
}

.readiness-event-card:hover {
    border-color: rgba(13, 110, 253, .35);

    box-shadow:
        0 8px 24px rgba(15, 23, 42, .06);

    transform: translateY(-1px);

    color: inherit;
}

.readiness-event-card.is-selected {
    border-color: rgba(13, 110, 253, .55);

    box-shadow:
        0 0 0 3px rgba(13, 110, 253, .08);
}

.readiness-score-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.readiness-score-row .progress {
    height: 7px;

    border-radius: 999px;
}

.readiness-big-score {
    text-align: right;
}

.readiness-big-score strong,
.readiness-big-score small {
    display: block;
}

.readiness-big-score strong {
    font-size: 1.6rem;
    line-height: 1;

    color: var(--app-text);
}

.readiness-big-score small {
    margin-top: 4px;

    color: #64748b;
}

.readiness-metric {
    height: 100%;

    padding: 12px;

    border: 1px solid #e2e8f0;
    border-radius: 12px;

    background: #f8fafc;
}

.readiness-metric span,
.readiness-metric strong,
.readiness-metric small {
    display: block;
}

.readiness-metric span {
    font-size: .75rem;

    color: #64748b;
}

.readiness-metric strong {
    margin-top: 3px;

    font-size: 1.35rem;

    color: #0f172a;
}

.readiness-metric small {
    margin-top: 2px;

    color: #64748b;
}

.readiness-check-list {
    display: flex;
    flex-direction: column;
}

.readiness-check-row {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 14px 16px;

    border-bottom: 1px solid #edf1f5;
}

.readiness-check-row:last-child {
    border-bottom: 0;
}

.readiness-check-row.is-critical {
    background: rgba(220, 53, 69, .035);
}

.readiness-check-icon {
    width: 30px;

    flex: 0 0 30px;

    text-align: center;

    font-size: 1.25rem;
}

.readiness-all-good {
    display: flex;
    flex-direction: column;
    align-items: center;

    padding: 30px 18px;

    text-align: center;

    color: #198754;
}

.readiness-all-good i {
    margin-bottom: 8px;

    font-size: 2.4rem;
}

.readiness-all-good span {
    margin-top: 4px;

    font-size: .8rem;

    color: #64748b;
}

.readiness-empty {
    padding: 50px 20px;

    text-align: center;

    color: #64748b;
}

.readiness-empty > i {
    font-size: 2.5rem;

    color: #94a3b8;
}

.readiness-setup-card {
    border-color: rgba(13, 110, 253, .25);
}

@media (max-width: 1199.98px) {

    .readiness-event-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }
}

@media (max-width: 767.98px) {

    .readiness-event-grid {
        grid-template-columns: 1fr;
    }

    .event-readiness-page .readiness-summary-value {
        font-size: 1.55rem;
    }

    .readiness-check-row {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .readiness-check-row .btn {
        width: 100%;
        margin-left: 42px;
    }
}


/* ========================================================================== */
/* POS BKY v1.20 - Production Go-Live + UAT                                  */
/* ========================================================================== */

.go-live-final-card {
    overflow: hidden;
}

.go-live-final-card.is-ready {
    border-color: rgba(25, 135, 84, .28);

    background:
        linear-gradient(
            135deg,
            rgba(25, 135, 84, .06),
            rgba(25, 135, 84, .015)
        ),
        #fff;
}

.go-live-final-card.is-not-ready {
    border-color: rgba(255, 193, 7, .35);

    background:
        linear-gradient(
            135deg,
            rgba(255, 193, 7, .07),
            rgba(255, 193, 7, .015)
        ),
        #fff;
}

.go-live-final-icon {
    width: 54px;
    height: 54px;

    flex: 0 0 54px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 15px;

    background: #fff;

    box-shadow:
        0 4px 14px rgba(15, 23, 42, .08);

    color: var(--bs-primary);

    font-size: 1.45rem;
}

.go-live-final-progress {
    height: 10px;

    border-radius: 999px;
}

.go-live-metric {
    margin-top: 4px;

    font-size: 1.8rem;
    font-weight: 750;
    line-height: 1.15;

    color: var(--app-text);
}

.go-live-check-list {
    display: flex;
    flex-direction: column;
}

.go-live-check-row {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 14px 16px;

    border-bottom: 1px solid #edf1f5;
}

.go-live-check-row:last-child {
    border-bottom: 0;
}

.go-live-check-icon {
    width: 30px;

    flex: 0 0 30px;

    text-align: center;

    font-size: 1.2rem;
}

.uat-run-header,
.uat-signoff-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    padding: 14px;

    border: 1px solid #e2e8f0;
    border-radius: 12px;

    background: #f8fafc;
}

.uat-score {
    text-align: right;
}

.uat-score strong,
.uat-score span {
    display: block;
}

.uat-score strong {
    font-size: 1.5rem;
    line-height: 1;

    color: #0f172a;
}

.uat-score span {
    margin-top: 4px;

    font-size: .72rem;

    color: #64748b;
}

.uat-mini-stat {
    height: 100%;

    padding: 10px 12px;

    border: 1px solid #e2e8f0;
    border-radius: 10px;

    background: #fff;
}

.uat-mini-stat span,
.uat-mini-stat strong {
    display: block;
}

.uat-mini-stat span {
    font-size: .7rem;

    color: #64748b;
}

.uat-mini-stat strong {
    margin-top: 3px;

    font-size: 1.15rem;
}

.uat-group-title {
    margin-top: 16px;
    padding: 8px 12px;

    border-radius: 8px;

    background: #eef2f7;

    font-size: .78rem;
    font-weight: 700;

    color: #475569;
}

.uat-group-title:first-child {
    margin-top: 0;
}

.uat-item {
    display: grid;
    grid-template-columns:
        minmax(0, 1.3fr)
        minmax(300px, .7fr);
    gap: 16px;

    padding: 14px 12px;

    border-bottom: 1px solid #edf1f5;
}

.uat-item-main {
    min-width: 0;
}

.uat-result-panel {
    min-width: 0;
}

.uat-status-buttons {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 5px;
}

.uat-status-buttons .btn {
    min-width: 78px;
}

.go-live-empty {
    padding: 44px 20px;

    text-align: center;

    color: #64748b;
}

.go-live-empty > i {
    font-size: 2.4rem;

    color: #94a3b8;
}

@media (max-width: 991.98px) {

    .uat-item {
        grid-template-columns: 1fr;
    }

    .uat-status-buttons {
        justify-content: flex-start;
    }
}

@media (max-width: 575.98px) {

    .go-live-check-row {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .go-live-check-row .btn {
        width: 100%;
        margin-left: 42px;
    }

    .uat-run-header,
    .uat-signoff-box {
        align-items: stretch;
        flex-direction: column;
    }

    .uat-score {
        text-align: left;
    }

    .uat-signoff-box .btn {
        width: 100%;
    }

    .uat-status-buttons {
        display: grid;
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }

    .uat-status-buttons .btn {
        width: 100%;
        min-width: 0;
    }
}


/* v1.20.1 - DataTables length label spacing */
div.dt-container .dt-length label {
    margin-left: 8px;
}

/* Ensure form controls/components inherit Prompt */
button,
input,
select,
textarea,
.form-control,
.form-select,
.btn,
.select2-container,
.dt-container {
    font-family: "Prompt", sans-serif !important;
}


/* ========================================================================== */
/* POS BKY v1.21 - Full System Data Reset                                     */
/* ========================================================================== */

.app-nav-link-danger {
    color: #b42318;
}

.app-nav-link-danger:hover,
.app-nav-link-danger.active {
    color: #b42318;
    background: rgba(220, 53, 69, .08);
}

.system-setting-danger-card {
    border-color: rgba(220, 53, 69, .22);
}

.system-reset-danger {
    border-color: rgba(220, 53, 69, .35);

    background:
        linear-gradient(
            135deg,
            rgba(220, 53, 69, .07),
            rgba(220, 53, 69, .015)
        ),
        #fff;
}

.system-reset-danger-icon {
    width: 54px;
    height: 54px;

    flex: 0 0 54px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 15px;

    color: #dc3545;
    background: rgba(220, 53, 69, .1);

    font-size: 1.45rem;
}

.system-reset-number {
    margin-top: 4px;

    font-size: 1.8rem;
    font-weight: 700;

    line-height: 1.1;
}

.system-reset-scope-item {
    min-height: 46px;

    display: flex;
    align-items: center;
    gap: 9px;

    padding: 10px 12px;

    border: 1px solid #e4e9ef;
    border-radius: 10px;

    font-size: .9rem;
}

.system-reset-scope-item.delete {
    color: #842029;
    background: #fff7f7;
}

.system-reset-scope-item.delete > i {
    color: #dc3545;
}

.system-reset-scope-item.keep {
    color: #0f5132;
    background: #f5fcf8;
}

.system-reset-scope-item.keep > i {
    color: #198754;
}

.system-reset-action-card {
    position: sticky;
    top: 82px;

    border-color: rgba(220, 53, 69, .25);
}

.system-reset-footer {
    padding: 14px 16px;

    border-top: 1px solid #e8ebef;

    background: #fafbfc;
}

@media (max-width: 1199.98px) {

    .system-reset-action-card {
        position: static;
    }
}


/* =========================================================
   Sidebar Scroll
   ซ่อน Scrollbar แต่ยัง Scroll ได้
========================================================= */

.app-sidebar,
.app-sidebar-nav,
.sidebar-nav {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.app-sidebar::-webkit-scrollbar,
.app-sidebar-nav::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

/* ========================================================================== */
/* POS BKY v1.41.7 hotfix - Event Product multi-row add modal                  */
/* ========================================================================== */

.event-product-bulk-modal .modal-dialog {
    max-width: min(1400px, calc(100vw - 2rem));
}

.event-product-bulk-modal .modal-content {
    max-height: calc(100vh - 2rem);
    overflow: hidden;
}

.event-product-bulk-form {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
}

.event-product-bulk-body {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 1.25rem;
}

.event-product-bulk-modal .modal-header,
.event-product-bulk-modal .modal-footer {
    flex: 0 0 auto;
    background: #fff;
    z-index: 2;
}

.event-product-bulk-table-head,
.event-product-bulk-row {
    display: grid;
    grid-template-columns: 76px minmax(340px, 2.4fr) minmax(190px, 1fr) minmax(360px, 2.1fr) 76px;
    column-gap: 18px;
    align-items: center;
}

.event-product-bulk-table-head {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 10px 12px;
    margin: -1rem -1rem 0;
    border-bottom: 1px solid #cfd7e2;
    background: #fff;
    font-weight: 700;
    color: #111827;
}

.event-product-bulk-rows {
    display: flex;
    flex-direction: column;
}

/* Keep the first dynamically-added row visually centered like later rows. */
.event-product-bulk-rows > .event-product-bulk-row:first-child {
    padding-top: 18px;
    padding-bottom: 18px;
}

.event-product-bulk-row {
    min-height: 92px;
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
}

.event-product-bulk-row:hover {
    background: #fbfdff;
}

.event-product-bulk-field,
.event-product-bulk-product-wrap,
.event-product-bulk-packaging {
    min-width: 0;
}

.event-product-bulk-image-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.event-product-bulk-thumb {
    width: 64px;
    height: 64px;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: #f8fafc;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.event-product-bulk-thumb .product-table-thumb {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
}

.event-product-bulk-thumb .product-table-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.event-product-bulk-thumb .product-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9aa6b2;
}


.event-product-bulk-sale-units {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.event-product-bulk-sale-row {
    display: grid;
    grid-template-columns: 92px minmax(180px, 1fr);
    gap: 10px;
    align-items: center;
}

.event-product-bulk-default-unit {
    display: flex;
    align-items: center;
    gap: 10px;
}

.event-product-bulk-default-unit .form-select {
    width: 120px;
    min-height: 34px;
}

.event-product-bulk-packaging {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .95rem;
    color: #111827;
}

.event-product-bulk-row .form-control,
.event-product-bulk-row .form-select,
.event-product-bulk-row .select2-container .select2-selection--single {
    min-height: 42px;
}

.event-product-bulk-row .select2-container .select2-selection--single {
    display: flex;
    align-items: center;
}

.event-product-bulk-row .select2-container--default .select2-selection--single .select2-selection__rendered {
    display: block;
    min-width: 0;
    padding-left: 12px;
    padding-right: 34px;
    line-height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-product-bulk-row .select2-selection__clear {
    display: none !important;
}

.event-product-bulk-row .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
}

.event-product-bulk-remove-wrap {
    display: flex;
    justify-content: center;
}

.event-product-bulk-remove-wrap .btn {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 991.98px) {
    .event-product-bulk-modal .modal-dialog {
        max-width: calc(100vw - 1rem);
        margin: .5rem auto;
    }

    .event-product-bulk-modal .modal-content {
        max-height: calc(100vh - 1rem);
    }

    .event-product-bulk-row {
        grid-template-columns: 70px minmax(300px, 2fr) minmax(180px, 1fr) minmax(340px, 2fr) 60px;
        gap: 10px;
        min-width: 1050px;
    }

    .event-product-bulk-body {
        overflow-x: auto;
    }
}

/* v1.41.31.4 final cascade overrides (must remain after v1.41.7 rules). */
.event-product-bulk-modal .modal-dialog{max-width:min(1500px,calc(100vw - 1.5rem))}
.event-product-bulk-body{padding:12px;overflow-x:hidden;background:#f4f7fb}
.event-product-bulk-table-head{display:none}
.event-product-bulk-rows{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.event-product-bulk-row,
.event-product-bulk-rows>.event-product-bulk-row:first-child{display:flex;flex-direction:column;align-items:stretch;min-width:0;min-height:0;padding:10px;gap:9px;border:1px solid #dce3ed;border-radius:14px;background:#fff;box-shadow:0 2px 7px rgba(15,23,42,.04)}
.event-product-bulk-row:hover{border-color:#b9c8dc;background:#fff;box-shadow:0 5px 14px rgba(15,23,42,.08)}
.event-product-bulk-card-head{display:grid;grid-template-columns:54px minmax(0,1fr);gap:8px;align-items:center;width:100%}
.event-product-bulk-product-wrap{display:block;width:100%;max-width:none}
.event-product-bulk-product-wrap .select2-container{width:100%!important;max-width:none}
.event-product-bulk-thumb{width:54px;height:54px;border-radius:10px}
.event-product-bulk-packaging{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:.75rem;line-height:1.25;color:#64748b}
.event-product-bulk-label{display:block;margin-bottom:4px;font-size:.75rem;line-height:1.2;font-weight:700;color:#475569}
.event-product-bulk-sale-units{gap:6px;padding:8px;border:1px solid #e5eaf1;border-radius:10px;background:#f8fafc}
.event-product-bulk-sale-row{grid-template-columns:64px minmax(0,1fr);gap:5px}
.event-product-bulk-sale-row .form-check-label,.event-product-bulk-default-unit,.event-product-bulk-card-status{font-size:.72rem}
.event-product-bulk-default-unit{justify-content:space-between;gap:5px}
.event-product-bulk-default-unit .form-select{width:94px;min-height:34px}
.event-product-bulk-request-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
.event-product-bulk-request-grid label{min-width:0;margin:0}
.event-product-bulk-request-grid label span{display:block;margin-bottom:2px;text-align:center;font-size:.68rem;color:#64748b}
.event-product-bulk-request-grid input{padding-left:4px;padding-right:4px;text-align:center}
.event-product-bulk-row .form-control,.event-product-bulk-row .form-select,.event-product-bulk-row .select2-container .select2-selection--single{min-height:34px;font-size:.78rem}
.event-product-bulk-row .select2-container--default .select2-selection--single .select2-selection__rendered{padding-left:8px;padding-right:24px;line-height:32px;font-size:.76rem}
.event-product-bulk-row .select2-container--default .select2-selection--single .select2-selection__arrow{height:32px}
.event-product-bulk-row .input-group-text{padding:.25rem .35rem;font-size:.68rem}
.event-product-bulk-remove-wrap{width:100%;margin-top:2px}
.event-product-bulk-remove-wrap .btn{width:100%;height:34px;padding:.25rem .5rem;font-size:.75rem}
.event-product-bulk-card-status{margin-top:auto;color:#0f8a4b}
@media(max-width:1199.98px){.event-product-bulk-rows{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:767.98px){
 .event-product-bulk-modal .modal-dialog{max-width:calc(100vw - .5rem);margin:.25rem auto}
 .event-product-bulk-body{padding:7px;overflow-x:hidden}
 .event-product-bulk-rows{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
 .event-product-bulk-row,.event-product-bulk-rows>.event-product-bulk-row:first-child{min-width:0;padding:7px;gap:7px;border-radius:10px}
 .event-product-bulk-card-head{grid-template-columns:44px minmax(0,1fr);gap:5px}
 .event-product-bulk-thumb{width:44px;height:44px}
 .event-product-bulk-remove-wrap .btn{width:100%;height:32px;padding:.2rem .3rem;font-size:.68rem}
 .event-product-bulk-sale-units{padding:5px}
 .event-product-bulk-sale-row{grid-template-columns:55px minmax(0,1fr)}
 .event-product-bulk-row .input-group-text,.event-product-bulk-card-status{display:none}
}
