html {
    color-scheme: dark;
}

:root {
    --lotus-bg: #080808;
    --lotus-surface: #111111;
    --lotus-surface-2: #1a1a1a;
    --lotus-border: #2a2a2a;
    --lotus-text: #e8e8e8;
    --lotus-muted: #888888;
    --lotus-silver: #c9c9c9;
    --lotus-gold: #c9a962;
    --lotus-gold-dim: rgba(201, 169, 98, 0.15);
    --lotus-accent: #d4b978;
    --radius: 10px;
    --font: 'Inter', system-ui, -apple-system, 'Microsoft YaHei', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background: var(--lotus-bg);
    color: var(--lotus-text);
    height: 100vh;
    padding: 16px 0 24px;
    font-size: 13px;
    overflow: hidden;
}

.app-wrapper {
    max-width: 1440px;
    margin: 0 auto;
    height: calc(100vh - 40px);
    background: var(--lotus-surface);
    border: 1px solid var(--lotus-border);
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header — Logo + 字标，无独立底框 */
.header {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: minmax(88px, 1fr) auto minmax(88px, 1fr);
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: #000;
    border-bottom: 1px solid var(--lotus-border);
}

.header-extra {
    font-size: 11px;
    font-weight: 500;
    color: var(--lotus-muted);
    white-space: nowrap;
}

#available-cards {
    justify-self: end;
    text-align: right;
    color: var(--lotus-silver);
}

.brand-lockup {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.brand-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.brand-lotus {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: block;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.5));
}

.brand-title,
.header h1 {
    font-size: clamp(18px, 2.6vw, 24px);
    font-weight: 700;
    letter-spacing: 0.22em;
    color: #fff;
    margin: 0;
    line-height: 1;
    text-transform: uppercase;
}

.brand-tagline {
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.18em;
    color: rgba(255, 255, 255, 0.88);
    margin: 0;
    text-transform: uppercase;
}

.brand-values {
    font-size: 8px;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--lotus-gold);
    margin: 0;
    text-transform: uppercase;
}

.stat-pill,
.header .user-info {
    font-size: 11px;
    font-weight: 500;
    color: var(--lotus-silver);
}

.lang-btn,
.language-switch button,
#lang-btn {
    justify-self: start;
    background: transparent;
    color: var(--lotus-gold);
    border: 1px solid rgba(201, 169, 98, 0.35);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.lang-btn:hover,
.language-switch button:hover {
    background: var(--lotus-gold-dim);
    border-color: var(--lotus-gold);
}

/* 库存页顶栏 */
.header--inventory {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 16px;
    grid-template-columns: unset;
}

.nav-home {
    font-size: 12px;
    font-weight: 600;
    color: var(--lotus-gold);
    text-decoration: none;
    letter-spacing: 0.06em;
}

.nav-home:hover { color: #fff; }

.inv-stat {
    flex: 1;
    text-align: center;
    font-size: 11px;
    color: var(--lotus-silver);
}

.lang-switch {
    display: flex;
    gap: 6px;
}

.lang-switch__btn {
    padding: 5px 10px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--lotus-border);
    background: transparent;
    color: #888;
    cursor: pointer;
}

.lang-switch__btn.is-active {
    border-color: var(--lotus-gold);
    color: var(--lotus-gold);
    background: var(--lotus-gold-dim);
}

.lang-switch__btn:hover {
    border-color: var(--lotus-gold);
    color: #fff;
}

