.app-card {
    background: var(--app-color-surface);
    border: 1px solid var(--app-color-border);
    border-radius: var(--app-radius-md);
    box-shadow: var(--app-shadow-sm);
}

.app-panel {
    background: var(--app-color-surface);
    border: 1px solid var(--app-color-border);
    border-radius: var(--app-radius-md);
    padding: var(--app-space-4);
}

.app-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--app-color-primary-strong);
}

.app-link-action {
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: underline;
    background: transparent;
    border: 0;
    padding: 0;
}

.app-link-action:focus-visible,
.app-btn-reset:focus-visible,
.app-click-row:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    box-shadow: var(--app-focus-ring);
}

.app-btn-reset {
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    color: inherit;
}

.app-click-row {
    width: 100%;
    text-align: left;
    border: 0;
    cursor: pointer;
    background: transparent;
}

.app-table-row:hover {
    background: var(--app-color-surface-alt);
}

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

.app-status-icon {
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

.app-icon-warning {
    color: #d69e2e;
    font-size: 1.15rem;
    vertical-align: middle;
}

.app-icon-neutral {
    color: #718096;
    font-size: 1.15rem;
    vertical-align: middle;
}

.theme-toggle-switch {
    border: 1px solid rgba(255, 255, 255, 0.55);
    color: #fff;
    background: transparent;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
    height: 32px;
    min-width: 92px;
    padding: 0.25rem 0.55rem 0.25rem 0.35rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.theme-toggle-switch:hover {
    background: rgba(255, 255, 255, 0.14);
}

.theme-toggle-switch:focus-visible {
    outline: none;
    box-shadow: var(--app-focus-ring);
}

.theme-toggle-switch-track {
    width: 36px;
    height: 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    position: relative;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

.theme-toggle-switch-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s ease;
}

.theme-toggle-switch-label {
    min-width: 34px;
    text-align: left;
}

.theme-toggle-switch[data-theme-state="dark"] .theme-toggle-switch-track {
    background: rgba(147, 197, 253, 0.75);
}

.theme-toggle-switch[data-theme-state="dark"] .theme-toggle-switch-thumb {
    transform: translateX(18px);
}

.app-toast-host {
    position: fixed;
    top: 84px;
    right: 16px;
    z-index: 12000;
    width: min(420px, calc(100vw - 24px));
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.app-toast {
    position: relative;
    padding: 12px 42px 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--app-color-border);
    background: var(--app-color-surface);
    color: var(--app-color-text);
    box-shadow: var(--app-shadow-md);
    pointer-events: auto;
}

.app-toast-title {
    margin: 0 0 3px;
    font-size: 0.9rem;
    font-weight: 700;
}

.app-toast-body {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.35;
}

.app-toast-link-wrap {
    margin-top: 8px;
}

.app-toast-link {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--app-color-link);
    text-decoration: underline;
}

.app-toast-link:hover {
    color: var(--app-color-link-hover);
}

.app-toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1.2rem;
    line-height: 1;
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

.app-toast-close:hover {
    background: rgba(0, 0, 0, 0.08);
}

.app-toast-info {
    border-left: 5px solid #0ea5e9;
}

.app-toast-success {
    border-left: 5px solid #16a34a;
}

.app-toast-warning {
    border-left: 5px solid #d97706;
}

.app-toast-error {
    border-left: 5px solid #dc2626;
}

html[data-theme="dark"] .app-toast-close:hover {
    background: rgba(255, 255, 255, 0.14);
}

/* UserSearch component fallback styles (non-isolated) */
.user-search-component .nav-tabs .nav-link {
    background-color: #50b9e4;
    color: #fff !important;
    border: 1px solid #dee2e6;
    margin-right: 2px;
    font-weight: 700;
}

.user-search-component .nav-tabs .nav-link:hover,
.user-search-component .nav-tabs .nav-link:focus {
    background-color: #3ca3cc;
    color: #fff !important;
}

.user-search-component .nav-tabs .nav-link.active {
    background-color: #fff !important;
    color: #000 !important;
    border-bottom: 2px solid #fff !important;
}

html[data-theme="dark"] .user-search-component .nav-tabs .nav-link {
    color: #e5e7eb !important;
    background-color: #1f2937 !important;
    border-color: #334155 !important;
    font-weight: 700;
}

html[data-theme="dark"] .user-search-component .nav-tabs .nav-link:hover,
html[data-theme="dark"] .user-search-component .nav-tabs .nav-link:focus {
    color: #f8fafc !important;
    background-color: #334155 !important;
}

html[data-theme="dark"] .user-search-component .nav-tabs .nav-link.active {
    color: #93c5fd !important;
    background-color: #0f172a !important;
    border-color: #334155 !important;
}

.user-search-component .counts-group {
    margin-top: 7px;
    margin-bottom: 3px;
    border: 1px solid gray;
    background-color: #000;
}

.user-search-component .user-list-scroll {
    height: 55vh;
    overflow-x: hidden;
    overflow-y: visible;
    border: 1px solid lightgray;
}

.user-search-component .user-display-selected,
.user-search-component .user-display {
    border-top: 1px solid lightgray;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
}

.user-search-component .user-display-selected {
    background-color: #fff;
}

.user-search-component .user-display {
    background-color: #0000ff6b;
    color: #fff;
}

.user-search-component .user-display-header {
    padding-left: 5px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-top: 5px;
    background-color: #0d1b48;
    color: #fff;
}

.user-search-component .text-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
}

