:root {
    --portal-blue: #111111;
    --portal-blue-dark: #000000;
    --portal-text: #131313;
    --portal-muted: #666666;
    --portal-bg: #f2f2f0;
    --portal-border: #d7d7d2;
    --portal-surface: #ffffff;
    --portal-overlay: rgba(0, 0, 0, 0.55);
    --portal-success: #2e7d32;
    --portal-radius: 22px;
    --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.06);
    --shadow-strong: 0 28px 70px rgba(0, 0, 0, 0.1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.portal-body {
    margin: 0;
    min-height: 100vh;
    color: var(--portal-text);
    background:
        radial-gradient(circle at top left, rgba(0, 0, 0, 0.05), transparent 26%),
        linear-gradient(180deg, #fbfbfa 0%, var(--portal-bg) 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

.catalog-overlay {
    position: fixed;
    inset: 0;
    z-index: 45;
    background: var(--portal-overlay);
}

body.has-overlay {
    overflow: hidden;
}

.offer-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--portal-border);
    backdrop-filter: blur(16px);
}

.offer-header__inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
}

.offer-header__row {
    display: flex;
    align-items: center;
    gap: 20px;
}

.offer-header__row--main {
    min-height: 76px;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 236px;
}

.brand-block__logo {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    overflow: hidden;
    background: transparent;
    box-shadow: none;
}

.brand-block__logo-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.brand-block__name {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.01em;
}

.catalog-dropdown {
    position: relative;
}

.catalog-toggle,
.history-link,
.cart-chip {
    height: 42px;
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    background: #fff;
}

.catalog-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    color: var(--portal-text);
    font-weight: 500;
    font-size: 14px;
}

.catalog-toggle--mobile {
    width: 100%;
    justify-content: center;
}

.catalog-toggle__icon,
.cart-chip__icon,
.search-shell__icon {
    position: relative;
    display: inline-block;
    flex: 0 0 auto;
}

.catalog-toggle__icon {
    width: 18px;
    height: 12px;
}

.catalog-toggle__icon::before,
.catalog-toggle__icon::after,
.catalog-toggle__icon span {
    content: "";
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.catalog-toggle__icon::before {
    top: 0;
}

.catalog-toggle__icon::after {
    bottom: 0;
}

.catalog-toggle__icon {
    background: linear-gradient(currentColor, currentColor) center/18px 2px no-repeat;
}

.catalog-menu {
    position: absolute;
    top: calc(100% + 14px);
    left: 0;
    z-index: 60;
    width: 390px;
    max-width: calc(100vw - 32px);
    padding: 10px;
    border: 1px solid var(--portal-border);
    border-radius: 24px;
    background: var(--portal-surface);
    box-shadow: var(--shadow-strong);
}

.catalog-menu__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    color: var(--portal-text);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.catalog-menu__item:hover,
.catalog-menu__item.is-active {
    color: var(--portal-blue);
    background: rgba(0, 0, 0, 0.06);
}

.catalog-menu__arrow {
    font-size: 1.1rem;
}

.catalog-menu__meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.catalog-menu__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
    color: var(--portal-blue);
    font-size: 12px;
    font-weight: 500;
}

.history-link {
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    color: var(--portal-muted);
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
}