/* Notice */
.notice-bar {
    background: linear-gradient(90deg, var(--lotus-gold-dim), transparent);
    border-bottom: 1px solid var(--lotus-border);
    padding: 8px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.notice-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notice-icon {
    color: var(--lotus-gold);
    font-size: 14px;
}

.notice-text {
    color: var(--lotus-silver);
    font-size: 12px;
}

.notice-close {
    background: none;
    border: none;
    color: var(--lotus-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.notice-close:hover {
    color: #fff;
}

/* Layout */
.container {
    flex: 1;
    display: flex;
    min-height: 0;
    overflow: hidden;
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
    padding: 20px;
    border-right: 1px solid var(--lotus-border);
    background: var(--lotus-bg);
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
}

.filter-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.sidebar h2 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--lotus-gold);
    margin-bottom: 16px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 12px;
}

.form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.form-group-half {
    flex: 1;
}

.form-group label,
.form-group-half label {
    display: block;
    font-size: 11px;
    color: var(--lotus-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.form-group input,
.form-group select,
.form-group-half input,
.form-group-half select {
    width: 100%;
    padding: 8px 10px;
    background: var(--lotus-surface-2);
    border: 1px solid var(--lotus-border);
    border-radius: var(--radius);
    color: var(--lotus-text);
    font-size: 12px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group-half input:focus,
.form-group-half select:focus {
    outline: none;
    border-color: var(--lotus-gold);
    box-shadow: 0 0 0 2px var(--lotus-gold-dim);
}

.form-actions {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 8px;
    margin: 4px 0 12px;
}

.btn-reset {
    padding: 10px;
    background: transparent;
    color: var(--lotus-silver);
    border: 1px solid var(--lotus-border);
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: border-color 0.2s, color 0.2s;
}

.btn-reset:hover {
    border-color: var(--lotus-silver);
    color: #fff;
}

.btn-search {
    width: 100%;
    padding: 10px;
    margin: 0;
    background: linear-gradient(135deg, #d4b978, #a8863e);
    color: #0a0a0a;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: filter 0.2s, transform 0.1s;
}

.btn-search:hover {
    filter: brightness(1.08);
}

.btn-search:active {
    transform: scale(0.99);
}

/* Support card */
.user-profile {
    margin-top: auto;
    padding: 14px;
    background: var(--lotus-surface);
    border: 1px solid var(--lotus-border);
    border-radius: var(--radius);
    display: flex;
    gap: 12px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.user-profile::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--lotus-gold-dim), transparent);
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
}

.user-profile:hover {
    border-color: var(--lotus-gold);
    box-shadow: 0 0 20px rgba(201, 169, 98, 0.12);
}

.user-profile:hover::before {
    opacity: 1;
}

.user-profile.compact {
    flex-direction: row;
    padding: 10px;
}

.user-profile.mini-ball {
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 50%;
    margin: 8px auto 0;
    justify-content: center;
    align-items: center;
}

.user-profile.mini-ball .user-info {
    display: none;
}

.user-profile.mini-ball .avatar {
    width: 40px;
    height: 40px;
    margin: 0;
}

.user-profile.mini-ball:hover {
    transform: scale(1.05);
}

.user-profile.mini-ball.expanded {
    width: auto;
    height: auto;
    border-radius: var(--radius);
    padding: 14px;
    margin: 8px 0 0;
}

.user-profile.mini-ball.expanded .user-info {
    display: block;
}

.user-profile.mini-ball.expanded .avatar {
    width: 44px;
    height: 44px;
}

.avatar {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.45);
    background: #000;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 2px;
    background: radial-gradient(circle at 50% 35%, rgba(212, 175, 55, 0.35), #000 65%);
    box-sizing: border-box;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.6));
}

.username {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.06em;
}

.user-desc {
    font-size: 11px;
    color: var(--lotus-muted);
    margin-top: 2px;
}

.user-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--lotus-gold);
    margin-top: 6px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 6px #4ade80;
}

/* Main */
.main-content {
    flex: 1;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.table-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--lotus-silver);
    white-space: pre;
}

.table-header .result-bin {
    color: var(--lotus-gold);
    font-weight: 600;
}

.record-count {
    font-size: 12px;
    color: var(--lotus-muted);
    background: var(--lotus-surface-2);
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid var(--lotus-border);
}

