:root {
    --crm-primary: #007A94;
    --crm-primary-dark: #00657A;
    --crm-primary-soft: #E6F4F7;
    --crm-accent: #007A94;
    --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: #FAF9F8;
    --crm-topbar: #FFFFFF;
    --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) .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-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;
}

.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:has(textarea) .mud-input-control-input-container,
.crm-input:has(textarea) .mud-input-control-input-container {
    height: auto !important;
    min-height: unset !important;
    max-height: none !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.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 {
    position: relative;
    min-height: 100vh;
    isolation: isolate;
    background: #f4f7fb;
}

.auth-shell:has(.auth-page--ref) {
    background: #f4f7fb;
}

.auth-shell:has(.auth-page--ref)::before,
.auth-shell:has(.auth-page--ref)::after {
    display: none;
}

.auth-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background: url("background-image.jpg") center center / cover no-repeat;
    opacity: 0.2;
    pointer-events: none;
}

.auth-shell::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(155deg,
        rgba(248, 251, 253, 0.62) 0%,
        rgba(245, 249, 252, 0.58) 50%,
        rgba(248, 246, 252, 0.62) 100%);
}

.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.auth-page--split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 100vh;
    position: relative;
}

.auth-page--split::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: url("background-image.jpg") center center / cover no-repeat;
    opacity: 0.16;
    pointer-events: none;
}

.auth-page--split > * {
    position: relative;
    z-index: 1;
}

.auth-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 3.5rem;
    overflow: hidden;
    color: #fff;
    width: 100%;
    min-width: 0;
}

.auth-hero .mud-typography {
    width: 100%;
    max-width: 100%;
}

.auth-hero--tenant {
    background: linear-gradient(145deg,
        rgba(0, 145, 174, 0.92) 0%,
        rgba(0, 122, 148, 0.9) 42%,
        rgba(70, 78, 184, 0.88) 100%);
}

.auth-hero--platform {
    background: linear-gradient(145deg,
        rgba(99, 102, 241, 0.9) 0%,
        rgba(79, 70, 229, 0.92) 48%,
        rgba(49, 46, 129, 0.94) 100%);
}

.auth-hero__overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.18) 0%, transparent 45%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.12) 0%, transparent 40%);
    pointer-events: none;
}

.auth-hero__content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 32rem;
    min-width: min(100%, 20rem);
}

.auth-hero__title {
    font-weight: 700 !important;
    letter-spacing: -0.03em;
    line-height: 1.25 !important;
    color: #fff !important;
    margin-bottom: 0.75rem !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: anywhere;
    max-width: 100%;
}

.auth-hero__lead {
    color: rgba(255, 255, 255, 0.88) !important;
    line-height: 1.6 !important;
    margin-bottom: 1.75rem !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: anywhere;
    max-width: 100%;
}

.auth-hero__features {
    list-style: none;
    margin: 0 0 2.25rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.auth-hero__features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.92);
}

.auth-hero__features .mud-icon-root {
    font-size: 1.125rem !important;
    opacity: 0.95;
}

