/* Executive Dashboard CSS - Professional Vehicle Processing System */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    min-height: 100vh;
    color: #1e293b;
    line-height: 1.5;
    overflow-x: hidden;
    font-size: 14px;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
}

/* Professional Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
    font-family: inherit;
    font-weight: 600;
    line-height: 1.3;
    color: #1e293b;
    margin: 0;
}

h1 { font-size: 32px; font-weight: 700; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }
h5 { font-size: 14px; }
h6 { font-size: 12px; }

p {
    margin: 0 0 16px 0;
    color: #475569;
}

small {
    font-size: 12px;
    color: #64748b;
}

.text-sm { font-size: 12px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 18px; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-primary { color: #5788B3; }
.text-secondary { color: #64748b; }
.text-muted { color: #94a3b8; }

/* Professional Spacing System (8px grid) */
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

/* Professional Status Colors */
.status-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.status-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.status-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.status-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Professional Shadows */
.shadow-sm { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.shadow { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06); }
.shadow-md { box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08); }
.shadow-lg { box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1); }

.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
    max-width: 1400px;
}

/* Header - Executive Design */
.header {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid #e2e8f0;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(8px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo i {
    font-size: 24px;
    padding: 10px;
    background: linear-gradient(135deg, #5788B3, #4a7aa3);
    border-radius: 8px;
    color: white;
    box-shadow: 0 2px 6px rgba(87, 136, 179, 0.15);
}

.logo h1 {
    font-size: 26px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    letter-spacing: -0.02em;
}

.header-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

/* User Dropdown Styles */
.user-dropdown-container {
    position: relative;
}

.user-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.user-dropdown-trigger:hover {
    border-color: #5788B3;
    box-shadow: 0 2px 4px rgba(87, 136, 179, 0.1);
}

.user-display {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dropdown-arrow {
    font-size: 12px;
    color: #64748b;
    transition: transform 0.2s ease;
}

.user-dropdown-trigger.active .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    min-width: 280px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.user-dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.dropdown-header .user-name,
.dropdown-header .user-role,
.dropdown-header .store-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #475569;
    line-height: 1.3;
}

.dropdown-header .user-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 15px;
    margin-bottom: 6px;
}

.dropdown-header .user-role {
    font-size: 13px;
    color: #5788B3;
    font-weight: 500;
    margin-bottom: 6px;
}

.dropdown-header .store-info {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 0;
}

.dropdown-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 0;
}

.dropdown-actions {
    padding: 8px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    text-align: left;
    color: #475569;
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.dropdown-item:hover {
    background: #f8fafc;
    color: #1e293b;
}

.dropdown-item.logout-btn {
    color: #dc2626;
}

.dropdown-item.logout-btn:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* Legacy user-info for backwards compatibility */
.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-right: 20px;
    padding-right: 20px;
    border-right: 1px solid #e2e8f0;
    min-width: 220px;
    gap: 4px;
}

.user-name, .user-role, .store-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #475569;
    line-height: 1.3;
}

.user-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 15px;
}

.user-role {
    font-size: 13px;
    color: #5788B3;
    font-weight: 500;
}

.store-info {
    font-size: 13px;
    color: #64748b;
}

.user-info i {
    font-size: 14px;
    opacity: 0.8;
    color: #94a3b8;
}

/* Store Selector Styles */
.store-selector {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.store-selector select,
.store-selector input {
    font-size: 12px;
    padding: 3px 6px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
}

.store-selector select {
    min-width: 100px;
    cursor: pointer;
}

.store-dropdown {
    max-width: 200px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 16px;
    padding-right: 28px;
}

.store-selector select:hover {
    border-color: #94a3b8;
}

.store-selector select:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.store-selector input {
    min-width: 80px;
}

.store-selector .btn {
    font-size: 10px;
    padding: 3px 6px;
}

/* Executive Admin Controls */
.admin-controls {
    margin-top: 0;
}

.dropdown-header .admin-controls {
    margin-top: 0;
    margin-bottom: 0;
}

.admin-controls .btn {
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 5px;
}

/* User Management Modal */
.modal-large {
    max-width: 800px;
    width: 90%;
}

.user-management-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.user-management-actions {
    display: flex;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.create-user-form {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.create-user-form h4 {
    margin-bottom: 15px;
    color: #334155;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #5788B3;
    box-shadow: 0 0 0 2px rgba(87, 136, 179, 0.1);
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: 12px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.user-list-container h4 {
    margin-bottom: 15px;
    color: #334155;
}

.user-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.user-item:hover {
    background: #f8fafc;
}

.user-item.inactive {
    opacity: 0.6;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 5px;
}

.user-details {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 12px;
    color: #64748b;
}

.user-role {
    background: #e0f2fe;
    color: #0369a1;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.user-stores {
    font-family: monospace;
}

.user-status.active {
    color: #16a34a;
    font-weight: 500;
}

.user-status.inactive {
    color: #dc2626;
    font-weight: 500;
}

.user-actions {
    display: flex;
    gap: 5px;
}

.btn-sm {
    font-size: 11px;
    padding: 4px 8px;
}

.loading,
.no-users,
.error {
    text-align: center;
    padding: 20px;
    color: #dc2626;
    font-style: italic;
}

/* User Management Page Specific Styles */
.user-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.user-role-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
}

.user-role-badge.super_admin {
    background: #dc2626;
    color: white;
}

.user-role-badge.admin {
    background: #ea580c;
    color: white;
}

.user-role-badge.user {
    background: #0284c7;
    color: white;
}

.user-created {
    font-size: 11px;
}

.search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #5788B3;
    box-shadow: 0 0 0 2px rgba(87, 136, 179, 0.1);
}

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

.required {
    color: #dc2626;
}

.btn-block {
    width: 100%;
}

.alert {
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 10px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Stats Date Controls */
.stats-date-controls {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 20px;
    padding: 0;
}

/* Professional Date Filter */
.date-filter-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    width: fit-content;
}

.date-filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
}

.date-filter-label i {
    color: #5788B3;
    font-size: 16px;
}

.date-filter-dropdown {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    background: white;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
}

.date-filter-dropdown:hover {
    border-color: #7C9FC2;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.date-filter-dropdown:focus {
    outline: none;
    border-color: #5788B3;
    box-shadow: 0 0 0 3px rgba(87, 136, 179, 0.1);
}

.current-range-display {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    background: #f8fafc;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    border: 1px solid #e2e8f0;
}

/* Executive Button System */
.btn {
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-family: inherit;
    line-height: 1.4;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    min-height: 44px;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

.btn-primary {
    background: #5788B3;
    color: white;
    border-color: #5788B3;
}

.btn-primary:hover {
    background: #4a7aa3;
    border-color: #4a7aa3;
    box-shadow: 0 2px 4px rgba(87, 136, 179, 0.2);
}

.btn-outline {
    background: transparent;
    border: 1px solid #7C9FC2;
    color: #5788B3;
}

.btn-outline:hover {
    background: #7C9FC2;
    color: white;
    border-color: #7C9FC2;
}

.btn-danger {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.btn-secondary {
    background: #f8fafc;
    color: #64748b;
    border-color: #e2e8f0;
}

.btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
    color: white;
    border: 2px solid #dc3545;
}

.btn-danger:hover {
    background: #c82333;
    border-color: #c82333;
    transform: translateY(-2px);
}

/* Main Content */
.main-content {
    padding: 32px 0;
}

/* Executive Statistics Section */
.statistics-section {
    margin-bottom: 32px;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    position: relative;
    padding: 8px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    width: 100%;
    box-sizing: border-box;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.2s ease;
    border: 1px solid #f1f5f9;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #ACC2D8;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #e2e8f0;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    background: linear-gradient(135deg, #7C9FC2, #5788B3);
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(87, 136, 179, 0.2);
}

.stat-icon.success {
    background: #f8fafc;
    color: #059669;
}

.stat-icon.info {
    background: #f8fafc;
    color: #0369a1;
}

.stat-icon.warning {
    background: #f8fafc;
    color: #d97706;
}

.stat-icon.premium {
    background: #f8fafc;
    color: #7c3aed;
}

.stat-icon.activity {
    background: #f8fafc;
    color: #059669;
}

.stat-content {
    flex: 1;
}

/* Enhanced styling for book value and time saved cards */
.book-value-card .stat-content,
.time-saved-card .stat-content {
    flex: 1;
}

.book-value-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
}

.period-dropdown {
    font-size: 0.75em;
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
    color: #374151;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.period-dropdown:hover {
    border-color: #6366f1;
}

.period-dropdown:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 1px #6366f1;
}

