/* Portal Theme - Matching Original Laravel Portal */
:root {
    --theme-1: #2b3647eb;
    --theme-6: #ef4444;
    --theme-9: #10b981;
    --theme-10: #3b82f6;
    --dark-3: #2b3647eb;
    --dark-5: #334155;
    --dark-6: #475569;
}

body {
    background: #2b3647eb;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Side Navigation */
.side-nav {
    width: 260px;
    background: #2a333f;
    min-height: 100vh;
    position: relative;
    left: 0;
    top: 0;
    z-index: 1000;
    padding: 1.5rem 0 0.5rem 0;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    flex-shrink: 0;
    overflow: visible;
}

.side-nav .intro-x {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.side-nav__devider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.75rem 0;
}

.side-menu {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
    position: relative;
    border-radius: 8px;
    margin: 0 0.75rem;
    width: calc(100% - 1.5rem);
    z-index: 1;
}

/* Hover state - only for non-active items, with lower z-index to stay behind active */
.side-menu:not(.side-menu--active):hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateX(2px);
     border-radius: 12px 0px 0px 12px !important;
    margin: 0 0.75rem;
    width: 260px; /*calc(100% - 1.5rem);*/
    z-index: 0;
}

/* Active state - with left border line that breaks the border */
.side-menu.side-menu--active,
a.side-menu.side-menu--active {
    background: #f1f5f9 !important;
    color: #1e293b !important;
    border-radius: 12px 0px 0px 12px !important;
    margin-left: 20px;
    width: 260px; /*calc(100% - 1.5rem);*/
    
    position: relative;
    overflow: visible;
    z-index: 10 !important;
}

/* Left border line that extends beyond the rounded border - breaks the border 
.side-menu.side-menu--active::before,
a.side-menu.side-menu--active::before {
    content: '';
    position: absolute;
    left: -0.75rem;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #e2e8f0;
    border-radius: 0;
    z-index: 1;
    
}*/

/* Prevent hover effects on active items */
.side-menu.side-menu--active:hover,
a.side-menu.side-menu--active:hover {
    background: #e2e8f0 !important;
    color: #1e293b !important;
    transform: none;
}

/* Ensure the line stays visible on hover */
.side-menu.side-menu--active:hover::before,
a.side-menu.side-menu--active:hover::before {
    background: #e2e8f0;
}

.side-menu.side-menu--active .side-menu__icon,
a.side-menu.side-menu--active .side-menu__icon {
    color: #1e293b !important;
}

.side-menu.side-menu--active .side-menu__icon i,
a.side-menu.side-menu--active .side-menu__icon i,
.side-menu.side-menu--active .side-menu__icon svg,
a.side-menu.side-menu--active .side-menu__icon svg {
    color: #1e293b !important;
    stroke: #1e293b !important;
}

.side-menu.side-menu--active .side-menu__title,
a.side-menu.side-menu--active .side-menu__title {
    color: #1e293b !important;
}