.auth-hero-carousel {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-hero-carousel__slide {
    display: none;
    width: 100%;
    animation: auth-hero-fade-in 0.45s ease;
}

.auth-hero-carousel__slide.is-active {
    display: block;
}

@keyframes auth-hero-fade-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-hero-carousel__dots {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.auth-hero-carousel__dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.auth-hero-carousel__dot.is-active {
    background: #fff;
    transform: scale(1.15);
}

.xeno-logo-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
}

.xeno-logo {
    display: inline-flex;
    align-items: baseline;
    font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1;
    color: #0f172a;
}

.xeno-logo--sm {
    font-size: 1.25rem;
}

.xeno-logo--md {
    font-size: 1.65rem;
}

.xeno-logo--lg {
    font-size: 2.125rem;
}

.xeno-logo__letter--accent {
    color: var(--crm-primary) !important;
}

.xeno-logo__tagline {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.auth-panel {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(6px);
}

.auth-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2.5rem 0.75rem;
}

.auth-panel__brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.auth-panel__logo {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: linear-gradient(145deg, #0091ae 0%, #464eb8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 6px 16px rgba(0, 145, 174, 0.22);
}

.auth-panel__logo--admin {
    background: linear-gradient(145deg, #6366f1 0%, #4f46e5 100%);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.28);
}

.auth-panel__logo-img {
    max-height: 40px;
    max-width: 140px;
    object-fit: contain;
}

.auth-panel__brand-name {
    font-weight: 700 !important;
    letter-spacing: -0.02em;
    color: #1e293b !important;
}

.auth-panel__main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem 2rem;
}

.auth-panel__footer {
    padding: 1rem 2.5rem 1.5rem;
    text-align: center;
    font-size: 0.8125rem;
    color: #64748b;
}

.auth-panel__footer a {
    color: var(--crm-primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-panel__footer a:hover {
    text-decoration: underline;
}

.auth-panel__footer-sep {
    margin: 0 0.375rem;
    color: #cbd5e1;
}

/* Legacy single-column auth (account-expired, etc.) */
.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.5rem;
}

.auth-page__logo {
    width: 48px;
    height: 48px;
    margin-bottom: 0.75rem;
    border-radius: 12px;
    background: linear-gradient(145deg, #5B5FC7 0%, #464EB8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 6px 16px rgba(0, 145, 174, 0.28);
}

.auth-page__brand-name {
    font-weight: 700 !important;
    letter-spacing: -0.02em;
    color: #33475b !important;
}

.auth-card {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    padding: 2rem 1.75rem 1.5rem;
    box-shadow: 0 8px 32px rgba(51, 71, 91, 0.08);
}

.auth-card--modern {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.5rem 1.5rem 1.25rem;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}

.auth-card--tall {
    min-height: 26rem;
    padding: 2rem 1.75rem 1.75rem;
    display: flex;
    flex-direction: column;
}

.auth-form--tall {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.auth-form__spacer {
    flex: 1;
    min-height: 1.5rem;
}

.auth-page .auth-btn.crm-btn.mud-button-root {
    border-radius: 8px !important;
}

.auth-card__title {
    font-weight: 700 !important;
    letter-spacing: -0.02em;
    color: #0f172a !important;
    margin-bottom: 0.35rem !important;
    text-align: left;
}

.auth-card__subtitle {
    color: #64748b !important;
    margin-bottom: 1.125rem !important;
    line-height: 1.5 !important;
    text-align: left;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: left;
}

.auth-field {
    margin: 0 !important;
}

.auth-form .auth-field.mud-input-control {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.auth-field--outlined .mud-input-outlined-border {
    border-color: #dfe3eb !important;
    border-radius: 10px !important;
}

.auth-field--outlined.mud-input-focused .mud-input-outlined-border,
.auth-field--outlined .mud-input-control:focus-within .mud-input-outlined-border {
    border-color: var(--crm-primary) !important;
    border-width: 1px !important;
}

.auth-field--outlined .mud-input-label {
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    color: #64748b !important;
}

.auth-field--outlined .mud-input > input.mud-input-root,
.auth-field--outlined .mud-input-slot input {
    font-size: 0.875rem !important;
    color: #33475b !important;
}

@media (max-width: 960px) {
    .auth-page--split {
        grid-template-columns: 1fr;
    }

    .auth-hero {
        display: none;
    }

    .auth-panel {
        background: rgba(255, 255, 255, 0.88);
    }

    .auth-panel__header,
    .auth-panel__main,
    .auth-panel__footer {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}

.auth-field:not(.auth-field--outlined) .mud-input-outlined-border {
    display: none !important;
}

.auth-field:not(.auth-field--outlined) .mud-input-control-input-container {
    background: #fff;
    border: 1px solid #dfe3eb;
    border-radius: 10px;
    padding: 0 12px;
    min-height: 44px;
    transition: border-color var(--crm-transition), box-shadow var(--crm-transition);
}

.auth-field--outlined .mud-input-control-input-container {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    min-height: unset !important;
}

.auth-field:not(.auth-field--outlined) .mud-input-control-input-container:hover {
    border-color: #cbd5e1;
}

.auth-field:not(.auth-field--outlined).mud-input-focused .mud-input-control-input-container,
.auth-field:not(.auth-field--outlined) .mud-input-control-input-container:focus-within {
    border-color: var(--crm-primary);
    box-shadow: 0 0 0 3px rgba(0, 145, 174, 0.12);
}

.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:not(.auth-field--outlined) .mud-input-label {
    display: none !important;
}

.auth-field--outlined .mud-input-label {
    display: block !important;
}

.auth-field .mud-input > input.mud-input-root,
.auth-field .mud-input-slot,
.auth-field .mud-input-slot input {
    font-size: 0.8125rem !important;
    font-weight: 400 !important;
    font-variation-settings: "wght" 400;
    color: #516f90;
    padding: 8px 0;
}

.auth-field .mud-input > input.mud-input-root::placeholder,
.auth-field .mud-input-slot input::placeholder {
    color: #94a3b8;
    font-weight: 400 !important;
    font-variation-settings: "wght" 400;
    opacity: 1;
}

.auth-field .mud-input-adornment .mud-icon-root {
    color: #94a3b8;
    font-size: 1.05rem !important;
}

.auth-field .mud-input-adornment-start {
    margin-inline-end: 6px;
}

.auth-field .mud-input-adornment-end .mud-icon-button {
    color: #64748b !important;
    width: 28px !important;
    height: 28px !important;
    padding: 4px !important;
}

.auth-field .mud-input-adornment-end .mud-icon-root {
    font-size: 1.05rem !important;
}

.auth-form__error {
    margin: 0;
}

.auth-btn.crm-btn.mud-button-root {
    margin-top: 0.35rem !important;
    width: 100%;
    box-shadow: 0 4px 14px rgba(0, 145, 174, 0.22) !important;
}

.auth-btn.crm-btn.mud-button-root:hover {
    box-shadow: 0 6px 18px rgba(0, 145, 174, 0.28) !important;
}

.auth-form__links {
    margin-top: 1.25rem;
}

.auth-link.mud-button-root {
    color: var(--crm-primary) !important;
    text-transform: none !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
}

.auth-link.mud-button-root:hover {
    background: rgba(0, 145, 174, 0.06) !important;
}

.auth-demo-hint {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid #eaf0f6;
    text-align: center;
}

.auth-demo-hint--zoho {
    margin-top: 1.5rem;
    padding-top: 0;
    border-top: none;
    text-align: left;
}

.auth-demo-hint .mud-typography-caption {
    display: block;
    color: #94a3b8 !important;
    line-height: 1.6;
}

.auth-page__footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.25rem 1.5rem;
    text-align: center;
    font-size: 0.8125rem;
    color: #64748b;
}

.auth-page__footer a {
    color: var(--crm-primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-page__footer a:hover {
    text-decoration: underline;
}

.auth-page__footer-sep {
    margin: 0 0.375rem;
    color: #cbd5e1;
}

/* Auth route bootstrap / session check (no dashboard flash) */
.auth-route-splash {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
    background: #eef2f6;
}

.auth-route-splash__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    text-align: center;
}

.auth-route-splash__message {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b;
}

.auth-route-splash__spinner {
    margin-top: 0.25rem;
}

/* ── Auth layout (Zoho-style centered card) ─────────────────── */

.auth-page--zoho {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem 2.5rem;
    background: #eef2f6;
    overflow: hidden;
}

.auth-zoho__texture {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-color: #eef2f6;
    background-image:
        radial-gradient(ellipse 120% 80% at 50% -15%, rgba(0, 122, 148, 0.14), transparent 55%),
        radial-gradient(ellipse 70% 55% at 100% 85%, rgba(100, 116, 139, 0.12), transparent 50%),
        radial-gradient(ellipse 65% 50% at 0% 70%, rgba(0, 122, 148, 0.09), transparent 48%),
        linear-gradient(168deg, #f8fafc 0%, #f1f5f9 38%, #e8edf3 72%, #e2e8f0 100%);
}

.auth-zoho__texture::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 52% 42% at 50% 46%, rgba(255, 255, 255, 0.72), transparent 68%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, transparent 22%, transparent 78%, rgba(15, 23, 42, 0.04) 100%);
}

.auth-zoho__pattern {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    --auth-zoho-pattern-fade: radial-gradient(ellipse 92% 78% at 50% 44%, #000 18%, rgba(0, 0, 0, 0.55) 50%, transparent 82%);
    background-color: transparent;
    background-image:
        radial-gradient(circle at center, rgba(0, 122, 148, 0.22) 1.25px, transparent 1.35px),
        linear-gradient(rgba(0, 122, 148, 0.09) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 122, 148, 0.09) 1px, transparent 1px),
        linear-gradient(rgba(100, 116, 139, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(100, 116, 139, 0.06) 1px, transparent 1px);
    background-size: 72px 72px, 72px 72px, 72px 72px, 18px 18px, 18px 18px;
    background-position: -1px -1px, 0 0, 0 0, 0 0, 0 0;
    mask-image: var(--auth-zoho-pattern-fade);
}

.auth-zoho__pattern::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(
            -12deg,
            transparent,
            transparent 47px,
            rgba(0, 122, 148, 0.035) 47px,
            rgba(0, 122, 148, 0.035) 48px
        ),
        repeating-linear-gradient(
            12deg,
            transparent,
            transparent 47px,
            rgba(15, 23, 42, 0.025) 47px,
            rgba(15, 23, 42, 0.025) 48px
        );
    mask-image: var(--auth-zoho-pattern-fade);
    opacity: 0.85;
}

.auth-zoho__pattern::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(15, 23, 42, 0.05) 0.75px, transparent 0);
    background-size: 24px 24px;
    mask-image: var(--auth-zoho-pattern-fade);
    opacity: 0.65;
}

.auth-zoho__frame {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 56rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.auth-zoho__card {
    --auth-zoho-panel-pt: 2rem;
    --auth-zoho-panel-pb: 2rem;
    --auth-zoho-content-inset-top: 0.875rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: 100%;
    min-height: 36rem;
    background: #fff;
    border-radius: 14px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.65) inset,
        0 2px 4px rgba(15, 23, 42, 0.03),
        0 12px 32px rgba(15, 23, 42, 0.06),
        0 28px 56px rgba(0, 122, 148, 0.07);
    overflow: hidden;
}

.auth-zoho__signin {
    padding: calc(var(--auth-zoho-panel-pt) + var(--auth-zoho-content-inset-top)) 2.25rem var(--auth-zoho-panel-pb);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.auth-zoho__logo {
    margin-bottom: 1.75rem;
}

.auth-zoho__promo {
    position: relative;
    padding: var(--auth-zoho-panel-pt) 2rem var(--auth-zoho-panel-pb);
    background: #fff;
    border-left: 1px solid #e8edf3;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    min-height: 0;
}

.auth-card--zoho {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    width: 100%;
}

.auth-card--zoho .auth-card__title {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a !important;
    letter-spacing: -0.02em;
}

.auth-card--zoho .auth-card__title:focus,
.auth-card__title:focus {
    outline: none;
    box-shadow: none;
}

.auth-card--zoho .auth-card__subtitle {
    margin: 0 0 1.35rem;
    font-size: 0.9375rem;
    color: #64748b !important;
}

.auth-zoho__copyright {
    margin: 0;
    font-size: 0.75rem;
    color: #64748b;
    text-align: center;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
}

/* Zoho-style sign-in promo carousel */
.auth-zoho-carousel {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    text-align: center;
}

.auth-zoho-carousel__viewport {
    position: relative;
    flex: 1 1 auto;
    min-height: 18rem;
}

.auth-zoho-carousel__slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.55s ease, visibility 0.55s ease, transform 0.55s ease;
    pointer-events: none;
}

.auth-zoho-carousel__slide.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.auth-zoho-carousel__media {
    width: 100%;
    max-width: min(100%, 24rem);
    margin: 0 auto 1rem;
    flex-shrink: 0;
}

.auth-zoho-carousel__image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 15.5rem;
    object-fit: contain;
    object-position: center;
}

.auth-zoho-carousel__title {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0 0 0.85rem;
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.35;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.auth-zoho-carousel__title-accent {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.25rem;
    border-radius: 5px;
    background: #1a73e8;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
}

.auth-zoho-carousel__title-text {
    text-align: left;
}

.auth-zoho-carousel__lead {
    margin: 0 auto 1.35rem;
    max-width: 22rem;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #475569;
}

.auth-zoho-carousel__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.375rem;
    padding: 0 1.5rem;
    border: none;
    border-radius: 999px;
    background: #e8f4fd;
    color: #1a73e8;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.auth-zoho-carousel__cta:hover {
    background: #d2ebfa;
    color: #1558b0;
}

.auth-zoho-carousel__dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1.25rem;
}

.auth-zoho-carousel__dot {
    width: 1.25rem;
    height: 5px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #c8d9ef;
    cursor: pointer;
    transition: width 0.25s ease, background 0.25s ease;
}

.auth-zoho-carousel__dot.is-active {
    width: 2rem;
    background: #1a73e8;
}

@media (max-width: 900px) {
    .auth-zoho__card {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .auth-zoho__promo {
        display: none;
    }

    .auth-zoho__signin {
        padding: 1.75rem 1.5rem 1.5rem;
    }
}

/* Legacy auth reference (unused) */
.auth-page--ref {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    min-height: 100vh;
}

.auth-showcase {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 2.25rem 2.75rem 2rem;
    overflow: hidden;
    color: #fff;
}

.auth-showcase--brand,
.auth-showcase--platform,
.auth-showcase--tenant {
    background: linear-gradient(165deg, #004d5e 0%, #007a94 42%, #0095b3 100%);
}

.auth-showcase__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
}

.auth-showcase__glow--one {
    width: 280px;
    height: 280px;
    top: 10%;
    right: -40px;
    background: rgba(0, 149, 179, 0.35);
}

.auth-showcase__glow--two {
    width: 220px;
    height: 220px;
    bottom: 18%;
    left: -30px;
    background: rgba(0, 122, 148, 0.28);
}

.auth-showcase__inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    max-width: 34rem;
    margin: 0 auto;
    min-height: 0;
}

.auth-showcase__carousel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 0 1rem;
    min-height: 0;
}

.auth-showcase .auth-hero__title {
    margin: 0 0 0.65rem;
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.25;
    color: #fff;
    letter-spacing: -0.02em;
}

.auth-showcase .auth-hero__lead {
    margin: 0 0 1.35rem;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.82);
    max-width: 30rem;
}

