.crm-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 20px;
    min-height: 600px;
    height: calc(100vh - 200px);
}

.crm-panel-left,
.crm-panel-right {
    display: flex;
    flex-direction: column;
    background: rgba(var(--rgb-ink), 0.4);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 22px;
    overflow-y: auto;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.2);
    min-width: 0;
}
.crm-panel-left > * { flex-shrink: 0; }   /* [1101] 거르개·도구 줄이 눌려 겹치지 않게 - 판이 넘치면 판이 스크롤한다 */

.crm-search-wrapper {
    margin-bottom: 16px;
}

.crm-search-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(var(--rgb-ink), 0.5) !important;
    border: 1px solid var(--border-glass) !important;
    color: var(--c-white) !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    outline: none !important;
    transition: all 0.2s !important;
}

.crm-search-input:focus {
    border-color: rgba(37, 99, 235, 0.5) !important;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.25) !important;
}

#crm-editor-panel > .grid-3 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 6px 10px !important; margin-bottom: 8px !important; }
#crm-editor-panel > .grid-3 > div { min-width: 0; }
#crm-editor-panel > .grid-3 > div:has(> #crm-input-name) { order: 1; }
#crm-editor-panel > .grid-3 > div:has(> #crm-input-phone) { order: 2; }
#crm-editor-panel > .grid-3 > div:has(> #crm-select-role) { order: 3; }
#crm-editor-panel > .grid-3 > div:has(> #crm-select-status) { order: 4; }
#crm-editor-panel > .grid-3 > div:has(#crm-trade-checks) { order: 5; grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 12px; align-items: start; }
#crm-editor-panel > .grid-3 > #crm-offer-box { order: 5; }
#crm-editor-panel > .grid-3 > div:has(#crm-trade-checks) > div:first-child { grid-column: 1 / -1; margin-bottom: 0 !important; }
#crm-editor-panel > .grid-3 > div:has(#crm-trade-checks) > div { margin-bottom: 0 !important; }
#crm-editor-panel > .grid-3 > div:has(> #crm-input-price) { order: 6; }
#crm-editor-panel > .grid-3 > div:has(> #crm-input-memo) { order: 7; grid-column: span 3 !important; }
#crm-editor-panel > .grid-3 > #crm-contracts-wrap { order: 8; grid-column: 1 / -1 !important; }
#crm-editor-panel > .grid-3 > div:has(> #crm-history-display) { order: 9; grid-column: 1 / -1 !important; }   /* [0923] 녹음 칸이 피드로 가서 이력이 폭 전부 */
#crm-editor-panel > .grid-3 > #crm-editor-fold { order: 11; }
#crm-editor-panel > .grid-3 > #crm-ptype-group { order: 12; }
#crm-editor-panel > .grid-3 > div:has(> #crm-select-lead-source), #crm-editor-panel > .grid-3 > div:has(> #crm-input-lead-source-memo), #crm-editor-panel > .grid-3 > div:has(> #crm-input-manager) { order: 13; grid-column: auto !important; }
#crm-editor-panel > .grid-3 > div:has(> #crm-select-lead-source) { grid-column: span 2 !important; }
#crm-editor-panel label { margin-bottom: 2px !important; font-size: 10.5px !important; }
#crm-editor-panel input[type="text"], #crm-editor-panel select { padding: 5px 8px !important; font-size: 12px !important; }
#crm-editor-panel #crm-trade-checks { padding: 5px 8px !important; min-height: 30px !important; }
#crm-editor-panel #crm-history-display { max-height: 120px !important; }
.crm-filter-bar { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 8px 0; flex: 1 0 100%; }   /* 도구 줄(flex-wrap) 안에서 거르개는 제 줄을 다 쓰고, 단추들은 그 아래 한 줄에 */
.crm-filter-row { display: flex; align-items: flex-start; gap: 8px; }
.crm-filter-label { flex: 0 0 74px; font-size: 11.5px; color: var(--c-text-dim); padding-top: 4px; }
.crm-filter-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.crm-chip { padding: 2px 8px; border-radius: 12px; font-size: 11.5px; cursor: pointer; background: rgba(var(--rgb-overlay), 0.05); border: 1px solid rgba(var(--rgb-overlay), 0.14); color: var(--c-text-calm); }
.crm-chip .n { margin-left: 4px; font-size: 10.5px; color: var(--c-text-mute); }
.crm-chip.on { background: var(--gradient-primary); border-color: transparent; color: var(--c-on-primary); }
.crm-chip.on .n { color: var(--c-on-primary); opacity: 0.85; }
.crm-chip.zero { opacity: 0.55; }
.crm-chip-clear, .crm-filter-more { padding: 2px 8px; border-radius: 12px; font-size: 11px; cursor: pointer; background: transparent; border: 1px dashed rgba(var(--rgb-overlay), 0.25); color: var(--c-text-dim); }
.crm-filter-summary { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--c-text-calm); padding-top: 2px; flex-wrap: wrap; }
.crm-chip-find { padding: 2px 8px; border-radius: 12px; font-size: 11.5px; width: 120px; background: var(--c-ink); border: 1px solid var(--c-line-mid); color: var(--c-white); }
.crm-filter-presets { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.crm-filter-preset { padding: 2px 6px; border-radius: 6px; font-size: 11.5px; background: var(--c-ink); border: 1px solid var(--c-line-mid); color: var(--c-white); }
.crm-filter-rest { display: flex; flex-direction: column; gap: 4px; }
.crm-step-row select { padding: 2px 6px; border-radius: 6px; font-size: 11.5px; background: var(--c-ink); border: 1px solid var(--c-line-mid); color: var(--c-white); max-width: 200px; }
.crm-chip-group { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; padding-right: 8px; margin-right: 4px; border-right: 1px solid var(--c-line-mid); }
.crm-chip-group:last-child { border-right: none; }
.crm-chip-grouphead { padding: 2px 6px; border-radius: 6px; font-size: 11px; cursor: pointer; background: transparent; border: 1px solid var(--c-line-mid); color: var(--c-text-dim); }
.crm-table-container {
    flex: 1 0 auto;
    height: calc(100vh - 260px);
    min-height: 320px;
    max-height: none;          /* [옮김 20260908] 편집기가 오른쪽으로 가서 목록이 왼쪽 세로를 다 쓴다 */
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
}

.crm-table {
    width: 100%;
    min-width: 1080px;      /* [대표님 20260923] "왜 가로 스크롤 없앴니" - 열이 눌려 안 넘치면 스크롤이 사라진다. 이만큼은 펼치고 넘치면 통(.crm-table-container)이 가로로 민다. */
    border-collapse: collapse;
    font-size: 13px;
}


.crm-table td:nth-child(2) {
    white-space: normal;
    word-break: break-word;
    line-height: 1.45;
    min-width: 200px;
    max-width: 240px;
}

.crm-table th,
.crm-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-glass);
    white-space: nowrap;
    text-align: left;
}

