﻿/* =========================================================
   GLOBAL RESET
========================================================= */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    /* Reserve space for the vertical scrollbar at all times so that
       opening/closing a Bootstrap modal (which toggles body overflow
       and injects padding-right) does NOT cause a horizontal layout
       shift / flicker when the scrollbar reappears. */
    scrollbar-gutter: stable;
}

/* =========================================================
   MODAL FLICKER FIX
   ---------------------------------------------------------
   Bootstrap adds inline `padding-right` to <body> while a modal
   is open to compensate for the scrollbar it just hid. With
   `scrollbar-gutter: stable` above the gutter is already
   reserved, so that extra padding causes a visible shift when
   the modal closes. Neutralize it.
========================================================= */
body.modal-open {
    padding-right: 0 !important;
    overflow: hidden;
}

/* =========================================================
   AUTH PAGES
========================================================= */
.auth-page {
    overflow: hidden;
    background: url('/assets/media/auth/bg4.jpg') center/cover no-repeat;
}

[data-bs-theme="dark"].auth-page {
    background-image: url('/assets/media/auth/bg4-dark.jpg');
}

.auth-container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

.auth-left, .auth-right {
    width: 50%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-right {
    padding: 2rem;
}

@media (max-width: 992px) {
    .auth-container { flex-direction: column; }
    .auth-left, .auth-right { width: 100%; height: 50%; }
}

/* =========================================================
   COMPACT CARD SYSTEM (GLOBAL FIX)
========================================================= */
.card {
    border-radius: 0.6rem;
    overflow: hidden;
}

/* 🔥 SINGLE SOURCE OF TRUTH (REMOVED DUPLICATES) */
.kt-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px; /* compact */
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
}

.kt-card-header::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 3px;
    background: #3b82f6;
}

.kt-card-title {
    margin: 0;
    font-size: 12.5px;
    font-weight: 600;
    padding-left: 6px;
    color: #111827;
    text-transform: uppercase;
}

.kt-card-body {
    padding: 8px 10px;
}

/* =========================================================
   FILE: merchant-details-compact.css
   MODULE: Merchant UI (Parent & Child Details)
-----------------------------------------------------------
   PURPOSE
   -------
   Ultra-compact styling for:
   - Parent Merchant Details Card
   - Child Merchant Details Card

   DESIGN GOALS
   ------------
   ✔ Reduce vertical height (50%+ compact)
   ✔ Remove unnecessary whitespace
   ✔ Maintain readability
   ✔ Keep UI clean and professional
   ✔ Bootstrap override safe

========================================================= */


/* ===============================
   CARD CONTAINER
================================ */
.parent-merchant-card {
    border: 1px solid #e4e6ef;
    border-left: 2px solid #009ef7;
    background: #f9fbfd;
    margin-bottom: 8px;
}


    /* ===============================
   HEADER (ULTRA COMPACT)
================================ */
    .parent-merchant-card .card-header {
        padding: 4px 8px !important;
        min-height: unset !important;
        height: auto !important;
        line-height: 1.1;
        display: flex;
        align-items: center;
        border-bottom: 1px solid #eef0f3;
    }

    /* Title */
    .parent-merchant-card .card-title {
        font-size: 12.5px;
        font-weight: 500;
        margin: 0;
        line-height: 1.2;
        color: #2b2f3a;
    }

        /* Icon */
        .parent-merchant-card .card-title i {
            font-size: 12px;
            margin-right: 5px;
            vertical-align: middle;
        }


    /* ===============================
   BODY (COMPACT)
================================ */
    .parent-merchant-card .card-body {
        padding: 8px 10px;
    }


    /* ===============================
   GRID SPACING CONTROL
================================ */
    .parent-merchant-card .row {
        --bs-gutter-x: 8px;
        --bs-gutter-y: 6px;
    }


/* ===============================
   INFO BOX (KEY-VALUE BLOCK)
================================ */
.info-box {
    background: #ffffff;
    border: 1px solid #f1f1f1;
    border-radius: 5px;
    padding: 4px 8px;
    line-height: 1.2;
    transition: none;
}

    /* Remove hover effect for dense UI */
    .info-box:hover {
        box-shadow: none;
    }


