html {
    font-size: 14px;
    min-height: 100%;
    position: relative;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

:root {
    --app-bg: #f4f6f8;
    --app-surface: #ffffff;
    --app-surface-muted: #f8fafc;
    --app-border: #dde3ea;
    --app-border-soft: #edf1f5;
    --app-text: #17202a;
    --app-muted: #596579;
    --app-muted-strong: #3f4c5f;
    --app-primary: #2454a6;
    --app-primary-dark: #193c78;
    --app-primary-contrast: #ffffff;
    --app-primary-soft: rgba(36, 84, 166, 0.12);
    --app-sidebar: #17202a;
    --app-sidebar-soft: #202b38;
    --app-shadow: rgba(23, 32, 42, 0.05);
    --app-shadow-strong: rgba(23, 32, 42, 0.12);
    --app-focus: rgba(36, 84, 166, 0.18);
    --app-warning-bg: #fff7ed;
    --app-warning-border: #fed7aa;
    --app-warning-text: #9a3412;
    --app-warning-contrast: #ffffff;
    --app-danger: #b42318;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --app-bg: #101820;
        --app-surface: #17212b;
        --app-surface-muted: #1d2935;
        --app-border: #31404f;
        --app-border-soft: #263543;
        --app-text: #e8edf2;
        --app-muted: #b5c0cc;
        --app-muted-strong: #d1d8e0;
        --app-primary: #8db4ff;
        --app-primary-dark: #b8ceff;
        --app-primary-contrast: #0c1218;
        --app-primary-soft: rgba(141, 180, 255, 0.16);
        --app-sidebar: #0c1218;
        --app-sidebar-soft: #182330;
        --app-shadow: rgba(0, 0, 0, 0.24);
        --app-shadow-strong: rgba(0, 0, 0, 0.32);
        --app-focus: rgba(141, 180, 255, 0.22);
        --app-warning-bg: #3a2918;
        --app-warning-border: #8b5a21;
        --app-warning-text: #ffd08a;
        --app-warning-contrast: #101820;
        --app-danger: #ff8f84;
    }
}

:root[data-theme="dark"] {
    --app-bg: #101820;
    --app-surface: #17212b;
    --app-surface-muted: #1d2935;
    --app-border: #31404f;
    --app-border-soft: #263543;
    --app-text: #e8edf2;
    --app-muted: #b5c0cc;
    --app-muted-strong: #d1d8e0;
    --app-primary: #8db4ff;
    --app-primary-dark: #b8ceff;
    --app-primary-contrast: #0c1218;
    --app-primary-soft: rgba(141, 180, 255, 0.16);
    --app-sidebar: #0c1218;
    --app-sidebar-soft: #182330;
    --app-shadow: rgba(0, 0, 0, 0.24);
    --app-shadow-strong: rgba(0, 0, 0, 0.32);
    --app-focus: rgba(141, 180, 255, 0.22);
    --app-warning-bg: #3a2918;
    --app-warning-border: #8b5a21;
    --app-warning-text: #ffd08a;
    --app-warning-contrast: #101820;
    --app-danger: #ff8f84;
}

html {
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;
}

body {
    background-color: var(--app-bg);
    color: var(--app-text);
    min-height: 100vh;
}

a {
    color: var(--app-primary);
}

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

.text-danger {
    color: var(--app-danger) !important;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem var(--app-focus);
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    background: var(--app-sidebar);
    color: #ffffff;
    flex: 0 0 260px;
    min-height: 100vh;
    padding: 24px 18px;
}

.app-brand {
    align-items: center;
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
}

.brand-mark {
    align-items: center;
    background: linear-gradient(135deg, var(--app-surface), var(--app-primary-soft));
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 10px 24px rgba(0, 0, 0, 0.18);
    color: #ffffff;
    display: flex;
    font-size: 0.95rem;
    font-weight: 800;
    height: 42px;
    justify-content: center;
    letter-spacing: 0;
    position: relative;
    width: 42px;
}