.crm-table th:nth-child(1),
.crm-table td:nth-child(1) {
    text-align: center;
}

.crm-table th:nth-child(7), .crm-table td:nth-child(7),
.crm-table th:nth-child(8), .crm-table td:nth-child(8),
.crm-table th:nth-child(9), .crm-table td:nth-child(9),
.crm-table th:nth-child(10), .crm-table td:nth-child(10) {
    text-align: center;
}
.crm-table td.crm-status-cell .crm-status-chip { margin-left: 0 !important; }
.crm-table td.crm-status-cell > div { margin-top: 3px; }
.crm-table td.crm-status-cell > div > span { margin-left: 0 !important; }
.crm-table td:nth-child(4) .crm-role-more {
    display: block;
    width: fit-content;
    margin: 2px 0;
    font-size: 10.5px;
    color: var(--c-text-dim);
    cursor: help;
}

.crm-table th:nth-child(4), .crm-table td:nth-child(4) {
    white-space: nowrap;
}

.crm-table th:nth-child(6),
.crm-table td:nth-child(6) {
    text-align: left;
    white-space: normal;
    max-width: 170px;
    word-break: keep-all;
}
.crm-table td:nth-child(6) .badge.trade {
    display: block;
    width: fit-content;
    margin: 2px 0;
}
.crm-table [data-칸] { cursor: pointer; }
.crm-table td:nth-child(5) .crm-contract-line {
    font-size: 10.5px;
    color: var(--c-text-calm);
    margin-top: 2px;
    white-space: nowrap;
}
.crm-table td:nth-child(4) .crm-role-badge {
    display: block;
    width: fit-content;
    margin: 2px 0;
    cursor: pointer;   /* [20260923] 누르면 고객구분을 바꾼다(상태 칩과 같은 꼴) */
}

.crm-table th:nth-child(3), .crm-table td:nth-child(3) {
    white-space: nowrap;
    min-width: 130px;
}

.crm-table th:nth-child(5),
.crm-table td:nth-child(5) {
    width: 100%;            /* 남는 자리를 이 열이 받는다 (관심단지 - 20260908 고객구분 열이 앞에 들어와 5번째) */
    white-space: normal;
    line-height: 1.35;
    word-break: keep-all;
}

.crm-table th:nth-child(4), .crm-table td:nth-child(4),
.crm-table th:nth-child(6), .crm-table td:nth-child(6),
.crm-table th:nth-child(7), .crm-table td:nth-child(7),
.crm-table th:nth-child(8), .crm-table td:nth-child(8),
.crm-table th:nth-child(9), .crm-table td:nth-child(9),
.crm-table th:nth-child(10), .crm-table td:nth-child(10) {
    width: 1%;              /* 제 글만큼만(자동 표에서 '좁게'라는 뜻) - 고객구분(4)·거래(6)·최근기록(7)·상태(8, 20261020)·등록일(9)·담당자(10) */
}

