/**
 * Qubex Track Self-Service Portal — guided layout (UX doc §2–§8)
 * Prefix: portal-guided-*
 * Primary accent: #008a5e (portal brand green)
 */

:root {
    --portal-primary: #008a5e;
    --portal-primary-dark: #006b49;
    --portal-primary-hover: #007a54;
    --portal-primary-light: #e8f7f1;
    --portal-primary-muted-bg: #f0fdf7;
    --portal-primary-border: #b8e6d4;
    --portal-primary-focus: rgba(0, 138, 94, 0.12);
}

.portal-shell {
    min-height: 100vh;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 40%);
}

.portal-shell__inner {
    max-width: 920px;
    margin: 0 auto;
    padding: 1.25rem 1rem 2.5rem;
}

@media (min-width: 768px) {
    .portal-shell__inner {
        padding: 2rem 1.5rem 3rem;
    }
}

.portal-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.portal-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
}

.portal-brand i {
    color: var(--portal-primary);
    font-size: 1.35rem;
}

.portal-topnav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
}

.portal-topnav a,
.portal-topnav button.portal-link-btn {
    font-size: 13px;
    color: #64748b;
    text-decoration: none;
    background: none;
    border: 0;
    padding: 0;
}

.portal-topnav a:hover,
.portal-topnav a.is-active,
.portal-topnav button.portal-link-btn:hover {
    color: var(--portal-primary);
}

.portal-topnav a.is-active {
    font-weight: 600;
}

.portal-guided-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 992px) {
    .portal-guided-header:has(.portal-guided-steps) {
        grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.4fr);
        align-items: stretch;
    }
}

.portal-guided-hero {
    background: linear-gradient(135deg, var(--portal-primary-muted-bg) 0%, #fff 100%);
    border: 1px solid var(--portal-primary-border);
    border-radius: 14px;
    padding: 1.15rem 1.35rem;
}

.portal-guided-hero--auth {
    max-width: 520px;
    margin: 0 auto 1.25rem;
}

.portal-guided-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 13px;
    color: #64748b;
    text-decoration: none;
    margin-bottom: 0.5rem;
}

.portal-guided-back:hover {
    color: var(--portal-primary);
}

.portal-guided-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.25rem;
    line-height: 1.2;
}

@media (max-width: 767.98px) {
    .portal-guided-title {
        font-size: 1.2rem;
    }
}

.portal-guided-subtitle {
    font-size: 14px;
    color: #475569;
    margin: 0;
}

.portal-guided-steps {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.portal-guided-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    text-align: center;
    opacity: 0.55;
    min-width: 0;
}

.portal-guided-step.is-active,
.portal-guided-step.is-done {
    opacity: 1;
}

.portal-guided-step-num {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    background: #e2e8f0;
    color: #475569;
}

.portal-guided-step.is-active .portal-guided-step-num {
    background: var(--portal-primary);
    color: #fff;
}

.portal-guided-step.is-done .portal-guided-step-num {
    background: #198754;
    color: #fff;
}

.portal-guided-step-text {
    font-size: 11px;
    font-weight: 600;
    color: #334155;
    line-height: 1.25;
}

@media (max-width: 767.98px) {
    .portal-guided-step-text {
        font-size: 9px;
    }
}

.portal-guided-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.portal-guided-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.portal-guided-card-header {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.portal-guided-card-badge {
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--portal-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.portal-guided-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 0.15rem;
}

.portal-guided-card-hint {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.portal-guided-card-body {
    padding: 1.25rem;
}

.portal-guided-footer {
    position: sticky;
    bottom: 0.75rem;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.08);
}

@media (max-width: 575.98px) {
    .portal-guided-footer .btn {
        flex: 1 1 100%;
        min-height: 42px;
    }
}

.portal-flash {
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 14px;
}

.portal-flash--success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.portal-flash--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.portal-flash--info {
    background: var(--portal-primary-light);
    border: 1px solid var(--portal-primary-border);
    color: var(--portal-primary-dark);
}

.portal-flash--warning {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #c2410c;
}

.portal-auth-card {
    max-width: 520px;
    margin: 0 auto;
}

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

@media (min-width: 768px) {
    .portal-summary-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.portal-summary-tile {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.85rem 1rem;
}

.portal-summary-tile__label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.portal-summary-tile__value {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}

.portal-status-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.portal-status-tag--active,
.portal-status-tag--trialing {
    background: #f0fdf4;
    color: #166534;
}

.portal-status-tag--expired,
.portal-status-tag--cancelled {
    background: #fef2f2;
    color: #991b1b;
}

.portal-status-tag--pending {
    background: #fffbeb;
    color: #92400e;
}

.portal-status-tag--past_due {
    background: #fff7ed;
    color: #c2410c;
}

.portal-store-search__field {
    position: relative;
}

.portal-store-search__icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.1rem;
    pointer-events: none;
}

.portal-store-search__input {
    border-radius: 10px;
    border-color: #e2e8f0;
    padding: 0.625rem 0.85rem 0.625rem 2.5rem;
    font-size: 14px;
    min-height: 44px;
}

.portal-store-search__input:focus {
    border-color: #7dd4b0;
    box-shadow: 0 0 0 3px var(--portal-primary-focus);
}

.portal-store-card__meta code {
    font-size: 12px;
    color: #475569;
    background: #f8fafc;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

.portal-store-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.portal-store-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1rem 1.15rem;
    background: #fff;
}

.portal-store-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.portal-store-card__title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.portal-store-card__meta {
    font-size: 13px;
    color: #64748b;
}

.portal-store-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.portal-details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem 1.25rem;
}