.side-menu__icon {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.side-menu__title {
    flex: 1;
    min-width: 0;
}

.side-menu__sub-icon {
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    margin-left: 0.5rem;
}

.side-menu__sub {
    display: none;
    background: rgba(0, 0, 0, 0.1);
    padding-left: 0;
    margin: 0;
}

.side-menu__sub-open {
    display: block;
}

/* Collapsed Sidebar State */
.side-nav.sidebar-collapsed {
    width: 70px !important;
    transition: width 0.3s ease;
    position: fixed !important;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Hover to expand when collapsed - simple CSS approach */
.side-nav.sidebar-collapsed:hover {
    width: 260px !important;
    position: fixed !important;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-collapsed .sidebar-logo-link {
    padding: 1rem 0.5rem;
    transition: padding 0.3s ease;
}

/* Restore normal logo link padding on hover */
.sidebar-collapsed:hover .sidebar-logo-link {
    padding: 1.5rem;
}

.sidebar-collapsed .sidebar-logo {
    width: 40px;
    height: auto;
    transition: width 0.3s ease;
}

/* Restore normal logo size on hover */
.sidebar-collapsed:hover .sidebar-logo {
    width: 100%;
}

.sidebar-collapsed .side-menu__title {
    opacity: 0;
    visibility: hidden;
    width: 0;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.2s ease 0.25s, visibility 0s ease 0.45s, max-width 0s ease 0.45s;
}

/* Show titles when hovering over collapsed sidebar - delay until sidebar expands */
.sidebar-collapsed:hover .side-menu__title {
    opacity: 1;
    visibility: visible;
    width: auto;
    max-width: 200px;
    transition: opacity 0.2s ease 0.25s, visibility 0s ease 0s, max-width 0.3s ease 0.25s;
}

.sidebar-collapsed .side-menu__sub-icon {
    display: none;
}

/* Show sub-icon when hovering over collapsed sidebar */
.sidebar-collapsed:hover .side-menu__sub-icon {
    display: flex !important;
}

.sidebar-collapsed .side-menu {
    justify-content: center;
    padding: 0.75rem 0.5rem;
    margin: 0 0.5rem;
    width: calc(100% - 1.5rem);
    transition: padding 0.3s ease, margin 0.3s ease, justify-content 0.3s ease;
    overflow: hidden;
}

/* Restore normal menu layout when hovering */
.sidebar-collapsed:hover .side-menu {
    justify-content: flex-start;
    padding: 0.75rem 1.5rem;
    margin: 0 0.75rem;
    width: calc(100% - 1.5rem);
}

.sidebar-collapsed .side-menu__icon {
    margin-right: 0;
    transition: margin-right 0.3s ease 0.2s;
    flex-shrink: 0;
}

/* Restore icon margin when hovering - delay slightly */
.sidebar-collapsed:hover .side-menu__icon {
    margin-right: 0.75rem;
    transition: margin-right 0.3s ease 0.2s;
}

.sidebar-collapsed .side-menu.side-menu--active {
    margin-left: 0.5rem;
    width: calc(100% - 1rem);
    border-radius: 8px;
}

/* Restore active menu style when hovering */
.sidebar-collapsed:hover .side-menu.side-menu--active {
    margin-left: 20px;
    width: 260px;
    border-radius: 12px 0px 0px 12px;
}

.sidebar-collapsed .side-nav__devider {
    margin: 0.5rem 0.25rem;
}

.sidebar-collapsed .opening-times-container {
    display: none;
}

.sidebar-collapsed .side-menu__sub {
    display: none !important;
}

/* Allow submenus to show when hovering over collapsed sidebar if they have the open class */
.sidebar-collapsed:hover .side-menu__sub.side-menu__sub-open {
    display: block !important;
}

.side-menu--has-sub {
    cursor: pointer;
}

.side-menu--has-sub.side-menu--open .side-menu__sub-icon i {
    transform: rotate(180deg);
}

.side-menu__sub-icon {
    margin-left: auto;
    transition: transform 0.2s;
}

.side-menu__sub-icon i {
    transition: transform 0.2s;
}

.side-menu__sub .side-menu {
    padding-left: 3rem;
    font-size: 0.9rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.side-menu__sub li {
    list-style: none;
}

/* Content Area */
.content {
    min-height: 100vh;
    background: #2a333f;
    padding: 20px;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    overflow-x: auto;
    flex: 1;
    min-width: 0;
    transition: margin-left 0.3s ease;
}

/* Push content to the right when sidebar is collapsed and fixed */
.side-nav.sidebar-collapsed ~ .content {
    margin-left: 70px;
}

/* When hovering over collapsed sidebar (expands to 260px), push content accordingly */
.side-nav.sidebar-collapsed:hover ~ .content {
    margin-left: 260px;
}

/* When sidebar is expanded (normal state), no margin needed */
.side-nav:not(.sidebar-collapsed) ~ .content {
    margin-left: 0;
}

.content-inner {
    background: #f1f5f9;
    border-radius: 15px;
    padding: 20px;
    min-height: calc(100vh - 40px);
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    width: 100%;
}

/* Top Bar */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0rem 1.5rem;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 0rem;
}

/* Desktop: show desktop grid, hide mobile grid */
.desktop-credits-grid {
    display: grid;
}

.mobile-credits-grid {
    display: none;
}

/* Box/Card */
.box {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

/* Buttons */
.button {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.bg-theme-1 {
    background-color: var(--theme-1);
    color: white;
}

.bg-theme-9 {
    background-color: var(--theme-9);
    color: white;
}

.text-theme-1 {
    color: var(--theme-1);
}

.text-theme-6 {
    color: var(--theme-6);
}

/* Forms */
.input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    transition: border-color 0.2s;
}

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

.input-form {
    margin-bottom: 1rem;
}

.input-form label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: #374151;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-box {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    display: none;
    z-index: 50;
}

.dropdown:hover .dropdown-box {
    display: block;
}

.dropdown-box__content {
    min-width: 200px;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* Notifications */
.notification {
    position: relative;
    cursor: pointer;
}

.notification--bullet::before {
    content: attr(data-amount);
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--theme-6);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Dark mode support */
.dark {
    color-scheme: dark;
}

.dark .box {
    background: var(--dark-3);
    color: white;
}

.dark .input {
    background: var(--dark-5);
    border-color: var(--dark-6);
    color: white;
}

/* Login Page Styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.intro-x {
    animation: fadeIn 0.5s ease-in;
}

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

.login__input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
}

.login__input:focus {
    outline: none;
    border-color: var(--theme-1);
    box-shadow: 0 0 0 3px rgba(44, 56, 69, 0.1);
}

.login__input-error {
    color: var(--theme-6);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.input--lg {
    padding: 0.875rem 1.25rem;
    font-size: 1.125rem;
}

.border-theme-6 {
    border-color: var(--theme-6) !important;
}

.button--lg {
    padding: 0.875rem 2rem;
    font-size: 1.125rem;
}

/* Flex container */
.flex {
    display: flex;
    width: 100%;
}

.flex-col {
    flex-direction: column;
}

/* Table styles */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
}

.table--sm th,
.table--sm td {
    padding: 0.5rem;
}

/* Grid utilities - Ensure Tailwind grid works properly */
/* Tailwind CDN handles grid, but we add fallbacks for custom classes */
.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

/* Ensure boxes have proper width */
.box {
    width: 100%;
    box-sizing: border-box;
}

/* Fix report boxes */
.report-box--- {
    width: 100%;
}

.report-box--- > div {
    width: 100%;
}

/* Dashboard specific styles */
.padBox1 {
    padding: 51px 0px;
    min-height: 130px;
}

.padBox1a {
    padding: 23px 0px;
    min-height: 130px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.padBox2 {
    padding: 34px 0px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.imgBox {
    width: 64px;
    height: 64px;
    cursor: pointer;
    transition: transform 0.2s;
}

.imgBox:hover,
.imgBox-hover {
    transform: scale(1.1);
}

.marg0auto {
    margin: 0 auto;
}

.dispInline {
    display: inline-block;
    vertical-align: middle;
}

.mr-2 {
    margin-right: 0.5rem;
}

.ml-2 {
    margin-left: 0.5rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-5 {
    margin-top: 1.25rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.pt-4 {
    padding-top: 1rem;
}

.pb-4 {
    padding-bottom: 1rem;
}

.pt-8 {
    padding-top: 2rem;
}

.pl-2 {
    padding-left: 0.5rem;
}

.pr-2 {
    padding-right: 0.5rem;
}

.w-16 {
    width: 4rem;
}

.h-16 {
    height: 4rem;
}

.w-full {
    width: 100%;
}

.m-auto {
    margin: 0 auto;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

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

.cursor-pointer {
    cursor: pointer;
}

.hidden {
    display: none;
}

.border-t {
    border-top: 1px solid #e2e8f0;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.font-medium {
    font-weight: 500;
}

.text-white {
    color: white;
}

.text-gray-600 {
    color: #2a333f;
}

.bg-gray-200 {
    background-color: #e5e7eb;
}

.bg-gray-700 {
    background-color: #374151;
}

.bg-white {
    background-color: white;
}

.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.block {
    display: block;
}

.inline {
    display: inline;
}

.inline-block {
    display: inline-block;
}

.intro-y {
    margin-bottom: 1.5rem;
}

.report-box--- {
    margin-bottom: 0rem;
}

.items-center {
    align-items: center;
}

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

.cursor-pointer {
    cursor: pointer;
}

.hidden {
    display: none;
}

.border-t {
    border-top: 1px solid #e2e8f0;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-5 {
    margin-top: 1.25rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.pt-4 {
    padding-top: 1rem;
}

.pb-4 {
    padding-bottom: 1rem;
}

.pt-8 {
    padding-top: 2rem;
}

.pl-2 {
    padding-left: 0.5rem;
}

.pr-2 {
    padding-right: 0.5rem;
}

.w-16 {
    width: 4rem;
}

.h-16 {
    height: 4rem;
}

.w-full {
    width: 100%;
}

.m-auto {
    margin: 0 auto;
}

.flex-wrap {
    flex-wrap: wrap;
}

.carLogoName {
    background: #374151;
    border-radius: 0.375rem;
    padding: 18px 2px;
    padding-left: 74px;
}

.arrowGraph {
    position: relative;
}

.ecu-selectors {
    display: flex;
    margin-bottom: 1rem;
}

.ecu-selectors button {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    background: white;
    cursor: pointer;
    transition: background 0.2s;
}

.ecu-selectors button:hover {
    background: #f3f4f6;
}

.render-table {
    width: 100%;
    border-collapse: collapse;
}

.render-table th,
.render-table td {
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
}

.no_background {
    background: transparent !important;
}

.tuning_stats_wrap td {
    text-align: center;
}

/* Mobile-specific adjustments - ALL tuning statistics changes are mobile-only */
@media (max-width: 768px) {
    /* Mobile overlay - ensure it's visible and clickable when sidebar is open (MOBILE ONLY) */
    .mobile-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background: rgba(0, 0, 0, 0.5) !important;
        z-index: 9998 !important; /* Behind sidebar (9999) but above content */
        cursor: pointer !important;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1) !important;
        pointer-events: auto !important;
        /* Display controlled by JavaScript - overlay must be set to display: block via JS */
    }
    
    /* Stage 1 column - reduced for mobile */
    .render-table th:nth-child(3),
    .render-table td:nth-child(3) {
        width: 24% !important;
        min-width: 65px !important;
        padding: 0.15rem 0.15rem !important;
    }
    
    /* Stage 2 column - reduced for mobile */
    .render-table th:last-child,
    .render-table td:last-child {
        width: 24% !important;
        min-width: 65px !important;
        padding: 0.15rem 0.15rem !important;
    }
    
    /* VRM/DVLA input box - prevent overflow on mobile */
    #vrm-lookup-container {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }
    
    #vrm-lookup-container .flex {
        width: 100% !important;
        max-width: 100% !important;
        flex-wrap: nowrap !important;
        box-sizing: border-box !important;
    }
    
    .vrm-input {
        max-width: calc(100% - 75px) !important;
        width: auto !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        font-size: 18px !important;
        height: 42px !important;
        line-height: 1 !important;
        padding: 4px 4px 4.5px 4px !important;
        margin: 0 -1px 0 -1px !important;
        border: 2px solid #13547c !important;
        border-left: 0 !important;
        border-right: 0 !important;
        vertical-align: top !important;
    }
    
    .vrm-button {
        flex-shrink: 0 !important;
        min-width: 35px !important;
        max-width: 40px !important;
        box-sizing: border-box !important;
        height: 42px !important;
        padding: 9px 9px 10px 9px !important;
        line-height: 1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border: none !important;
        margin: 0 !important;
        vertical-align: top !important;
    }
    
    .vrm-button--left {
        min-width: 35px !important;
        max-width: 40px !important;
        font-size: 8px !important;
        padding: 4px 8px !important;
        height: 42px !important;
        line-height: 1.2 !important;
        margin: 0 !important;
        vertical-align: top !important;
    }
    
    .vrm-button--right {
        min-width: 35px !important;
        max-width: 40px !important;
        font-size: 16px !important;
        padding: 9px 9px 10px 9px !important;
        height: 42px !important;
        line-height: 1 !important;
        margin: 0 !important;
        vertical-align: top !important;
    }
    
    .vrm-button--right svg {
        width: 14px !important;
        height: 14px !important;
    }
    
    /* Mobile Menu Bar - matching old PHP portal style - MOBILE ONLY */
    .mobile-menu {
        display: block !important;
        position: relative !important;
        z-index: 1 !important; /* Low z-index, part of normal flow */
        width: 100%;
        background: #1e293b; /* Same background as menu bar to cover full width */
    }
    
    .mobile-menu-bar {
        display: flex !important;
        position: relative !important; /* Scrolls with page, not fixed */
        width: 100%;
        background: #1e293b;
        z-index: 1 !important; /* Low z-index */
        padding: 0 0.75rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        margin-left: 0; /* No margin - background covers full width */
        margin-right: 0;
        height: 90px !important;
        overflow: hidden !important;
    }
    
    .mobile-menu-bar .mobile-logo-container {
        text-decoration: none;
        display: flex;
        align-items: center;
        margin-left: auto;
        margin-right: auto;
        flex: 1;
        justify-content: center;
        padding: 0;
        margin: 0;
        position: relative;
        z-index: 2;
        transform: translateY(10px);
    }
    
    .mobile-menu-bar .mobile-logo-container img {
        pointer-events: none;
        cursor: default;
        width: 12.5rem;
        height: auto;
        position: relative;
        top: 0;
        margin: 0;
        padding: 0;
        display: block;
        z-index: 2;
    }
    
    .mobile-menu-bar #mobile-menu-toggler {
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: white;
    }
    
    .mobile-menu-bar #mobile-menu-toggler:hover {
        opacity: 0.8;
    }
    
    .mobile-menu-bar #mobile-menu-toggler i {
        width: 2rem;
        height: 2rem;
        color: white;
        transform: rotate(-90deg);
    }
    
    /* Remove padding-top since menu bar is not fixed */
    .content {
        padding-top: 1.5rem !important;
    }
    
    /* Ensure content and other elements are above mobile menu bar */
    .content,
    .content-inner,
    .top-bar {
        position: relative;
        z-index: 2; /* Above mobile menu bar */
    }
}

/* Mobile Overlay - Desktop: always hidden */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
}

/* Hide upload file button on ALL screens (desktop and mobile) */
.upload-file-btn-desktop {
    display: none !important;
    visibility: hidden !important;
}

/* Desktop: Hide overlay completely */
@media (min-width: 769px) {
    .mobile-overlay {
        display: none !important;
    }
}

/* Mobile Menu - matching old PHP portal style - MOBILE ONLY */
.mobile-menu {
    display: none; /* Hidden by default, shown on mobile */
}

/* Hide on desktop */
@media (min-width: 769px) {
    .mobile-menu {
        display: none !important;
    }
    
    /* Hide credits display on desktop */
    .top-bar .mobile-topbar-credits {
        display: none !important;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    /* Body - allow scrolling */
    body {
        overflow-x: hidden;
        overflow-y: auto;
    }
    
    /* Main flex container - keep horizontal on mobile, sidebar hidden */
    .flex.main-layout {
        min-height: 100vh !important;
        flex-direction: row !important;
    }
    
    /* Sidebar - hidden by default, slides in from left (matching old PHP portal style) */
    .side-nav {
        position: fixed !important;
        left: 0;
        top: 0;
        width: 280px !important;
        height: 100vh;
        z-index: 9999;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: #1e293b !important;
        padding-top: 0rem !important; /* Adjust this to reduce top spacing */
    }
    
    .side-nav.mobile-open {
        transform: translateX(0);
    }
    
    /* Sidebar logo - matching old PHP portal style - same approach as mobile menu bar */
    .side-nav .intro-x {
        padding: 0rem 0.75rem !important;
        height: 98px !important;                    /* Fixed height - adjust to cut more/less from logo */
        overflow: hidden !important;                 /* Clips logo top/bottom */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: relative !important;
        transform: translateY(-10px) !important;     /* Shift logo up within clipped area - adjust value */
        margin-bottom: 0 !important;
        margin-top: 0 !important;
    }
    
    .side-nav .intro-x img {
        width: 12.5rem !important;
        max-width: 200px !important;
        height: auto;
        position: relative !important;
        z-index: 2 !important;
        display: block !important;
    }
    
    /* Menu items - matching old PHP portal style */
    .side-nav .side-menu {
        padding: 0.875rem 1.25rem !important;
        color: rgba(255, 255, 255, 0.8) !important;
        font-size: 14px !important;
        border-radius: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        background: transparent !important;
    }
    
    .side-nav .side-menu:hover {
        background: rgba(255, 255, 255, 0.1) !important;
        color: rgba(255, 255, 255, 1) !important;
        transform: none !important;
    }
    
    /* Active menu item - matching old PHP portal style */
    .side-nav .side-menu.side-menu--active {
        background: #f1f5f9 !important;
        color: #1e293b !important;
        border-radius: 12px, 12px, 0px, 0px !important;
        margin: 0 !important;
        width: 100% !important;
    }
    
    .side-nav .side-menu.side-menu--active .side-menu__icon,
    .side-nav .side-menu.side-menu--active .side-menu__title {
        color: #1e293b !important;
    }
    
    .side-nav .side-menu.side-menu--active .side-menu__icon i,
    .side-nav .side-menu.side-menu--active .side-menu__icon svg {
        color: #1e293b !important;
        stroke: #1e293b !important;
    }
    
    /* Menu dividers - matching old PHP portal style */
    .side-nav__devider {
        height: 1px !important;
        background: #415266 !important;
        margin: 1.5rem 0 !important;
    }
    
    /* Hide duplicate consecutive dividers on mobile - hide second divider if it immediately follows another divider */
    .side-nav ul > li.side-nav__devider + li.side-nav__devider {
        display: none !important;
    }
    
    /* Sub-menu styling - matching old PHP portal */
    .side-nav .side-menu__sub {
        background: rgba(0, 0, 0, 0.15) !important;
        padding-left: 0 !important;
        margin: 0 !important;
    }
    
    .side-nav .side-menu__sub .side-menu {
        padding-left: 3rem !important;
        font-size: 0.9rem !important;
    }
    
    /* Content area - full width, no sidebar offset (MOBILE ONLY) */
    .content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 10px !important;
        min-height: 100vh !important;
        background: #1e293b !important;
    }
    
    /* Inner content div - natural flow, no forced heights (MOBILE ONLY) */
    .content-inner {
        background: #f1f5f9 !important;
        border-radius: 10px !important;
        padding: 15px !important;
        min-height: auto !important;
        height: auto !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Remove any forced stacking or overflow (MOBILE ONLY) */
    .content-inner > * {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Top bar - compact */
    .top-bar {
        padding: 0.75rem !important;
        flex-wrap: nowrap !important;
        gap: 0.5rem;
        margin-bottom: 0.75rem;
        background: white;
        border-radius: 8px;
        justify-content: space-between !important;
        align-items: center !important;
        position: relative !important;
    }
    
    .top-bar > * {
        flex: 0 0 auto !important;
        min-width: 0;
    }
    
    /* Hide welcome text on mobile */
    .top-bar h2 {
        display: none !important;
    }
    
    /* Hide upload file button on mobile */
    .upload-file-btn-desktop {
        display: none !important;
    }
    
    /* Notifications - left side on mobile */
    .top-bar .mobile-topbar-notifications {
        margin-right: 0 !important;
        margin-left: 0 !important;
        order: 1 !important;
        flex: 0 0 auto !important;
    }
    
    /* Notifications dropdown - open to the right on mobile */
    .top-bar .mobile-topbar-notifications .dropdown-box {
        right: auto !important;
        left: 0 !important;
    }
    
    /* Language selector - center on mobile */
    .top-bar .mobile-topbar-language {
        position: absolute !important;
        left: 35% !important;
        transform: translateX(-50%) !important;
        margin: 0 !important;
        order: 2 !important;
        z-index: 1;
        width: auto !important;
    }
    
    /* Credits display - between language and profile on mobile, equal spacing */
    .top-bar .mobile-topbar-credits {
        order: 3 !important;
        flex: 0 0 auto !important;
        position: absolute !important;
        left: calc(38% + 60px) !important;
        transform: translateX(0) !important;
        margin: 0 !important;
        display: flex !important;
        align-items: center !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 1 !important;
        gap: 0.25rem !important;
    }
    
    .top-bar .mobile-topbar-credits .mobile-credits-icon {
        width: 1.25rem !important;
        height: 1.25rem !important;
        flex-shrink: 0;
        color: #374151;
    }
    
    .top-bar .mobile-topbar-credits span {
        font-size: 0.875rem !important;
        line-height: 1;
        white-space: nowrap;
        color: #000000 !important;
        font-weight: 500 !important;
    }
    
    /* Profile pic - right side on mobile - fix zoom issue and increase touch target */
    .top-bar .mobile-topbar-account {
        margin-left: auto !important;
        margin-right: -0.9rem !important;
        order: 4 !important;
        flex: 0 0 auto !important;
        flex-shrink: 0 !important;
        padding: 0.75rem !important; /* Much larger touch target area - all sides */
        min-width: 3.75rem !important; /* Even larger minimum size */
        min-height: 3.75rem !important; /* Even larger minimum size */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: relative !important;
        z-index: 10 !important; /* Ensure it's above other elements */
        cursor: pointer !important; /* Make entire container clickable */
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1) !important; /* Visual feedback on tap */
        background: transparent !important; /* No background */
        border: none !important; /* No border */
        box-shadow: none !important; /* No shadow */
    }
    
    /* Override w-8 h-8 classes on mobile for larger touch target */
    .top-bar .mobile-topbar-account.w-8,
    .top-bar .mobile-topbar-account.w-8.h-8 {
        width: auto !important;
        height: auto !important;
        min-width: 3.75rem !important;
        min-height: 3.75rem !important;
    }
    
    .top-bar .mobile-topbar-account .dropdown-toggle,
    .top-bar .mobile-topbar-account .dropdown-toggle.image-fit {
        overflow: visible !important;
        padding: 0.625rem !important; /* Even more padding for much easier clicking */
        cursor: pointer !important;
        -webkit-tap-highlight-color: transparent !important;
        width: auto !important; /* Remove fixed width */
        height: auto !important; /* Remove fixed height */
        min-width: 3rem !important; /* Larger minimum touch target size */
        min-height: 3rem !important; /* Larger minimum touch target size */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: relative !important;
        z-index: 11 !important;
        flex: 1 !important; /* Fill available space in parent */
        background: transparent !important; /* No background */
        border: none !important; /* No border */
        box-shadow: none !important; /* Remove shadow-lg shadow */
        border-radius: 0 !important; /* Remove rounded-full border radius initially */
    }
    
    .top-bar .mobile-topbar-account .dropdown-toggle.w-8,
    .top-bar .mobile-topbar-account .dropdown-toggle.w-8.h-8 {
        width: auto !important;
        height: auto !important;
        min-width: 3rem !important;
        min-height: 3rem !important;
    }
    
    .top-bar .mobile-topbar-account .dropdown-toggle img {
        object-fit: cover !important;
        width: 2rem !important;
        height: 2rem !important;
        transform: scale(1) !important;
        pointer-events: none !important; /* Allow clicks through to parent */
        border-radius: 50% !important; /* Make image itself circular, not the container */
    }
    
    .top-bar .mobile-topbar-account.zoom-in {
        transform: scale(1) !important;
    }
    
    .top-bar .mobile-topbar-account.zoom-in .dropdown-toggle {
        transform: scale(1) !important;
    }
    
    /* Equal spacing for all top bar items on mobile */
    .top-bar {
        justify-content: space-between !important;
        gap: 0.5rem !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        overflow-x: visible !important;
    }
    
    /* Hide file credits container on mobile */
    #report-area .grid > div.order-2 .report-box--- {
        display: none !important;
    }
    
    /* Hide "Upload this vehicle" button on mobile */
    #upload-this-vehicle-btn {
        display: none !important;
    }
    
    /* Hide upload file modal on mobile */
    #upload-file-modal {
        display: none !important;
    }
    
    /* Hide any upload-related buttons on mobile */
    button[onclick*="openUploadFileModal"],
    button[onclick*="openUploadVehicleSelection"],
    .btn-upload-vehicle {
        display: none !important;
    }
    
    /* Hide RSS/News feed on mobile */
    #rss-feed-section,
    .rss-feed-container,
    .rss-slideshow-container {
        display: none !important;
    }
    
    /* Compact padding */
    .padBox1 {
        padding: 10px 5px;
    }
    
    .padBox1a {
        padding: 4px 5px !important;
        min-height: 80px !important;
    }
    
    /* Reduce gap between file room status and file credits containers on mobile */
    /* Target only the first container (file room status) */
    #report-area .grid > div:first-child .report-box---,
    #report-area .grid > div.order-1 .report-box--- {
        margin-top: -19px !important;
    }
    
    /* Target only the second container (file credits) */
    #report-area .grid > div:last-child .report-box---,
    #report-area .grid > div.order-2 .report-box--- {
        margin-top: -55px !important;
    }
    
    /* Reduce gap in the grid */
    #report-area .grid {
        gap: 0.25rem !important;
    }
    
    /* Hide desktop credits grid on mobile */
    .desktop-credits-grid {
        display: none !important;
    }
    
    /* Show mobile credits grid on mobile */
    .mobile-credits-grid {
        display: block !important;
    }
    
    /* Hide EVC credits on mobile */
    .evc-credits {
        display: none !important;
    }
    
    /* Force file credits values to black on mobile */
    .mobile-credits-grid .text-black,
    .mobile-credits-grid p.text-2xl {
        color: #000000 !important;
    }
    
    .padBox2 {
        padding: 10px 5px;
    }
    
    /* Tables - scrollable */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        font-size: 13px;
    }
    
    /* Responsive text */
    h1 { font-size: 1.25rem !important; margin: 0.75rem 0 !important; }
    h2 { font-size: 1.1rem !important; margin: 0.5rem 0 !important; }
    h3 { font-size: 1rem !important; margin: 0.5rem 0 !important; }
    
    /* Cards and boxes */
    .box, .card {
        margin: 8px 0;
        padding: 12px;
        border-radius: 8px;
    }
    
    /* Buttons - full width, touch friendly */
    button, .btn {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin: 4px 0;
    }
    
    /* Menu items - styled above in sidebar section */
    
    /* Grids - single column */
    .grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    
    /* Remove forced heights and widths */
    .content-inner,
    .content > div {
        min-height: auto !important;
        max-width: 100% !important;
    }
    
    /* Ensure all containers respect viewport */
    * {
        max-width: 100vw !important;
    }
    
    /* Fix any absolute/fixed positioning issues */
    .content-inner > * {
        position: relative !important;
    }
    
    /* Prevent horizontal overflow */
    body, html {
        overflow-x: hidden !important;
        width: 100% !important;
    }
}

