/**
 * Loyalty Public Styles
 * Shared stylesheet for all public-facing installer portal templates.
 */

/* ======================== CSS Custom Properties ======================== */
:root {
    --loyalty-primary: #1890ff;
    --loyalty-primary-hover: #40a9ff;
    --loyalty-primary-active: #096dd9;
    --loyalty-success: #52c41a;
    --loyalty-warning: #fa8c16;
    --loyalty-danger: #ff4d4f;
    --loyalty-purple-start: #667eea;
    --loyalty-purple-end: #764ba2;
    --loyalty-bg: #f0f2f5;
    --loyalty-card-bg: #ffffff;
    --loyalty-text: #262626;
    --loyalty-text-secondary: #8c8c8c;
    --loyalty-border: #f0f0f0;
    --loyalty-radius: 12px;
    --loyalty-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --loyalty-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
    --loyalty-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ======================== Reset & Base ======================== */
.loyalty-page {
    margin: 0;
    padding: 0;
}

.loyalty-page *,
.loyalty-page *::before,
.loyalty-page *::after {
    box-sizing: border-box;
}

/* ======================== Top Bar ======================== */
.loyalty-topbar {
    background: var(--loyalty-card-bg);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--loyalty-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.loyalty-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.loyalty-topbar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--loyalty-text);
}

.loyalty-topbar-divider {
    width: 1px;
    height: 20px;
    background: #d9d9d9;
}

/* ======================== Container ======================== */
.loyalty-container {
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* ======================== Card ======================== */
.loyalty-card {
    margin-bottom: 20px;
}

.loyalty-card-hover {
    cursor: pointer;
    transition: box-shadow 0.3s, transform 0.3s;
}

.loyalty-card-hover:hover {
    box-shadow: var(--loyalty-shadow-hover);
    transform: translateY(-2px);
}

.loyalty-card-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: #254487;
}

/* ======================== Card Variants ======================== */
.loyalty-points-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #254487;
    border-radius: var(--loyalty-radius);
    padding: 24px;

    border: none;
}

.loyalty-points-card .loyalty-points-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: #fff;
}

.loyalty-points-card  h1 {
    color: #fff;
    margin: 0;
}

.loyalty-points-card .loyalty-points-header .view-more {
       color: #fff;
     
}

.loyalty-points-card .loyalty-points-row {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.loyalty-points-card  .loyalty-points-btns {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding-top: 1rem;
  padding-bottom: 2rem;
}

.loyalty-points-card  .loyalty-points-btns a {
    display: block;
    padding: 10px 20px;
    border-radius: 10px;
    color: #fff;
    text-decoration: none;
    background-color: #ee822f;
}

.loyalty-points-card .loyalty-points-icon {
    font-size: 36px;
}

.loyalty-points-card .loyalty-points-value {
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.loyalty-points-card .loyalty-points-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.loyalty-points-rules {
    width: 100%;
    border: 2px solid #254487;
    border-radius: 15px;
    padding: 1rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.loyalty-points-rules p {
    margin: 0;
}

/* ======================== Buttons ======================== */
.loyalty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    line-height: 1.5;
    font-family: var(--loyalty-font);
}


.loyalty-btn.cnsure {
    padding: 0.5rem 5rem;
    background-color: #1e386b;
    color: #fff;
}

.loyalty-btn.cancel {
      padding: 0.5rem 5rem;
      border: 1px solid #8c8c8c;
      color: #000;
      text-decoration: none !important;
}

.loyalty-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.loyalty-btn-primary {
    background: var(--loyalty-primary);
    color: #fff;
    border-color: var(--loyalty-primary);
}

.loyalty-btn-primary:hover:not(:disabled) {
    background: var(--loyalty-primary-hover);
    border-color: var(--loyalty-primary-hover);
}

.loyalty-btn-primary:active:not(:disabled) {
    background: var(--loyalty-primary-active);
    border-color: var(--loyalty-primary-active);
}

.loyalty-btn-ghost {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.7);
}

.loyalty-btn-ghost:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
}

.loyalty-btn-default {
    background: var(--loyalty-card-bg);
    color: var(--loyalty-text);
    border-color: #d9d9d9;
}

.loyalty-btn-default:hover:not(:disabled) {
    color: var(--loyalty-primary);
    border-color: var(--loyalty-primary);
}

.loyalty-btn-text {
    background: transparent;
    color: var(--loyalty-text-secondary);
    border-color: transparent;
    padding: 8px 12px;
}

.loyalty-btn-text:hover:not(:disabled) {
    color: var(--loyalty-primary);
    background: rgba(24, 144, 255, 0.06);
}

.loyalty-btn-danger {
    background: transparent;
    color: var(--loyalty-danger);
    border-color: transparent;
}

.loyalty-btn-danger:hover:not(:disabled) {
    background: rgba(255, 77, 79, 0.08);
}

.loyalty-btn-sm {
    padding: 4px 12px;
    font-size: 13px;
    border-radius: 6px;
}

.loyalty-btn-lg {
    padding: 10px 28px;
    font-size: 16px;
    height: 44px;
}

.loyalty-btn-block {
    display: flex;
    width: 100%;
}

/* ======================== Links ======================== */
.loyalty-link {
    color: var(--loyalty-primary);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s;
}

.loyalty-link:hover {
    color: var(--loyalty-primary-hover);
    text-decoration: underline;
}

/* ======================== Forms ======================== */

.loyalty-form-group-row {
    display: flex;
    gap: 1rem;
}
.loyalty-form-group {
    margin-bottom: 20px;
    flex: 1;
}

.loyalty-form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--loyalty-text);
}

.loyalty-form-label .loyalty-required {
    color: var(--loyalty-danger);
    margin-left: 2px;
}

.loyalty-input {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-family: var(--loyalty-font);
    color: var(--loyalty-text);
    background: var(--loyalty-card-bg);
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    transition: border-color 0.3s, box-shadow 0.3s;
    outline: none;
}

.loyalty-input:focus {
    border-color: var(--loyalty-primary);
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.loyalty-input::placeholder {
    color: #bfbfbf;
}

.loyalty-input[readonly] {
    background: #f5f5f5;
    color: var(--loyalty-text-secondary);
    cursor: not-allowed;
}

.loyalty-input-error {
    border-color: var(--loyalty-danger);
}

.loyalty-input-error:focus {
    box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.2);
}

.loyalty-textarea {
    resize: vertical;
    min-height: 80px;
}

select.loyalty-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238c8c8c' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.loyalty-form-error {
    color: var(--loyalty-danger);
    font-size: 13px;
    margin-top: 4px;
    display: none;
}

.loyalty-form-error.visible {
    display: block;
}

/* ======================== Messages / Alerts ======================== */
.loyalty-message {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    display: none;
}

.loyalty-message.visible {
    display: block;
}

.loyalty-message-error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: var(--loyalty-danger);
}

.loyalty-message-success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: var(--loyalty-success);
}

.loyalty-message-info {
    background: #e6f7ff;
    border: 1px solid #91d5ff;
    color: var(--loyalty-primary);
}

/* ======================== Status Tags ======================== */
.loyalty-tag {
    display: inline-block;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    line-height: 20px;
}

.loyalty-tag-pending {
    background: #fff7e6;
    color: #d46b08;
    border: 1px solid #ffd591;
}

.loyalty-tag-approved {
    background: #f6ffed;
    color: #389e0d;
    border: 1px solid #b7eb8f;
}

.loyalty-tag-rejected {
    background: #fff2f0;
    color: #cf1322;
    border: 1px solid #ffccc7;
}

.loyalty-tag-disabled {
    background: #fafafa;
    color: #8c8c8c;
    border: 1px solid #d9d9d9;
}

.loyalty-tag-processing {
    background: #e6f7ff;
    color: #096dd9;
    border: 1px solid #91d5ff;
}

.loyalty-tag-completed {
    background: #f6ffed;
    color: #389e0d;
    border: 1px solid #b7eb8f;
}

.loyalty-tag-cancelled {
    background: #fff2f0;
    color: #cf1322;
    border: 1px solid #ffccc7;
}

.loyalty-tag-blue {
    background: #e6f7ff;
    color: #096dd9;
    border: 1px solid #91d5ff;
}

/* ======================== Tables ======================== */
.loyalty-table-wrapper {
    overflow-x: auto;
}

.loyalty-table {
    width: 100%;
    border-collapse: collapse;
    border: none;
    font-size: 14px;
}

.loyalty-table thead th {
    background: #fafafa;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--loyalty-text);
    border: none;
    white-space: nowrap;
}

.loyalty-table tbody td {
    padding: 12px 16px;
    border: none;
    color: var(--loyalty-text);
}

.loyalty-table tbody tr:hover {
    background: #fafafa;
}

.loyalty-table tbody tr.loyalty-table-empty td {
    text-align: center;
    padding: 40px 16px;
    color: var(--loyalty-text-secondary);
}

.loyalty-table .loyalty-points-positive {
    color: var(--loyalty-success);
    font-weight: 600;
    font-size: 15px;
}

.loyalty-table .loyalty-points-negative {
    color: var(--loyalty-danger);
    font-weight: 600;
    font-size: 15px;
}