@media (min-width: 768px) {
    .portal-details-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.portal-details-row {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.portal-details-row__label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #64748b;
}

.portal-details-row__value {
    font-size: 14px;
    color: #334155;
}

.portal-invoice-table {
    width: 100%;
    border-collapse: collapse;
}

.portal-invoice-table th,
.portal-invoice-table td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    font-size: 14px;
}

.portal-invoice-table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    background: #f8fafc;
}

@media (max-width: 767.98px) {
    .portal-invoice-table thead {
        display: none;
    }

    .portal-invoice-table tr {
        display: block;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        margin-bottom: 0.65rem;
        padding: 0.35rem 0;
    }

    .portal-invoice-table td {
        display: flex;
        justify-content: space-between;
        gap: 0.75rem;
        border-bottom: 0;
        padding: 0.45rem 0.85rem;
    }

    .portal-invoice-table td::before {
        content: attr(data-label);
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        color: #64748b;
    }
}

.portal-checkout-amount {
    font-size: 1.45rem;
    font-weight: 700;
    color: #0f172a;
}

/* Checkout page — full width, responsive layout */
.portal-shell__inner:has(.portal-checkout-shell) {
    max-width: 100%;
    width: 100%;
}

.portal-checkout-shell {
    width: 100%;
    max-width: 100%;
}

.portal-checkout-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    width: 100%;
    align-items: start;
}

.portal-checkout-layout__intro,
.portal-checkout-layout__main {
    min-width: 0;
    width: 100%;
}

.portal-checkout-layout__intro .portal-guided-header {
    margin-bottom: 0;
}

.portal-checkout-layout__intro .portal-flash {
    margin-top: 1rem;
    margin-bottom: 0;
}

.portal-checkout-layout__main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 992px) {
    .portal-checkout-layout {
        grid-template-columns: minmax(300px, 1fr) minmax(380px, 1.35fr);
        gap: 1.25rem;
    }

    .portal-checkout-layout__intro .portal-guided-hero {
        height: 100%;
    }
}

.portal-account-pos-shell .page-breadcrumb {
    margin-bottom: 1rem;
}

.portal-checkout-card .portal-guided-card-body {
    padding: 1.25rem 1.35rem;
}

.portal-checkout-lines {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.portal-checkout-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 1rem;
}

.portal-checkout-line__label {
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    word-break: break-word;
}

.portal-checkout-line__value {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    text-align: right;
    white-space: nowrap;
}

.portal-checkout-line--meta .portal-checkout-line__label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #64748b;
}

.portal-checkout-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1rem 1.15rem;
    background: linear-gradient(135deg, var(--portal-primary-light) 0%, #fff 100%);
    border: 1px solid var(--portal-primary-border);
    border-radius: 12px;
}

.portal-checkout-total__label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.portal-checkout-gst-note {
    margin-top: 0.75rem;
}

.portal-checkout-tax {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px dashed #e2e8f0;
}

.portal-checkout-line--tax .portal-checkout-line__label,
.portal-checkout-line--tax .portal-checkout-line__value {
    font-size: 13px;
    color: #64748b;
}

.portal-checkout-footer {
    margin-top: 0;
    width: 100%;
}

@media (max-width: 991.98px) {
    .portal-checkout-layout__intro .portal-flash:last-child {
        margin-bottom: 0;
    }
}

