/* Color Palette:
    Primary Blue: #4A90E2
    Darker Blue: #2C5F9B
    Light Blue: #EBF4FF
    Accent Green: #6DD47E
    Darker Green: #4CAF50
    Even Darker Green: #065F46
    Light Grey: #A0AEC0
    Dark Grey: #4A5568
    Red (for errors/warnings): #EF4444 / #B91C1C / #FEE2E2 / #FCA5A5

    --- NEW Velzon-inspired Palette ---
    Dark Sidebar BG: #2a3042
    Dark Sidebar Link: #a0a6bd
    Dark Sidebar Link Active: #ffffff
    Dark Sidebar Menu Title: #6c757d
    Main BG: #f3f3f9
    Top Header BG: #ffffff
    Card BG: #ffffff
    Border Color: #e9e9ef
    Primary Text: #495057
    Secondary Text: #6c757d
*/

/* Custom Scrollbar for Dropdowns */
.scrollbar-hide {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.custom-scrollbar-hover {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.custom-scrollbar-hover:hover {
    scrollbar-color: #cbd5e1 transparent;
}

.custom-scrollbar-hover::-webkit-scrollbar {
    width: 6px;
    background: transparent;
}

.custom-scrollbar-hover::-webkit-scrollbar-thumb {
    background-color: transparent;
    border-radius: 20px;
}

.custom-scrollbar-hover:hover::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
}

.custom-scrollbar-hover::-webkit-scrollbar-track {
    background: transparent;
}

/* --- NEW: Import Inter Font --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');


/* Base styles */
html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    /* --- NEW: Set new font --- */
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    background-color: #F0F2F5;
    /* Default light background */
}

/* --- START: NEW VELZON ADMIN LAYOUT STYLES --- */

/* =========================================
   THEME VARIABLES SETUP
   ========================================= */
:root {
    /* Default Theme (Dark/Classic Black - similar to current) */
    --sidebar-bg: #2a3042;
    --sidebar-item-color: #a0a6bd;
    --sidebar-item-hover-color: #ffffff;
    --sidebar-item-hover-bg: rgba(255, 255, 255, 0.05);
    --sidebar-active-color: #ffffff;
    --sidebar-active-bg: transparent;
    /* Or specific color if needed */
    --sidebar-menu-header-color: #6c757d;
    --logo-color: #ffffff;
    --sidebar-border-color: rgba(255, 255, 255, 0.05);
}

/* Theme 1: Original (Gradient Blue Turquoise) - Matches Client Portal */
body[data-theme="original"] {
    --sidebar-bg: linear-gradient(to bottom, #4a90e2, #50e3c2);
    --sidebar-item-color: #e0f2fe;
    /* Very light blue */
    --sidebar-item-hover-color: #ffffff;
    --sidebar-item-hover-bg: rgba(255, 255, 255, 0.2);
    --sidebar-active-color: #ffffff;
    --sidebar-active-bg: rgba(255, 255, 255, 0.1);
    /* Added explicit active bg */
    --sidebar-menu-header-color: #cffafe;
    /* Cyan 100 */
    --logo-color: #ffffff;
    --sidebar-border-color: rgba(255, 255, 255, 0.2);
}

/* Theme 2: UP Maroon (Refined: Dark Base with Maroon/Gold Accents) */
body[data-theme="up_maroon"] {
    --sidebar-bg: #2e0809;
    /* Deep, dark maroon (almost black) - much easier on the eyes */
    --sidebar-item-color: #e5e7eb;
    /* Light gray text */
    --sidebar-item-hover-color: #fbbf24;
    /* UP Gold text on hover */
    --sidebar-item-hover-bg: rgba(123, 17, 19, 0.2);
    /* Subtle maroon tint on hover */
    --sidebar-active-color: #fbbf24;
    /* UP Gold text for active item */
    --sidebar-active-bg: #7b1113;
    /* The bright UP Maroon applies ONLY to the active item */
    --sidebar-menu-header-color: #9ca3af;
    /* Gray 400 */
    --logo-color: #ffffff;
    /* White logo */
    --sidebar-border-color: rgba(255, 255, 255, 0.05);
}

/* Theme 3: Classic Black (Darker than default) */
body[data-theme="dark"] {
    --sidebar-bg: #0f172a;
    /* Slate 900 / Black */
    --sidebar-item-color: #94a3b8;
    --sidebar-item-hover-color: #f8fafc;
    --sidebar-item-hover-bg: #1e293b;
    --sidebar-active-color: #ffffff;
    --sidebar-menu-header-color: #64748b;
    --logo-color: #ffffff;
    --sidebar-border-color: #1e293b;
}

/* Theme 4: Gen Z (Gradient Pink/Purple) */
body[data-theme="gen_z"] {
    --sidebar-bg: linear-gradient(135deg, #ec4899, #8b5cf6);
    /* Pink to Violet */
    --sidebar-item-color: #fce7f3;
    /* Light Pink text */
    --sidebar-item-hover-color: #ffffff;
    --sidebar-item-hover-bg: rgba(255, 255, 255, 0.25);
    --sidebar-active-color: #ffffff;
    --sidebar-menu-header-color: #fbcfe8;
    /* Pink 200 */
    --logo-color: #ffffff;
    --sidebar-border-color: rgba(255, 255, 255, 0.2);
}


.admin-layout-body {
    display: flex;
    height: 100vh;
    background-color: #f3f3f9;
    /* Velzon main light grey BG */
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}

/* --- MODIFICATION: Updated the version superscript to be a badge --- */
.sidebar-version {
    display: inline-block;
    position: relative;
    /* Use relative positioning */
    font-size: 0.6rem;
    /* Made text even smaller */
    font-weight: 700;
    /* Bold */
    line-height: 1;
    color: #92400E;
    /* Dark yellow-orange text (like text-amber-800) */
    background-color: #FBBF24;
    /* Yellow-orange (like bg-yellow-400) */
    padding: 3px 6px;
    /* Small padding (top/bottom, left/right) */
    border-radius: 9999px;
    /* Full pill shape */
    top: -0.9em;
    /* Lifts it up */
    margin-left: 4px;
    /* Space from title */
}

/* --- END MODIFICATION --- */


/* 1. The Sidebar (Dark Theme) */
.admin-sidebar {
    /* --- MODIFIED: Reduced width --- */
    width: 250px;
    /* Was 260px */
    flex-shrink: 0;

    /* --- THEME UPDATE: Use Variables --- */
    background: var(--sidebar-bg);
    color: var(--sidebar-item-color);

    transition: width 0.3s ease-in-out, transform 0.3s ease-in-out;
    /* Added width transition */
    z-index: 100;
    display: flex;
    flex-direction: column;
}

/* --- NEW: Custom Scrollbar for Admin Sidebar (Auto-hide) --- */
.admin-sidebar .overflow-y-auto {
    scrollbar-width: thin;
    /* Firefox */
    scrollbar-color: transparent transparent;
    /* thumb and track (invisible) */
}

.admin-sidebar .overflow-y-auto:hover {
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    /* thumb and track (visible on hover) */
}

.admin-sidebar .overflow-y-auto::-webkit-scrollbar {
    width: 6px;
}

.admin-sidebar .overflow-y-auto::-webkit-scrollbar-track {
    background: transparent;
    /* Invisible track */
}

.admin-sidebar .overflow-y-auto::-webkit-scrollbar-thumb {
    background-color: transparent;
    /* Invisible thumb */
    border-radius: 3px;
}

.admin-sidebar .overflow-y-auto:hover::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    /* Visible thumb on hover */
}

.admin-sidebar .overflow-y-auto:hover::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

/* --- END: Custom Scrollbar --- */


@media (max-width: 1023px) {
    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        transform: translateX(-100%);
    }

    .admin-sidebar.sidebar-hidden {
        transform: translateX(-100%);
    }

    .admin-sidebar:not(.sidebar-hidden) {
        transform: translateX(0);
    }

    /* On mobile, mini-menu state is just hidden */
    .admin-layout-body.sidebar-mini .admin-sidebar {
        transform: translateX(-100%);
    }
}

/* Hide desktop toggle on mobile */
@media (min-width: 1024px) {

    /* --- NEW: Mini-menu styles for desktop --- */
    .admin-layout-body.sidebar-mini .admin-sidebar {
        width: 70px;
    }

    /* Hide text and submenu icons */
    .admin-layout-body.sidebar-mini .admin-sidebar .sidebar-menu-toggle span,
    .admin-layout-body.sidebar-mini .admin-sidebar .sidebar-menu-toggle svg.submenu-toggle-icon,
    /* MODIFIED: Target svg */
    .admin-layout-body.sidebar-mini .admin-sidebar .sidebar-link span,
    .admin-layout-body.sidebar-mini .admin-sidebar .sidebar-header-title,
    .admin-layout-body.sidebar-mini .admin-sidebar .sidebar-footer-title {
        opacity: 0;
        visibility: hidden;
        width: 0;
        display: none;
        /* Ensure it collapses */
    }

    /* Hide submenus */
    .admin-layout-body.sidebar-mini .admin-sidebar .submenu {
        display: none !important;
        /* Force hide submenus in mini mode */
        max-height: 0 !important;
    }

    .admin-layout-body.sidebar-mini .admin-sidebar .sidebar-menu-toggle {
        justify-content: center;
        /* Center the icon */
    }

    .admin-layout-body.sidebar-mini .admin-sidebar .sidebar-menu-toggle .menu-icon {
        margin-right: 0;
        width: 1.25rem;
        /* Make icon a bit bigger */
        height: 1.25rem;
        /* --- NEW: Hide title lines in mini mode --- */
        border-top: none;
        padding-top: 0;
    }

    .admin-layout-body.sidebar-mini .admin-sidebar .sidebar-link {
        justify-content: center;
        /* Center the icon */
    }

    /* --- MODIFIED: Target icon on submenu link --- */
    .admin-layout-body.sidebar-mini .admin-sidebar .sidebar-link {
        margin-right: 0;
        padding-left: 1.5rem;
        /* Reset padding */
    }

    .admin-layout-body.sidebar-mini .admin-sidebar .sidebar-link svg {
        margin-right: 0;
        width: 1.25rem;
        /* Make icon a bit bigger */
        height: 1.25rem;
    }


    /* --- BUG FIX: Removed conflicting margin-left --- */
    .admin-layout-body.sidebar-mini .admin-main-content {
        /* margin-left: 70px; */
        /* REMOVED */
    }

    /* --- END: Mini-menu styles --- */
}

