:root {
    --crm-bg: #f6f7f9;
    --crm-panel: #ffffff;
    --crm-panel-soft: #f3f4f6;
    --crm-panel-hover: #f9fafb;
    --crm-text: #1d1d1f;
    --crm-muted: #6b7280;
    --crm-line: #e5e7eb;
    --crm-line-strong: #d1d5db;
    --crm-accent: #0070f3;
    --crm-accent-strong: #0060df;
    --crm-accent-light: #f0f7ff;
    --crm-accent-ring: rgba(0, 112, 243, 0.2);
    --crm-warn: #b45309;
    --crm-danger: #b91c1c;
    --crm-radius: 8px;
    --crm-shadow: none;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--crm-bg);
    color: var(--crm-text);
}

button,
input,
select,
textarea {
    font: inherit;
}

.crm-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.crm-shell {
    min-height: 100vh;
}

.crm-header {
    position: sticky;
    top: 0;
    z-index: 1100;
    display: grid;
    grid-template-columns: 1fr minmax(280px, 360px) 1fr;
    gap: 16px;
    align-items: center;
    min-height: 58px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--crm-line);
    background: #fff;
}

.crm-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.crm-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--crm-text);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0;
}

.crm-brand-link img {
    width: auto;
    height: 20px;
    display: block;
}

.crm-tool-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--crm-line);
    border-radius: 8px;
    background: var(--crm-panel-soft);
}

.crm-tool-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 6px;
    color: var(--crm-muted);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.crm-tool-link svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.crm-tool-link.is-active {
    background: var(--crm-panel);
    color: var(--crm-accent);
    box-shadow: none;
}

.crm-search {
    position: relative;
    justify-self: center;
    width: 100%;
    max-width: 360px;
    min-width: 0;
}

.crm-search-mobile-idle,
.crm-search-cancel {
    display: none;
}

.crm-search-field {
    display: contents;
}

.crm-search-control {
    display: flex;
    align-items: center;
    min-width: 0;
    height: 38px;
    min-height: 38px;
    max-height: 38px;
    border: 1px solid var(--crm-line);
    border-radius: 8px;
    background: var(--crm-panel-soft);
    overflow: hidden;
}

.crm-search:focus-within .crm-search-control {
    border-color: var(--crm-accent);
    background: var(--crm-panel);
    box-shadow: 0 0 0 3px var(--crm-accent-ring);
}

.crm-search input {
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 0 14px;
    border: 0;
    outline: 0;
    color: var(--crm-text);
    background: transparent;
}

.crm-search-submit,
.crm-note-form button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    border: 0;
    background: var(--crm-accent);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.crm-search-submit {
    width: 44px;
    min-width: 44px;
    padding: 0;
    border-left: 1px solid var(--crm-line);
    border-radius: 0 7px 7px 0;
}

.crm-search-submit svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.crm-search-submit:hover,
.crm-note-form button:hover {
    background: var(--crm-accent-strong);
}

.crm-search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 1200;
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px;
    border: 1px solid var(--crm-line);
    border-radius: 8px;
    background: var(--crm-panel);
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.14);
}

.crm-search-dropdown[hidden] {
    display: none;
}

.crm-search-result {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 5px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--crm-text);
    text-align: left;
    cursor: pointer;
}

.crm-search-result .crm-customer-avatar {
    width: 38px;
    height: 38px;
    font-size: 13px;
}

.crm-search-result:hover,
.crm-search-result:focus-visible {
    outline: none;
    background: var(--crm-accent-light);
}

.crm-search-result-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 650;
}

.crm-search-result-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.crm-search-result-meta {
    min-width: 0;
    overflow: hidden;
    color: var(--crm-muted);
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-search-heading {
    padding: 7px 10px 5px;
    color: var(--crm-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.crm-search-empty {
    padding: 10px 12px;
    color: var(--crm-muted);
    font-size: 13px;
    font-weight: 650;
}

.crm-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}

.crm-account-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 38px;
    border: 1px solid var(--crm-line);
    border-radius: 8px;
    background: var(--crm-panel);
    color: var(--crm-text);
    cursor: pointer;
}

.crm-account-button .avatar-initials:not(:empty) + svg {
    display: none;
}

.crm-main {
    display: block;
    padding: 16px;
}

.crm-board,
.crm-detail {
    min-width: 0;
    border: 1px solid var(--crm-line);
    border-radius: var(--crm-radius);
    background: var(--crm-panel);
    box-shadow: var(--crm-shadow);
}

.crm-board {
    overflow: hidden;
}

.crm-board-toolbar,
.crm-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--crm-line);
    background: #fafafa;
}

.crm-board-toolbar {
    display: grid;
    grid-template-columns: minmax(104px, 0.55fr) minmax(520px, auto) minmax(128px, 0.55fr);
}

.crm-board-title {
    min-width: 104px;
}

.crm-board-title p {
    max-width: 280px;
}

.crm-board-toolbar h1,
.crm-detail-header h2 {
    margin: 0;
    color: var(--crm-text);
    font-size: 20px;
    line-height: 1.15;
    letter-spacing: 0;
}

.crm-detail-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.crm-detail-avatar {
    flex: 0 0 auto;
}

.crm-detail-title-text {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    min-width: 0;
}

.crm-detail-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.crm-contact-control {
    display: inline-flex;
    min-width: 0;
    min-height: var(--ff-control-min-height);
}

.crm-contact-control[data-crm-contact-control="phone"] {
    flex: 0 1 auto;
}

.crm-contact-control[data-crm-contact-control="email"] {
    flex: 1 1 220px;
    max-width: 340px;
}

.crm-copy-contact {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    min-height: var(--ff-control-min-height);
    padding: 0 10px;
    border: 1px solid var(--crm-line);
    border-radius: 8px 0 0 8px;
    background: #fff;
    color: var(--crm-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
}

.crm-copy-contact [data-crm-contact-label] {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-contact-select {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 var(--ff-control-min-height);
    width: var(--ff-control-min-height);
    min-height: var(--ff-control-min-height);
    border: 1px solid var(--crm-line);
    border-left: 0;
    border-radius: 0 8px 8px 0;
    background: #fff;
    color: var(--crm-muted);
}

.crm-contact-select select {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.crm-contact-select svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.crm-contact-select:hover,
.crm-contact-select:focus-within {
    border-color: var(--crm-line-strong);
    background: var(--crm-panel-hover);
    color: var(--crm-accent);
}

.crm-contact-select:focus-within {
    box-shadow: 0 0 0 4px var(--crm-accent-ring);
}

.crm-copy-contact:hover {
    border-color: var(--crm-line-strong);
    color: var(--crm-accent);
    background: var(--crm-panel-hover);
}

.crm-board-toolbar p,
.crm-generated,
.crm-card-meta,
.crm-muted {
    color: var(--crm-muted);
}

.crm-board-toolbar p {
    margin: 5px 0 0;
    font-size: 13px;
}

.crm-generated {
    min-width: 0;
    text-align: right;
    font-size: 12px;
    line-height: 1.2;
}

.crm-toolbar-actions {
    display: grid;
    align-items: start;
    justify-content: flex-end;
    justify-self: end;
    gap: 4px;
    min-width: 0;
}

.crm-date-filter,
.crm-custom-dates label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--crm-muted);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.crm-date-filter[hidden] {
    display: none;
}

.crm-date-filter select,
.crm-custom-dates input {
    height: 34px;
    border: 1px solid var(--crm-line);
    border-radius: 8px;
    background: #fff;
    color: var(--crm-text);
    font-size: 13px;
    font-weight: 650;
}

.crm-date-filter select {
    min-width: 126px;
    padding: 0 28px 0 9px;
}

.crm-custom-dates {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--crm-line);
    background: #fff;
}

.crm-custom-dates[hidden] {
    display: none;
}

.crm-custom-dates input {
    width: 150px;
    padding: 0 8px;
}

.crm-stage-tabs {
    display: flex;
    gap: 2px;
    justify-content: center;
    justify-self: center;
    min-width: 260px;
    width: 100%;
    max-width: 880px;
    overflow-x: auto;
    padding: 0 2px 2px;
    scrollbar-width: thin;
}

.crm-stage-tabs:empty {
    display: none;
}

.crm-funnel-step {
    --funnel-fill: #ffffff;
    --funnel-border: var(--crm-line);
    --funnel-text: var(--crm-text);
    --funnel-count: #111827;
    --funnel-notch: 16px;
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(76px, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-width: 116px;
    min-height: 40px;
    padding: 6px 21px 6px 18px;
    border: 0;
    background: transparent;
    color: var(--funnel-text);
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
    filter: drop-shadow(0 1px 0 rgba(17, 24, 39, 0.04));
    transition: color 0.14s ease, transform 0.14s ease, filter 0.14s ease;
}

.crm-funnel-step::before,
.crm-funnel-step::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    clip-path: polygon(
        0 0,
        calc(100% - var(--funnel-notch)) 0,
        100% 50%,
        calc(100% - var(--funnel-notch)) 100%,
        0 100%,
        var(--funnel-notch) 50%
    );
}

.crm-funnel-step::before {
    z-index: -2;
    background: var(--funnel-border);
}

.crm-funnel-step::after {
    z-index: -1;
    inset: 1px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(249, 250, 251, 0.72) 100%),
        var(--funnel-fill);
    clip-path: polygon(
        0 0,
        calc(100% - var(--funnel-notch)) 0,
        100% 50%,
        calc(100% - var(--funnel-notch)) 100%,
        0 100%,
        var(--funnel-notch) 50%
    );
}