.book-value-details,
.time-saved-details {
    margin-top: 4px;
    font-size: 0.8em;
}

.book-value-details .text-muted,
.time-saved-details .text-muted {
    color: #6b7280;
    font-style: italic;
}

/* Special styling for book value amount based on positive/negative */
#book-value-amount.positive {
    color: #059669 !important;
}

#book-value-amount.negative {
    color: #dc2626 !important;
}

#book-value-amount.neutral {
    color: #6b7280 !important;
}

.stat-number {
    font-size: 28px;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 4px;
    line-height: 1;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Executive Search Section */
.search-section {
    margin-bottom: 24px;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    padding: 0;
}

.search-container {
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid #f1f5f9;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
    min-width: 280px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 16px;
}

.search-box input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.search-box input:focus {
    outline: none;
    border-color: #5788B3;
    box-shadow: 0 0 0 2px rgba(87, 136, 179, 0.1);
}

.search-clear {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #718096;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: none;
}

.search-clear:hover {
    color: #e53e3e;
    background: rgba(229, 62, 62, 0.1);
}

.search-filters {
    display: flex;
    gap: 12px;
}

.search-filters select {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    min-width: 120px;
}

.search-filters select:focus {
    outline: none;
    border-color: #5788B3;
    box-shadow: 0 0 0 2px rgba(87, 136, 179, 0.1);
}

/* Vehicles Section */
.vehicles-section {
    margin-bottom: 40px;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    width: 100%;
    box-sizing: border-box;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin: 0;
    flex-shrink: 0;
}

.results-count {
    color: white;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Loading and Error States */
.loading-state, .error-state {
    background: white;
    padding: 60px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.loading-spinner {
    font-size: 48px;
    color: #667eea;
    margin-bottom: 20px;
}

.error-icon {
    font-size: 48px;
    color: #e53e3e;
    margin-bottom: 20px;
}

/* Vehicle Display Layout */
#vehicles-grid {
    margin-top: 20px;
    width: 100%;
    display: block !important; /* ensure it is not a grid container */
    overflow: hidden;
    box-sizing: border-box;
}

/* Featured Section */
.featured-section {
    margin-bottom: 60px;
    width: 100%;
    display: block;
}

.featured-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.featured-section h3 i {
    color: #f39c12;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    max-width: 100%;
    overflow: hidden;
}

/* Force 3 columns on large screens */
@media (min-width: 1200px) {
    .featured-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Remaining Section - Full width underneath featured cards */
.remaining-section {
    margin-top: 60px;
    width: 100%;
    display: block;
    clear: both;
    background: #f8f9fa;
    padding: 20px 0;
}

.remaining-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Vehicle Card Styles */
.vehicle-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

/* Enhanced styles for featured section cards */
.featured-section .vehicle-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    position: relative;
}

.featured-section .vehicle-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #ACC2D8;
    border-radius: 8px 8px 0 0;
}

.featured-section .vehicle-card.success::before {
    background: #16a34a;
}

.featured-section .vehicle-card.processing::before {
    background: #f59e0b;
}

.featured-section .vehicle-card.failed::before {
    background: #dc2626;
}

.featured-section .vehicle-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}

.featured-section .vehicle-header {
    margin-bottom: 16px;
}

.featured-section .vehicle-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
}

.featured-section .vehicle-status {
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.vehicle-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #ACC2D8;
}

.vehicle-card.success {
    border-color: #d1fae5;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}

.vehicle-card.processing {
    border-color: #fef3c7;
    background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
}

.vehicle-card.failed {
    border-color: #fecaca;
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
}

.vehicle-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.vehicle-name {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
    line-height: 1.4;
}

.vehicle-stock {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    font-size: 0.9rem;
}

.vehicle-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.vehicle-status.success {
    background: #d5f4e6;
    color: #27ae60;
}

.vehicle-status.processing {
    background: #eef2ff;
    color: #4f46e5;
}

.vehicle-status.issues, .vehicle-status.failed {
    background: #f3f4f6;
    color: #374151;
}

.vehicle-info {
    margin-bottom: 15px;
}

.vehicle-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.vehicle-detail i {
    color: #7f8c8d;
    width: 16px;
}

.vehicle-detail .label {
    color: #7f8c8d;
    font-weight: 500;
}

.vehicle-detail .value {
    color: #2c3e50;
}

.vehicle-features {
    margin-bottom: 15px;
}

.feature-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.feature-badge {
    background: #ecf0f1;
    color: #2c3e50;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.feature-badge.updated {
    background: #d5f4e6;
    color: #27ae60;
}

.processing-status {
    margin-bottom: 15px;
}

.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: auto; /* Push to bottom in flex container */
}

/* Responsive status grid */
.featured-section .status-grid {
    margin-top: 15px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: center;
    justify-content: center;
    min-height: 40px;
    box-sizing: border-box;
}

.status-item i {
    font-size: 14px;
    flex-shrink: 0;
}

.status-item span {
    font-size: 0.8rem;
    line-height: 1.2;
}