.brand-mark::after {
    background: var(--app-primary);
    border-radius: 999px;
    bottom: 8px;
    content: "";
    height: 4px;
    position: absolute;
    right: 8px;
    width: 14px;
}

.brand-mark span {
    line-height: 1;
    transform: translateY(-1px);
}

.app-brand h4 {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

.app-brand small {
    color: #b8c2cf;
}

.app-nav {
    gap: 6px;
}

.app-nav .nav-link {
    border-radius: 8px;
    color: #dbe3ec;
    font-weight: 600;
    padding: 11px 12px;
}

.app-nav .nav-link:hover,
.app-nav .nav-link.active {
    background-color: var(--app-sidebar-soft);
    color: #ffffff;
}

.app-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.app-topbar {
    align-items: center;
    background: var(--app-surface);
    border-bottom: 1px solid var(--app-border);
    display: flex;
    justify-content: flex-end;
    min-height: 68px;
    padding: 0 28px;
}

.admin-access-label {
    background: var(--app-primary-soft);
    border: 1px solid var(--app-primary);
    border-radius: 999px;
    color: var(--app-primary);
    font-size: 0.82rem;
    font-weight: 800;
    margin-right: auto;
    padding: 6px 11px;
}

.notification-center {
    margin-right: 18px;
}

.theme-toggle {
    align-items: center;
    background: var(--app-surface-muted);
    border: 1px solid var(--app-border);
    border-radius: 999px;
    color: var(--app-muted-strong);
    display: inline-flex;
    font-size: 0.86rem;
    font-weight: 750;
    gap: 7px;
    justify-content: center;
    margin-right: 14px;
    min-height: 38px;
    min-width: 72px;
    padding: 7px 12px;
}

.theme-toggle-icon {
    fill: none;
    flex: 0 0 auto;
    height: 17px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 17px;
}

.theme-toggle-icon-moon {
    display: none;
}

.theme-toggle[data-theme-state="dark"] .theme-toggle-icon-sun {
    display: none;
}

.theme-toggle[data-theme-state="dark"] .theme-toggle-icon-moon {
    display: block;
}

.theme-toggle-label {
    line-height: 1;
}

.theme-toggle:hover,
.theme-toggle:focus {
    background: var(--app-primary-soft);
    border-color: var(--app-primary);
    color: var(--app-text);
}

.notification-trigger {
    align-items: center;
    background: var(--app-warning-bg);
    border: 1px solid var(--app-warning-border);
    border-radius: 999px;
    color: var(--app-warning-text);
    display: inline-flex;
    font-size: 0.9rem;
    font-weight: 750;
    gap: 8px;
    min-height: 38px;
    padding: 7px 12px;
}

.notification-trigger:hover,
.notification-trigger:focus {
    background: var(--app-warning-bg);
    border-color: var(--app-warning-text);
}

.notification-badge {
    align-items: center;
    background: var(--app-warning-text);
    border-radius: 999px;
    color: var(--app-warning-contrast);
    display: inline-flex;
    font-size: 0.74rem;
    font-weight: 800;
    height: 22px;
    justify-content: center;
    min-width: 22px;
    padding: 0 7px;
}

.notification-menu {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
    box-shadow: 0 18px 44px var(--app-shadow-strong);
    margin-top: 10px;
    overflow: hidden;
    padding: 0;
    width: min(380px, calc(100vw - 32px));
}

.notification-header {
    background: var(--app-warning-bg);
    border-bottom: 1px solid var(--app-warning-border);
    padding: 14px 16px;
}

.notification-header strong,
.notification-header small,
.notification-item-title,
.notification-item-meta,
.notification-item-warning {
    display: block;
}

.notification-header small {
    color: var(--app-warning-text);
    margin-top: 2px;
}

.notification-list {
    max-height: 360px;
    overflow-y: auto;
}

.notification-item {
    border-bottom: 1px solid var(--app-border-soft);
    color: var(--app-text);
    display: block;
    padding: 13px 16px;
    text-decoration: none;
}

.notification-item:hover {
    background: var(--app-surface-muted);
    color: var(--app-text);
}

.notification-item-title {
    font-weight: 750;
}

.notification-item-meta {
    color: var(--app-muted);
    font-size: 0.84rem;
    margin-top: 2px;
}

.notification-item-warning {
    color: var(--app-warning-text);
    font-size: 0.82rem;
    font-weight: 750;
    margin-top: 6px;
}

.notification-footer {
    background: var(--app-surface-muted);
    padding: 12px 16px;
    text-align: right;
}

.notification-empty {
    color: var(--app-muted);
    padding: 22px 16px;
    text-align: center;
}

.user-menu {
    align-items: center;
    display: flex;
    gap: 16px;
}

.top-profile-link {
    align-items: center;
    animation: top-profile-pulse 3.8s ease-in-out infinite;
    background: var(--app-surface-muted);
    border: 1px solid var(--app-border);
    border-radius: 999px;
    color: var(--app-muted-strong);
    display: inline-flex;
    gap: 9px;
    min-height: 40px;
    max-width: 220px;
    padding: 4px 12px 4px 5px;
    text-decoration: none;
    transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.top-profile-link:hover,
.top-profile-link:focus {
    background: var(--app-primary-soft);
    border-color: var(--app-primary);
    box-shadow: 0 8px 22px var(--app-shadow-strong);
    color: var(--app-text);
    transform: translateY(-1px);
}

.top-profile-avatar {
    align-items: center;
    background: var(--app-primary-soft);
    border: 1px solid var(--app-primary);
    border-radius: 999px;
    color: var(--app-primary);
    display: inline-flex;
    flex: 0 0 30px;
    font-size: 0.76rem;
    font-weight: 800;
    height: 30px;
    justify-content: center;
    overflow: hidden;
    width: 30px;
}

.top-profile-avatar img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.top-profile-name {
    font-size: 0.9rem;
    font-weight: 750;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@keyframes top-profile-pulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(36, 84, 166, 0);
    }

    45% {
        box-shadow: 0 0 0 4px var(--app-primary-soft);
    }
}

.app-content {
    padding: 28px;
}

.page-header {
    align-items: flex-start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 22px;
}

.page-title {
    font-size: 1.65rem;
    font-weight: 750;
    margin: 0;
}

.page-subtitle {
    color: var(--app-muted-strong);
    font-size: 1rem;
    line-height: 1.55;
    margin: 6px 0 0;
    max-width: 720px;
}

.toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.panel {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px var(--app-shadow);
}

.panel-body {
    padding: 24px;
}

.stat-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-left: 4px solid var(--app-primary);
    border-radius: 8px;
    padding: 20px;
}

