/* ============================================================
   Vouchers por e-mail e programa de indicações
   Extensão visual dos tokens existentes do Format.AI.
   ============================================================ */

.referral-kicker {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    margin-bottom: .4rem;
    color: var(--emerald-600, #0b7a4d);
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.referral-btn-primary,
.referral-btn-secondary,
.referral-btn-danger {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .62rem .95rem;
    border-radius: 12px;
    font-weight: 750;
    line-height: 1.2;
    transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, border-color .16s ease;
}

.referral-btn-primary {
    color: #fff !important;
    background: var(--pine-800, #0e4a33) !important;
    border: 1px solid var(--pine-800, #0e4a33) !important;
    box-shadow: 0 10px 24px -14px rgba(7, 39, 27, .72);
}

.referral-btn-primary:hover {
    color: #fff !important;
    background: var(--pine-950, #07271b) !important;
    border-color: var(--pine-950, #07271b) !important;
    transform: translateY(-1px);
}

.referral-btn-secondary {
    color: var(--pine-900, #0a3826) !important;
    background: #eef8f2 !important;
    border: 1px solid #b9d9c6 !important;
}

.referral-btn-secondary:hover {
    color: var(--pine-950, #07271b) !important;
    background: #dff1e7 !important;
    border-color: #8fc8a7 !important;
}

.referral-btn-danger {
    color: #831f1b !important;
    background: #fff5f4 !important;
    border: 1px solid #e2aaa6 !important;
}

.referral-btn-danger:hover {
    color: #681511 !important;
    background: #ffe6e3 !important;
    border-color: #ce7c76 !important;
}

.referral-btn-primary:focus-visible,
.referral-btn-secondary:focus-visible,
.referral-btn-danger:focus-visible,
.referral-copy-field button:focus-visible,
.referral-status-trigger:focus-visible {
    outline: 3px solid var(--mint-300, #7df0bb);
    outline-offset: 3px;
    box-shadow: none !important;
}

.referral-btn-primary:disabled,
.referral-btn-secondary:disabled,
.referral-btn-danger:disabled,
.referral-copy-field button:disabled {
    opacity: .58;
    cursor: not-allowed;
    transform: none;
}

.ref-status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: .25rem .62rem;
    color: #44544c;
    background: #edf2ef;
    border: 1px solid rgba(68, 84, 76, .18);
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
}

.ref-status-qualified,
.ref-status-credited,
.ref-status-accounted,
.ref-status-redeemed,
.ref-status-active,
.ref-status-sent,
.ref-status-delivered {
    color: #075d3c;
    background: #d9f5e7;
    border-color: rgba(7, 93, 60, .24);
}

.ref-status-pending,
.ref-status-none,
.ref-status-not-sent,
.ref-status-queued {
    color: #075985;
    background: #e4f4fc;
    border-color: rgba(7, 89, 133, .22);
}

.ref-status-blocked,
.ref-status-failed,
.ref-status-bounced {
    color: #831f1b;
    background: #fff0ee;
    border-color: rgba(131, 31, 27, .22);
}

.ref-status-void,
.ref-status-reversed,
.ref-status-revoked,
.ref-status-expired,
.ref-status-disabled {
    color: #5f4a18;
    background: #fff7d8;
    border-color: rgba(95, 74, 24, .22);
}

.referral-inline-status {
    min-height: 1.45rem;
    color: #44544c;
    font-size: .84rem;
    font-weight: 650;
}

.referral-inline-status.is-success { color: #075d3c; }
.referral-inline-status.is-error { color: #831f1b; }
.referral-inline-status.is-info { color: #075985; }
.referral-inline-status:focus { outline: none; }

/* Convite de voucher no admin */
.voucher-invite-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1rem;
    background: #f3faf6;
    border: 1px solid #cde4d6;
    border-radius: var(--radius-md, 14px);
}

.voucher-invite-option .form-check {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    min-width: 0;
    margin: 0;
    padding-left: 0;
}

.voucher-invite-option .form-check-input {
    flex: 0 0 auto;
    width: 1.15rem;
    height: 1.15rem;
    margin: .12rem 0 0;
}

.voucher-invite-option strong,
.voucher-invite-option small {
    display: block;
}

.voucher-invite-option strong { color: var(--pine-900, #0a3826); }
.voucher-invite-option small { margin-top: .16rem; color: #52655b; font-size: .78rem; }

.voucher-individual-use-note {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-top: .42rem;
    padding: .3rem .55rem;
    color: #075d3c;
    background: #e9f8f0;
    border: 1px solid #b8ddc8;
    border-radius: 9px;
    font-size: .72rem;
    font-weight: 800;
}

.voucher-individual-use-note[hidden] { display: none !important; }

.voucher-invite-email-chip,
.voucher-invite-complete {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-height: 32px;
    padding: .3rem .62rem;
    color: #075985;
    background: #e4f4fc;
    border: 1px solid #b8ddec;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 800;
    white-space: nowrap;
}

.voucher-invite-complete {
    min-height: 44px;
    color: #075d3c;
    background: #d9f5e7;
    border-color: #abd9c0;
}

.voucher-invitation-panel {
    margin: 0 1.05rem 1rem;
    padding: .9rem 1rem;
    background: linear-gradient(135deg, #f5fbf8, #eef7fb);
    border: 1px solid #cfe3da;
    border-radius: var(--radius-md, 14px);
}

.voucher-invitation-heading {
    display: flex;
    align-items: center;
    gap: .7rem;
}

.voucher-invitation-heading > div { min-width: 0; }
.voucher-invitation-heading > div > span,
.voucher-invitation-heading > div > strong { display: block; }
.voucher-invitation-heading > div > span { color: #52655b; font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.voucher-invitation-heading > div > strong { color: var(--pine-900, #0a3826); overflow-wrap: anywhere; }
.voucher-invitation-heading .ref-status-chip { margin-left: auto; }

.voucher-invitation-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    color: var(--pine-900, #0a3826);
    background: var(--mint-300, #7df0bb);
    border-radius: 12px;
}

.voucher-invitation-timeline {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .55rem;
    margin: .8rem 0;
}

.voucher-invitation-timeline > div {
    min-width: 0;
    padding: .6rem .7rem;
    background: rgba(255, 255, 255, .78);
    border: 1px solid #dce9e2;
    border-radius: 10px;
}

.voucher-invitation-timeline dt {
    color: #52655b;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.voucher-invitation-timeline dd {
    margin: .16rem 0 0;
    color: var(--pine-900, #0a3826);
    font-size: .8rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.voucher-invitation-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .8rem;
    flex-wrap: wrap;
}

.voucher-invitation-actions .voucher-form-status { flex: 1 1 240px; }

/* Planos: convite seguro e indicação separada */
.voucher-invite-notice,
.plan-referral-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.25rem;
    padding: 1.15rem 1.25rem;
    background: #fff;
    border: 1px solid #cfe3d8;
    border-radius: var(--radius-lg, 20px);
    box-shadow: var(--shadow-soft, 0 8px 24px -8px rgba(10, 56, 38, .12));
}

.voucher-invite-notice[hidden] { display: none !important; }

.voucher-invite-notice {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.voucher-invite-notice.is-loading { background: #f4faf7; }
.voucher-invite-notice.is-success { background: #effaf4; border-color: #9cd0b3; }
.voucher-invite-notice.is-error { background: #fff5f4; border-color: #e2aaa6; }
.voucher-invite-notice.is-info { background: #f1f8fc; border-color: #b8ddec; }

.voucher-invite-notice-icon,
.plan-referral-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    color: var(--pine-950, #07271b);
    background: var(--mint-300, #7df0bb);
    border-radius: 16px;
    font-size: 1.25rem;
}

.voucher-invite-notice h2,
.plan-referral-card h2 {
    margin: 0 0 .25rem;
    color: var(--pine-900, #0a3826);
    font-family: 'Newsreader', serif;
    font-size: clamp(1.25rem, 2.2vw, 1.65rem);
    font-weight: 700;
}

.voucher-invite-notice p,
.plan-referral-card p {
    margin: 0;
    color: #44544c;
    font-size: .9rem;
    line-height: 1.58;
}

.plan-referral-card {
    grid-template-columns: minmax(280px, .92fr) minmax(360px, 1.08fr);
    background:
        radial-gradient(420px 150px at 0 0, rgba(125, 240, 187, .13), transparent 70%),
        #fff;
}

.plan-referral-card.has-pending-code { border-color: #9cd0b3; }
.plan-referral-card.is-paused { grid-template-columns: 1fr; background: #fffaf0; border-color: #e4cf92; }

.plan-referral-copy {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
}

.plan-referral-copy > div { min-width: 0; }

.plan-referral-form {
    padding: .9rem;
    background: #f7fbf9;
    border: 1px solid #dce9e2;
    border-radius: var(--radius-md, 14px);
}

.plan-referral-form .form-label { color: var(--pine-900, #0a3826); font-weight: 750; }
.plan-referral-form .form-control { min-height: 44px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-weight: 750; text-transform: uppercase; }
.plan-referral-form .referral-inline-status { margin-top: .35rem; }

.referral-linked-summary {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 36px;
    margin-top: .7rem;
    padding: .38rem .7rem;
    color: #075d3c;
    background: #d9f5e7;
    border: 1px solid #abd9c0;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 800;
}

/* Cadastro */
.register-context-card {
    display: flex;
    align-items: flex-start;
    gap: .8rem;
    padding: .95rem;
    background: #f4faf7;
    border: 1px solid #cde4d6;
    border-radius: var(--radius-md, 14px);
}

.register-context-voucher { background: #f1f8fc; border-color: #b8ddec; }
.register-context-referral { background: #effaf4; border-color: #abd9c0; }

.register-context-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    color: var(--pine-950, #07271b);
    background: var(--mint-300, #7df0bb);
    border-radius: 12px;
}

.register-context-card h3 {
    margin: 0 0 .25rem;
    color: var(--pine-900, #0a3826);
    font-size: 1rem;
    font-weight: 800;
}

.register-context-card p {
    margin: 0;
    color: #44544c;
    font-size: .82rem;
    line-height: 1.52;
}

.register-context-meta {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-top: .5rem;
    color: var(--pine-900, #0a3826);
    font-size: .76rem;
    font-weight: 750;
    overflow-wrap: anywhere;
}

/* Dashboard */
.dashboard-referral-card {
    display: grid;
    grid-template-columns: minmax(270px, 1.08fr) minmax(220px, .72fr) minmax(330px, 1fr);
    gap: 1rem;
    padding: 1.1rem;
    background:
        radial-gradient(460px 180px at 4% 0, rgba(125, 240, 187, .15), transparent 72%),
        #fff;
    border: 1px solid #cfe3d8;
    border-radius: var(--radius-lg, 20px);
    box-shadow: var(--shadow-soft, 0 8px 24px -8px rgba(10, 56, 38, .12));
    scroll-margin-top: calc(var(--header-height, 72px) + 1rem);
}

.dashboard-referral-card.is-paused,
.dashboard-referral-card.is-blocked { background: #fffaf2; border-color: #e2cf9b; }

.dashboard-referral-intro,
.dashboard-referral-stats,
.dashboard-referral-share {
    min-width: 0;
}

.dashboard-referral-heading {
    display: flex;
    align-items: center;
    gap: .7rem;
}

.dashboard-referral-heading > div { min-width: 0; }

.dashboard-referral-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    color: var(--pine-950, #07271b);
    background: var(--mint-300, #7df0bb);
    border-radius: 14px;
    font-size: 1.12rem;
}

.dashboard-referral-intro h2 {
    margin: 0;
    color: var(--pine-900, #0a3826);
    font-family: 'Newsreader', serif;
    font-size: clamp(1.25rem, 2vw, 1.55rem);
    font-weight: 700;
}

.dashboard-referral-intro > .ref-status-chip { margin: .65rem 0 .45rem; }
.dashboard-referral-intro > p { margin: 0; color: #44544c; font-size: .82rem; line-height: 1.55; }

.referral-program-notice {
    display: flex;
    align-items: flex-start;
    gap: .45rem;
    margin-top: .65rem;
    padding: .58rem .65rem;
    color: #5f4a18;
    background: #fff7d8;
    border: 1px solid #e4cf92;
    border-radius: 10px;
    font-size: .76rem;
    font-weight: 700;
}

.dashboard-referral-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: stretch;
    gap: .55rem;
}

.dashboard-referral-stats > div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: .7rem;
    background: #f6faf8;
    border: 1px solid #dce9e2;
    border-radius: 12px;
    text-align: center;
}

.dashboard-referral-stats span { color: #52655b; font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.dashboard-referral-stats strong { margin-top: .18rem; color: var(--pine-900, #0a3826); font-family: 'Newsreader', serif; font-size: 1.45rem; line-height: 1; }

.dashboard-referral-share {
    padding: .8rem;
    background: #f8fbf9;
    border: 1px solid #dce9e2;
    border-radius: 14px;
}

.referral-code-share { display: grid; gap: .55rem; }
.referral-code-share label { display: block; margin-bottom: .25rem; color: var(--pine-900, #0a3826); font-size: .74rem; font-weight: 800; }

.referral-copy-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
}

.referral-copy-field input {
    min-width: 0;
    min-height: 44px;
    padding: .55rem .65rem;
    color: var(--pine-900, #0a3826);
    background: #fff;
    border: 1px solid #bddbc9;
    border-right: 0;
    border-radius: 10px 0 0 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: .74rem;
}

.referral-copy-field button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    padding: .5rem .65rem;
    color: var(--pine-900, #0a3826);
    background: #eef8f2;
    border: 1px solid #bddbc9;
    border-radius: 0 10px 10px 0;
    font-size: .72rem;
    font-weight: 800;
}

.dashboard-referral-share .form-text { margin: .55rem 0; color: #52655b; font-size: .72rem; }
.dashboard-referral-actions { display: flex; align-items: center; justify-content: flex-end; gap: .65rem; flex-wrap: wrap; }
.dashboard-referral-actions .referral-inline-status { flex: 1 1 180px; }

/* Admin de indicações */
.referral-admin-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.35rem 1.5rem;
    color: #fff;
    background:
        radial-gradient(520px 180px at 88% -20%, rgba(125, 240, 187, .22), transparent 68%),
        linear-gradient(135deg, var(--pine-950, #07271b), var(--pine-800, #0e4a33));
    border: 1px solid rgba(125, 240, 187, .2);
    border-radius: var(--radius-lg, 20px);
    box-shadow: 0 18px 42px -24px rgba(7, 39, 27, .78);
}

.referral-admin-hero .referral-kicker { color: var(--mint-300, #7df0bb); }
.referral-admin-hero h3 { margin: 0 0 .35rem; color: #fff; font-family: 'Newsreader', serif; font-size: clamp(1.55rem, 2.5vw, 2rem); font-weight: 700; }
.referral-admin-hero p { max-width: 780px; margin: 0; color: rgba(255, 255, 255, .84); }

.ref-program-state {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    flex: 0 0 auto;
    min-height: 38px;
    padding: .42rem .72rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 800;
    white-space: nowrap;
}

.ref-program-state.is-active { color: var(--pine-950, #07271b); background: var(--mint-300, #7df0bb); border: 1px solid var(--mint-300, #7df0bb); }
.ref-program-state.is-paused { color: #5f3d00; background: #ffe9a8; border: 1px solid #e0bb54; }

.referral-admin-stats {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: .7rem;
}

.referral-admin-stats article {
    min-width: 0;
    padding: .85rem .9rem;
    background: #fff;
    border: 1px solid var(--card-border, rgba(14, 74, 51, .08));
    border-radius: var(--radius-md, 14px);
    box-shadow: var(--shadow-soft, 0 8px 24px -8px rgba(10, 56, 38, .12));
}

.referral-admin-stats article.is-attention { background: #fffaf0; border-color: #e4cf92; }
.referral-admin-stats article.is-recovered { background: #f0faf5; border-color: #b8ddc8; }
.referral-admin-stats span,
.referral-admin-stats small { display: block; }
.referral-admin-stats span { color: #52655b; font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.referral-admin-stats strong { display: block; margin: .15rem 0 .08rem; color: var(--pine-900, #0a3826); font-family: 'Newsreader', serif; font-size: 1.55rem; line-height: 1; }
.referral-admin-stats small { color: #52655b; font-size: .68rem; }

.referral-admin-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr);
    gap: 1rem;
}

.referral-rule-panel .card-header,
.referral-config-panel .card-header,
.referral-admin-section .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.referral-rule-panel .card-header small,
.referral-config-panel .card-header small,
.referral-admin-section .card-header small { color: rgba(255, 255, 255, .82) !important; }

.referral-rule-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .65rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.referral-rule-steps li {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    padding: .7rem;
    background: #f6faf8;
    border: 1px solid #dce9e2;
    border-radius: 12px;
}

.referral-rule-steps li > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    color: #fff;
    background: var(--pine-800, #0e4a33);
    border-radius: 50%;
    font-size: .75rem;
    font-weight: 800;
}

.referral-rule-steps strong,
.referral-rule-steps small { display: block; }
.referral-rule-steps strong { color: var(--pine-900, #0a3826); font-size: .82rem; }
.referral-rule-steps small { margin-top: .15rem; color: #52655b; font-size: .72rem; line-height: 1.42; }

.referral-rule-exact {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    margin-top: .8rem;
    padding: .7rem .8rem;
    color: #075d3c;
    background: #e9f8f0;
    border: 1px solid #b8ddc8;
    border-radius: 11px;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.48;
}

.referral-config-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    padding: .75rem .8rem;
    background: #f4faf7;
    border: 1px solid #cde4d6;
    border-radius: 12px;
    cursor: pointer;
}

.referral-config-toggle strong,
.referral-config-toggle small { display: block; }
.referral-config-toggle strong { color: var(--pine-900, #0a3826); }
.referral-config-toggle small { margin-top: .14rem; color: #52655b; font-size: .74rem; }
.referral-config-toggle .form-check-input { width: 2.7rem; height: 1.45rem; cursor: pointer; }

.referral-config-panel .form-control,
.referral-config-panel .input-group-text,
.referral-admin-toolbar .form-control,
.referral-admin-toolbar .form-select,
.referral-admin-toolbar .input-group-text,
.referral-reason-modal .form-control { min-height: 44px; }
.referral-config-panel .form-label,
.referral-reason-modal .form-label { color: var(--pine-900, #0a3826); font-weight: 750; }

.referral-config-updated { margin: .75rem 0 0; color: #52655b; font-size: .74rem; }
.referral-form-actions { display: flex; align-items: center; justify-content: flex-end; gap: .7rem; margin-top: .85rem; flex-wrap: wrap; }
.referral-form-actions .referral-inline-status { flex: 1 1 220px; }

.referral-result-count {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: .3rem .65rem;
    color: var(--pine-900, #0a3826);
    background: var(--mint-300, #7df0bb);
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 800;
    white-space: nowrap;
}

.referral-admin-toolbar {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(190px, auto);
    gap: .7rem;
    margin-bottom: .85rem;
}

.referral-admin-table { min-width: 900px; }
.referral-admin-table th { color: #52655b; font-size: .69rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.referral-admin-table td { color: #283c32; font-size: .8rem; vertical-align: middle; }
.referral-admin-table td > strong,
.referral-admin-table td > small { display: block; }
.referral-admin-table td > small { margin-top: .12rem; color: #52655b; }
.referral-admin-table code { display: inline-block; margin-top: .2rem; padding: .22rem .38rem; color: var(--pine-900, #0a3826); background: #eef8f2; border: 1px dashed #a7cdb7; border-radius: 6px; font-size: .72rem; font-weight: 800; }
.referral-admin-table .referral-status-trigger { min-height: 40px; padding: .48rem .68rem; font-size: .75rem; }

.referral-compensation-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.referral-compensation-note {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    padding: .72rem .8rem;
    color: #34483d;
    background: #f6faf8;
    border: 1px solid #d6e7dd;
    border-radius: 11px;
    font-size: .76rem;
    line-height: 1.48;
}

.referral-compensation-note > i { flex: 0 0 auto; color: #075d3c; font-size: 1rem; }
.referral-compensation-table { min-width: 980px; }

.referral-credit-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: .28rem;
}

.referral-credit-breakdown > span {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .25rem .42rem;
    color: #34483d;
    background: #f1f5f3;
    border: 1px solid #d6e2dc;
    border-radius: 999px;
    font-size: .68rem;
    white-space: nowrap;
}

.referral-credit-breakdown > span.is-recovered,
.referral-credit-breakdown > span.is-clear { color: #075d3c; background: #e9f8f0; border-color: #b8ddc8; }
.referral-credit-breakdown > span.is-debt { color: #831f1b; background: #fff5f4; border-color: #e2aaa6; }
.referral-credit-breakdown strong { font-size: .76rem; }
.referral-compensation-reason { margin: .65rem 0 0; color: #52655b; font-size: .72rem; line-height: 1.45; }

.referral-risk-list { display: flex; flex-wrap: wrap; gap: .3rem; }
.referral-risk-list span { display: inline-flex; align-items: center; gap: .28rem; padding: .24rem .42rem; color: #6a4600; background: #fff4cf; border: 1px solid #e4cf92; border-radius: 999px; font-size: .68rem; font-weight: 750; }
.referral-clean-signal { display: inline-flex; align-items: center; gap: .25rem; color: #075d3c; font-size: .72rem; font-weight: 750; }
.referral-block-reason { display: block; margin: .35rem 0 0; color: #831f1b; font-size: .7rem; line-height: 1.4; }

.referral-mobile-list { display: none; }
.referral-mobile-card { padding: .85rem; background: #fff; border: 1px solid #dce9e2; border-radius: 14px; }
.referral-mobile-card[hidden] { display: none !important; }
.referral-mobile-card-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .65rem; }
.referral-mobile-card-head code { color: var(--pine-900, #0a3826); font-size: .74rem; font-weight: 800; overflow-wrap: anywhere; }
.referral-mobile-card dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin: 0 0 .7rem; }
.referral-mobile-card dl > div { min-width: 0; padding: .5rem; background: #f7faf8; border-radius: 9px; }
.referral-mobile-card dt { color: #52655b; font-size: .66rem; font-weight: 800; text-transform: uppercase; }
.referral-mobile-card dd { margin: .12rem 0 0; color: #283c32; font-size: .76rem; font-weight: 700; overflow-wrap: anywhere; }
.referral-mobile-card dd small { display: block; margin-top: .1rem; color: #52655b; font-weight: 500; }
.referral-mobile-card > .btn { width: 100%; margin-top: .65rem; }

.referral-empty-state,
.referral-filter-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 1.2rem;
    color: #52655b;
    text-align: center;
}
.referral-empty-state > i,
.referral-filter-empty > i { margin-bottom: .5rem; color: #8fb6a0; font-size: 2rem; }
.referral-empty-state h6,
.referral-filter-empty strong { margin: 0; color: var(--pine-900, #0a3826); }
.referral-empty-state p,
.referral-filter-empty span { margin: .25rem 0 0; font-size: .8rem; }
.referral-filter-empty[hidden] { display: none !important; }

.referral-reason-modal { border: 1px solid #d7e5dc; border-radius: var(--radius-lg, 20px); overflow: hidden; }
.referral-reason-modal .modal-header { align-items: flex-start; background: #f6faf8; }
.referral-reason-modal .modal-title { color: var(--pine-900, #0a3826); font-weight: 800; }
.referral-reason-modal textarea { resize: vertical; }

@media (max-width: 1399.98px) {
    .referral-admin-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .dashboard-referral-card { grid-template-columns: minmax(270px, 1fr) minmax(280px, 1fr); }
    .dashboard-referral-stats { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 1199.98px) {
    .referral-admin-layout { grid-template-columns: 1fr; }
    .voucher-invitation-timeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 991.98px) {
    .plan-referral-card,
    .dashboard-referral-card { grid-template-columns: 1fr; }
    .dashboard-referral-stats { grid-column: auto; grid-row: auto; }
    .referral-admin-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .referral-desktop-table { display: none; }
    .referral-mobile-list { display: grid; gap: .7rem; }
}

@media (max-width: 767.98px) {
    .voucher-invite-notice { grid-template-columns: auto minmax(0, 1fr); }
    .voucher-invite-notice > .btn { grid-column: 1 / -1; width: 100%; }
    .voucher-invitation-timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .referral-admin-hero { align-items: flex-start; flex-direction: column; }
    .referral-admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .referral-compensation-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .referral-rule-steps { grid-template-columns: 1fr; }
    .referral-admin-toolbar { grid-template-columns: 1fr; }
}

@media (max-width: 575.98px) {
    .voucher-invite-option,
    .voucher-invitation-heading,
    .voucher-invitation-actions,
    .plan-referral-copy,
    .dashboard-referral-actions { align-items: stretch; flex-direction: column; }
    .voucher-invite-email-chip,
    .voucher-invitation-heading .ref-status-chip { align-self: flex-start; margin-left: 0; }
    .voucher-invitation-panel { margin-inline: .7rem; }
    .voucher-invitation-timeline,
    .dashboard-referral-stats,
    .referral-admin-stats,
    .referral-compensation-stats,
    .referral-mobile-card dl { grid-template-columns: 1fr; }
    .plan-referral-icon { width: 46px; height: 46px; flex-basis: 46px; }
    .plan-voucher-input-row { grid-template-columns: 1fr; }
    .plan-referral-form .btn,
    .dashboard-referral-actions .btn,
    .referral-form-actions .btn,
    .voucher-invitation-actions .btn { width: 100%; }
    .referral-copy-field { grid-template-columns: 1fr; }
    .referral-copy-field input { border-right: 1px solid #bddbc9; border-radius: 10px 10px 0 0; }
    .referral-copy-field button { border-top: 0; border-radius: 0 0 10px 10px; }
    .register-context-card { padding: .8rem; }
    .referral-config-toggle { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    .referral-btn-primary,
    .referral-btn-secondary,
    .referral-btn-danger { transition: none; }
    .referral-btn-primary:hover,
    .referral-btn-secondary:hover,
    .referral-btn-danger:hover { transform: none; }
}