.auth-hero__feature-cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.auth-hero__feature-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-hero__feature-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.auth-hero__feature-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.auth-hero__feature-text strong {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
}

.auth-hero__feature-text span {
    font-size: 0.75rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.72);
}

.auth-hero-carousel {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-hero-carousel__body {
    position: relative;
    min-height: 0;
}

.auth-hero-carousel__slide {
    display: none;
    width: 100%;
    animation: auth-hero-fade-in 0.45s ease;
}

.auth-hero-carousel__slide.is-active {
    display: block;
}

.auth-hero-carousel__dots {
    display: flex;
    gap: 0.45rem;
    margin-top: 0.25rem;
}

.auth-hero-carousel__dot {
    width: 7px;
    height: 7px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.auth-hero-carousel__dot.is-active {
    background: #fff;
    transform: scale(1.2);
}

.auth-showcase-art {
    margin-top: 1.25rem;
    flex-shrink: 0;
    width: 100%;
    max-width: 26rem;
}

.auth-showcase-art__img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 11rem;
    object-fit: contain;
    object-position: left bottom;
    opacity: 0.95;
    filter: drop-shadow(0 12px 28px rgba(15, 23, 42, 0.22));
}

.auth-signin {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 2.5rem;
    background: #f4f7fb;
}

.auth-signin__texture {
    position: absolute;
    inset: 0;
    background: url("background-image.jpg") center / cover no-repeat;
    opacity: 0.42;
    pointer-events: none;
}

.auth-signin__texture::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.62) 0%, rgba(248, 250, 252, 0.55) 100%);
}