.stat-card-success {
    border-left-color: #198754;
}

.stat-card-warning {
    border-left-color: #d97706;
}

.stat-label {
    color: var(--app-muted);
    font-size: 0.84rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.dashboard-meta {
    flex: 0 0 auto;
    font-weight: 700;
    white-space: nowrap;
}

.dashboard-panel-header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    justify-content: space-between;
    margin-bottom: 16px;
}

.dashboard-list {
    display: grid;
    gap: 4px;
}

.dashboard-list .dashboard-list-item {
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 12px 14px;
}

.dashboard-list .dashboard-list-item + .dashboard-list-item {
    border-top-width: 1px;
}

.dashboard-list-row {
    align-items: flex-start;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    min-width: 0;
}

.dashboard-list-row-center {
    align-items: center;
}

.dashboard-list-main {
    min-width: 0;
    overflow-wrap: anywhere;
}

.dashboard-status-badge {
    align-self: flex-start;
    flex: 0 0 auto;
    line-height: 1.2;
    margin-left: 6px;
    max-width: 12rem;
    padding: 0.45em 0.7em;
    text-align: center;
    white-space: normal;
}

.toast-container {
    z-index: 1080;
}

.app-toast {
    background: var(--app-surface);
    border-left: 4px solid #198754 !important;
    box-shadow: 0 18px 44px var(--app-shadow-strong);
    color: var(--app-text);
    min-width: min(360px, calc(100vw - 32px));
    overflow: hidden;
}