/* Vehicle Type Icons - Compact Style (Legacy) */
.imgBox {
    width: 64px;
    height: 64px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
    border-radius: 4px;
    padding: 4px;
}

.imgBox:hover {
    opacity: 0.7;
    transform: scale(1.05);
}

.imgBox-hover {
    opacity: 0.5 !important;
    background-color: rgba(59, 130, 246, 0.1);
    border: 2px solid #3b82f6;
}

/* Modern Vehicle Selection - Progressive Reveal */
.vehicle-type-card {
    display: inline-block;
}

.vehicle-type-card input:checked + div {
    border-color: #3b82f6 !important;
    background-color: #dbeafe !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.vehicle-type-card input:checked + div span {
    color: #2563eb !important;
    font-weight: 600;
}

.vehicle-dropdown-wrapper {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease-out;
}

.vehicle-dropdown-wrapper[style*="display: block"] {
    opacity: 1;
    transform: translateY(0);
}

.vehicle-select {
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

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

/* Compact layout for vehicle selection */
#vehicle-dropdown-container {
    max-width: 100%;
}

@media (min-width: 768px) {
    #vehicle-dropdown-container .flex {
        justify-content: flex-start;
    }
}

/* Vehicle Selection Modal - Modern Interactive Design */
.vehicle-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.vehicle-type-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.vehicle-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.vehicle-modal-dialog {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: auto;
}

