body {
    background: var(--tm-bg);
    color: var(--tm-text);
    font-family: var(--tm-font-sans);
    font-size: var(--tm-font-size-body);
    line-height: 1.5;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6,
.card-title,
.modal-title {
    color: var(--tm-heading);
    font-family: var(--tm-font-sans);
    font-weight: var(--tm-font-weight-bold);
    letter-spacing: 0;
    line-height: var(--tm-line-height-tight);
}

a {
    color: var(--tm-primary);
}

a:hover {
    color: var(--tm-primary-hover);
}

label,
.form-label,
.col-form-label {
    color: var(--tm-text);
    font-weight: var(--tm-font-weight-semibold);
    letter-spacing: 0;
}

.small,
small {
    letter-spacing: 0;
}

.text-muted {
    color: var(--tm-muted) !important;
}

.text-primary {
    color: var(--tm-primary) !important;
}

.text-success {
    color: var(--tm-success) !important;
}

.text-warning {
    color: var(--tm-warning) !important;
}

.text-danger {
    color: var(--tm-danger) !important;
}

.text-info {
    color: var(--tm-info) !important;
}

.bg-secondary {
    background-color: var(--tm-neutral) !important;
}

.bg-dark {
    background-color: var(--tm-nav) !important;
}

.bg-light {
    background-color: var(--tm-surface-muted) !important;
}

.bg-primary-subtle {
    background-color: var(--tm-primary-soft) !important;
}

.bg-success-subtle {
    background-color: var(--tm-success-soft) !important;
}

.bg-warning-subtle {
    background-color: var(--tm-warning-soft) !important;
}

.bg-danger-subtle {
    background-color: var(--tm-danger-soft) !important;
}

.bg-info-subtle {
    background-color: var(--tm-info-soft) !important;
}

.text-bg-primary {
    color: var(--tm-on-accent) !important;
    background-color: var(--tm-primary) !important;
}

.text-bg-secondary {
    color: var(--tm-on-accent) !important;
    background-color: var(--tm-neutral) !important;
}

.text-bg-success {
    color: var(--tm-on-accent) !important;
    background-color: var(--tm-success) !important;
}

.text-bg-warning {
    color: var(--tm-on-accent) !important;
    background-color: var(--tm-warning) !important;
}

.text-bg-danger {
    color: var(--tm-on-accent) !important;
    background-color: var(--tm-danger) !important;
}

.text-bg-info {
    color: var(--tm-on-accent) !important;
    background-color: var(--tm-info) !important;
}

.text-bg-dark {
    color: var(--tm-on-accent) !important;
    background-color: var(--tm-nav) !important;
}

.text-bg-light {
    color: var(--tm-text-soft) !important;
    background-color: var(--tm-surface-soft) !important;
}

.border,
.border-top,
.border-end,
.border-bottom,
.border-start {
    border-color: var(--tm-border) !important;
}

.card {
    border-color: var(--tm-border-soft);
    border-radius: var(--tm-radius);
    background: var(--tm-surface);
    box-shadow: var(--tm-shadow-sm);
}

.card-header,
.modal-header,
.modal-footer {
    border-color: var(--tm-border-soft);
    background: var(--tm-surface);
}

.dropdown-menu {
    border-color: var(--tm-border);
    border-radius: var(--tm-radius);
    box-shadow: var(--tm-shadow-md);
}

.dropdown-item {
    color: var(--tm-text);
    font-weight: var(--tm-font-weight-medium);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--tm-primary-soft);
    color: var(--tm-primary-hover);
}

.btn {
    border-radius: 0.425rem;
    font-family: var(--tm-font-sans);
    font-weight: var(--tm-font-weight-semibold);
    letter-spacing: 0;
    min-height: 2.35rem;
}

.btn-sm {
    min-height: 2rem;
}

.btn-primary {
    --bs-btn-bg: var(--tm-primary);
    --bs-btn-border-color: var(--tm-primary);
    --bs-btn-hover-bg: var(--tm-primary-hover);
    --bs-btn-hover-border-color: var(--tm-primary-hover);
    --bs-btn-active-bg: var(--tm-primary-hover);
    --bs-btn-active-border-color: var(--tm-primary-hover);
    --bs-btn-disabled-bg: var(--tm-primary-disabled);
    --bs-btn-disabled-border-color: var(--tm-primary-disabled);
}

.btn-success {
    --bs-btn-bg: var(--tm-success);
    --bs-btn-border-color: var(--tm-success);
    --bs-btn-hover-bg: var(--tm-success-hover);
    --bs-btn-hover-border-color: var(--tm-success-hover);
}

.btn-warning {
    --bs-btn-bg: var(--tm-warning);
    --bs-btn-border-color: var(--tm-warning);
    --bs-btn-hover-bg: var(--tm-warning-hover);
    --bs-btn-hover-border-color: var(--tm-warning-hover);
    --bs-btn-color: var(--tm-on-accent);
    --bs-btn-hover-color: var(--tm-on-accent);
}

.btn-danger {
    --bs-btn-bg: var(--tm-danger);
    --bs-btn-border-color: var(--tm-danger);
    --bs-btn-hover-bg: var(--tm-danger-hover);
    --bs-btn-hover-border-color: var(--tm-danger-hover);
}

.btn-info {
    --bs-btn-bg: var(--tm-info);
    --bs-btn-border-color: var(--tm-info);
    --bs-btn-hover-bg: var(--tm-info-hover);
    --bs-btn-hover-border-color: var(--tm-info-hover);
    --bs-btn-color: var(--tm-on-accent);
    --bs-btn-hover-color: var(--tm-on-accent);
}

.btn-outline-primary {
    --bs-btn-color: var(--tm-primary);
    --bs-btn-border-color: var(--tm-primary);
    --bs-btn-hover-bg: var(--tm-primary);
    --bs-btn-hover-border-color: var(--tm-primary);
}

.btn-outline-secondary {
    --bs-btn-color: var(--tm-text-soft);
    --bs-btn-border-color: var(--tm-border);
    --bs-btn-hover-color: var(--tm-text-strong);
    --bs-btn-hover-bg: var(--tm-surface-soft);
    --bs-btn-hover-border-color: var(--tm-border-strong);
}

.form-control,
.form-select,
.input-group-text {
    border-color: var(--tm-border);
    border-radius: 0.425rem;
    color: var(--tm-text);
    font-family: var(--tm-font-sans);
}

.form-control,
.form-select {
    background-color: var(--tm-surface);
}

.form-control:focus,
.form-select:focus,
.btn:focus-visible,
.dropdown-item:focus,
.page-link:focus {
    border-color: var(--tm-primary);
    box-shadow: 0 0 0 0.18rem var(--tm-focus-ring);
}

.form-control::placeholder {
    color: var(--tm-placeholder);
}

.form-check-input[data-picker-check],
.form-check-input[data-link-check] {
    --bs-form-check-bg: #fff;
    background-color: #fff;
    border: 2px solid var(--tm-primary);
    box-shadow: 0 0 0 1px rgba(23, 72, 124, 0.12);
    cursor: pointer;
    height: 1.15rem;
    width: 1.15rem;
}

.form-check-input[data-picker-check]:hover,
.form-check-input[data-link-check]:hover {
    border-color: var(--tm-primary-hover);
    box-shadow: 0 0 0 0.18rem var(--tm-focus-ring);
}

.form-check-input[data-picker-check]:focus,
.form-check-input[data-link-check]:focus {
    border-color: var(--tm-primary);
    box-shadow: 0 0 0 0.2rem var(--tm-focus-ring);
}

.form-check-input[data-picker-check]:checked,
.form-check-input[data-link-check]:checked {
    background-color: var(--tm-primary);
    border-color: var(--tm-primary);
}

.input-group-text {
    background-color: var(--tm-surface-muted);
    color: var(--tm-muted);
    font-weight: var(--tm-font-weight-semibold);
}

.table {
    --bs-table-color: var(--tm-text);
    --bs-table-bg: var(--tm-surface);
    --bs-table-border-color: var(--tm-border-soft);
    color: var(--tm-text);
    font-size: var(--tm-font-size-table);
}

.table thead th {
    background: var(--tm-surface-muted);
    color: var(--tm-text);
    font-size: var(--tm-font-size-sm);
    font-weight: var(--tm-font-weight-extrabold);
    letter-spacing: 0;
}

.table-hover > tbody > tr:hover > * {
    --bs-table-accent-bg: var(--tm-surface-tint);
}

.badge {
    border-radius: 999px;
    font-weight: var(--tm-font-weight-bold);
    letter-spacing: 0;
}

.alert {
    border-color: var(--tm-border);
    border-radius: var(--tm-radius);
}

.page-link {
    color: var(--tm-primary);
    border-color: var(--tm-border);
}

.active > .page-link,
.page-link.active {
    background-color: var(--tm-primary);
    border-color: var(--tm-primary);
}