.auth-signin__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 24rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.auth-signin__logo {
    margin-bottom: 1.5rem;
    align-self: flex-start;
}

.auth-card--ref,
.auth-card--zoho {
    width: 100%;
}

.auth-card--ref {
    background: #fff;
    border: 1px solid #e8edf3;
    border-radius: 18px;
    padding: 1.65rem 1.5rem 1.35rem;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.auth-card--ref .auth-card__title {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a !important;
    letter-spacing: -0.02em;
    text-align: left;
}

.auth-card--ref .auth-card__subtitle {
    margin: 0 0 1.25rem;
    font-size: 0.875rem;
    color: #64748b !important;
    line-height: 1.5;
    text-align: left;
}

.auth-form--ref {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.auth-field--ref.mud-input-control {
    justify-content: flex-start !important;
    text-align: left;
}

.auth-field--ref .mud-input-control-input-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    background: #fff;
    border: 1px solid #dbe3ec;
    border-radius: 10px;
    min-height: 46px;
    padding: 0 0.75rem;
}

.auth-field--ref .mud-input-underline:before,
.auth-field--ref .mud-input-underline:after {
    display: none !important;
}

.auth-field--ref .mud-input-label {
    display: none !important;
}

.auth-field--ref .mud-input {
    margin-top: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    align-self: center;
}

.auth-field--ref .mud-input-slot {
    width: 100%;
    text-align: left;
}

.auth-field--ref .mud-input > input.mud-input-root,
.auth-field--ref .mud-input-slot input {
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1.35 !important;
    height: auto !important;
    min-height: 0 !important;
    width: 100%;
    text-align: left !important;
}

.auth-field--ref .mud-input-adornment {
    align-self: center;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    height: auto;
    display: inline-flex;
    align-items: center;
}

.auth-field--ref .mud-input-adornment-end .mud-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-field--ref.mud-input-focused .mud-input-control-input-container,
.auth-field--ref .mud-input-control-input-container:focus-within {
    border-color: var(--crm-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--crm-primary) 18%, transparent);
}

