/* ═══════════════════════════════════════════════════════════════
   LIVE INVENTORY & STOCK STYLING
   Theme: Aurora Navy & Crimson Accent (Toyota Enterprise)
   Multi-View: Table (Dense), Accordion (Grouped), Grid (Cards)
   ═══════════════════════════════════════════════════════════════ */

/* ── Top Banner & Stats Card ──────────────────────────────── */
.inv-top-card {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
    padding: 20px 22px 18px;
    margin-bottom: 14px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

.inv-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.inv-title {
    font-size: 18px;
    font-weight: 800;
    color: #0d1b3e;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    letter-spacing: -0.3px;
}

.inv-subtitle {
    font-size: 12px;
    color: #64748b;
    margin: 0;
    font-weight: 500;
}

.btn-refresh-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-refresh-pill:hover {
    background: #0d1b3e;
    color: #ffffff;
    border-color: #0d1b3e;
    box-shadow: 0 4px 12px rgba(13, 27, 62, 0.15);
}

.btn-refresh-pill i {
    font-size: 12px;
    transition: transform 0.4s ease;
}

.btn-refresh-pill:active i {
    transform: rotate(180deg);
}

/* ── Stats Summary Grid ───────────────────────────────────── */
.inv-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .inv-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}

.inv-stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid #e8ecf4;
    background: #f8fafc;
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 0;
    box-sizing: border-box;
}

.inv-stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.inv-stat-item .stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.inv-stat-item .stat-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.inv-stat-item .stat-val {
    font-size: 17px;
    font-weight: 800;
    color: #0d1b3e;
    line-height: 1.2;
}

.inv-stat-item .stat-lbl {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 100%;
    display: block;
}

/* Stat color variants */
.stat-ready {
    background: #f0fdf4;
    border-color: #bbf7d0;
}
.stat-ready .stat-icon {
    background: #dcfce7;
    color: #15803d;
}
.stat-ready .stat-val {
    color: #15803d;
}

.stat-total {
    background: #f8fafc;
    border-color: #e2e8f0;
}
.stat-total .stat-icon {
    background: #e2e8f0;
    color: #0d1b3e;
}

.stat-matched {
    background: #fff7ed;
    border-color: #fed7aa;
}
.stat-matched .stat-icon {
    background: #ffedd5;
    color: #c2410c;
}
.stat-matched .stat-val {
    color: #c2410c;
}

.stat-models {
    background: #f5f3ff;
    border-color: #ddd6fe;
}
.stat-models .stat-icon {
    background: #ede9fe;
    color: #6d28d9;
}
.stat-models .stat-val {
    color: #6d28d9;
}

/* ── Search Bar & Inputs ──────────────────────────────────── */
.search-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    color: #94a3b8;
    font-size: 14px;
    pointer-events: none;
}

.search-input-styled {
    width: 100%;
    padding: 11px 38px 11px 38px !important;
    border-radius: 12px !important;
    border: 1.5px solid #cbd5e1 !important;
    background: #f8fafc !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    color: #0f1830 !important;
    transition: all 0.2s ease !important;
}

.search-input-styled:focus {
    background: #ffffff !important;
    border-color: #d7123a !important;
    box-shadow: 0 0 0 3px rgba(215, 18, 58, 0.12) !important;
    outline: none !important;
}

.clear-search-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 13px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.clear-search-btn:hover {
    color: #0f1830;
}

.btn-filter-square {
    position: relative;
    width: 44px;
    height: 44px;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    color: #0d1b3e;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.btn-filter-square:hover {
    background: #0d1b3e;
    color: #ffffff;
    border-color: #0d1b3e;
}

.filter-count-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #d7123a;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 99px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 5px rgba(215, 18, 58, 0.4);
}