@keyframes tm-content-enter {
    from {
        opacity: 0;
        transform: translateY(0.35rem);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.tm-app-shell {
    min-height: 100vh;
}

.tm-auth-shell {
    min-height: 100vh;
    background: linear-gradient(135deg, color-mix(in srgb, var(--tm-nav) 18%, var(--tm-bg)), color-mix(in srgb, var(--tm-surface-tint) 70%, var(--tm-bg)) 100%);
}

.tm-auth-panel {
    max-width: 440px;
    width: 100%;
}

.tm-sidebar {
    --bs-offcanvas-width: var(--tm-sidebar-width);
    --bs-offcanvas-bg: var(--tm-primary);
    --bs-offcanvas-color: var(--tm-nav-text);
    flex: 0 0 var(--tm-sidebar-width);
    width: var(--tm-sidebar-width);
    max-width: var(--tm-sidebar-width);
    min-width: var(--tm-sidebar-width);
    flex-shrink: 0;
    background: var(--tm-nav);
    background-color: var(--tm-nav);
    color: var(--tm-nav-text);
    display: flex;
    flex-direction: column;
    transition:
        flex-basis 0.18s ease,
        width 0.18s ease,
        min-width 0.18s ease,
        max-width 0.18s ease;
}

.tm-sidebar .offcanvas-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.tm-sidebar-brand-header {
    align-items: center;
    flex: 0 0 auto;
    gap: 0.75rem;
    justify-content: space-between;
    min-height: 5.25rem;
    padding: 1rem 1rem 0.75rem;
}

.tm-sidebar-fixed-controls {
    flex: 0 0 auto;
}

.tm-nav-brand {
    min-width: 0;
    line-height: 1.1;
}

.tm-nav-brand-icon {
    flex: 0 0 auto;
}

.tm-nav-brand-logo {
    flex: 0 0 auto;
    width: 2.35rem;
    height: 2.35rem;
    padding: 0.15rem;
    border-radius: 0.35rem;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.96);
}

.tm-nav-brand-copy {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.tm-nav-brand-title {
    color: var(--tm-nav-text);
    font-size: 1.15rem;
    font-weight: var(--tm-font-weight-extrabold);
    line-height: 1.1;
}

.tm-nav-brand-subtitle {
    color: var(--tm-nav-muted);
    font-size: var(--tm-font-size-xs);
    font-weight: var(--tm-font-weight-semibold);
    line-height: 1.15;
}

.tm-sidebar-collapse-toggle {
    align-items: center;
    background: var(--tm-nav-control-bg);
    border: 1px solid var(--tm-nav-control-border);
    border-radius: 0.45rem;
    color: var(--tm-nav-text);
    display: inline-flex;
    flex: 0 0 auto;
    height: 2rem;
    justify-content: center;
    padding: 0;
    transition:
        background-color 0.16s ease,
        border-color 0.16s ease,
        transform 0.16s ease;
    width: 2rem;
}

.tm-sidebar-collapse-toggle:hover,
.tm-sidebar-collapse-toggle:focus {
    background: var(--tm-nav-active-bg);
    border-color: var(--tm-nav-control-border-strong);
    color: var(--tm-nav-text);
    outline: none;
}

.tm-sidebar-collapse-toggle:focus-visible {
    box-shadow: 0 0 0 0.15rem var(--tm-focus-ring);
}

.tm-sidebar-expand-icon {
    display: none;
}

.tm-sidebar .nav-link {
    align-items: center;
    color: var(--tm-nav-link);
    border-radius: 0.5rem;
    display: flex;
    max-height: 2.75rem;
    min-height: 2.5rem;
    overflow: hidden;
    white-space: nowrap;
    transform: translateX(0);
    transition:
        color 0.16s ease,
        background-color 0.16s ease,
        opacity 0.16s ease,
        transform 0.16s ease,
        max-height 0.18s ease,
        padding-top 0.18s ease,
        padding-bottom 0.18s ease;
}

.tm-sidebar .nav-link > .bi,
.tm-nav-reset > .bi {
    flex: 0 0 auto;
}

.tm-nav-label {
    display: inline-block;
    line-height: 1.25;
    min-width: 0;
    white-space: nowrap;
}

.tm-sidebar .nav-link:hover,
.tm-sidebar .nav-link.active {
    color: var(--tm-nav-text);
    background: var(--tm-nav-active-bg);
}

.tm-nav-group,
.tm-nav-most-used {
    display: grid;
    gap: 0.25rem;
    margin-top: 0.35rem;
}

.tm-nav-group-toggle {
    align-items: center;
    background: var(--tm-nav-control-bg);
    border: 1px solid var(--tm-nav-control-border-muted);
    border-radius: 0.5rem;
    color: var(--tm-nav-link-strong);
    display: flex;
    font-size: var(--tm-font-size-xs);
    font-weight: var(--tm-font-weight-bold);
    justify-content: space-between;
    letter-spacing: 0;
    line-height: 1.2;
    padding: 0.55rem 0.65rem;
    text-align: left;
    text-transform: uppercase;
    width: 100%;
}

.tm-nav-group-title {
    align-items: center;
    display: inline-flex;
    min-width: 0;
}

.tm-nav-group-toggle:hover,
.tm-nav-group-toggle:focus {
    background: var(--tm-nav-active-bg);
    color: var(--tm-nav-text);
    outline: none;
}

.tm-nav-group-toggle[aria-expanded="true"] {
    background: var(--tm-nav-control-bg-muted);
    border-color: var(--tm-nav-control-border);
    color: var(--tm-nav-text);
}

.tm-nav-group-toggle:focus-visible {
    box-shadow: 0 0 0 0.15rem var(--tm-focus-ring);
}

.tm-nav-group-chevron {
    flex: 0 0 auto;
    transition: transform 0.16s ease;
}

.tm-nav-group-toggle[aria-expanded="true"] .tm-nav-group-chevron {
    transform: rotate(180deg);
}

.tm-nav-group-links {
    display: grid;
    gap: 0.15rem;
}

.tm-nav-group-links[hidden] {
    display: none;
}

.tm-nav-most-used {
    border: 1px solid color-mix(in srgb, var(--tm-nav-control-border) 72%, var(--tm-nav));
    border-radius: 0.625rem;
    margin-bottom: 0.25rem;
    padding: 0.35rem;
}

.tm-nav-most-used .nav-link {
    color: var(--tm-nav-text);
}

.tm-nav-reset {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 0.5rem;
    color: var(--tm-nav-muted);
    display: flex;
    font-size: var(--tm-font-size-xs);
    font-weight: var(--tm-font-weight-semibold);
    margin-top: 0.5rem;
    padding: 0.55rem 0.65rem;
    text-align: left;
    white-space: nowrap;
    width: 100%;
}

.tm-nav-reset:hover,
.tm-nav-reset:focus {
    background: var(--tm-nav-active-bg);
    color: var(--tm-nav-text);
    outline: none;
}

.tm-nav-reset:focus-visible {
    box-shadow: 0 0 0 0.15rem var(--tm-focus-ring);
}

.tm-nav-utility-toolbar {
    align-items: center;
    background: color-mix(in srgb, var(--tm-nav) 72%, var(--tm-primary));
    border-top: 1px solid var(--tm-nav-control-border);
    display: flex;
    flex: 0 0 auto;
    gap: 0.35rem;
    min-height: 4rem;
    padding: 0.55rem 0.75rem calc(0.55rem + env(safe-area-inset-bottom));
    position: relative;
    z-index: 6;
}

.tm-nav-utility-item {
    display: block;
    flex: 1 1 0;
    margin: 0;
    min-width: 0;
    position: static;
}

.tm-nav-utility-item.tm-nav-most-used {
    border: 0;
    margin: 0;
    padding: 0;
}

.tm-sidebar .tm-nav-utility-trigger,
.tm-sidebar .tm-nav-utility-action {
    align-items: center;
    background: var(--tm-nav-control-bg);
    border: 1px solid var(--tm-nav-control-border-muted);
    border-radius: 0.45rem;
    color: var(--tm-nav-link-strong);
    display: flex;
    height: 2.75rem;
    justify-content: center;
    margin: 0;
    min-height: 2.75rem;
    padding: 0;
    width: 100%;
}

.tm-sidebar .tm-nav-utility-trigger:hover,
.tm-sidebar .tm-nav-utility-trigger:focus,
.tm-sidebar .tm-nav-utility-trigger[aria-expanded="true"],
.tm-sidebar .tm-nav-utility-action:hover,
.tm-sidebar .tm-nav-utility-action:focus {
    background: var(--tm-nav-active-bg);
    border-color: var(--tm-nav-control-border-strong);
    color: var(--tm-nav-text);
}

.tm-sidebar .tm-nav-utility-trigger:focus-visible,
.tm-sidebar .tm-nav-utility-action:focus-visible {
    box-shadow: 0 0 0 0.15rem var(--tm-focus-ring);
    outline: 0;
}

.tm-nav-utility-trigger .tm-nav-label,
.tm-nav-utility-trigger .tm-nav-group-chevron,
.tm-nav-utility-action .tm-nav-label {
    display: none;
}

.tm-nav-utility-trigger .tm-nav-group-title {
    justify-content: center;
}

.tm-sidebar .tm-nav-utility-trigger .bi,
.tm-sidebar .tm-nav-utility-action .bi {
    font-size: 1.05rem;
    margin-right: 0 !important;
}

.tm-nav-utility-item:has(.nav-link.active) .tm-nav-utility-trigger {
    background: var(--tm-nav-active-bg);
    border-color: var(--tm-nav-control-border-strong);
    color: var(--tm-nav-text);
}

.tm-nav-utility-popover {
    background: var(--tm-nav);
    border: 1px solid var(--tm-nav-control-border);
    border-radius: 0.5rem;
    bottom: calc(100% + 0.5rem);
    box-shadow: var(--tm-shadow-lg);
    gap: 0.15rem;
    left: 0.65rem;
    max-height: min(60vh, 32rem);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0.45rem;
    position: absolute;
    right: 0.65rem;
    scrollbar-gutter: stable;
    z-index: 1080;
}

.tm-nav-utility-popover-heading {
    color: var(--tm-nav-muted);
    font-size: var(--tm-font-size-xs);
    font-weight: var(--tm-font-weight-bold);
    letter-spacing: 0;
    padding: 0.35rem 0.55rem 0.45rem;
    text-transform: uppercase;
}

.tm-nav-utility-empty {
    color: var(--tm-nav-muted);
    font-size: var(--tm-font-size-sm);
    line-height: 1.4;
    padding: 0.7rem 0.55rem;
}

.tm-nav-utility-popover .nav-link {
    min-height: 2.35rem;
}

.tm-sidebar .nav-link.tm-nav-link-filtered {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-0.35rem);
}

.tm-sidebar-scopes .input-group-text,
.tm-sidebar-scopes .form-select {
    border-color: var(--tm-nav-control-border);
    background-color: var(--tm-nav-control-bg);
    color: var(--tm-nav-link-strong);
}

.tm-sidebar-scopes .input-group-text {
    min-width: 4.5rem;
    justify-content: center;
    color: var(--tm-nav-link-soft);
}

.tm-sidebar-scopes .form-select {
    --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23d7e3f0' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

.tm-sidebar-scopes .form-select:focus {
    background-color: var(--tm-nav-control-bg);
    border-color: var(--tm-nav-control-border-strong);
    color: var(--tm-nav-link-strong);
    box-shadow: 0 0 0 0.15rem var(--tm-focus-ring);
}

.tm-sidebar-scopes .form-select:disabled {
    color: var(--tm-nav-link-disabled);
    background-color: var(--tm-nav-control-bg-muted);
    border-color: var(--tm-nav-control-border-muted);
}

.tm-sidebar-scopes .form-select option {
    color: var(--tm-heading);
    background: var(--tm-surface);
}

.tm-content {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

.tm-topbar {
    min-height: 4.75rem;
}

.tm-topbar .container-fluid {
    min-width: 0;
}

.tm-topbar .container-fluid,
main#main-content {
    width: 100%;
    max-width: var(--tm-content-max-width);
    margin-right: auto;
    margin-left: auto;
}

.tm-topbar-actions {
    flex: 0 1 auto;
    min-width: 0;
    margin-left: auto;
}

.min-w-0 {
    min-width: 0;
}

.tm-skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 1080;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    background: var(--tm-surface);
    box-shadow: var(--tm-shadow-popover);
}

.alert {
    animation: tm-content-enter 0.18s ease-out;
}

.btn:not(.btn-link) {
    transition:
        background-color 0.16s ease,
        border-color 0.16s ease,
        color 0.16s ease,
        box-shadow 0.16s ease,
        transform 0.16s ease;
}

.btn:not(.btn-link):hover,
.btn:not(.btn-link):focus-visible {
    transform: translateY(-1px);
}

.modal .btn:not(.btn-link):hover,
.modal .btn:not(.btn-link):focus-visible {
    transform: none;
}

.tm-page-title {
    font-size: var(--tm-font-size-title);
    font-weight: var(--tm-font-weight-bold);
    line-height: var(--tm-line-height-tight);
}

.tm-breadcrumb {
    --bs-breadcrumb-divider-color: var(--tm-text-muted);
    font-size: var(--tm-font-size-sm);
}

.tm-breadcrumb a {
    color: var(--tm-muted);
    text-decoration: none;
}

.tm-breadcrumb a:hover {
    color: var(--tm-primary);
    text-decoration: underline;
}

.tm-user-menu {
    max-width: 14rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.tm-user-menu::after {
    flex: 0 0 auto;
}

.tm-user-customer-code {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.55rem;
    padding: 0.38rem 0.5rem;
    border-left: 0.2rem solid var(--tm-primary);
    background: var(--tm-primary-soft);
    color: var(--tm-text-muted);
    font-size: 0.68rem;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.045em;
}

.tm-user-customer-code strong {
    color: var(--tm-primary);
    font-family: var(--bs-font-monospace);
    font-size: 0.76rem;
    letter-spacing: 0.035em;
    overflow-wrap: anywhere;
}

.tm-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 1px solid var(--tm-border);
    border-radius: 50%;
    background: var(--tm-primary-soft);
    color: var(--tm-primary);
    font-weight: var(--tm-font-weight-extrabold);
    line-height: 1;
    object-fit: cover;
    overflow: hidden;
}

.tm-user-avatar-xs {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.68rem;
}

.tm-user-avatar-sm {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.72rem;
}

.tm-user-avatar-md {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 0.9rem;
}

.tm-user-avatar-lg {
    width: 4rem;
    height: 4rem;
    font-size: 1.25rem;
}

.tm-user-avatar-xl {
    width: 8rem;
    height: 8rem;
    font-size: 2.25rem;
}

.tm-user-avatar-fallback {
    text-transform: uppercase;
}

.tm-topbar-document-link,
.tm-topbar-todo-link {
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.tm-topbar-document-link.active,
.tm-topbar-todo-link.active {
    color: var(--tm-on-accent);
    background-color: var(--tm-primary);
    border-color: var(--tm-primary);
}

.tm-topbar-todo-badge {
    position: absolute;
    top: -0.45rem;
    right: -0.45rem;
    min-width: 1.25rem;
    height: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.35rem;
    border: 2px solid var(--tm-surface);
    font-size: 0.68rem;
    line-height: 1;
}

.tm-unit-filter {
    min-width: 15rem;
}

.tm-unit-filter-form {
    flex: 0 1 auto;
    max-width: 18rem;
}

.tm-kpi-card {
    border: 0;
    border-radius: 0.75rem;
    box-shadow: var(--tm-shadow-sm);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.tm-kpi-card:hover,
.tm-kpi-card:focus-within {
    box-shadow: var(--tm-shadow-hover);
    transform: translateY(-1px);
}

.tm-dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.tm-kpi-card.tm-dashboard-kpi-card {
    --tm-dashboard-kpi-accent: var(--tm-primary);
    min-width: 0;
    overflow: hidden;
    border-left: 3px solid var(--tm-dashboard-kpi-accent);
    border-radius: 0.6rem;
}

.tm-dashboard-kpi-card.tm-dashboard-kpi-success {
    --tm-dashboard-kpi-accent: var(--tm-success);
}

.tm-dashboard-kpi-card.tm-dashboard-kpi-danger {
    --tm-dashboard-kpi-accent: var(--tm-danger);
}

.tm-dashboard-kpi-card.tm-dashboard-kpi-warning {
    --tm-dashboard-kpi-accent: var(--tm-warning);
}

.tm-dashboard-kpi-card.tm-dashboard-kpi-secondary {
    --tm-dashboard-kpi-accent: var(--tm-muted);
}

.tm-dashboard-kpi-card.tm-dashboard-kpi-info {
    --tm-dashboard-kpi-accent: var(--tm-info);
}

.tm-dashboard-kpi-card .card-body {
    min-height: 4.5rem;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
}

.tm-dashboard-kpi-copy {
    min-width: 0;
}

.tm-dashboard-kpi-label {
    color: var(--tm-text-muted);
    font-size: 0.72rem;
    font-weight: var(--tm-font-weight-bold);
    line-height: 1.15;
}

.tm-dashboard-kpi-value {
    margin-top: 0.16rem;
    color: var(--tm-heading);
    font-size: 1.35rem;
    font-variant-numeric: tabular-nums;
    font-weight: var(--tm-font-weight-extrabold);
    letter-spacing: -0.02em;
    line-height: 1;
}

.tm-icon-box.tm-dashboard-kpi-icon {
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    border-radius: 0.5rem;
    font-size: 1rem;
}

.tm-dashboard-kpi-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.18rem;
    margin-top: 0.35rem;
}

.tm-dashboard-kpi-badges .badge {
    padding: 0.18rem 0.3rem;
    font-size: 0.6rem;
    line-height: 1.1;
}

@media (min-width: 768px) {
    .tm-dashboard-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .tm-dashboard-kpi-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.tm-icon-box {
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
}

.tm-color-swatch,
.tm-status-dot {
    width: 0.85rem;
    height: 0.85rem;
    display: inline-block;
    border-radius: 50%;
    border: 1px solid var(--tm-border-muted);
    background: var(--tm-status-color, var(--tm-muted));
}

.tm-status-badge {
    border: 1px solid var(--tm-border-muted);
    background: color-mix(in srgb, var(--tm-status-color, var(--tm-muted)) 14%, var(--tm-surface));
    color: var(--tm-text);
}

.card-body > form,
.card-body form:not(.d-inline) {
    max-width: 100%;
}

.tm-report-columns-button {
    min-width: 7.5rem;
}

form.row.g-3,
form .modal-body > .row.g-3,
form > .row.g-3,
.tm-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.25rem 1.25rem;
    align-items: start;
    margin-left: 0;
    margin-right: 0;
    min-width: 0;
}

form.row.g-3 > [class*="col-"],
form .modal-body > .row.g-3 > [class*="col-"],
form > .row.g-3 > [class*="col-"],
.tm-form-grid > [class*="col-"],
.tm-form-grid > .tm-form-field {
    width: auto;
    max-width: none;
    min-width: 0;
    padding-left: 0;
    padding-right: 0;
}

form.row.g-3 > input[type="hidden"],
form > .row.g-3 > input[type="hidden"],
form .modal-body > .row.g-3 > input[type="hidden"],
.tm-form-grid > input[type="hidden"] {
    display: none;
}

form.row.g-3 > .col-12,
form.row.g-3 > [class*="col-"]:has(> textarea),
form.row.g-3 > [class*="col-"]:has(> select[multiple]),
form.row.g-3 > [class*="col-"]:has(> .alert),
form.row.g-3 > [class*="col-"]:has(> .table-responsive),
form.row.g-3 > [class*="col-"]:has(> .tm-extra-fields),
form.row.g-3 > [class*="col-"]:has(> .d-flex.justify-content-between),
form.row.g-3 > [class*="col-"]:has(> .btn),
form .modal-body > .row.g-3 > .col-12,
form .modal-body > .row.g-3 > [class*="col-"]:has(> textarea),
form .modal-body > .row.g-3 > [class*="col-"]:has(> select[multiple]),
form .modal-body > .row.g-3 > [class*="col-"]:has(> .btn),
form > .row.g-3 > .col-12,
form > .row.g-3 > [class*="col-"]:has(> textarea),
form > .row.g-3 > [class*="col-"]:has(> select[multiple]),
form > .row.g-3 > [class*="col-"]:has(> .alert),
form > .row.g-3 > [class*="col-"]:has(> .table-responsive),
form > .row.g-3 > [class*="col-"]:has(> .tm-extra-fields),
form > .row.g-3 > [class*="col-"]:has(> .d-flex.justify-content-between),
form > .row.g-3 > [class*="col-"]:has(> .btn),
.tm-form-grid > .col-12,
.tm-form-grid > .col-span-2,
.tm-form-grid > .tm-form-wide,
.tm-form-grid > [class*="col-"]:has(> textarea),
.tm-form-grid > [class*="col-"]:has(> select[multiple]),
.tm-form-grid > [class*="col-"]:has(> .alert),
.tm-form-grid > [class*="col-"]:has(> .table-responsive),
.tm-form-grid > [class*="col-"]:has(> .tm-extra-fields),
.tm-form-grid > [class*="col-"]:has(> .d-flex.justify-content-between),
.tm-form-grid > [class*="col-"]:has(> .btn) {
    grid-column: 1 / -1;
}

form .form-label {
    margin-bottom: 0.35rem;
    color: var(--tm-text-soft);
    font-size: var(--tm-font-size-label);
    font-weight: var(--tm-font-weight-semibold);
}

form .form-text,
form .invalid-feedback {
    font-size: var(--tm-font-size-sm);
}

form .form-control:not(.form-control-sm),
form .form-select:not(.form-select-sm),
form .input-group:not(.input-group-sm) > .form-control,
form .input-group:not(.input-group-sm) > .form-select,
form .input-group:not(.input-group-sm) > .input-group-text {
    min-height: 2.5rem;
}

form textarea.form-control {
    min-height: 6.5rem;
}

form select[multiple].form-select {
    min-height: 9rem;
}

form .form-control[readonly],
form .form-control.bg-light {
    background-color: var(--tm-surface-muted) !important;
    border-color: var(--tm-border-subtle);
    color: var(--tm-text-subtle);
}

.tm-search-results {
    z-index: 1050;
    max-height: 14rem;
    overflow-y: auto;
}

.tm-stacked-form {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.tm-form-section {
    padding: 1.25rem;
    border: 1px solid var(--tm-border-muted);
    border-radius: 0.5rem;
    background: var(--tm-surface);
    box-shadow: var(--tm-shadow-xs);
    min-width: 0;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.tm-form-section + .tm-form-section {
    margin-top: 0;
}

.tm-form-section > .d-flex:first-child {
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--tm-border-soft);
}

.tm-form-section > .d-flex .bi {
    width: 1.5rem;
    height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    background: var(--tm-primary-soft);
}

.tm-form-section-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.85rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--tm-border-soft);
}

.tm-form-section-header h2 {
    margin: 0;
    color: var(--tm-text-strong);
    font-size: 1rem;
    font-weight: var(--tm-font-weight-extrabold);
}

.tm-form-section-header p {
    margin: 0.2rem 0 0;
    color: var(--tm-text-muted);
    font-size: var(--tm-font-size-label);
}

.tm-table-actions {
    width: 1%;
    white-space: nowrap;
}

.tm-extra-fields {
    display: grid;
    gap: 0.75rem;
}

.tm-extra-field-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: end;
}