.auth-form__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.15rem;
}

.auth-remember .mud-typography {
    font-size: 0.8125rem !important;
}

.auth-link--inline.mud-button-root {
    min-height: auto !important;
    padding: 0 !important;
    font-size: 0.8125rem !important;
    text-transform: none !important;
    color: var(--crm-primary) !important;
}

.auth-btn--ref.crm-btn.mud-button-root {
    margin-top: 0.35rem;
    min-height: 46px !important;
    border-radius: 10px !important;
    background: var(--crm-primary) !important;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--crm-primary) 35%, transparent) !important;
    font-weight: 600 !important;
}

.auth-btn--ref.crm-btn.mud-button-root:hover {
    background: var(--crm-primary-dark) !important;
}

.auth-trust-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin: 1.75rem 0 0;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #94a3b8;
}

.auth-trust-line span {
    position: relative;
}

.auth-trust-line span + span::before {
    content: "•";
    position: absolute;
    left: -0.85rem;
    color: #cbd5e1;
    font-weight: 400;
}

.xeno-logo-block--light .xeno-logo__letter:not(.xeno-logo__letter--accent) {
    color: #ffffff;
}

.xeno-logo-block--light .xeno-logo__letter--accent {
    color: #b8e6f0 !important;
}

.xeno-logo-block--light .xeno-logo__tagline {
    color: rgba(255, 255, 255, 0.72);
}

.xeno-logo-block--dark .xeno-logo__letter:not(.xeno-logo__letter--accent) {
    color: #0f172a;
}