.header-side {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    min-width: 170px;
    color: var(--portal-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.cart-chip.is-active {
    border-color: rgba(0, 0, 0, 0.24);
    background: rgba(0, 0, 0, 0.04);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.cart-chip__icon {
    width: 22px;
    height: 18px;
    border: 2px solid var(--portal-text);
    border-radius: 4px;
}

.cart-chip__icon::before {
    content: "";
    position: absolute;
    left: 2px;
    top: -7px;
    width: 14px;
    height: 9px;
    border: 2px solid var(--portal-text);
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
}

.cart-chip__content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
}

.cart-chip__amount {
    font-size: 0.84rem;
    font-weight: 500;
}

.cart-chip__count {
    color: var(--portal-muted);
    font-size: 0.72rem;
}

.search-shell {
    position: relative;
    display: flex;
    align-items: center;
    flex: 0 1 520px;
    min-width: 220px;
    min-height: 44px;
    padding: 0 16px 0 46px;
    border: 1px solid var(--portal-border);
    border-radius: 14px;
    background: #fff;
}

.client-chip {
    display: flex;
    flex: 0 1 240px;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    padding: 0 4px;
}

.client-chip__label {
    color: var(--portal-muted);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.client-chip__name {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
}

.search-shell__icon {
    position: absolute;
    left: 16px;
    width: 18px;
    height: 18px;
    border: 2px solid var(--portal-muted);
    border-radius: 999px;
}

.search-shell__icon::after {
    content: "";
    position: absolute;
    right: -4px;
    bottom: -5px;
    width: 9px;
    height: 2px;
    background: var(--portal-muted);
    transform: rotate(45deg);
    border-radius: 999px;
}

.search-shell__input {
    width: 100%;
    border: 0;
    outline: none;
    font-size: 14px;
    color: var(--portal-text);
    background: transparent;
}

.offer-main,
.simple-page {
    max-width: 1440px;
    margin: 0 auto;
    padding: 22px 24px 40px;
}

.offer-intro__eyebrow,
.checkout-card__eyebrow {
    margin-bottom: 8px;
    color: var(--portal-blue);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.offer-intro__title,
.simple-card__title {
    margin: 0;
    font-size: 32px;
    font-weight: 600;
    line-height: 1.1;
}

.offer-intro__text,
.simple-card__text {
    margin: 10px 0 0;
    max-width: 700px;
    color: var(--portal-muted);
    font-size: 1rem;
}

.offer-intro__meta,
.simple-card__meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.offer-intro__stat,
.simple-card__meta span {
    padding: 12px 16px;
    border: 1px solid var(--portal-border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.75);
}

.offer-intro__stat {
    min-width: 140px;
}

.offer-intro__stat-label {
    display: block;
    margin-bottom: 4px;
    color: var(--portal-muted);
    font-size: 0.8rem;
}

.offer-intro__stat-value {
    font-weight: 700;
}

.offer-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 16px;
    align-items: start;
}

.hero-banner {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid var(--portal-border);
    border-radius: 26px;
    background: linear-gradient(135deg, #0b0b0b, #1b1b1b 58%, #151515);
    color: #fff;
    box-shadow: var(--shadow-soft);
}

.hero-banner__media {
    min-height: 136px;
    overflow: hidden;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
}

.hero-banner__media-link {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-banner__media img,
.hero-banner__fallback {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.hero-banner__fallback {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
        linear-gradient(135deg, #242424, #101010);
}

.hero-banner__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 4px 8px 4px 0;
}

.hero-banner__title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.2;
}

.hero-banner__text {
    margin: 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: 15px;
    line-height: 1.5;
}

.catalog-panel,
.checkout-card,
.history-card,
.simple-card {
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius);
    background: var(--portal-surface);
    box-shadow: var(--shadow-soft);
}

.catalog-panel,
.history-card,
.simple-card {
    padding: 18px;
}

.catalog-panel__toolbar,
.history-card__header,
.checkout-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.catalog-panel__caption,
.catalog-panel__result {
    font-size: 0.86rem;
}

.catalog-panel__result {
    color: var(--portal-muted);
}

.catalog-groups {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 12px;
}

.catalog-group__header {
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--portal-border);
}

.catalog-group__header h2 {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 500;
}

.product-table-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px 140px 132px;
    gap: 12px;
    padding: 6px 10px 8px;
    color: var(--portal-muted);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    position: sticky;
    top: 84px;
    z-index: 4;
    background: var(--portal-surface);
    border-bottom: 1px solid var(--portal-border);
}

.product-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px 140px 132px;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--portal-border);
    border-radius: 14px;
    background: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.product-row:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 0, 0, 0.14);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.05);
}

.product-row__main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.product-thumb {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    overflow: hidden;
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.03));
    color: var(--portal-blue);
}