.crm-funnel-step:first-child {
    padding-left: 16px;
}

.crm-funnel-step:first-child::before,
.crm-funnel-step:first-child::after {
    clip-path: polygon(
        0 0,
        calc(100% - var(--funnel-notch)) 0,
        100% 50%,
        calc(100% - var(--funnel-notch)) 100%,
        0 100%
    );
}

.crm-funnel-step:last-child {
    padding-right: 16px;
}

.crm-funnel-step:last-child::before,
.crm-funnel-step:last-child::after {
    clip-path: polygon(
        0 0,
        100% 0,
        100% 100%,
        0 100%,
        var(--funnel-notch) 50%
    );
}

.crm-funnel-step:hover {
    --funnel-fill: var(--crm-panel-hover);
    --funnel-border: var(--crm-line-strong);
    transform: translateY(-1px);
    filter: drop-shadow(0 5px 12px rgba(15, 23, 42, 0.08));
}

.crm-funnel-step.is-active {
    --funnel-fill: var(--crm-accent-light);
    --funnel-border: var(--crm-accent);
    --funnel-text: var(--crm-accent-strong);
    --funnel-count: var(--crm-accent);
    filter: drop-shadow(0 6px 14px rgba(0, 112, 243, 0.14));
}

.crm-funnel-step.is-active::after {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.86) 0%, rgba(240, 247, 255, 0.96) 100%),
        var(--funnel-fill);
}

.crm-funnel-step:focus-visible {
    outline: 0;
    filter: drop-shadow(0 0 0 var(--crm-accent));
}

.crm-funnel-step:focus-visible::before {
    background: var(--crm-accent);
}

.crm-funnel-step:focus-visible::after {
    inset: 3px;
}

.crm-funnel-label {
    position: relative;
    z-index: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.crm-funnel-count {
    position: relative;
    z-index: 1;
    justify-self: end;
    min-width: 24px;
    color: var(--funnel-count);
    font-size: 18px;
    font-weight: 850;
    line-height: 1;
}

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

.crm-kanban {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    min-width: 0;
    padding: 8px;
}

.crm-kanban-column {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--crm-line);
    border-radius: var(--crm-radius);
    background: var(--crm-panel-soft);
}

.crm-kanban-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    padding: 0 10px;
    border-bottom: 1px solid var(--crm-line);
    background: var(--crm-panel);
}

.crm-kanban-header h2 {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: var(--crm-text);
    font-size: 14px;
    font-weight: 850;
}

.crm-kanban-stage-icon {
    display: inline-block;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    background: var(--crm-accent);
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: contain;
}

.crm-kanban-stage-icon.is-engaged {
    mask-image: url('/graphics/crm/drivecentric-engaged.svg');
}

.crm-kanban-stage-icon.is-visit {
    mask-image: url('/graphics/crm/drivecentric-visit.svg');
}

.crm-kanban-stage-icon.is-proposal {
    mask-image: url('/graphics/crm/drivecentric-proposal.svg');
}

.crm-kanban-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--crm-accent-light);
    color: var(--crm-accent-strong);
    font-size: 12px;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
}

.crm-kanban-cards {
    display: grid;
    align-content: start;
    gap: 4px;
    padding: 6px;
    overflow: visible;
}

.crm-kanban-card.crm-action-row {
    grid-template-columns: 32px minmax(0, 1fr);
    min-height: 48px;
    gap: 8px;
    padding: 4px 8px;
    border: 1px solid var(--crm-line);
    border-radius: var(--crm-radius);
    background: var(--crm-panel);
}

.crm-kanban-card.crm-action-row .crm-customer-avatar {
    width: 32px;
    height: 32px;
    font-size: 11px;
}

.crm-kanban-card.crm-action-row .crm-action-main {
    gap: 1px;
}

.crm-kanban-card.crm-action-row .crm-action-main strong {
    overflow: hidden;
    font-size: 13px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-kanban-card.crm-action-row .crm-action-vehicle {
    font-size: 11px;
    line-height: 1.2;
}

.crm-kanban-card.crm-action-row:hover,
.crm-kanban-card.crm-action-row.is-selected {
    border-color: var(--crm-line-strong);
    background: var(--crm-panel-hover);
}

.crm-kanban-card.crm-action-row.is-selected {
    box-shadow: inset 4px 0 0 var(--crm-accent);
}

.crm-kanban-empty {
    margin: 0;
    padding: 20px 12px;
    color: var(--crm-muted);
    font-size: 13px;
    text-align: center;
}

.crm-today-overview {
    display: grid;
    grid-template-columns: minmax(190px, 0.8fr) minmax(220px, 1fr) auto auto;
    align-items: center;
    gap: 20px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--crm-line);
    background: linear-gradient(90deg, #f8fbff, #fff);
}

.crm-progress {
    display: grid;
    gap: 7px;
    min-width: 220px;
}

.crm-home-progress {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--crm-line);
    background: var(--crm-panel);
}

.crm-home-progress-value {
    justify-self: end;
    color: var(--crm-text);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    font-weight: 850;
}

.crm-progress-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
}

.crm-progress-label strong {
    color: var(--crm-text);
    font-weight: 850;
}

.crm-progress-label span {
    color: var(--crm-muted);
    font-weight: 700;
}

.crm-progress-track {
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: #dbe4ee;
}

.crm-progress-track > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0070f3, #08b892);
    transition: width 0.35s ease-out;
}

.crm-progress.is-compact {
    min-width: 0;
    padding-top: 4px;
}

.crm-today-overview[hidden] {
    display: none;
}

.crm-notifications {
    padding: 10px 16px;
    border-bottom: 1px solid var(--crm-line);
    background: #fff;
}

.crm-notifications-load,
.crm-notification-card button,
.crm-task-workflows button {
    min-height: 44px;
    padding: 7px 12px;
    border: 1px solid #b9c8d8;
    border-radius: 8px;
    background: #fff;
    color: var(--crm-accent-strong);
    font: inherit;
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
}

.crm-notification-status {
    padding: 10px 0 2px;
    color: var(--crm-muted);
    font-size: 13px;
}

.crm-notification-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid var(--crm-line);
}

.crm-notification-card div,
.crm-notification-card p {
    display: grid;
    gap: 3px;
    margin: 0;
}

.crm-notification-card span,
.crm-notification-card p {
    color: var(--crm-muted);
    font-size: 12px;
}

.crm-task-workflows {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.crm-task-workflows[hidden] {
    display: none;
}

.crm-task-workflows.is-summary {
    margin-top: 2px;
    padding-top: 10px;
    border-top: 1px solid var(--crm-line);
}

.crm-task-workflow-label {
    color: var(--crm-muted);
    font-size: 12px;
    font-weight: 800;
}

.crm-reschedule-date input {
    min-height: 44px;
    padding: 7px 10px;
    border: 1px solid var(--crm-line-strong);
    border-radius: 8px;
    background: var(--crm-panel);
    color: var(--crm-text);
}

.crm-task-workflows button.is-primary {
    border-color: var(--crm-accent);
    background: var(--crm-accent);
    color: #fff;
}

@media (max-width: 640px) {
    .crm-notification-card {
        grid-template-columns: 1fr;
    }

    .crm-notification-card button,
    .crm-notifications-load {
        width: 100%;
    }
}

.crm-today-copy {
    display: grid;
    gap: 3px;
}

.crm-today-copy strong {
    font-size: 16px;
}

.crm-today-copy span {
    color: var(--crm-muted);
    font-size: 12px;
}

.crm-today-stats {
    display: flex;
    align-items: center;
    gap: 8px;
}

.crm-today-stats > span {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    min-height: 30px;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--crm-panel-soft);
    color: var(--crm-muted);
    font-size: 12px;
    font-weight: 750;
}