.xeno-logo-block--dark .xeno-logo__letter--accent {
    color: var(--crm-primary, #007a94) !important;
}

.auth-hero-carousel__panel {
    padding: 1.35rem 1.4rem 1.25rem;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(6px);
}

.xeno-logo__tagline {
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

@media (max-width: 960px) {
    .auth-page--ref {
        grid-template-columns: 1fr;
    }

    .auth-showcase {
        display: none;
    }

    .auth-signin {
        min-height: 100vh;
        padding: 1.5rem 1.25rem;
    }
}

/* ── 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;
}

/* ── 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__menu-item.mud-list-item {
    padding: 0 !important;
    min-height: 0 !important;
}

.crm-export-menu__menu-item .crm-export-menu__option {
    width: 100%;
}

.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); }

/* Sidebar */
.crm-app-layout .crm-sidebar.mud-drawer {
    top: 0 !important;
    height: 100% !important;
    margin-top: 0 !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__xeno-logo .xeno-logo--sm {
    font-size: 1.05rem;
}

.crm-sidebar-nav__xeno-logo .xeno-logo__tagline {
    display: none;
}

.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-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;
}

/* 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-app-layout.crm-dark .crm-sidebar-nav__menu .mud-nav-link.active .mud-icon-root {
    color: #ffffff !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;
    display: flex;
    flex-direction: column;
    padding-top: 0 !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) 2rem;
    flex: 1;
}

@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;
    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;
}

.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, #5B5FC7 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-shell {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 0;
}

.crm-pipeline-shell__hint {
    margin: 0;
}

.crm-pipeline-shell .pm-board-wrap {
    height: calc(100vh - 280px);
    min-height: 420px;
    overflow: hidden;
    margin-inline: calc(-1 * var(--crm-page-padding-x));
    width: calc(100% + (2 * var(--crm-page-padding-x)));
    padding-inline: var(--crm-page-padding-x);
    box-sizing: border-box;
}

.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 (deals / sales — aligned with pm-board) */
.pipeline-board.pm-board {
    scroll-padding-inline: 0.5rem;
}

.pipeline-column.pm-board-column {
    flex: 1 1 0;
    min-width: 240px;
    background: #f4f5f7;
    border: none;
    border-radius: 8px;
}

.crm-app-layout.crm-dark .pipeline-column.pm-board-column {
    background: #252423;
}

.pipeline-column.pm-board-column:has(.mud-drop-zone-drag) {
    box-shadow: inset 0 0 0 2px var(--crm-primary);
}

.pipeline-column__header.pm-board-column__header {
    justify-content: space-between;
    border-radius: 8px 8px 0 0;
    border-top: 3px solid var(--crm-primary);
}

.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.pm-board-column__title {
    color: var(--crm-text);
    text-transform: none;
    letter-spacing: normal;
    font-weight: 600;
}

.pipeline-column__cards.mud-drop-zone {
    min-height: 120px;
}

.pipeline-column__cards > .mud-drop-item {
    margin: 0 !important;
    border-radius: 8px;
    overflow: hidden;
}

.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.pm-board-card {
    border: none;
    padding: 0.45rem 0.6rem 0.35rem;
}

.pipeline-card--dragging {
    opacity: 0.55;
}

.pipeline-card__top.pm-board-card__top {
    align-items: flex-start;
}

.pipeline-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.375rem;
}

.pipeline-card__name.pm-board-card__title {
    flex: 1;
    min-width: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    -webkit-line-clamp: 2;
}

.pipeline-card__amount {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--crm-primary);
    white-space: nowrap;
}

.pipeline-card__meta.pm-board-card__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.25rem 0.5rem;
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--crm-border-light);
    font-size: 0.6875rem;
    line-height: 1.2;
    color: var(--crm-text-muted);
}

.crm-app-layout.crm-dark .pipeline-card__meta.pm-board-card__footer {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.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__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: 280px;
}

.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: 1.75rem;
    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 1.75rem 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: center;
    gap: 1.75rem;
    height: 100%;
    padding: 0 0.5rem;
    position: relative;
    z-index: 1;
    overflow-x: auto;
}

.crm-bar-chart__column {
    flex: 0 0 4.5rem;
    width: 4.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 4.5rem;
    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.75rem;
    flex-shrink: 0;
    border-radius: 3px 3px 0 0;
    transition: height 0.35s ease, filter 0.15s ease;
}

.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-shrink: 0;
    height: 1.75rem;
    margin-top: 0;
    padding-top: 0.4rem;
    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.25;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.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;
}

.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; }
    .crm-pipeline-shell .pm-board-wrap {
        padding-inline: var(--crm-page-padding-x);
    }
}

/* 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; }

/* Deal / sale detail */
.record-detail--pipeline .record-detail__sidebar {
    background: transparent;
    border: none;
    border-radius: 0;
}

.record-detail--pipeline .record-detail__sidebar .record-detail__card {
    position: sticky;
    top: 0.75rem;
}

.record-detail__grid--pipeline {
    grid-template-columns: minmax(260px, 300px) 1fr minmax(240px, 280px);
    gap: 1.25rem;
    margin-top: 1rem;
}

.crm-pipeline-detail__back {
    text-transform: none !important;
    font-weight: 500 !important;
    color: var(--crm-text-muted) !important;
}

.crm-pipeline-detail-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem 2rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--crm-radius-lg);
    border: 1px solid var(--crm-border);
    background: linear-gradient(135deg, var(--crm-surface) 0%, var(--crm-primary-soft) 100%);
    box-shadow: var(--crm-shadow-sm);
}

.crm-pipeline-detail-hero__identity {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    min-width: 0;
    flex: 1 1 280px;
}

.crm-pipeline-detail-hero__icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--crm-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.25);
}

.crm-pipeline-detail-hero__icon .mud-icon-root {
    font-size: 1.75rem;
}

.crm-pipeline-detail-hero__titles {
    min-width: 0;
}

.crm-pipeline-detail-hero__name {
    font-weight: 700 !important;
    line-height: 1.25 !important;
    margin: 0 !important;
    word-break: break-word;
}

.crm-pipeline-detail-hero__subtitle {
    margin-top: 0.25rem !important;
    color: var(--crm-text-muted) !important;
}

.crm-pipeline-detail-hero__stage {
    display: inline-flex;
    margin-top: 0.625rem;
    padding: 0.2rem 0.625rem;
    border-radius: var(--crm-radius-pill);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border-top: none;
    border-radius: var(--crm-radius-pill);
}

.crm-pipeline-detail-hero__metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    flex: 0 1 auto;
}