/* Sidebar Links (Velzon style) */
.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1.5rem;
    border-radius: 0.25rem;
    /* 4px */

    /* --- THEME UPDATE --- */
    color: var(--sidebar-item-color);

    /* --- MODIFIED: Fixed hierarchy --- */
    font-weight: 400;
    /* Was 500, now normal */

    font-size: 0.8125rem;
    /* 13px */
    line-height: 1.2;
    /* 15.6px */
    transition: background-color 0.2s ease, color 0.2s ease;
    margin: 0;
    cursor: pointer;
    /* ADDED: Ensures hand cursor on hover */
}

/* --- MODIFICATION: Target SVG icons created by Lucide --- */
.sidebar-link svg {
    width: 1.125rem;
    /* 18px */
    height: 1.125rem;
    /* 18px */
    stroke-width: 2;
    text-align: center;

    /* --- THEME UPDATE --- */
    color: var(--sidebar-item-color);

    transition: color 0.2s ease;
    margin-right: 0.75rem;
    /* 12px */
    flex-shrink: 0;
    /* Prevent icon from shrinking */
}

.sidebar-link span {
    transition: opacity 0.3s ease-in-out;
}

.sidebar-link:hover {
    /* --- THEME UPDATE --- */
    background-color: var(--sidebar-item-hover-bg);
    color: var(--sidebar-item-hover-color);
}

/* Target Lucide icons */
.sidebar-link:hover svg {
    color: var(--sidebar-item-hover-color);
}

.sidebar-link.active {
    /* --- THEME UPDATE --- */
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active-color);
    font-weight: 600;
    /* Bold when active */
}

/* Target Lucide icons */
.sidebar-link.active svg {
    color: var(--sidebar-active-color);
}


/* --- NEW: Collapsible Menu Styles --- */
.sidebar-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;

    /* --- MODIFIED: Match .sidebar-link style --- */
    padding: 1rem 1.5rem;
    /* Consistent padding */

    /* --- THEME UPDATE --- */
    color: var(--sidebar-menu-header-color);

    font-size: 0.75rem;
    /* 12px (SMALLER) */
    font-weight: 600;
    /* semibold */
    text-transform: uppercase;
    /* UPPERCASE */
    /* --- END MODIFICATION --- */

    letter-spacing: 0.05em;
    /* tracking-wider */
    cursor: pointer;
    transition: background-color 0.2s ease;

    /* --- NEW: Clean separator line for mini mode --- */
    border-top: 1px solid var(--sidebar-border-color);
    padding-top: 1rem;
}

/* No border for the first one */
ul>li:first-child .sidebar-menu-toggle {
    border-top: none;
    padding-top: 1rem;
}

.sidebar-menu-toggle:hover {
    color: var(--sidebar-item-hover-color);
}

/* Target Lucide icons */
.sidebar-menu-toggle .menu-icon {
    width: 1.125rem;
    /* 18px */
    height: 1.125rem;
    /* 18px */
    stroke-width: 2;
    text-align: center;
    margin-right: 1rem;
    /* MODIFIED: Increased spacing from 0.75rem */
    flex-shrink: 0;
    /* --- NEW: Hide title lines in mini mode --- */
    border-top: none;
    padding-top: 0;
}

.sidebar-menu-toggle span {
    flex: 1;
    transition: opacity 0.3s ease-in-out;
}

/* --- MODIFICATION: Arrow logic fixed to target SVG --- */
.sidebar-menu-toggle svg.submenu-toggle-icon {
    width: 1rem;
    /* 16px */
    height: 1rem;
    stroke-width: 2.5;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    transform: rotate(0deg);
    /* Default state is pointing right */
    flex-shrink: 0;
    margin-left: 0.5rem;
    /* MODIFIED: Added margin-left for better spacing */
}

/* When the menu is OPEN (not collapsed), rotate the arrow down */
.sidebar-menu-toggle:not(.collapsed) svg.submenu-toggle-icon {
    transform: rotate(90deg);
}

/* --- END MODIFICATION --- */

.submenu {
    overflow: hidden;
    max-height: 0;
    /* Collapsed by default */
    transition: max-height 0.3s ease-out;
    padding-left: 0;
    /* Remove old padding */
}

/* --- MODIFICATION: Fixed indentation based on new icon size --- */
.submenu .sidebar-link {
    /* Indent submenu links */
    /* Align with parent text: 1.5rem (pad) + 1.125rem (icon) + 1rem (margin) = 3.625rem */
    padding-left: 3.625rem;

    /* --- NEW: Adjust font size for submenu hierarchy --- */
    /* REMOVED: font-size and line-height. Now inherits 13px from .sidebar-link */
}

/* --- NEW: Hide icons inside all submenus --- */
/* .submenu .sidebar-link svg {
    display: none;
} */

/* --- END: Collapsible Menu Styles --- */


/* 2. The Main Content Area (Right Side) */
.admin-main-content {
    flex: 1 1 0%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* This container does NOT scroll */
    background-color: #f3f3f9;
    /* Velzon main BG */
    /* --- NEW: Transition for mini-menu --- */
    transition: margin-left 0.3s ease-in-out;

    /* --- BUG FIX: Removed margin-left: 250px; --- */
    /* This was fighting the 'display: flex' on the body */
    /* margin-left: 250px; */
}

@media (max-width: 1023px) {
    .admin-main-content {
        margin-left: 0;
        /* This is correct, as sidebar is position:fixed */
    }
}


/* 3. The Top Header (Light Theme) */
.admin-top-header {
    height: 70px;
    /* Velzon top header height */
    background-color: #ffffff;
    /* White header */
    border-bottom: 1px solid #e9e9ef;
    flex-shrink: 0;
    /* Prevents header from shrinking */
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    /* 24px padding */
}

/* --- MODIFICATION: Style for the hamburger icon itself --- */
#sidebarToggle {
    /* font-size: 1.25rem; */
    /* Removed */
    color: #495057;
    padding: 0.5rem;
    border-radius: 4px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

/* Target Lucide icon */
#sidebarToggle svg {
    width: 1.25rem;
    /* 20px */
    height: 1.25rem;
}

#sidebarToggle:hover {
    color: #2563EB;
    background-color: #f3f3f9;
}


/* 4. The Main Scrollable Area */
.admin-main-area {
    flex-grow: 1;
    /* Takes up all remaining space */
    overflow-y: auto;
    /* THIS is what scrolls */
}

/* Wrapper for padding inside the scrollable area */
.admin-content-wrapper {
    padding: 1.5rem;
    /* 24px padding all around */
}

/* 5. Footer (Velzon style) */
.admin-footer {
    background-color: #f3f3f9;
    /* Same as main BG */
    color: #6c757d;
    /* Secondary text */
    padding: 1.5rem;
    /* 24px padding */
    flex-shrink: 0;
    /* Prevents footer from shrinking */
    border-top: 1px solid #e9e9ef;
}

.admin-footer .copyright {
    font-size: 0.875rem;
    /* text-sm */
    text-align: center;
}

/* --- END: NEW VELZON ADMIN LAYOUT STYLES --- */


/* --- Admin Card Refinements (Velzon Style) --- */
.stat-card {
    background-color: #ffffff;
    border: 1px solid #e9e9ef;
    border-radius: 0.25rem;
    /* 4px, sharp edges */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    /* Velzon subtle shadow */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.07);
}

/* --- MODIFICATION: Target Lucide icons in stat cards --- */
.stat-card svg[data-lucide] {
    width: 1.5rem;
    /* 24px */
    height: 1.5rem;
}

.admin-card {
    background-color: #ffffff;
    border: 1px solid #e9e9ef;
    border-radius: 0.25rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.07);
}

/* --- Chart Legend Styles (Velzon Style) --- */
.chart-legend-item {
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease-in-out, opacity 0.2s ease-in-out;
    border: 1px solid transparent;
}

.chart-legend-item.inactive {
    opacity: 0.6;
}

.chart-legend-item.active {
    background-color: #eef2ff;
    /* Light blue */
    border-color: #818cf8;
    /* Indigo */
}

.year-selector-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.875rem;
    color: #4B5563;
}

