/* Trang trống (shortcode) — tránh theme làm vỡ layout */
body.dwm-blank-page {
    margin: 0;
    padding: 0;
    background: #eef1f6;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #1d2327;
    overflow-x: hidden;
}

body.dwm-blank-page #wpadminbar {
    display: none !important;
}

body.dwm-blank-page .site-header,
body.dwm-blank-page .site-footer,
body.dwm-blank-page header.entry-header {
    display: none !important;
}

/* ——— Auth (đăng nhập / đăng ký) ——— */
.dwm-saas-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    box-sizing: border-box;
}

.dwm-saas-page-inner {
    width: 100%;
    max-width: 440px;
}

.dwm-saas-page-inner--wide {
    max-width: 640px;
}

.dwm-saas-page-header {
    text-align: center;
    margin-bottom: 24px;
}

.dwm-saas-logo {
    display: inline-block;
    background: linear-gradient(135deg, #1846c7 0%, #2563eb 100%);
    color: #fff;
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: 0.02em;
    padding: 12px 28px;
    border-radius: 10px;
    margin-bottom: 10px;
}

.dwm-saas-page-tagline {
    margin: 0;
    color: #5c6370;
    font-size: 0.95rem;
}

.dwm-saas-host-badge {
    display: inline-block;
    margin: 12px 0 0;
    padding: 4px 12px;
    background: #e8eeff;
    color: #1846c7;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.dwm-saas-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.1);
    padding: 28px 24px 24px;
    width: 100%;
    box-sizing: border-box;
}

.dwm-saas-card-wide {
    max-width: 100%;
}

.dwm-saas-card-title {
    margin: 0 0 8px;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

.dwm-saas-card-desc {
    margin: 0 0 20px;
    color: #64748b;
    font-size: 0.92rem;
}

.dwm-saas-card-footer {
    margin: 20px 0 0;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
}

.dwm-saas-card-footer a {
    color: #1846c7;
    font-weight: 600;
    text-decoration: none;
}

.dwm-saas-card-footer a:hover {
    text-decoration: underline;
}

.dwm-saas-form {
    margin: 0;
}

.dwm-saas-field {
    margin-bottom: 16px;
}

.dwm-saas-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.88rem;
    color: #334155;
}

.dwm-saas-field input[type="text"],
.dwm-saas-field input[type="email"],
.dwm-saas-field input[type="tel"],
.dwm-saas-field input[type="password"] {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1rem;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.dwm-saas-password-wrap {
    position: relative;
    display: block;
}

.dwm-saas-password-wrap input[type="password"],
.dwm-saas-password-wrap input[type="text"] {
    display: block;
    width: 100%;
    margin: 0;
    padding-right: 44px;
}

.dwm-saas-password-toggle {
    position: absolute;
    right: 6px;
    top: 0;
    bottom: 0;
    width: 32px;
    height: 32px;
    margin: auto 0;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    min-height: 0;
    box-sizing: border-box;
    box-shadow: none;
    transform: none;
    font: inherit;
    -webkit-appearance: none;
    appearance: none;
    transition: color 0.15s, background 0.15s;
}

.dwm-saas-password-toggle:hover,
.dwm-saas-password-toggle:focus {
    color: #1846c7;
    background: #f1f5f9;
    outline: none;
}

.dwm-saas-password-toggle .dashicons {
    display: inline-block;
    width: 20px;
    height: 20px;
    font-size: 20px;
    line-height: 1;
    font-family: dashicons;
    speak: never;
    font-style: normal;
    font-weight: 400;
    font-variant: normal;
    text-transform: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ghi đè style nút của theme trên trang đăng ký / đăng nhập */
body.dwm-blank-page .dwm-saas-form .dwm-saas-password-toggle {
    position: absolute;
    top: 0;
    bottom: 0;
    margin: auto 0;
    background: transparent;
    color: #64748b;
    border: 0;
    box-shadow: none;
}

body.dwm-blank-page .dwm-saas-form .dwm-saas-password-toggle:hover,
body.dwm-blank-page .dwm-saas-form .dwm-saas-password-toggle:focus {
    background: #f1f5f9;
    color: #1846c7;
}

.dwm-saas-field input:focus {
    border-color: #1846c7;
    outline: none;
    box-shadow: 0 0 0 3px rgba(24, 70, 199, 0.15);
}

.dwm-saas-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

.dwm-saas-field-full {
    grid-column: 1 / -1;
}

.dwm-saas-subdomain-row {
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.dwm-saas-subdomain-row input {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    margin: 0;
    border-radius: 8px 0 0 8px !important;
    border-right: 0;
}

.dwm-saas-subdomain-row input:focus {
    position: relative;
    z-index: 1;
}

.dwm-saas-subdomain-row input:focus + .dwm-saas-subdomain-suffix {
    border-color: #1846c7;
    box-shadow: 0 0 0 3px rgba(24, 70, 199, 0.15);
}

.dwm-saas-subdomain-suffix {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    padding: 11px 14px;
    box-sizing: border-box;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-left: 0;
    border-radius: 0 8px 8px 0;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: nowrap;
}

.dwm-saas-hint {
    display: block;
    margin-top: 6px;
    color: #94a3b8;
    font-size: 0.8rem;
}

.dwm-saas-hint code {
    background: #f1f5f9;
    padding: 1px 5px;
    border-radius: 4px;
}

.dwm-saas-plan-options {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
}

.dwm-saas-plan-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: #f8fafc;
    cursor: pointer;
}

.dwm-saas-plan-option input {
    margin-top: 4px;
}

.dwm-saas-plan-option__body {
    display: grid;
    gap: 4px;
}

.dwm-saas-plan-option__body strong {
    color: #0f172a;
}

.dwm-saas-plan-option__body small {
    color: #64748b;
}

.dwm-saas-plan-paid-fields {
    padding: 12px 0 0;
}

.dwm-plan-price-estimate {
    margin-top: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid #bfdbfe;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
}

.dwm-plan-price-estimate--inline {
    margin-top: 10px;
    max-width: 420px;
}

.dwm-plan-price-estimate__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.dwm-plan-price-estimate__label {
    font-size: 0.88rem;
    color: #475569;
    font-weight: 600;
}

.dwm-plan-price-estimate__amount {
    font-size: 1.25rem;
    color: #1d4ed8;
    font-weight: 800;
}

.dwm-plan-price-estimate__detail {
    margin: 0 0 4px;
    font-size: 0.82rem;
    color: #64748b;
}

.dwm-plan-price-estimate__bonus {
    margin: 0;
    font-size: 0.85rem;
    color: #047857;
    font-weight: 600;
}

.dwm-plan-price-estimate__bonus[hidden] {
    display: none;
}

.dwm-plan-panel h4 {
    margin: 18px 0 8px;
}

.dwm-plan-current {
    margin: 0 0 10px;
    font-size: 1rem;
}

.dwm-plan-limits {
    margin: 0 0 12px 18px;
    color: #475569;
}

.dwm-plan-limits li {
    margin-bottom: 4px;
}

.dwm-saas-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #1846c7;
    color: #fff !important;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.3;
}

.dwm-saas-btn:hover {
    background: #1239a8;
    color: #fff !important;
}

.dwm-saas-btn-block {
    width: 100%;
}

.dwm-saas-alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.dwm-saas-alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.dwm-saas-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.dwm-saas-alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* Legacy aliases */
.dwm-saas-auth {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.dwm-saas-error,
.dwm-saas-notice-error {
    color: #b32d2e;
}

.dwm-saas-notice {
    background: #edfaef;
    border-left: 4px solid #00a32a;
    padding: 10px 12px;
    margin-bottom: 16px;
}

.dwm-saas-lead {
    color: #555;
    margin-bottom: 20px;
}

.dwm-saas-packages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.dwm-saas-package {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.dwm-saas-bonus {
    color: #00a32a;
    font-weight: 600;
}

@media (max-width: 600px) {
    .dwm-saas-grid {
        grid-template-columns: 1fr;
    }

    .dwm-saas-subdomain-row {
        flex-direction: column;
        align-items: stretch;
    }

    .dwm-saas-subdomain-row input {
        border-radius: 8px 8px 0 0 !important;
        border-right: 1px solid #cbd5e1;
    }

    .dwm-saas-subdomain-row input:focus + .dwm-saas-subdomain-suffix {
        box-shadow: none;
    }

    .dwm-saas-subdomain-suffix {
        border: 1px solid #cbd5e1;
        border-top: 0;
        border-radius: 0 0 8px 8px;
        justify-content: center;
    }
}

/* ——— Topbar app khách thuê ——— */
.dwm-tenant-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: #0f172a;
    color: #f8fafc;
    font-size: 14px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.dwm-tenant-topbar-brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.dwm-tenant-topbar-title {
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dwm-tenant-topbar-sub {
    font-size: 0.8rem;
    color: #94a3b8;
}

.dwm-tenant-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.dwm-tenant-sub-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(34, 197, 94, 0.18);
    color: #bbf7d0;
    border: 1px solid rgba(34, 197, 94, 0.35);
    max-width: min(420px, 72vw);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dwm-tenant-sub-badge.is-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fde68a;
    border-color: rgba(245, 158, 11, 0.45);
}

.dwm-tenant-sub-badge.is-expired {
    background: rgba(239, 68, 68, 0.22);
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.45);
}

.dwm-tenant-renew-btn,
.dwm-tenant-history-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    white-space: nowrap;
}

.dwm-tenant-renew-btn {
    background: rgba(37, 99, 235, 0.25);
    color: #bfdbfe;
    border-color: rgba(59, 130, 246, 0.45);
}

.dwm-tenant-renew-btn:hover {
    background: rgba(37, 99, 235, 0.4);
    color: #fff;
}

.dwm-tenant-history-btn {
    background: rgba(148, 163, 184, 0.18);
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.35);
}

.dwm-tenant-history-btn:hover {
    background: rgba(148, 163, 184, 0.32);
    color: #fff;
}

.dwm-tenant-points-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    background: rgba(16, 185, 129, 0.22);
    color: #a7f3d0;
    border: 1px solid rgba(52, 211, 153, 0.45);
    white-space: nowrap;
}

