@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

/* Global rule to prevent gradients - enforce solid colors */
html, body, .page, main {
    background-image: none !important;
}

html, body {
    font-family: 'Inter', 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--theme-background-page) !important;
    background-image: none !important;
    color: var(--theme-text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: var(--theme-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover, .btn-link:hover {
    color: var(--theme-secondary-hover);
    text-decoration: underline;
}

.btn-primary {
    color: var(--theme-primary-text);
    background: var(--theme-primary);
    border: 1px solid var(--theme-primary-hover);
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px var(--theme-shadow-soft);
}

.btn-primary:hover {
    background: var(--theme-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--theme-shadow-medium);
    border-color: var(--theme-primary-hover);
}

.btn-primary:disabled,
.btn-primary.disabled {
    color: var(--theme-primary-text);
    background: var(--theme-primary);
    border-color: var(--theme-primary-hover);
    opacity: 0.65;
}

.btn-outline-primary {
    color: var(--theme-primary);
    background: transparent;
    border: 1px solid var(--theme-primary);
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px var(--theme-shadow-soft);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus-visible {
    color: var(--theme-primary-text);
    background: var(--theme-primary);
    border-color: var(--theme-primary);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--theme-shadow-medium);
}

.btn-outline-primary:disabled,
.btn-outline-primary.disabled {
    color: var(--theme-primary);
    background: transparent;
    border-color: var(--theme-primary);
    opacity: 0.65;
    box-shadow: none;
}

.btn-check:checked + .btn-outline-primary,
.btn-check:active + .btn-outline-primary,
.btn-outline-primary.active,
.btn-outline-primary.dropdown-toggle.show {
    color: var(--theme-primary-text);
    background: var(--theme-primary);
    border-color: var(--theme-primary);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--theme-shadow-medium);
}

.btn-outline-danger {
    color: var(--theme-danger);
    background: transparent;
    border: 1px solid var(--theme-danger);
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px var(--theme-shadow-soft);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus-visible {
    color: var(--theme-danger-text);
    background: var(--theme-danger);
    border-color: var(--theme-danger);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--theme-shadow-medium);
}

.btn-outline-danger:disabled,
.btn-outline-danger.disabled {
    color: var(--theme-danger);
    background: transparent;
    border-color: var(--theme-danger);
    opacity: 0.65;
    box-shadow: none;
}

.btn-success {
    color: var(--theme-success-text);
    background: var(--theme-success);
    border: 1px solid var(--theme-success);
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px var(--theme-shadow-soft);
}

.btn-success:hover,
.btn-success:focus-visible {
    background: var(--theme-success);
    filter: brightness(0.92);
    border-color: var(--theme-success);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--theme-shadow-medium);
}

.btn-danger {
    color: var(--theme-danger-text);
    background: var(--theme-danger);
    border: 1px solid var(--theme-danger);
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px var(--theme-shadow-soft);
}

.btn-danger:hover,
.btn-danger:focus-visible {
    background: var(--theme-danger);
    filter: brightness(0.92);
    border-color: var(--theme-danger);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--theme-shadow-medium);
}

.btn-info {
    color: var(--theme-info-text);
    background: var(--theme-info);
    border: 1px solid var(--theme-info);
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px var(--theme-shadow-soft);
}

.btn-info:hover,
.btn-info:focus-visible {
    background: var(--theme-info);
    filter: brightness(0.92);
    border-color: var(--theme-info);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--theme-shadow-medium);
}

.transformation-toggle .btn {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    background: var(--theme-primary-light);
    color: var(--theme-primary);
    border-color: var(--theme-primary);
}

.transformation-toggle .btn:hover,
.transformation-toggle .btn:focus-visible {
    background: var(--theme-primary);
    color: var(--theme-primary-text);
}

.transformation-toggle .btn-check:checked + .btn {
    background: var(--theme-primary);
    color: var(--theme-primary-text);
    border-color: var(--theme-primary);
    box-shadow: 0 6px 16px var(--theme-shadow-medium);
}