.product-thumb__button {
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.product-thumb__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-viewer {
    position: fixed;
    inset: 0;
    z-index: 90;
}

.image-viewer__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(8, 8, 8, 0.78);
}

.image-viewer__dialog {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(92vw, 980px);
    height: min(88vh, 820px);
    margin: min(6vh, 44px) auto;
    padding: 20px;
}

.image-viewer__image {
    max-width: 100%;
    max-height: 100%;
    border-radius: 22px;
    background: #fff;
    box-shadow: var(--shadow-strong);
    object-fit: contain;
}

.image-viewer__close {
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #111;
    font-size: 26px;
    line-height: 1;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.16);
}

body.has-image-viewer {
    overflow: hidden;
}

.product-thumb__placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: rgba(0, 0, 0, 0.5);
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 65%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.08));
}

.product-thumb__placeholder-icon {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.product-row__content {
    min-width: 0;
}

.product-row__name {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
}

.product-row__description {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-row__meta,
.product-row__unit,
.checkout-line__meta,
.checkout-empty,
.offer-alert {
    color: var(--portal-muted);
}

.product-row__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-row__meta-separator {
    flex: 0 0 auto;
    opacity: 0.6;
}

.product-row__stock {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--portal-muted);
}

.product-row__stock-label {
    display: none;
    line-height: 1.2;
}

.stock-meter {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 32px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(228, 228, 223, 0.98));
    border: 1px solid rgba(0, 0, 0, 0.14);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.82),
        0 8px 18px rgba(0, 0, 0, 0.06);
}

.stock-meter::after {
    content: attr(data-stock-label);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    bottom: auto;
    transform: translateY(-50%) translateX(-6px);
    padding: 7px 10px;
    border-radius: 10px;
    background: rgba(22, 22, 22, 0.94);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(8px);
    z-index: 8;
}

.stock-meter:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.stock-meter__bars {
    display: inline-flex;
    align-items: flex-end;
    gap: 4px;
    height: 12px;
}

.stock-meter__bar {
    height: 12px;
    width: 9px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.16);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 rgba(0, 0, 0, 0.06);
}

.stock-meter--high .stock-meter__bar {
    background: linear-gradient(180deg, #b9ccb6, #93ab8f);
}

.stock-meter--medium .stock-meter__bar:nth-child(1),
.stock-meter--medium .stock-meter__bar:nth-child(2) {
    background: linear-gradient(180deg, #d4c9bb, #b9aa97);
}

.stock-meter--low .stock-meter__bar:nth-child(1) {
    background: linear-gradient(180deg, #dac5bb, #bfa296);
}

.stock-meter--out .stock-meter__bar {
    background: rgba(0, 0, 0, 0.09);
}

.product-row__price {
    text-align: left;
}

.product-row__amount {
    font-size: 14px;
    font-weight: 500;
}

.qty-control__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--portal-border);
    border-radius: 10px;
    background: #fff;
    color: var(--portal-text);
    padding: 0;
    line-height: 1;
    touch-action: manipulation;
}

.qty-control__btn--primary {
    border-color: var(--portal-blue);
    background: var(--portal-blue);
    color: #fff;
}

.qty-control__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    transform: translateY(-1px);
}

.qty-control__btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.qty-control__group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px;
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    background: #fff;
}

.qty-control__input {
    width: 48px;
    min-width: 48px;
    height: 32px;
    padding: 0 4px;
    border: 0;
    background: transparent;
    color: var(--portal-text);
    text-align: center;
    font-weight: 500;
    font-size: 13px;
    outline: none;
    -moz-appearance: textfield;
}

.qty-control__input::-webkit-outer-spin-button,
.qty-control__input::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.product-row.is-focused {
    border-color: rgba(0, 0, 0, 0.24);
    box-shadow:
        0 0 0 3px rgba(0, 0, 0, 0.06),
        0 18px 36px rgba(0, 0, 0, 0.08);
}