.dwm-tenant-points-badge:hover {
    background: rgba(16, 185, 129, 0.38);
    color: #fff;
}

.dwm-referral-points-panel h3,
.dwm-referral-points-panel h4 {
    margin-top: 0;
}

.dwm-referral-points-balance {
    font-size: 1.05rem;
}

.dwm-referral-link-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.dwm-referral-rules {
    margin: 8px 0 16px 20px;
}

.dwm-referral-redeem-box {
    margin: 16px 0 20px;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.dwm-redeem-tier-select {
    min-width: 280px;
    max-width: 100%;
}

.dwm-referral-redeem-form {
    margin: 12px 0 20px;
    padding: 14px 16px;
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    background: #eef2ff;
}

.dwm-referral-redeem-form select {
    min-width: 300px;
    max-width: 100%;
}

.dwm-notice-success {
    padding: 10px 12px;
    border-radius: 8px;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.dwm-notice-error {
    padding: 10px 12px;
    border-radius: 8px;
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.dwm-referral-ledger-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
}

.dwm-referral-ledger-tab {
    border: 1px solid #cbd5e1;
    background: #fff;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
}

.dwm-referral-ledger-tab.is-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.dwm-referral-ledger-table-wrap {
    overflow-x: auto;
}

.dwm-ledger-positive td:nth-child(3) strong {
    color: #047857;
}

.dwm-ledger-negative td:nth-child(3) strong {
    color: #b91c1c;
}

.dwm-tenant-renew-wrap {
    padding: 16px;
    max-width: 900px;
    margin: 0 auto;
}

.dwm-tenant-logout-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: transparent;
    color: #f8fafc !important;
    border: 1px solid rgba(248, 250, 252, 0.35);
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.dwm-tenant-logout-btn:hover {
    background: rgba(248, 250, 252, 0.12);
    border-color: #f8fafc;
    color: #fff !important;
}

.dwm-tenant-logout-btn--inline {
    background: #1846c7;
    border-color: #1846c7;
}

/* ——— Header / footer cửa hàng ——— */
.dwm-store-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 20px;
    font-size: 14px;
    color: #0f172a;
}

.dwm-store-header__main {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.dwm-store-header__brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.dwm-store-header__name {
    font-weight: 700;
    font-size: 1.05rem;
    color: #1846c7;
}

.dwm-store-header__host {
    font-size: 0.8rem;
    color: #64748b;
}

.dwm-store-header__contact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    color: #475569;
}

.dwm-store-header__item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.dwm-store-header__item .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #64748b;
}

