.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 22px;
}

.page-heading h1 {
    margin: 0 0 5px;
}

.page-heading p {
    margin: 0;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
    gap: 22px;
}

.catalog-card {
    overflow: hidden;
    position: relative;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    box-shadow: 0 14px 40px rgba(16, 24, 40, .08);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.catalog-card:hover {
    transform: translateY(-3px);
    border-color: #c4b5fd;
    box-shadow: 0 22px 54px rgba(91, 33, 182, .14);
}

.catalog-head {
    display: grid;
    grid-template-columns: 94px 1fr;
    gap: 18px;
    align-items: center;
    padding: 22px;
    background: radial-gradient(circle at 10% 0, #ede9fe 0, transparent 48%), linear-gradient(135deg, #ffffff, #f8faff);
}

.catalog-head img,
.catalog-placeholder {
    width: 94px;
    height: 94px;
    border-radius: 18px;
    object-fit: cover;
    border: 1px solid rgba(109, 40, 217, .12);
    box-shadow: 0 10px 24px rgba(37, 99, 235, .13);
}

.catalog-placeholder {
    display: grid;
    place-items: center;
    color: #ffffff;
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    font-size: 25px;
    font-weight: 900;
}

.catalog-head h2 {
    margin: 7px 0 5px;
    color: #111827;
    font-size: 22px;
    line-height: 1.2;
}

.catalog-head p {
    margin: 0;
}

.catalog-category {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    color: #5b21b6;
    background: #ede9fe;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .65px;
    text-transform: uppercase;
}

.catalog-meta {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 22px;
    color: #475467;
    background: #f8fafc;
    border-top: 1px solid #eef2f6;
    border-bottom: 1px solid #eef2f6;
    font-size: 12px;
}

.package-list {
    display: grid;
    gap: 10px;
    padding: 16px;
}

.package-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 15px;
    background: #f8faff;
    border: 1px solid #e8eaf2;
    border-radius: 13px;
}

.package-row:last-child {
    border-bottom: 1px solid #e8eaf2;
}

.package-row > strong {
    flex: 0 0 auto;
    color: #5b21b6;
    font-size: 18px;
}

.copy-code {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.copy-code code {
    padding: 3px 7px;
    color: #1d4ed8;
    background: #dbeafe;
    border-radius: 6px;
    font-weight: 800;
}

.copy-mini {
    padding: 4px 8px;
    color: #ffffff;
    background: #6d28d9;
    border: 0;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 800;
}

.api-server-card {
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 95% 0, #dbeafe 0, transparent 40%), #ffffff;
    border-color: #c4b5fd;
}

.api-server-card h3 {
    margin: 14px 0 12px;
    font-size: 21px;
}

@media (max-width: 600px) {
    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .catalog-grid {
        grid-template-columns: 1fr;
    }

    .catalog-head {
        grid-template-columns: 72px 1fr;
        gap: 13px;
        padding: 17px;
    }

    .catalog-head img,
    .catalog-placeholder {
        width: 72px;
        height: 72px;
        border-radius: 14px;
    }

    .catalog-head h2 {
        font-size: 18px;
    }

    .catalog-meta {
        flex-direction: column;
        gap: 4px;
        padding: 11px 17px;
    }

    .package-row {
        align-items: flex-start;
    }
}

.editor-actions,
.row-actions,
.stock-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.editor-actions {
    margin-top: 18px;
}

.row-actions form {
    margin: 0;
}

.stock-filter {
    margin: 18px 0;
}

.history-table-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.history-table-heading h3,
.history-table-heading p {
    margin-top: 0;
}

.history-table-heading p {
    margin-bottom: 0;
}

.history-table-heading > b {
    flex: 0 0 auto;
    padding: 7px 10px;
    border: 1px solid #ddd6fe;
    border-radius: 9px;
    color: #5b21b6;
    background: #f5f3ff;
    font-size: 12px;
}

.balance-history-stats .stat b {
    overflow-wrap: anywhere;
}

@media (max-width: 600px) {
    .history-table-heading {
        flex-direction: column;
        gap: 8px;
    }
}

.credit-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 8px 0 16px;
    padding: 13px 14px;
    background: #f8fafc;
    border: 1px solid #e4e7ec;
    border-radius: 10px;
}

.credit-total b {
    color: #5b21b6;
    font-size: 24px;
}

.voucher-code {
    display: flex;
    align-items: center;
    gap: 7px;
}

.voucher-code code {
    display: inline-block;
    max-width: 260px;
    overflow: hidden;
    padding: 6px 8px;
    color: #344054;
    background: #f8fafc;
    border-radius: 7px;
    text-overflow: ellipsis;
}

.stock-table td {
    vertical-align: top;
}

.admin-editor h3 {
    margin-bottom: 18px;
}

@media (max-width: 650px) {
    .voucher-code code {
        max-width: 180px;
    }

    .stock-filter .btn {
        flex: 1;
    }
}

.dual-price {
    display: grid;
    justify-items: end;
    gap: 2px;
    min-width: 92px;
}

.dual-price small {
    color: var(--muted);
    font-weight: 750;
}

.wallet-balance-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.wallet-balance-grid > div {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: linear-gradient(135deg, #f8f5ff, #f5f9ff);
}

.wallet-balance-grid span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.wallet-balance-grid b {
    display: block;
    margin-top: 5px;
    font-size: 24px;
}

.sold-delete-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 14px 0;
    padding: 15px 17px;
    border: 1px solid #fecdca;
    border-radius: 13px;
    background: #fff6f5;
}

.sold-delete-bar span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.dual-wallet-adjust {
    grid-template-columns: 72px 90px 72px 142px auto;
    min-width: 510px;
}

.wallet-rate-setting {
    margin-top: 26px;
    padding-top: 4px;
    border-top: 1px solid var(--line);
}

@media (max-width: 680px) {
    .wallet-balance-grid {
        grid-template-columns: 1fr;
    }

    .sold-delete-bar {
        align-items: stretch;
        flex-direction: column;
    }
}