/* ── Category & Quick Chips ───────────────────────────────── */
.quick-chips-wrapper {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px 2px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.quick-chips-wrapper::-webkit-scrollbar {
    display: none;
}

.chip-item {
    padding: 7px 14px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chip-item:hover {
    background: #e2e8f0;
    color: #0d1b3e;
}

.chip-item.active {
    background: #0d1b3e;
    color: #ffffff;
    border-color: #0d1b3e;
    box-shadow: 0 2px 8px rgba(13, 27, 62, 0.2);
}

.chip-item.chip-ready {
    background: #f0fdf4;
    color: #15803d;
    border-color: #bbf7d0;
}
.chip-item.chip-ready:hover {
    background: #dcfce7;
}
.chip-item.chip-ready.active {
    background: #15803d;
    color: #ffffff;
    border-color: #15803d;
    box-shadow: 0 2px 8px rgba(21, 128, 61, 0.3);
}

/* ── Toolbar Card & View Mode Switcher ────────────────────── */
.inv-toolbar-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

.inv-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.inv-result-text {
    font-size: 12.5px;
    font-weight: 700;
    color: #334155;
}

.accordion-toggle-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-small-link {
    background: none;
    border: none;
    color: #d7123a;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.2s;
}
.btn-small-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.inv-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-mode-label {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 4px;
}

@media (max-width: 540px) {
    .view-mode-label {
        display: none;
    }
}

.view-mode-switcher {
    display: inline-flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.view-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    border-radius: 7px;
    font-size: 11.5px;
    font-weight: 700;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-btn.active {
    background: #ffffff;
    color: #0d1b3e;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.view-btn:hover:not(.active) {
    color: #0d1b3e;
}

/* ═══════════════════════════════════════════════════════════════
   MODE 1: COMPACT TABLE VIEW (DEFAULT & HIGH DENSITY)
   ═══════════════════════════════════════════════════════════════ */
.inventory-render-wrapper {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.inventory-table-container {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    margin-bottom: 20px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.inv-table-responsive {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

.inv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    text-align: left;
}

.inv-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 800;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 12px 14px;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}

.inv-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: #1e293b;
    transition: background 0.15s ease;
}

.inv-table tr:last-child td {
    border-bottom: none;
}

.inv-table tr:hover td {
    background: #f8fafc;
}

/* Column Elements in Table */
.table-car-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
}

.table-car-img {
    width: 58px;
    height: 44px;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s;
}
.table-car-img:hover {
    transform: scale(1.06);
}
.table-car-img img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.table-car-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.table-car-name {
    font-size: 13px;
    font-weight: 800;
    color: #0d1b3e;
    line-height: 1.3;
}

.table-car-cat {
    font-size: 10px;
    font-weight: 700;
    color: #d7123a;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.table-mono-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.mono-rrn {
    font-size: 12px;
    font-weight: 800;
    color: #d7123a;
}

.mono-chassis {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
}

.mono-engine {
    font-size: 10.5px;
    color: #94a3b8;
}

.table-color-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 99px;
    background: #f1f5f9;
    font-size: 11px;
    font-weight: 700;
    color: #334155;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
}

.table-location-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11.5px;
}

.loc-site {
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 5px;
}
.loc-site i {
    color: #d7123a;
    font-size: 11px;
}

.loc-wh {
    font-size: 11px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 5px;
}
.loc-wh i {
    color: #94a3b8;
    font-size: 10px;
}

/* Status Badges */
.badge-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.status-ready {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.status-matched {
    background: #ffedd5;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

.status-reserved {
    background: #e0e7ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
}

.status-locked {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.hold-timer-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #78350f;
    color: #fef08a;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 6px;
    margin-top: 4px;
    font-family: monospace;
}

.btn-table-hold {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}
.btn-table-hold:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

.btn-table-release {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}
.btn-table-release:hover {
    background: #fecaca;
}

/* Table Button */
.btn-table-ambil {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    font-weight: 800;
    font-size: 11.5px;
    padding: 7px 12px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
    transition: all 0.2s ease;
}

.btn-table-ambil:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
}

.btn-table-disabled {
    background: #f1f5f9;
    color: #94a3b8;
    font-weight: 700;
    font-size: 11px;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    cursor: not-allowed;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════
   MODE 2: ACCORDION VIEW (GROUPED COLLAPSIBLE BY MODEL)
   ═══════════════════════════════════════════════════════════════ */
.category-section-block {
    margin-bottom: 24px;
}

.category-badge-heading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #0d1b3e;
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(13, 27, 62, 0.2);
}

.category-badge-heading i {
    color: #f43f5e;
}

.accordion-model-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    margin-bottom: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
    transition: all 0.2s ease;
}

.accordion-model-card.expanded {
    border-color: #cbd5e1;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.accordion-header-btn {
    width: 100%;
    padding: 14px 18px;
    background: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
    gap: 12px;
}

.accordion-header-btn:hover {
    background: #f8fafc;
}