.year-selector-label input {
    margin-right: 0.5rem;
    width: 1rem;
    height: 1rem;
}


/* --- START: UNTOUCHED CLIENT PORTAL STYLES (index.html) --- */
/* These are separate from the admin layout */
header.app-header {
    background-image: linear-gradient(to right, #4a90e2, #50e3c2);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.version-number {
    color: #EBF4FF;
    /* Light Blue */
    font-weight: 400;
    font-size: 0.9rem;
}

.page-content-wrapper {
    background-color: #F9FAFB;
    /* bg-gray-50 */
}

footer.app-footer {
    background-color: #2d3748;
    /* Dark Slate Gray */
    color: #e2e8f0;
    /* Light Gray Text */
    border-top: 1px solid #4a5568;
}

.app-footer p {
    margin: 0;
    color: #a0aec0;
    /* Lighter Gray Text */
    font-size: 0.875rem;
}

.app-footer .copyright {
    font-style: normal;
    color: #e2e8f0;
    font-weight: normal;
}

.app-footer .designer {
    font-style: normal;
    color: #a0aec0;
    font-size: 0.9em;
}

/* --- END: UNTOUCHED CLIENT PORTAL STYLES --- */


/* Search input and related elements */
.search-input-container {
    position: relative;
    flex-grow: 1;
    overflow: visible;
    display: flex;
    align-items: center;
    /* Removed pill shape, added border/shadow in index.html */
    transition: all 0.2s ease-in-out;
    padding-right: 0.5rem;
}

.search-input-container:focus-within {
    border-color: #4A90E2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.25);
}

.search-input-container input {
    flex-grow: 1;
    padding: 0.75rem 0 0.75rem 1rem;
    border: none;
    background: transparent;
    color: #4A5568;
}

.search-input-container input:focus {
    outline: none;
}

.search-icon-left {
    margin-left: 1rem;
    color: #A0AEC0;
    pointer-events: none;
    z-index: 1;
}

/* --- MODIFICATION: Target Lucide icons --- */
.search-icon-left[data-lucide] {
    width: 1rem;
    height: 1rem;
}

.search-icons-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 0.5rem;
}

.search-clear-button,
.export-button-inside {
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.6;
    /* font-size: 1.1rem; */
    /* No longer needed */
    color: #4A5568;
    padding: 0.2rem;
    margin: 0;
    z-index: 102;
    border-radius: 50%;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- MODIFICATION: Target Lucide icons --- */
@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.animate-shimmer {
    animation: shimmer 1.5s infinite linear;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(-5%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }

    50% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

.animate-bounce {
    animation: bounce 1s infinite;
}

.search-clear-button svg,
.export-button-inside svg {
    width: 1.1rem;
    height: 1.1rem;
}

.search-clear-button:hover,
.export-button-inside:hover:not([disabled]) {
    opacity: 1;
    color: #EF4444;
    background-color: #FFF5F5;
}

.export-button-inside:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: none;
    box-shadow: none;
    transform: none;
}

#suggestionsList,
#suggestionsListOrders {
    position: absolute;
    background-color: white;
    border: 1px solid #E2E8F0;
    border-radius: 0.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 999;
}

/* This rule is for the new modal suggestion list, which is positioned by JS */
#sr-co-suggestions {
    /* position and z-index are set by admin.js */
    background-color: white;
    border: 1px solid #E2E8F0;
    border-radius: 0.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
}

#suggestionsList.hidden,
#suggestionsListOrders.hidden,
#sr-co-suggestions.hidden {
    display: none;
}

#suggestionsList div,
#suggestionsListOrders div,
#sr-co-suggestions div {
    padding: 0.75rem 1rem;
    cursor: pointer;
    color: #4A5568;
    font-size: 0.9rem;
    transition: background-color 0.2s ease-in-out;
}

#suggestionsList div:hover,
#suggestionsListOrders div:hover,
#sr-co-suggestions div:hover {
    background-color: #EBF4FF;
    color: #2C5F9B;
}

#suggestionsList .load-more-results,
#suggestionsListOrders .load-more-results,
#sr-co-suggestions .load-more-results {
    font-weight: 600;
    text-align: center;
    border-top: 1px solid #E2E8F0;
    color: #4A90E2;
}

#suggestionsList .load-more-results:hover,
#suggestionsListOrders .load-more-results:hover,
#sr-co-suggestions .load-more-results:hover {
    background-color: #F8FAFC;
    color: #2C5F9B;
}

.soft-dropdown {
    border-radius: 1.5rem;
    padding: 0.75rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18), 0 4px 8px rgba(0, 0, 0, 0.1);
    background-color: white;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out, visibility 0.3s;
    border: none;
}

.soft-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.soft-dropdown a {
    padding: 0.75rem 1.25rem;
    border-radius: 1rem;
    color: #4A5568;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    display: block;
    text-align: left;
    font-weight: 500;
}

.soft-dropdown a:hover {
    background-color: #EBF4FF;
    color: #2C5F9B;
}

/* Summary Panel: Updated to use Tailwind classes in HTML */
#quantitySummaryPanel {
    /* background-color: #EBF4FF; */
    /* This is now bg-blue-50 in HTML */
    border: none;
    /* border-radius: 1.5rem; */
    /* This is now rounded-lg in HTML */
    padding: 1.5rem;
    /* box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); */
    /* Now shadow-sm in HTML */
    /* color: #2C5F9B; */
    /* text-blue-800 in HTML */
    font-weight: 600;
    transition: all 0.3s ease-in-out;
}

.summary-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.summary-icon {
    font-size: 1.8rem;
    /* color: #4A90E2; */
    /* text-blue-500 in HTML */
}

#consignmentSummaryList {
    margin-top: 1rem;
    font-size: 0.95rem;
    list-style: disc;
    padding-left: 1.5rem;
    color: #4A5568;
}

#consignmentSummaryList li {
    margin-bottom: 0.4rem;
}

#consignmentSummaryList span {
    font-weight: 700;
    color: #2C5F9B;
}

/* Dashboard Section (Title card) */
.dashboard-section {
    /* background-color: #F8FAFC; */
    /* Now bg-white in HTML */
    border: none;
    /* border-radius: 1.5rem; */
    /* Now rounded-xl in HTML */
    padding: 2rem;
    /* box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.06); */
    /* Now shadow-sm in HTML */
}

.dashboard-main-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1A202C;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* --- ADDED BACK: Collapsible styles for Orders page --- */
.collapsible-section {
    background-color: #FFFFFF;
    border-radius: 0.25rem;
    /* Velzon sharp edges */
    border: 1px solid #e9e9ef;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    /* 16px 24px */
    cursor: pointer;
    border-bottom: 1px solid #e9e9ef;
}

.collapsible-header:hover {
    background-color: #f3f3f9;
}

/* --- MODIFICATION: Target correct Lucide class --- */
.collapsible-header svg.collapsible-icon {
    transition: transform 0.3s ease-in-out;
    color: #6B7280;
    /* text-gray-500 */
    width: 1.25rem;
    height: 1.25rem;
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    padding: 0 1.5rem;
}

.collapsible-content.expanded {
    max-height: 1000px;
    /* Large value to allow content to show */
    padding: 1rem 0;
    /* Add padding when expanded */
}

.collapsible-icon {
    transition: transform 0.3s ease-in-out;
    color: #6B7280;
    /* text-gray-500 */
}

.collapsible-icon.rotate {
    transform: rotate(180deg);
}

/* --- END: Collapsible styles --- */


/* --- NEW: Miro-inspired Card Design --- */
.sr-card {
    border-radius: 0.75rem;
    /* 12px */
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid transparent;
    transition: box-shadow 0.2s ease-in-out;
    position: relative;
    /* <-- ADDED: This is needed for the pushpin */
}

.sr-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.07);
}

/* Card Color Themes */
.sr-card.sr-card-color-1 {
    background-color: #EBF8FF;
    border-color: #BEE3F8;
}

/* Light Blue */
.sr-card.sr-card-color-2 {
    background-color: #F0FFF4;
    border-color: #C6F6D5;
}

/* Light Green */
.sr-card.sr-card-color-3 {
    background-color: #FFFFF0;
    border-color: #FEFCBF;
}

/* Light Yellow */
.sr-card.sr-card-color-4 {
    background-color: #FFF5F5;
    border-color: #FED7D7;
}

/* Light Red */

.sr-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Use center for better vertical alignment */
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    margin-top: 1rem;
    /* Pushes header down to make space for the pin */
}

.sr-card-content {
    padding-top: 1rem;
}

.sr-id-text {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.25rem;
    color: #1F2937;
    /* gray-800 */
    line-height: 1.4;
}

.status-text-summary {
    font-size: 0.85rem;
    font-weight: 500;
    color: #4B5563;
    /* gray-600 */
    text-align: right;
}

/* NEW: Pushpin pseudo-element */
.sr-card::after {
    content: '';
    position: absolute;
    top: 12px;
    /* Position from the top edge of the card */
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    background-color: #EF4444;
    /* red-500 */
    border-radius: 50%;
    border: 1px solid #991B1B;
    /* red-800 */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

/* --- END: New Card Design --- */

/* NEW: Styles for centering a single card */
#srProgressBubblesContainer.single-item-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* Single column */
    justify-items: center;
    /* Center the item horizontally */
}

