::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 5px 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;
}

/* Center the modal container */
.blazored-modal-container {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 1rem;
}

/* Modal styling with fixed width */
.blazored-modal {
    position: relative !important;
    width: 600px !important;
    max-width: 90vw !important;
    max-height: 90vh;
    overflow: auto;
    background-color: white !important;
    border-radius: 0.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Dark mode for modal */
.dark .blazored-modal {
    background-color: rgb(31, 41, 55) !important; /* gray-800 */
    border: 1px solid rgb(55, 65, 81) !important; /* gray-700 */
    color: rgb(243, 244, 246) !important; /* gray-100 */
}

.dark .blazored-modal > div,
.dark .blazored-modal-content {
    background-color: rgb(31, 41, 55) !important; /* gray-800 */
    color: rgb(243, 244, 246) !important; /* gray-100 */
}

/* Modal overlay */
.blazored-modal-overlay {
    background-color: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(4px);
}

.dark .blazored-modal-overlay {
    background-color: rgba(0, 0, 0, 0.7) !important;
}

/* Ensure all child divs inherit dark background */
.dark .blazored-modal div {
    color: inherit;
}

.dark .blazored-modal .space-y-4,
.dark .blazored-modal > div > div {
    background-color: rgb(31, 41, 55) !important; /* gray-800 */
}

/* Form elements inside modals - dark mode */
.dark .blazored-modal input[type="text"],
.dark .blazored-modal input[type="email"],
.dark .blazored-modal select,
.dark .blazored-modal textarea {
    background-color: rgb(55, 65, 81) !important; /* gray-700 */
    border-color: rgb(75, 85, 99) !important; /* gray-600 */
    color: rgb(243, 244, 246) !important; /* gray-100 */
}

.dark .blazored-modal input[disabled] {
    background-color: rgb(17, 24, 39) !important; /* gray-900 */
    color: rgb(156, 163, 175) !important; /* gray-400 */
}

/* Labels in dark mode */
.dark .blazored-modal label {
    color: rgb(209, 213, 219) !important; /* gray-300 */
}

/* Text colors in dark mode */
.dark .blazored-modal .text-gray-700 {
    color: rgb(209, 213, 219) !important; /* gray-300 */
}

.dark .blazored-modal .text-gray-500 {
    color: rgb(156, 163, 175) !important; /* gray-400 */
}

.dark .blazored-modal .text-gray-900 {
    color: rgb(243, 244, 246) !important; /* gray-100 */
}

/* Borders in dark mode - only for actual border elements */
.dark .blazored-modal .border-gray-300 {
    border-color: rgb(75, 85, 99) !important; /* gray-600 */
}

.dark .blazored-modal .border-gray-200 {
    border-color: rgb(55, 65, 81) !important; /* gray-700 */
}

/* Background colors in dark mode */
.dark .blazored-modal .bg-white {
    background-color: rgb(31, 41, 55) !important; /* gray-800 */
}

.dark .blazored-modal .bg-gray-50 {
    background-color: rgb(55, 65, 81) !important; /* gray-700 */
}

.dark .blazored-modal .bg-gray-100 {
    background-color: rgb(17, 24, 39) !important; /* gray-900 */
}

/* Buttons in dark mode */
.dark .blazored-modal button {
    color: rgb(243, 244, 246) !important; /* gray-100 */
}

.dark .blazored-modal button.bg-gray-900 {
    background-color: rgb(55, 65, 81) !important; /* gray-700 */
}

.dark .blazored-modal button.bg-white {
    background-color: rgb(55, 65, 81) !important; /* gray-700 */
    color: rgb(243, 244, 246) !important; /* gray-100 */
}

/* Hover states in dark mode */
.dark .blazored-modal button:hover {
    opacity: 0.9;
}

.dark .blazored-modal .hover\:bg-gray-50:hover {
    background-color: rgb(55, 65, 81) !important; /* gray-700 */
}

.dark .blazored-modal .hover\:bg-gray-800:hover {
    background-color: rgb(55, 65, 81) !important; /* gray-600 */
}

/* Placeholder text in dark mode */
.dark .blazored-modal input::placeholder,
.dark .blazored-modal select option {
    color: rgb(156, 163, 175) !important; /* gray-400 */
}

/* Remove all focus outlines from headings and non-interactive elements */
h1, h2, h3, h4, h5, h6, p, div, span {
    outline: none !important;
}

/* Remove focus outline on mouse click for all elements */
*:focus:not(:focus-visible) {
    outline: none;
}

/* Only show focus outline when using keyboard (Tab key) for interactive elements */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
    outline: 2px solid rgb(239, 68, 68); /* red-500 */
    outline-offset: 2px;
    border-radius: 0.25rem;
}