.app-toast .toast-body {
    font-weight: 650;
    padding: 14px 16px;
}

.toast-progress {
    animation: toast-progress 3.5s linear forwards;
    background: linear-gradient(90deg, #198754, var(--app-primary));
    height: 3px;
    transform-origin: left;
}

@keyframes toast-progress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

.card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    color: var(--app-text);
}

.interactive-card {
    cursor: pointer;
    position: relative;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.interactive-card:hover,
.interactive-card:focus-within {
    border-color: var(--app-primary);
    box-shadow: 0 14px 34px var(--app-shadow-strong) !important;
    transform: translateY(-2px);
}

.interactive-card .stretched-link:focus {
    outline: 0;
}

.interactive-card:focus-within {
    box-shadow: 0 0 0 0.2rem var(--app-focus), 0 14px 34px var(--app-shadow-strong) !important;
}

.card-secondary-action {
    position: relative;
    z-index: 2;
}

.card-secondary-action:hover {
    color: var(--app-primary) !important;
}

.process-card-attention {
    border-color: var(--app-warning-border);
    border-left: 4px solid #d97706;
}

.card-title {
    font-weight: 700;
}

.attention-chip {
    align-self: flex-start;
    background: var(--app-warning-bg);
    border: 1px solid var(--app-warning-border);
    border-radius: 999px;
    color: var(--app-warning-text);
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 5px 10px;
}

.process-title-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.process-number-chip {
    align-self: flex-start;
    background: var(--app-primary-soft);
    border: 1px solid var(--app-primary);
    border-radius: 999px;
    color: var(--app-primary);
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 4px 9px;
}

.process-number-chip-lg {
    font-size: 0.88rem;
    padding: 6px 11px;
}

.additional-data-header {
    align-items: center;
    background: var(--app-surface-muted);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    padding: 14px;
}

.additional-data-list {
    display: grid;
    gap: 12px;
}

.additional-data-item {
    background: var(--app-surface-muted);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 14px;
}

.form-label,
.control-label {
    color: var(--app-muted-strong);
    font-weight: 650;
    margin-bottom: 6px;
}

.form-control,
.form-select {
    background: var(--app-surface);
    border-color: var(--app-border);
    border-radius: 8px;
    color: var(--app-text);
}

.form-control::placeholder {
    color: var(--app-muted);
}

.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--app-text);
    box-shadow: 0 0 0 1000px var(--app-surface) inset;
    transition: background-color 9999s ease-in-out 0s;
}

.form-control:focus,
.form-select:focus {
    background: var(--app-surface);
    border-color: var(--app-primary);
    color: var(--app-text);
}

.form-floating > label {
    color: var(--app-muted);
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: var(--app-muted-strong);
}

.turnstile-container {
    align-items: center;
    display: flex;
    justify-content: center;
    width: 100%;
}

.form-check-input {
    background-color: var(--app-surface);
    border-color: var(--app-border);
}

.form-check-label {
    color: var(--app-muted-strong);
}

.invalid-feedback,
.validation-summary-errors,
.field-validation-error {
    color: var(--app-danger);
}

.btn {
    border-radius: 8px;
    align-items: center;
    display: inline-flex;
    gap: 0.4rem;
    font-weight: 650;
    justify-content: center;
    line-height: 1.25;
    max-width: 100%;
    min-height: 2.375rem;
    text-align: center;
    vertical-align: middle;
    white-space: normal;
}

.btn-sm {
    min-height: 2rem;
}

.btn-lg {
    min-height: 2.875rem;
}

.btn-primary {
    background-color: var(--app-primary);
    border-color: var(--app-primary);
    color: var(--app-primary-contrast);
}

.btn-primary:hover {
    background-color: var(--app-primary-dark);
    border-color: var(--app-primary-dark);
    color: var(--app-primary-contrast);
}

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

.btn-outline-primary:hover {
    background: var(--app-primary);
    border-color: var(--app-primary);
    color: var(--app-primary-contrast);
}