/* ======================== Redemption Page ======================== */
.loyalty-redemption-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px 48px;
}

.loyalty-rd-points-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: #e8f0fa;
    border-radius: 0;
    padding: 28px 40px;
    margin: 0 -24px 28px;
}

.loyalty-rd-points-left {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.loyalty-rd-points-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #254487;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.loyalty-rd-points-label {
    font-size: 15px;
    font-weight: 500;
    color: #254487;
    line-height: 1.3;
}

.loyalty-rd-points-value {
    font-size: 36px;
    font-weight: 700;
    color: #1a2b4a;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.loyalty-rd-upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 999px;
    background: #254487;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.2s;
}

.loyalty-rd-upload-btn:hover {
    background: #1d376f;
    color: #fff;
    text-decoration: none;
}

/* ======================== Product Grid ======================== */
.loyalty-product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

@media (max-width: 992px) {
    .loyalty-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    .loyalty-product-grid {
        grid-template-columns: 1fr;
    }
}

.loyalty-product-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 16px;
    color: var(--loyalty-text-secondary);
    font-size: 14px;
}

/* ======================== Product Card ======================== */
.loyalty-product-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(37, 68, 135, 0.06);
    overflow: hidden;
    transition: box-shadow 0.3s, transform 0.3s;
    display: flex;
    flex-direction: column;
}

.loyalty-product-card:hover {
    box-shadow: 0 8px 24px rgba(37, 68, 135, 0.12);
    transform: translateY(-2px);
}

.loyalty-product-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fff;
    padding: 20px 20px 8px;
}

.loyalty-product-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.loyalty-product-img-placeholder {
    font-size: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
    border-radius: 12px;
}

.loyalty-product-info {
    padding: 8px 18px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.loyalty-product-name {
    margin: 0 0 14px 0;
    font-size: 14px;
    font-weight: 600;
    color: #254487;
    line-height: 1.4;
    text-align: center;
    min-height: 2.8em;
}

.loyalty-product-desc {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: var(--loyalty-text-secondary);
    line-height: 1.5;
    flex: 1;
}

.loyalty-product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
}

.loyalty-product-points {
    font-size: 15px;
    font-weight: 600;
    color: #254487;
    margin: 0;
}

.loyalty-product-exchange {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 16px;
    border: 1px solid #254487;
    border-radius: 999px;
    background: #fff;
    color: #254487;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
    font-family: var(--loyalty-font);
    line-height: 1.4;
}

.loyalty-product-exchange:hover:not(:disabled) {
    background: #254487;
    color: #fff;
}

.loyalty-product-exchange:disabled,
.loyalty-product-exchange.loyalty-btn-disabled {
    border-color: #c5cddb;
    color: #a0aab8;
    background: #f5f7fa;
    cursor: not-allowed;
}

/* Disabled/grayed-out redeem button */
.loyalty-btn-disabled,
.loyalty-btn.loyalty-btn-disabled,
.loyalty-btn.loyalty-btn-disabled:hover,
.loyalty-btn.loyalty-btn-disabled:active {
    background: #d9d9d9;
    color: #bfbfbf;
    border-color: #d9d9d9;
    cursor: not-allowed;
    opacity: 1;
}

/* Redemption pagination */
.loyalty-rd-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 28px 0 8px;
}

.loyalty-rd-pagination button {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 14px;
    font-family: var(--loyalty-font);
    border: none;
    border-radius: 8px;
    background: #eef1f6;
    color: #254487;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.loyalty-rd-pagination button:hover:not(:disabled):not(.active) {
    background: #e0e6f0;
}

.loyalty-rd-pagination button.active {
    background: #254487;
    color: #fff;
}

.loyalty-rd-pagination button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.loyalty-rd-pagination .loyalty-rd-page-ellipsis,
.loyalty-record-pagination .loyalty-rd-page-ellipsis {
    color: #8a97ad;
    font-size: 14px;
    padding: 0 2px;
    user-select: none;
}

/* Point conversion rules */
.loyalty-rd-rules {
    margin-top: 36px;
    padding: 8px 4px 0;
}

.loyalty-rd-rules-title {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 700;
    color: #1a2b4a;
}

.loyalty-rd-rules-list {
    margin: 0;
    padding-left: 20px;
    color: #5a6b85;
    font-size: 14px;
    line-height: 1.85;
}

.loyalty-rd-rules-list li {
    margin-bottom: 2px;
}

@media (max-width: 768px) {
    .loyalty-redemption-page {
        padding: 0 12px 32px;
        max-width: 100%;
    }

    .loyalty-rd-points-bar {
        flex-direction: column;
        align-items: stretch;
        margin: 0 -12px 20px;
        padding: 18px 16px;
        gap: 14px;
    }

    .loyalty-rd-points-left {
        gap: 12px;
    }

    .loyalty-rd-points-icon {
        width: 52px;
        height: 52px;
    }

    .loyalty-rd-points-value {
        font-size: 28px;
    }

    .loyalty-rd-upload-btn {
        width: 100%;
        min-height: 44px;
        text-align: center;
    }

    .loyalty-product-grid {
        gap: 14px;
    }

    .loyalty-product-img {
        padding: 14px 14px 6px;
    }

    .loyalty-product-info {
        padding: 6px 14px 14px;
    }

    .loyalty-rd-rules {
        margin-top: 24px;
        padding: 0;
    }

    .loyalty-rd-rules-title {
        font-size: 15px;
    }

    .loyalty-rd-rules-list {
        padding-left: 18px;
        font-size: 13px;
        line-height: 1.7;
    }
}

@media (max-width: 480px) {
    .loyalty-redemption-page {
        padding: 0 8px 28px;
    }

    .loyalty-rd-points-bar {
        margin: 0 -8px 16px;
        padding: 16px 12px;
    }

    .loyalty-rd-points-label {
        font-size: 13px;
    }

    .loyalty-rd-points-value {
        font-size: 24px;
    }
}

/* ======================== Pagination ======================== */
.loyalty-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px 0;
}

.loyalty-pagination button {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    font-size: 13px;
    font-family: var(--loyalty-font);
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    background: var(--loyalty-card-bg);
    color: var(--loyalty-text);
    cursor: pointer;
    transition: all 0.3s;
}

.loyalty-pagination button:hover:not(:disabled) {
    color: var(--loyalty-primary);
    border-color: var(--loyalty-primary);
}

.loyalty-pagination button.active {
    background: var(--loyalty-primary);
    color: #fff;
    border-color: var(--loyalty-primary);
}

.loyalty-pagination button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.loyalty-pagination .loyalty-pagination-info {
    font-size: 13px;
    color: var(--loyalty-text-secondary);
    margin: 0 8px;
}

/* ======================== Tabs ======================== */
.loyalty-tabs {
    display: flex;
    border-bottom: 1px solid var(--loyalty-border);
    margin-bottom: 16px;
    gap: 0;
}

.loyalty-tab {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--loyalty-text-secondary);
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
    font-family: var(--loyalty-font);
    margin-bottom: -1px;
}

.loyalty-tab:hover {
    color: var(--loyalty-primary);
}

.loyalty-tab.active {
    color: var(--loyalty-primary);
    border-bottom-color: var(--loyalty-primary);
}

.loyalty-tab-panel {
    display: none;
}

.loyalty-tab-panel.active {
    display: block;
}

/* ======================== Modal ======================== */
.loyalty-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.loyalty-modal-overlay.open {
    display: flex;
}

.loyalty-modal {
    background: var(--loyalty-card-bg);
    border-radius: var(--loyalty-radius);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 0;
}

.loyalty-modal-wide {
    max-width: 780px;
}

.loyalty-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--loyalty-border);
}

.loyalty-modal-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.loyalty-modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--loyalty-text-secondary);
    padding: 4px;
    line-height: 1;
}

.loyalty-modal-close:hover {
    color: var(--loyalty-text);
}

.loyalty-modal-body {
    padding: 24px;
}

.loyalty-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--loyalty-border);
}

/* ======================== Edit Information Modal ======================== */
.loyalty-pc-edit-modal {
    max-width: 600px;
    border-radius: 20px;
    box-shadow: 0 16px 48px rgba(26, 43, 74, 0.22);
    overflow: hidden;
}

.loyalty-pc-edit-body {
    padding: 32px 36px 28px;
}

.loyalty-pc-edit-title {
    margin: 0 0 24px;
    font-size: 24px;
    font-weight: 700;
    color: #1a2b4a;
    line-height: 1.25;
    text-align: left;
}

.loyalty-pc-edit-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.loyalty-pc-edit-modal .loyalty-form-group {
    margin-bottom: 16px;
}

.loyalty-pc-edit-modal .loyalty-form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #254487;
}

.loyalty-pc-edit-modal .loyalty-required {
    color: #254487;
}

.loyalty-pc-edit-modal .loyalty-input {
    width: 100%;
    height: 40px;
    border: 1px solid #d9e2ef;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    color: #1a2b4a;
    background: #fff;
    box-shadow: none;
}

.loyalty-pc-edit-modal .loyalty-input:focus {
    border-color: #254487;
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 68, 135, 0.12);
}

