/* css/dealer-inventory.css — Inventory Management Styles */
/* ============================================
   CREDCARS MOBILITY — Dealer Inventory
   ============================================ */

/* ============================================
   LAYOUT
   ============================================ */
.dealer-inventory-layout {
    display: flex;
    min-height: 100vh;
    background: #F8FAFC;
}

/* ============================================
   SIDEBAR
   ============================================ */
.inventory-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    background: #0A1628;
    color: #fff;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.inventory-sidebar::-webkit-scrollbar {
    width: 4px;
}
.inventory-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.sidebar-logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
}
.sidebar-logo-text .logo-highlight {
    color: #2D7DFF;
}

.sidebar-badge {
    background: linear-gradient(135deg, #2D7DFF, #7C3AED);
    color: #fff;
    font-size: 0.6rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-left: 0.25rem;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
}
.sidebar-close:hover {
    color: #fff;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-avatar {
    width: 44px;
    height: 44px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #2D7DFF, #7C3AED);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
}

.sidebar-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
}
.sidebar-user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
}
.sidebar-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.5rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    background: none;
    border-right: none;
    border-top: none;
    border-bottom: none;
    width: 100%;
    font-family: inherit;
    text-align: left;
}
.sidebar-nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
}
.sidebar-nav-link.active {
    color: #fff;
    background: rgba(45, 125, 255, 0.12);
    border-left-color: #2D7DFF;
}

.sidebar-nav-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}
.sidebar-nav-label {
    flex: 1;
}

.sidebar-badge {
    padding: 0.125rem 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
}
.sidebar-badge.badge-unread {
    background: #EF4444;
    color: #fff;
}

.sidebar-footer {
    padding: 0.75rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar-footer .sidebar-nav-link {
    color: rgba(255, 255, 255, 0.4);
}
.sidebar-footer .sidebar-nav-link:hover {
    color: #fff;
}

/* ============================================
   MAIN HEADER
   ============================================ */
.inventory-main-content {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.inventory-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: #fff;
    border-bottom: 1px solid #E2E8F0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.inventory-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
}
.sidebar-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #1E293B;
    border-radius: 2px;
    transition: all 0.2s;
}

.inventory-page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #0A1628;
    margin: 0;
}

.inventory-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.inventory-header-right .btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================
   CONTENT
   ============================================ */
.inventory-content {
    padding: 1.5rem 2rem 6rem;
    flex: 1;
}

/* ============================================
   STATS BAR
   ============================================ */
.inventory-stats-bar {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    text-align: center;
    padding: 0.75rem;
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid #E2E8F0;
}

.stat-number {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0A1628;
}

.stat-label {
    font-size: 0.7rem;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ============================================
   FILTER BAR
   ============================================ */
.inventory-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid #E2E8F0;
}

.filter-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border: 1px solid #E2E8F0;
    border-radius: 0.5rem;
    background: #fff;
}
.filter-search input {
    border: none;
    outline: none;
    font-size: 0.875rem;
    padding: 0.375rem 0;
    width: 200px;
    font-family: inherit;
}
.filter-search svg {
    color: #94A3B8;
    flex-shrink: 0;
}

.filter-select {
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    border: 1px solid #E2E8F0;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background: #fff;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364758B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    cursor: pointer;
    font-family: inherit;
}
.filter-select:focus {
    outline: none;
    border-color: #2D7DFF;
}

.filter-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-right .checkbox-label {
    font-size: 0.875rem;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.filter-right .checkbox-custom {
    width: 16px;
    height: 16px;
}

/* ============================================
   TABLE
   ============================================ */
.inventory-table-wrapper {
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid #E2E8F0;
    overflow: hidden;
    overflow-x: auto;
}

.inventory-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.inventory-table thead {
    background: #F8FAFC;
    border-bottom: 2px solid #E2E8F0;
}

.inventory-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.inventory-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #F1F5F9;
    vertical-align: middle;
}

.inventory-table tbody tr:hover {
    background: #FAFBFC;
}

.inventory-table .vehicle-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.inventory-table .vehicle-thumb {
    width: 48px;
    height: 36px;
    border-radius: 0.375rem;
    overflow: hidden;
    background: #E2E8F0;
    flex-shrink: 0;
}
.inventory-table .vehicle-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inventory-table .vehicle-name {
    font-weight: 500;
    color: #0A1628;
}
.inventory-table .vehicle-id {
    font-size: 0.7rem;
    color: #94A3B8;
}