.user-search-component .text-value {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
}

.user-search-component .form-control::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

.user-search-component .truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    margin-top: 0;
}

.user-search-component textarea.form-control {
    height: 120px;
}

.user-search-component .custom-tabs .nav-link {
    padding: 0.5rem 0.95rem;
}

.user-search-component .user-name-card {
    background-color: #fff;
    max-width: fit-content;
    border: 0;
    border-radius: 10px;
    box-shadow: none !important;
}

.user-search-component .user-name-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: #343a40;
}

.user-search-component .filter-bar {
    gap: 10px;
}

.user-search-component .user-search {
    max-width: 210px;
}

.user-search-component .filter-item {
    max-width: 120px;
}

.user-search-component .small-dropdown {
    min-width: 120px !important;
}

.user-search-component .medium-dropdown {
    min-width: 120px !important;
    max-width: 120px !important;
}

.user-search-component .filter-bar label {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.user-search-component .medium-dropdown,
.user-search-component .small-dropdown {
    display: inline-block;
}

.user-search-component .pager-btn {
    width: 100px;
    height: 1.3rem;
    margin-top: auto;
    margin-bottom: auto;
}

.user-search-component .pager-btn:disabled {
    pointer-events: none;
    opacity: 0.5;
}

.user-search-component .user-col-last,
.user-search-component .user-col-first,
.user-search-component .user-col-username,
.user-search-component .user-col-email,
.user-search-component .user-col-primary,
.user-search-component .user-col-secondary,
.user-search-component .user-col-date {
    display: inline-block;
    vertical-align: middle;
}

.user-search-component .user-col-last {
    width: 110px;
    padding-left: 5px;
}

.user-search-component .user-col-first {
    width: 90px;
}

.user-search-component .user-col-username {
    width: 110px;
}

.user-search-component .user-col-email {
    width: 175px;
}

.user-search-component .user-col-primary,
.user-search-component .user-col-secondary {
    width: 60px;
}

.user-search-component .user-col-date {
    width: 120px;
}

.user-search-component .user-list-spinner {
    z-index: 5;
    top: 14vh;
    background-color: rgba(0, 0, 0, 0.5);
}

.user-search-component .role-loading-spinner {
    top: -80%;
    left: 40%;
    transform: translate(-50%, -50%);
    z-index: 5;
    background-color: rgba(0, 0, 0, 0.5);
}

/* UserComplianceSearch component fallback styles (non-isolated) */
.user-compliance-search-component .nav-tabs .nav-link {
    background-color: #50b9e4;
    color: #fff;
    border: 1px solid #dee2e6;
    margin-right: 2px;
    font-weight: 700;
}

.user-compliance-search-component .nav-tabs .nav-link:hover {
    background-color: #3ca3cc;
    color: #fff;
}

.user-compliance-search-component .nav-tabs .nav-link.active {
    background-color: #fff !important;
    color: #000 !important;
    border-bottom: 2px solid #fff !important;
}

.user-compliance-search-component .counts-group {
    margin-top: 7px;
    margin-bottom: 3px;
    border: 1px solid gray;
    background-color: #000;
}

.user-compliance-search-component .user-list-scroll {
    height: 55vh;
    overflow-x: hidden;
    overflow-y: visible;
    border: 1px solid lightgray;
}

.user-compliance-search-component .user-display,
.user-compliance-search-component .user-display-selected {
    border-top: 1px solid lightgray;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
}

.user-compliance-search-component .user-display {
    background-color: #fff;
}

.user-compliance-search-component .user-display-selected {
    background-color: #0000ff6b;
    color: #fff;
}

.user-compliance-search-component .user-display-header {
    font-size: 0.7rem;
    font-weight: 700;
    margin-top: 5px;
    background-color: #0d1b48;
    color: #fff;
}

.user-compliance-search-component .text-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
}

