:root {
    --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --color-bg: #f1f5f9;
    --color-surface: #ffffff;
    --color-border: #e2e8f0;
    --color-text: #111827;
    --color-text-muted: #64748b;
    --color-accent: #4f46e5;
    --color-accent-hover: #4338ca;
    --color-accent-soft: rgba(79, 70, 229, 0.12);
    --radius-lg: 12px;
    --radius-md: 8px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    /* Sticky top nav bar */
    --site-header-height: 3.5rem;
}

html, body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background-color: var(--color-bg);
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: var(--color-accent);
}

a:hover {
    color: var(--color-accent-hover);
}

.btn-primary {
    color: #fff;
    background-color: var(--color-accent);
    border-color: var(--color-accent);
}

.btn-primary:hover {
    background-color: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--color-accent-soft);
}

.content {
    padding-top: 0.5rem;
    padding-bottom: 2.5rem;
    max-width: 1120px;
}

.auth-redirect {
    padding: 2rem 1.25rem;
    text-align: center;
    font-size: 0.95rem;
    color: var(--color-text-muted);
}

/* Home shortcuts */
.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.quick-link-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.15rem 1.25rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.quick-link-card:hover {
    border-color: #c7d2fe;
    box-shadow: var(--shadow-md);
}

.quick-link-card.active {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 1px var(--color-accent-soft);
}

.quick-link-card__title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-text);
}

.quick-link-card__desc {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    line-height: 1.4;
}

/* Cart total monthly (products page) */
.cart-monthly-summary {
    position: sticky;
    top: 0.75rem;
    z-index: 2;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    border: 1px solid #c7d2fe;
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.35rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

@media (min-width: 641px) {
    .cart-monthly-summary {
        top: var(--site-header-height);
    }
}

.cart-monthly-summary__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.cart-monthly-summary__title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.cart-monthly-summary__hint {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin: 0;
    line-height: 1.4;
    max-width: 36rem;
}

.cart-monthly-summary__amount-block {
    text-align: right;
    flex-shrink: 0;
}

.cart-monthly-summary__amount {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--color-accent);
    font-variant-numeric: tabular-nums;
}

.cart-monthly-summary__per {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-left: 0.2rem;
}

.cart-monthly-summary__link {
    display: inline-block;
    margin-top: 0.85rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
}

.cart-monthly-summary__link:hover {
    text-decoration: underline;
}

/* Product catalog */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    align-items: stretch;
}

.product-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.35rem 1.4rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.product-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.product-card__meta-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.65rem;
}

.product-card__category {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-accent);
}

.product-card__sku {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

.product-card__title {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--color-text);
    line-height: 1.3;
}

.product-card__summary {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin: 0;
    line-height: 1.45;
    flex: 1;
}

.product-card__oem {
    margin: 0;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(15, 23, 42, 0.03));
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.product-card__oem-heading {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-text-muted);
    margin: 0 0 0.35rem;
}

.product-card__oem-dci {
    margin: 0 0 0.45rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--color-text);
}

.product-card__oem-dci strong {
    font-weight: 600;
    color: var(--color-text-muted);
    margin-right: 0.25rem;
}

.product-card__oem-list {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.8125rem;
    color: var(--color-text);
    line-height: 1.4;
}

.product-card__oem-list li {
    margin-bottom: 0.15rem;
}

.product-card__price {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.65rem 0 0.15rem;
    border-top: 1px solid var(--color-border);
    margin-top: 0.15rem;
    background: transparent;
}

.product-card__price-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.5rem;
}

.product-card__price-note {
    width: 100%;
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.3;
}

.product-card__tier-panel {
    width: 100%;
    border-radius: 10px;
    background: color-mix(in srgb, var(--color-accent) 6%, var(--color-surface));
    border: 1px solid color-mix(in srgb, var(--color-accent) 18%, var(--color-border));
    padding: 0.55rem 0.65rem 0.5rem;
}

.product-card__tier-heading {
    margin: 0 0 0.4rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
}

.product-card__tier-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.product-card__tier-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.4rem 0;
    border-top: 1px solid color-mix(in srgb, var(--color-border) 85%, transparent);
    font-size: 0.875rem;
}

.product-card__tier-list .product-card__tier-line:first-child {
    border-top: none;
    padding-top: 0;
}

