/* Add this rule inside the <style> tag */
        #app-container {
            display: none; /* Hide the main app by default */
        }
        /* Ensure html and body take full height for h-screen to work correctly */
        html, body {
            height: 100%;
            overscroll-behavior-y: contain; /* Prevents scrolling of the body when a modal is open */
        }

/* NEW: CSS for Toast Notifications                                                  */
/* ================================================================================= */

.toast {
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    color: white;
    font-weight: 600;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
.toast.show {
    transform: translateX(0);
    opacity: 1;
}
.toast.success {
    background-color: #22c55e; /* green-500 */
}
.toast.error {
    background-color: #ef4444; /* red-500 */
}



.date-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem; /* 12px */
    border-bottom: 2px solid #e5e7eb; /* border-gray-200 */
    margin-top: 1rem; /* 16px */
}
        /* ================================================================================= */
/* START: NEW CSS FOR MOBILE DASHBOARD                                               */
/* ================================================================================= */

/* START: Styles for the "More" Navigation Menu */
.more-menu-modal .modal-content {
    max-width: 100%;
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 1.25rem 1.25rem 0 0; /* Rounded top corners */
    padding: 1rem 1rem 2rem 1rem; /* Adjust padding */
    animation: slideUp 0.3s ease-out forwards;
    max-height: 70vh; /* Limit height */
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.more-menu-modal .menu-item {
    display: flex;
    align-items: center;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    color: #374151; /* text-gray-700 */
    transition: background-color 0.2s ease;
}

.more-menu-modal .menu-item:hover {
    background-color: #f3f4f6; /* text-gray-100 */
}

.more-menu-modal .menu-item i {
    font-size: 1.25rem;
    color: #6b7280; /* text-gray-500 */
    width: 2.5rem; /* Fixed width for alignment */
    text-align: center;
    margin-right: 0.75rem;
}
/* END: Styles for the "More" Navigation Menu */
.dashboard-hero-card {
    border-radius: 1rem;
    padding: 1.5rem;
    color: white;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    cursor: pointer;
}
.dashboard-hero-card:hover {
    transform: translateY(-5px);
}
.dashboard-secondary-card {
    background-color: white;
    border-radius: 1rem;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
}
.dashboard-secondary-card:hover {
    transform: translateY(-5px);
}
.dashboard-secondary-card .icon-wrapper {
    margin: 0 auto 0.75rem;
    height: 3rem;
    width: 3rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
.dashboard-secondary-card .label, .dashboard-summary-list .label {
    font-size: 0.75rem;
    color: #4b5563; /* text-gray-600 */
    font-weight: 500;
}
.dashboard-secondary-card .stat, .dashboard-summary-list .stat {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937; /* text-gray-800 */
}
.dashboard-summary-list {
    background-color: white;
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    cursor: pointer;
}
/* ================================================================================= */
/* END: NEW CSS FOR MOBILE DASHBOARD                                                 */
/* ================================================================================= */
        /* Base styles for the body, setting font and background */
        body {
            font-family: 'Inter', sans-serif;
            background-color: #f0f4f8; /* A slightly cooler, modern background */
        }
        /* Styling for the active navigation link in the bottom bar */
        .nav-link-active {
            background-image: linear-gradient(to right, #1a73e8, #4285f4); /* Stronger Google Blue gradient */
            color: white;
            box-shadow: 0 4px 10px rgba(26, 115, 232, 0.3); /* Stronger, colored shadow */
            transform: scale(1.02); /* Slight scale on active */
        }
        /* Styling for the icon within an active navigation link */
        .nav-link-active i {
            color: white;
        }
        /* Base styles for views, initially hidden with a fade-in animation for smooth transitions */
        .view {
            display: none;
            animation: fadeInSlideUp 0.6s ease-out forwards; /* Combined animation */
        }
        /* Keyframe animation for fading in and sliding up elements */
        @keyframes fadeInSlideUp {
            from { opacity: 0; transform: translateY(20px); } /* Start slightly below and transparent */
            to { opacity: 1; transform: translateY(0); } /* End at original position and fully opaque */
        }
        /* Display active view */
        .view.active {
            display: block;
        }
        /* Hover effect for cards, providing a subtle lift and shadow for interactivity */
        .card-hover {
            transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-8px); /* Lift card slightly more */
            box-shadow: 0 15px 30px rgba(0,0,0,0.15); /* Enhance shadow */
        }
        /* Custom scrollbar for the sidebar to match the theme - now unused for navigation */
        .sidebar-scroll::-webkit-scrollbar {
            width: 6px;
        }
        .sidebar-scroll::-webkit-scrollbar-track {
            background: #f0f2f5; /* Light track */
        }
        .sidebar-scroll::-webkit-scrollbar-thumb {
            background: #a78bfa; /* Purple-300 for thumb */
            border-radius: 10px;
        }
        /* Initially hide "Other" input fields for categories until selected */
        #manage-other-category-wrapper {
            display: none;
        }
        /* Styles for the product search results list, ensuring it's scrollable and well-defined */
        #product-search-results, .product-search-results {
            max-height: 200px;
            overflow-y: auto;
            border: 1px solid #cbd5e1; /* Slate-300 */
            border-radius: 0.75rem; /* More rounded */
            background-color: white;
            box-shadow: 0 4px 10px rgba(0,0,0,0.08);
            margin-top: 0.5rem;
        }
        #product-search-results .search-result-item, .product-search-results .search-result-item {
            padding: 0.85rem 1.25rem;
            cursor: pointer;
            border-bottom: 1px solid #e2e8f0; /* Lighter gray border for separation */
            transition: background-color 0.2s ease;
        }
        #product-search-results .search-result-item:last-child, .product-search-results .search-result-item:last-child {
            border-bottom: none; /* No border for the last item */
        }
        #product-search-results .search-result-item:hover, .product-search-results .search-result-item:hover {
            background-color: #f8fafc; /* Very light hover background */
        }
        /* Styles for disabled form fields to indicate non-interactability */
        .form-field-disabled {
            background-color: #eef2f8; /* Lighter background */
            cursor: not-allowed;
            opacity: 0.8;
        }

        /* Styles for the modal overlay, covering the entire screen with a semi-transparent background */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.6); /* Darker, more prominent overlay */
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 1000; /* Ensure it's on top of other content */
            backdrop-filter: blur(8px); /* Stronger blur effect for background */
            animation: fadeInOverlay 0.3s ease-out forwards;
        }

        /* Keyframe animation for modal overlay fade-in */
        @keyframes fadeInOverlay {
            from { background-color: rgba(0, 0, 0, 0); backdrop-filter: blur(0px); }
            to { background-color: rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px); }
        }

        /* Styles for the modal content, centered and styled for readability */
        .modal-content {
            background-color: white;
            padding: 2.5rem;
            border-radius: 1.25rem; /* More rounded corners */
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3); /* Much stronger shadow for depth */
            width: 90%;
            max-width: 650px; /* Slightly wider max width */
            max-height: 85vh; /* Slightly taller max height */
            overflow-y: auto; /* Enable scrolling if content exceeds height */
            position: relative;
            animation: slideInModal 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards; /* Smooth, bouncy slide-in */
        }

        /* Keyframe animation for modal slide-in from top with bounce */
        @keyframes slideInModal {
            from { transform: translateY(-100px) scale(0.9); opacity: 0; }
            to { transform: translateY(0) scale(1); opacity: 1; }
        }

        /* Styling for active tab buttons within sections */
        .tab-btn-active {
            border-color: #1a73e8; /* Google Blue */
            color: #1a73e8; /* Google Blue text */
            background-color: #e8f0fe; /* Light blue background */
            font-weight: 600;

        }

        /* Custom button styling for a more playful look */
        .btn-primary {
            background-image: linear-gradient(to right, #1a73e8, #4285f4); /* Google Blue gradient */
            color: white;
            padding: 0.75rem 1.5rem;
            border-radius: 0.75rem; /* More rounded */
            font-weight: 600;
            transition: all 0.2s ease-in-out;
            box-shadow: 0 4px 10px rgba(26, 115, 232, 0.2);
            border: none; /* Ensure no default border */
        }
        .btn-primary:hover {
            transform: translateY(-2px) scale(1.02);
            box-shadow: 0 6px 15px rgba(26, 115, 232, 0.3);
        }
        .btn-primary:active {
            transform: translateY(0);
            box-shadow: 0 2px 5px rgba(26, 115, 232, 0.2);
        }

        .btn-secondary {
            background-color: #e0e0e0; /* Light gray */
            color: #333333; /* Dark gray */
            padding: 0.75rem 1.5rem;
            border-radius: 0.75rem;
            font-weight: 600;
            transition: all 0.2s ease-in-out;
            box-shadow: 0 2px 5px rgba(0,0,0,0.05);
            border: none; /* Ensure no default border */
        }
        .btn-secondary:hover {
            background-color: #cccccc; /* Slightly darker gray */
            transform: translateY(-1px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        }
.btn-add-item {
            background-color: #7D26F4; /* A very light gray, almost white */
            border: 2px solid; /* slate-300 */
            color: white; /* gray-600 */
            padding: 0.75rem 1.5rem;
            border-radius: 0.75rem;
            font-weight: 600;
            transition: all 0.2s ease-in-out;
            cursor: pointer;
        }

        .btn-add-item:hover {
            background-color: #5411AB; /* Light Google Blue background */
            color: white; /* Google Blue */
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(26, 115, 232, 0.1);
        }
        /* Input field styling */
        input[type="text"], input[type="number"], input[type="date"], textarea, select {
            border: 1px solid #cbd5e1; /* Slate-300 */
            border-radius: 0.75rem; /* More rounded */
            padding: 0.75rem 1rem;
            transition: all 0.2s ease-in-out;
        }
        input[type="text"]:focus, input[type="number"]:focus, input[type="date"]:focus, textarea:focus, select:focus {
            border-color: #1a73e8; /* Google Blue */
            box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.25); /* Focus ring */
            outline: none;
        }

        /* Responsive adjustments */
        @media (max-width: 768px) {
            /* Main content padding for the new sticky mobile header and bottom nav */
           main {
               padding: 0.5rem; /* Reduced padding for more content space */
                padding-top: 6rem; /* Increased space for the taller sticky header */
                padding-bottom: 5rem; /* Space for the sticky bottom nav */
            }

            .modal-content {
                padding: 1.5rem;
                width: 95%; /* Make modals almost full width on mobile */
                max-width: none; /* Remove max-width constraint */
            }
            /* Adjust button spacing in modals */
            .modal-content .flex.justify-end.space-x-3 {
                flex-direction: column;
                gap: 0.75rem;
            }
            .modal-content .flex.justify-end.space-x-3 button {
                width: 100%;
            }


            /* Adjust font sizes for mobile readability */
            h1 { font-size: 2.5rem; } /* Larger h1 for impact */
            h2 { font-size: 1.75rem; } /* Larger h2 */
            .text-xl { font-size: 1.125rem; } /* Adjusting existing text-xl */
            .text-lg { font-size: 1rem; } /* Adjusting existing text-lg */
            .text-base { font-size: 0.9375rem; } /* Slightly smaller base text */
            .text-sm { font-size: 0.8125rem; } /* Slightly smaller small text */
            .text-xs { font-size: 0.75rem; } /* Keep xs as is */

            /* Form field adjustments for better touch targets and spacing */
            input[type="text"], input[type="number"], input[type="date"], textarea, select {
                padding: 0.9rem 1rem; /* Increase padding for touch */
                font-size: 0.9375rem; /* Ensure readable font size */
            }
            .space-y-5 > div, .space-y-4 > div {
                margin-bottom: 1rem !important; /* Consistent vertical spacing for form fields */
            }
            .grid.grid-cols-12 > div {
                grid-column: span 12 / span 12; /* Force single column for product rows */
            }
            .grid.grid-cols-12 .col-span-1 { /* Adjust trash icon column */
                grid-column: span 2 / span 2;
                display: flex;
                justify-content: flex-end;
                align-items: center;
            }
            .grid.grid-cols-12 .col-span-5, .grid.grid-cols-12 .col-span-4, .grid.grid-cols-12 .col-span-2 {
                grid-column: span 10 / span 10; /* Adjust other columns for single column layout */
            }
            /* [R2] Forms and cards full width for mobile */
            .form-card, .dashboard-card {
                width: 100%;
                box-sizing: border-box; /* Include padding and border in the element's total width */
            }
            /* [R2] Adjust grid columns for mobile to ensure full width */
            .grid-cols-1.sm\:grid-cols-2 > div {
                grid-column: span 1 / span 1; /* Ensure labor form fields stack */
            }
            .md\:grid-cols-2 > div { /* Target generic 2-column grids on mobile, if present */
                grid-column: span 2 / span 2; /* Make them single column on mobile */
            }
            /* [R5] Optimize date filters space for mobile */
            .date-filter-group {
                flex-direction: column;
                gap: 0.5rem;
            }
            .date-filter-group > div {
                width: 100%;
            }
        }

        /* Custom styles for search input with icon to prevent overlap */
        .search-input-container {
            position: relative;
            width: 100%;
        }
        .search-input-container .fa-search {
            position: absolute;
            left: 1rem;
            top: 50%;
            transform: translateY(-50%);
            color: #9ca3af; /* Gray-400 */
            z-index: 10; /* Ensure icon is above input */
        }
        .search-input-container input {
            padding-left: 2.5rem; /* Enough space for the icon */
        }

        /* Style for the bottom navigation bar */
        .bottom-nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 0.5rem 0.25rem;
            flex: 1; /* Distribute space evenly */
            color: #6b7280; /* Gray-500 */
            transition: all 0.2s ease-in-out;
            border-radius: 0.5rem; /* Slightly rounded for touch */
        }
        .bottom-nav-item i {
            font-size: 1.5rem; /* Larger icon size */
            margin-bottom: 0.2rem; /* Small space between icon and text */
        }
        .bottom-nav-item span {
            font-size: 0.7rem; /* Smaller text label */
            font-weight: 500;
        }
        .bottom-nav-item.nav-link-active {
            color: white; /* Active color */
            background-color: #1a73e8; /* Solid background for active */
        }
        .bottom-nav-item:hover {
            background-color: #f3f4f6; /* Light hover background */
            color: #1a73e8; /* Blue hover text */
        }
        .bottom-nav-item.nav-link-active:hover {
            background-color: #4285f4; /* Darker blue on active hover */
            color: white;
        }

        /* Desktop Sidebar Navigation Styles */
        .sidebar {
            width: 250px; /* Fixed width for the sidebar */
            min-width: 250px; /* Prevent shrinking */
            background-color: #ffffff;
            box-shadow: 2px 0 10px rgba(0,0,0,0.05);
            padding: 1.5rem 1rem;
            display: none; /* Hidden by default, shown on md screens */
            flex-direction: column;
            z-index: 20; /* Below mobile header, above main content */
            overflow-y: auto; /* Enable scrolling for many menu items */
        }

        .sidebar .nav-link {
            display: flex;
            align-items: center;
            padding: 0.75rem 1rem;
            border-radius: 0.75rem;
            color: #4b5563; /* Gray-700 */
            font-weight: 500;
            transition: all 0.2s ease-in-out;
            margin-bottom: 0.5rem;
        }

        .sidebar .nav-link i {
            font-size: 1.25rem;
            margin-right: 1rem;
            color: #6b7280; /* Gray-500 */
            transition: color 0.2s ease;
        }

        .sidebar .nav-link:hover {
            background-color: #e8f0fe; /* Light blue hover */
            color: #1a73e8; /* Google Blue text */
        }

        .sidebar .nav-link:hover i {
            color: #1a73e8; /* Google Blue icon */
        }

        .sidebar .nav-link.nav-link-active {
            background-image: linear-gradient(to right, #1a73e8, #4285f4); /* Google Blue gradient */
            color: white;
            box-shadow: 0 4px 10px rgba(26, 115, 232, 0.2);
        }

        .sidebar .nav-link.nav-link-active i {
            color: white;
        }

        /* Adjust main content area for desktop layout */
        @media (min-width: 768px) {
            .sidebar {
                display: flex; /* Show sidebar on medium and larger screens */
            }
            .main-content-area {
                padding-left: 1.5rem; /* Adjust padding for sidebar */
                padding-right: 1.5rem;
                padding-top: 2rem; /* Standard top padding for desktop */
                padding-bottom: 2rem; /* Standard bottom padding for desktop */
            }
            /* Hide mobile header and bottom nav on desktop */
            .mobile-header, .bottom-nav {
                display: none;
            }
            /* [R8] Desktop view: Labor and Tools in single column */
            #labor-records-list, #tools-list { /* Assuming these are the containers for the records */
                grid-template-columns: repeat(1, minmax(0, 1fr)) !important; /* Force single column */
            }
            .md\:grid-cols-2 {
                grid-template-columns: repeat(1, minmax(0, 1fr)); /* Override for desktop */
            }
        }
        /* [R3] Damaged/Lost tool text color */
        .damaged-tool-notes {
            color: #ef4444; /* red-500 */
            font-weight: 600;
        }
        #floating-action-button {
            transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        /* ================================================================================= */