.salary-management-page .accordion {
    border: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.salary-management-page .accordion-item {
    background: transparent;
    border: none;
}

.salary-management-page .accordion-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--theme-background-card);
    color: var(--theme-secondary);
    border-radius: 14px;
    border: 1px solid var(--theme-border-subtle);
    box-shadow: 0 4px 14px var(--theme-shadow-soft);
    padding: 1rem 1.25rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: all 0.25s ease;
}

.salary-management-page .accordion-button.collapsed {
    background: var(--theme-background-card);
    color: var(--theme-secondary);
}

.salary-management-page .accordion-button:hover,
.salary-management-page .accordion-button:focus-visible {
    background: var(--theme-primary-light);
    color: var(--theme-primary);
    border-color: var(--theme-primary);
    box-shadow: 0 10px 24px var(--theme-shadow-medium);
}

.salary-management-page .accordion-button:not(.collapsed) {
    background: var(--theme-secondary);
    color: var(--theme-secondary-text);
    border-color: var(--theme-secondary);
    box-shadow: 0 12px 28px var(--theme-shadow-medium);
}

.salary-management-page .accordion-button::after {
    transition: filter 0.25s ease;
}

.salary-management-page .accordion-button.collapsed::after {
    filter: brightness(0) saturate(100%) invert(35%) sepia(71%) saturate(525%) hue-rotate(175deg) brightness(90%) contrast(93%);
}

.salary-management-page .accordion-button:not(.collapsed)::after {
    filter: invert(1);
}

.salary-management-page .accordion-body {
    background: var(--theme-background-card);
    border: 1px solid var(--theme-border-default);
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 0.75rem;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.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(--theme-background-card), 0 0 0 0.25rem var(--theme-primary-light);
}

.content {
    padding-top: 1.1rem;
    background-color: var(--theme-background-section);
    min-height: calc(100vh - 76px);
    transition: background-color 0.3s ease;
}

.valid.modified:not([type=checkbox]) {
    outline: 2px solid var(--theme-success);
    border-color: var(--theme-success);
}

.invalid {
    outline: 2px solid var(--theme-danger);
    border-color: var(--theme-danger);
}

.validation-message {
    color: var(--theme-danger);
    font-weight: 500;
    font-size: 0.875rem;
}

#blazor-error-ui {
    background: var(--theme-background-card);
    bottom: 0;
    box-shadow: 0 -4px 12px var(--theme-shadow-medium);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    border-top: 2px solid var(--theme-secondary-light);
    transition: all 0.3s ease;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
        color: var(--theme-text-primary);
        font-weight: 600;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, var(--theme-secondary);
    padding: 1rem 1rem 1rem 3.7rem;
    color: var(--theme-secondary-text);
    border-radius: 8px;
    margin: 1rem;
    box-shadow: 0 4px 12px var(--theme-shadow-medium);
    transition: all 0.3s ease;
}

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

/* Navbar Logo Styling */
.navbar-logo {
    height: 50px;
    width: auto;
    max-width: 250px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    transition: all 0.3s ease;
}

.navbar-brand {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    margin: 0;
}

.navbar-brand:hover .navbar-logo {
    opacity: 0.9;
    transition: opacity 0.2s ease;
    transform: scale(1.02);
}