.tm-extra-field-remove {
    width: 2.375rem;
    height: 2.375rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tm-photo-thumb,
.tm-photo-preview,
.tm-photo-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--tm-border-subtle);
    background: var(--tm-surface-muted);
    color: var(--tm-text-muted);
}

.tm-photo-thumb {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    object-fit: cover;
}

.tm-photo-thumb-empty {
    font-size: 1.1rem;
}

.tm-photo-preview-wrap {
    min-height: 9rem;
}

.tm-photo-preview,
.tm-photo-placeholder {
    width: 9rem;
    height: 9rem;
    border-radius: 0.5rem;
}

.tm-photo-preview {
    object-fit: cover;
}

.tm-photo-placeholder {
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.82rem;
}

.tm-photo-placeholder .bi {
    font-size: 1.5rem;
}

.tm-user-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.tm-user-summary-card {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--tm-border-muted);
    border-radius: 0.5rem;
    background: var(--tm-surface);
    box-shadow: var(--tm-shadow-xs);
}

.tm-user-summary-card span {
    display: block;
    color: var(--tm-text-muted);
    font-size: var(--tm-font-size-sm);
    font-weight: var(--tm-font-weight-bold);
    text-transform: uppercase;
}

.tm-user-summary-card strong {
    display: block;
    margin-top: 0.35rem;
    color: var(--tm-text-strong);
    font-size: 1.45rem;
    line-height: 1;
}

.tm-user-filter-grid {
    display: grid;
    grid-template-columns: minmax(14rem, 1.6fr) minmax(9rem, 1fr) minmax(11rem, 1.1fr) minmax(11rem, 1.1fr) auto;
    gap: 0.75rem;
    align-items: end;
}

.tm-user-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.tm-user-name-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 14rem;
}

.tm-user-table td {
    vertical-align: middle;
}

.tm-user-unit-list {
    display: inline-block;
    max-width: 20rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.tm-user-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 0;
}

.tm-user-detail-grid > div {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--tm-border-muted);
    border-radius: 0.5rem;
    background: var(--tm-surface-muted);
}

.tm-user-detail-grid > .col-span-2 {
    grid-column: 1 / -1;
}

.tm-user-detail-grid dt {
    color: var(--tm-text-muted);
    font-size: 0.76rem;
    font-weight: var(--tm-font-weight-extrabold);
    text-transform: uppercase;
}

.tm-user-detail-grid dd {
    margin: 0.25rem 0 0;
    color: var(--tm-text-strong);
    font-weight: var(--tm-font-weight-semibold);
}

.tm-attachment-rows {
    display: grid;
    gap: 0.75rem;
}

.tm-attachment-row {
    display: grid;
    grid-template-columns: minmax(10rem, 0.9fr) minmax(12rem, 1fr) minmax(12rem, 1fr) auto;
    gap: 0.75rem;
    align-items: end;
}

.tm-document-library {
    position: relative;
}

.tm-doc-layout {
    display: grid;
    grid-template-columns: minmax(13rem, 14.5rem) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.tm-doc-rail,
.tm-doc-table-shell,
.tm-doc-metric,
.tm-doc-inspector,
.tm-doc-grid-item {
    border: 1px solid var(--tm-border-subtle);
    background: var(--tm-surface);
    box-shadow: var(--tm-shadow-xs);
}

.tm-doc-rail {
    position: sticky;
    top: 5.75rem;
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
}

.tm-doc-brand-title {
    color: var(--tm-primary);
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.1;
}

.tm-doc-brand-subtitle {
    color: var(--tm-muted);
    font-size: 0.75rem;
    font-weight: 650;
    letter-spacing: 0;
}

.tm-doc-upload {
    min-height: 2.5rem;
    font-weight: 700;
}

.tm-doc-filter-nav {
    display: grid;
    gap: 0.35rem;
}

.tm-doc-filter {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: 0;
    border-radius: 0.5rem;
    padding: 0.65rem 0.75rem;
    background: transparent;
    color: var(--tm-text-soft);
    font-size: 0.86rem;
    font-weight: var(--tm-font-weight-semibold);
    text-align: left;
    text-decoration: none;
    transition: background-color 0.16s ease, color 0.16s ease;
}

.tm-doc-filter:hover,
.tm-doc-filter.active {
    background: var(--tm-primary-soft);
    color: var(--tm-primary);
}

.tm-doc-main {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.tm-doc-main > *,
.tm-doc-action-row,
.tm-doc-filter-grid,
.tm-doc-metrics,
.tm-doc-folder-directory,
.tm-doc-table-shell {
    min-width: 0;
}

.tm-doc-toolbar {
    display: grid;
    gap: 1rem;
    padding: 0.25rem 0 0;
}

.tm-doc-title-row,
.tm-doc-action-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tm-doc-title-row {
    justify-content: space-between;
}

.tm-doc-title-row h2 {
    margin: 0;
    color: var(--tm-primary);
    font-size: 1.05rem;
    font-weight: 800;
    white-space: nowrap;
}

.tm-doc-search {
    position: relative;
    flex: 1 1 28rem;
    max-width: 34rem;
}

.tm-doc-search .bi {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    z-index: 2;
    color: var(--tm-text-muted);
    transform: translateY(-50%);
}

.tm-doc-search .form-control {
    min-height: 2.5rem;
    padding-left: 2.45rem;
    border-color: var(--tm-border-strong);
    background: var(--tm-surface-muted);
}

.tm-doc-action-row {
    flex-wrap: wrap;
    justify-content: space-between;
}

.tm-doc-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.25rem;
    border: 1px solid var(--tm-border-subtle);
    border-radius: 0.5rem;
    background: var(--tm-surface);
}

.tm-doc-tabs a,
.tm-doc-view-toggle button {
    border: 0;
    border-radius: 0.375rem;
    background: transparent;
    color: var(--tm-text-soft);
    font-size: var(--tm-font-size-sm);
    font-weight: var(--tm-font-weight-bold);
    min-height: 2rem;
    padding: 0.35rem 0.85rem;
    text-decoration: none;
}

.tm-doc-tabs a.active,
.tm-doc-view-toggle button.active {
    background: var(--tm-primary-soft-strong);
    color: var(--tm-primary);
}

.tm-doc-filter-grid {
    display: grid;
    grid-template-columns: minmax(7.5rem, 1fr) minmax(7.5rem, 1fr) minmax(8rem, 1.1fr) minmax(8rem, 1.1fr) minmax(10rem, 1.25fr) auto auto;
    gap: 0.5rem;
    align-items: center;
    flex: 1 1 34rem;
}

.tm-doc-filter-grid .form-control,
.tm-doc-filter-grid .form-select,
.tm-doc-filter-grid .btn {
    min-height: 2.25rem;
    font-size: 0.82rem;
}

.tm-doc-view-toggle {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 0.5rem;
    background: var(--tm-neutral-soft);
}

.tm-doc-view-toggle button {
    width: 2.25rem;
    padding: 0;
    font-size: 1rem;
}

.tm-doc-table-shell {
    position: relative;
    overflow: visible;
    width: 100%;
    border-radius: 0.5rem;
}

[data-tm-view-panel] {
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.tm-view-panel-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(0.35rem);
}

.tm-doc-table-shell .table-responsive {
    overflow: visible;
}

.tm-doc-table {
    min-width: 1080px;
}

.tm-doc-table thead th {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--tm-border-subtle);
    background: var(--tm-surface-soft);
    color: var(--tm-text);
    font-size: var(--tm-font-size-sm);
    font-weight: var(--tm-font-weight-extrabold);
    letter-spacing: 0;
    text-transform: uppercase;
}

.tm-doc-table tbody td {
    padding: 0.95rem 1rem;
    color: var(--tm-text-soft);
    font-size: 0.86rem;
    border-bottom: 1px solid var(--tm-border-muted);
}

.tm-doc-table tbody tr {
    transition: background-color 0.16s ease;
}

.tm-doc-table tbody tr:hover {
    background: var(--tm-surface-tint);
}

.tm-doc-check {
    width: 3.25rem;
}

.tm-doc-name {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    gap: 0.85rem;
    border: 0;
    padding: 0;
    background: transparent;
    text-align: left;
}

.tm-doc-file-title,
.tm-doc-file-meta,
.tm-doc-grid-title,
.tm-doc-grid-meta {
    display: block;
}

.tm-doc-file-title {
    color: var(--tm-text-strong);
    font-weight: var(--tm-font-weight-extrabold);
}

.tm-doc-file-meta,
.tm-doc-grid-meta {
    color: var(--tm-text-muted);
    font-size: 0.76rem;
    font-weight: var(--tm-font-weight-semibold);
}

.tm-doc-file-icon {
    width: 2rem;
    height: 2rem;
    flex: 0 0 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    font-size: 1.1rem;
}

.tm-doc-file-icon-primary {
    color: var(--tm-primary);
    background: var(--tm-primary-soft-strong);
}

.tm-doc-file-icon-danger {
    color: var(--tm-danger);
    background: var(--tm-danger-soft);
}

.tm-doc-file-icon-teal {
    color: var(--tm-success-strong);
    background: var(--tm-success-soft);
}

.tm-doc-status {
    display: inline-flex;
    align-items: center;
    min-height: 1.5rem;
    border-radius: 999px;
    padding: 0.15rem 0.65rem;
    font-size: 0.74rem;
    font-weight: var(--tm-font-weight-extrabold);
}

.tm-doc-status-published {
    background: var(--tm-primary-soft-strong);
    color: var(--tm-primary);
}

.tm-doc-status-draft {
    background: var(--tm-neutral-soft);
    color: var(--tm-text-subtle);
}

.tm-doc-status-archived {
    background: var(--tm-surface-soft);
    color: var(--tm-text-muted);
}

.tm-doc-status-in-review {
    background: var(--tm-warning-soft);
    color: var(--tm-warning-strong);
}

.tm-doc-status-rejected {
    background: var(--tm-danger-soft);
    color: var(--tm-danger-hover);
}

.tm-doc-status-trash {
    background: var(--tm-neutral-muted);
    color: var(--tm-neutral-strong);
}

.tm-doc-action-menu {
    min-width: 12.5rem;
    z-index: 1080;
}

.tm-doc-action-dropdown {
    position: relative;
    z-index: 3;
}

.tm-doc-action-dropdown .dropdown-menu.show {
    z-index: 1080;
}

.tm-doc-action-menu form {
    margin: 0;
}

.tm-doc-action-menu .dropdown-item {
    display: flex;
    align-items: center;
    min-height: 2rem;
    font-size: 0.84rem;
}

.tm-doc-pagination {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--tm-surface-soft);
    color: var(--tm-text-soft);
    font-size: var(--tm-font-size-label);
    font-weight: var(--tm-font-weight-semibold);
}

.tm-doc-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.tm-doc-folder-directory {
    display: grid;
    gap: 0.85rem;
    padding: 1rem;
    border: 1px solid var(--tm-border-subtle);
    border-radius: 0.5rem;
    background: var(--tm-surface);
    box-shadow: var(--tm-shadow-xs);
}

.tm-doc-version-cleanup {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
    padding: 0.85rem 1rem;
    border: 1px solid var(--tm-border-subtle);
    border-radius: 0.5rem;
    background: var(--tm-surface);
    box-shadow: var(--tm-shadow-xs);
}

.tm-doc-version-cleanup-icon {
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.45rem;
    background: var(--tm-warning-soft);
    color: var(--tm-warning-strong);
    font-size: 1.15rem;
}

.tm-doc-version-cleanup-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.tm-doc-version-cleanup-copy h3 {
    margin: 0;
    color: var(--tm-text-strong);
    font-size: 0.88rem;
    font-weight: var(--tm-font-weight-extrabold);
}

.tm-doc-version-cleanup-copy p {
    margin: 0.15rem 0 0;
    color: var(--tm-text-muted);
    font-size: 0.76rem;
}

.tm-doc-folder-directory-head,
.tm-doc-folder-card,
.tm-doc-folder-link,
.tm-doc-folder-row td,
.tm-doc-grid-folder-heading {
    display: flex;
    align-items: center;
}

.tm-doc-folder-directory-head {
    justify-content: space-between;
    gap: 1rem;
}

.tm-doc-folder-directory-head h3 {
    margin: 0;
    color: var(--tm-text-strong);
    font-size: 0.95rem;
    font-weight: var(--tm-font-weight-extrabold);
}

.tm-doc-folder-directory-head p {
    margin: 0.15rem 0 0;
    color: var(--tm-text-muted);
    font-size: 0.76rem;
}

.tm-doc-folder-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
}

.tm-doc-folder-card {
    min-width: 0;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.7rem;
    border: 1px solid var(--tm-border-muted);
    border-radius: 0.45rem;
    background: var(--tm-surface-soft);
}

.tm-doc-folder-card.is-empty {
    border-style: dashed;
}

.tm-doc-folder-link {
    min-width: 0;
    flex: 1 1 auto;
    gap: 0.65rem;
    color: var(--tm-text-strong);
    text-decoration: none;
}

.tm-doc-folder-link > .bi {
    flex: 0 0 auto;
    color: var(--tm-primary);
    font-size: 1.35rem;
}

.tm-doc-folder-link span,
.tm-doc-folder-link strong,
.tm-doc-folder-link small {
    display: block;
    min-width: 0;
}

.tm-doc-folder-link strong {
    overflow: hidden;
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tm-doc-folder-link small,
.tm-doc-folder-row small,
.tm-doc-grid-folder-heading small {
    color: var(--tm-text-muted);
    font-size: 0.72rem;
    font-weight: var(--tm-font-weight-semibold);
}

.tm-doc-folder-empty {
    grid-column: 1 / -1;
    color: var(--tm-text-muted);
    font-size: 0.82rem;
}

.tm-doc-folder-row td {
    justify-content: space-between;
    gap: 1rem;
    padding-block: 0.55rem !important;
    background: var(--tm-primary-soft-strong);
    color: var(--tm-text-strong) !important;
}

.tm-doc-folder-row:hover {
    background: transparent !important;
}

.tm-doc-folder-row span,
.tm-doc-grid-folder-heading span {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    font-weight: var(--tm-font-weight-extrabold);
}

.tm-doc-folder-row .bi,
.tm-doc-grid-folder-heading .bi {
    color: var(--tm-primary);
}

.tm-doc-grid-folder-heading {
    grid-column: 1 / -1;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--tm-border-subtle);
    color: var(--tm-text-strong);
}

