/* =============================================================================
   支付网关 - 自定义主题
   ============================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;600;700&display=swap');

:root {
    --pg-primary: #2563eb;
    --pg-primary-dark: #1d4ed8;
    --pg-primary-light: #dbeafe;
    --pg-accent: #0ea5e9;
    --pg-success: #10b981;
    --pg-warning: #f59e0b;
    --pg-danger: #ef4444;
    --pg-sidebar-bg: linear-gradient(180deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    --pg-sidebar-width: 260px;
    --pg-header-height: 60px;
    --pg-radius: 12px;
    --pg-radius-lg: 16px;
    --pg-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.06);
    --pg-shadow-lg: 0 8px 30px rgba(15, 23, 42, 0.12);
    --pg-font: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

body {
    font-family: var(--pg-font) !important;
    -webkit-font-smoothing: antialiased;
}

/* ---- Sidebar ---- */
.app-sidebar.pg-sidebar {
    background: var(--pg-sidebar-bg) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    width: var(--pg-sidebar-width);
}

.pg-sidebar .sidebar-brand {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pg-sidebar .brand-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #fff !important;
}

.pg-sidebar .brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--pg-primary), var(--pg-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.pg-sidebar .brand-text {
    font-weight: 600 !important;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    color: #fff !important;
}

.pg-sidebar .brand-sub {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 400;
    display: block;
    margin-top: 2px;
}

.pg-sidebar .nav-header {
    padding: 1rem 1.5rem 0.5rem;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.35);
}

.pg-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.72) !important;
    border-radius: 10px;
    margin: 2px 12px;
    padding: 0.65rem 1rem !important;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pg-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
}

.pg-sidebar .nav-link.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.35), rgba(14, 165, 233, 0.2)) !important;
    color: #fff !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.pg-sidebar .nav-link .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
    opacity: 0.85;
}

.pg-sidebar .nav-link p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    flex: 1;
    display: flex;
    align-items: center;
}

.pg-sidebar .pg-admin-tree .pg-tree-arrow {
    margin-left: auto;
    font-size: 0.65rem;
    opacity: 0.55;
    transition: transform 0.2s ease;
}

.pg-sidebar .pg-nav-tree.menu-open > .nav-link .pg-tree-arrow {
    transform: rotate(180deg);
}

.pg-sidebar .nav-treeview {
    display: none;
    padding: 0.15rem 0 0.35rem;
}

.pg-sidebar .pg-nav-tree.menu-open > .nav-treeview {
    display: block !important;
}

.pg-sidebar .pg-admin-tree {
    display: block !important;
}

.pg-sidebar .nav-treeview .nav-link {
    margin: 1px 12px 1px 8px;
    padding: 0.5rem 0.85rem 0.5rem 1.1rem !important;
    font-size: 0.84rem;
}

.pg-sidebar .nav-treeview .nav-link .nav-icon {
    font-size: 0.82rem;
    width: 18px;
}

.pg-sidebar .nav-treeview .nav-link.active {
    background: #3b6fd9 !important;
    box-shadow: none;
}

.pg-sidebar .pg-tree-toggle {
    cursor: pointer;
}

/* ---- Header ---- */
.pg-header {
    background: #fff !important;
    border-bottom: 1px solid #e2e8f0;
    min-height: var(--pg-header-height);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.pg-header .nav-link {
    color: #475569 !important;
    font-weight: 500;
    font-size: 0.9rem;
}

.pg-header .user-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    background: #f1f5f9;
    border-radius: 999px;
    font-size: 0.85rem;
    color: #334155;
}

.pg-header .user-badge .avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pg-primary), var(--pg-accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.pg-header .btn-logout {
    color: #64748b !important;
    font-size: 0.85rem;
}

.pg-header .btn-logout:hover {
    color: var(--pg-danger) !important;
}

/* ---- Content area ---- */
.app-main {
    background: #f8fafc;
}

.pg-page-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 1.25rem 0;
}

.pg-page-header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.02em;
}

.pg-page-header .breadcrumb-text {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.app-content {
    padding: 1.5rem 0 2rem;
}

/* ---- Cards ---- */
.pg-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--pg-radius-lg);
    box-shadow: var(--pg-shadow);
    overflow: hidden;
}

.pg-card .card-header {
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
}

.pg-card .card-body {
    padding: 1.25rem;
}

/* ---- Stat boxes ---- */
.pg-stat {
    border-radius: var(--pg-radius-lg);
    padding: 1.35rem 1.5rem;
    color: #fff;
    position: relative;
    overflow: hidden;
    border: none;
    box-shadow: var(--pg-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pg-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--pg-shadow-lg);
}

.pg-stat .stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.03em;
}

.pg-stat .stat-label {
    font-size: 0.85rem;
    opacity: 0.88;
    margin-top: 0.25rem;
    font-weight: 500;
}

.pg-stat .stat-icon {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    opacity: 0.2;
}