#srProgressBubblesContainer.single-item-grid>.sr-card {
    width: 100%;
    /* Take full width on mobile */
    max-width: 600px;
    /* Widen the card on desktop, but not full width */
}

/* END: New single-card styles */


/* NEW: Badge styles for card header */
.badge-status {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
}

.badge-completed {
    background-color: #D1FAE5;
    /* green-100 */
    color: #065F46;
    /* green-800 */
    border: 1px solid #A7F3D0;
    /* green-200 */
}

.badge-processing {
    background-color: #DBEAFE;
    /* blue-100 */
    color: #1E40AF;
    /* blue-800 */
    border: 1px solid #BFDBFE;
    /* blue-200 */
}

/* NEW: Badge for Awaiting */
.badge-awaiting {
    background-color: #FEE2E2;
    /* red-100 */
    color: #991B1B;
    /* red-800 */
    border: 1px solid #FECACA;
    /* red-200 */
}

/* Note: .badge.badge-error (for awaiting) is already defined */
/* END: New badge styles */


.badge.badge-error {
    /* For "Awaiting for Invoice" in collapsible header */
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 9999px;
    background-color: #FEE2E2;
    /* red-100 */
    color: #B91C1C;
    /* red-700 */
    gap: 0.25rem;
    line-height: 1;
}

.badge.badge-error svg {
    width: 0.75rem;
    height: 0.75rem;
}


.progress-bar-container {
    margin-bottom: 0;
    border: none;
    box-shadow: none;
    padding: 0;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
    margin-top: 1.5rem;
}

.progress-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.progress-bar-header h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.acknowledge-sr-button {
    padding: 0.4em 0.8em;
    border-radius: 9999px;
    font-size: 0.8em;
    font-weight: 600;
    background-color: #FBBF24;
    /* Yellow for acknowledge */
    color: #78350F;
    /* Dark amber text */
    border: 1px solid #F59E0B;
    transition: all 0.2s ease-in-out;
    margin-left: 0.5rem;
    /* Space next to h4 */
}

.acknowledge-sr-button:hover:not([disabled]) {
    background-color: #F59E0B;
    color: white;
}

.acknowledge-sr-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* --- MODIFICATION: Target Lucide icons --- */
.acknowledge-sr-button svg {
    width: 1em;
    height: 1em;
    margin-right: 0.25rem;
    display: inline-block;
}

/* DaisyUI-like Steps Styling */
.progress-bar-stages {
    display: flex;
    align-items: flex-start;
    position: relative;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    color: #A0AEC0;
    /* Default text color for inactive steps */
}

.progress-stage-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    flex: 1;
}

.progress-stage-item .progress-stage-circle {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background-color: #E0E0E0;
    border: 2px solid #E0E0E0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.3rem;
    z-index: 2;
    position: relative;
}

/* Active step (blue) */
.progress-stage-item.active .progress-stage-circle {
    background-color: #4A90E2;
    border-color: #4A90E2;
}

.progress-stage-item.active {
    color: #2C5F9B;
}

.progress-stage-item.active:not(:last-child)::after {
    background-color: #4A90E2;
}

/* Completed step (green) */
.progress-stage-item.completed .progress-stage-circle {
    background-color: #4CAF50;
    /* Darker Green */
    border-color: #4CAF50;
}

.progress-stage-item.completed {
    color: #065F46;
    /* Even Darker Green for text */
}

.progress-stage-item.completed:not(:last-child)::after {
    background-color: #4CAF50;
    /* Darker Green for line */
}


.progress-stage-item.step-pending-invoice .progress-stage-circle {
    background-color: #FEE2E2;
    border-color: #EF4444;
}

.progress-stage-item.step-pending-invoice {
    color: #EF4444;
}

.progress-stage-item.step-pending-voucher .progress-stage-circle {
    background-color: #FEF3C7;
    border-color: #FBBF24;
}

.progress-stage-item.step-pending-voucher {
    color: #FBBF24;
}

.progress-stage-item:not(:last-child)::after {
    content: "";
    position: absolute;
    left: calc(50% + 0.625rem);
    right: calc(-50% + 0.625rem);
    top: 0.625rem;
    transform: translateY(-1px);
    height: 2px;
    background-color: #E0E0E0;
    z-index: 1;
}

/* Line color for active step leading to next */
.progress-stage-item.active:not(:last-child)::after {
    background-color: #4A90E2;
}

.progress-stage-item:last-child::after {
    display: none;
}

/* NEW: Styles for the Details section in the card */
.details-container {
    /* REMOVED: top border and padding */
}

.details-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}

.details-grid {
    display: grid;
    /* DESIGN FIX: Use max-content for labels, 1fr for values */
    grid-template-columns: max-content 1fr;
    align-items: center;
    /* Vertically center-align items in grid */
    gap: 0.75rem 1.5rem;
    /* row-gap, column-gap */
    font-size: 0.9rem;
}

.details-label {
    font-weight: 500;
    color: #4B5563;
    /* gray-600 */
    /* NEW: Add structure for two-column layout */
    grid-column: 1 / 1;
}

.details-value {
    font-weight: 600;
    color: #1F2937;
    /* gray-800 */
    text-align: left;
    /* ALIGNMENT FIX: Changed from 'right' to 'left' */
    /* NEW: Add structure for two-column layout */
    grid-column: 2 / 2;
}

/* END: New Details Styles */


/* Table container: Now styled with Tailwind in HTML */
#tableContainer {
    position: relative;
    min-height: 150px;
    border: none;
    /* border-radius: 1.5rem; */
    /* Now rounded-xl in HTML */
    /* box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08); */
    /* Now shadow-sm in HTML */
    padding: 1.5rem;
    /* background-color: white; */
    /* Now bg-white in HTML */
    overflow-x: auto;
}

#invoiceTable {
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

#invoiceTable thead th {
    background-color: #EBF4FF;
    color: #2C5F9B;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 1rem 1.25rem;
    position: relative;
    border-bottom: 2px solid #A0AEC0;
}

#invoiceTable thead th:first-child {
    border-top-left-radius: 1rem;
}

#invoiceTable thead th:last-child {
    border-top-right-radius: 1rem;
}

#invoiceTable tbody tr:last-child td {
    border-bottom: none;
}

#invoiceTable tbody tr {
    transition: background-color 0.2s ease-in-out;
}

#invoiceTable tbody tr:nth-child(even) {
    background-color: #F9FAFB;
}

#invoiceTable tbody tr:hover {
    background-color: #EBF4FF;
}

#invoiceTable td {
    border-bottom: 1px solid #E2E8F0;
    padding: 0.85rem 1.25rem;
    text-align: left;
    font-size: 0.9rem;
    color: #4A5568;
}

/* NEW: Styles for tables inside cards on orders.html */
.collapsible-content table {
    width: 100%;
    border-collapse: collapse;
}

.collapsible-content th {
    background-color: #F9FAFB;
    /* bg-gray-50 */
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    /* 12px */
    font-weight: 600;
    color: #4B5563;
    /* gray-600 */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #E5E7EB;
    /* gray-200 */
}

.collapsible-content td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    /* 14px */
    color: #374151;
    /* gray-700 */
    border-bottom: 1px solid #E5E7EB;
    /* gray-200 */
    white-space: nowrap;
}

.collapsible-content tr:last-child td {
    border-bottom: none;
}

/* END: New table styles */


.status-button {
    padding: 0.4em 0.8em;
    border-radius: 9999px;
    font-size: 0.85em;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    width: max-content;
    min-width: unset;
    max-width: 100%;
}

.status-button {
    border: 1px solid;
}

.status-waiting {
    /* Now for "awaiting for invoice" in table */
    background-color: #FEE2E2;
    /* Light red */
    color: #B91C1C;
    /* Darker red text */
    border-color: #FCA5A5;
    /* Reddish border */
}

.status-waiting:hover {
    /* Optional: Darken on hover */
    background-color: #FECACA;
    /* red-200 */
    border-color: #F87171;
    /* red-400 */
}

.status-processing {
    background-color: #BFDBFE;
    color: #1E40AF;
    border-color: #93C5FD;
}

.status-processing:hover {
    background-color: #93C5FD;
    box-shadow: 0 2px 5px rgba(59, 130, 246, 0.2);
}

.status-done {
    background-color: #D1FAE5;
    color: #065F46;
    border-color: #A7F3D0;
}

.status-done:hover {
    background-color: #A7F3D0;
    box-shadow: 0 2px 5px rgba(34, 197, 94, 0.2);
}

/* New Pagination Styles */
.pagination-join {
    display: inline-flex;
}

.pagination-join .btn {
    border: 1px solid #D1D5DB;
    /* Tailwind gray-300 */
    background-color: white;
    padding: 0.5rem 1rem;
    line-height: 1.25rem;
    font-size: 0.875rem;
    /* text-sm */
    color: #374151;
    /* gray-700 */
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    margin-left: -1px;
    /* Overlap borders */
}

.pagination-join .btn:first-child {
    margin-left: 0;
    border-top-left-radius: 0.375rem;
    /* rounded-md */
    border-bottom-left-radius: 0.375rem;
}

.pagination-join .btn:last-child {
    border-top-right-radius: 0.375rem;
    /* rounded-md */
    border-bottom-right-radius: 0.375rem;
}