.crm-pipeline-detail-metric {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 120px;
    padding: 0.625rem 1rem;
    background: var(--crm-surface);
    border: 1px solid var(--crm-border-light);
    border-radius: var(--crm-radius);
}

.crm-pipeline-detail-metric__label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--crm-text-muted);
}

.crm-pipeline-detail-metric__value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--crm-primary);
    line-height: 1.2;
}

.crm-pipeline-detail-metric__value--muted {
    font-size: 1rem;
    font-weight: 600;
    color: var(--crm-text);
}

.crm-pipeline-detail__section-title {
    font-weight: 600 !important;
    margin-bottom: 0.75rem !important;
    display: block;
}

.crm-pipeline-detail__body-text {
    color: var(--crm-text-muted);
    line-height: 1.55;
    white-space: pre-wrap;
}

.crm-pipeline-detail__stage-field .mud-input-root {
    margin-top: 0;
}

.record-detail__props--comfortable dt:first-child {
    margin-top: 0;
}

.crm-pipeline-detail-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem 1.25rem;
}

.crm-pipeline-detail-summary__label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--crm-text-muted);
    margin-bottom: 0.25rem;
}

.crm-pipeline-detail-summary__value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--crm-text);
}

.crm-pipeline-detail-links .crm-quick-link:last-child {
    margin-bottom: 0;
}

.record-detail__card--flush-top {
    border-radius: var(--crm-radius-lg);
}

@media (max-width: 1100px) {
    .record-detail__grid--pipeline {
        grid-template-columns: 1fr;
    }

    .record-detail--pipeline .record-detail__sidebar .record-detail__card {
        position: static;
    }

    .crm-pipeline-detail-hero {
        padding: 1rem;
    }

    .crm-pipeline-detail-hero__metrics {
        width: 100%;
    }

    .crm-pipeline-detail-metric {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 0;
    }
}

.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 {
    min-width: 56px !important;
    width: 56px !important;
    max-width: 56px !important;
    text-align: center !important;
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    box-sizing: border-box;
}

.crm-col-actions--compact {
    min-width: 56px !important;
    width: 56px !important;
    max-width: 56px !important;
    text-align: center !important;
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
}

.crm-data-table-wrap .mud-table-head .crm-col-actions--compact,
.crm-data-table-wrap .mud-table-head .mud-table-cell.crm-col-actions--compact {
    text-align: left !important;
}

.crm-data-table-wrap .mud-table-head .crm-col-actions {
    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;
}

/* Roles list — fit page width (override leads table min-width) */
.crm-roles-table-wrap {
    overflow-x: hidden;
}

.crm-roles-table .mud-table-container {
    overflow-x: hidden;
}

.crm-roles-table table {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100%;
    table-layout: fixed;
}

.crm-roles-table .mud-table-body .mud-table-row:hover {
    background: var(--crm-row-hover, rgba(0, 0, 0, 0.02));
}

.crm-roles-table .crm-roles-table__col-role {
    width: 16%;
}

.crm-roles-table .crm-roles-table__col-type {
    width: 9%;
    text-align: center !important;
}

.crm-roles-table .crm-roles-table__col-desc {
    width: 46%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-roles-table .crm-roles-table__col-perms {
    width: 12%;
    text-align: center !important;
}

.crm-roles-table .crm-roles-table__col-users {
    width: 9%;
    text-align: center !important;
}

.crm-roles-table .crm-col-actions--compact {
    width: 8% !important;
    min-width: 3.25rem !important;
    max-width: 4rem !important;
}

.crm-roles-table__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--crm-radius-md, 8px);
    background: var(--crm-primary-soft, rgba(0, 128, 128, 0.08));
    color: var(--crm-primary, teal);
    flex-shrink: 0;
}

.crm-roles-table__name {
    font-weight: 600 !important;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-roles-table__type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 4.25rem;
    padding: 0.2rem 0.55rem;
    border-radius: var(--crm-radius-pill, 999px);
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0.02em;
    border: 1px solid var(--crm-border);
    white-space: nowrap;
}

.crm-roles-table__type-badge--system {
    color: var(--crm-text-muted);
    background: var(--crm-surface-alt, #f4f6f8);
}

.crm-roles-table__type-badge--custom {
    color: var(--crm-primary, teal);
    border-color: color-mix(in srgb, var(--crm-primary, teal) 35%, var(--crm-border));
    background: var(--crm-primary-soft, rgba(0, 128, 128, 0.08));
}

.crm-roles-table__metric {
    display: inline-block;
    min-width: 1.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--crm-text);
}

.crm-roles-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
    gap: 0.35rem;
}

.crm-roles-empty__icon {
    font-size: 2.5rem !important;
    color: var(--crm-text-muted);
    opacity: 0.65;
    margin-bottom: 0.5rem;
}

.crm-roles-empty__title {
    font-weight: 600 !important;
}

.crm-data-table-wrap .mud-table-head .crm-col-created {
    vertical-align: bottom;
    z-index: 1 !important;
}

