:root {
    --crm-primary: #5B5FC7;
    --crm-primary-dark: #464EB8;
    --crm-primary-soft: #E8E8FC;
    --crm-accent: #5B5FC7;
    --crm-secondary: #616161;
    --crm-surface: #ffffff;
    --crm-bg: #ffffff;
    --crm-border: #EDEBE9;
    --crm-border-light: #F3F2F1;
    --crm-text: #242424;
    --crm-text-muted: #616161;
    --crm-sidebar: #FFFFFF;
    --crm-topbar: #201F1E;
    --crm-nav-text: #424242;
    --crm-nav-icon: #616161;
    --crm-nav-hover: #F3F2F1;
    --crm-nav-active-bg: var(--crm-primary-soft);
    --crm-input-bg: #ffffff;
    --crm-menu-bg: #ffffff;
    --crm-action-icon: #616161;
    --crm-action-hover-neutral: #f3f2f1;
    --crm-action-hover-edit: #fff4e5;
    --crm-action-hover-info: #e8f4fd;
    --crm-action-hover-danger: #fde7e9;
    --crm-action-sticky-bg: #ffffff;
    --crm-action-sticky-hover: #faf9ff;
    --crm-pipeline-column-bg: #f5f8fa;
    --crm-pipeline-card-bg: #ffffff;
    --crm-pipeline-card-hover-border: #c8d4e0;
    --crm-radius: 4px;
    --crm-radius-sm: 4px;
    --crm-radius-lg: 6px;
    --crm-radius-pill: 6px;
    --crm-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --crm-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --crm-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
    --crm-transition: 0.15s ease;
    --crm-control-height: 38px;
    --crm-control-height-compact: 34px;
    --crm-control-padding-x: 10px;
    --crm-control-font-size: 0.8125rem;
    --crm-control-line-height: 1.35;
    --crm-control-border-color: #cbd6e2;
    --crm-field-gap: 1.25rem;
    --crm-section-gap: 2rem;
    --crm-label-gap: 0.5rem;
}

/* ── Dark mode (whole app shell) ─────────────────────────────── */
.crm-app-layout.crm-dark {
    --crm-surface: #292827;
    --crm-bg: #141414;
    --crm-border: #3b3a39;
    --crm-border-light: #323130;
    --crm-text: #f3f2f1;
    --crm-text-muted: #a19f9d;
    --crm-sidebar: #1b1a19;
    --crm-topbar: #1b1a19;
    --crm-nav-text: #e1dfdd;
    --crm-nav-icon: #c8c6c4;
    --crm-nav-hover: rgba(255, 255, 255, 0.06);
    --crm-nav-active-bg: rgba(255, 255, 255, 0.1);
    --crm-input-bg: #292827;
    --crm-menu-bg: #292827;
    --crm-action-icon: #c8c6c4;
    --crm-action-hover-neutral: rgba(255, 255, 255, 0.08);
    --crm-action-hover-edit: rgba(202, 80, 16, 0.18);
    --crm-action-hover-info: rgba(0, 120, 212, 0.18);
    --crm-action-hover-danger: rgba(209, 52, 56, 0.18);
    --crm-action-sticky-bg: #292827;
    --crm-action-sticky-hover: #323130;
    --crm-pipeline-column-bg: #252423;
    --crm-pipeline-card-bg: #323130;
    --crm-pipeline-card-hover-border: #605e5c;
    --crm-control-border-color: #605e5c;
    --crm-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --crm-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    --crm-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
}

html:has(.crm-app-layout.crm-dark),
html:has(.crm-app-layout.crm-dark) body {
    background: #141414;
    color: #f3f2f1;
}

html:has(.crm-app-layout.crm-dark) .crm-panel__toolbar {
    background: #292827;
}

html:has(.crm-app-layout.crm-dark) .crm-stat-card--primary,
html:has(.crm-app-layout.crm-dark) .crm-stat-card--success,
html:has(.crm-app-layout.crm-dark) .crm-stat-card--warning,
html:has(.crm-app-layout.crm-dark) .crm-stat-card--info {
    background: var(--crm-surface) !important;
}

html:has(.crm-app-layout.crm-dark) .tm-dash {
    --tm-dash-bg: var(--crm-bg);
    --tm-dash-ink: var(--crm-text);
    --tm-dash-muted: var(--crm-text-muted);
}

html:has(.crm-app-layout.crm-dark) .tm-dash-header,
html:has(.crm-app-layout.crm-dark) .tm-dash .crm-widget.tm-dash-card {
    background: var(--crm-surface) !important;
    border-color: var(--crm-border);
    box-shadow: none !important;
}

html:has(.crm-app-layout.crm-dark) .tm-dash-header__title,
html:has(.crm-app-layout.crm-dark) .tm-kpi__value,
html:has(.crm-app-layout.crm-dark) .tm-area-empty__title,
html:has(.crm-app-layout.crm-dark) .tm-dash .crm-widget-title {
    color: var(--crm-text) !important;
}

html:has(.crm-app-layout.crm-dark) .tm-dash-header__kicker,
html:has(.crm-app-layout.crm-dark) .tm-dash-header__sub,
html:has(.crm-app-layout.crm-dark) .tm-kpi__label,
html:has(.crm-app-layout.crm-dark) .tm-dash-row__due,
html:has(.crm-app-layout.crm-dark) .tm-area-empty__sub {
    color: var(--crm-text-muted);
}

html:has(.crm-app-layout.crm-dark) .tm-dash-btn {
    background: var(--crm-surface);
    border-color: var(--crm-border);
    color: var(--crm-text);
}

html:has(.crm-app-layout.crm-dark) .tm-dash-btn--primary {
    background: var(--crm-primary);
    border-color: var(--crm-primary);
    color: #fff;
}

html:has(.crm-app-layout.crm-dark) .crm-stat-card--active,
html:has(.crm-app-layout.crm-dark) .crm-stat-card--completed,
html:has(.crm-app-layout.crm-dark) .crm-stat-card--overdue,
html:has(.crm-app-layout.crm-dark) .crm-stat-card--hours {
    background: var(--crm-surface) !important;
    border-color: var(--crm-border) !important;
}

html:has(.crm-app-layout.crm-dark) .crm-stat-card--active .tm-kpi__value,
html:has(.crm-app-layout.crm-dark) .crm-stat-card--completed .tm-kpi__value,
html:has(.crm-app-layout.crm-dark) .crm-stat-card--overdue .tm-kpi__value,
html:has(.crm-app-layout.crm-dark) .crm-stat-card--hours .tm-kpi__value {
    color: var(--crm-text);
}

html:has(.crm-app-layout.crm-dark) .crm-donut-chart__legend--cards .crm-donut-chart__legend-item,
html:has(.crm-app-layout.crm-dark) .tm-dash .tm-dash-row:hover,
html:has(.crm-app-layout.crm-dark) .tm-dash-list--recent .tm-dash-row:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--crm-border);
}

html:has(.crm-app-layout.crm-dark) .tm-area-empty__icon {
    background: rgba(99, 102, 241, 0.16);
    color: #A5B4FC;
}

html:has(.crm-app-layout.crm-dark) .crm-main-content .mud-table-head .mud-table-cell,
html:has(.crm-app-layout.crm-dark) .crm-data-table-wrap .mud-table-head .mud-table-cell {
    background: #323130 !important;
}

html:has(.crm-app-layout.crm-dark) .crm-main-content .mud-table-row:hover,
html:has(.crm-app-layout.crm-dark) .crm-data-table-wrap .mud-table-body .mud-table-row:hover {
    background: rgba(255, 255, 255, 0.04) !important;
}

html:has(.crm-app-layout.crm-dark) .crm-editor-footer {
    background: linear-gradient(to top, var(--crm-bg) 70%, rgba(20, 20, 20, 0));
}

html:has(.crm-app-layout.crm-dark) .crm-main-content .crm-panel,
html:has(.crm-app-layout.crm-dark) .crm-main-content .crm-section-editor,
html:has(.crm-app-layout.crm-dark) .crm-main-content .record-drawer__inner,
html:has(.crm-app-layout.crm-dark) .mud-dialog .mud-dialog-content {
    --mud-palette-text-primary: #f3f2f1;
    --mud-palette-text-secondary: #a19f9d;
    --mud-palette-text-disabled: #797775;
    --mud-palette-action-default: #a19f9d;
    --mud-palette-surface: #292827;
    --mud-palette-background: #141414;
    --mud-palette-lines-inputs: #605e5c;
}

html:has(.crm-app-layout.crm-dark) .crm-record-filter {
    background: var(--crm-surface);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

html:has(.crm-app-layout.crm-dark) .crm-empty-state__icon {
    background: #323130;
    color: #a19f9d;
}

/* MudBlazor menus, popovers, selects (render outside layout tree) */
html:has(.crm-app-layout.crm-dark) .mud-popover-paper,
html:has(.crm-app-layout.crm-dark) .mud-menu .mud-list,
html:has(.crm-app-layout.crm-dark) .mud-select-popover .mud-list,
html:has(.crm-app-layout.crm-dark) .mud-autocomplete-popover .mud-list {
    background-color: #292827 !important;
    color: #f3f2f1 !important;
    border: 1px solid #3b3a39 !important;
}

html:has(.crm-app-layout.crm-dark) .mud-list-item,
html:has(.crm-app-layout.crm-dark) .mud-menu-item {
    color: #f3f2f1 !important;
}

html:has(.crm-app-layout.crm-dark) .mud-list-item:hover,
html:has(.crm-app-layout.crm-dark) .mud-menu-item:hover,
html:has(.crm-app-layout.crm-dark) .mud-list-item:focus-visible,
html:has(.crm-app-layout.crm-dark) .mud-menu-item:focus-visible {
    background-color: rgba(255, 255, 255, 0.06) !important;
}

html:has(.crm-app-layout.crm-dark) .mud-list-item-text,
html:has(.crm-app-layout.crm-dark) .mud-menu-item .mud-menu-item-text {
    color: #f3f2f1 !important;
}

html:has(.crm-app-layout.crm-dark) .mud-list-item-icon .mud-icon-root,
html:has(.crm-app-layout.crm-dark) .mud-menu-item .mud-icon-root {
    color: #c8c6c4 !important;
}

html:has(.crm-app-layout.crm-dark) .mud-divider {
    border-color: #3b3a39 !important;
}

html:has(.crm-app-layout.crm-dark) .crm-filter-menu {
    background: var(--crm-menu-bg);
    border-color: var(--crm-border);
    box-shadow: var(--crm-shadow-lg);
}

html:has(.crm-app-layout.crm-dark) .crm-filter-menu__item--selected:hover {
    background: rgba(255, 255, 255, 0.1);
}

html:has(.crm-app-layout.crm-dark) .crm-filter-menu__checkbox {
    background: #323130;
    border-color: var(--crm-control-border-color);
}

html:has(.crm-app-layout.crm-dark) .crm-global-search__input,
html:has(.crm-app-layout.crm-dark) .crm-filter-trigger {
    background: var(--crm-input-bg);
    color: var(--crm-text);
}

html:has(.crm-app-layout.crm-dark) .crm-filter-trigger__text {
    color: var(--crm-text);
}

html:has(.crm-app-layout.crm-dark) .crm-col-actions,
html:has(.crm-app-layout.crm-dark) .crm-data-table-wrap .mud-table-head .crm-col-actions {
    background: var(--crm-action-sticky-bg) !important;
    box-shadow: -8px 0 16px -8px rgba(0, 0, 0, 0.35);
}

html:has(.crm-app-layout.crm-dark) .crm-data-table-wrap .mud-table-body .mud-table-row:hover .crm-col-actions {
    background: var(--crm-action-sticky-hover) !important;
}

html:has(.crm-app-layout.crm-dark) .crm-action-btn.mud-icon-button {
    color: var(--crm-action-icon) !important;
}

html:has(.crm-app-layout.crm-dark) .crm-action-btn--view:hover {
    background: var(--crm-action-hover-neutral) !important;
    color: var(--crm-text) !important;
}

html:has(.crm-app-layout.crm-dark) .crm-action-btn--edit:hover {
    background: var(--crm-action-hover-edit) !important;
    color: #ffaa44 !important;
}

html:has(.crm-app-layout.crm-dark) .crm-action-btn--info:hover {
    background: var(--crm-action-hover-info) !important;
    color: #4da6ff !important;
}

html:has(.crm-app-layout.crm-dark) .crm-action-btn--danger:hover {
    background: var(--crm-action-hover-danger) !important;
    color: #ff6b6f !important;
}

html:has(.crm-app-layout.crm-dark) .record-drawer--view .mud-drawer-content,
html:has(.crm-app-layout.crm-dark) .record-drawer--view .record-drawer__body {
    background: #1f1e1e !important;
}

html:has(.crm-app-layout.crm-dark) .record-view-section__header {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, var(--crm-surface) 100%);
}

html:has(.crm-app-layout.crm-dark) .crm-sidebar-nav__menu .mud-nav-group > .mud-nav-link {
    color: var(--crm-nav-text) !important;
}

html:has(.crm-app-layout.crm-dark) .crm-sidebar-nav__menu .mud-nav-link-expand-icon,
html:has(.crm-app-layout.crm-dark) .crm-sidebar-nav__menu .mud-nav-group .mud-nav-link .mud-icon-root {
    color: var(--crm-nav-icon) !important;
}

html:has(.crm-app-layout.crm-dark) .crm-notification-item--unread {
    background: rgba(255, 255, 255, 0.06);
}

html:has(.crm-app-layout.crm-dark) .crm-data-table-wrap .mud-table-body .mud-table-row:hover {
    background: rgba(255, 255, 255, 0.04) !important;
}

html:has(.crm-app-layout.crm-dark) ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

html:has(.crm-app-layout.crm-dark) ::-webkit-scrollbar-track {
    background: #1b1a19;
}

html:has(.crm-app-layout.crm-dark) ::-webkit-scrollbar-thumb {
    background: #484644;
    border-radius: 6px;
    border: 2px solid #1b1a19;
}

html:has(.crm-app-layout.crm-dark) ::-webkit-scrollbar-thumb:hover {
    background: #605e5c;
}

html:has(.crm-app-layout.crm-dark) .mud-link,
html:has(.crm-app-layout.crm-dark) .mud-table-cell .mud-link {
    color: #6cb8ff !important;
}

html:has(.crm-app-layout.crm-dark) .crm-view-mode-toggle__btn--active {
    background: var(--crm-surface) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

html:has(.crm-app-layout.crm-dark) .pipeline-stage--blue { background: rgba(91, 95, 199, 0.16); }
html:has(.crm-app-layout.crm-dark) .pipeline-stage--orange { background: rgba(255, 122, 89, 0.14); }
html:has(.crm-app-layout.crm-dark) .pipeline-stage--teal { background: rgba(0, 189, 165, 0.14); }
html:has(.crm-app-layout.crm-dark) .pipeline-stage--pink { background: rgba(242, 84, 125, 0.14); }
html:has(.crm-app-layout.crm-dark) .pipeline-stage--purple { background: rgba(124, 58, 237, 0.14); }
html:has(.crm-app-layout.crm-dark) .pipeline-stage--green { background: rgba(0, 189, 165, 0.14); }
html:has(.crm-app-layout.crm-dark) .pipeline-stage--gray { background: rgba(153, 172, 194, 0.12); }

html:has(.crm-app-layout.crm-dark) .pipeline-column__count {
    background: rgba(255, 255, 255, 0.1);
}

html:has(.crm-app-layout.crm-dark) .pipeline-card:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    border-color: var(--crm-pipeline-card-hover-border);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    font-family: 'Segoe UI', 'Plus Jakarta Sans', 'Inter', 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    background: var(--crm-bg);
    color: var(--crm-text);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.mud-button-root.mud-button-filled-primary {
    background: var(--crm-primary) !important;
    box-shadow: none !important;
    border-radius: var(--crm-radius-pill) !important;
    font-weight: 500 !important;
}

.mud-button-root.mud-button-filled-primary:hover {
    background: var(--crm-primary-dark) !important;
}

.mud-button-root.mud-button-outlined {
    border-radius: var(--crm-radius-pill) !important;
    border-color: var(--crm-border) !important;
    font-weight: 500 !important;
}

/* ── Compact form controls (app-wide) ───────────────────────── */

/* Native multiline fields must never inherit single-line control sizing */
textarea.crm-native-textarea,
.crm-native-textarea {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 4.5rem !important;
    max-height: none !important;
    padding: 0.5rem 0.625rem !important;
    line-height: 1.5 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    vertical-align: top !important;
    field-sizing: content;
}

.mud-input-slot input,
.mud-input-root input,
.mud-input-root textarea,
.mud-select .mud-select-input .mud-input-slot {
    font-weight: 400 !important;
}

.mud-input-outlined .mud-input-root,
.mud-select .mud-select-input.mud-input-root,
.mud-picker .mud-input-root,
.mud-autocomplete .mud-input-root {
    min-height: var(--crm-control-height) !important;
    height: var(--crm-control-height) !important;
    max-height: var(--crm-control-height) !important;
    margin-top: 0 !important;
}

.mud-input-outlined .mud-input-root:has(textarea),
.crm-input:has(textarea) .mud-input-root {
    height: auto !important;
    min-height: unset !important;
    max-height: none !important;
}

.mud-input-outlined .mud-input-slot,
.mud-select .mud-select-input .mud-input-slot,
.mud-picker .mud-input-slot,
.mud-autocomplete .mud-input-slot {
    min-height: var(--crm-control-height) !important;
    height: var(--crm-control-height) !important;
    max-height: var(--crm-control-height) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: var(--crm-control-padding-x) !important;
    padding-right: var(--crm-control-padding-x) !important;
    font-size: var(--crm-control-font-size) !important;
    font-weight: 400 !important;
    line-height: var(--crm-control-line-height) !important;
    overflow: visible !important;
    box-sizing: border-box !important;
}

.mud-input-outlined .mud-input-control-input-container,
.crm-input .mud-input-control-input-container,
.mud-input-number-control .mud-input-control-input-container {
    overflow: visible !important;
    min-height: var(--crm-control-height) !important;
    height: var(--crm-control-height) !important;
}

.mud-input-outlined .mud-input-control-input-container input,
.crm-input .mud-input-control-input-container input {
    line-height: var(--crm-control-line-height) !important;
    height: 100% !important;
    min-height: var(--crm-control-height) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    overflow: visible !important;
    box-sizing: border-box !important;
}

.mud-input-outlined .mud-input-slot:has(textarea),
.crm-input:has(textarea) .mud-input-slot,
.mud-input-outlined textarea.mud-input-slot,
.crm-input textarea.mud-input-slot {
    height: auto !important;
    min-height: 72px !important;
    max-height: none !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    align-items: stretch !important;
    display: block !important;
}

.mud-input-outlined .mud-input-outlined-border {
    border-radius: var(--crm-radius) !important;
    border-color: var(--crm-control-border-color) !important;
}

.mud-input-dense .mud-input-root,
.mud-input-dense .mud-input-slot,
.mud-select.mud-input-dense .mud-select-input.mud-input-root,
.mud-select.mud-input-dense .mud-select-input .mud-input-slot,
.mud-picker.mud-input-dense .mud-input-root,
.mud-picker.mud-input-dense .mud-input-slot {
    min-height: var(--crm-control-height-compact) !important;
    height: var(--crm-control-height-compact) !important;
    max-height: var(--crm-control-height-compact) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.mud-input-control-input-container .mud-input-slot {
    font-weight: 400 !important;
}

.mud-button-root {
    text-transform: none !important;
    letter-spacing: normal !important;
}

.mud-button-root.mud-button-size-medium {
    min-height: var(--crm-control-height) !important;
    height: var(--crm-control-height) !important;
    padding: 0 14px !important;
    font-size: 0.8125rem !important;
}

.mud-button-root.mud-button-size-large {
    min-height: 38px !important;
    height: 38px !important;
    padding: 0 16px !important;
    font-size: 0.875rem !important;
}

.mud-button-root.mud-button-size-small {
    min-height: 28px !important;
    height: 28px !important;
    padding: 0 10px !important;
    font-size: 0.75rem !important;
}

.mud-picker .mud-input-slot,
.mud-autocomplete .mud-input-slot {
    min-height: var(--crm-control-height) !important;
}

/* Hide numeric up/down spin buttons app-wide */
.mud-input-numeric-spin {
    display: none !important;
}

.mud-input-number-control.mud-input-showspin .mud-input:not(.mud-input-adorned-end) input,
.mud-input-number-control.mud-input-showspin .mud-input:not(.mud-input-adorned-end) input.mud-input-root {
    padding-right: 12px !important;
    padding-inline-end: 12px !important;
}

.mud-input-number-control input::-webkit-outer-spin-button,
.mud-input-number-control input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

.mud-input-number-control input[type="number"] {
    -moz-appearance: textfield;
}

/* ── Auth pages ─────────────────────────────────────────────── */

.auth-shell {
    min-height: 100vh;
    background:
        radial-gradient(1200px 480px at 50% -80px, rgba(99, 102, 241, 0.16), transparent 60%),
        radial-gradient(700px 320px at 100% 100%, rgba(167, 139, 250, 0.12), transparent 50%),
        #F7F8FC;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    background: transparent;
}

.auth-page__main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem 5rem;
}

.auth-page__content {
    width: 100%;
    max-width: 420px;
}

.auth-page__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.35rem;
}

.auth-page__logo {
    width: 52px;
    height: 52px;
    margin-bottom: 0.7rem;
    border-radius: 14px;
    background: linear-gradient(145deg, #818CF8 0%, #4F46E5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.28);
}

.auth-page__logo .mud-icon-root {
    font-size: 1.65rem !important;
}

.auth-page__brand-copy {
    text-align: center;
}

.auth-page__brand-name {
    font-weight: 750 !important;
    letter-spacing: -0.03em;
    color: #111827 !important;
    line-height: 1.2 !important;
}

.auth-page__brand-tag {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.8125rem;
    color: #6B7280;
}

.auth-card {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    padding: 1.75rem 1.6rem 1.35rem;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 16px 40px rgba(17, 24, 39, 0.06);
}

.auth-card__title {
    font-weight: 750 !important;
    letter-spacing: -0.03em;
    color: #111827 !important;
    margin-bottom: 0.25rem !important;
    text-align: center;
}

.auth-card__subtitle {
    color: #6B7280 !important;
    margin-bottom: 1.5rem !important;
    line-height: 1.5 !important;
    text-align: center;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    text-align: left;
}

.auth-label {
    margin: 0.35rem 0 0.2rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #374151;
}

.auth-field {
    margin: 0 0 0.55rem !important;
}

.auth-field .mud-input-control-input-container {
    background: #F8FAFC;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 0 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.auth-field .mud-input-control-input-container:hover {
    border-color: #C7D2FE;
    background: #fff;
}

.auth-field.mud-input-focused .mud-input-control-input-container,
.auth-field .mud-input-control-input-container:focus-within {
    border-color: #6366F1;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
}

.auth-field .mud-input-underline:before,
.auth-field .mud-input-underline:after,
.auth-field .mud-input-underline:hover:not(.mud-disabled):before,
.auth-field .mud-input-underline:hover:not(.mud-disabled):after,
.auth-field .mud-input-underline.mud-disabled:before,
.auth-field .mud-input-underline.mud-disabled:after {
    display: none !important;
}

.auth-field .mud-input-label {
    display: none !important;
}

.auth-field .mud-input > input.mud-input-root,
.auth-field .mud-input-slot,
.auth-field .mud-input-slot input {
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: #111827;
    padding: 10px 0;
}

.auth-field .mud-input > input.mud-input-root::placeholder,
.auth-field .mud-input-slot input::placeholder {
    color: #9CA3AF;
    font-weight: 400 !important;
    opacity: 1;
}

.auth-field .mud-input-adornment .mud-icon-root {
    color: #9CA3AF;
    font-size: 1.1rem !important;
}

.auth-field .mud-input-adornment-start {
    margin-inline-end: 8px;
}

.auth-field .mud-input-adornment-end .mud-icon-button {
    color: #6B7280 !important;
    width: 28px !important;
    height: 28px !important;
    padding: 4px !important;
}

.auth-field .mud-input-adornment-end .mud-icon-root {
    font-size: 1.1rem !important;
}

.auth-form__error {
    margin: 0 0 0.5rem;
    border-radius: 10px !important;
}

.auth-btn.mud-button-root {
    margin-top: 0.55rem !important;
    min-height: 42px !important;
    height: 42px !important;
    border-radius: 12px !important;
    font-size: 0.875rem !important;
    font-weight: 700 !important;
    text-transform: none !important;
    letter-spacing: 0;
    background: #4F46E5 !important;
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.28) !important;
}

.auth-btn.mud-button-root:hover {
    background: #4338CA !important;
    box-shadow: 0 10px 22px rgba(79, 70, 229, 0.34) !important;
}

.auth-form__links {
    margin-top: 1.25rem;
}

.auth-link.mud-button-root {
    color: #4F46E5 !important;
    text-transform: none !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
}

.auth-link.mud-button-root:hover {
    background: rgba(99, 102, 241, 0.08) !important;
}

.auth-demo {
    margin-top: 1.15rem;
    padding-top: 1.05rem;
    border-top: 1px solid #F3F4F6;
}

.auth-demo__title {
    margin: 0 0 0.55rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9CA3AF;
    text-align: center;
}

.auth-demo__row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    margin-bottom: 0.4rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid #EEF2F7;
    border-radius: 10px;
    background: #F8FAFC;
    cursor: pointer;
    text-align: left;
}

.auth-demo__row:hover {
    border-color: #C7D2FE;
    background: #EEF2FF;
}

.auth-demo__badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 0.5rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    flex-shrink: 0;
}

.auth-demo__badge--employee {
    background: #ECFDF5;
    color: #047857;
}

.auth-demo__badge--manager {
    background: #EEF2FF;
    color: #4338CA;
}

.auth-demo__email {
    min-width: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: #4B5563;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-demo-hint {
    display: none;
}

.auth-page__footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.25rem 1.5rem;
    text-align: center;
    font-size: 0.8125rem;
    color: #6B7280;
}

.auth-page__footer a {
    color: #4F46E5;
    text-decoration: none;
    font-weight: 600;
}

.auth-page__footer a:hover {
    text-decoration: underline;
}

.auth-page__footer-sep {
    margin: 0 0.375rem;
    color: #D1D5DB;
}

/* ── App shell ──────────────────────────────────────────────── */


.crm-appbar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(8px);
}

.crm-appbar__brand {
    margin-left: 0.25rem;
}

.crm-appbar__logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
}

.crm-appbar__title {
    font-weight: 600 !important;
    line-height: 1.2 !important;
    color: #fff !important;
}

.crm-appbar__subtitle {
    color: rgba(248, 250, 252, 0.65) !important;
    line-height: 1 !important;
}

.crm-user-chip {
    font-weight: 500 !important;
}

.crm-drawer {
    border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.crm-main-content {
    background: var(--crm-bg) !important;
    min-height: calc(100vh - 64px);
}

/* Removed duplicate padding rule — see unified .crm-page-container below */

/* ── Navigation ─────────────────────────────────────────────── */

.crm-nav {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.crm-nav__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 0.5rem;
}

.crm-nav__header-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #93c5fd;
}

.crm-nav__header-title {
    font-weight: 600 !important;
    color: #f1f5f9 !important;
    line-height: 1.2 !important;
}

.crm-nav__header-sub {
    color: #64748b !important;
}

.crm-nav-menu .mud-nav-link {
    border-radius: 8px;
    margin: 2px 8px;
    transition: background 0.15s ease;
}

.crm-nav-menu .mud-nav-link.active {
    background: rgba(37, 99, 235, 0.2) !important;
    color: #93c5fd !important;
}

.crm-nav-menu .mud-nav-group .mud-navmenu {
    padding-left: 1.125rem;
    margin-left: 0.375rem;
}

.crm-nav-menu .mud-nav-group .mud-navmenu .mud-nav-link {
    padding-left: 0.875rem !important;
    padding-inline-start: 0.875rem !important;
}

/* ── Page header ────────────────────────────────────────────── */

.crm-page-header__eyebrow {
    color: var(--crm-primary) !important;
    font-weight: 600 !important;
    letter-spacing: 0.08em;
    display: block;
    margin-bottom: 0.25rem;
}

.crm-page-header__title {
    font-weight: 700 !important;
    letter-spacing: -0.02em;
}

.crm-page-header__description {
    color: var(--crm-text-muted) !important;
}

/* ── Dashboard stat cards ───────────────────────────────────── */

.crm-stat-card {
    border-radius: var(--crm-radius-lg) !important;
    border: 1px solid var(--crm-border) !important;
    box-shadow: none !important;
    background: var(--crm-surface) !important;
    transition: box-shadow 0.15s ease;
    height: 100%;
}

.crm-stat-card:hover {
    box-shadow: var(--crm-shadow-sm) !important;
}

.crm-stat-label {
    color: var(--crm-text-muted) !important;
    font-weight: 500 !important;
    text-transform: none;
    letter-spacing: normal;
    font-size: 0.75rem !important;
}

.crm-stat-value {
    font-weight: 600 !important;
    letter-spacing: -0.02em;
    color: var(--crm-text) !important;
}

.crm-stat-subtitle {
    color: var(--crm-text-muted) !important;
    font-weight: 400 !important;
}