.accordion-model-card.expanded .accordion-header-btn {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.accordion-model-info {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex-grow: 1;
}

.accordion-thumb {
    width: 48px;
    height: 36px;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
}

.accordion-thumb img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.accordion-title-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.accordion-model-name {
    font-size: 14px;
    font-weight: 800;
    color: #0d1b3e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.accordion-model-badge-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.accordion-status-counts {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.pill-count-ready {
    background: #dcfce7;
    color: #15803d;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 99px;
    border: 1px solid #bbf7d0;
}

.pill-count-total {
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 99px;
}

.accordion-chevron {
    color: #94a3b8;
    font-size: 13px;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.accordion-model-card.expanded .accordion-chevron {
    transform: rotate(180deg);
    color: #0d1b3e;
}

.accordion-body-content {
    display: none;
    padding: 12px 14px 14px;
    background: #ffffff;
}

.accordion-model-card.expanded .accordion-body-content {
    display: block;
}

/* ═══════════════════════════════════════════════════════════════
   MODE 3: MODERN COMPACT CARD GRID
   ═══════════════════════════════════════════════════════════════ */
.inv-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.inv-compact-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    padding: 14px 16px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.inv-compact-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
}

.card-top-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.card-car-thumb {
    width: 72px;
    height: 54px;
    background: #f8fafc;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    overflow: hidden;
}

.card-car-thumb img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.card-main-meta {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.card-model-title {
    font-size: 13px;
    font-weight: 800;
    color: #0d1b3e;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-rrn-badge {
    font-size: 12px;
    font-weight: 800;
    color: #d7123a;
    font-family: ui-monospace, monospace;
}

.card-chassis-row {
    font-size: 11px;
    color: #64748b;
    font-family: ui-monospace, monospace;
}

.card-chassis-row span {
    font-weight: 700;
    color: #0f1830;
}

.card-pills-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.card-divider-line {
    border-top: 1px dashed #e2e8f0;
    margin: 2px 0;
}

.card-tags-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.card-tag-badge {
    font-size: 10px;
    font-weight: 700;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 3px 7px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.card-tag-badge i {
    color: #d7123a;
}

.card-action-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    font-weight: 800;
    font-size: 12.5px;
    padding: 9px;
    border-radius: 9px;
    border: none;
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
    transition: all 0.2s ease;
}

.card-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.card-action-btn.disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
    border: 1px solid #e2e8f0;
}

/* ═══════════════════════════════════════════════════════════════
   FILTER MODAL & SPK MODAL STYLES
   ═══════════════════════════════════════════════════════════════ */
.filter-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.filter-overlay.active {
    display: flex;
}

.filter-content {
    background: white;
    width: 100%;
    max-width: 440px;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: spkModalPop 0.25s ease-out;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid #f1f5f9;
}
.filter-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #0d1b3e;
}
.close-filter {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.close-filter:hover {
    background: #e2e8f0;
    color: #0d1b3e;
}

.filter-body {
    padding: 20px 22px;
    max-height: 65vh;
    overflow-y: auto;
}
.form-group {
    margin-bottom: 14px;
}
.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #334155;
}

.filter-footer {
    display: flex;
    padding: 16px 22px;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
    gap: 10px;
}

/* SPK Modal */
.spk-modal-content {
    background: white;
    width: 100%;
    max-width: 450px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: spkModalPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes spkModalPop {
    from { opacity: 0; transform: scale(0.94) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.spk-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px 14px;
    border-bottom: 1px solid #f1f5f9;
}
.spk-modal-header h3 {
    margin: 0;
    font-size: 16.5px;
    font-weight: 800;
    color: #0d1b3e;
}

.spk-close-btn {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}
.spk-close-btn:hover {
    background: #e2e8f0;
    color: #0d1b3e;
}

.spk-modal-body {
    padding: 18px 22px 22px;
    max-height: 75vh;
    overflow-y: auto;
}

.spk-unit-preview {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 18px;
}

.spk-preview-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.spk-preview-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #fee2e2;
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.spk-preview-title {
    font-size: 12.5px;
    font-weight: 800;
    color: #0d1b3e;
    line-height: 1.35;
    text-transform: uppercase;
}

.spk-preview-divider {
    border-top: 1px dashed #cbd5e1;
    margin: 10px 0;
}

.spk-preview-chassis {
    display: flex;
    align-items: center;
    gap: 10px;
}

.spk-chassis-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: #e2e8f0;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
}

.spk-chassis-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.spk-chassis-label {
    font-size: 9px;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.spk-chassis-val {
    font-size: 12px;
    font-weight: 800;
    color: #0d1b3e;
    font-family: ui-monospace, monospace;
}

.spk-field-group {
    margin-bottom: 14px;
}

.spk-field-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
}

.spk-field-label span {
    color: #ef4444;
}

.spk-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #0d1b3e;
    background: #f8fafc;
    transition: all 0.2s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.spk-input:focus {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    outline: none;
}

.spk-modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
}