@media (max-width: 575.98px) {
    .portal-checkout-line {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }

    .portal-checkout-line__value {
        text-align: left;
        white-space: normal;
    }

    .portal-checkout-total {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .portal-checkout-footer .btn {
        flex: 1 1 100%;
        width: 100%;
    }
}

.portal-muted-note {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.portal-btn-primary {
    background: linear-gradient(135deg, var(--portal-primary) 0%, var(--portal-primary-dark) 100%);
    border: none;
    color: #fff;
    border-radius: 10px;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    min-height: 42px;
}

.portal-btn-primary:hover {
    color: #fff;
    filter: brightness(1.05);
}

.portal-btn-outline {
    border: 2px solid #e2e8f0;
    background: #fff;
    color: #334155;
    border-radius: 10px;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    min-height: 42px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.portal-btn-outline:hover {
    border-color: var(--portal-primary);
    color: var(--portal-primary);
}

/* ── Auth split layout (login / register) ───────────────────────────── */

.portal-auth-shell {
    min-height: 100vh;
    min-height: 100dvh;
    background: #fff;
    overflow-x: hidden;
}

.portal-auth-split {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
}

.portal-auth-promo {
    position: relative;
    display: none;
    flex: 0 0 50%;
    max-width: 50%;
    width: 50%;
    background: linear-gradient(145deg, #2b7568 0%, #6a8f84 32%, #b87862 58%, #d49176 100%);
    color: #fff;
    overflow: hidden;
}

@media (min-width: 992px) {
    .portal-auth-promo {
        display: flex;
    }
}

@media (max-width: 991.98px) {
    .portal-auth-main__scroll {
        justify-content: flex-start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 1rem 0 calc(1.25rem + env(safe-area-inset-bottom, 0px));
    }

    .portal-auth-main__inner {
        padding-top: max(1rem, env(safe-area-inset-top, 0px));
        padding-right: max(1rem, env(safe-area-inset-right, 0px));
        padding-bottom: 0.75rem;
        padding-left: max(1rem, env(safe-area-inset-left, 0px));
    }

    .portal-auth-footer {
        padding: 0.85rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
    }

    .portal-auth-title {
        font-size: 1.45rem;
    }

    .portal-auth-form .portal-auth-input,
    .portal-auth-shell .form-select.portal-auth-input {
        width: 100%;
        max-width: 100%;
        font-size: 16px;
    }
}

.portal-auth-promo__glow {
    display: none;
}

.portal-auth-promo__inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
    padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1.25rem, 4vw, 2.75rem);
    box-sizing: border-box;
}

.portal-auth-promo__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.portal-auth-promo__brand i {
    font-size: 1.5rem;
    color: #7dd4b0;
}

.portal-auth-promo__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    min-width: 0;
    max-width: none;
    padding: clamp(0.75rem, 2vw, 1rem) 0 clamp(1.25rem, 3vw, 2rem);
    box-sizing: border-box;
}

.portal-auth-promo__trust {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.85rem;
    width: 100%;
    min-width: 0;
}

.portal-auth-promo__headline {
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.75rem;
    letter-spacing: -0.02em;
}

.portal-auth-promo__headline em {
    font-style: normal;
    color: #fff;
}

.portal-auth-promo__subtext {
    font-size: clamp(0.9375rem, 1.8vw, 1rem);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.78);
    margin: 0;
}

.portal-auth-promo__trust-avatars {
    display: flex;
    flex-shrink: 0;
}

.portal-auth-promo__trust-avatars span {
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.85);
    margin-left: -0.6rem;
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.18);
}