.tm-doc-grid-item {
    display: grid;
    justify-items: start;
    gap: 0.55rem;
    min-height: 10rem;
    border-radius: 0.5rem;
    padding: 1rem;
    color: var(--tm-text-soft);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.tm-doc-grid-item:hover {
    border-color: var(--tm-border-focus);
    box-shadow: var(--tm-shadow-hover-soft);
    transform: translateY(-1px);
}

.tm-doc-grid-item:focus-visible {
    outline: 3px solid var(--tm-focus-ring-strong);
    outline-offset: 2px;
}

.tm-doc-grid-head {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.tm-doc-grid-item .tm-doc-action-dropdown {
    margin-top: -0.35rem;
    margin-right: -0.35rem;
}

.tm-doc-grid-item .tm-doc-action-dropdown > .btn {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.tm-doc-grid-title {
    color: var(--tm-text-strong);
    font-weight: var(--tm-font-weight-extrabold);
}

.tm-doc-empty {
    display: grid;
    place-items: center;
    min-height: 12rem;
    gap: 0.5rem;
    border: 1px dashed var(--tm-border-strong);
    border-radius: 0.5rem;
    color: var(--tm-text-muted);
    background: var(--tm-surface);
    font-weight: var(--tm-font-weight-bold);
}

.tm-doc-empty .bi {
    font-size: 2rem;
}

.tm-doc-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.tm-doc-metric {
    display: grid;
    gap: 0.55rem;
    min-height: 7rem;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.tm-doc-metric:hover,
.tm-doc-metric:focus-within {
    border-color: var(--tm-border-focus-soft);
    box-shadow: var(--tm-shadow-hover-soft);
    transform: translateY(-1px);
}

.tm-doc-metric span {
    color: var(--tm-text-subtle);
    font-size: 0.8rem;
    font-weight: var(--tm-font-weight-extrabold);
}

.tm-doc-metric strong {
    color: var(--tm-text-strong);
    font-size: 1.2rem;
    line-height: 1.1;
}

.tm-doc-metric small {
    color: var(--tm-primary);
    font-weight: 700;
}

.tm-doc-tone-primary {
    color: var(--tm-primary);
}

.tm-doc-tone-teal {
    color: var(--tm-success-strong);
}

.tm-doc-tone-danger {
    color: var(--tm-danger);
}

.tm-doc-inspector {
    position: fixed;
    top: 5rem;
    right: 1rem;
    z-index: 1030;
    width: min(22rem, calc(100vw - 2rem));
    height: calc(100vh - 6rem);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.75rem;
    opacity: 0;
    transform: translateX(calc(100% + 2rem));
    transition: opacity 0.18s ease, transform 0.2s ease, box-shadow 0.18s ease;
}

.tm-doc-inspector.is-open {
    opacity: 1;
    box-shadow: var(--tm-shadow-lg);
    transform: translateX(0);
}

.tm-doc-inspector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.tm-doc-inspector-header h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.tm-doc-share-alert {
    max-width: 64rem;
}

.tm-doc-context-pill {
    min-height: 2.35rem;
    display: flex;
    align-items: center;
    border: 1px solid var(--tm-border-subtle);
    border-radius: 0.5rem;
    padding: 0.45rem 0.75rem;
    background: var(--tm-surface-muted);
    color: var(--tm-text-soft);
    font-weight: var(--tm-font-weight-bold);
}

.tm-doc-history {
    max-height: 9rem;
    margin: 0;
    overflow: auto;
    white-space: pre-wrap;
    color: var(--tm-text-soft);
    font-family: inherit;
    font-size: 0.82rem;
}

.tm-doc-preview {
    min-height: 10rem;
    display: grid;
    place-items: center;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, var(--tm-primary-soft) 0%, var(--tm-surface-muted) 100%);
    color: var(--tm-primary);
}

.tm-doc-preview .bi {
    font-size: 4rem;
}

.tm-doc-details {
    display: grid;
    gap: 0.9rem;
    margin: 0;
}

.tm-doc-details dt {
    color: var(--tm-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.tm-doc-details dd {
    margin: 0.1rem 0 0;
    color: var(--tm-text-strong);
    font-size: 0.9rem;
    font-weight: var(--tm-font-weight-semibold);
}

.tm-doc-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.tm-todo-page {
    display: grid;
    gap: 1.35rem;
    min-width: 0;
}

.tm-todo-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
    min-width: 0;
}

.tm-todo-stat {
    min-height: 4.35rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    border: 1px solid var(--tm-border-subtle);
    border-radius: 0.5rem;
    padding: 0.85rem 1rem;
    background: var(--tm-surface);
    color: var(--tm-text-strong);
    text-decoration: none;
    box-shadow: var(--tm-shadow-xs);
    min-width: 0;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.tm-todo-stat:hover,
.tm-todo-stat:focus-visible {
    border-color: var(--tm-border-focus);
    color: var(--tm-text-strong);
    box-shadow: var(--tm-shadow-hover);
    transform: translateY(-1px);
}

.tm-todo-stat-icon {
    width: 2.6rem;
    height: 2.6rem;
    flex: 0 0 2.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    color: var(--tm-on-accent);
    font-size: 1.15rem;
}

.tm-todo-stat-copy {
    min-width: 0;
    display: grid;
    gap: 0.1rem;
    line-height: 1.15;
}

.tm-todo-stat-copy span {
    color: var(--tm-text-soft);
    font-size: var(--tm-font-size-label);
    font-weight: var(--tm-font-weight-extrabold);
}

.tm-todo-stat-copy strong {
    color: var(--tm-text-strong);
    font-size: 1.3rem;
    font-weight: var(--tm-font-weight-black);
}

.tm-todo-stat-primary .tm-todo-stat-icon {
    background: var(--tm-primary);
}

.tm-todo-stat-danger .tm-todo-stat-icon {
    background: var(--tm-danger);
}

.tm-todo-stat-warning .tm-todo-stat-icon {
    background: var(--tm-warning);
    color: var(--tm-on-accent);
}

.tm-todo-stat-success .tm-todo-stat-icon {
    background: var(--tm-success);
}

.tm-todo-stat-secondary .tm-todo-stat-icon {
    background: var(--tm-neutral);
}

.tm-todo-section {
    display: grid;
    gap: 0.65rem;
    min-width: 0;
}

.tm-todo-section h2 {
    margin: 0;
    color: var(--tm-heading);
    font-size: var(--tm-font-size-section-title);
    font-weight: var(--tm-font-weight-black);
}

.tm-todo-add-card {
    border: 1px solid var(--tm-border-subtle);
    border-left: 0.3rem solid var(--tm-primary);
    border-radius: 0.5rem;
    padding: 0 1rem;
    background: var(--tm-surface);
    box-shadow: var(--tm-shadow-xs);
}

.tm-todo-add-card summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .8rem 0;
    color: var(--tm-heading);
    font-weight: var(--tm-font-weight-extrabold);
    cursor: pointer;
}

.tm-todo-add-card details[open] summary {
    border-bottom: 1px solid var(--tm-border-row);
}

.tm-todo-add-body {
    display: grid;
    gap: .75rem;
    padding: 1rem 0;
}

.tm-todo-add-body > .badge {
    justify-self: start;
}

.tm-todo-add-card h2 {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.tm-todo-add-card h2::before {
    content: "\F4FE";
    font-family: bootstrap-icons;
    color: var(--tm-primary);
    font-size: 1.05rem;
    line-height: 1;
}

.tm-todo-add-grid,
.tm-todo-filter-grid {
    display: grid;
    gap: 0.85rem 1rem;
    align-items: end;
    min-width: 0;
}

.tm-todo-add-grid {
    grid-template-columns: minmax(18rem, 2.1fr) repeat(4, minmax(8.5rem, 1fr));
}

.tm-todo-filter-grid {
    grid-template-columns: repeat(6, minmax(8rem, 1fr));
}

.tm-todo-task-field {
    min-width: 0;
}

.tm-todo-add-grid textarea.form-control {
    min-height: 4rem;
    resize: vertical;
}

.tm-todo-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tm-todo-actions .btn {
    min-width: 4.75rem;
}

.tm-todo-table-shell {
    overflow: hidden;
    border: 1px solid var(--tm-border-subtle);
    border-radius: 0.5rem;
    background: var(--tm-surface);
    box-shadow: var(--tm-shadow-xs);
    min-width: 0;
}

.tm-todo-table {
    min-width: 880px;
}

.tm-todo-table thead th {
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--tm-border-subtle);
    background: var(--tm-surface-muted);
    color: var(--tm-nav-hover);
    font-size: var(--tm-font-size-sm);
    font-weight: var(--tm-font-weight-black);
}

.tm-todo-table tbody td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--tm-border-row);
    color: var(--tm-text-soft);
    font-size: var(--tm-font-size-table);
    vertical-align: middle;
}

.tm-todo-table tbody tr:hover {
    background: var(--tm-surface-tint);
}

.tm-todo-table tbody tr,
.tm-doc-table tbody tr,
.table-hover > tbody > tr {
    transition: background-color 0.16s ease;
}

tr[data-row-url] {
    cursor: pointer;
}

tr[data-row-url]:focus-visible > * {
    outline: 2px solid var(--tm-primary);
    outline-offset: -2px;
}

.tm-todo-done {
    width: 4rem;
}

.tm-todo-check {
    width: 1.25rem;
    height: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--tm-radius-xs);
    padding: 0;
    background: transparent;
    color: var(--tm-border-strong);
}

button.tm-todo-check:hover,
button.tm-todo-check:focus-visible {
    color: var(--tm-success);
}

.tm-todo-check.is-complete {
    color: var(--tm-success);
}

.tm-todo-task-cell {
    min-width: 19rem;
}

.tm-todo-task-title {
    color: var(--tm-heading);
    font-weight: var(--tm-font-weight-extrabold);
    line-height: 1.3;
}

.tm-todo-row-completed .tm-todo-task-title {
    color: var(--tm-text-muted);
    text-decoration: line-through;
}

.tm-todo-task-meta {
    margin-top: 0.15rem;
    color: var(--tm-text-muted);
    font-size: 0.75rem;
    font-weight: var(--tm-font-weight-semibold);
}

.tm-todo-date {
    color: var(--tm-text-strong);
    font-weight: var(--tm-font-weight-extrabold);
    line-height: var(--tm-line-height-tight);
}

.tm-todo-table .badge {
    font-weight: var(--tm-font-weight-extrabold);
}

.tm-todo-status-select {
    min-width: 8.25rem;
}

.tm-todo-delete {
    font-size: 1rem;
    text-decoration: none;
}

.tm-todo-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--tm-surface-soft);
    color: var(--tm-text-soft);
    font-size: var(--tm-font-size-label);
    font-weight: var(--tm-font-weight-bold);
}

.tm-todo-pagination nav {
    margin-left: auto;
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

.table-responsive > .table {
    margin-bottom: 0;
}

.table-responsive .btn-group,
.table-responsive .input-group {
    white-space: nowrap;
}

.table-responsive .input-group {
    min-width: max-content;
}

.table-responsive .form-control,
.table-responsive .form-select {
    min-width: 6.75rem;
}

.table-responsive .form-control[type="date"] {
    min-width: 8.75rem;
}

.table-responsive::after {
    content: "";
    display: block;
    height: 0.25rem;
}

.tm-spare-filter-card .card-body {
    padding: 0.85rem;
}

.tm-spare-filter-grid {
    display: grid;
    grid-template-columns: minmax(15rem, 1.4fr) repeat(4, minmax(7rem, 0.8fr)) auto;
    gap: 0.55rem 0.65rem;
    align-items: end;
}

.tm-spare-filter-grid .form-label {
    margin-bottom: 0.18rem;
    color: var(--tm-text-subtle);
    font-size: var(--tm-font-size-xs);
    line-height: 1.15;
    white-space: nowrap;
}

.tm-spare-filter-grid .form-control,
.tm-spare-filter-grid .form-select {
    min-height: 2.15rem !important;
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
    font-size: 0.84rem;
}

.tm-spare-filter-grid .form-select {
    padding-right: 1.85rem;
}

.tm-searchable-multi-filter-field,
.tm-searchable-multi-filter {
    min-width: 0;
}

.tm-searchable-multi-filter .tm-multi-filter-toggle {
    min-height: 2.15rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.3rem 0.65rem;
    color: var(--tm-text);
    background-color: var(--tm-surface);
    border-color: var(--tm-border);
    font-size: 0.84rem;
    text-align: left;
}

.tm-searchable-multi-filter .tm-multi-filter-toggle [data-multi-filter-summary] {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tm-searchable-multi-filter-menu {
    width: max(100%, 18rem);
    max-width: min(24rem, calc(100vw - 2rem));
    padding: 0;
    overflow: hidden;
    border-color: var(--tm-border);
    box-shadow: var(--tm-shadow-lg);
}

.tm-searchable-multi-filter-head {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem;
    background: var(--tm-surface);
    border-bottom: 1px solid var(--tm-border-soft);
}

.tm-searchable-multi-filter-head .input-group {
    min-width: 0;
}

.tm-searchable-multi-filter-head .input-group-text {
    color: var(--tm-text-muted);
    background: var(--tm-surface-muted);
    border-color: var(--tm-border);
}

.tm-searchable-multi-filter-head .form-control {
    min-width: 0;
    border-color: var(--tm-border);
}

.tm-searchable-multi-filter-head .btn-link {
    flex: 0 0 auto;
    color: var(--tm-primary);
    text-decoration: none;
}

.tm-searchable-multi-filter-options {
    max-height: 14rem;
    padding: 0.35rem;
    overflow-y: auto;
}

.tm-searchable-multi-filter .tm-multi-filter-option {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.42rem 0.5rem;
    border-radius: 0.35rem;
    color: var(--tm-text);
    font-size: 0.84rem;
    line-height: 1.25;
    white-space: normal;
}

.tm-searchable-multi-filter .tm-multi-filter-option:hover {
    background: var(--tm-primary-soft);
}

.tm-searchable-multi-filter .tm-multi-filter-option[hidden] {
    display: none !important;
}

.tm-searchable-multi-filter .tm-multi-filter-option .form-check-input {
    flex: 0 0 auto;
    margin-top: 0.12rem;
    border-color: var(--tm-primary);
}

.tm-searchable-multi-filter .tm-multi-filter-option .form-check-input:checked {
    background-color: var(--tm-primary);
    border-color: var(--tm-primary);
}

.tm-work-order-filter-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.55rem 0.65rem;
    align-items: end;
}

.tm-work-order-filter-grid > * {
    min-width: 0;
}

.tm-work-order-filter-grid .form-label {
    margin-bottom: 0.18rem;
    color: var(--tm-text-subtle);
    font-size: var(--tm-font-size-xs);
    line-height: 1.15;
    white-space: nowrap;
}

.tm-work-order-filter-grid .form-control,
.tm-work-order-filter-grid .form-select,
.tm-work-order-filter-grid .tm-multi-filter-toggle {
    min-height: 2.15rem !important;
    font-size: 0.84rem;
}

.tm-work-order-filter-search {
    grid-column: span 2;
}

.tm-work-order-filter-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 0.45rem;
}

