/* Configuration module refresh. Scoped presentation rules only. */
.config-modern-page {
    --config-primary: #3568e8;
    --config-soft: #edf3ff;
    --config-bg: #f4f7fb;
    --config-surface: #fff;
    --config-muted-surface: #f8fafc;
    --config-border: #e2e8f0;
    --config-text: #263247;
    --config-muted: #68758a;
    background: var(--config-bg);
    color: var(--config-text);
}

.config-modern-page *,
.config-modern-page *::before,
.config-modern-page *::after {
    box-sizing: border-box;
}

.config-modern-page :is(.form-control, .form-select) {
    min-height: 38px;
    border-color: #dbe3ee;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: none;
}

.config-modern-page :is(.form-control, .form-select):focus {
    border-color: #86a6f2;
    box-shadow: 0 0 0 3px rgba(53, 104, 232, .12);
}

.config-modern-page :is(.form-label, .col-form-label, .control-label) {
    color: #4b5870;
    font-weight: 600;
}

.config-modern-page .btn {
    min-height: 36px;
    border-radius: 8px;
}

.config-modern-list-page :is(.main-content, .content-wrapper),
.config-modern-list-page:not(:has(.main-content, .content-wrapper)) {
    min-width: 0;
    padding: 14px;
    background: var(--config-bg);
}

