﻿html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    box-sizing: border-box;
    height: 100%;
    margin: 0;
    padding: 0;
}

*, *::before, *::after {
    box-sizing: inherit;
}

:root {
    --primary-saffron: #fff8e1;
    --secondary-black: #ffac40;
    --text-on-dark: #FFFFFF; /* Added for better contrast on black */
}

/* Light/Dark theme styles for page container */
.page.dark-theme {
    background: #1a1a1a;
    color: #fff;
}

.page.light-theme {
    background: #ffffff;
    color: #000;
}

/* Sidebar backgrounds per theme */
.page.dark-theme .sidebar {
    background-color: #1a1a1a !important;
}

.page.light-theme .sidebar {
    background-color: #ffffff !important;
}

/* Navbar per theme */
.page.dark-theme .sidebar-navbar {
    background-color: #1a1a1a !important;
    color: #ffffff !important;
    border-bottom: 1px solid #ffffff;
}

.page.light-theme .sidebar-navbar {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-bottom: 1px solid #000000;
}

/* Nav link colors per theme */
.page.dark-theme .sidebar .nav-link,
.page.dark-theme .sidebar .sidebar-menu .nav-link,
.page.dark-theme .sidebar i,
.page.dark-theme .sidebar svg {
    color: #ffffff !important;
    font-weight: 600;
    opacity: 1 !important;
}

.page.dark-theme .sidebar .nav-link.active,
.page.dark-theme .sidebar .sidebar-menu .nav-link.active {
    color: #222 !important;
    background: rgba(255,255,255,0.25) !important;
}

.page.light-theme .sidebar .nav-link,
.page.light-theme .sidebar .sidebar-menu .nav-link,
.page.light-theme .sidebar i,
.page.light-theme .sidebar svg {
    color: #000000 !important;
    font-weight: 600;
    opacity: 1 !important;
}

.page.light-theme .sidebar .nav-link.active,
.page.light-theme .sidebar .sidebar-menu .nav-link.active {
    color: #fff !important;
    background: rgba(0,0,0,0.15) !important;
}

    /* Existing sidebar rules - keep as is for sidebar solid color */
    .saffron-theme .sidebar {
        background-color: #FFFFFF !important;
    }

    /* --- MODIFIED RULE FOR NAVBAR IN SAFFRON THEME --- */
    /* Target the sidebar-navbar directly for saffron & black */
    .saffron-theme .sidebar-navbar {
        background-color: var(--secondary-black) !important; /* Black background for the navbar */
        color: var(--primary-saffron) !important; /* Saffron text/icons for contrast */
        border-bottom: 1px solid var(--primary-saffron); /* Optional: add a saffron line */
    }

        /* Ensure elements within the saffron navbar respect the new color */
        .saffron-theme .sidebar-navbar .nav-link,
        .saffron-theme .sidebar-navbar .nav-link i,
        .saffron-theme .sidebar-navbar .nav-link svg,
        .saffron-theme .sidebar-navbar .navbar-brand { /* Assuming you have a brand/logo in the navbar */
            color: var(--primary-saffron) !important; /* Saffron for all text/icons */
        }

        /* If you have a toggle button in the navbar, adjust its color */
        .saffron-theme .sidebar-navbar .theme-toggle-btn {
            color: var(--primary-saffron) !important;
        }

        /* Ensure active/hover states within the saffron navbar are visible */
        .saffron-theme .sidebar-navbar .nav-link.active {
            background-color: rgba(255, 179, 71, 0.25) !important; /* Lighter saffron shade for active state */
            color: var(--text-on-dark) !important; /* White text for active background */
        }

        .saffron-theme .sidebar-navbar .nav-link:hover {
            background-color: rgba(255, 179, 71, 0.1) !important; /* Subtle hover effect */
            color: var(--primary-saffron) !important;
        }


    /* Keep existing styles */
    .saffron-theme .btn-outline-warning {
        color: var(--secondary-black);
        border-color: var(--primary-saffron);
        background-color: var(--primary-saffron);
    }

        .saffron-theme .btn-outline-warning:hover {
            background-color: var(--primary-saffron);
            color: #fff;
        }

    .saffron-theme .sidebar, .saffron-theme .sidebar * {
        color: var(--secondary-black) !important;
    }

        .saffron-theme .sidebar .nav-link, .saffron-theme .sidebar .sidebar-menu .nav-link, .saffron-theme .sidebar i, .saffron-theme .sidebar svg {
            color: var(--secondary-black) !important;
            font-weight: 600;
            opacity: 1 !important;
        }

            .saffron-theme .sidebar .nav-link.active, .saffron-theme .sidebar .sidebar-menu .nav-link.active {
                color: #fff !important;
                background: rgba(255,179,71,0.15) !important; /* primary-saffron with opacity */
            }