.crm-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.crm-stat-icon--primary { background: var(--crm-primary-soft); color: var(--crm-primary); }
.crm-stat-icon--success { background: #E7F5E7; color: #107C10; }
.crm-stat-icon--warning { background: #FFF4E5; color: #CA5010; }
.crm-stat-icon--info    { background: #E8E8FC; color: #464EB8; }

.crm-stat-card--primary,
.crm-stat-card--success,
.crm-stat-card--warning,
.crm-stat-card--info {
    background: #fff !important;
    border-color: var(--crm-border) !important;
}

.crm-stat-card.tm-kpi {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    height: 100%;
    padding: 1.05rem 1.1rem 1rem;
    border-radius: 16px !important;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 10px 24px rgba(17, 24, 39, 0.05) !important;
    overflow: hidden;
}

.tm-kpi__icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tm-kpi__icon .mud-icon-root {
    font-size: 1.35rem !important;
}

.tm-kpi__body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.tm-kpi__label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #6B7280;
}

.tm-kpi__value {
    font-size: 1.85rem;
    font-weight: 750;
    letter-spacing: -0.04em;
    line-height: 1.1;
    color: #111827;
    font-variant-numeric: tabular-nums;
}

.tm-kpi__hint {
    margin-top: 0.2rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.tm-kpi__hint--muted { color: #6B7280; font-weight: 500; }
.tm-kpi__hint--up { color: #16A34A; }
.tm-kpi__hint--down { color: #DC2626; }
.tm-kpi__hint--warn { color: #DC2626; }
.tm-kpi__hint--ok { color: #16A34A; }

.crm-stat-card--active {
    background: linear-gradient(180deg, #EEF2FF 0%, #FFFFFF 58%) !important;
    border-color: #E0E7FF !important;
}
.crm-stat-card--active .tm-kpi__icon { background: #E0E7FF; color: #4F46E5; }
.crm-stat-card--active .tm-kpi__value { color: #312E81; }

.crm-stat-card--completed {
    background: linear-gradient(180deg, #ECFDF5 0%, #FFFFFF 58%) !important;
    border-color: #D1FAE5 !important;
}
.crm-stat-card--completed .tm-kpi__icon { background: #D1FAE5; color: #15803D; }
.crm-stat-card--completed .tm-kpi__value { color: #14532D; }

.crm-stat-card--overdue {
    background: linear-gradient(180deg, #FEF2F2 0%, #FFFFFF 58%) !important;
    border-color: #FECACA !important;
}
.crm-stat-card--overdue .tm-kpi__icon { background: #FEE2E2; color: #DC2626; }
.crm-stat-card--overdue .tm-kpi__value { color: #7F1D1D; }

.crm-stat-card--hours {
    background: linear-gradient(180deg, #F5F3FF 0%, #FFFFFF 58%) !important;
    border-color: #EDE9FE !important;
}
.crm-stat-card--hours .tm-kpi__icon { background: #EDE9FE; color: #7C3AED; }
.crm-stat-card--hours .tm-kpi__value { color: #4C1D95; }

/* ── Panels & tables (global inner pages) ───────────────────── */

.crm-panel,
.crm-main-content .mud-paper:not(.crm-stat-card):not(.auth-card) {
    border-radius: var(--crm-radius) !important;
    border: 1px solid var(--crm-border);
    box-shadow: var(--crm-shadow-sm) !important;
    background: var(--crm-surface) !important;
    overflow: hidden;
}

.crm-panel__toolbar {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--crm-border);
    background: #fafbfc;
}

.crm-panel__body {
    padding: 1.25rem;
}

.crm-main-content .mud-table {
    border-radius: 0;
}

.crm-main-content .mud-table-head .mud-table-cell {
    font-weight: 600 !important;
    text-transform: uppercase;
    font-size: 0.6875rem !important;
    letter-spacing: 0.05em;
    color: var(--crm-text-muted) !important;
    background: #f8fafc !important;
}

.crm-main-content .mud-table-row:hover {
    background: #f8fafc !important;
}

.crm-main-content .mud-button-filled-primary {
    border-radius: 10px !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25) !important;
}

.crm-main-content .mud-button-outlined {
    border-radius: 10px !important;
}

.crm-main-content .mud-input-outlined .mud-input-outlined-border {
    border-radius: 10px !important;
}

.crm-welcome-banner {
    border-radius: var(--crm-radius-lg) !important;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: var(--crm-shadow) !important;
    overflow: hidden;
    position: relative;
}

.crm-welcome-banner::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.crm-welcome-banner .mud-typography {
    color: #fff !important;
    position: relative;
    z-index: 1;
}

.crm-welcome-banner .mud-typography-body2 {
    color: rgba(255, 255, 255, 0.85) !important;
}

.crm-empty-state {
    text-align: center;
}

.crm-empty-state__icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

/* ── Blazor defaults ────────────────────────────────────────── */

a, .btn-link {
    color: var(--crm-primary);
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

/* ══════════════════════════════════════════════════════════════
   Enterprise CRM — Planner-inspired UI
   ══════════════════════════════════════════════════════════════ */

/* Top bar */
.crm-topbar {
    background: var(--crm-topbar) !important;
    border-bottom: 1px solid var(--crm-border) !important;
    color: var(--crm-text) !important;
    padding: 0 !important;
}

.crm-topbar .mud-toolbar-appbar {
    min-height: 48px !important;
    padding: 0 1rem !important;
    width: 100%;
}

.crm-topbar__right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.125rem;
    margin-left: auto;
}

.crm-global-search {
    position: relative;
    width: 100%;
}

.crm-global-search__icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #616161 !important;
    pointer-events: none;
}

.crm-global-search__input {
    width: 100%;
    height: 32px;
    padding: 0 0.75rem 0 2rem;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius-pill);
    background: var(--crm-input-bg);
    color: var(--crm-text);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 400;
    transition: border-color var(--crm-transition), box-shadow var(--crm-transition);
}

.crm-global-search__input:focus {
    outline: none;
    border-color: var(--crm-primary);
    box-shadow: 0 0 0 2px rgba(91, 95, 199, 0.15);
}

.crm-global-search__input::placeholder { color: #a19f9d; }

.crm-global-search { position: relative; }

.crm-global-search__results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--crm-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 360px;
    overflow-y: auto;
    z-index: 1300;
}

.crm-global-search__result {
    display: grid;
    grid-template-columns: 72px 1fr;
    grid-template-rows: auto auto;
    gap: 0 12px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    border-bottom: 1px solid var(--crm-border-light);
}

.crm-global-search__result:hover { background: var(--crm-border-light); }

.crm-global-search__type {
    grid-row: 1 / span 2;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--crm-primary);
    align-self: center;
}

.crm-global-search__title { font-size: 0.8125rem; font-weight: 500; color: var(--crm-text); }
.crm-global-search__subtitle { font-size: 0.75rem; color: var(--crm-text-muted); grid-column: 2; }
.crm-global-search__empty { padding: 16px; font-size: 0.8125rem; color: var(--crm-text-muted); }

.crm-notifications-panel { min-width: 320px; max-width: 380px; }
.crm-notifications-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 8px;
    border-bottom: 1px solid var(--crm-border-light);
}

.crm-notification-item--unread { background: rgba(91, 95, 199, 0.06); }
.crm-notification-item__title { font-weight: 600; }
.crm-notification-item__time { margin-top: 4px; display: block; }

.crm-theme-presets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.crm-theme-preset {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 8px;
    border: 2px solid var(--crm-border);
    border-radius: 8px;
    background: var(--crm-surface);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.crm-theme-preset:hover { border-color: var(--preset-color, var(--crm-primary)); }
.crm-theme-preset--active {
    border-color: var(--preset-color, var(--crm-primary));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--preset-color, var(--crm-primary)) 25%, transparent);
}

.crm-theme-preset__swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--preset-color, var(--crm-primary));
}

.crm-theme-preset__label { font-size: 0.75rem; color: var(--crm-text-muted); }

.crm-theme-menu {
    padding: 0.75rem;
    min-width: 220px;
}

.crm-theme-menu__heading {
    display: block;
    padding: 0 0.25rem 0.5rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--crm-text-muted);
}

.crm-theme-menu__options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.crm-theme-menu__option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, border-color 0.15s;
}

.crm-theme-menu__option:hover {
    background: var(--crm-border-light);
}

.crm-theme-menu__option--active {
    background: color-mix(in srgb, var(--preset-color, var(--crm-primary)) 10%, transparent);
    border-color: color-mix(in srgb, var(--preset-color, var(--crm-primary)) 35%, transparent);
}

.crm-theme-menu__swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--preset-color, var(--crm-primary));
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.crm-theme-menu__label {
    flex: 1;
    font-size: 0.8125rem;
    color: var(--crm-text);
}

.crm-theme-menu__check {
    color: var(--preset-color, var(--crm-primary)) !important;
}

.crm-export-menu-popover {
    border-radius: 12px !important;
    border: 1px solid var(--crm-border) !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12) !important;
    overflow: hidden;
    background: var(--crm-surface) !important;
}

.crm-export-menu-list.mud-list {
    padding: 0 !important;
    background: transparent !important;
}

.crm-export-menu {
    padding: 0.625rem;
    min-width: 252px;
}

.crm-export-menu__heading {
    display: block;
    padding: 0.25rem 0.5rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--crm-text-muted);
}

.crm-export-menu__options {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.crm-export-menu__option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.crm-export-menu__option:hover:not(:disabled) {
    background: var(--crm-border-light);
    border-color: var(--crm-border);
}

.crm-export-menu__option:active:not(:disabled) {
    transform: scale(0.99);
}

.crm-export-menu__option:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.crm-export-menu__icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.crm-export-menu__icon--pdf {
    background: color-mix(in srgb, #dc2626 12%, transparent);
    color: #dc2626;
}

.crm-export-menu__icon--excel {
    background: color-mix(in srgb, #16a34a 12%, transparent);
    color: #16a34a;
}

.crm-export-menu__text {
    flex: 1;
    min-width: 0;
}

.crm-export-menu__title {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--crm-text);
    line-height: 1.3;
}

.crm-export-menu__desc {
    display: block;
    margin-top: 0.125rem;
    font-size: 0.6875rem;
    color: var(--crm-text-muted);
    line-height: 1.35;
}

.crm-export-menu__trigger .mud-icon-root.mud-icon-size-medium:last-child {
    transition: transform 0.2s ease;
}

.crm-hidden-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.crm-topbar__action {
    color: #616161 !important;
    border-radius: 6px !important;
}

.crm-topbar__action:hover {
    background: var(--crm-border-light) !important;
    color: var(--crm-text) !important;
}

.crm-user-menu {
    display: flex;
    align-items: center;
    padding: 2px;
    border-radius: 50%;
    cursor: pointer;
    transition: background var(--crm-transition);
}

.crm-user-menu:hover { background: var(--crm-border-light); }

.crm-account-menu-popover {
    padding: 0 !important;
    overflow: hidden;
    border-radius: 16px !important;
    border: 1px solid #E5E7EB !important;
    box-shadow: 0 10px 40px rgba(17, 24, 39, 0.12), 0 2px 8px rgba(17, 24, 39, 0.06) !important;
}

.crm-account-menu-popover .mud-paper {
    border-radius: 16px !important;
    overflow: hidden;
}

.crm-account-menu-popover .mud-list {
    padding: 0 !important;
}

.crm-account-menu {
    width: 300px;
    background: #fff;
}

.crm-account-menu__header {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1.05rem 1.05rem 0.95rem;
    background: linear-gradient(180deg, #EEF2FF 0%, #fff 78%);
    border-bottom: 1px solid #F3F4F6;
}

.crm-account-menu__avatar {
    width: 44px !important;
    height: 44px !important;
    font-size: 0.875rem !important;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px #fff, 0 0 0 5px #C7D2FE;
}

.crm-account-menu__identity {
    min-width: 0;
    flex: 1;
}

.crm-account-menu__name {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.25;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-account-menu__email {
    margin: 0.15rem 0 0;
    font-size: 0.75rem;
    line-height: 1.35;
    color: #6B7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-account-menu__tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin-top: 0.45rem;
}

.crm-account-menu__chip {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 0.5rem;
    border-radius: 999px;
    background: #EEF2FF;
    color: #4338CA;
    font-size: 0.6875rem;
    font-weight: 700;
}

.crm-account-menu__org {
    font-size: 0.6875rem;
    color: #6B7280;
    line-height: 1.2;
}

.crm-account-menu__section {
    padding: 0.4rem 0.4rem;
}

.crm-account-menu__section--footer {
    padding-top: 0.3rem;
    border-top: 1px solid #F3F4F6;
}

.crm-account-menu__section-label {
    margin: 0;
    padding: 0.4rem 0.65rem 0.3rem;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9CA3AF;
}

.crm-account-menu__divider {
    display: none;
}

.crm-account-menu__item.mud-list-item {
    min-height: 40px;
    margin: 0 0.15rem;
    padding: 0 0.55rem 0 0.4rem !important;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #111827;
}

.crm-account-menu__item.mud-list-item:hover {
    background: #F8FAFC !important;
}

.crm-account-menu__item .mud-list-item-icon {
    min-width: 2.15rem !important;
    margin-right: 0.45rem !important;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    color: #4F46E5 !important;
    background: #EEF2FF;
}

.crm-account-menu__item .mud-list-item-icon .mud-icon-root {
    font-size: 1.05rem !important;
}

.crm-account-menu__item--day .mud-list-item-icon { background: #FFF7ED; color: #C2410C !important; }
.crm-account-menu__item--tasks .mud-list-item-icon { background: #ECFDF5; color: #047857 !important; }
.crm-account-menu__item--account .mud-list-item-icon { background: #EEF2FF; color: #4F46E5 !important; }
.crm-account-menu__item--approvals .mud-list-item-icon { background: #EFF6FF; color: #1D4ED8 !important; }
.crm-account-menu__item--reports .mud-list-item-icon { background: #F5F3FF; color: #6D28D9 !important; }
.crm-account-menu__item--admin .mud-list-item-icon { background: #F1F5F9; color: #334155 !important; }

.crm-account-menu__item--signout .mud-list-item-text {
    color: #B91C1C;
    font-weight: 650;
}

.crm-account-menu__item--signout .mud-list-item-icon {
    background: #FEF2F2;
    color: #DC2626 !important;
}

.crm-account-menu__item--signout.mud-list-item:hover {
    background: #FEF2F2 !important;
}

html:has(.crm-app-layout.crm-dark) .crm-account-menu {
    background: var(--crm-surface);
}

html:has(.crm-app-layout.crm-dark) .crm-account-menu__header {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.16) 0%, var(--crm-surface) 80%);
    border-bottom-color: var(--crm-border);
}

html:has(.crm-app-layout.crm-dark) .crm-account-menu__name {
    color: var(--crm-text);
}

html:has(.crm-app-layout.crm-dark) .crm-account-menu__item.mud-list-item {
    color: var(--crm-text);
}

html:has(.crm-app-layout.crm-dark) .crm-account-menu__item.mud-list-item:hover {
    background: var(--crm-nav-hover) !important;
}

html:has(.crm-app-layout.crm-dark) .crm-account-menu__section--footer {
    border-top-color: var(--crm-border);
}

.tm-account {
    max-width: 960px;
}

.tm-account__grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 900px) {
    .tm-account__grid {
        grid-template-columns: 1fr 1fr;
    }

    .tm-account__readonly {
        grid-column: 1 / -1;
    }
}

.tm-account__actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.25rem;
}

.tm-account__header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tm-account__header .pm-avatar--lg {
    width: 56px;
    height: 56px;
    font-size: 1.125rem;
}

.tm-account__name {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 650;
    color: var(--crm-text);
}

.tm-account__email {
    margin: 0.2rem 0 0;
    font-size: 0.8125rem;
    color: var(--crm-text-muted);
}

.tm-account__details .tm-detail-row {
    grid-template-columns: 140px minmax(0, 1fr);
}

/* Sidebar */
/* Sidebar — clipped under the app bar (Planner chrome) */
.crm-app-layout .crm-sidebar.mud-drawer {
    top: var(--mud-appbar-height, 48px) !important;
    height: calc(100% - var(--mud-appbar-height, 48px)) !important;
    max-height: calc(100% - var(--mud-appbar-height, 48px)) !important;
    z-index: 1050 !important;
    border-right: 1px solid var(--crm-border) !important;
}

.crm-sidebar {
    background: var(--crm-sidebar) !important;
    border-right: 1px solid var(--crm-border) !important;
}

.crm-sidebar.mud-drawer-mini.mud-drawer--closed .mud-drawer-content {
    overflow-x: hidden;
}

.crm-sidebar-nav { height: 100%; display: flex; flex-direction: column; min-height: 0; }

.crm-sidebar-nav__brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 1rem 0.75rem 0.375rem;
    min-height: 48px;
}

.crm-sidebar-nav__brand-main {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
    flex: 1;
}

.crm-sidebar-nav__toggle {
    color: var(--crm-nav-icon) !important;
    flex-shrink: 0;
    margin: 0 !important;
}

.crm-sidebar-nav__toggle:hover {
    background: var(--crm-border-light) !important;
    color: var(--crm-text) !important;
}

.crm-sidebar-nav__logo {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--crm-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.crm-sidebar-nav__brand-text {
    color: var(--crm-text) !important;
    font-weight: 600 !important;
    white-space: nowrap;
    font-size: 0.875rem !important;
}

.crm-sidebar-nav__create {
    padding: 0.75rem 0.75rem 0.875rem;
}

.crm-sidebar-create-btn {
    width: 100%;
}

/* Standard buttons — match drawer Create button */
.crm-btn.mud-button-root,
.mud-button-root.crm-btn,
.crm-btn-primary.mud-button-root,
.mud-button-root.crm-btn-primary,
.crm-btn-outline.mud-button-root,
.mud-button-root.crm-btn-outline,
.crm-toolbar-btn.mud-button-root,
.mud-button-root.crm-toolbar-btn {
    min-height: 38px !important;
    height: auto !important;
    padding: 0.5625rem 1rem !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    text-transform: none !important;
    letter-spacing: 0.01em;
    border-radius: var(--crm-radius-pill) !important;
    box-shadow: none !important;
    gap: 0.375rem !important;
}

.crm-btn-primary {
    background: var(--crm-primary) !important;
    color: #fff !important;
    transition: background var(--crm-transition) !important;
}

.crm-btn-primary:hover { background: var(--crm-primary-dark) !important; }

.crm-btn-primary.mud-button-root:disabled,
.mud-button-root.crm-btn-primary:disabled,
.crm-btn-primary.mud-disabled,
.crm-btn-primary.mud-button-disabled,
.crm-btn-primary.mud-button-root.mud-disabled {
    background: #f4f5f7 !important;
    color: #6b778c !important;
    border: 1px solid #dfe1e6 !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
    filter: none !important;
}

.crm-btn-primary.mud-button-root:disabled:hover,
.mud-button-root.crm-btn-primary:disabled:hover,
.crm-btn-primary.mud-disabled:hover,
.crm-btn-primary.mud-button-disabled:hover {
    background: #f4f5f7 !important;
    color: #6b778c !important;
}

.crm-btn-outline {
    border: 1px solid var(--crm-primary) !important;
    color: var(--crm-primary) !important;
    background: transparent !important;
    transition: background var(--crm-transition), border-color var(--crm-transition) !important;
}

.crm-btn-outline:hover {
    background: var(--crm-primary-soft) !important;
    border-color: var(--crm-primary) !important;
}

.crm-sidebar-nav__menu {
    display: flex;
    flex-direction: column;
    gap: 0.4375rem;
    padding: 0.5rem 0 0.75rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.crm-sidebar-nav__menu .mud-nav-link {
    border-radius: 6px;
    margin: 0 8px;
    min-height: 38px;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    font-size: 0.8125rem !important;
    font-weight: 400 !important;
    color: var(--crm-nav-text) !important;
    transition: background var(--crm-transition);
}

.crm-sidebar-nav__menu .mud-nav-link .mud-nav-link-text {
    white-space: normal;
    line-height: 1.35;
    overflow: visible;
    text-overflow: unset;
}

.crm-sidebar-nav__menu .mud-nav-link .mud-icon-root {
    color: var(--crm-nav-icon) !important;
    font-size: 1.125rem !important;
    flex-shrink: 0;
}

/* Colorful sidebar nav icons (Planner-style tiles) */
.crm-sidebar-nav__menu .crm-nav-link--my-day .mud-icon-root,
.crm-sidebar-nav__menu .crm-nav-link--my-tasks .mud-icon-root,
.crm-sidebar-nav__menu .crm-nav-link--projects .mud-icon-root {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 28px !important;
    height: 28px !important;
    font-size: 1rem !important;
    border-radius: 6px;
    color: #fff !important;
    flex-shrink: 0;
}

.crm-sidebar-nav__menu .crm-nav-link--my-day .mud-icon-root {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.crm-sidebar-nav__menu .crm-nav-link--my-tasks .mud-icon-root {
    background: linear-gradient(135deg, #6366f1 0%, #5b5fc7 100%);
}

.crm-sidebar-nav__menu .crm-nav-link--projects .mud-icon-root {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.crm-sidebar-nav__menu .crm-nav-link--my-day.active .mud-icon-root {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.crm-sidebar-nav__menu .crm-nav-link--my-tasks.active .mud-icon-root {
    background: linear-gradient(135deg, #5b5fc7 0%, #464eb8 100%);
}

.crm-sidebar-nav__menu .crm-nav-link--projects.active .mud-icon-root {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

/* Parent nav group header */
.crm-sidebar-nav__menu .mud-nav-group > .mud-nav-link {
    font-weight: 500 !important;
    padding-left: 0.75rem !important;
    padding-inline-start: 0.75rem !important;
    margin-bottom: 0.25rem;
}

/* Child nav links — indent under expanded groups */
.crm-sidebar-nav--expanded .crm-sidebar-nav__menu .mud-nav-group .mud-navmenu {
    padding-left: 0.625rem;
    margin-left: 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-bottom: 0.375rem;
}

.crm-sidebar-nav--expanded .crm-sidebar-nav__menu .mud-nav-group .mud-navmenu .mud-nav-link {
    padding-left: 0.625rem !important;
    padding-inline-start: 0.625rem !important;
    padding-top: 0.4375rem !important;
    padding-bottom: 0.4375rem !important;
    min-height: 36px;
    font-size: 0.8125rem !important;
    margin: 0 6px;
}

/* Collapsed sidebar — icon rail only */
.crm-sidebar.mud-drawer-mini.mud-drawer--closed .crm-sidebar-nav__brand {
    justify-content: center;
    padding: 0.875rem 0 0.5rem;
    gap: 0;
}

.crm-sidebar.mud-drawer-mini.mud-drawer--closed .crm-sidebar-nav__brand-main {
    display: none;
}

.crm-sidebar.mud-drawer-mini.mud-drawer--closed .crm-sidebar-nav__toggle {
    margin: 0 auto !important;
}

.crm-sidebar.mud-drawer-mini.mud-drawer--closed .crm-sidebar-nav__create {
    display: none;
}

.crm-sidebar.mud-drawer-mini.mud-drawer--closed .crm-sidebar-nav__menu .mud-nav-link,
.crm-sidebar.mud-drawer-mini.mud-drawer--closed .crm-sidebar-nav__menu .mud-nav-group > .mud-nav-link {
    margin: 2px 4px !important;
    padding: 0.5rem !important;
    padding-inline: 0.5rem !important;
    justify-content: center !important;
    min-height: 36px;
}

.crm-sidebar.mud-drawer-mini.mud-drawer--closed .crm-sidebar-nav__menu .mud-nav-link-text {
    display: none !important;
}

.crm-sidebar.mud-drawer-mini.mud-drawer--closed .crm-sidebar-nav__menu .mud-nav-link-expand-icon {
    display: none !important;
}

.crm-sidebar.mud-drawer-mini.mud-drawer--closed .crm-sidebar-nav__menu .mud-nav-group .mud-navmenu {
    display: none !important;
}

.crm-sidebar.mud-drawer-mini.mud-drawer--closed .crm-sidebar-nav__menu .mud-nav-link-icon,
.crm-sidebar.mud-drawer-mini.mud-drawer--closed .crm-sidebar-nav__menu .mud-nav-link .mud-icon-root:first-child {
    margin: 0 !important;
}

.crm-sidebar-nav__menu .mud-nav-link.active {
    background: var(--crm-nav-active-bg) !important;
    color: var(--crm-primary) !important;
}

.crm-app-layout.crm-dark .crm-sidebar-nav__menu .mud-nav-link.active {
    color: #ffffff !important;
}

.crm-sidebar-nav__menu .mud-nav-link.active .mud-icon-root {
    color: var(--crm-primary) !important;
    background: transparent !important;
}

.crm-sidebar-nav__menu .crm-nav-link--my-day.active .mud-icon-root,
.crm-sidebar-nav__menu .crm-nav-link--my-tasks.active .mud-icon-root,
.crm-sidebar-nav__menu .crm-nav-link--projects.active .mud-icon-root {
    color: #fff !important;
}

.crm-app-layout.crm-dark .crm-sidebar-nav__menu .mud-nav-link.active .mud-icon-root {
    color: #ffffff !important;
}

.crm-app-layout.crm-dark .crm-sidebar-nav__menu .crm-nav-link--my-day.active .mud-icon-root,
.crm-app-layout.crm-dark .crm-sidebar-nav__menu .crm-nav-link--my-tasks.active .mud-icon-root,
.crm-app-layout.crm-dark .crm-sidebar-nav__menu .crm-nav-link--projects.active .mud-icon-root {
    color: #fff !important;
}

.crm-sidebar-nav__menu .mud-nav-link:hover {
    background: var(--crm-nav-hover) !important;
}

.crm-workspace {
    background: var(--crm-bg) !important;
    min-height: 100vh;
    height: 100vh;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.crm-workspace > .crm-topbar {
    position: sticky;
    top: 0;
    z-index: 1100;
    flex-shrink: 0;
}

.crm-page-container {
    --crm-page-padding-x: 1.5rem;
    --crm-page-padding-y: 1.25rem;
    padding: var(--crm-page-padding-y) var(--crm-page-padding-x) 1.5rem;
    flex: 1;
    min-height: 0;
    overflow-x: auto;
    overflow-y: auto !important;
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .crm-page-container {
        --crm-page-padding-x: 1rem;
        --crm-page-padding-y: 1rem;
    }
}

/* Full-bleed sections break out of page padding */
.crm-module-header,
.crm-dashboard-greeting {
    margin-left: calc(-1 * var(--crm-page-padding-x));
    margin-right: calc(-1 * var(--crm-page-padding-x));
    margin-top: calc(-1 * var(--crm-page-padding-y));
    width: calc(100% + (2 * var(--crm-page-padding-x)));
}

.crm-data-table-wrap {
    padding: 0 var(--crm-page-padding-x) var(--crm-page-padding-y);
    background: var(--crm-surface);
}

.crm-page-body {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    flex: 1 0 auto;
    padding-bottom: 5rem;
}

.crm-editor-footer {
    position: sticky;
    bottom: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
    padding: 1rem 0;
    border-top: 1px solid var(--crm-border);
    background: linear-gradient(to top, var(--crm-bg) 70%, rgba(255, 255, 255, 0));
}

.crm-editor-footer .crm-btn-primary {
    min-width: 140px;
}

.crm-page-body--narrow {
    max-width: 960px;
}

.crm-panel {
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius-lg);
    overflow: hidden;
    box-shadow: none;
}

.crm-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--crm-border-light);
    background: var(--crm-surface);
}

.crm-panel__title {
    font-weight: 600 !important;
    color: var(--crm-text) !important;
    font-size: 0.9375rem !important;
}

.crm-panel__body {
    padding: 1.25rem;
}

.crm-panel__body--flush {
    padding: 0;
}

.crm-panel__body--flush .mud-table-cell {
    overflow: visible !important;
    vertical-align: middle;
}

.crm-panel__body--flush .mud-input-control,
.crm-panel__body--flush .crm-form-select-wrap {
    overflow: visible !important;
}

.crm-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--crm-field-gap) 1.25rem;
    max-width: 720px;
}

@media (max-width: 768px) {
    .crm-form-grid {
        grid-template-columns: 1fr;
        max-width: none;
    }
}

.crm-section-editor__item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--crm-border-light);
}

.crm-section-editor__item:last-child {
    border-bottom: none;
}

/* Native textareas — avoids MudBlazor dark-mode text color on light panels */
.crm-native-textarea {
    display: block;
    width: 100%;
    height: auto !important;
    min-height: 4.5rem !important;
    max-height: none !important;
    padding: 0.5rem 0.625rem !important;
    border: 1px solid #cbd6e2;
    border-radius: 6px;
    font-family: inherit;
    font-size: var(--crm-control-font-size);
    font-weight: 400;
    line-height: 1.5 !important;
    color: #242424 !important;
    -webkit-text-fill-color: #242424 !important;
    background-color: #ffffff !important;
    caret-color: #242424 !important;
    resize: vertical;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    vertical-align: top;
    margin: 0;
    field-sizing: content;
}

.record-drawer .crm-native-textarea,
.crm-panel .crm-native-textarea,
.form-section .crm-native-textarea,
.mud-dialog .crm-native-textarea,
.crm-section-editor .crm-native-textarea {
    height: auto !important;
    min-height: 4.5rem !important;
    max-height: none !important;
}

.crm-native-textarea::placeholder {
    color: #616161 !important;
    -webkit-text-fill-color: #616161 !important;
    opacity: 1;
}

.crm-native-textarea:hover {
    border-color: var(--crm-primary);
}

.crm-native-textarea:focus {
    outline: none;
    border-color: var(--crm-primary);
    box-shadow: 0 0 0 1px var(--crm-primary);
}

/* Force readable Mud inputs on light CRM panels in light mode only */
.crm-app-layout:not(.crm-dark) .crm-main-content .crm-panel,
.crm-app-layout:not(.crm-dark) .crm-main-content .crm-section-editor,
.crm-app-layout:not(.crm-dark) .crm-main-content .record-drawer__inner,
.crm-app-layout:not(.crm-dark) .mud-dialog .mud-dialog-content {
    --mud-palette-text-primary: #242424;
    --mud-palette-text-secondary: #616161;
    --mud-palette-text-disabled: #a19f9d;
    --mud-palette-action-default: #616161;
    --mud-palette-surface: #ffffff;
    --mud-palette-background: #ffffff;
    --mud-palette-lines-inputs: #c8c6c4;
}

.crm-theme-picker { margin-bottom: 0.5rem; }

.crm-theme-card {
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius-lg);
    padding: 0.75rem;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.crm-theme-card:hover { border-color: var(--crm-primary); }

.crm-theme-card--active {
    border-color: var(--crm-primary);
    box-shadow: 0 0 0 1px var(--crm-primary);
}

.crm-theme-card__preview {
    height: 56px;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.crm-theme-card__preview--classic { background: linear-gradient(135deg, #f3f4f6 0%, #fff 100%); border: 1px solid #d1d5db; }
.crm-theme-card__preview--modern { background: linear-gradient(135deg, var(--crm-primary) 0%, #eef0ff 40%, #fff 100%); }
.crm-theme-card__preview--executive { background: linear-gradient(135deg, #111827 0%, #374151 100%); }

.crm-theme-card__name { font-weight: 600 !important; }

.crm-brand-logo-preview {
    width: 88px;
    height: 88px;
    border: 1px dashed var(--crm-border);
    border-radius: var(--crm-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #faf9f8;
}

.crm-brand-logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.crm-employee-photo-field {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.crm-employee-photo-field__preview {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--crm-border);
    background: var(--crm-primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.crm-employee-photo-field__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.crm-employee-photo-field__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.375rem;
    min-width: 0;
}

.auth-page__logo-img,
.crm-sidebar-nav__logo-img {
    max-height: 40px;
    max-width: 120px;
    object-fit: contain;
}

.crm-sidebar-nav__logo-img {
    max-height: 32px;
    max-width: 100px;
}

.crm-customer-picker .crm-tabs-compact {
    margin-top: 0;
}

.crm-form-grid--single {
    grid-template-columns: 1fr;
    max-width: 420px;
}

.crm-section-label {
    font-weight: 600 !important;
    color: var(--crm-text-secondary) !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.6875rem !important;
}

.crm-settings-table .mud-table-head .mud-table-cell {
    background: #faf9f8 !important;
    font-weight: 500 !important;
    font-size: 0.75rem !important;
    text-transform: none;
    letter-spacing: normal;
}

/* Module header */
.crm-module-header {
    background: var(--crm-surface);
    border-bottom: 1px solid var(--crm-border);
    margin-bottom: 0;
    position: relative;
    z-index: 20;
}

/* Space between page header and filter panel (all list pages) */
.crm-module-header + .crm-record-filter {
    margin-top: 1.25rem;
}

.crm-module-header__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem 1rem;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.crm-module-header__icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--crm-primary-soft);
    color: var(--crm-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.crm-module-header__title {
    color: var(--crm-text) !important;
    font-weight: 600 !important;
    font-size: 1.125rem !important;
}

.crm-module-header__desc {
    color: var(--crm-text-muted) !important;
    margin-top: 0.3125rem;
    line-height: 1.45;
    font-weight: 400 !important;
}

.crm-module-header__actions {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-shrink: 0;
}

.crm-count-chip {
    font-size: 0.6875rem !important;
    height: 22px !important;
    border-color: var(--crm-border) !important;
    font-weight: 400 !important;
}

.crm-module-header__tabs {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.375rem 1.5rem 1.125rem;
    overflow-x: auto;
    border-bottom: none;
}

.crm-view-tab {
    background: #fff;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius-pill);
    padding: 0.4375rem 1rem;
    min-height: 34px;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--crm-text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.crm-view-tab:hover {
    color: var(--crm-text);
    border-color: #c8c6c4;
    background: var(--crm-border-light);
}

.crm-view-tab--active {
    color: var(--crm-text) !important;
    border-color: var(--crm-text) !important;
    font-weight: 500 !important;
    background: #fff !important;
}

.crm-module-header__toolbar {
    display: flex;
    align-items: flex-end;
    gap: 0.875rem;
    padding: 0.375rem 1.5rem 1.25rem;
    flex-wrap: wrap;
    background: transparent;
    border-bottom: 1px solid var(--crm-border-light);
    position: relative;
    z-index: 21;
    overflow: visible;
}

.crm-module-header__toolbar .crm-field {
    margin: 0;
}

.crm-module-header__toolbar .crm-field + .crm-field {
    margin-top: 0;
}

.crm-module-header__toolbar .crm-field__label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--crm-text-muted);
    margin-bottom: 0.375rem;
}

.crm-toolbar-search {
    min-width: 200px;
    max-width: 280px;
    margin-bottom: 0 !important;
}

.crm-filter-field {
    min-width: 160px;
    max-width: 200px;
    flex-shrink: 0;
}

.crm-toolbar-filter {
    min-width: 160px;
    max-width: 200px;
}

.crm-toolbar-icon-btn {
    width: var(--crm-control-height) !important;
    height: var(--crm-control-height) !important;
    min-width: var(--crm-control-height) !important;
    min-height: var(--crm-control-height) !important;
    padding: 0 !important;
    border-radius: var(--crm-radius) !important;
    border: 1px solid var(--crm-control-border-color) !important;
    color: var(--crm-primary) !important;
    box-shadow: none !important;
}

.crm-toolbar-icon-btn:hover {
    border-color: var(--crm-primary) !important;
    background: var(--crm-primary-soft) !important;
}

.crm-toolbar-icon-btn .mud-icon-root {
    font-size: 1.125rem !important;
}

.crm-view-mode-toggle {
    display: inline-flex;
    align-items: center;
    background: var(--crm-border-light);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius-pill);
    padding: 2px;
    margin-left: auto;
    flex-shrink: 0;
}

.crm-view-mode-toggle__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3125rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: var(--crm-radius-pill);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--crm-text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.crm-view-mode-toggle__btn:hover {
    color: var(--crm-text);
}

.crm-view-mode-toggle__btn--active {
    background: var(--crm-surface);
    color: var(--crm-primary);
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.crm-pipeline-wrap {
    height: calc(100vh - 220px);
    min-height: 420px;
    overflow: hidden;
}

.crm-toolbar-btn {
    border-color: var(--crm-border) !important;
    color: var(--crm-text) !important;
}

/* Data table */
.crm-data-table-wrap {
    overflow-x: auto;
    overflow-y: visible;
    position: relative;
    z-index: 1;
}

.crm-data-table-wrap .mud-table {
    background: transparent !important;
}

.crm-leads-table .mud-table-container {
    overflow-x: auto;
}

.crm-leads-table table {
    min-width: 1280px;
    table-layout: auto;
}

.crm-data-table-wrap .mud-table-head .mud-table-cell {
    background: var(--crm-surface) !important;
    color: var(--crm-text-muted) !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    text-transform: none;
    letter-spacing: 0.01em;
    border-bottom: 1px solid var(--crm-border) !important;
    padding: 0.6875rem 0.875rem !important;
    line-height: 1.35;
    white-space: nowrap;
    overflow: visible;
}

.crm-data-table-wrap .mud-table-body .mud-table-row {
    transition: background var(--crm-transition);
}

.crm-data-table-wrap .mud-table-body .mud-table-row:hover {
    background: var(--crm-border-light) !important;
}

.crm-data-table-wrap .mud-table-cell {
    padding: 0.6875rem 0.875rem !important;
    border-bottom: 1px solid var(--crm-border-light) !important;
    font-size: 0.875rem !important;
    font-weight: 400 !important;
    line-height: 1.45;
    color: var(--crm-text);
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: none !important;
}

.crm-data-table-wrap .mud-table-dense .mud-table-cell {
    padding: 0.6875rem 0.875rem !important;
}

.crm-data-table-wrap .mud-chip.mud-chip-size-small {
    height: auto !important;
    min-height: 26px !important;
    padding: 0.3125rem 0.8125rem !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    letter-spacing: 0.02em !important;
    border-radius: var(--crm-radius-pill) !important;
    box-shadow: none !important;
    vertical-align: middle;
}

.crm-data-table-wrap .mud-chip.mud-chip-size-small .mud-chip-content {
    padding: 0 0.125rem !important;
    margin: 0 !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
}

.crm-data-table-wrap .mud-chip.mud-chip-outlined.mud-chip-size-small {
    padding: 0.28125rem 0.75rem !important;
    min-height: 24px !important;
    font-weight: 500 !important;
    letter-spacing: 0.015em !important;
}

.crm-data-table-wrap .mud-chip.mud-chip-size-small:not(.mud-chip-outlined) {
    padding: 0.3125rem 0.875rem !important;
    min-height: 26px !important;
}

.crm-record-link {
    color: var(--crm-primary) !important;
    font-weight: 400 !important;
    text-decoration: none !important;
    cursor: pointer;
}

.crm-record-link:hover { text-decoration: underline !important; }

.crm-record-sub {
    color: var(--crm-text-muted) !important;
    font-size: 0.8125rem !important;
}

/* Table pager — align rows-per-page select with label */
.crm-data-table-wrap .mud-table-pagination-toolbar {
    display: flex !important;
    align-items: center !important;
    min-height: 52px;
    padding: 0.625rem 1rem !important;
    gap: 0.375rem;
    flex-wrap: nowrap;
}

.crm-data-table-wrap .mud-table-pagination-toolbar .mud-table-pagination-caption {
    display: inline-flex;
    align-items: center;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.35;
    font-size: 0.8125rem;
    color: var(--crm-text-muted);
    white-space: nowrap;
}

.crm-data-table-wrap .mud-table-pagination-toolbar .mud-table-pagination-display {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 !important;
    line-height: 1.35;
    font-size: 0.8125rem;
    color: var(--crm-text-muted);
    white-space: nowrap;
}

.crm-data-table-wrap .mud-table-pagination-toolbar .mud-input-control {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    align-self: center;
}

.crm-data-table-wrap .mud-table-pagination-toolbar .mud-select {
    width: auto;
    min-width: 68px;
    margin-top: 0 !important;
}

.crm-data-table-wrap .mud-table-pagination-toolbar .mud-select .mud-select-input.mud-input-root,
.crm-data-table-wrap .mud-table-pagination-toolbar .mud-select .mud-select-input .mud-input-slot,
.crm-data-table-wrap .mud-table-pagination-toolbar .mud-input-control-input-container {
    min-height: 32px !important;
    height: 32px !important;
    max-height: 32px !important;
    margin-top: 0 !important;
}

.crm-data-table-wrap .mud-table-pagination-toolbar .mud-select .mud-select-input .mud-input-slot {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 0.625rem !important;
    padding-right: 0.25rem !important;
    font-size: 0.8125rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

.crm-data-table-wrap .mud-table-pagination-toolbar .mud-select .mud-input-adornment-end {
    align-self: center;
    margin-top: 0 !important;
}

.crm-data-table-wrap .mud-table-pagination-toolbar .mud-icon-button {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Record avatar */
.record-avatar {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}

.record-avatar img { width: 100%; height: 100%; object-fit: cover; }
.record-avatar--sm { width: 28px; height: 28px; font-size: 0.625rem; }
.record-avatar--md { width: 36px; height: 36px; font-size: 0.75rem; }
.record-avatar--lg { width: 48px; height: 48px; font-size: 0.875rem; }

/* Record drawer */
.record-drawer .mud-drawer-content {
    background: var(--crm-surface) !important;
    padding: 0 !important;
}

.record-drawer__inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.record-drawer__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--crm-border);
    background: var(--crm-surface);
}

.record-drawer__eyebrow {
    color: var(--crm-text-muted) !important;
    font-weight: 400 !important;
    letter-spacing: normal;
    text-transform: none;
}

.record-drawer__title {
    font-weight: 600 !important;
    color: var(--crm-text) !important;
    font-size: 1.125rem !important;
}

.record-drawer__body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: var(--crm-field-gap);
}

.record-drawer .mud-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--crm-field-gap) 1.25rem;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    margin-left: 0 !important;
    margin-top: 0 !important;
    box-sizing: border-box !important;
}

.record-drawer .mud-grid > .mud-grid-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: none !important;
    flex: none !important;
    flex-grow: 0 !important;
    flex-basis: auto !important;
    padding: 0 !important;
    padding-left: 0 !important;
    padding-top: 0 !important;
    margin: 0 !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.record-drawer .mud-grid > .mud-grid-item .crm-field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    min-width: 0;
}

.record-drawer .mud-grid > .mud-grid-item[class*="xs-12"]:not([class*="sm-"]) {
    grid-column: 1 / -1;
}

@media (max-width: 480px) {
    .record-drawer .mud-grid {
        grid-template-columns: 1fr;
    }

    .record-drawer .mud-grid > .mud-grid-item[class*="xs-12"]:not([class*="sm-"]) {
        grid-column: auto;
    }
}

/* Drawer-safe dropdowns */
.crm-form-select-wrap {
    position: relative;
    width: 100%;
}

.crm-native-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    display: block;
    width: 100%;
    height: var(--crm-control-height);
    min-height: var(--crm-control-height);
    max-height: var(--crm-control-height);
    padding: 0 2rem 0 var(--crm-control-padding-x);
    border: 1px solid var(--crm-control-border-color);
    border-radius: var(--crm-radius);
    font-family: inherit;
    font-size: var(--crm-control-font-size);
    font-weight: 400;
    line-height: var(--crm-control-line-height);
    color: #242424;
    background-color: #ffffff;
    cursor: pointer;
    box-sizing: border-box;
}

.crm-native-select:hover:not(.crm-native-select--disabled) {
    border-color: var(--crm-primary);
}

.crm-native-select:focus {
    outline: none;
    border-color: var(--crm-primary);
    box-shadow: 0 0 0 1px var(--crm-primary);
}

.crm-native-select--disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f5f8fa;
}

.crm-native-select--compact {
    height: 28px;
    min-height: 28px;
    max-height: 28px;
    padding: 0 1.5rem 0 0.5rem;
    font-size: 0.6875rem;
    line-height: 1.2;
}

.crm-native-select__icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #616161 !important;
}

.crm-money-field {
    display: flex;
    align-items: stretch;
    height: var(--crm-control-height);
    border: 1px solid var(--crm-control-border-color);
    border-radius: var(--crm-radius);
    background: var(--crm-input-bg);
    overflow: hidden;
    transition: border-color var(--crm-transition), box-shadow var(--crm-transition);
}

.crm-money-field:hover {
    border-color: var(--crm-primary);
}

.crm-money-field:focus-within {
    border-color: var(--crm-primary);
    box-shadow: 0 0 0 1px var(--crm-primary);
}

.crm-money-field__currency {
    position: relative;
    flex: 0 0 5.5rem;
    width: 5.5rem;
    background: var(--crm-border-light);
}

.crm-money-field__select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    display: block;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: 0 1.5rem 0 0.75rem;
    border: 0;
    background: transparent;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: calc(var(--crm-control-height) - 2px);
    color: var(--crm-text);
    cursor: pointer;
}

.crm-money-field__select:focus {
    outline: none;
}

.crm-money-field__caret {
    position: absolute;
    right: 0.2rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--crm-text-muted) !important;
    font-size: 1.125rem !important;
}

.crm-money-field__divider {
    width: 1px;
    margin: 0.4rem 0;
    background: var(--crm-border);
    flex-shrink: 0;
}

.crm-money-field__currency,
.crm-money-field__amount-wrap {
    height: 100%;
}

.crm-money-field__amount-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    background: var(--crm-input-bg);
}

.crm-money-field input.crm-money-field__amount,
.crm-money-field__amount {
    display: block;
    flex: 1;
    min-width: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0 0.75rem;
    border: none !important;
    border-bottom: none !important;
    border-radius: 0;
    outline: none !important;
    box-shadow: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    background: transparent !important;
    background-image: none !important;
    font-family: inherit;
    font-size: var(--crm-control-font-size);
    font-weight: 400;
    font-variant-numeric: tabular-nums;
    color: var(--crm-text);
    /* Match the inner control height so the value sits on the same midline as USD. */
    line-height: calc(var(--crm-control-height) - 2px);
}

.crm-money-field input.crm-money-field__amount:hover,
.crm-money-field input.crm-money-field__amount:focus,
.crm-money-field input.crm-money-field__amount:focus-visible,
.crm-money-field input.crm-money-field__amount:active {
    border: none !important;
    border-bottom: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.crm-money-field .mud-input-underline:before,
.crm-money-field .mud-input-underline:after,
.crm-money-field .mud-input-underline:hover:not(.mud-disabled):before,
.crm-money-field .mud-input-underline:hover:not(.mud-disabled):after {
    display: none !important;
    border-bottom: none !important;
}

.crm-money-field__amount::placeholder {
    color: var(--crm-text-muted);
    opacity: 0.7;
}

.crm-app-layout.crm-dark .crm-money-field__currency {
    background: rgba(255, 255, 255, 0.04);
}

.crm-money-field--compact {
    min-width: 10.5rem;
}

.crm-money-field--compact .crm-money-field__currency {
    flex: 0 0 4.25rem;
    width: 4.25rem;
}

.crm-money-field--compact .crm-money-field__select {
    padding: 0 1.25rem 0 0.5rem;
    font-size: 0.6875rem;
}

.crm-money-field--compact .crm-money-field__amount {
    padding: 0 0.5rem;
}

.crm-form-select-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    height: var(--crm-control-height);
    min-height: var(--crm-control-height);
    max-height: var(--crm-control-height);
    padding: 0 var(--crm-control-padding-x);
    border: 1px solid var(--crm-control-border-color);
    border-radius: var(--crm-radius);
    background: #fff;
    font-size: var(--crm-control-font-size);
    font-weight: 400;
    line-height: var(--crm-control-line-height);
    color: var(--crm-text);
    cursor: pointer;
    text-align: left;
    box-sizing: border-box;
}

.crm-form-select-trigger:hover:not(.crm-form-select-trigger--disabled) {
    border-color: var(--crm-primary);
}

.crm-form-select-trigger--disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f5f8fa;
}

.crm-form-select-trigger__text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-form-select-popover {
    z-index: 1500 !important;
}

.crm-form-select-item--selected {
    background: rgba(91, 95, 199, 0.08) !important;
    font-weight: 600;
}

/* MudBlazor popovers/menus must render above drawers, overlays, and headers */
.crm-popover-root,
.crm-popover-root .mud-popover,
.crm-form-select-popover,
.mud-popover-open,
.mud-select-popover,
.mud-menu-popover {
    z-index: 4000 !important;
}

.mud-overlay {
    z-index: 1300 !important;
}

/* Picker modal overlays (MudPopoverProvider) — above record drawer, below popovers */
.mud-popover-provider .mud-overlay:not(.mud-drawer-overlay) {
    z-index: 1595 !important;
}

.mud-drawer {
    z-index: 1400 !important;
}

.record-drawer.mud-drawer {
    z-index: 1500 !important;
}

.record-drawer + .mud-overlay-scrim,
.record-drawer ~ .mud-overlay {
    z-index: 1490 !important;
}

.record-drawer__footer {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid var(--crm-border);
    background: var(--crm-surface);
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Record view drawer (read-only details) */
.record-drawer--view .mud-drawer-content {
    background: #f7f8fa !important;
}

.record-drawer--view .record-drawer__header {
    padding: 1.125rem 1.5rem;
    background: linear-gradient(180deg, rgba(91, 95, 199, 0.07) 0%, var(--crm-surface) 72%);
    border-bottom: 1px solid var(--crm-border);
}

.record-drawer--view .record-drawer__eyebrow {
    font-size: 0.6875rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--crm-primary) !important;
    margin-bottom: 0.125rem;
}

.record-drawer--view .record-drawer__title {
    font-size: 1.0625rem !important;
    font-weight: 650 !important;
    letter-spacing: -0.015em;
    line-height: 1.3 !important;
}

.record-drawer--view .record-drawer__header .mud-icon-button {
    margin-top: -0.125rem;
    color: var(--crm-text-muted) !important;
}

.record-drawer--view .record-drawer__body {
    padding: 1rem 1.25rem 1.375rem;
    background: #f7f8fa;
    gap: 0.875rem;
}

.record-view-drawer__content {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.record-view-section {
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius-lg);
    box-shadow: var(--crm-shadow-sm);
    overflow: hidden;
}

.record-view-section__header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.8125rem 1rem;
    background: linear-gradient(180deg, #fafafa 0%, var(--crm-surface) 100%);
    border-bottom: 1px solid var(--crm-border-light);
}

.record-view-section__icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--crm-radius);
    background: var(--crm-primary-soft);
    flex-shrink: 0;
}

.record-view-section__icon {
    color: var(--crm-primary) !important;
    font-size: 1.0625rem !important;
}

.record-view-section__title {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 650;
    color: var(--crm-text);
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.record-view-props {
    display: flex;
    flex-direction: column;
    padding: 0.125rem 1rem 0.75rem;
}

.record-view-item {
    display: grid;
    grid-template-columns: minmax(108px, 34%) 1fr;
    gap: 0.625rem 1rem;
    align-items: start;
    padding: 0.6875rem 0;
    border-bottom: 1px solid var(--crm-border-light);
}

.record-view-item:last-child {
    border-bottom: none;
    padding-bottom: 0.375rem;
}

.record-view-item__label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--crm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.045em;
    line-height: 1.45;
    padding-top: 0.0625rem;
}

.record-view-item__value {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--crm-text);
    line-height: 1.5;
    word-break: break-word;
}

.record-view-item__value--empty {
    color: #a19f9d;
    font-weight: 400;
}

.record-view-item__value .mud-chip {
    margin: 0;
}

.record-view-item__value .mud-icon-root {
    vertical-align: middle;
}

.record-view-item__value .crm-record-link {
    font-size: inherit;
    font-weight: 500;
}

.record-drawer--view .record-drawer__footer {
    padding: 0.9375rem 1.5rem;
    background: var(--crm-surface);
    border-top: 1px solid var(--crm-border);
    box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.04);
}

.record-view-drawer__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
}

.record-view-drawer__footer-start {
    display: flex;
    align-items: center;
    min-width: 0;
}

.record-view-drawer__footer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.625rem;
    margin-left: auto;
    flex-shrink: 0;
}

.record-view-drawer__footer-start .crm-export-menu__trigger {
    min-height: 36px;
    padding-inline: 0.875rem;
}

.record-view-drawer__close {
    color: var(--crm-text-muted) !important;
    font-weight: 500 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    min-width: 4.5rem;
}

.record-view-drawer__edit {
    min-width: 7.5rem;
}

.crm-employee-view-photo {
    display: flex;
    justify-content: center;
    margin-bottom: 0.25rem;
}

.crm-employee-view-photo img {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: var(--crm-shadow);
}

@media (max-width: 480px) {
    .record-view-item {
        grid-template-columns: 1fr;
        gap: 0.25rem;
        padding: 0.625rem 0;
    }

    .record-drawer--view .record-drawer__header,
    .record-drawer--view .record-drawer__body,
    .record-drawer--view .record-drawer__footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Form sections */
.form-section {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    margin-bottom: 0;
    border: none;
    border-radius: 0;
    overflow: visible;
}

.form-section + .form-section {
    margin-top: 0.25rem;
    padding-top: var(--crm-section-gap);
    border-top: 1px solid var(--crm-border-light);
}

.form-section__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.125rem 0 0.625rem 0;
    background: transparent;
    border-bottom: none;
}

.form-section__header-actions {
    margin-left: auto;
}

.form-section__icon { color: var(--crm-primary) !important; font-size: 1.125rem !important; }

.form-section__title {
    font-weight: 600 !important;
    color: var(--crm-text) !important;
    font-size: 0.875rem !important;
}

.form-section__body {
    padding: 0;
    width: 100%;
}

.crm-section-action {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border: none;
    background: transparent;
    color: var(--crm-primary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.25rem 0.125rem;
    line-height: 1.2;
}

.crm-section-action:hover {
    text-decoration: underline;
}

.crm-section-action--muted {
    color: var(--crm-text-muted);
}

.crm-choice-pills {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.crm-choice-pill {
    min-height: 38px;
    padding: 0.5625rem 1.125rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: var(--crm-radius-pill);
    border: 1px solid var(--crm-border);
    background: var(--crm-surface);
    color: var(--crm-text);
    cursor: pointer;
    transition: background var(--crm-transition), color var(--crm-transition), border-color var(--crm-transition);
}

.crm-choice-pill:hover {
    border-color: var(--crm-primary);
    background: var(--crm-primary-soft);
}

.crm-choice-pill--active {
    background: var(--crm-primary);
    color: #fff;
    border-color: var(--crm-primary);
}

.crm-choice-pill--active:hover {
    background: var(--crm-primary-dark);
    color: #fff;
}

.crm-section-hint {
    margin: 0 0 0.75rem;
    font-size: 0.8125rem;
    color: var(--crm-text-muted);
}

/* Universal vertical stack for form fields */
.crm-form-stack {
    display: flex;
    flex-direction: column;
    gap: var(--crm-field-gap);
}

/* Pipeline board */
.pipeline-board {
    display: flex;
    gap: 0.625rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.75rem 1.5rem 1rem;
    height: 100%;
    align-items: stretch;
}

.pipeline-column {
    flex: 0 0 212px;
    background: var(--crm-pipeline-column-bg);
    border-radius: var(--crm-radius);
    border: 1px solid var(--crm-border-light);
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
}

.pipeline-column--drop-target,
.pipeline-column:has(.mud-drop-zone-drag) {
    border-color: var(--crm-primary);
    box-shadow: inset 0 0 0 1px var(--crm-primary);
}

.pipeline-column__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.625rem;
    border-radius: var(--crm-radius) var(--crm-radius) 0 0;
    border-top: 3px solid var(--crm-primary);
    flex-shrink: 0;
}

.pipeline-stage--blue { border-top-color: var(--crm-primary); background: var(--crm-primary-soft); }
.pipeline-stage--orange { border-top-color: #ff7a59; background: #fff0eb; }
.pipeline-stage--teal { border-top-color: #00bda5; background: #e6faf7; }
.pipeline-stage--pink { border-top-color: #f2547d; background: #fdeef3; }
.pipeline-stage--purple { border-top-color: #7c3aed; background: #f3eeff; }
.pipeline-stage--green { border-top-color: #00bda5; background: #e6faf7; }
.pipeline-stage--gray { border-top-color: #99acc2; background: #f0f3f7; }

.pipeline-column__title {
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    color: var(--crm-text) !important;
    line-height: 1.2 !important;
}

.pipeline-column__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 0.375rem;
    border-radius: var(--crm-radius-pill);
    font-size: 0.6875rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.08);
    color: var(--crm-text);
}

.pipeline-column__cards {
    flex: 1;
    overflow-y: auto;
    padding: 0.375rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-height: 140px;
}

.pipeline-column__cards.mud-drop-zone {
    min-height: 140px;
}

.pipeline-column__cards > .mud-drop-item {
    margin: 0 !important;
}

.pipeline-column__empty {
    flex: 1;
    min-height: 112px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--crm-border);
    border-radius: calc(var(--crm-radius) - 2px);
    color: var(--crm-text-muted);
    font-size: 0.75rem;
    pointer-events: none;
}

.pipeline-card {
    background: var(--crm-pipeline-card-bg);
    border: 1px solid var(--crm-border);
    border-radius: calc(var(--crm-radius) - 2px);
    padding: 0.5rem 0.625rem;
    cursor: grab;
    transition: box-shadow var(--crm-transition), border-color var(--crm-transition), opacity var(--crm-transition);
}

.pipeline-card:active {
    cursor: grabbing;
}

.pipeline-card--dragging {
    opacity: 0.55;
}

.pipeline-card:hover {
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    border-color: var(--crm-pipeline-card-hover-border);
}

.pipeline-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.375rem;
}

.pipeline-card__name {
    flex: 1;
    min-width: 0;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--crm-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pipeline-card__amount {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--crm-primary);
    white-space: nowrap;
}

.pipeline-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.5rem;
    margin-top: 0.25rem;
    font-size: 0.6875rem;
    line-height: 1.2;
    color: var(--crm-text-muted);
}

.pipeline-card__org {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pipeline-card__date {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
}

.pipeline-card__footer {
    margin-top: 0.375rem;
}

.pipeline-card__stage {
    width: 100%;
}

.pipeline-column__footer {
    padding: 0.4375rem 0.625rem;
    border-top: 1px solid var(--crm-border-light);
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.6875rem;
    color: var(--crm-text-muted);
    flex-shrink: 0;
}

/* Dashboard v2 */
.crm-dashboard-greeting {
    padding: 1.25rem 1.5rem;
    background: var(--crm-surface);
    border-bottom: 1px solid var(--crm-border);
}

.crm-dashboard-greeting__date {
    color: var(--crm-text-muted) !important;
    font-size: 0.8125rem !important;
    font-weight: 400 !important;
}

.crm-dashboard-greeting__title {
    font-weight: 600 !important;
    font-size: 1.375rem !important;
    color: var(--crm-text) !important;
    letter-spacing: -0.02em;
    margin-top: 0.25rem !important;
}

.crm-dashboard-body {
    padding: 1.25rem 0 0;
    background: var(--crm-bg);
}

.crm-widget {
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius-lg);
    overflow: hidden;
    height: 100%;
    box-shadow: none;
}

.crm-widget:hover { box-shadow: var(--crm-shadow-sm); }

.crm-widget__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--crm-border-light);
}

.crm-widget__title {
    font-weight: 600 !important;
    color: var(--crm-text) !important;
    font-size: 0.875rem !important;
}

.crm-widget__caption {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--crm-text-muted);
}

.crm-widget__body { padding: 1rem; }

.crm-quick-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: var(--crm-radius);
    border: 1px solid var(--crm-border-light);
    text-decoration: none !important;
    color: var(--crm-text) !important;
    transition: background var(--crm-transition), border-color var(--crm-transition);
    margin-bottom: 0.5rem;
}

.crm-quick-link:hover {
    background: var(--crm-border-light);
    border-color: var(--crm-border);
}

.crm-quick-link__icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--crm-primary-soft);
    color: var(--crm-primary);
}

