html {
    --rs-body-bg: #ffffff;
    --rs-body-color: #212529;
    --rs-surface: #ffffff;
    --rs-surface-subtle: #f8f9fa;
    --rs-input-bg: #f2f2f2;
    --rs-input-focus-bg: #ffffff;
    --rs-border: #dee2e6;
    --rs-border-strong: #ced4da;
    --rs-heading: #2c3e50;
    --rs-text: #333333;
    --rs-text-muted: #6c757d;
    --rs-table-text: #495057;
    --rs-hover-bg: #f8f9fa;
    --rs-menu-bg: #ffffff;
    --rs-shadow: rgba(0, 0, 0, 0.12);
    --rs-primary-link: #006bb7;
    --rs-focus-ring-inner: #ffffff;
    --rs-status-muted-bg: #e9ecef;
    --rs-info-bg: #f8f9fa;
}

[data-bs-theme="dark"] {
    --rs-body-bg: #111827;
    --rs-body-color: #e5e7eb;
    --rs-surface: #1f2937;
    --rs-surface-subtle: #172033;
    --rs-input-bg: #111827;
    --rs-input-focus-bg: #0f172a;
    --rs-border: #374151;
    --rs-border-strong: #4b5563;
    --rs-heading: #f3f4f6;
    --rs-text: #e5e7eb;
    --rs-text-muted: #9ca3af;
    --rs-table-text: #d1d5db;
    --rs-hover-bg: #243247;
    --rs-menu-bg: #1f2937;
    --rs-shadow: rgba(0, 0, 0, 0.45);
    --rs-primary-link: #7db8ff;
    --rs-focus-ring-inner: #111827;
    --rs-status-muted-bg: #374151;
    --rs-info-bg: #172033;
    --bs-body-bg: var(--rs-body-bg);
    --bs-body-color: var(--rs-body-color);
    --bs-secondary-color: var(--rs-text-muted);
    --bs-border-color: var(--rs-border);
}

html,
body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--rs-body-bg);
    color: var(--rs-body-color);
}

.page,
main,
article.content,
.content,
.page-container {
    background-color: var(--rs-body-bg);
    color: var(--rs-body-color);
}

main {
    min-height: 100vh;
}

a,
.btn-link {
    color: var(--rs-primary-link);
}

.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 var(--rs-focus-ring-inner), 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

@media (max-width: 1279.98px) {
    .content {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

h1:focus {
    outline: none;
}

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

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

.validation-message {
    color: #e50000;
}

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

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

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Toast Styling */
.toast-container {
    z-index: 1090;
}

.toast {
    min-width: 300px;
    max-width: 400px;
}

.toast-body {
    padding: 0.75rem;
}

/* Common Report Form Styles */
.card {
    box-shadow: none;
    border-radius: 0;
}

.section-card {
    border: 1px solid var(--rs-border);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.card,
.card-body {
    background-color: var(--rs-surface);
    color: var(--rs-body-color);
}

.form-control,
.form-select {
    background-color: var(--rs-input-bg);
    border: 1px solid var(--rs-border-strong);
    color: var(--rs-body-color);
    border-radius: 0;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--rs-input-focus-bg);
    color: var(--rs-body-color);
    box-shadow: none;
    border-color: #80bdff;
}

.form-label {
    font-size: 0.9rem;
    color: var(--rs-text);
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-wrap: nowrap;
}


.form-check-input {
    width: 3em;
    height: 1.5em;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: #28a745;
    border-color: #28a745;
}

/* Toggle Switch Styling */
.form-switch .form-check-input {
    width: 2.5em;
    height: 1.25em;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba(0,0,0,0.25)'/%3e%3c/svg%3e");
    background-position: left center;
    border-radius: 2em;
    transition: background-position 0.15s ease-in-out;
    background-color: var(--rs-status-muted-bg);
    border: 1px solid var(--rs-border-strong);
}

.form-switch .form-check-input:checked {
    background-position: right center;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
    background-color: #28a745;
    border-color: #28a745;
}

.form-switch .form-check-input:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba(0,0,0,0.25)'/%3e%3c/svg%3e");
    box-shadow: 0 0 0 0.25rem rgba(40, 167, 69, 0.25);
}

.form-switch .form-check-input:checked:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

.form-check-label {
    font-size: 0.85rem;
    color: var(--rs-text);
    cursor: pointer;
    padding-left: 0.5rem;
}


.form-actions {
    margin-top: 2rem;
    text-align: center;
    margin-bottom: 1rem;
}

.btn-submit {
    background-color: #ff0000;
    color: white;
    padding: 0.75rem 4rem;
    font-weight: 600;
    text-transform: uppercase;
    border: none;
    border-radius: 0;
}

.btn-submit:hover {
    background-color: #cc0000;
    color: white;
}

.btn-submit:disabled {
    background-color: #ffcccc;
    cursor: not-allowed;
}

.alert {
    border-radius: 0;
}

.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--rs-heading);
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .page-container {
        padding: 1rem 0.5rem;
    }

    .page-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .btn-submit {
        width: 100%;
        padding: 0.75rem 2rem;
    }
}