.crm-table-container,
.crm-feed-container,
.crm-editor-wrapper {
    scrollbar-width: thin;                                  /* 파이어폭스 */
    scrollbar-color: rgba(var(--rgb-overlay), 0.18) var(--sb-track-2);
}

.crm-table-container::-webkit-scrollbar,
.crm-feed-container::-webkit-scrollbar,
.crm-editor-wrapper::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.crm-table-container::-webkit-scrollbar-track,
.crm-feed-container::-webkit-scrollbar-track,
.crm-editor-wrapper::-webkit-scrollbar-track {
    background: var(--sb-track-2);
    border-radius: 6px;
}

.crm-table-container::-webkit-scrollbar-thumb,
.crm-feed-container::-webkit-scrollbar-thumb,
.crm-editor-wrapper::-webkit-scrollbar-thumb {
    background-color: rgba(var(--rgb-overlay), 0.18);
    border: 2px solid transparent;
    border-radius: 6px;
    background-clip: padding-box;
}

.crm-table-container::-webkit-scrollbar-thumb:hover,
.crm-feed-container::-webkit-scrollbar-thumb:hover,
.crm-editor-wrapper::-webkit-scrollbar-thumb:hover {
    background-color: rgba(var(--rgb-overlay), 0.35);
}

.crm-editor-wrapper {
    max-height: none;
    overflow: visible;
    flex: 0 0 auto;
}

.crm-table th {
    background: rgba(var(--rgb-ink), 0.95);
    color: var(--text-secondary);
    font-weight: var(--w-strong);
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 10;
}

.crm-table tr {
    cursor: pointer;
    transition: all 0.2s;
}

.crm-table tr:hover {
    background: rgba(var(--rgb-overlay), 0.02);
}

.crm-table tr.active-row {
    background: rgba(37, 99, 235, 0.12);
    border-left: 3px solid var(--accent-primary);
}

.crm-feed-container {
    flex: 1;
    min-height: 320px;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.crm-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
    gap: 12px;
}

.crm-card {
    background: rgba(var(--rgb-ink), 0.45);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 18px;
    animation: fadeIn 0.3s ease;
}

.crm-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(var(--rgb-overlay), 0.04);
    padding-bottom: 8px;
}

.crm-card-date {
    font-size: 12px;
    color: var(--accent-cyan);
    font-weight: var(--w-strong);
}

.crm-card-file {
    font-size: 11.5px;
    color: var(--text-muted);
    text-align: right;
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crm-card-body {
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--text-primary);
    white-space: pre-line;
    margin-bottom: 14px;
}

.crm-sms-box {
    background: rgba(var(--rgb-ink), 0.6);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 6px;
    padding: 14px;
    position: relative;
}

.crm-sms-text {
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--c-text-soft);
    white-space: pre-wrap;
    padding-right: 50px;
}
textarea.crm-sms-text {
    display: block;
    width: 100%;
    box-sizing: border-box;
    min-height: 120px;
    padding: 8px 10px;
    background: rgba(var(--rgb-ink), 0.6);
    border: 1px solid var(--c-line-soft);
    border-radius: 6px;
    resize: vertical;
    font-family: inherit;
    outline: none;
}
textarea.crm-sms-text:focus {
    border-color: var(--c-sky);
}

.crm-sms-copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 4px;
    color: var(--c-blue-3);
    padding: 4px 10px;
    font-size: 11px;
    font-weight: var(--w-heavy);
    cursor: pointer;
    transition: all 0.2s;
}

.crm-sms-copy-btn:hover {
    background: rgba(99, 102, 241, 0.3);
    color: white;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: var(--w-heavy);
    line-height: 1.2;
}

.badge.gray {
    background: rgba(var(--rgb-overlay), 0.06);
    color: var(--text-secondary);
}

.badge.blue {
    background: rgba(59, 130, 246, 0.12);
    color: var(--c-blue-11);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge.green {
    background: rgba(16, 185, 129, 0.12);
    color: var(--c-green-2);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge.trade {
    background: rgba(6, 182, 212, 0.12);
    color: var(--c-teal-3);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

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


#walking-customer-modal .interest-row { font-size: 13.5px; }
#walking-customer-modal .interest-cond-line,
#walking-customer-modal .interest-more { font-size: 13px !important; }
#walking-customer-modal .interest-cond-line[style*="max-height"] { max-height: 260px !important; }
#walking-customer-modal .interest-kind-btn { font-size: 13px !important; padding: 5px 11px !important; }
#walking-customer-modal .interest-row select,
#walking-customer-modal .interest-row input[type="text"],
#walking-customer-modal .interest-row input[type="number"] { font-size: 13.5px; padding: 7px 9px !important; }
.crm-table .crm-search-where { font-size: 11px; color: var(--c-text-calm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