.pagination-join .btn:hover:not([disabled]):not(.active) {
    background-color: #F3F4F6;
    /* gray-100 */
    border-color: #9CA3AF;
    /* gray-400 */
}

.pagination-join .btn.active {
    background-color: #4A90E2;
    /* Primary Blue */
    color: white;
    border-color: #4A90E2;
    z-index: 10;
}

.pagination-join .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #F9FAFB;
    /* gray-50 */
    color: #9CA3AF;
    /* gray-400 */
}

.pagination-join .pagination-arrow {
    font-weight: 600;
}

.pagination-join .pagination-number {
    min-width: 2.5rem;
    text-align: center;
}

/* ---
GLOBAL BUTTON STYLES
--- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    /* semibold */
    padding: 0.6rem 1.25rem;
    /* py-2 px-5 */
    font-size: 0.875rem;
    /* text-sm */
    border-radius: 0.5rem;
    /* rounded-lg */
    border: 1px solid transparent;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    /* shadow-sm */
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-icon {
    gap: 0.5rem;
    /* space-x-2 */
}

.btn-icon svg {
    width: 1rem;
    /* w-4 */
    height: 1rem;
    /* h-4 */
    margin-left: -0.25rem;
    /* -ml-1 */
}

/* Primary Button (Solid Blue) */
.btn-primary {
    background-color: #3b82f6;
    /* bg-blue-500 */
    color: #ffffff;
    /* text-white */
}

.btn-primary:hover {
    background-color: #2563eb;
    /* hover:bg-blue-600 */
}

/* Secondary Button (Light Gray) */
.btn-secondary {
    background-color: #f3f4f6;
    /* bg-gray-100 */
    color: #374151;
    /* text-gray-700 */
    border-color: #e5e7eb;
    /* border-gray-200 */
}

.btn-secondary:hover {
    background-color: #e5e7eb;
    /* hover:bg-gray-200 */
}

/* Light "Quick Access" Style Buttons */
.btn-teal-light {
    background-color: #ccfbf1;
    /* bg-teal-100 */
    color: #0f766e;
    /* text-teal-700 */
}

.btn-teal-light:hover {
    background-color: #99f6e4;
    /* hover:bg-teal-200 */
}

.btn-blue-light {
    background-color: #dbeafe;
    /* bg-blue-100 */
    color: #1d4ed8;
    /* text-blue-700 */
}

.btn-blue-light:hover {
    background-color: #bfdbfe;
    /* hover:bg-blue-200 */
}

.btn-green-light {
    background-color: #dcfce7;
    /* bg-green-100 */
    color: #166534;
    /* text-green-700 */
}

.btn-green-light:hover {
    background-color: #bbf7d0;
    /* hover:bg-green-200 */
}

.btn-indigo-light {
    background-color: #e0e7ff;
    /* bg-indigo-100 */
    color: #3730a3;
    /* text-indigo-700 */
}

.btn-indigo-light:hover {
    background-color: #c7d2fe;
    /* hover:bg-indigo-200 */
}

/* NEW: Mint/Emerald Button (Matches the History Dashboard Screenshot) */
.btn-mint-light {
    background-color: #D1FAE5;
    /* bg-emerald-100 */
    color: #047857;
    /* text-emerald-700 */
    border: 1px solid transparent;
}

.btn-mint-light:hover {
    background-color: #A7F3D0;
    /* hover:bg-emerald-200 */
    color: #064E3B;
    /* hover:text-emerald-900 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Danger Button (Light Red) - for Delete */
.btn-danger-light {
    background-color: #fee2e2;
    /* bg-red-100 */
    color: #991b1b;
    /* text-red-700 */
}

.btn-danger-light:hover {
    background-color: #fecaca;
    /* hover:bg-red-200 */
}

/* ---
END GLOBAL BUTTON STYLES
--- */


#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #4A90E2;
    background-image: radial-gradient(circle at center, #4A90E2 0%, #2C5F9B 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
    transition: opacity 0.5s ease-out;
}

#loadingOverlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-text {
    font-size: 2.5rem;
    font-weight: 700;
    margin-top: 2.5rem;
    animation: fadeInOut 5s infinite alternate;
    padding: 0 1rem;
    white-space: nowrap;
}

.version-suffix {
    font-size: 1.8rem;
    color: #EBF4FF;
    font-weight: 600;
    vertical-align: super;
    margin-left: 0.2em;
}

.loading-dots-container {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.loading-dot {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background-color: #EBF4FF;
    animation: bounce 1.4s infinite ease-in-out;
}

.loading-dot:nth-child(1) {
    background-color: #4A90E2;
}

.loading-dot:nth-child(2) {
    background-color: #6DD47E;
    animation-delay: 0.1s;
}

.loading-dot:nth-child(3) {
    background-color: #FBBF24;
    animation-delay: 0.2s;
}

.loading-dot:nth-child(4) {
    background-color: #EF4444;
    animation-delay: 0.3s;
}

@keyframes fadeInOut {
    0% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.table-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.85);
    z-index: 50;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 1.5rem;
}

.table-loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.table-loading-overlay .loading-dots-container {
    width: 5rem;
    height: 5rem;
}

.table-loading-overlay .loading-dot {
    width: 1.2rem;
    height: 1.2rem;
    animation: sequential-fill 1.2s infinite ease-in-out;
}

@keyframes sequential-fill {

    0%,
    100% {
        opacity: 0.3;
        background-color: #E0E0E0;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        background-color: #4A90E2;
        transform: scale(1.2);
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: white;
    border-radius: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    width: 90%;
    max-width: 450px;
    transform: translateY(-20px) scale(0.95);
    transition: transform 0.3s ease-out;
    border: none;
    color: #1F2937;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 280px;
}

.modal-overlay.show .modal-content {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border-bottom: 1px dashed #D1D5DB;
    padding: 0 0 1rem 0;
    margin-bottom: 1.5rem;
    position: relative;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1F2937;
    text-shadow: none;
    margin-bottom: 0.75rem;
    text-align: left;
    width: calc(100% - 3rem);
}

.modal-close-button {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6B7280;
    transition: all 0.2s ease-in-out;
    padding: 0.3rem;
    border-radius: 50%;
}

.modal-close-button:hover {
    color: #DC2626;
    background-color: #FFF5F5;
    transform: rotate(90deg);
}

.modal-body {
    flex-grow: 1;
    padding: 0 0.5rem;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem;
}

.modal-body p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    padding: 0.2rem 0;
    display: contents;
}

.modal-body strong {
    color: #4A5568;
    font-weight: 500;
    text-align: left;
    grid-column: 1;
}

.modal-body span {
    color: #1F2937;
    font-weight: 600;
    text-align: left;
    word-wrap: break-word;
    grid-column: 2;
}

.modal-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    border-top: 1px dashed #D1D5DB;
    padding-top: 1.5rem;
    margin-top: 1rem;
}