/* Theme-aware Navbar Colors */
.navbar.bg-primary {
    background: var(--theme-primary) !important;
    box-shadow: 0 2px 8px var(--theme-shadow-soft);
    border-bottom: 2px solid var(--theme-primary-hover);
    transition: all 0.3s ease;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    transition: all 0.2s ease;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
    color: rgba(255, 255, 255, 1);
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.navbar-dark .navbar-nav .dropdown-menu {
    background: var(--theme-background-card);
    border: 1px solid var(--theme-border-default);
    box-shadow: 0 8px 32px var(--theme-shadow-medium);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.navbar-dark .navbar-nav .dropdown-item {
    color: var(--theme-text-primary);
    font-weight: 500;
    transition: all 0.2s ease;
}

.navbar-dark .navbar-nav .dropdown-item:hover {
    background-color: var(--theme-secondary-light);
    color: var(--theme-secondary-text);
    transform: translateX(3px);
}

.navbar-dark .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.4);
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-dark .navbar-toggler:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background-color: rgba(255, 255, 255, 0.2);
}

.navbar-dark .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Bootstrap Background Overrides for Theme System */
/* Page Title Consistency */
.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--theme-text-primary);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 1rem;
    color: var(--theme-text-muted);
    margin-bottom: 1.5rem;
}

/* Consistent card styling */
.card {
    border: 1px solid var(--theme-border-subtle);
    border-radius: 12px;
    box-shadow: 0 2px 10px var(--theme-shadow-soft);
    background-color: var(--theme-background-card);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.card:hover {
    background-color: var(--theme-background-card-hover);
    box-shadow: 0 14px 28px var(--theme-shadow-medium);
    transform: translateY(-2px);
}

.card-body {
    padding: 1.5rem;
}

/* Table consistency */
/* Override Bootstrap's table-striped CSS variables to prevent Bootstrap colors */
.table-striped {
    --bs-table-striped-bg: transparent;
    --bs-table-striped-color: inherit;
    --bs-table-accent-bg: transparent;
}

/* Override Bootstrap's table-hover CSS variables to use theme colors */
.table,
.table-hover {
    --bs-table-hover-bg: var(--theme-background-card-hover);
    --bs-table-hover-color: var(--theme-text-primary);
}

.table th {
    background: var(--theme-primary);
    color: var(--theme-primary-text);
    font-weight: 600;
    border-bottom: 2px solid var(--theme-border-strong);
    padding: 1rem 0.75rem;
}

.table tbody tr {
    background-color: var(--theme-background-card);
}

.table td {
    padding: 0.75rem;
    border-color: var(--theme-border-default);
    vertical-align: middle;
    background-color: inherit;
}

.table-striped > tbody > tr:nth-of-type(odd) {
    --bs-table-accent-bg: var(--theme-background-card-alt);
    background-color: var(--theme-background-card-alt) !important;
    color: inherit;
}

.table tbody tr[data-status="low"],
.table tbody tr.low-stock {
    background-color: var(--theme-warning-light) !important;
    color: var(--theme-warning) !important;
}

.table tbody tr[data-status="critical"],
.table tbody tr.out-of-stock {
    background-color: var(--theme-danger-light) !important;
    color: var(--theme-danger) !important;
}

.table-striped > tbody > tr[data-status="low"]:nth-of-type(odd),
.table-striped > tbody > tr[data-status="critical"]:nth-of-type(odd),
.table-striped > tbody > tr.low-stock:nth-of-type(odd),
.table-striped > tbody > tr.out-of-stock:nth-of-type(odd) {
    background-color: inherit !important;
}

.table tbody tr:hover,
.table-hover tbody tr:hover,
.table tbody > tr:hover,
.table-hover tbody > tr:hover {
    --bs-table-hover-bg: var(--theme-background-card-hover) !important;
    --bs-table-hover-color: var(--theme-text-primary) !important;
    background-color: var(--theme-background-card-hover) !important;
    color: var(--theme-text-primary) !important;
}

/* Ensure hover overrides striped background - higher specificity */
.table-striped > tbody > tr:nth-of-type(odd):hover,
.table-striped > tbody > tr:nth-of-type(even):hover,
.table-striped.table-hover > tbody > tr:nth-of-type(odd):hover,
.table-striped.table-hover > tbody > tr:nth-of-type(even):hover {
    --bs-table-hover-bg: var(--theme-background-card-hover) !important;
    --bs-table-hover-color: var(--theme-text-primary) !important;
    --bs-table-accent-bg: var(--theme-background-card-hover) !important;
    background-color: var(--theme-background-card-hover) !important;
    color: var(--theme-text-primary) !important;
}

.table th .fa-sort {
    opacity: 0.7;
    transition: opacity 0.2s ease;
    color: rgba(255, 255, 255, 0.8);
}

.table th:hover .fa-sort {
    opacity: 1;
    color: var(--theme-surface-elevated);
}

.table th .fa-sort-up,
.table th .fa-sort-down {
    opacity: 1;
    color: var(--theme-background-card);
}

/* ===== COMPREHENSIVE COMPONENT STYLES ===== */

/* Avatar Circle */
.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--theme-secondary);
    color: var(--theme-background-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 2px 8px var(--theme-shadow-soft);
    border: 2px solid var(--theme-background-card);
}