.table-container {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--lotus-bg);
    border: 1px solid var(--lotus-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.table-header-wrapper {
    flex-shrink: 0;
    border-bottom: 1px solid var(--lotus-border);
    overflow: hidden;
    /* 滚动条上方空隙也铺表头底色，避免右侧空洞 */
    background: var(--lotus-surface-2);
}

.table-body-wrapper {
    flex: 1;
    /* VirtualScroll 自带内部滚动，外层不再滚动，避免双滚动条错位 */
    overflow: hidden;
    min-height: 0;
}

/* 表头/表体共用同一套列宽，保证对齐 */
.table-row {
    --table-cols: minmax(96px, 9%) 8% 8% 9% 10% 12% 23% 6% 15%;
    display: grid;
    grid-template-columns: var(--table-cols);
    width: 100%;
    box-sizing: border-box;
    align-items: stretch;
}

.table-row--head {
    flex-shrink: 0;
    background: var(--lotus-surface-2);
    box-sizing: border-box;
}

.table-row--body {
    min-height: 40px;
    border-bottom: 1px solid var(--lotus-border);
    width: 100%;
    box-sizing: border-box;
}

.table-row--body:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.table-row--body:hover,
.table-row--body.is-selected {
    background: rgba(201, 169, 98, 0.08);
}

.table-cell {
    display: flex;
    align-items: center;
    padding: 8px;
    font-family: 'Inter', system-ui, -apple-system, 'Microsoft YaHei', sans-serif;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: normal;
    line-height: 1.4;
    color: #c8c8c8;
    word-break: break-word;
    overflow: hidden;
    min-width: 0;
}

.table-row--head .table-cell {
    padding: 10px 8px;
    font-weight: 500;
    color: var(--lotus-gold);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* BIN 略亮并加粗；价格加粗；类型/品牌与其它列同为浅灰 */
.table-cell:nth-child(1) {
    color: #f0e6c8;
    font-weight: 700;
    white-space: nowrap;
    overflow: visible;
}
.table-cell:nth-child(8) {
    font-weight: 700;
}
.table-cell:nth-child(4),
.table-cell:nth-child(5) { color: #c8c8c8; }

/* Country / Price / Updated 居中 */
.table-cell:nth-child(3),
.table-cell:nth-child(8),
.table-cell:nth-child(9) {
    justify-content: center;
    text-align: center;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed;
}

.data-table th {
    background: var(--lotus-surface-2);
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    color: var(--lotus-silver);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--lotus-border);
}

.data-table td {
    padding: 8px;
    border-bottom: 1px solid var(--lotus-border);
    color: var(--lotus-text);
    line-height: 1.4;
    vertical-align: top;
    word-break: break-word;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 200px;
    padding: 32px 20px;
    text-align: center;
}

.empty-state__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--lotus-silver);
}

.empty-state__hint {
    font-size: 12px;
    color: var(--lotus-muted);
    max-width: 280px;
    line-height: 1.5;
}

.form-group select option {
    background: var(--lotus-surface-2);
    color: var(--lotus-text);
}

.notice-bar.is-hidden {
    display: none;
}

.record-count #record_count {
    color: var(--lotus-gold);
    font-weight: 600;
}