/* ===============================
   LABEL (UPPERCASE, LIGHT)
================================ */
.info-label {
    font-size: 10px;
    color: #8a8f9f;
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 0;
    line-height: 1.1;
}


/* ===============================
   VALUE (READABLE, NOT HEAVY)
================================ */
.info-value {
    font-size: 12px;
    font-weight: 500;
    color: #2b2f3a;
    line-height: 1.2;
    margin-top: 1px;
    word-break: break-word;
}


/* ===============================
   REMOVE DEFAULT HEADING SPACING
================================ */
.parent-merchant-card h1,
.parent-merchant-card h2,
.parent-merchant-card h3,
.parent-merchant-card h4,
.parent-merchant-card h5,
.parent-merchant-card h6 {
    margin: 0;
    padding: 0;
}


/* ===============================
   RESPONSIVE TWEAKS (MOBILE)
================================ */
@media (max-width: 768px) {

    .parent-merchant-card .card-body {
        padding: 6px 8px;
    }

    .info-box {
        padding: 4px 6px;
    }

    .info-label {
        font-size: 9.5px;
    }

    .info-value {
        font-size: 11.5px;
    }
}

/* =========================================================
   TABLE COMPACT
========================================================= */
.table-sm-10 {
    font-size: 12px;
    border-collapse: collapse;
}

.table-sm-10 th,
.table-sm-10 td {
    border: 1px solid #dee2e6;
    padding: 3px 5px;
}

/* Child merchant table */
#kt_child_merchant_table th,
#kt_child_merchant_table td {
    padding: 5px 8px !important;
}

#kt_child_merchant_table .btn,
#kt_terminals_table .btn {
    padding: 2px 6px !important;
    font-size: 11px;
}

/* =========================================================
   TERMINAL TABLE
========================================================= */
.terminal-table {
    border-collapse: collapse !important;
}

.terminal-table th,
.terminal-table td {
    border: 1px solid #dee2e6 !important;
}

/* =========================================================
   BADGES
========================================================= */
.badge.bg-light-primary {
    background-color: #eef6ff !important;
    font-size: 10px;
    padding: 3px 6px;
}

.terminal-badge {
    position: absolute;
    top: 0;
    left: 100%;
    transform: translate(-40%, -40%);
    font-size: 10px;
    padding: 0 4px;
    height: 16px;
    line-height: 16px;
    background: #dc3545;
    color: #fff;
    border-radius: 4px;
}

/* =========================================================
   REPORT FILTERS (COMPACT)
========================================================= */
.report-filters {
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 1.5rem;
}

.report-filters .form-control {
    height: 32px;
    font-size: 12px;
}

.report-filters .btn-icon {
    height: 32px;
    width: 32px;
}

/* =========================================================
   UTILITIES
========================================================= */
.cursor-pointer { cursor: pointer; }
.text-justify { text-align: justify; }

.is-invalid {
    border-color: #f1416c !important;
}

/* =========================================================
   SCROLL (CLEAN)
========================================================= */
.hover-scroll-overlay-y {
    overflow-y: auto;
}

.hover-scroll-overlay-y::-webkit-scrollbar {
    width: 6px;
}

.hover-scroll-overlay-y:hover::-webkit-scrollbar-thumb {
    background: rgba(120,120,120,0.5);
}

/* Smooth blur masking */
.maskable {
    display: inline-block;
    white-space: nowrap;
    font-family: var(--bs-font-monospace, monospace);
    filter: blur(6px);
    transition: filter 0.2s ease-in-out;
}

    /* Unmasked state */
    .maskable.unmasked {
        filter: blur(0);
    }

/* Smooth colored accent border feel */
.stat-card {
    transition: all 0.2s ease;
    border-left-width: 4px !important;
}

    /* Slight hover enhancement */
    .stat-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 0.75rem 1.5rem rgba(0,0,0,0.08);
    }

/* Icon container */
.icon-wrapper {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}



#kt_upload_merchant_status_table th,
#kt_upload_merchant_status_table td {
    vertical-align: middle;
}

    #kt_upload_merchant_status_table td:nth-child(4),
    #kt_upload_merchant_status_table th:nth-child(4) {
        /*white-space: nowrap !important;*/
    }