.checkout-line__main {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
}

.checkout-line__main:hover .checkout-line__name {
    color: var(--portal-blue);
}

.catalog-empty {
    padding: 48px 24px;
    border: 1px dashed var(--portal-border);
    border-radius: 20px;
    text-align: center;
}

.catalog-empty__title {
    font-size: 1.1rem;
    font-weight: 700;
}

.catalog-empty__text {
    margin-top: 6px;
    color: var(--portal-muted);
}

.checkout-panel {
    position: sticky;
    top: 128px;
}

.checkout-card {
    padding: 16px;
}

.checkout-card__title {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 500;
}

.checkout-card__summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
}

.checkout-card__summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    border: 0;
    background: transparent;
}

.checkout-card__summary-item span {
    display: block;
    margin-bottom: 4px;
    color: var(--portal-muted);
    font-size: 0.76rem;
}

.checkout-card__summary-item strong {
    font-size: 0.84rem;
    font-weight: 500;
}

.checkout-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 40px;
    margin-bottom: 12px;
}

.checkout-empty {
    padding: 14px;
    border: 1px dashed var(--portal-border);
    border-radius: 16px;
    font-size: 0.78rem;
}

.checkout-line {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 12px;
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    background: #fff;
}

.checkout-line__side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.checkout-line__name {
    font-weight: 500;
    font-size: 0.84rem;
}

.checkout-line__meta {
    margin-top: 4px;
    font-size: 0.72rem;
}

.checkout-line__amount {
    font-weight: 500;
    font-size: 0.82rem;
    white-space: nowrap;
}

.checkout-line__remove {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--portal-muted);
    font-size: 11px;
}

.checkout-card__label {
    font-weight: 500;
    font-size: 12px;
}

.checkout-card__textarea {
    border-color: var(--portal-border);
    border-radius: 16px;
    resize: vertical;
}

.checkout-card__pending {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.04);
    color: var(--portal-text);
    font-size: 13px;
    font-weight: 500;
}

.checkout-card__pending-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-top-color: var(--portal-blue);
    border-radius: 999px;
    animation: checkout-spin 0.8s linear infinite;
}

.checkout-card__submit,
.simple-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 18px;
    border: 1px solid var(--portal-border);
    border-radius: 16px;
    background: #fff;
    color: var(--portal-text);
    font-weight: 500;
}

.checkout-card__submit {
    width: 100%;
    margin-top: 12px;
    border-color: var(--portal-blue);
    background: var(--portal-blue);
    color: #fff;
}

.offer-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 80;
    max-width: 320px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(11, 23, 54, 0.94);
    color: #fff;
    font-size: 14px;
    box-shadow: var(--shadow-strong);
}

.checkout-card__submit:disabled {
    opacity: 0.55;
}

.checkout-card.is-submitting .checkout-card__submit {
    cursor: progress;
}

.checkout-card.is-submitting .checkout-card__textarea,
.checkout-card.is-submitting .checkout-line__remove,
.checkout-card.is-submitting .checkout-line__main {
    pointer-events: none;
}

.simple-btn--primary {
    border-color: var(--portal-blue);
    background: var(--portal-blue);
    color: #fff;
}

.simple-page {
    display: flex;
    justify-content: center;
}

.simple-card {
    max-width: 760px;
    text-align: center;
}

.admin-page {
    width: 100%;
}

.admin-card {
    width: min(100%, 1440px);
    text-align: left;
}

.admin-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.admin-login-card {
    width: min(100%, 460px);
}

.admin-settings-card {
    padding: 24px;
}

.admin-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 6px;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.03);
}

.admin-tabs__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--portal-border);
    border-radius: 14px;
    background: #fff;
    color: var(--portal-muted);
    font-size: 14px;
    font-weight: 500;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.admin-tabs__item:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 0, 0, 0.18);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.06);
}