.dwm-store-header__item a {
    color: inherit;
    text-decoration: none;
}

.dwm-store-header__item a:hover {
    color: #1846c7;
    text-decoration: underline;
}

.dwm-store-header__item--address {
    max-width: 420px;
}

.dwm-store-header--topbar {
    background: #0f172a;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    color: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 1001;
}

.dwm-store-header--topbar .dwm-store-header__name {
    color: #f8fafc;
}

.dwm-store-header--topbar .dwm-store-header__host,
.dwm-store-header--topbar .dwm-store-header__contact,
.dwm-store-header--topbar .dwm-store-header__item .dashicons {
    color: #94a3b8;
}

.dwm-store-header--topbar .dwm-store-header__item a {
    color: #e2e8f0;
}

.dwm-store-header--topbar .dwm-store-header__item a:hover {
    color: #fff;
}

.dwm-store-header--public {
    border-radius: 12px 12px 0 0;
    border: 1px solid #e2e8f0;
    border-bottom: 0;
}

.dwm-store-header__website {
    display: inline-flex;
    padding: 6px 12px;
    border-radius: 999px;
    background: #eaf0ff;
    color: #1846c7 !important;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none !important;
}

.dwm-tenant-topbar--actions-only {
    padding: 8px 20px;
    background: #1e293b;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    position: sticky;
    top: var(--dwm-store-header-height, auto);
    z-index: 1000;
}