.modal-footer button {
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.modal-print-button {
    background-color: #6DD47E;
    color: white;
    border: none;
}

.modal-print-button:hover:not([disabled]) {
    background-color: #4CAF50;
    box-shadow: 0 6px 15px rgba(109, 212, 126, 0.25);
    transform: translateY(-1px);
}

.modal-print-button:disabled {
    background-color: #A0AEC0;
    /* Tailwind gray-400 */
    color: #EBF4FF;
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    border: 1px solid #718096;
    /* Tailwind gray-500 */
}

.modal-note {
    font-size: 0.8rem;
    color: #6B7280;
    text-align: left;
    margin-top: 1rem;
    line-height: 1.5;
}

.confirmation-section {
    text-align: left;
    margin-bottom: 1rem;
}

.confirmation-section label {
    font-size: 0.85rem;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    color: #4A5568;
    cursor: pointer;
}

.confirmation-section input[type="checkbox"] {
    margin-top: 0.2rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

/* --- NEW: Styles for Large SR Modal --- */
.modal-overlay.large {
    /* Higher z-index to ensure it's on top */
    z-index: 1000;
}

.modal-content.large {
    width: 90%;
    max-width: 900px;
    /* Much wider modal */
    min-height: 80vh;
    /* Taller modal */
    max-height: 90vh;
    /* Max height */
    padding: 1.5rem 2rem;
    /* Adjust padding */
}

.modal-body.large {
    display: block;
    /* Override grid display */
    padding: 0 0.5rem;
    flex-grow: 1;
    overflow-y: auto;
    /* Allow modal body to scroll */
}

/* Ensure suggestions appear over the modal (z-20 in HTML) */
#sr-co-suggestions {
    z-index: 1050;
    /* Higher than modal overlay */
}

/* --- END: Large SR Modal Styles --- */


/* --- NEW: Login & Onboarding Styles --- */
/* Style for the radio buttons on login.html */
.onboarding-radio-label {
    display: block;
}

.onboarding-radio-label .onboarding-radio-span {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border: 2px solid #D1D5DB;
    /* gray-300 */
    border-radius: 0.5rem;
    /* rounded-lg */
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-weight: 500;
    color: #4B5563;
    /* gray-600 */
}

.onboarding-radio-label input:checked+.onboarding-radio-span {
    border-color: #2563EB;
    /* blue-600 */
    background-color: #DBEAFE;
    /* blue-100 */
    color: #1E40AF;
    /* blue-800 */
    font-weight: 600;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.onboarding-radio-label .onboarding-radio-span:hover {
    border-color: #9CA3AF;
    /* gray-400 */
}

/* --- END: Login Styles --- */

/* --- NEW: Admin User Management Page Styles --- */
.user-management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.user-card {
    background-color: #ffffff;
    border: 1px solid #e9e9ef;
    border-radius: 0.25rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.user-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9e9ef;
}

.user-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 9999px;
    object-fit: cover;
    border: 2px solid #e9e9ef;
}

.user-card-info {
    flex: 1;
}

.user-card-name {
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
}

.user-card-email {
    font-size: 0.875rem;
    color: #6c757d;
}

.user-card-body {
    padding: 1.5rem;
    flex-grow: 1;
}

.user-card-details {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.user-card-label {
    font-weight: 500;
    color: #6c757d;
}

.user-card-value {
    font-weight: 500;
    color: #495057;
}

.user-card-value .badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
}

.user-card-value .badge-pending {
    background-color: #FEF3C7;
    /* yellow-100 */
    color: #92400E;
    /* yellow-800 */
}

.user-card-value .badge-approved {
    background-color: #D1FAE5;
    /* green-100 */
    color: #065F46;
    /* green-800 */
}

.user-card-footer {
    padding: 1rem 1.5rem;
    background-color: #f3f3f9;
    border-top: 1px solid #e9e9ef;
    display: flex;
    gap: 0.75rem;
}

.user-card-button {
    flex: 1;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.25rem;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.user-card-button.approve {
    background-color: #10B981;
    /* green-500 */
    color: white;
    border-color: #059669;
    /* green-600 */
}

.user-card-button.approve:hover {
    background-color: #059669;
}

.user-card-button.deny {
    background-color: #EF4444;
    /* red-500 */
    color: white;
    border-color: #DC2626;
    /* red-600 */
}

.user-card-button.deny:hover {
    background-color: #DC2626;
}

.user-card-button:disabled {
    background-color: #D1D5DB;
    /* gray-300 */
    color: #6B7280;
    /* gray-500 */
    border-color: #9CA3AF;
    /* gray-400 */
    cursor: not-allowed;
}

/* --- MODIFICATION: Modern Segmented Control --- */
.segmented-control {
    display: inline-flex;
    /* Changed from flex to inline-flex */
    background-color: transparent;
    /* Let HTML wrapper control bg */
    padding: 0;
    /* Let wrapper control padding */
    border-radius: inherit;
    width: auto;
    /* Auto width */
}

.segmented-control-button {
    padding: 0.5rem 1.25rem;
    /* Consistent padding */
    border: none;
    background-color: transparent;
    border-radius: 0.375rem;
    /* Tailwind rounded-md */
    font-size: 0.875rem;
    font-weight: 500;
    color: #6B7280;
    /* text-gray-500 */
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

/* Explicitly force colors for the active state to override Tailwind utility classes */
.segmented-control-button.active {
    color: #2563EB !important;
    /* blue-600 */
    background-color: #EFF6FF !important;
    /* blue-50 */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Explicitly force colors for the inactive state */
.segmented-control-button:not(.active) {
    color: #6B7280 !important;
    /* text-gray-500 */
    background-color: transparent !important;
}

.segmented-control-button:not(.active):hover {
    color: #111827 !important;
    /* text-gray-900 */
    background-color: #F9FAFB !important;
    /* gray-50 */
}

/* --- END: Modern Segmented Control --- */

/* --- NEW: Create Sales Report Form Styles --- */
#sr-form-item-table-body tr:nth-child(even) {
    background-color: #f9fafb;
    /* bg-gray-50 */
}

#sr-form-item-table-body tr:hover {
    background-color: #f3f4f6;
    /* bg-gray-100 */
}

.sr-item-input {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sr-item-input:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.sr-item-input:invalid {
    border-color: #EF4444;
    /* red-500 */
}

/* --- NEW: Strikethrough warning class --- */
.sr-item-input.input-critical-warning {
    color: #EF4444;
    /* red-500 */
    text-decoration: line-through;
    font-weight: 600;
}

/* --- NEW: Empty State Container for Step 1 (Revamped) --- */
.sr-step-1-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    /* py-16 px-8 */
    background: linear-gradient(to bottom, #F9FAFB, #FFFFFF);
    /* Soft gradient */
    border: 2px dashed #E5E7EB;
    /* border-gray-200, dashed */
    border-radius: 1rem;
    /* rounded-2xl */
    text-align: center;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.sr-step-1-empty-state:hover {
    border-color: #BFDBFE;
    /* Blue-200 on hover */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.sr-step-1-icon-container {
    background-color: #EFF6FF;
    /* blue-50 */
    padding: 1.25rem;
    border-radius: 50%;
    margin-bottom: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Ring effect */
    box-shadow: 0 0 0 8px #F3F4F6;
    /* gray-100 ring */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sr-step-1-empty-state:hover .sr-step-1-icon-container {
    transform: scale(1.05);
    box-shadow: 0 0 0 12px #EFF6FF;
    /* blue-50 ring on hover */
    color: #2563EB;
}

.sr-step-1-icon-container svg {
    width: 2.5rem;
    height: 2.5rem;
    color: #3B82F6;
    /* blue-500 */
    stroke-width: 1.5px;
}

.sr-step-1-title {
    font-size: 1.25rem;
    /* text-xl */
    font-weight: 700;
    /* bold */
    color: #1F2937;
    /* text-gray-800 */
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
}

.sr-step-1-desc {
    font-size: 0.95rem;
    /* text-base */
    color: #6B7280;
    /* text-gray-500 */
    margin-bottom: 2.5rem;
    max-width: 28rem;
    /* max-w-md */
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* --- END NEW --- */
/* --- END: Create Sales Report Form Styles --- */


/* --- NEW: Fix for JIT Toggle (Hide Default Checkbox) --- */
.toggle-checkbox {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    /* Retain layout properties so the switch still takes up space */
    height: 1.5rem;
    /* h-6 */
    width: 2.75rem;
    /* w-11 */
    border-radius: 9999px;
    background-color: #E5E7EB;
    /* bg-gray-200 */
    position: relative;
    cursor: pointer;
    outline: none;
    transition: background-color 0.2s ease-in-out;
}

/* The circle (thumb) */
.toggle-checkbox::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    height: 1.25rem;
    /* h-5 */
    width: 1.25rem;
    /* w-5 */
    border-radius: 50%;
    background-color: white;
    border: 1px solid #D1D5DB;
    /* border-gray-300 */
    transition: transform 0.2s ease-in-out;
}

/* Checked State */
.toggle-checkbox:checked {
    background-color: #2563EB;
    /* bg-blue-600 */
}

.toggle-checkbox:checked::after {
    transform: translateX(100%);
    /* Move to right */
    border-color: white;
}

/* Focus State */
.toggle-checkbox:focus {
    box-shadow: 0 0 0 2px white, 0 0 0 4px #3B82F6;
    /* ring-blue-500 */
}

/* --- END: JIT Toggle Fix --- */

/* --- NEW: Collapsible Modal Sections --- */
.collapsible-header-modal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    border-bottom: 1px solid #e9e9ef;
}

.collapsible-header-modal:hover {
    background-color: #f9fafb;
    /* bg-gray-50 */
}

.collapsible-icon-modal {
    transition: transform 0.3s ease-in-out;
    color: #6B7280;
    /* text-gray-500 */
    width: 1.25rem;
    height: 1.25rem;
    margin-left: 0.75rem;
    /* Add spacing */
}

.collapsible-icon-modal.rotate {
    transform: rotate(180deg);
}

.collapsible-content-modal {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding: 0;
}

.collapsible-content-modal.expanded {
    max-height: 1000px;
    /* Large value */
    padding: 0;
}

/* --- END: Collapsible Modal --- */


/* --- NEW: 'Step' Badges and Icons for Create SR Modal --- */
.step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    background-color: #3b82f6;
    /* bg-blue-500 */
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
    margin-right: 0.75rem;
}

.step-icon {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    color: #4b5563;
    /* text-gray-600 */
    vertical-align: middle;
    margin-top: -2px;
}

.sr-step-header>span {
    display: flex;
    align-items: center;
}

/* --- NEW: Grid layout for Step 2 Details --- */
.sr-details-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 1rem 1.5rem;
    align-items: center;
}

.sr-details-grid label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    /* text-gray-600 */
}

.sr-details-grid .sr-details-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    /* text-gray-900 */
}

/* Responsive grid for mobile */
@media (max-width: 767px) {
    .sr-details-grid {
        grid-template-columns: 1fr;
        /* Stack on mobile */
        gap: 0.25rem;
    }

    .sr-details-grid label {
        font-size: 0.75rem;
        /* Smaller label */
    }

    .sr-details-grid div {
        margin-bottom: 0.5rem;
        /* Add spacing between stacked items */
    }
}

/* 1. New Step Header Styles */
.sr-step-header {
    font-size: 1.125rem;
    /* text-lg */
    font-weight: 600;
    /* semibold */
    color: #111827;
    /* gray-900 */
    padding-bottom: 0.75rem;
    /* pb-3 */
    border-bottom: 1px solid #e5e7eb;
    /* border-gray-200 */
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.sr-step-header .collapsible-icon-modal {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.3s ease;
    transform: rotate(180deg);
    /* Start open */
}

.sr-step-header.collapsed .collapsible-icon-modal {
    transform: rotate(0deg);
    /* Closed */
}

/* --- NEW: Action buttons for history table --- */
.sr-action-btn-group {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
}

.sr-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 0.25rem;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.sr-action-btn svg {
    width: 0.9rem;
    height: 0.9rem;
    margin-right: 0.25rem;
}

.sr-action-btn.view {
    background-color: #f3f4f6;
    /* gray-100 */
    color: #374151;
    /* gray-700 */
    border-color: #d1d5db;
    /* gray-300 */
}

.sr-action-btn.view:hover {
    background-color: #e5e7eb;
    /* gray-200 */
}

.sr-action-btn.edit {
    background-color: #dbeafe;
    /* blue-100 */
    color: #1d4ed8;
    /* blue-700 */
    border-color: #bfdbfe;
    /* blue-200 */
}

.sr-action-btn.edit:hover {
    background-color: #bfdbfe;
    /* blue-200 */
}

.sr-action-btn.delete {
    background-color: #fee2e2;
    /* red-100 */
    color: #b91c1c;
    /* red-700 */
    border-color: #fecaca;
    /* red-200 */
}

.sr-action-btn.delete:hover {
    background-color: #fecaca;
    /* red-200 */
}

/* --- END: Action buttons --- */

/* --- END: Create Sales Report Form Styles --- */


@media print {
    body.print-active>*:not(.modal-overlay) {
        display: none;
    }

    body.print-active .modal-overlay {
        position: static;
        background-color: transparent;
        display: block;
        width: auto;
        height: auto;
        overflow: visible;
        justify-content: flex-start;
        align-items: flex-start;
    }

    body.print-active .modal-content {
        width: 100mm;
        max-width: 100mm;
        box-shadow: none;
        border: none;
        padding: 10mm;
        transform: none;
        border-radius: 0;
        margin: 0;
        float: left;
        /* margin-left: 10mm; */
        min-height: auto;
    }

    /* Removed margin-left */
    body.print-active .modal-header {
        border-bottom: 1px dashed #D1D5DB;
        padding-bottom: 0.5rem;
        margin-bottom: 0.5rem;
        align-items: flex-start;
        text-align: left;
        display: flex;
        flex-direction: column;
        padding-left: 0;
        padding-right: 0;
    }

    body.print-active .print-header {
        font-family: 'Poppins', sans-serif;
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
        color: #1F2937;
        text-align: left;
        width: 100%;
        display: block;
    }

    body.print-active .print-header p {
        margin: 0;
        line-height: 1.2;
        text-align: left;
    }

    body.print-active .modal-header h2 {
        font-size: 1.3rem;
        margin-bottom: 0;
        font-family: 'Poppins', sans-serif;
        font-weight: 700;
        text-align: left;
        width: 100%;
    }

    body.print-active .modal-footer {
        border-top: none;
        padding-top: 0;
        margin-top: 0;
        align-items: flex-start;
    }

    /* UPDATED: Explicitly scoped #printDetailsButton to body.print-active to ensure it hides */
    body.print-active .modal-close-button,
    body.print-active .modal-footer button.modal-print-button,
    body.print-active #printDetailsButton,
    .no-print {
        display: none !important;
    }

    .only-print {
        display: block !important;
    }

    /* This is for the note */
    body.print-active .modal-body {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 0.5rem;
        font-size: 0.9rem;
        margin-bottom: 0.1rem;
        padding: 0.1rem 0;
        font-family: 'Poppins', sans-serif;
    }

    body.print-active .modal-body p {
        display: contents;
    }

    body.print-active .modal-body strong {
        font-weight: 400;
        text-align: left;
        font-family: 'Poppins', sans-serif;
        grid-column: 1;
    }

    body.print-active .modal-body span {
        font-weight: 600;
        text-align: left;
        font-family: 'Poppins', sans-serif;
        word-wrap: break-word;
        grid-column: 2;
    }

    body.print-active .modal-note.only-print {
        font-size: 0.7rem;
        font-style: normal;
        margin-top: 1rem;
        text-align: left;
        color: #6B7280;
        line-height: 1.4;
    }

    .print-separator {
        display: none !important;
    }

    /* Hide this separator for print */

    /* Updated Signature Section for Print */
    .signature-section {
        display: flex !important;
        /* Important to override potential JS inline style if it was 'none' */
        flex-direction: row;
        justify-content: space-between;
        /* UPDATED: Changed from baseline to flex-end to align the text labels */
        align-items: flex-end;
        width: 100%;
        margin-top: 1rem;
        /* Space above signature area */
        padding-top: 0;
        font-family: 'Poppins', sans-serif;
        color: #1F2937;
    }

    .signature-block-centered {
        /* Container for signature line and text */
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        width: 60%;
        /* Adjust as needed */
        margin: 0;
    }

    .signature-line {
        border-bottom: 1px solid #A1A1AA;
        width: 100%;
        /* Full width of its container */
        margin-bottom: 0.25em;
        /* Space between line and text */
    }

    .signature-text {
        font-size: 0.75rem;
        text-align: left;
        width: 100%;
        margin-top: 0;
        line-height: 1.2;
    }

    .date-line {
        font-size: 0.75rem;
        width: 35%;
        /* Adjust as needed */
        text-align: left;
        /* Or 'right' if date should be right-aligned */
        margin: 0;
        line-height: 1.2;
        /* Match signature-text */
    }

    /* --- NEW: Print styles for Create SR Modal --- */
    /* This class will be added to body by admin.js */
    body.print-sr-active>*:not(#create-sr-modal-overlay) {
        display: none;
    }

    body.print-sr-active #create-sr-modal-overlay {
        position: static;
        background-color: transparent;
        display: block;
        width: 100%;
        height: auto;
        overflow: visible;
    }

    body.print-sr-active .modal-content.large {
        width: 100%;
        max-width: 100%;
        min-height: auto;
        max-height: none;
        box-shadow: none;
        border: none;
        padding: 0;
        transform: none;
        border-radius: 0;
        margin: 0;
    }

    /* Hide all non-print elements in the modal */
    body.print-sr-active #create-sr-modal-overlay .modal-header,
    body.print-sr-active #create-sr-modal-overlay .modal-footer,
    body.print-sr-active #create-sr-modal-overlay #sr-form-container {
        display: none;
    }

    /* Show and style the view-only container */
    body.print-sr-active #create-sr-modal-overlay #sr-view-mode-details {
        display: block !important;
        padding: 1rem;
    }

    body.print-sr-active #create-sr-modal-overlay .modal-body.large {
        overflow-y: visible;
    }

    /* Style view-only tables for print */
    body.print-sr-active #view-sr-items-table table {
        width: 100%;
        border-collapse: collapse;
        font-size: 10pt;
    }

    body.print-sr-active #view-sr-items-table th,
    body.print-sr-active #view-sr-items-table td {
        border: 1px solid #ccc;
        padding: 6px;
        text-align: left;
    }

    body.print-sr-active #view-sr-items-table th {
        background-color: #eee;
    }

    /* --- END: Create SR Modal Print Styles --- */
}