.btn-outline-secondary {
    border-color: var(--app-border);
    color: var(--app-muted-strong);
}

.btn-outline-secondary:hover {
    background: var(--app-surface-muted);
    border-color: var(--app-muted-strong);
    color: var(--app-text);
}

.btn-outline-warning {
    border-color: var(--app-warning-border);
    color: var(--app-warning-text);
}

.btn-outline-warning:hover,
.btn-outline-warning:focus {
    background: var(--app-warning-bg);
    border-color: var(--app-warning-text);
    color: var(--app-warning-text);
}

.btn-warning {
    background: var(--app-warning-text);
    border-color: var(--app-warning-text);
    color: var(--app-warning-contrast);
}

.btn-warning:hover,
.btn-warning:focus {
    background: var(--app-warning-text);
    border-color: var(--app-warning-text);
    color: var(--app-warning-contrast);
}

.empty-state {
    background: var(--app-surface);
    border: 1px dashed var(--app-border);
    border-radius: 8px;
    color: var(--app-muted);
    padding: 36px;
    text-align: center;
}

.status-page-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: 0 16px 40px var(--app-shadow-strong);
    color: var(--app-text);
    max-width: 620px;
    padding: 36px;
    width: min(100%, 620px);
}

.status-page-card h1 {
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 12px;
}

.status-page-card p {
    color: var(--app-muted);
    line-height: 1.6;
    margin: 0;
}

.status-code-label {
    color: var(--app-primary);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.status-page-path {
    background: var(--app-surface-muted);
    border: 1px solid var(--app-border-soft);
    border-radius: 8px;
    color: var(--app-muted-strong);
    margin-top: 18px;
    overflow-wrap: anywhere;
    padding: 12px 14px;
}

.status-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.detail-list {
    display: grid;
    gap: 20px;
}

.detail-row {
    border-bottom: 1px solid var(--app-border-soft);
    display: grid;
    gap: 8px;
    grid-template-columns: 180px 1fr;
    padding-bottom: 20px;
}

.detail-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.detail-label {
    color: var(--app-muted-strong);
    font-size: 0.92rem;
    font-weight: 750;
    line-height: 1.45;
}

.detail-value {
    color: var(--app-text);
    font-size: 1.03rem;
    font-weight: 700;
    line-height: 1.55;
}

.detail-copy {
    font-weight: 500;
}

.vault-field-list {
    display: grid;
    gap: 18px;
}

.vault-field-row {
    border-bottom: 1px solid var(--app-border-soft);
    display: grid;
    gap: 8px;
    grid-template-columns: 180px 1fr;
    padding-bottom: 18px;
}

.vault-field-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.vault-field-label {
    color: var(--app-muted-strong);
    font-size: 0.92rem;
    font-weight: 750;
    line-height: 1.45;
}

.vault-secret-group {
    max-width: 100%;
}

.vault-secret-group .form-control,
.vault-secret-textarea-group .form-control {
    background-color: var(--app-surface-muted);
    border-color: var(--app-border);
    color: var(--app-text);
}

.vault-secret-group .form-control[readonly],
.vault-secret-textarea-group .form-control[readonly] {
    background-color: var(--app-surface-muted);
    color: var(--app-text);
    opacity: 1;
}

.vault-secret-group .form-control::placeholder,
.vault-secret-textarea-group .form-control::placeholder {
    color: var(--app-muted);
    opacity: 1;
}

.vault-secret-group .btn,
.vault-secret-textarea-group .btn {
    background-color: var(--app-surface);
    border-color: var(--app-border);
    color: var(--app-muted-strong);
}

.vault-secret-group .btn:hover,
.vault-secret-group .btn:focus,
.vault-secret-textarea-group .btn:hover,
.vault-secret-textarea-group .btn:focus {
    background-color: var(--app-primary-soft);
    border-color: var(--app-primary);
    color: var(--app-primary);
}

.vault-secret-textarea-group {
    align-items: flex-start;
    display: flex;
    gap: 10px;
}

.vault-secret-textarea-group .form-control {
    flex: 1 1 auto;
}

.vault-secret-textarea-group .btn {
    flex: 0 0 auto;
}

.vault-eye-icon {
    display: block;
    height: 18px;
    width: 18px;
}

.detail-meta {
    color: var(--app-muted);
    font-size: 0.92rem;
    font-weight: 650;
    line-height: 1.45;
    margin-top: 8px;
}

.text-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 18px;
}

