.crm-work-filter-group-view .crm-work-view-chip.active {
    border-color: #0f766e;
    background: #0f766e;
    color: #ffffff;
}

.crm-kanban-root {
    padding-top: 14px;
}

.crm-kanban-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid var(--color-divider);
    border-radius: 8px;
    background: var(--color-card-bg);
}

.crm-kanban-toolbar > div:first-child {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.crm-kanban-toolbar strong {
    color: var(--color-heading);
    font-size: 13px;
    font-weight: 900;
    line-height: 1.25;
}

.crm-kanban-toolbar span {
    color: var(--color-text-subtle);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.3;
}

.crm-kanban-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.crm-kanban-toolbar-actions button {
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid var(--color-divider);
    border-radius: 7px;
    background: var(--color-panel-raised);
    color: var(--color-body-text);
    cursor: pointer;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.crm-kanban-toolbar-actions button:hover:not(:disabled) {
    border-color: var(--color-divider-strong);
    transform: translateY(-1px);
}

.crm-kanban-toolbar-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.46;
}

.crm-kanban-board {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(292px, 1fr);
    gap: 12px;
    min-height: 560px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    padding: 2px 2px 12px;
}

.crm-kanban-board::-webkit-scrollbar {
    height: 10px;
}

.crm-kanban-board::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.28);
}

.crm-kanban-column {
    display: grid;
    grid-template-rows: auto 1fr;
    min-width: 292px;
    min-height: 520px;
    border: 1px solid var(--color-divider);
    border-radius: 8px;
    background: color-mix(in srgb, var(--color-card-bg) 86%, var(--color-panel-raised) 14%);
    scroll-snap-align: start;
}

.crm-kanban-column-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    min-height: 68px;
    padding: 12px;
    border-bottom: 1px solid var(--color-divider);
}

.crm-kanban-column-head div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.crm-kanban-column-head strong {
    color: var(--color-heading);
    font-size: 14px;
    font-weight: 900;
    line-height: 1.25;
}

.crm-kanban-column-head span {
    color: var(--color-text-subtle);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.35;
}

.crm-kanban-column-head em {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 26px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    color: var(--color-heading);
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.crm-kanban-dropzone {
    display: grid;
    align-content: start;
    gap: 10px;
    min-height: 450px;
    padding: 10px;
    transition: background-color 0.16s ease, box-shadow 0.16s ease;
}

.crm-kanban-dropzone.is-over {
    background: rgba(15, 118, 110, 0.08);
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.22);
}

.crm-kanban-column-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 92px;
    border: 1px dashed var(--color-divider);
    border-radius: 8px;
    color: var(--color-text-subtle);
    font-size: 12px;
    font-weight: 900;
}

.crm-kanban-empty {
    display: grid;
    place-items: center;
    gap: 6px;
    min-height: 280px;
    border: 1px dashed var(--color-divider);
    border-radius: 8px;
    background: var(--color-card-bg);
    text-align: center;
}

.crm-kanban-empty strong {
    color: var(--color-heading);
    font-size: 15px;
    font-weight: 900;
}

.crm-kanban-empty span {
    color: var(--color-text-subtle);
    font-size: 12px;
    font-weight: 800;
}

.crm-kanban-card {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--color-divider);
    border-left-width: 4px;
    border-radius: 8px;
    background: var(--color-card-bg);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    animation: crmKanbanCardIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: calc(min(var(--card-index), 10) * 24ms);
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.crm-kanban-card.is-draggable {
    cursor: grab;
}

.crm-kanban-card.is-draggable:active {
    cursor: grabbing;
}

.crm-kanban-card.is-dragging {
    opacity: 0.56;
    transform: scale(0.985);
}

.crm-kanban-card:hover {
    border-color: var(--color-divider-strong);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
    transform: translateY(-1px);
}

.crm-kanban-card.is-locked {
    cursor: default;
}