.loyalty-pc-edit-modal .loyalty-input[readonly] {
    background: #f7f9fc;
    color: #5a6b85;
    cursor: default;
}

.loyalty-pc-edit-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 28px;
}

.loyalty-pc-edit-ensure {
    min-width: 110px;
    height: 40px;
    border: none !important;
    border-radius: 999px !important;
    background: #254487 !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    padding: 0 28px !important;
}

.loyalty-pc-edit-ensure:hover:not(:disabled) {
    background: #1d376f !important;
}

.loyalty-pc-edit-cancel {
    min-width: 110px;
    height: 40px;
    border: none !important;
    border-radius: 999px !important;
    background: #eef1f6 !important;
    color: #8a97ad !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    padding: 0 28px !important;
}

.loyalty-pc-edit-cancel:hover:not(:disabled) {
    background: #e4e9f2 !important;
    color: #5a6b85 !important;
}

@media (max-width: 480px) {
    .loyalty-pc-edit-body {
        padding: 24px 20px 20px;
    }

    .loyalty-pc-edit-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .loyalty-pc-edit-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .loyalty-pc-edit-ensure,
    .loyalty-pc-edit-cancel {
        width: 100%;
    }
}

/* ======================== Exchange Confirm Modal ======================== */
.loyalty-exchange-modal {
    position: relative;
    width: 520px;
    max-width: calc(100vw - 32px);
    border-radius: 20px;
    overflow-x: hidden;
    box-shadow: 0 16px 48px rgba(26, 43, 74, 0.22);
}

.loyalty-exchange-modal .loyalty-modal-body {
    padding: 34px 48px 40px;
    overflow-x: hidden;
    text-align: center;
}

.loyalty-exchange-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #8a97ad;
    cursor: pointer;
    z-index: 2;
}

.loyalty-exchange-modal-close svg {
    width: 18px;
    height: 18px;
}

.loyalty-exchange-modal-close:hover {
    background: #eef1f6;
    color: #254487;
}

.loyalty-exchange-modal-title {
    margin: 0 0 8px;
    color: #1a2b4a;
    font-size: 34px;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.02em;
}

.loyalty-exchange-modal-desc {
    margin: 0 0 30px;
    color: #1a2b4a;
    font-size: 16px;
    line-height: 1.35;
}

.loyalty-exchange-product {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 32px;
    padding: 0;
    background: transparent;
}

.loyalty-exchange-product-img {
    width: 150px;
    height: 190px;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loyalty-exchange-product-img img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    display: block;
}

.loyalty-exchange-product-info {
    text-align: center;
    min-width: 0;
}

.loyalty-exchange-product-name {
    font-size: 18px;
    font-weight: 700;
    color: #254487;
    line-height: 1.3;
}

.loyalty-exchange-product-points {
    margin-top: 2px;
    font-size: 14px;
    font-weight: 400;
    color: #254487;
    line-height: 1.4;
}

.loyalty-exchange-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.loyalty-exchange-actions .loyalty-btn,
.loyalty-exchange-actions .loyalty-btn.cnsure,
.loyalty-exchange-actions .loyalty-btn.cancel {
    min-width: 132px;
    width: auto;
    height: 40px;
    min-height: 40px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    padding: 0 28px;
    border: none;
    box-shadow: none;
    justify-content: center;
}

.loyalty-exchange-actions .loyalty-btn.cnsure {
    background: #254487;
    color: #fff;
}

.loyalty-exchange-actions .loyalty-btn.cancel {
    background: #eef1f6;
    color: #8a97ad;
    border: none;
}

.loyalty-exchange-actions .loyalty-btn.cancel:hover {
    background: #e4e9f2;
    color: #5a6b85;
    border: none;
}

.loyalty-exchange-success-title {
    margin: 0 0 24px;
    font-size: 20px;
    font-weight: 700;
    color: #1a2b4a;
    line-height: 1.35;
    text-align: center;
}

.loyalty-exchange-success-desc {
    margin: 0 0 48px;
    font-size: 15px;
    color: #1a2b4a;
    line-height: 1.35;
    text-align: center;
}

.loyalty-exchange-success-icon {
    color: #d8e7f7;
    display: flex;
    justify-content: center;
    margin-bottom: 56px;
}

.loyalty-exchange-success-ok {
    min-width: 132px;
    height: 40px;
    border-radius: 999px;
    background: #254487 !important;
    color: #fff !important;
    border: none !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    padding: 0 28px !important;
}

@media (max-width: 560px) {
    .loyalty-exchange-modal .loyalty-modal-body {
        padding: 28px 24px 30px;
    }

    .loyalty-exchange-modal-title {
        font-size: 28px;
    }

    .loyalty-exchange-actions {
        flex-direction: column;
        gap: 12px;
    }

    .loyalty-exchange-actions .loyalty-btn,
    .loyalty-exchange-actions .loyalty-btn.cnsure,
    .loyalty-exchange-actions .loyalty-btn.cancel,
    .loyalty-exchange-success-ok {
        width: 100%;
    }
}


/* ======================== Action Cards ======================== */
.loyalty-action-card {
    text-align: center;
    cursor: pointer;
    border-radius: var(--loyalty-radius);
    padding: 24px 16px;
    background: var(--loyalty-card-bg);
    box-shadow: var(--loyalty-shadow);
    transition: box-shadow 0.3s, transform 0.3s;
    text-decoration: none;
    display: block;
    color: inherit;
}

.loyalty-action-card:hover {
    box-shadow: var(--loyalty-shadow-hover);
    transform: translateY(-2px);
}

.loyalty-action-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 24px;
}

.loyalty-action-card-icon.blue {
    background: #e6f7ff;
    color: var(--loyalty-primary);
}

.loyalty-action-card-icon.orange {
    background: #fff7e6;
    color: var(--loyalty-warning);
}

.loyalty-action-card-icon.green {
    background: #f6ffed;
    color: var(--loyalty-success);
}

.loyalty-action-card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.loyalty-action-card-desc {
    font-size: 12px;
    color: var(--loyalty-text-secondary);
}

/* ======================== Personal Center Layout ======================== */
body:has(.loyalty-personal-center) .entry-header,
body:has(.loyalty-personal-center) .entry-header.ast-no-thumbnail,
body:has(.loyalty-personal-center) .entry-title {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

body:has(.loyalty-personal-center) .entry-content,
body:has(.loyalty-personal-center) .ast-container,
body:has(.loyalty-personal-center) .site-content {
    margin-top: 0;
    padding-top: 0;
}

.loyalty-personal-center {
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    color: #172C57;
    font-size: 18px;
    box-sizing: border-box;
}

/* Keep portal content centered inside theme content wrappers (Kadence etc.). */
body:has(.loyalty-personal-center) .entry-content-wrap,
body:has(.loyalty-personal-center) .entry-content.single-content,
body:has(.loyalty-personal-center) .content-container.site-container {
    max-width: none;
    width: 100%;
}

body:has(.loyalty-personal-center) .loyalty-page {
    width: 100%;
    display: block;
}

.loyalty-personal-center  section .loyalty-pc-outline-btn {
    text-decoration: none;
}

/* Profile header */
.loyalty-pc-profile {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    background: #fff;
    border-radius: 16px;
    padding: 28px 32px;
    box-shadow: 0 2px 12px rgba(37, 68, 135, 0.06);
}

.loyalty-pc-profile-main {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    min-width: 0;
    flex: 1;
}

.loyalty-pc-avatar {
    display: none;
}

.loyalty-pc-profile-info {
    min-width: 0;
    flex: 1;
}

.loyalty-pc-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.loyalty-pc-name {
    margin: 0;
    font-size: 52px;
    font-weight: 700;
    color: #172C57;
    line-height: 1.2;
}

.loyalty-pc-edit-name {
    border: none;
    background: transparent;
    color: #172C57;
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    border-radius: 6px;
}

.loyalty-pc-edit-name:hover {
    background: rgba(23, 44, 87, 0.08);
}

.loyalty-pc-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 8px 22px;
    margin-bottom: 10px;
    text-align: left;
}

.loyalty-pc-meta-item,
.loyalty-pc-address {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    color: #172C57;
    font-size: 18px;
    line-height: 1.5;
    text-align: left;
}

.loyalty-pc-meta-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 5px;
    box-sizing: border-box;
    border-radius: 50%;
    background-color: #172C57;
    color: #fff;
    flex-shrink: 0;
}

.loyalty-pc-meta-icon svg,
.loyalty-pc-meta-item svg,
.loyalty-pc-address svg {
    width: 18px;
    height: 18px;
    display: block;
    color: inherit;
    flex-shrink: 0;
}

.loyalty-pc-meta-rite {
    color: #172C57;
}

.loyalty-pc-address {
    max-width: 100%;
}

.loyalty-pc-pwd-btn {
    flex-shrink: 0;
    background: #172C57 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 999px !important;
    padding: 10px 22px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    white-space: nowrap;
}

.loyalty-pc-pwd-btn:hover:not(:disabled) {
    background: #122343 !important;
}