.crm-today-stats .is-urgent { background: #fef2f2; color: #b91c1c; }
.crm-today-stats .is-ready { background: #eff6ff; color: #1d4ed8; }
.crm-today-stats .is-blocked { background: #fff7ed; color: #9a3412; }

.crm-start-next {
    min-height: 38px;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    background: var(--crm-accent);
    color: #fff;
    font-size: 13px;
    font-weight: 850;
    cursor: pointer;
}

.crm-start-next:hover,
.crm-start-next:focus-visible {
    outline: none;
    background: var(--crm-accent-strong);
    box-shadow: 0 0 0 4px var(--crm-accent-ring);
}

.crm-start-next:disabled {
    cursor: default;
    opacity: 0.45;
}

.crm-action-queue {
    display: grid;
}

.crm-action-row {
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 74px;
    padding: 12px 16px;
    border: 0;
    border-bottom: 1px solid var(--crm-line);
    background: #fff;
    color: var(--crm-text);
    text-align: left;
    cursor: pointer;
}

.crm-action-row:hover,
.crm-action-row.is-selected {
    background: var(--crm-panel-hover);
}

.crm-action-row:focus-visible {
    z-index: 1;
    outline: 3px solid var(--crm-accent-ring);
    outline-offset: -3px;
}

.crm-action-main {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.crm-action-main strong {
    font-size: 16px;
}

.crm-priority-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 800;
}

.crm-priority-badge.is-urgent { background: #fef2f2; color: #b91c1c; }
.crm-priority-badge.is-blocked { background: #fff7ed; color: #9a3412; }

.crm-action-vehicle {
    overflow: hidden;
    color: var(--crm-muted);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-action-vehicle {
    color: #4b5563;
    font-weight: 700;
}

.crm-next-item {
    min-height: 30px;
    margin-left: auto;
    padding: 0 9px;
    border: 1px solid var(--crm-line-strong);
    border-radius: 8px;
    background: #fff;
    color: var(--crm-muted);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.crm-manager-review-open {
    min-height: 44px;
    padding: 0 9px;
    border: 1px solid var(--crm-line-strong);
    border-radius: 8px;
    background: var(--crm-panel);
    color: var(--crm-accent-strong);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.crm-next-item svg {
    display: none;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.crm-manager-review {
    border: 1px solid var(--crm-line);
    border-radius: 10px;
    background: var(--crm-panel);
}

.crm-manager-review[hidden] {
    display: none;
}

.crm-manager-review > summary {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 14px;
    color: var(--crm-text);
    font-size: 13px;
    font-weight: 850;
    cursor: pointer;
}

.crm-manager-review > summary::marker {
    color: var(--crm-accent);
}

.crm-manager-review-body {
    display: grid;
    gap: 12px;
    padding: 0 14px 14px;
    border-top: 1px solid var(--crm-line);
}

.crm-manager-review-body > p {
    margin: 12px 0 0;
    color: var(--crm-muted);
    font-size: 13px;
    line-height: 1.4;
}

.crm-manager-field {
    display: grid;
    gap: 6px;
    color: var(--crm-text);
    font-size: 12px;
    font-weight: 800;
}

.crm-manager-field small {
    color: var(--crm-muted);
    font-weight: 650;
}

.crm-manager-field select,
.crm-manager-field textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--crm-line-strong);
    border-radius: 8px;
    background: var(--crm-panel);
    color: var(--crm-text);
    font: inherit;
    font-weight: 600;
}

.crm-manager-field textarea {
    min-height: 72px;
    resize: vertical;
}

.crm-manager-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.crm-manager-reasons legend {
    width: 100%;
    margin-bottom: 6px;
    padding: 0;
    color: var(--crm-text);
    font-size: 12px;
    font-weight: 800;
}

.crm-manager-reasons button,
.crm-manager-actions button {
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--crm-line-strong);
    border-radius: 8px;
    background: var(--crm-panel);
    color: var(--crm-text);
    font: inherit;
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
}

.crm-manager-reasons button[aria-pressed="true"] {
    border-color: var(--crm-accent);
    background: var(--crm-accent-light);
    color: var(--crm-accent-strong);
}

.crm-manager-note-preview {
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--crm-accent-light);
    color: var(--crm-text);
    font-size: 13px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.crm-manager-note-preview::first-letter {
    color: var(--crm-accent-strong);
}

.crm-manager-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.crm-manager-actions button {
    border-color: var(--crm-accent);
    background: var(--crm-accent);
    color: #fff;
}

.crm-manager-actions button:disabled {
    border-color: var(--crm-line-strong);
    background: var(--crm-panel-soft);
    color: var(--crm-muted);
    cursor: default;
}

.crm-manager-actions span {
    color: var(--crm-muted);
    font-size: 12px;
    font-weight: 700;
}

.crm-next-item:hover,
.crm-next-item:focus-visible {
    outline: none;
    border-color: var(--crm-accent);
    color: var(--crm-accent);
    box-shadow: 0 0 0 3px var(--crm-accent-ring);
}

.crm-table {
    min-width: 860px;
}

.crm-table-header,
.crm-table-row {
    display: grid;
    grid-template-columns: minmax(260px, 1.25fr) minmax(260px, 1.2fr) minmax(190px, 0.8fr) minmax(170px, 0.75fr);
    align-items: center;
    column-gap: 18px;
}

.crm-table-header {
    position: sticky;
    top: 0;
    z-index: 2;
    min-height: 42px;
    padding: 0 16px;
    border-bottom: 1px solid var(--crm-line);
    background: #fff;
    color: var(--crm-muted);
    font-size: 12px;
    font-weight: 700;
}

.crm-table-row {
    width: 100%;
    min-height: 64px;
    padding: 10px 16px;
    border: 0;
    border-bottom: 1px solid var(--crm-line);
    background: #fff;
    color: var(--crm-text);
    text-align: left;
    cursor: pointer;
}

.crm-table-row:hover,
.crm-table-row.is-selected {
    background: var(--crm-panel-hover);
}

.crm-table-row.is-selected {
    box-shadow: inset 4px 0 0 var(--crm-accent);
}

.crm-table-cell {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.crm-table-customer {
    display: flex;
    align-items: center;
    gap: 12px;
}

.crm-table-info {
    color: var(--crm-text);
    font-weight: 500;
}

.crm-table-count {
    text-align: right;
}

.crm-card {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: 0;
    border-bottom: 1px solid var(--crm-line);
    background: #fff;
    color: var(--crm-text);
    text-align: left;
    cursor: pointer;
}

.crm-customer-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: var(--crm-avatar-bg, var(--crm-accent));
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.crm-card-main {
    min-width: 0;
}

.crm-card:hover,
.crm-card.is-selected {
    background: var(--crm-panel-hover);
}

.crm-card.is-selected {
    box-shadow: inset 4px 0 0 var(--crm-accent);
}

.crm-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-weight: 650;
}

.crm-card-title span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-card-task-side {
    display: grid;
    justify-items: end;
    gap: 6px;
}

.crm-task-count {
    display: inline-flex;
    gap: 3px;
    align-items: center;
    color: var(--crm-muted);
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.crm-workplan-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--crm-muted);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.crm-badge,
.crm-stage-pill {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--crm-panel-soft);
    color: var(--crm-muted);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.crm-stage-pill {
    background: #dff3ef;
    color: var(--crm-accent-strong);
}

.crm-card-meta {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.35;
}

.crm-card-next {
    align-self: start;
    max-width: 130px;
    color: var(--crm-warn);
    font-size: 12px;
    font-weight: 850;
    text-align: right;
}

.crm-detail-empty {
    padding: 32px;
    color: var(--crm-muted);
}

.crm-modal[hidden] {
    display: none;
}

.crm-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 20px;
}

.crm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.42);
    opacity: 0;
    transition: opacity 0.16s ease-out;
}

.crm-modal-card {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(1440px, calc(100vw - 28px));
    height: min(820px, calc(100vh - 28px));
    overflow: hidden;
    border: 1px solid var(--crm-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 22px 70px rgba(15, 23, 42, 0.22);
    opacity: 0;
    transform: translateY(18px) scale(0.98) rotateX(2deg);
    transform-origin: 50% 40%;
    transition: opacity 0.16s ease-out, transform 0.16s ease-out;
}

.crm-modal-bar {
    display: contents;
}

.crm-modal-bar > strong,
.crm-modal-bar > span,
.crm-modal-close-back {
    display: none;
}

.crm-modal.is-open .crm-modal-backdrop {
    opacity: 1;
}

.crm-modal.is-open .crm-modal-card {
    opacity: 1;
    transform: translateY(0) scale(1) rotateX(0);
}

.crm-modal-open {
    overflow: hidden;
}

.crm-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 0;
    border: 1px solid var(--crm-line);
    border-radius: 8px;
    background: #fff;
    color: var(--crm-muted);
    cursor: pointer;
}

.crm-modal-close:hover {
    border-color: var(--crm-line-strong);
    color: var(--crm-text);
}

.crm-modal-close svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
}

.crm-modal .crm-detail {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.crm-modal .crm-detail-header {
    flex: 0 0 auto;
    padding-right: 58px;
}

.crm-detail-empty h2 {
    margin: 0 0 8px;
    color: var(--crm-text);
}

.crm-detail-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 18px;
}

.crm-detail-main {
    min-width: 0;
}

.crm-activity-rail {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    padding: 18px;
    border-bottom: 1px solid var(--crm-line);
    background: var(--crm-panel-hover);
}

.crm-activity-toolbar {
    display: grid;
    gap: 12px;
    flex: 0 0 auto;
    margin-bottom: 14px;
}

.crm-activity-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.crm-activity-title h3 {
    margin: 0;
    color: var(--crm-text);
    font-size: 16px;
}

.crm-activity-title span {
    color: var(--crm-muted);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.crm-activity-filter {
    display: grid;
    gap: 6px;
    color: var(--crm-muted);
    font-size: 12px;
    font-weight: 800;
}

.crm-activity-filter select {
    width: 100%;
    min-height: var(--ff-control-min-height);
    padding: 0 34px 0 10px;
    border: 1px solid var(--crm-line-strong);
    border-radius: 8px;
    background: var(--crm-panel);
    color: var(--crm-text);
    cursor: pointer;
}

.crm-activity-filter select:focus-visible {
    outline: 2px solid var(--crm-accent);
    outline-offset: 2px;
}

.crm-activity-rail > .crm-activity-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.crm-activity-filter-empty {
    padding: 20px 8px;
    text-align: center;
}

.crm-vehicle-rail {
    display: grid;
    align-content: start;
    gap: 14px;
    min-width: 0;
    padding: 18px;
    border-top: 1px solid var(--crm-line);
    background: var(--crm-panel-hover);
}

.crm-vehicle-add {
    position: relative;
    z-index: 4;
    display: grid;
    gap: 7px;
    padding-bottom: 2px;
}

.crm-vehicle-add > label {
    color: var(--crm-text);
    font-size: 13px;
    font-weight: 850;
}

.crm-vehicle-search-control {
    position: relative;
}

.crm-vehicle-search-control > svg {
    position: absolute;
    top: 50%;
    left: 12px;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--crm-muted);
    stroke-width: 2;
    transform: translateY(-50%);
    pointer-events: none;
}

.crm-vehicle-search-control input {
    width: 100%;
    min-height: 44px;
    padding: 0 12px 0 38px;
    border: 1px solid var(--crm-line-strong);
    border-radius: 10px;
    background: var(--crm-panel);
    color: var(--crm-text);
    font: inherit;
}

.crm-vehicle-search-control input:focus {
    border-color: var(--crm-accent);
    outline: 2px solid color-mix(in srgb, var(--crm-accent) 24%, transparent);
    outline-offset: 1px;
}

.crm-vehicle-search-results {
    position: absolute;
    top: calc(100% - 1px);
    right: 0;
    left: 0;
    z-index: 8;
    max-height: min(410px, 52vh);
    overflow: auto;
    border: 1px solid var(--crm-line-strong);
    border-radius: 11px;
    background: var(--crm-panel);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.2);
}

.crm-vehicle-search-result {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) 24px;
    gap: 10px;
    align-items: center;
    width: 100%;
    min-height: 64px;
    padding: 8px;
    border: 0;
    border-bottom: 1px solid var(--crm-line);
    background: transparent;
    color: var(--crm-text);
    text-align: left;
    cursor: pointer;
}