/*
#kt_upload_merchant_status_table {
    table-layout: fixed;
}*/

/*#kt_upload_merchant_status_table {
    width: 100% !important;
}*/

    #kt_upload_merchant_status_table th:first-child,
    #kt_upload_merchant_status_table td:first-child {
        white-space: nowrap;
    }

/* =============================================================================
   STAT CARD COLORED SHADOWS
============================================================================= */

.stat-card {
    transition: all 0.2s ease-in-out;
}

    /* Base hover effect (optional but recommended) */
    .stat-card:hover {
        transform: translateY(-2px);
    }

/* Individual color shadows */
.shadow-primary {
    box-shadow: 0 4px 14px rgba(13, 110, 253, 0.25);
}

.dashboard-toast-wrapper {
    z-index: 1100;
}

.dashboard-kpi-nowrap {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shadow-info {
    box-shadow: 0 4px 14px rgba(13, 202, 240, 0.25);
}

.shadow-warning {
    box-shadow: 0 4px 14px rgba(255, 193, 7, 0.25);
}

.shadow-danger {
    box-shadow: 0 4px 14px rgba(220, 53, 69, 0.25);
}

.shadow-success {
    box-shadow: 0 4px 14px rgba(25, 135, 84, 0.25);
}

/* =========================================================
   TABLE: COLUMN WRAPPING UTILITIES
   Applied dynamically by InitialiseDatatables() based on
   header text. 'nowrap-col' keeps cells on one line.
   'wrap-col' lets the browser word-wrap naturally and
   justifies the text inside description-style cells.
========================================================= */
.nowrap-col {
    white-space: nowrap !important;
}

.wrap-col {
    white-space: normal !important;
    word-break: normal;
    overflow-wrap: break-word;
    text-align: justify !important;
    text-justify: inter-word;
}

/* =========================================================
   MERCHANT DETAILS SPLIT LAYOUT
   Left panel (profile + balance + audit) is fixed/sticky;
   right panel (tabs and details) scrolls independently.
========================================================= */
.merchant-split-layout {
    align-items: flex-start;
}

.merchant-left-panel {
    position: sticky;
    top: 90px; /* offset for portal header */
    align-self: flex-start;
    overflow: visible;
}

/* (scrollbar styling removed - left panel no longer scrolls) */

/* Compact left-panel internals to avoid any vertical scroll */
.merchant-left-card .card-body {
    padding: 1rem !important;
}

.merchant-left-card .kt-card-header {
    padding: 6px 14px !important;
}

.merchant-left-card .kt-card-body {
    padding: 8px 14px !important;
}

.merchant-left-card .kt-card-title {
    font-size: 13px;
}

.merchant-left-card table td {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    font-size: 13px;
    line-height: 1.3;
}

.merchant-left-card .separator {
    margin-top: 0.75rem !important;
    margin-bottom: 1rem !important;
}

.merchant-left-card .symbol.symbol-80px > img {
    width: 80px;
    height: 80px;
    object-fit: cover;
}

/* Stack the inner cards (Balance + Audit) vertically inside the narrow left panel */
.merchant-left-panel .row > [class*="col-lg-"],
.merchant-left-panel .row > [class*="col-md-"] {
    flex: 0 0 100%;
    max-width: 100%;
}

.merchant-right-panel {
    /* right side scrolls with the page naturally */
}

/* Hide terminal Actions column in Merchant Profile > All Transactions */
#kt_terminals_table thead th:last-child,
#kt_terminals_table tbody td:last-child {
    display: none;
}

.merchant-chart-placeholder {
    height: 150px;
    border: 1px solid var(--bs-gray-300);
    border-radius: 0.475rem;
    background:
        linear-gradient(135deg, rgba(0,0,0,0.02) 25%, transparent 25%) -8px 0/16px 16px,
        linear-gradient(225deg, rgba(0,0,0,0.02) 25%, transparent 25%) -8px 0/16px 16px,
        linear-gradient(315deg, rgba(0,0,0,0.02) 25%, transparent 25%) 0 0/16px 16px,
        linear-gradient(45deg, rgba(0,0,0,0.02) 25%, transparent 25%) 0 0/16px 16px,
        #fff;
}