.crm-row-actions-trigger.mud-icon-button {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    border-radius: 8px !important;
    color: var(--crm-action-icon) !important;
    background: transparent !important;
}

.crm-row-actions-trigger.mud-icon-button:hover {
    background: var(--crm-action-hover-neutral) !important;
    color: var(--crm-text) !important;
}

.crm-row-actions-popover .mud-list {
    min-width: 11.5rem;
    padding: 0.35rem 0;
}

.crm-row-actions-popover .mud-list-item {
    font-size: 0.8125rem;
    min-height: 38px;
}

.crm-row-actions-popover .crm-menu-item--danger {
    color: #a4262c !important;
}

.crm-row-actions-popover .crm-menu-item--danger .mud-icon-root {
    color: #a4262c !important;
}

.crm-row-actions-popover .crm-menu-item--primary {
    color: var(--crm-primary) !important;
}

.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-shell,
.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;
}

.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; }
}

.pm-board-shell {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    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;
    overflow: hidden;
}

.pm-board {
    display: flex;
    gap: 0.5rem;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: stretch;
    padding: 0;
}

.pm-board-column {
    flex: 1 1 0;
    min-width: 240px;
    background: #f4f5f7;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
}

.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 {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    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;
    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.45rem 0.6rem 0.35rem;
    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.8125rem;
    font-weight: 400;
    line-height: 1.3;
    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);
}

@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__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__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: #ebecf0;
    overflow: hidden;
}

.pm-directory__progress-fill {
    height: 100%;
    border-radius: 999px;
    background: #0052cc;
}

.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 {
        display: none;
    }
}

.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);
}

.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;
}

.permission-matrix {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-size: 0.8125rem;
}

.permission-matrix__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--crm-border-light);
    border-radius: var(--crm-radius-md, 8px);
    background: var(--crm-surface-muted, #f8fafb);
}

.permission-matrix__toolbar-label {
    font-weight: 600;
    color: var(--crm-text);
}

.permission-matrix__toolbar-meta {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--crm-text-muted);
}

.permission-matrix__module {
    border: 1px solid var(--crm-border-light);
    border-radius: var(--crm-radius-md, 8px);
    overflow: hidden;
    background: var(--crm-surface);
}

.permission-matrix__module-head {
    padding: 0.75rem 1rem;
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--crm-primary, teal) 8%, var(--crm-surface)) 0%,
        var(--crm-surface-muted, #f4f6f8) 100%
    );
    border-bottom: 1px solid var(--crm-border-light);
}

.permission-matrix__module-head-main {
    min-width: 0;
}

.permission-matrix__module-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--crm-radius-md, 8px);
    background: var(--crm-primary-soft, rgba(0, 128, 128, 0.1));
    color: var(--crm-primary, teal);
    flex-shrink: 0;
}

.permission-matrix__module-title {
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--crm-text);
    line-height: 1.25;
}

.permission-matrix__module-sub {
    margin-top: 0.125rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--crm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.permission-matrix__module-body {
    padding: 0.25rem 0;
}

.permission-matrix__row {
    display: grid;
    grid-template-columns: 1fr 3.25rem;
    align-items: center;
    column-gap: 0.75rem;
    padding: 0.4375rem 1rem;
    border-bottom: 1px solid var(--crm-border-light);
}

.permission-matrix__row:last-child {
    border-bottom: none;
}

.permission-matrix__row--head {
    padding-top: 0.5rem;
    padding-bottom: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--crm-text-muted);
    background: var(--crm-surface);
}

.permission-matrix__action--head {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

.permission-matrix__grant--head {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
    padding-right: 0;
}

.permission-matrix__row:not(.permission-matrix__row--head):hover {
    background: var(--crm-row-hover, rgba(0, 0, 0, 0.02));
}

.permission-matrix__row--granted:not(.permission-matrix__row--head) {
    background: color-mix(in srgb, var(--crm-primary, teal) 4%, var(--crm-surface));
}

.permission-matrix__action {
    color: var(--crm-text);
    font-weight: 500;
    min-width: 0;
}

.permission-matrix__grant {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 3.25rem;
}

.permission-matrix__grant .mud-checkbox {
    margin: 0 !important;
    padding: 0 !important;
    justify-content: center;
}

.permission-matrix__grant .mud-checkbox .mud-checkbox-dense {
    margin: 0;
}

.permission-matrix__grant .mud-button-root.mud-icon-button {
    margin: 0 auto;
}

html:has(.crm-app-layout.crm-dark) .permission-matrix__module-head {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.02) 100%);
}

html:has(.crm-app-layout.crm-dark) .permission-matrix__row--granted:not(.permission-matrix__row--head) {
    background: rgba(255, 255, 255, 0.03);
}

.role-editor-page .crm-panel {
    overflow: visible;
}

.role-editor-page .crm-form-grid {
    max-width: 720px;
}

.role-editor-page__field-span {
    grid-column: 1 / -1;
}

.role-editor-page__matrix {
    overflow-x: auto;
    padding: 0.25rem 0.125rem 0.5rem;
}

.role-editor-page__actions {
    margin-top: 1.25rem;
    padding-bottom: 2rem;
}