.config-modern-list-page :is(.main-content, .content-wrapper) > .card,
.config-modern-list-page :is(.main-content, .content-wrapper) > .container-fluid > .card,
.config-modern-list-page > .card {
    border: 1px solid var(--config-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(28, 51, 81, .06);
    overflow: hidden;
}

.config-modern-list-page :is(.main-content, .content-wrapper) > .card > .card-body,
.config-modern-list-page :is(.main-content, .content-wrapper) > .container-fluid > .card > .card-body {
    padding: 14px;
}

.config-modern-list-page .search_form {
    max-width: 100%;
    margin-bottom: 14px !important;
    padding: 12px;
    border: 1px solid var(--config-border);
    border-radius: 10px;
    background: var(--config-muted-surface);
}

.config-modern-list-page .search_form .list-group {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px 14px;
}

.config-modern-list-page .search_form .query-group {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.config-modern-list-page .search_form .form-label {
    flex: 0 0 auto;
    margin: 0;
    font-size: 13px;
}

.config-modern-list-page .search_form :is(.form-group, .input-group, .select2-container) {
    max-width: 100%;
}

.config-modern-list-page .list-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    margin: 0 0 12px !important;
}

.config-modern-list-page .list-buttons .btn-group {
    display: flex;
    flex: 0 0 auto;
}

.config-modern-list-page .list-table {
    display: block;
    max-width: 100%;
    border: 1px solid var(--config-border);
    border-radius: 10px;
    background: #fff;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-color: #c8d2df transparent;
    scrollbar-width: thin;
}

.config-modern-list-page .list-table > :is(.list-thead, .list-tbody, .list-tfoot) {
    min-width: 980px;
}

.config-modern-list-page .list-table .table {
    min-width: 980px;
    margin: 0;
}

.config-modern-list-page .list-table th {
    padding: 10px 8px;
    border-color: var(--config-border);
    background: var(--config-muted-surface);
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

.config-modern-list-page .list-table td {
    padding: 10px 8px;
    border-color: #edf1f6;
    background: #fff;
    color: #334155;
    font-size: 12px;
    vertical-align: middle;
}

.config-modern-list-page .list-table tbody tr:hover > td {
    background: #f8fbff;
}

.config-modern-list-page :is(.page-nav, .fixed-table-toolbar, .fixed-table-pagination) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.config-current-merchant-page :is(.account-message, .springwater-message),
.config-export-page .springwater-message {
    border-color: var(--config-border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(28, 51, 81, .06);
}

.config-current-merchant-page .section-title,
.config-export-page .section-title {
    color: #273449;
    font-weight: 650;
}

.config-image-page .list-table img {
    max-width: 96px;
    max-height: 96px;
    border-radius: 9px;
    object-fit: contain;
}

/* Settings, employee/role forms and current-source UAM detail pages. */
.config-modern-detail-page {
    min-width: 0;
    padding-bottom: 78px;
    background: var(--config-bg);
}

.config-modern-detail-page .content-wrapper {
    min-height: calc(100vh - 75px);
    padding-bottom: 86px;
    background: var(--config-bg);
    overflow-x: hidden;
    overflow-y: auto;
}

.config-modern-detail-page > :is(.card, form),
.config-modern-detail-page .content-wrapper > .container-fluid > .card {
    border: 1px solid var(--config-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(28, 51, 81, .06);
}

.config-modern-detail-page > form {
    width: min(100%, 960px);
    margin: 16px auto;
    padding: 20px;
}

.config-modern-detail-page .section {
    margin-bottom: 16px;
}

.config-modern-detail-page .section > .card {
    border: 1px solid var(--config-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(28, 51, 81, .06);
    overflow: visible;
}

.config-modern-detail-page .section .card-body {
    min-height: 0;
    padding: 0 24px 24px;
    overflow-x: auto;
}

.config-modern-detail-page .section-title,
.config-modern-detail-page .myCard-header,
.config-modern-detail-page > .card > .card-header {
    position: relative;
    padding: 15px 20px 15px 29px;
    border-bottom: 1px solid #edf1f6;
    background: #fbfcfe;
    color: #1f2b3f;
    font-size: 16px;
    font-weight: 650;
}

.config-modern-detail-page .section-title {
    margin: 0 -24px 20px;
    border-radius: 12px 12px 0 0;
}

.config-modern-detail-page .section-title::before,
.config-modern-detail-page .myCard-header::before {
    position: absolute;
    top: 50%;
    left: 16px;
    width: 4px;
    height: 18px;
    border-radius: 4px;
    background: var(--config-primary);
    content: "";
    transform: translateY(-50%);
}

.config-modern-detail-page .bootstrap-table,
.config-permission-page .bootstrap-table {
    max-width: 100%;
    border: 1px solid var(--config-border);
    border-radius: 9px;
    overflow-x: auto;
}

.config-modern-detail-page .bootstrap-table .fixed-table-container,
.config-permission-page .bootstrap-table .fixed-table-container {
    min-width: 760px;
    border: 0;
}

.config-modern-detail-page .right-sidebar {
    padding: 12px;
    border: 1px solid var(--config-border);
    border-radius: 11px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 8px 24px rgba(28, 51, 81, .06);
}

.config-modern-detail-page .right-sidebar .nav-link {
    margin-bottom: 4px;
    padding: 8px 11px;
    border-radius: 7px;
    color: var(--config-muted);
    white-space: nowrap;
}

.config-modern-detail-page .right-sidebar .nav-link:hover,
.config-modern-detail-page .right-sidebar .nav-link.active {
    background: var(--config-soft);
    color: var(--config-primary);
}

.config-modern-detail-page .float-container {
    left: var(--erp-sidebar-width, 236px);
    right: 0;
    bottom: 0;
    z-index: 1035;
    width: auto;
    min-height: 64px;
    padding: 12px 24px;
    border-top: 1px solid #dce4ee;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 -8px 24px rgba(25, 49, 77, .08);
}

/* Permission/tree workbenches remain desktop-oriented but horizontally reachable. */
.config-permission-page .content-wrapper,
.config-tree-page .main-content {
    padding: 14px;
    background: var(--config-bg);
}

.config-permission-page .content-wrapper > .card,
.config-tree-page .main-content > .card {
    border: 1px solid var(--config-border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(28, 51, 81, .06);
}

.config-permission-page .from-body-box,
.config-tree-page .list-table {
    max-width: 100%;
    overflow-x: auto;
}

.config-permission-page .from-body-box > table,
.config-tree-page .ztree {
    min-width: 720px;
}

.config-tree-page .list-table {
    min-width: 0 !important;
    max-width: 100% !important;
    border-color: var(--config-border);
    border-radius: 10px;
    background: #fff;
}

/* Dynamic tab host for legacy UAM user pages. */
.config-modern-tab-page .content-tab-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 75px);
    min-height: 0;
    padding: 14px 16px 16px;
    background: var(--config-bg);
    overflow: hidden;
}

.config-modern-tab-page .menus-tab {
    flex: 0 0 auto;
    padding: 0 14px;
    border: 1px solid var(--config-border);
    border-bottom: 0;
    border-radius: 12px 12px 0 0;
    background: #fff;
}

.config-modern-tab-page .menus-tab .nav-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    border-bottom: 0;
    overflow-x: auto;
}

.config-modern-tab-page .menus-tab .nav-link {
    padding: 13px 16px 11px;
    border: 0;
    color: var(--config-muted);
    font-weight: 600;
    white-space: nowrap;
}

.config-modern-tab-page .menus-tab .nav-item.active .nav-link,
.config-modern-tab-page .menus-tab .nav-link:hover {
    color: var(--config-primary);
}

.config-modern-tab-page .page-body-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    border: 1px solid var(--config-border);
    border-radius: 0 0 12px 12px;
    background: #fff;
    overflow: hidden;
}

.config-modern-tab-page .iframeContent {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* IM keeps its original three-pane behavior and gains safer small-screen bounds. */
.config-im-page .im-container-wrapper {
    background: var(--config-bg);
}

.config-im-page .im-main-box {
    border: 1px solid var(--config-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(28, 51, 81, .06);
    overflow: hidden;
}

.config-im-page :is(.left-box, .right-box, .im-buyer-info-box) {
    min-width: 0;
}

/* Shared dialogs, image upload and subscription cards. */
.config-modern-page .modal-dialog {
    width: calc(100% - 24px);
    max-width: min(1000px, calc(100vw - 24px));
    margin-right: auto;
    margin-left: auto;
}

.config-modern-page .modal-content {
    border: 0;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(20, 38, 67, .22);
    overflow: hidden;
}

.config-modern-page .modal-header,
.config-modern-page .modal-footer {
    border-color: #e7ebf1;
    background: #fbfcfe;
}

.config-modern-page .modal-body {
    max-height: min(74vh, 700px) !important;
    overflow-x: auto;
    overflow-y: auto;
}

.config-modern-page .modal-body :is(.table, .fixed-table-container) {
    min-width: 680px;
}

.config-modern-page .modal-body img,
.config-image-page img {
    max-width: 100%;
    height: auto;
}

.config-subscription-page > .card,
.config-website-page > .card {
    margin: 16px;
}

@media (max-width: 991.98px) {
    .config-modern-detail-page .content-wrapper {
        min-height: calc(100vh - 58px);
    }

    .config-modern-detail-page .mian-wrapper,
    .config-modern-detail-page .container-fluid > .row {
        display: flex;
        flex-direction: column;
    }

    .config-modern-detail-page .mian-wrapper > .col-10,
    .config-modern-detail-page .mian-wrapper > .col-2 {
        width: 100% !important;
        max-width: 100%;
    }

    .config-modern-detail-page .mian-wrapper > .col-2 {
        order: -1;
        margin-bottom: 12px;
    }

    .config-modern-detail-page :is(.right-sidebar, .sidebar-fixed) {
        position: static !important;
        width: 100% !important;
    }

    .config-modern-detail-page .right-sidebar .nav {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .config-modern-detail-page .float-container {
        left: 0;
    }

    .config-modern-tab-page .content-tab-wrapper {
        height: calc(100vh - 58px);
        padding: 10px;
    }
}

@media (max-width: 767.98px) {
    .config-modern-list-page :is(.main-content, .content-wrapper),
    .config-modern-list-page:not(:has(.main-content, .content-wrapper)) {
        padding: 6px;
    }

    .config-modern-list-page .search_form .list-group,
    .config-modern-list-page .search_form .query-group {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 8px;
    }

    .config-modern-list-page .search_form .query-group:has(> .btn) {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .config-modern-list-page .search_form :is(.form-group, .input-group, .form-control, .form-select, .select2-container),
    .config-modern-list-page .search_form [style*="width"] {
        width: 100% !important;
        max-width: 100% !important;
    }

    .config-modern-list-page .list-buttons,
    .config-modern-list-page .list-buttons .btn-group {
        flex-wrap: wrap;
    }

    .config-modern-list-page .list-buttons .btn-group,
    .config-modern-list-page .list-buttons .btn {
        flex: 1 1 auto;
    }

    .config-modern-detail-page > form {
        width: calc(100% - 12px);
        margin: 6px;
        padding: 12px;
    }

    .config-modern-detail-page .section .card-body {
        padding: 0 12px 16px;
    }

    .config-modern-detail-page .section-title {
        margin-right: -12px;
        margin-left: -12px;
        padding: 13px 14px 13px 25px;
    }

    .config-modern-detail-page .section .row > [class*="col-"] {
        width: 100%;
        max-width: 100%;
    }

    .config-modern-detail-page .float-container {
        display: flex;
        gap: 8px;
        padding: 9px 10px;
        overflow-x: auto;
    }

    .config-modern-detail-page .float-container .btn {
        flex: 1 1 auto;
    }

    .config-modern-tab-page .content-tab-wrapper {
        padding: 6px;
    }

    .config-im-page .im-main-box {
        max-width: 100%;
        overflow-x: auto;
    }

    .config-modern-page .modal-dialog {
        width: calc(100% - 16px);
        max-width: calc(100vw - 16px) !important;
        margin: 8px auto !important;
    }

    .config-modern-page .modal-footer {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .config-modern-page .modal-footer .btn {
        flex: 1 1 auto;
        margin: 0;
    }
}