/* On smaller screens, drop the sticky behavior and stack the panels */
@media (max-width: 991.98px) {
    .merchant-left-panel {
        position: static;
        top: auto;
    }
}

.child-merchant-view-shell .table th,
.child-merchant-view-shell .table td {
    font-size: 12px;
    vertical-align: middle;
}

.child-merchant-view-shell .border {
    border-color: var(--bs-gray-400) !important;
}

.child-merchant-view-header h3 {
    line-height: 1.2;
}

.child-merchant-view-shell .symbol.symbol-75px > .symbol-label {
    width: 75px;
    height: 75px;
}

/* Keep the description header readable (centered like other headers) */
th.wrap-col {
    text-align: center !important;
}

/* =========================================================
   MODAL SMOOTH OPEN / CLOSE ANIMATION
   ---------------------------------------------------------
   Bootstrap 5's default .fade transition is very short
   (150ms opacity only) and the dialog "snap" can feel
   abrupt. The rules below:
     - Lengthen the backdrop + dialog transitions
     - Add a gentle scale + translateY on open
     - Reverse smoothly on close
   Applies globally to every .modal in the app.
   ========================================================= */

/* Backdrop fade — slightly longer and eased */
.modal-backdrop.fade {
    transition: opacity 0.25s ease-in-out;
}

.modal-backdrop.show {
    opacity: 0.5;
}

/* Dialog: fade + subtle lift + scale */
.modal.fade .modal-dialog {
    transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1),
                opacity 0.25s ease-in-out;
    transform: translateY(-20px) scale(0.98);
    opacity: 0;
}

/* ====================================================================
   DataTables 2.x search box -- Metronic-styled, label-free
   --------------------------------------------------------------------
   Used by the Reports / All Reports screen (Views/Reports/AllReports.cshtml
   + wwwroot/assets/js/app/reports/all-reports.js).

   This project loads DataTables 2.x (via the Metronic datatables bundle).
   In v2:
     * The search wrapper is div.dt-search (NOT v1's .dataTables_filter).
     * The layout is configured via the `layout` option; all-reports.js
       places the search box in `topStart` and the pagination in
       `bottomEnd`, with `info: false` to suppress the
       "Showing X to Y of Z" line.
     * The default markup wraps the <input> in a <label>. Metronic's
       .form-control-solid rule then pushes the label text and the input
       onto separate lines.
   all-reports.js -> styleSearchInput() removes the wrapping <label>
   outright, applies Metronic .form-control-solid styling, and sets a
   "Search" placeholder so the input renders as a clean Metronic textbox
   with no visible label. The rules below pin it LEFT in the layout grid.
   Scoped to #reportResultsCard so no other DataTable on the site is
   affected.
   ==================================================================== */

/* The DataTables 2.x layout grid -- top row (search) + bottom row (paging). */
#reportResultsCard .dt-layout-row {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    margin-bottom: 0.75rem;
}

#reportResultsCard .dt-layout-cell {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
}

#reportResultsCard .dt-layout-cell.dt-layout-start {
    justify-content: flex-start !important;
}

#reportResultsCard .dt-layout-cell.dt-layout-end {
    justify-content: flex-end !important;
}

/* The search wrapper -- single inline cell with no label. */
#reportResultsCard div.dt-search,
#reportResultsCard .rpt-inline-control {
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
    width: auto !important;
    float: none !important;
}

/* Search <input> -- Metronic solid styling, sensible width. */
#reportResultsCard div.dt-search input,
#reportResultsCard div.dt-search .form-control,
#reportResultsCard div.dt-search .form-control-solid {
    display: inline-block !important;
    width: 280px !important;
    margin-left: 0 !important;
    float: none !important;
    vertical-align: middle !important;
}

/* All report-table column headers are ALWAYS centre-aligned, regardless
   of the schema's per-column align hint (which is honoured for data
   cells only). DataTables auto-applies columns[i].className to both
   <th> and <td>, so we override the <th> alignment here with
   !important to win against text-start / text-end that DataTables
   paints on the header cell. */