.crm-vehicle-search-result:last-child {
    border-bottom: 0;
}

.crm-vehicle-search-result:hover,
.crm-vehicle-search-result:focus-visible {
    background: var(--crm-panel-hover);
    outline: none;
}

.crm-vehicle-search-photo {
    display: grid;
    place-items: center;
    width: 58px;
    height: 44px;
    overflow: hidden;
    border-radius: 7px;
    background: var(--crm-panel-hover);
}

.crm-vehicle-search-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.crm-vehicle-search-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.crm-vehicle-search-copy strong,
.crm-vehicle-search-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-vehicle-search-copy strong {
    font-size: 12px;
}

.crm-vehicle-search-copy span {
    color: var(--crm-muted);
    font-size: 11px;
}

.crm-vehicle-search-add {
    color: var(--crm-accent);
    font-size: 24px;
    font-weight: 500;
    text-align: center;
}

.crm-vehicle-search-empty {
    padding: 16px 12px;
    color: var(--crm-muted);
    font-size: 12px;
    text-align: center;
}

.crm-vehicle-action-status {
    min-height: 16px;
    color: var(--crm-muted);
    font-size: 11px;
    font-weight: 750;
}

.crm-vehicle-action-status.is-success {
    color: #16803c;
}

.crm-vehicle-action-status.is-error {
    color: #b42318;
}

.crm-deal-vehicle {
    position: relative;
    min-width: 0;
}

.crm-deal-vehicle ff-inventory-card {
    display: block;
}

.crm-vehicle-remove {
    position: absolute;
    top: 9px;
    right: 9px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 32px;
    padding: 0 9px;
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 999px;
    background: rgba(27, 31, 38, 0.82);
    color: #fff;
    font-size: 11px;
    font-weight: 850;
    backdrop-filter: blur(8px);
    cursor: pointer;
}

.crm-vehicle-remove > span:first-child {
    font-size: 18px;
    font-weight: 500;
    line-height: 1;
}

.crm-vehicle-remove:hover,
.crm-vehicle-remove:focus-visible {
    border-color: #fecaca;
    background: #b42318;
    outline: none;
}

.crm-vehicle-remove:disabled {
    opacity: 0.62;
    cursor: wait;
}

.crm-vehicle-empty {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 28px 16px;
    border: 1px dashed var(--crm-line-strong);
    border-radius: 12px;
    color: var(--crm-muted);
    text-align: center;
}

.crm-vehicle-empty strong {
    color: var(--crm-text);
}

.crm-vehicle-empty > span:last-child {
    max-width: 260px;
    font-size: 12px;
    line-height: 1.45;
}

@media (min-width: 900px) {
    .crm-detail-body {
        display: grid;
        grid-template-columns: minmax(240px, 300px) minmax(300px, 1fr) minmax(260px, 320px);
        overflow: hidden;
        padding: 0;
    }

    .crm-detail-main,
    .crm-activity-rail,
    .crm-vehicle-rail {
        min-height: 0;
        overscroll-behavior: contain;
    }

    .crm-detail-main {
        overflow: auto;
        padding: 18px;
    }

    .crm-activity-rail {
        border-right: 1px solid var(--crm-line);
        border-bottom: 0;
    }

    .crm-vehicle-rail {
        overflow: auto;
        border-top: 0;
        border-left: 1px solid var(--crm-line);
    }
}

@media (max-width: 899px) {
    .crm-detail-body {
        display: grid;
        grid-template-areas:
            "main"
            "activity"
            "vehicle";
        align-content: start;
        gap: 16px;
    }

    .crm-detail-main {
        grid-area: main;
    }

    .crm-activity-rail {
        grid-area: activity;
        max-height: min(620px, 68vh);
        margin: 0 -18px;
        border-top: 1px solid var(--crm-line);
    }

    .crm-vehicle-rail {
        grid-area: vehicle;
        margin: 0 -18px -18px;
    }
}

.crm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.crm-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--crm-line);
    border-radius: 8px;
    color: var(--crm-text);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.crm-action-link:hover {
    border-color: var(--crm-line-strong);
    background: var(--crm-panel-hover);
    color: var(--crm-accent);
}

.crm-section {
    padding: 16px 0;
    border-bottom: 1px solid var(--crm-line);
}

.crm-section:last-child {
    border-bottom: 0;
}

.crm-section h3 {
    margin: 0 0 10px;
    font-size: 12px;
    letter-spacing: 0;
    text-transform: uppercase;
    color: var(--crm-muted);
}

.crm-customer-summary {
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--crm-line);
    border-left: 4px solid var(--crm-accent);
    border-radius: 8px;
    background: var(--crm-accent-light);
    color: var(--crm-text);
    font-size: 15px;
    font-weight: 650;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.crm-detail.is-refreshed .crm-customer-summary {
    animation: crm-detail-refreshed 1.2s ease-out;
}

@keyframes crm-detail-refreshed {
    0% {
        border-color: var(--crm-accent);
        box-shadow: 0 0 0 3px var(--crm-accent-ring);
    }
    100% {
        border-color: var(--crm-line);
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
    }
}