.bank-cell {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-debit { color: #7dd3fc; }
.status-credit { color: #fbbf24; }

.schema-visa { color: #a5b4fc; font-weight: 600; }
.schema-mastercard { color: #f87171; font-weight: 600; }
.schema-amex { color: #60a5fa; font-weight: 600; }
.schema-discover { color: #fb923c; font-weight: 600; }
.schema-jcb { color: #38bdf8; font-weight: 600; }

.level-classic,
.level-standard,
.level-world {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    background: var(--lotus-surface-2);
    border: 1px solid var(--lotus-border);
    color: var(--lotus-silver);
}

/* Searchable select */
.searchable-select {
    position: relative;
    width: 100%;
}

.searchable-select input {
    width: 100%;
    padding: 8px 32px 8px 10px;
    background: var(--lotus-surface-2);
    border: 1px solid var(--lotus-border);
    border-radius: var(--radius);
    color: var(--lotus-text);
    font-size: 12px;
}

.searchable-select input:focus {
    border-color: var(--lotus-gold);
    outline: none;
}

.clear-button {
    position: absolute;
    right: 28px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--lotus-muted);
    font-size: 14px;
    border-radius: 50%;
}

.clear-button.show { display: flex; }
.clear-button:hover { color: #fff; background: var(--lotus-border); }

.dropdown-arrow {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--lotus-muted);
    font-size: 10px;
    pointer-events: none;
}

.searchable-select.active .dropdown-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--lotus-surface-2);
    border: 1px solid var(--lotus-border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.searchable-select.active .dropdown-list {
    display: block;
}

.dropdown-option {
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--lotus-border);
    color: var(--lotus-text);
}

.dropdown-option:hover {
    background: var(--lotus-gold-dim);
}

.dropdown-option.selected {
    background: var(--lotus-gold);
    color: #0a0a0a;
}

.dropdown-option.highlighted {
    background: var(--lotus-gold-dim);
}

.dropdown-option.loading {
    color: var(--lotus-gold);
    text-align: center;
    font-style: italic;
    cursor: default;
}

.dropdown-option.error {
    color: #f87171;
    text-align: center;
}

.select-with-clear {
    position: relative;
}

.clear-button-select {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    cursor: pointer;
    color: var(--lotus-muted);
}

.clear-button-select.show { display: block; }

/* Loading */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(8, 8, 8, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    border-radius: var(--radius);
}

.loading-overlay.show { display: flex; }

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--lotus-border);
    border-top-color: var(--lotus-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    color: var(--lotus-gold);
    font-size: 13px;
    margin-top: 12px;
}

/* Scrollbars */
.table-body-wrapper::-webkit-scrollbar,
.dropdown-list::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.table-body-wrapper::-webkit-scrollbar-thumb,
.dropdown-list::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 760px) {
    body {
        overflow: auto;
        height: auto;
        padding: 0;
    }

    .app-wrapper {
        height: auto;
        min-height: 100vh;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--lotus-border);
        max-height: none;
    }

    .header {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 8px;
        padding: 10px 12px;
    }

    .header-extra,
    #available-cards,
    #lang-btn {
        justify-self: center;
        text-align: center;
        white-space: normal;
    }

    .brand-lockup {
        grid-column: auto;
        grid-row: auto;
    }

    .main-content {
        min-height: 60vh;
        padding: 14px 12px 20px;
    }

    .page-inventory .filter-bar { padding: 12px; }

    .page-inventory .filter-bar__head {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
        gap: 8px;
    }

    .page-inventory .filter-bar__title {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 8px;
        min-width: 0;
        flex: 1;
    }

    .page-inventory .filter-bar__head h2 {
        display: none;
    }

    .filter-drawer-open {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        height: 32px;
        padding: 0 12px;
        border-radius: 999px;
        border: 1px solid var(--lotus-gold);
        background: transparent;
        color: var(--lotus-gold);
        font-size: 13px;
        letter-spacing: 0.06em;
        white-space: nowrap;
    }

    .stock-switch {
        display: flex;
        flex-direction: row;
        width: auto;
        flex: 1 1 auto;
        min-width: 0;
        border-radius: 999px;
    }

    .stock-switch__btn {
        flex: 1;
        letter-spacing: 0;
        font-size: 12px;
        padding: 7px 8px;
        white-space: nowrap;
        line-height: 1.2;
    }

    .page-inventory .user-profile--inline {
        flex-shrink: 0;
        padding: 0;
    }

    .page-inventory .user-profile--inline .avatar {
        width: 32px;
        height: 32px;
    }

    .page-inventory .user-profile--inline .user-info {
        display: none;
    }

    .page-inventory .notice-bar {
        display: none;
    }

    .page-inventory .main-content--stack {
        padding: 12px;
        min-height: 70vh;
    }

    .table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .table-header h3 { white-space: normal; }

    .table-container { overflow: hidden; }

    .table-header-wrapper {
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
    }

    .table-header-wrapper::-webkit-scrollbar { display: none; }

    .table-body-wrapper { overflow: visible; }

    .table-row { min-width: 820px; }
}

@media (max-width: 900px) {
    body {
        overflow: auto;
        height: auto;
    }

    .app-wrapper {
        height: auto;
        min-height: 100vh;
        border-radius: 0;
    }

    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--lotus-border);
        max-height: none;
    }
}

/* ========== 查询页：上下结构 ========== */
.page-inventory .app-wrapper {
    display: flex;
    flex-direction: column;
}

.page-inventory .notice-bar {
    margin: 12px 16px 0;
    padding: 12px 16px;
    text-align: center;
    justify-content: center;
    background: var(--lotus-gold-dim);
    border: 1px solid rgba(201, 169, 98, 0.25);
    border-radius: 8px;
}

.page-inventory .notice-content {
    justify-content: center;
}

.page-inventory .notice-icon,
.page-inventory .notice-close {
    display: none;
}

.page-inventory .notice-text {
    font-size: 13px;
    letter-spacing: 0.04em;
    color: var(--lotus-gold);
    line-height: 1.6;
}

.page-inventory .notice-link {
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-decoration: none;
}

.page-inventory .filter-bar {
    flex-shrink: 0;
    padding: 14px 20px 16px;
    background: var(--lotus-bg);
    border-bottom: 1px solid var(--lotus-border);
}