.status-badge {
    display: inline-block;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.status-badge.active {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}
.status-badge.pending {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}
.status-badge.draft {
    background: rgba(100, 116, 139, 0.1);
    color: #64748B;
}
.status-badge.sold {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}
.status-badge.archived {
    background: rgba(100, 116, 139, 0.05);
    color: #94A3B8;
}
.status-badge.reserved {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
}

.action-btns {
    display: flex;
    gap: 0.25rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.action-btns .btn {
    font-size: 0.7rem;
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
}

.table-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #2D7DFF;
}

/* ============================================
   MOBILE CARDS
   ============================================ */
.inventory-cards {
    display: none;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.inventory-card {
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid #E2E8F0;
    padding: 1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.inventory-card .card-checkbox {
    flex-shrink: 0;
}
.inventory-card .card-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: #2D7DFF;
    cursor: pointer;
}

.inventory-card .card-image {
    width: 80px;
    height: 60px;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #E2E8F0;
    flex-shrink: 0;
}
.inventory-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inventory-card .card-info {
    flex: 1;
    min-width: 0;
}
.inventory-card .card-info .card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0A1628;
    margin: 0;
}
.inventory-card .card-info .card-details {
    font-size: 0.75rem;
    color: #64748B;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.inventory-card .card-info .card-price {
    font-size: 1rem;
    font-weight: 700;
    color: #0A1628;
}

.inventory-card .card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.inventory-card .card-actions .btn {
    font-size: 0.7rem;
    padding: 0.125rem 0.5rem;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.inventory-empty {
    padding: 3rem 0;
}

/* ============================================
   PAGINATION
   ============================================ */
.inventory-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #E2E8F0;
}

.inventory-pagination button {
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border: 1px solid #E2E8F0;
    border-radius: 0.375rem;
    background: #fff;
    color: #475569;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}
.inventory-pagination button:hover:not(.active):not(:disabled) {
    background: #F8FAFC;
}
.inventory-pagination button.active {
    background: #2D7DFF;
    color: #fff;
    border-color: #2D7DFF;
}
.inventory-pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================
   MOBILE NAV
   ============================================ */
.inventory-mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #E2E8F0;
    padding: 0.25rem 0;
    z-index: 50;
    justify-content: space-around;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: #94A3B8;
    font-size: 0.65rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    position: relative;
    transition: color 0.2s;
}
.mobile-nav-item:hover {
    color: #475569;
}
.mobile-nav-item.active {
    color: #2D7DFF;
}

.mobile-nav-icon {
    font-size: 1.2rem;
}

.mobile-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    font-size: 0.55rem;
    font-weight: 600;
    background: #94A3B8;
    color: #fff;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mobile-badge.badge-unread {
    background: #EF4444;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .inventory-sidebar {
        transform: translateX(-100%);
    }
    .inventory-sidebar.is-open {
        transform: translateX(0);
    }
    .sidebar-close {
        display: block;
    }
    .inventory-main-content {
        margin-left: 0;
    }
    .sidebar-toggle {
        display: flex;
    }
    .inventory-stats-bar {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .inventory-header {
        padding: 0.75rem 1rem;
    }
    .inventory-content {
        padding: 1rem;
        padding-bottom: 5rem;
    }
    .inventory-page-title {
        font-size: 1rem;
    }
    .inventory-table-wrapper {
        display: none;
    }
    .inventory-cards {
        display: grid;
    }
    .inventory-stats-bar {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    .stat-item {
        padding: 0.5rem;
    }
    .stat-number {
        font-size: 1rem;
    }
    .inventory-filter-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 0.75rem;
    }
    .filter-left {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-search input {
        width: 100%;
    }
    .filter-right {
        flex-wrap: wrap;
    }
    .inventory-mobile-nav {
        display: flex;
    }
    .inventory-header-right .btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
    .inventory-card {
        flex-wrap: wrap;
    }
    .inventory-card .card-actions {
        flex-direction: row;
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .inventory-stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
    .inventory-card {
        flex-direction: column;
        align-items: stretch;
    }
    .inventory-card .card-image {
        width: 100%;
        height: 120px;
    }
    .inventory-card .card-actions {
        justify-content: stretch;
    }
    .inventory-card .card-actions .btn {
        flex: 1;
        justify-content: center;
    }
}