/* 📁 파일 위치: /영일전기철물2/admin/assets/css/customer/customer_management.css */
/* ✅ 덮어쓰기 지시: 고객관리 CSS v2.0 — view.php 클래스와 1:1 매칭(레이아웃/리스트/상세/표/사진) */

[v-cloak] {
    display: none !important;
}

/* 페이지 기본 */
.cm-page-wrap {
    max-width: 1320px;
    margin: 0 auto;
    padding: 18px 16px 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", Arial, sans-serif;
    color: #111827;
}

/* 헤더 */
.cm-header-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.cm-title-main {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.2px;
}

.cm-title-sub {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

.cm-btn-primary {
    border: 0;
    background: #2563eb;
    color: #fff;
    padding: 10px 12px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}

.cm-btn-primary:hover {
    filter: brightness(0.97);
}

.cm-btn-ghost {
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #111827;
    padding: 8px 10px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

.cm-btn-ghost:hover {
    background: #f9fafb;
}

.cm-btn-danger {
    border: 1px solid #fecaca;
    background: #fff;
    color: #b91c1c;
    padding: 8px 10px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}

.cm-btn-danger:hover {
    background: #fff5f5;
}

/* 레이아웃 */
.cm-layout {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 14px;
    align-items: start;
}

@media (max-width: 1024px) {
    .cm-layout {
        grid-template-columns: 1fr;
    }
}

/* 카드 공통 */
.cm-card,
.cm-detail-card {
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    min-width: 0;
}

.cm-card {
    padding: 12px;
}

.cm-detail-card {
    padding: 14px;
}

/* 카드 타이틀 */
.cm-card-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 4px 10px;
    font-weight: 800;
}

.cm-muted {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 600;
}

/* 빠른 추가 */
.cm-quick-add-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
    margin-bottom: 8px;
}

.cm-quick-add-row input {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 10px;
    outline: none;
    font-size: 13px;
    background: #fff;
}

.cm-quick-add-row input:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.cm-quick-add-row button {
    border: 0;
    border-radius: 10px;
    padding: 10px 12px;
    background: #111827;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.cm-quick-add-row button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.cm-quick-hint {
    font-size: 11px;
    color: #6b7280;
    margin: 4px 2px 10px;
}

/* 검색 */
.cm-search-row {
    display: flex;
    gap: 8px;
    margin: 8px 0 10px;
}

.cm-search-row input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 10px;
    outline: none;
    font-size: 13px;
}

.cm-search-row input:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.cm-search-row button {
    border: 1px solid #e5e7eb;
    background: #fff;
    padding: 10px 12px;
    border-radius: 10px;
    font-weight: 800;
    cursor: pointer;
}

.cm-search-row button:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.cm-list-empty {
    padding: 18px 8px;
    font-size: 13px;
    color: #6b7280;
    text-align: center;
}

/* 고객 리스트 */
.cm-list {
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    padding: 8px;
    max-height: 66vh;
    overflow: auto;
}

.cm-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 10px 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: transform .06s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
}

.cm-list-item:hover {
    background: #f9fbff;
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.cm-list-item.active {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.10);
}

.cm-li-main {
    min-width: 0;
}