.vehicle-modal-content {
    position: relative;
    width: 100%;
    max-width: 1336px;
    max-height: 90vh;
    background: #1e293b;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

.vehicle-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.vehicle-modal-back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.vehicle-modal-back-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.vehicle-modal-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.vehicle-modal-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.vehicle-modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0 2.5rem 2.5rem 2.5rem;
}

.vehicle-modal-search {
    margin-bottom: 1rem;
    margin-top: 1rem;
}

.vehicle-search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    transition: all 0.2s;
}

.vehicle-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.vehicle-search-input:focus {
    outline: none;
    border-color: #3b82f6;
    background-color: rgba(255, 255, 255, 0.15);
}

.vehicle-modal-content-area {
    flex: 1;
    overflow-y: auto;
    max-height: calc(90vh - 200px);
    padding-right: 1rem;
}

/* Scrollbar styling for dark theme */
.vehicle-modal-content-area::-webkit-scrollbar {
    width: 8px;
}

.vehicle-modal-content-area::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.vehicle-modal-content-area::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.vehicle-modal-content-area::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Make Grid Layout - Match Ultratec Style (8 columns) */
.vehicle-makes-grid {
    display: grid !important;
    grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
    gap: 1rem;
    margin: 0;
    padding: 0;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    justify-items: stretch;
    align-items: stretch;
}