/* Points bar */
.loyalty-pc-points-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #fff;
    border-radius: 16px;
    padding: 18px 28px;
    box-shadow: 0 2px 12px rgba(37, 68, 135, 0.06);
}

.loyalty-pc-points-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.loyalty-pc-points-accent {
    width: 4px;
    height: 22px;
    border-radius: 2px;
    background: #172C57;
    display: inline-block;
    flex-shrink: 0;
}

.loyalty-pc-points-label {
    font-size: 18px;
    font-weight: 700;
    color: #172C57;
}

.loyalty-pc-points-value {
    font-size: 22px;
    font-weight: 700;
    color: #172C57;
}

.loyalty-pc-points-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

.loyalty-pc-outline-btn,
a.loyalty-pc-outline-btn,
a.loyalty-pc-outline-btn:hover,
a.loyalty-pc-outline-btn:focus,
a.loyalty-pc-outline-btn:active,
a.loyalty-pc-outline-btn:visited {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: 1px solid #172C57;
    border-radius: 999px;
    color: #172C57;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 500;
    background: #fff;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.loyalty-pc-outline-btn:hover,
a.loyalty-pc-outline-btn:hover {
    background: #172C57;
    color: #fff;
    text-decoration: none !important;
}

/* History cards */
.loyalty-pc-history-card {
    background: #fff;
    border-radius: 16px;
    padding: 22px 28px 12px;
    box-shadow: 0 2px 12px rgba(37, 68, 135, 0.06);
}

.loyalty-pc-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.loyalty-pc-history-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: #172C57;
    line-height: 1.3;
}

.loyalty-pc-view-more {
    padding: 6px 16px;
    font-size: 13px;
}

.loyalty-pc-table {
    width: 100%;
    margin: 0;
}

.loyalty-pc-table thead th {
    color: #172C57;
    font-weight: 500;
    font-size: 18px;
    border-bottom: 1px solid #eef1f6;
    padding: 12px 8px;
    background: transparent;
}

.loyalty-pc-table tbody td {
    padding: 16px 8px;
    border-bottom: 1px solid #eef1f6;
    color: #172C57;
    font-size: 18px;
    vertical-align: middle;
}

.loyalty-pc-table tbody tr:last-child td {
    border-bottom: none;
}

.loyalty-pc-points-cell {
    font-weight: 600;
}

.loyalty-pc-points-plus {
    color: #172C57;
}

.loyalty-pc-points-minus {
    color: #172C57;
}

.loyalty-pc-points-empty {
    color: #172C57;
}

.loyalty-pc-status {
    font-weight: 600;
    font-size: 14px;
}

.loyalty-pc-status-approved {
    color: #52c41a;
}

.loyalty-pc-status-rejected {
    color: #ff4d4f;
}

.loyalty-pc-status-pending {
    color: #fa8c16;
}

@media (max-width: 900px) {
    .loyalty-personal-center {
        padding: 16px;
        font-size: 16px;
        gap: 16px;
        max-width: 100%;
    }

    .loyalty-pc-profile {
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
        gap: 16px;
    }

    .loyalty-pc-pwd-btn {
        align-self: stretch;
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    .loyalty-pc-points-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 16px 18px;
        gap: 14px;
    }

    .loyalty-pc-points-actions {
        width: 100%;
        justify-content: stretch;
        flex-direction: column;
    }

    .loyalty-pc-history-card {
        padding: 16px 14px 8px;
    }

    .loyalty-pc-name {
        font-size: 28px;
    }

    .loyalty-pc-meta-item,
    .loyalty-pc-address,
    .loyalty-pc-points-label,
    .loyalty-pc-history-title {
        font-size: 15px;
    }

    .loyalty-pc-points-value {
        font-size: 20px;
    }
}

@media (max-width: 640px) {
    .loyalty-personal-center {
        padding: 12px;
        margin: 0;
        gap: 12px;
        font-size: 15px;
    }

    .loyalty-pc-profile {
        padding: 16px;
        border-radius: 14px;
    }

    .loyalty-pc-profile-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }

    .loyalty-pc-name {
        font-size: 20px;
        line-height: 1.2;
    }

    .loyalty-pc-name-row {
        flex-wrap: nowrap;
        align-items: center;
        gap: 6px;
        margin-bottom: 8px;
    }

    .loyalty-pc-profile-info {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        min-width: 0;
        flex: 1;
        width: 100%;
        text-align: left;
    }

    .loyalty-pc-name,
    .loyalty-pc-name-row {
        text-align: left;
        width: 100%;
        justify-content: flex-start;
    }

    .loyalty-pc-meta {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 10px;
        margin-bottom: 12px;
        width: 100%;
        text-align: left;
    }

    .loyalty-pc-meta-item,
    .loyalty-pc-address {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
        font-size: 14px;
        word-break: break-word;
        text-align: left;
    }

    .loyalty-pc-address {
        width: 100%;
        justify-content: flex-start;
        text-align: left;
    }

    .loyalty-pc-meta-icon {
        width: 24px;
        height: 24px;
        padding: 4px;
    }

    .loyalty-pc-meta-icon svg,
    .loyalty-pc-meta-item svg,
    .loyalty-pc-address svg {
        width: 14px;
        height: 14px;
    }

    .loyalty-pc-points-bar,
    .loyalty-pc-history-card {
        border-radius: 14px;
    }

    .loyalty-pc-outline-btn,
    a.loyalty-pc-outline-btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
        padding: 10px 16px;
        font-size: 14px;
        white-space: normal;
        text-align: center;
    }

    .loyalty-pc-history-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .loyalty-pc-view-more {
        width: 100%;
    }

    .loyalty-pc-table thead th,
    .loyalty-pc-table tbody td {
        font-size: 14px;
    }
}

/* ======================== Profile Card ======================== */
.loyalty-profile-card {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.loyalty-profile-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.loyalty-profile-card-header .loyalty-card-title {
    margin: 0;
}

/* ======================== Profile DL (Left-Right Key-Value List) ======================== */
.loyalty-profile-dl {
    display: flex;
    flex-direction: column;
    margin: 0;
}

.loyalty-profile-dl-row {
    display: flex;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid var(--loyalty-border);
}

.loyalty-profile-dl-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.loyalty-profile-dl-row:first-child {
    padding-top: 0;
}

.loyalty-profile-dl-row dt {
    width: 100px;
    flex-shrink: 0;
    font-size: 14px;
    color: var(--loyalty-text-secondary);
    font-weight: 400;
    margin: 0;
    line-height: 1.5;
}

.loyalty-profile-dl-row dd {
    flex: 1;
    margin: 0;
    font-size: 14px;
    color: var(--loyalty-text);
    line-height: 1.5;
    word-break: break-word;
}

/* Keep existing profile-name/profile-email for inline text styling */
.loyalty-profile-forename,
.loyalty-profile-surname,
.loyalty-profile-name {
    font-weight: 500;
}

/* ======================== Deprecated (kept for backwards compat if needed) ======================== */
.loyalty-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--loyalty-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    flex-shrink: 0;
}

/* ======================== Banner ======================== */
.loyalty-banner {
    position: relative;
    background-image: url('../../assets/images/upload-bg.png');
    background-repeat: no-repeat;
    background-size: cover;
    border-radius: var(--loyalty-radius);
    padding: 5rem;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    border: none;
}

.loyalty-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(30, 56, 107,.9);
    z-index: 1;
}


.loyalty-banner-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    flex-shrink: 0;
}

.loyalty-banner-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1;
    z-index: 2;
}

.loyalty-banner-title {
    color: #fff;
}

.loyalty-banner-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    line-height: 1.6;
}

/* ======================== Upload Preview ======================== */
.loyalty-upload-area {
    border: 2px dashed #d9d9d9;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s;
    position: relative;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loyalty-upload-area:hover {
    border-color: var(--loyalty-primary);
}

.loyalty-upload-area.has-preview {
    border-style: solid;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
    justify-content: center;
    align-content: flex-start;
}

.loyalty-upload-area.loyalty-uploaded {
    border-color: var(--loyalty-success, #52c41a);
    border-style: solid;
}

/* Uploading / error state indicators */
.loyalty-upload-area.loyalty-uploading {
    border-color: var(--loyalty-primary);
    border-style: solid;
    position: relative;
    overflow: hidden;
}

.loyalty-upload-area.loyalty-uploading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--loyalty-primary);
    animation: loyalty-upload-progress 1.5s ease-in-out infinite;
}

@keyframes loyalty-upload-progress {
    0% { width: 0; left: 0; }
    50% { width: 70%; left: 15%; }
    100% { width: 0; left: 100%; }
}

.loyalty-upload-area.loyalty-upload-error {
    border-color: var(--loyalty-danger);
    border-style: solid;
}

/* ======================== Unified Thumbnail Card ========================
 * Receipt/packaging preview cards match Dropzone .dz-preview exactly.
 */
.loyalty-upload-area.has-preview .loyalty-upload-preview {
    /* Card wrapper — matches .dz-preview */
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    width: 100px;
    padding: 6px;
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    position: relative;
}