.text-muted {
    font-size: 0.85rem;
    color: var(--rs-text-muted) !important;
}

/* Common Action Icons */
.action-icon {
    background: none;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    padding: 0;
    transition: all 0.2s ease;
    position: relative;
    vertical-align: middle;
}

.action-icon::before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.icon-edit::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a90e2' stroke-width='2'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'/%3E%3C/svg%3E");
}

.icon-edit:hover::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232874c7' stroke-width='2'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'/%3E%3C/svg%3E");
}

.icon-delete::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e74c3c' stroke-width='2'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/%3E%3Cline x1='10' y1='11' x2='10' y2='17'/%3E%3Cline x1='14' y1='11' x2='14' y2='17'/%3E%3C/svg%3E");
}

.icon-delete:hover::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c0392b' stroke-width='2'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/%3E%3Cline x1='10' y1='11' x2='10' y2='17'/%3E%3Cline x1='14' y1='11' x2='14' y2='17'/%3E%3C/svg%3E");
}

.icon-soft-delete::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f39c12' stroke-width='2'%3E%3Cpath d='M21 8v13H3V8'/%3E%3Cpath d='M1 3h22v5H1z'/%3E%3Cpath d='M10 12h4'/%3E%3C/svg%3E");
}

.icon-soft-delete:hover::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d68910' stroke-width='2'%3E%3Cpath d='M21 8v13H3V8'/%3E%3Cpath d='M1 3h22v5H1z'/%3E%3Cpath d='M10 12h4'/%3E%3C/svg%3E");
}

@media (max-width: 768px) {
    .action-icon {
        width: 28px;
        height: 28px;
    }
}

.info-card {
    background-color: var(--rs-info-bg);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--rs-border);
}

.info-label {
    font-size: 0.875rem;
    color: var(--rs-text-muted);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.info-value {
    font-size: 1rem;
    color: var(--rs-heading);
    font-weight: 600;
}

/* Section Header Styling (for detail pages) */
.section-header {
    background-color: #2c3e50;
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    padding: 0.75rem 1rem;
}

/* Status Bar Styling */
.status-bar {
    background-color: #dc3545;
    transition: background-color 0.3s ease;
}

.status-bar.active {
    background-color: #28a745;
}

.status-bar.deleted {
    background-color: #6c757d;
}

/* Mobile Responsive Improvements - Tablet First Approach (< 1280px) */
@media (max-width: 1279.98px) {
    /* General Layout */
    body {
        font-size: 16px; /* Better readability on mobile */
    }

    /* Tables - Make them scrollable horizontally on mobile */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 0.9rem;
    }

    table th,
    table td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }

    /* Buttons */
    .btn {
        touch-action: manipulation; /* Better touch response */
    }

    .btn-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn-group .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    /* Forms */
    .form-control,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 44px; /* Better touch target */
    }

    .form-label {
        font-size: 1rem;
    }

    /* Cards and Sections */
    .card {
        margin-bottom: 1rem;
    }

    .section-card {
        border-radius: 4px;
        margin-bottom: 1rem;
    }

    /* Modals */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    /* Navigation improvements for small screens */
    .nav-tabs {
        flex-wrap: wrap;
    }

    .nav-tabs .nav-link {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }

    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pagination .page-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    /* Toast notifications */
    .toast {
        min-width: auto;
        max-width: 90vw;
    }
}

/* Extra small mobile devices (< 768px) */
@media (max-width: 767.98px) {
    /* Even more compact on small phones */
    .page-title {
        font-size: 1.25rem;
    }

    table {
        font-size: 0.85rem;
    }

    table th,
    table td {
        padding: 0.5rem 0.25rem;
    }

    .btn {
        font-size: 0.9rem;
        padding: 0.625rem 1.25rem;
    }

    /* Stack form fields on very small screens */
    .row > [class*='col-'] {
        margin-bottom: 0.75rem;
    }
}