.tm-work-order-filter-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 6.5rem;
    max-width: 10rem;
    min-height: 2.15rem;
}

.tm-spare-filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.45rem;
    align-items: end;
}

.tm-spare-filter-actions .btn {
    min-height: 2.15rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    font-size: 0.84rem;
    font-weight: var(--tm-font-weight-semibold);
    white-space: nowrap;
}

.tm-machine-filter-card .card-body {
    padding: 0.85rem;
}

.tm-machine-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem 0.75rem;
    align-items: end;
}

.tm-machine-filter-grid .tm-filter-search {
    grid-column: span 2;
}

.tm-machine-filter-subsection {
    grid-column: span 2;
}

.tm-machine-filter-grid .form-label {
    margin-bottom: 0.18rem;
    color: var(--tm-text-subtle);
    font-size: var(--tm-font-size-xs);
    line-height: 1.15;
    white-space: nowrap;
}

.tm-machine-filter-grid .form-control,
.tm-machine-filter-grid .form-select {
    min-height: 2.15rem !important;
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
    font-size: 0.84rem;
}

.tm-machine-filter-grid .form-select {
    padding-right: 1.85rem;
}

.tm-machine-filter-grid .tm-multi-filter-toggle {
    min-height: 2.15rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.3rem 0.65rem;
    color: var(--tm-text);
    background-color: var(--tm-surface);
    border-color: var(--tm-border);
    font-size: 0.84rem;
    text-align: left;
}

.tm-machine-filter-grid .tm-multi-filter-toggle [data-multi-filter-summary] {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tm-machine-filter-grid .tm-multi-filter-menu {
    width: 100%;
    max-height: 16rem;
    overflow-y: auto;
    padding: 0.35rem;
    border-color: var(--tm-border);
    box-shadow: var(--tm-shadow-lg);
}

.tm-machine-filter-grid .tm-multi-filter-option {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    border-radius: 0.35rem;
    color: var(--tm-text);
    font-size: 0.84rem;
    line-height: 1.25;
    white-space: normal;
}

.tm-machine-filter-grid .tm-multi-filter-option[hidden] {
    display: none !important;
}

.tm-machine-filter-grid .tm-multi-filter-option .form-check-input {
    flex: 0 0 auto;
    margin-top: 0.12rem;
    border-color: var(--tm-primary);
}

.tm-machine-filter-grid .tm-multi-filter-option .form-check-input:checked {
    background-color: var(--tm-primary);
    border-color: var(--tm-primary);
}

.tm-machine-filter-actions {
    display: flex;
    grid-column: 4;
    justify-content: flex-end;
    gap: 0.45rem;
    align-items: end;
}

.tm-machine-filter-actions .btn {
    min-height: 2.15rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    font-size: 0.84rem;
    font-weight: var(--tm-font-weight-semibold);
    white-space: nowrap;
}

.tm-spare-kpi-strip .card-body {
    padding: 0.9rem 1rem;
}

.tm-spare-kpi-row {
    display: grid;
    grid-template-columns: minmax(13rem, 1.15fr) repeat(5, minmax(6rem, 0.62fr)) minmax(13rem, 1fr);
    gap: 0.75rem;
    align-items: center;
}

.tm-spare-kpi-title {
    min-width: 0;
}

.tm-spare-kpi-title .tm-icon-box {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.55rem;
    flex: 0 0 auto;
}

.tm-spare-kpi-item {
    min-width: 0;
    padding-left: 0.7rem;
    border-left: 3px solid var(--tm-border-strong);
}

.tm-spare-kpi-item span {
    display: block;
    color: var(--tm-text-muted);
    font-size: var(--tm-font-size-xs);
    font-weight: var(--tm-font-weight-bold);
    line-height: 1.15;
    text-transform: uppercase;
}

.tm-spare-kpi-item strong {
    display: block;
    margin-top: 0.15rem;
    color: var(--tm-text-strong);
    font-size: 1.05rem;
    line-height: 1.1;
}

.tm-spare-kpi-primary {
    border-left-color: var(--tm-primary);
}

.tm-spare-kpi-success {
    border-left-color: var(--tm-success);
}

.tm-spare-kpi-warning {
    border-left-color: var(--tm-warning);
}

.tm-spare-kpi-danger {
    border-left-color: var(--tm-danger);
}

.tm-spare-kpi-info {
    border-left-color: var(--tm-info);
}

.tm-spare-kpi-chart {
    height: 5rem;
    min-width: 0;
}

.tm-spare-kpi-chart canvas {
    width: 100% !important;
    height: 100% !important;
}

.tm-quick-action {
    min-height: 3.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.tm-quick-action:hover,
.tm-quick-action:focus-visible {
    box-shadow: var(--tm-shadow-hover-soft);
    transform: translateY(-1px);
}

.tm-chart-frame {
    position: relative;
    min-height: 260px;
    height: 260px;
}

.tm-chart-frame canvas {
    width: 100% !important;
    height: 100% !important;
}

.tm-chart-empty {
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tm-muted);
    border: 1px dashed var(--tm-border-muted);
    border-radius: 0.75rem;
    background: var(--tm-surface-muted);
    animation: tm-content-enter 0.18s ease-out;
}

.tm-back-to-top {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1040;
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    transform: translateY(0.75rem);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.tm-back-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

@media (max-width: 991.98px) {
    .tm-sidebar {
        --bs-offcanvas-width: min(88vw, var(--tm-sidebar-width));
        width: var(--bs-offcanvas-width);
        min-width: 0;
        max-width: var(--bs-offcanvas-width);
        min-height: 100vh;
        right: auto;
        transform: none !important;
        transition: none;
    }

    #tmSidebar.offcanvas.offcanvas-start {
        left: calc(-1 * var(--bs-offcanvas-width)) !important;
    }

    #tmSidebar.offcanvas-lg.offcanvas-start.show,
    #tmSidebar.offcanvas-lg.offcanvas-start.showing {
        left: 0 !important;
        transform: none !important;
        visibility: visible !important;
    }

    #tmSidebar.offcanvas-lg.offcanvas-start.hiding {
        left: calc(-1 * var(--bs-offcanvas-width)) !important;
        transform: none !important;
    }

    .tm-sidebar .offcanvas-body {
        padding-top: 0;
    }

    .tm-content {
        width: 100%;
    }

    .tm-topbar {
        position: sticky;
        top: 0;
        z-index: 1020;
        min-height: auto;
        box-shadow: var(--tm-shadow-sm);
    }

    .tm-topbar-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .tm-form-section {
        padding: 1rem;
    }

    .tm-attachment-row {
        grid-template-columns: 1fr;
    }

    .tm-attachment-row .tm-extra-field-remove {
        width: 100%;
    }

    .tm-doc-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .tm-doc-rail {
        position: static;
    }

    .tm-doc-filter-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tm-doc-title-row {
        align-items: stretch;
        flex-direction: column;
    }

    .tm-doc-search {
        max-width: none;
    }

    .tm-doc-grid,
    .tm-doc-folder-grid,
    .tm-doc-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tm-doc-table-shell .table-responsive {
        width: 100%;
        overflow-x: auto;
    }

    .tm-todo-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .tm-user-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tm-user-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tm-user-filter-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .tm-todo-add-grid,
    .tm-todo-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tm-todo-task-field {
        grid-column: 1 / -1;
    }

    .tm-spare-filter-grid,
    .tm-machine-filter-grid,
    .tm-work-order-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .tm-filter-search,
    .tm-spare-filter-actions,
    .tm-machine-filter-actions,
    .tm-work-order-filter-search,
    .tm-work-order-filter-actions {
        grid-column: 1 / -1;
    }

    .tm-spare-filter-actions,
    .tm-machine-filter-actions {
        justify-content: flex-start;
    }

    .tm-spare-kpi-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .tm-spare-kpi-title,
    .tm-spare-kpi-chart {
        grid-column: 1 / -1;
    }
}

@media (min-width: 992px) {
    .tm-sidebar {
        position: sticky;
        top: 0;
        bottom: auto;
        z-index: auto;
        height: 100vh;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    html.tm-sidebar-compact .tm-sidebar {
        --bs-offcanvas-width: var(--tm-sidebar-compact-width);
        flex-basis: var(--tm-sidebar-compact-width);
        width: var(--tm-sidebar-compact-width);
        min-width: var(--tm-sidebar-compact-width);
        max-width: var(--tm-sidebar-compact-width);
    }

    .tm-sidebar.offcanvas-lg {
        background: var(--tm-nav) !important;
        background-color: var(--tm-nav) !important;
        color: var(--tm-nav-text) !important;
        transform: none !important;
        visibility: visible !important;
    }

    .tm-sidebar .offcanvas-body {
        height: auto;
    }

    html.tm-sidebar-compact .tm-sidebar-brand-header {
        flex-direction: column;
        gap: 0.3rem;
        justify-content: center;
        padding: 0.55rem;
    }

    html.tm-sidebar-compact .tm-nav-brand {
        justify-content: center;
    }

    html.tm-sidebar-compact .tm-nav-brand-copy,
    html.tm-sidebar-compact .tm-sidebar-fixed-controls {
        display: none;
    }

    html.tm-sidebar-compact .tm-sidebar-collapse-icon {
        display: none;
    }

    html.tm-sidebar-compact .tm-sidebar-expand-icon {
        display: inline-block;
    }

    html.tm-sidebar-compact .tm-sidebar .offcanvas-body {
        padding: 0.55rem !important;
    }

    html.tm-sidebar-compact .tm-sidebar .nav-link,
    html.tm-sidebar-compact .tm-nav-group-toggle,
    html.tm-sidebar-compact .tm-nav-reset {
        align-items: center;
        display: flex;
        height: 2.75rem;
        justify-content: center;
        min-height: 2.75rem;
        padding: 0.55rem;
        width: 100%;
    }

    html.tm-sidebar-compact .tm-sidebar .nav-link > .bi,
    html.tm-sidebar-compact .tm-nav-group-title > .bi,
    html.tm-sidebar-compact .tm-nav-reset > .bi {
        font-size: 1.05rem;
        margin-right: 0 !important;
    }

    html.tm-sidebar-compact .tm-nav-label,
    html.tm-sidebar-compact .tm-nav-group-chevron {
        display: none;
    }

    html.tm-sidebar-compact .tm-nav-group-title {
        justify-content: center;
    }

    html.tm-sidebar-compact .tm-nav-group-links {
        display: none !important;
    }

    html.tm-sidebar-compact .tm-nav-group,
    html.tm-sidebar-compact .tm-nav-most-used {
        gap: 0;
        margin-top: 0.25rem;
    }

    html.tm-sidebar-compact .tm-nav-most-used {
        border: 0;
        padding: 0;
    }

    html.tm-sidebar-compact .tm-nav-reset {
        margin-top: 0.35rem;
    }

    html.tm-sidebar-compact .tm-nav-utility-toolbar {
        display: grid;
        gap: 0.25rem;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        min-height: auto;
        padding: 0.35rem;
    }

    html.tm-sidebar-compact .tm-nav-utility-item {
        margin: 0;
    }

    html.tm-sidebar-compact .tm-sidebar .tm-nav-utility-trigger,
    html.tm-sidebar-compact .tm-sidebar .tm-nav-utility-action {
        height: 2rem;
        min-height: 2rem;
        padding: 0;
    }

    html.tm-sidebar-compact .tm-nav-utility-popover:not([hidden]) {
        bottom: 0.5rem;
        display: grid !important;
        left: calc(var(--tm-sidebar-compact-width) + 0.5rem);
        max-height: calc(100vh - 1rem);
        position: fixed;
        right: auto;
        width: min(19rem, calc(100vw - var(--tm-sidebar-compact-width) - 1rem));
    }

    html.tm-sidebar-compact .tm-nav-utility-popover .tm-nav-label {
        display: inline-block;
    }

    html.tm-sidebar-compact .tm-nav-utility-popover .nav-link {
        justify-content: flex-start;
        padding: 0.5rem 0.65rem;
    }

    html.tm-sidebar-compact .tm-nav-utility-popover .nav-link > .bi {
        margin-right: 0.5rem !important;
    }
}

@media (max-width: 767.98px) {
    main#main-content {
        padding: var(--tm-mobile-gutter) !important;
    }

    .card-body {
        padding: 1rem;
    }

    .tm-page-title {
        font-size: 1.1rem;
    }

    .tm-breadcrumb {
        font-size: 0.72rem;
    }

    .tm-unit-filter-form {
        flex: 1 1 100%;
        max-width: none;
        order: 3;
    }

    .tm-unit-filter {
        min-width: 0;
        width: 100%;
    }

    .tm-unit-filter .input-group-text {
        display: none;
    }

    .tm-user-menu {
        max-width: min(11rem, 46vw);
    }

    .tm-user-dropdown {
        min-width: 0;
    }

    .tm-user-summary-grid,
    .tm-user-filter-grid,
    .tm-user-detail-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .tm-user-detail-grid > .col-span-2,
    .tm-user-filter-actions {
        grid-column: auto;
    }

    .tm-user-filter-actions .btn,
    .tm-user-filter-actions a {
        flex: 1 1 auto;
    }

    .tm-user-avatar-xl {
        width: 6.5rem;
        height: 6.5rem;
        font-size: 1.85rem;
    }

    .tm-extra-field-row {
        grid-template-columns: minmax(0, 1fr);
    }

    form.row.g-3,
    form .modal-body > .row.g-3,
    form > .row.g-3,
    .tm-form-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.25rem 0.875rem;
    }

    .tm-extra-field-remove {
        width: 100%;
    }

    .tm-chart-frame,
    .tm-chart-empty {
        min-height: 220px;
        height: 220px;
    }

    .tm-doc-action-row {
        align-items: stretch;
        flex-direction: column;
    }

    .tm-doc-tabs,
    .tm-doc-view-toggle {
        width: 100%;
    }

    .tm-doc-action-row {
        align-items: stretch;
        flex-direction: column;
    }

    .tm-doc-version-cleanup {
        align-items: stretch;
        flex-direction: column;
    }

    .tm-doc-version-cleanup form,
    .tm-doc-version-cleanup .btn {
        width: 100%;
    }

    .tm-doc-tabs a {
        flex: 1 1 auto;
    }

    .tm-doc-filter-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .tm-doc-filter-nav,
    .tm-doc-grid,
    .tm-doc-folder-grid,
    .tm-doc-metrics {
        grid-template-columns: minmax(0, 1fr);
    }

    .tm-doc-pagination {
        align-items: flex-start;
        flex-direction: column;
    }

    .tm-doc-inspector {
        top: auto;
        right: 0;
        bottom: 0;
        width: 100%;
        height: min(82vh, 38rem);
        border-radius: 0.75rem 0.75rem 0 0;
        transform: translateY(calc(100% + 1rem));
    }

    .tm-doc-inspector.is-open {
        transform: translateY(0);
    }

    .tm-todo-summary,
    .tm-todo-add-grid,
    .tm-todo-filter-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .tm-spare-filter-grid,
    .tm-machine-filter-grid,
    .tm-spare-kpi-row,
    .tm-work-order-filter-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .tm-filter-search,
    .tm-spare-filter-actions,
    .tm-machine-filter-actions,
    .tm-machine-filter-subsection,
    .tm-work-order-filter-search,
    .tm-spare-kpi-title,
    .tm-spare-kpi-chart {
        grid-column: auto;
    }

    .tm-work-order-filter-actions {
        grid-column: 1 / -1;
        justify-content: stretch;
    }

    .tm-work-order-filter-actions .btn {
        flex: 1 1 0;
        max-width: none;
    }

    .tm-spare-filter-card .card-body,
    .tm-machine-filter-card .card-body,
    .tm-spare-kpi-strip .card-body {
        padding: 0.85rem;
    }

    .tm-spare-filter-actions,
    .tm-machine-filter-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .tm-spare-filter-actions .btn,
    .tm-machine-filter-actions .btn {
        justify-content: center;
        width: 100%;
    }

    .tm-todo-stat {
        min-height: 4rem;
    }

    .tm-todo-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .tm-todo-actions .btn {
        width: 100%;
    }

    .tm-todo-pagination {
        align-items: flex-start;
        flex-direction: column;
    }

    .tm-todo-pagination nav {
        margin-left: 0;
    }
}