.signature-section {
    display: none;
}

/* Hidden by default, shown by print CSS or JS for canvas */
.only-print {
    display: none;
}

/* Hidden by default, shown only for print */


.print-separator {
    display: none;
}

/* Hidden by default, and now also for print and PNG */


#messageModalOverlay .modal-content {
    min-height: unset;
    max-width: 380px;
    padding: 1.5rem;
}

#messageModalOverlay .modal-header {
    padding: 0 0 1rem 0;
    margin-bottom: 1rem;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

#messageModalOverlay .modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0;
    color: #1F2937;
    flex-grow: 1;
}

/* --- MODIFIED: Target correct Lucide class --- */
#messageModalOverlay .modal-header svg[data-lucide] {
    width: 1.5rem;
    height: 1.5rem;
    color: #4A90E2;
    margin-right: 0.25rem;
    flex-shrink: 0;
}

#messageModalOverlay .modal-close-button {
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1.3rem;
}

#messageModalOverlay .modal-body {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #4A5568;
    flex-grow: unset;
    padding: 0 0.5rem;
}

#messageModalOverlay .modal-footer {
    border-top: none;
    padding-top: 0;
    margin-top: 1.5rem;
    justify-content: flex-end;
    align-items: flex-end;
}

#messageModalOverlay .modal-footer button {
    background-color: #4A90E2;
    color: white;
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 9999px;
}

#messageModalOverlay .modal-footer button:hover {
    background-color: #2C5F9B;
    box-shadow: 0 6px 15px rgba(74, 144, 226, 0.2);
    transform: translateY(-1px);
}

/* REMOVED: Old footer.app-footer styles */