.product-card__tier-breakpoint {
    font-weight: 600;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

.product-card__tier-amount {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--color-text);
    text-align: right;
    white-space: nowrap;
}

.product-card__tier-each {
    font-weight: 500;
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.product-card__amount {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

.product-card__period {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.product-card__min-hint {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin: 0;
}

.product-card__terms {
    padding-top: 0.35rem;
    border-top: 1px solid var(--color-border);
}

.product-card__terms-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.term-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.term-chip {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid var(--color-border);
}

.product-card__cta {
    margin-top: 0.25rem;
    align-self: flex-start;
}

.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
}

/* Account — three management sections */
.account-page-header .page-lead {
    max-width: 42rem;
}

.account-manage {
    max-width: 920px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Account tabs — segment control + panels */
.account-tabs {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.account-tabs__nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    padding: 3px;
    margin: 0.85rem 0.85rem 0;
    background: #dfe4ea;
    border-radius: 12px;
    border: 1px solid #cdd5df;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.account-tabs__tab {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
    padding: 0.62rem 0.7rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border: none;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    border-radius: 0;
    transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

/* Flush segment: rounded ends only, no gaps */
.account-tabs__tab:first-child {
    border-radius: 10px 0 0 10px;
}

.account-tabs__tab:last-child {
    border-radius: 0 10px 10px 0;
}

.account-tabs__tab:only-child {
    border-radius: 10px;
}

/* Hairline separators between segments (not after last) */
.account-tabs__tab:not(:last-child) {
    box-shadow: 1px 0 0 rgba(148, 163, 184, 0.55);
}

/* Inactive tab: clear hover / focus cue */
.account-tabs__tab:not(.account-tabs__tab--active):hover {
    color: var(--color-text);
    background: rgba(79, 70, 229, 0.12);
    box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.28);
}

.account-tabs__tab:not(.account-tabs__tab--active):active {
    background: rgba(79, 70, 229, 0.18);
}

.account-tabs__tab:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--color-accent);
    z-index: 2;
}

.account-tabs__tab--active {
    position: relative;
    z-index: 1;
    color: var(--color-accent);
    background: #fff;
    font-weight: 700;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.14);
}

.account-tabs__tab--active:hover {
    color: var(--color-accent);
    background: #fff;
}

.account-tabs__panel {
    padding: 1.25rem 1.35rem 1.5rem;
    min-height: 12rem;
    border-top: 1px solid var(--color-border);
    margin-top: 0.85rem;
}

.account-tabs__panel-lead {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin: 0 0 1.15rem;
    line-height: 1.45;
    max-width: 40rem;
}

/* Profile tab: sensible field width (no full-bleed inputs) */
.account-profile-body {
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.account-tabs__panel--profile .profile-card__header {
    max-width: 100%;
    width: 100%;
    margin-bottom: 1.25rem;
}

.account-profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.25rem 2.25rem;
    align-items: start;
    width: 100%;
    max-width: 52rem;
}

.account-profile-update {
    min-width: 0;
}

.account-profile-update__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    letter-spacing: -0.02em;
    color: var(--color-text);
}

.account-tabs__panel--profile .profile-form {
    max-width: 100%;
    width: 100%;
}

.account-tabs__panel--profile .profile-form__row {
    width: 100%;
    max-width: 100%;
}

.account-tabs__panel--profile .profile-form .form-control {
    max-width: 100%;
}

.account-tabs__panel--profile .profile-dl--readonly {
    max-width: 100%;
    width: 100%;
    margin-bottom: 1rem;
}

.account-tabs__panel--profile .profile-save {
    max-width: 100%;
    width: auto;
}

.account-tabs__panel--profile .profile-form__label {
    text-transform: none;
    letter-spacing: 0.01em;
    font-size: 0.8125rem;
    font-weight: 600;
}

.account-password-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    max-width: 22rem;
    width: 100%;
}

.account-password-section--split {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    max-width: 100%;
    padding-left: 1.5rem;
    border-left: 1px solid var(--color-border);
}

.account-password-section__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    letter-spacing: -0.02em;
    color: var(--color-text);
}

.account-password-section__hint {
    margin: 0 0 1rem;
    max-width: 20rem;
}

.account-password-section .profile-save.btn-outline-primary {
    margin-top: 0.5rem;
}