.dwm-tenant-topbar-brand--sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.dwm-tenant-topbar--actions-only .dwm-tenant-topbar-actions {
    width: 100%;
    justify-content: flex-end;
}

.dwm-store-footer {
    margin-top: auto;
    padding: 16px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 13px;
    color: #475569;
}

.dwm-store-footer__inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dwm-store-footer__name {
    color: #0f172a;
    font-size: 14px;
}

.dwm-store-footer__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
}

.dwm-store-footer__meta a {
    color: #1846c7;
    text-decoration: none;
}

.dwm-store-footer__meta a:hover {
    text-decoration: underline;
}

.dwm-store-footer__referral {
    border-top: 1px solid #dbeafe;
    background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 55%, #f0fdf4 100%);
    padding: 16px 20px;
}

.dwm-store-footer__referral-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 24px;
}

.dwm-store-footer__referral-text {
    flex: 1 1 240px;
    min-width: 0;
}

.dwm-store-footer__referral-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 4px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e3a8a;
}

.dwm-store-footer__referral-title .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
    color: #2563eb;
}

.dwm-store-footer__referral-desc {
    margin: 0;
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.45;
}

.dwm-store-footer__referral-actions {
    flex: 1 1 320px;
    max-width: 620px;
    display: flex;
    align-items: stretch;
    gap: 8px;
    min-width: 0;
}