/* Button Group Spacing */
.btn-group .btn {
    margin-right: 2px;
}

.btn-group .btn:last-child {
    margin-right: 0;
}

/* Modal Styling */
.modal.show {
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-dialog {
    max-width: 600px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px var(--theme-shadow-medium);
}

/* Table Cell Styling */
.table td {
    vertical-align: middle;
    background-color: var(--theme-background-card);
}

/* Badge Improvements */
.badge {
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
}

/* Alert Styling */
.alert {
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 8px var(--theme-shadow-soft);
}

/* Alerts */
.alert {
    border-radius: 0.95rem;
    border: 1px solid var(--theme-border-subtle);
    padding: 0.95rem 1.1rem;
    background: var(--theme-background-card);
    box-shadow: 0 16px 32px var(--theme-shadow-soft);
    color: var(--theme-text-primary);
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.alert strong {
    font-weight: 700;
}

.alert .btn-close {
    filter: none;
    color: inherit;
    opacity: 0.6;
}

.alert .btn-close:hover {
    opacity: 1;
}

.alert-success {
    background: var(--theme-success-light) !important;
    border-color: var(--theme-success) !important;
    color: var(--theme-success) !important;
    border-left: 6px solid var(--theme-success) !important;
}

.alert-warning {
    background: var(--theme-warning-light) !important;
    border-color: var(--theme-warning) !important;
    color: var(--theme-warning) !important;
    border-left: 6px solid var(--theme-warning) !important;
}

.alert-danger {
    background: var(--theme-danger-light) !important;
    border-color: var(--theme-danger) !important;
    color: var(--theme-danger) !important;
    border-left: 6px solid var(--theme-danger) !important;
}

.alert-info {
    background: var(--theme-info-light) !important;
    border-color: var(--theme-info) !important;
    color: var(--theme-info) !important;
    border-left: 6px solid var(--theme-info) !important;
}

.alert-primary {
    background: var(--theme-primary-light) !important;
    border-color: var(--theme-primary) !important;
    color: var(--theme-primary) !important;
    border-left: 6px solid var(--theme-primary) !important;
}

.alert-secondary {
    background: var(--theme-secondary-light) !important;
    border-color: var(--theme-secondary) !important;
    color: var(--theme-secondary) !important;
    border-left: 6px solid var(--theme-secondary) !important;
}

/* Form Control Focus Effects */
.form-control:focus,
.form-select:focus {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 0.2rem var(--theme-shadow-soft);
    background-color: var(--theme-background-card);
}

/* Button Hover Effects */
.btn:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease;
    box-shadow: 0 4px 12px var(--theme-shadow-medium);
}

/* Loading Spinner */
.spinner-border {
    color: var(--theme-primary);
}

/* Text Styling */
.text-primary {
    color: var(--theme-secondary) !important;
    font-weight: 600;
}

.text-info {
    color: var(--theme-primary) !important;
    font-weight: 600;
}

.text-muted {
    color: var(--theme-text-muted) !important;
}

.text-muted i {
    opacity: 0.6;
    color: var(--theme-text-muted);
}

/* Card Styling */
.card {
    border: none;
    box-shadow: 0 4px 16px var(--theme-shadow-soft);
    border-radius: 16px;
    background-color: var(--theme-background-card);
    border: 1px solid var(--theme-border-subtle);
}

.card-header {
    background: var(--theme-primary);
    border-bottom: 2px solid var(--theme-primary-hover);
    border-radius: 16px 16px 0 0 !important;
    color: var(--theme-background-card);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6 {
    color: inherit !important;
}

/* Table Responsive */
.table-responsive {
    border-radius: 0 0 16px 16px;
    background-color: var(--theme-background-card);
    border: 1px solid var(--theme-border-default);
    overflow-x: auto;
    width: 100%;
}

/* Form Label */
.form-label {
    color: var(--theme-text-primary);
    font-weight: 600;
}

/* File Upload Styling */
.form-control[type="file"] {
    border: 2px dashed var(--theme-border-default);
    background: var(--theme-background-page);
}

.form-control[type="file"]:focus {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 0.2rem var(--theme-shadow-soft);
}

/* Progress Bar */
.progress {
    background-color: var(--theme-border-default);
}

.progress-bar {
    background: var(--theme-primary);
}

/* Sticky Elements */
.sticky-top {
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Text Truncate */
.text-truncate {
    max-width: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .btn-group {
        display: flex;
        flex-direction: column;
    }
    
    .btn-group .btn {
        margin-bottom: 2px;
        margin-right: 0;
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .avatar-circle {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

/* ===== STANDARDIZED PANEL SYSTEM ===== */

/* Standard Panel - Main content panels */
.panel {
    background-color: var(--theme-background-card);
    border: 1px solid var(--theme-border-subtle);
    border-radius: 16px;
    box-shadow: 0 4px 16px var(--theme-shadow-soft);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.panel-header {
    background: var(--theme-primary);
    color: var(--theme-primary-text);
    padding: 1rem 1.5rem;
    border-bottom: 2px solid var(--theme-primary-hover);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.panel-header h1,
.panel-header h2,
.panel-header h3,
.panel-header h4,
.panel-header h5,
.panel-header h6 {
    margin: 0;
    color: var(--theme-primary-text);
}

.panel-header p,
.panel-header .subtitle {
    margin-top: 0.5rem;
    opacity: 0.9;
    font-size: 0.9rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9) !important;
}

.panel-body {
    padding: 1.5rem;
    background-color: var(--theme-background-card);
}

/* Panel with actions in header */
.panel-header-with-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.panel-header-with-actions .panel-title {
    flex: 1;
    min-width: 200px;
}

.panel-header-with-actions .panel-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Secondary Panel - For sub-sections */
.panel-secondary {
    background-color: var(--theme-background-card);
    border: 1px solid var(--theme-border-default);
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--theme-shadow-soft);
    margin-bottom: 1rem;
    overflow: hidden;
}

.panel-secondary .panel-header {
    background: var(--theme-secondary);
    border-bottom: 2px solid var(--theme-secondary-hover);
    padding: 1rem 1.25rem;
    color: var(--theme-secondary-text);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.panel-secondary .panel-header h1,
.panel-secondary .panel-header h2,
.panel-secondary .panel-header h3,
.panel-secondary .panel-header h4,
.panel-secondary .panel-header h5,
.panel-secondary .panel-header h6 {
    margin: 0;
    color: var(--theme-secondary-text);
}

.panel-secondary .panel-header p,
.panel-secondary .panel-header .subtitle {
    margin-top: 0.4rem;
    opacity: 0.9;
    font-size: 0.9rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.92) !important;
}

.panel-secondary .panel-body {
    padding: 1rem;
}

.reports-page .metric-tile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 16px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1), 0 6px 14px var(--theme-shadow-soft);
}

.metric-tile-icon {
    font-size: 2rem;
    line-height: 1;
    opacity: 0.9;
}

.metric-tile-label {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.85;
    margin-bottom: 0.25rem;
}

.metric-tile-value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.1;
}

.metric-tile-subtext {
    font-size: 0.75rem;
    opacity: 0.8;
}

.metric-tile-brand {
    background: var(--theme-secondary);
    color: var(--theme-background-card);
}

.metric-tile-success {
    background: var(--theme-success);
    color: var(--theme-success-text);
}

.metric-tile-info {
    background: var(--theme-info);
    color: var(--theme-info-text);
}

.metric-tile-warning {
    background: var(--theme-warning);
    color: var(--theme-warning-text);
}

/* Info Panel - For informational content */
.panel-info {
    background-color: var(--theme-background-card);
    border: 1px solid var(--theme-info);
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--theme-shadow-soft);
    margin-bottom: 1rem;
    overflow: hidden;
}

.panel-info .panel-header {
    background: var(--theme-info);
    color: var(--theme-info-text);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

.panel-info .panel-body {
    padding: 1rem;
}

/* Success Panel - For success states */
.panel-success {
    background-color: var(--theme-background-card);
    border: 1px solid var(--theme-success);
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--theme-shadow-soft);
    margin-bottom: 1rem;
    overflow: hidden;
}

.panel-success .panel-header {
    background: var(--theme-success);
    color: var(--theme-success-text);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

.panel-success .panel-body {
    padding: 1rem;
}

/* Warning Panel - For warning states */
.panel-warning {
    background-color: var(--theme-background-card);
    border: 1px solid var(--theme-warning);
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--theme-shadow-soft);
    margin-bottom: 1rem;
    overflow: hidden;
}

.panel-warning .panel-header {
    background: var(--theme-warning);
    color: var(--theme-warning-text);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

.panel-warning .panel-body {
    padding: 1rem;
}

/* Danger Panel - For error states */
.panel-danger {
    background-color: var(--theme-background-card);
    border: 1px solid var(--theme-danger);
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--theme-shadow-soft);
    margin-bottom: 1rem;
    overflow: hidden;
}

.panel-danger .panel-header {
    background: var(--theme-danger);
    color: var(--theme-danger-text);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

.panel-danger .panel-body {
    padding: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .panel-header-with-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .panel-header-with-actions .panel-title {
        min-width: auto;
        margin-bottom: 0.5rem;
    }
    
    .panel-header-with-actions .panel-actions {
        justify-content: stretch;
    }
    
    .panel-header-with-actions .panel-actions .btn {
        flex: 1;
        min-width: 0;
    }
}

/* Button and Badge Overrides - No Bootstrap references */
.btn-success {
    background: var(--theme-success) !important;
    border-color: var(--theme-success) !important;
    color: var(--theme-success-text) !important;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-success:hover {
    background: var(--theme-success) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px var(--theme-shadow-medium);
    border-color: var(--theme-success) !important;
}

.bg-primary {
    background-color: var(--theme-primary) !important;
    color: var(--theme-primary-text) !important;
}

.bg-success {
    background-color: var(--theme-success) !important;
    color: var(--theme-success-text) !important;
}

.bg-info {
    background-color: var(--theme-info) !important;
    color: var(--theme-info-text) !important;
}

.bg-warning {
    background-color: var(--theme-warning) !important;
    color: var(--theme-warning-text) !important;
}

.bg-danger {
    background-color: var(--theme-danger) !important;
    color: var(--theme-danger-text) !important;
}

.badge-primary {
    background-color: var(--theme-primary) !important;
    color: var(--theme-primary-text) !important;
}

.badge-success {
    background-color: var(--theme-success) !important;
    color: var(--theme-success-text) !important;
}

.badge-warning {
    background-color: var(--theme-warning) !important;
    color: var(--theme-warning-text) !important;
}

.badge-info {
    background-color: var(--theme-info) !important;
    color: var(--theme-info-text) !important;
}

.badge-danger {
    background-color: var(--theme-danger) !important;
    color: var(--theme-danger-text) !important;
}

.btn-info {
    background: var(--theme-info) !important;
    border-color: var(--theme-info) !important;
    color: var(--theme-info-text) !important;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-info:hover {
    background: var(--theme-info) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px var(--theme-shadow-medium);
    border-color: var(--theme-info) !important;
}

.btn-warning {
    background: var(--theme-warning) !important;
    border-color: var(--theme-warning) !important;
    color: var(--theme-warning-text) !important;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-warning:hover {
    background: var(--theme-warning) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px var(--theme-shadow-medium);
    border-color: var(--theme-warning) !important;
}

.btn-danger {
    background: var(--theme-danger) !important;
    border-color: var(--theme-danger) !important;
    color: var(--theme-danger-text) !important;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: var(--theme-danger) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px var(--theme-shadow-medium);
    border-color: var(--theme-danger) !important;
}

/* Shared table sorting styles */
.sortable-header {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    color: inherit;
    --sortable-header-active-color: var(--theme-primary);
    --sortable-header-muted-color: rgba(0, 0, 0, 0.45);
}

.sortable-header {
    position: relative;
    overflow: hidden;
}

.sortable-header:hover,
.sortable-header:focus-visible {
    color: inherit;
}

.sortable-header:hover::after,
.sortable-header:focus-visible::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.06);
    pointer-events: none;
}

.table-dark .sortable-header {
    color: var(--theme-text-inverse);
    --sortable-header-active-color: var(--theme-text-inverse);
    --sortable-header-muted-color: rgba(255, 255, 255, 0.65);
}

.table-dark .sortable-header:hover::after,
.table-dark .sortable-header:focus-visible::after {
    background-color: rgba(255, 255, 255, 0.14);
}

thead.table-dark {
    background-color: rgba(30, 41, 59, 0.92);
    color: var(--theme-text-inverse);
}

thead.table-dark tr {
    background-color: inherit;
}

thead.table-dark th {
    background-color: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    color: inherit;
}

.table-dark {
    background-color: var(--theme-primary) !important;
    color: var(--theme-text-inverse) !important;
}

.sortable-header .sort-icon.text-primary {
    color: var(--theme-primary) !important;
}

.table-dark .sortable-header .sort-icon.text-primary {
    color: var(--theme-text-inverse) !important;
}

.sortable-header .sort-icon.text-muted {
    color: var(--theme-text-muted) !important;
}

.sort-icon {
    font-size: 0.75rem;
    margin-left: 0.35rem;
}

/* Shared action button styling */
.action-btn {
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin: 0 4px;
    position: relative;
    font-weight: 600;
    gap: 0.4rem;
}

.action-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
}

.btn-outline-primary.action-btn {
    border-color: var(--theme-primary);
    color: var(--theme-primary);
}

.btn-outline-primary.action-btn:hover:not(:disabled) {
    background-color: var(--theme-primary);
    color: var(--theme-primary-text);
}

.btn-primary.action-btn {
    box-shadow: 0 4px 10px var(--theme-shadow-medium);
}

.btn-primary.action-btn:hover:not(:disabled) {
    box-shadow: 0 6px 14px var(--theme-shadow-strong);
}

.action-btn:disabled,
.action-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Pricing Page */
.pricing-page {
    background: var(--theme-background-page);
}

.bg-brand-primary {
    background: var(--theme-primary);
}

.text-brand-primary {
    color: var(--theme-primary);
}

.text-brand-primary-contrast {
    color: var(--theme-primary-text);
}

.bg-brand-secondary {
    background: var(--theme-secondary);
}

.text-brand-secondary {
    color: var(--theme-secondary);
}

.text-brand-secondary-contrast {
    color: var(--theme-secondary-text);
}

.bg-surface-card {
    background: var(--theme-background-card);
}

.pricing-hero {
    background: rgba(21, 94, 239, 0.92);
    border-radius: 32px;
    box-shadow: 0 45px 90px rgba(15, 23, 42, 0.18);
    position: relative;
    overflow: hidden;
}

.pricing-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.28);
    opacity: 0.7;
    pointer-events: none;
}

.pricing-hero .container-xl {
    position: relative;
    z-index: 1;
}

.pricing-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.16);
    color: var(--theme-primary-text);
    backdrop-filter: blur(8px);
}