.crm-kanban-card.is-relationship-hot { border-left-color: #dc2626; }
.crm-kanban-card.is-relationship-warm { border-left-color: #d97706; }
.crm-kanban-card.is-relationship-mild { border-left-color: #0f766e; }
.crm-kanban-card.is-relationship-cool { border-left-color: #64748b; }
.crm-kanban-card.is-relationship-sleep { border-left-color: #94a3b8; }

/* 데이터 정리(= CRM 미연결 헙스딜 대기실): 온도색·채도를 죽여 전체적으로 옅은 회색으로 뒤로 물림.
   테마 하드코딩 대신 grayscale + 중립 테두리로 라이트/다크 모두 안전. hover 시 복귀. */
.crm-kanban-card[data-work-type="데이터 정리"] {
    background: color-mix(in srgb, var(--color-card-bg) 84%, #94a3b8 16%);
    border-left-color: var(--color-divider-strong);
    filter: grayscale(0.82);
    opacity: 0.82;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}
.crm-kanban-card[data-work-type="데이터 정리"]:hover {
    filter: grayscale(0.45);
    opacity: 1;
    border-color: var(--color-divider-strong);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.09);
    transform: translateY(-1px);
}

.crm-kanban-card-head {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    min-width: 0;
}

.crm-kanban-media {
    position: relative;
    width: 42px;
    height: 42px;
}

.crm-kanban-media .crm-work-avatar-stack,
.crm-kanban-media .crm-work-avatar,
.crm-kanban-media .crm-work-avatar-fallback {
    width: 42px;
    height: 42px;
}

.crm-kanban-relationship-ring {
    position: absolute;
    inset: -3px;
    border: 2px solid currentColor;
    border-radius: 9px;
    pointer-events: none;
    opacity: 0.88;
}

.is-relationship-hot .crm-kanban-relationship-ring { color: #dc2626; }
.is-relationship-warm .crm-kanban-relationship-ring { color: #d97706; }
.is-relationship-mild .crm-kanban-relationship-ring { color: #0f766e; }
.is-relationship-cool .crm-kanban-relationship-ring { color: #64748b; }
.is-relationship-sleep .crm-kanban-relationship-ring { color: #94a3b8; }

.crm-kanban-title {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.crm-kanban-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.crm-kanban-badges .crm-work-track-badge,
.crm-kanban-badges .crm-work-signal-badge {
    margin: 0;
}

.crm-kanban-status-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.crm-kanban-worktype,
.crm-kanban-relationship,
.crm-kanban-source-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.crm-kanban-worktype {
    background: rgba(15, 118, 110, 0.1);
    color: #0f766e;
}

.crm-kanban-relationship {
    background: rgba(15, 23, 42, 0.07);
    color: var(--color-heading);
}

.crm-kanban-source-badge {
    background: rgba(148, 163, 184, 0.15);
    color: #64748b;
}

.crm-kanban-source-badge.is-manual {
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
}

.crm-kanban-source-badge.is-ai {
    background: rgba(15, 118, 110, 0.1);
    color: #0f766e;
}

.crm-kanban-meter {
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
}

.crm-kanban-meter span {
    display: block;
    width: calc(var(--relationship-score) * 1%);
    height: 100%;
    border-radius: inherit;
    background: currentColor;
}

.is-relationship-hot .crm-kanban-meter { color: #dc2626; }
.is-relationship-warm .crm-kanban-meter { color: #d97706; }
.is-relationship-mild .crm-kanban-meter { color: #0f766e; }
.is-relationship-cool .crm-kanban-meter { color: #64748b; }
.is-relationship-sleep .crm-kanban-meter { color: #94a3b8; }

.crm-kanban-ai-panel {
    display: grid;
    gap: 7px;
    min-width: 0;
    padding: 9px;
    border: 1px solid rgba(100, 116, 139, 0.22);
    border-radius: 8px;
    background: rgba(248, 250, 252, 0.74);
}

.crm-kanban-ai-panel.has-result {
    border-color: rgba(15, 118, 110, 0.24);
    background: rgba(240, 253, 250, 0.58);
}

.crm-kanban-ai-panel.is-different {
    border-color: rgba(217, 119, 6, 0.32);
    background: rgba(255, 251, 235, 0.64);
}

.crm-kanban-ai-panel.is-error {
    border-color: rgba(220, 38, 38, 0.26);
    background: rgba(254, 242, 242, 0.72);
}

.crm-kanban-ai-panel.is-loading {
    position: relative;
    overflow: hidden;
}

.crm-kanban-ai-panel.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.46) 46%, transparent 72%);
    transform: translateX(-100%);
    animation: crmKanbanAiShimmer 1.35s ease-in-out infinite;
    pointer-events: none;
}

.crm-kanban-ai-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.crm-kanban-ai-head strong {
    color: var(--color-heading);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
}

.crm-kanban-ai-head button {
    min-height: 26px;
    padding: 0 8px;
    border: 1px solid rgba(15, 118, 110, 0.24);
    border-radius: 7px;
    background: #ffffff;
    color: #0f766e;
    cursor: pointer;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.crm-kanban-ai-head button:hover:not(:disabled) {
    border-color: rgba(15, 118, 110, 0.48);
    transform: translateY(-1px);
}

.crm-kanban-ai-head button:disabled {
    cursor: not-allowed;
    opacity: 0.52;
}

.crm-kanban-ai-panel p,
.crm-kanban-ai-panel small,
.crm-kanban-ai-panel li {
    overflow-wrap: anywhere;
}

.crm-kanban-ai-panel > p,
.crm-kanban-ai-error {
    margin: 0;
    color: var(--color-text-subtle);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.45;
}

.crm-kanban-ai-error {
    color: #b91c1c;
}

.crm-kanban-ai-result {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.crm-kanban-ai-result span {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    color: var(--color-heading);
    font-size: 12px;
    font-weight: 900;
    line-height: 1.35;
}

.crm-kanban-ai-result em {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.1);
    color: #0f766e;
    font-size: 10px;
    font-style: normal;
    font-weight: 900;
}

.crm-kanban-ai-result small {
    color: var(--color-text-subtle);
    font-size: 10px;
    font-weight: 850;
    line-height: 1.35;
}

.crm-kanban-ai-result p {
    margin: 0;
    color: var(--color-body-text);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.45;
}

.crm-kanban-ai-result ul {
    display: grid;
    gap: 3px;
    margin: 0;
    padding-left: 14px;
    color: var(--color-text-subtle);
    font-size: 10px;
    font-weight: 800;
    line-height: 1.35;
}

.crm-kanban-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}

.crm-kanban-detail-grid > div {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding-top: 8px;
    border-top: 1px solid var(--color-divider);
}

.crm-kanban-detail-grid > div > span {
    color: var(--color-text-subtle);
    font-size: 10px;
    font-weight: 900;
}

.crm-kanban-detail-grid strong,
.crm-kanban-detail-grid small {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.crm-kanban-detail-grid strong {
    color: var(--color-body-text);
    font-size: 12px;
    font-weight: 900;
    line-height: 1.35;
}

.crm-kanban-detail-grid small {
    color: var(--color-text-subtle);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.35;
}

.crm-kanban-detail-grid .crm-work-deal-stage,
.crm-kanban-detail-grid .crm-work-deal-empty,
.crm-kanban-detail-grid .crm-work-deal-stage-button {
    justify-items: start;
    text-align: left;
}

.crm-kanban-actions {
    display: grid;
    gap: 6px;
}

.crm-kanban-actions .crm-work-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.crm-kanban-reset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    border: 1px solid var(--color-divider);
    border-radius: 7px;
    background: transparent;
    color: var(--color-text-subtle);
    cursor: pointer;
    font-size: 11px;
    font-weight: 900;
}

.crm-kanban-reset-btn:hover {
    border-color: var(--color-divider-strong);
    color: var(--color-body-text);
}

@keyframes crmKanbanCardIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes crmKanbanAiShimmer {
    to {
        transform: translateX(100%);
    }
}

@media (max-width: 860px) {
    .crm-kanban-root {
        margin-right: -16px;
    }

    .crm-kanban-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .crm-kanban-toolbar-actions {
        justify-content: flex-start;
    }

    .crm-kanban-board {
        grid-auto-columns: minmax(284px, 86vw);
        scroll-snap-type: x mandatory;
        padding-right: 16px;
    }

    .crm-kanban-column {
        min-width: 284px;
    }
}