@keyframes crm-status-soft-pop {
    0% {
        transform: translateY(2px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.crm-comm-panel {
    display: grid;
    gap: 10px;
}

.crm-comm-action-bar {
    overflow: hidden;
    border: 1px solid var(--crm-line);
    border-radius: 8px;
    background: var(--crm-panel-soft);
}

.crm-comm-action-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.crm-comm-channel-action {
    --crm-channel-color: var(--crm-line-strong);
    --crm-channel-text: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 44px;
    min-height: var(--ff-control-min-height);
    padding: 0 10px;
    border: 1px solid var(--crm-channel-color);
    border-radius: 8px;
    background: var(--crm-channel-color);
    color: var(--crm-channel-text);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    position: relative;
}

.crm-comm-action-picker {
    position: relative;
    display: inline-flex;
    align-items: stretch;
}

.crm-comm-action-picker > .crm-comm-primary-action {
    width: var(--ff-control-min-height);
    padding: 0;
    border-radius: 8px 0 0 8px;
}

.crm-comm-action-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--ff-control-min-height);
    min-height: var(--ff-control-min-height);
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--ff-color-activity-text, #4182d7) 82%, #000);
    border-left: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 0 8px 8px 0;
    background: var(--ff-color-activity-text, #4182d7);
    color: #fff;
    cursor: pointer;
}

.crm-comm-action-menu-toggle svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    transition: transform 0.14s ease;
}

.crm-comm-action-menu-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.crm-comm-action-menu-toggle:hover,
.crm-comm-action-menu-toggle:focus-visible {
    background: color-mix(in srgb, var(--ff-color-activity-text, #4182d7) 86%, #000);
    outline: none;
}

.crm-comm-action-menu-toggle:focus-visible {
    box-shadow: 0 0 0 4px var(--crm-accent-ring);
}

.crm-comm-action-menu-toggle:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.crm-comm-action-menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 7px);
    z-index: 12;
    display: grid;
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--crm-line);
    border-radius: 12px;
    background: var(--crm-panel);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
}

.crm-comm-action-menu[hidden] {
    display: none;
}

.crm-comm-action-menu.is-below {
    top: calc(100% + 7px);
    bottom: auto;
}

.crm-comm-action-menu .crm-comm-channel-action {
    width: var(--ff-control-min-height);
    padding: 0;
}