.user-compliance-search-component .text-value {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
}

.user-compliance-search-component .form-control::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

.user-compliance-search-component .truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    margin-top: 0;
}

.user-compliance-search-component textarea.form-control {
    height: 120px;
}

.user-compliance-search-component .btn-filter {
    padding: 0 15px;
    font-size: 10px;
    width: 140px;
    border-radius: 5px;
}

.user-compliance-search-component .btn-compliant {
    background-color: #28a745 !important;
    color: #fff;
}

.user-compliance-search-component .btn-outline-compliant {
    background-color: #fff;
    color: #28a745;
    border: 1px solid #28a745;
}

.user-compliance-search-component .btn-warning-custom {
    background-color: #ffc107;
    color: #000;
}

.user-compliance-search-component .btn-outline-warning-custom {
    background-color: #fff;
    color: #ffc107;
    border: 1px solid #ffc107;
}

.user-compliance-search-component .btn-expired-custom {
    background-color: #dc3545;
    color: #fff;
}

.user-compliance-search-component .btn-outline-expired-custom {
    background-color: #fff;
    color: #dc3545;
    border: 1px solid #dc3545;
}

.user-compliance-search-component .btn-nodate-custom {
    background-color: #6c757d;
    color: #fff;
}

.user-compliance-search-component .btn-outline-nodate-custom {
    background-color: #fff;
    color: #6c757d;
    border: 1px solid #6c757d;
}

.user-compliance-search-component .badge {
    height: 25px;
    line-height: 25px;
    display: inline-block;
    text-align: center;
    padding: 0 10px;
}

.user-compliance-search-component .comp-container {
    position: relative;
}

.user-compliance-search-component .loading-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.user-compliance-search-component .spinner {
    margin-top: 65px;
}

.user-compliance-search-component .user-search-input {
    width: 100%;
}

.user-compliance-search-component .user-search-row.is-hidden {
    display: none;
}

.user-compliance-search-component .mt-26 {
    margin-top: 26px;
}

.user-compliance-search-component .pb-60 {
    padding-bottom: 60px;
}

.user-compliance-search-component .pager-btn {
    width: 100px;
}

.user-compliance-search-component .pager-btn:disabled {
    pointer-events: none;
    opacity: 0.5;
}

.user-compliance-search-component .compliance-col-last,
.user-compliance-search-component .compliance-col-first,
.user-compliance-search-component .compliance-col-username,
.user-compliance-search-component .compliance-col-email,
.user-compliance-search-component .compliance-col-primary,
.user-compliance-search-component .compliance-col-secondary,
.user-compliance-search-component .compliance-col-console,
.user-compliance-search-component .compliance-col-dev,
.user-compliance-search-component .compliance-col-expiration,
.user-compliance-search-component .compliance-col-status {
    display: inline-block;
    vertical-align: middle;
}

.user-compliance-search-component .compliance-col-last {
    width: 100px;
    padding-left: 5px;
}

.user-compliance-search-component .compliance-col-first {
    width: 100px;
}

.user-compliance-search-component .compliance-col-username {
    width: 120px;
}

.user-compliance-search-component .compliance-col-email {
    width: 175px;
}

.user-compliance-search-component .compliance-col-primary,
.user-compliance-search-component .compliance-col-secondary,
.user-compliance-search-component .compliance-col-console {
    width: 80px;
}

.user-compliance-search-component .compliance-col-dev {
    width: 140px;
}

.user-compliance-search-component .compliance-col-expiration {
    width: 113px;
}

.user-compliance-search-component .compliance-col-status {
    width: 50px;
    vertical-align: middle;
}

.user-search-component .sortable-header,
.user-compliance-search-component .sortable-header {
    cursor: pointer !important;
}