.loyalty-upload-area.has-preview .loyalty-upload-preview img {
    /* Thumbnail — matches .dz-image img */
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

/* Success checkmark overlay — matches .dz-success-mark */
.loyalty-upload-area.loyalty-uploaded .loyalty-upload-preview::before {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(82, 196, 26, 0.85);
    color: #fff;
    text-align: center;
    line-height: 28px;
    font-size: 14px;
    z-index: 1;
    pointer-events: none;
    margin-top: -10px; /* offset for filename area */
}

/* Error cross overlay — matches .dz-error-mark */
.loyalty-upload-area.loyalty-upload-error .loyalty-upload-preview::before {
    content: '✕';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 77, 79, 0.85);
    color: #fff;
    text-align: center;
    line-height: 28px;
    font-size: 14px;
    z-index: 1;
    pointer-events: none;
    margin-top: -10px;
}

/* Filename label — matches Dropzone .dz-filename */
.loyalty-upload-filename {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 90px;
    font-size: 11px;
    color: var(--loyalty-text);
    padding: 4px 0 0;
}

/* File size label — matches Dropzone .dz-size */
.loyalty-upload-filesize {
    font-size: 10px;
    color: var(--loyalty-text-secondary);
}

.loyalty-upload-placeholder {
    color: var(--loyalty-text-secondary);
    font-size: 14px;
}

.loyalty-upload-placeholder-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}

.loyalty-upload-preview {
    position: relative;
    width: 100%;
}

.loyalty-upload-preview img {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 6px;
}

.loyalty-upload-preview-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--loyalty-danger);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    padding: 0;
    z-index: 2;
    transition: transform 0.15s;
}

.loyalty-upload-preview-remove:hover {
    transform: scale(1.15);
}

.loyalty-upload-hint {
    font-size: 12px;
    color: var(--loyalty-text-secondary);
    margin-top: 8px;
}

/* ======================== Dropzone (Multi-file Installation Images) ======================== */
.loyalty-dropzone {
    border: 2px dashed #d9d9d9;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s, background-color 0.3s;
    min-height: 140px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
    align-content: flex-start;
}

/* Dropzone has-files: same solid border treatment as upload-area.has-preview */
.loyalty-dropzone--has-files {
    border-style: solid;
    border-color: #d9d9d9;
}

.loyalty-dropzone:hover,
.loyalty-dropzone.dz-drag-hover {
    border-color: var(--loyalty-primary);
    background: rgba(24, 144, 255, 0.04);
}

.loyalty-dropzone.dz-started .dz-message {
    display: none;
}

.loyalty-dropzone .dz-message {
    width: 100%;
    align-self: center;
}

.loyalty-dropzone--has-files .dz-message {
    display: none;
}

.loyalty-dropzone-message {
    color: var(--loyalty-text-secondary);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.loyalty-dropzone-hint {
    font-size: 12px;
    color: var(--loyalty-text-secondary);
    opacity: 0.7;
}

/* Dropzone preview items */
.loyalty-dropzone .dz-preview {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    width: 100px;
    padding: 6px;
    background: #fafafa;
    border-radius: 6px;
    border: 1px solid #f0f0f0;
}

.loyalty-dropzone .dz-preview .dz-image {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loyalty-dropzone .dz-preview .dz-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.loyalty-dropzone .dz-preview .dz-details {
    padding: 4px 0;
    font-size: 11px;
    text-align: center;
    max-width: 90px;
}

.loyalty-dropzone .dz-preview .dz-filename {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--loyalty-text);
}

.loyalty-dropzone .dz-preview .dz-size {
    color: var(--loyalty-text-secondary);
    font-size: 10px;
}

.loyalty-dropzone .dz-preview .dz-progress {
    display: block;
    height: 4px;
    background: #e8e8e8;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}

.loyalty-dropzone .dz-preview .dz-progress .dz-upload {
    display: block;
    height: 100%;
    background: var(--loyalty-primary);
    width: 0;
    transition: width 0.2s ease;
}

.loyalty-dropzone .dz-preview .dz-error-message {
    display: none;
    font-size: 10px;
    color: var(--loyalty-danger);
}

.loyalty-dropzone .dz-preview.dz-error .dz-error-message {
    display: block;
}

.loyalty-dropzone .dz-preview .dz-error-mark,
.loyalty-dropzone .dz-preview .dz-success-mark {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    text-align: center;
    line-height: 28px;
    font-size: 14px;
    z-index: 1;
    pointer-events: none;
}

.loyalty-dropzone .dz-preview.dz-success .dz-success-mark {
    display: block;
    background: rgba(82, 196, 26, 0.85);
    color: #fff;
}

.loyalty-dropzone .dz-preview.dz-error .dz-error-mark {
    display: block;
    background: rgba(255, 77, 79, 0.85);
    color: #fff;
}

.loyalty-dropzone .dz-preview .dz-remove,
.loyalty-dropzone .dz-preview .loyalty-upload-preview-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--loyalty-danger);
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    z-index: 2;
    transition: transform 0.15s;
    border: none;
    cursor: pointer;
    padding: 0;
}

.loyalty-dropzone .dz-preview .dz-remove:hover,
.loyalty-dropzone .dz-preview .loyalty-upload-preview-remove:hover {
    transform: scale(1.15);
}

/* Responsive: larger preview thumbnails on wider screens */
@media (min-width: 480px) {
    .loyalty-dropzone .dz-preview,
    .loyalty-upload-area.has-preview .loyalty-upload-preview {
        width: 120px;
    }
    .loyalty-dropzone .dz-preview .dz-image,
    .loyalty-upload-area.has-preview .loyalty-upload-preview img {
        width: 100px;
        height: 100px;
    }
}

/* ======================== Spinner / Loading ======================== */
.loyalty-spinner-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px;
}

.loyalty-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--loyalty-border);
    border-top-color: var(--loyalty-primary);
    border-radius: 50%;
    animation: loyalty-spin 0.8s linear infinite;
}

.loyalty-spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

@keyframes loyalty-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ======================== Grid Layout ======================== */
.loyalty-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 1rem 0;
    margin-bottom: 20px;
}

.loyalty-col {
    flex: 1;
    min-width: 0;
}

.loyalty-col-4 {
    flex: 0 0 calc(33.333% - 11px);
    min-width: 200px;
}

.loyalty-col-6 {
    flex: 0 0 calc(50% - 8px);
    min-width: 280px;
}

.loyalty-col-8 {
    flex: 0 0 calc(66.666% - 6px);
    min-width: 300px;
}

/* ======================== Auth Pages (Login/Register/Forgot Password) ======================== */
.loyalty-auth-page {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 48px 40px;
    min-height: 100vh;
    background-color: #00020F;
    background-image: url('../assets/images/login-register-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

/* Dark overlay on the full-page background */
.loyalty-auth-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #00020F;
    opacity: 0.55;
    z-index: 0;
    pointer-events: none;
}

.loyalty-auth-split {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(360px, 460px);
    align-items: center;
    gap: 48px 64px;
    width: 100%;
    max-width: 1180px;
    min-height: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.loyalty-auth-visual {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 0;
    padding: 24px 12px 24px 24px;
    background: none;
    color: #fff;
    overflow: visible;
}

.loyalty-auth-split-login .loyalty-auth-visual,
.loyalty-auth-split-register .loyalty-auth-visual,
.loyalty-auth-split-forgot .loyalty-auth-visual {
    background-image: none;
}

.loyalty-auth-visual::before,
.loyalty-auth-visual::after {
    display: none;
}

.loyalty-auth-visual-content {
    position: relative;
    z-index: 2;
    max-width: 480px;
}

.loyalty-auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 112px;
    min-height: 42px;
    margin-bottom: 96px;
    padding: 8px 18px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
    backdrop-filter: blur(8px);
}

.loyalty-auth-logo-image {
    display: block;
    width: auto;
    max-width: 180px;
    max-height: 64px;
    margin-bottom: 96px;
    object-fit: contain;
}

.loyalty-auth-visual-title {
    margin: 0 0 18px;
    color: #fff;
    font-size: 48px;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.02em;
}

.loyalty-auth-visual-subtitle {
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 17px;
    line-height: 1.7;
    max-width: 420px;
}

.loyalty-auth-logo,
.loyalty-auth-logo-image {
    margin-bottom: 96px;
}

.loyalty-auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
}

.loyalty-auth-card {
    background: rgba(236, 242, 252, 0.96);
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(0, 2, 15, 0.35);
    padding: 40px 36px;
    width: 100%;
    backdrop-filter: blur(10px);
}

.loyalty-auth-split .loyalty-auth-card {
    max-width: 100%;
    padding: 40px 36px;
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(0, 2, 15, 0.35);
}

.loyalty-auth-card.loyalty-auth-sm {
    max-width: 420px;
}

.loyalty-auth-card.loyalty-auth-md {
    max-width: 460px;
}

.loyalty-auth-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin: 0 0 24px 0;
    color: #0b2a5b;
}

.loyalty-auth-help-text {
    font-size: 13px;
    color: #5b6b86;
    line-height: 1.55;
    margin: 0 0 20px;
}

.loyalty-auth-title-left {
    text-align: left;
    margin-bottom: 10px;
}