.crm-comm-channel-text {
    --crm-channel-color: var(--ff-color-activity-text, #4182d7);
}

.crm-comm-channel-email {
    --crm-channel-color: var(--ff-color-activity-email, #19b4ff);
    --crm-channel-text: #063b4f;
}

.crm-comm-channel-call {
    --crm-channel-color: var(--ff-color-activity-call, #2ecc71);
    --crm-channel-text: #073b20;
}

.crm-comm-channel-video {
    --crm-channel-color: #8b5cf6;
}

.crm-comm-channel-action svg,
.crm-video-upload-button svg {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.crm-comm-channel-action span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-comm-channel-action:hover,
.crm-comm-channel-action:focus-visible {
    border-color: color-mix(in srgb, var(--crm-channel-color) 82%, #000);
    background: color-mix(in srgb, var(--crm-channel-color) 86%, #000);
    color: var(--crm-channel-text);
    outline: none;
}

.crm-comm-quick-action.is-ready {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--crm-channel-color) 25%, transparent);
}

.crm-comm-task-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: rgba(11, 99, 206, 0.12);
    color: var(--crm-accent);
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
}

.crm-comm-channel-action .crm-comm-task-badge {
    background: color-mix(in srgb, var(--crm-channel-text) 18%, transparent);
    color: var(--crm-channel-text);
}

.crm-comm-channel-action:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.crm-comm-body {
    display: grid;
    gap: 9px;
}

.crm-comm-compose {
    min-width: 0;
    overflow: visible;
}

.crm-comm-messagebar {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    min-width: 0;
    padding: 3px;
    border: 1px solid var(--crm-line);
    border-radius: var(--crm-radius);
    background: #fff;
}

.crm-comm-messagebar:focus-within {
    border-color: var(--crm-accent);
    box-shadow: 0 0 0 3px var(--crm-accent-ring);
}

.crm-comm-message[hidden],
.crm-comm-subject[hidden],
.crm-comm-video-url[hidden] {
    display: none;
}

.crm-comm-message,
.crm-comm-subject,
.crm-comm-video-url {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--crm-line);
    border-radius: 8px;
    background: #fff;
    color: var(--crm-text);
    outline: 0;
}

.crm-comm-message {
    min-height: 86px;
    max-height: 220px;
    padding: 10px 11px;
    line-height: 1.4;
    resize: vertical;
}

.crm-comm-compose .crm-comm-message,
.crm-comm-compose .crm-comm-subject,
.crm-comm-compose .crm-comm-video-url {
    border: 0;
    border-radius: 0;
    background: transparent;
}

.crm-comm-subject,
.crm-comm-video-url {
    height: 38px;
    padding: 0 11px;
}

.crm-comm-message:focus,
.crm-comm-subject:focus,
.crm-comm-video-url:focus {
    border-color: var(--crm-accent);
    box-shadow: 0 0 0 3px var(--crm-accent-ring);
}

.crm-comm-compose .crm-comm-message:focus,
.crm-comm-compose .crm-comm-subject:focus,
.crm-comm-compose .crm-comm-video-url:focus {
    border-color: transparent;
    box-shadow: none;
}

.crm-video-upload {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 22px;
    border: 1px dashed var(--crm-line-strong);
    border-radius: 10px;
    background: var(--crm-panel-soft);
    text-align: center;
}

.crm-comm-compose .crm-video-upload {
    border: 0;
    border-radius: 0;
}

.crm-video-upload[hidden] {
    display: none;
}

.crm-video-upload-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: 9px;
    background: var(--crm-accent);
    color: #fff;
    font-size: 14px;
    font-weight: 850;
    cursor: pointer;
}

.crm-video-upload-button:hover,
.crm-video-upload-button:focus-visible {
    outline: none;
    background: var(--crm-accent-strong);
    box-shadow: 0 0 0 4px var(--crm-accent-ring);
}

.crm-video-upload-button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.crm-video-upload-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.crm-video-file-name {
    max-width: 100%;
    overflow: hidden;
    color: var(--crm-muted);
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-video-file-name.is-ready {
    color: #047857;
}

.crm-comm-status {
    min-width: 0;
    color: var(--crm-muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.crm-comm-status:empty {
    display: none;
}

.crm-comm-status a {
    color: var(--crm-accent);
    font-weight: 850;
    text-decoration: none;
}

.crm-comm-status a:hover {
    text-decoration: underline;
}

/* Customer conversation: one chronological thread with a composer anchored below it. */
.crm-detail-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 0;
}

.crm-conversation {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.crm-conversation-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex: 0 0 auto;
    padding: 4px 20px 10px;
}

.crm-conversation-header h3 {
    margin: 0;
    color: var(--crm-text);
    font-size: 14px;
    text-transform: none;
}

.crm-conversation-header span {
    color: var(--crm-muted);
    font-size: 11px;
    font-weight: 800;
}

.crm-conversation-list {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 9px;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 18px 16px;
    scrollbar-gutter: stable;
}

.crm-thread-item {
    --crm-thread-accent: var(--crm-line-strong);
    --crm-thread-accent-text: #fff;
    display: flex;
    width: 100%;
}

.crm-thread-kind-text {
    --crm-thread-accent: var(--ff-color-activity-text, #4182d7);
}

.crm-thread-kind-email {
    --crm-thread-accent: var(--ff-color-activity-email, #19b4ff);
    --crm-thread-accent-text: #063b4f;
}

.crm-thread-kind-call {
    --crm-thread-accent: var(--ff-color-activity-call, #2ecc71);
    --crm-thread-accent-text: #073b20;
}

.crm-thread-kind-video {
    --crm-thread-accent: #8b5cf6;
}

.crm-thread-item.is-inbound {
    justify-content: flex-start;
    padding-right: 12%;
}

.crm-thread-item.is-outbound {
    justify-content: flex-end;
    padding-left: 12%;
}

.crm-thread-item.is-system {
    justify-content: center;
    padding: 0 8%;
}

.crm-thread-bubble {
    position: relative;
    min-width: 96px;
    max-width: 82%;
    padding: 9px 12px 7px;
    border: 1px solid color-mix(in srgb, var(--crm-thread-accent) 44%, var(--crm-line));
    border-radius: 17px 17px 17px 5px;
    background: color-mix(in srgb, var(--crm-thread-accent) 12%, var(--crm-panel));
    color: var(--crm-text);
    box-shadow: 0 1px 1px rgba(15, 23, 42, 0.04);
}

.crm-thread-item.is-outbound .crm-thread-bubble {
    border-color: var(--crm-thread-accent);
    border-radius: 17px 17px 5px 17px;
    background: var(--crm-thread-accent);
    color: var(--crm-thread-accent-text);
}

.crm-thread-bubble .crm-activity-text {
    color: inherit;
    font-size: 14px;
    line-height: 1.4;
}

.crm-thread-bubble .crm-activity-email-body {
    max-height: 210px;
    overflow: auto;
}

.crm-thread-meta {
    margin-top: 5px;
    color: var(--crm-muted);
    font-size: 10px;
    font-weight: 750;
    line-height: 1.25;
}

.crm-thread-item.is-outbound .crm-thread-meta {
    color: rgba(255, 255, 255, 0.78);
    text-align: right;
}

.crm-conversation-empty {
    display: grid;
    flex: 1 1 auto;
    place-items: center;
    min-height: 120px;
    text-align: center;
}

.crm-comm-panel {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: block;
    flex: 0 0 auto;
    gap: 0;
    padding: 10px 14px 12px;
    border-top: 1px solid var(--crm-line);
    background: color-mix(in srgb, var(--crm-panel) 94%, transparent);
    box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.07);
    backdrop-filter: blur(12px);
}

.crm-comm-body {
    gap: 0;
}

.crm-comm-message {
    flex: 1 1 auto;
    height: 44px;
    min-height: 44px;
    max-height: 150px;
    padding: 11px 6px 11px 12px;
    overflow-y: hidden;
    line-height: 22px;
    resize: none;
}

.crm-comm-messagebar > .crm-comm-action-row {
    flex: 0 0 auto;
    flex-wrap: nowrap;
}

.crm-comm-compose > .crm-comm-status:not(:empty) {
    padding: 0 10px 8px;
}

.crm-kv {
    display: grid;
    grid-template-columns: minmax(120px, 0.35fr) 1fr;
    gap: 8px 14px;
    font-size: 14px;
}

.crm-kv dt {
    color: var(--crm-muted);
}

.crm-kv dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 600;
}

.crm-activity-list {
    display: grid;
    gap: 12px;
}

.crm-activity-item {
    --crm-activity-accent: var(--ff-color-activity-timeline, #969696);
    --crm-activity-border: color-mix(in srgb, var(--crm-activity-accent) 42%, var(--crm-line));
    --crm-activity-surface: color-mix(in srgb, var(--crm-activity-accent) 13%, var(--crm-panel));
    --crm-activity-label-text: #fff;
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid var(--crm-activity-border);
    border-radius: 8px;
    background: var(--crm-activity-surface);
}

.crm-activity-item[hidden] {
    display: none;
}

.crm-activity-text,
.crm-activity-meta {
    min-width: 0;
    overflow-wrap: anywhere;
}

.crm-activity-head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.crm-activity-kind {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--crm-activity-accent);
    color: var(--crm-activity-label-text);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.crm-activity-meta {
    color: var(--crm-muted);
    font-size: 12px;
    font-weight: 600;
}

.crm-activity-text {
    color: var(--crm-text);
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.crm-activity-text:empty {
    display: none;
}

.crm-activity-email-body {
    max-height: 220px;
    padding-right: 6px;
    overflow: auto;
    scrollbar-gutter: stable;
}

.crm-activity-kind-text {
    --crm-activity-accent: var(--ff-color-activity-text, #4182d7);
}

.crm-activity-kind-email {
    --crm-activity-accent: var(--ff-color-activity-email, #19b4ff);
    --crm-activity-label-text: #063b4f;
}

.crm-activity-kind-call {
    --crm-activity-accent: var(--ff-color-activity-call, #2ecc71);
    --crm-activity-label-text: #073b20;
}

.crm-activity-kind-note {
    --crm-activity-accent: var(--ff-color-activity-note, #f5cd19);
    --crm-activity-surface: var(--crm-activity-note-card-surface, var(--ff-color-activity-note-card, #fff5d7));
    --crm-activity-label-text: #493d00;
}

.crm-activity-kind-task {
    --crm-activity-accent: var(--ff-color-activity-task, #969696);
}

.crm-activity-kind-appointment {
    --crm-activity-accent: var(--ff-color-activity-appointment, #50326e);
}

.crm-activity-kind-deal {
    --crm-activity-accent: var(--ff-color-activity-deal, #969696);
}

.crm-activity-kind-service {
    --crm-activity-accent: var(--ff-color-activity-service, #2c3e50);
}

.crm-note-form {
    display: grid;
    gap: 10px;
}

.crm-note-form textarea {
    min-height: 96px;
    padding: 10px;
    border: 1px solid var(--crm-line);
    border-radius: 8px;
    resize: vertical;
}

.crm-note-form button {
    justify-self: start;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 8px;
}

.crm-notes {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.crm-note {
    padding: 10px;
    border: 1px solid var(--crm-line);
    border-radius: 8px;
    background: #fbfcfd;
}

.crm-note-time {
    margin-bottom: 4px;
    color: var(--crm-muted);
    font-size: 12px;
    font-weight: 750;
}

.crm-error,
.crm-empty {
    padding: 18px;
    color: var(--crm-muted);
}

.crm-error {
    color: var(--crm-danger);
}

.crm-detail-loading {
    display: grid;
    gap: 10px;
}

.crm-skeleton-line {
    display: block;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--crm-panel-soft), var(--crm-line), var(--crm-panel-soft));
    background-size: 200% 100%;
    animation: crm-skeleton 1.1s ease-in-out infinite;
}

.crm-skeleton-line.is-short {
    width: 48%;
}

.crm-skeleton-line.is-medium {
    width: 72%;
}

@keyframes crm-skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (max-width: 980px) {
    .crm-header {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .crm-search {
        justify-self: stretch;
        max-width: none;
    }

    .crm-brand,
    .crm-header-actions {
        justify-content: space-between;
    }

    .crm-board-toolbar {
        grid-template-columns: minmax(104px, auto) 1fr;
    }

    .crm-toolbar-actions {
        justify-self: end;
    }

    .crm-main {
        padding: 12px;
    }

    .crm-today-overview {
        grid-template-columns: 1fr auto;
    }

    .crm-today-overview > .crm-progress {
        grid-column: 1;
        grid-row: 2;
    }

    .crm-today-stats {
        grid-column: 1 / -1;
        grid-row: 3;
    }

    .crm-stage-tabs {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: flex-start;
        justify-self: stretch;
        max-width: none;
    }
}

@media (max-width: 720px) {
    .crm-list {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .crm-list::-webkit-scrollbar {
        display: none;
    }

    .crm-kanban {
        grid-template-columns: repeat(3, minmax(82vw, 1fr));
        width: max-content;
        max-width: none;
        gap: 10px;
        padding: 10px 14px max(14px, env(safe-area-inset-bottom));
    }

    .crm-kanban-column {
        width: 82vw;
        scroll-snap-align: start;
        border-color: var(--crm-line);
        background: #111216;
    }

    .crm-kanban-header {
        min-height: 42px;
        border-bottom-color: var(--crm-line);
        background: #17191d;
    }

    .crm-kanban-card.crm-action-row {
        border-color: var(--crm-line);
        background: var(--crm-panel);
    }
}

@media (max-width: 560px) {
    .crm-header {
        padding: 10px 12px;
    }

    .crm-brand {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .crm-tool-switch {
        width: 100%;
    }

    .crm-tool-link {
        flex: 1;
    }

    .crm-card {
        grid-template-columns: 38px minmax(0, 1fr);
        align-items: start;
    }

    .crm-card-task-side {
        grid-column: 2;
        justify-items: start;
    }

    .crm-card-next {
        max-width: none;
        text-align: left;
    }

    .crm-workplan-legend {
        flex-wrap: wrap;
        white-space: normal;
    }

    .crm-toolbar-actions,
    .crm-custom-dates {
        align-items: stretch;
        flex-direction: column;
    }

    .crm-board-toolbar {
        grid-template-columns: 1fr;
    }

    .crm-toolbar-actions {
        justify-self: stretch;
    }

    .crm-generated {
        min-width: 0;
        text-align: left;
    }

    .crm-date-filter {
        justify-content: space-between;
    }

    .crm-date-filter select,
    .crm-custom-dates input {
        width: 100%;
    }

    .crm-funnel-step {
        min-width: 116px;
    }

    .crm-today-overview {
        grid-template-columns: 1fr;
    }

    .crm-today-overview > .crm-progress {
        grid-column: 1;
        grid-row: auto;
        min-width: 0;
    }

    .crm-today-stats {
        grid-column: 1;
        grid-row: auto;
        flex-wrap: wrap;
    }

    .crm-next-item {
        width: 100%;
    }

    .crm-start-next {
        width: 100%;
    }

    .crm-kv {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

@media (max-width: 720px) {
    :root {
        --crm-bg: #0f1013;
        --crm-panel: #15161a;
        --crm-panel-soft: #202126;
        --crm-panel-hover: #1a1c20;
        --crm-text: #f7f7f8;
        --crm-muted: #9a9ca3;
        --crm-line: #25272d;
        --crm-line-strong: #343842;
        --crm-accent: #08b892;
        --crm-accent-strong: #10d2a8;
        --crm-accent-light: rgba(8, 184, 146, 0.14);
        --crm-accent-ring: rgba(8, 184, 146, 0.22);
        --crm-activity-card-surface: #36383f;
        --crm-activity-note-card-surface: #5c5232;
    }

    body {
        background: var(--crm-bg);
    }

    .crm-header {
        grid-template-columns: minmax(0, 1fr) 40px;
        grid-template-areas:
            "brand actions"
            "search search";
        gap: 10px;
        padding: max(10px, env(safe-area-inset-top)) 14px 12px;
        border-bottom-color: #202228;
        background: #101115;
    }

    .crm-brand {
        grid-area: brand;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 9px;
        min-width: 0;
    }

    .crm-brand-link {
        flex: 0 0 auto;
    }

    .crm-brand-link img {
        height: 22px;
    }

    .crm-brand-link span,
    .crm-tool-link span {
        display: none;
    }

    .crm-tool-switch {
        width: auto;
        padding: 2px;
        border-color: #2a2d34;
        background: #1b1d22;
    }

    .crm-tool-link {
        flex: 0 0 auto;
        width: 34px;
        min-height: 32px;
        padding: 0;
        border-radius: 7px;
    }

    .crm-tool-link.is-active {
        background: #2b2e35;
        color: var(--crm-accent-strong);
    }

    .crm-search {
        grid-area: search;
    }

    .crm-search-control {
        height: 38px;
        min-height: 38px;
        max-height: 38px;
        border: 1px solid var(--crm-line);
        border-radius: 8px;
        background: #27282e;
    }

    .crm-search input {
        padding: 0 14px;
        color: #fff;
        font-size: 15px;
        font-weight: 650;
    }

    .crm-search input::placeholder {
        color: #b7b7bd;
    }

    .crm-search-submit {
        width: 44px;
        min-width: 44px;
        border-left: 1px solid var(--crm-line);
        border-radius: 0 8px 8px 0;
        background: var(--crm-accent);
        color: #fff;
    }

    .crm-search-submit:hover {
        background: var(--crm-accent-strong);
    }

    .crm-search-dropdown {
        top: calc(100% + 8px);
        max-height: min(340px, calc(100vh - 170px));
        border-color: var(--crm-line-strong);
        background: #1b1d22;
        box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
    }

    .crm-search-result {
        grid-template-columns: 40px minmax(0, 1fr);
        min-height: 54px;
        gap: 12px;
        padding: 7px 10px;
        color: var(--crm-text);
    }

    .crm-search-result .crm-customer-avatar {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .crm-search-result-name {
        color: var(--crm-text);
        font-size: 16px;
        font-weight: 760;
    }

    .crm-header-actions {
        grid-area: actions;
        justify-content: flex-end;
    }

    .crm-account-button {
        width: 40px;
        height: 40px;
        border: 0;
        background: #24262c;
        color: #fff;
    }

    .crm-main {
        padding: 0;
    }

    .crm-board {
        border: 0;
        border-radius: 0;
        background: var(--crm-bg);
    }

    .crm-board-toolbar {
        align-items: center;
        flex-wrap: wrap;
        gap: 10px;
        padding: 18px 16px 0;
        border-bottom: 0;
        background: #101115;
    }

    .crm-board-title {
        min-width: 0;
    }

    .crm-board-toolbar h1 {
        color: #fff;
        font-size: 26px;
        line-height: 1.08;
        font-weight: 820;
    }

    .crm-toolbar-actions {
        width: auto;
        margin-left: auto;
        gap: 8px;
    }

    .crm-date-filter {
        gap: 0;
    }

    .crm-date-filter span,
    .crm-generated {
        display: none;
    }

    .crm-date-filter select {
        width: auto;
        min-width: 112px;
        height: 34px;
        border-color: #2d3139;
        border-radius: 999px;
        background: #202228;
        color: #fff;
        font-size: 12px;
        font-weight: 800;
    }

    .crm-custom-dates {
        align-items: stretch;
        padding: 12px 16px;
        border-color: #24262b;
        background: #111216;
    }

    .crm-custom-dates label {
        justify-content: space-between;
    }

    .crm-custom-dates input {
        border-color: #323640;
        background: #24262c;
        color: #fff;
    }

    .crm-stage-tabs {
        order: 3;
        flex: 0 0 calc(100% + 32px);
        min-width: 0;
        margin: 4px -16px 0;
        padding: 0 16px 14px;
        gap: 8px;
        border-bottom: 1px solid #25272d;
        scrollbar-width: none;
    }

    .crm-stage-tabs::-webkit-scrollbar {
        display: none;
    }

    .crm-funnel-step {
        display: grid;
        grid-template-columns: auto auto;
        grid-template-rows: 1fr;
        align-content: center;
        align-items: center;
        gap: 7px;
        min-width: 126px;
        min-height: 52px;
        padding: 9px 12px;
        filter: none;
    }

    .crm-funnel-step::before {
        display: none;
    }

    .crm-funnel-step::after,
    .crm-funnel-step:first-child::after,
    .crm-funnel-step:last-child::after {
        inset: 0;
        border: 1px solid #292c33;
        border-radius: 12px;
        background: #1f2127;
        clip-path: none;
    }

    .crm-funnel-step.is-active::after {
        border-color: rgba(8, 184, 146, 0.38);
        background: #172922;
    }

    .crm-funnel-step:hover {
        transform: none;
    }

    .crm-funnel-count {
        grid-column: 1;
        grid-row: 1;
        justify-self: start;
        min-width: 0;
        color: var(--crm-accent);
        font-size: 22px;
        font-weight: 850;
        line-height: 1;
    }

    .crm-funnel-label {
        grid-column: 2;
        grid-row: 1;
        color: #aeb0b7;
        overflow: visible;
        text-overflow: clip;
        font-size: 12px;
        font-weight: 800;
    }

    .crm-list {
        max-height: none;
        overflow: visible;
        background: var(--crm-bg);
    }

    .crm-today-overview {
        border-color: #25272d;
        background: #15161a;
    }

    .crm-today-copy strong {
        color: #fff;
    }

    .crm-progress-label strong {
        color: #fff;
    }

    .crm-progress-track {
        background: #2b2e34;
    }

    .crm-today-stats .is-urgent { background: rgba(220, 38, 38, 0.16); color: #fca5a5; }
    .crm-today-stats .is-ready { background: rgba(8, 184, 146, 0.14); color: #6ee7c9; }
    .crm-today-stats .is-blocked { background: rgba(217, 119, 6, 0.16); color: #fdba74; }

    .crm-action-row {
        grid-template-columns: 40px minmax(0, 1fr);
        min-height: 70px;
        gap: 10px;
        padding: 10px 16px;
        border-bottom-color: #24262b;
        background: var(--crm-bg);
        color: #fff;
    }

    .crm-action-row:hover,
    .crm-action-row.is-selected {
        background: #17191d;
    }

    .crm-action-row .crm-customer-avatar {
        grid-column: 1;
        grid-row: 1;
        width: 40px;
        height: 40px;
    }

    .crm-action-main {
        grid-column: 2;
        grid-row: 1;
    }

    .crm-action-main strong {
        color: #fff;
    }

    .crm-action-vehicle {
        color: #9b9ea6;
    }

    .crm-priority-badge.is-ready {
        background: rgba(8, 184, 146, 0.14);
        color: #6ee7c9;
    }

    .crm-priority-badge.is-urgent {
        background: rgba(220, 38, 38, 0.16);
        color: #fca5a5;
    }

    .crm-priority-badge.is-blocked {
        background: rgba(217, 119, 6, 0.16);
        color: #fdba74;
    }

    .crm-task-workflows {
        align-items: stretch;
    }

    .crm-task-workflow-label {
        width: 100%;
    }

    .crm-reschedule-date {
        flex: 1 1 150px;
    }

    .crm-reschedule-date input {
        width: 100%;
    }

    .crm-manager-reasons {
        display: grid;
        grid-template-columns: 1fr;
    }

    .crm-manager-reasons button,
    .crm-manager-actions button {
        width: 100%;
    }

    .crm-manager-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .crm-next-item {
        border-color: #343842;
        background: #24262c;
        color: #d1d5db;
    }

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

    .crm-table-header {
        display: none;
    }

    .crm-table-body {
        display: block;
    }

    .crm-table-row {
        position: relative;
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) 16px;
        grid-template-rows: min-content min-content;
        column-gap: 12px;
        row-gap: 2px;
        align-content: center;
        min-height: 64px;
        padding: 9px 16px;
        border-bottom-color: #24262b;
        background: var(--crm-bg);
        color: #fff;
    }

    .crm-table-row::after {
        content: "";
        grid-column: 3;
        grid-row: 1 / 3;
        align-self: center;
        justify-self: end;
        width: 10px;
        height: 10px;
        border-top: 2px solid #555861;
        border-right: 2px solid #555861;
        transform: rotate(45deg);
    }

    .crm-table-row:hover,
    .crm-table-row.is-selected {
        background: #17191d;
    }

    .crm-table-row.is-selected {
        box-shadow: inset 3px 0 0 var(--crm-accent);
    }

    .crm-table-cell {
        white-space: nowrap;
        font-size: 14px;
    }

    .crm-table-customer {
        display: contents;
    }

    .crm-customer-avatar {
        grid-column: 1;
        grid-row: 1 / 3;
        align-self: center;
        justify-self: start;
        width: 40px;
        height: 40px;
        font-size: 15px;
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
    }

    .crm-card-title {
        grid-column: 2;
        grid-row: 1;
        align-self: end;
        color: #fff;
        font-size: 17px;
        font-weight: 800;
        line-height: 1.12;
    }

    .crm-table-cell:nth-child(2) {
        grid-column: 2;
        color: #9b9ea6;
        font-size: 14px;
        font-weight: 680;
        line-height: 1.16;
    }

    .crm-table-cell:nth-child(2) {
        grid-row: 2;
    }

    .crm-table-cell:nth-child(4),
    .crm-table-cell:nth-child(3) {
        display: none;
    }

    .crm-empty,
    .crm-error {
        padding: 24px 16px;
        background: var(--crm-bg);
    }

    .crm-modal {
        align-items: end;
        padding: 0;
    }

    .crm-modal-backdrop {
        background: rgba(0, 0, 0, 0.58);
    }

    .crm-modal-card {
        width: 100%;
        height: 100dvh;
        max-height: none;
        border: 0;
        border-radius: 18px 18px 0 0;
        background: #15171b;
        box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.42);
        transform: translateY(28px);
    }

    .crm-modal-close {
        top: 12px;
        right: 12px;
        width: 38px;
        height: 38px;
        border-color: #333741;
        background: #22252b;
        color: #f4f4f5;
    }

    .crm-detail-header {
        border-color: #2b2e34;
        background: #15171b;
    }

    .crm-detail-body {
        padding: 16px;
    }

    .crm-modal .crm-activity-rail {
        height: min(620px, 68vh);
        margin-right: -12px;
        margin-left: -12px;
        padding: 14px 12px;
        border-color: #2b2e34;
        background: #181a1f;
    }

    .crm-modal .crm-activity-rail.is-empty {
        height: auto;
    }

    .crm-modal .crm-vehicle-rail {
        margin: 0 -12px -10px;
    }

    .crm-activity-filter select {
        border-color: #343842;
        background: #22252b;
        color: #f7f7f8;
    }

    .crm-activity-filter option {
        background: #22252b;
        color: #f7f7f8;
    }

    .crm-copy-contact,
    .crm-customer-summary {
        border-color: #30343c;
        background: #1d2025;
        color: #f7f7f8;
    }

    .crm-activity-item {
        border-color: var(--crm-activity-border);
        background: var(--crm-activity-surface);
        color: #f7f7f8;
    }

    .crm-comm-action-bar {
        border-color: #30343c;
        background: #1d2025;
    }

    .crm-comm-quick-action.is-ready {
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--crm-channel-color) 30%, transparent);
    }

    .crm-comm-task-badge {
        background: rgba(65, 130, 215, 0.2);
        color: #89b8f2;
    }

    .crm-comm-message,
    .crm-comm-subject,
    .crm-comm-video-url {
        border-color: #30343c;
        background: #1d2025;
        color: #f7f7f8;
    }

    .crm-comm-messagebar {
        border-color: #30343c;
        background: #1d2025;
    }

    .crm-comm-compose .crm-comm-message,
    .crm-comm-compose .crm-comm-subject,
    .crm-comm-compose .crm-comm-video-url {
        background: transparent;
    }

    .crm-video-upload {
        border-color: #3f4652;
        background: #1d2025;
    }

    .crm-video-file-name.is-ready {
        color: #6ee7c9;
    }

    .crm-comm-message::placeholder,
    .crm-comm-subject::placeholder,
    .crm-comm-video-url::placeholder {
        color: #8c9098;
    }

    .crm-comm-action-row {
        flex-wrap: nowrap;
        gap: 4px;
        width: auto;
        margin-left: auto;
    }

    .crm-comm-channel-action {
        flex: 0 0 var(--ff-control-min-height);
        min-width: var(--ff-control-min-height);
        padding: 0;
    }

    .crm-comm-action-row .crm-comm-channel-action svg {
        display: block;
    }

    .crm-comm-channel-action .crm-comm-task-badge {
        position: absolute;
        top: -5px;
        right: -5px;
        display: inline-flex;
    }

    .crm-detail-main {
        height: calc(100dvh - 150px);
        min-height: 560px;
        margin: 0 -12px;
    }

    .crm-conversation-header {
        padding-right: 14px;
        padding-left: 14px;
    }

    .crm-conversation-list {
        padding-right: 10px;
        padding-left: 10px;
    }

    .crm-thread-item.is-inbound {
        padding-right: 6%;
    }

    .crm-thread-item.is-outbound {
        padding-left: 6%;
    }

    .crm-thread-bubble {
        max-width: 88%;
    }

    .crm-detail-main > .crm-comm-panel {
        padding: 8px 8px 10px;
        background: rgba(21, 23, 27, 0.96);
    }

    .crm-comm-status {
        width: 100%;
    }
}

/* Unified CRM button behavior. Uses CRM variables so mobile dark mode stays coherent. */
:root {
    --crm-control-shadow: inset 0 1px 0 rgba(255,255,255,0.68), 0 1px 2px rgba(15,23,42,0.05);
    --crm-control-shadow-hover: inset 0 1px 0 rgba(255,255,255,0.80), 0 8px 20px rgba(15,23,42,0.08);
    --crm-primary-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 1px 2px rgba(0,112,243,0.12);
    --crm-primary-shadow-hover: inset 0 1px 0 rgba(255,255,255,0.28), 0 8px 18px rgba(0,112,243,0.18);
    --crm-control-ease: cubic-bezier(0.23, 1, 0.32, 1);
}

.crm-tool-link,
.crm-modal-close,
.crm-action-link,
.crm-copy-contact,
.crm-comm-channel-action {
    border-radius: var(--crm-radius);
    box-shadow: var(--crm-control-shadow);
    transition:
        background 0.14s var(--crm-control-ease),
        border-color 0.14s var(--crm-control-ease),
        box-shadow 0.14s var(--crm-control-ease),
        color 0.14s var(--crm-control-ease),
        transform 0.14s var(--crm-control-ease);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.crm-search-submit,
.crm-note-form button {
    box-shadow: var(--crm-primary-shadow);
    transition:
        background 0.14s var(--crm-control-ease),
        border-color 0.14s var(--crm-control-ease),
        box-shadow 0.14s var(--crm-control-ease),
        color 0.14s var(--crm-control-ease),
        transform 0.14s var(--crm-control-ease);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.crm-tool-link:hover,
.crm-modal-close:hover,
.crm-action-link:hover,
.crm-copy-contact:hover,
.crm-tool-link:focus-visible,
.crm-modal-close:focus-visible,
.crm-action-link:focus-visible,
.crm-copy-contact:focus-visible {
    border-color: var(--crm-line-strong);
    background: var(--crm-panel-hover);
    box-shadow: var(--crm-control-shadow-hover);
    color: var(--crm-accent);
    outline: none;
    transform: translateY(-1px);
}

.crm-search-submit:hover,
.crm-note-form button:hover,
.crm-search-submit:focus-visible,
.crm-note-form button:focus-visible {
    background: var(--crm-accent-strong);
    box-shadow: var(--crm-primary-shadow-hover);
    color: #fff;
    outline: none;
    transform: translateY(-1px);
}

.crm-tool-link:focus-visible,
.crm-modal-close:focus-visible,
.crm-action-link:focus-visible,
.crm-copy-contact:focus-visible,
.crm-comm-channel-action:focus-visible,
.crm-search-submit:focus-visible,
.crm-note-form button:focus-visible {
    box-shadow: 0 0 0 4px var(--crm-accent-ring), var(--crm-control-shadow);
}

.crm-search-submit:focus-visible,
.crm-note-form button:focus-visible {
    box-shadow: 0 0 0 4px var(--crm-accent-ring), var(--crm-primary-shadow);
}

.crm-tool-link:active,
.crm-modal-close:active,
.crm-action-link:active,
.crm-copy-contact:active,
.crm-comm-channel-action:active,
.crm-search-submit:active,
.crm-note-form button:active {
    box-shadow: var(--crm-control-shadow);
    transform: translateY(0) scale(0.98);
}

.crm-search-submit:active,
.crm-note-form button:active {
    box-shadow: var(--crm-primary-shadow);
}

.crm-comm-channel-action:disabled {
    box-shadow: none;
    transform: none;
}

.crm-contact-control > .crm-copy-contact {
    border-radius: var(--crm-radius) 0 0 var(--crm-radius);
}

.crm-contact-control > .crm-copy-contact:hover,
.crm-contact-control > .crm-copy-contact:focus-visible,
.crm-contact-control > .crm-copy-contact:active {
    transform: none;
}

@media (hover: none), (pointer: coarse) {
    .crm-tool-link:hover,
    .crm-modal-close:hover,
    .crm-action-link:hover,
    .crm-copy-contact:hover,
    .crm-comm-channel-action:hover,
    .crm-search-submit:hover,
    .crm-note-form button:hover {
        transform: none;
    }
}