.status-item.success {
    background: #d5f4e6;
    color: #27ae60;
}

.status-item.pending {
    background: #f3f4f6;
    color: #374151;
}

.no-build-data-warning {
    background: #fef9e7;
    color: #f39c12;
    padding: 10px 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    border: 1px solid #f7dc6f;
}



.vehicle-list {
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.vehicle-list-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f8f9fa;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.vehicle-list-item:last-child {
    border-bottom: none;
}

.vehicle-list-item:hover {
    background-color: #f8f9fa;
}

.list-item-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.list-item-info {
    flex: 1;
}

.list-item-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.list-item-details {
    display: flex;
    gap: 15px;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.list-item-status .status-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-badge.success {
    background: #d5f4e6;
    color: #27ae60;
}

.status-badge.muted {
    background: #f3f4f6;
    color: #374151;
}

.status-badge.processing {
    background: #eef2ff;
    color: #4f46e5;
}

.list-item-meta {
    display: flex;
    gap: 15px;
    color: #95a5a6;
    font-size: 0.85rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-item.updated {
    color: #27ae60;
}

/* Legacy Vehicle Cards Grid (keeping for compatibility) */
.vehicles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

.vehicle-card {
    background: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
}

.vehicle-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.vehicle-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.vehicle-name {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
}

.vehicle-stock {
    font-size: 14px;
    color: #718096;
    font-weight: 500;
}

.vehicle-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.vehicle-status.success {
    background: #c6f6d5;
    color: #22543d;
}

.vehicle-status.danger {
    background: #fed7d7;
    color: #742a2a;
}

.vehicle-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.vehicle-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.vehicle-detail i {
    width: 16px;
    color: #667eea;
}

.vehicle-detail .label {
    color: #718096;
    font-weight: 500;
}

.vehicle-detail .value {
    color: #2d3748;
    font-weight: 600;
}

.vehicle-features {
    border-top: 1px solid #e2e8f0;
    padding-top: 15px;
}

.feature-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.feature-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    background: #edf2f7;
    color: #4a5568;
}

.feature-badge.special {
    background: #fef5e7;
    color: #744210;
}

.vehicle-description {
    font-size: 13px;
    color: #718096;
    line-height: 1.5;
    margin-top: 10px;
}

.description-status {
    font-size: 12px;
    font-weight: 500;
}

.description-status.success {
    color: #38a169;
}

.description-status.muted {
    color: #a0aec0;
}

/* Processing Status Styles */
.vehicle-card.processing {
    border: 2px solid #93c5fd;
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.15);
    animation: processingPulse 2s infinite;
}

@keyframes processingPulse {
    0%, 100% {
        box-shadow: 0 8px 30px rgba(59, 130, 246, 0.15);
        transform: translateY(0px);
    }
    50% {
        box-shadow: 0 8px 30px rgba(59, 130, 246, 0.25);
        transform: translateY(-2px);
    }
}

.processing-indicator {
    display: inline-block;
    margin-left: 8px;
    color: #f59e0b;
}

.no-build-data-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 6px;
    padding: 8px 12px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #92400e;
    font-weight: 500;
}

.no-build-data-warning i {
    color: #f59e0b;
    font-size: 14px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
}

.pagination-btn {
    padding: 12px 20px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

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

.pagination-info {
    color: white;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.2);
    padding: 12px 20px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}



/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    display: none;
    z-index: 1000;
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    max-width: 800px;
    width: 90%;
    max-height: 90%;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 25px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #718096;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: #e53e3e;
    background: rgba(229, 62, 62, 0.1);
}

.modal-body {
    padding: 25px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Custom Scrollbar Styles */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Firefox scrollbar */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
}

.toast {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
    animation: slideInRight 0.3s ease;
}

.toast.success {
    border-left: 4px solid #48bb78;
}

.toast.error {
    border-left: 4px solid #e53e3e;
}