/* mobile layout */
@media (max-width: 640px) {
    /* Page container padding */
    .p-6 {
        padding: 1rem !important;
    }

    /* Smaller buttons */
    button, .btn {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }

        /* Compact icon buttons */
        button svg {
            width: 1rem;
            height: 1rem;
        }

    /* Smaller badges */
    .inline-flex.items-center.rounded {
        font-size: 0.75rem;
        padding: 0.125rem 0.5rem;
    }

    /* Table cells - more compact */
    table th,
    table td {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.875rem;
    }

    /* Table header text */
    table th {
        font-size: 0.625rem !important;
    }

    /* Ensure minimum column widths */
    table th,
    table td {
        min-width: 100px;
    }

        /* Actions column can be narrower */
        table td:last-child {
            min-width: 80px;
        }

    /* Compact gaps in action buttons */
    .flex.items-center.gap-2 {
        gap: 0.25rem;
    }

    /* Search bar */
    input[type="search"],
    input[type="text"] {
        font-size: 0.875rem;
    }
}

/** form select styling */
select option {
    padding: 8px 12px;
    background-color: white;
    color: #111827;
}

select option:hover,
select option:checked {
    background-color: #f3f4f6 !important;
    color: #111827;
}

.dark select option {
    background-color: #1f2937;
    color: #f9fafb;
}

.dark select option:hover,
.dark select option:checked {
    background-color: #374151 !important;
    color: #f9fafb;
}

/* Success Toast - Light & Dark Mode */
.success-toast-override {
    background-color: white !important;
    color: #111827 !important;
    border-left: 4px solid #10b981 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

.dark .success-toast-override {
    background-color: #1f2937 !important;
    color: #f3f4f6 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2) !important;
}

.success-toast-override .blazored-toast-icon {
    color: #10b981 !important;
}

.success-toast-override .blazored-toast-close-button {
    color: #9ca3af !important;
}

    .success-toast-override .blazored-toast-close-button:hover {
        color: #4b5563 !important;
    }

.dark .success-toast-override .blazored-toast-close-button:hover {
    color: #d1d5db !important;
}

.success-toast-override .blazored-toast-progress {
    background-color: #10b981 !important;
}

/* Error Toast - Light & Dark Mode */
.error-toast-override {
    background-color: white !important;
    color: #111827 !important;
    border-left: 4px solid #ef4444 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

.dark .error-toast-override {
    background-color: #1f2937 !important;
    color: #f3f4f6 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2) !important;
}

.error-toast-override .blazored-toast-icon {
    color: #ef4444 !important;
}

.error-toast-override .blazored-toast-close-button {
    color: #9ca3af !important;
}

    .error-toast-override .blazored-toast-close-button:hover {
        color: #4b5563 !important;
    }

.dark .error-toast-override .blazored-toast-close-button:hover {
    color: #d1d5db !important;
}

.error-toast-override .blazored-toast-progress {
    background-color: #ef4444 !important;
}

/* Warning Toast - Light & Dark Mode */
.warning-toast-override {
    background-color: white !important;
    color: #111827 !important;
    border-left: 4px solid #f59e0b !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

.dark .warning-toast-override {
    background-color: #1f2937 !important;
    color: #f3f4f6 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2) !important;
}

.warning-toast-override .blazored-toast-icon {
    color: #f59e0b !important;
}

.warning-toast-override .blazored-toast-close-button {
    color: #9ca3af !important;
}

    .warning-toast-override .blazored-toast-close-button:hover {
        color: #4b5563 !important;
    }

.dark .warning-toast-override .blazored-toast-close-button:hover {
    color: #d1d5db !important;
}

.warning-toast-override .blazored-toast-progress {
    background-color: #f59e0b !important;
}

/* Info Toast - Light & Dark Mode */
.info-toast-override {
    background-color: white !important;
    color: #111827 !important;
    border-left: 4px solid #3b82f6 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

.dark .info-toast-override {
    background-color: #1f2937 !important;
    color: #f3f4f6 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2) !important;
}

.info-toast-override .blazored-toast-icon {
    color: #3b82f6 !important;
}

.info-toast-override .blazored-toast-close-button {
    color: #9ca3af !important;
}

    .info-toast-override .blazored-toast-close-button:hover {
        color: #4b5563 !important;
    }

.dark .info-toast-override .blazored-toast-close-button:hover {
    color: #d1d5db !important;
}

.info-toast-override .blazored-toast-progress {
    background-color: #3b82f6 !important;
}