/* Landscape orientation adjustments for tablets */
@media (max-width: 1279.98px) and (orientation: landscape) {
    main {
        padding-top: 90px; /* Slightly less padding in landscape */
    }

    .top-row {
        min-height: 90px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets on touch devices */
    a, button, .btn, .nav-link {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Search Components Styling */
.search-container {
    position: relative;
    margin-bottom: 2rem;
    z-index: 11;
}

.search-bar-container {
    position: relative;
    width: 100%;
}

.search-bar-container .search-input,
.search-bar-container .form-control.search-input {
    width: 100%;
    padding: 1rem 2.5rem 1rem 1.25rem !important;
    font-size: 1.125rem !important;
    border: 1px solid var(--rs-border-strong) !important;
    border-radius: 4px !important;
    min-height: 56px !important;
}

.clear-search-button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    width: 24px;
    height: 24px;
    padding: 0;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.clear-search-button:hover {
    opacity: 1;
}

.clear-search-button::before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.search-results-overlay {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--rs-menu-bg);
    border: 1px solid var(--rs-border-strong);
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 6px var(--rs-shadow);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

.results-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.results-table thead {
    background-color: var(--rs-surface-subtle);
    border-bottom: 2px solid var(--rs-border);
}

.results-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--rs-table-text);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.results-table tbody tr {
    border-bottom: 1px solid var(--rs-border);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.results-table tbody tr:hover {
    background-color: var(--rs-hover-bg);
}

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

.results-table td {
    padding: 0.75rem 1rem;
    color: var(--rs-table-text);
    font-size: 0.9rem;
}

.no-results {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--rs-text-muted);
    font-style: italic;
}

/* Entity Grid */
.header-add-button {
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-weight: 700;
    padding: 0.75rem 1.25rem;
    white-space: nowrap;
    backdrop-filter: blur(10px);
}

.header-add-button:hover,
.header-add-button:focus {
    border-color: rgba(255, 255, 255, 0.55);
    background-color: rgba(255, 255, 255, 0.28);
    color: #fff;
}

.entity-grid {
    display: grid;
    gap: 1rem;
    min-width: 0;
    max-width: 100%;
}

.entity-grid-toolbar .search-container {
    margin-bottom: 0;
}

.entity-grid-toolbar {
    display: grid;
    gap: 0.75rem;
}

.entity-grid-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    border: 1px solid var(--rs-border);
    border-radius: 8px;
    background: var(--rs-surface);
    -webkit-overflow-scrolling: touch;
}

.entity-grid-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.entity-grid-table thead {
    background-color: var(--rs-surface-subtle);
    border-bottom: 2px solid var(--rs-border);
}

.entity-grid-table th,
.entity-grid-table td {
    padding: 0.75rem 1rem;
    color: var(--rs-table-text);
    font-size: 0.9rem;
    text-align: left;
    vertical-align: middle;
}

.entity-grid-table thead tr:first-child th:first-child {
    border-top-left-radius: 7px;
}

.entity-grid-table thead tr:first-child th:last-child {
    border-top-right-radius: 7px;
}

.entity-grid-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 7px;
}

.entity-grid-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 7px;
}

.entity-grid-table th {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.entity-grid-table tbody tr {
    border-bottom: 1px solid var(--rs-border);
    cursor: pointer;
}

.entity-grid-table tbody tr:hover {
    background-color: var(--rs-hover-bg);
}

.entity-grid-table tbody tr.entity-grid-row-readonly {
    cursor: default;
}

.entity-grid-table tbody tr.entity-grid-row-readonly:hover {
    background-color: transparent;
}

.entity-grid-table tbody tr:last-child {
    border-bottom: none;
}

.entity-grid-sort {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-transform: inherit;
}

.entity-grid-status-header {
    position: relative;
    white-space: nowrap;
}

.entity-grid-status-header > span {
    display: inline-flex;
    align-items: center;
    margin-right: 0.5rem;
}

.entity-grid-status-filter-button {
    position: relative;
    display: inline-flex;
    width: 1.75rem;
    height: 1.75rem;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 4px;
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%230ea5e9' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5h18l-7 8v5l-4 2v-7L3 5Z'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 1rem 1rem;
    vertical-align: middle;
}

.entity-grid-status-filter-button:hover,
.entity-grid-status-filter-button:focus {
    border-color: #7db8ff;
    background-color: var(--rs-hover-bg);
}

.entity-grid-status-menu {
    position: absolute;
    z-index: 5;
    top: calc(100% - 0.25rem);
    right: 0.75rem;
    display: grid;
    min-width: 14rem;
    max-width: 18rem;
    padding: 0.35rem;
    border: 1px solid var(--rs-border-strong);
    border-radius: 6px;
    background-color: var(--rs-menu-bg);
    box-shadow: 0 0.35rem 0.8rem var(--rs-shadow);
    text-transform: none;
    letter-spacing: 0;
}

.entity-grid-status-option {
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--rs-table-text);
    padding: 0.45rem 0.65rem;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
}

