/* Tech Empire Inventory — Apple Liquid Glass */

.inv-page {
    background: linear-gradient(165deg, #f5f5f7 0%, #ebebef 45%, #f7f7f9 100%);
    min-height: 100vh;
}

.inv-page::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.inv-layout {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* Sidebar */
.inv-sidebar {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    padding: 1.75rem 1.25rem;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
}

.inv-sidebar-logo {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.1em;
    margin-bottom: 2.5rem;
    padding: 0 0.5rem;
}

.inv-nav {
    list-style: none;
    flex: 1;
}

.inv-nav-item {
    margin-bottom: 0.25rem;
}

.inv-nav-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.88rem;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.inv-nav-item a:hover,
.inv-nav-item a.active {
    background: rgba(0, 0, 0, 0.06);
    color: var(--primary-black);
}

.inv-nav-item a.active {
    background: var(--primary-black);
    color: var(--primary-white);
}

.inv-sidebar-footer {
    padding: 1rem 0.5rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.inv-sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
}

/* Main */
.inv-main {
    padding: 2rem 2.5rem 3rem;
    min-width: 0;
}

.inv-page-header {
    margin-bottom: 1.75rem;
}

.inv-page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.35rem;
}

.inv-page-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Glass stats */
.inv-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.inv-stat-card {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 1.25rem 1.35rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease;
}

.inv-stat-card:hover {
    transform: translateY(-1px);
}

.inv-stat-card h4 {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.inv-stat-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.inv-stat-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

/* Panel */
.inv-panel {
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 24px;
    padding: 1.25rem 1.5rem 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

.inv-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.inv-search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 320px;
}

.inv-search-wrap input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.35rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    font-size: 0.88rem;
    font-family: inherit;
    background: rgba(0, 0, 0, 0.03);
    transition: background 0.2s, border-color 0.2s;
}

.inv-search-wrap input:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.15);
}

.inv-search-wrap i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.inv-select {
    padding: 0.55rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    background: rgba(0, 0, 0, 0.03);
    cursor: pointer;
}

.inv-view-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 999px;
    padding: 3px;
}

.inv-view-btn {
    border: none;
    background: transparent;
    width: 36px;
    height: 32px;
    border-radius: 999px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.2s;
}