.timeline {
    border-left: 2px solid var(--app-border);
    margin-left: 10px;
    padding-left: 20px;
}

.timeline-item {
    position: relative;
}

.timeline-item::before {
    background: var(--app-primary);
    border-radius: 50%;
    content: "";
    height: 10px;
    left: -27px;
    position: absolute;
    top: 5px;
    width: 10px;
}

.timeline-card {
    background: var(--app-surface-muted);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    color: var(--app-text);
}

.list-group {
    --bs-list-group-bg: transparent;
    --bs-list-group-color: var(--app-text);
    --bs-list-group-border-color: var(--app-border-soft);
    --bs-list-group-action-color: var(--app-text);
    --bs-list-group-action-hover-color: var(--app-text);
    --bs-list-group-action-hover-bg: var(--app-surface-muted);
    --bs-list-group-action-active-color: var(--app-text);
    --bs-list-group-action-active-bg: var(--app-primary-soft);
}

.list-group-item {
    background: transparent;
    color: var(--app-text);
}

.list-group-item-action:hover,
.list-group-item-action:focus {
    background: var(--app-surface-muted);
    color: var(--app-text);
}

.table {
    --bs-table-bg: var(--app-surface);
    --bs-table-color: var(--app-text);
    --bs-table-border-color: var(--app-border);
    --bs-table-striped-bg: var(--app-surface-muted);
    --bs-table-striped-color: var(--app-text);
    --bs-table-hover-bg: var(--app-surface-muted);
    --bs-table-hover-color: var(--app-text);
}

.table > :not(caption) > * > * {
    background-color: var(--bs-table-bg);
    border-bottom-color: var(--app-border);
    color: var(--app-text);
}

.badge.bg-primary {
    background-color: var(--app-primary) !important;
    color: var(--app-primary-contrast);
}

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

.text-warning-emphasis {
    color: var(--app-warning-text) !important;
}

.bg-light,
.bg-white {
    background-color: var(--app-bg) !important;
    color: var(--app-text);
}

.auth-body {
    background: var(--app-bg);
    color: var(--app-text);
    min-height: 100vh;
}

.auth-body .card {
    max-width: calc(100vw - 32px);
    box-shadow: 0 18px 44px var(--app-shadow-strong) !important;
}

.auth-theme-toggle {
    position: fixed;
    right: 22px;
    top: 18px;
    z-index: 10;
}

.profile-grid {
    align-items: start;
    display: grid;
    gap: 20px;
    grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.25fr);
}

.profile-identity-panel {
    position: sticky;
    top: 20px;
}

.profile-hero {
    align-items: center;
    display: flex;
    gap: 16px;
}

.profile-avatar {
    align-items: center;
    background: var(--app-primary-soft);
    border: 1px solid var(--app-primary);
    border-radius: 8px;
    color: var(--app-primary);
    display: flex;
    flex: 0 0 76px;
    font-size: 1.45rem;
    font-weight: 800;
    height: 76px;
    justify-content: center;
    width: 76px;
}

.profile-hero-main {
    min-width: 0;
}

.profile-hero-main h2 {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    overflow-wrap: anywhere;
}

.profile-hero-main p,
.profile-handle {
    color: var(--app-muted);
    margin: 4px 0 0;
    overflow-wrap: anywhere;
}

.profile-section-title {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 18px;
}

.permissions-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.permission-role-card {
    min-width: 0;
}

.permission-role-header {
    align-items: flex-start;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-bottom: 18px;
}

.permission-role-title {
    min-width: 0;
}

.permission-role-default {
    background: var(--app-surface-muted);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 12px 14px;
}