.login-forgot {
    text-align: center;
    padding-top: 0.25rem;
}

.login-forgot__link {
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.login-forgot__link:hover {
    text-decoration: underline;
}

@media (max-width: 900px) {
    .account-profile-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .account-password-section--split {
        padding-left: 0;
        border-left: none;
        margin-top: 1.5rem;
        padding-top: 1.5rem;
        border-top: 1px solid var(--color-border);
    }
}

@media (max-width: 520px) {
    .account-tabs__nav {
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }

    .account-tabs__tab {
        font-size: 0.8rem;
        padding: 0.55rem 0.4rem;
    }

    .account-tabs__panel--profile .profile-card__header,
    .account-tabs__panel--profile .profile-form,
    .account-tabs__panel--profile .profile-dl--readonly,
    .account-tabs__panel--profile .profile-save {
        max-width: 100%;
    }
}

.account-section-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.account-section-card__head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.2rem 1.35rem;
    background: linear-gradient(180deg, #fafbfc 0%, #f8fafc 100%);
    border-bottom: 1px solid var(--color-border);
}

.account-section-card__icon {
    width: 2.85rem;
    height: 2.85rem;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}

.account-section-card__icon--profile {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.account-section-card__icon--orders {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.35);
}

.account-section-card__icon--billing {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.account-section-card__head-text {
    min-width: 0;
}

.account-section-card__title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    letter-spacing: -0.02em;
    color: var(--color-text);
}

.account-section-card__subtitle {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--color-text-muted);
}

.account-section-card__body {
    padding: 1.35rem 1.35rem 1.5rem;
}

.account-section-card__body--profile {
    padding-top: 1.25rem;
}

.account-table-shell {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: #fafbfc;
    overflow: hidden;
}

.account-order-download {
    display: inline;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    font-weight: 700;
    color: inherit;
    cursor: pointer;
    text-align: left;
    text-decoration: underline;
    text-decoration-color: transparent;
}

.account-order-download:hover {
    text-decoration-color: currentColor;
}

.account-order-download:focus-visible {
    outline: 2px solid var(--color-accent, #2563eb);
    outline-offset: 2px;
}

.account-empty-state {
    text-align: center;
    padding: 2rem 1.5rem;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}

.account-empty-state--compact {
    padding: 1.5rem 1.25rem;
}

.account-empty-state__icon {
    width: 3.25rem;
    height: 3.25rem;
    margin: 0 auto 0.85rem;
    border-radius: 50%;
    background: var(--color-accent-soft);
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.account-empty-state__icon--subtle {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.account-empty-state__title {
    font-weight: 600;
    font-size: 1rem;
    margin: 0 0 0.35rem;
    color: var(--color-text);
}

.account-empty-state__text {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin: 0 auto 1rem;
    max-width: 22rem;
    line-height: 1.45;
}

.account-empty-state--compact .account-empty-state__text {
    margin-bottom: 0;
}

.account-state {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
}

.account-state--muted {
    background: #f1f5f9;
    color: var(--color-text-muted);
}

.account-state__dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: var(--color-accent);
    animation: account-pulse 1.2s ease-in-out infinite;
}

@keyframes account-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.92); }
}

.account-line-details {
    margin-top: 0.35rem;
}

.account-line-details summary {
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    list-style: none;
}

.account-line-details summary::-webkit-details-marker {
    display: none;
}

.account-line-list {
    padding-left: 1.1rem;
}

.profile-card__header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--color-border);
}