@media (max-width: 575.98px) {
    .tm-topbar-actions {
        flex-wrap: wrap;
        justify-content: stretch;
    }

    .tm-user-dropdown .dropdown-menu-end {
        right: auto;
        left: 0;
    }

    .tm-topbar-actions .tm-unit-filter-form {
        width: 100%;
    }

    .card {
        border-radius: 0.5rem;
    }

    .card-body > .d-flex.justify-content-between,
    .card-body > .d-flex.justify-content-end,
    form .d-flex.justify-content-between,
    form .d-flex.justify-content-end {
        align-items: stretch !important;
        flex-direction: column;
    }

    .card-body > .d-flex.justify-content-between .btn,
    .card-body > .d-flex.justify-content-end .btn,
    form .d-flex.justify-content-between .btn,
    form .d-flex.justify-content-end .btn {
        width: 100%;
    }

    form .d-flex.gap-2 {
        flex-wrap: wrap;
    }

    form .d-flex.gap-2 > .btn {
        flex: 1 1 9rem;
    }

    .btn-group {
        display: inline-flex;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .table-responsive {
        margin-inline: -0.25rem;
        padding-inline: 0.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    .btn:not(.btn-link):hover,
    .btn:not(.btn-link):focus-visible,
    .tm-kpi-card:hover,
    .tm-kpi-card:focus-within,
    .tm-doc-metric:hover,
    .tm-doc-metric:focus-within,
    .tm-quick-action:hover,
    .tm-quick-action:focus-visible {
        transform: none;
    }

    .tm-nav-link-filtered,
    .tm-view-panel-hidden {
        transition: none !important;
    }
}

.tm-report-print-header {
    margin: 0 0 0.75rem;
    color: #111;
    background: #fff;
    break-after: avoid;
    break-inside: avoid;
    page-break-after: avoid;
    page-break-inside: avoid;
}

.tm-report-print-header h1 {
    margin: 0;
    color: inherit;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
}

.tm-report-print-header p {
    margin: 0.15rem 0 0;
    color: #444;
    font-size: 0.9rem;
    line-height: 1.3;
}

@media print {
    .tm-sidebar,
    .navbar,
    .tm-back-to-top {
        display: none !important;
    }

    body {
        background: var(--tm-surface);
    }
}

/* Shared workspace refinements. Keep these screen-only so print output stays unchanged. */
@media screen {
    .tm-content {
        background: var(--tm-bg);
    }

    .tm-sidebar {
        box-shadow: 0.35rem 0 1.5rem rgba(16, 39, 72, 0.12);
    }

    .tm-sidebar .nav-link {
        position: relative;
    }

    .tm-sidebar .nav-link.active {
        box-shadow: 0 0.35rem 0.9rem rgba(var(--tm-primary-rgb), 0.2);
        font-weight: var(--tm-font-weight-bold);
    }

    .tm-sidebar .nav-link.active::before {
        position: absolute;
        top: 0.45rem;
        bottom: 0.45rem;
        left: 0;
        width: 0.2rem;
        border-radius: 0 0.25rem 0.25rem 0;
        background: var(--tm-on-accent);
        content: "";
    }

    .tm-topbar {
        position: sticky;
        top: 0;
        z-index: 1020;
        background: rgba(255, 255, 255, 0.94) !important;
        box-shadow: 0 0.2rem 1.25rem rgba(17, 30, 52, 0.06);
        backdrop-filter: blur(14px);
    }

    .tm-page-title {
        font-size: 1.42rem;
        letter-spacing: 0;
    }

    .tm-page-context {
        display: flex;
        align-items: center;
        gap: 0.45rem;
        min-width: 0;
        margin-top: 0.35rem;
        color: var(--tm-muted);
        font-size: var(--tm-font-size-xs);
        font-weight: var(--tm-font-weight-semibold);
        line-height: 1.2;
    }

    .tm-page-context-item {
        display: inline-flex;
        align-items: center;
        gap: 0.3rem;
        min-width: 0;
        max-width: 16rem;
    }

    .tm-page-context-item .bi {
        flex: 0 0 auto;
        color: var(--tm-primary);
    }

    .tm-page-context-divider {
        width: 0.22rem;
        height: 0.22rem;
        border-radius: 50%;
        background: var(--tm-border-strong);
    }

    .card {
        box-shadow: var(--tm-shadow-xs);
        transition: border-color 160ms ease, box-shadow 160ms ease;
    }

    .card:hover {
        border-color: var(--tm-border-strong);
        box-shadow: var(--tm-shadow-sm);
    }

    .card-header {
        padding: 0.95rem 1.15rem;
        background: var(--tm-surface) !important;
    }

    .card-body {
        padding: 1.15rem;
    }

    .table-responsive {
        border: 1px solid var(--tm-border-soft);
        border-radius: var(--tm-radius-sm);
        scrollbar-color: var(--tm-border-strong) transparent;
    }

    .table-responsive .table {
        margin-bottom: 0;
    }

    .table thead th {
        position: sticky;
        top: 0;
        z-index: 1;
        border-bottom-width: 1px;
        white-space: nowrap;
    }

    .table tbody tr {
        transition: background-color 140ms ease;
    }

    .form-control,
    .form-select,
    .input-group-text {
        box-shadow: inset 0 1px 1px rgba(20, 42, 72, 0.025);
    }

    .form-control:focus,
    .form-select:focus {
        background-color: var(--tm-surface);
    }

    .tm-topbar [data-page-feedback-open] {
        box-shadow: 0 0.35rem 0.85rem rgba(var(--tm-primary-rgb), 0.2);
    }

    .tm-kpi-card {
        border: 1px solid var(--tm-border-soft);
        box-shadow: var(--tm-shadow-xs);
    }

    .tm-kpi-card .fs-3 {
        color: var(--tm-heading);
        font-variant-numeric: tabular-nums;
        letter-spacing: 0;
    }

    .tm-quick-action {
        border-width: 1px;
        background: var(--tm-surface);
    }

    .tm-report-filter-card {
        border: 1px solid var(--tm-border-soft) !important;
        box-shadow: var(--tm-shadow-xs) !important;
    }

    .tm-report-filter-card:hover {
        border-color: var(--tm-border-soft);
        box-shadow: var(--tm-shadow-xs);
    }

    .tm-report-filter-card .card-body {
        padding: 0.72rem 0.8rem;
    }

    .tm-report-filter-grid {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
        grid-auto-flow: row;
        align-items: end;
        gap: 0.5rem 0.625rem !important;
        width: 100%;
        max-width: 100%;
        margin: 0 !important;
    }

    .tm-report-filter-grid > * {
        width: auto;
        max-width: none;
        min-width: 0;
    }

    .tm-report-filter-grid > [class*="col"] {
        margin: 0;
        padding: 0;
    }

    .tm-report-filter-grid .form-label {
        margin-bottom: 0.18rem;
        color: var(--tm-text-soft);
        font-size: 0.72rem;
        font-weight: var(--tm-font-weight-semibold);
        line-height: 1.15;
    }

    .tm-report-filter-grid .form-control,
    .tm-report-filter-grid .form-select,
    .tm-report-filter-grid .dropdown,
    .tm-report-filter-grid .tm-multi-filter-toggle {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .tm-report-filter-grid .form-control,
    .tm-report-filter-grid .form-select,
    .tm-report-filter-grid .tm-multi-filter-toggle {
        min-height: 2.15rem;
        font-size: 0.8125rem;
        line-height: 1.25;
    }

    .tm-report-filter-grid .form-control {
        padding: 0.38rem 0.625rem;
    }

    .tm-report-filter-grid .form-select {
        padding: 0.38rem 2rem 0.38rem 0.625rem;
    }

    .tm-report-filter-wide {
        grid-column: span 2;
    }

    .tm-report-filter-options,
    .tm-report-filter-actions {
        grid-column: 1 / -1;
    }

    .tm-report-filter-options {
        display: flex;
        align-items: center;
        gap: 0.7rem;
        min-width: 0;
    }

    .tm-report-filter-options > .form-label {
        flex: 0 0 auto;
        margin: 0;
    }

    .tm-report-filter-options .tm-report-option-pills {
        gap: 0.35rem !important;
        min-width: 0;
    }

    .tm-report-filter-options .tm-report-option-pills .btn {
        min-height: 2rem;
        padding: 0.3rem 0.7rem;
        font-size: 0.78rem;
        line-height: 1.2;
    }

    .tm-report-filter-actions {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.5rem), 1fr));
        grid-auto-flow: row;
        gap: 0.375rem !important;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding-top: 0.05rem !important;
    }

    .tm-report-filter-actions .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100% !important;
        max-width: 100%;
        min-width: 0;
        height: 2.5rem;
        padding: 0.25rem 0.5rem;
        font-size: 0.78rem;
        line-height: 1.1;
        text-align: center;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .tm-report-filter-actions.tm-report-filter-actions-compact {
        display: flex !important;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .tm-report-filter-actions.tm-report-filter-actions-compact .btn {
        width: auto !important;
        min-width: 6.5rem;
        max-width: 10rem;
        flex: 0 1 10rem !important;
        white-space: nowrap;
        overflow-wrap: normal;
    }
}

@media screen and (min-width: 576px) {
    form[method="get"] button[type="submit"].btn {
        width: auto !important;
        min-width: 6.5rem;
        max-width: 10rem;
        flex: 0 1 10rem !important;
    }
}

@media screen and (max-width: 575.98px) {
    .tm-page-context-item {
        max-width: 11rem;
    }

    .tm-page-context-item:last-child {
        max-width: 9rem;
    }

    .card-body {
        padding: 1rem;
    }

    .tm-report-filter-card .card-body {
        padding: 0.65rem;
    }

    .tm-report-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem 0.5rem !important;
    }

    .tm-report-filter-options {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
    }

    .tm-report-filter-options .tm-report-option-pills {
        flex-wrap: nowrap !important;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.15rem;
        scrollbar-width: thin;
    }

    .tm-report-filter-options .tm-report-option-pills .btn {
        flex: 0 0 auto;
    }
}