#tblReports thead th,
#tblReports thead th.text-start,
#tblReports thead th.text-end,
#tblReports thead th.text-left,
#tblReports thead th.text-right {
    text-align: center !important;
}

/* Reports table cell padding -- the metadata-driven reports often have
   12+ columns whose text lengths vary wildly. Without explicit
   horizontal padding, adjacent headers like "MERCHANT CATEGORY CODE"
   and "MERCHANT CATEGORY NAME" run into each other (Metronic's
   table-striped default collapses padding to almost nothing). The
   rules below give every header AND every body cell consistent
   left/right breathing room. Vertical padding stays compact so the
   table remains dense. */
#tblReports thead th,
#tblReports tbody td {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* Reports table area -- reserve a stable minimum height so paging
   doesn't cause the card to shrink/expand vertically when the last
   page has fewer than `pageLength` rows. With pageLength = 50 and
   row height ~32px, 50 rows + header + table padding ~= 1700px which
   would be too tall when there is only one short page; pick a value
   that comfortably covers a typical screen-worth of rows so the
   layout below the table (pagination row, footer, etc.) stops
   flickering. The .table-responsive wrapper handles horizontal
   scroll, and any vertical overflow inside the body is allowed to
   grow naturally beyond the min-height. */
#reportResultsCard .card-body {
    min-height: 600px;
}
#reportResultsCard .table-responsive {
    min-height: 540px;
}

.modal.show .modal-dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Honor users that prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .modal.fade .modal-dialog,
    .modal-backdrop.fade {
        transition: opacity 0.15s linear;
        transform: none;
    }
}
/* =============================================================================
   DUPLICATE PREVIEW — SECTION SEPARATORS
   Visually segregates the Merchants / Child Merchants / Terminals tables
   inside the Duplicate Preview modal.
============================================================================= */
.duplicate-preview-section {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
}

.duplicate-preview-section + .duplicate-preview-section {
    margin-top: 1.5rem;
    border-top: 1px dashed var(--bs-gray-300, #e4e6ef);
}

.duplicate-preview-section .duplicate-preview-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    color: var(--bs-dark, #181c32);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* =========================================================
   CARD HEADER EDIT ICON FLICKER FIX
   ---------------------------------------------------------
   Edit icons (fa-pencil) anchored to the right of a card
   header via justify-content-between visibly shimmer while
   the sidebar (aside) animates open/closed: the card's
   width transitions for 0.3s and the font glyph is
   re-rasterized on every frame as its X position changes.
   Promoting the icon to its own GPU compositor layer keeps
   the glyph stable during the parent's width animation.
========================================================= */
.kt-edit-icon {
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

/* =========================================================
   ROLE PERMISSION MATRIX - SMOOTH CHECKBOX TRANSITIONS
   ---------------------------------------------------------
   Scope: Manage Role Permission page (ManageRolePermission.cshtml).
   Every form-check-input inside the matrix and the #masterToggle
   ease their color/border/box-shadow changes so individual ticks
   feel fluid rather than instantaneous. No transforms, no pulses.
========================================================= */
.rbac-feature-row .form-check-input,
.rbac-feature-row .form-check-label,
#masterToggle {
    transition: background-color 0.2s ease,
                border-color 0.2s ease,
                box-shadow 0.2s ease,
                color 0.2s ease;
}

/* Subtle visual separation between the per-feature "All" switch and
   the inline action checkboxes that follow it. The right padding sits
   the divider just inside the wrapper; the right margin then opens a
   clear gap between the divider and the first action checkbox. */
.rbac-feature-row .feature-select-all-wrapper {
    padding-right: 2.25rem;
    margin-right: 2rem;
    border-right: 1px solid var(--bs-gray-200);
}

/* Inline divider between consecutive action checkboxes
   (e.g. Create | Read | Update | Delete). Implemented as a
   pseudo-element so it stays wrap-friendly: when the action row
   wraps to a new line, the trailing pipe simply does not render. */
.rbac-feature-row .action-list > label.form-check {
    position: relative;
    padding-right: 0.75rem;
}

.rbac-feature-row .action-list > label.form-check:not(:last-child)::after {
    content: "|";
    position: absolute;
    right: -0.15rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bs-gray-400);
    font-weight: 400;
    pointer-events: none;
}