.profile-avatar {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.profile-card__name {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.2rem;
    letter-spacing: -0.02em;
}

.profile-card__email {
    margin: 0;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.profile-dl {
    margin: 0;
}

.profile-dl__row {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.profile-dl__row:last-child {
    border-bottom: none;
}

.profile-dl dt {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.profile-dl dd {
    margin: 0;
    font-size: 0.9rem;
    color: var(--color-text);
}

.profile-dl--readonly {
    margin-bottom: 1rem;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.profile-form__row {
    margin: 0;
}

.profile-form__label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    margin-bottom: 0.35rem;
}

.profile-save {
    margin-top: 0.35rem;
}

.profile-saved {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0.75rem 0 0;
}

.account-gate {
    max-width: 520px;
}

.account-gate__text {
    margin: 0 0 1rem;
    color: var(--color-text-muted);
}

.login-panel {
    max-width: 420px;
}

.login-field {
    margin-bottom: 1rem;
}

.login-submit {
    margin-top: 0.35rem;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 0.35rem;
}

@media (max-width: 520px) {
    .profile-dl__row {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }
}

/* Page shell */
.page-header-block {
    margin-bottom: 0.25rem;
}

.page-header-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
}

.page-header-brand__logo {
    height: 2.5rem;
    width: auto;
    max-width: 9rem;
    object-fit: contain;
    background: #0f172a;
    padding: 0.35rem 0.6rem;
    border-radius: 10px;
    box-sizing: content-box;
}

.page-header-brand__title {
    margin-bottom: 0;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-text);
    margin: 0 0 0.35rem;
}

.page-lead {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin: 0 0 1.75rem;
    line-height: 1.5;
}

.page-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.25rem;
}

.admin-catalog-wrap .table {
    min-width: 44rem;
}

.admin-catalog-tiers {
    min-width: 16rem;
    vertical-align: top;
}

.admin-catalog-tier-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin-bottom: 0.35rem;
}

.admin-catalog-tier-row__label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.admin-catalog-tier-row__qty {
    max-width: 4.5rem;
}

.admin-catalog-tier-row__price {
    max-width: 5.5rem;
}

.admin-catalog-tier-row__at {
    font-weight: 600;
    color: var(--color-text-muted);
}

.admin-catalog-tier-row__each {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.admin-catalog-tier-row__remove {
    font-size: 0.75rem;
    padding: 0 0.25rem !important;
}

.admin-catalog-oem {
    min-width: 12rem;
    max-width: 18rem;
    vertical-align: top;
}

.admin-catalog-oem__input {
    font-size: 0.8rem;
    line-height: 1.35;
    resize: vertical;
}

.admin-access-user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
    gap: 0.35rem 1rem;
}

.admin-access-user-check {
    margin: 0;
    font-size: 0.9rem;
}