/* Dashboard charts */
.crm-widget--chart .crm-widget__body {
    min-height: 260px;
}

.crm-widget--chart-sm .crm-widget__body {
    min-height: 220px;
}

.crm-bar-chart {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    min-height: var(--crm-bar-height, 260px);
}

.crm-bar-chart__y-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
    width: 2.75rem;
    padding-bottom: 2.5rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--crm-text-muted);
    font-variant-numeric: tabular-nums;
    text-align: right;
    line-height: 1;
}

.crm-bar-chart__plot {
    flex: 1;
    min-width: 0;
    position: relative;
    height: var(--crm-bar-height, 260px);
}

.crm-bar-chart__grid {
    position: absolute;
    inset: 0 0 2.5rem 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

.crm-bar-chart__grid-line {
    border-top: 1px solid var(--crm-border-light);
}

.crm-bar-chart__grid-line:last-child {
    border-top-color: #c8c6c4;
}

.crm-bar-chart__bars {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    gap: 1rem;
    height: 100%;
    padding: 0 0.75rem;
    position: relative;
    z-index: 1;
    overflow: visible;
}

.crm-bar-chart__column {
    flex: 1 1 0;
    width: auto;
    max-width: 9.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 5.75rem;
    height: 100%;
}

.crm-bar-chart__bar-area {
    flex: 1;
    width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

.crm-bar-chart__bar {
    width: 2.25rem;
    max-width: 70%;
    flex-shrink: 0;
    border-radius: 3px 3px 0 0;
    transition: height 0.35s ease, filter 0.15s ease;
}

.crm-bar-chart__bar--empty {
    opacity: 0.28;
}

.crm-bar-chart__bar:hover {
    filter: brightness(1.08);
}

.crm-bar-chart__bar-value {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--crm-text);
    margin-bottom: 0.35rem;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.crm-bar-chart__label {
    flex: 0 0 2.5rem;
    height: 2.5rem;
    margin-top: 0;
    padding: 0.4rem 0.15rem 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--crm-text-muted);
    text-align: center;
    line-height: 1.2;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    white-space: normal;
    word-break: break-word;
}

.crm-app-layout.crm-dark .crm-bar-chart__grid-line:last-child {
    border-top-color: var(--crm-border);
}

.crm-chart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    color: var(--crm-text-muted);
    text-align: center;
    gap: 0.5rem;
}

.crm-chart-empty__icon {
    font-size: 2.5rem !important;
    opacity: 0.35;
}

.tm-dash-link {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--crm-primary);
    text-decoration: none;
}

.tm-dash-link:hover {
    text-decoration: underline;
}

.tm-dash-empty {
    padding: 1.25rem 1rem;
    font-size: 0.8125rem;
    color: var(--crm-text-muted);
}

.tm-dash-list {
    display: flex;
    flex-direction: column;
}

.tm-dash-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--crm-border-light);
    text-decoration: none !important;
    color: inherit;
}

.tm-dash-row:last-child {
    border-bottom: 0;
}

.tm-dash-row:hover {
    background: var(--crm-primary-soft, #f4f5f7);
}

.tm-dash-row__icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
}

.tm-dash-row__copy {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.tm-dash-row__title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--crm-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tm-dash-row__meta {
    font-size: 0.75rem;
    color: var(--crm-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tm-dash-row .pm-directory__lozenge {
    flex-shrink: 0;
    font-size: 0.625rem;
    padding: 0.15rem 0.45rem;
    white-space: nowrap;
}

.tm-dash {
    --tm-dash-bg: #F7F8FC;
    --tm-dash-ink: #111827;
    --tm-dash-muted: #6B7280;
    margin: calc(-1 * var(--crm-page-padding-y, 1.25rem)) calc(-1 * var(--crm-page-padding-x, 1.5rem)) -1.5rem;
    min-height: calc(100% + var(--crm-page-padding-y, 1.25rem) + 1.5rem);
    background: var(--tm-dash-bg);
    padding-bottom: 1.75rem;
    flex: 1 1 auto;
}

.tm-dash-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem var(--crm-page-padding-x, 1.5rem) 1.2rem;
    background: #fff;
    border-bottom: 1px solid #E5E7EB;
    box-shadow: 0 1px 4px rgba(17, 24, 39, 0.04);
}

.tm-dash-header__kicker {
    margin: 0 0 0.2rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6B7280;
}

.tm-dash-header__title {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 750;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: #111827;
}

.tm-dash-header__sub {
    margin: 0.28rem 0 0;
    font-size: 0.9rem;
    color: #6B7280;
}

.tm-dash-header__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    padding-top: 0.15rem;
}

.tm-dash-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    height: 36px;
    padding: 0 0.9rem;
    border-radius: 10px;
    border: 1px solid #E5E7EB;
    background: #fff;
    color: #111827;
    font-size: 0.8125rem;
    font-weight: 650;
    text-decoration: none !important;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}

.tm-dash-btn:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
}

.tm-dash-btn--primary {
    background: #6366F1;
    border-color: #6366F1;
    color: #fff;
    box-shadow: 0 8px 18px rgba(99, 102, 241, 0.28);
}

.tm-dash-btn--primary:hover {
    background: #4F46E5;
    border-color: #4F46E5;
    color: #fff;
}

.tm-dash-btn .mud-icon-root {
    font-size: 1.05rem !important;
}

.tm-dash .crm-dashboard-body,
.tm-dash-body {
    padding: 1rem var(--crm-page-padding-x, 1.5rem) 0;
    background: transparent;
}

.tm-dash .crm-widget.tm-dash-card {
    border-radius: 16px;
    border-color: #E5E7EB;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 8px 20px rgba(17, 24, 39, 0.04);
    background: #fff;
}

.tm-dash .crm-widget-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem 0.7rem;
    border-bottom: 1px solid #F3F4F6;
}

.tm-dash .crm-widget-title {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em;
    color: #111827 !important;
    line-height: 1.25 !important;
}

.tm-dash .crm-muted {
    display: block;
    margin-top: 0.12rem;
    color: #6B7280 !important;
}

.tm-dash .crm-widget-body--chart {
    padding: 0.35rem 0.85rem 0.9rem;
}

.tm-dash .tm-dash-card__chart {
    min-height: 0;
}

.tm-dash .tm-dash-card__chart--sm {
    padding-top: 0.15rem;
}

.tm-dash .crm-chart-empty {
    min-height: 150px;
}

.tm-dash-chip {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    height: 22px;
    padding: 0 0.5rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 650;
    white-space: nowrap;
}

.tm-dash-chip--warn {
    background: #FEF2F2;
    color: #DC2626;
}

.tm-dash-row__mark {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tm-dash-row--recent {
    padding: 0.72rem 1rem;
}

.tm-dash-row__due {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6B7280;
    min-width: 5.5rem;
    text-align: right;
}

.tm-dash-row__icon--warn {
    background: #FEF2F2;
    color: #DC2626;
}

.tm-dash-row__icon--info {
    background: #EEF2FF;
    color: #4F46E5;
}

.tm-dash-row__chevron {
    color: #9CA3AF;
}

.tm-dash .tm-dash-row:hover {
    background: #F8FAFC;
}

.tm-dash-list--recent .tm-dash-row:nth-child(even) {
    background: #FCFCFD;
}

.tm-area-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 168px;
    text-align: center;
    padding: 0.75rem 1rem 1rem;
}

.tm-area-empty__icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #EEF2FF, #F5F3FF);
    color: #6366F1;
    margin-bottom: 0.7rem;
}

.tm-area-empty__icon .mud-icon-root {
    font-size: 1.5rem !important;
}

.tm-area-empty__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
}

.tm-area-empty__sub {
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: #6B7280;
}

.tm-prod-chart {
    display: flex;
    align-items: stretch;
    gap: 0.65rem;
    min-height: 220px;
    height: 220px;
    padding: 0.15rem 0.15rem 0;
}

.tm-prod-chart__axis {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: 1.35rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #94A3B8;
    text-align: right;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.tm-prod-chart__axis-spacer {
    height: 1.25rem;
    flex-shrink: 0;
}

.tm-prod-chart__axis-spacer--labels {
    height: 1.5rem;
}

.tm-prod-chart__ticks {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.tm-prod-chart__plot {
    position: relative;
    flex: 1;
    min-width: 0;
}

.tm-prod-chart__grid {
    position: absolute;
    top: 1.25rem;
    right: 0;
    bottom: 1.5rem;
    left: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

.tm-prod-chart__grid span {
    display: block;
    border-top: 1px dashed #E5E7EB;
}

.tm-prod-chart__grid span:last-child {
    border-top: 1px solid #D1D5DB;
}

.tm-prod-chart__cols {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 0.55rem;
    height: 100%;
}

.tm-prod-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tm-prod-col__value {
    height: 1.25rem;
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.25rem;
    font-variant-numeric: tabular-nums;
}

.tm-prod-col--empty .tm-prod-col__value {
    color: #CBD5E1 !important;
}

.tm-prod-col__track {
    flex: 1 1 auto;
    width: 26px;
    max-width: 56%;
    min-height: 0;
    position: relative;
    overflow: hidden;
    background: #EEF2F6;
    border-radius: 10px 10px 0 0;
}

.tm-prod-col__fill {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 10px 10px 0 0;
}

.tm-prod-col__label {
    height: 1.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 0.1rem;
    font-size: 0.72rem;
    font-weight: 650;
    color: #6B7280;
    line-height: 1;
}

.tm-prod-col__label--current {
    color: #111827;
    font-weight: 750;
}

html:has(.crm-app-layout.crm-dark) .tm-prod-chart__axis,
html:has(.crm-app-layout.crm-dark) .tm-prod-col__label {
    color: var(--crm-text-muted);
}

html:has(.crm-app-layout.crm-dark) .tm-prod-chart__grid span {
    border-top-color: var(--crm-border);
}

html:has(.crm-app-layout.crm-dark) .tm-prod-col__track {
    background: rgba(255, 255, 255, 0.08);
}

html:has(.crm-app-layout.crm-dark) .tm-prod-col__label--current {
    color: var(--crm-text);
}

.crm-donut-chart__legend--cards {
    flex: 1 1 12rem;
    gap: 0.4rem;
    min-width: 11rem;
}

.crm-donut-chart__legend--cards .crm-donut-chart__legend-item {
    background: #F8FAFC;
    border: 1px solid #EEF2F7;
    border-radius: 10px;
    padding: 0.42rem 0.6rem;
}

.tm-dash .crm-donut-chart {
    min-height: 0;
    gap: 1.25rem 1.5rem;
    padding: 0.15rem 0.15rem 0.35rem;
    justify-content: flex-start;
}

.tm-dash .crm-donut-chart__ring-wrap {
    width: 132px;
    height: 132px;
}

.tm-dash .crm-donut-chart__total {
    font-size: 1.5rem;
}

.tm-dash .crm-bar-chart {
    min-height: var(--crm-bar-height, 148px);
}

@media (max-width: 720px) {
    .tm-dash-header {
        flex-direction: column;
        align-items: stretch;
    }

    .tm-dash-header__actions {
        padding-top: 0;
    }

    .tm-dash-row__due {
        display: none;
    }
}

.crm-donut-chart {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1.75rem 2.5rem;
    min-height: 240px;
    padding: 0.5rem 0;
}

.crm-donut-chart__ring-wrap {
    position: relative;
    width: 168px;
    height: 168px;
    flex-shrink: 0;
}

.crm-donut-chart__ring {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.crm-donut-chart__center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 58%;
    height: 58%;
    background: var(--crm-surface);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px var(--crm-border-light);
}

.crm-donut-chart__total {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--crm-text);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.crm-donut-chart__total-label {
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--crm-text-muted);
    margin-top: 0.125rem;
}

.crm-donut-chart__legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    min-width: 10rem;
}

.crm-donut-chart__legend-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.5rem 0.75rem;
    font-size: 0.8125rem;
}

.crm-donut-chart__swatch {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 3px;
    flex-shrink: 0;
}

.crm-donut-chart__legend-label {
    font-weight: 500;
    color: var(--crm-text);
}

.crm-donut-chart__legend-value {
    font-weight: 600;
    color: var(--crm-text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.crm-app-layout.crm-dark .crm-donut-chart__ring {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.crm-pipeline-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--crm-border-light);
}

.crm-pipeline-chip {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--crm-border-light);
    border-radius: var(--crm-radius);
    background: var(--crm-surface);
    min-width: 120px;
    flex: 1 1 auto;
    transition: border-color var(--crm-transition), box-shadow var(--crm-transition);
}

.crm-pipeline-chip:hover {
    border-color: var(--crm-primary);
    box-shadow: var(--crm-shadow-sm);
}

.crm-pipeline-chip__stage {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--crm-text);
}

.crm-pipeline-chip__meta {
    font-size: 0.6875rem;
    color: var(--crm-text-muted);
}

.crm-pipeline-chip__value {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--crm-primary);
    font-variant-numeric: tabular-nums;
}

.crm-trend-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--crm-border-light);
}

.crm-trend-summary__item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--crm-radius);
    background: var(--crm-border-light);
}

@media (max-width: 768px) {
    .crm-trend-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .crm-global-search { max-width: 100%; }
    .crm-user-menu__name { display: none !important; }
    .crm-module-header__top { padding: 1rem; }
    .crm-module-header__toolbar { padding: 0.75rem 1rem; }
    .pipeline-board { padding: 0.75rem; }
}

/* Form fields — label above input (HubSpot style) */
.crm-field {
    width: 100%;
    margin: 0;
}

.crm-field + .crm-field {
    margin-top: var(--crm-field-gap);
}

.crm-form-stack > .crm-field,
.crm-form-stack > .crm-field + .crm-field,
.record-drawer__body > .crm-field,
.record-drawer__body > .crm-field + .crm-field,
.crm-form-grid > .crm-field,
.crm-form-grid > .crm-field + .crm-field,
.auth-form > .crm-field,
.auth-form > .crm-field + .crm-field,
.form-section__body > .crm-field,
.form-section__body > .crm-field + .crm-field,
.mud-stack > .crm-field,
.mud-stack > .crm-field + .crm-field {
    margin-top: 0;
}

.crm-customer-picker .mud-stack {
    gap: var(--crm-field-gap) !important;
}

.record-drawer .mud-input-control,
.mud-grid .mud-input-control,
.crm-panel .mud-input-control,
.record-drawer .crm-field .mud-input-control,
.record-drawer .crm-field .mud-input-root,
.record-drawer .crm-field .crm-form-select-wrap,
.record-drawer .crm-field .crm-form-date-picker {
    width: 100%;
    max-width: 100%;
}

.crm-field > .crm-form-select-wrap,
.crm-field > .crm-money-field,
.crm-field > .crm-native-textarea,
.crm-field > .mud-input-control,
.crm-field > .mud-menu,
.crm-field > .crm-filter-dropdown,
.crm-field .mud-input-control,
.crm-field .mud-input-root {
    width: 100%;
    max-width: 100%;
}

.crm-field__label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--crm-text);
    margin-bottom: var(--crm-label-gap);
    line-height: 1.3;
}

.crm-field__required { color: #f2545b; margin-left: 2px; }

.crm-field__helper {
    font-size: 0.75rem;
    color: #516f90;
    margin-top: 0.375rem;
}

.crm-field__error,
.validation-message {
    display: block;
    font-size: 0.75rem;
    color: #f2545b;
    margin-top: 0.375rem;
    line-height: 1.3;
}

.crm-panel__body > .crm-form-grid,
.crm-panel__body > .crm-form-stack {
    margin-top: 0;
}

.mud-dialog-content .crm-field + .crm-field {
    margin-top: var(--crm-field-gap);
}

.crm-input .mud-input-root {
    margin-top: 0 !important;
    min-height: var(--crm-control-height) !important;
    height: var(--crm-control-height) !important;
    max-height: var(--crm-control-height) !important;
}

.crm-input:has(textarea) .mud-input-root {
    height: auto !important;
    min-height: unset !important;
    max-height: none !important;
}

.crm-input .mud-input-slot {
    min-height: var(--crm-control-height) !important;
    height: var(--crm-control-height) !important;
    max-height: var(--crm-control-height) !important;
    font-size: var(--crm-control-font-size) !important;
    font-weight: 400 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: var(--crm-control-padding-x) !important;
    padding-right: var(--crm-control-padding-x) !important;
    line-height: var(--crm-control-line-height) !important;
    overflow: visible !important;
    box-sizing: border-box !important;
}

.crm-input:has(textarea) .mud-input-slot,
.crm-input textarea.mud-input-slot {
    height: auto !important;
    min-height: 72px !important;
    max-height: none !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    display: block !important;
    align-items: stretch !important;
}

.crm-input .mud-input-outlined .mud-input-outlined-border legend {
    max-width: 0 !important;
}

.crm-input .mud-input-outlined .mud-input-outlined-border legend span {
    display: none !important;
}

.crm-input--compact .mud-input-root,
.crm-input--compact .mud-input-slot {
    min-height: var(--crm-control-height-compact) !important;
    height: var(--crm-control-height-compact) !important;
    max-height: var(--crm-control-height-compact) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    font-size: 0.75rem !important;
}

.crm-module-header__toolbar .crm-input--compact .mud-input-root,
.crm-module-header__toolbar .crm-input--compact .mud-input-slot {
    min-height: var(--crm-control-height) !important;
    height: var(--crm-control-height) !important;
    max-height: var(--crm-control-height) !important;
    font-size: var(--crm-control-font-size) !important;
}

/* Numeric inputs — keep full height, allow text to render without clipping */
.mud-input-number-control .mud-input-root,
.mud-input-number-control .mud-input-slot,
.mud-input-number-control .mud-input-control-input-container {
    overflow: visible !important;
}

.mud-input-number-control .mud-input-control-input-container input {
    overflow: visible !important;
    text-overflow: clip !important;
}

.crm-input .mud-input-outlined .mud-input-outlined-border {
    border-radius: var(--crm-radius) !important;
    border-color: var(--crm-control-border-color) !important;
}

.crm-module-header__toolbar .crm-input .mud-input-outlined:hover .mud-input-outlined-border,
.crm-module-header__toolbar .crm-filter-trigger:hover {
    border-color: var(--crm-primary) !important;
}

.crm-module-header__toolbar .crm-input .mud-input-adornment-start .mud-icon-root {
    color: var(--crm-text-muted) !important;
    font-size: 1.125rem !important;
}

.crm-input.mud-input-outlined:hover .mud-input-outlined-border {
    border-color: var(--crm-primary) !important;
}

/* Typed text must stay visible — dark Mud palette + white CRM panels */
.crm-native-textarea,
.record-drawer .crm-native-textarea,
.crm-panel .crm-native-textarea,
.form-section .crm-native-textarea,
.mud-dialog .crm-native-textarea,
.crm-section-editor .crm-native-textarea,
.crm-panel textarea.mud-input-slot,
.crm-panel .mud-input-control-input-container textarea,
.crm-panel .mud-input-root input,
.crm-panel .mud-input-root textarea,
.crm-panel .mud-input-slot,
.crm-panel .mud-input-slot input,
.crm-panel .mud-input-slot textarea,
.crm-input textarea.mud-input-slot,
.crm-input .mud-input-control-input-container textarea,
.crm-input .mud-input-root input,
.crm-input .mud-input-root textarea,
.crm-input .mud-input-slot,
.crm-input .mud-input-slot input,
.crm-input .mud-input-slot textarea,
.crm-section-editor textarea.mud-input-slot,
.crm-section-editor .mud-input-control-input-container textarea {
    color: #242424 !important;
    -webkit-text-fill-color: #242424 !important;
    caret-color: #242424 !important;
}

.crm-panel .mud-input-root,
.crm-input .mud-input-root {
    background-color: #ffffff;
}

.crm-panel .mud-input-slot textarea::placeholder,
.crm-input .mud-input-slot textarea::placeholder,
.crm-panel .mud-input-slot input::placeholder,
.crm-input .mud-input-slot input::placeholder {
    color: #616161 !important;
    opacity: 1;
}

/* Compact data table — readable sizing (not ultra-dense) */
.crm-data-table-wrap--compact .mud-table-cell {
    font-size: 0.875rem !important;
    padding: 0.6875rem 0.875rem !important;
    line-height: 1.45 !important;
}

.crm-data-table-wrap--compact .mud-table-head .mud-table-cell {
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    padding: 0.6875rem 0.875rem !important;
    letter-spacing: 0.01em;
    text-transform: none;
}

.crm-cell-nowrap { white-space: nowrap; }

.crm-cell-ellipsis {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-module-header__title {
    font-size: 1.125rem !important;
}

.crm-module-header__desc {
    font-size: 0.75rem !important;
}

/* Record detail page */
.record-detail { padding: 0; }

.record-detail__back { margin-bottom: 0.75rem; }

.record-detail__grid {
    display: grid;
    grid-template-columns: 280px 1fr 260px;
    gap: 1rem;
    align-items: start;
}

@media (max-width: 1100px) {
    .record-detail__grid { grid-template-columns: 1fr; }
}

.record-detail__profile {
    text-align: center;
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--crm-border-light);
}

.record-detail__name {
    font-size: 1rem !important;
    font-weight: 700 !important;
    margin-top: 0.75rem !important;
}

.record-detail__email {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem !important;
}

.record-detail__actions {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.record-detail__sidebar,
.record-detail__related,
.record-detail__card {
    background: #fff;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
}

.record-detail__card {
    padding: 1rem;
}

.record-detail__card-title {
    font-weight: 600 !important;
    color: var(--crm-text-muted) !important;
    margin-bottom: 0.75rem !important;
    display: block;
}

.record-detail__props {
    margin: 0;
    font-size: 0.75rem;
}

.record-detail__props dt {
    color: var(--crm-text-muted);
    font-weight: 600;
    margin-top: 0.625rem;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.record-detail__props dd {
    margin: 2px 0 0;
    color: var(--crm-text);
    word-break: break-word;
}

.crm-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.125rem;
    height: 1.125rem;
    padding: 0 0.35rem;
    margin-left: 0.35rem;
    border-radius: 999px;
    background: var(--crm-primary);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 600;
    line-height: 1;
}

.lead-followup-preview {
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--crm-border);
}

.lead-import-file-input {
    display: block;
    width: 100%;
    font-size: 0.8125rem;
}

.lead-import-file-input::file-selector-button {
    margin-right: 0.75rem;
    border: 1px solid var(--crm-border);
    background: #fff;
    border-radius: var(--crm-radius-sm);
    padding: 0.375rem 0.75rem;
    cursor: pointer;
    font-size: 0.8125rem;
}

.record-detail__tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--crm-border-light);
    margin-bottom: 1rem;
}