.portal-auth-promo__trust-avatars span:first-child {
    margin-left: 0;
    background: linear-gradient(145deg, #037a58 0%, #04966a 100%);
}

.portal-auth-promo__trust-avatars span:nth-child(2) {
    background: linear-gradient(145deg, #2b7568 0%, #6a8f84 100%);
}

.portal-auth-promo__trust-avatars span:nth-child(3) {
    background: linear-gradient(145deg, #b87862 0%, #d49176 100%);
}

.portal-auth-promo__trust-avatars span:nth-child(4) {
    background: linear-gradient(145deg, #e8434f 0%, #ff6b76 100%);
}

.portal-auth-promo__trust-text {
    font-size: clamp(12px, 1.5vw, 13px);
    color: rgba(255, 255, 255, 0.72);
    margin: 0;
    line-height: 1.4;
    min-width: 0;
}

.portal-auth-promo__trust-text strong {
    color: #fff;
    font-weight: 700;
}

.portal-auth-main {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
}

@media (min-width: 992px) {
    .portal-auth-main {
        flex: 0 0 50%;
        max-width: 50%;
        width: 50%;
    }

    .portal-auth-shell--register .portal-auth-main__inner,
    .portal-auth-shell--register .portal-auth-footer {
        max-width: 520px;
    }

    .portal-auth-shell--register .portal-auth-header,
    .portal-auth-shell--register .portal-auth-subtitle,
    .portal-auth-shell--register .portal-auth-switch {
        text-align: left;
    }

    .portal-auth-shell--register .portal-auth-main__scroll {
        justify-content: flex-start;
        padding-top: 0.5rem;
    }

    .portal-auth-shell--register .portal-auth-back {
        margin-bottom: 1.25rem;
    }
}

.portal-auth-main__scroll {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    overflow-x: hidden;
}

.portal-auth-main__inner {
    flex: 0 1 auto;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 1rem;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .portal-auth-main__inner {
        padding: 2.5rem 2rem 1.5rem;
    }
}

.portal-auth-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    margin-bottom: 1.5rem;
}

.portal-auth-back:hover {
    color: var(--portal-primary);
}

.portal-auth-brand-mobile {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1.25rem;
}

.portal-auth-brand-mobile i {
    color: var(--portal-primary);
    font-size: 1.35rem;
}

@media (min-width: 992px) {
    .portal-auth-brand-mobile {
        display: none;
    }
}

.portal-auth-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.portal-auth-title {
    font-size: 1.65rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.35rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.portal-auth-subtitle {
    font-size: 14px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

.portal-auth-steps-wrap {
    margin-bottom: 1.25rem;
}

.portal-auth-steps-meta {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin: 0 0 0.65rem;
}

.portal-auth-steps {
    list-style: none;
    display: flex;
    gap: 0;
    padding: 0;
    margin: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.portal-auth-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.65rem 0.35rem;
    text-align: center;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    opacity: 0.55;
    min-width: 0;
}

.portal-auth-step:last-child {
    border-right: 0;
}

.portal-auth-step.is-active,
.portal-auth-step.is-done {
    opacity: 1;
    background: #fff;
}

.portal-auth-step__indicator {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    background: #e2e8f0;
    color: #64748b;
}

.portal-auth-step.is-active .portal-auth-step__indicator {
    background: var(--portal-primary);
    color: #fff;
}

.portal-auth-step.is-done .portal-auth-step__indicator {
    background: #16a34a;
    color: #fff;
}

.portal-auth-step__short {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}

.portal-auth-step.is-active .portal-auth-step__short {
    color: var(--portal-primary);
}

.portal-auth-step__label {
    font-size: 10px;
    font-weight: 600;
    color: #475569;
    line-height: 1.2;
}

@media (max-width: 575.98px) {
    .portal-auth-step__label {
        display: none;
    }
}

.portal-auth-info-note {
    margin-bottom: 1.25rem;
    font-size: 13px;
}

.portal-auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.portal-auth-form .form-label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.35rem;
}

.portal-auth-form .form-label .portal-required {
    font-weight: 700;
    margin-left: 0.15rem;
}

.portal-auth-input {
    border-radius: 10px;
    border-color: #e2e8f0;
    padding: 0.625rem 0.85rem;
    font-size: 14px;
    min-height: 44px;
}

.portal-auth-input:focus {
    border-color: #7dd4b0;
    box-shadow: 0 0 0 3px var(--portal-primary-focus);
}

.portal-auth-fieldset {
    border: 0;
    padding: 0;
    margin: 0;
}

.portal-auth-fieldset__legend {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.85rem;
    float: none;
    width: 100%;
}

.portal-auth-fieldset__num {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--portal-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.portal-auth-review {
    padding: 0.85rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.portal-auth-submit {
    margin-top: 0.25rem;
    font-size: 15px;
    padding: 0.75rem 1.25rem;
    min-height: 48px;
    border-radius: 10px;
}

.portal-auth-switch {
    text-align: center;
    font-size: 14px;
    color: #64748b;
    margin: 1.25rem 0 0;
}

.portal-auth-switch a {
    color: var(--portal-primary);
    font-weight: 600;
    text-decoration: none;
}

.portal-auth-switch a:hover {
    text-decoration: underline;
}

.portal-auth-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 0.75rem;
    width: 100%;
    max-width: 480px;
    padding: 1rem 1.25rem 1.25rem;
    margin-top: 0;
    border-top: 1px solid #f1f5f9;
}

.portal-auth-footer a {
    font-size: 12px;
    color: #94a3b8;
    text-decoration: none;
}

.portal-auth-footer a:hover {
    color: var(--portal-primary);
}

.portal-auth-footer__dot {
    width: 3px;
    height: 3px;
    border-radius: 999px;
    background: #cbd5e1;
}

.portal-auth-checkout-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    margin-bottom: 1.25rem;
}

.portal-auth-checkout-card__head {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.portal-auth-checkout-card__title {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 0.15rem;
}

.portal-auth-checkout-card__hint {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.portal-auth-checkout-card__body {
    padding: 1.25rem;
}

.portal-auth-checkout-actions {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.portal-auth-complete {
    text-align: center;
    padding: 1rem 0;
}

.portal-auth-complete__icon {
    width: 4rem;
    height: 4rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--portal-primary-light);
    color: var(--portal-primary);
    font-size: 2rem;
    margin-bottom: 1.25rem;
}

.portal-auth-complete__icon.is-ready {
    background: #f0fdf4;
    color: #16a34a;
}

.portal-auth-complete__message {
    font-size: 15px;
    color: #334155;
    margin-bottom: 1.5rem;
    line-height: 1.55;
}

/* ── Subscription details (UX §19 — portal variant) ───────────────── */

.portal-shell__inner:has(.portal-subscription-details-shell) {
    max-width: 1040px;
}

.portal-account-pos-shell .page-content {
    max-width: 100%;
}

.portal-account-pos-shell .portal-subscription-details-shell,
.portal-account-pos-shell .portal-checkout-shell,
.portal-account-pos-shell .portal-checkout-layout,
.portal-account-pos-shell .portal-guided-card,
.portal-account-pos-shell .portal-guided-header,
.portal-account-pos-shell .portal-guided-footer {
    max-width: 100%;
}

.portal-subscription-details-shell {
    max-width: 100%;
}

.portal-subscription-details-header {
    margin-bottom: 1rem;
}

.portal-subscription-details-hero {
    background: linear-gradient(135deg, var(--portal-primary-muted-bg) 0%, #fff 55%, #f8fafc 100%);
    border: 1px solid var(--portal-primary-border);
    border-radius: 14px;
    padding: 1.15rem 1.35rem;
}

.portal-subscription-hero-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.portal-subscription-serial-badge-row {
    display: flex;
    flex-wrap: wrap;
    margin-top: 0.85rem;
}

.portal-subscription-details-shell .portal-serial-key-badge.payment-status-badge {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    max-width: 100%;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0;
    color: #0f172a;
    background: linear-gradient(135deg, var(--portal-primary-light) 0%, #fff 100%) !important;
    border: 1px solid var(--portal-primary);
    box-shadow: 0 2px 10px rgba(0, 138, 94, 0.14);
}

.portal-subscription-details-shell .portal-serial-key-badge i {
    color: var(--portal-primary);
    font-size: 1.05rem;
    line-height: 1;
}

.portal-subscription-details-shell .portal-serial-key-badge__label {
    color: #334155;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.6875rem;
    letter-spacing: 0.05em;
}

.portal-subscription-details-shell .portal-serial-key-badge__value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--portal-primary);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--portal-primary-border);
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    word-break: break-all;
}

@media (max-width: 767.98px) {
    .portal-subscription-details-shell .portal-serial-key-badge.payment-status-badge {
        width: 100%;
        justify-content: flex-start;
    }
}

.portal-subscription-details-shell .sale-invoice-details-meta-row i {
    color: var(--portal-primary);
}

.portal-subscription-summary-icon {
    color: var(--portal-primary) !important;
}

.portal-subscription-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 0.75rem;
}

.portal-subscription-alert i {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.portal-subscription-alert--warning {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #c2410c;
}

.portal-subscription-alert--info {
    background: var(--portal-primary-light);
    border: 1px solid var(--portal-primary-border);
    color: var(--portal-primary-dark);
}

.portal-subscription-details-table thead th {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.portal-subscription-qty-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    background: var(--portal-primary-light);
    color: var(--portal-primary-dark);
}

@media (max-width: 767.98px) {
    .portal-subscription-details-table thead {
        display: none;
    }

    .portal-subscription-details-table tbody tr {
        display: block;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        margin: 0.65rem 0.85rem;
        padding: 0.35rem 0;
    }

    .portal-subscription-details-table tbody td {
        display: flex;
        justify-content: space-between;
        gap: 0.75rem;
        border-bottom: 0;
        padding: 0.45rem 0.85rem;
    }

    .portal-subscription-details-table tbody td::before {
        content: attr(data-label);
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        color: #64748b;
    }

    .portal-subscription-details-table tbody td.text-end {
        text-align: right !important;
    }
}

/* Portal primary buttons inside POS shell */
.portal-account-pos-shell .btn-primary,
.portal-subscription-details-shell .btn-primary,
.portal-subscription-details-shell .btn-outline-primary {
    --bs-btn-bg: var(--portal-primary);
    --bs-btn-border-color: var(--portal-primary);
    --bs-btn-hover-bg: var(--portal-primary-hover);
    --bs-btn-hover-border-color: var(--portal-primary-hover);
    --bs-btn-active-bg: var(--portal-primary-dark);
    --bs-btn-active-border-color: var(--portal-primary-dark);
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
}

.portal-account-pos-shell .btn-outline-primary,
.portal-subscription-details-shell .btn-outline-primary {
    --bs-btn-bg: transparent;
    --bs-btn-color: var(--portal-primary);
    --bs-btn-border-color: var(--portal-primary);
    --bs-btn-hover-bg: var(--portal-primary);
    --bs-btn-hover-color: #fff;
}

.portal-account-pos-shell .text-primary,
.portal-subscription-details-shell .text-primary {
    color: var(--portal-primary) !important;
}

.sale-invoice-details-summary-tile--primary {
    border-color: var(--portal-primary-border);
    background: linear-gradient(135deg, var(--portal-primary-light) 0%, #fff 100%);
}

.portal-subscription-details-shell .sale-invoice-guided-back:hover {
    color: var(--portal-primary);
}

.portal-serial-key {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    word-break: break-all;
}

.portal-subscription-details-footer {
    margin-top: 1.25rem;
}

.portal-subscription-empty {
    text-align: center;
    padding: 2.5rem 1.25rem 2rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
}

.portal-subscription-empty__icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1.25rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--portal-primary-light) 0%, var(--portal-primary-muted-bg) 100%);
    color: var(--portal-primary);
    font-size: 2rem;
}

.portal-subscription-empty__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.5rem;
}

.portal-subscription-empty__text {
    font-size: 14px;
    color: #64748b;
    max-width: 420px;
    margin: 0 auto 1.25rem;
    line-height: 1.55;
}

@media (max-width: 575.98px) {
    .portal-subscription-details-shell .sale-invoice-details-actions-btns .btn {
        flex: 1 1 100%;
        min-height: 42px;
    }

    .portal-subscription-details-shell .sale-invoice-details-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Change plan — guided comparison (§22) */
.portal-shell__inner:has(.portal-change-plan-shell) {
    max-width: 100%;
    width: 100%;
}

.portal-change-plan-shell {
    width: 100%;
    max-width: 100%;
}

.portal-change-plan-summary {
    margin-top: 1rem;
}

.portal-change-plan-current__plan {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.portal-change-plan-current__icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--portal-primary-light);
    color: var(--portal-primary);
    font-size: 1.35rem;
    flex-shrink: 0;
}

.portal-change-plan-current__label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    margin: 0 0 0.15rem;
}

.portal-change-plan-current__name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.portal-plan-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .portal-plan-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.portal-plan-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
    padding: 1.15rem;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
}