.pricing-hero .pricing-hero-highlight {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    height: 100%;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(10px);
}

.pricing-hero-icon {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.pricing-billing-toggle {
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: var(--theme-background-card);
}

.pricing-loading .spinner-border {
    width: 3rem;
    height: 3rem;
}

.pricing-empty-state {
    border-radius: 24px;
    background: var(--theme-background-card);
    box-shadow: 0 18px 60px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.pricing-card {
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: var(--theme-background-card);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
    position: relative;
    overflow: hidden;
}

.pricing-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 32px 70px rgba(15, 23, 42, 0.18);
    border-color: rgba(59, 130, 246, 0.55);
}

.pricing-card.is-popular {
    border: 2px solid var(--theme-primary);
    box-shadow: 0 40px 80px rgba(37, 99, 235, 0.24);
}

.pricing-card.is-current-plan {
    border: 2px solid var(--theme-success);
    box-shadow: 0 40px 80px rgba(34, 197, 94, 0.24);
}

.pricing-card-badge {
    position: absolute;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.pricing-card-badge .badge {
    border-radius: 999px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
}

.pricing-amount h2 {
    color: var(--theme-secondary);
}

.pricing-banner {
    border-radius: 16px;
    padding: 0.75rem 1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.pricing-feature-list ul {
    display: grid;
    gap: 0.65rem;
}

.pricing-feature-list li {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--theme-text-primary);
    font-size: 0.95rem;
}

.pricing-feature-list li i {
    color: var(--theme-success);
}

.pricing-value-card {
    background: var(--theme-background-card);
    border-radius: 24px;
    padding: 2rem 1.75rem;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.18);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.pricing-value-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 70px rgba(15, 23, 42, 0.16);
}

.pricing-value-card .icon-wrap {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin-bottom: 1rem;
}

.pricing-faq .accordion {
    border-radius: 24px;
    background: var(--theme-background-card);
    overflow: hidden;
}

.pricing-faq .accordion-item {
    border: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.pricing-faq .accordion-item:last-child {
    border-bottom: none;
}

.pricing-faq .accordion-button {
    background: transparent;
    font-weight: 600;
    color: var(--theme-text-primary);
    padding: 1.25rem 1.5rem;
}

.pricing-faq .accordion-button:focus {
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.15);
}

.pricing-faq .accordion-button:not(.collapsed) {
    background: var(--theme-secondary);
    color: var(--theme-secondary-text);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.4);
}

.pricing-cta {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 28px;
    box-shadow: 0 32px 80px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.pricing-cta-button {
    animation: pricing-pulse 2.5s infinite;
    box-shadow: 0 18px 45px rgba(37, 99, 235, 0.28);
}

.pricing-cta-button:hover {
    animation-play-state: paused;
    transform: translateY(-2px);
    box-shadow: 0 24px 55px rgba(37, 99, 235, 0.35);
}

@keyframes pricing-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.35);
    }
    70% {
        box-shadow: 0 0 0 18px rgba(37, 99, 235, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

/* Hide theme token tooltip by default - only show on theme palette page */
#theme-token-tooltip {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    left: -9999px !important;
    top: -9999px !important;
}

/* Show tooltip only when on theme palette page and visible */
body:has(.theme-palette) #theme-token-tooltip.is-visible {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}