@media (max-width: 1400px) {
    .vehicle-makes-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 1024px) {
    .vehicle-makes-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 640px) {
    .vehicle-makes-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

.vehicle-make-item {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem 1rem;
    background: #2a333f !important;
    border: 1px solid #2a333f;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 140px;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    overflow: hidden;
}

.vehicle-make-item:hover {
    background: #3c4655e5 !important;
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.vehicle-make-item img {
    max-width: 100px;
    max-height: 70px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin-bottom: 0.75rem;
    display: block;
    /* No filter - show logos in original colors */
}

.vehicle-make-item span {
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    word-break: break-word;
}

/* Models Grid - Multi-column layout like Ultratec */
.items-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem !important;
    margin-top: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.items-grid.models.in-modal {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 0.75rem !important;
    margin: 0 auto !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

@media (max-width: 1200px) {
    .items-grid,
    .items-grid.models.in-modal {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

/* My Files table headers - desktop: show desktop text, hide mobile text */
#files-table thead th .desktop-header-text {
    display: inline !important;
}

#files-table thead th .mobile-header-text {
    display: none !important;
}

/* File Detail Table headers - desktop: show desktop text, hide mobile text */
.file-detail-table td .desktop-header-text {
    display: inline !important;
}

.file-detail-table td .mobile-header-text {
    display: none !important;
}

@media (max-width: 768px) {
    .items-grid,
    .items-grid.models.in-modal {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    
    /* My Files table - mobile only: hide vehicle description, make more compact */
    #files-table {
        font-size: 0.75rem !important; /* Smaller font */
    }
    
    #files-table thead th {
        padding: 0.5rem 0.5rem !important; /* Reduce header padding */
        font-size: 0.7rem !important;
    }
    
    #files-table tbody td {
        padding: 0.5rem 0.5rem !important; /* Reduce cell padding */
        font-size: 0.75rem !important;
    }
    
    /* Mobile header text - show mobile versions, hide desktop versions */
    #files-table thead th .desktop-header-text {
        display: none !important;
    }
    
    #files-table thead th .mobile-header-text {
        display: inline !important;
    }
    
    /* Hide vehicle description text on mobile - keep only logo */
    #files-table .vehicle-description-text {
        display: none !important;
    }
    
    /* Make vehicle logo smaller on mobile */
    #files-table tbody td:nth-child(2) img {
        width: 1.5rem !important;
        height: 1.5rem !important;
        min-width: 1.5rem !important;
        min-height: 1.5rem !important;
    }
    
    /* Make vehicle icon (feather icon) smaller on mobile */
    #files-table tbody td:nth-child(2) i[data-feather] {
        width: 1.5rem !important;
        height: 1.5rem !important;
    }
    
    /* Ensure vehicle column only shows logo - reduce width */
    #files-table tbody td:nth-child(2) {
        width: auto !important;
        min-width: 2rem !important;
        max-width: 3rem !important;
    }
    
    /* Make status badge smaller */
    #files-table tbody td:nth-child(4) .inline-flex.items-center {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.65rem !important;
    }
    
    /* Reduce spacing in vehicle column flex container */
    #files-table tbody td:nth-child(2) .flex.items-center {
        gap: 0 !important;
    }
    
    /* Make date column more compact */
    #files-table tbody td:nth-child(1) {
        white-space: nowrap !important;
        width: auto !important;
        min-width: 4rem !important;
    }
    
    /* Make registration column more compact */
    #files-table tbody td:nth-child(3) {
        white-space: nowrap !important;
        width: auto !important;
        min-width: 4rem !important;
    }
    
    /* File Detail Page - Vehicle Information Table - Mobile Only */
    .file-detail-table {
        font-size: 0.75rem !important;
        width: 100% !important;
        table-layout: fixed !important;
    }
    
    .file-detail-table td {
        padding: 0.5rem 0.5rem !important;
        word-wrap: break-word !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
        vertical-align: top !important;
    }
    
    .file-detail-table td:first-child {
        width: 38% !important;
        max-width: 38% !important;
        font-weight: 600 !important;
        padding-right: 0.25rem !important;
    }
    
    .file-detail-table td:last-child {
        width: 62% !important;
        max-width: 62% !important;
        padding-left: 0.75rem !important; /* Move text to the right to prevent crossing over title */
    }
    
    /* Vehicle Information table - ensure long text wraps */
    .file-detail-table .info-value {
        word-wrap: break-word !important;
        word-break: break-word !important;
        display: inline-block !important;
        max-width: 100% !important;
    }
    
    /* Chat box - fix camera icon off screen - Mobile Only */
    .chat-input-wrapper {
        padding: 6px 8px !important;
        gap: 6px !important;
        align-items: flex-end !important;
        overflow: hidden !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .chat-input-wrapper .flex.flex-col {
        flex: 1 !important;
        min-width: 0 !important;
        max-width: calc(100% - 110px) !important; /* Reserve space for buttons */
        width: auto !important;
    }
    
    .chat-input-wrapper .flex.flex-col.w-full {
        width: auto !important;
        max-width: calc(100% - 110px) !important;
    }
    
    .chat-textarea {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        padding: 6px 8px !important;
        font-size: 0.8rem !important;
        box-sizing: border-box !important;
    }
    
    .chat-action-buttons {
        display: flex !important;
        align-items: center !important;
        gap: 3px !important;
        padding-left: 6px !important;
        border-left: 1px solid #e2e8f0 !important;
        flex-shrink: 0 !important;
        width: auto !important;
        min-width: fit-content !important;
        margin-left: auto !important;
    }
    
    .chat-icon-button {
        width: 28px !important;
        height: 28px !important;
        flex-shrink: 0 !important;
        min-width: 28px !important;
        min-height: 28px !important;
        padding: 0 !important;
    }
    
    .chat-icon-button i {
        width: 14px !important;
        height: 14px !important;
    }
    
    /* Ensure chat input container fits on screen */
    .chat-input-container {
        padding: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    
    /* Make warranty info more compact on mobile */
    .file-detail-table .flex.flex-row {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        padding-left: 0.75rem !important; /* Add padding to prevent crossing over title */
    }
    
    .file-detail-table .flex.flex-row > * {
        flex-shrink: 1 !important;
        min-width: 0 !important;
    }
    
    /* Vehicle Registration value already has padding from td:last-child rule above */
    
    /* Expired badge - add padding/margin to prevent crossing over title */
    #warranty-status-badge {
        margin-left: 0.75rem !important;
    }
    
    /* Warranty countdown text - add padding if needed */
    #warranty-countdown {
        padding-left: 0.25rem !important;
    }
    
    /* Connection Method - show mobile text, hide desktop text on mobile */
    .file-detail-table td .desktop-header-text {
        display: none !important;
    }
    
    .file-detail-table td .mobile-header-text {
        display: inline !important;
    }
}