.portal-plan-card--current {
    border-color: var(--portal-primary-border);
    background: linear-gradient(180deg, var(--portal-primary-muted-bg) 0%, #fff 55%);
    box-shadow: inset 0 0 0 1px rgba(0, 138, 94, 0.08);
}

.portal-plan-card__header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.portal-plan-card__badge {
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--portal-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.portal-plan-card__heading {
    flex: 1;
    min-width: 0;
}

.portal-plan-card__title {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 0.15rem;
}

.portal-plan-card__limits {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.portal-plan-card__status {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--portal-primary-dark);
    background: var(--portal-primary-light);
    border: 1px solid var(--portal-primary-border);
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    white-space: nowrap;
}

.portal-plan-card__price {
    font-size: 1.45rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.portal-plan-card__cycle {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    margin-top: 0.15rem;
}

.portal-plan-card__actions {
    margin-top: auto;
}

.portal-plan-card__form {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.portal-plan-card__prorate {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.portal-plan-card__highlights {
    list-style: none;
    margin: 0.85rem 0 1rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.portal-plan-card__highlights li {
    position: relative;
    padding-left: 1.15rem;
    font-size: 13px;
    color: #475569;
    line-height: 1.4;
}

.portal-plan-card__highlights li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45rem;
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: var(--portal-primary, #008a5e);
}

.portal-access-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.35rem;
    font-size: 13px;
    color: #334155;
    background: #f0fdf6;
    border: 1px solid #b8e6d4;
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    margin: 0;
}

.portal-access-note .bx {
    color: var(--portal-primary, #008a5e);
}

.portal-addon-desc {
    font-size: 14px;
    color: #475569;
    line-height: 1.45;
    margin: 0 0 0.75rem;
}

.portal-feature-matrix {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e2e8f0;
}

.portal-feature-matrix__title {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 0.25rem;
}

.portal-feature-matrix__hint {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 0.85rem;
}

.portal-feature-matrix__table-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.portal-feature-matrix__table {
    width: 100%;
    border-collapse: collapse;
    min-width: 32rem;
    margin: 0;
    background: #fff;
}

.portal-feature-matrix__table th,
.portal-feature-matrix__table td {
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
    text-align: left;
    vertical-align: middle;
}

.portal-feature-matrix__table thead th {
    background: #f8fafc;
    font-weight: 600;
    color: #0f172a;
}

.portal-feature-matrix__table thead th:not(:first-child),
.portal-feature-matrix__table tbody td {
    text-align: center;
}

.portal-feature-matrix__table tbody th {
    font-weight: 500;
    color: #334155;
    width: 44%;
    text-align: left;
}

.portal-feature-matrix__table tbody tr:last-child th,
.portal-feature-matrix__table tbody tr:last-child td {
    border-bottom: 0;
}

.portal-feature-matrix__table td {
    color: #475569;
    width: 28%;
}

.portal-feature-matrix__yes {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    background: #e8f7f1;
    color: #008a5e;
    font-size: 1rem;
}

.portal-feature-matrix__no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 1rem;
}

.portal-change-plan-actions {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.portal-change-plan-actions__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.portal-change-plan-actions__item--danger {
    background: #fff;
}

.portal-change-plan-actions__title {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 0.2rem;
}

.portal-change-plan-actions__hint {
    font-size: 13px;
}

@media (max-width: 575.98px) {
    .portal-change-plan-actions__item {
        flex-direction: column;
        align-items: stretch;
    }

    .portal-change-plan-actions__item .btn {
        width: 100%;
        min-height: 42px;
    }

    .portal-change-plan-footer .btn {
        flex: 1 1 100%;
        min-height: 42px;
    }
}

.portal-account-pos-shell .portal-change-plan-shell .portal-guided-card,
.portal-account-pos-shell .portal-change-plan-shell .portal-guided-header,
.portal-account-pos-shell .portal-change-plan-shell .portal-guided-footer {
    max-width: 100%;
}

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

.portal-card__header {
    padding: 1rem 1.25rem 0;
}

.portal-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
}

.portal-card__body {
    padding: 1rem 1.25rem 1.25rem;
}

.portal-radio-card {
    display: block;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.9rem 1rem;
    cursor: pointer;
    height: 100%;
}

.portal-radio-card.is-selected,
.portal-radio-card:has(input:checked) {
    border-color: var(--portal-primary);
    background: var(--portal-primary-muted-bg);
}

.portal-radio-card input {
    margin-right: 0.5rem;
}

.portal-radio-card__title {
    display: block;
    font-weight: 600;
}

.portal-radio-card__hint {
    display: block;
    color: #64748b;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.portal-status-tag {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
}

.portal-status-tag.is-success {
    background: var(--portal-primary-light);
    color: var(--portal-primary-dark);
}

.portal-status-tag.is-danger {
    background: #fee2e2;
    color: #b91c1c;
}


.portal-subscription-activity__item {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.portal-subscription-activity__item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.portal-subscription-activity__item:first-child {
    padding-top: 0;
}

.portal-subscription-activity__main {
    min-width: 0;
    flex: 1 1 14rem;
}

.portal-subscription-activity__time {
    white-space: nowrap;
}

/* ===== Ported from retail-pos modern-form-controls.css: sale-invoice-details component (portal subscription UI) ===== */
/* Sale invoice details — read-only view */
.sale-invoice-details-shell .page-content {
    max-width: 100%;
    width: 100%;
}

.sale-invoice-details-header {
    margin-bottom: 1rem;
}

.sale-invoice-details-hero {
    background: linear-gradient(135deg, #f0fdf4 0%, #fff 55%, #f8fafc 100%);
    border: 1px solid #d1e7dd;
    border-radius: 14px;
    padding: 1.15rem 1.35rem;
}

.sale-invoice-details-hero-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.sale-invoice-details-meta-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.sale-invoice-details-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 13px;
    color: #475569;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
}

.sale-invoice-details-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    align-items: flex-end;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.sale-invoice-details-actions-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
}

.sale-invoice-details-actions-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}

.sale-invoice-details-actions-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.receipt-status-links {
    gap: 0.6rem;
}

.receipt-status-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #0f172a;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.15rem 0;
}

.receipt-status-link:hover {
    color: #04966a;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.receipt-status-link > i {
    color: #04966a;
    font-size: 1rem;
}

.receipt-status-link__text {
    font-weight: 600;
}

.sale-invoice-details-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
    .sale-invoice-details-summary {
        grid-template-columns: repeat(4, 1fr);
    }
}

.sale-invoice-details-summary-tile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
}

.sale-invoice-details-summary-tile--primary {
    border-color: #bfdbfe;
    background: linear-gradient(135deg, #eff6ff 0%, #fff 100%);
}

.sale-invoice-details-summary-tile--success {
    border-color: #bbf7d0;
    background: linear-gradient(135deg, #f0fdf4 0%, #fff 100%);
}

.sale-invoice-details-summary-tile--danger {
    border-color: #fecaca;
    background: linear-gradient(135deg, #fef2f2 0%, #fff 100%);
}

.sale-invoice-details-summary-tile--muted {
    border-color: #e2e8f0;
}

.sale-invoice-details-summary-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: rgba(255, 255, 255, 0.8);
    color: #04966a;
    flex-shrink: 0;
}

.sale-invoice-details-summary-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.sale-invoice-details-summary-label {
    font-size: 12px;
    color: #64748b;
}

.sale-invoice-details-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (min-width: 992px) {
    .sale-invoice-details-layout {
        grid-template-columns: minmax(260px, 320px) 1fr;
        align-items: start;
    }
}

.sale-invoice-details-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sale-invoice-details-main {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
}

.sale-invoice-details-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
}

.sale-invoice-details-card-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid #f1f5f9;
    background: #fafbfc;
}

.sale-invoice-details-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    flex: 1;
}