.dwm-store-footer__referral-input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font-size: 0.85rem;
    line-height: 1.4;
    box-sizing: border-box;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.dwm-store-footer__referral-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.dwm-store-footer__referral-btn {
    flex: 0 0 auto;
    margin: 0;
    padding: 10px 16px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.22);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.dwm-store-footer__referral-btn:hover,
.dwm-store-footer__referral-btn:focus {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    outline: none;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
}

.dwm-store-footer__referral-btn.is-copied {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

@media (max-width: 700px) {
    .dwm-store-footer__referral-actions {
        flex-direction: column;
        max-width: none;
        width: 100%;
    }

    .dwm-store-footer__referral-btn {
        width: 100%;
        justify-content: center;
    }
}

body.dwm-blank-page .dwm-store-footer {
    margin-top: 0;
}

body.dwm-blank-page .dwm-store-footer .dashicons {
    display: inline-block;
    font-family: dashicons;
    line-height: 1;
    font-style: normal;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}

/* ——— Dashboard trên frontend (subdomain) ——— */
.dwm-tenant-app-wrap {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

body.dwm-blank-page .dwm-tenant-app-wrap {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 52px);
}

body.dwm-blank-page .dwm-tenant-app-wrap,
body.dwm-blank-page .dwm-tenant-app-wrap * {
    box-sizing: border-box;
}

body.dwm-blank-page .dwm-tenant-app-wrap .dwm-layout {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 0 !important;
    width: 100%;
    max-width: 100%;
    background: #f3f5f9;
}

body.dwm-blank-page .dwm-tenant-app-wrap .dwm-sidebar {
    flex-shrink: 0;
    width: 230px;
}

body.dwm-blank-page .dwm-tenant-app-wrap .dwm-main {
    min-width: 0;
    flex: 1;
    overflow-x: auto;
}

body.dwm-blank-page .dwm-tenant-app-wrap .dwm-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

body.dwm-blank-page .dwm-tenant-app-wrap .dwm-nav-item .dashicons {
    flex-shrink: 0;
}

body.dwm-blank-page .dwm-tenant-app-wrap .dashicons {
    display: inline-block;
    font-family: dashicons !important;
    speak: never;
    font-style: normal;
    font-weight: 400;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    width: 20px;
    height: 20px;
    font-size: 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.dwm-blank-page .dwm-tenant-app-wrap .dwm-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 14px;
}

body.dwm-blank-page .dwm-tenant-app-wrap .dwm-stat strong {
    display: block;
}

body.dwm-blank-page .dwm-tenant-app-wrap .dwm-stat span {
    display: block;
}

body.dwm-blank-page .dwm-tenant-app-wrap .dwm-list-toolbar input,
body.dwm-blank-page .dwm-tenant-app-wrap .dwm-list-toolbar select {
    width: auto;
    max-width: 220px;
}

body.dwm-blank-page .dwm-tenant-app-wrap input[type="text"],
body.dwm-blank-page .dwm-tenant-app-wrap input[type="email"],
body.dwm-blank-page .dwm-tenant-app-wrap input[type="password"],
body.dwm-blank-page .dwm-tenant-app-wrap input[type="number"],
body.dwm-blank-page .dwm-tenant-app-wrap input[type="date"],
body.dwm-blank-page .dwm-tenant-app-wrap input[type="search"],
body.dwm-blank-page .dwm-tenant-app-wrap select,
body.dwm-blank-page .dwm-tenant-app-wrap textarea {
    max-width: 100%;
}

@media (max-width: 900px) {
    body.dwm-blank-page .dwm-tenant-app-wrap .dwm-layout {
        flex-direction: column;
    }

    body.dwm-blank-page .dwm-tenant-app-wrap .dwm-sidebar {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        padding: 10px;
    }

    body.dwm-blank-page .dwm-tenant-app-wrap .dwm-brand {
        width: 100%;
    }

    body.dwm-blank-page .dwm-tenant-app-wrap .dwm-nav-item {
        width: auto;
        flex: 0 1 auto;
    }

    body.dwm-blank-page .dwm-tenant-app-wrap .dwm-stats-grid {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }
}

/* Form / modal trên frontend tenant */
body.dwm-blank-page .dwm-tenant-app-wrap .dwm-modal-form,
body.dwm-blank-page .dwm-tenant-app-wrap .dwm-form-grid,
body.dwm-blank-page .dwm-tenant-app-wrap .dwm-inline-form {
    font-size: 14px;
}

body.dwm-blank-page .dwm-tenant-app-wrap .dwm-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 12px 16px;
}