.items-grid > div {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.items-grid .entry {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #ef4444;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.items-grid .entry-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.items-grid .entry-list li {
    display: flex !important;
    align-items: center !important;
    padding: 0.25rem 0 !important;
    list-style: none !important;
}

.bullet.bullet-dot {
    width: 6px;
    height: 6px;
    background-color: #3b82f6;
    border-radius: 50%;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.items-grid .entry-list a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
    cursor: pointer;
    display: block;
}

.items-grid .entry-list a:hover {
    color: white;
    text-decoration: underline;
}

.vehicle-make-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 140px;
}

.vehicle-make-item:hover {
    background-color: #3c4655e5;
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.vehicle-make-item img {
    max-width: 80px;
    max-height: 60px;
    object-fit: contain;
    margin-bottom: 0.75rem;
    /* No filter - show logos in original colors */
}

.vehicle-make-item span {
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
}

/* Model Columns Layout */
.vehicle-models-columns {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
}

.vehicle-model-category {
    display: flex;
    flex-direction: column;
}

.vehicle-model-category h5 {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #ef4444;
}

.vehicle-model-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.vehicle-model-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    background-color:#3c4655 ;
}

.vehicle-model-bullet {
    width: 6px;
    height: 6px;
    background-color: #3b82f6;
    border-radius: 50%;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.vehicle-model-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
    cursor: pointer;
}