.entity-grid-status-option:hover,
.entity-grid-status-option:focus {
    background-color: var(--rs-hover-bg);
}

.entity-grid-status-option-active {
    background-color: rgba(13, 110, 253, 0.18);
    color: #0d6efd;
}

.sort-indicator {
    display: inline-block;
    width: 0.9rem;
    height: 0.9rem;
    opacity: 0.35;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 0.85rem 0.85rem;
}

.sort-indicator-asc,
.sort-indicator-desc {
    opacity: 0.9;
}

.sort-indicator-asc {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23495057' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m18 15-6-6-6 6'/%3E%3C/svg%3E");
}

.sort-indicator-desc {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23495057' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.entity-grid-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 9rem;
    color: var(--rs-text-muted);
}

.entity-grid-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.entity-grid-summary {
    color: var(--rs-text-muted);
    font-size: 0.9rem;
}

.entity-grid-pagination {
    display: flex;
    gap: 0.5rem;
}

.status-pill {
    display: inline-block;
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-pill-muted {
    color: var(--rs-table-text);
    background-color: var(--rs-status-muted-bg);
}

.visibility-label {
    display: inline-block;
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.visibility-label-assigned {
    color: #0b4f8f;
    background-color: rgba(13, 110, 253, 0.18);
}

.visibility-label-device {
    color: #0f6848;
    background-color: rgba(25, 135, 84, 0.18);
}

.visibility-label-muted {
    color: var(--rs-table-text);
    background-color: var(--rs-status-muted-bg);
}

@media (max-width: 1279.98px) {
    .search-results-overlay {
        max-height: 300px;
    }

    .results-table th,
    .results-table td {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    .entity-grid-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .entity-grid-table-wrap {
        scrollbar-gutter: stable;
    }

    .entity-grid-table {
        min-width: max(100%, 64rem);
        table-layout: auto;
    }

    .entity-grid-table th,
    .entity-grid-table td {
        padding: 0.625rem 0.75rem;
        font-size: 0.85rem;
        line-height: 1.35;
    }

    .entity-grid-table tbody tr {
        height: 44px;
    }

    .entity-grid-table th {
        white-space: nowrap;
    }

    .entity-grid-table td {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .entity-grid-table th:first-child,
    .entity-grid-table td:first-child {
        position: sticky;
        left: 0;
        z-index: 2;
        white-space: nowrap;
        background-color: var(--rs-surface);
        box-shadow: 1px 0 0 var(--rs-border);
    }

    .entity-grid-table th:first-child {
        z-index: 3;
        background-color: var(--rs-surface-subtle);
    }

    .entity-grid-table tbody tr:hover td:first-child {
        background-color: var(--rs-hover-bg);
    }

    .entity-grid-table tbody tr.entity-grid-row-readonly:hover td:first-child {
        background-color: var(--rs-surface);
    }

    .entity-grid-sort,
    .entity-grid-status-header,
    .entity-grid-status-header > span,
    .status-pill,
    .visibility-label {
        white-space: nowrap;
    }

    .entity-grid-pagination .btn {
        min-height: 44px;
        padding: 0.5rem 0.85rem;
    }
}

/* Technician Views Shared Styles */
.tech-page-header {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--rs-heading);
    margin-bottom: 1.5rem;
    text-align: center;
}

.tech-loading-message,
.tech-empty-message {
    padding: 2rem;
    text-align: center;
    color: var(--rs-text-muted);
    font-size: 1.1rem;
}

.tech-count {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: var(--rs-info-bg);
    border-left: 4px solid #2AB573;
    font-size: 1.1rem;
    color: var(--rs-heading);
}

.tech-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Technician Report Row Styling */
.tech-report-row {
    cursor: pointer;
    background-color: var(--rs-surface-subtle);
}

.tech-report-row-green {
    background-color: #E8F5E9;
    border-left: 4px solid #2AB573;
}

.tech-report-row-blue {
    background-color: #E3F2FD;
    border-left: 4px solid #1E90FF;
}

.tech-report-row-purple {
    background-color: #F3EBFE;
    border-left: 4px solid #9370DB;
}

.tech-report-row-lime {
    background-color: #E7F5DC;
    border-left: 4px solid #8DC540;
}

/* Technician Report Text Styling */
.report-id-green {
    color: #2AB573;
    font-weight: bold;
}

.report-id-blue {
    color: #1E90FF;
    font-weight: bold;
}

.report-id-purple {
    color: #9370DB;
    font-weight: bold;
}

.report-id-lime {
    color: #8DC540;
    font-weight: bold;
}

.report-id-amber {
    color: #f39c12;
    font-weight: bold;
}

.report-id-red {
    color: #e74c3c;
    font-weight: bold;
}

.device-id-text {
    color: var(--rs-text);
    font-weight: 600;
}

.client-name {
    color: var(--rs-text);
}

.address-text {
    color: var(--rs-text-muted);
}

.status-text {
    font-weight: 600;
    font-size: 0.9rem;
}

[data-bs-theme="dark"] .btn-outline-secondary {
    color: #d1d5db;
    border-color: #6b7280;
}

[data-bs-theme="dark"] .btn-outline-secondary:hover,
[data-bs-theme="dark"] .btn-outline-secondary:focus {
    color: #ffffff;
    background-color: #4b5563;
    border-color: #6b7280;
}

[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] .card-header.bg-light {
    background-color: var(--rs-surface-subtle) !important;
    color: var(--rs-heading) !important;
}

[data-bs-theme="dark"] .table {
    --bs-table-bg: var(--rs-surface);
    --bs-table-color: var(--rs-table-text);
    --bs-table-border-color: var(--rs-border);
    --bs-table-hover-bg: var(--rs-hover-bg);
    --bs-table-hover-color: var(--rs-body-color);
}

[data-bs-theme="dark"] .order-items-table .order-items-header {
    background-color: var(--rs-surface-subtle);
    color: var(--rs-table-text);
}

[data-bs-theme="dark"] .order-items-table .order-item-row {
    background-color: var(--rs-surface);
    border-color: var(--rs-border);
    color: var(--rs-body-color);
}

[data-bs-theme="dark"] .order-items-table .order-item-row:hover {
    background-color: var(--rs-hover-bg);
}

[data-bs-theme="dark"] table,
[data-bs-theme="dark"] thead,
[data-bs-theme="dark"] tbody,
[data-bs-theme="dark"] tr,
[data-bs-theme="dark"] th,
[data-bs-theme="dark"] td {
    border-color: var(--rs-border);
}

[data-bs-theme="dark"] input,
[data-bs-theme="dark"] select,
[data-bs-theme="dark"] textarea {
    color-scheme: dark;
}

[data-bs-theme="dark"] .login-box {
    background-color: var(--rs-surface) !important;
    border-color: var(--rs-border) !important;
    box-shadow: 0 2px 10px var(--rs-shadow) !important;
}

[data-bs-theme="dark"] .login-box h2 {
    color: var(--rs-heading) !important;
}

[data-bs-theme="dark"] .search-results-overlay,
[data-bs-theme="dark"] .autocomplete-results,
[data-bs-theme="dark"] .dropdown-results,
[data-bs-theme="dark"] .select-panel,
[data-bs-theme="dark"] .entity-grid-status-menu,
[data-bs-theme="dark"] .modal-dialog {
    background-color: var(--rs-menu-bg);
    border-color: var(--rs-border);
    color: var(--rs-body-color);
    box-shadow: 0 0.5rem 1rem var(--rs-shadow);
}

[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer {
    border-color: var(--rs-border);
}

[data-bs-theme="dark"] .autocomplete-item,
[data-bs-theme="dark"] .dropdown-item,
[data-bs-theme="dark"] .option-item {
    border-color: var(--rs-border);
    color: var(--rs-body-color);
}

[data-bs-theme="dark"] .autocomplete-item:hover:not(.loading):not(.no-results),
[data-bs-theme="dark"] .dropdown-item:hover:not(.loading):not(.no-results),
[data-bs-theme="dark"] .option-item:not(.no-results):hover,
[data-bs-theme="dark"] .option-item.highlighted {
    background-color: var(--rs-hover-bg);
}

[data-bs-theme="dark"] .tech-report-row-green {
    background-color: rgba(42, 181, 115, 0.16);
}

[data-bs-theme="dark"] .tech-report-row-blue {
    background-color: rgba(30, 144, 255, 0.16);
}

[data-bs-theme="dark"] .tech-report-row-purple {
    background-color: rgba(147, 112, 219, 0.18);
}

[data-bs-theme="dark"] .tech-report-row-lime {
    background-color: rgba(141, 197, 64, 0.16);
}

@media (max-width: 1280px) {
    .tech-page-header {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
}