@media (max-width: 767px) {

    /* REMOVED: Old responsive footer styles */
    /* --- ADDED BACK: Responsive styles for client footer --- */
    .app-footer p {
        font-size: 0.8rem;
        /* Mobile footer p font size */
    }

    /* --- END --- */

    /* .dashboard-section { border-radius: 1.5rem; padding: 1.25rem; } */
    /* Handled by Tailwind */
    .collapsible-section {
        border-radius: 0.75rem;
        margin-bottom: 1rem;
    }

    /* Matched radius */
    .collapsible-header {
        padding: 1rem 1.25rem;
    }

    .collapsible-content.expanded {
        max-height: 500px;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    /* Adjusted max-height */
    .collapsible-icon {
        width: 1.6rem;
        height: 1.6rem;
        padding: 0.3rem;
    }

    /* NEW: Miro card mobile styles */
    .sr-card {
        border-radius: 0.75rem;
    }

    .sr-card-header {
        padding: 1.25rem 1rem;
        /* Adjust padding */
    }

    .sr-card-content {
        padding: 1.25rem 1rem;
        /* Adjust padding */
    }

    .sr-id-text {
        font-size: 1.1rem;
        /* Slightly smaller on mobile */
    }

    .badge-status {
        font-size: 0.75rem;
    }

    /* END: Miro card mobile styles */


    /* --- FIX: Removed stacking styles for details grid --- */
    /* .details-grid {
        grid-template-columns: 1fr; 
        gap: 0.25rem;
    }
    .details-label {
        color: #6B7280;
        font-weight: 400;
        font-size: 0.8rem;
        grid-column: 1 / 1;
    }
    .details-value {
        text-align: left;
        margin-bottom: 0.5rem;
        grid-column: 1 / 1;
    } 
    */
    /* --- END FIX --- */


    /* #tableContainer { border-radius: 1.25rem; padding: 1rem; } */
    /* Handled by Tailwind */
    #invoiceTable thead {
        display: none;
    }

    #invoiceTable,
    #invoiceTable tbody,
    #invoiceTable tr {
        display: block;
        width: 100%;
    }

    #invoiceTable tr {
        margin-bottom: 1rem;
        border: 1px solid #E2E8F0;
        border-radius: 0.75rem;
        overflow: hidden;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    }

    #invoiceTable td {
        display: grid;
        grid-template-columns: minmax(80px, max-content) 1fr;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
        align-items: center;
        min-height: 40px;
        border-bottom: 1px solid #E2E8F0;
        font-size: 0.9rem;
        color: #4A5568;
    }

    #invoiceTable td:last-child {
        border-bottom: none;
    }

    #invoiceTable td::before {
        content: attr(data-label);
        display: inline-block;
        font-weight: 600;
        color: #4A5568;
        text-align: left;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #invoiceTable td>*:not(::before) {
        text-align: right;
        word-break: break-word;
        overflow-wrap: break-word;
        justify-self: end;
    }

    #invoiceTable td[data-label="Status:"] {
        justify-content: flex-end;
        text-align: right;
    }

    #invoiceTable td[data-label="Status:"]>*:not(::before) {
        text-align: right;
    }

    .modal-content {
        border-radius: 1rem;
        padding: 1.25rem;
        max-width: 95%;
    }

    .modal-header h2 {
        font-size: 1.2rem;
    }

    .modal-footer {
        padding-top: 1rem;
        margin-top: 1.5rem;
        gap: 1rem;
    }

    .modal-footer button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .modal-note {
        font-size: 0.7rem;
    }

    .print-header {
        font-size: 0.65rem;
    }

    .loading-text {
        font-size: 2rem;
        margin-top: 30px;
    }

    .version-suffix {
        font-size: 1.5rem;
    }

    .loading-dots-container {
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .loading-dot {
        width: 1.2rem;
        height: 1.2rem;
    }

    .mb-6.flex.flex-row {
        flex-wrap: nowrap;
        justify-content: space-between;
    }

    .search-reset-container {
        flex-grow: 1;
        min-width: 200px;
        margin-bottom: 0;
    }

    /* --- NEW: Admin Table Responsive Styles --- */
    #adminReportsTable thead,
    #userManagementTable thead,
    #sr-form-item-table thead,
    #my-sr-history-table-container thead {
        display: none;
    }

    #adminReportsTable,
    #adminReportsTable tbody,
    #adminReportsTable tr,
    #userManagementTable,
    #userManagementTable tbody,
    #userManagementTable tr,
    #sr-form-item-table-body,
    #sr-form-item-table-body tr,
    #my-sr-history-table-body,
    #my-sr-history-table-body tr {
        display: block;
        width: 100%;
    }

    #adminReportsTable tr,
    #userManagementTable tr,
    #sr-form-item-table-body tr,
    #my-sr-history-table-body tr {
        margin-bottom: 1rem;
        border: 1px solid #E2E8F0;
        border-radius: 0.75rem;
        overflow: hidden;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    }

    #adminReportsTable td,
    #userManagementTable td,
    #sr-form-item-table-body td,
    #my-sr-history-table-body td {
        display: grid;
        grid-template-columns: 130px 1fr;
        /* Wider label column */
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        align-items: center;
        border-bottom: 1px solid #E2E8F0;
        font-size: 0.9rem;
        color: #4A5568;
    }

    #adminReportsTable td:first-child,
    #userManagementTable td:first-child {
        /* Checkbox cell */
        grid-template-columns: 1fr;
        /* Let it be a single column */
        padding-left: 1rem;
    }

    #adminReportsTable td:first-child::before,
    #userManagementTable td:first-child::before {
        display: none;
        /* No label for the checkbox */
    }

    #adminReportsTable td:last-child,
    #userManagementTable td:last-child,
    #sr-form-item-table-body td:last-child,
    #my-sr-history-table-body td:last-child {
        border-bottom: none;
    }

    #adminReportsTable td::before,
    #userManagementTable td::before,
    #sr-form-item-table-body td::before,
    #my-sr-history-table-body td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #4A5568;
    }

    #adminReportsTable td>*,
    #userManagementTable td>*,
    #sr-form-item-table-body td>*,
    #my-sr-history-table-body td>* {
        text-align: right;
        word-break: break-all;
        /* Fix for long unbroken words */
    }

    #adminReportsTable td:first-child>*,
    #userManagementTable td:first-child>* {
        justify-self: start;
        /* Align checkbox to the left */
        text-align: left;
    }

    /* Specific overrides for user table */
    #userManagementTable td[data-label="User"] {
        grid-template-columns: 1fr;
    }

    #userManagementTable td[data-label="User"]::before {
        display: none;
    }

    #userManagementTable td[data-label="Actions"],
    #my-sr-history-table-body td[data-label="Actions"] {
        grid-template-columns: 1fr;
    }

    #userManagementTable td[data-label="Actions"]>*,
    #my-sr-history-table-body td[data-label="Actions"]>* {
        justify-self: start;
        text-align: left;
    }

    .user-info-flex {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        justify-self: start !important;
    }

    .user-info-flex img {
        width: 32px;
        height: 32px;
    }

    /* Specific overrides for SR form table */
    #sr-form-item-table-body td {
        grid-template-columns: 100px 1fr;
        /* Shorter label */
    }

    #sr-form-item-table-body td>input {
        width: 100%;
    }

    /* --- NEW: Responsive styles for View-Only table --- */
    #view-sr-items-table thead {
        display: none;
    }

    #view-sr-items-table table,
    #view-sr-items-table tbody,
    #view-sr-items-table tr {
        display: block;
        width: 100%;
    }

    #view-sr-items-table tr {
        margin-bottom: 1rem;
        border: 1px solid #E2E8F0;
        border-radius: 0.75rem;
        overflow: hidden;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    }

    #view-sr-items-table td {
        display: grid;
        grid-template-columns: 130px 1fr;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        align-items: center;
        border-bottom: 1px solid #E2E8F0;
        font-size: 0.9rem;
        color: #4A5568;
    }

    #view-sr-items-table td:last-child {
        border-bottom: none;
    }

    /* We will add data-label attributes in admin.js */
    #view-sr-items-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #4A5568;
    }

    #view-sr-items-table td>span {
        text-align: right;
        word-break: break-all;
    }

    /* --- END: View-Only Table Responsive Styles --- */
}

/* --- Added for Admin Invoice Revamp --- */
.btn-white {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    color: #475569;
    transition: all 0.2s;
    border-radius: 0.375rem;
    font-weight: 500;
}

.btn-white:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

/* --- Added for Admin Invoice Revamp (Redesign v2) --- */
.animate-in {
    animation-duration: 500ms;
    animation-fill-mode: forwards;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in {
    animation-name: fadeIn;
}

.slide-in-from-bottom-4 {
    animation-name: slideInFromBottom;
}

.slide-in-from-right-4 {
    animation-name: slideInFromRight;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInFromBottom {
    from {
        transform: translateY(1rem);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes slideInFromRight {
    from {
        transform: translateX(1rem);
    }

    to {
        transform: translateX(0);
    }
}

/* Custom Scrollbar for Item Table and Suggestions */
#invoice-sr-table::-webkit-scrollbar,
#invoice-suggestions::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

#invoice-sr-table::-webkit-scrollbar-track,
#invoice-suggestions::-webkit-scrollbar-track {
    background: transparent;
}

#invoice-sr-table::-webkit-scrollbar-thumb,
#invoice-suggestions::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

#invoice-sr-table::-webkit-scrollbar-thumb:hover,
#invoice-suggestions::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

/* Form & Search refinement */
#invoice-form select:focus,
#invoice-form input:focus,
#invoice-co-search-input:focus {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.08);
    /* Sophisticated thin glow */
}

#invoice-co-search-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* 3-Column Workspace Cards */
#page-receive_invoice .bg-white {
    transition: box-shadow 0.3s ease;
}

#page-receive_invoice .bg-white:hover {
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.05);
}

/* Make inputs with type='number' look like text inputs (no arrows) */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
    /* Firefox */
    appearance: textfield;
}