.record-detail__main { min-width: 0; }

/* Sticky actions column */
.crm-col-created {
    min-width: 112px !important;
    width: 112px !important;
    max-width: 112px !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    box-sizing: border-box;
}

.crm-col-actions {
    position: sticky !important;
    right: 0 !important;
    z-index: 2 !important;
    background: var(--crm-action-sticky-bg) !important;
    box-shadow: -8px 0 16px -8px rgba(15, 23, 42, 0.08);
    min-width: 200px !important;
    width: 200px !important;
    max-width: 200px !important;
    text-align: right !important;
    padding-left: 0.5rem !important;
    padding-right: 0.875rem !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    box-sizing: border-box;
}

.crm-data-table-wrap .mud-table-head .crm-col-actions {
    background: var(--crm-action-sticky-bg) !important;
    z-index: 4 !important;
    color: var(--crm-text-muted) !important;
    text-align: center !important;
    vertical-align: bottom;
}

.crm-data-table-wrap .mud-table-head .mud-table-cell.crm-col-actions {
    text-align: center !important;
}

.crm-data-table-wrap .mud-table-head .crm-col-created {
    vertical-align: bottom;
    z-index: 1 !important;
}

.crm-data-table-wrap .mud-table-body .mud-table-row:hover .crm-col-actions {
    background: var(--crm-action-sticky-hover) !important;
}

.crm-row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.1875rem;
    padding: 0.1875rem 0.25rem;
    border-radius: 999px;
    background: transparent;
    transition: background var(--crm-transition), box-shadow var(--crm-transition);
}

.crm-data-table-wrap .mud-table-row:hover .crm-row-actions {
    background: rgba(243, 242, 241, 0.95);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.crm-row-actions__divider {
    width: 1px;
    height: 20px;
    margin: 0 0.1875rem;
    background: var(--crm-border);
    flex-shrink: 0;
}

.crm-action-btn.mud-icon-button {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    padding: 0 !important;
    border-radius: 8px !important;
    color: var(--crm-action-icon) !important;
    background: transparent !important;
    transition: background var(--crm-transition), color var(--crm-transition), transform 0.12s ease !important;
}

.crm-action-btn.mud-icon-button .mud-icon-root {
    font-size: 1.125rem !important;
}

.crm-action-btn.mud-icon-button:hover {
    transform: translateY(-1px);
}

.crm-action-btn.mud-icon-button:disabled {
    opacity: 0.38 !important;
    transform: none !important;
}

.crm-action-btn--view:hover {
    background: var(--crm-action-hover-neutral) !important;
    color: var(--crm-text) !important;
}

.crm-action-btn--edit:hover {
    background: var(--crm-action-hover-edit) !important;
    color: #ca5010 !important;
}

.crm-action-btn--info:hover {
    background: var(--crm-action-hover-info) !important;
    color: #0078d4 !important;
}

.crm-action-btn--primary:hover {
    background: var(--crm-primary-soft) !important;
    color: var(--crm-primary) !important;
}

.crm-action-btn--danger {
    color: #a4262c !important;
}

.crm-action-btn--danger:hover {
    background: var(--crm-action-hover-danger) !important;
    color: #d13438 !important;
}

/* Filter multi-select trigger */
.crm-filter-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: var(--crm-control-height);
    min-height: var(--crm-control-height);
    max-height: var(--crm-control-height);
    padding: 0 0.75rem;
    font-family: inherit;
    font-size: var(--crm-control-font-size);
    font-weight: 400;
    line-height: var(--crm-control-line-height);
    color: var(--crm-text);
    background: var(--crm-input-bg);
    border: 1px solid var(--crm-control-border-color);
    border-radius: var(--crm-radius);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    gap: 0.375rem;
    box-sizing: border-box;
}

.crm-module-header__toolbar .crm-filter-trigger .mud-icon-root {
    color: var(--crm-text-muted);
    font-size: 1.125rem !important;
}

.crm-filter-trigger:hover {
    border-color: var(--crm-primary);
}

.crm-filter-trigger:focus {
    outline: none;
    border-color: var(--crm-primary);
    box-shadow: 0 0 0 2px rgba(91, 95, 199, 0.15);
}

.crm-filter-trigger--open {
    border-color: var(--crm-primary);
    box-shadow: 0 0 0 2px rgba(91, 95, 199, 0.15);
}

.crm-filter-trigger__icon {
    color: var(--crm-text-muted);
    flex-shrink: 0;
    transition: transform 0.15s ease, color 0.15s ease;
}

.crm-filter-trigger--open .crm-filter-trigger__icon {
    color: var(--crm-primary);
    transform: rotate(180deg);
}

.crm-filter-trigger__text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
    flex: 1;
    color: var(--crm-text);
}

.crm-filter-trigger--placeholder .crm-filter-trigger__text {
    color: var(--crm-text-muted);
}

.crm-filter-dropdown {
    position: relative;
    width: 100%;
}

.crm-filter-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 100%;
    width: max-content;
    max-width: 280px;
    max-height: 320px;
    overflow-y: auto;
    background: var(--crm-menu-bg);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius-lg);
    box-shadow: var(--crm-shadow-lg);
    z-index: 4100;
    padding: 0.375rem;
}

.crm-filter-menu__item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    min-height: 36px;
    padding: 0.4375rem 0.625rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.35;
    color: var(--crm-text);
    cursor: pointer;
    text-align: left;
    transition: background var(--crm-transition);
}

.crm-filter-menu__item:hover {
    background: var(--crm-border-light);
}

.crm-filter-menu__item--selected {
    background: var(--crm-primary-soft);
}

.crm-filter-menu__item--selected:hover {
    background: #dedff8;
}

.crm-filter-menu__checkbox {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border: 1.5px solid var(--crm-control-border-color);
    border-radius: 4px;
    background: var(--crm-input-bg);
    color: #fff;
    transition: background var(--crm-transition), border-color var(--crm-transition);
}

.crm-filter-menu__checkbox--checked {
    background: var(--crm-primary);
    border-color: var(--crm-primary);
}

.crm-filter-menu__checkbox .mud-icon-root {
    font-size: 0.875rem !important;
}

.crm-filter-menu__label {
    flex: 1;
    min-width: 0;
    line-height: 1.35;
}

.crm-filter-menu__divider {
    height: 1px;
    background: var(--crm-border-light);
    margin: 0.375rem 0.25rem;
}

.crm-filter-menu__clear {
    display: flex;
    align-items: center;
    width: calc(100% - 0.5rem);
    min-height: 34px;
    margin: 0 0.25rem;
    padding: 0.4375rem 0.625rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--crm-primary);
    cursor: pointer;
    text-align: left;
    transition: background var(--crm-transition);
}

.crm-filter-menu__clear:hover {
    background: var(--crm-border-light);
}

/* Record filter panel */
.crm-record-filter {
    margin: 0 1.5rem 1.25rem;
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: 12px;
    box-shadow: var(--crm-shadow-sm);
    overflow: visible;
    position: relative;
    z-index: 20;
}

.crm-record-filter + .crm-pipeline-wrap,
.crm-record-filter + .crm-data-table-wrap {
    margin-top: 0.25rem;
}

.crm-record-filter__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    border-bottom: 1px solid transparent;
}

.crm-record-filter--expanded .crm-record-filter__header {
    border-bottom-color: var(--crm-border-light);
}

.crm-record-filter__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.375rem;
    margin: 0;
    border: none;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
    color: var(--crm-text);
    border-radius: 8px;
    transition: background var(--crm-transition);
}

.crm-record-filter__toggle:hover {
    background: var(--crm-border-light);
}

.crm-record-filter__toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--crm-primary-soft);
    color: var(--crm-primary);
}

.crm-record-filter__title {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.crm-record-filter__badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: var(--crm-radius-pill);
    background: var(--crm-primary-soft);
    color: var(--crm-primary);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.crm-record-filter__chevron {
    color: var(--crm-text-muted);
    margin-left: 0.125rem;
}

.crm-record-filter__clear {
    min-height: 32px !important;
    padding: 0 0.625rem !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    color: var(--crm-text-muted) !important;
    text-transform: none !important;
}

.crm-record-filter__clear:hover {
    color: var(--crm-primary) !important;
    background: var(--crm-primary-soft) !important;
}

.crm-record-filter__body {
    padding: 1rem 1rem 1.125rem;
}

.crm-record-filter__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.875rem 1rem;
}

.crm-record-filter__field {
    min-width: 0;
    margin: 0 !important;
}

.crm-record-filter__field .crm-field__label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--crm-text-muted);
    margin-bottom: 0.375rem;
    letter-spacing: 0.01em;
}

.crm-record-filter__field .crm-input--compact .mud-input-root,
.crm-record-filter__field .crm-input--compact .mud-input-slot,
.crm-record-filter__field .crm-filter-trigger,
.crm-record-filter__field .mud-picker-input .mud-input-root,
.crm-record-filter__field .mud-picker-input .mud-input-slot {
    min-height: var(--crm-control-height) !important;
    height: var(--crm-control-height) !important;
    max-height: var(--crm-control-height) !important;
}
.crm-record-filter__grid .crm-filter-field {
    min-width: 0;
    max-width: none;
    flex-shrink: 1;
}

@media (max-width: 1200px) {
    .crm-record-filter__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .crm-record-filter__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .crm-record-filter {
        margin-left: 1rem;
        margin-right: 1rem;
    }

    .crm-record-filter__grid {
        grid-template-columns: 1fr;
    }
}

.crm-hr-dashboard {
    padding: 0 var(--crm-page-padding-x, 24px) var(--crm-page-padding-y, 24px);
}

.crm-hr-card {
    cursor: pointer;
    border: 1px solid var(--crm-border, rgba(0, 0, 0, 0.08));
    border-radius: 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    height: 100%;
}

.crm-hr-card:hover {
    border-color: var(--crm-primary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.crm-hr-card__icon {
    color: var(--crm-primary);
    margin-bottom: 12px;
}

.crm-hr-card__title {
    font-weight: 600;
    margin-bottom: 4px;
}

.crm-hr-card__desc {
    color: var(--crm-text-muted, rgba(0, 0, 0, 0.6));
}

.crm-admin-layout {
    --crm-primary: #4F46E5;
    --crm-primary-dark: #3730A3;
    --crm-primary-soft: #E0E7FF;
}

.crm-admin-logo {
    background: #4F46E5 !important;
    color: #fff !important;
}

.crm-admin-title {
    font-weight: 600;
    letter-spacing: 0.01em;
}

.crm-tenant-banner {
    margin-bottom: 1rem;
}

.crm-admin-auth .auth-page__logo {
    background: #4F46E5;
    color: #fff;
}

.pm-workspace {
    width: 100%;
}

.pm-tabs {
    display: flex;
    width: 100%;
    align-items: stretch;
    border-bottom: 1px solid var(--crm-border);
}

.pm-tabs__tab {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-width: 0;
    min-height: 42px;
    padding: 0 0.5rem;
    margin: 0;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--crm-text-muted);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.pm-tabs__tab:hover {
    color: var(--crm-text);
    background: var(--crm-border-light);
}

.pm-tabs__tab--active {
    color: var(--crm-text);
    font-weight: 600;
    border-bottom-color: var(--crm-primary);
    background: transparent;
}

.pm-tabs__tab .mud-icon-root {
    font-size: 1.125rem;
    width: 1.125rem;
    height: 1.125rem;
    opacity: 0.78;
}

.pm-tabs__tab--active .mud-icon-root {
    opacity: 1;
    color: var(--crm-primary);
}

.pm-tab-panel {
    padding: 1.25rem 0 1.5rem;
}

.pm-backlog {
    max-width: 1180px;
}

.pm-backlog__header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.625rem;
}

.pm-backlog__create-sprint {
    margin-left: auto;
}

.pm-backlog__heading {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--crm-text);
}

.pm-backlog__count {
    font-size: 0.75rem;
    color: var(--crm-text-muted);
}