.btn-spk-cancel {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-spk-cancel:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-spk-submit {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    font-size: 13px;
    font-weight: 800;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
    transition: all 0.2s ease;
    flex: 1;
}

.btn-spk-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN SYSTEM (MOBILE & SMALL SCREENS)
   Samsung Galaxy A-series (360px), iPhone SE (375px/320px),
   Modern Large Phones (390–430px), Tablets (768px)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
    .inv-top-card {
        padding: 16px 14px 14px;
        border-radius: 16px;
        margin-bottom: 12px;
    }

    .inv-header-row {
        gap: 10px;
        margin-bottom: 14px;
    }

    .inv-title {
        font-size: 16px;
    }

    .btn-refresh-pill {
        padding: 6px 12px;
        font-size: 11.5px;
    }

    .inv-cards-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 16px;
    }

    .inv-compact-card {
        padding: 12px 14px;
        border-radius: 12px;
    }

    .category-badge-heading {
        font-size: 12px;
        padding: 5px 12px;
        margin-bottom: 10px;
    }

    .accordion-header-btn {
        padding: 10px 14px;
        gap: 10px;
    }

    .accordion-model-name {
        font-size: 13px;
    }

    .accordion-body-content {
        padding: 10px 12px 12px;
    }

    .inv-table th,
    .inv-table td {
        padding: 10px 12px;
        font-size: 12px;
    }
}

@media (max-width: 540px) {
    .view-mode-label {
        display: none;
    }

    .inv-toolbar-card {
        padding: 10px 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        border-radius: 12px;
        margin-bottom: 12px;
    }

    .inv-toolbar-left {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 6px;
    }

    .inv-result-text {
        font-size: 12px;
    }

    .inv-toolbar-right {
        width: 100%;
    }

    .view-mode-switcher {
        width: 100%;
        display: flex;
        box-sizing: border-box;
        padding: 2.5px;
        border-radius: 8px;
    }

    .view-btn {
        flex: 1;
        justify-content: center;
        padding: 6px 4px;
        font-size: 11px;
        gap: 4px;
    }

    .view-btn i {
        font-size: 11px;
    }
}

/* Standard Mobile & Samsung Galaxy A55 (<= 480px) */
@media (max-width: 480px) {
    .inv-top-card {
        padding: 14px 12px 12px;
        border-radius: 14px;
    }

    .inv-header-row {
        gap: 8px;
        margin-bottom: 12px;
    }

    .inv-title {
        font-size: 15px;
        letter-spacing: -0.2px;
    }

    .inv-subtitle {
        font-size: 11px;
        line-height: 1.35;
    }

    .btn-refresh-pill {
        padding: 6px 10px;
        font-size: 11px;
        border-radius: 8px;
        gap: 5px;
    }

    .inv-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        margin-bottom: 12px !important;
    }

    .inv-stat-item {
        padding: 9px 8px !important;
        gap: 8px !important;
        border-radius: 12px !important;
        min-width: 0 !important;
    }

    .inv-stat-item .stat-icon {
        width: 32px !important;
        height: 32px !important;
        font-size: 13.5px !important;
        border-radius: 8px !important;
    }

    .inv-stat-item .stat-val {
        font-size: 15px !important;
        line-height: 1.15 !important;
    }

    .inv-stat-item .stat-lbl {
        font-size: 10px !important;
    }

    .search-bar {
        gap: 6px !important;
        margin-top: 10px !important;
        margin-bottom: 10px !important;
    }

    .search-input-wrapper {
        min-width: 0 !important;
    }

    .search-icon {
        left: 10px !important;
        font-size: 13px !important;
    }

    .search-input-styled {
        padding: 9px 30px 9px 30px !important;
        font-size: 12px !important;
        border-radius: 10px !important;
    }

    .btn-filter-square {
        width: 38px !important;
        height: 38px !important;
        border-radius: 10px !important;
        font-size: 13px !important;
    }

    .quick-chips-wrapper {
        gap: 6px !important;
        padding: 2px 0 !important;
    }

    .chip-item {
        padding: 6px 11px !important;
        font-size: 11px !important;
        gap: 5px !important;
    }

    .inventory-table-container {
        border-radius: 14px !important;
        margin-bottom: 14px !important;
    }

    .inv-table th,
    .inv-table td {
        padding: 9px 10px !important;
        font-size: 11.5px !important;
    }

    .table-car-cell {
        min-width: 190px !important;
        gap: 8px !important;
    }

    .table-car-img {
        width: 48px !important;
        height: 38px !important;
        border-radius: 7px !important;
    }

    .table-car-name {
        font-size: 12px !important;
    }

    .table-car-cat {
        font-size: 9.5px !important;
    }

    .accordion-header-btn {
        padding: 10px 12px !important;
        gap: 8px !important;
    }

    .accordion-model-info {
        gap: 10px !important;
    }

    .accordion-thumb {
        width: 42px !important;
        height: 32px !important;
        border-radius: 7px !important;
    }

    .accordion-model-name {
        font-size: 12.5px !important;
    }

    .pill-count-ready,
    .pill-count-total {
        font-size: 10px !important;
        padding: 3px 8px !important;
    }
}