/* Back-compat dark default when not using saffron class (kept for existing styles) */
html:not(.saffron-theme) .sidebar .nav-link.active, html:not(.saffron-theme) .sidebar .sidebar-menu .nav-link.active {
    color: #222 !important;
    background: rgba(255,255,255,0.25) !important;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.page {
    display: flex;
    min-height: 100vh;
    width: 100vw;
    overflow: hidden;
    background: #1a1a1a;
}

.saffron-theme.page {
    background: #FFFFFF;
}

.sidebar {
    width: 250px;
    min-width: 200px;
    max-width: 300px;
    height: 100vh;
    position: relative;
    z-index: 100;
    background: #fff;
    transition: transform 0.3s ease-in-out;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
    display: none;
    flex-shrink: 0;
    background-color: #1a1a1a !important;
}

    .sidebar.sidebar-visible {
        display: block;
        position: absolute;
        left: 0;
        top: 0;
        height: 100vh;
    }

/* Remove forced display:block for sidebar on desktop, allow toggling on all sizes */
/* Commenting out the following block to allow sidebar toggling on all screen sizes */
/*
@media (min-width: 768px) {
    .sidebar {
        display: block !important;
        position: relative;
        height: 100vh;
        box-shadow: none;
    }
}
*/

main {
    flex: 1 1 0%;
    min-width: 0;
    margin-left: 0;
    transition: margin-left 0.3s;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-x: auto;
    background: transparent;
}

@media (min-width: 768px) {
    main {
        margin-left: 0;
    }
}

.content {
    padding-top: 1.1rem;
    flex: 1 1 auto;
    overflow-y: auto;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45OTMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3LjgyMSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.status-bar-safe-area {
    display: none;
}

@supports (-webkit-touch-callout: none) {
    .status-bar-safe-area {
        display: flex;
        position: sticky;
        top: 0;
        height: env(safe-area-inset-top);
        background-color: #f7f7f7;
        width: 100%;
        z-index: 1;
    }

    .flex-column, .navbar-brand {
        padding-left: env(safe-area-inset-left);
    }
}

/* Nav menu alignment fix */
.sidebar-menu .nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    font-size: 1rem;
    line-height: 1.5;
}

    .sidebar-menu .nav-link i {
        font-size: 1.2em;
        display: flex;
        align-items: center;
    }

.btn-close-sidebar {
    font-size: 1.5rem;
    color: #fff;
    background: none;
    border: none;
    padding: 0 0.5rem;
    line-height: 1;
    box-shadow: none;
}

    .btn-close-sidebar:focus {
        outline: none;
        box-shadow: none;
    }

@media (min-width: 768px) {
    .btn-close-sidebar {
        display: none !important;
    }
}

/* Ensure the sidebar toggle button is always visible */
.top-row .btn {
    display: inline-block !important;
}

/* Sidebar layout to keep logout button at bottom */
.sidebar-navbar {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-menu {
    flex: 1 1 auto;
}

.sidebar-footer {
    margin-top: auto;
}

/* Dark theme styles */
html.dark-theme, body.dark-theme {
    background: #1a1a1a;
    color: #fff;
}

/* Saffron theme styles */
html.saffron-theme, body.saffron-theme {
    background: #FFFFFF;
    color: var(--secondary-black);
}

/* Mobile-first responsive utilities */
@media (max-width: 576px) {
    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .btn {
        min-height: 44px; /* Touch-friendly minimum size */
        padding: 0.5rem 0.75rem;
    }
    
    .btn-sm {
        min-height: 36px;
        padding: 0.375rem 0.5rem;
    }
    
    .form-control, .form-select {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .table-responsive {
        border: none;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th, .table td {
        padding: 0.5rem 0.25rem;
        vertical-align: middle;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-content {
        max-height: calc(100vh - 1rem);
    }
    
    .modal-body {
        max-height: calc(100vh - 200px);
        overflow-y: auto;
    }
}

@media (max-width: 768px) {
    .d-flex.gap-2 {
        flex-wrap: wrap;
        gap: 0.5rem !important;
    }
    
    .btn-group {
        flex-wrap: wrap;
    }
    
    .btn-group .btn {
        margin-bottom: 0.25rem;
    }
    
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .table th, .table td {
        padding: 0.375rem 0.25rem;
        white-space: nowrap;
    }
    
    .text-truncate {
        max-width: 120px;
    }
}

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }
    
    .btn:active {
        transform: scale(0.98);
    }
    
    .table tbody tr:hover {
        background-color: transparent;
    }
    
    .table tbody tr:active {
        background-color: rgba(0, 123, 255, 0.1);
    }
}

/* Mobile-specific table improvements */
@media (max-width: 768px) {
    .mobile-table-card {
        display: block;
    }
    
    .mobile-table-card .table {
        display: none;
    }
    
    .mobile-table-card .mobile-card {
        display: block;
        margin-bottom: 0.75rem;
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
        padding: 0.75rem;
        background: white;
    }
    
    .mobile-card .card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.5rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid #e9ecef;
    }
    
    .mobile-card .card-title {
        font-size: 0.9rem;
        font-weight: 600;
        margin: 0;
    }
    
    .mobile-card .card-body {
        padding: 0;
    }
    
    .mobile-card .row {
        margin: 0;
    }
    
    .mobile-card .col-6 {
        padding: 0.25rem 0;
    }
    
    .mobile-card .label {
        font-size: 0.75rem;
        color: #6c757d;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .mobile-card .value {
        font-size: 0.875rem;
        color: #212529;
        font-weight: 500;
    }
    
    .mobile-card .actions {
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid #e9ecef;
    }
    
    .mobile-card .actions .btn {
        margin-right: 0.25rem;
        margin-bottom: 0.25rem;
    }
}

/* Hide mobile cards on desktop */
@media (min-width: 769px) {
    .mobile-table-card .mobile-card {
        display: none;
    }
    
    .mobile-table-card .table {
        display: table;
    }
}

/* Mobile-friendly modals */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 0.25rem;
        max-width: calc(100% - 0.5rem);
        max-height: calc(100vh - 0.5rem);
    }
    
    .modal-content {
        max-height: calc(100vh - 0.5rem);
        border-radius: 0.5rem;
    }
    
    .modal-header {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #dee2e6;
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 1rem;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }
    
    .modal-footer {
        padding: 0.75rem 1rem;
        border-top: 1px solid #dee2e6;
    }
    
    .modal-footer .btn {
        min-width: 80px;
    }
}