.pm-backlog__list {
    --pm-backlog-cols: 28px minmax(0, 1fr) 56px 72px 80px 132px;
    border: 1px solid var(--crm-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--crm-surface, #fff);
}

.pm-backlog__cols,
.pm-backlog__row {
    display: grid;
    grid-template-columns: var(--pm-backlog-cols);
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.75rem;
}

.pm-backlog__cols {
    min-height: 36px;
    border-bottom: 1px solid var(--crm-border);
    background: var(--crm-border-light, #fafbfc);
    color: var(--crm-text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pm-backlog__cols-end {
    justify-self: end;
    text-align: right;
}

.pm-backlog__cols-center {
    justify-self: center;
    text-align: center;
}

.pm-backlog__row {
    min-height: 42px;
    border-bottom: 1px solid var(--crm-border-light, #f3f2f1);
    cursor: pointer;
    background: var(--crm-surface, #fff);
}

.pm-backlog__row:hover {
    background: var(--crm-border-light, #f4f5f7);
}

.pm-backlog__type {
    display: inline-flex;
    color: #2684ff;
}

.pm-backlog__type .mud-icon-root {
    font-size: 1.125rem;
    width: 1.125rem;
    height: 1.125rem;
}

.pm-backlog__title {
    font-size: 0.875rem;
    color: var(--crm-text);
    font-weight: 500;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pm-backlog__priority {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
}

.pm-backlog__priority .mud-icon-root {
    font-size: 1.25rem;
    width: 1.25rem;
    height: 1.25rem;
}

.pm-backlog__priority--urgent { color: #c9372c; }
.pm-backlog__priority--high { color: #d97917; }
.pm-backlog__priority--normal { color: #b38600; }
.pm-backlog__priority--low { color: #3d6b99; }

.pm-backlog__due {
    font-size: 0.75rem;
    color: var(--crm-text-muted);
    text-align: center;
    justify-self: center;
    white-space: nowrap;
}

.pm-backlog__assignee {
    display: flex;
    justify-content: center;
}

.pm-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pm-avatar--sm {
    width: 24px;
    height: 24px;
    font-size: 0.625rem;
}

.pm-avatar--empty {
    background: transparent;
    border: 1px dashed #c1c7d0;
    color: #7a869a;
}

.pm-avatar--empty .mud-icon-root {
    font-size: 0.9375rem;
    width: 0.9375rem;
    height: 0.9375rem;
}

/* Project picker (task create / edit) */
.tm-project-picker {
    width: 100%;
}

.tm-project-picker .mud-menu {
    width: 100%;
}

.tm-project-picker__trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    height: var(--crm-control-height);
    min-height: var(--crm-control-height);
    padding: 0 var(--crm-control-padding-x);
    border: 1px solid var(--crm-control-border-color);
    border-radius: var(--crm-radius);
    background: #fff;
    font-size: var(--crm-control-font-size);
    font-weight: 400;
    line-height: var(--crm-control-line-height);
    color: var(--crm-text);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease;
}

.tm-project-picker__trigger:hover:not(:disabled) {
    border-color: var(--crm-primary);
}

.tm-project-picker__trigger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f5f8fa;
}

.tm-project-picker__label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tm-project-picker__chevron {
    margin-left: auto;
    color: var(--crm-text-muted);
    flex-shrink: 0;
}

.tm-project-picker__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tm-project-picker__icon--private {
    background: rgba(91, 95, 199, 0.1);
    color: var(--crm-primary);
}

.tm-project-picker__popover {
    z-index: 4000 !important;
}

.tm-project-picker__list {
    min-width: 280px !important;
    max-width: 360px;
    padding: 0.375rem !important;
}

.tm-project-picker__item {
    padding: 0 !important;
    min-height: auto !important;
    border-radius: var(--crm-radius) !important;
}

.tm-project-picker__item:hover {
    background: rgba(91, 95, 199, 0.06) !important;
}

.tm-project-picker__option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.5rem 0.625rem;
}

.tm-project-picker__option-copy {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.tm-project-picker__option-title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--crm-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tm-project-picker__option-sub {
    font-size: 0.6875rem;
    color: var(--crm-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tm-project-picker__check {
    color: var(--crm-primary);
    flex-shrink: 0;
}

.tm-project-picker__divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.375rem 0.625rem;
    color: var(--crm-text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tm-project-picker__divider::before,
.tm-project-picker__divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--crm-border-subtle, #dfe1e6);
}

.tm-project-picker--disabled {
    pointer-events: none;
}

.pm-backlog__move {
    display: flex;
    justify-content: center;
}

.pm-backlog__sprint {
    width: 100%;
    height: 28px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: var(--crm-text-muted);
    font-family: inherit;
    font-size: 0.75rem;
    padding: 0 0.35rem;
    cursor: pointer;
    text-align: center;
    text-align-last: center;
}

.pm-backlog__row:hover .pm-backlog__sprint,
.pm-backlog__sprint:focus {
    border-color: var(--crm-border);
    background: var(--crm-surface, #fff);
}

.pm-backlog__create {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    column-gap: 0.5rem;
    width: 100%;
    min-height: 42px;
    padding: 0 0.75rem;
    margin: 0;
    border: 0;
    background: var(--crm-surface, #fff);
    color: var(--crm-text-muted);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: left;
    justify-items: start;
    cursor: pointer;
}

.pm-backlog__create:hover,
.pm-backlog__create:focus-visible {
    background: var(--crm-border-light, #f4f5f7);
    color: var(--crm-primary);
    outline: none;
}

.pm-backlog__create-plus {
    width: 28px;
    text-align: center;
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1;
}

.pm-backlog__create-label {
    justify-self: start;
}

@media (max-width: 720px) {
    .pm-backlog__cols {
        display: none;
    }

    .pm-backlog__row {
        grid-template-columns: 28px minmax(0, 1fr) 36px;
        grid-template-areas:
            "type title assignee"
            "type meta meta";
        padding: 0.5rem 0.75rem;
        gap: 0.25rem 0.5rem;
    }

    .pm-backlog__type { grid-area: type; align-self: start; margin-top: 0.15rem; }
    .pm-backlog__title { grid-area: title; }
    .pm-backlog__assignee { grid-area: assignee; }
    .pm-backlog__priority,
    .pm-backlog__due,
    .pm-backlog__move { display: none; }
}

.pm-sprints {
    max-width: 1180px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pm-sprints__create {
    display: flex;
    justify-content: flex-start;
}

.pm-sprints__empty {
    padding: 1.25rem 1rem;
    border: 1px dashed var(--crm-border);
    border-radius: 8px;
    color: var(--crm-text-muted);
    font-size: 0.875rem;
}

.pm-sprint {
    border: 1px solid var(--crm-border);
    border-radius: 8px;
    background: var(--crm-surface, #fff);
    overflow: hidden;
}

.pm-sprint--active {
    box-shadow: inset 3px 0 0 #22a06b;
}

.pm-sprint__head {
    display: grid;
    grid-template-columns: 28px minmax(8rem, 1fr) auto auto auto auto;
    align-items: center;
    gap: 0.5rem 0.75rem;
    min-height: 52px;
    padding: 0.5rem 0.75rem;
    background: var(--crm-border-light, #fafbfc);
    border-bottom: 1px solid var(--crm-border);
}

.pm-sprint__toggle,
.pm-sprint__name {
    border: 0;
    background: transparent;
    padding: 0;
    font-family: inherit;
    cursor: pointer;
    color: var(--crm-text);
}

.pm-sprint__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--crm-text-muted);
    border-radius: 4px;
}

.pm-sprint__toggle:hover {
    background: rgba(0, 0, 0, 0.04);
}

.pm-sprint__identity {
    min-width: 0;
}

.pm-sprint__name {
    font-size: 0.9375rem;
    font-weight: 600;
    text-align: left;
    line-height: 1.3;
}

.pm-sprint__name:hover {
    color: var(--crm-primary);
}

.pm-sprint__goal {
    margin-top: 0.15rem;
    font-size: 0.75rem;
    color: var(--crm-text-muted);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pm-sprint__count,
.pm-sprint__dates {
    font-size: 0.75rem;
    color: var(--crm-text-muted);
    white-space: nowrap;
}

.pm-sprint__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.15rem;
}

.pm-sprint__action {
    border: 0;
    background: transparent;
    color: var(--crm-text-muted);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.35rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
}

.pm-sprint__action:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--crm-text);
}

.pm-pill--sprint-active {
    background: rgba(34, 160, 107, 0.12);
    color: #1f845a;
    border-color: transparent;
}

.pm-pill--sprint-planning {
    background: var(--crm-primary-soft);
    color: var(--crm-primary);
    border-color: transparent;
}

.pm-pill--sprint-completed {
    background: var(--crm-border-light, #f4f5f7);
    color: var(--crm-text-muted);
    border-color: transparent;
}

.pm-sprint__body {
    --pm-sprint-cols: 28px minmax(0, 1fr) 56px 72px 80px;
}

.pm-sprint__cols,
.pm-sprint__row {
    display: grid;
    grid-template-columns: var(--pm-sprint-cols);
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.75rem;
}

.pm-sprint__cols {
    min-height: 34px;
    border-bottom: 1px solid var(--crm-border);
    background: var(--crm-surface, #fff);
    color: var(--crm-text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pm-sprint__row {
    min-height: 42px;
    border-bottom: 1px solid var(--crm-border-light, #f3f2f1);
    cursor: pointer;
}

.pm-sprint__row:hover {
    background: var(--crm-border-light, #f4f5f7);
}

@media (max-width: 900px) {
    .pm-sprint__head {
        grid-template-columns: 28px 1fr auto;
        grid-template-areas:
            "toggle identity actions"
            "toggle meta meta";
    }

    .pm-sprint__toggle { grid-area: toggle; }
    .pm-sprint__identity { grid-area: identity; }
    .pm-sprint__actions { grid-area: actions; }
    .pm-sprint__count,
    .pm-sprint__dates { display: none; }
}

.crm-page-container:has(.pm-board-page) {
    min-width: 0;
    overflow-x: hidden;
}

.pm-board-page {
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
}

.pm-board-page .crm-module-header {
    flex-shrink: 0;
}

.pm-board-shell {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
    min-height: 0;
    max-width: 100%;
}

.pm-board-page .pm-board-shell {
    flex: 1 1 auto;
    min-height: 0;
}

.pm-board-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pm-board-toolbar__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.pm-board-search {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    width: 220px;
    height: 36px;
    padding: 0 0.65rem;
    border: 1px solid #dfe1e6;
    border-radius: 4px;
    background: var(--crm-surface, #fff);
    color: var(--crm-text-muted);
}

.pm-board-search .mud-icon-root {
    font-size: 1.05rem;
    width: 1.05rem;
    height: 1.05rem;
}

.pm-board-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--crm-text);
}

.pm-board-avatars {
    display: flex;
    align-items: center;
    padding-left: 0.25rem;
}

.pm-board-avatars__item {
    margin-left: -6px;
    border: 2px solid var(--crm-surface, #fff);
    cursor: pointer;
    position: relative;
    z-index: 1;
    padding: 0;
    appearance: none;
}

.pm-board-avatars__item:first-child {
    margin-left: 0;
}

.pm-board-avatars__item:hover,
.pm-board-avatars__item--active {
    z-index: 2;
}

.pm-board-avatars__item--active {
    box-shadow: 0 0 0 2px var(--crm-primary);
}

.pm-board-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    height: 36px;
    padding: 0 0.4rem 0 0.75rem;
    border: 1px solid #dfe1e6;
    border-radius: 4px;
    background: var(--crm-surface, #fff);
    color: #42526e;
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
}

.pm-board-filter:hover {
    background: #f4f5f7;
}

.pm-board-filter--active {
    background: var(--crm-primary-soft);
    border-color: var(--crm-primary);
    color: var(--crm-primary);
}

.pm-board-filter .mud-icon-root {
    font-size: 1.125rem;
    width: 1.125rem;
    height: 1.125rem;
    color: #6b778c;
}

.pm-board-menu {
    border-radius: 8px !important;
    border: 1px solid #dfe1e6 !important;
    box-shadow: 0 8px 16px -4px rgba(9, 30, 66, 0.25), 0 0 1px rgba(9, 30, 66, 0.31) !important;
    overflow: hidden;
}

.pm-board-menu__list {
    padding: 0.35rem 0 !important;
    min-width: 180px;
}

.pm-board-menu .mud-menu-item,
.pm-board-menu__item {
    min-height: 36px !important;
    padding: 0.5rem 1rem !important;
    font-size: 0.875rem !important;
    color: var(--crm-text) !important;
    border-radius: 0 !important;
}

.pm-board-menu .mud-menu-item:hover,
.pm-board-menu__item:hover {
    background: #f4f5f7 !important;
}

.pm-board-menu__item--active,
.pm-board-menu .pm-board-menu__item--active {
    background: var(--crm-primary-soft) !important;
    color: var(--crm-primary) !important;
    font-weight: 600 !important;
}

.crm-app-layout.crm-dark .pm-board-filter,
.crm-app-layout.crm-dark .pm-directory__filter-btn {
    border-color: var(--crm-border);
    color: var(--crm-text);
}

.crm-app-layout.crm-dark .pm-board-filter:hover,
.crm-app-layout.crm-dark .pm-directory__filter-btn:hover,
.crm-app-layout.crm-dark .pm-board-menu .mud-menu-item:hover {
    background: rgba(255, 255, 255, 0.06) !important;
}

.crm-app-layout.crm-dark .pm-board-menu {
    border-color: var(--crm-border) !important;
}

.pm-board-wrap {
    height: calc(100vh - 260px);
    min-height: 420px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

.pm-board,
.pm-board.mud-drop-container {
    display: flex;
    gap: 0.75rem;
    width: max-content;
    min-width: 100%;
    max-width: none;
    height: 100%;
    overflow: visible;
    align-items: stretch;
    padding: 0 0.15rem 0.5rem 0;
}

.pm-board-column {
    flex: 0 0 280px;
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    background: #f4f5f7;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

.crm-app-layout.crm-dark .pm-board-column {
    background: #252423;
}

.pm-board-column__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 0.75rem 0.5rem;
    flex-shrink: 0;
}

.pm-board-column__title {
    min-width: 0;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.25;
    text-transform: uppercase;
    color: var(--crm-text-muted);
}

.pm-board-column__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 0.375rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #dfe1e6;
    color: #42526e;
}

.crm-app-layout.crm-dark .pm-board-column__count {
    background: rgba(255, 255, 255, 0.12);
    color: var(--crm-text);
}

.pm-board-column__cards {
    flex: 1;
    overflow-y: auto;
    padding: 0 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-height: 120px;
}

.pm-board-column__cards.mud-drop-zone {
    min-height: 120px;
}

.pm-board-column__cards > .mud-drop-item {
    margin: 0 !important;
    min-width: 0;
    max-width: 100%;
    border-radius: 8px;
    overflow: hidden;
}

.pm-board-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 1px rgba(9, 30, 66, 0.2);
    padding: 0.5rem 0.65rem 0.4rem;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    cursor: grab;
    overflow: hidden;
    transition: background 0.12s ease, box-shadow 0.12s ease;
}

.crm-app-layout.crm-dark .pm-board-card {
    background: var(--crm-pipeline-card-bg, #323130);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
}

.pm-board-card:active {
    cursor: grabbing;
}

.pm-board-card:hover {
    background: #f4f5f7;
}

.crm-app-layout.crm-dark .pm-board-card:hover {
    background: #3b3a39;
}

.pm-board-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.4rem;
}

.pm-board-card__title {
    flex: 1;
    min-width: 0;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.35;
    color: var(--crm-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pm-board-card__label {
    display: inline-flex;
    flex-shrink: 0;
    margin-top: 0.05rem;
    padding: 0.05rem 0.35rem;
    border-radius: 8px;
    background: #eae6ff;
    color: #403294;
    font-size: 0.625rem;
    font-weight: 500;
    white-space: nowrap;
}

.pm-board-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    margin-top: 0.55rem;
}

.pm-board-card__key {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--crm-text-muted);
}

.pm-board-card__type {
    font-size: 0.875rem !important;
    width: 0.875rem;
    height: 0.875rem;
    color: #2684ff;
}

.pm-board-card__marks {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.pm-board-card__marks .pm-backlog__priority .mud-icon-root {
    font-size: 1rem;
    width: 1rem;
    height: 1rem;
}

.pm-board-card__marks .pm-avatar--sm {
    width: 22px;
    height: 22px;
    font-size: 0.5625rem;
}

.pm-files,
.pm-people-page {
    max-width: 1180px;
}

.pm-files__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.pm-files__toolbar .pm-backlog__header {
    margin-bottom: 0;
}

.pm-files__hint {
    margin: 0.25rem 0 0.75rem;
    font-size: 0.75rem;
    color: var(--crm-text-muted);
}

.pm-files__list {
    border: 1px solid var(--crm-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--crm-surface, #fff);
}

.pm-files__cols,
.pm-files__row {
    display: grid;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.75rem;
}

.pm-files__cols--docs,
.pm-files__row--docs {
    grid-template-columns: 32px minmax(0, 1fr) 112px 72px 80px 40px;
}

.pm-files__cols--files,
.pm-files__row--files {
    grid-template-columns: 32px minmax(0, 1fr) 72px 80px 40px;
}

.pm-files__cols--people,
.pm-files__row--people {
    grid-template-columns: 32px minmax(0, 1fr) 160px 40px;
}

.pm-files__cols {
    min-height: 36px;
    border-bottom: 1px solid var(--crm-border);
    background: var(--crm-border-light, #fafbfc);
    color: var(--crm-text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pm-files__cols-center {
    justify-self: center;
    text-align: center;
}

.pm-files__row {
    min-height: 48px;
    border-bottom: 1px solid var(--crm-border-light, #f3f2f1);
}

.pm-files__row:last-child {
    border-bottom: 0;
}

.pm-files__row:hover {
    background: var(--crm-border-light, #f4f5f7);
}

.pm-files__icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f4f5f7;
    color: #5e6c84;
    flex-shrink: 0;
}

.pm-files__icon .mud-icon-root {
    font-size: 1rem;
    width: 1rem;
    height: 1rem;
}

.pm-files__icon--pdf { background: #ffebe6; color: #de350b; }
.pm-files__icon--doc { background: #deebff; color: #0052cc; }
.pm-files__icon--sheet { background: #e3fcef; color: #006644; }
.pm-files__icon--ppt { background: #fff0e6; color: #c25100; }
.pm-files__icon--image { background: #eae6ff; color: #5243aa; }
.pm-files__icon--file { background: #f4f5f7; color: #5e6c84; }

.pm-files__name {
    min-width: 0;
}

.pm-files__title {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--crm-text);
    text-decoration: none;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

a.pm-files__title:hover {
    color: var(--crm-primary);
    text-decoration: underline;
}

.pm-files__meta,
.pm-files__size,
.pm-files__date,
.pm-files__role {
    font-size: 0.75rem;
    color: var(--crm-text-muted);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pm-files__lozenge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    height: 20px;
    padding: 0 0.5rem;
    border-radius: 3px;
    background: #dfe1e6;
    color: #42526e;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pm-files__action {
    justify-self: end;
}

.pm-files__row .crm-action-btn {
    opacity: 0;
}

.pm-files__row:hover .crm-action-btn,
.pm-files__row:focus-within .crm-action-btn {
    opacity: 1;
}

.pm-files__empty {
    padding: 1.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--crm-text-muted);
    text-align: center;
}

.pm-people-page__link {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--crm-primary);
    text-decoration: none;
    white-space: nowrap;
}

.pm-people-page__link:hover {
    text-decoration: underline;
}

.pm-people-team {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.75rem 0;
    padding: 0.75rem 1rem;
    border: 1px solid var(--crm-border);
    border-radius: 8px;
    background: var(--crm-surface, #fff);
}

.pm-people-team__icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--crm-primary-soft);
    color: var(--crm-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pm-people-team__icon .mud-icon-root {
    font-size: 1.125rem;
    width: 1.125rem;
    height: 1.125rem;
}

.pm-people-team__copy {
    flex: 1;
    min-width: 0;
}

.pm-people-team__label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--crm-text);
}

.pm-people-team__hint {
    margin-top: 0.1rem;
    font-size: 0.75rem;
    color: var(--crm-text-muted);
}

.pm-people-team__select {
    width: 240px;
    flex-shrink: 0;
}

.pm-people-add {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 42px;
    padding: 0 0.75rem;
}

.pm-files__empty + .pm-people-add {
    border-top: 1px solid var(--crm-border-light, #f3f2f1);
}

.pm-people-add:hover {
    background: var(--crm-border-light, #f4f5f7);
}

.pm-people-add .pm-backlog__create-plus {
    color: var(--crm-text-muted);
}

.pm-people-add .crm-form-select-wrap {
    flex: 1;
    min-width: 0;
}

.pm-people-add .crm-native-select {
    height: 36px;
    min-height: 36px;
    max-height: 36px;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    padding-left: 0;
    color: var(--crm-text-muted);
    font-weight: 500;
}

.pm-people-add:hover .crm-native-select,
.pm-people-add .crm-native-select:focus {
    border-color: transparent;
    box-shadow: none;
    color: var(--crm-primary);
}

.pm-people-add .crm-native-select__icon {
    display: none;
}

@media (max-width: 720px) {
    .pm-files__cols { display: none; }
    .pm-files__row--docs,
    .pm-files__row--files,
    .pm-files__row--people {
        grid-template-columns: 32px minmax(0, 1fr) 40px;
    }
    .pm-files__lozenge,
    .pm-files__size,
    .pm-files__date,
    .pm-files__role { display: none; }
    .pm-files__row .crm-action-btn { opacity: 1; }
    .pm-people-team {
        flex-wrap: wrap;
    }
    .pm-people-team__select {
        width: 100%;
    }
}

.pm-directory {
    max-width: 1180px;
}

.pm-directory__toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.25rem 0 0.75rem;
}

.pm-directory__filter-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #dfe1e6;
    border-radius: 4px;
    background: var(--crm-surface, #fff);
    color: #42526e;
    cursor: pointer;
}

.pm-directory__filter-btn:hover {
    background: #f4f5f7;
}

.pm-directory__filter-btn--active {
    background: var(--crm-primary-soft);
    border-color: var(--crm-primary);
    color: var(--crm-primary);
}

.pm-directory__filter-btn .mud-icon-root {
    font-size: 1.125rem;
    width: 1.125rem;
    height: 1.125rem;
}

.pm-directory__filter-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--crm-primary);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

.pm-directory__filters {
    width: 100%;
    margin: -0.25rem 0 0.75rem;
    border: 1px solid #dfe1e6;
    border-radius: 8px;
    background: var(--crm-surface, #fff);
    box-shadow: 0 8px 16px -4px rgba(9, 30, 66, 0.25), 0 0 1px rgba(9, 30, 66, 0.31);
    overflow: visible;
}

.pm-directory__filters-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 40px;
    padding: 0.35rem 0.5rem 0.35rem 0.875rem;
    border-bottom: 1px solid #ebecf0;
}

.pm-directory__filters-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--crm-text);
}

.pm-directory__filters-actions {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.pm-directory__filters-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #6b778c;
    cursor: pointer;
}

.pm-directory__filters-close:hover {
    background: #f4f5f7;
    color: var(--crm-text);
}

.pm-directory__filters-close .mud-icon-root {
    font-size: 1rem;
    width: 1rem;
    height: 1rem;
}

.pm-directory__filters-body {
    display: grid;
    grid-template-columns: minmax(180px, 0.9fr) minmax(240px, 1.4fr) minmax(220px, 1fr);
    align-items: start;
    gap: 1rem 1.25rem;
    padding: 0.85rem 0.875rem;
}

.pm-directory__filter {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
}

.pm-directory__filter-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b778c;
}

.pm-directory__filter-search {
    width: 100%;
}

.pm-directory__status-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.pm-directory__status-chips .pm-directory__lozenge {
    height: 24px;
    padding: 0 0.625rem;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
    opacity: 0.55;
}

.pm-directory__status-chips .pm-directory__lozenge:hover {
    opacity: 0.85;
}

.pm-directory__status-chips .pm-directory__lozenge--selected {
    opacity: 1;
    border-color: currentColor;
}

.pm-directory__dates {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.4rem;
}

.pm-directory__dates-sep {
    color: #6b778c;
    font-size: 0.875rem;
}

.pm-directory__filters .crm-form-date-picker .mud-input-root,
.pm-directory__filters .crm-form-date-picker .mud-input-slot {
    min-height: 36px !important;
    height: 36px !important;
    max-height: 36px !important;
}

.pm-directory__filters-foot {
    padding: 0.5rem 0.875rem 0.7rem;
    border-top: 1px solid #ebecf0;
    font-size: 0.75rem;
    color: #6b778c;
}

.crm-app-layout.crm-dark .pm-directory__filters {
    border-color: var(--crm-border);
}

.crm-app-layout.crm-dark .pm-directory__filters-head,
.crm-app-layout.crm-dark .pm-directory__filters-foot {
    border-color: var(--crm-border);
}

.crm-app-layout.crm-dark .pm-directory__filters-close:hover {
    background: rgba(255, 255, 255, 0.06);
}

.crm-app-layout.crm-dark .pm-task-check {
    background: transparent;
    border-color: var(--crm-text-muted);
}

@media (max-width: 900px) {
    .pm-directory__filters-body {
        grid-template-columns: 1fr;
    }
}

.pm-directory__clear {
    border: 0;
    background: transparent;
    padding: 0 0.35rem;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--crm-primary);
    cursor: pointer;
}

.pm-directory__clear:hover {
    text-decoration: underline;
}

.pm-directory__list {
    border: 1px solid var(--crm-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--crm-surface, #fff);
}

.pm-directory__cols,
.pm-directory__row {
    display: grid;
    grid-template-columns: minmax(220px, 1.8fr) 120px minmax(90px, 0.8fr) 140px 96px 56px 40px;
    align-items: center;
    gap: 0.75rem;
    padding: 0 0.75rem;
}

.pm-directory__cols {
    min-height: 36px;
    border-bottom: 1px solid var(--crm-border);
    background: var(--crm-border-light, #fafbfc);
    color: var(--crm-text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pm-directory__cols-center {
    justify-self: center;
    text-align: center;
}

.pm-directory__row {
    min-height: 56px;
    border-bottom: 1px solid var(--crm-border-light, #f3f2f1);
    cursor: pointer;
}

.pm-directory__row:last-child {
    border-bottom: 0;
}

.pm-directory__row:hover {
    background: var(--crm-border-light, #f4f5f7);
}

.pm-directory__project {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.pm-directory__icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pm-directory__copy {
    min-width: 0;
}

.pm-directory__name {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--crm-text);
    text-decoration: none;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pm-directory__name:hover {
    color: var(--crm-primary);
    text-decoration: underline;
}

.pm-directory__name--done,
.pm-directory__name--done:hover {
    color: var(--crm-text-muted);
    text-decoration: line-through;
}

.pm-task-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 1.5px solid #8A8886;
    border-radius: 50%;
    background: #fff;
    color: #fff;
    flex-shrink: 0;
    cursor: pointer;
}

.pm-task-check .mud-icon-root {
    font-size: 12px;
    width: 12px;
    height: 12px;
    opacity: 0;
}

.pm-task-check:hover .mud-icon-root {
    opacity: 1;
    color: var(--crm-primary);
}

.pm-task-check--done .mud-icon-root,
.pm-task-check--done:hover .mud-icon-root {
    opacity: 1;
    color: #fff;
}

.pm-task-check:hover {
    border-color: var(--crm-primary);
    color: var(--crm-primary);
}

.pm-task-check--done {
    border-color: var(--crm-primary);
    background: var(--crm-primary);
    color: #fff;
}

.pm-task-check--done:hover {
    border-color: var(--crm-primary-dark);
    background: var(--crm-primary-dark);
    color: #fff;
}

.pm-directory__meta,
.pm-directory__team,
.pm-directory__tasks {
    font-size: 0.75rem;
    color: var(--crm-text-muted);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pm-directory__tasks {
    justify-self: center;
    font-weight: 600;
    color: var(--crm-text);
}

.pm-directory__lozenge {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 0.5rem;
    border-radius: 3px;
    background: #dfe1e6;
    color: #42526e;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.pm-directory__status-btn {
    height: 22px;
    padding: 0 0.2rem 0 0.5rem;
    border: 0;
    font-family: inherit;
    cursor: pointer;
}

.pm-directory__status-btn:hover:not(:disabled) {
    filter: brightness(0.96);
}

.pm-directory__status-btn:disabled {
    cursor: wait;
    opacity: 0.7;
}

.pm-directory__status-btn .mud-icon-root {
    font-size: 1rem;
    width: 1rem;
    height: 1rem;
    margin-left: 0.05rem;
    opacity: 0.7;
}

.pm-directory__status-menu,
.pm-directory__status-menu .mud-paper,
.pm-directory__status-menu .mud-list,
.pm-directory__status-menu .mud-menu-item {
    overflow: visible !important;
}

.pm-directory__status-menu .mud-paper {
    width: auto !important;
    max-width: none !important;
}

.pm-directory__status-menu-list {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.4rem;
    min-width: 0 !important;
    width: max-content !important;
    padding: 0.7rem 0.75rem !important;
}

.pm-directory__status-menu .mud-menu-item,
.pm-directory__status-menu .mud-list-item {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    justify-content: center !important;
}

.pm-directory__status-menu .mud-menu-item:hover,
.pm-directory__status-menu .mud-list-item:hover {
    background: transparent !important;
}

.pm-directory__status-menu .mud-list-item-text,
.pm-directory__status-menu .mud-menu-item-text {
    flex: 0 0 auto !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

.pm-directory__status-menu .pm-board-menu__item--active {
    background: transparent !important;
    color: inherit !important;
    font-weight: 600 !important;
}

.pm-directory__status-menu .pm-directory__lozenge {
    height: 28px;
    padding: 0 0.7rem;
    border: 1px solid transparent;
    cursor: pointer;
}

.pm-directory__status-menu .mud-menu-item:hover .pm-directory__lozenge {
    filter: brightness(0.96);
}

.pm-directory__status-menu .pm-board-menu__item--active .pm-directory__lozenge {
    border-color: currentColor;
}

.pm-directory__lozenge--planning { background: #dfe1e6; color: #42526e; }
.pm-directory__lozenge--active { background: #e3fcef; color: #006644; }
.pm-directory__lozenge--onhold { background: #fff0b3; color: #974f0c; }
.pm-directory__lozenge--completed { background: #deebff; color: #0747a6; }
.pm-directory__lozenge--cancelled { background: #ffebe6; color: #bf2600; }
.pm-directory__lozenge--todo { background: #dfe1e6; color: #42526e; }
.pm-directory__lozenge--draft { background: #dfe1e6; color: #42526e; }
.pm-directory__lozenge--pendingapproval { background: #fff0b3; color: #974f0c; }
.pm-directory__lozenge--approved { background: #e3fcef; color: #006644; }
.pm-directory__lozenge--inprogress { background: #deebff; color: #0747a6; }
.pm-directory__lozenge--pendingrating { background: #eae6ff; color: #403294; }
.pm-directory__lozenge--rejected { background: #ffebe6; color: #bf2600; }
.pm-directory__lozenge--low { background: #dfe1e6; color: #42526e; }
.pm-directory__lozenge--normal { background: #deebff; color: #0747a6; }
.pm-directory__lozenge--high { background: #fff0b3; color: #974f0c; }
.pm-directory__lozenge--urgent { background: #ffebe6; color: #bf2600; }

.pm-directory__cols--tasks,
.pm-directory__row--tasks {
    grid-template-columns: minmax(220px, 1.8fr) 140px 110px 140px minmax(90px, 0.8fr) 88px 40px;
}

.pm-directory__due {
    font-size: 0.75rem;
    color: var(--crm-text-muted);
}

.pm-directory__progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    font-size: 0.75rem;
    color: var(--crm-text-muted);
}

.pm-directory__progress-track {
    flex: 1;
    min-width: 0;
    height: 6px;
    border-radius: 999px;
    background: var(--crm-border-light, #ebecf0);
    overflow: hidden;
}

.pm-directory__progress-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--crm-primary);
}

.pm-directory__people {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.pm-directory__more {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--crm-text-muted);
}

.pm-directory__action {
    justify-self: end;
}

.pm-directory__empty {
    padding: 2rem 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--crm-text-muted);
}

@media (max-width: 900px) {
    .pm-directory__cols {
        display: none;
    }

    .pm-directory__row {
        grid-template-columns: minmax(0, 1fr) auto 40px;
        min-height: 64px;
        padding: 0.65rem 0.75rem;
    }

    .pm-directory__team,
    .pm-directory__progress,
    .pm-directory__people,
    .pm-directory__tasks,
    .pm-directory__priority,
    .pm-directory__due {
        display: none;
    }

    .pm-directory__row--tasks {
        grid-template-columns: minmax(0, 1fr) auto 40px;
    }

    .pm-directory__list--report .pm-directory__cols {
        display: grid;
    }

    .pm-directory__list--report .pm-directory__row {
        min-height: 56px;
        padding: 0 0.75rem;
    }

    .pm-directory__list--report .pm-directory__team,
    .pm-directory__list--report .pm-directory__progress,
    .pm-directory__list--report .pm-directory__due {
        display: flex;
    }

    .pm-directory__list--report .pm-directory__team {
        display: block;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .pm-directory__cols--report-efficiency,
    .pm-directory__row--report-efficiency {
        grid-template-columns: minmax(120px, 0.9fr) minmax(180px, 1.4fr) 90px 80px 130px 100px 100px minmax(140px, 1fr);
    }

    .pm-directory__cols--report-completion,
    .pm-directory__row--report-completion {
        grid-template-columns: minmax(120px, 0.9fr) minmax(110px, 0.8fr) minmax(110px, 0.8fr) minmax(140px, 1fr) 100px minmax(180px, 1.6fr) 140px;
    }

    .pm-directory__cols--report-overdue,
    .pm-directory__row--report-overdue {
        grid-template-columns: 100px minmax(200px, 1.8fr) minmax(140px, 1fr) minmax(120px, 0.9fr) 120px 100px 110px;
    }

    .pm-directory__cols--report-workload,
    .pm-directory__row--report-workload {
        grid-template-columns: minmax(180px, 1.4fr) minmax(140px, 1fr) 80px 100px 130px 90px 110px;
    }
}

.pm-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.pm-toolbar .crm-form-select-wrap {
    min-width: 200px;
}

.pm-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.pm-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--crm-radius-pill);
    background: var(--crm-primary-soft);
    color: var(--crm-text);
    font-size: 0.8125rem;
}

.pm-chip__remove {
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    color: var(--crm-text-muted);
}

.pm-team-badge {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--crm-border);
}

.pm-team-badge--sm {
    width: 28px;
    height: 28px;
    border-radius: 8px;
}

.pm-badge-upload {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pm-file-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.pm-overview {
    max-width: 720px;
}

.pm-summary {
    max-width: 1180px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.25rem 0;
}

.pm-summary__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.15rem 0 0.35rem;
}

.pm-project-head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
}

.pm-project-head__pills {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.pm-pill {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 0.625rem;
    border-radius: 999px;
    border: 1px solid var(--crm-border);
    background: var(--crm-surface, #fff);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--crm-text-muted);
    line-height: 1;
    white-space: nowrap;
}

.pm-pill--status {
    color: var(--crm-primary);
    background: var(--crm-primary-soft);
    border-color: transparent;
}

.pm-project-head__icon {
    width: 28px;
    height: 28px;
    margin-top: 0.15rem;
    border-radius: 6px;
    background: var(--crm-primary-soft);
    color: var(--crm-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pm-project-head__icon .mud-icon-root {
    font-size: 1rem;
    width: 1rem;
    height: 1rem;
}

.pm-project-head__name {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--crm-text);
    line-height: 1.3;
}

.pm-project-head__desc {
    margin: 0.2rem 0 0;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--crm-text-muted);
    line-height: 1.45;
    max-width: 40rem;
}

.pm-summary__kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.75rem;
}

.pm-kpi {
    border: 1px solid var(--crm-border);
    background: var(--crm-surface, #fff);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    box-shadow: var(--crm-shadow-sm);
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.pm-kpi__value {
    font-size: 1.5rem;
    font-weight: 750;
    color: var(--crm-text);
    line-height: 1.1;
}

.pm-kpi__label {
    font-size: 0.8125rem;
    color: var(--crm-text-muted);
    margin-top: 0.25rem;
}

.pm-kpi__icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--crm-border-light, rgba(0,0,0,0.06));
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.pm-kpi__icon svg {
    width: 22px;
    height: 22px;
}

.pm-kpi--total .pm-kpi__icon--total,
.pm-kpi__icon--total {
    background: rgba(13, 110, 253, 0.10);
    color: #1862d8;
    border-color: rgba(13, 110, 253, 0.18);
}

.pm-kpi__icon--backlog {
    background: rgba(245, 159, 0, 0.10);
    color: #f59f00;
    border-color: rgba(245, 159, 0, 0.22);
}

.pm-kpi__icon--done {
    background: rgba(34, 160, 107, 0.10);
    color: #22a06b;
    border-color: rgba(34, 160, 107, 0.22);
}

.pm-kpi__icon--due {
    background: rgba(255, 99, 132, 0.10);
    color: #e0242a;
    border-color: rgba(255, 99, 132, 0.22);
}

.pm-summary__grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 0.75rem;
    align-items: stretch;
}

@media (max-width: 980px) {
    .pm-summary__grid {
        grid-template-columns: 1fr;
    }
}

.pm-summary__status,
.pm-summary__recent,
.pm-summary__people {
    border: 1px solid var(--crm-border);
    background: var(--crm-surface, #fff);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    box-shadow: var(--crm-shadow-sm);
    display: flex;
    flex-direction: column;
    min-height: 320px;
}

.pm-status-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex: 1;
    width: 100%;
    padding: 0.5rem 0;
}

@media (max-width: 640px) {
    .pm-status-content {
        flex-direction: column;
        gap: 1.25rem;
    }
}

.pm-summary__people {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-radius: 12px;
}

.pm-summary__section-title {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 0.75rem;
}

.pm-summary__section-title-main {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--crm-text);
}

.pm-summary__section-title-sub {
    font-size: 0.75rem;
    color: var(--crm-text-muted);
}

.pm-donut {
    position: relative;
    width: 200px;
    height: 200px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
}

.pm-donut__ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(#f59f00 0% 100%);
}

.pm-donut__center {
    position: absolute;
    inset: 26px;
    background: var(--crm-surface, #fff);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    text-align: center;
    padding: 0 0.4rem;
}

.pm-donut__center-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--crm-text);
    line-height: 1.05;
}

.pm-donut__center-label {
    font-size: 0.75rem;
    color: var(--crm-text-muted);
    line-height: 1.25;
    max-width: 6rem;
}

.pm-legend {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    min-width: 140px;
}

.pm-legend__item {
    display: grid;
    grid-template-columns: 16px 1fr auto;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--crm-text-muted);
}

.pm-legend__dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.pm-legend__dot--todo {
    background: #f59f00;
}

.pm-legend__dot--progress {
    background: #1c7ed6;
}

.pm-legend__dot--review {
    background: #8777d9;
}

.pm-legend__dot--done {
    background: #22a06b;
}

.pm-legend__value {
    color: var(--crm-text);
    font-weight: 650;
}

.pm-recent-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.pm-recent-item {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.6rem;
    border: 1px solid var(--crm-border-light, #e5e7eb);
    border-radius: 10px;
    background: var(--crm-surface, #fff);
}

.pm-recent-item__avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--crm-border, #e5e7eb);
    background: var(--crm-primary-soft, rgba(26, 115, 232, 0.08));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--crm-text);
}

.pm-recent-item__content {
    min-width: 0;
}

.pm-recent-item__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.pm-recent-item__meta {
    font-size: 0.75rem;
    color: var(--crm-text-muted);
    margin-top: 0.15rem;
}

.pm-recent-item__progress {
    width: 104px;
    height: 6px;
    border-radius: 999px;
    background: var(--crm-border-light, #e5e7eb);
    overflow: hidden;
    justify-self: end;
}

.pm-recent-item__progress-fill {
    height: 100%;
    background: var(--crm-primary);
    border-radius: 999px;
}

.pm-people {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pm-person {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-radius: 10px;
    padding: 0.35rem 0.55rem;
    border: 1px solid var(--crm-border-light, #e5e7eb);
    background: var(--crm-surface, #fff);
    min-height: 44px;
}

.pm-person__avatar {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: var(--crm-primary-soft, rgba(26, 115, 232, 0.08));
    border: 1px solid var(--crm-border-light, #e5e7eb);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 750;
}

.pm-person__name {
    font-size: 0.8125rem;
    color: var(--crm-text);
    max-width: 160px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pm-timeline {
    --pm-work-width: 280px;
    --pm-row-height: 56px;
    --pm-bar: #8777d9;
    --pm-bar-done: #22a06b;
    --pm-today: #0c66e4;
    --pm-grid-line: #ebecf0;
    --pm-row-alt: #f7f8f9;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 420px;
}

.crm-app-layout.crm-dark .pm-timeline {
    --pm-bar: #9f8fe8;
    --pm-bar-done: #2abb7f;
    --pm-today: #579dff;
    --pm-grid-line: #3b3a39;
    --pm-row-alt: #1f1e1d;
}

.pm-timeline__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.pm-timeline__search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 38px;
    min-width: 240px;
    padding: 0 0.75rem;
    border: 1px solid var(--crm-control-border-color, #dfe1e6);
    border-radius: 8px;
    background: var(--crm-surface, #fff);
    color: var(--crm-text-muted);
}

.pm-timeline__search-input {
    flex: 1;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--crm-text);
    font: inherit;
    font-size: 0.8125rem;
}

.pm-timeline__zoom {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--crm-control-border-color, #dfe1e6);
    border-radius: 999px;
    background: var(--crm-surface, #fff);
    overflow: hidden;
}

.pm-timeline__zoom-btn {
    min-height: 38px;
    padding: 0 0.9rem;
    border: 0;
    background: transparent;
    color: var(--crm-text);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
}

.pm-timeline__zoom-btn:hover {
    background: var(--crm-primary-soft, #e9f2ff);
}

.pm-timeline__zoom-btn--active {
    background: #deebff;
    color: #0c66e4;
}

.crm-app-layout.crm-dark .pm-timeline__zoom-btn--active {
    background: rgba(87, 157, 255, 0.18);
    color: #579dff;
}

.pm-timeline__empty {
    padding: 2rem 0;
}

.pm-timeline__scroll {
    overflow: auto;
    border: 1px solid var(--crm-border, #dfe1e6);
    border-radius: 10px;
    background: var(--crm-surface, #fff);
    max-height: calc(100vh - 220px);
}

.pm-timeline__canvas {
    min-width: calc(var(--pm-work-width) + var(--pm-timeline-width));
}

.pm-timeline__head,
.pm-timeline__lane,
.pm-timeline__row {
    display: grid;
    grid-template-columns: var(--pm-work-width) var(--pm-timeline-width);
    min-width: calc(var(--pm-work-width) + var(--pm-timeline-width));
}

.pm-timeline__head {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--crm-surface, #fff);
    border-bottom: 1px solid var(--crm-border, #dfe1e6);
}

.pm-timeline__work-head,
.pm-timeline__work-cell {
    position: sticky;
    left: 0;
    z-index: 2;
    width: var(--pm-work-width);
    background: var(--crm-surface, #fff);
    border-right: 1px solid var(--crm-border, #dfe1e6);
    box-sizing: border-box;
}

.pm-timeline__work-head {
    z-index: 4;
    display: flex;
    align-items: flex-end;
    min-height: 64px;
    padding: 0.75rem 1rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--crm-text-muted);
}

.pm-timeline__scale,
.pm-timeline__grid {
    position: relative;
    width: var(--pm-timeline-width);
    background-image: linear-gradient(to right, var(--pm-grid-line) 1px, transparent 1px);
    background-size: var(--pm-week-px, 70px) 100%;
}

.pm-timeline__scale {
    min-height: 64px;
}

.pm-timeline__months {
    position: relative;
    height: 36px;
}

.pm-timeline__month {
    position: absolute;
    top: 0;
    height: 36px;
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--crm-text);
    border-right: 1px solid var(--pm-grid-line);
    box-sizing: border-box;
}

.pm-timeline__month--current {
    background: rgba(9, 30, 66, 0.04);
}

.crm-app-layout.crm-dark .pm-timeline__month--current {
    background: rgba(255, 255, 255, 0.04);
}

.pm-timeline__ticks {
    position: relative;
    height: 28px;
}

.pm-timeline__tick {
    position: absolute;
    top: 6px;
    width: 1px;
    height: 16px;
    background: var(--pm-grid-line);
}

.pm-timeline__today {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--pm-today);
    z-index: 1;
    pointer-events: none;
}

.pm-timeline__lane {
    min-height: 44px;
    border-bottom: 1px solid var(--crm-border, #dfe1e6);
    background: var(--pm-row-alt);
}

.pm-timeline__lane .pm-timeline__work-cell {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    background: var(--pm-row-alt);
}

.pm-timeline__section {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--crm-text-muted);
}

.pm-timeline__sprint {
    position: absolute;
    top: 10px;
    height: 24px;
    padding: 0 0.65rem;
    border-radius: 999px;
    background: #dfe1e6;
    color: #42526e;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 24px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crm-app-layout.crm-dark .pm-timeline__sprint {
    background: #3b3a39;
    color: #c8c6c4;
}

.pm-timeline__row {
    min-height: var(--pm-row-height);
    border-bottom: 1px solid var(--pm-grid-line);
    cursor: pointer;
}

.pm-timeline__row:nth-child(even) .pm-timeline__work-cell,
.pm-timeline__row:nth-child(even) .pm-timeline__grid {
    background-color: var(--pm-row-alt);
}

.pm-timeline__row:hover .pm-timeline__work-cell,
.pm-timeline__row:hover .pm-timeline__grid {
    background-color: var(--crm-primary-soft, #e9f2ff);
}

.pm-timeline__work-cell {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
}

.pm-timeline__type {
    color: #8777d9;
    margin-top: 1px;
    flex-shrink: 0;
}

.pm-timeline__work-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.pm-timeline__title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--crm-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pm-timeline__meta {
    font-size: 0.6875rem;
    color: var(--crm-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pm-timeline__progress {
    display: block;
    width: 88px;
    height: 4px;
    margin-top: 0.15rem;
    border-radius: 999px;
    background: #dfe1e6;
    overflow: hidden;
}

.crm-app-layout.crm-dark .pm-timeline__progress {
    background: #3b3a39;
}

.pm-timeline__progress-fill {
    display: block;
    height: 100%;
    background: var(--pm-bar);
}

.pm-timeline__progress-fill--done {
    background: var(--pm-bar-done);
}

.pm-timeline__bar {
    position: absolute;
    top: 18px;
    height: 18px;
    border-radius: 9px;
    background: var(--pm-bar);
    box-shadow: 0 1px 2px rgba(9, 30, 66, 0.12);
}

.pm-timeline__bar--done {
    background: var(--pm-bar-done);
}

.pm-timeline__bar--inferred {
    opacity: 0.55;
}

.pm-status-pills {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.pm-status-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 38px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--crm-control-border-color, #cbd6e2);
    border-radius: 10px;
    background: var(--crm-surface, #fff);
    color: var(--crm-text, #33475b);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.pm-status-pill:hover {
    border-color: var(--crm-primary);
}

.pm-status-pill--active {
    box-shadow: 0 0 0 1px currentColor;
}

.pm-status-pill--todo.pm-status-pill--active {
    background: #f1f3f5;
    color: #495057;
    border-color: #ced4da;
}

.pm-status-pill--progress.pm-status-pill--active {
    background: #e7f5ff;
    color: #1971c2;
    border-color: #a5d8ff;
}

.pm-status-pill--review.pm-status-pill--active {
    background: #fff4e6;
    color: #e67700;
    border-color: #ffd8a8;
}

.pm-status-pill--done.pm-status-pill--active {
    background: #e6fcf5;
    color: #0ca678;
    border-color: #96f2d7;
}

.pm-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #adb5bd;
}

.pm-status-dot--todo { background: #868e96; }
.pm-status-dot--progress { background: #1c7ed6; }
.pm-status-dot--review { background: #f08c00; }
.pm-status-dot--done { background: #12b886; }

.pm-attach-list {
    list-style: none;
    margin: 0.625rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.pm-attach-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 36px;
    padding: 0.25rem 0.4rem 0.25rem 0.5rem;
    border: 1px solid var(--crm-border);
    border-radius: 6px;
    background: var(--crm-surface, #fff);
    color: var(--crm-text);
    font-size: 0.8125rem;
}

.pm-attach-item__icon {
    font-size: 1.125rem !important;
    width: 1.125rem;
    height: 1.125rem;
    color: var(--crm-text-muted);
    flex-shrink: 0;
}

.pm-attach-item__name,
.pm-attach-item a {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pm-attach-item__size {
    color: var(--crm-text-muted);
    font-size: 0.75rem;
    flex-shrink: 0;
}

.pm-attach-item__remove {
    border: 0;
    background: transparent;
    color: var(--crm-text-muted);
    cursor: pointer;
    font-size: 1.125rem;
    line-height: 1;
    width: 28px;
    height: 28px;
    border-radius: 4px;
}

.pm-attach-item__remove:hover {
    background: var(--crm-border-light);
    color: var(--crm-text);
}

.pm-dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-height: 112px;
    padding: 1rem 0.75rem;
    border: 1px dashed #dfe1e6;
    border-radius: 8px;
    background: #fafbfc;
    color: var(--crm-text-muted);
    cursor: pointer;
    overflow: hidden;
}

.pm-dropzone:hover,
.pm-dropzone:focus-within {
    border-color: var(--crm-primary);
    background: var(--crm-primary-soft);
}

.pm-dropzone__input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.pm-dropzone__icon {
    font-size: 1.5rem !important;
    width: 1.5rem;
    height: 1.5rem;
    margin-bottom: 0.2rem;
    color: var(--crm-text-muted);
}

.pm-dropzone__title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--crm-text);
}

.pm-dropzone__hint {
    font-size: 0.75rem;
}

.pm-dropzone__browse {
    color: var(--crm-primary);
    font-weight: 600;
}

.crm-app-layout.crm-dark .pm-dropzone {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--crm-border);
}

.tm-record {
    max-width: 960px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.tm-record--compact {
    max-width: none;
    width: 100%;
    gap: 0.625rem;
}

.tm-record__topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem 1rem;
    flex-wrap: wrap;
}

.tm-record__meta {
    display: flex;
    align-items: center;
    gap: 0.5rem 0.875rem;
    flex-wrap: wrap;
    min-width: 0;
}

.tm-record--compact .crm-panel__body {
    padding: 0.875rem 1rem 1rem;
}

.tm-record--compact .crm-panel__header {
    padding: 0.625rem 1rem;
}

.tm-record--compact .form-section + .form-section {
    padding-top: 0.875rem;
    margin-top: 0.625rem;
}

.tm-record--compact .form-section {
    gap: 0.5rem;
}

.tm-record--compact .form-section__header {
    padding-bottom: 0.25rem;
}

.tm-record--compact .crm-field__label {
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
}

/* Jira-style task issue view */
.tm-issue {
    width: 100%;
    min-width: 0;
}

.tm-issue__crumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 1.5rem 0 1rem;
    padding-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--crm-text-muted);
}

.tm-issue__crumb-link {
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--crm-primary);
    font: inherit;
    font-size: inherit;
    cursor: pointer;
}

.tm-issue__crumb-link:hover {
    text-decoration: underline;
}

.tm-issue__crumb-sep {
    opacity: 0.55;
}

.tm-issue__crumb-current {
    color: var(--crm-text);
    font-weight: 600;
}

.tm-issue__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.tm-issue__title {
    flex: 1;
    min-width: min(100%, 420px);
}

.tm-issue__title .mud-input-root {
    font-size: 1.375rem;
    font-weight: 650;
    line-height: 1.3;
}

.tm-issue__title .mud-input-root input {
    padding: 0.125rem 0;
}

.tm-issue__title .mud-input-underline:before,
.tm-issue__title .mud-input-underline:after {
    display: none;
}

.tm-issue__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
}

.tm-issue__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 1.25rem;
    align-items: stretch;
}

.tm-issue__main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius-lg);
    background: var(--crm-surface);
    padding: 0.25rem 0;
}

.tm-issue__aside {
    position: sticky;
    top: 0.75rem;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius-lg);
    background: var(--crm-surface);
    padding: 0.875rem;
    min-width: 0;
}

.tm-issue-status-wrap {
    margin-bottom: 0.875rem;
}

.tm-issue-status-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    width: 100%;
    min-height: 36px;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.45rem 0.7rem;
    border-radius: 8px;
    text-align: left;
}

.tm-issue-status-btn .mud-icon-root {
    font-size: 1.15rem;
    width: 1.15rem;
    height: 1.15rem;
    opacity: 0.8;
}

.tm-issue-status-menu .mud-list {
    padding: 0.35rem 0 !important;
    min-width: 200px;
}

.tm-issue-status-menu .mud-menu-item {
    min-height: 36px !important;
    padding: 0.35rem 0.75rem !important;
}

.tm-issue-status-menu__item--current {
    background: #f4f5f7 !important;
}

.tm-issue-assignee {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    min-height: 32px;
    border: 0;
    background: transparent;
    padding: 0.15rem 0;
    cursor: pointer;
    font: inherit;
    color: var(--crm-text);
    text-align: left;
}

.tm-issue-assignee:hover:not(:disabled) {
    color: var(--crm-primary);
}

.tm-issue-assignee:disabled {
    cursor: default;
}

.tm-issue-assignee__name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8125rem;
}

.tm-issue-assignee-menu .mud-list,
.tm-issue-assignee-menu__list {
    padding: 0.25rem 0 !important;
    max-height: 280px;
    overflow-y: auto;
    min-width: 220px;
}

.tm-issue-assignee-menu .mud-menu-item {
    min-height: 36px !important;
    padding: 0.3rem 0.7rem !important;
    font-size: 0.8125rem !important;
}

.tm-issue-assignee-menu__person {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.tm-issue-feed {
    margin-top: 1.25rem;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius-lg);
    background: var(--crm-surface);
    padding: 0;
}

.tm-issue-feed__tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0.65rem 1rem 0;
    border-bottom: 1px solid var(--crm-border-light);
}

.tm-issue-feed__tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 0;
    background: transparent;
    padding: 0.5rem 0.7rem 0.55rem;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--crm-text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tm-issue-feed__tab:hover {
    color: var(--crm-text);
}

.tm-issue-feed__tab--active {
    color: var(--crm-primary);
    border-bottom-color: var(--crm-primary);
}

.tm-issue-feed__count {
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.3rem;
    border-radius: 8px;
    background: #f3f2f1;
    color: #616161;
    font-size: 0.6875rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tm-issue-feed__body {
    padding: 0.9rem 1rem 0.5rem;
    min-height: 4.5rem;
}

.tm-issue-comments {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.tm-issue-comment {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.tm-issue-comment__body {
    min-width: 0;
    flex: 1;
}

.tm-issue-comment__head {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tm-issue-comment__head strong {
    font-size: 0.8125rem;
    color: var(--crm-text);
}

.tm-issue-comment__head time,
.tm-activity__time {
    font-size: 0.75rem;
    color: var(--crm-text-muted);
}

.tm-issue-comment__body p {
    margin: 0.15rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--crm-text);
    white-space: pre-wrap;
    word-break: break-word;
}

.tm-issue-composer {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.75rem 1rem 1rem;
    border-top: 1px solid var(--crm-border-light);
}

.tm-issue-composer__input {
    flex: 1;
    min-width: 0;
    height: 36px;
    border: 1px solid var(--crm-border);
    border-radius: 18px;
    padding: 0 0.9rem;
    font: inherit;
    font-size: 0.8125rem;
    background: var(--crm-bg, #faf9f8);
    color: var(--crm-text);
}

.tm-issue-composer__input:focus {
    outline: none;
    border-color: var(--crm-primary);
    background: #fff;
}

.tm-issue-composer__send {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: var(--crm-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.tm-issue-composer__send:disabled {
    opacity: 0.4;
    cursor: default;
}

.tm-issue-composer__send .mud-icon-root {
    font-size: 1.05rem;
    width: 1.05rem;
    height: 1.05rem;
}

.tm-activity__time {
    display: block;
    margin-top: 0.15rem;
}

.tm-issue-status {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 36px;
    height: auto !important;
    text-align: center;
    margin-bottom: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: var(--crm-radius);
    padding: 0.5rem 0.75rem;
    line-height: 1.3;
    white-space: normal;
}

.tm-issue-status-select .crm-native-select {
    min-height: 36px;
    font-weight: 600;
    text-align: center;
    text-align-last: center;
}

.tm-issue-aside__actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.875rem;
    padding-top: 0.875rem;
    border-top: 1px solid var(--crm-border-light);
}

.tm-issue-aside__hint {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--crm-text-muted);
}

.tm-issue-aside__heading {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    font-weight: 650;
    color: var(--crm-text);
}

.tm-detail-list {
    margin: 0;
    padding: 0;
}

.tm-detail-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 0.35rem 0.625rem;
    align-items: start;
    padding: 0.3rem 0;
    font-size: 0.8125rem;
}

.tm-detail-row dt {
    margin: 0;
    padding-top: 0.45rem;
    color: var(--crm-text-muted);
    font-weight: 500;
    font-size: 0.75rem;
}

.tm-detail-row dd {
    margin: 0;
    min-width: 0;
}

.tm-detail-row__text {
    padding-top: 0.45rem;
    color: var(--crm-text);
}

.tm-detail-person {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding-top: 0.25rem;
    color: var(--crm-text);
}

.tm-detail-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.35rem;
    min-width: 0;
}

.tm-detail-progress .pm-directory__progress-track {
    flex: 1;
    min-width: 0;
}

.tm-detail-progress__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--crm-text-muted);
    white-space: nowrap;
}

.tm-issue-block {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--crm-border-light);
}

.tm-issue-block:last-child {
    border-bottom: 0;
}

.tm-issue-block__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.625rem;
}

.tm-issue-block__title {
    margin: 0 0 0.625rem;
    font-size: 0.8125rem;
    font-weight: 650;
    color: var(--crm-text);
}

.tm-issue-block__head .tm-issue-block__title {
    margin-bottom: 0;
}

.tm-issue-block--description {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.tm-issue-block__textarea {
    flex: 1 1 auto;
    width: 100%;
    min-height: 16rem !important;
    height: 100% !important;
    field-sizing: fixed;
    resize: vertical;
}

.tm-issue-file-input {
    display: none !important;
}

.tm-issue-block--attachments {
    position: relative;
}

.tm-issue-attach-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--crm-radius);
    border: 1px solid var(--crm-border);
    background: var(--crm-surface);
    cursor: pointer;
    color: var(--crm-text-muted);
}

.tm-issue-attach-btn:hover {
    border-color: var(--crm-primary);
    color: var(--crm-primary);
}

.tm-issue-attach-empty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    border: 1px dashed var(--crm-border);
    border-radius: var(--crm-radius);
    font-size: 0.8125rem;
    color: var(--crm-text-muted);
    cursor: pointer;
}

.tm-issue-attach-empty:hover {
    border-color: var(--crm-primary);
    color: var(--crm-primary);
}

.tm-issue-attach-list {
    display: flex;
    gap: 0.625rem;
    overflow-x: auto;
    list-style: none;
    margin: 0;
    padding: 0.125rem 0 0.25rem;
}

.tm-issue-attach-card {
    flex: 0 0 140px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.625rem;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: var(--crm-bg);
    position: relative;
}

.tm-issue-attach-card__icon {
    color: var(--crm-primary);
}

.tm-issue-attach-card__name {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--crm-text);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tm-issue-attach-card__name:hover {
    color: var(--crm-primary);
    text-decoration: underline;
}

.tm-issue-attach-card__remove {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    border: 0;
    background: transparent;
    color: var(--crm-text-muted);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
}

.tm-work-log-form {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) 72px auto;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.tm-issue-rating {
    margin-top: 0.875rem;
    padding-top: 0.875rem;
    border-top: 1px solid var(--crm-border-light);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tm-issue__aside .tm-record__score {
    margin-top: 0.875rem;
    font-size: 0.75rem;
}

@media (max-width: 960px) {
    .tm-issue__layout {
        grid-template-columns: 1fr;
    }

    .tm-issue__aside {
        position: static;
    }

    .tm-work-log-form {
        grid-template-columns: 1fr 1fr;
    }

    .tm-work-log-form__hours {
        grid-column: 1;
    }
}

.tm-record__back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    align-self: flex-start;
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--crm-text-muted);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
}

.tm-record__back .mud-icon-root {
    font-size: 1.05rem;
    width: 1.05rem;
    height: 1.05rem;
}

.tm-record__back:hover {
    color: var(--crm-primary);
}

.tm-record__hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.tm-record__key {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--crm-text-muted);
}

.tm-record__title {
    margin: 0.2rem 0 0.55rem;
    font-size: 1.375rem;
    font-weight: 650;
    line-height: 1.25;
    color: var(--crm-text);
}

.tm-record__chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tm-record__assignee {
    font-size: 0.8125rem;
    color: var(--crm-text-muted);
}

.tm-record__actions,
.tm-record__actions--hero {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
}

.tm-record .crm-panel + .crm-panel {
    margin-top: 0;
}

.tm-record__empty {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--crm-text-muted);
}

.tm-record__score {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: #e3fcef;
    color: #006644;
    font-size: 0.8125rem;
}

.tm-work-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.tm-work-table th,
.tm-work-table td {
    padding: 0.55rem 0.65rem;
    text-align: left;
    border-bottom: 1px solid var(--crm-border-light);
    vertical-align: top;
}

.tm-work-table th {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--crm-text-muted);
}

.tm-work-table td:last-child,
.tm-work-table th:last-child {
    text-align: right;
    white-space: nowrap;
}

.tm-activity {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.tm-activity__item {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
}

.tm-activity__dot {
    width: 8px;
    height: 8px;
    margin-top: 0.4rem;
    border-radius: 50%;
    background: var(--crm-primary);
    flex-shrink: 0;
}

.tm-activity__action {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--crm-text);
}

.tm-activity__meta {
    margin-top: 0.1rem;
    font-size: 0.75rem;
    color: var(--crm-text-muted);
}

.pm-sprint-cell {
    cursor: pointer;
}

.lib-page {
    max-width: 1180px;
}

.lib-page__toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1.25rem 0 0.85rem;
}

.lib-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
    gap: 0.75rem;
}

.lib-folder {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 148px;
    padding: 1.1rem 0.75rem 0.9rem;
    border: 1px solid var(--crm-border);
    border-radius: 8px;
    background: var(--crm-surface, #fff);
    cursor: pointer;
    text-align: center;
}

.lib-folder:hover {
    background: var(--crm-border-light, #f4f5f7);
}

.lib-folder--create {
    border-style: dashed;
    color: var(--crm-text-muted);
    font-family: inherit;
}

.lib-folder--create:hover {
    color: var(--crm-primary);
    border-color: var(--crm-primary);
    background: var(--crm-primary-soft);
}

.lib-folder__icon {
    display: inline-flex;
    color: #f5c518;
    margin-bottom: 0.55rem;
}

.lib-folder__icon .mud-icon-root {
    font-size: 2.75rem;
    width: 2.75rem;
    height: 2.75rem;
}

.lib-folder__icon--doc-tile {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    background: #f4f5f7;
    color: #5e6c84;
}

.lib-folder__icon--doc-tile .mud-icon-root {
    font-size: 1.75rem;
    width: 1.75rem;
    height: 1.75rem;
}

.lib-folder__icon--pdf { background: #ffebe6; color: #de350b; }
.lib-folder__icon--doc { background: #deebff; color: #0052cc; }
.lib-folder__icon--sheet { background: #e3fcef; color: #006644; }
.lib-folder__icon--ppt { background: #fff0e6; color: #c25100; }
.lib-folder__icon--image { background: #eae6ff; color: #5243aa; }
.lib-folder__icon--file { background: #f4f5f7; color: #5e6c84; }

.lib-folder__plus {
    font-size: 1.75rem;
    font-weight: 400;
    line-height: 1;
    margin-bottom: 0.45rem;
}

.lib-folder__name {
    display: block;
    width: 100%;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--crm-text);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.lib-folder__meta {
    margin-top: 0.2rem;
    font-size: 0.6875rem;
    color: var(--crm-text-muted);
}

.lib-folder__action {
    position: absolute;
    top: 0.25rem;
    right: 0.2rem;
}

.crm-app-layout.crm-dark .lib-folder {
    background: #1a2332;
    border-color: #2b3648;
}

.crm-app-layout.crm-dark .lib-folder:hover {
    background: #222c3d;
}

.crm-app-layout.crm-dark .lib-folder__name {
    color: #f4f5f7;
}

.crm-app-layout.crm-dark .lib-folder__icon--doc-tile,
.crm-app-layout.crm-dark .lib-folder__icon--file {
    background: #2b3648;
    color: #b6c2d6;
}

.lib-folder__lock {
    position: absolute;
    top: 0.4rem;
    left: 0.4rem;
    color: #5e4db2;
    display: inline-flex;
}

.lib-folder__lock .mud-icon-root {
    font-size: 1rem;
    width: 1rem;
    height: 1rem;
}

.lib-access {
    position: relative;
}

.lib-access__hint {
    margin: 0.35rem 0 0;
    font-size: 11px;
    font-weight: 400;
    line-height: 14px;
    letter-spacing: 0;
    color: #6b778c;
}

.lib-access-pill .mud-icon-root {
    font-size: 1.05rem;
    width: 1.05rem;
    height: 1.05rem;
}

.lib-access-pill--everyone.pm-status-pill--active {
    color: #0052cc;
    background: #deebff;
    border-color: #0052cc;
}

.lib-access-pill--restricted.pm-status-pill--active {
    color: #5e4db2;
    background: #eae6ff;
    border-color: #5e4db2;
}

.lib-person-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.lib-person-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    padding: 0.15rem 0.35rem 0.15rem 0.15rem;
    border-radius: var(--crm-radius-pill);
    background: #dfe1e6;
    color: #172b4d;
    font-size: 0.8125rem;
    font-weight: 500;
}

.lib-person-chip__name {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.lib-person-chip__remove {
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0 0.2rem;
    font-size: 1rem;
    line-height: 1;
    color: #5e6c84;
}

.lib-person-chip__remove:hover {
    color: #172b4d;
}

.lib-access__picker {
    position: relative;
    width: 100%;
    margin-top: 0.75rem;
}

.lib-access__picker-plus {
    color: var(--crm-text-muted);
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1;
    margin-right: 0.15rem;
}

.lib-people-menu {
    width: 100%;
    max-width: none;
    max-height: none;
    padding: 0.375rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.lib-people-menu__search {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.125rem 0.25rem 0.375rem;
    padding: 0 0.5rem;
    height: 34px;
    border: 1px solid var(--crm-control-border-color);
    border-radius: 6px;
    background: var(--crm-input-bg);
    color: var(--crm-text-muted);
}

.lib-people-menu__search .mud-icon-root {
    font-size: 1rem;
    width: 1rem;
    height: 1rem;
}

.lib-people-menu__search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.8125rem;
    color: var(--crm-text);
}

.lib-people-menu__list {
    max-height: 220px;
    overflow-y: auto;
}

.lib-people-menu__empty {
    padding: 0.85rem 0.65rem;
    font-size: 0.8125rem;
    color: var(--crm-text-muted);
    text-align: center;
}

.crm-app-layout.crm-dark .lib-person-chip {
    background: #2b3648;
    color: #f4f5f7;
}

.crm-app-layout.crm-dark .lib-folder__lock {
    color: #c0b6f2;
}

.tm-planner-day {
    border: 1px solid var(--crm-border-light);
    border-radius: var(--crm-radius);
    min-height: 180px;
    background: var(--crm-surface);
}

.tm-planner-day--today {
    border-color: var(--crm-primary);
    box-shadow: 0 0 0 1px var(--crm-primary-soft);
}

.tm-planner-card {
    padding: 0.5rem 0.625rem;
    border-radius: 8px;
    border: 1px solid var(--crm-border-light);
    background: var(--crm-border-light);
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.12s ease;
}

.tm-planner-card:hover {
    border-color: var(--crm-primary);
    transform: translateY(-1px);
}

.crm-page-content {
    padding: 1.25rem 1.5rem 2rem;
}

.auth-page {
    min-height: 100vh;
}

.auth-card {
    width: min(420px, 92vw);
}

.tm-view-tabs {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem;
    border: 1px solid var(--crm-border-light);
    border-radius: var(--crm-radius-pill);
    background: var(--crm-surface);
}

.tm-view-tabs__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 32px;
    padding: 0 0.75rem;
    border: 0;
    border-radius: var(--crm-radius-pill);
    background: transparent;
    color: var(--crm-text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
}

.tm-view-tabs__btn--active {
    background: var(--crm-primary-soft);
    color: var(--crm-primary);
}

.tm-plan-charts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 2rem;
}

.tm-plan-charts__row {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.tm-plan-charts__row--top {
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
}

@media (max-width: 960px) {
    .tm-plan-charts__row--top {
        grid-template-columns: 1fr;
    }
}

.tm-plan-chart {
    background: #fff;
    border: 1px solid #e1dfdd;
    border-radius: 2px;
    min-width: 0;
    overflow: visible;
}

.tm-plan-chart__head {
    margin: 0;
    padding: 0.7rem 1rem;
    background: #f3f2f1;
    border-bottom: 1px solid #e1dfdd;
    color: #323130;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.2;
}

.tm-plan-chart__body {
    padding: 1.15rem 1.15rem 1.15rem;
    overflow: visible;
}

.tm-plan-chart--status .crm-donut-chart {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1.35rem;
    min-height: 0;
    padding: 0.35rem 0 0.15rem;
}

.tm-plan-chart--status .crm-donut-chart__ring-wrap {
    width: 176px;
    height: 176px;
}

.tm-plan-chart--status .crm-donut-chart__ring {
    box-shadow: none;
}

.tm-plan-chart--status .crm-donut-chart__center {
    width: 62%;
    height: 62%;
    box-shadow: none;
    background: #fff;
}

.tm-plan-chart--status .crm-donut-chart__total {
    font-size: 1.75rem;
    font-weight: 600;
    color: #323130;
}

.tm-plan-chart--status .crm-donut-chart__total-label {
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.8125rem;
    font-weight: 400;
    color: #605e5c;
    margin-top: 0.15rem;
}

.tm-plan-chart--status .crm-donut-chart__legend {
    width: 100%;
    max-width: 220px;
    gap: 0.55rem;
}

.tm-plan-chart--status .crm-donut-chart__legend-item {
    grid-template-columns: 10px 1fr auto;
    gap: 0.55rem 0.65rem;
    font-size: 0.8125rem;
}

.tm-plan-chart--status .crm-donut-chart__swatch {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.tm-plan-chart--status .crm-donut-chart__legend-label {
    font-weight: 400;
    color: #323130;
}

.tm-plan-chart--status .crm-donut-chart__legend-value {
    font-weight: 400;
    color: #605e5c;
}

.tm-stacked-chart {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr);
    grid-template-rows: var(--tm-stacked-height, 240px) auto;
    column-gap: 0.65rem;
    row-gap: 0.4rem;
    align-items: stretch;
}

.tm-stacked-chart__y {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    padding: 1.35rem 0 0;
    color: #605e5c;
    font-size: 0.6875rem;
    line-height: 1;
}

.tm-stacked-chart__y span {
    display: block;
}

.tm-stacked-chart__y span:first-child {
    transform: translateY(-0.35em);
}

.tm-stacked-chart__y span:last-child {
    transform: translateY(0.35em);
}

.tm-stacked-chart__plot {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    min-width: 0;
    min-height: 0;
}

.tm-stacked-chart__grid {
    position: absolute;
    inset: 1.35rem 0.35rem 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

.tm-stacked-chart__grid-line {
    border-top: 1px solid #edebe9;
}

.tm-stacked-chart__grid-line:last-child {
    border-top-color: #c8c6c4;
}

.tm-stacked-chart__bars {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
    height: 100%;
    padding: 1.35rem 0.35rem 0;
    box-sizing: border-box;
}

.tm-stacked-chart__col {
    flex: 1 1 0;
    min-width: 4.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tm-stacked-chart__col-area {
    flex: 1;
    width: 100%;
    max-width: 56px;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.tm-stacked-chart__stack-wrap {
    position: relative;
    width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.tm-stacked-chart__total {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    margin-bottom: 0.28rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #323130;
    line-height: 1;
    text-align: center;
    pointer-events: none;
}

.tm-stacked-chart__stack {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column-reverse;
    overflow: hidden;
    border-radius: 1px 1px 0 0;
}

.tm-stacked-chart__seg {
    min-height: 3px;
    width: 100%;
}

.tm-stacked-chart__labels {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    align-items: start;
    gap: 0.75rem;
    padding: 0 0.35rem;
}

.tm-stacked-chart__label {
    flex: 1 1 0;
    min-width: 4.5rem;
    color: #605e5c;
    font-size: 0.75rem;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
    overflow: visible;
    word-break: break-word;
}

.tm-stacked-chart__legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.85rem 1.25rem;
    list-style: none;
    margin: 0.85rem 0 0;
    padding: 0.15rem 0 0;
    color: #323130;
    font-size: 0.75rem;
}

.tm-stacked-chart__legend li {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.tm-stacked-chart__legend span {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

html:has(.crm-app-layout.crm-dark) .tm-plan-chart {
    background: var(--crm-surface, #292827);
    border-color: var(--crm-border, #3b3a39);
}

html:has(.crm-app-layout.crm-dark) .tm-plan-chart__head {
    background: #323130;
    border-bottom-color: #3b3a39;
    color: #f3f2f1;
}

html:has(.crm-app-layout.crm-dark) .tm-plan-chart--status .crm-donut-chart__center {
    background: var(--crm-surface, #292827);
}

html:has(.crm-app-layout.crm-dark) .tm-plan-chart--status .crm-donut-chart__total,
html:has(.crm-app-layout.crm-dark) .tm-plan-chart--status .crm-donut-chart__legend-label,
html:has(.crm-app-layout.crm-dark) .tm-stacked-chart__total,
html:has(.crm-app-layout.crm-dark) .tm-stacked-chart__legend {
    color: #f3f2f1;
}

html:has(.crm-app-layout.crm-dark) .tm-plan-chart--status .crm-donut-chart__total-label,
html:has(.crm-app-layout.crm-dark) .tm-plan-chart--status .crm-donut-chart__legend-value,
html:has(.crm-app-layout.crm-dark) .tm-stacked-chart__y,
html:has(.crm-app-layout.crm-dark) .tm-stacked-chart__label {
    color: #a19f9d;
}

html:has(.crm-app-layout.crm-dark) .tm-stacked-chart__grid-line {
    border-top-color: #3b3a39;
}

html:has(.crm-app-layout.crm-dark) .tm-stacked-chart__grid-line:last-child {
    border-top-color: #605e5c;
}

.tm-myday-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    width: 100%;
    max-width: none;
    margin: 0.65rem 0 0.35rem;
    padding: 1.1rem 1.5rem;
    border: 0;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(37, 36, 91, 0.05), 0 10px 28px rgba(37, 36, 91, 0.08);
    box-sizing: border-box;
    flex-shrink: 0;
}

.tm-myday-banner__left {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
}

.tm-myday-banner__progress {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.45rem;
    min-width: 168px;
    flex-shrink: 0;
}

.tm-myday-banner__cal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 52px;
    min-height: 64px;
    padding: 0.35rem 0.15rem;
    border-radius: 14px;
    background: #F6F5FB;
    color: #5C5A7A;
    font-style: normal;
    line-height: 1.05;
    flex-shrink: 0;
}

.tm-myday-banner__weekday,
.tm-myday-banner__month {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: #8A88A8;
}

.tm-myday-banner__day {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2F2D55;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    padding: 0.15rem 0 0.1rem;
}

.tm-myday-banner__art {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}

.tm-myday-banner__svg {
    display: block;
    width: 100%;
    height: 100%;
}

.tm-myday-banner__art--morning .tm-myday-banner__svg-bg { fill: #FFF1DC; }
.tm-myday-banner__art--afternoon .tm-myday-banner__svg-bg { fill: #E6ECF7; }
.tm-myday-banner__art--evening .tm-myday-banner__svg-bg { fill: #EAE6F6; }

.tm-myday-banner__copy {
    min-width: 0;
}

.tm-myday-banner__greeting {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: #2F2D55;
}

.tm-myday-banner__tagline {
    margin: 0.2rem 0 0;
    font-size: 0.875rem;
    line-height: 1.35;
    color: #6E6D8A;
}

.tm-myday-banner__count {
    color: #6E6D8A;
    font-size: 0.8125rem;
    line-height: 1.2;
    white-space: nowrap;
}

.tm-myday-banner__bar {
    width: 168px;
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: #E4E0F5;
}

.tm-myday-banner__bar-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--crm-primary);
    transition: width 0.25s ease;
}

@media (max-width: 720px) {
    .tm-myday-banner {
        flex-direction: column;
        align-items: stretch;
        gap: 0.9rem;
        padding: 0.9rem 1rem;
        max-width: 100%;
    }

    .tm-myday-banner__progress {
        align-items: stretch;
        min-width: 0;
        width: 100%;
        padding-left: calc(52px + 0.9rem);
    }

    .tm-myday-banner__bar {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .tm-myday-banner__art {
        display: none;
    }

    .tm-myday-banner__progress {
        padding-left: 0;
    }

    .tm-myday-banner__greeting {
        font-size: 1.125rem;
    }
}

.tm-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: 2rem 1rem;
    text-align: center;
}

.tm-empty-state__icon {
    margin-bottom: 0.75rem;
    color: var(--crm-primary);
    opacity: 0.85;
}

.tm-project-chip,
.tm-plan-chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 0.75rem;
    border-radius: var(--crm-radius-pill);
    background: var(--crm-primary-soft);
    color: var(--crm-primary);
    font-size: 0.8125rem;
    font-weight: 500;
}

/* Project hub (Planner-style) */
.tm-project-hub {
    width: 100%;
    max-width: none;
    padding-top: 0.25rem;
}

.tm-project-hub__section {
    width: 100%;
    margin-bottom: 2rem;
}

.tm-project-hub__section-label {
    display: block;
    margin: 0 0 1rem;
    padding: 0;
    border: 0;
    font-size: 0.6875rem;
    color: var(--crm-text-muted);
    letter-spacing: 0.08em;
    font-weight: 700;
    text-transform: uppercase;
}

.tm-project-hub__grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 1.25rem;
    align-items: stretch;
}

.tm-project-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 168px;
    border: 1px solid var(--crm-border-subtle, #dfe1e6);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.tm-project-card:hover {
    border-color: #c8ceda;
    box-shadow: 0 8px 24px rgba(51, 71, 91, 0.08);
    transform: translateY(-1px);
}

.tm-project-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem 1rem 0.875rem;
    cursor: pointer;
    text-align: left;
}

.tm-project-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.tm-project-card__menu-btn {
    color: var(--crm-text-muted) !important;
}

.tm-project-card-menu,
.tm-project-card-menu .mud-paper,
.tm-project-card-menu .mud-list,
.tm-project-card-menu__list {
    min-width: 132px !important;
    width: max-content !important;
    padding: 0.15rem 0 !important;
    font-size: 0.75rem !important;
}

.tm-project-card-menu .mud-menu-item,
.tm-project-card-menu .mud-list-item,
.tm-project-card-menu__list .mud-menu-item,
.tm-project-card-menu__list .mud-list-item {
    min-height: 26px !important;
    height: auto !important;
    padding: 0.2rem 0.6rem !important;
    font-size: 0.75rem !important;
    line-height: 1.2 !important;
    gap: 0.4rem !important;
}

.tm-project-card-menu .mud-menu-item-text,
.tm-project-card-menu .mud-list-item-text,
.tm-project-card-menu .mud-typography,
.tm-project-card-menu .mud-typography-body1,
.tm-project-card-menu .mud-typography-body2,
.tm-project-card-menu__list .mud-menu-item-text,
.tm-project-card-menu__list .mud-typography {
    font-size: 0.75rem !important;
    line-height: 1.2 !important;
    margin: 0 !important;
}

.tm-project-card-menu .mud-menu-item-icon,
.tm-project-card-menu .mud-list-item-icon,
.tm-project-card-menu__list .mud-menu-item-icon {
    margin-right: 0.4rem !important;
    margin-inline-end: 0.4rem !important;
    min-width: 16px !important;
}

.tm-project-card-menu .mud-icon-root,
.tm-project-card-menu svg,
.tm-project-card-menu__list .mud-icon-root,
.tm-project-card-menu__list svg {
    width: 14px !important;
    height: 14px !important;
    font-size: 14px !important;
}

.tm-project-card__title {
    margin: 0 0 0.375rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--crm-text);
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.tm-project-card__desc {
    margin: 0 0 0.625rem;
    font-size: 0.75rem;
    color: var(--crm-text-muted);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tm-project-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: auto;
    font-size: 0.75rem;
    color: var(--crm-text-muted);
}

.tm-project-card__pin {
    color: var(--crm-primary);
    opacity: 0.85;
}

.tm-project-card__progress {
    height: 4px;
    margin-top: 0.625rem;
    border-radius: 999px;
    background: #edf2f7;
    overflow: hidden;
}

.tm-project-card__progress-bar {
    height: 100%;
    border-radius: inherit;
    background: var(--tm-project-accent, var(--crm-primary));
}

.tm-project-card__progress-label {
    margin-top: 0.375rem;
    font-size: 0.6875rem;
    color: var(--crm-text-muted);
}

.tm-project-card--new {
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 168px;
    border-style: dashed;
    background: #fafbfc;
    color: var(--crm-text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
}

.tm-project-card--new:hover {
    border-color: var(--crm-primary);
    color: var(--crm-primary);
    background: rgba(91, 95, 199, 0.04);
    transform: none;
    box-shadow: none;
}

.tm-project-detail {
    margin-bottom: 1rem;
}

.tm-project-detail__breadcrumb {
    margin-bottom: 0.75rem;
}

.tm-project-detail__back {
    text-transform: none !important;
    font-weight: 500 !important;
    color: var(--crm-text-muted) !important;
    padding-left: 0 !important;
}

.tm-project-detail__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--crm-border-subtle, #dfe1e6);
    border-radius: 12px;
    background: #fff;
    margin-bottom: 1.25rem;
}

.tm-project-detail__header .pm-avatar {
    width: 48px;
    height: 48px;
    font-size: 0.875rem;
}

.tm-project-detail__copy {
    flex: 1;
    min-width: 200px;
}

.tm-project-detail__title {
    font-weight: 700 !important;
    letter-spacing: -0.02em;
}

.tm-project-detail__desc {
    color: var(--crm-text-muted) !important;
    margin-top: 0.25rem !important;
}

.tm-project-detail__stats {
    display: flex;
    gap: 1.5rem;
}

.tm-project-detail__stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 64px;
}

.tm-project-detail__stat-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--crm-text);
    line-height: 1.2;
}

.tm-project-detail__stat-label {
    font-size: 0.6875rem;
    color: var(--crm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tm-project-detail__toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.75rem;
}

.tm-project-detail__add-task {
    margin-left: auto;
}

.pm-board-column--add {
    min-width: 260px;
    background: transparent;
    border: none;
    box-shadow: none;
}

.tm-bucket-add {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px dashed #c8ceda;
    border-radius: 12px;
    background: #fafbfc;
}

.tm-bucket-add__input {
    width: 100%;
    height: 38px;
    padding: 0 0.75rem;
    border: 1px solid var(--crm-control-border-color);
    border-radius: var(--crm-radius);
    font-size: 0.8125rem;
    background: #fff;
}

.tm-bucket-add__actions {
    display: flex;
    gap: 0.5rem;
}

.tm-bucket-add__trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 44px;
    padding: 0.75rem 1rem;
    border: 1px dashed #c8ceda;
    border-radius: 12px;
    background: #fafbfc;
    color: var(--crm-text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
}

.tm-bucket-add__trigger:hover {
    border-color: var(--crm-primary);
    color: var(--crm-primary);
    background: rgba(91, 95, 199, 0.04);
}

.pm-board-card__due {
    font-size: 0.6875rem;
    color: var(--crm-text-muted);
}

.pm-directory__cols--mywork,
.pm-directory__row--mywork {
    grid-template-columns: minmax(200px, 1.6fr) minmax(120px, 1fr) 96px 110px 140px 56px;
}

.pm-directory__cols--plan,
.pm-directory__row--plan {
    grid-template-columns: minmax(200px, 1.8fr) minmax(120px, 1fr) 110px 110px 90px minmax(140px, 1fr);
}

.pm-directory__cols--plans,
.pm-directory__row--plans {
    grid-template-columns: minmax(220px, 1.8fr) 110px 80px minmax(140px, 1fr) 56px;
}

.pm-directory__list--report {
    margin: 0 0 1.25rem;
    overflow-x: auto;
}

.pm-directory__row--static {
    cursor: default;
}

.pm-directory__row--static .pm-directory__name:hover {
    color: var(--crm-text);
    text-decoration: none;
}

.pm-directory__cols--report-efficiency,
.pm-directory__row--report-efficiency {
    grid-template-columns: minmax(120px, 0.9fr) minmax(180px, 1.4fr) 90px 80px 130px 100px 100px minmax(140px, 1fr);
    min-width: 980px;
}

.pm-directory__cols--report-completion,
.pm-directory__row--report-completion {
    grid-template-columns: minmax(120px, 0.9fr) minmax(110px, 0.8fr) minmax(110px, 0.8fr) minmax(140px, 1fr) 100px minmax(180px, 1.6fr) 140px;
    min-width: 960px;
}

.pm-directory__cols--report-overdue,
.pm-directory__row--report-overdue {
    grid-template-columns: 100px minmax(200px, 1.8fr) minmax(140px, 1fr) minmax(120px, 0.9fr) 120px 100px 110px;
    min-width: 960px;
}

.pm-directory__cols--report-workload,
.pm-directory__row--report-workload {
    grid-template-columns: minmax(180px, 1.4fr) minmax(140px, 1fr) 80px 100px 130px 90px 110px;
    min-width: 900px;
}

.tm-project-privacy {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0 1.25rem;
}

.tm-project-privacy__label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--crm-text);
}

.tm-project-privacy__option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
}

.tm-project-privacy__option input {
    margin-top: 0.2rem;
    accent-color: var(--crm-primary);
}

.tm-project-privacy__copy {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.tm-project-privacy__copy strong {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--crm-text);
}

.tm-project-privacy__copy span {
    font-size: 0.75rem;
    color: var(--crm-text-muted);
    line-height: 1.4;
}

.tm-project-members {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--crm-border-subtle, #dfe1e6);
    border-radius: 10px;
    padding: 0.375rem;
    background: #fafbfc;
}

.tm-project-members__item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.625rem;
    border-radius: 8px;
    cursor: pointer;
}

.tm-project-members__item:hover {
    background: rgba(91, 95, 199, 0.06);
}

.tm-project-members__item input {
    accent-color: var(--crm-primary);
}

.tm-project-members__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--crm-primary);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tm-project-members__copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tm-project-members__name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--crm-text);
}

.tm-project-members__meta {
    font-size: 0.6875rem;
    color: var(--crm-text-muted);
}

.tm-project-card__private {
    color: var(--crm-text-muted);
}

.tm-bucket-empty {
    padding: 1rem 0;
}

.tm-bucket-empty__tasks {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    max-width: 320px;
}

.tm-bucket-empty__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--crm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tm-project-planner {
    gap: 0;
}

.tm-planner-header {
    border-bottom: 1px solid #dfe1e6;
    margin: -0.25rem 0 0.75rem;
    padding-bottom: 0.75rem;
}

.tm-planner-header__row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    min-width: 0;
}

.tm-planner-header__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 0 1 auto;
}

.tm-planner-header__icon {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    flex-shrink: 0;
}

.tm-planner-header__copy {
    min-width: 0;
}

.tm-planner-header__title-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.tm-planner-header__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--crm-text);
}

.tm-planner-header__subtitle {
    margin: 0.125rem 0 0;
    font-size: 0.8125rem;
    color: var(--crm-text-muted);
}

.tm-planner-header__pin {
    border: 0;
    background: transparent;
    color: #6b778c;
    cursor: pointer;
    padding: 0.125rem;
    display: inline-flex;
}

.tm-planner-header__pin:hover {
    color: #ff991f;
}

.tm-planner-header__lock {
    color: var(--crm-text-muted);
}

.tm-planner-header__tabs {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1 1 auto;
    min-width: 0;
}

.tm-planner-header__tab {
    border: 0;
    background: transparent;
    color: #42526e;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}

.tm-planner-header__tab--active {
    color: #0052cc;
    border-bottom-color: #0052cc;
}

.tm-planner-header__tab--disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.tm-planner-header__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    flex-wrap: wrap;
}

.tm-planner-member {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tm-planner-member strong {
    display: block;
    font-size: 0.8125rem;
}

.tm-planner-member small {
    display: block;
    font-size: 0.6875rem;
    color: var(--crm-text-muted);
}

.tm-planner-filters {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.tm-bucket-empty--planner {
    padding: 0.5rem 0 0.75rem;
}

.tm-project-planner .pm-board-wrap {
    height: calc(100vh - 240px);
    min-height: 420px;
}

.pm-board-column__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.pm-board-column__quick-add {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 40px;
    margin: 0 0.5rem 0.375rem;
    border: 0;
    border-radius: 4px;
    background: #fff;
    color: #0052cc;
    cursor: pointer;
    box-shadow: 0 1px 1px rgba(9, 30, 66, 0.15);
}

.pm-board-column__quick-add:hover {
    background: #f4f5f7;
}

.pm-board-composer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0 0.5rem 0.5rem;
    padding: 0.625rem;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 1px rgba(9, 30, 66, 0.2);
}

.pm-board-composer__title {
    border: 0;
    outline: none;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--crm-text);
    padding: 0.125rem 0;
}

.pm-board-composer__meta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 0;
    background: transparent;
    color: #6b778c;
    font-size: 0.8125rem;
    cursor: pointer;
    padding: 0;
    text-align: left;
}

.pm-board-composer__meta:hover {
    color: #0052cc;
}

.pm-board-composer__date,
.pm-board-composer__select {
    width: 100%;
    border: 1px solid #dfe1e6;
    border-radius: 4px;
    padding: 0.375rem 0.5rem;
    font-family: inherit;
    font-size: 0.8125rem;
}

.pm-board-composer__submit {
    align-self: flex-start;
    margin-top: 0.25rem;
}

.pm-board-add-bucket {
    flex: 0 0 200px;
    align-self: flex-start;
    padding-top: 0.7rem;
}

.pm-board-add-bucket__link {
    border: 0;
    background: transparent;
    color: #6b778c;
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.25rem 0;
}

.pm-board-add-bucket__link:hover {
    color: #0052cc;
}

.pm-board-add-bucket__form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 220px;
}

.pm-board-add-bucket__input {
    border: 1px solid #dfe1e6;
    border-radius: 4px;
    padding: 0.5rem 0.625rem;
    font-family: inherit;
    font-size: 0.875rem;
}

.pm-board-add-bucket__actions {
    display: flex;
    gap: 0.5rem;
}

.pm-board-card__assignee {
    flex-shrink: 0;
}

/* Planner project board — matches Microsoft Planner layout */
.tm-project-planner {
    background: #f4f5f7;
    margin: -0.5rem -1.25rem 0;
    padding: 0.75rem 1.25rem 1.25rem;
    min-height: calc(100vh - 120px);
}

.tm-project-planner .pm-board-shell {
    margin: 0;
}

.tm-project-planner .pm-board-wrap--planner {
    height: calc(100vh - 210px);
    min-height: 480px;
    overflow-x: auto;
    overflow-y: hidden;
}

.tm-project-planner .pm-board--planner,
.tm-project-planner .pm-board--planner.mud-drop-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    height: 100%;
    min-height: 100%;
    overflow: visible;
    padding: 4px 0 16px;
}

.tm-project-planner .pm-board-column--planner {
    flex: 0 0 280px;
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    background: transparent;
    border-radius: 0;
    overflow: visible;
    max-height: none;
}

.tm-project-planner .pm-board-column--planner .pm-board-column__header {
    padding: 0 8px 10px;
}

.tm-project-planner .pm-board-column--planner .pm-board-column__title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #44546f;
}

.tm-project-planner .pm-board-column__scroll {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 260px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 8px;
}

.tm-project-planner .pm-board-column__quick-add {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(100% - 16px);
    min-height: 36px;
    margin: 0 8px 8px;
    border: 0;
    border-radius: 4px;
    background: #fff;
    color: #0052cc;
    cursor: pointer;
    box-shadow: 0 1px 0 rgba(9, 30, 66, 0.13);
    flex-shrink: 0;
}

.tm-project-planner .pm-board-column__quick-add:hover {
    background: #fafbfc;
}

.tm-project-planner .pm-board-column__quick-add .mud-icon-root {
    font-size: 20px;
}

.tm-project-planner .pm-board-column__cards {
    flex: 0 1 auto;
    min-height: 4px !important;
    padding: 0 8px;
    gap: 8px;
    overflow: visible;
}

.tm-project-planner .pm-board-column__cards.mud-drop-zone {
    min-height: 4px !important;
}

.tm-project-planner .pm-board-card--planner {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 0 rgba(9, 30, 66, 0.13);
    padding: 10px 12px;
    cursor: pointer;
    border: none;
}

.tm-project-planner .pm-board-card--planner:hover {
    background: #fff;
    box-shadow: 0 2px 6px rgba(9, 30, 66, 0.12);
}

.tm-project-planner .pm-board-card--planner .pm-board-card__title {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    color: #172b4d;
    margin-bottom: 10px;
    display: block;
    -webkit-line-clamp: unset;
}

.tm-project-planner .pm-board-card--planner .pm-board-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0;
    min-height: 24px;
}

.tm-project-planner .pm-board-card--planner .pm-board-card__due {
    font-size: 12px;
    color: #6b778c;
}

.tm-project-planner .pm-board-card--planner .pm-board-card__assignee {
    width: 24px;
    height: 24px;
    font-size: 10px;
}

.tm-project-planner .pm-board-composer {
    margin: 0 8px 8px;
    padding: 10px 12px;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 0 rgba(9, 30, 66, 0.13);
    gap: 8px;
}

.tm-project-planner .pm-board-composer__title {
    font-size: 14px;
    padding: 2px 0 6px;
    border-bottom: 1px solid transparent;
}

.tm-project-planner .pm-board-composer__title:focus {
    outline: none;
}

.tm-project-planner .pm-board-composer__meta {
    font-size: 13px;
    color: #6b778c;
    padding: 2px 0;
}

.tm-project-planner .pm-board-composer__meta .mud-icon-root {
    color: #6b778c;
    font-size: 16px;
}

.tm-project-planner .pm-board-composer__submit {
    width: 100%;
    min-height: 36px;
    margin-top: 4px;
    border: 0;
    border-radius: 4px;
    background: #0078d4;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.tm-project-planner .pm-board-composer__submit:hover:not(:disabled) {
    background: #106ebe;
}

.tm-project-planner .pm-board-composer__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tm-project-planner .pm-board-add-bucket {
    flex: 0 0 auto;
    align-self: flex-start;
    padding-top: 2px;
    min-width: 160px;
}

.tm-project-planner .pm-board-add-bucket__link {
    border: 0;
    background: transparent;
    color: #6b778c;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    padding: 6px 8px;
}

.tm-project-planner .pm-board-add-bucket__link:hover {
    color: #0052cc;
}

.tm-project-planner .pm-board-add-bucket__cancel {
    border: 0;
    background: transparent;
    color: #6b778c;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 12px;
}

.tm-project-planner .tm-planner-header {
    background: #fff;
    border-bottom: 1px solid #dfe1e6;
    margin: -0.75rem -1.25rem 0.75rem;
    padding: 0.75rem 1.25rem;
}

/* Project board — same design language as project hub */
.tm-project-board {
    padding-top: 0.25rem;
}

.tm-schedule {
    width: 100%;
    border: 1px solid #E1DFDD;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.tm-schedule__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 48px;
    padding: 0.35rem 0.75rem;
    background: #F3F2F1;
    border-bottom: 1px solid #E1DFDD;
}

.tm-schedule__nav {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    min-width: 0;
}

.tm-schedule__icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #616161;
    cursor: pointer;
}

.tm-schedule__icon-btn:hover {
    background: #E1DFDD;
    color: #242424;
}

.tm-schedule__month {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    height: 32px;
    padding: 0 0.35rem 0 0.5rem;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #242424;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.tm-schedule__month:hover {
    background: #E1DFDD;
}

.tm-schedule__month .mud-icon-root {
    font-size: 1.25rem;
    width: 1.25rem;
    height: 1.25rem;
    color: #616161;
}

.tm-schedule__modes {
    display: inline-flex;
    align-items: stretch;
    gap: 0.15rem;
}

.tm-schedule__mode {
    min-height: 32px;
    padding: 0 0.7rem 0.1rem;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: #616161;
    font-family: inherit;
    font-size: 0.875rem;
    cursor: pointer;
}

.tm-schedule__mode:hover {
    color: #242424;
}

.tm-schedule__mode--active {
    color: var(--crm-primary);
    font-weight: 600;
    border-bottom-color: var(--crm-primary);
}

.tm-schedule__weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    background: #fff;
    border-bottom: 1px solid #EDEBE9;
}

.tm-schedule__dow {
    padding: 0.55rem 0.65rem 0.45rem;
    color: #616161;
    font-size: 0.8125rem;
    font-weight: 600;
}

.tm-schedule__dow--today {
    color: var(--crm-primary);
    box-shadow: inset 0 -2px 0 var(--crm-primary);
}

.tm-schedule__grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.tm-schedule__cell {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-height: 7.25rem;
    padding: 0.4rem 0.4rem 0.45rem;
    border-right: 1px solid #EDEBE9;
    border-bottom: 1px solid #EDEBE9;
    background: #fff;
    min-width: 0;
}

.tm-schedule__cell:nth-child(7n) {
    border-right: 0;
}

.tm-schedule__grid--week .tm-schedule__cell {
    min-height: 18rem;
}

.tm-schedule__cell--outside {
    background: #FAF9F8;
}

.tm-schedule__num {
    color: #242424;
    font-size: 0.875rem;
    line-height: 1.2;
}

.tm-schedule__num--today {
    color: var(--crm-primary);
    font-weight: 700;
}

.tm-schedule__cell--outside .tm-schedule__num {
    color: #A19F9D;
}

.tm-schedule__chips {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.tm-schedule__chip {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    width: 100%;
    min-height: 22px;
    padding: 0.1rem 0.4rem;
    border: 0;
    border-radius: 4px;
    background: #F3F2F1;
    color: #242424;
    font-family: inherit;
    font-size: 0.75rem;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
}

.tm-schedule__chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tm-schedule__chip:hover {
    background: #E1DFDD;
}

.tm-schedule__chip--done {
    background: var(--crm-primary);
    color: #fff;
}

.tm-schedule__chip--done:hover {
    background: var(--crm-primary-dark);
}

.tm-schedule__chip .mud-icon-root {
    flex-shrink: 0;
    font-size: 0.85rem;
    width: 0.85rem;
    height: 0.85rem;
}

.tm-schedule__chip--done .mud-icon-root {
    color: #fff;
}

.tm-schedule__more {
    color: #616161;
    font-size: 0.75rem;
    padding: 0 0.35rem;
}

.tm-project-board__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.tm-project-board__toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-left: auto;
}

.tm-bucket-board {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.tm-bucket-board__track,
.tm-bucket-board__track.mud-drop-container {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    min-height: 420px;
    padding: 0.25rem 0 1rem;
}

.tm-bucket-column {
    flex: 0 0 280px;
    width: 280px;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 280px);
    border: 1px solid var(--crm-border-subtle, #dfe1e6);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.tm-bucket-column__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--crm-border-subtle, #dfe1e6);
    flex-shrink: 0;
}

.tm-bucket-column__title {
    flex: 0 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    margin: 0;
    margin-right: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-family: inherit;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: left;
    color: var(--crm-text-muted);
    cursor: text;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tm-bucket-column__title:hover {
    color: var(--crm-text);
}

.tm-bucket-column__title-input {
    flex: 1;
    min-width: 0;
    height: 1.5rem;
    margin: -0.1rem 0.5rem -0.1rem 0;
    padding: 0;
    border: 0;
    border-bottom: 1px solid var(--crm-primary, #5b5fc7);
    border-radius: 0;
    background: transparent;
    outline: none;
    font-family: inherit;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: left;
    color: var(--crm-text);
}

.tm-bucket-column__count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--crm-text-muted);
}

.tm-bucket-column__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0.75rem;
    gap: 0.625rem;
}

.tm-bucket-column__add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    min-height: 38px;
    border: 1px dashed var(--crm-border-subtle, #dfe1e6);
    border-radius: var(--crm-radius-pill);
    background: #fafbfc;
    color: var(--crm-primary);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    flex-shrink: 0;
}

.tm-bucket-column__add:hover {
    border-color: var(--crm-primary);
    background: rgba(91, 95, 199, 0.04);
}

.tm-bucket-column__cards {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    min-height: 8px !important;
    flex: 1;
    padding: 0 !important;
}

.tm-bucket-column__cards.mud-drop-zone {
    min-height: 8px !important;
}

.tm-bucket-column--new {
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 168px;
    border-style: dashed;
    background: #fafbfc;
    color: var(--crm-text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    padding: 1rem;
}

.tm-bucket-column--new:hover {
    border-color: var(--crm-primary);
    color: var(--crm-primary);
    background: rgba(91, 95, 199, 0.04);
}

.tm-bucket-task {
    border: 1px solid var(--crm-border-subtle, #dfe1e6);
    border-radius: 10px;
    background: #fff;
    padding: 0.75rem 0.875rem;
    cursor: pointer;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.tm-bucket-task:hover {
    border-color: #c8ceda;
    box-shadow: 0 4px 12px rgba(51, 71, 91, 0.08);
}

.tm-bucket-task__title {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--crm-text);
    margin-bottom: 0.5rem;
}

.tm-bucket-task__meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
    min-width: 0;
}

.tm-bucket-task__meta .pm-directory__lozenge {
    flex-shrink: 0;
    height: 18px;
    padding: 0 0.4rem;
}

.tm-bucket-task__progress {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    flex: 1;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #6b778c;
}

.tm-bucket-task__progress-track {
    flex: 1;
    min-width: 0;
    height: 6px;
    border-radius: 999px;
    background: #ebecf0;
    overflow: hidden;
}

.tm-bucket-task__progress-fill {
    height: 100%;
    border-radius: 999px;
    background: #5b5fc7;
}

.tm-bucket-task__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.tm-bucket-task__due {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 24px;
    font-size: 0.75rem;
    color: var(--crm-text-muted);
}

.tm-bucket-task__due .mud-icon-root {
    font-size: 0.875rem;
    width: 0.875rem;
    height: 0.875rem;
}

.tm-bucket-task__due--empty {
    flex: 1;
}

.tm-card-assignee {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    position: relative;
    z-index: 2;
}

.tm-card-assignee .mud-menu {
    display: inline-flex;
    width: auto;
}

.tm-card-assignee__hit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    border-radius: 999px;
}

.tm-card-assignee__hit:hover .pm-avatar--empty,
.tm-card-assignee__hit:focus-visible .pm-avatar--empty {
    border-color: #5b5fc7;
    color: #5b5fc7;
    background: #f4f5ff;
}

.tm-card-assignee__empty.pm-avatar--empty {
    background: #f4f5f7;
    border: 1px solid #dfe1e6;
    color: #6b778c;
}

.tm-card-assignee-pop.mud-popover,
.tm-card-assignee-pop {
    width: 280px !important;
    min-width: 280px !important;
    max-width: min(280px, calc(100vw - 24px)) !important;
    padding: 0 !important;
    text-align: left !important;
}

.tm-card-assignee-list.mud-list,
.tm-card-assignee-pop .mud-list,
.tm-card-assignee-pop .mud-list-item,
.tm-card-assignee-pop .mud-menu-item {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    text-align: left !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    box-sizing: border-box;
}

.tm-card-assignee-pop__panel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 0 6px;
}

.tm-card-assignee-pop__search {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 10px 6px;
    padding: 0 0.55rem;
    height: 32px;
    border: 1px solid #e1dfdd;
    border-radius: 4px;
    background: #fff;
    color: #605e5c;
    box-sizing: border-box;
}

.tm-card-assignee-pop__search:focus-within {
    border-color: #5b5fc7;
    box-shadow: 0 0 0 1px #5b5fc7;
}

.tm-card-assignee-pop__search .mud-icon-root {
    font-size: 1rem;
    flex-shrink: 0;
}

.tm-card-assignee-pop__search input {
    flex: 1;
    min-width: 0;
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 0.8125rem;
    color: #242424;
    text-align: left;
}

.tm-card-assignee-pop__list {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-height: 240px;
    overflow-x: hidden;
    overflow-y: auto;
}

.tm-card-assignee-pop__empty {
    padding: 0.7rem 10px;
    font-size: 0.8125rem;
    color: #605e5c;
    text-align: left;
}

.tm-card-assignee-pop__item {
    display: grid !important;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
    justify-content: start;
    column-gap: 10px;
    width: 100% !important;
    margin: 0;
    padding: 7px 10px !important;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
}

.tm-card-assignee-pop__item:hover {
    background: #f3f2f1;
}

.tm-card-assignee-pop__item .pm-avatar {
    width: 24px;
    height: 24px;
    margin: 0;
}

.tm-card-assignee-pop__copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
    width: 100%;
    text-align: left;
}

.tm-card-assignee-pop__name,
.tm-card-assignee-pop__meta {
    display: block;
    width: 100%;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tm-card-assignee-pop__name {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    color: #242424;
}

.tm-card-assignee-pop__meta {
    font-size: 0.6875rem;
    line-height: 1.2;
    color: #605e5c;
}

/* ══════════════════════════════════════════════════════════════
   Microsoft Planner chrome
   ══════════════════════════════════════════════════════════════ */

.planner-appbar.mud-appbar,
.planner-appbar {
    background: #201F1E !important;
    color: #fff !important;
    border-bottom: 0 !important;
    min-height: 48px !important;
    height: 48px !important;
    z-index: 1300 !important;
}

.planner-appbar .mud-toolbar {
    min-height: 48px !important;
    height: 48px !important;
    padding: 0 8px 0 4px !important;
    gap: 0.125rem;
}

.planner-appbar__menu {
    display: none !important;
    color: #fff !important;
}

.planner-appbar__icon.mud-icon-button,
.planner-appbar .mud-icon-button {
    color: #fff !important;
    border-radius: 4px !important;
}

.planner-appbar .mud-icon-button:hover {
    background: rgba(255, 255, 255, 0.12) !important;
}

.planner-appbar__brand {
    color: #fff !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em;
    margin-left: 0.15rem !important;
    white-space: nowrap;
}

.planner-appbar__right {
    display: flex;
    align-items: center;
    gap: 0.125rem;
}

.planner-appbar .crm-user-menu {
    margin-left: 0.25rem;
}

.planner-appbar .crm-user-menu:hover {
    background: rgba(255, 255, 255, 0.12);
}

.planner-sidebar.mud-drawer,
.planner-sidebar .mud-drawer-content {
    background: #fff !important;
}

.crm-app-layout .planner-sidebar.mud-drawer {
    top: var(--mud-appbar-height, 48px) !important;
    height: calc(100% - var(--mud-appbar-height, 48px)) !important;
    max-height: calc(100% - var(--mud-appbar-height, 48px)) !important;
    z-index: 1050 !important;
}

.planner-nav {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0.75rem 0 0.75rem;
}

.planner-nav__scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.planner-nav__menu {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    padding: 0.25rem 0 0.5rem;
}

.planner-nav__menu .mud-nav-link {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.4rem;
    margin: 0 8px !important;
    min-height: 36px !important;
    padding: 0 10px !important;
    border-radius: 4px !important;
    border-left: 3px solid transparent;
    color: #242424 !important;
    font-size: 0.875rem !important;
    font-weight: 400 !important;
}

.planner-nav__menu .mud-nav-link .mud-nav-link-icon {
    margin-inline-end: 0 !important;
    margin-right: 0 !important;
}

.planner-nav__menu .mud-nav-link .mud-icon-root {
    color: #616161 !important;
    background: transparent !important;
    width: 20px !important;
    height: 20px !important;
    font-size: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    margin-inline-end: 0 !important;
    margin-right: 0 !important;
    border-radius: 0 !important;
    flex-shrink: 0;
}

.planner-nav__menu .mud-nav-link .mud-icon-root svg,
.planner-nav__menu .mud-nav-link .mud-svg-icon {
    width: 20px !important;
    height: 20px !important;
}

.planner-nav__menu .mud-nav-link:hover {
    background: #F3F2F1 !important;
}

.planner-nav__menu .mud-nav-link.active {
    background: #EDEBE9 !important;
    color: #242424 !important;
    border-left-color: var(--crm-primary);
    font-weight: 600 !important;
}

.planner-nav__menu .mud-nav-link.active .mud-icon-root {
    background: transparent !important;
}

.planner-nav__menu .planner-nav__link--my-day .mud-icon-root { color: #C59A1A !important; }
.planner-nav__menu .planner-nav__link--my-tasks .mud-icon-root { color: #3A7D88 !important; }
.planner-nav__menu .planner-nav__link--plans .mud-icon-root { color: #5B5FC7 !important; }
.planner-nav__menu .planner-nav__link--overview .mud-icon-root { color: #4F6BED !important; }
.planner-nav__menu .planner-nav__link--efficiency .mud-icon-root { color: #2F6F6A !important; }
.planner-nav__menu .planner-nav__link--completion .mud-icon-root { color: #498205 !important; }
.planner-nav__menu .planner-nav__link--overdue .mud-icon-root { color: #C4314B !important; }
.planner-nav__menu .planner-nav__link--workload .mud-icon-root { color: #0078D4 !important; }
.planner-nav__menu .planner-nav__link--employees .mud-icon-root { color: #8764B8 !important; }
.planner-nav__menu .planner-nav__link--access .mud-icon-root { color: #CA5010 !important; }
.planner-nav__menu .planner-nav__link--roles .mud-icon-root { color: #5B6E8C !important; }
.planner-nav__menu .planner-nav__link--teams .mud-icon-root { color: #038387 !important; }
.planner-nav__menu .planner-nav__link--directory .mud-icon-root { color: #4F6BED !important; }

.planner-nav__section {
    padding: 0.75rem 0 0.25rem;
}

.planner-nav__section-label {
    padding: 0.25rem 1.15rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #616161;
}

.planner-nav__plan {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin: 0 8px;
    padding: 0.4rem 0.65rem;
    border-radius: 4px;
    border-left: 3px solid transparent;
    color: #242424;
    text-decoration: none;
    min-height: 36px;
}

.planner-nav__plan:hover {
    background: #F3F2F1;
}

.planner-nav__plan--active {
    background: #EDEBE9;
    border-left-color: var(--crm-primary);
    font-weight: 600;
}

.planner-nav__plan-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.planner-nav__plan-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
}

.planner-nav__footer {
    margin-top: auto;
    padding: 0.75rem 0.75rem 0.25rem;
}

.planner-new-plan {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    min-height: 36px;
    padding: 0 0.65rem;
    border: 1px solid #EDEBE9;
    border-radius: 4px;
    background: #fff;
    color: #242424;
    font-family: inherit;
    font-size: 0.875rem;
    cursor: pointer;
}

.planner-new-plan:hover {
    background: #F3F2F1;
}

.planner-new-plan .mud-icon-root {
    font-size: 1.125rem;
    color: #616161;
}

.planner-new-plan__caret {
    margin-left: auto;
}

.planner-page {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 0 auto;
    width: 100%;
    min-height: 0;
    overflow: visible;
}

.planner-page .pm-directory {
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
    min-height: 0;
    overflow: visible;
    max-width: none;
    width: 100%;
}

.planner-page .planner-toolbar {
    padding-top: 1.15rem;
    padding-bottom: 1.15rem;
}

.planner-page:has(.tm-myday-banner) .tm-myday-banner {
    margin-top: 0.65rem;
    margin-bottom: 0.35rem;
    margin-left: 0;
    margin-right: 0;
}

.planner-page:has(.tm-myday-banner) .planner-toolbar {
    padding-top: 0.25rem;
    padding-bottom: 0.3rem;
}

.planner-page:has(.tm-myday-banner) .pm-board-wrap--mywork {
    padding-top: 0;
}

.planner-page:has(.tm-myday-banner) .pm-board-column__header {
    padding-top: 0.2rem;
}

.planner-page .pm-directory__list {
    margin-bottom: 1.5rem;
}

.planner-page-header {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: space-between;
    gap: 0;
    width: calc(100% + (2 * var(--crm-page-padding-x, 1.5rem)));
    max-width: none;
    min-height: 48px;
    margin: 0 calc(-1 * var(--crm-page-padding-x, 1.5rem));
    padding: 0 var(--crm-page-padding-x, 1.5rem);
    flex-shrink: 0;
    background: #fff;
    border-bottom: 1px solid #E1DFDD;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}

.planner-page-header--stacked {
    flex-direction: column !important;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.planner-page-header__row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: space-between;
    gap: 1rem;
    min-height: 48px;
    width: 100%;
    flex: 1 1 auto;
}

.planner-page-header__toolbar {
    width: 100%;
}

.planner-page-header--stacked .planner-toolbar {
    padding: 0.4rem 0 0.5rem;
    min-height: 36px;
}

.planner-page-header__toolbar .pm-directory__filters {
    margin: 0 0 0.55rem;
}

.pm-directory__filters-body--plan {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.planner-page-header__left {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.35rem;
    min-width: 0;
    flex: 1;
}

.planner-page-header__brand {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    height: 48px;
    flex: 0 1 auto;
}

.planner-plan-identity {
    display: inline-flex;
    align-items: center;
    align-self: center;
    gap: 0.3rem;
    min-width: 0;
    flex: 0 1 auto;
    min-height: 48px;
}

.planner-plan-crumb {
    color: #616161;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.planner-plan-crumb:hover {
    color: var(--crm-primary);
    text-decoration: underline;
}

.planner-plan-crumb__sep {
    color: #8A8886;
    font-size: 0.95rem;
    line-height: 1;
    flex-shrink: 0;
}

.planner-plan-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    color: #fff;
    flex-shrink: 0;
}

.planner-plan-mark .mud-icon-root {
    font-size: 0.85rem !important;
    width: 0.85rem !important;
    height: 0.85rem !important;
    color: #fff !important;
}

.planner-page-header__icon,
.planner-page-header__icon.mud-icon-root,
.planner-page-header__icon.mud-icon-size-medium {
    font-size: 1.5rem !important;
    width: 1.5rem !important;
    height: 1.5rem !important;
    min-width: 1.5rem;
    min-height: 1.5rem;
    flex-shrink: 0;
    display: block !important;
    line-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.planner-page-header__icon svg,
.planner-page-header__icon.mud-icon-root svg {
    display: block;
    width: 1.5rem !important;
    height: 1.5rem !important;
    fill: currentColor !important;
}

.planner-page-header__icon {
    color: #616161 !important;
}

.planner-page-header__icon.planner-page-header__icon--my-day,
.planner-page-header__icon.mud-icon-root.planner-page-header__icon--my-day { color: #C59A1A !important; }
.planner-page-header__icon.planner-page-header__icon--my-tasks,
.planner-page-header__icon.mud-icon-root.planner-page-header__icon--my-tasks { color: #3A7D88 !important; }
.planner-page-header__icon.planner-page-header__icon--plans,
.planner-page-header__icon.mud-icon-root.planner-page-header__icon--plans { color: #5B5FC7 !important; }
.planner-page-header__icon.planner-page-header__icon--overview,
.planner-page-header__icon.mud-icon-root.planner-page-header__icon--overview { color: #4F6BED !important; }
.planner-page-header__icon.planner-page-header__icon--efficiency,
.planner-page-header__icon.mud-icon-root.planner-page-header__icon--efficiency { color: #2F6F6A !important; }
.planner-page-header__icon.planner-page-header__icon--completion,
.planner-page-header__icon.mud-icon-root.planner-page-header__icon--completion { color: #498205 !important; }
.planner-page-header__icon.planner-page-header__icon--overdue,
.planner-page-header__icon.mud-icon-root.planner-page-header__icon--overdue { color: #C4314B !important; }
.planner-page-header__icon.planner-page-header__icon--workload,
.planner-page-header__icon.mud-icon-root.planner-page-header__icon--workload { color: #0078D4 !important; }
.planner-page-header__icon.planner-page-header__icon--employees,
.planner-page-header__icon.mud-icon-root.planner-page-header__icon--employees { color: #8764B8 !important; }
.planner-page-header__icon.planner-page-header__icon--access,
.planner-page-header__icon.mud-icon-root.planner-page-header__icon--access { color: #CA5010 !important; }
.planner-page-header__icon.planner-page-header__icon--roles,
.planner-page-header__icon.mud-icon-root.planner-page-header__icon--roles { color: #5B6E8C !important; }
.planner-page-header__icon.planner-page-header__icon--teams,
.planner-page-header__icon.mud-icon-root.planner-page-header__icon--teams { color: #038387 !important; }
.planner-page-header__icon.planner-page-header__icon--directory,
.planner-page-header__icon.mud-icon-root.planner-page-header__icon--directory { color: #4F6BED !important; }

.planner-page-header__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.35;
    color: #242424;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.planner-page-header__title-btn {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    height: 48px;
    margin: 0;
    padding: 0 0.35rem;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: text;
}

.planner-page-header__title-btn:hover {
    background: #F3F2F1;
    border-color: #E1DFDD;
}

.planner-page-header__title-input {
    min-width: 12rem;
    max-width: min(28rem, 50vw);
    height: 36px;
    padding: 0 0.55rem;
    border: 1px solid var(--crm-primary);
    border-radius: 4px;
    background: #fff;
    color: #242424;
    font-family: inherit;
    font-size: 1.125rem;
    font-weight: 600;
    outline: none;
}

.planner-page-header__plan-caret {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #616161;
    cursor: pointer;
}

.planner-page-header__plan-caret:hover {
    background: #F3F2F1;
    color: #242424;
}

.pm-board-avatars {
    cursor: pointer;
}

.pm-board-avatars__add {
    background: #F3F2F1 !important;
    color: #616161 !important;
    font-weight: 600;
}

.planner-page-header__actions {
    display: flex;
    align-items: center;
    align-self: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: auto;
    min-height: 48px;
}

.planner-page-header__action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 32px;
    padding: 0 0.75rem;
    border: 1px solid #D1D1D1;
    border-radius: 4px;
    background: #fff;
    color: #242424;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.planner-page-header__action:hover {
    background: #F3F2F1;
    border-color: #C8C6C4;
}

.planner-page-header__action .mud-icon-root {
    font-size: 1.05rem;
    width: 1.05rem;
    height: 1.05rem;
    color: #616161;
}

.planner-page-header__icon-btn {
    color: #616161 !important;
}

.planner-page-header__icon-btn:hover {
    background: #F3F2F1 !important;
}

.planner-page-header__icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #616161;
    cursor: pointer;
}

.planner-page-header__icon-link:hover {
    background: #F3F2F1;
    color: #242424;
}

.planner-page-header .tm-view-tabs {
    display: inline-flex;
    align-items: stretch;
    align-self: stretch;
    gap: 0.15rem;
    margin: 0 0 0 0.35rem;
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 0;
    flex-shrink: 0;
    height: auto;
    min-height: 48px;
}

.planner-page-header .tm-view-tabs__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 48px;
    height: 100%;
    padding: 0 0.8rem;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: #616161;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1;
    box-sizing: border-box;
    margin-bottom: -1px;
}

.planner-page-header .tm-view-tabs__btn .mud-icon-root {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.125rem !important;
    width: 1.125rem !important;
    height: 1.125rem !important;
    line-height: 1;
    margin: 0;
    transform: translateY(0.5px);
}

.tm-view-tabs__btn--grid .mud-icon-root { color: #5B5FC7 !important; }
.tm-view-tabs__btn--board .mud-icon-root { color: #038387 !important; }
.tm-view-tabs__btn--schedule .mud-icon-root { color: #0078D4 !important; }
.tm-view-tabs__btn--charts .mud-icon-root { color: #CA5010 !important; }

.planner-page-header .tm-view-tabs__btn:hover {
    color: #242424;
    background: transparent;
}

.planner-page-header .tm-view-tabs__btn--active {
    background: transparent;
    color: var(--crm-primary);
    font-weight: 600;
    border-bottom-color: var(--crm-primary);
}

.planner-page-header .tm-view-tabs__btn:disabled {
    opacity: 0.55;
    cursor: default;
    color: #616161;
}

.planner-toolbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    width: 100%;
    min-height: 44px;
    padding: 0.75rem 0 0.85rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.planner-toolbar__left,
.planner-toolbar__right {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.planner-toolbar__right {
    margin-left: auto;
}

.planner-toolbar__icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #616161;
    cursor: pointer;
}

.planner-toolbar__icon-btn:hover,
.planner-toolbar__icon-btn--active {
    background: #F3F2F1;
    color: #242424;
}

.planner-search {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 0.6rem;
    border-bottom: 1px solid var(--crm-primary);
}

.planner-search input {
    width: 180px;
    border: 0;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.875rem;
    color: #242424;
}

.planner-chip {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 0.85rem;
    border: 1px solid #E1DFDD;
    border-radius: 4px;
    background: #fff;
    color: #242424;
    font-family: inherit;
    font-size: 0.8125rem;
    cursor: pointer;
}

.planner-chip:hover {
    background: #F3F2F1;
    color: #242424;
}

.planner-chip--active {
    background: var(--crm-primary);
    border-color: var(--crm-primary);
    color: #fff;
}

.planner-chip--active:hover {
    background: #464EB8;
    border-color: #464EB8;
    color: #fff;
}

.planner-toolbar__action {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    height: 32px;
    padding: 0 0.55rem;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #616161;
    font-family: inherit;
    font-size: 0.8125rem;
    cursor: pointer;
}

.planner-toolbar__action:hover,
.planner-toolbar__action--active {
    background: #F3F2F1;
    color: #242424;
}

.planner-toolbar__action--static {
    cursor: default;
}

.planner-toolbar__action .mud-icon-root {
    font-size: 1.125rem;
    width: 1.125rem;
    height: 1.125rem;
}

.planner-page .pm-board-wrap {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    min-height: 0;
    height: auto;
    width: 100%;
    overflow: visible;
}

.planner-page .pm-board-wrap--mywork {
    min-height: 0;
    padding-top: 0.15rem;
    padding-bottom: 1.5rem;
}

.planner-page .pm-board,
.planner-page .pm-board.mud-drop-container {
    display: flex !important;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 2.25rem;
    width: max-content;
    min-width: 0;
    max-width: none;
    flex: 0 0 auto;
    min-height: 280px;
    height: auto;
    overflow: visible;
    box-sizing: border-box;
}

.planner-page .pm-board-wrap--mywork .pm-board,
.planner-page .pm-board-wrap--mywork .pm-board.mud-drop-container {
    gap: 2.25rem;
}

.planner-page .pm-board-column,
.planner-page .pm-board.mud-drop-container > .pm-board-column {
    display: flex !important;
    flex-direction: column;
    flex: 0 0 240px !important;
    width: 240px !important;
    min-width: 240px !important;
    max-width: 240px !important;
    min-height: 0;
    max-height: none;
    height: auto;
    background: transparent;
    border-radius: 0;
    overflow: visible;
}

.planner-page .pm-board-column__header {
    flex-shrink: 0;
    padding: 0.5rem 0.15rem 0.7rem;
}

.planner-page .pm-board-column__cards,
.planner-page .pm-board-column__cards.mud-drop-zone {
    flex: 0 0 auto;
    min-height: 120px;
    padding: 0 0.15rem 1.5rem;
    gap: 0.75rem;
    overflow: visible;
}

.planner-page .pm-board-column__title {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: #242424;
}

.planner-page .pm-board-column__count {
    display: none;
}

.planner-page .pm-board-column__cards > .mud-drop-item {
    border-radius: 12px;
    overflow: visible;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.planner-page .pm-board-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--crm-border-subtle, #dfe1e6);
    border-radius: 12px;
    background: #fff;
    box-shadow: none;
    padding: 0.7rem 0.8rem 0.65rem;
    overflow: visible;
    transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.planner-page .pm-board-card:hover {
    background: #fff;
    border-color: #c8ceda;
    box-shadow: 0 8px 24px rgba(51, 71, 91, 0.08);
    transform: translateY(-1px);
}

.pm-board-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.4rem;
}

.pm-board-card__main {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    flex: 1;
    min-width: 0;
}

.pm-board-card__menu {
    flex-shrink: 0;
    margin: -0.25rem -0.4rem 0 0;
}

.pm-board-card__menu-btn.mud-icon-button {
    width: 26px !important;
    height: 26px !important;
    padding: 0 !important;
    color: #626f86 !important;
}

.pm-board-card__menu-btn .mud-icon-root {
    font-size: 1.15rem;
}

.planner-page .pm-board-card__menu-btn {
    opacity: 0.72;
}

.planner-page .pm-board-card:hover .pm-board-card__menu-btn,
.planner-page .pm-board-card:focus-within .pm-board-card__menu-btn {
    opacity: 1;
}

.pm-board-card-menu,
.pm-board-card-menu .mud-paper,
.pm-board-card-menu .mud-list,
.pm-board-card-menu__list {
    min-width: 176px !important;
    width: max-content !important;
    padding: 0.2rem 0 !important;
    font-size: 0.8125rem !important;
}

.pm-board-card-menu .mud-menu-item,
.pm-board-card-menu .mud-list-item,
.pm-board-card-menu__list .mud-menu-item,
.pm-board-card-menu__list .mud-list-item {
    min-height: 32px !important;
    padding: 0.25rem 0.75rem !important;
    font-size: 0.8125rem !important;
    gap: 0.55rem !important;
    color: #172b4d !important;
}

.pm-board-card-menu .mud-menu-item-icon,
.pm-board-card-menu .mud-list-item-icon,
.pm-board-card-menu__list .mud-menu-item-icon {
    min-width: 1.25rem !important;
    color: #626f86 !important;
}

.pm-board-card-menu__danger,
.pm-board-card-menu__danger .mud-menu-item-text,
.pm-board-card-menu__danger .mud-typography {
    color: #c9372c !important;
}

.pm-board-card-menu__danger .mud-menu-item-icon,
.pm-board-card-menu__danger .mud-icon-root {
    color: #c9372c !important;
}

html:has(.crm-app-layout.crm-dark) .pm-board-card__menu-btn.mud-icon-button {
    color: #a8b0bd !important;
}

html:has(.crm-app-layout.crm-dark) .pm-board-card-menu .mud-menu-item,
html:has(.crm-app-layout.crm-dark) .pm-board-card-menu .mud-list-item {
    color: var(--crm-text, #f3f2f1) !important;
}

html:has(.crm-app-layout.crm-dark) .pm-board-card-menu .mud-menu-item-icon {
    color: #a8b0bd !important;
}

html:has(.crm-app-layout.crm-dark) .pm-board-card-menu__danger,
html:has(.crm-app-layout.crm-dark) .pm-board-card-menu__danger .mud-menu-item-text,
html:has(.crm-app-layout.crm-dark) .pm-board-card-menu__danger .mud-typography,
html:has(.crm-app-layout.crm-dark) .pm-board-card-menu__danger .mud-icon-root {
    color: #f87171 !important;
}

.pm-board-card__check {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border: 1.5px solid #8A8886;
    border-radius: 50%;
    flex-shrink: 0;
    background: #fff;
}

.planner-page .pm-board-card__title {
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.35;
    -webkit-line-clamp: 3;
}

.planner-page .pm-board-card__marks {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.45rem 0 0.15rem 1.7rem;
}

.pm-board-card__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--crm-primary);
}

.pm-board-card__dot--low { background: #038387; }
.pm-board-card__dot--normal { background: var(--crm-primary); }
.pm-board-card__dot--high { background: #CA5010; }
.pm-board-card__dot--urgent { background: #C4314B; }

.pm-board-card__sparkle {
    font-size: 0.9rem !important;
    width: 0.9rem;
    height: 0.9rem;
    color: #8764B8;
}

.planner-page .pm-board-card__footer {
    margin-top: 0.55rem;
    padding-top: 0.45rem;
    border-top: 1px solid #F3F2F1;
}

.pm-board-card__due {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    color: #616161;
}

.pm-board-card__due .mud-icon-root {
    font-size: 1rem;
    width: 1rem;
    height: 1rem;
}

.pm-board-card__due--empty {
    color: #8A8886;
}

.crm-module-header {
    background: transparent;
    border-bottom: 0;
}

.crm-module-header__icon,
.crm-count-chip {
    display: none;
}

.crm-module-header__desc {
    display: none;
}

.crm-module-header__top {
    padding: 0.15rem 0 0.75rem;
    align-items: flex-end;
}

.crm-module-header__title {
    font-size: 1.25rem !important;
}

.crm-module-header,
.crm-dashboard-greeting {
    margin-left: 0;
    margin-right: 0;
    margin-top: 0;
    width: auto;
}

@media (max-width: 960px) {
    .planner-appbar__menu {
        display: inline-flex !important;
    }

    .planner-page .pm-board-column,
    .planner-page .pm-board.mud-drop-container > .pm-board-column {
        flex: 0 0 220px !important;
        width: 220px !important;
        min-width: 220px !important;
        max-width: 220px !important;
    }
}

.tm-plan-dialog {
    width: min(560px, calc(100vw - 2rem));
}

.tm-plan-dialog .mud-dialog-content {
    overflow: visible;
}

.tm-plan-dialog__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #242424;
}

.mud-dialog.tm-employee-dialog {
    width: min(640px, calc(100vw - 2rem)) !important;
    max-width: 640px !important;
    border-radius: 8px !important;
    overflow: hidden;
}

.tm-employee-dialog .mud-dialog-title {
    padding: 20px 24px 4px !important;
}

.tm-employee-dialog .tm-plan-dialog__title {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #172b4d;
}

.tm-employee-dialog .mud-dialog-content {
    padding: 12px 24px 8px !important;
}

.tm-employee-dialog .mud-dialog-actions {
    padding: 12px 24px 16px !important;
    margin: 0;
    border-top: 1px solid #dfe1e6;
    gap: 8px;
}

.tm-emp-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tm-emp-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
}

.tm-emp-form__row > .crm-field,
.tm-emp-form__row > .crm-field + .crm-field {
    margin-top: 0 !important;
}

.tm-emp-form__row--full {
    grid-template-columns: 1fr;
}

.tm-employee-dialog .crm-field__label {
    font-size: 12px;
    font-weight: 600;
    color: #626f86;
    margin-bottom: 4px;
}

.tm-employee-dialog .crm-native-select {
    line-height: var(--crm-control-height);
}

.tm-employee-dialog .mud-input-control {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.tm-employee-dialog .mud-input-control-helper-container {
    display: none !important;
}

@media (max-width: 600px) {
    .tm-emp-form__row {
        grid-template-columns: 1fr;
    }
}

html:has(.crm-app-layout.crm-dark) .tm-employee-dialog .tm-plan-dialog__title {
    color: var(--crm-text);
}

html:has(.crm-app-layout.crm-dark) .tm-employee-dialog .mud-dialog-actions {
    border-top-color: var(--crm-border);
}

.tm-plan-danger {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #EDEBE9;
}

.tm-plan-danger__label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #A4262C;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tm-plan-danger p {
    margin: 0 0 0.75rem;
    font-size: 0.8125rem;
    color: #616161;
}

.mud-dialog.tm-delete-plan {
    width: min(480px, calc(100vw - 2rem)) !important;
    max-width: 480px !important;
}

.tm-delete-plan__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #242424;
}

.tm-delete-plan__warn {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 1rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid #F1C6C6;
    border-radius: 6px;
    background: #FDE7E9;
    color: #A4262C;
}

.tm-delete-plan__warn p {
    margin: 0.25rem 0 0;
    font-size: 0.8125rem;
    color: #611F20;
}

.tm-delete-plan__warn strong {
    font-size: 0.875rem;
}

.tm-people {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tm-people-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 36px;
    padding: 0 0.65rem;
    border: 1px solid #D1D1D1;
    border-radius: 4px;
    background: #fff;
}

.tm-people-search__icon {
    color: #616161;
    font-size: 1.1rem !important;
}

.tm-people-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 0.875rem;
    color: #242424;
}

.tm-people-search__spinner {
    width: 16px !important;
    height: 16px !important;
}

.tm-people-results {
    position: relative;
    z-index: 20;
    align-self: flex-start;
    width: max-content;
    min-width: 260px;
    max-width: min(340px, 100%);
    max-height: min(220px, 40vh);
    overflow-x: hidden;
    overflow-y: auto;
    margin-top: 0.15rem;
    background: #fff;
    border: 1px solid #E1DFDD;
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.tm-people-results__item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.65rem;
    width: 100%;
    min-width: 100%;
    box-sizing: border-box;
    padding: 0.5rem 0.7rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.tm-people-results__item:hover {
    background: #F3F2F1;
}

.tm-people-results__copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    text-align: left;
}

.tm-people-results__name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #242424;
}

.tm-people-results__meta {
    font-size: 0.75rem;
    color: #616161;
}

.tm-people-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem 0.75rem;
}

.tm-people-chip {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.tm-people-chip__hit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.tm-people-chip__x {
    position: absolute;
    top: -3px;
    right: -3px;
    display: none;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    padding: 0;
    border: 1px solid #fff;
    border-radius: 50%;
    background: #323130;
    color: #fff;
    cursor: pointer;
    line-height: 0;
    z-index: 2;
}

.tm-people-chip__x .mud-icon-root {
    font-size: 10px !important;
    width: 10px;
    height: 10px;
}

.tm-people-chip:hover .tm-people-chip__x,
.tm-people-chip:focus-within .tm-people-chip__x {
    display: inline-flex;
}

.tm-people-chip__days {
    font-size: 0.6875rem;
    color: #616161;
}

.tm-people-chip--past .pm-avatar {
    opacity: 0.55;
}

.pm-avatar--md {
    width: 40px;
    height: 40px;
    font-size: 0.875rem;
}

.pm-avatar--lg {
    width: 64px;
    height: 64px;
    font-size: 1.25rem;
}

.pm-avatar--xl {
    width: 72px;
    height: 72px;
    font-size: 1.375rem;
    flex: 0 0 72px;
}

.tm-people-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2100;
    background: rgba(32, 31, 30, 0.4);
}

.tm-people-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    width: 240px;
    padding: 1.15rem 1rem 1rem;
    border: 1px solid #E1DFDD;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.tm-people-card--dialog {
    width: 100%;
    border: 0;
    box-shadow: none;
    padding: 0.25rem 0 0;
}

.mud-dialog.tm-person-dialog {
    width: min(420px, calc(100vw - 2rem)) !important;
    max-width: 420px !important;
}

.mud-dialog.tm-person-dialog .mud-dialog-content {
    padding: 1.25rem 1.25rem 0.5rem !important;
}

.mud-dialog.tm-person-dialog .mud-dialog-actions {
    padding: 0.5rem 1rem 0.85rem !important;
}

.tm-person {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    text-align: left;
}

.tm-person__copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding-top: 0.15rem;
}

.tm-person__name {
    font-size: 1.125rem;
    font-weight: 600;
    color: #242424;
    line-height: 1.3;
}

.tm-person__role,
.tm-person__meta {
    margin-top: 0.2rem;
    font-size: 0.8125rem;
    color: #616161;
}

.tm-person__email {
    margin-top: 0.35rem;
    font-size: 0.8125rem;
    color: var(--crm-primary);
    text-decoration: none;
    word-break: break-word;
}

.tm-person__email:hover {
    text-decoration: underline;
}

.tm-people-card__photo {
    margin-bottom: 0.35rem;
}

.tm-people-card__photo {
    margin-bottom: 0.35rem;
}

.tm-people-card__name {
    font-size: 0.9375rem;
    color: #242424;
}

.tm-people-card__dept,
.tm-people-card__email,
.tm-people-card__days {
    font-size: 0.75rem;
    color: #616161;
    word-break: break-word;
}

.tm-people-card__remove {
    margin-top: 0.55rem;
    padding: 0.25rem 0.7rem;
    border: 1px solid #D1D1D1;
    border-radius: 4px;
    background: #fff;
    color: #242424;
    font: inherit;
    font-size: 0.75rem;
    cursor: pointer;
}

.tm-people-card__remove:hover {
    background: #F3F2F1;
}

.tm-people-past__label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #616161;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mud-dialog.tm-newplan-dialog {
    max-width: none !important;
}

.mud-dialog.tm-newplan-dialog .mud-dialog-content {
    padding: 0 !important;
    overflow: hidden;
}

.mud-dialog.tm-newplan-dialog--picker {
    width: min(880px, calc(100vw - 2rem)) !important;
    max-width: 880px !important;
}

.mud-dialog.tm-newplan-dialog--preview {
    width: min(1080px, calc(100vw - 2rem)) !important;
    max-width: 1080px !important;
    height: min(720px, calc(100vh - 4rem)) !important;
}

.mud-dialog.tm-newplan-dialog--preview .mud-dialog-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.mud-dialog.tm-newplan-dialog--details {
    width: min(480px, calc(100vw - 2rem)) !important;
    max-width: 480px !important;
    max-height: min(90vh, 760px) !important;
}

.mud-dialog.tm-newplan-dialog--details .mud-dialog-content {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    max-height: min(90vh, 760px);
}

.mud-dialog .tm-people-results {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    align-self: flex-start;
    width: max-content;
    min-width: 260px;
    max-width: min(340px, 100%);
    max-height: 200px;
    margin-top: 0.35rem;
}

.tm-newplan {
    padding: 1.25rem 1.5rem 1.1rem;
}

.tm-newplan__bar {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 2rem;
    margin-bottom: 1.25rem;
}

.tm-newplan__title {
    flex: 1;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #242424;
    line-height: 1.3;
}

.tm-newplan__icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #616161;
    cursor: pointer;
}

.tm-newplan__icon-btn:hover {
    background: #F3F2F1;
}

.tm-newplan__text-btn {
    border: 0;
    background: transparent;
    color: var(--crm-primary);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.tm-newplan__text-btn--back {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    color: #242424;
    font-weight: 600;
}

.tm-newplan-basic {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    width: min(280px, 100%);
    margin: 0.25rem auto 1.5rem;
    padding: 1.35rem 1rem 1.15rem;
    border: 1px solid #EDEBE9;
    border-radius: 8px;
    background: #FAF9F8;
    color: #242424;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.tm-newplan-basic:hover {
    border-color: #C8C6C4;
    background: #fff;
}

.tm-newplan-basic__plus {
    font-size: 1.6rem;
    line-height: 1;
    color: #616161;
    margin-bottom: 0.35rem;
}

.tm-newplan-basic strong {
    font-size: 0.9375rem;
}

.tm-newplan-basic span:last-child {
    font-size: 0.75rem;
    color: #616161;
}

.tm-newplan__section-label {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #242424;
}

.tm-newplan-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.tm-newplan-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.7rem 0.7rem 0.85rem;
    border: 1px solid #EDEBE9;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    text-align: center;
    color: #242424;
}

.tm-newplan-card:hover {
    border-color: #C8C6C4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.tm-newplan-card__art {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 88px;
    border-radius: 6px;
}

.tm-newplan-card__art .mud-icon-root {
    font-size: 2.25rem !important;
}

.tm-newplan-card__name {
    font-size: 0.8125rem;
    font-weight: 600;
}

.tm-newplan__footer-link {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.1rem;
}

.tm-newplan.tm-newplan--preview {
    display: flex;
    align-items: stretch;
    padding: 0 !important;
    margin: 0;
    flex: 1;
    min-height: 0;
    height: 100%;
}

.tm-newplan-nav {
    --nav-pad: 12px;
    --nav-icon: 28px;
    --nav-gap: 10px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 240px;
    flex: 0 0 240px;
    border-right: 1px solid #EDEBE9;
    padding: 0;
    overflow: hidden;
    background: #fff;
}

.tm-newplan-nav button {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    box-sizing: border-box;
    font-family: inherit;
}

.tm-newplan-nav__top {
    flex: 0 0 auto;
    padding: 0.85rem 0 0.25rem;
}

.tm-newplan-nav__back {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.15rem;
    width: 100%;
    min-width: 100%;
    padding: 0.35rem var(--nav-pad);
    border: 0;
    background: transparent;
    color: #242424;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
}

.tm-newplan-nav__list {
    display: block;
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 0 0 1rem;
}

.tm-newplan-nav__group {
    display: block;
    box-sizing: border-box;
    width: 100%;
    padding: 0.7rem var(--nav-pad) 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #616161;
    line-height: 1.3;
}

.tm-newplan-nav__row {
    display: block;
    width: 100%;
}

.tm-newplan-nav__row:hover {
    background: #F3F2F1;
}

.tm-newplan-nav__row--active,
.tm-newplan-nav__row--active:hover {
    background: #EDEBE9;
}

.tm-newplan-nav__item {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: var(--nav-gap);
    width: 100% !important;
    min-width: 100%;
    padding: 0.45rem var(--nav-pad) !important;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #242424;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
}

.tm-newplan-nav__row--active .tm-newplan-nav__item {
    font-weight: 600;
}

.tm-newplan-nav__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--nav-icon);
    height: var(--nav-icon);
    border-radius: 6px;
    color: #fff;
    flex: 0 0 var(--nav-icon);
}

.tm-newplan-nav__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tm-newplan-preview {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 1;
    min-width: 0;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

.tm-newplan-preview__head {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 0 0 auto;
    padding: 1.15rem 3rem 0.15rem 1.5rem;
}

.tm-newplan-preview__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 0.65rem 1.5rem 1rem;
}

.tm-newplan-preview__close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
}

.tm-newplan-preview__title {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: #242424;
    align-self: stretch;
}

.tm-newplan-preview__chip {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    width: auto;
    flex: 0 0 auto;
    height: 22px;
    padding: 0 0.5rem;
    margin-bottom: 0.55rem;
    border-radius: 4px;
    background: #EDEBE9;
    color: #242424;
    font-size: 0.75rem;
    font-weight: 600;
}

.tm-newplan-preview__lead {
    margin: 0 0 1rem;
    color: #616161;
    font-size: 0.875rem;
}

.tm-newplan-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 0.9rem;
    border-radius: 10px;
    background: linear-gradient(135deg, #c9b6ea 0%, #8ec5e8 55%, #5aa0c8 100%);
    min-height: 280px;
}

.tm-newplan-board__col {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    padding: 0.55rem;
    min-height: 240px;
}

.tm-newplan-board__col-title {
    margin: 0 0 0.45rem 0.15rem;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
}

.tm-newplan-board__card {
    background: #fff;
    border-radius: 6px;
    padding: 0.55rem 0.6rem;
    margin-bottom: 0.45rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tm-newplan-board__card-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #242424;
}

.tm-newplan-board__checks {
    margin: 0.35rem 0 0;
    padding: 0;
    list-style: none;
}

.tm-newplan-board__checks li {
    position: relative;
    padding: 0.12rem 0 0.12rem 1.15rem;
    font-size: 0.75rem;
    color: #616161;
}

.tm-newplan-board__checks li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.28rem;
    width: 12px;
    height: 12px;
    border: 1px solid #C8C6C4;
    border-radius: 50%;
}

.tm-newplan-board__add {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.75rem;
    padding: 0.25rem 0.15rem;
}

.tm-newplan-preview__benefits {
    margin-top: 1.15rem;
}

.tm-newplan-preview__benefits-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #242424;
    margin-bottom: 0.35rem;
}

.tm-newplan-preview__benefits ul {
    margin: 0;
    padding-left: 1.1rem;
    color: #616161;
    font-size: 0.875rem;
}

.tm-newplan-preview__actions {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: auto;
    padding: 0.85rem 1.5rem 1.1rem;
    border-top: 1px solid #EDEBE9;
    background: #fff;
}

.tm-newplan--details {
    padding: 1rem 1.25rem 1.15rem;
}

.tm-newplan-details {
    padding-top: 0.15rem;
}

.tm-newplan-pin {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.875rem;
    color: #242424;
    cursor: pointer;
}

.tm-newplan-pin input {
    width: 16px;
    height: 16px;
}

.tm-newplan-details__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.15rem;
}

@media (max-width: 900px) {
    .tm-newplan-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tm-newplan--preview {
        flex-direction: column;
        min-height: 0;
        height: auto;
    }

    .mud-dialog.tm-newplan-dialog--preview {
        height: auto !important;
        max-height: calc(100vh - 2rem) !important;
    }

    .tm-newplan-nav {
        width: 100%;
        flex-basis: auto;
        border-right: 0;
        border-bottom: 1px solid #EDEBE9;
        max-height: 180px;
    }

    .tm-newplan-board {
        grid-template-columns: 1fr;
    }
}

.tm-hub-lead {
    margin: 1rem 0 1.25rem;
    color: var(--crm-text-muted);
    font-size: 0.875rem;
    max-width: 46rem;
}

.tm-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    padding: 0.25rem 0 1.5rem;
}

.tm-hub-card {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 1.15rem 1.2rem 1.25rem;
    border: 1px solid var(--crm-border);
    border-radius: 12px;
    background: var(--crm-surface);
    color: var(--crm-text);
    text-decoration: none;
    min-height: 148px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.tm-hub-card:hover {
    border-color: var(--crm-primary);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.tm-hub-card .mud-icon-root {
    color: var(--crm-primary);
    font-size: 1.35rem;
}

.tm-hub-card__title {
    font-size: 1rem;
    font-weight: 600;
}

.tm-hub-card__copy {
    color: var(--crm-text-muted);
    font-size: 0.8125rem;
    line-height: 1.4;
}

.tm-report-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    margin: 1rem 0;
}

.tm-report-filters {
    --jira-border: var(--crm-border);
    --jira-text: var(--crm-text);
    --jira-subtle: var(--crm-text-muted);
    --jira-panel: var(--crm-bg);
    --jira-radius: 3px;
    margin: 1rem 0 1.25rem;
    border: 1px solid var(--jira-border);
    border-radius: 8px;
    background: var(--jira-panel);
}

.tm-report-filters__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 44px;
    padding: 0 12px;
    background: var(--crm-surface);
    border-radius: 8px;
}

.tm-report-filters--open .tm-report-filters__head {
    border-bottom: 1px solid var(--jira-border);
    border-radius: 8px 8px 0 0;
}

.tm-report-filters__brand {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    margin: 0;
    padding: 4px 6px;
    border: 0;
    border-radius: var(--jira-radius);
    background: transparent;
    color: var(--jira-text);
    font: inherit;
    cursor: pointer;
}

.tm-report-filters__brand:hover {
    background: var(--crm-nav-hover, #ebecf0);
}

.tm-report-filters__icon {
    font-size: 18px !important;
    width: 18px !important;
    height: 18px !important;
    color: var(--jira-subtle);
}

.tm-report-filters__chevron {
    color: var(--jira-subtle);
}

.tm-report-filters__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--jira-text);
}

.tm-report-filters__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 8px;
    background: var(--crm-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.tm-report-filters__meta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.tm-report-filters__count {
    font-size: 12px;
    font-weight: 500;
    color: var(--jira-subtle);
    white-space: nowrap;
}

.tm-report-filters__clear {
    border: 0;
    background: transparent;
    color: var(--crm-primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: var(--jira-radius);
}

.tm-report-filters__clear:hover {
    background: var(--crm-primary-soft);
}

.tm-report-filters__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px 16px;
}

.tm-report-filters__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px 12px;
}

.tm-report-filters__row--period {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--jira-border);
}

.tm-report-filters__row--chips {
    align-items: flex-start;
}

.tm-report-field {
    display: grid;
    grid-template-rows: 16px 34px;
    row-gap: 4px;
    width: 168px;
    min-width: 0;
}

.tm-report-field--date {
    width: 148px;
}

.tm-report-field--action {
    width: auto;
    flex: 0 0 auto;
}

.tm-report-field__label {
    display: block;
    grid-row: 1;
    height: 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--jira-subtle);
    line-height: 16px;
    overflow: hidden;
}

.tm-report-field > .tm-report-field__input,
.tm-report-field > .mud-picker,
.tm-report-field > .tm-report-chip,
.tm-report-field > .tm-report-search {
    grid-row: 2;
    width: 100%;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    margin: 0 !important;
}

.tm-report-field__input,
.tm-report-field__input.mud-input-control {
    width: 100%;
    margin: 0 !important;
}

.tm-report-filters .mud-input-control-helper-container {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}

.tm-report-filters .mud-picker,
.tm-report-filters .mud-input-control {
    margin: 0 !important;
}

.tm-report-field__input .mud-input-label {
    display: none !important;
}

.tm-report-filters .tm-report-field__input .mud-input-root,
.tm-report-filters .tm-report-field__input .mud-input-slot,
.tm-report-filters .tm-report-field__input .mud-input-control-input-container {
    min-height: 34px !important;
    height: 34px !important;
    max-height: 34px !important;
}

.tm-report-filters .mud-picker,
.tm-report-filters .mud-picker .mud-input-control {
    height: 34px !important;
}

.tm-report-filters .tm-report-field__input .mud-input-outlined .mud-input-outlined-border {
    border-radius: 10px !important;
    border-color: var(--crm-border) !important;
}

.tm-report-filters .tm-report-field__input .mud-input-outlined:hover .mud-input-outlined-border {
    border-color: #8590a2 !important;
}

.tm-report-filters .tm-report-field__input .mud-input-outlined.mud-input-outlined-with-label .mud-input-outlined-border,
.tm-report-filters .tm-report-field__input.mud-input-outlined:focus-within .mud-input-outlined-border,
.tm-report-filters .tm-report-field__input .mud-input:focus-within .mud-input-outlined-border {
    border-color: var(--crm-primary) !important;
    border-width: 2px !important;
}

.tm-report-search {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: var(--crm-primary);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
}

.tm-report-search:hover {
    filter: brightness(0.95);
}

.tm-report-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0 12px;
    border: 1px solid var(--crm-border);
    border-radius: 10px;
    background: var(--crm-surface);
    color: var(--crm-text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
}

.tm-report-chip:hover {
    background: var(--crm-nav-hover, #ebecf0);
}

.tm-report-chip--on {
    border-color: var(--crm-primary);
    background: var(--crm-primary-soft);
    color: var(--crm-primary);
}

.tm-report-export__caret {
    margin-left: -0.15rem;
    font-size: 1.1rem !important;
    width: 1.1rem !important;
    height: 1.1rem !important;
}

.tm-report-export-menu {
    min-width: 196px;
    padding: 4px !important;
    border-radius: 8px !important;
    border: 1px solid var(--crm-border) !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12) !important;
    overflow: hidden;
    background: var(--crm-surface, #fff) !important;
}

.tm-report-export-menu .mud-list {
    padding: 0 !important;
}

.tm-report-export-menu__item {
    min-height: 36px !important;
    border-radius: 6px !important;
    font-size: 0.875rem !important;
    color: var(--crm-text) !important;
}

.tm-report-export-menu__item .mud-icon-root {
    color: var(--crm-primary) !important;
}

.tm-report-table {
    margin: 0 0 1.25rem;
    border: 1px solid var(--crm-border);
    border-radius: 12px;
    background: var(--crm-surface, #fff);
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(37, 36, 91, 0.04);
}

.tm-report-table .mud-table {
    background: transparent;
}

.tm-report-table .mud-table-container {
    overflow-x: auto;
}

.tm-employee-actions {
    width: 88px !important;
    min-width: 88px !important;
    text-align: right !important;
    white-space: nowrap !important;
}

.tm-employee-actions .crm-row-actions {
    justify-content: flex-end;
}

.planner-page-header__action:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

@media (max-width: 560px) {
    .tm-report-field,
    .tm-report-field--date {
        width: 100%;
        flex: 1 1 100%;
    }
}

html:has(.crm-app-layout.crm-dark) .tm-report-filters {
    --jira-border: var(--crm-border);
    --jira-text: var(--crm-text);
    --jira-subtle: var(--crm-text-muted);
    --jira-panel: var(--crm-bg);
    background: var(--crm-bg);
    border-color: var(--crm-border);
}

html:has(.crm-app-layout.crm-dark) .tm-report-filters__head {
    background: var(--crm-surface);
}

html:has(.crm-app-layout.crm-dark) .tm-report-filters__brand:hover,
html:has(.crm-app-layout.crm-dark) .tm-report-chip:hover {
    background: var(--crm-nav-hover);
}

html:has(.crm-app-layout.crm-dark) .tm-report-chip {
    background: var(--crm-surface);
    border-color: var(--crm-border);
    color: var(--crm-text);
}

html:has(.crm-app-layout.crm-dark) .tm-report-chip--on {
    background: var(--crm-primary-soft);
    border-color: var(--crm-primary);
    color: var(--crm-primary);
}

html:has(.crm-app-layout.crm-dark) .tm-report-table {
    background: var(--crm-surface);
    border-color: var(--crm-border);
    box-shadow: none;
}

html:has(.crm-app-layout.crm-dark) .tm-report-export-menu {
    background: var(--crm-surface) !important;
    border-color: var(--crm-border) !important;
}

html:has(.crm-app-layout.crm-dark) .tm-report-filters .tm-report-field__input .mud-input-root,
html:has(.crm-app-layout.crm-dark) .tm-report-filters .tm-report-field__input .mud-input-slot,
html:has(.crm-app-layout.crm-dark) .tm-report-filters .mud-picker .mud-input-root {
    background: var(--crm-surface) !important;
    color: var(--crm-text) !important;
}

html:has(.crm-app-layout.crm-dark) .tm-hub-lead {
    color: var(--crm-text-muted);
}

html:has(.crm-app-layout.crm-dark) .pm-directory__progress-track {
    background: var(--crm-border);
}

.tm-admin-search {
    flex: 1;
    min-width: 220px;
    max-width: 420px;
}

.tm-hidden-file {
    display: none !important;
}

.tm-admin-panel {
    margin-bottom: 1rem;
}

.tm-admin-inline-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.tm-access-name {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.tm-access-meta {
    color: #616161;
    font-size: 0.75rem;
}

.tm-access-role-cell {
    vertical-align: top !important;
}

.tm-access-role {
    min-width: 140px;
}

.tm-access-role .mud-select-input .mud-input-slot {
    display: flex !important;
    align-items: center !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 1 !important;
}

.tm-perm {
    margin: 0 0 1.5rem;
}

.tm-perm__tabs {
    display: flex;
    gap: 0;
    margin: 0 0 1rem;
    border-bottom: 2px solid #dfe1e6;
}

.tm-perm__tab {
    margin: 0 0 -2px;
    padding: 8px 16px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #626f86;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.tm-perm__tab:hover {
    color: #172b4d;
}

.tm-perm__tab--active {
    color: var(--crm-primary);
    border-bottom-color: var(--crm-primary);
    font-weight: 600;
}

.tm-perm__board {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tm-perm-group {
    border: 1px solid #dfe1e6;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.tm-perm-group__head {
    padding: 10px 16px;
    border-bottom: 1px solid #dfe1e6;
    background: #f7f8f9;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #626f86;
}

.tm-perm-group__body {
    display: flex;
    flex-direction: column;
}

.tm-perm-row {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    column-gap: 12px;
    align-items: start;
    margin: 0;
    padding: 12px 16px;
    border-bottom: 1px solid #dfe1e6;
    cursor: pointer;
}

.tm-perm-row:last-child {
    border-bottom: 0;
}

.tm-perm-row:hover {
    background: #f7f8f9;
}

.tm-perm-row__box {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 1px;
}

.tm-perm-row__box .mud-checkbox,
.tm-perm-row__box .mud-input-control,
.tm-perm-row__box .mud-input-control-input-container {
    width: auto !important;
    max-width: 32px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 0 0 auto !important;
}

.tm-perm-row__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tm-perm-row__name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: #172b4d;
}

.tm-perm-row__desc {
    font-size: 12px;
    line-height: 1.4;
    color: #626f86;
}

html:has(.crm-app-layout.crm-dark) .tm-perm-group {
    background: var(--crm-surface);
    border-color: var(--crm-border);
}

html:has(.crm-app-layout.crm-dark) .tm-perm-group__head,
html:has(.crm-app-layout.crm-dark) .tm-perm-row:hover {
    background: var(--crm-bg);
}

html:has(.crm-app-layout.crm-dark) .tm-perm__tabs,
html:has(.crm-app-layout.crm-dark) .tm-perm-group__head,
html:has(.crm-app-layout.crm-dark) .tm-perm-row {
    border-color: var(--crm-border);
}

html:has(.crm-app-layout.crm-dark) .tm-perm__tab {
    color: var(--crm-text-muted);
}

html:has(.crm-app-layout.crm-dark) .tm-perm-row__name {
    color: var(--crm-text);
}

.tm-team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    padding: 0.25rem 0 1.5rem;
}

.tm-team-card {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding: 1rem 1.1rem 1.15rem;
    border: 1px solid #dfe1e6;
    border-radius: 12px;
    background: #fff;
}

.tm-team-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.tm-team-card h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.tm-team-card p {
    margin: 0.2rem 0 0;
    color: #616161;
    font-size: 0.8125rem;
}

.crm-theme-menu-popover {
    border-radius: 12px !important;
    border: 1px solid var(--crm-border) !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12) !important;
    overflow: hidden;
    background: var(--crm-surface) !important;
}

html:has(.crm-app-layout.crm-dark) .planner-sidebar.mud-drawer,
html:has(.crm-app-layout.crm-dark) .planner-sidebar .mud-drawer-content {
    background: var(--crm-sidebar) !important;
    border-right-color: var(--crm-border) !important;
}

html:has(.crm-app-layout.crm-dark) .planner-nav__menu .mud-nav-link {
    color: var(--crm-nav-text) !important;
}

html:has(.crm-app-layout.crm-dark) .planner-nav__menu .mud-nav-link .mud-icon-root {
    color: var(--crm-nav-icon) !important;
}

html:has(.crm-app-layout.crm-dark) .planner-nav__menu .mud-nav-link:hover {
    background: var(--crm-nav-hover) !important;
}

html:has(.crm-app-layout.crm-dark) .planner-nav__menu .mud-nav-link.active {
    background: var(--crm-nav-active-bg) !important;
    color: var(--crm-text) !important;
}

html:has(.crm-app-layout.crm-dark) .planner-nav__menu .planner-nav__link--my-day .mud-icon-root { color: #E2C36A !important; }
html:has(.crm-app-layout.crm-dark) .planner-nav__menu .planner-nav__link--my-tasks .mud-icon-root { color: #6BB3B8 !important; }
html:has(.crm-app-layout.crm-dark) .planner-nav__menu .planner-nav__link--plans .mud-icon-root { color: #8B8FE8 !important; }
html:has(.crm-app-layout.crm-dark) .planner-nav__menu .planner-nav__link--overview .mud-icon-root { color: #7E93F5 !important; }
html:has(.crm-app-layout.crm-dark) .planner-nav__menu .planner-nav__link--efficiency .mud-icon-root { color: #6AA8A2 !important; }
html:has(.crm-app-layout.crm-dark) .planner-nav__menu .planner-nav__link--completion .mud-icon-root { color: #7FB34A !important; }
html:has(.crm-app-layout.crm-dark) .planner-nav__menu .planner-nav__link--overdue .mud-icon-root { color: #E06B7A !important; }
html:has(.crm-app-layout.crm-dark) .planner-nav__menu .planner-nav__link--workload .mud-icon-root { color: #5AA8EA !important; }
html:has(.crm-app-layout.crm-dark) .planner-nav__menu .planner-nav__link--employees .mud-icon-root { color: #A98CD0 !important; }
html:has(.crm-app-layout.crm-dark) .planner-nav__menu .planner-nav__link--access .mud-icon-root { color: #E08A4C !important; }
html:has(.crm-app-layout.crm-dark) .planner-nav__menu .planner-nav__link--roles .mud-icon-root { color: #8A9BB0 !important; }
html:has(.crm-app-layout.crm-dark) .planner-nav__menu .planner-nav__link--teams .mud-icon-root { color: #4EB8BE !important; }
html:has(.crm-app-layout.crm-dark) .planner-nav__menu .planner-nav__link--directory .mud-icon-root { color: #7E93F5 !important; }

html:has(.crm-app-layout.crm-dark) .planner-nav__section-label {
    color: var(--crm-text-muted);
}

html:has(.crm-app-layout.crm-dark) .planner-nav__plan {
    color: var(--crm-nav-text);
}

html:has(.crm-app-layout.crm-dark) .planner-nav__plan:hover {
    background: var(--crm-nav-hover);
}

html:has(.crm-app-layout.crm-dark) .planner-nav__plan--active {
    background: var(--crm-nav-active-bg);
}

html:has(.crm-app-layout.crm-dark) .planner-new-plan {
    background: var(--crm-surface);
    border-color: var(--crm-border);
    color: var(--crm-text);
}

html:has(.crm-app-layout.crm-dark) .planner-new-plan:hover {
    background: var(--crm-nav-hover);
}

html:has(.crm-app-layout.crm-dark) .planner-page-header {
    background: var(--crm-surface);
    border-bottom-color: var(--crm-border);
    box-shadow: none;
}

html:has(.crm-app-layout.crm-dark) .tm-schedule {
    background: var(--crm-surface);
    border-color: var(--crm-border);
}

html:has(.crm-app-layout.crm-dark) .tm-schedule__toolbar {
    background: var(--crm-pipeline-column-bg);
    border-bottom-color: var(--crm-border);
}

html:has(.crm-app-layout.crm-dark) .tm-schedule__month,
html:has(.crm-app-layout.crm-dark) .tm-schedule__num {
    color: var(--crm-text);
}

html:has(.crm-app-layout.crm-dark) .tm-schedule__icon-btn,
html:has(.crm-app-layout.crm-dark) .tm-schedule__mode,
html:has(.crm-app-layout.crm-dark) .tm-schedule__dow,
html:has(.crm-app-layout.crm-dark) .tm-schedule__more {
    color: var(--crm-text-muted);
}

html:has(.crm-app-layout.crm-dark) .tm-schedule__weekdays,
html:has(.crm-app-layout.crm-dark) .tm-schedule__cell {
    background: var(--crm-surface);
    border-color: var(--crm-border);
}

html:has(.crm-app-layout.crm-dark) .tm-schedule__cell--outside {
    background: var(--crm-pipeline-column-bg);
}

html:has(.crm-app-layout.crm-dark) .tm-schedule__chip {
    background: var(--crm-nav-hover);
    color: var(--crm-text);
}

html:has(.crm-app-layout.crm-dark) .tm-myday-banner {
    background: var(--crm-surface);
    border-color: var(--crm-border);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.28);
}

html:has(.crm-app-layout.crm-dark) .tm-myday-banner__cal {
    background: #323130;
}

html:has(.crm-app-layout.crm-dark) .tm-myday-banner__weekday,
html:has(.crm-app-layout.crm-dark) .tm-myday-banner__month,
html:has(.crm-app-layout.crm-dark) .tm-myday-banner__tagline,
html:has(.crm-app-layout.crm-dark) .tm-myday-banner__count {
    color: var(--crm-text-muted);
}

html:has(.crm-app-layout.crm-dark) .tm-myday-banner__day,
html:has(.crm-app-layout.crm-dark) .tm-myday-banner__greeting {
    color: var(--crm-text);
}

html:has(.crm-app-layout.crm-dark) .tm-myday-banner__bar {
    background: rgba(91, 95, 199, 0.28);
}

html:has(.crm-app-layout.crm-dark) .planner-page-header__title,
html:has(.crm-app-layout.crm-dark) .planner-page-header__title-btn {
    color: var(--crm-text);
}

html:has(.crm-app-layout.crm-dark) .planner-plan-crumb,
html:has(.crm-app-layout.crm-dark) .planner-plan-crumb__sep,
html:has(.crm-app-layout.crm-dark) .planner-page-header__icon-link,
html:has(.crm-app-layout.crm-dark) .planner-page-header .tm-view-tabs__btn {
    color: var(--crm-text-muted);
}

html:has(.crm-app-layout.crm-dark) .planner-page-header__icon {
    color: var(--crm-text-muted) !important;
}

html:has(.crm-app-layout.crm-dark) .planner-page-header__icon.planner-page-header__icon--my-day,
html:has(.crm-app-layout.crm-dark) .planner-page-header__icon.mud-icon-root.planner-page-header__icon--my-day { color: #E2C36A !important; }
html:has(.crm-app-layout.crm-dark) .planner-page-header__icon.planner-page-header__icon--my-tasks,
html:has(.crm-app-layout.crm-dark) .planner-page-header__icon.mud-icon-root.planner-page-header__icon--my-tasks { color: #6BB3B8 !important; }
html:has(.crm-app-layout.crm-dark) .planner-page-header__icon.planner-page-header__icon--plans,
html:has(.crm-app-layout.crm-dark) .planner-page-header__icon.mud-icon-root.planner-page-header__icon--plans { color: #8B8FE8 !important; }
html:has(.crm-app-layout.crm-dark) .planner-page-header__icon.planner-page-header__icon--overview,
html:has(.crm-app-layout.crm-dark) .planner-page-header__icon.mud-icon-root.planner-page-header__icon--overview { color: #7E93F5 !important; }
html:has(.crm-app-layout.crm-dark) .planner-page-header__icon.planner-page-header__icon--efficiency,
html:has(.crm-app-layout.crm-dark) .planner-page-header__icon.mud-icon-root.planner-page-header__icon--efficiency { color: #6AA8A2 !important; }
html:has(.crm-app-layout.crm-dark) .planner-page-header__icon.planner-page-header__icon--completion,
html:has(.crm-app-layout.crm-dark) .planner-page-header__icon.mud-icon-root.planner-page-header__icon--completion { color: #7FB34A !important; }
html:has(.crm-app-layout.crm-dark) .planner-page-header__icon.planner-page-header__icon--overdue,
html:has(.crm-app-layout.crm-dark) .planner-page-header__icon.mud-icon-root.planner-page-header__icon--overdue { color: #E06B7A !important; }
html:has(.crm-app-layout.crm-dark) .planner-page-header__icon.planner-page-header__icon--workload,
html:has(.crm-app-layout.crm-dark) .planner-page-header__icon.mud-icon-root.planner-page-header__icon--workload { color: #5AA8EA !important; }
html:has(.crm-app-layout.crm-dark) .planner-page-header__icon.planner-page-header__icon--employees,
html:has(.crm-app-layout.crm-dark) .planner-page-header__icon.mud-icon-root.planner-page-header__icon--employees { color: #A98CD0 !important; }
html:has(.crm-app-layout.crm-dark) .planner-page-header__icon.planner-page-header__icon--access,
html:has(.crm-app-layout.crm-dark) .planner-page-header__icon.mud-icon-root.planner-page-header__icon--access { color: #E08A4C !important; }
html:has(.crm-app-layout.crm-dark) .planner-page-header__icon.planner-page-header__icon--roles,
html:has(.crm-app-layout.crm-dark) .planner-page-header__icon.mud-icon-root.planner-page-header__icon--roles { color: #8A9BB0 !important; }
html:has(.crm-app-layout.crm-dark) .planner-page-header__icon.planner-page-header__icon--teams,
html:has(.crm-app-layout.crm-dark) .planner-page-header__icon.mud-icon-root.planner-page-header__icon--teams { color: #4EB8BE !important; }
html:has(.crm-app-layout.crm-dark) .planner-page-header__icon.planner-page-header__icon--directory,
html:has(.crm-app-layout.crm-dark) .planner-page-header__icon.mud-icon-root.planner-page-header__icon--directory { color: #7E93F5 !important; }

html:has(.crm-app-layout.crm-dark) .tm-view-tabs__btn--grid .mud-icon-root { color: #8B8FE8 !important; }
html:has(.crm-app-layout.crm-dark) .tm-view-tabs__btn--board .mud-icon-root { color: #4EB8BE !important; }
html:has(.crm-app-layout.crm-dark) .tm-view-tabs__btn--schedule .mud-icon-root { color: #5AA8EA !important; }
html:has(.crm-app-layout.crm-dark) .tm-view-tabs__btn--charts .mud-icon-root { color: #E08A4C !important; }

html:has(.crm-app-layout.crm-dark) .tm-hub-card,
html:has(.crm-app-layout.crm-dark) .tm-team-card {
    background: var(--crm-surface);
    border-color: var(--crm-border);
    color: var(--crm-text);
}

.tm-import-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.tm-import-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
    gap: 0.65rem;
    margin: 0.85rem 0 1rem;
}

.tm-import-stat {
    padding: 0.7rem 0.75rem;
    border: 1px solid var(--crm-border);
    border-radius: 8px;
    background: var(--crm-surface);
}

.tm-import-stat strong {
    display: block;
    font-size: 1.15rem;
    line-height: 1.2;
}

.tm-import-stat span {
    color: var(--crm-text-muted);
    font-size: 0.75rem;
}

.tm-import-table {
    border: 1px solid var(--crm-border);
    border-radius: 8px;
    overflow: hidden;
}

.tm-import-result {
    text-align: center;
    padding: 0.5rem 0 0.25rem;
}

.tm-import-result__icon {
    color: #107C10 !important;
    font-size: 2.25rem !important;
}

.tm-import-result h2 {
    margin: 0.4rem 0 0.25rem;
    font-size: 1.15rem;
}

.tm-import-errors {
    text-align: left;
    color: var(--crm-text-muted);
    font-size: 0.8125rem;
    margin: 0.5rem 0 0;
    padding-left: 1.2rem;
}

.mud-dialog.tm-import-dialog {
    max-width: 960px;
}

html:has(.crm-app-layout.crm-dark) .crm-btn-primary.mud-button-root:disabled,
html:has(.crm-app-layout.crm-dark) .mud-button-root.crm-btn-primary:disabled,
html:has(.crm-app-layout.crm-dark) .crm-btn-primary.mud-disabled,
html:has(.crm-app-layout.crm-dark) .crm-btn-primary.mud-button-disabled {
    background: #3b3a39 !important;
    color: #a19f9d !important;
    border-color: #605e5c !important;
}