body.dwm-blank-page .dwm-tenant-app-wrap .dwm-form-grid label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

body.dwm-blank-page .dwm-tenant-app-wrap .dwm-form-grid input,
body.dwm-blank-page .dwm-tenant-app-wrap .dwm-form-grid select,
body.dwm-blank-page .dwm-tenant-app-wrap .dwm-form-grid textarea,
body.dwm-blank-page .dwm-tenant-app-wrap .dwm-modal-form input[type="text"],
body.dwm-blank-page .dwm-tenant-app-wrap .dwm-modal-form input[type="email"],
body.dwm-blank-page .dwm-tenant-app-wrap .dwm-modal-form input[type="number"],
body.dwm-blank-page .dwm-tenant-app-wrap .dwm-modal-form input[type="date"],
body.dwm-blank-page .dwm-tenant-app-wrap .dwm-modal-form input[type="password"],
body.dwm-blank-page .dwm-tenant-app-wrap .dwm-modal-form select,
body.dwm-blank-page .dwm-tenant-app-wrap .dwm-modal-form textarea {
    width: 100%;
    max-width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #ccd3de;
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
}

body.dwm-blank-page .dwm-tenant-app-wrap .dwm-modal-panel {
    width: min(980px, 96vw);
    max-height: 92vh;
    overflow: auto;
    background: #fff;
    border-radius: 14px;
    padding: 24px 24px 20px;
    position: relative;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

body.dwm-blank-page .dwm-tenant-app-wrap .dwm-modal-panel > h2 {
    margin: 0 0 16px;
    font-size: 1.25rem;
    line-height: 1.35;
    color: #0f172a;
}

body.dwm-blank-page .dwm-tenant-app-wrap .dwm-modal-panel > .dwm-close-modal:first-child {
    border: 0;
    background: #f1f5f9;
    color: #475569;
    font-size: 22px;
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: absolute;
    right: 14px;
    top: 14px;
    z-index: 2;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

body.dwm-blank-page .dwm-tenant-app-wrap .dwm-modal-panel:has(.dwm-modal-actions .dwm-close-modal) > .dwm-close-modal:first-child {
    display: none;
}

body.dwm-blank-page .dwm-tenant-app-wrap .dwm-modal-panel > .dwm-close-modal:first-child:hover,
body.dwm-blank-page .dwm-tenant-app-wrap .dwm-modal-panel > .dwm-close-modal:first-child:focus-visible {
    background: #e2e8f0;
    color: #0f172a;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

body.dwm-blank-page .dwm-tenant-app-wrap .dwm-modal-actions .dwm-close-modal {
    position: static;
    width: auto;
    height: auto;
    min-height: 38px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    background: #fff;
    color: #334155;
    border: 1px solid #cbd5e1;
}

body.dwm-blank-page .dwm-tenant-app-wrap .dwm-modal-actions .dwm-close-modal:hover,
body.dwm-blank-page .dwm-tenant-app-wrap .dwm-modal-actions .dwm-close-modal:focus-visible {
    background: #f8fafc;
    color: #0f172a;
    border-color: #94a3b8;
}

body.dwm-blank-page .dwm-tenant-app-wrap .dwm-modal-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

body.dwm-blank-page .dwm-tenant-app-wrap .dwm-phone-lookup {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

body.dwm-blank-page .dwm-tenant-app-wrap .dwm-customer-lookup-btn {
    min-width: 42px;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #1e293b;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
}

body.dwm-blank-page .dwm-tenant-app-wrap .dwm-customer-lookup-btn:hover,
body.dwm-blank-page .dwm-tenant-app-wrap .dwm-customer-lookup-btn:focus-visible {
    background: #e8eeff;
    border-color: #93c5fd;
    color: #1d4ed8;
    outline: none;
}

body.dwm-blank-page .dwm-tenant-app-wrap .dwm-lookup-status,
body.dwm-blank-page .dwm-tenant-app-wrap .dwm-scan-status {
    margin: 6px 0 0;
    font-size: 12px;
    color: #475569;
}

body.dwm-blank-page .dwm-tenant-app-wrap .button-primary {
    background: linear-gradient(135deg, #1846c7 0%, #2563eb 100%);
    border: 0;
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);
}

body.dwm-blank-page .dwm-tenant-app-wrap .button-primary:hover,
body.dwm-blank-page .dwm-tenant-app-wrap .button-primary:focus-visible {
    background: linear-gradient(135deg, #123aa8 0%, #1d4ed8 100%);
    color: #fff;
    outline: none;
}

body.dwm-blank-page .dwm-tenant-app-wrap .dwm-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

body.dwm-blank-page .dwm-tenant-app-wrap .dwm-modal.is-open {
    display: flex;
}

body.dwm-blank-page .dwm-tenant-app-wrap .button,
body.dwm-blank-page .dwm-tenant-app-wrap .button-primary {
    font-family: inherit;
    height: auto;
    line-height: 1.4;
    padding: 8px 14px;
}

@media (max-width: 700px) {
    body.dwm-blank-page .dwm-tenant-app-wrap .dwm-form-grid {
        grid-template-columns: 1fr;
    }
}

.dwm-saas-notice-info {
    padding: 16px;
    text-align: center;
}

.dwm-saas-notice-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.dwm-saas-notice-info {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.dwm-saas-back-link {
    margin: 0 0 10px;
    font-size: 0.9rem;
}

.dwm-renewal-history-wrap {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}

.dwm-renewal-history-title {
    margin: 0 0 12px;
    font-size: 1rem;
}

.dwm-renewal-history-empty {
    color: #64748b;
    margin: 0;
}

.dwm-renewal-history-scroll {
    overflow-x: auto;
}

.dwm-renewal-history-table {
    min-width: 560px;
}

.dwm-renewal-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.dwm-renewal-status.is-approved {
    background: #dcfce7;
    color: #166534;
}

.dwm-renewal-status.is-pending {
    background: #fef9c3;
    color: #854d0e;
}

.dwm-renewal-status.is-cancelled {
    background: #f1f5f9;
    color: #64748b;
}

.dwm-subscription-summary {
    margin: 0 0 12px;
    font-size: 1rem;
}

.dwm-subscription-summary--expired {
    color: #b91c1c;
}

.dwm-saas-package-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1846c7;
    margin: 8px 0 12px;
}

/* ——— SePay thanh toán gia hạn ——— */
.dwm-saas-payment-card h1 {
    margin-bottom: 8px;
}

.dwm-saas-payment-qr-block {
    text-align: center;
    margin: 0 0 20px;
    padding: 18px 16px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
}

.dwm-saas-payment-qr-guide {
    margin: 0 0 14px;
    font-size: 0.95rem;
    color: #334155;
}

.dwm-saas-payment-qr-frame {
    display: inline-flex;
    padding: 12px;
    border-radius: 12px;
    background: #fff;
    border: 2px solid #2563eb;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
}

.dwm-saas-payment-qr-img {
    display: block;
    width: min(280px, 72vw);
    height: auto;
    border-radius: 8px;
}

.dwm-saas-payment-qr-note {
    margin: 14px 0 0;
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.45;
}

.dwm-saas-payment-bank-sub {
    margin: 0 0 12px;
    font-size: 0.85rem;
    color: #64748b;
}

.dwm-saas-payment-amount {
    text-align: center;
    padding: 20px 16px;
    margin: 16px 0 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #a7f3d0;
}

.dwm-saas-payment-amount__label {
    display: block;
    font-size: 0.85rem;
    color: #047857;
    font-weight: 600;
    margin-bottom: 6px;
}

.dwm-saas-payment-amount__value {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    color: #065f46;
    letter-spacing: -0.02em;
}

.dwm-saas-payment-bank {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 18px;
}

.dwm-saas-payment-bank h3 {
    margin: 0 0 12px;
    font-size: 1rem;
}

.dwm-saas-payment-dl {
    margin: 0;
    display: grid;
    gap: 12px;
}

.dwm-saas-payment-dl dt {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin: 0 0 2px;
}

.dwm-saas-payment-dl dd {
    margin: 0;
    font-size: 0.95rem;
    color: #0f172a;
}

.dwm-saas-payment-code {
    display: inline-block;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 8px 14px;
    background: #fff;
    border: 2px dashed #2563eb;
    border-radius: 8px;
    color: #1d4ed8;
}

.dwm-saas-payment-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: #64748b;
}

.dwm-saas-payment-status {
    text-align: center;
    padding: 18px 14px;
    border-radius: 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
}

.dwm-saas-payment-status.is-paid {
    background: #ecfdf5;
    border-color: #6ee7b7;
    color: #065f46;
}

.dwm-saas-payment-status p {
    margin: 6px 0 0;
}

.dwm-saas-payment-status__sub,
.dwm-saas-payment-status__exp {
    font-size: 0.85rem;
    opacity: 0.9;
}

.dwm-saas-payment-spinner {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 3px solid #93c5fd;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: dwm-spin 0.8s linear infinite;
    margin-bottom: 8px;
}

@keyframes dwm-spin {
    to { transform: rotate(360deg); }
}

.dwm-saas-payment-success-panel {
    text-align: center;
    padding: 12px 8px 8px;
}

.dwm-saas-payment-success-card,
.dwm-saas-payment-success-panel .dwm-saas-payment-success-icon {
    text-align: center;
}

.dwm-saas-payment-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(145deg, #10b981, #059669);
    color: #fff;
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
}

.dwm-saas-payment-success-summary {
    margin: 16px auto;
    max-width: 420px;
    padding: 14px 18px;
    border-radius: 12px;
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    color: #065f46;
    font-size: 0.95rem;
}

.dwm-saas-payment-success-summary p {
    margin: 0;
}

.dwm-saas-payment-success-actions {
    margin: 20px 0 8px;
}

.dwm-saas-btn-primary {
    display: inline-block;
    min-width: 200px;
    text-align: center;
    background: linear-gradient(145deg, #2563eb, #1d4ed8);
    color: #fff !important;
    border: none;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.dwm-saas-btn-primary:hover {
    filter: brightness(1.05);
    color: #fff !important;
}

.dwm-qr-card {
    cursor: pointer;
}

.dwm-qr-card .dwm-qr-actions,
.dwm-qr-card .dwm-qr-actions a,
.dwm-qr-card .dwm-qr-select {
    cursor: default;
}

.dwm-qr-card .dwm-qr-actions a {
    cursor: pointer;
}

.dwm-qr-selected-bar .button-link {
    background: none;
    border: none;
    color: #1d4ed8;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    font-size: inherit;
}

.dwm-qr-selected-bar .button-link:hover {
    color: #1e3a8a;
}

body.dwm-blank-page .button:disabled,
body.dwm-blank-page .button[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.dwm-saas-payment-success-countdown {
    font-size: 0.85rem;
    color: #64748b;
}