.sale-invoice-details-item-count {
    font-size: 12px;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
}

.sale-invoice-details-card-body {
    padding: 1rem 1.1rem;
}

.sale-invoice-details-party-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.65rem;
}

.sale-invoice-details-meta-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 14px;
    color: #475569;
    margin-bottom: 0.45rem;
}

.sale-invoice-details-meta-row i {
    color: #04966a;
    margin-top: 2px;
    flex-shrink: 0;
}

.sale-invoice-details-table-wrap {
    max-height: none;
}

.sale-invoice-details-table thead th {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.sale-invoice-details-table tbody td {
    font-size: 14px;
    vertical-align: top;
    border-bottom: 1px solid #f1f5f9;
}

.sale-invoice-details-table .col-num {
    width: 40px;
}

.sale-invoice-details-item-name {
    font-weight: 600;
    color: #0f172a;
}

.sale-invoice-details-item-meta {
    font-size: 12px;
    color: #64748b;
    margin-top: 0.15rem;
}

.sale-invoice-details-totals-row--muted {
    color: #94a3b8;
    font-size: 13px;
}

.sale-invoice-details-mobile-items {
    padding: 0.5rem;
}

.sale-invoice-details-mobile-item {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: #fafbfc;
}

.sale-invoice-details-mobile-item-head {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.sale-invoice-details-mobile-item-num {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: #e2e8f0;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sale-invoice-details-mobile-item-total {
    font-weight: 700;
    color: #04966a;
    white-space: nowrap;
}

.sale-invoice-details-mobile-item-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.35rem;
    font-size: 13px;
}

@media (min-width: 480px) {
    .sale-invoice-details-mobile-item-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.sale-invoice-details-mobile-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #94a3b8;
}

.sale-invoice-details-totals {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1rem 1.1rem;
}

.sale-invoice-details-totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.45rem 0;
    font-size: 14px;
    color: #475569;
    border-bottom: 1px dashed #f1f5f9;
}

.sale-invoice-details-totals-row:last-child {
    border-bottom: none;
}

.sale-invoice-details-totals-row--grand {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    padding-top: 0.65rem;
    margin-top: 0.25rem;
    border-top: 2px solid #e2e8f0;
    border-bottom: none;
}

.sale-invoice-details-totals-row--balance {
    font-weight: 700;
    font-size: 1rem;
}

.sale-invoice-details-section-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 0.75rem;
}

.sale-invoice-details-payment-field {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

@media (max-width: 575px) {
    .sale-invoice-details-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .sale-invoice-details-actions-btns .btn {
        flex: 1 1 auto;
    }
}

/* ===== admin-table meta note (portal billing tables) ===== */
.admin-table-meta {
    display: block;
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 0.15rem;
}

.admin-table-meta code {
    font-size: 0.72rem;
}

.admin-table-meta--warning {
    color: #b45309;
}