.page-inventory .filter-bar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.page-inventory .filter-bar__title {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.stock-switch {
    display: inline-flex;
    border: 1px solid var(--lotus-border);
    border-radius: 999px;
    overflow: hidden;
}

.stock-switch__btn {
    border: 0;
    background: transparent;
    color: var(--lotus-silver);
    font: inherit;
    font-size: 12px;
    letter-spacing: 0.08em;
    padding: 6px 14px;
    cursor: pointer;
}

.stock-switch__btn.is-active {
    background: linear-gradient(135deg, #d4b978, #a8863e);
    color: #0a0a0a;
    font-weight: 600;
}

.page-inventory .filter-bar__head h2 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--lotus-gold);
    font-weight: 600;
    margin: 0;
}

.page-inventory .user-profile--inline {
    margin: 0;
    padding: 6px 10px;
    gap: 8px;
    align-items: center;
}

.page-inventory .user-profile--inline .avatar {
    width: 44px;
    height: 44px;
}

.page-inventory .user-profile--inline .user-desc {
    display: none;
}

.page-inventory .user-profile--inline .username {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.page-inventory .user-profile--inline .user-status {
    margin-top: 4px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #7dffb2;
}

.page-inventory .user-profile--inline .status-dot {
    width: 10px;
    height: 10px;
    box-shadow: 0 0 8px #4ade80, 0 0 16px rgba(74, 222, 128, 0.65);
}

.page-inventory .filter-bar__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 12px;
    align-items: end;
}

.page-inventory .filter-bar__grid .form-group {
    margin-bottom: 0;
}

.page-inventory .form-actions--bar {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 8px;
    margin: 0;
    align-self: end;
}

.page-inventory .form-actions--bar .btn-search {
    margin: 0;
}

.page-inventory .main-content--stack {
    flex: 1;
    min-height: 0;
    padding: 16px 20px 20px;
    display: flex;
    flex-direction: column;
}

@media (max-width: 1100px) {
    .page-inventory .filter-bar__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .page-inventory .filter-bar__grid {
        grid-template-columns: 1fr 1fr;
    }

    .page-inventory .form-actions--bar {
        grid-column: 1 / -1;
    }

    .page-inventory .filter-bar__head {
        flex-wrap: nowrap;
    }
}

@media (max-width: 480px) {
    .page-inventory .filter-bar__grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 761px) {
    .filter-drawer-open,
    .filter-drawer-close {
        display: none;
    }
}

.filter-drawer-mask {
    display: none;
}

@media (max-width: 760px) {
    .page-inventory .filter-bar__head {
        margin-bottom: 0;
    }

    .page-inventory .filter-bar__grid {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 40;
        width: min(400px, 92vw);
        margin: 0;
        padding: 56px 16px 16px;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        grid-template-columns: none;
        background: #0c0c0c;
        border-left: 1px solid rgba(201, 169, 98, 0.35);
        box-shadow: -20px 0 48px rgba(0, 0, 0, 0.55);
        overflow: auto;
        transform: translateX(105%);
        transition: transform 0.25s ease;
    }

    .page-inventory .filter-bar__grid .form-group {
        width: 100%;
        margin: 0;
    }

    .page-inventory .filter-bar__grid .form-group label {
        text-align: left;
        text-transform: none;
        letter-spacing: 0.04em;
        color: #d7c29a;
        font-size: 12px;
        margin-bottom: 6px;
    }

    .page-inventory .filter-bar__grid .form-group input,
    .page-inventory .filter-bar__grid .form-group select,
    .page-inventory .filter-bar__grid .searchable-select {
        width: 100%;
        min-height: 40px;
        border-radius: 10px;
    }

    .filter-drawer-close {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
        border: 1px solid var(--lotus-border);
        border-radius: 8px;
        background: #161616;
        color: var(--lotus-silver);
        font-size: 18px;
        line-height: 1;
    }

    .page-inventory .form-actions--bar {
        grid-column: auto;
        grid-template-columns: 1fr 1.4fr;
        gap: 10px;
        margin-top: 4px;
        padding-top: 8px;
        position: sticky;
        bottom: 0;
        background: #0c0c0c;
    }

    .page-inventory .form-actions--bar .btn-reset,
    .page-inventory .form-actions--bar .btn-search {
        min-height: 42px;
        border-radius: 10px;
        font-size: 14px;
    }

    body.page-inventory.is-filter-open {
        position: fixed;
        left: 0;
        right: 0;
        width: 100%;
        overflow: hidden;
    }

    body.page-inventory.is-filter-open .filter-bar__grid {
        transform: translateX(0);
    }

    body.page-inventory.is-filter-open .filter-drawer-mask {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 30;
        background: rgba(0, 0, 0, 0.55);
    }
}