.loyalty-register-card .loyalty-auth-help-text {
    margin-bottom: 22px;
    color: #5b6b86;
    font-size: 13px;
    line-height: 1.5;
}

.loyalty-register-card .loyalty-form-group {
    margin-bottom: 14px;
}

.loyalty-register-card .loyalty-form-label {
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #0b2a5b;
}

.loyalty-register-card .loyalty-input {
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #c9d6ea;
    background: #fff;
}

.loyalty-register-card .loyalty-input:focus {
    border-color: #254487;
    box-shadow: 0 0 0 3px rgba(37, 68, 135, 0.12);
}

.loyalty-register-card .loyalty-textarea {
    min-height: 56px;
}

/* Forename + Surname side by side */
.loyalty-register-card #loyalty-register-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 16px;
}

.loyalty-register-card #loyalty-register-form .loyalty-form-group:nth-child(n+3),
.loyalty-register-card #loyalty-register-form .loyalty-register-submit-wrap {
    grid-column: 1 / -1;
}

.loyalty-register-submit-wrap {
    margin-top: 10px;
}

.loyalty-register-card #loyalty-register-submit {
    max-width: none;
    width: 100%;
    min-height: 46px;
    margin: 0;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    background: #0b2a5b;
    border-color: #0b2a5b;
}

.loyalty-register-card #loyalty-register-submit:hover {
    background: #163a73;
    border-color: #163a73;
}

.loyalty-auth-card.loyalty-auth-sm .loyalty-form-label {
    font-size: 14px;
    font-weight: 600;
    color: #0b2a5b;
}

.loyalty-auth-card.loyalty-auth-sm .loyalty-input {
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #c9d6ea;
    background: #fff;
}

.loyalty-auth-card.loyalty-auth-sm .loyalty-btn-primary {
    min-height: 46px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    background: #0b2a5b;
    border-color: #0b2a5b;
}

.loyalty-auth-card.loyalty-auth-sm .loyalty-btn-primary:hover {
    background: #163a73;
    border-color: #163a73;
}

.loyalty-register-footer {
    margin-top: 16px;
}

.loyalty-auth-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: #5b6b86;
}

.loyalty-auth-footer a {
    color: #0b2a5b;
    font-weight: 600;
    text-decoration: none;
}

.loyalty-auth-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 900px) {
    .loyalty-auth-page {
        align-items: flex-start;
        padding: 28px 16px;
        min-height: 100svh;
        min-height: 100dvh;
    }

    .loyalty-auth-split {
        grid-template-columns: 1fr;
        max-width: 520px;
        gap: 24px;
        width: 100%;
    }

    .loyalty-auth-visual {
        min-height: 0;
        padding: 8px 4px 0;
        justify-content: center;
        text-align: center;
    }

    .loyalty-auth-visual-content {
        max-width: 100%;
        margin: 0 auto;
    }

    .loyalty-auth-logo,
    .loyalty-auth-logo-image {
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 20px;
    }

    .loyalty-auth-visual-title {
        font-size: clamp(28px, 7vw, 34px);
    }

    .loyalty-auth-visual-subtitle {
        margin-left: auto;
        margin-right: auto;
        font-size: 15px;
    }

    .loyalty-auth-panel {
        padding: 0;
        width: 100%;
    }

    .loyalty-auth-split .loyalty-auth-card {
        padding: 28px 22px;
        width: 100%;
    }

    .loyalty-auth-card.loyalty-auth-sm .loyalty-input,
    .loyalty-register-card .loyalty-input {
        font-size: 16px; /* prevent iOS zoom */
        min-height: 48px;
    }

    .loyalty-auth-card.loyalty-auth-sm .loyalty-btn-primary,
    .loyalty-register-card #loyalty-register-submit {
        min-height: 48px;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .loyalty-auth-page {
        padding: 20px 12px max(20px, env(safe-area-inset-bottom));
    }

    .loyalty-auth-visual {
        padding: 0;
    }

    .loyalty-auth-logo {
        min-width: 96px;
        min-height: 36px;
        margin-bottom: 16px;
        font-size: 15px;
    }

    .loyalty-auth-logo-image {
        max-width: 130px;
        margin-bottom: 16px;
    }

    .loyalty-auth-visual-title {
        font-size: 26px;
        margin-bottom: 12px;
    }

    .loyalty-auth-visual-subtitle {
        font-size: 14px;
        line-height: 1.55;
    }

    .loyalty-auth-split .loyalty-auth-card {
        padding: 24px 16px;
        border-radius: 16px;
    }

    .loyalty-auth-title {
        font-size: 22px;
        margin-bottom: 18px;
    }

    .loyalty-register-card #loyalty-register-form {
        grid-template-columns: 1fr;
        column-gap: 0;
    }
}

/* ======================== Divider ======================== */
.loyalty-divider {
    height: 1px;
    background: var(--loyalty-border);
    margin: 20px 0;
    border: none;
}

/* ======================== Image Thumbnail ======================== */
.loyalty-img-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.loyalty-img-placeholder {
    width: 60px;
    height: 60px;
    background: #f5f5f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #d9d9d9;
}

/* ======================== Redeem Modal Table ======================== */
.loyalty-redeem-points-display {
    margin-bottom: 16px;
    font-size: 14px;
}

.loyalty-redeem-points-display .loyalty-points-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--loyalty-primary);
}

/* ======================== Popconfirm ======================== */
.loyalty-popconfirm-trigger {
    cursor: pointer;
}

.loyalty-popconfirm-overlay {
    position: fixed;
    background: var(--loyalty-card-bg);
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    padding: 16px;
    z-index: 1100;
    min-width: 220px;
    display: none;
}

.loyalty-popconfirm-overlay.open {
    display: block;
}

.loyalty-popconfirm-text {
    font-size: 14px;
    margin-bottom: 12px;
}

.loyalty-popconfirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ======================== Empty State ======================== */
.loyalty-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--loyalty-text-secondary);
}

.loyalty-empty-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.loyalty-empty-text {
    font-size: 14px;
}

/* ======================== Back Link ======================== */
.loyalty-back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--loyalty-text-secondary);
    text-decoration: none;
    font-size: 14px;
}

.loyalty-back-link:hover {
    color: var(--loyalty-primary);
}

/* ======================== Toast Notifications ======================== */
.loyalty-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 2000;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--loyalty-font);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    max-width: 400px;
}

@media (max-width: 480px) {
    .loyalty-toast {
        left: 16px;
        right: 16px;
        max-width: none;
    }
}

.loyalty-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.loyalty-toast-success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: var(--loyalty-success);
}

.loyalty-toast-error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: var(--loyalty-danger);
}

.loyalty-toast-info {
    background: #e6f7ff;
    border: 1px solid #91d5ff;
    color: var(--loyalty-primary);
}