/* START: NEW CSS FOR SPINNER                                                      */
/* ================================================================================= */
#spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.85); /* Slightly more opaque background */
    backdrop-filter: blur(4px); /* Add a blur effect to the background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000; /* Ensure it's on top of everything */
    transition: opacity 0.3s ease-in-out;
    opacity: 0;
    pointer-events: none; /* Allows clicks to go through when hidden */
}

#spinner-overlay.show {
    opacity: 1;
    pointer-events: auto; /* Blocks clicks when visible */
}

.spinner {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    position: relative;
    animation: rotate 1.2s linear infinite;
}
.spinner::before,
.spinner::after {
    content: "";
    box-sizing: border-box;
    position: absolute;
    inset: 0px;
    border-radius: 50%;
    border: 6px solid transparent;
}

/* Blue part of the spinner */
.spinner::before {
    border-top-color: #1a73e8; /* Google Blue */
    border-right-color: #1a73e8;
    animation: rotate-before 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

/* Green part of the spinner */
.spinner::after {
    border-bottom-color: #22c55e; /* Green-500 */
    border-left-color: #22c55e;
    animation: rotate-after 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}


@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes rotate-before {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(180deg); }
}
@keyframes rotate-after {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(-180deg); }
}

/* ================================================================================= */
/* END: NEW CSS FOR SPINNER                                                        */
/* ================================================================================= *//* ================================================================================= */
/* START: NEW CSS FOR SPINNER                                                      */
/* ================================================================================= */
#spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.85); /* Slightly more opaque background */
    backdrop-filter: blur(4px); /* Add a blur effect to the background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000; /* Ensure it's on top of everything */
    transition: opacity 0.3s ease-in-out;
    opacity: 0;
    pointer-events: none; /* Allows clicks to go through when hidden */
}

#spinner-overlay.show {
    opacity: 1;
    pointer-events: auto; /* Blocks clicks when visible */
}

.spinner {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    position: relative;
    animation: rotate 1.2s linear infinite;
}
.spinner::before,
.spinner::after {
    content: "";
    box-sizing: border-box;
    position: absolute;
    inset: 0px;
    border-radius: 50%;
    border: 6px solid transparent;
}

/* Blue part of the spinner */
.spinner::before {
    border-top-color: #1a73e8; /* Google Blue */
    border-right-color: #1a73e8;
    animation: rotate-before 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

/* Green part of the spinner */
.spinner::after {
    border-bottom-color: #22c55e; /* Green-500 */
    border-left-color: #22c55e;
    animation: rotate-after 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}


@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes rotate-before {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(180deg); }
}
@keyframes rotate-after {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(-180deg); }
}

/* ================================================================================= */
/* END: NEW CSS FOR SPINNER                                                        */
/* ================================================================================= */