.inv-view-btn.active {
    background: white;
    color: var(--primary-black);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.btn-inv-primary {
    background: var(--primary-black);
    color: white;
    border: none;
    padding: 0.65rem 1.25rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: inherit;
    white-space: nowrap;
    transition: background 0.2s, transform 0.15s;
}

.btn-inv-primary:hover {
    background: #333;
}

.btn-inv-primary:active {
    transform: scale(0.97);
}

/* Product grid view */
.inv-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.inv-product-grid.hidden {
    display: none;
}

.inv-product-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 18px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.inv-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.inv-product-card-img {
    aspect-ratio: 1;
    background: #f5f5f7;
    position: relative;
}

.inv-product-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inv-product-card-body {
    padding: 0.85rem 1rem 1rem;
}

.inv-product-card-name {
    font-weight: 600;
    font-size: 0.88rem;
    line-height: 1.35;
    margin-bottom: 0.35rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.inv-product-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.65rem;
}

.inv-product-card-price {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.inv-product-card-cat {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
}

.inv-product-card-actions {
    display: flex;
    gap: 0.4rem;
}

.inv-icon-btn {
    flex: 1;
    padding: 0.45rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.inv-icon-btn:hover {
    background: rgba(0, 0, 0, 0.04);
}

.inv-icon-btn.danger:hover {
    background: #fff0f0;
    color: #c62828;
}

.inv-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

/* Table overrides */
.inv-table-wrap.hidden {
    display: none;
}

.inv-table-wrap .table tbody tr {
    transition: background 0.15s;
}

.inv-table-wrap .table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

.inv-product-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.inv-product-thumb {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f5f5f7;
}

.inv-product-name {
    font-weight: 600;
    font-size: 0.88rem;
    line-height: 1.3;
}

.inv-action-group {
    display: flex;
    gap: 0.35rem;
}

/* Listing Studio */
.listing-container {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    padding: 2rem 2.5rem 6rem;
    background: transparent;
    display: none;
    min-width: 0;
}

.listing-container.active {
    display: block;
}

.listing-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    position: sticky;
    top: 0;
    background: rgba(245, 245, 247, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1rem 0;
    z-index: 50;
}

.btn-back-link {
    background: none;
    border: none;
    color: var(--primary-black);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: inherit;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.btn-back-link:hover {
    opacity: 1;
}

.listing-header h1 {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-top: 0.5rem;
}

.listing-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 20px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.listing-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.02em;
}

.listing-card h3 i {
    width: 18px;
    color: var(--text-muted);
}

.ebay-input,
.te-field {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.8);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ebay-input:focus,
.te-field:focus {
    outline: none;
    border-color: var(--primary-black);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.condition-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.condition-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.6);
}

.condition-option:hover {
    border-color: rgba(0, 0, 0, 0.15);
    background: white;
}

.condition-option:has(input:checked) {
    border-color: var(--primary-black);
    background: rgba(0, 0, 0, 0.03);
}

.condition-option input[type="radio"] {
    accent-color: var(--primary-black);
}

.ebay-dropzone {
    border: 2px dashed rgba(0, 0, 0, 0.12);
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.2s;
    cursor: pointer;
}

.ebay-dropzone.dragover {
    border-color: var(--primary-black);
    background: rgba(0, 0, 0, 0.02);
}

.btn-ebay-pill,
.btn-te-secondary {
    background: white;
    color: var(--primary-black);
    border: 1px solid rgba(0, 0, 0, 0.15);
    padding: 0.55rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-ebay-pill:hover,
.btn-te-secondary:hover {
    background: #f5f5f7;
    border-color: var(--primary-black);
}

.type-btn.active {
    border-color: var(--primary-black) !important;
    color: var(--primary-black) !important;
    background: rgba(0, 0, 0, 0.04) !important;
}

.desc-tab.active {
    color: var(--primary-black) !important;
    border-bottom-color: var(--primary-black) !important;
}

.sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: none;
    justify-content: flex-end;
    gap: 1rem;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 1rem 2.5rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0));
}

.sticky-footer.active {
    display: flex;
}

.btn-ebay-blue,
.btn-te-primary {
    background: var(--primary-black);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.btn-ebay-blue:hover,
.btn-te-primary:hover {
    background: #333;
}

.btn-ebay-blue:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-ebay-outline {
    background: transparent;
    color: var(--primary-black);
    border: 1px solid rgba(0, 0, 0, 0.2);
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
}

.spinner {
    border-top-color: var(--primary-black) !important;
}

/* Toast */
.inv-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-120px);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--primary-black);
    padding: 12px 22px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.88rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    z-index: 10000;
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    pointer-events: none;
}

.inv-toast.show {
    transform: translateX(-50%) translateY(0);
}

.inv-toast-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e6f4ea;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1e8e3e;
}

@media (max-width: 1100px) {
    .inv-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .inv-layout {
        grid-template-columns: 1fr;
    }

    .inv-sidebar {
        position: relative;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 1rem;
        gap: 0.5rem;
    }

    .inv-sidebar-logo {
        margin-bottom: 0;
        width: 100%;
    }

    .inv-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        width: 100%;
    }

    .inv-nav-item {
        margin: 0;
    }

    .inv-sidebar-footer {
        display: none;
    }

    .inv-main,
    .listing-container {
        padding: 1.25rem;
    }

    .listing-container {
        grid-column: 1;
    }
}

@media (max-width: 600px) {
    .inv-stats {
        grid-template-columns: 1fr 1fr;
    }

    .inv-product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