.admin-tabs__item.is-active {
    border-color: var(--portal-blue);
    background: linear-gradient(180deg, #161616, #050505);
    color: #fff;
    box-shadow: 0 14px 26px rgba(0, 0, 0, 0.14);
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-form--stack {
    gap: 18px;
}

.admin-form__label {
    font-size: 13px;
    font-weight: 500;
}

.admin-form__input,
.admin-form__textarea {
    width: 100%;
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid var(--portal-border);
    border-radius: 16px;
    background: #fff;
    color: var(--portal-text);
    outline: none;
}

.admin-form__textarea {
    min-height: 120px;
    padding: 14px 16px;
    resize: vertical;
}

.admin-form__input:focus,
.admin-form__textarea:focus {
    border-color: rgba(0, 0, 0, 0.34);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.06);
}

.admin-form__input--file {
    min-height: 54px;
    padding: 12px 16px;
}

.admin-form__check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.admin-form__check--card {
    width: 100%;
    align-items: flex-start;
    padding: 14px 16px;
    border: 1px solid var(--portal-border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
}

.admin-form__check--card input {
    margin-top: 3px;
}

.admin-form__check--card span {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.admin-form__check--card strong {
    font-size: 14px;
    font-weight: 600;
}

.admin-form__check--card small {
    color: var(--portal-muted);
    font-size: 12px;
    line-height: 1.35;
}

.admin-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    white-space: nowrap;
}

.admin-form__message {
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 14px;
}

.admin-form__message--error {
    background: rgba(163, 32, 32, 0.08);
    color: #a32020;
}

.admin-form__message--success {
    background: rgba(27, 94, 32, 0.1);
    color: #1b5e20;
}

.admin-form__hint,
.admin-section__hint {
    margin: 0;
    color: var(--portal-muted);
    font-size: 13px;
}

.admin-form__submit {
    width: 100%;
}

.admin-section {
    padding: 18px;
    border: 1px solid var(--portal-border);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.78);
}

.admin-section__title {
    margin: 0 0 14px;
    font-size: 17px;
    font-weight: 600;
}

.admin-section__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.admin-toggle-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.admin-search {
    width: min(320px, 100%);
}

.admin-form__input--compact {
    min-height: 42px;
    padding: 0 12px;
    border-radius: 12px;
}

.admin-table-wrap {
    overflow-x: visible;
}

.admin-table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
}

.admin-table th,
.admin-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--portal-border);
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f7f7f5;
    color: var(--portal-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-table td {
    font-size: 14px;
}

.admin-table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.015);
}

.admin-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.03);
}

.admin-table__primary {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}

.admin-table__secondary {
    margin-top: 4px;
    color: var(--portal-muted);
    font-size: 12px;
    line-height: 1.35;
}

.admin-table__mono {
    font-family: Consolas, "Courier New", monospace;
}

.admin-table__token {
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    word-break: break-all;
}

.admin-table select.admin-form__input {
    min-width: 260px;
}

.admin-table--clients th:first-child,
.admin-table--clients td:first-child,
.admin-table--links th:first-child,
.admin-table--links td:first-child {
    width: 24%;
}

.admin-table--clients th:nth-child(2),
.admin-table--clients td:nth-child(2) {
    width: 76%;
}

.admin-table--links th:nth-child(2),
.admin-table--links td:nth-child(2),
.admin-table--links th:nth-child(3),
.admin-table--links td:nth-child(3) {
    width: 35%;
}

.admin-table__token-line {
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.03);
}

.admin-table__token-line strong {
    display: block;
    margin-bottom: 4px;
    color: var(--portal-text);
}

.admin-hero-preview {
    margin-top: 8px;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid var(--portal-border);
    background: #111;
}

.admin-hero-preview img {
    width: 100%;
    max-height: 260px;
    display: block;
    object-fit: cover;
}

.token-entry-page {
    min-height: 100vh;
    align-items: center;
}

.token-entry-card {
    width: min(100%, 560px);
    text-align: left;
    padding: 28px;
}

.token-entry-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.token-entry-card__header .brand-block {
    min-width: 0;
}

.token-entry-card__manager {
    margin: 12px 0 0;
}