.cm-li-name {
    font-size: 14px;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cm-li-sub {
    font-size: 12px;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}

.cm-li-tag {
    font-size: 11px;
    font-weight: 800;
    color: #1f2937;
    background: #eef2ff;
    border: 1px solid #e0e7ff;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

/* 우측 placeholder */
.cm-placeholder {
    padding: 18px 10px;
    color: #6b7280;
    font-size: 13px;
}

/* 상세 헤더 */
.cm-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef2f7;
    margin-bottom: 12px;
}

.cm-detail-name {
    font-size: 18px;
    font-weight: 900;
}

.cm-detail-subtext {
    font-size: 12px;
    color: #6b7280;
    margin-top: 3px;
}

.cm-detail-tags {
    margin-top: 8px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.cm-tag {
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 999px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
}

/* 상세 그리드 */
.cm-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
    padding: 4px 0 10px;
}

@media (max-width: 1024px) {
    .cm-detail-grid {
        grid-template-columns: 1fr;
    }
}

.cm-field-label {
    font-size: 11px;
    color: #6b7280;
    font-weight: 800;
}

.cm-field-value {
    font-size: 13px;
    font-weight: 700;
    margin-top: 2px;
    color: #111827;
    border: 1px solid #eef2f7;
    background: #fbfdff;
    padding: 8px 10px;
    border-radius: 10px;
    white-space: pre-line;
    word-break: break-word;
}

.cm-detail-grid--extra {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cm-detail-grid--extra.is-collapsed {
    display: none;
}

@media (max-width: 1200px) {
    .cm-detail-grid--extra {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .cm-detail-grid--extra {
        grid-template-columns: 1fr;
    }
}

/* 섹션 타이틀 */
.cm-section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 10px;
    margin-top: 14px;
    margin-bottom: 8px;
}

.cm-section-title-row--toggle {
    align-items: center;
}

.cm-section-title {
    font-size: 14px;
    font-weight: 900;
}

.cm-section-sub {
    font-size: 11px;
    color: #6b7280;
}

.cm-section-hamburger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #111827;
    border-radius: 10px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.cm-section-hamburger:hover {
    background: #f9fafb;
}

.cm-section-hamburger:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.cm-hamburger-icon {
    font-size: 15px;
    line-height: 1;
    transform: rotate(0deg);
    transition: transform .15s ease;
}

.cm-section-hamburger.is-open .cm-hamburger-icon {
    transform: rotate(90deg);
}

/* 공통 empty */
.qh-empty {
    padding: 14px 8px;
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    border: 1px dashed #e5e7eb;
    border-radius: 12px;
    background: #fafafa;
}

/* 사진 */
.customer-photo-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

@media (max-width: 1024px) {
    .customer-photo-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 520px) {
    .customer-photo-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

.customer-photo-item {
    border: 1px solid #eef2f7;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.customer-photo-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

.customer-photo-meta {
    padding: 6px 8px;
    font-size: 11px;
    color: #6b7280;
}

.customer-photo-upload {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 6px;
}

.customer-photo-upload input[type="file"] {
    max-width: 260px;
}

/* 요약 카드 */
.qh-summary-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 8px;
}

@media (max-width: 1024px) {
    .qh-summary-row {
        grid-template-columns: 1fr;
    }
}

.qh-summary-card {
    border: 1px solid #eef2f7;
    border-radius: 12px;
    padding: 10px 10px;
    background: #fbfdff;
}

.qh-label {
    font-size: 11px;
    color: #6b7280;
    font-weight: 800;
}

.qh-value {
    font-size: 15px;
    font-weight: 900;
    margin-top: 4px;
}

/* 테이블 */
.qh-table-wrap {
    border: 1px solid #eef2f7;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.qh-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.qh-table thead th {
    text-align: left;
    padding: 10px 10px;
    background: #f9fafb;
    border-bottom: 1px solid #eef2f7;
    font-size: 11px;
    color: #6b7280;
    font-weight: 900;
}

.qh-table tbody td {
    padding: 10px 10px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.qh-table tbody tr:hover {
    background: #fbfdff;
    cursor: pointer;
}

.qh-table tbody tr:last-child td {
    border-bottom: 0;
}

/* 상태 배지 */
.qh-status-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 900;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #f3f4f6;
}

.qh-status-badge--draft {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.qh-status-badge--sent {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.qh-status-badge--won {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #047857;
}

.qh-status-badge--contract {
    background: #f5f3ff;
    border-color: #ddd6fe;
    color: #5b21b6;
}

/* 링크 버튼 */
.cm-link-btn {
    border: 1px solid #e5e7eb;
    background: #fff;
    padding: 6px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
}

.cm-link-btn:hover {
    background: #f9fafb;
}

/* 말줄임 */
.cm-ellipsis {
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cm-error {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #9f1239;
    font-weight: 800;
    font-size: 12px;
}

/* print-card-page는 기존대로(여긴 프린트 CSS 따로 있으면 그쪽에서) */

/* ===================================================
   ✅ A4 통일 테마 오버라이드
=================================================== */
body {
    background: #e5e7eb !important;
}
.cm-page-wrap {
    font-family: "Nanum Myeongjo", "Noto Serif KR", "Batang", serif;
    color: #111;
}
.cm-card,
.cm-detail-card {
    border: 1px solid #222;
    border-radius: 0;
    box-shadow: none;
}
.cm-title-main { font-weight: 900; }
.cm-title-sub { color: #666; }

.cm-btn-primary,
.cm-btn-ghost,
.cm-btn-danger,
.cm-quick-add-row button,
.cm-search-row button,
.cm-link-btn,
.cm-section-hamburger {
    border-radius: 0;
    border: 1px solid #111;
    background: #fff;
    color: #111;
}
.cm-btn-primary {
    background: #111;
    color: #fff;
}
.cm-btn-danger {
    border-color: #b91c1c;
    color: #b91c1c;
}
.cm-link-btn:hover { background: #f3f4f6; }

.cm-quick-add-row input,
.cm-search-row input {
    border-radius: 0;
    border: 1px solid #222;
    box-shadow: none;
}
.cm-quick-add-row input:focus,
.cm-search-row input:focus {
    border-color: #111;
    box-shadow: none;
}

.cm-list-item,
.cm-detail-grid,
.cm-section-title-row,
.cm-list,
.cm-detail-card table,
.cm-detail-card .cm-table,
.cm-detail-card .cm-table th,
.cm-detail-card .cm-table td {
    border-color: #222;
}

/* 고객 수정 모달 */
.cm-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1500;
    background: rgba(15, 23, 42, 0.62);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.cm-modal-backdrop[hidden] {
    display: none !important;
}

.cm-modal-panel {
    width: min(900px, 97vw);
    max-height: 86vh;
    overflow: auto;
    background: #fff;
    border: 1px solid #222;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.2);
    padding: 8px 10px 10px;
}

.cm-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.cm-modal-form {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.cm-modal-section {
    border: 1px solid #2f2f2f;
    padding: 6px 8px 8px;
    background: #fcfcfc;
}

.cm-modal-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.cm-modal-section-title {
    font-size: 11px;
    font-weight: 800;
    color: #111;
    letter-spacing: 0.02em;
}

.cm-modal-section > .cm-modal-section-title {
    display: block;
    margin-bottom: 6px;
}

.cm-modal-section--core {
    background: #fafafa;
}

.cm-modal-hint {
    margin-top: 6px;
    font-size: 10px;
    color: #4b5563;
}

.cm-modal-advanced-wrap {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.cm-btn-mini {
    padding: 4px 8px;
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
}

.cm-modal-grid {
    display: grid;
    grid-template-columns: repeat(16, minmax(0, 1fr));
    gap: 4px 6px;
    align-items: end;
}

.cm-modal-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    grid-column: span 4;
    min-width: 0;
}

.cm-modal-field--xs {
    grid-column: span 2;
}

.cm-modal-field--sm {
    grid-column: span 3;
}

.cm-modal-field--md {
    grid-column: span 4;
}

.cm-modal-field--lg {
    grid-column: span 6;
}

.cm-modal-field--chip {
    justify-self: start;
    max-width: 140px;
    width: 100%;
}

.cm-modal-field--short {
    justify-self: start;
    max-width: 220px;
    width: 100%;
}

.cm-modal-field--date {
    justify-self: start;
    max-width: 170px;
    width: 100%;
}

.cm-modal-field span {
    font-size: 10px;
    color: #666;
    font-weight: 800;
    line-height: 1.2;
}

.cm-modal-field input,
.cm-modal-field select,
.cm-modal-field textarea {
    border: 1px solid #222;
    border-radius: 0;
    padding: 4px 7px;
    font-size: 12px;
    line-height: 1.3;
    outline: none;
    background: #fff;
    color: #111;
    min-height: 28px;
}

.cm-modal-field--wide {
    grid-column: 1 / -1;
}

.cm-modal-field textarea {
    min-height: 44px;
}

.cm-modal-grid--memo .cm-modal-field--memo {
    grid-column: span 8;
}

.cm-modal-grid--memo .cm-modal-field--memo textarea {
    min-height: 50px;
}

.cm-modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid #222;
}

.cm-modal-actions .cm-btn-primary,
.cm-modal-actions .cm-btn-ghost {
    padding: 7px 12px;
    font-size: 12px;
}

body.cm-modal-open {
    overflow: hidden;
}

@media (max-width: 1100px) {
    .cm-modal-grid {
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }
    .cm-modal-field {
        grid-column: span 4;
    }
    .cm-modal-field--xs {
        grid-column: span 3;
    }
    .cm-modal-field--sm {
        grid-column: span 4;
    }
    .cm-modal-field--lg {
        grid-column: span 6;
    }
    .cm-modal-field--chip,
    .cm-modal-field--short,
    .cm-modal-field--date {
        max-width: none;
    }
    .cm-modal-grid--memo .cm-modal-field--memo {
        grid-column: span 12;
    }
}

@media (max-width: 760px) {
    .cm-modal-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .cm-modal-field,
    .cm-modal-field--xs,
    .cm-modal-field--sm,
    .cm-modal-field--md,
    .cm-modal-field--lg,
    .cm-modal-field--wide {
        grid-column: 1 / -1;
    }
}

/* ===================================================
   ✅ 개선 UI 추가 스타일 (모듈형 고객관리)
=================================================== */
.cm-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.cm-kpi-card {
    border: 1px solid #e5e7eb;
    padding: 10px 12px;
    background: #fff;
    border-radius: 12px;
}

.cm-kpi-label {
    font-size: 11px;
    color: #6b7280;
}

.cm-kpi-value {
    font-size: 16px;
    font-weight: 800;
}

.cm-quick-card {
    border: 1px dashed #d1d5db;
    padding: 10px;
    border-radius: 12px;
    margin-bottom: 10px;
    background: #fafafa;
}

.cm-quick-title {
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 6px;
}

.cm-filter-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.cm-filter-chip {
    border: 1px solid #d1d5db;
    background: #fff;
    padding: 5px 9px;
    font-size: 11px;
    cursor: pointer;
    border-radius: 999px;
    font-weight: 700;
    color: #374151;
}

.cm-filter-chip.active {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

.cm-sort-sep {
    color: #9ca3af;
    font-size: 11px;
    align-self: center;
    margin: 0 2px;
}

.cm-work-group-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.cm-detail-tabs {
    display: flex;
    gap: 6px;
    margin: 12px 0 8px;
    flex-wrap: wrap;
}

.cm-tab-btn {
    border: 1px solid #d1d5db;
    background: #fff;
    padding: 6px 12px;
    font-size: 11px;
    cursor: pointer;
    border-radius: 999px;
    font-weight: 700;
}

.cm-tab-btn.active {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

.cm-tab-panel {
    margin-top: 6px;
}

.cm-recent-row {
    display: flex;
    gap: 8px;
    margin: 6px 0 12px;
    flex-wrap: wrap;
}

.cm-recent-card {
    border: 1px solid #e5e7eb;
    padding: 8px 10px;
    background: #fff;
    border-radius: 12px;
    min-width: 180px;
}

.cm-recent-label {
    font-size: 11px;
    color: #6b7280;
}

.cm-recent-value {
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 980px) {
    .cm-kpi-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cm-recent-row {
        flex-direction: column;
    }
}

/* ===================================================
   ✅ 고객관리 UI v3.0 — 동선 중심 리프레시 (오버라이드)
=================================================== */
:root {
    --cm-ink: #0f172a;
    --cm-muted: #64748b;
    --cm-line: #e5e7eb;
    --cm-card: #ffffff;
    --cm-bg: #f6f7fb;
    --cm-accent: #1f7aec;
    --cm-accent-2: #22c55e;
    --cm-warn: #ef4444;
    --cm-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.cm-page-wrap {
    position: relative;
    background: var(--cm-bg);
    border-radius: 18px;
    padding: 22px 18px 28px;
    font-family: "SUIT", "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
    color: var(--cm-ink);
}

.cm-page-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 18px;
    background:
        radial-gradient(1200px 400px at 20% -10%, rgba(31, 122, 236, 0.12), transparent 60%),
        radial-gradient(900px 300px at 90% 0%, rgba(34, 197, 94, 0.10), transparent 60%);
    pointer-events: none;
}

.cm-page-wrap > * {
    position: relative;
    z-index: 1;
}

.cm-header-row {
    align-items: center;
    margin-bottom: 16px;
}

.cm-title-main {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -0.4px;
}

.cm-title-sub {
    font-size: 12.5px;
    color: var(--cm-muted);
}

.cm-btn-primary {
    background: linear-gradient(135deg, #1f7aec, #2a5bff);
    box-shadow: 0 6px 16px rgba(31, 122, 236, 0.25);
    padding: 10px 14px;
    border-radius: 12px;
}

.cm-btn-primary:hover {
    filter: brightness(1.02);
}

.cm-layout {
    gap: 16px;
}

.cm-card,
.cm-detail-card {
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: var(--cm-shadow);
    backdrop-filter: blur(6px);
}

@media (min-width: 1024px) {
    .cm-card {
        position: sticky;
        top: 16px;
        align-self: start;
    }
}

.cm-kpi-row {
    gap: 12px;
}

.cm-kpi-card {
    border: 0;
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    padding: 12px 14px;
}

.cm-kpi-value {
    font-size: 18px;
    font-weight: 900;
    color: var(--cm-ink);
}

.cm-quick-card {
    background: #ffffff;
    border: 1px dashed rgba(31, 122, 236, 0.35);
}

.cm-quick-title {
    color: var(--cm-ink);
}

.cm-search-row input,
.cm-quick-add-row input {
    border-radius: 12px;
    border-color: #dbe3f0;
}

.cm-search-row button,
.cm-quick-add-row button {
    border-radius: 12px;
}

.cm-filter-chip {
    border-color: #dbe3f0;
    color: #1f2937;
    background: #fff;
}

.cm-filter-chip.active {
    background: #111827;
    border-color: #111827;
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.15);
}

.cm-list {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 10px;
}

.cm-list-item {
    border-radius: 14px;
    border: 1px solid #edf2f7;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

.cm-list-item.active {
    border-color: rgba(31, 122, 236, 0.45);
    box-shadow: 0 0 0 3px rgba(31, 122, 236, 0.12);
}

.cm-li-name {
    font-size: 14.5px;
}

.cm-li-tag {
    background: rgba(31, 122, 236, 0.12);
    border-color: rgba(31, 122, 236, 0.25);
    color: #1e3a8a;
}

.cm-detail-header {
    border-bottom: 1px dashed #e2e8f0;
}

.cm-detail-name {
    font-size: 20px;
}

.cm-detail-tags .cm-tag {
    background: #ecfdf3;
    border-color: rgba(34, 197, 94, 0.25);
    color: #15803d;
}

.cm-detail-grid .cm-field-value {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.02);
}

.cm-detail-tabs {
    gap: 8px;
}

.cm-tab-btn {
    border-radius: 999px;
    padding: 7px 14px;
    border-color: #dbe3f0;
    font-weight: 800;
}

.cm-tab-btn.active {
    background: linear-gradient(135deg, #111827, #1f2937);
    border-color: #111827;
}

.cm-recent-card {
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    border: 0;
}

.cm-btn-danger {
    border-color: #fecaca;
    color: #b91c1c;
    background: #fff;
}

.cm-btn-danger:hover {
    background: #ffecec;
}

.cm-summary-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 8px 0 12px;
}

.cm-summary-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 10px 12px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.cm-summary-title {
    font-size: 11px;
    font-weight: 800;
    color: var(--cm-muted);
}

.cm-summary-main {
    margin-top: 4px;
    font-size: 14px;
    font-weight: 900;
    color: var(--cm-ink);
}

.cm-summary-dot {
    margin: 0 4px;
    color: #94a3b8;
}

.cm-summary-sub {
    margin-top: 4px;
    font-size: 11px;
    color: #64748b;
}

@media (max-width: 980px) {
    .cm-summary-row {
        grid-template-columns: 1fr;
    }
}

/* 모달이 페이지 하단에 붙는 문제 방지 (강제 오버레이) */
.cm-modal-backdrop {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 9999 !important;
}

.cm-modal-backdrop[hidden] {
    display: none !important;
}

/* 한눈에 요약(overview) */
.cm-glance-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 8px 0 12px;
}

.cm-glance-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.cm-glance-head {
    font-size: 11px;
    font-weight: 800;
    color: var(--cm-muted);
    margin-bottom: 6px;
}

.cm-glance-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: var(--cm-ink);
}

.cm-glance-item {
    display: flex;
    gap: 6px;
    align-items: center;
    line-height: 1.3;
}

.cm-glance-name {
    font-weight: 700;
}

.cm-glance-date {
    color: #64748b;
    font-size: 11px;
}

.cm-glance-dot {
    color: #94a3b8;
}

.cm-glance-empty {
    color: #9ca3af;
    font-size: 11px;
}

@media (max-width: 980px) {
    .cm-glance-row {
        grid-template-columns: 1fr;
    }
}

/* 그래프 */
.cm-graph-row {
    margin: 6px 0 12px;
}

.cm-graph-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 10px 12px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.cm-graph-head {
    font-size: 11px;
    font-weight: 800;
    color: var(--cm-muted);
    margin-bottom: 6px;
}

.cm-graph-body {
    min-height: 56px;
}

.cm-graph-empty {
    color: #9ca3af;
    font-size: 11px;
}

.cm-sparkline {
    width: 100%;
    height: 56px;
    display: block;
}

/* 한눈 표 */
.cm-quick-tables {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.cm-quick-table-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 8px 10px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.cm-quick-table-head {
    font-size: 11px;
    font-weight: 800;
    color: var(--cm-muted);
    margin-bottom: 6px;
}

.cm-mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    table-layout: fixed;
}
.cm-mini-table .cm-ellipsis {
    max-width: 0;
}

.cm-mini-table th,
.cm-mini-table td {
    padding: 6px 4px;
    border-bottom: 1px solid #eef2f7;
    text-align: left;
}

.cm-mini-table th {
    font-weight: 800;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 1100px) {
    .cm-quick-tables {
        grid-template-columns: 1fr;
    }
}