/* Compact Smartphones (<= 380px: Samsung Galaxy A55 360px, iPhone SE 375px/320px) */
@media (max-width: 380px) {
    .inv-top-card {
        padding: 12px 10px 10px !important;
        border-radius: 12px !important;
    }

    .inv-title {
        font-size: 14px !important;
    }

    .inv-title i {
        font-size: 13px !important;
        margin-right: 4px !important;
    }

    .inv-subtitle {
        font-size: 10.5px !important;
    }

    .btn-refresh-pill {
        padding: 5px 8px !important;
        font-size: 10.5px !important;
        border-radius: 7px !important;
    }

    .inv-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 6px !important;
        margin-bottom: 10px !important;
    }

    .inv-stat-item {
        padding: 8px 6px !important;
        gap: 6px !important;
        border-radius: 10px !important;
    }

    .inv-stat-item .stat-icon {
        width: 28px !important;
        height: 28px !important;
        font-size: 12px !important;
        border-radius: 7px !important;
    }

    .inv-stat-item .stat-val {
        font-size: 13.5px !important;
    }

    .inv-stat-item .stat-lbl {
        font-size: 9.5px !important;
    }

    .search-input-styled {
        padding: 8px 28px 8px 28px !important;
        font-size: 11.5px !important;
    }

    .search-icon {
        left: 9px !important;
        font-size: 12px !important;
    }

    .btn-filter-square {
        width: 36px !important;
        height: 36px !important;
        border-radius: 9px !important;
        font-size: 12px !important;
    }

    .chip-item {
        padding: 5px 9px !important;
        font-size: 10.5px !important;
        gap: 4px !important;
    }

    .inv-toolbar-card {
        padding: 8px 10px !important;
        gap: 6px !important;
        border-radius: 10px !important;
    }

    .inv-result-text {
        font-size: 11px !important;
    }

    .view-btn {
        padding: 5px 2px !important;
        font-size: 10px !important;
        gap: 3px !important;
    }

    .view-btn i {
        font-size: 10px !important;
    }

    .inventory-table-container {
        border-radius: 12px !important;
    }

    .inv-table th,
    .inv-table td {
        padding: 8px 8px !important;
        font-size: 11px !important;
    }

    .table-car-cell {
        min-width: 170px !important;
        gap: 6px !important;
    }

    .table-car-img {
        width: 40px !important;
        height: 30px !important;
    }

    .table-car-name {
        font-size: 11.5px !important;
    }

    .inv-compact-card {
        padding: 10px 12px !important;
        border-radius: 10px !important;
    }

    .card-car-thumb {
        width: 58px !important;
        height: 44px !important;
    }

    .accordion-header-btn {
        padding: 8px 10px !important;
        gap: 6px !important;
    }

    .accordion-model-info {
        gap: 8px !important;
    }

    .accordion-thumb {
        width: 36px !important;
        height: 28px !important;
    }

    .accordion-model-name {
        font-size: 12px !important;
    }

    .pill-count-ready,
    .pill-count-total {
        font-size: 9.5px !important;
        padding: 2px 6px !important;
    }
}