.toast.info {
    border-left: 4px solid #4299e1;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .header-actions {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
    }
   .user-info {
       align-items: flex-start;
    }
    .dashboard-breadcrumbs {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 6px;

    }

   

    .user-dropdown-menu {
        right: 0;
        left: auto;
        min-width: 260px;
    }
    
    .stats-date-controls {
        margin-bottom: 16px;
    }

    .date-filter-container {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin-right: 0;
        padding-right: 0;
        border-right: none;
        padding: 12px;
        width: 100%;
        justify-content: center;
    }
    
    .current-range-display {
        text-align: center;
        font-size: 11px;
    }
    
    .logo h1 {
        font-size: 24px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .search-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        min-width: auto;
    }
    
    .search-filters {
        justify-content: stretch;
    }
    
    .search-filters select {
        flex: 1;
    }
    
    .vehicles-grid {
        grid-template-columns: 1fr;
    }

    .featured-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .featured-section .vehicle-card {
        padding: 16px;
    }
    
    .status-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .status-item {
        padding: 10px 12px;
        font-size: 0.8rem;
    }
    
    .status-item span {
        font-size: 0.75rem;
    }

    .list-item-details {
        flex-direction: column;
        gap: 5px;
    }

    .list-item-meta {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .vehicle-info {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
        text-align: center;
        width: 100%;
        overflow: hidden;
    }
    
    .section-header h2 {
        font-size: 20px;
    }
    
    .pagination {
        flex-direction: column;
        gap: 15px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
}

@media (max-width: 600px) {
    .featured-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 16px;
    }
    
    .featured-section .vehicle-card {
        padding: 14px;
    }
    
    .featured-section .vehicle-name {
        font-size: 1rem;
    }
    
    .featured-section .vehicle-status {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .status-item {
        padding: 8px 10px;
        min-height: 36px;
    }
    
    .feature-badges {
        gap: 6px;
    }
    
    .feature-badge {
        padding: 3px 6px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 20px 0;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-number {
        font-size: 24px;
    }
    
    .search-container {
        padding: 20px;
    }
    
    .vehicle-card {
        padding: 20px;
    }
    
    .featured-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .featured-section .vehicle-card {
        padding: 12px;
    }
    
    .vehicle-header {
        margin-bottom: 12px;
    }
    
    .vehicle-name {
        font-size: 0.95rem;
    }
    
    .vehicle-stock {
        font-size: 0.85rem;
    }
    
    .status-item {
        padding: 6px 8px;
        min-height: 32px;
        font-size: 0.75rem;
    }
    
    .status-item span {
        font-size: 0.7rem;
    }
    
    .modal-body {
        padding: 20px;
    }
}

/* New Enhanced Dashboard Styles */
.processing-status {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.status-row {
    margin-bottom: 8px;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
}

.status-badge.success {
    background: rgba(34, 197, 94, 0.1);
    color: #059669;
}

.status-badge.warning {
    background: rgba(251, 191, 36, 0.1);
    color: #d97706;
}

.status-badge.danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.status-details {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.status-mini {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.05);
}

.status-mini.success {
    background: rgba(34, 197, 94, 0.1);
    color: #059669;
}

.status-mini.muted {
    color: #6b7280;
}

/* Enhanced Modal Styles */
.feature-summary {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.feature-location {
    display: block;
    color: #6b7280;
    font-size: 0.8rem;
    margin-left: 20px;
}

.ai-summary {
    background: rgba(139, 69, 19, 0.1);
    border: 1px solid rgba(139, 69, 19, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-summary i {
    color: #8b4513;
    font-size: 1.2rem;
}

.toggle-button {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 6px;
    padding: 8px 12px;
    color: #4f46e5;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
}

.toggle-button:hover {
    background: rgba(99, 102, 241, 0.15);
}

.ai-details {
    margin-top: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.ai-details pre {
    font-size: 0.8rem;
    line-height: 1.4;
    color: #475569;
    white-space: pre-wrap;
    word-break: break-word;
}

.media-totals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.media-item {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.media-label {
    font-weight: 500;
    color: #065f46;
}

.media-value {
    font-weight: 600;
    color: #047857;
}

/* Enhanced responsive styles for new elements */
@media (max-width: 768px) {
    .media-totals {
        grid-template-columns: 1fr;
    }

    .status-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .processing-status {
        margin-top: 8px;
        padding-top: 8px;
    }
}

/* Additional Modal Status Styles */
.modal-field .status.warning {
    color: #d97706;
}

.status.warning {
    color: #d97706 !important;
}

/* Book Values Styles */
.book-values-container {
    margin-top: 15px;
}

.book-values-empty {
    color: #64748b;
    font-style: italic;
    padding: 15px;
    text-align: center;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.book-values-comparison {
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    width: 100%;
}

.book-values-header {
    display: table;
    width: 100%;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.book-values-header > div {
    display: table-cell;
    padding: 12px 15px;
    font-weight: 600;
    font-size: 14px;
    color: #475569;
    vertical-align: middle;
    border-right: 1px solid #e2e8f0;
}

.book-values-header > div:last-child {
    border-right: none;
}

.key-column {
    width: 15%;
}

.before-column {
    width: 30%;
}

.after-column {
    width: 30%;
}

.difference-column {
    width: 25%;
    text-align: center;
}

.book-values-rows {
    max-height: 300px;
    overflow-y: auto;
    width: 100%;
}

.book-value-row {
    display: table;
    width: 100%;
    border-bottom: 1px solid #f1f5f9;
}

.book-value-row:last-child {
    border-bottom: none;
}

.book-value-row:hover {
    background: #f8fafc;
}

.book-value-key,
.book-value-before,
.book-value-after,
.book-value-difference {
    display: table-cell;
    padding: 12px 15px;
    vertical-align: middle;
    border-right: 1px solid #f1f5f9;
}

.book-value-key {
    width: 15%;
    font-weight: 500;
    color: #334155;
    font-size: 13px;
}

.book-value-before,
.book-value-after {
    width: 30%;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    color: #1e293b;
    text-align: right;
}

.book-value-difference {
    width: 25%;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    border-right: none;
}

.book-value-difference.positive {
    color: #065f46;
    background: #d1fae5;
}

.book-value-difference.negative {
    color: #991b1b;
    background: #fee2e2;
}

.book-value-difference.neutral {
    color: #475569;
    background: #f1f5f9;
}

.book-values-single {
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.book-values-title {
    background: #f8fafc;
    padding: 12px 15px;
    font-weight: 600;
    font-size: 14px;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
}

.book-values-list {
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.book-value-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.book-value-item:last-child {
    border-bottom: none;
}

.book-value-label {
    font-weight: 500;
    color: #334155;
}

.book-value-value {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    color: #1e293b;
    font-weight: 600;
}

/* Responsive styles for book values */
@media (max-width: 768px) {
    .book-values-comparison {
        overflow-x: auto;
    }
    
    .book-values-header,
    .book-value-row {
        min-width: 600px; /* Ensure minimum width for readability */
    }
    
    .book-value-key {
        width: 20%;
    }
    
    .book-value-before,
    .book-value-after {
        width: 25%;
    }
    
    .book-value-difference {
        width: 30%;
    }
    
    .book-value-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* Delete Modal and Button Styles */
.modal-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-small {
    max-width: 500px;
}

.delete-confirmation {
    text-align: center;
    padding: 20px 0;
}

.warning-icon {
    font-size: 48px;
    color: #f59e0b;
    margin-bottom: 15px;
}

.delete-confirmation p {
    margin-bottom: 10px;
    color: #374151;
}

.vehicle-info {
    background: #f3f4f6;
    padding: 10px;
    border-radius: 6px;
    margin: 15px 0;
    font-size: 14px;
    line-height: 1.5;
}

.warning-text {
    color: #dc2626 !important;
    font-weight: 600;
    font-size: 14px;
}

.modal-body .modal-actions {
    justify-content: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-danger {
    background: #dc2626;
    color: white;
    border: 1px solid #dc2626;
}

.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.btn-secondary {
    background: #6b7280;
    color: white;
    border: 1px solid #6b7280;
}

.btn-secondary:hover {
    background: #4b5563;
    border-color: #4b5563;
}

/* Date Range Modal Styles */
.date-range-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.date-input-group label {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.date-input {
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
}

.date-input:hover {
    border-color: #d1d5db;
}

.date-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.date-range-presets h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preset-buttons .btn {
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 6px;
}

.preset-buttons .btn:hover {
    background: #6366f1;
    color: white;
    border-color: #6366f1;
}

/* Enhanced Book Value Modal Styles */
.clickable-card {
    cursor: pointer;
    transition: all 0.2s ease;
}

.clickable-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.book-value-breakdown {
    padding: 0;
}

.breakdown-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
}

.breakdown-summary h4 {
    font-size: 1.3em;
    margin-bottom: 15px;
    opacity: 0.95;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.total-impact {
    font-size: 3.5em;
    font-weight: 700;
    margin: 20px 0;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    letter-spacing: -1px;
}

.impact-description {
    opacity: 0.9;
    font-size: 1.1em;
    font-weight: 300;
}

.breakdown-categories {
    margin-bottom: 20px;
}

.breakdown-categories h5 {
    color: #1f2937;
    font-size: 1.2em;
    margin-bottom: 25px;
    font-weight: 600;
    text-align: center;
    position: relative;
}

.breakdown-categories h5::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

/* Table Styles for Book Value Modal */
.breakdown-table-container {
    margin-bottom: 20px;
}

.breakdown-table-container h5 {
    color: #1f2937;
    font-size: 1.2em;
    margin-bottom: 25px;
    font-weight: 600;
    text-align: center;
    position: relative;
}

.breakdown-table-container h5::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    background: white;
}

.book-value-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.book-value-table thead {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
}

.book-value-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9em;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border: none;
}

.book-value-table th:first-child {
    padding-left: 20px;
}

.book-value-table th:last-child {
    padding-right: 20px;
}

.book-value-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.book-value-table tbody tr:hover {
    background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
    transform: scale(1.005);
}

.book-value-table tbody tr:last-child {
    border-bottom: none;
}

.book-value-table td {
    padding: 16px 12px;
    border: none;
    vertical-align: middle;
}

.book-value-table td:first-child {
    padding-left: 20px;
    font-weight: 600;
    color: #374151;
}

.book-value-table td:last-child {
    padding-right: 20px;
}

.book-value-table .source-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 1em;
}

.book-value-table .currency-value {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-weight: 500;
    font-size: 0.95em;
}

.book-value-table .change-positive {
    color: #059669;
    font-weight: 600;
    background: rgba(5, 150, 105, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.book-value-table .change-negative {
    color: #dc2626;
    font-weight: 600;
    background: rgba(220, 38, 38, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.book-value-table .change-neutral {
    color: #6b7280;
    font-weight: 500;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.book-value-table .impact-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    margin-left: 8px;
}

.book-value-table .impact-positive {
    background: #059669;
    color: white;
}

.book-value-table .impact-negative {
    background: #dc2626;
    color: white;
}

.book-value-table .impact-neutral {
    background: #6b7280;
    color: white;
}

.table-empty {
    text-align: center;
    padding: 60px 30px;
    background: linear-gradient(145deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: 12px;
    border: 2px dashed #d1d5db;
}

.table-empty .empty-icon {
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.6;
}

.table-empty p {
    color: #6b7280;
    font-size: 1.1em;
    font-style: italic;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.category-item {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.category-item:hover {
    background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
    border-color: #cbd5e1;
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.category-item:hover::before {
    transform: scaleX(1);
}

.category-name {
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
    font-size: 1.1em;
    letter-spacing: 0.3px;
}

.category-difference {
    font-size: 1.4em;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.category-difference.positive {
    color: #059669;
    text-shadow: 0 1px 3px rgba(5, 150, 105, 0.2);
}

.category-difference.negative {
    color: #dc2626;
    text-shadow: 0 1px 3px rgba(220, 38, 38, 0.2);
}

.category-difference.neutral {
    color: #6b7280;
    text-shadow: 0 1px 3px rgba(107, 114, 128, 0.2);
}

/* Enhanced modal styles */
.modal-content {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    border: 1px solid #e2e8f0;
    animation: modalSlideIn 0.3s ease-out;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    padding: 25px 30px;
    border-bottom: none;
}

.modal-header h3 {
    font-weight: 600;
    font-size: 1.4em;
    letter-spacing: 0.3px;
}

.modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.modal-body {
    padding: 35px;
}

/* Empty state styling */
.categories-empty {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 60px 30px;
    background: linear-gradient(145deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: 16px;
    border: 2px dashed #d1d5db;
    font-size: 1.1em;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 20px auto;
        border-radius: 16px;
    }
    
    .breakdown-summary {
        padding: 30px 20px;
    }
    
    .total-impact {
        font-size: 2.8em;
    }
    
    .modal-body {
        padding: 25px;
    }
    
    .modal-header {
        padding: 20px 25px;
    }
    
    /* Table responsive adjustments */
    .book-value-table {
        font-size: 0.85em;
    }
    
    .book-value-table th,
    .book-value-table td {
        padding: 12px 8px;
    }
    
    .book-value-table th:first-child,
    .book-value-table td:first-child {
        padding-left: 12px;
    }
    
    .book-value-table th:last-child,
    .book-value-table td:last-child {
        padding-right: 12px;
    }
    
    .book-value-table .impact-icon {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
}

/* Sidebar Styles */
.dashboard-layout {
    display: flex;
    min-height: calc(100vh - 80px);
    position: relative;
    width: 100%;
    overflow-x: hidden;
}

.main-container {
    flex: 1;
    margin-left: 280px;
    min-width: 0;
    width: calc(100% - 280px);
    box-sizing: border-box;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 76px;
    width: 280px;
    height: calc(100vh - 76px);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-right: 1px solid #e2e8f0;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.08);
    z-index: 90;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

.sidebar-header {
    padding: 40px 24px 30px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
    overflow: hidden;
    min-height: 80px;
}

.sidebar-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.1) 75%, transparent 75%, transparent);
    background-size: 20px 20px;
    opacity: 0.1;
    pointer-events: none;
}

.sidebar-header::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.header-content {
    position: relative;
    z-index: 2;
    flex: 1;
}

.header-content h3 {
    margin: 0;
    color: white;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-content h3::before {
    content: '';
    font-size: 24px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

#sidebar-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 18px;
    margin: 0;
    padding: 0;
}

.sidebar-subtitle {
    margin: 6px 0 0 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-subtitle::before {
    content: '';
    font-size: 12px;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 10%);
    position: relative;
}

.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #667eea, #764ba2);
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #5a67d8, #6b46c1);
}

/* Enhanced animations for sidebar elements */
.sidebar {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    transition: all 0.3s ease;
}

.sidebar-header:hover {
    background: linear-gradient(135deg, #5f7cfa 0%, #7c3aed 100%);
}

.book-value-card {
    animation: slideInUp 0.3s ease forwards;
}

.book-value-card:nth-child(1) { animation-delay: 0.1s; }
.book-value-card:nth-child(2) { animation-delay: 0.2s; }
.book-value-card:nth-child(3) { animation-delay: 0.3s; }
.book-value-card:nth-child(4) { animation-delay: 0.4s; }
.book-value-card:nth-child(5) { animation-delay: 0.5s; }

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulse animation for positive/negative indicators */
.card-amount.positive::before {
    animation: pulse 2s infinite;
}

.card-amount.negative::before {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.book-value-controls {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
}

.period-dropdown {
    padding: 8px 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.period-dropdown:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.period-dropdown:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

/* Sidebar card-based design */
.sidebar .book-value-cards {
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: radial-gradient(ellipse at top, rgba(255,255,255,0.1) 0%, transparent 50%);
}

.sidebar .book-value-cards::before {
    content: 'Recent Changes';
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    padding: 0 4px;
}

.book-value-card {
    background: white;
    border: none;
    border-radius: 12px;
    padding: 18px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.book-value-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #e5e7eb, #e5e7eb);
    transition: all 0.3s ease;
}

.book-value-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.book-value-card.positive {
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}

.book-value-card.positive::before {
    background: linear-gradient(90deg, #10b981, #34d399);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.book-value-card.negative {
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
}

.book-value-card.negative::before {
    background: linear-gradient(90deg, #ef4444, #f87171);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.book-value-card.neutral {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
}

.book-value-card.neutral::before {
    background: linear-gradient(90deg, #6b7280, #9ca3af);
}

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

.card-source {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-source::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #16a34a;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.book-value-card.negative .card-source::before {
    background: #dc2626;
}

.book-value-card.neutral .card-source::before {
    background: #6b7280;
}

.card-amount {
    font-size: 16px;
    font-weight: 800;
    font-family: 'Inter', 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', monospace;
    line-height: 1;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-amount.positive {
    color: #059669;
}

.card-amount.positive::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 6px solid #16a34a;
    margin-right: 4px;
    vertical-align: middle;
}

.card-amount.negative {
    color: #dc2626;
}

.card-amount.negative::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 6px solid #dc2626;
    margin-right: 4px;
    vertical-align: middle;
}

.card-amount.neutral {
    color: #6b7280;
}

.card-amount.neutral::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 2px;
    background: #6b7280;
    margin-right: 4px;
    vertical-align: middle;
}

.card-meta {
    font-size: 12px;
    color: #64748b;
    margin-top: 6px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-meta::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 1.5px solid #64748b;
    border-radius: 50%;
    margin-right: 4px;
    position: relative;
    vertical-align: middle;
}

.card-meta::after {
    content: '';
    position: absolute;
    width: 1px;
    height: 3px;
    background: #64748b;
    left: 4px;
    top: 1px;
    transform: rotate(90deg);
}

.sidebar-empty {
    padding: 60px 20px;
    text-align: center;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    margin: 16px;
    border-radius: 12px;
    border: 2px dashed #d1d5db;
}

.sidebar-empty .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-empty p {
    color: #475569;
    font-size: 14px;
    margin: 0;
    font-weight: 500;
    line-height: 1.5;
}

/* Responsive design */
@media (max-width: 1400px) {
    .sidebar {
        width: 260px;
    }
    
    .main-container {
        margin-left: 260px;
        width: calc(100% - 260px);
    }
}

@media (max-width: 1200px) {
    .sidebar {
        width: 240px;
    }
    
    .main-container {
        margin-left: 240px;
        width: calc(100% - 240px);
    }
    
    .sidebar-header {
        padding: 20px 16px;
    }
    
    .header-content h3 {
        font-size: 18px;
    }
    
    .header-content h3::before {
        font-size: 20px;
    }
    
    .sidebar-subtitle {
        font-size: 12px;
    }
    
    .period-dropdown {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .book-value-cards {
        padding: 12px;
        gap: 10px;
    }
    
    .book-value-card {
        padding: 12px;
    }
    
    .card-source {
        font-size: 12px;
    }
    
    .card-amount {
        font-size: 14px;
    }
    
    .vehicles-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 16px;
    }
    
    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* Media query for medium-large screens where 3 columns start to get cramped */
@media (max-width: 1100px) {
    .featured-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
        z-index: 1001;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-container {
        margin-left: 0;
        width: 100%;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: 1000;
        display: none;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    /* Mobile sidebar toggle button */
    .sidebar-toggle {
        position: fixed;
        top: 90px;
        left: 16px;
        z-index: 1002;
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 10px 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .sidebar-toggle:hover {
        background: #f8fafc;
        border-color: #d1d5db;
    }
    
    .sidebar-toggle i {
        color: #374151;
        font-size: 16px;
    }
    
    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
        max-width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 16px;
    }
    
    .main-content {
        padding: 20px 0;
    }
    
    .sidebar-toggle {
        top: 95px;
        left: 12px;
        padding: 8px 10px;
    }
    
    .sidebar-header {
        padding: 18px 16px;
    }
    
    .header-content h3 {
        font-size: 16px;
    }
    
    .header-content h3::before {
        font-size: 18px;
    }
    
    .sidebar-subtitle {
        font-size: 12px;
    }
    
    .sidebar .book-value-cards {
        padding: 16px 12px;
        gap: 12px;
    }
    
    .book-value-card {
        padding: 14px;
    }
    
    .card-source {
        font-size: 13px;
    }
    
    .card-amount {
        font-size: 15px;
    }
    
    .period-dropdown {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .vehicles-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-card {
        min-height: auto;
        padding: 12px 16px;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .main-content {
        padding: 16px 0;
    }
    
    .section-header h2 {
        font-size: 18px;
        word-break: break-word;
    }
    
    .results-count {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .book-value-card {
        padding: 14px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .card-amount {
        align-self: flex-end;
        margin-top: -20px;
    }
}

/* Skeleton Loader Styles */
.skeleton {
    animation: skeleton-loading 1s linear infinite alternate;
    background-color: #f0f0f0;
    position: relative;
    overflow: hidden;
}

.skeleton::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-color: #e2e8f0;
    }
    100% {
        background-color: #f0f4f8;
    }
}

@keyframes skeleton-shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Vehicle Card Skeleton */
.vehicle-card-skeleton {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
}

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

.skeleton-title {
    height: 24px;
    width: 60%;
    border-radius: 4px;
}

.skeleton-badge {
    height: 20px;
    width: 80px;
    border-radius: 12px;
}

.skeleton-content {
    display: grid;
    gap: 10px;
}

.skeleton-line {
    height: 16px;
    border-radius: 4px;
}

.skeleton-line.short {
    width: 40%;
}

.skeleton-line.medium {
    width: 70%;
}

.skeleton-line.long {
    width: 90%;
}

.skeleton-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.skeleton-button {
    height: 36px;
    width: 100px;
    border-radius: 6px;
}

/* Stats Skeleton */
.stat-card-skeleton {
    background: white;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    height: 140px;
}

.skeleton-stat-value {
    height: 36px;
    width: 80%;
    margin: 0 auto 10px;
    border-radius: 4px;
}

.skeleton-stat-label {
    height: 16px;
    width: 60%;
    margin: 0 auto;
    border-radius: 4px;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    text-align: center;
}

.loading-spinner-large {
    font-size: 48px;
    color: #0ea5e9;
    margin-bottom: 20px;
}

.loading-text {
    font-size: 16px;
    color: #64748b;
    margin: 0;
}

/* Smooth transitions */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Featured Section Skeleton Specific Styles */
.skeleton-container .featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    max-width: 100%;
    overflow: hidden;
}

.skeleton-container .featured-section h3,
.skeleton-container .remaining-section h3 {
    color: #64748b;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.skeleton-container .vehicle-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Loading transition for vehicles grid */
#vehicles-grid {
    transition: opacity 0.3s ease;
}

/* Prevent layout shift during loading */
.loading-state {
    min-height: 400px;
}

/* Smooth loading indicator for existing content */
.vehicles-loading-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #64748b;
    z-index: 10;
}

.vehicles-loading-indicator i {
    color: #0ea5e9;
}

/* Enhanced Mobile Responsive Styles */
@media (max-width: 1024px) {
    /* Tablet adjustments */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .vehicle-info {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* Mobile adjustments */
    body {
        font-size: 13px;
    }
    
    /* Header improvements */
    .header {
        padding: 15px 0;
    }
    
    .logo i {
        font-size: 20px;
        padding: 8px;
    }
    
    .logo h1 {
        font-size: 20px;
    }
    
    /* Stats cards - single column */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
        gap: 12px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .stat-number {
        font-size: 22px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    /* Search section */
    .search-container {
        padding: 12px 16px;
        gap: 12px;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .search-box input {
        font-size: 13px;
        padding: 8px 10px 8px 32px;
    }
    
    .search-filters {
        flex-direction: column;
        gap: 8px;
    }
    
    .search-filters select {
        width: 100%;
        min-width: auto;
    }
    
    /* Vehicle cards */
    .vehicles-grid {
        gap: 16px;
    }
    
    .vehicle-card {
        padding: 16px;
    }
    
    .vehicle-name {
        font-size: 14px;
    }
    
    .vehicle-stock {
        font-size: 12px;
    }
    
    .vehicle-detail {
        font-size: 13px;
    }
    
    /* Buttons */
    .btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    /* Modal/Panel - Full screen on mobile */
    #vehicle-panel {
        max-width: 100% !important;
        left: 0 !important;
        right: 0 !important;
    }
    
    /* Vehicle details panel content */
    #vehicle-panel .p-8 {
        padding: 16px !important;
    }
    
    #vehicle-panel .px-8 {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
    
    #vehicle-panel .py-5 {
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }
    
    /* Grid adjustments in panel */
    #vehicle-panel .grid-cols-2,
    #vehicle-panel .md\\:grid-cols-4,
    #vehicle-panel .xl\\:grid-cols-3 {
        grid-template-columns: 1fr !important;
    }
    
    /* Spacing in panel */
    #vehicle-panel .gap-6 {
        gap: 16px !important;
    }
    
    #vehicle-panel .mb-6 {
        margin-bottom: 16px !important;
    }
    
    /* Text sizes in panel */
    #vehicle-panel .text-lg {
        font-size: 16px !important;
    }
    
    #vehicle-panel .text-base {
        font-size: 14px !important;
    }
    
    #vehicle-panel .text-sm {
        font-size: 12px !important;
    }
    
    /* Icon sizes in panel */
    #vehicle-panel .w-10 {
        width: 32px !important;
        height: 32px !important;
    }
    
    /* Table responsiveness */
    table {
        font-size: 12px;
    }
    
    table th,
    table td {
        padding: 8px 12px !important;
    }
    
    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .pagination-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    /* Small mobile adjustments */
    .container {
        padding: 0 10px;
    }
    
    .main-content {
        padding: 16px 0;
    }
    
    /* Even smaller text */
    body {
        font-size: 12px;
    }
    
    .logo h1 {
        font-size: 18px;
    }
    
    /* Compact stats */
    .stat-card {
        padding: 12px;
    }
    
    .stat-number {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    /* Search */
    .search-container {
        padding: 12px;
    }
    
    /* Vehicle cards more compact */
    .vehicle-card {
        padding: 12px;
    }
    
    .vehicle-name {
        font-size: 13px;
    }
    
    /* Buttons more compact */
    .btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    /* Panel header */
    #vehicle-panel .text-xl {
        font-size: 16px !important;
    }
    
    /* Panel footer buttons stack */
    #vehicle-panel .flex.items-center.gap-3 {
        flex-direction: column;
        gap: 8px !important;
    }
    
   
    
    /* Status badges smaller */
    .status-badge,
    .vehicle-status {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    /* Feature badges */
    .feature-badge {
        font-size: 10px;
        padding: 2px 6px;
    }
}

/* Landscape phone orientation */
@media (max-width: 768px) and (orientation: landscape) {
    #vehicle-panel {
        overflow-y: auto;
    }
    
    .header {
        padding: 10px 0;
    }
    
    .stat-card {
        padding: 12px;
    }
}

/* Print styles */
@media print {
    .header,
    .search-section,
    .pagination,
    .btn,
    #vehicle-modal {
        display: none;
    }
    
    .vehicle-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* ========================================
   Dashboard-Specific Styles (from inline)
   ======================================== */

:root {
    --dark-blue: #2F6CB0;
    --light-blue: #ACC2D8;
}

/* Book Value Cards */
.book-value-cards {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.book-value-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #dbe4f0;
    border-radius: 1rem;
    padding: 1.25rem 1.5rem 1.5rem 1.75rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book-value-card::before {
    content: '';
    position: absolute;
    left: 0.85rem;
    top: 1.2rem;
    width: 6px;
    height: calc(100% - 2.4rem);
    border-radius: 9999px;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.85) 0%, rgba(14, 116, 144, 0.85) 100%);
}

.book-value-card.positive::before {
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.95) 0%, rgba(6, 95, 70, 0.9) 100%);
}

.book-value-card.negative::before {
    background: linear-gradient(180deg, rgba(248, 113, 113, 0.95) 0%, rgba(185, 28, 28, 0.9) 100%);
}

.book-value-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.card-source {
    font-size: 0.9rem;
    font-weight: 600;
    color: #3b4a64;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.01em;
}

.card-source::before {
    content: '';
    width: 9px;
    height: 9px;
    border-radius: 9999px;
    background-color: currentColor;
    opacity: 0.7;
}

.card-amount {
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: -0.005em;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.card-amount.positive {
    color: #059669;
}

.card-amount.negative {
    color: #dc2626;
}

.card-amount.neutral {
    color: #64748b;
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.card-label {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #a1acc9;
}

.card-highlight {
    font-size: 0.93rem;
    font-weight: 500;
    color: #1f2a44;
}

.card-highlight.positive {
    color: #047857;
}

.card-highlight.negative {
    color: #b91c1c;
}

.card-meta {
    font-size: 0.82rem;
    color: #64748b;
    display: flex;
    justify-content: space-between;
    font-weight: 500;
}

.card-meta-value {
    font-weight: 600;
}

.card-meta-value.positive {
    color: #047857;
}

.card-meta-value.negative {
    color: #dc2626;
}

.card-meta-value.neutral {
    color: #475569;
}

/* Statistics Cards - Override base styles for dashboard */
.statistics-section .stat-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 0.65rem !important;
    padding: 24px !important;
    background: white !important;
    border-radius: 10px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    border: 1px solid #f1f5f9 !important;
    position: relative !important;
    overflow: visible !important;
}

.statistics-section .stat-card::before {
    display: none !important;
}

.statistics-section .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.statistics-section .stat-card .stat-icon {
    order: 0 !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 20px !important;
    flex-shrink: 0 !important;
    background: linear-gradient(135deg, #7C9FC2, #5788B3) !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(87, 136, 179, 0.2) !important;
}

.statistics-section .stat-card .stat-label {
    order: 1 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.16em !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    color: #8b96b3 !important;
    margin: 0 !important;
}

.statistics-section .stat-card .stat-number {
    order: 2 !important;
    font-size: 1.85rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    letter-spacing: -0.015em !important;
    margin: 0 !important;
}

.statistics-section .grid {
    justify-items: stretch !important;
}

/* Sidebar States */
.sidebar-loading {
    display: none;
    align-items: center;
    gap: 0.6rem;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 500;
}

.sidebar-loading.active {
    display: flex;
}

.sidebar-empty {
    display: none;
    text-align: center;
    padding: 2.5rem 1rem;
    color: #94a3b8;
    font-size: 0.95rem;
}

.sidebar-empty .empty-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.sidebar-empty.active {
    display: block;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    z-index: 10;
    border-radius: 1.5rem;
}

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

.loading-content {
    text-align: center;
    color: #475569;
}

.loading-spinner-large {
    font-size: 1.75rem;
    color: #2563eb;
    margin-bottom: 0.75rem;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-container {
    background: white;
    border-radius: 1.5rem;
    max-width: 56rem;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.18);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay:not(.hidden) .modal-container {
    transform: scale(1);
}

.modal-header {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.75rem;
    overflow-y: auto;
}

/* Toast Notifications */
.toast {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1.25rem;
    border-radius: 0.9rem;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(8px);
}

.toast.info {
    background: rgba(59, 130, 246, 0.9);
    color: white;
}

.toast.success {
    background: rgba(16, 185, 129, 0.9);
    color: white;
}

.toast.error {
    background: rgba(248, 113, 113, 0.95);
    color: white;
}

/* Sidebar Overlay & Toggle */
#sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    z-index: 35;
    display: none;
}

#sidebar-overlay.active {
    display: block;
}

#sidebar-toggle {
    display: none;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.25);
}

/* Tablet Responsive */
@media (max-width: 1024px) {
    #book-value-sidebar {
        position: fixed;
        inset: 0;
        margin: auto;
        width: calc(100% - 3rem);
        max-width: 360px;
        z-index: 40;
        transform: translateX(-200%);
        transition: transform 0.3s ease;
    }

    #book-value-sidebar.mobile-open {
        transform: translateX(0);
    }

    #sidebar-toggle {
        display: inline-flex;
    }
}

@media (min-width: 1025px) {
    #sidebar-overlay {
        display: none !important;
    }

    #sidebar-toggle {
        display: none !important;
    }
}

/* Dashboard Mobile Responsive Enhancements */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    /* Header adjustments */
    header .max-w-7xl {
        padding-left: 1rem;
        padding-right: 1rem;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    header h1 {
        font-size: 1.25rem !important;
    }

    header .text-xs {
        font-size: 0.65rem;
    }

    /* Hide desktop-only elements */
    #refresh-dashboard {
        display: none !important;
    }

    #user-menu-button .hidden {
        display: none !important;
    }

    /* Filters and controls */
    .bg-white\/12 {
        padding: 0.75rem;
    }

    .flex.flex-col.sm\:flex-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    select#store-select,
    select#global-date-filter {
        width: 100%;
        min-width: unset;
        font-size: 0.875rem;
    }

    /* Main content area */
    main {
        padding: 1rem !important;
    }

    /* Statistics grid - 2 columns on mobile */
    .statistics-section .grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .stat-card .stat-number {
        font-size: 1.5rem;
    }

    .stat-card .stat-label {
        font-size: 0.65rem;
    }

    .stat-icon {
        width: 2rem !important;
        height: 2rem !important;
        font-size: 0.875rem !important;
    }

    /* Search and filters section */
    .bg-white.border.rounded-3xl {
        padding: 1rem;
        border-radius: 1.25rem;
    }

    .flex.flex-col.xl\:flex-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    #search {
        font-size: 0.875rem;
        padding: 0.625rem 0.75rem 0.625rem 2.5rem;
    }

    select#status-filter,
    select#description-filter {
        width: 100%;
        min-width: unset;
        font-size: 0.875rem;
    }

    #refresh-button {
        width: 100%;
        justify-content: center;
    }

    /* Results count and export */
    .flex.flex-col.lg\:flex-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    #export-csv {
        width: 100%;
        justify-content: center;
    }

    /* Table - make it scrollable horizontally */
    .border.border-slate-200.rounded-2xl {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
    }

    table th,
    table td {
        padding: 0.75rem;
        font-size: 0.8125rem;
    }

    table th {
        font-size: 0.7rem;
    }

    /* Pagination */
    #pagination {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    #pagination .flex {
        justify-content: center;
    }

    /* Book value sidebar - full width on mobile when open */
    #book-value-sidebar {
        max-width: calc(100% - 2rem) !important;
    }

    .book-value-card {
        padding: 1rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* Modal adjustments */
    .modal-container {
        max-width: calc(100% - 2rem);
        max-height: 95vh;
        border-radius: 1rem;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    /* Vehicle detail panel */
    #vehicle-panel {
        max-width: 100% !important;
    }

    #vehicle-panel .px-8 {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    #vehicle-panel .py-6 {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    #modal-vehicle-title {
        font-size: 1.25rem;
    }

    /* Touch-friendly buttons */
    button,
    select,
    input[type="text"],
    input[type="tel"],
    input[type="date"] {
        min-height: 44px;
        touch-action: manipulation;
    }

    /* Sidebar toggle button */
    #sidebar-toggle {
        bottom: 1rem;
        right: 1rem;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    /* Single column stats on very small screens */
    .statistics-section .grid {
        grid-template-columns: 1fr !important;
    }

    .stat-card {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
        padding: 1rem;
    }

    .stat-card .stat-icon {
        order: 0;
    }

    .stat-card .stat-label {
        order: 1;
    }

    .stat-card .stat-number {
        order: 2;
        margin-left: auto;
    }

    /* Smaller text */
    h1 {
        font-size: 1.125rem !important;
    }

    h2 {
        font-size: 1rem;
    }

    /* Compact filters */
    select {
        font-size: 0.8125rem;
    }

    /* Compact table */
    table th,
    table td {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
}

/* Landscape orientation for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .statistics-section .grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    #book-value-sidebar {
        max-width: 50% !important;
    }
}

/* Touch interaction improvements */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .hover\:bg-slate-800:hover {
        background-color: inherit;
    }

    /* Increase touch targets */
    a, button {
        min-height: 44px;
        min-width: 44px;
    }

    /* Better tap feedback */
    button:active,
    a:active {
        transform: scale(0.98);
        transition: transform 0.1s;
    }
}