.vehicle-model-link:hover {
    color: white;
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Ensure content area and grid work properly in vehicle box */
#vehicle-box-content-area {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

#vehicle-box-content-area .vehicle-makes-grid {
    display: grid !important;
    grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
    gap: 0.50rem !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

@media (max-width: 1400px) {
    #vehicle-box-content-area .vehicle-makes-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 1024px) {
    #vehicle-box-content-area .vehicle-makes-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 640px) {
    #vehicle-box-content-area .vehicle-makes-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
    opacity: 0;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 1;
}

.modal__content {
    background-color: #fff;
    margin: auto;
    padding: 0;
    border: none;
    width: 90%;
    max-width: 600px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.modal.show .modal__content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Admin Message Modal Specific Styles */
#popup-modal-admin-message .modal__content {
    overflow: hidden;
}

#popup-modal-admin-message .modal__content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

#popup-modal-admin-message .modal__content .box {
    background: transparent;
    border: none;
    padding: 1.5rem;
    margin: 0;
    max-height: 60vh;
    overflow-y: auto;
}

#popup-modal-admin-message .modal__content .box::-webkit-scrollbar {
    width: 8px;
}

#popup-modal-admin-message .modal__content .box::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

#popup-modal-admin-message .modal__content .box::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

#popup-modal-admin-message .modal__content .box::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

#popup-modal-admin-message .modal__content a[data-dismiss="modal"] {
    z-index: 10;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

#popup-modal-admin-message .modal__content a[data-dismiss="modal"]:hover {
    background-color: #f3f4f6;
    transform: scale(1.1);
}

#popup-modal-admin-message .modal__content a[data-dismiss="modal"] i {
    width: 20px;
    height: 20px;
    color: #6b7280;
}

#popup-modal-admin-message .modal__content button {
    padding: 0.625rem 1.5rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.25);
}

#popup-modal-admin-message .modal__content button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.35);
}

#popup-modal-admin-message .modal__content button:active {
    transform: translateY(0);
}