/* Auth landing cards */
.app-auth-landing .app-auth-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 10px;
    border: 1px solid var(--app-color-border);
    box-shadow: var(--app-shadow-sm);
}

.app-auth-landing .app-auth-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--app-shadow-md);
}

.app-auth-landing .app-auth-link,
.app-auth-landing .app-auth-title,
.app-auth-landing .app-auth-text {
    color: var(--app-color-text) !important;
}

.app-auth-landing .card-icon {
    font-size: 2.8em;
    color: var(--app-color-primary);
}

.app-auth-landing .card-body {
    padding: 2rem;
}

/* Dark mode visibility and contrast */
html[data-theme="dark"] .text-dark,
html[data-theme="dark"] .text-black-50,
html[data-theme="dark"] .text-black {
    color: var(--app-color-text) !important;
}

html[data-theme="dark"] .badge.text-dark,
html[data-theme="dark"] .bg-warning.text-dark {
    color: #111827 !important;
}

html[data-theme="dark"] .text-muted {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .list-group-item.bg-light {
    background-color: #1a2333 !important;
    color: var(--app-color-text) !important;
}

html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .modal-body {
    background-color: #0f172a !important;
    color: var(--app-color-text) !important;
    border-color: var(--app-color-border) !important;
}

html[data-theme="dark"] .modal-content .text-dark,
html[data-theme="dark"] .modal-content .text-muted {
    color: var(--app-color-text) !important;
}

html[data-theme="dark"] .modal-content .modal-title,
html[data-theme="dark"] .modal-content h1,
html[data-theme="dark"] .modal-content h2,
html[data-theme="dark"] .modal-content h3,
html[data-theme="dark"] .modal-content h4,
html[data-theme="dark"] .modal-content h5,
html[data-theme="dark"] .modal-content h6 {
    color: var(--app-color-text) !important;
}

html[data-theme="dark"] .btn-light {
    background-color: #1f2937 !important;
    border-color: #334155 !important;
    color: #e5e7eb !important;
}

html[data-theme="dark"] a.text-primary,
html[data-theme="dark"] .text-primary,
html[data-theme="dark"] a,
html[data-theme="dark"] .breadcrumb-item a {
    color: #93c5fd !important;
}

html[data-theme="dark"] a:hover,
html[data-theme="dark"] .breadcrumb-item a:hover {
    color: #bfdbfe !important;
}

html[data-theme="dark"] .button-address-icon,
html[data-theme="dark"] .strong-activity-title,
html[data-theme="dark"] code {
    color: #e5e7eb !important;
}

html[data-theme="dark"] .card-icon i,
html[data-theme="dark"] .log-icon i,
html[data-theme="dark"] .userName i {
    color: inherit;
}

/* AppPage tile cards */
.app-page-card-link {
    text-decoration: none;
}

.app-page-card-title {
    color: var(--app-color-text);
}

.app-page-card-icon {
    font-size: 3em;
    color: var(--app-color-primary);
}

html:not([data-theme="dark"]) .app-page-card-icon .fa-home,
html:not([data-theme="dark"]) .app-page-card-icon .fa-house,
html:not([data-theme="dark"]) .app-page-card-icon .ti-home {
    color: #000 !important;
}

/* Signout page */
.app-signout-card {
    border: 1px solid var(--app-color-border);
    background-color: var(--app-color-surface);
}

.app-signout-title {
    color: var(--app-color-text);
}

html[data-theme="dark"] .app-page-card {
    border-color: var(--app-color-border);
}

html[data-theme="dark"] .app-page-card-title {
    color: #f3f4f6 !important;
}

html[data-theme="dark"] .app-page-card-icon {
    color: #93c5fd !important;
}

html[data-theme="dark"] .app-signout-card {
    background-color: #1a2333 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .app-signout-title {
    color: #e5e7eb !important;
}

/* Component header readability in dark mode */
html[data-theme="dark"] .card-header {
    background-color: #1a2333 !important;
    color: #e5e7eb !important;
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .card-header .text-dark,
html[data-theme="dark"] .user-search-component .user-name-text,
html[data-theme="dark"] .heading {
    color: #e5e7eb !important;
}

/* Do not reserve scrollbar gutter space when no scrollbar is present */
html {
    scrollbar-gutter: auto;
}

/* Prevent Bootstrap .modal-open from adding body width compensation */
body.modal-open {
    padding-right: 0 !important;
}