.token-entry-card__manager-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--portal-text);
    font-size: 14px;
    font-weight: 500;
}

.token-entry-card__manager-link svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: block;
    fill: currentColor;
}

.token-entry-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.token-entry-form__input {
    min-height: 54px;
    padding: 0 18px;
    border: 1px solid var(--portal-border);
    border-radius: 16px;
    background: #fff;
    color: var(--portal-text);
    font-size: 15px;
    outline: none;
}

.token-entry-form__input:focus {
    border-color: rgba(0, 0, 0, 0.34);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.06);
}

.token-entry-form__error {
    color: #a32020;
    font-size: 13px;
}

.token-entry-form__submit {
    width: 100%;
    margin-top: 4px;
}

.success-mark {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    border-radius: 22px;
    background: rgba(15, 157, 88, 0.12);
    color: var(--portal-success);
    font-size: 2rem;
    font-weight: 800;
}

.simple-card__actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.history-page {
    width: 100%;
}

.history-shell {
    width: min(100%, 1440px);
}

.history-card--wide {
    padding: 20px;
}

.history-card__header--stack {
    align-items: flex-start;
    margin-bottom: 16px;
}

.history-hero {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-hero__meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.history-stat {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    min-width: 148px;
    padding: 12px 14px;
    border: 1px solid var(--portal-border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
}

.history-stat__label {
    color: var(--portal-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.history-stat__value {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.history-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-table-head {
    display: grid;
    gap: 12px;
    padding: 6px 10px 8px;
    color: var(--portal-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    position: sticky;
    top: 84px;
    z-index: 4;
    background: var(--portal-surface);
    border-bottom: 1px solid var(--portal-border);
}

.history-table-head--orders {
    grid-template-columns: 168px minmax(0, 1.15fr) 138px 138px 138px 120px;
}

.history-table-head--detail {
    grid-template-columns: 170px minmax(0, 1.3fr) 100px 132px 132px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-row {
    display: grid;
    grid-template-columns: 168px minmax(0, 1.15fr) 138px 138px 138px 120px;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--portal-border);
    border-radius: 16px;
    background: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.history-row--detail {
    grid-template-columns: 170px minmax(0, 1.3fr) 100px 132px 132px;
}

.history-row:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 0, 0, 0.14);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.05);
}

.history-row__main,
.history-row__meta-block,
.history-row__action {
    min-width: 0;
}

.history-row__action {
    display: flex;
    justify-content: flex-end;
}

.history-row__label {
    display: none;
    margin-bottom: 4px;
    color: var(--portal-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.history-row__value {
    font-size: 13px;
    line-height: 1.35;
    color: var(--portal-text);
}

.history-row__value--strong {
    font-weight: 600;
}

.history-row__value--mono {
    font-family: Consolas, "Courier New", monospace;
}

.history-table__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    background: #fff;
    color: var(--portal-text);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.history-empty {
    margin-top: 8px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 500;
}

.status-pill--new {
    color: var(--portal-blue);
    background: rgba(0, 0, 0, 0.08);
}

.status-pill--sent {
    color: var(--portal-success);
    background: rgba(15, 157, 88, 0.12);
}

.status-pill--inactive {
    color: var(--portal-muted);
    background: rgba(0, 0, 0, 0.06);
}

@keyframes checkout-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 1199.98px) {
    .offer-layout {
        grid-template-columns: 1fr;
    }

    .checkout-panel {
        position: static;
    }
}

@media (max-width: 991.98px) {
    .offer-header__inner,
    .offer-main,
    .simple-page {
        padding-left: 16px;
        padding-right: 16px;
    }

    .offer-header__row--main {
        min-height: auto;
        padding: 12px 0;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px;
    }

    .brand-block,
    .search-shell {
        min-width: 0;
    }

    .brand-block {
        flex: 1 1 auto;
        min-width: 0;
    }

    .catalog-dropdown {
        margin-left: auto;
        order: 2;
    }

    .search-shell {
        order: 10;
        width: 100%;
        flex: 1 1 100%;
    }

    .history-link {
        order: 3;
    }

    .client-chip {
        order: 4;
        flex: 0 1 220px;
        min-width: 0;
        margin-left: auto;
        align-items: flex-end;
        text-align: right;
    }

    .header-side {
        order: 5;
        margin-left: 0;
    }

    .catalog-menu {
        left: auto;
        right: 0;
        width: min(390px, calc(100vw - 32px));
        max-height: min(70vh, 520px);
        overflow-y: auto;
    }

    .hero-banner {
        grid-template-columns: 1fr;
    }

    .product-table-head {
        display: none;
    }

    .product-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "main main"
            "stock price"
            "qty qty";
        row-gap: 10px;
        padding: 12px;
        align-items: start;
    }

    .product-row__main {
        grid-area: main;
    }

    .product-row__stock {
        grid-area: stock;
        align-self: center;
    }

    .product-row__price {
        grid-area: price;
        text-align: right;
        align-self: center;
    }

    .qty-control {
        grid-area: qty;
        display: flex;
        justify-content: flex-end;
    }

    .history-table-head {
        display: none;
    }

    .history-row,
    .history-row--detail {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .history-row__action {
        justify-content: flex-start;
    }

    .history-row__label {
        display: block;
    }
}

@media (max-width: 767.98px) {
    .offer-main,
    .simple-page {
        padding-top: 20px;
        padding-bottom: 32px;
    }

    .catalog-panel,
    .checkout-card,
    .history-card,
    .simple-card {
        padding: 16px;
        border-radius: 20px;
    }

    .token-entry-card {
        padding: 22px 18px;
    }

    .token-entry-card__header {
        gap: 12px;
    }


    .cart-chip {
        min-width: 0;
        flex: 1 1 auto;
    }

    .catalog-dropdown {
        width: auto;
    }

    .catalog-toggle {
        min-width: 0;
        padding: 0 12px;
    }

    .catalog-menu {
        width: min(360px, calc(100vw - 32px));
    }

    .history-link,
    .catalog-toggle {
        font-size: 14px;
    }

    .brand-block {
        gap: 10px;
        min-width: 0;
    }

    .brand-block__logo {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }

    .brand-block__name {
        font-size: 0.82rem;
    }

    .client-chip__name {
        font-size: 0.82rem;
    }

    .history-link {
        height: 38px;
        padding: 0 12px;
    }

    .search-shell__input {
        font-size: 16px;
    }

    .cart-chip {
        height: 38px;
        padding: 0 12px;
    }

    .cart-chip__content {
        min-width: 0;
    }

    .cart-chip__amount,
    .cart-chip__count {
        white-space: nowrap;
    }

    .catalog-group__header h2 {
        font-size: 0.84rem;
    }

    .hero-banner {
        padding: 14px;
        border-radius: 22px;
    }

    .hero-banner__media {
        min-height: 120px;
    }

    .hero-banner__media img {
        object-fit: contain;
        background: rgba(0, 0, 0, 0.28);
    }

    .hero-banner__title {
        font-size: 18px;
    }

    .hero-banner__text {
        font-size: 14px;
    }

    .product-row {
        gap: 8px 12px;
        padding: 12px 10px;
    }

    .product-row__main {
        align-items: flex-start;
    }

    .product-thumb {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
        border-radius: 9px;
    }

    .product-thumb__placeholder-icon {
        width: 18px;
        height: 18px;
    }

    .product-row__content {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .product-row__name {
        line-height: 1.3;
    }

    .product-row__meta {
        margin-top: 0;
        flex-wrap: wrap;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .product-row__description {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }

    .product-row__stock,
    .product-row__amount {
        font-size: 13px;
    }

    .product-row__stock {
        justify-content: flex-start;
    }

    .product-row__stock-label {
        display: inline;
        font-size: 12px;
        font-weight: 500;
        color: var(--portal-text);
    }

    .qty-control {
        justify-content: stretch;
        width: 100%;
    }

    .qty-control__btn--primary,
    .qty-control__group {
        margin-left: auto;
    }

    .qty-control__group {
        gap: 4px;
    }

    .qty-control__btn,
    .qty-control__input {
        height: 36px;
    }

    .qty-control__btn {
        min-width: 36px;
    }

    .history-card--wide {
        padding: 16px;
    }

    .history-card__header--stack {
        flex-direction: column;
        align-items: stretch;
    }

    .history-hero__meta {
        gap: 10px;
    }

    .history-stat {
        min-width: 0;
        flex: 1 1 160px;
    }

    .history-row,
    .history-row--detail {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 14px 12px;
    }

    .history-row__action,
    .history-table__link {
        width: 100%;
    }

    .history-table__link {
        min-height: 42px;
    }

    .admin-card__header,
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .admin-card__header {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-settings-card {
        padding: 18px;
    }

    .admin-toggle-list {
        grid-template-columns: 1fr;
    }

    .admin-search {
        width: 100%;
    }

    .admin-table-wrap {
        overflow-x: auto;
    }

    .admin-table {
        min-width: 620px;
    }
}

@media (max-width: 767.98px) {
    .admin-table-wrap {
        overflow: visible;
    }

    .admin-table {
        min-width: 0;
        border-collapse: separate;
        border-spacing: 0;
        background: transparent;
    }

    .admin-table thead {
        display: none;
    }

    .admin-table tbody {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .admin-table tr {
        display: block;
        padding: 14px;
        border: 1px solid var(--portal-border);
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.04);
    }

    .admin-table td {
        display: grid;
        grid-template-columns: 112px minmax(0, 1fr);
        gap: 10px;
        padding: 8px 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        align-items: start;
    }

    .admin-table td:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

    .admin-table td::before {
        content: attr(data-label);
        color: var(--portal-muted);
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .admin-table__primary,
    .admin-table__secondary,
    .admin-table__token,
    .admin-table__mono {
        min-width: 0;
    }

    .admin-table__token {
        max-width: none;
    }

    .admin-form__input--compact {
        min-height: 40px;
    }

    .admin-table select.admin-form__input {
        min-width: 0;
    }

    .admin-switch {
        justify-content: flex-start;
    }
}

@media (max-width: 575.98px) {
    .offer-header__row--main {
        gap: 10px;
    }

    .brand-block {
        order: 1;
        flex: 1 1 auto;
        min-width: 0;
    }

    .catalog-dropdown {
        order: 3;
        flex: 0 0 auto;
    }

    .client-chip {
        order: 2;
        flex: 0 1 46%;
        min-width: 0;
        margin-left: auto;
        padding: 0;
        align-items: flex-end;
        text-align: right;
    }

    .catalog-toggle {
        height: 38px;
        border-radius: 10px;
    }

    .catalog-menu {
        position: fixed;
        top: 72px;
        left: 16px;
        right: 16px;
        width: auto;
        max-width: none;
        border-radius: 18px;
    }

    .history-link {
        order: 4;
        flex: 1 1 auto;
        justify-content: center;
    }

    .header-side {
        order: 5;
        flex: 1 1 auto;
        margin-left: 0;
    }

    .cart-chip {
        width: 100%;
        justify-content: center;
    }

    .product-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "main main"
            "stock price"
            "qty qty";
    }

    .product-row__price {
        text-align: right;
    }

    .product-row__stock {
        gap: 8px;
        min-width: 0;
    }

    .stock-meter {
        width: 54px;
        height: 30px;
        border-radius: 12px;
    }

    .stock-meter__bars {
        gap: 3px;
    }

    .stock-meter__bar {
        width: 8px;
    }

    .qty-control {
        justify-content: flex-end;
    }

    .qty-control__btn--primary,
    .qty-control__group {
        margin-left: auto;
    }

    .qty-control__group {
        width: 100%;
        justify-content: space-between;
    }

    .qty-control__input {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 16px;
    }
}