/* Mobile navigation improvements */
@media (max-width: 768px) {
    .sidebar {
        width: 100vw;
        max-width: 300px;
    }
    
    .sidebar-visible::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
}

/* Mobile-friendly form improvements */
@media (max-width: 768px) {
    .form-label {
        font-size: 0.9rem;
        font-weight: 600;
        margin-bottom: 0.25rem;
    }
    
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
    }
    
    .form-check-input {
        width: 1.25rem;
        height: 1.25rem;
    }
    
    .form-check-label {
        font-size: 0.9rem;
        padding-left: 0.5rem;
    }
}

/* Mobile pagination */
@media (max-width: 768px) {
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .pagination .page-item {
        margin: 0.125rem;
    }
    
    .pagination .page-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* Mobile search and filters */
@media (max-width: 768px) {
    .search-filters {
        margin-bottom: 1rem;
    }
    
    .search-filters .row {
        margin: 0;
    }
    
    .search-filters .col-md-3,
    .search-filters .col-md-2 {
        margin-bottom: 0.75rem;
    }
    
    .search-filters .form-control,
    .search-filters .form-select {
        width: 100%;
    }
}

/* Mobile-specific improvements for better touch experience */
@media (max-width: 768px) {
    /* Ensure proper spacing for mobile cards */
    .mobile-card {
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        border: 1px solid #e9ecef;
        border-radius: 0.5rem;
        background: white;
    }
    
    .mobile-card .card-header {
        background: #f8f9fa;
        border-bottom: 1px solid #e9ecef;
        padding: 0.75rem;
    }
    
    .mobile-card .card-body {
        padding: 0.75rem;
    }
    
    /* Mobile-friendly button groups */
    .btn-group-mobile {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .btn-group-mobile .btn {
        flex: 1;
        min-width: 0;
    }
    
    /* Mobile table headers */
    .table-mobile-header {
        background: #f8f9fa;
        padding: 0.75rem;
        border-bottom: 1px solid #e9ecef;
        font-weight: 600;
        color: #495057;
    }
    
    /* Mobile-friendly badges */
    .badge-mobile {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
        border-radius: 0.375rem;
    }
    
    /* Mobile-friendly form controls */
    .form-control-mobile {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
        border-radius: 0.5rem;
        border: 1px solid #ced4da;
    }
    
    /* Mobile-friendly modals */
    .modal-mobile {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
        max-height: calc(100vh - 1rem);
    }
    
    /* Mobile-friendly navigation */
    .nav-mobile {
        padding: 0.5rem;
    }
    
    .nav-mobile .nav-link {
        padding: 0.75rem 1rem;
        border-radius: 0.375rem;
        margin-bottom: 0.25rem;
    }
    
    /* Mobile-friendly cards */
    .card-mobile {
        margin-bottom: 1rem;
        border-radius: 0.5rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    /* Mobile-friendly spacing */
    .p-mobile {
        padding: 0.75rem;
    }
    
    .m-mobile {
        margin: 0.75rem;
    }
    
    /* Mobile-friendly text */
    .text-mobile {
        font-size: 0.875rem;
        line-height: 1.5;
    }
    
    /* Mobile-friendly icons */
    .icon-mobile {
        width: 1.5rem;
        height: 1.5rem;
    }
    
    /* Mobile-friendly images */
    .img-mobile {
        max-width: 100%;
        height: auto;
        border-radius: 0.375rem;
    }
}

/* Additional mobile optimizations for very small screens */
@media (max-width: 576px) {
    .container-fluid {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    .btn-sm {
        font-size: 0.8rem;
        padding: 0.375rem 0.5rem;
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .modal-dialog {
        margin: 0.25rem;
        max-width: calc(100% - 0.5rem);
    }
    
    .mobile-card {
        margin-bottom: 0.5rem;
    }
    
    .mobile-card .card-header {
        padding: 0.5rem;
    }
    
    .mobile-card .card-body {
        padding: 0.5rem;
    }
}

/* Mobile-specific card styles */
.mobile-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #e9ecef;
    border-radius: 0.75rem;
}

.mobile-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mobile-icon {
    transition: transform 0.2s ease;
}

.mobile-card:hover .mobile-icon {
    transform: scale(1.1);
}

.mobile-stats-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.mobile-stats-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Mobile button improvements */
.btn-mobile {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

/* Icon-only button utility */
.btn-icon-only {
    padding: 0.5rem !important;
}

.btn-group .btn-icon-only i,
.btn.btn-icon-only i {
    margin: 0 !important;
}

.btn-mobile:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-mobile:active {
    transform: translateY(0);
}

/* Mobile form improvements */
@media (max-width: 768px) {
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
        border-radius: 0.5rem;
        border: 1px solid #ced4da;
    }
    
    .form-label {
        font-weight: 600;
        margin-bottom: 0.5rem;
        color: #495057;
    }
    
    .input-group .form-control {
        border-radius: 0.5rem 0 0 0.5rem;
    }
    
    .input-group .btn {
        border-radius: 0 0.5rem 0.5rem 0;
    }
}

/* Mobile table improvements */
@media (max-width: 768px) {
    .table-responsive {
        border: none;
        border-radius: 0.5rem;
        overflow: hidden;
    }
    
    .table {
        margin-bottom: 0;
        font-size: 0.875rem;
    }
    
    .table th {
        background-color: #f8f9fa;
        border-bottom: 2px solid #dee2e6;
        font-weight: 600;
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }
    
    .table td {
        padding: 0.75rem 0.5rem;
        vertical-align: middle;
        border-bottom: 1px solid #dee2e6;
    }
    
    .table tbody tr:hover {
        background-color: rgba(0, 123, 255, 0.05);
    }
}

/* Mobile modal improvements */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
        max-height: calc(100vh - 1rem);
    }
    
    .modal-content {
        border-radius: 0.75rem;
        border: none;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
    
    .modal-header {
        border-bottom: 1px solid #e9ecef;
        padding: 1rem;
    }
    
    .modal-title {
        font-size: 1.1rem;
        font-weight: 600;
    }
    
    .modal-body {
        padding: 1rem;
        max-height: calc(100vh - 200px);
        overflow-y: auto;
    }
    
    .modal-footer {
        border-top: 1px solid #e9ecef;
        padding: 1rem;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        min-width: 80px;
    }
}

/* Mobile navigation improvements */
@media (max-width: 768px) {
    .sidebar-navbar {
        padding: 0;
    }
    
    .sidebar-header {
        padding: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .sidebar-title {
        font-size: 1.1rem;
        font-weight: 600;
    }
    
    .btn-close-sidebar {
        font-size: 1.25rem;
        padding: 0.5rem;
        border-radius: 0.375rem;
        background: rgba(255, 255, 255, 0.1);
        border: none;
        color: #fff;
        transition: all 0.2s ease;
    }
    
    .btn-close-sidebar:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: scale(1.1);
    }
    
    .sidebar-menu {
        padding: 0.5rem 0;
    }
    
    .sidebar-menu .nav-item {
        margin: 0.25rem 0;
    }
    
    .sidebar-menu .nav-link {
        padding: 0.75rem 1rem;
        margin: 0 0.5rem;
        border-radius: 0.5rem;
        font-weight: 500;
        transition: all 0.2s ease;
    }
    
    .sidebar-menu .nav-link:hover {
        background: rgba(255, 255, 255, 0.1);
        transform: translateX(4px);
    }
    
    .sidebar-menu .nav-link.active {
        background: rgba(255, 255, 255, 0.2);
        font-weight: 600;
    }
    
    .sidebar-footer {
        padding: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .sidebar-footer .btn {
        width: 100%;
        padding: 0.75rem;
        font-weight: 500;
        border-radius: 0.5rem;
    }
}

/* Enhanced image handling for WebView stability */
.product-image, .product-image-large {
    max-width: 100%;
    height: auto;
    object-fit: cover;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    transition: opacity 0.3s ease;
}

.product-image {
    width: 40px;
    height: 40px;
}

.product-image-large {
    width: 100%;
    max-height: 300px;
}

/* Image loading states */
.image-loading {
    opacity: 0.5;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Image error states */
.image-error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

/* Product placeholder styling */
.product-placeholder {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    color: #6c757d;
}

.no-image-placeholder {
    width: 100%;
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 0.375rem;
    color: #6c757d;
}

.no-image-placeholder i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Image preview container */
.image-preview-container {
    position: relative;
    display: inline-block;
}

.image-preview-container img {
    max-width: 100%;
    height: auto;
    border-radius: 0.375rem;
}

/* Responsive image handling */
@media (max-width: 768px) {
    .product-image {
        width: 35px;
        height: 35px;
    }
    
    .product-image-large {
        max-height: 200px;
    }
    
    .no-image-placeholder {
        height: 150px;
    }
}

/* Additional mobile-specific improvements */
@media (max-width: 768px) {
    /* Mobile-specific card improvements */
    .mobile-card {
        border-radius: 0.75rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        transition: all 0.2s ease;
    }
    
    .mobile-card:hover {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
        transform: translateY(-2px);
    }
    
    /* Mobile-specific button improvements */
    .btn-mobile {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 500;
        border-radius: 0.5rem;
        transition: all 0.2s ease;
        padding: 0.5rem 1rem;
    }
    
    .btn-mobile:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    
    .btn-mobile:active {
        transform: translateY(0);
    }
    
    /* Mobile-specific form improvements */
    .form-control, .form-select {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 0.5rem;
    }
    
    .form-label {
        font-weight: 600;
        margin-bottom: 0.5rem;
    }
    
    /* Mobile-specific table improvements */
    .table-responsive {
        border-radius: 0.5rem;
        overflow: hidden;
    }
    
    .table th, .table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
        border: none;
        vertical-align: middle;
    }
    
    .table th {
        background-color: #f8f9fa;
        font-weight: 600;
        text-transform: uppercase;
        font-size: 0.75rem;
        letter-spacing: 0.5px;
    }
    
    /* Mobile-specific modal improvements */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-content {
        border-radius: 0.75rem;
        border: none;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
    
    .modal-header {
        border-bottom: 1px solid #e9ecef;
        padding: 1rem 1.5rem;
    }
    
    .modal-title {
        font-size: 1.25rem;
        font-weight: 600;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-footer {
        border-top: 1px solid #e9ecef;
        padding: 1rem 1.5rem;
    }
    
    /* Mobile-specific navigation improvements */
    .nav-pills .nav-link {
        padding: 0.75rem 1rem;
        border-radius: 0.5rem;
        font-weight: 500;
    }
    
    .nav-pills .nav-link.active {
        background-color: #0d6efd;
        color: white;
    }
    
    /* Mobile-specific badge improvements */
    .badge {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
        border-radius: 0.375rem;
    }
    
    /* Mobile-specific progress bar improvements */
    .progress {
        height: 8px;
        border-radius: 4px;
        background-color: #e9ecef;
    }
    
    .progress-bar {
        border-radius: 4px;
    }
    
    /* Mobile-specific alert improvements */
    .alert {
        border-radius: 0.5rem;
        border: none;
        padding: 1rem 1.25rem;
    }
    
    .alert-dismissible .btn-close {
        padding: 0.75rem 1rem;
    }
    
    /* Mobile-specific pagination improvements */
    .pagination {
        justify-content: center;
        margin-bottom: 0;
    }
    
    .page-link {
        padding: 0.5rem 0.75rem;
        border-radius: 0.375rem;
        margin: 0 0.125rem;
        border: 1px solid #dee2e6;
    }
    
    .page-item.active .page-link {
        background-color: #0d6efd;
        border-color: #0d6efd;
    }
    
    /* Mobile-specific dropdown improvements */
    .dropdown-menu {
        border-radius: 0.5rem;
        border: none;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
        padding: 0.5rem 0;
    }
    
    .dropdown-item {
        padding: 0.75rem 1.25rem;
        font-weight: 500;
    }
    
    .dropdown-item:hover {
        background-color: #f8f9fa;
    }
    
    /* Mobile-specific input group improvements */
    .input-group .form-control {
        border-radius: 0.5rem 0 0 0.5rem;
    }
    
    .input-group .btn {
        border-radius: 0 0.5rem 0.5rem 0;
    }
    
    /* Mobile-specific card improvements */
    .card {
        border-radius: 0.75rem;
        border: 1px solid #e9ecef;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .card-header {
        background-color: #f8f9fa;
        border-bottom: 1px solid #e9ecef;
        padding: 1rem 1.25rem;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    .card-footer {
        background-color: #f8f9fa;
        border-top: 1px solid #e9ecef;
        padding: 1rem 1.25rem;
    }
    
    /* Mobile-specific text improvements */
    .text-truncate {
        max-width: 200px;
    }
    
    .fw-bold {
        font-weight: 700 !important;
    }
    
    .fw-semibold {
        font-weight: 600 !important;
    }
    
    /* Mobile-specific spacing improvements */
    .mb-3 {
        margin-bottom: 1rem !important;
    }
    
    .mt-3 {
        margin-top: 1rem !important;
    }
    
    .p-3 {
        padding: 1rem !important;
    }
    
    .px-3 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .py-3 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
}

/* Fix for modal text visibility - override theme colors */
.modal-content {
    color: #212529 !important; /* Dark text for better visibility */
}

.modal-content .form-label {
    color: #212529 !important; /* Ensure form labels are visible */
}

.modal-content .form-check-label {
    color: #212529 !important; /* Ensure checkbox labels are visible */
}

.modal-content .text-muted {
    color: #6c757d !important; /* Ensure muted text is visible */
}

.modal-content .small {
    color: #6c757d !important; /* Ensure small text is visible */
}

.modal-content .invalid-feedback {
    color: #dc3545 !important; /* Ensure validation messages are visible */
}

.modal-content .valid-feedback {
    color: #198754 !important; /* Ensure success messages are visible */
}

/* Override any theme-specific modal text colors */
.page.dark-theme .modal-content,
.page.light-theme .modal-content,
.saffron-theme .modal-content {
    color: #212529 !important;
}

.page.dark-theme .modal-content .form-label,
.page.light-theme .modal-content .form-label,
.saffron-theme .modal-content .form-label {
    color: #212529 !important;
}

.page.dark-theme .modal-content .form-check-label,
.page.light-theme .modal-content .form-check-label,
.saffron-theme .modal-content .form-check-label {
    color: #212529 !important;
}

/* Toast notification text color fixes for MAUI */
.toast-notification {
    color: inherit !important;
}

.toast-notification.success {
    background: #d4edda !important;
    color: #155724 !important;
    border-left: 4px solid #28a745 !important;
}

.toast-notification.error {
    background: #f8d7da !important;
    color: #721c24 !important;
    border-left: 4px solid #dc3545 !important;
}

.toast-notification.warning {
    background: #fff3cd !important;
    color: #856404 !important;
    border-left: 4px solid #ffc107 !important;
}

.toast-notification.info {
    background: #d1ecf1 !important;
    color: #0c5460 !important;
    border-left: 4px solid #17a2b8 !important;
}

.toast-title {
    color: inherit !important;
    font-weight: 600 !important;
    margin-bottom: 0.25rem !important;
}

.toast-message {
    color: inherit !important;
    font-size: 0.9rem !important;
}

.toast-icon {
    color: inherit !important;
}

.toast-close {
    color: inherit !important;
    opacity: 0.7 !important;
}

.toast-close:hover {
    opacity: 1 !important;
}

/* Override theme-specific toast colors */
.page.dark-theme .toast-notification.success,
.page.light-theme .toast-notification.success,
.saffron-theme .toast-notification.success {
    background: #d4edda !important;
    color: #155724 !important;
}

.page.dark-theme .toast-notification.error,
.page.light-theme .toast-notification.error,
.saffron-theme .toast-notification.error {
    background: #f8d7da !important;
    color: #721c24 !important;
}

.page.dark-theme .toast-notification.warning,
.page.light-theme .toast-notification.warning,
.saffron-theme .toast-notification.warning {
    background: #fff3cd !important;
    color: #856404 !important;
}

.page.dark-theme .toast-notification.info,
.page.light-theme .toast-notification.info,
.saffron-theme .toast-notification.info {
    background: #d1ecf1 !important;
    color: #0c5460 !important;
}

/* Ensure toast text elements inherit the correct colors */
.page.dark-theme .toast-title,
.page.light-theme .toast-title,
.saffron-theme .toast-title {
    color: inherit !important;
}

.page.dark-theme .toast-message,
.page.light-theme .toast-message,
.saffron-theme .toast-message {
    color: inherit !important;
}

.page.dark-theme .toast-icon,
.page.light-theme .toast-icon,
.saffron-theme .toast-icon {
    color: inherit !important;
}

.page.dark-theme .toast-close,
.page.light-theme .toast-close,
.saffron-theme .toast-close {
    color: inherit !important;
}

/* Bootstrap toast text color fixes for MAUI */
.toast .toast-header {
    color: #212529 !important;
}

.toast .toast-header .me-auto {
    color: #212529 !important;
}

.toast .toast-body {
    color: #212529 !important;
}

.toast .btn-close {
    color: #212529 !important;
}

/* Override theme-specific Bootstrap toast colors */
.page.dark-theme .toast .toast-header,
.page.light-theme .toast .toast-header,
.saffron-theme .toast .toast-header {
    color: #212529 !important;
}

.page.dark-theme .toast .toast-header .me-auto,
.page.light-theme .toast .toast-header .me-auto,
.saffron-theme .toast .toast-header .me-auto {
    color: #212529 !important;
}

.page.dark-theme .toast .toast-body,
.page.light-theme .toast .toast-body,
.saffron-theme .toast .toast-body {
    color: #212529 !important;
}

.page.dark-theme .toast .btn-close,
.page.light-theme .toast .btn-close,
.saffron-theme .toast .btn-close {
    color: #212529 !important;
}