html,
body {
    min-height: 100%;
}

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

.sidebar {
    flex: 0 0 var(--sidebar-width);
    min-height: 100vh;
    position: sticky;
    top: 0;
    width: var(--sidebar-width);
    z-index: 20;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
}

.sidebar-top {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.sidebar-brand {
    align-items: center;
    color: inherit;
    display: flex;
    gap: 0.75rem;
    min-width: 0;
    text-decoration: none;
}

.sidebar-logo {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    height: 48px;
    justify-content: center;
    overflow: hidden;
    padding: 0.35rem;
    width: 58px;
}

.sidebar-logo img,
.login-logo img {
    display: block;
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.sidebar-title-wrap {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-title {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.1;
}

.sidebar-subtitle {
    font-size: 0.78rem;
    margin-top: 0.1rem;
}

.sidebar-section {
    font-size: 0.72rem;
    font-weight: 800;
    margin: 1rem 0 0.55rem;
    text-transform: uppercase;
}

.sidebar .nav {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.sidebar-link {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    text-decoration: none;
}

.sidebar-icon {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 1.05rem;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: auto;
}

.sidebar-user {
    align-items: center;
    display: flex;
    flex-direction: column;
    padding: 0.9rem;
    text-align: center;
}

.sidebar-user-photo {
    align-items: center;
    background: rgba(0, 122, 255, 0.12);
    border: 1px solid rgba(0, 122, 255, 0.24);
    border-radius: 999px;
    color: var(--accent, #007aff);
    display: flex;
    flex: 0 0 auto;
    font-size: 1.35rem;
    height: 44px;
    justify-content: center;
    margin: 0 auto 0.6rem;
    overflow: hidden;
    width: 44px;
}

.sidebar-user-photo:hover,
.sidebar-user-photo:focus-visible {
    background: rgba(0, 122, 255, 0.18);
    color: var(--accent-strong, #0a84ff);
}

.sidebar-user-photo img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.sidebar-user-name {
    font-weight: 750;
    margin-bottom: 0.35rem;
}

.document-thumb-link {
    display: inline-flex;
}

.document-thumb,
.document-file-icon {
    align-items: center;
    background: var(--surface-bg-soft, #f5f5f7);
    border: 1px solid var(--surface-border, rgba(60, 60, 67, 0.16));
    border-radius: 10px;
    display: inline-flex;
    flex: 0 0 auto;
    height: 48px;
    justify-content: center;
    width: 64px;
}

.document-thumb {
    object-fit: cover;
}

.document-file-icon {
    color: var(--accent-strong, #0a84ff);
    font-size: 1.45rem;
}

.intervention-photo-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.intervention-photo-card {
    background: var(--surface-bg-soft, #f5f5f7);
    border: 1px solid var(--surface-border, rgba(60, 60, 67, 0.16));
    border-radius: 14px;
    overflow: hidden;
}

.intervention-photo-preview {
    background: rgba(118, 118, 128, 0.12);
    display: block;
    height: 150px;
    overflow: hidden;
}

.intervention-photo-preview img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.intervention-photo-meta {
    display: grid;
    gap: 0.55rem;
    padding: 0.75rem;
}

.content-area {
    flex: 1 1 auto;
    min-height: 100vh;
    min-width: 0;
    overflow-x: hidden;
}

.content-container {
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    max-width: var(--content-max-width);
    min-height: calc(100vh - 4rem);
    width: 100%;
}

.page-content {
    flex: 1 1 auto;
}

.app-footer {
    padding: 1.25rem 0 0;
}

.guest-shell {
    min-height: 100vh;
    padding: 1rem;
}

.mobile-app-header,
.mobile-sidebar-backdrop {
    display: none;
}

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

    body {
        padding-top: 64px;
    }

    body.mobile-nav-open {
        overflow: hidden;
    }

    .mobile-app-header {
        align-items: center;
        backdrop-filter: blur(22px);
        -webkit-backdrop-filter: blur(22px);
        background: rgba(255, 255, 255, 0.82);
        border-bottom: 1px solid rgba(60, 60, 67, 0.14);
        display: flex;
        gap: 0.75rem;
        height: 64px;
        justify-content: space-between;
        left: 0;
        padding: 0.65rem 0.85rem;
        position: fixed;
        right: 0;
        top: 0;
        transform: translateY(0);
        transition: transform 0.2s ease, background-color 0.2s ease;
        z-index: 120;
    }

    body.mobile-header-hidden:not(.mobile-nav-open) .mobile-app-header {
        transform: translateY(-100%);
    }

    .mobile-menu-button {
        align-items: center;
        background: var(--surface-bg-soft, #f6f6f8);
        border: 1px solid var(--surface-border, rgba(60, 60, 67, 0.16));
        border-radius: 999px;
        color: var(--heading-text, #111114);
        display: inline-flex;
        flex: 0 0 auto;
        font-size: 1.25rem;
        height: 42px;
        justify-content: center;
        padding: 0;
        width: 42px;
    }

    .mobile-header-brand {
        align-items: center;
        color: var(--heading-text, #111114);
        display: inline-flex;
        font-weight: 800;
        gap: 0.55rem;
        min-width: 0;
        text-decoration: none;
    }

    .mobile-header-brand img {
        display: block;
        max-height: 32px;
        max-width: 88px;
        object-fit: contain;
    }

    .mobile-sidebar-backdrop {
        background: rgba(0, 0, 0, 0.34);
        bottom: 0;
        display: block;
        left: 0;
        opacity: 0;
        pointer-events: none;
        position: fixed;
        right: 0;
        top: 0;
        transition: opacity 0.18s ease;
        z-index: 100;
    }

    body.mobile-nav-open .mobile-sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar {
        bottom: 0;
        box-shadow: 18px 0 50px rgba(0, 0, 0, 0.18);
        max-width: min(86vw, 340px);
        min-height: 100vh;
        overflow-y: auto;
        position: fixed;
        top: 0;
        transform: translateX(-105%);
        transition: transform 0.22s ease;
        width: min(86vw, 340px);
        z-index: 130;
    }

    body.mobile-nav-open .sidebar {
        transform: translateX(0);
    }

    .content-area {
        min-height: calc(100vh - 64px);
    }
}

/* Final UI polish: light, quiet, consistent application surfaces. */
body {
    background: #f5f5f7 !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
.sidebar-title,
.metric-value,
.app-page-header h1 {
    letter-spacing: 0 !important;
}

.content-container {
    max-width: min(1680px, 100%);
}

.app-page-header {
    align-items: center;
    background: rgba(255, 255, 255, 0.9) !important;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.app-page-header h1 {
    font-size: clamp(1.55rem, 2vw, 2.1rem) !important;
}

.card,
.app-card,
.detail-card,
.form-card,
.stat-card,
.dashboard-card,
.login-card,
.machine-card,
.user-card,
.summary-card {
    background: rgba(255, 255, 255, 0.94) !important;
    border-color: rgba(60, 60, 67, 0.14) !important;
    border-radius: 16px !important;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.06) !important;
}

.card-header {
    background: rgba(250, 250, 252, 0.96) !important;
}

.table {
    font-size: 0.94rem;
}

.table thead th {
    background: rgba(246, 246, 248, 0.98);
    border-bottom-width: 1px;
    white-space: nowrap;
}

.table td,
.table th {
    vertical-align: middle;
}

.table-hover > tbody > tr:hover > * {
    background-color: rgba(0, 122, 255, 0.07) !important;
}

.clickable-row,
.clickable-card {
    cursor: pointer;
}

.clickable-card {
    border-radius: 12px;
    margin-inline: -0.25rem;
    padding-inline: 0.25rem;
    transition: background-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.clickable-card:hover {
    background: rgba(0, 122, 255, 0.07);
}

.clickable-row:focus-visible,
.clickable-card:focus-visible {
    outline: 3px solid rgba(0, 122, 255, 0.32);
    outline-offset: -3px;
}

.clickable-row:active > *,
.clickable-card:active {
    background-color: rgba(0, 122, 255, 0.11) !important;
}

.btn {
    box-shadow: none !important;
    white-space: nowrap;
}

.btn-danger {
    --bs-btn-bg: #ff3b30;
    --bs-btn-border-color: #ff3b30;
    --bs-btn-color: #fff;
    --bs-btn-hover-bg: #e92c23;
    --bs-btn-hover-border-color: #e92c23;
    --bs-btn-hover-color: #fff;
}

.btn-outline-danger {
    --bs-btn-color: #ff3b30;
    --bs-btn-border-color: rgba(255, 59, 48, 0.35);
    --bs-btn-hover-bg: #ff3b30;
    --bs-btn-hover-border-color: #ff3b30;
    --bs-btn-hover-color: #fff;
}

.form-control,
.form-select {
    box-shadow: none !important;
}

textarea.form-control {
    line-height: 1.45;
}

.form-check-input {
    cursor: pointer;
}

.form-switch .form-check-input {
    height: 1.25rem;
    width: 2.35rem;
}

.mobile-photo-actions {
    display: none;
    gap: 0.65rem;
    grid-template-columns: 1fr;
}

.mobile-photo-action {
    align-items: center;
    display: inline-flex;
    gap: 0.45rem;
    justify-content: center;
    min-height: 46px;
    position: relative;
    width: 100%;
}

.mobile-photo-input {
    height: 1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    position: absolute;
    width: 1px;
}

.photo-preview-grid {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
}

.photo-preview-item {
    background: rgba(246, 246, 248, 0.92);
    border: 1px solid rgba(60, 60, 67, 0.14);
    border-radius: 12px;
    overflow: hidden;
}

.photo-preview-item img {
    aspect-ratio: 1;
    display: block;
    object-fit: cover;
    width: 100%;
}

.photo-preview-item small {
    color: var(--muted-text, #6e6e73);
    display: block;
    font-size: 0.72rem;
    overflow: hidden;
    padding: 0.35rem 0.45rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.asset-picker-selected {
    background: rgba(0, 122, 255, 0.08);
    border: 1px solid rgba(0, 122, 255, 0.16);
    border-radius: 12px;
    color: var(--heading-text, #111114);
    font-size: 0.9rem;
    font-weight: 650;
    padding: 0.65rem 0.8rem;
}

.asset-picker-selected.is-empty {
    background: rgba(142, 142, 147, 0.08);
    border-color: rgba(142, 142, 147, 0.18);
    color: var(--muted-text, #6e6e73);
}

.asset-picker-list {
    border: 1px solid rgba(60, 60, 67, 0.14);
    border-radius: 14px;
    display: grid;
    gap: 0.45rem;
    max-height: 320px;
    overflow-y: auto;
    padding: 0.45rem;
}

.asset-picker-list.asset-picker-error {
    border-color: rgba(255, 59, 48, 0.55);
    box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.12);
}

.asset-picker-item {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(60, 60, 67, 0.13);
    border-radius: 12px;
    color: var(--page-text, #1d1d1f);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-height: 52px;
    padding: 0.65rem 0.75rem;
    text-align: left;
    width: 100%;
}

.asset-picker-item:hover,
.asset-picker-item:focus-visible,
.asset-picker-item.active {
    background: rgba(0, 122, 255, 0.1);
    border-color: rgba(0, 122, 255, 0.28);
    outline: none;
}

.asset-picker-item strong,
.asset-picker-item small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.asset-picker-item small,
.asset-picker-empty,
.compact-meta {
    color: var(--muted-text, #6e6e73);
    font-size: 0.8rem;
}

.asset-picker-empty {
    padding: 0.55rem 0.65rem;
}

.min-width-0 {
    min-width: 0;
}

.equipment-group-title {
    align-items: center;
    display: flex;
    gap: 0.45rem;
    min-width: 0;
}

.equipment-group-title .text-clamp-1 {
    min-width: 0;
}

.text-clamp-1,
.text-clamp-2 {
    -webkit-box-orient: vertical;
    display: -webkit-box;
    overflow: hidden;
}

.text-clamp-1 {
    -webkit-line-clamp: 1;
}

.text-clamp-2 {
    -webkit-line-clamp: 2;
}

@media (max-width: 767.98px) {
    .desktop-photo-input {
        display: none;
    }

    .mobile-photo-actions {
        display: grid;
    }

    .clickable-row td,
    .clickable-row th {
        padding-bottom: 0.95rem;
        padding-top: 0.95rem;
    }

    .asset-picker-list {
        max-height: 48vh;
    }
}

.notification-settings-panel,
.description-box,
.preview-box,
.upload-zone,
.breadcrumb-box {
    background: rgba(246, 246, 248, 0.92);
    border: 1px solid rgba(60, 60, 67, 0.14);
    border-radius: 14px;
    padding: 0.9rem;
}

.badge {
    line-height: 1.1;
}

.badge.bg-danger,
.badge.text-bg-danger {
    background-color: #ff3b30 !important;
}

.badge.bg-warning,
.badge.text-bg-warning {
    background-color: #ffcc00 !important;
    color: #1d1d1f !important;
}

.badge.bg-success,
.badge.text-bg-success {
    background-color: #34c759 !important;
}

.alert {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(60, 60, 67, 0.16);
    color: #1d1d1f;
}

.timeline .card {
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.05) !important;
}

.document-thumb,
.document-file-icon,
.intervention-photo-card {
    border-color: rgba(60, 60, 67, 0.14);
}

.sidebar {
    background: rgba(255, 255, 255, 0.78) !important;
}

.sidebar-link {
    min-width: 0;
}

.sidebar-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.login-card {
    margin-inline: auto;
}

.login-wrapper {
    min-height: min(720px, calc(100vh - 2rem));
    padding-top: 1rem;
}

.modal-content {
    background: rgba(255, 255, 255, 0.98) !important;
}

.btn-group form {
    display: inline-flex;
}

@media (max-width: 991.98px) {
    .app-page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .app-page-header > .d-flex {
        justify-content: flex-start;
    }

    .sidebar-inner {
        gap: 0.75rem;
        min-height: 100%;
    }

    #sidebarToggle {
        display: none;
    }

    .sidebar .nav {
        display: flex;
        flex-direction: column;
    }

    .sidebar-footer {
        padding-top: 0;
    }

    .sidebar-user {
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 575.98px) {
    .content-area {
        padding: 0.75rem !important;
    }

    .card-body {
        padding: 1rem;
    }

    .table-responsive {
        border-radius: 14px;
    }

    .btn,
    .input-group .btn,
    .btn-group .btn {
        width: 100%;
    }

    .btn-group {
        display: grid;
        gap: 0.45rem;
        width: 100%;
    }

    .btn-group form,
    .btn-group form .btn {
        width: 100%;
    }

    .input-group {
        gap: 0.45rem;
    }

    .input-group > .form-control,
    .input-group > .form-select,
    .input-group > .btn {
        border-radius: var(--control-radius) !important;
        flex: 1 0 100%;
        width: 100%;
    }

    .intervention-photo-grid {
        grid-template-columns: 1fr;
    }
}

.sidebar-controls {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 0.4rem;
}

.sidebar-control-button,
.guest-theme-toggle,
.back-to-top {
    align-items: center;
    background: var(--surface-bg-soft, #f6f6f8);
    border: 1px solid var(--surface-border, rgba(60, 60, 67, 0.16));
    border-radius: 999px;
    color: var(--heading-text, #111114);
    display: inline-flex;
    height: 40px;
    justify-content: center;
    padding: 0;
    transition: background-color 0.16s ease, color 0.16s ease, opacity 0.16s ease, transform 0.16s ease;
    width: 40px;
}

.sidebar-control-button:hover,
.guest-theme-toggle:hover,
.back-to-top:hover {
    background: var(--accent-soft, rgba(0, 122, 255, 0.13));
    color: var(--accent-strong, #0a84ff);
}

.guest-theme-toggle {
    position: fixed;
    right: 1rem;
    top: 1rem;
    z-index: 50;
}

.back-to-top {
    bottom: 1.25rem;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    right: 1.25rem;
    transform: translateY(0.5rem);
    z-index: 80;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.app-footer {
    color: var(--page-text, #1d1d1f);
    padding-bottom: 1.25rem;
}

.app-footer-links {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: flex-end;
}

.app-footer-links a {
    border: 1px solid var(--surface-border, rgba(60, 60, 67, 0.16));
    border-radius: 999px;
    color: var(--muted-text, #6e6e73);
    font-size: 0.86rem;
    font-weight: 700;
    padding: 0.38rem 0.68rem;
    text-decoration: none;
}

.app-footer-links a:hover {
    background: var(--accent-soft, rgba(0, 122, 255, 0.13));
    color: var(--accent-strong, #0a84ff);
}

.sidebar-user {
    color: var(--page-text, #1d1d1f);
}

.sidebar-user-name {
    color: var(--heading-text, #111114) !important;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user .btn-outline-light {
    --bs-btn-color: var(--heading-text, #111114);
    --bs-btn-border-color: var(--surface-border, rgba(60, 60, 67, 0.16));
    --bs-btn-hover-bg: var(--accent-soft, rgba(0, 122, 255, 0.13));
    --bs-btn-hover-border-color: var(--surface-border, rgba(60, 60, 67, 0.16));
    --bs-btn-hover-color: var(--heading-text, #111114);
}

@media (min-width: 992px) {
    .sidebar,
    .content-area,
    .sidebar-title-wrap,
    .sidebar-text,
    .sidebar-section,
    .sidebar-user-label,
    .sidebar-user-name {
        transition: all 0.18s ease;
    }

    body.sidebar-collapsed .sidebar,
    html.sidebar-collapsed-init .sidebar {
        flex-basis: var(--sidebar-width-collapsed, 84px);
        width: var(--sidebar-width-collapsed, 84px);
    }

    body.sidebar-collapsed .sidebar,
    html.sidebar-collapsed-init .sidebar {
        padding-inline: 0.7rem;
    }

    body.sidebar-collapsed .sidebar-top,
    html.sidebar-collapsed-init .sidebar-top {
        flex-direction: column;
        justify-content: center;
    }

    body.sidebar-collapsed .sidebar-brand,
    html.sidebar-collapsed-init .sidebar-brand {
        justify-content: center;
    }

    body.sidebar-collapsed .sidebar-logo,
    html.sidebar-collapsed-init .sidebar-logo {
        height: 42px;
        width: 48px;
    }

    body.sidebar-collapsed .sidebar-title-wrap,
    html.sidebar-collapsed-init .sidebar-title-wrap,
    body.sidebar-collapsed .sidebar-section,
    html.sidebar-collapsed-init .sidebar-section,
    body.sidebar-collapsed .sidebar-text,
    html.sidebar-collapsed-init .sidebar-text,
    body.sidebar-collapsed .sidebar-user-name,
    html.sidebar-collapsed-init .sidebar-user-name,
    body.sidebar-collapsed .sidebar-user-label,
    html.sidebar-collapsed-init .sidebar-user-label,
    body.sidebar-collapsed .sidebar-user form span,
    html.sidebar-collapsed-init .sidebar-user form span {
        opacity: 0;
        overflow: hidden;
        pointer-events: none;
        position: absolute;
        width: 0;
    }

    body.sidebar-collapsed .sidebar-controls,
    html.sidebar-collapsed-init .sidebar-controls {
        flex-direction: column;
    }

    body.sidebar-collapsed .sidebar-link,
    html.sidebar-collapsed-init .sidebar-link {
        justify-content: center;
        padding-inline: 0.35rem;
    }

    body.sidebar-collapsed .sidebar-icon,
    html.sidebar-collapsed-init .sidebar-icon {
        height: 42px;
        width: 42px;
    }

    body.sidebar-collapsed .sidebar-user,
    html.sidebar-collapsed-init .sidebar-user {
        padding: 0.7rem 0.35rem;
    }

    body.sidebar-collapsed .sidebar-user-photo,
    html.sidebar-collapsed-init .sidebar-user-photo {
        margin-bottom: 0.65rem;
    }

    body.sidebar-collapsed .sidebar-user .btn,
    html.sidebar-collapsed-init .sidebar-user .btn {
        min-width: 42px;
        padding-inline: 0;
    }
}

[data-bs-theme="dark"] body {
    background: #101014 !important;
    color: var(--page-text, #f5f5f7);
}

[data-bs-theme="dark"] .sidebar {
    background: rgba(28, 28, 30, 0.82) !important;
    border-color: rgba(255, 255, 255, 0.14);
}

[data-bs-theme="dark"] .mobile-app-header {
    background: rgba(28, 28, 30, 0.84);
    border-color: rgba(255, 255, 255, 0.14);
}

[data-bs-theme="dark"] .mobile-menu-button {
    background: rgba(36, 36, 38, 0.92);
    border-color: rgba(255, 255, 255, 0.14);
    color: var(--page-text, #f5f5f7);
}

[data-bs-theme="dark"] .mobile-header-brand {
    color: var(--heading-text, #ffffff);
}

[data-bs-theme="dark"] .app-page-header,
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .app-card,
[data-bs-theme="dark"] .detail-card,
[data-bs-theme="dark"] .form-card,
[data-bs-theme="dark"] .stat-card,
[data-bs-theme="dark"] .dashboard-card,
[data-bs-theme="dark"] .login-card,
[data-bs-theme="dark"] .machine-card,
[data-bs-theme="dark"] .user-card,
[data-bs-theme="dark"] .summary-card,
[data-bs-theme="dark"] .modal-content {
    background: rgba(28, 28, 30, 0.92) !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.32) !important;
    color: var(--page-text, #f5f5f7);
}

[data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .bg-white,
[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] .table thead th {
    background: rgba(36, 36, 38, 0.96) !important;
    color: var(--muted-text, #a1a1a6);
}

[data-bs-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--page-text, #f5f5f7);
    --bs-table-border-color: rgba(255, 255, 255, 0.14);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.05);
    --bs-table-striped-color: var(--page-text, #f5f5f7);
    --bs-table-hover-bg: rgba(10, 132, 255, 0.16);
    --bs-table-hover-color: var(--page-text, #f5f5f7);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .input-group-text {
    background: rgba(36, 36, 38, 0.98);
    border-color: rgba(255, 255, 255, 0.16);
    color: var(--page-text, #f5f5f7);
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: rgba(245, 245, 247, 0.48);
}

[data-bs-theme="dark"] .notification-settings-panel,
[data-bs-theme="dark"] .description-box,
[data-bs-theme="dark"] .preview-box,
[data-bs-theme="dark"] .upload-zone,
[data-bs-theme="dark"] .breadcrumb-box,
[data-bs-theme="dark"] .document-thumb,
[data-bs-theme="dark"] .document-file-icon,
[data-bs-theme="dark"] .intervention-photo-card,
[data-bs-theme="dark"] .sidebar-control-button,
[data-bs-theme="dark"] .guest-theme-toggle,
[data-bs-theme="dark"] .back-to-top {
    background: rgba(36, 36, 38, 0.92);
    border-color: rgba(255, 255, 255, 0.14);
    color: var(--page-text, #f5f5f7);
}

[data-bs-theme="dark"] .alert {
    background: rgba(36, 36, 38, 0.94);
    border-color: rgba(255, 255, 255, 0.14);
    color: var(--page-text, #f5f5f7);
}

[data-bs-theme="dark"] .asset-picker-selected {
    background: rgba(10, 132, 255, 0.16);
    border-color: rgba(10, 132, 255, 0.28);
    color: var(--heading-text, #ffffff);
}

[data-bs-theme="dark"] .asset-picker-selected.is-empty {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--muted-text, #a1a1a6);
}

[data-bs-theme="dark"] .asset-picker-list,
[data-bs-theme="dark"] .asset-picker-item,
[data-bs-theme="dark"] .photo-preview-item {
    background: rgba(36, 36, 38, 0.88);
    border-color: rgba(255, 255, 255, 0.13);
}

[data-bs-theme="dark"] .asset-picker-item:hover,
[data-bs-theme="dark"] .asset-picker-item:focus-visible,
[data-bs-theme="dark"] .asset-picker-item.active {
    background: rgba(10, 132, 255, 0.18);
    border-color: rgba(10, 132, 255, 0.34);
}

[data-bs-theme="dark"] .sidebar-user {
    background: rgba(255, 255, 255, 0.08);
    color: var(--page-text, #f5f5f7);
}

[data-bs-theme="dark"] .sidebar-user-name {
    color: var(--heading-text, #ffffff) !important;
}

[data-bs-theme="dark"] .sidebar-user .btn-outline-light {
    --bs-btn-color: var(--page-text, #f5f5f7);
    --bs-btn-border-color: rgba(255, 255, 255, 0.18);
    --bs-btn-hover-bg: rgba(255, 255, 255, 0.1);
    --bs-btn-hover-color: var(--page-text, #f5f5f7);
}

[data-bs-theme="dark"] .app-footer,
[data-bs-theme="dark"] .app-footer-title {
    color: var(--page-text, #f5f5f7);
}

[data-bs-theme="dark"] .app-footer-links a {
    border-color: rgba(255, 255, 255, 0.14);
    color: var(--muted-text, #a1a1a6);
}

[data-bs-theme="dark"] code {
    color: #9ad1ff;
}

@media (max-width: 991.98px) {
    .sidebar-controls {
        margin-left: auto;
    }

    .app-footer-links {
        justify-content: flex-start;
    }
}

@media (max-width: 575.98px) {
    .app-footer-links {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .app-footer-links a {
        text-align: center;
        width: 100%;
    }

    .back-to-top {
        bottom: 0.85rem;
        right: 0.85rem;
    }
}