.admin-access-tabs .nav-link {
    border: 1px solid transparent;
    border-top-left-radius: 0.375rem;
    border-top-right-radius: 0.375rem;
    margin-bottom: -1px;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.admin-access-tabs .nav-link:hover:not(.active) {
    border-color: var(--bs-border-color, #dee2e6);
}

.admin-access-tabs .nav-link.active {
    border-color: var(--bs-border-color, #dee2e6) var(--bs-border-color, #dee2e6) #fff;
    background: #fff;
}

.product-card__special {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.1rem 0.45rem;
    border-radius: 6px;
    font-weight: 600;
    color: var(--color-accent, #0d6efd);
    background: color-mix(in srgb, var(--color-accent, #0d6efd) 12%, transparent);
}

/* Dashboard cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.stat-card__label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
}

.stat-card__value {
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    width: fit-content;
}

.status-pill::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-pill--ok {
    background: #ecfdf5;
    color: #047857;
}

.status-pill--ok::before {
    background: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.status-pill--warn {
    background: #fffbeb;
    color: #b45309;
}

.status-pill--warn::before {
    background: #f59e0b;
}

.status-pill--bad {
    background: #fef2f2;
    color: #b91c1c;
}

.status-pill--bad::before {
    background: #ef4444;
}

.alert-modern {
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 0.9rem;
}

/* Weather table */
.table-modern-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

.table-modern-wrap .table {
    margin-bottom: 0;
}

.table-modern-wrap .table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    font-weight: 600;
    border-bottom-width: 1px;
    background: #f8fafc;
}

.table-modern-wrap .table tbody tr:last-child td {
    border-bottom: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: #fffbeb;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: #b91c1c;
    padding: 1rem 1.25rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e2e8f0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: var(--color-accent);
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: 600;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    color: var(--color-text-muted);
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #7c3aed;
}

/* Plan builder */
.product-card__in-plan {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.product-card__qty-block {
    margin-top: 0.35rem;
}

.product-card__qty-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    margin-bottom: 0.4rem;
}

.product-card__qty-row-input {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.product-qty-input {
    width: 5.5rem;
    max-width: 100%;
    padding: 0.45rem 0.6rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: #fff;
    color: var(--color-text);
}

.product-qty-input:focus {
    border-color: var(--color-accent);
    outline: none;
    box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.product-card__qty-error {
    font-size: 0.8125rem;
    color: #b91c1c;
    margin: 0.35rem 0 0;
}

.product-card__line-preview {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin: 0.4rem 0 0;
}

.product-card__commitment {
    margin-top: 0.35rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
}

.product-card__commitment-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    margin-bottom: 0.45rem;
}

.product-term-pick {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.product-term-btn {
    flex: 1;
    min-width: 6rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 2px solid var(--color-border);
    background: #f8fafc;
    color: var(--color-text);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.product-term-btn:hover {
    border-color: #c7d2fe;
}

.product-term-btn--active {
    border-color: var(--color-accent);
    background: var(--color-accent-soft);
    color: var(--color-accent);
}

.product-qty-input--full {
    width: 100%;
    max-width: 100%;
}

.product-card__line-monthly {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin: 0.55rem 0 0;
    line-height: 1.45;
}

.product-card__line-detail {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.25rem;
    color: #94a3b8;
}

.product-card__in-cart {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin: 0.65rem 0 0;
    padding-top: 0.65rem;
    border-top: 1px dashed var(--color-border);
}

.product-card__credit-hint {
    font-size: 0.8rem;
    color: #b45309;
    margin: 0.35rem 0 0;
    width: 100%;
    line-height: 1.35;
}

.product-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: auto;
}

.btn-outline-secondary {
    color: #475569;
    border: 1px solid var(--color-border);
    background: #fff;
}

.btn-outline-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
}

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

@media (min-width: 900px) {
    .plan-layout {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

.plan-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 1rem;
    letter-spacing: -0.02em;
}

.plan-line-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Cart line layout follows panel width — viewport-wide breakpoints squeezed 5 columns into a half-width column */
.plan-lines {
    container-type: inline-size;
    container-name: plan-lines;
}

/* Default: stacked so product text never shares a row with inputs in a narrow panel */
.plan-line {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 0.75rem;
    align-items: start;
    padding: 0.85rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.plan-line:last-child {
    border-bottom: none;
}

.plan-line__info {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.plan-line__name {
    font-weight: 600;
    color: var(--color-text);
    overflow-wrap: break-word;
}

.plan-line__sku {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.plan-line__oem {
    font-size: 0.72rem;
    color: #475569;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.plan-line__min {
    font-size: 0.72rem;
    color: #7c3aed;
    font-weight: 600;
}

.plan-line__qty {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.15rem 0.25rem;
    background: #f8fafc;
    justify-self: start;
    width: fit-content;
    max-width: 100%;
}

.plan-qty-btn {
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 6px;
    background: #fff;
    color: var(--color-text);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    font-weight: 600;
}

.plan-qty-btn:hover {
    background: #eef2ff;
    color: var(--color-accent);
}

.plan-qty-value {
    min-width: 1.5rem;
    text-align: center;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.plan-line__line-price {
    grid-column: 1 / -1;
    justify-self: start;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    align-items: flex-start;
    font-variant-numeric: tabular-nums;
}

.plan-line__mp {
    font-weight: 700;
    color: var(--color-text);
    white-space: nowrap;
}

.plan-line__per {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.plan-line__term {
    display: flex;
    align-items: center;
}

.plan-line-term-pick {
    display: inline-flex;
    gap: 0.35rem;
}

.plan-line-term-btn {
    padding: 0.35rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    background: #fff;
    color: var(--color-text-muted);
    cursor: pointer;
}

.plan-line-term-btn:hover {
    border-color: #c7d2fe;
    color: var(--color-accent);
}

.plan-line-term-btn--active {
    border-color: var(--color-accent);
    background: var(--color-accent-soft);
    color: var(--color-accent);
}

.plan-line__remove {
    grid-column: 1 / -1;
    justify-self: start;
    font-size: 0.85rem;
}

@container plan-lines (min-width: 768px) {
    .plan-line {
        grid-template-columns: minmax(0, 1fr) auto auto minmax(5.5rem, 7rem) auto;
        grid-template-rows: auto;
        align-items: center;
    }

    .plan-line__info {
        grid-column: auto;
    }

    .plan-line__qty {
        grid-column: auto;
        justify-self: start;
    }

    .plan-line__term {
        grid-column: auto;
    }

    .plan-line__line-price {
        grid-column: auto;
        justify-self: end;
        align-items: flex-end;
    }

    .plan-line__remove {
        grid-column: auto;
        justify-self: end;
    }
}

.plan-lines__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.plan-lines__footer--stack {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
}

.plan-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

.plan-total-row--muted .plan-subtotal-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.plan-total-row--dci-line .plan-subtotal-label,
.plan-total-row--dci-line .plan-subtotal-value {
    font-weight: 400;
    color: var(--color-text-muted);
}

.plan-total-row--dci-line .plan-subtotal-value {
    font-size: 0.8rem;
}

.plan-total-row--dci-line.plan-total-row--dci-saving .plan-subtotal-label,
.plan-total-row--dci-line.plan-total-row--dci-saving .plan-subtotal-value {
    color: #c62828;
}

.plan-subtotal-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.plan-subtotal-value {
    font-size: 1.1rem;
    font-variant-numeric: tabular-nums;
}

.plan-terms-lead {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin: 0 0 1rem;
    line-height: 1.45;
}

.term-pick {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 520px) {
    .term-pick {
        grid-template-columns: 1fr;
    }
}

.term-option {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem 1.1rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: #f8fafc;
    cursor: pointer;
    position: relative;
}

.term-option input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.term-option--active {
    border-color: var(--color-accent);
    background: var(--color-accent-soft);
    box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.2);
}

.term-option__title {
    font-weight: 700;
    font-size: 0.95rem;
}

.term-option__monthly {
    font-size: 1.2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--color-text);
}

.term-option__monthly span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.term-option__total {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

.plan-summary-card {
    padding: 1rem 1.15rem;
    border-radius: var(--radius-md);
    background: #f8fafc;
    border: 1px solid var(--color-border);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 1rem;
    margin-bottom: 1.25rem;
}

.plan-summary-card__label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--color-text-muted);
}

.plan-summary-card__value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.plan-summary-card__highlight {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--color-accent);
    font-variant-numeric: tabular-nums;
}

.plan-submit {
    width: 100%;
    padding: 0.65rem 1rem;
    font-weight: 600;
}

.plan-legal {
    margin: 0.75rem 0 0;
    line-height: 1.4;
}

.plan-empty {
    text-align: left;
}

.plan-success {
    max-width: 520px;
}

.plan-success__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.plan-success__text {
    color: var(--color-text-muted);
    margin: 0 0 1rem;
    line-height: 1.5;
}

.nav-link--disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
    color: var(--color-text-muted) !important;
}

.alert-modern--credit {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.product-card--blocked {
    opacity: 0.92;
}

.account-payment-summary__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.account-payment-stat {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.account-payment-stat__label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
}

.account-payment-stat__value {
    font-size: 1.35rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--color-text);
}

.account-payment-stat__value--compact {
    font-size: 1.05rem;
}

.account-payment-stat__sep {
    font-weight: 500;
    color: var(--color-text-muted);
}

.account-schedule-block__title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.account-schedule-proforma {
    color: #0369a1;
}

.account-pay-calendar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.account-pay-calendar__title {
    font-weight: 700;
    font-size: 0.95rem;
}

.account-pay-calendar__nav {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.account-pay-calendar__label {
    min-width: 10rem;
    text-align: center;
    font-weight: 600;
}

.account-pay-calendar__weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    text-align: center;
}

.account-pay-calendar__grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    background: var(--color-border);
    border-radius: var(--radius-md);
    padding: 4px;
}

.account-pay-cal-cell {
    min-height: 4.25rem;
    background: var(--color-surface);
    border-radius: 6px;
    padding: 4px 6px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    font-size: 0.7rem;
    line-height: 1.2;
}

.account-pay-cal-cell--muted {
    opacity: 0.45;
}

.account-pay-cal-cell--today {
    outline: 2px solid var(--color-accent);
    outline-offset: -2px;
}

.account-pay-cal-cell__num {
    font-weight: 700;
    font-size: 0.8rem;
}

.account-pay-cal-cell__amt {
    font-variant-numeric: tabular-nums;
    color: var(--color-text);
    font-weight: 600;
}

.account-pay-cal-cell__amt--pro {
    color: #0369a1;
    font-weight: 500;
}

@media (max-width: 520px) {
    .account-pay-cal-cell {
        min-height: 3.5rem;
        font-size: 0.62rem;
    }
}