.permission-screen-list {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    overflow: hidden;
}

.permission-screen-item {
    align-items: center;
    background: var(--app-surface);
    border-bottom: 1px solid var(--app-border-soft);
    cursor: pointer;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    margin: 0;
    padding: 14px 16px;
}

.permission-screen-item:last-child {
    border-bottom: 0;
}

.permission-screen-item:hover {
    background: var(--app-surface-muted);
}

.permission-screen-item span {
    display: block;
    min-width: 0;
}

.permission-screen-item strong {
    display: block;
    font-weight: 800;
}

.permission-screen-item small {
    color: var(--app-muted);
    display: block;
    line-height: 1.45;
    margin-top: 3px;
}

.permission-role-actions {
    border-top: 1px solid var(--app-border-soft);
    margin-top: 18px;
    padding-top: 18px;
    text-align: right;
}

.profile-subsection-title {
    font-size: 0.95rem;
    font-weight: 800;
    margin: 22px 0 12px;
}

.profile-facts {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-facts div,
.profile-access-item,
.profile-disabled-row,
.profile-delete-placeholder {
    background: var(--app-surface-muted);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 13px 14px;
}

.profile-facts span,
.profile-disabled-row span,
.profile-delete-placeholder span,
.profile-access-item span,
.profile-access-item small {
    color: var(--app-muted);
    display: block;
    font-size: 0.88rem;
}

.profile-facts strong,
.profile-disabled-row strong,
.profile-delete-placeholder strong,
.profile-access-item strong {
    color: var(--app-text);
    display: block;
    font-weight: 800;
    margin-top: 3px;
    overflow-wrap: anywhere;
}

.profile-disabled-row,
.profile-delete-placeholder {
    align-items: center;
    display: flex;
    gap: 14px;
    justify-content: space-between;
}

.profile-delete-placeholder {
    align-items: flex-start;
    flex-direction: column;
}

.profile-access-list {
    display: grid;
    gap: 10px;
}

.profile-theme-options {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-theme-option {
    align-items: center;
    background: var(--app-surface-muted);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    gap: 10px;
    padding: 13px 14px;
}

.profile-theme-option:has(input:checked) {
    background: var(--app-primary-soft);
    border-color: var(--app-primary);
    color: var(--app-primary);
    font-weight: 800;
}

.profile-danger-panel {
    border-color: var(--app-warning-border);
}

.input-group-text {
    background: var(--app-surface-muted);
    border-color: var(--app-border);
    color: var(--app-muted-strong);
}

.modal-content,
.dropdown-menu {
    background-color: var(--app-surface);
    color: var(--app-text);
}

.modal-header,
.modal-footer {
    border-color: var(--app-border);
}

@media (max-width: 768px) {
    .app-shell {
        display: block;
    }

    .app-sidebar {
        min-height: auto;
        padding: 18px;
    }

    .app-nav {
        flex-direction: row !important;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .app-topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
        justify-content: flex-start;
        padding: 14px 18px;
    }

    .admin-access-label {
        margin-right: 0;
    }

    .notification-center {
        margin-right: 0;
    }

    .user-menu {
        flex-wrap: wrap;
        gap: 10px;
    }

    .top-profile-link {
        max-width: calc(100vw - 140px);
    }

    .app-content {
        padding: 20px 16px;
    }

    .page-header {
        display: block;
    }

    .page-header .toolbar,
    .page-header > .btn,
    .page-header > a {
        margin-top: 14px;
    }

    .detail-row {
        grid-template-columns: 1fr;
    }

    .dashboard-panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-list .dashboard-list-item {
        padding: 12px;
    }

    .dashboard-list-row {
        gap: 10px;
    }

    .dashboard-status-badge {
        max-width: 9rem;
    }

    .profile-grid,
    .profile-facts,
    .profile-theme-options {
        grid-template-columns: 1fr;
    }

    .profile-identity-panel {
        position: static;
    }

    .profile-disabled-row {
        align-items: flex-start;
    }
}