/* Shared maintenance schedule timeline */
.tm-schedule-timeline-row > td {
    padding: 0.55rem 1rem 0.7rem !important;
    border-top: 0;
    background: var(--tm-canvas, #f6f8fb);
    box-shadow: inset 0 1px 0 var(--tm-border-soft, #e8edf3);
}

.tm-schedule-timeline {
    min-width: 44rem;
    padding: 0.15rem 1.25rem 0;
    color: var(--tm-text, #243447);
}

.tm-schedule-timeline-track {
    position: relative;
    height: 8.5rem;
}

.tm-schedule-timeline-track::before {
    position: absolute;
    top: 4rem;
    right: 0;
    left: 0;
    height: 3px;
    border-radius: 999px;
    background: var(--tm-border, #d8e0e8);
    content: "";
}

.tm-schedule-timeline-window {
    position: absolute;
    z-index: 1;
    top: 3.65rem;
    left: var(--tm-timeline-left);
    width: var(--tm-timeline-width);
    min-width: 0.45rem;
    height: 0.75rem;
    border: 1px solid color-mix(in srgb, var(--tm-primary, #336699) 18%, transparent);
    background: color-mix(in srgb, var(--tm-primary, #336699) 10%, transparent);
}

.tm-schedule-timeline-window-label {
    position: absolute;
    top: calc(100% + 0.22rem);
    display: block;
    width: max-content;
    color: var(--tm-primary-hover, #2a527a);
    font-size: 0.62rem;
    font-weight: 650;
    line-height: 1.15;
    white-space: nowrap;
}

.tm-schedule-timeline-window-label time {
    color: var(--tm-text-muted, #667085);
    font-variant-numeric: tabular-nums;
}

.tm-schedule-timeline-window-label--start {
    right: 100%;
    padding-right: 0.28rem;
    text-align: right;
}

.tm-schedule-timeline-window-label--end {
    left: 100%;
    padding-left: 0.28rem;
    text-align: left;
}

.tm-schedule-timeline-marker {
    position: absolute;
    z-index: 2;
    top: 0;
    left: var(--tm-timeline-position);
    width: 0;
    height: 100%;
    color: var(--tm-neutral, #667085);
}

.tm-schedule-timeline-dot {
    position: absolute;
    top: 3.65rem;
    left: 0;
    width: 0.78rem;
    height: 0.78rem;
    border: 2px solid var(--tm-surface, #fff);
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 1px color-mix(in srgb, currentColor 24%, transparent);
    transform: translateX(-50%);
}

.tm-schedule-timeline-label {
    position: absolute;
    top: 5.65rem;
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
    width: max-content;
    max-width: 11rem;
    color: currentColor;
    font-size: 0.7rem;
    line-height: 1.2;
    white-space: nowrap;
    transform: translateX(-50%);
}

.tm-schedule-timeline-label strong {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

.tm-schedule-timeline-label time {
    color: var(--tm-text-muted, #667085);
    font-variant-numeric: tabular-nums;
}

.tm-schedule-timeline-marker--start .tm-schedule-timeline-label {
    transform: none;
}

.tm-schedule-timeline-marker--end .tm-schedule-timeline-label {
    transform: translateX(-100%);
    text-align: right;
}

.tm-schedule-timeline-marker--due {
    color: var(--tm-primary, #336699);
}

.tm-schedule-timeline-marker--due .tm-schedule-timeline-dot {
    top: 3.58rem;
    width: 1.1rem;
    height: 0.55rem;
    border: 0;
    border-radius: 999px;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--tm-primary, #336699) 12%, transparent);
}

.tm-schedule-timeline-marker--due .tm-schedule-timeline-label {
    top: 0.15rem;
    padding: 0.28rem 0.5rem;
    border: 1px solid var(--tm-primary, #336699);
    border-radius: 0.35rem;
    color: var(--tm-primary, #336699);
    background: var(--tm-surface, #fff);
    text-align: center;
}

.tm-schedule-timeline-marker--due .tm-schedule-timeline-label time {
    color: inherit;
    font-weight: 700;
}

.tm-schedule-timeline-marker--escalates {
    color: var(--tm-danger, #b33a3a);
}

.tm-schedule-timeline-marker--lane-lower .tm-schedule-timeline-label {
    top: 6.85rem;
}

.tm-schedule-timeline-marker--escalates .tm-schedule-timeline-label--upper-row {
    top: 2.35rem;
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 0.25rem;
    max-width: none;
    color: inherit;
    line-height: 1;
    white-space: nowrap;
}

.tm-schedule-timeline-label--upper-row strong,
.tm-schedule-timeline-label--upper-row time {
    display: inline-block;
}

.tm-schedule-timeline-label--upper-row time {
    color: inherit;
    font-weight: 600;
}

.tm-schedule-timeline-empty {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.8rem;
    color: var(--tm-warning, #9a5b13);
    font-size: 0.78rem;
    font-weight: 600;
}

.tm-schedule-timeline-empty i {
    font-size: 1rem;
}

.tm-schedule-timeline-row:not([hidden]) .tm-schedule-timeline {
    animation: tm-schedule-timeline-reveal 160ms ease-out both;
}

/* Tenant branding governance */
.tm-branding-current-logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem;
    border: 1px solid var(--tm-border);
    border-radius: var(--tm-radius-sm);
    background: var(--tm-surface-muted);
}

.tm-branding-current-logo img {
    flex: 0 0 auto;
    width: 3rem;
    height: 3rem;
    padding: 0.2rem;
    border: 1px solid var(--tm-border);
    border-radius: var(--tm-radius-sm);
    object-fit: contain;
    background: var(--tm-surface);
}

.tm-branding-palette-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.tm-branding-palette-option {
    display: grid;
    grid-template-columns: 4.5rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.7rem;
    min-height: 4rem;
    padding: 0.65rem;
    border: 1px solid var(--tm-border);
    border-radius: var(--tm-radius-sm);
    background: var(--tm-surface);
    cursor: pointer;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.tm-branding-palette-option:hover {
    border-color: var(--tm-primary-disabled);
    background: var(--tm-primary-soft);
}

.tm-branding-palette-option:has(input:focus-visible) {
    border-color: var(--tm-primary);
    box-shadow: 0 0 0 0.18rem var(--tm-focus-ring);
}

.tm-branding-palette-option:has(input:checked) {
    border-color: var(--tm-primary);
    background: var(--tm-primary-soft);
    box-shadow: inset 0 0 0 1px var(--tm-primary);
}

.tm-branding-palette-option strong,
.tm-branding-palette-option small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tm-branding-palette-option small {
    margin-top: 0.15rem;
    color: var(--tm-text-muted);
    font-size: var(--tm-font-size-xs);
}

.tm-branding-palette-option > .bi {
    color: var(--tm-primary);
    opacity: 0;
}

.tm-branding-palette-option:has(input:checked) > .bi {
    opacity: 1;
}

.tm-branding-palette-swatches {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 4.5rem;
    height: 2rem;
    overflow: hidden;
    border: 1px solid var(--tm-border);
    border-radius: var(--tm-radius-xs);
}

.tm-branding-preview {
    position: sticky;
    top: 1rem;
    padding: 1rem;
    border: 1px solid var(--tm-border);
    border-radius: var(--tm-radius);
    background: var(--tm-surface);
    box-shadow: var(--tm-shadow-sm);
}

.tm-branding-preview-label {
    margin-bottom: 0.65rem;
    color: var(--tm-text-muted);
    font-size: var(--tm-font-size-xs);
    font-weight: var(--tm-font-weight-bold);
    text-transform: uppercase;
}

.tm-branding-preview-shell {
    display: grid;
    grid-template-columns: 42% 1fr;
    min-height: 17rem;
    margin-bottom: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--tm-border);
    border-radius: var(--tm-radius-sm);
    background: var(--tm-bg);
}

.tm-branding-preview-nav {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.8rem;
    color: #fff;
    background: var(--tm-branding-preview-nav);
}

.tm-branding-preview-nav > span {
    width: 82%;
    height: 0.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
}

.tm-branding-preview-nav > span:nth-last-child(1) {
    width: 62%;
}

.tm-branding-preview-identity {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    margin-bottom: 0.4rem;
}

.tm-branding-preview-identity img,
.tm-branding-preview-identity > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    padding: 0.12rem;
    border-radius: var(--tm-radius-xs);
    object-fit: contain;
    color: var(--tm-branding-preview-primary);
    background: #fff;
}

.tm-branding-preview-identity div {
    min-width: 0;
}

.tm-branding-preview-identity strong,
.tm-branding-preview-identity small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tm-branding-preview-identity strong {
    font-size: 0.72rem;
}

.tm-branding-preview-identity small {
    margin-top: 0.1rem;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.58rem;
}

.tm-branding-preview-content {
    padding: 1.25rem 0.85rem;
}

.tm-branding-preview-heading,
.tm-branding-preview-line {
    height: 0.55rem;
    margin-bottom: 0.65rem;
    border-radius: 999px;
    background: var(--tm-border);
}

.tm-branding-preview-heading {
    width: 72%;
    height: 0.85rem;
    margin-bottom: 1.25rem;
    background: var(--tm-branding-preview-nav);
}

.tm-branding-preview-line--short {
    width: 68%;
}

.tm-branding-preview-content button {
    margin-top: 1.2rem;
    padding: 0.45rem 0.65rem;
    border: 0;
    border-radius: var(--tm-radius-xs);
    color: #fff;
    background: var(--tm-branding-preview-primary);
    font-size: 0.65rem;
    font-weight: var(--tm-font-weight-bold);
    pointer-events: none;
}

@media (max-width: 767.98px) {
    .tm-branding-palette-grid {
        grid-template-columns: 1fr;
    }

    .tm-branding-preview {
        position: static;
    }
}

@keyframes tm-schedule-timeline-reveal {
    from {
        opacity: 0;
        transform: translateY(-0.25rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .tm-schedule-timeline-row:not([hidden]) .tm-schedule-timeline {
        animation: none;
    }
}
/* Platform administrators must always see whether tenant support access is active. */
.tm-sidebar-platform-mode {
    align-items: center;
    background: rgba(255, 255, 255, .09);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: .35rem;
    color: rgba(255, 255, 255, .88);
    display: flex;
    font-size: .8rem;
    font-weight: 600;
    gap: .5rem;
    padding: .55rem .65rem;
}

.tm-support-access-banner {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: .6rem 1rem;
}

.tm-support-access-banner--platform {
    background: #f5f8fb;
    border-bottom: 1px solid #cbd8e5;
    color: #24496d;
}

.tm-support-access-banner--active {
    background: #fff7e8;
    border-bottom: 1px solid #e6c98f;
    color: #5f3a0d;
}

.tm-support-access-banner__content,
.tm-support-access-banner__actions {
    align-items: center;
    display: flex;
    gap: .65rem;
}

.tm-support-access-banner__content {
    min-width: 0;
}

.tm-support-access-banner__content > .bi {
    font-size: 1.1rem;
}

.tm-support-access-banner__meta {
    font-size: .78rem;
    opacity: .82;
}

.tm-support-access-banner__actions {
    flex: 0 0 auto;
}

@media (max-width: 767.98px) {
    .tm-support-access-banner {
        align-items: flex-start;
        flex-direction: column;
    }

    .tm-support-access-banner__actions {
        width: 100%;
    }
}

@media print {
    .tm-support-access-banner {
        display: none !important;
    }
}

/* Personal To-Do diary: board, list, and calendar share one private-entry language. */
.tm-todo-diary-head {
    position: relative;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1.5rem;
    overflow: hidden;
    border: 1px solid var(--tm-border-subtle);
    border-left: .35rem solid var(--tm-primary);
    border-radius: .65rem;
    padding: 1.15rem 1.25rem;
    background-color: var(--tm-surface);
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent 1.75rem,
        var(--tm-border-row) 1.8rem
    );
    box-shadow: var(--tm-shadow-xs);
}

.tm-todo-diary-head > div {
    position: relative;
    z-index: 1;
    max-width: 46rem;
    background: var(--tm-surface);
}

.tm-todo-diary-kicker {
    display: block;
    margin-bottom: .2rem;
    color: var(--tm-primary);
    font-size: .72rem;
    font-weight: var(--tm-font-weight-black);
    letter-spacing: .12em;
    text-transform: uppercase;
}

.tm-todo-diary-head h2 {
    margin: 0;
    color: var(--tm-heading);
    font-size: clamp(1.15rem, 2vw, 1.55rem);
    font-weight: var(--tm-font-weight-black);
}

.tm-todo-diary-head p {
    margin: .35rem 0 0;
    color: var(--tm-text-soft);
    font-size: .88rem;
}

.tm-todo-view-switch {
    position: relative;
    z-index: 1;
    display: inline-flex;
    flex: 0 0 auto;
    gap: .25rem;
    border: 1px solid var(--tm-border-subtle);
    border-radius: .55rem;
    padding: .25rem;
    background: var(--tm-surface);
    box-shadow: var(--tm-shadow-xs);
}

.tm-todo-view-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    border-radius: .35rem;
    padding: .5rem .75rem;
    color: var(--tm-text-soft);
    font-size: .82rem;
    font-weight: var(--tm-font-weight-extrabold);
    text-decoration: none;
}

.tm-todo-view-link:hover,
.tm-todo-view-link:focus-visible {
    color: var(--tm-primary);
    background: var(--tm-surface-tint);
}

.tm-todo-view-link.is-active {
    color: var(--tm-on-accent);
    background: var(--tm-primary);
}

.tm-todo-filter-card {
    border: 1px solid var(--tm-border-subtle);
    border-radius: .55rem;
    padding: 0 1rem;
    background: var(--tm-surface);
    box-shadow: var(--tm-shadow-xs);
}

.tm-todo-filter-card summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .8rem 0;
    color: var(--tm-heading);
    font-weight: var(--tm-font-weight-extrabold);
    cursor: pointer;
}

.tm-todo-filter-card details[open] summary {
    border-bottom: 1px solid var(--tm-border-row);
}

.tm-todo-filter-card .tm-todo-filter-grid {
    padding: 1rem 0;
}

.tm-todo-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(15rem, 1fr));
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: .35rem;
    scrollbar-width: thin;
}

.tm-todo-board-guide {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .65rem;
    color: var(--tm-text-muted);
    font-size: .76rem;
    font-weight: var(--tm-font-weight-semibold);
}

.tm-todo-board-guide > span {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

.tm-todo-board-column {
    min-width: 15rem;
    border: 1px solid var(--tm-border-subtle);
    border-top: .25rem solid var(--tm-neutral);
    border-radius: .6rem;
    padding: .8rem;
    background: var(--tm-surface-soft);
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.tm-todo-board-column.is-drop-target {
    border-color: var(--tm-primary);
    background: var(--tm-surface-tint);
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--tm-primary) 22%, transparent);
}

.tm-todo-board-column-primary { border-top-color: var(--tm-primary); }
.tm-todo-board-column-warning { border-top-color: var(--tm-warning); }
.tm-todo-board-column-success { border-top-color: var(--tm-success); }

.tm-todo-board-column > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .75rem;
}

.tm-todo-board-column > header h2 {
    margin: 0;
    color: var(--tm-heading);
    font-size: .88rem;
    font-weight: var(--tm-font-weight-black);
}

.tm-todo-board-column > header span {
    min-width: 1.65rem;
    border-radius: 999px;
    padding: .15rem .45rem;
    background: var(--tm-surface);
    color: var(--tm-text-soft);
    font-size: .72rem;
    font-weight: var(--tm-font-weight-black);
    text-align: center;
}

.tm-todo-board-stack {
    display: grid;
    gap: .7rem;
    min-height: 4rem;
}

.tm-todo-board-card {
    border: 1px solid var(--tm-border-row);
    border-radius: .5rem;
    padding: .8rem;
    background: var(--tm-surface);
    box-shadow: var(--tm-shadow-xs);
    transition: border-color .16s ease, box-shadow .16s ease, opacity .16s ease, transform .16s ease;
}

.tm-todo-board-card:hover {
    border-color: var(--tm-border-focus);
    box-shadow: var(--tm-shadow-hover);
}

.tm-todo-board-card.is-complete {
    opacity: .72;
}

.tm-todo-board-card.is-complete h3 {
    text-decoration: line-through;
}

.tm-todo-board-card.is-dragging {
    opacity: .45;
    transform: scale(.985);
}

.tm-todo-board-card.is-updating {
    opacity: .68;
    pointer-events: none;
}

.tm-todo-board-card-top {
    display: flex;
    align-items: center;
    gap: .45rem;
}

.tm-todo-drag-handle {
    display: inline-grid;
    place-items: center;
    width: 1.65rem;
    height: 1.65rem;
    border: 1px solid transparent;
    border-radius: .35rem;
    padding: 0;
    background: transparent;
    color: var(--tm-text-muted);
    cursor: grab;
    touch-action: none;
}

.tm-todo-drag-handle:hover,
.tm-todo-drag-handle:focus-visible {
    border-color: var(--tm-border-focus);
    background: var(--tm-surface-tint);
    color: var(--tm-primary);
}

.tm-todo-drag-handle:active {
    cursor: grabbing;
}

.tm-todo-board-card h3 {
    margin: .65rem 0;
    color: var(--tm-heading);
    font-size: .92rem;
    font-weight: var(--tm-font-weight-extrabold);
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.tm-todo-board-card-meta {
    display: grid;
    gap: .3rem;
    color: var(--tm-text-muted);
    font-size: .74rem;
    font-weight: var(--tm-font-weight-semibold);
}

.tm-todo-board-card-meta span {
    display: flex;
    align-items: center;
    gap: .4rem;
    min-width: 0;
}

.tm-todo-column-empty {
    border: 1px dashed var(--tm-border-strong);
    border-radius: .45rem;
    padding: 1.5rem .75rem;
    color: var(--tm-text-muted);
    font-size: .8rem;
    text-align: center;
}

.tm-todo-calendar-shell {
    overflow: hidden;
    border: 1px solid var(--tm-border-subtle);
    border-radius: .65rem;
    background: var(--tm-surface);
    box-shadow: var(--tm-shadow-xs);
}

.tm-todo-calendar-toolbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--tm-border-subtle);
    padding: .8rem 1rem;
    background: var(--tm-surface-soft);
    text-align: center;
}

.tm-todo-calendar-toolbar span {
    color: var(--tm-text-muted);
    font-size: .7rem;
    font-weight: var(--tm-font-weight-black);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.tm-todo-calendar-toolbar h2 {
    margin: .1rem 0 0;
    color: var(--tm-heading);
    font-size: 1.1rem;
    font-weight: var(--tm-font-weight-black);
}

.tm-todo-calendar-scroll {
    overflow-x: auto;
    scrollbar-width: thin;
}

.tm-todo-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(8rem, 1fr));
    min-width: 56rem;
}

.tm-todo-calendar-weekday {
    border-right: 1px solid var(--tm-border-row);
    border-bottom: 1px solid var(--tm-border-subtle);
    padding: .5rem;
    color: var(--tm-text-muted);
    font-size: .7rem;
    font-weight: var(--tm-font-weight-black);
    letter-spacing: .06em;
    text-align: center;
    text-transform: uppercase;
}

.tm-todo-calendar-day {
    min-height: 8.5rem;
    border-right: 1px solid var(--tm-border-row);
    border-bottom: 1px solid var(--tm-border-row);
    padding: .5rem;
    background: var(--tm-surface);
}

.tm-todo-calendar-day.is-outside {
    background: var(--tm-surface-soft);
    color: var(--tm-text-muted);
}

.tm-todo-calendar-day.is-today {
    box-shadow: inset 0 0 0 2px var(--tm-primary);
}

.tm-todo-calendar-date {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .35rem;
    margin-bottom: .45rem;
    color: var(--tm-heading);
    font-size: .78rem;
    font-weight: var(--tm-font-weight-black);
}

.tm-todo-calendar-date small {
    border-radius: 999px;
    padding: .1rem .35rem;
    background: var(--tm-primary);
    color: var(--tm-on-accent);
    font-size: .62rem;
}

.tm-todo-calendar-entries {
    display: grid;
    gap: .3rem;
}

.tm-todo-calendar-entry {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: .3rem;
    border-left: .2rem solid var(--tm-neutral);
    border-radius: .3rem;
    padding: .3rem .35rem;
    background: var(--tm-surface-tint);
}

.tm-todo-calendar-entry-high { border-left-color: var(--tm-warning); }
.tm-todo-calendar-entry-urgent { border-left-color: var(--tm-danger); }
.tm-todo-calendar-entry-low { border-left-color: var(--tm-border-strong); }

.tm-todo-calendar-entry.is-complete {
    opacity: .65;
}

.tm-todo-calendar-check,
.tm-todo-calendar-entry-title {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--tm-text-strong);
}

.tm-todo-calendar-check {
    color: var(--tm-primary);
    line-height: 1.2;
}

.tm-todo-calendar-entry-title {
    overflow: hidden;
    font-size: .7rem;
    font-weight: var(--tm-font-weight-bold);
    line-height: 1.25;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tm-todo-calendar-entry-title:hover,
.tm-todo-calendar-entry-title:focus-visible {
    color: var(--tm-primary);
    text-decoration: underline;
}

@media (max-width: 991.98px) {
    .tm-todo-diary-head {
        align-items: stretch;
        flex-direction: column;
    }

    .tm-todo-view-switch {
        align-self: flex-start;
    }

    .tm-todo-board {
        grid-template-columns: repeat(4, minmax(17rem, 17rem));
    }
}

@media (max-width: 575.98px) {
    .tm-todo-diary-head {
        padding: 1rem;
    }

    .tm-todo-view-switch {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        width: 100%;
    }

    .tm-todo-view-link {
        justify-content: center;
        padding-inline: .45rem;
    }

    .tm-todo-add-card summary,
    .tm-todo-filter-card summary,
    .tm-todo-board-guide {
        align-items: flex-start;
        flex-direction: column;
        gap: .2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tm-todo-board-card,
    .tm-todo-board-column,
    .tm-todo-view-link {
        transition: none;
    }
}

/* Private communications: full-width inbox with an on-demand notification blade. */
.tm-communications-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--tm-section-gap);
    align-items: start;
}

.tm-communications-ledger,
.tm-conversation-shell {
    overflow: hidden;
    border: 1px solid var(--tm-border);
    border-radius: var(--tm-radius);
    background: var(--tm-surface);
    box-shadow: var(--tm-shadow-sm);
}

.tm-communications-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: var(--tm-section-gap);
}

.tm-communications-device {
    max-width: 100%;
}

.tm-communications-device summary {
    padding: .6rem 0;
    color: var(--tm-text-soft);
    font-size: var(--tm-font-size-sm);
    cursor: pointer;
}

.tm-notification-panel.offcanvas-end {
    --bs-offcanvas-width: 80vw;
    border-left: 1px solid var(--tm-border);
    background: var(--tm-surface);
    box-shadow: var(--tm-shadow-lg);
}

.tm-notification-panel-head {
    flex: 0 0 auto;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--tm-border);
}

.tm-notification-form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.tm-notification-form > .offcanvas-body {
    padding: 1.5rem;
}

.tm-notification-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 1.5rem;
}

.tm-notification-recipients {
    padding-right: 1.5rem;
    border-right: 1px solid var(--tm-border-soft);
}

.tm-notification-panel-footer {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--tm-border);
    background: var(--tm-surface);
}

.tm-notify-scope {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.tm-recipient-toggles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
    gap: .6rem;
    max-height: max(18rem, 45vh);
    padding: .25rem;
    overflow-y: auto;
    align-content: start;
}

.tm-recipient-toggles.is-invalid {
    outline: 1px solid var(--bs-form-invalid-border-color);
}

.tm-recipient-card.btn {
    display: flex;
    align-items: center;
    gap: .65rem;
    width: 100%;
    height: 100%;
    min-height: 3.75rem;
    padding: .75rem;
    text-align: left;
    white-space: normal;
    border-color: var(--tm-border);
    color: var(--tm-text);
    background: var(--tm-surface);
}

.tm-recipient-card > span {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.tm-recipient-card strong,
.tm-recipient-card small {
    display: block;
}

.tm-recipient-card strong { font-weight: var(--tm-font-weight-semibold); }
.tm-recipient-card small { color: var(--tm-text-muted); font-size: var(--tm-font-size-xs); }
.tm-recipient-check { visibility: hidden; }

.tm-recipient-option .btn-check:checked + .tm-recipient-card,
.tm-recipient-option .btn-check + .tm-recipient-card:hover {
    border-color: var(--tm-primary);
    color: var(--tm-primary);
    background: var(--tm-primary-soft);
}

.tm-recipient-option .btn-check:checked + .tm-recipient-card .tm-recipient-check { visibility: visible; }
.tm-recipient-option .btn-check:focus-visible + .tm-recipient-card { outline: 2px solid var(--tm-primary); outline-offset: 2px; }

@media (max-width: 991.98px) {
    .tm-notification-panel.offcanvas-end { --bs-offcanvas-width: 100vw; }
    .tm-notification-workspace { grid-template-columns: minmax(0, 1fr); }
    .tm-notification-recipients { padding-right: 0; padding-bottom: 1.25rem; border-right: 0; border-bottom: 1px solid var(--tm-border-soft); }
    .tm-notification-panel-head, .tm-notification-form > .offcanvas-body, .tm-notification-panel-footer { padding: 1rem; }
}

.tm-communications-kicker {
    display: block;
    margin-bottom: .25rem;
    color: var(--tm-primary);
    font-size: var(--tm-font-size-xs);
    font-weight: var(--tm-font-weight-bold);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.tm-conversation-head h2 {
    margin: 0;
    color: var(--tm-heading);
    font-size: 1.08rem;
    font-weight: var(--tm-font-weight-bold);
}

.tm-conversation-head p,
.tm-communications-push p {
    margin: .3rem 0 0;
    color: var(--tm-text-muted);
    font-size: var(--tm-font-size-sm);
}

.tm-communications-push {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .5rem;
    align-items: center;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--tm-border-soft);
}

.tm-communications-push [data-push-status] {
    grid-column: 1 / -1;
}

.tm-communications-ledger-head,
.tm-conversation-head {
    display: flex;
    gap: .75rem;
    align-items: center;
    justify-content: space-between;
    padding: var(--tm-card-padding);
    border-bottom: 1px solid var(--tm-border);
}

.tm-communications-ledger-head {
    flex-wrap: wrap;
}

.tm-communications-tabs {
    display: flex;
    gap: .25rem;
    align-items: center;
}

.tm-communications-tabs a {
    display: inline-flex;
    gap: .4rem;
    align-items: center;
    padding: .48rem .68rem;
    border-radius: var(--tm-radius-sm);
    color: var(--tm-text-soft);
    font-size: var(--tm-font-size-sm);
    font-weight: var(--tm-font-weight-semibold);
    text-decoration: none;
}

.tm-communications-tabs a:hover,
.tm-communications-tabs a:focus-visible {
    color: var(--tm-primary);
    background: var(--tm-primary-soft);
}

.tm-communications-tabs a.is-active {
    color: var(--tm-on-accent);
    background: var(--tm-primary);
}

.tm-communications-search {
    display: flex;
    width: min(100%, 25rem);
}

.tm-communications-search .form-control {
    border-radius: var(--tm-radius-sm) 0 0 var(--tm-radius-sm);
}

.tm-communications-search .btn {
    border-left: 0;
    border-radius: 0 var(--tm-radius-sm) var(--tm-radius-sm) 0;
}

.tm-communications-scope-note {
    display: flex;
    gap: .45rem;
    align-items: center;
    padding: .65rem var(--tm-card-padding);
    border-bottom: 1px solid var(--tm-border-soft);
    color: var(--tm-text-muted);
    background: var(--tm-surface-muted);
    font-size: var(--tm-font-size-xs);
}

.tm-communications-cleanup {
    padding: .65rem var(--tm-card-padding);
    border-bottom: 1px solid var(--tm-border-soft);
    background: var(--tm-surface);
}

.tm-communications-cleanup summary {
    width: fit-content;
    color: var(--tm-text-soft);
    font-size: var(--tm-font-size-sm);
    font-weight: var(--tm-font-weight-semibold);
    cursor: pointer;
}

.tm-communications-cleanup-form {
    display: grid;
    grid-template-columns: minmax(8rem, 11rem) minmax(8rem, 11rem) minmax(15rem, 1fr) auto;
    gap: .75rem;
    align-items: end;
    margin-top: .8rem;
}

.tm-communications-cleanup-confirm {
    align-self: center;
    margin: 1.5rem 0 0;
}

.tm-communications-cleanup > details > p {
    margin: .6rem 0 0;
    color: var(--tm-text-muted);
    font-size: var(--tm-font-size-xs);
}

.tm-message-attachment-note {
    display: inline-flex;
    gap: .25rem;
    align-items: center;
    color: var(--tm-primary);
    font-size: var(--tm-font-size-xs);
}

.tm-message-list {
    display: grid;
}

.tm-message-list-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    border-bottom: 1px solid var(--tm-border-row);
}

.tm-message-list-row:hover,
.tm-message-list-row:focus-within {
    background: var(--tm-primary-soft);
}

.tm-message-list-row .tm-message-list-item {
    border-bottom: 0;
}

.tm-message-list-row .tm-message-list-item:hover,
.tm-message-list-row .tm-message-list-item:focus-visible {
    background: transparent;
}

.tm-message-list-action {
    padding-right: var(--tm-card-padding);
}

.tm-message-list-action .btn {
    display: inline-flex;
    width: 2.25rem;
    height: 2.25rem;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.tm-message-list-head {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) auto;
    gap: .75rem;
    padding: .5rem var(--tm-card-padding);
    border-bottom: 1px solid var(--tm-border-soft);
    color: var(--tm-text-muted);
    background: var(--tm-surface-muted);
    font-size: var(--tm-font-size-xs);
    text-transform: uppercase;
}

.tm-message-list-head > span:nth-child(2) {
    display: flex;
    justify-content: space-between;
}

.tm-message-list-item {
    position: relative;
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) auto;
    gap: .75rem;
    align-items: center;
    min-height: 5.15rem;
    padding: .75rem var(--tm-card-padding);
    border-bottom: 1px solid var(--tm-border-row);
    color: inherit;
    text-decoration: none;
}

.tm-message-list-item::before {
    position: absolute;
    inset: .65rem auto .65rem 0;
    width: .22rem;
    border-radius: 0 .2rem .2rem 0;
    background: var(--tm-border-strong);
    content: "";
}

.tm-message-list-item:hover,
.tm-message-list-item:focus-visible {
    color: inherit;
    background: var(--tm-primary-soft);
}

.tm-message-list-item.is-unread {
    background: color-mix(in srgb, var(--tm-primary) 5%, var(--tm-surface));
}

.tm-message-list-item.is-unread::before,
.tm-message-list-item.is-sent::before {
    background: var(--tm-primary);
}

.tm-message-direction {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--tm-primary);
    background: var(--tm-primary-soft-strong);
}

.tm-message-list-copy,
.tm-message-list-line {
    min-width: 0;
}

.tm-message-list-copy {
    display: grid;
    gap: .18rem;
}

.tm-message-list-line {
    display: flex;
    gap: .65rem;
    align-items: baseline;
    justify-content: space-between;
}

.tm-message-list-line strong,
.tm-message-subject,
.tm-message-preview {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tm-message-list-line time,
.tm-message-preview {
    color: var(--tm-text-muted);
    font-size: var(--tm-font-size-xs);
}

.tm-message-subject {
    color: var(--tm-text-strong);
    font-size: var(--tm-font-size-sm);
    font-weight: var(--tm-font-weight-semibold);
}

.tm-communications-empty {
    display: grid;
    place-items: center;
    min-height: 17rem;
    padding: 2rem;
    color: var(--tm-text-muted);
    text-align: center;
}

.tm-communications-empty i {
    color: var(--tm-border-strong);
    font-size: 2rem;
}

.tm-communications-empty strong {
    color: var(--tm-text-strong);
}

.tm-conversation-timeline {
    position: relative;
    display: grid;
    gap: .9rem;
    padding: clamp(1rem, 2vw, 1.75rem);
    border-left: .2rem solid var(--tm-primary);
}

.tm-conversation-message {
    display: grid;
    gap: .35rem;
    width: min(78%, 52rem);
}

.tm-conversation-message.is-mine {
    justify-self: end;
}

.tm-conversation-message-meta {
    display: flex;
    gap: .6rem;
    align-items: baseline;
    justify-content: space-between;
    color: var(--tm-text-muted);
    font-size: var(--tm-font-size-xs);
}

.tm-conversation-message-meta strong {
    color: var(--tm-text-soft);
}

.tm-conversation-bubble {
    padding: .8rem .95rem;
    border: 1px solid var(--tm-border);
    border-radius: var(--tm-radius) var(--tm-radius) var(--tm-radius) .15rem;
    background: var(--tm-surface);
    overflow-wrap: anywhere;
    white-space: normal;
}

.tm-conversation-message.is-mine .tm-conversation-bubble {
    border-color: color-mix(in srgb, var(--tm-primary) 25%, var(--tm-border));
    border-radius: var(--tm-radius) var(--tm-radius) .15rem var(--tm-radius);
    background: var(--tm-primary-soft);
}

.tm-conversation-report-action {
    display: flex;
    gap: .75rem;
    align-items: center;
    justify-content: space-between;
    padding: .65rem .75rem;
    border: 1px dashed var(--tm-border-strong);
    border-radius: var(--tm-radius-sm);
    background: var(--tm-surface-muted);
}

.tm-conversation-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.tm-conversation-report-action > span:first-child {
    display: flex;
    gap: .45rem;
    align-items: center;
}

.tm-conversation-reply {
    display: flex;
    gap: .75rem;
    align-items: end;
    padding: var(--tm-card-padding);
    border-top: 1px solid var(--tm-border);
    background: var(--tm-surface);
}

@media (max-width: 991.98px) {
    .tm-communications-shell {
        grid-template-columns: 1fr;
    }

    .tm-communications-cleanup-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .tm-message-list-head {
        display: none;
    }

    .tm-communications-tabs,
    .tm-communications-search {
        width: 100%;
    }

    .tm-communications-tabs a {
        flex: 1;
        justify-content: center;
    }

    .tm-message-list-item {
        grid-template-columns: 1.75rem minmax(0, 1fr);
    }

    .tm-message-list-action {
        padding-right: .65rem;
    }

    .tm-message-list-item > :last-child {
        grid-column: 2;
        justify-self: start;
    }

    .tm-communications-cleanup-form {
        grid-template-columns: 1fr;
    }

    .tm-communications-cleanup-confirm {
        margin-top: 0;
    }

    .tm-message-list-line {
        align-items: flex-start;
        flex-direction: column;
        gap: .1rem;
    }

    .tm-conversation-head,
    .tm-conversation-reply {
        align-items: stretch;
        flex-direction: column;
    }

    .tm-conversation-message {
        width: 94%;
    }

    .tm-conversation-report-action {
        align-items: stretch;
        flex-direction: column;
    }
}