/* ======================== Responsive ======================== */
@media (max-width: 768px) {
    .loyalty-page {
        overflow-x: hidden;
    }

    .loyalty-container {
        padding: 16px;
        max-width: 100%;
    }

    .loyalty-container-sm {
        padding: 16px;
    }

    .loyalty-col-4,
    .loyalty-col-6,
    .loyalty-col-8 {
        flex: 0 0 100%;
        min-width: 0;
    }

    .loyalty-banner {
        flex-direction: column;
        text-align: center;
        padding: 2.5rem 1.25rem;
        gap: 16px;
    }

    .loyalty-banner-title {
        font-size: 18px;
    }

    .loyalty-banner-icon {
        width: 56px;
        height: 56px;
        font-size: 24px;
    }

    .loyalty-modal {
        width: calc(100% - 24px);
        max-width: none;
        margin: 12px;
        max-height: 90vh;
    }

    .loyalty-modal-header,
    .loyalty-modal-body,
    .loyalty-modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .loyalty-modal-footer {
        flex-wrap: wrap;
    }

    .loyalty-modal-footer .loyalty-btn {
        flex: 1 1 auto;
        min-height: 44px;
    }

    .loyalty-tab {
        padding: 10px 14px;
        font-size: 13px;
        white-space: nowrap;
    }

    .loyalty-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .loyalty-tabs::-webkit-scrollbar {
        display: none;
    }

    .loyalty-table thead th,
    .loyalty-table tbody td {
        padding: 8px 10px;
        font-size: 13px;
    }

    .loyalty-form-group-row {
        flex-direction: column;
        gap: 0;
    }

    .loyalty-btn.cnsure,
    .loyalty-btn.cancel {
        padding: 0.75rem 1.5rem;
        width: 100%;
    }

    .loyalty-points-card {
        padding: 18px;
    }

    .loyalty-points-card .loyalty-points-value,
    .loyalty-points-card .loyalty-points-icon {
        font-size: 28px;
    }

    .loyalty-points-card .loyalty-points-btns {
        flex-direction: column;
        align-items: stretch;
        padding-bottom: 0.5rem;
    }

    .loyalty-points-card .loyalty-points-btns a {
        text-align: center;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .loyalty-row {
        gap: 12px;
        padding: 0.5rem 0;
    }

    /* Stack tables as cards on phones — no horizontal squeeze */
    .loyalty-table-wrapper {
        overflow: visible;
        margin: 0 -4px;
    }

    .loyalty-table,
    .loyalty-pc-table,
    .loyalty-record-table {
        border: 0;
        table-layout: auto;
    }

    .loyalty-table thead,
    .loyalty-pc-table thead,
    .loyalty-record-table thead {
        display: none;
    }

    .loyalty-table tbody,
    .loyalty-pc-table tbody,
    .loyalty-record-table tbody {
        display: block;
    }

    .loyalty-table tbody tr,
    .loyalty-pc-table tbody tr,
    .loyalty-record-table tbody tr {
        display: block;
        background: #fff;
        border: 1px solid #e8eef6;
        border-radius: 12px;
        margin-bottom: 12px;
        padding: 4px 0;
        box-shadow: 0 1px 4px rgba(37, 68, 135, 0.05);
    }

    .loyalty-table tbody tr:hover,
    .loyalty-pc-table tbody tr:hover,
    .loyalty-record-table tbody tr:hover {
        background: #fff;
    }

    .loyalty-table tbody tr.loyalty-table-empty,
    .loyalty-pc-table tbody tr.loyalty-table-empty,
    .loyalty-record-table tbody tr.loyalty-table-empty {
        border: none;
        box-shadow: none;
        background: transparent;
        padding: 24px 12px;
    }

    .loyalty-table tbody tr.loyalty-table-empty td,
    .loyalty-pc-table tbody tr.loyalty-table-empty td,
    .loyalty-record-table tbody tr.loyalty-table-empty td {
        display: block;
        border: none;
        padding: 16px;
        text-align: center;
    }

    .loyalty-table tbody td,
    .loyalty-pc-table tbody td,
    .loyalty-record-table tbody td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
        padding: 10px 14px;
        border: none;
        border-bottom: 1px solid #f0f4f9;
        font-size: 14px;
        line-height: 1.45;
        word-break: break-word;
        text-align: right;
    }

    .loyalty-table tbody td:last-child,
    .loyalty-pc-table tbody td:last-child,
    .loyalty-record-table tbody td:last-child {
        border-bottom: none;
    }

    .loyalty-table tbody td::before,
    .loyalty-pc-table tbody td::before,
    .loyalty-record-table tbody td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        max-width: 42%;
        font-size: 12px;
        font-weight: 600;
        color: #8a97ad;
        text-align: left;
        text-transform: uppercase;
        letter-spacing: 0.02em;
    }

    .loyalty-pagination,
    .loyalty-rd-pagination,
    .loyalty-record-pagination {
        flex-wrap: wrap;
        gap: 6px;
        padding: 12px 0;
    }

    .loyalty-pagination button,
    .loyalty-rd-pagination button,
    .loyalty-record-pagination.loyalty-pagination button {
        min-width: 40px;
        min-height: 40px;
        height: 40px;
    }

    .loyalty-product-meta {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .loyalty-product-exchange {
        width: 100%;
        min-height: 40px;
    }

    .loyalty-product-name {
        min-height: 0;
    }

    .loyalty-input,
    .loyalty-btn,
    .loyalty-pc-outline-btn,
    .loyalty-rd-upload-btn {
        min-height: 44px;
    }

    .loyalty-input {
        font-size: 16px; /* prevent iOS zoom on focus */
    }
}

@media (max-width: 480px) {
    .loyalty-auth-card {
        padding: 24px 16px;
    }

    .loyalty-topbar {
        padding: 0 12px;
        height: 48px;
    }

    .loyalty-topbar-title {
        font-size: 14px;
    }

    .loyalty-points-value {
        font-size: 28px;
    }

    .loyalty-banner {
        padding: 20px 16px;
    }

    .loyalty-toast {
        top: 12px;
    }
}

/* ======================== Record Detail Pages ======================== */
body:has(.loyalty-record-page) .entry-header,
body:has(.loyalty-record-page) .entry-title {
    display: none;
    margin: 0;
    padding: 0;
}

body:has(.loyalty-record-page) .entry-content,
body:has(.loyalty-record-page) .ast-container,
body:has(.loyalty-record-page) .site-content {
    margin-top: 0;
    padding-top: 0;
}


.loyalty-record-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 18px 0 40px;
}

.loyalty-record-card {
    background: #fff;
    border-radius: 18px;
    padding: 28px 0 32px;
    box-shadow: 0 2px 12px rgba(37, 68, 135, 0.04);
}

.loyalty-record-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 36px;
    flex-wrap: wrap;
}

.loyalty-record-heading-main {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.loyalty-record-heading-accent {
    width: 5px;
    height: 42px;
    border-radius: 999px;
    background: #254487;
    flex-shrink: 0;
}

.loyalty-record-heading h2 {
    margin: 0;
    font-size: 25px;
    font-weight: 700;
    color: #172C57;
    line-height: 1.2;
}

.loyalty-record-heading .loyalty-record-side-link.loyalty-pc-outline-btn,
.loyalty-record-heading a.loyalty-record-side-link.loyalty-pc-outline-btn,
.loyalty-record-heading a.loyalty-record-side-link.loyalty-pc-outline-btn:hover,
.loyalty-record-heading a.loyalty-record-side-link.loyalty-pc-outline-btn:focus,
.loyalty-record-heading a.loyalty-record-side-link.loyalty-pc-outline-btn:active,
.loyalty-record-heading a.loyalty-record-side-link.loyalty-pc-outline-btn:visited {
    min-width: 0;
    height: auto;
    box-shadow: none;
    flex-shrink: 0;
    text-decoration: none !important;
}

.loyalty-record-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    border: none;

}

.loyalty-record-table tr {
    border-bottom: 2px solid #E8F0F7;
}

.loyalty-record-table thead th {
    background: transparent;
    color: #172C57;
    font-size: 15px;
    font-weight: 500;
    padding: 0 0 16px;
    border: none;
    text-align: left;
}

.loyalty-record-table tbody td {
    padding: 28px 0;
    border: none;
    border-bottom: 2px solid #E8F0F7;
    color: #172C57;
    font-size: 18px;
    line-height: 1.35;
}

.loyalty-record-table tbody tr:hover {
    background: transparent;
}

.loyalty-record-table tbody tr:last-child td {
    border-bottom: none;
}

.loyalty-record-table .loyalty-table-empty td,
.loyalty-record-table tbody tr.loyalty-table-empty td {
    text-align: center;
    padding: 44px 16px;
    color: #8a97ad;
    font-size: 16px;
}

.loyalty-record-table .loyalty-record-points,
.loyalty-record-table .loyalty-pc-points-cell,
.loyalty-record-table .loyalty-pc-points-plus,
.loyalty-record-table .loyalty-pc-points-minus {
    color: #172C57;
    font-weight: 400;
}

.loyalty-record-table .loyalty-record-points.positive,
.loyalty-record-table .loyalty-record-points.negative,
.loyalty-record-table .loyalty-record-points.empty {
    color: #172C57;
}

.loyalty-record-table .loyalty-pc-status {
    font-size: 18px;
    font-weight: 500;
}

.loyalty-record-footer-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 34px;
    margin-top: 40px;
}

.loyalty-record-pagination.loyalty-pagination {
    padding: 0;
    gap: 12px;
    min-width: 360px;
    justify-content: center;
}

.loyalty-record-pagination.loyalty-pagination button {
    min-width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: #f5f5f5;
    color: #1a2b4a;
    font-size: 16px;
    font-weight: 400;
    box-shadow: none;
}

.loyalty-record-pagination.loyalty-pagination button.active {
    background: #172C57;
    color: #fff;
}

.loyalty-record-pagination.loyalty-pagination .loyalty-pagination-info {
    display: none;
}

@media (max-width: 900px) {
    .loyalty-record-page {
        padding: 12px 12px 32px;
        max-width: 100%;
    }

    .loyalty-record-card {
        padding: 18px 14px 20px;
        border-radius: 16px;
    }

    .loyalty-record-heading {
        margin-bottom: 18px;
        gap: 12px;
        flex-direction: column;
        align-items: stretch;
    }

    .loyalty-record-heading-main {
        gap: 12px;
    }

    .loyalty-record-heading-accent {
        height: 28px;
        width: 4px;
    }

    .loyalty-record-heading h2 {
        font-size: 20px;
    }

    .loyalty-record-heading .loyalty-record-side-link.loyalty-pc-outline-btn,
    .loyalty-record-heading a.loyalty-record-side-link.loyalty-pc-outline-btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
        white-space: normal;
        text-align: center;
    }

    .loyalty-record-table thead th {
        font-size: 13px;
        padding-bottom: 12px;
    }

    .loyalty-record-table tbody td {
        font-size: 14px;
    }

    .loyalty-record-footer-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        margin-top: 20px;
        padding: 0 4px;
    }

    .loyalty-record-footer-nav .loyalty-record-side-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding: 10px 16px;
        border: 1px solid #172C57;
        border-radius: 999px;
        color: #172C57;
        text-decoration: none;
        font-size: 14px;
        font-weight: 500;
        text-align: center;
    }

    .loyalty-record-pagination.loyalty-pagination {
        min-width: 0;
        width: 100%;
        order: -1;
    }

    .loyalty-record-pagination.loyalty-pagination button {
        min-width: 40px;
        height: 40px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .loyalty-record-page {
        padding: 8px 8px 28px;
    }

    .loyalty-record-card {
        padding: 14px 10px 16px;
        border-radius: 14px;
    }

    .loyalty-record-heading h2 {
        font-size: 18px;
    }
}