.pg-stat-primary { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.pg-stat-info    { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.pg-stat-success { background: linear-gradient(135deg, #10b981, #059669); }
.pg-stat-warning { background: linear-gradient(135deg, #f59e0b, #d97706); }

/* ---- Chart card ---- */
.pg-chart-card .card-body {
    padding: 0;
}

.pg-chart-header {
    position: relative;
    padding: 1rem 1.25rem 0;
    min-height: 2.5rem;
}

.pg-chart-header .pg-badge {
    position: absolute;
    left: 1.25rem;
    top: 1rem;
}

.pg-chart-title {
    margin: 0;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.5;
}

.pg-chart-canvas {
    height: 320px;
    padding: 0 0.5rem 0.75rem;
}

/* ---- Tables ---- */
.pg-table {
    margin: 0;
}

.pg-table thead th {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.85rem 1.25rem !important;
    white-space: nowrap;
}

.pg-table tbody td {
    padding: 0.9rem 1.25rem !important;
    vertical-align: middle;
    color: #334155;
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f5f9;
}

.pg-table tbody tr:hover {
    background: #f8fafc;
}

.pg-table .mono {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.82rem;
    color: #475569;
}

/* ---- Badges ---- */
.pg-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.pg-badge-success { background: #d1fae5; color: #065f46; }
.pg-badge-warning { background: #fef3c7; color: #92400e; }
.pg-badge-danger  { background: #fee2e2; color: #991b1b; }
.pg-badge-info    { background: #dbeafe; color: #1e40af; }
.pg-badge-muted   { background: #f1f5f9; color: #64748b; }

.pg-order-fail-type .pg-order-risk-rule {
    margin-top: 0.2rem;
}

.pg-table.pg-admin-order-table td[data-col="failType"].pg-col-width-custom {
    word-break: normal !important;
}

.pg-order-fail-type .pg-order-fail-detail-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    margin-top: 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.pg-order-fail-type .pg-order-fail-detail-scroll::-webkit-scrollbar {
    height: 4px;
}

.pg-order-fail-type .pg-order-fail-detail-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.pg-order-fail-type .pg-order-fail-detail {
    display: inline-block;
    white-space: nowrap;
    word-break: normal;
}

/* ---- Buttons ---- */
.btn-pg-primary {
    background: linear-gradient(135deg, var(--pg-primary), var(--pg-primary-dark));
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    transition: all 0.2s ease;
}

.btn-pg-primary:hover {
    background: linear-gradient(135deg, var(--pg-primary-dark), #1e40af);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-pg-outline {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    font-weight: 500;
    border-radius: 8px;
    font-size: 0.85rem;
    padding: 0.4rem 0.9rem;
}

.btn-pg-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}

.btn-pg-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* ---- Forms ---- */
.pg-form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.4rem;
}

.pg-form-control {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.pg-form-control:focus {
    border-color: var(--pg-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.pg-search-bar {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--pg-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--pg-shadow);
    overflow: visible;
}

.pg-search-bar .row {
    overflow: visible;
}

.pg-merchant-select {
    position: relative;
    overflow: visible;
}

.pg-merchant-select-search {
    width: 100%;
}

.pg-merchant-select.open .pg-merchant-select-search {
    border-color: var(--pg-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.pg-merchant-select-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1050;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--pg-radius);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.pg-merchant-select.open .pg-merchant-select-dropdown {
    display: block;
}

.pg-merchant-select-dropdown .pg-merchant-select-list {
    padding: 0.35rem;
}

.pg-merchant-select-list {
    max-height: 220px;
    overflow-y: auto;
}

.pg-merchant-select-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.pg-merchant-select-item:hover {
    background: #f8fafc;
}

.pg-merchant-select-item.selected {
    background: #eff6ff;
}

.pg-merchant-select-item input {
    margin: 0;
    flex-shrink: 0;
    pointer-events: none;
}

.pg-merchant-select-item .name {
    font-weight: 600;
    color: #334155;
}

.pg-merchant-select-item .code {
    color: #64748b;
    font-size: 0.78rem;
    margin-left: auto;
}

.pg-merchant-select-empty {
    padding: 1rem 0.5rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.85rem;
}

.pg-merchant-select-single .pg-merchant-select-tags {
    display: none;
}

.pg-merchant-select-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.45rem;
}

.pg-merchant-select-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    font-size: 0.78rem;
    color: #1e40af;
}

.pg-merchant-select-tag button {
    border: none;
    background: none;
    color: #64748b;
    padding: 0;
    line-height: 1;
    cursor: pointer;
}

.pg-audit-actions .form-control-sm {
    font-size: 0.82rem;
}

.nav-pills .nav-link {
    color: #64748b;
    font-size: 0.9rem;
    border-radius: 999px;
    padding: 0.45rem 0.95rem;
}

.nav-pills .nav-link.active {
    background: var(--pg-primary);
}

.pg-order-center-card {
    overflow: visible;
}

.pg-order-center-search {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem 0.65rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #eef2f7;
    background: #fff;
}

.pg-order-center-search-label {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
    white-space: nowrap;
}

.pg-order-center-search .form-control,
.pg-order-center-search .form-select {
    height: 34px;
    padding: 0 0.65rem;
    font-size: 0.875rem;
    border-color: #d1d5db;
    border-radius: 4px;
    box-shadow: none;
    line-height: 32px;
}

.pg-order-center-search .form-select {
    padding-right: 1.75rem;
    background-position: right 0.55rem center;
    background-size: 12px 9px;
    cursor: pointer;
}

.pg-order-center-keyword {
    width: 180px;
    flex: 0 0 180px;
}

.pg-order-center-date {
    width: 150px;
    flex: 0 0 150px;
}

.pg-order-center-state {
    width: 130px;
    flex: 0 0 130px;
    color: #374151;
}

.pg-order-center-order-scope {
    width: 120px;
    flex: 0 0 120px;
    color: #374151;
}

.pg-order-center-shipping-email-filter {
    width: 150px;
    flex: 0 0 150px;
    color: #374151;
}

.pg-order-center-page-size {
    width: 110px;
    flex: 0 0 110px;
    color: #374151;
}

.pg-order-center-page-size-footer strong {
    color: #1e293b;
}

.pg-order-center-sep {
    color: #64748b;
    font-size: 0.9rem;
    white-space: nowrap;
}

.pg-order-center-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.pg-order-center-total-amount {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid #dbeafe;
    border-radius: 6px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 0.8125rem;
    white-space: nowrap;
}

.pg-order-center-total-amount strong {
    color: #1d4ed8;
    font-size: 0.9rem;
}

.pg-order-center-total-amount .text-muted {
    color: #64748b;
    font-size: 0.75rem;
}

.pg-order-center-search .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    height: 34px;
    padding: 0 0.85rem;
    line-height: 1;
    border-radius: 4px;
    white-space: nowrap;
    text-decoration: none;
    flex-shrink: 0;
    box-shadow: none;
    transform: none;
}

.pg-order-center-search .btn:hover {
    transform: none;
}

.pg-order-column-picker {
    border-bottom: 1px solid #eef2f7;
    background: #f8fafc;
}

.pg-order-column-picker-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    padding: 0.65rem 1rem;
}

.pg-order-column-toggle {
    display: inline-flex;
    align-items: center;
    font-size: 0.8125rem;
    color: #334155;
}

.pg-order-column-hint {
    flex: 1 1 auto;
    min-width: 160px;
}

.pg-order-column-picker-actions {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.15rem;
}

.pg-order-column-picker-actions .btn-link {
    color: #0d9488;
    text-decoration: none;
    font-size: 0.8125rem;
}

.pg-order-column-picker-actions .btn-link:hover {
    color: #0f766e;
    text-decoration: underline;
}

.pg-order-column-picker-body {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.85rem;
    padding: 0 1rem 0.85rem;
}

.pg-order-column-option {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0.25rem 0.55rem;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    color: #475569;
    font-size: 0.8125rem;
    cursor: pointer;
    user-select: none;
}

.pg-order-column-option input {
    margin: 0;
    cursor: pointer;
}

.pg-order-column-option:hover {
    border-color: #99f6e4;
    background: #f0fdfa;
}

.pg-order-export-modal .modal-body {
    padding-top: 1rem;
}

.pg-order-export-mode-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.pg-order-export-mode {
    display: block;
    margin: 0;
    cursor: pointer;
}

.pg-order-export-mode input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pg-order-export-mode-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    height: 100%;
    padding: 0.85rem 0.95rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.pg-order-export-mode input:checked + .pg-order-export-mode-card {
    border-color: #14b8a6;
    background: #f0fdfa;
    box-shadow: 0 0 0 1px rgba(20, 184, 166, 0.15);
}

.pg-order-export-mode-title {
    font-weight: 600;
    color: #0f172a;
    font-size: 0.92rem;
}

.pg-order-export-mode-desc {
    color: #64748b;
    font-size: 0.78rem;
    line-height: 1.45;
}

.pg-order-export-panel {
    padding: 0.85rem;
    border: 1px solid #e8edf3;
    border-radius: 10px;
    background: #fafbfc;
}

.pg-order-export-column-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.85rem;
    max-height: 220px;
    overflow: auto;
}

@media (max-width: 768px) {
    .pg-order-export-mode-list {
        grid-template-columns: 1fr;
    }
}

.pg-admin-order-table .pg-col-hidden {
    display: none !important;
}

.pg-website-card {
    overflow: visible;
}

.pg-website-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #eef2f7;
    background: #fff;
}

.pg-website-add-btn {
    color: #0d9488;
    border-color: #cbd5e1;
}

.pg-website-add-btn:hover {
    color: #0f766e;
    border-color: #0d9488;
    background: #f0fdfa;
}

.pg-website-search {
    display: flex;
    align-items: center;
    gap: 0;
    margin-left: auto;
}

.pg-website-search .btn {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: 0;
    min-width: 64px;
}

.pg-website-search .form-control {
    width: 240px;
    height: 34px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    font-size: 0.875rem;
}

.pg-website-table thead th {
    background: #f8fafc;
    font-size: 0.85rem;
    white-space: nowrap;
}

.pg-website-modal .modal-header,
.pg-website-modal .modal-footer {
    border-color: #eef2f7;
}

.pg-website-modal .modal-footer {
    background: #f8fafc;
}

.pg-website-modal .modal-title {
    font-size: 1rem;
    font-weight: 600;
}

.pg-website-bulk-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #eef2f7;
}

.pg-website-bulk-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #334155;
}

.pg-website-bulk-form {
    padding: 1rem;
}

.pg-website-bulk-tips {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.75rem 0.9rem;
    margin-bottom: 0.85rem;
    color: #475569;
    font-size: 0.875rem;
}

.pg-website-bulk-tips ul {
    padding-left: 1.1rem;
}

.pg-website-bulk-tips li + li {
    margin-top: 0.25rem;
}

.pg-website-bulk-textarea {
    min-height: 220px;
    resize: vertical;
    font-size: 0.875rem;
    line-height: 1.5;
}

.pg-website-bulk-actions {
    margin-top: 0.85rem;
}

.pg-website-batch-raw {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.75rem 0.9rem;
    max-height: 220px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
    font-size: 0.8125rem;
    color: #334155;
}

.pg-order-center-table thead th {
    background: #f8fafc;
    font-size: 0.82rem;
}

.pg-admin-order-table thead th.pg-col-resizable {
    position: relative;
    overflow: visible;
    padding-right: 1.35rem !important;
    border-right: 1px solid #e2e8f0 !important;
}

.pg-admin-order-table .pg-col-resizer {
    position: absolute;
    top: 0;
    right: -5px;
    width: 10px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
    touch-action: none;
    z-index: 3;
}

.pg-admin-order-table .pg-col-resizer::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    transform: translateX(-50%);
    background: #dbe3ee;
    pointer-events: none;
}

.pg-admin-order-table .pg-col-resizer::after {
    content: '';
    position: absolute;
    top: 22%;
    bottom: 22%;
    left: 50%;
    width: 5px;
    transform: translateX(-50%);
    border-radius: 1px;
    background:
        linear-gradient(to right, #c5ced9 0 1px, transparent 1px 2px, #c5ced9 2px 3px, transparent 3px 4px, #c5ced9 4px 5px);
    opacity: 0.85;
    transition: opacity 0.15s ease, background 0.15s ease;
    pointer-events: none;
}

.pg-admin-order-table .pg-col-resizer:hover,
.pg-admin-order-table.pg-col-resizing .pg-col-resizer {
    background: rgba(37, 99, 235, 0.08);
}

.pg-admin-order-table .pg-col-resizer:hover::before,
.pg-admin-order-table.pg-col-resizing .pg-col-resizer::before {
    background: #94a3b8;
}

.pg-admin-order-table .pg-col-resizer:hover::after,
.pg-admin-order-table.pg-col-resizing .pg-col-resizer::after {
    opacity: 1;
    background:
        linear-gradient(to right, #64748b 0 1px, transparent 1px 2px, #64748b 2px 3px, transparent 3px 4px, #64748b 4px 5px);
}

.pg-admin-order-table.pg-col-resizing {
    cursor: col-resize;
    user-select: none;
}

.pg-admin-order-table.pg-col-resizing * {
    cursor: col-resize !important;
}

.pg-table.pg-admin-order-table .pg-col-width-custom {
    width: var(--pg-col-width) !important;
    min-width: var(--pg-col-width) !important;
    max-width: var(--pg-col-width) !important;
    overflow: hidden !important;
    box-sizing: border-box;
}

.pg-table.pg-admin-order-table td[data-col="userAgent"].pg-col-width-custom,
.pg-table.pg-admin-order-table td[data-col="orderFailInfo"].pg-col-width-custom {
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    word-break: normal !important;
}

.pg-shipping-select-col {
    width: 42px;
    min-width: 42px;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

.pg-shipping-select-col .form-check-input {
    margin: 0;
    float: none;
    cursor: pointer;
}

.pg-shipping-select-col.pg-shipping-select-blocked {
    position: relative;
}

.pg-shipping-select-col.pg-shipping-select-blocked .form-check-input {
    cursor: not-allowed;
    opacity: 0.45;
    pointer-events: none;
}

.pg-shipping-select-col.pg-shipping-select-blocked::after {
    content: '';
    position: absolute;
    inset: 0;
    cursor: not-allowed;
    z-index: 1;
}

.pg-shipping-select-col .form-check-input:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.pg-order-center-footer {
    padding: 0.85rem 1.25rem;
    border-top: 1px solid #f1f5f9;
    background: #fff;
}

.pg-order-page-jump .pg-order-page-input {
    width: 4.25rem;
    text-align: center;
}

.pg-order-page-jump .btn {
    white-space: nowrap;
}

.pg-order-amount-summary {
    font-size: 0.9rem;
    color: #64748b;
}

.pg-order-amount-summary strong {
    color: #059669;
    font-size: 1rem;
    margin-left: 0.15rem;
}

.pg-order-center-channel {
    width: 150px;
    flex: 0 0 150px;
}

.pg-order-center-merchant {
    width: 140px;
    flex: 0 0 140px;
}

.pg-logistics-toggle-btn {
    font-size: 0.9rem;
    padding: 0.45rem 0.9rem;
    box-shadow: none;
}

.pg-logistics-import-card {
    overflow: visible;
    border: 1px solid #e5e7eb;
}

.pg-logistics-import-header {
    padding: 0.65rem 1rem;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.95rem;
    font-weight: 500;
    color: #374151;
}

.pg-logistics-import-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: #fff;
}

.pg-logistics-template-link {
    color: #dc2626;
    text-decoration: none;
    font-size: 0.9rem;
}

.pg-logistics-template-link:hover {
    color: #b91c1c;
    text-decoration: underline;
}

.pg-admin-order-table .pg-order-amount-original {
    color: #dc2626;
    font-weight: 600;
    white-space: nowrap;
}

.pg-admin-order-table .pg-order-amount-usd {
    color: #059669;
    font-weight: 600;
    white-space: nowrap;
}

.pg-admin-order-table .pg-order-card-no {
    color: #dc2626;
    font-size: 0.8rem;
    white-space: nowrap;
}

.pg-admin-order-table .pg-order-ua {
    font-size: 0.78rem;
    color: #64748b;
}

.pg-admin-order-table {
    table-layout: auto !important;
    width: max-content !important;
    min-width: 100%;
}

.pg-table.pg-admin-order-table thead th {
    white-space: normal !important;
    word-break: break-word;
    text-transform: none;
    letter-spacing: normal;
}

.pg-table.pg-admin-order-table tbody td {
    white-space: normal !important;
    word-break: break-word;
    max-width: none !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

.pg-admin-order-table td,
.pg-admin-order-table th {
    vertical-align: middle;
}

.pg-admin-order-table .pg-order-actions-col {
    white-space: nowrap !important;
}

.pg-page-subtitle {
    font-size: 0.95rem;
    font-weight: 500;
    color: #64748b;
    margin-left: 0.35rem;
}

.pg-merchant-toolbar .pg-merchant-search .form-control {
    min-width: 200px;
}

.pg-merchant-create-card {
    overflow: visible;
}

.pg-merchant-create-header {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid #eef2f7;
    font-weight: 600;
    background: #fff;
}

.pg-merchant-create-form {
    padding: 1.25rem 1.5rem 1.5rem;
    background: #fff;
}

.pg-merchant-form-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.pg-merchant-form-row-top {
    align-items: flex-start;
}

.pg-merchant-form-row-top .pg-merchant-form-label {
    padding-top: 0.45rem;
}

.pg-merchant-form-label {
    width: 140px;
    flex-shrink: 0;
    text-align: right;
    color: #374151;
    font-size: 0.9rem;
    margin: 0;
}

.pg-merchant-form-field {
    flex: 1;
    max-width: 520px;
}

.pg-number-stepper {
    display: inline-flex;
    align-items: stretch;
    max-width: 200px;
}

.pg-number-stepper .form-control {
    width: 88px;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
}

.pg-number-stepper .btn {
    min-width: 40px;
}

.pg-tier-table {
    border: 1px solid #e5e7eb;
    background: #fafafa;
}

.pg-tier-table thead th {
    background: #f8fafc;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.pg-merchant-form-actions {
    padding-left: 156px;
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.pg-merchant-create-modal .modal-body {
    padding: 0;
    background: #f1f5f9;
}

.pg-merchant-create-modal .modal-header {
    background: #fff;
    padding: 1rem 1.5rem;
    flex-shrink: 0;
}

.pg-merchant-create-modal .modal-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.pg-merchant-create-modal .modal-subtitle {
    font-size: 0.8rem;
    font-weight: 400;
    color: #64748b;
    margin: 0;
}

.pg-merchant-create-modal .modal-footer {
    border-top: 1px solid #e2e8f0;
    background: #fff;
    padding: 0.85rem 1.5rem;
    flex-shrink: 0;
}

.pg-merchant-modal-body {
    padding: 1.25rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.pg-merchant-create-modal form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.pg-merchant-create-modal .modal-content {
    max-height: calc(100vh - 2rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pg-merchant-create-modal .pg-mch-panel {
    overflow: visible;
    flex-shrink: 0;
}

.pg-mch-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.pg-mch-panel-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.15rem;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    border-bottom: 1px solid #eef2f7;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
}

.pg-mch-panel-head i {
    width: 1.5rem;
    height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 0.75rem;
}

.pg-mch-panel-body {
    padding: 1.15rem;
}

.pg-mch-field {
    margin-bottom: 0;
}

.pg-mch-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #475569;
}

.pg-mch-label .req {
    color: #ef4444;
    margin-right: 0.1rem;
}

.pg-mch-input {
    border-color: #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    min-height: 38px;
}

.pg-mch-input:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.pg-mch-input-readonly {
    background: #f8fafc;
    color: #334155;
    min-height: 38px;
    display: flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
}

.pg-mch-risk-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 1rem;
    align-items: start;
    flex-shrink: 0;
    margin-top: 0.25rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
}

.pg-mch-amount-range {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pg-mch-amount-range .pg-mch-input {
    flex: 1;
    min-width: 0;
}

.pg-mch-amount-sep {
    color: #94a3b8;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.pg-mch-hint {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #94a3b8;
    line-height: 1.45;
}

.pg-mch-channel-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.pg-mch-channel-card {
    flex: 1 1 220px;
    margin: 0;
    padding: 0.7rem 0.9rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #fafbfc;
    transition: border-color 0.15s, background 0.15s;
    cursor: pointer;
}

.pg-mch-channel-card:has(.form-check-input:checked) {
    border-color: #3b82f6;
    background: #eff6ff;
}

.pg-mch-channel-card .form-check-input {
    margin-top: 0.15rem;
}

.pg-mch-channel-card .form-check-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
}

.pg-mch-toggle-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.pg-mch-toggle-item {
    padding: 0.85rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fafbfc;
}

.pg-mch-toggle-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.pg-mch-toggle-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
}

.pg-mch-toggle-desc {
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: #94a3b8;
    line-height: 1.45;
}

.pg-mch-toggle-head .form-check-input {
    width: 2.4em;
    height: 1.2em;
    cursor: pointer;
    flex-shrink: 0;
}

.pg-number-stepper {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.pg-number-stepper .form-control {
    width: 72px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    min-height: 36px;
}

.pg-number-stepper .btn {
    min-width: 36px;
    border: 0;
    border-radius: 0;
    padding: 0;
    color: #64748b;
}

.pg-number-stepper .btn:last-child {
    color: #2563eb;
    background: #eff6ff;
}

.pg-merchant-create-modal .pg-merchant-form-field {
    max-width: none;
}

.pg-mch-route-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: 220px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.15rem 0.35rem 0.15rem 0.15rem;
    margin-bottom: 0.25rem;
    border: 1px solid #e8edf3;
    border-radius: 10px;
    background: #f8fafc;
}

.pg-mch-route-list::-webkit-scrollbar {
    width: 6px;
}

.pg-mch-route-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.pg-mch-route-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.pg-mch-route-row {
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    flex-shrink: 0;
}

.pg-mch-route-main {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: flex-end;
}

.pg-mch-route-col {
    flex: 1 1 220px;
    min-width: 0;
}

.pg-mch-route-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 0 0 auto;
    margin-left: auto;
    padding-bottom: 0.2rem;
}

.pg-mch-route-row.is-fallback .pg-mch-route-countries {
    background: #f1f5f9;
    pointer-events: none;
}

.pg-mch-route-fallback {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    font-size: 0.8rem;
    color: #475569;
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.pg-mch-route-remove {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pg-mch-route-section {
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .pg-mch-risk-row {
        grid-template-columns: 1fr;
    }

    .pg-mch-toggle-grid {
        grid-template-columns: 1fr;
    }

    .pg-mch-route-col {
        flex: 1 1 100%;
    }

    .pg-mch-route-actions {
        width: 100%;
        margin-left: 0;
        justify-content: space-between;
    }
}

.pg-channel-markup-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pg-channel-markup-row {
    padding: 0.85rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fafbfc;
}

.pg-markup-tier-table {
    border: 1px solid #e8edf3;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.pg-markup-tier-head,
.pg-markup-tier-line {
    display: grid;
    grid-template-columns: 1fr auto 1fr 120px 36px;
    gap: 0.5rem;
    align-items: center;
    padding: 0.55rem 0.75rem;
}

.pg-markup-tier-range-sep {
    color: #94a3b8;
    font-size: 0.85rem;
}

.pg-markup-tier-add {
    margin-top: 0.5rem;
}

.pg-markup-tier-head {
    background: #f8fafc;
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
}

.pg-markup-tier-line + .pg-markup-tier-line {
    border-top: 1px solid #f1f5f9;
}

.pg-markup-tier-actions {
    display: flex;
    justify-content: flex-end;
    padding: 0.5rem 0.75rem 0.65rem;
    border-top: 1px solid #f1f5f9;
}

@media (max-width: 992px) {
    .pg-markup-tier-head {
        display: none;
    }

    .pg-markup-tier-line {
        grid-template-columns: 1fr 1fr;
        gap: 0.45rem;
    }

    .pg-markup-tier-line .pg-markup-tier-percent,
    .pg-markup-tier-line .pg-markup-tier-remove {
        grid-column: span 1;
    }
}

.pg-merchant-list-table thead th {
    background: #f8fafc;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* ---- Alerts ---- */
.pg-alert {
    border: none;
    border-radius: var(--pg-radius);
    padding: 0.85rem 1.15rem;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.pg-alert-success { background: #ecfdf5; color: #065f46; border-left: 4px solid #10b981; }
.pg-alert-danger  { background: #fef2f2; color: #991b1b; border-left: 4px solid #ef4444; }

/* ---- Detail list ---- */
.pg-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.pg-detail-item {
    padding: 0.85rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.pg-detail-item .label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
}

.pg-detail-item .value {
    font-size: 0.95rem;
    color: #1e293b;
    font-weight: 500;
}

/* ---- Login pages ---- */
.pg-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 40%, #2563eb 100%);
    position: relative;
    overflow: hidden;
}

.pg-login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    top: -200px;
    right: -150px;
}

.pg-login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.02);
    bottom: -100px;
    left: -100px;
}

.pg-login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

.pg-login-card .login-header {
    text-align: center;
    padding: 2rem 2rem 1rem;
}

.pg-login-card .login-logo {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--pg-primary), var(--pg-accent));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.pg-login-card.merchant-theme .login-logo {
    background: linear-gradient(135deg, #059669, #10b981);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
}

.pg-login-card .login-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.pg-login-card .login-subtitle {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 0.35rem;
}

.pg-login-card .login-body {
    padding: 0 2rem 2rem;
}

.pg-login-card .input-group-text {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #94a3b8;
}

.pg-login-card .form-control {
    border-color: #e2e8f0;
    padding: 0.65rem 0.9rem;
}

.pg-login-card .form-control:focus {
    border-color: var(--pg-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.pg-login-card .btn-login {
    width: 100%;
    padding: 0.7rem;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    margin-top: 0.5rem;
    font-size: 0.95rem;
}

.pg-login-card .btn-login-admin {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.pg-login-card .btn-login-merchant {
    background: linear-gradient(135deg, #059669, #047857);
    color: #fff;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
}

.pg-login-footer {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
    margin-top: 1rem;
}

.pg-login-footer a {
    color: var(--pg-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
}

.pg-login-hint {
    font-size: 0.78rem;
    color: #94a3b8;
    text-align: center;
    margin-top: 0.75rem;
}

/* ---- Checkout ---- */
.pg-checkout-page {
    min-height: 100vh;
    background: linear-gradient(160deg, #f0f4ff 0%, #f8fafc 50%, #ecfdf5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.pg-checkout-card {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.pg-checkout-header {
    background: linear-gradient(135deg, #1e293b, #334155);
    color: #fff;
    padding: 1.5rem 1.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pg-checkout-header .icon-wrap {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pg-checkout-subtitle {
    font-size: 0.8rem;
    opacity: 0.75;
    line-height: 1.35;
}

.pg-checkout-body {
    padding: 1.75rem;
}

.pg-checkout-amount {
    text-align: center;
    padding: 1.25rem 0;
    margin-bottom: 1rem;
    background: #f8fafc;
    border-radius: 12px;
}

.pg-checkout-amount .currency-amount {
    font-size: 2.25rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.03em;
}

.pg-checkout-amount .order-label {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 0.35rem;
}

.pg-checkout-card-preview {
    background: linear-gradient(135deg, #1e3a5f, #2563eb);
    border-radius: 14px;
    padding: 1.25rem;
    color: #fff;
    margin-bottom: 1.25rem;
}

.pg-checkout-card-preview .chip {
    width: 40px;
    height: 28px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.pg-checkout-card-preview .card-number {
    font-family: 'SF Mono', monospace;
    font-size: 1.1rem;
    letter-spacing: 0.15em;
    margin-bottom: 1rem;
}

.pg-checkout-card-preview .card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    opacity: 0.8;
}

.pg-checkout-btn {
    width: 100%;
    padding: 0.85rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
    transition: all 0.2s ease;
}

.pg-checkout-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
    color: #fff;
}

.pg-checkout-secure {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.78rem;
    color: #94a3b8;
}

.pg-checkout-secure i {
    color: var(--pg-success);
    margin-right: 0.25rem;
}

/* Hosted card checkout — mobile stack + desktop split layout */
.pg-checkout-card-page {
    -webkit-text-size-adjust: 100%;
}

.pg-checkout-card-page .pg-hosted-card-shell {
    max-width: 480px;
}

.pg-checkout-card-page .pg-form-control {
    min-height: 48px;
    font-size: 16px;
}

.pg-checkout-card-page .pg-checkout-btn {
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
}

.pg-hosted-card-layout {
    display: flex;
    flex-direction: column;
}

.pg-hosted-card-aside {
    display: flex;
    flex-direction: column;
}

.pg-hosted-aside-head,
.pg-hosted-trust-list {
    display: none;
}

.pg-hosted-main-head {
    display: none;
}

.pg-hosted-form-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.pg-hosted-field {
    margin-bottom: 1rem;
}

.pg-hosted-field.span-2 {
    margin-bottom: 1rem;
}

.pg-hosted-error {
    margin: 0 0 1rem;
}

.pg-checkout-card-page .pg-checkout-card-preview .card-number {
    word-break: break-word;
    overflow-wrap: anywhere;
}

.pg-checkout-card-page .pg-checkout-card-preview .card-meta span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 65%;
}

.pg-hosted-amount {
    margin-bottom: 1rem;
}

.pg-hosted-subject {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .pg-checkout-page {
        align-items: flex-start;
        padding: max(0.75rem, env(safe-area-inset-top))
                 max(0.75rem, env(safe-area-inset-right))
                 max(0.75rem, env(safe-area-inset-bottom))
                 max(0.75rem, env(safe-area-inset-left));
    }

    .pg-checkout-card-page .pg-hosted-card-shell {
        border-radius: 16px;
        box-shadow: 0 12px 40px rgba(15, 23, 42, 0.1);
    }

    .pg-hosted-mobile-header {
        padding: 1.1rem 1rem;
    }

    .pg-hosted-mobile-header .icon-wrap {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }

    .pg-checkout-card-page .pg-checkout-body {
        padding: 1.25rem 1rem 1.5rem;
    }

    .pg-hosted-amount {
        padding: 1rem 0.75rem;
        margin-bottom: 0.75rem;
    }

    .pg-hosted-amount .currency-amount {
        font-size: 1.85rem;
    }

    .pg-hosted-card-visual {
        padding: 1rem;
        margin-bottom: 0;
    }

    .pg-hosted-card-visual .chip {
        width: 34px;
        height: 24px;
        margin-bottom: 1.1rem;
    }

    .pg-hosted-card-visual .card-number {
        font-size: 0.92rem;
        letter-spacing: 0.08em;
        margin-bottom: 0.85rem;
    }

    .pg-hosted-mobile-secure {
        font-size: 0.72rem;
        line-height: 1.5;
        padding: 0 0.25rem;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .pg-checkout-page {
        padding: 1.25rem;
    }

    .pg-checkout-card-page .pg-hosted-card-shell {
        max-width: 440px;
    }
}

@media (min-width: 768px) {
    .pg-checkout-page {
        padding: 2.5rem 1.5rem;
        background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 45%, #ecfeff 100%);
    }

    .pg-checkout-card-page .pg-hosted-card-shell {
        max-width: 920px;
        border-radius: 24px;
        box-shadow: 0 28px 80px rgba(15, 23, 42, 0.14);
    }

    .pg-hosted-mobile-header {
        display: none;
    }

    .pg-checkout-card-page .pg-checkout-body {
        padding: 0;
    }

    .pg-hosted-error {
        margin: 1.25rem 1.5rem 0;
    }

    .pg-hosted-card-layout {
        display: grid;
        grid-template-columns: minmax(300px, 360px) 1fr;
        min-height: 520px;
    }

    .pg-hosted-card-aside {
        background: linear-gradient(165deg, #0f172a 0%, #1e293b 45%, #1e3a5f 100%);
        color: #fff;
        padding: 2rem 1.75rem;
        justify-content: center;
        gap: 1.25rem;
    }

    .pg-hosted-aside-head {
        display: flex;
        align-items: center;
        gap: 0.85rem;
    }

    .pg-hosted-aside-icon {
        width: 46px;
        height: 46px;
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.12);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.15rem;
    }

    .pg-hosted-aside-title {
        font-size: 1.35rem;
        font-weight: 700;
        line-height: 1.2;
    }

    .pg-hosted-aside-subtitle {
        font-size: 0.85rem;
        opacity: 0.72;
        margin-top: 0.15rem;
    }

    .pg-hosted-amount {
        text-align: left;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 16px;
        padding: 1.35rem 1.25rem;
        margin-bottom: 0;
    }

    .pg-hosted-amount .order-label {
        color: rgba(255, 255, 255, 0.65);
    }

    .pg-hosted-amount .currency-amount {
        color: #fff;
        font-size: 2.6rem;
    }

    .pg-hosted-subject {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .pg-hosted-card-visual {
        margin-bottom: 0;
        min-height: 200px;
        padding: 1.5rem;
        box-shadow: 0 16px 40px rgba(15, 23, 42, 0.25);
    }

    .pg-hosted-card-visual .chip {
        width: 46px;
        height: 32px;
        margin-bottom: 2rem;
    }

    .pg-hosted-card-visual .card-number {
        font-size: 1.25rem;
        letter-spacing: 0.12em;
        margin-bottom: 1.35rem;
    }

    .pg-hosted-trust-list {
        display: flex;
        flex-direction: column;
        gap: 0.55rem;
        list-style: none;
        margin: 0;
        padding: 0;
        font-size: 0.82rem;
        color: rgba(255, 255, 255, 0.78);
    }

    .pg-hosted-trust-list li {
        display: flex;
        align-items: center;
        gap: 0.55rem;
    }

    .pg-hosted-trust-list i {
        color: #86efac;
        width: 1rem;
        text-align: center;
    }

    .pg-hosted-card-main {
        padding: 2.25rem 2.5rem 2rem;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .pg-hosted-main-head {
        display: block;
        margin-bottom: 1.5rem;
    }

    .pg-hosted-main-title {
        font-size: 1.5rem;
        font-weight: 700;
        color: #0f172a;
        margin: 0 0 0.35rem;
    }

    .pg-hosted-main-desc {
        margin: 0;
        color: #64748b;
        font-size: 0.95rem;
    }

    .pg-hosted-form-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem 1.25rem;
    }

    .pg-hosted-field {
        margin-bottom: 0;
    }

    .pg-hosted-field.span-2 {
        grid-column: span 2;
    }

    .pg-hosted-pay-btn {
        margin-top: 0.35rem;
        padding: 0.95rem 1rem;
        font-size: 1.05rem;
    }

    .pg-hosted-mobile-secure {
        display: none;
    }
}

@media (min-width: 992px) {
    .pg-checkout-card-page .pg-hosted-card-shell {
        max-width: 960px;
    }

    .pg-hosted-card-layout {
        grid-template-columns: 380px 1fr;
    }

    .pg-hosted-card-main {
        padding: 2.75rem 3rem 2.25rem;
    }

    .pg-hosted-amount .currency-amount {
        font-size: 2.85rem;
    }
}

@media (max-height: 520px) and (orientation: landscape) and (max-width: 767.98px) {
    .pg-checkout-page {
        align-items: flex-start;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .pg-hosted-card-visual .chip {
        margin-bottom: 0.75rem;
    }
}

.pg-3ds-challenge {
    max-width: 420px;
}

.pg-3ds-bank-header {
    background: linear-gradient(135deg, #0f3460, #1a5276);
}

.pg-3ds-merchant-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    border-bottom: 1px dashed #e2e8f0;
}

.pg-3ds-merchant-row:last-of-type {
    border-bottom: none;
    margin-bottom: 0.5rem;
}

.pg-3ds-sms-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
}

.pg-3ds-demo-hint {
    background: #eff6ff;
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    color: #1e40af;
}

.pg-3ds-otp-input {
    letter-spacing: 0.45em;
    font-size: 1.35rem;
    font-weight: 600;
    padding-left: 1.25rem;
}

.pg-result-page {
    text-align: center;
    padding: 2rem;
}

.pg-result-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.pg-result-icon.success {
    background: #d1fae5;
    color: #059669;
}

.pg-result-icon.pending {
    background: #fef3c7;
    color: #d97706;
}

/* ---- Docs page ---- */
.pg-code-block {
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    font-family: 'SF Mono', monospace;
    font-size: 0.82rem;
    overflow-x: auto;
}

.pg-api-table code {
    background: #f1f5f9;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.82rem;
    color: #2563eb;
}

/* ---- Merchant dev support panel ---- */
.pg-dev-support-card {
    position: relative;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    overflow: visible;
}

.pg-dev-support-badge {
    position: absolute;
    top: -13px;
    left: 16px;
    z-index: 2;
    display: inline-block;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 5px 14px;
    border-radius: 4px;
    line-height: 1.35;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.pg-dev-support-list {
    padding-top: 18px;
}

.pg-dev-support-item {
    display: grid;
    grid-template-columns: 1fr 120px;
    align-items: center;
    column-gap: 24px;
    min-height: 52px;
    padding: 14px 24px;
    border-top: 1px solid #e5e7eb;
}

.pg-dev-support-item:first-child {
    border-top: none;
}

.pg-dev-support-item-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.pg-dev-support-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 14px;
}

.pg-dev-support-icon-wp {
    background: #f0f9ff;
    color: #0284c7;
}

.pg-dev-support-icon-zc {
    background: #fef3c7;
    color: #d97706;
}

.pg-dev-support-label {
    font-size: 14px;
    color: #1f2937;
    font-weight: 500;
    line-height: 1.4;
}

.pg-dev-support-action {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    font-size: 14px;
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.pg-dev-support-action:hover {
    color: #1d4ed8;
    text-decoration: none;
}

.pg-dev-support-action:hover span {
    text-decoration: underline;
}

.pg-dev-support-action i {
    font-size: 13px;
    opacity: 0.9;
}

@media (max-width: 576px) {
    .pg-dev-support-item {
        grid-template-columns: 1fr;
        row-gap: 10px;
        padding: 14px 16px;
    }

    .pg-dev-support-action {
        justify-content: flex-start;
        padding-left: 42px;
    }
}

/* ---- Empty state ---- */
.pg-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
}

.pg-empty i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

/* ---- Success rate center ---- */
.pg-success-rate-card {
    overflow: visible;
}

.pg-success-rate-search {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem 0.65rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #eef2f7;
    background: #fff;
}

.pg-success-rate-search-label {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
    white-space: nowrap;
}

.pg-success-rate-search .form-control,
.pg-success-rate-search .form-select {
    height: 34px;
    padding: 0 0.65rem;
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    box-shadow: none;
}

.pg-success-rate-keyword {
    width: 180px;
    flex: 0 0 180px;
}

.pg-merchant-combo {
    position: relative;
    width: 180px;
    flex: 0 0 180px;
}

.pg-merchant-combo .pg-success-rate-keyword {
    width: 100%;
    flex: 1 1 auto;
}

.pg-merchant-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    max-height: 180px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
    z-index: 25;
}

.pg-merchant-option {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: #fff;
    padding: 0.45rem 0.65rem;
    font-size: 0.85rem;
    cursor: pointer;
}

.pg-merchant-option:hover {
    background: #f1f5f9;
}

.pg-merchant-option-empty {
    color: #94a3b8;
    cursor: default;
}

.pg-success-rate-datetime {
    width: 185px;
    flex: 0 0 185px;
}

.pg-success-rate-channel,
.pg-success-rate-card-type {
    width: 168px;
    flex: 0 0 168px;
    height: 34px;
    min-height: 34px;
    padding-top: 0;
    padding-bottom: 0;
    padding-left: 0.65rem;
    padding-right: 1.75rem;
    line-height: 32px;
    color: #334155;
    font-size: 0.875rem;
    font-weight: 500;
}

.pg-success-rate-sep {
    color: #64748b;
    font-size: 0.9rem;
}

.pg-country-multi {
    position: relative;
    width: 200px;
    flex: 0 0 200px;
}

.pg-country-multi-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    min-height: 34px;
    padding: 0.15rem 0.45rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

.pg-country-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.pg-country-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.1rem 0.35rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 3px;
    font-size: 0.75rem;
    color: #1d4ed8;
}

.pg-country-tag button {
    border: none;
    background: transparent;
    color: #64748b;
    padding: 0;
    line-height: 1;
    font-size: 0.9rem;
    cursor: pointer;
}

.pg-country-input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 60px;
    height: 24px;
    font-size: 0.8rem;
    background: transparent;
    cursor: pointer;
}

.pg-country-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    max-height: 180px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
    z-index: 20;
}

.pg-country-option {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: #fff;
    padding: 0.45rem 0.65rem;
    font-size: 0.85rem;
    cursor: pointer;
}

.pg-country-option:hover {
    background: #f1f5f9;
}

.pg-country-option-empty {
    color: #94a3b8;
    cursor: default;
}

.pg-success-rate-table th {
    white-space: nowrap;
}

.pg-sort-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.pg-sort-link:hover {
    color: var(--pg-primary);
}

.pg-success-rate-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid #eef2f7;
}

/* ---- Admin dashboard filter ---- */
.pg-dashboard-filter-card {
    overflow: visible;
}

.pg-dashboard-filter {
    padding: 0.85rem 1rem;
}

.pg-dashboard-filter-row {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.55rem 0.65rem;
}

.pg-dashboard-filter-title {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 34px;
    white-space: nowrap;
    margin-right: 0.15rem;
}

.pg-dashboard-filter-merchant {
    position: relative;
    width: 220px;
    flex: 0 0 220px;
}

.pg-dashboard-filter-row .pg-form-control,
.pg-dashboard-filter-row .form-select {
    height: 34px;
    min-height: 34px;
    padding-top: 0;
    padding-bottom: 0;
    line-height: 32px;
    color: #334155;
    font-size: 0.875rem;
    font-weight: 500;
    background-color: #fff;
}

.pg-dashboard-filter-merchant .pg-merchant-select-search {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
}

.pg-dashboard-filter-channel {
    width: 168px;
    flex: 0 0 168px;
    padding-left: 0.65rem;
    padding-right: 1.75rem;
}

.pg-dashboard-filter-date {
    width: 150px;
    flex: 0 0 150px;
    padding-left: 0.55rem;
    padding-right: 0.55rem;
}

.pg-dashboard-filter-sep {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 34px;
}

.pg-dashboard-filter-row .btn {
    height: 34px;
    padding: 0 1rem;
    white-space: nowrap;
}

.pg-dashboard-filter-merchant .pg-merchant-select-tags {
    margin-top: 0.35rem;
}

@media (max-width: 992px) {
    .pg-dashboard-filter-merchant,
    .pg-dashboard-filter-channel,
    .pg-dashboard-filter-date {
        flex: 1 1 160px;
        width: auto;
    }
}

/* ---- Admin work tabs ---- */
.pg-work-tabs {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: #f1f5f9;
    border-bottom: 1px solid #dbe3ef;
    flex-shrink: 0;
}

.pg-work-tabs-list {
    display: flex;
    align-items: stretch;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

.pg-work-tabs-clear {
    flex-shrink: 0;
    position: sticky;
    right: 0;
    z-index: 2;
    margin-left: auto;
    padding: 0 1rem;
    min-width: 56px;
    border: none;
    border-left: 1px solid #dbe3ef;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.84rem;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.pg-work-tabs-clear:hover {
    background: #e8eef6;
    color: #334155;
}

.pg-work-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 180px;
    padding: 0.55rem 0.85rem;
    border: none;
    border-right: 1px solid #dbe3ef;
    background: transparent;
    color: #64748b;
    text-decoration: none;
    white-space: nowrap;
    font-size: 0.84rem;
    line-height: 1.2;
    transition: background 0.15s, color 0.15s;
}

.pg-work-tab:hover {
    background: #e8eef6;
    color: #334155;
}

.pg-work-tab.active {
    background: #fff;
    color: var(--pg-primary);
    box-shadow: inset 0 -2px 0 var(--pg-primary);
    font-weight: 500;
}

.pg-work-tab-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.pg-work-tab-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    border: none;
    border-radius: 3px;
    background: transparent;
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.pg-work-tab-close:hover {
    background: #fee2e2;
    color: #ef4444;
}

main.app-main {
    display: flex;
    flex-direction: column;
}

main.app-main > .pg-page-header,
main.app-main > .app-content {
    flex: 0 0 auto;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .pg-stat .stat-value { font-size: 1.5rem; }
    .pg-page-header h1 { font-size: 1.15rem; }
}