/* ======================== Upload Installation Page ======================== */
.loyalty-upload-shell {
    background: #f3f6fb;
    padding: 28px 0 64px;
}

.loyalty-upload-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.loyalty-upload-page form {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.loyalty-upload-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(26, 43, 74, 0.04);
}

.loyalty-upload-basic-card {
    padding: 42px 48px 46px;
}

.loyalty-upload-file-card {
    padding: 36px 40px 40px;
}

.loyalty-upload-basic-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 48px;
}

.loyalty-upload-two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 48px;
}

.loyalty-upload-model-field .loyalty-form-hint {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.4;
    color: #5b6b88;
}

.loyalty-upload-address-field {
    grid-column: 1 / -1;
}

.loyalty-upload-page select.loyalty-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235b6b88' d='M1.4 1.4L6 6l4.6-4.6L12 2.8 6 8.8 0 2.8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 8px;
    padding-right: 36px;
    cursor: pointer;
}

.loyalty-upload-page .loyalty-form-group {
    margin: 0;
}

.loyalty-upload-page .loyalty-form-label {
    display: block;
    margin: 0 0 14px;
    font-size: 18px;
    font-weight: 600;
    color: #254487;
    line-height: 1.3;
}

.loyalty-upload-page .loyalty-required {
    color: #254487;
}

.loyalty-upload-page .loyalty-input {
    width: 100%;
    height: 48px;
    border: 1px solid #d0d7e4;
    border-radius: 6px;
    padding: 10px 14px;
    color: #1a2b4a;
    font-size: 15px;
    background: #fff;
    box-shadow: none;
}

.loyalty-upload-page .loyalty-input:focus {
    border-color: #254487;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 68, 135, 0.1);
}

.loyalty-upload-card-head {
    margin-bottom: 28px;
}

.loyalty-upload-file-hint {
    margin: 0;
    color: #9aa3b2;
    font-size: 15px;
    line-height: 1.4;
}

.loyalty-upload-page .loyalty-upload-area,
.loyalty-upload-page .loyalty-dropzone {
    min-height: 210px;
    border: 1px solid #d0d7e4;
    border-radius: 8px;
    background: #fff;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.loyalty-upload-page .loyalty-upload-area:hover,
.loyalty-upload-page .loyalty-dropzone:hover,
.loyalty-upload-page .loyalty-dropzone.dz-drag-hover {
    border-color: #254487;
    background: #fbfcff;
    box-shadow: inset 0 0 0 1px rgba(37, 68, 135, 0.08);
}

.loyalty-upload-site-card .loyalty-dropzone {
    min-height: 210px;
    width: 100%;
}

.loyalty-upload-page .loyalty-upload-placeholder,
.loyalty-upload-page .loyalty-dropzone-message {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: #9aa3b2;
    font-size: 16px;
    line-height: 1.4;
    margin: 0;
}

.loyalty-upload-page .loyalty-upload-placeholder p,
.loyalty-upload-page .loyalty-dropzone-message p {
    margin: 0;
    color: #9aa3b2;
    font-size: 16px;
}

.loyalty-upload-svg {
    width: 48px;
    height: 48px;
    color: #9aa3b2;
    display: block;
}

.loyalty-upload-page .loyalty-upload-area.has-preview,
.loyalty-upload-page .loyalty-dropzone--has-files {
    justify-content: flex-start;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
}

.loyalty-upload-area.loyalty-upload-pdf-preview .loyalty-upload-preview {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}

.loyalty-upload-area.loyalty-upload-pdf-preview .loyalty-upload-preview::before {
    content: 'PDF';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    border-radius: 8px;
    background: #eef2f8;
    color: #254487;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 8px;
}

.loyalty-upload-area.loyalty-upload-pdf-preview .loyalty-upload-preview img {
    display: none;
}

.loyalty-upload-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 8px 0 0;
}

.loyalty-upload-actions .loyalty-btn,
.loyalty-upload-actions .loyalty-btn.cnsure,
.loyalty-upload-actions .loyalty-btn.cancel {
    min-width: 140px;
    height: 44px;
    border-radius: 999px;
    padding: 0 28px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    line-height: 1;
}

.loyalty-upload-actions .loyalty-btn.cnsure {
    background: #254487;
    color: #fff;
}

.loyalty-upload-actions .loyalty-btn.cancel {
    background: #e8edf5;
    color: #7b879c;
    text-decoration: none !important;
}

.loyalty-upload-actions .loyalty-btn.cancel:hover {
    background: #dde4f0;
    color: #5a6b85;
}

@media (max-width: 960px) {
    .loyalty-upload-shell {
        padding: 16px 0 40px;
    }

    .loyalty-upload-page {
        padding: 0 12px;
        max-width: 100%;
    }

    .loyalty-upload-basic-card,
    .loyalty-upload-file-card {
        padding: 20px 16px;
        border-radius: 14px;
    }

    .loyalty-upload-basic-grid,
    .loyalty-upload-two-col {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .loyalty-upload-page form {
        gap: 16px;
    }

    .loyalty-upload-page .loyalty-form-label {
        font-size: 15px;
        margin-bottom: 8px;
    }

    .loyalty-upload-page .loyalty-input {
        height: 48px;
        font-size: 16px; /* prevent iOS zoom */
    }

    .loyalty-upload-file-hint,
    .loyalty-upload-page .loyalty-upload-placeholder,
    .loyalty-upload-page .loyalty-dropzone-message,
    .loyalty-upload-page .loyalty-upload-placeholder p,
    .loyalty-upload-page .loyalty-dropzone-message p {
        font-size: 14px;
    }

    .loyalty-upload-page .loyalty-upload-area,
    .loyalty-upload-page .loyalty-dropzone,
    .loyalty-upload-site-card .loyalty-dropzone {
        min-height: 148px;
        padding: 16px;
    }

    .loyalty-upload-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 4px 0 8px;
    }

    .loyalty-upload-actions .loyalty-btn,
    .loyalty-upload-actions .loyalty-btn.cnsure,
    .loyalty-upload-actions .loyalty-btn.cancel {
        width: 100%;
        min-width: 0;
        min-height: 48px;
        height: 48px;
    }
}

@media (max-width: 480px) {
    .loyalty-upload-page {
        padding: 0 8px;
    }

    .loyalty-upload-basic-card,
    .loyalty-upload-file-card {
        padding: 16px 12px;
    }

    .loyalty-upload-svg {
        width: 40px;
        height: 40px;
    }
}

/* ======================== Mobile card table refinements ========================
 * Placed last so it wins over desktop .loyalty-record-table cell paddings.
 */
@media (max-width: 768px) {
    .loyalty-table-wrapper .loyalty-table tbody tr,
    .loyalty-table-wrapper .loyalty-pc-table tbody tr,
    .loyalty-table-wrapper .loyalty-record-table tbody tr {
        display: block;
        background: #fff;
        border: 1px solid #e8eef6;
        border-radius: 12px;
        margin-bottom: 14px;
        padding: 6px 0;
        box-shadow: 0 1px 4px rgba(37, 68, 135, 0.05);
    }

    .loyalty-table-wrapper .loyalty-table tbody td,
    .loyalty-table-wrapper .loyalty-pc-table tbody td,
    .loyalty-table-wrapper .loyalty-record-table tbody td {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        width: 100%;
        box-sizing: border-box;
        padding: 14px 16px !important;
        margin: 0;
        border: none !important;
        border-bottom: 1px solid #e8eef6 !important;
        font-size: 14px !important;
        line-height: 1.4;
        word-break: break-word;
        text-align: right;
        color: #172C57;
    }

    .loyalty-table-wrapper .loyalty-table tbody td:last-child,
    .loyalty-table-wrapper .loyalty-pc-table tbody td:last-child,
    .loyalty-table-wrapper .loyalty-record-table tbody td:last-child {
        border-bottom: none !important;
    }

    .loyalty-table-wrapper .loyalty-table tbody td::before,
    .loyalty-table-wrapper .loyalty-pc-table tbody td::before,
    .loyalty-table-wrapper .loyalty-record-table tbody td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        max-width: 40%;
        font-size: 12px;
        font-weight: 600;
        color: #8a97ad;
        text-align: left;
        text-transform: uppercase;
        letter-spacing: 0.02em;
    }

    .loyalty-table-wrapper .loyalty-table tbody tr.loyalty-table-empty td,
    .loyalty-table-wrapper .loyalty-pc-table tbody tr.loyalty-table-empty td,
    .loyalty-table-wrapper .loyalty-record-table tbody tr.loyalty-table-empty td {
        display: block !important;
        border-bottom: none !important;
        text-align: center;
        padding: 24px 16px !important;
    }

    .loyalty-table-wrapper .loyalty-table thead,
    .loyalty-table-wrapper .loyalty-pc-table thead,
    .loyalty-table-wrapper .loyalty-record-table thead {
        display: none;
    }
}
