/* 고객 관리(베타) 공통 스타일 — 이지고지 로고 색(진파랑 #0e5fae)에 맞춤 */
/* 기존 style.css 의 전역 button/input 규칙(너비 100%, 주황 배경, 큰 글씨)을 이 화면 안에서만 되돌린다.
   :where() 로 우선순위를 낮춰 아래 클래스 규칙이 그대로 적용되게 한다. */
:where(.cm-wrap, .cm-sheet) button { width: auto; margin: 0; padding: 0; background: none; color: inherit;
  font-size: inherit; font-weight: inherit; border-radius: 0; }
:where(.cm-wrap, .cm-sheet) button:hover { background: none; }
:where(.cm-wrap, .cm-sheet) input { width: auto; margin: 0; }
.cm-wrap { font-size: 15px; }
.cm-wrap { max-width: 720px; margin: 0 auto; padding: 16px 16px 96px; box-sizing: border-box; }
.cm-wrap *, .cm-sheet * { box-sizing: border-box; }
.cm-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 14px; }
.cm-top h1 { font-size: 20px; font-weight: 800; color: #1a1a2e; margin: 0; }
.cm-top .sub { font-size: 12px; color: #999; margin-top: 2px; }
.cm-back { display: inline-flex; align-items: center; gap: 4px; color: #888; font-size: 13px; text-decoration: none; margin-bottom: 8px; }
.cm-back:hover { color: #0e5fae; }
.cm-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cm-nav .cm-back { margin-bottom: 0; }
.cm-home { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: #0e5fae;
           background: #f1f7fd; border: 1.5px solid #cfe2f6; border-radius: 20px; padding: 5px 12px; text-decoration: none; }
.cm-home:hover { background: #0e5fae; color: #fff; border-color: #0e5fae; }
.cm-beta { font-size: 11px; font-weight: 800; color: #0b4f93; background: #e3effb; border-radius: 6px; padding: 2px 7px; vertical-align: middle; }

.cm-card { background: #fff; border: 1.5px solid #f0f0f0; border-radius: 16px; padding: 16px; margin-bottom: 12px;
           box-shadow: 0 2px 12px rgba(0,0,0,0.05); }
.cm-card h2 { font-size: 15px; font-weight: 800; color: #1a1a2e; margin: 0 0 10px; }
.cm-card h3 { font-size: 14px; font-weight: 800; color: #333; margin: 14px 0 8px; }
.cm-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13.5px; }
.cm-row .k { color: #888; flex-shrink: 0; }
.cm-row .v { color: #222; font-weight: 600; text-align: right; word-break: keep-all; }
.cm-muted { color: #999; font-size: 12.5px; }
.cm-note { font-size: 12px; color: #888; line-height: 1.6; }

.cm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: none; cursor: pointer;
          border-radius: 12px; padding: 11px 16px; font-size: 14px; font-weight: 700; text-decoration: none;
          background: #0e5fae; color: #fff; transition: filter .15s; }
.cm-btn:hover { filter: brightness(0.95); color: #fff; background: #0e5fae; }
.cm-btn.line:hover { background: #fff; color: #0e5fae; }
.cm-btn.gray:hover { background: #f1f1f4; }
.cm-btn.danger:hover { background: #fff; color: #dc2626; }
.cm-btn.line { background: #fff; color: #0e5fae; border: 1.5px solid #0e5fae; }
.cm-btn.gray { background: #f1f1f4; color: #444; }
.cm-btn.gray:hover { color: #222; }
.cm-btn.danger { background: #fff; color: #dc2626; border: 1.5px solid #fecaca; }
.cm-btn.block { width: 100%; }
.cm-btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.cm-btns { display: flex; gap: 8px; }
.cm-btns > * { flex: 1; }
.cm-fab { position: fixed; right: max(16px, calc(50% - 344px)); bottom: calc(20px + env(safe-area-inset-bottom));
          border-radius: 28px; padding: 14px 22px; box-shadow: 0 6px 20px rgba(14,95,174,0.35); z-index: 50; }

.cm-input, .cm-select, .cm-textarea { width: 100%; margin: 0; box-sizing: border-box; border: 1.5px solid #e5e5ea; border-radius: 12px; padding: 11px 13px;
          font-size: 15px; background: #fafafa; outline: none; }
.cm-input:focus, .cm-select:focus, .cm-textarea:focus { border-color: #0e5fae; background: #fff; }
.cm-label { display: block; font-size: 13px; font-weight: 700; color: #555; margin: 12px 0 6px; }
.cm-error { background: #fef2f2; color: #b91c1c; border-radius: 12px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 12px; }
.cm-consent { display: flex; gap: 10px; align-items: flex-start; background: #f1f7fd; border: 1.5px solid #fdd8b5;
              border-radius: 12px; padding: 12px; font-size: 13px; color: #0b4f93; line-height: 1.55; margin-top: 14px; }
.cm-consent input { width: 20px; height: 20px; margin-top: 1px; accent-color: #0e5fae; flex-shrink: 0; }

.cm-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.cm-chip { border: 1.5px solid #e5e5ea; background: #fff; color: #666; border-radius: 20px; padding: 6px 14px;
           font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer; }
.cm-chip:hover { background: #fff; }
.cm-chip.on, .cm-chip.on:hover { background: #0e5fae; border-color: #0e5fae; color: #fff; }

.cm-tag { display: inline-block; font-size: 11.5px; font-weight: 800; border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.tag-red { background: #fef2f2; color: #dc2626; }
.tag-blue { background: #eff6ff; color: #2563eb; }
.tag-green { background: #f0fdf4; color: #15803d; }
.tag-gray { background: #f1f1f4; color: #888; }
.tag-orange { background: #fff7ed; color: #c2410c; }
.tag-purple { background: #f5f3ff; color: #6d28d9; }
.tag-teal { background: #ecfeff; color: #0e7490; }

/* 판정 상태 */
.st-yes   { background: #fef2f2; color: #dc2626; }
.st-check { background: #fffbeb; color: #b45309; }
.st-no    { background: #f0fdf4; color: #15803d; }
.st-ask   { background: #f5f3ff; color: #6d28d9; }

/* 탭 */
/* 탭 막대: 모바일은 화면 맨 위에 붙는 흰 막대(좌우 끝까지), PC는 위쪽 메뉴 막대(62px) 바로 아래 */
.cm-tabs { display: flex; gap: 6px; overflow-x: auto; position: sticky; top: 0; z-index: 40;
           background: rgba(255,255,255,0.97); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
           margin: 0 -16px 10px; padding: 10px 16px; border-bottom: 1px solid #e8edf3;
           box-shadow: 0 4px 14px rgba(15,40,80,0.06); scrollbar-width: none; }
.cm-tabs::-webkit-scrollbar { display: none; }
.cm-tab { flex-shrink: 0; border: none; background: #f3f5f8; color: #6b7280; border-radius: 20px; padding: 8px 15px;
          font-size: 13.5px; font-weight: 700; cursor: pointer; border: 1.5px solid transparent; transition: background .15s, color .15s; }
.cm-tab:hover { background: #e9eef5; color: #374151; }
.cm-tab.on, .cm-tab.on:hover { background: #0e5fae; color: #fff; border-color: #0e5fae; box-shadow: 0 2px 8px rgba(14,95,174,0.25); }
.cm-panel { display: none; }
.cm-panel.on { display: block; }

/* 금액·카드 */
.cm-money { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cm-money div { background: #fafafa; border-radius: 12px; padding: 10px 4px; text-align: center; }
.cm-money .k { font-size: 11.5px; color: #888; }
.cm-money .v { font-size: 15px; font-weight: 800; color: #1a1a2e; margin-top: 2px; word-break: keep-all; }
.cm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cm-stat { width: 100%; background: #fff; border: 1.5px solid #f0f0f0; border-radius: 14px; padding: 12px; cursor: pointer; text-align: left; }
.cm-stat:hover { border-color: #0e5fae; }
.cm-stat .t { font-size: 13px; font-weight: 700; color: #333; }
.cm-stat .p { font-size: 11px; color: #aaa; }
.cm-stat .n { font-size: 20px; font-weight: 800; color: #0e5fae; margin-top: 4px; }
.cm-stat .n.zero { color: #ccc; font-size: 15px; }

/* 문항 */
.cm-q { border-top: 1px solid #f1f1f1; padding: 12px 0; }
.cm-q:first-child { border-top: none; }
.cm-q-title { font-size: 13.5px; font-weight: 700; color: #222; line-height: 1.5; margin-bottom: 8px; }
.cm-q-title b { color: #0e5fae; margin-right: 4px; }
.cm-item { background: #fafafa; border-radius: 12px; padding: 10px 12px; margin-bottom: 6px; }
.cm-item-head { display: flex; align-items: center; gap: 8px; }
.cm-item-head .lb { flex: 1; font-size: 13.5px; font-weight: 700; color: #333; }
.cm-yn { display: flex; gap: 4px; }
.cm-yn button { border: 1.5px solid #e5e5ea; background: #fff; color: #888; border-radius: 8px; padding: 4px 10px;
                font-size: 12.5px; font-weight: 700; cursor: pointer; }
.cm-yn button.on-yes { background: #dc2626; border-color: #dc2626; color: #fff; }
.cm-yn button.on-no  { background: #475569; border-color: #475569; color: #fff; }
.cm-ev { margin: 8px 0 0; padding: 0; list-style: none; }
.cm-ev li { font-size: 12.5px; color: #555; padding: 3px 0; display: flex; gap: 6px; flex-wrap: wrap; }
.cm-ev li .d { color: #999; min-width: 74px; }
.cm-ev li a { color: #2563eb; text-decoration: none; }
.cm-hint { font-size: 11.5px; color: #999; margin-top: 6px; line-height: 1.5; }

/* 방문(진료) 카드 */
.cm-visit { border: 1.5px solid #f0f0f0; border-radius: 14px; padding: 12px; margin-bottom: 8px; background: #fff; }
.cm-visit-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.cm-visit-head .h { font-size: 14px; font-weight: 800; color: #1a1a2e; }
.cm-visit-head .s { font-size: 12px; color: #999; margin-top: 2px; }
.cm-visit .tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.cm-visit details { margin-top: 8px; }
.cm-visit summary { font-size: 12.5px; font-weight: 700; color: #555; cursor: pointer; padding: 6px 0; }
.cm-sub { width: 100%; font-size: 12px; border-collapse: collapse; }
.cm-sub td, .cm-sub th { padding: 5px 4px; border-bottom: 1px solid #f3f3f3; text-align: left; vertical-align: top; }
.cm-sub th { color: #999; font-weight: 600; }
.cm-sec { scroll-margin-top: 120px; }

.cm-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cm-table th, .cm-table td { padding: 7px 6px; border-bottom: 1px solid #f1f1f1; text-align: right; white-space: nowrap; }
.cm-table th:first-child, .cm-table td:first-child { text-align: left; white-space: normal; min-width: 92px; }
@media (max-width: 420px) { .cm-table th, .cm-table td { padding: 7px 4px; font-size: 12px; } }
.cm-table th { color: #888; font-weight: 700; background: #fafafa; }
.cm-warn { background: #fef2f2; border: 1.5px solid #fecaca; color: #b91c1c; border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-bottom: 10px; }
.cm-info { background: #f8fafc; border: 1.5px solid #e2e8f0; color: #475569; border-radius: 12px; padding: 10px 12px; font-size: 12.5px; line-height: 1.6; margin-bottom: 10px; }

/* 서명 */
.cm-sign-pad { width: 100%; height: 180px; border: 2px dashed #d4d4d8; border-radius: 14px; background: #fff; touch-action: none; display: block; }
.cm-sign-img { max-width: 260px; width: 100%; border: 1.5px solid #eee; border-radius: 12px; background: #fff; }

/* 아래에서 올라오는 선택창 */
.cm-sheet-bg { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 500; }
.cm-sheet { display: none; position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 480px;
            background: #fff; border-radius: 22px 22px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); z-index: 501; }
.cm-sheet.on, .cm-sheet-bg.on { display: block; }
.cm-sheet h3 { font-size: 16px; font-weight: 800; text-align: center; margin: 0 0 14px; }
.cm-sheet a, .cm-sheet button.opt { display: block; width: 100%; text-align: left; border: 1.5px solid #eee; background: #fff;
            border-radius: 14px; padding: 14px 16px; margin-bottom: 8px; text-decoration: none; color: #222; }
.cm-sheet .t { font-size: 15px; font-weight: 800; }
.cm-sheet .s { font-size: 12px; color: #999; margin-top: 2px; }

.cm-toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: #1a1a2e; color: #fff;
            border-radius: 20px; padding: 10px 18px; font-size: 13.5px; z-index: 900; display: none; }

@media (max-width: 420px) {
  .cm-money .v { font-size: 13.5px; }
  .cm-grid { gap: 6px; }
}

/* 숨은 보험금 판정 */
.vd-ok    { background: #f0fdf4; color: #15803d; }
.vd-check { background: #fffbeb; color: #b45309; }
.vd-none  { background: #f1f1f4; color: #888; }
.vd-na    { background: #f1f7fd; color: #6d28d9; }
.ai-script { border-left: 3px solid #0e5fae; background: #f4f9fe; border-radius: 0 12px 12px 0; padding: 10px 12px; margin-bottom: 8px; }
.ai-script .t { font-size: 12.5px; font-weight: 800; color: #0b4f93; margin-bottom: 3px; }
.ai-script .x { font-size: 14px; color: #222; line-height: 1.65; }
.ai-weak { border: 1.5px solid #fde2c8; background: #f4f9fe; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.ai-weak .t { font-size: 13.5px; font-weight: 800; color: #0b4f93; margin-bottom: 6px; }
.ai-weak .row { display: flex; gap: 8px; font-size: 12.5px; line-height: 1.55; padding: 2px 0; }
.ai-weak .row .k { flex-shrink: 0; width: 62px; color: #0b4f93; font-weight: 700; }
.ai-weak .x { font-size: 13.5px; color: #222; line-height: 1.65; margin-top: 6px; padding-top: 6px; border-top: 1px dashed #fdd8b5; }

/* 현재 보험의 아쉬운 점 카드 */
.wk-head-title { margin: 18px 0 10px; font-size: 15px; font-weight: 800; color: #1a1a2e; display: flex; align-items: center; gap: 6px; }
.wk-head-title i { color: #0e5fae; }
.wk { background: #fff; border: 1.5px solid #f0f0f0; border-radius: 16px; padding: 14px; margin-bottom: 12px;
      box-shadow: 0 2px 10px rgba(0,0,0,0.04); border-left: 5px solid #0e5fae; }
.wk.wk-silson { border-left-color: #2a78d6; }
.wk-top { display: flex; align-items: center; gap: 8px; }
.wk-no { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: #f1f7fd; color: #0b4f93;
         font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.wk-silson .wk-no { background: #eff6ff; color: #1d4ed8; }
.wk-title { font-size: 16px; font-weight: 800; color: #1a1a2e; line-height: 1.4; margin-top: 8px; word-break: keep-all; }
.wk-kind { font-size: 11.5px; font-weight: 800; border-radius: 6px; padding: 2px 8px; background: #f1f7fd; color: #0b4f93; }
.wk-silson .wk-kind { background: #eff6ff; color: #1d4ed8; }
.wk-verdict { margin-left: auto; flex-shrink: 0; font-size: 12px; font-weight: 800; border-radius: 20px; padding: 4px 10px; white-space: nowrap; }
.v-keep { background: #dcfce7; color: #15803d; }
.v-switch { background: #dbeafe; color: #1d4ed8; }
.v-check { background: #fef3c7; color: #b45309; }
.v-fix { background: #fee2e2; color: #b91c1c; }
.wk-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 12px 0 2px; }
.wk-stats > div { background: #f8fafc; border-radius: 10px; padding: 8px 6px; text-align: center; }
.wk-stats span { display: block; font-size: 11px; color: #64748b; }
.wk-stats b { display: block; font-size: 13px; color: #0f172a; margin-top: 2px; word-break: keep-all; }
.wk-stats b.muted { color: #b45309; }
.wk-stats em { display: block; font-style: normal; font-size: 10.5px; color: #94a3b8; margin-top: 1px; word-break: keep-all; }
.wk-body { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.wk-row { display: flex; gap: 8px; align-items: flex-start; }
.wk-row .lab { flex-shrink: 0; width: 64px; text-align: center; font-size: 11.5px; font-weight: 800; border-radius: 8px; padding: 3px 0; }
.lab-now { background: #f1f5f9; color: #475569; }
.lab-gap { background: #fef2f2; color: #dc2626; }
.lab-fix { background: #f0fdf4; color: #15803d; }
.wk-row p { margin: 0; font-size: 13.5px; color: #334155; line-height: 1.55; word-break: keep-all; }
.wk-say { word-break: keep-all; margin-top: 10px; background: #f4f9fe; border-radius: 12px; padding: 10px 12px; font-size: 14px; color: #1f2937; line-height: 1.65; }
.wk-silson .wk-say { background: #f5f9ff; }
.wk-say-lab { display: block; font-size: 11.5px; font-weight: 800; color: #0b4f93; margin-bottom: 3px; }
.wk-silson .wk-say-lab { color: #1d4ed8; }
@media (max-width: 420px) {
  .wk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.daily-table td:first-child { white-space: normal; word-break: keep-all; min-width: 0; font-size: 12.5px; }
.daily-table td, .daily-table th { vertical-align: top; }
.daily-table td .cm-muted { font-size: 11px; font-weight: 400; }
.bh-table td:first-child { word-break: keep-all; }

/* 관리자: 다른 직원의 고객 보기 */
.cm-owner { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; background: #eef4ff; color: #1e3a8a;
  border: 1px solid #c7d7fe; border-radius: 10px; padding: 8px 12px; font-size: 13px; margin-bottom: 10px; }
.cm-owner span { color: #64748b; font-size: 12px; }
.cm-emp { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.cm-emp .av { width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; font-weight: 800; font-size: 17px; color: #fff; background: linear-gradient(135deg, #1b86cf, #0e5fae); }
.cm-emp .av.me { background: linear-gradient(135deg, #4facfe, #2a78d6); }
.cm-emp .av.br { background: linear-gradient(135deg, #34c3a3, #13917e); font-size: 19px; }
.cm-emp .av.br.none { background: linear-gradient(135deg, #b6bcc6, #8a919c); }
.cm-emp .body { flex: 1; min-width: 0; }
.cm-emp .nm { font-size: 15px; font-weight: 800; color: #1a1a2e; }
.cm-emp .meta { font-size: 12px; color: #888; margin-top: 2px; }
.cm-emp .bi-chevron-right { color: #bbb; }

/* PC 화면(860px 이상): 넓게, 목록은 2열 */
@media (min-width: 860px) {
  .cm-tabs { top: 62px; margin: 0 -24px 12px; padding: 10px 24px; border-radius: 0 0 14px 14px; }
  .cm-wrap { max-width: 960px; padding: 24px 24px 96px; }
  .cm-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
  .cm-list > .cm-card { margin: 0; }
  .cm-list > .cm-span { grid-column: 1 / -1; }
  .cm-fab { right: max(24px, calc(50% - 456px)); }
}

/* 보장 트렌드 점검 */
.trend-table td:first-child { word-break: keep-all; min-width: 0; }
.trend-table td, .trend-table th { vertical-align: top; }
.lab-trend { background: #e3effb; color: #0e5fae; }
.tx-list { margin: 4px 0 0; padding: 0; list-style: none; }
.tx-list li { display: flex; gap: 8px; justify-content: space-between; font-size: 12.5px; color: #475569; padding: 5px 0; border-top: 1px dashed #eef1f5; word-break: keep-all; }
.tx-list li b { flex-shrink: 0; color: #1a1a2e; }
.tx-group { border: 1px solid #eef1f5; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.tx-group summary { cursor: pointer; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13.5px; font-weight: 700; color: #1a1a2e; list-style: none; }
.tx-group summary::-webkit-details-marker { display: none; }
.tx-group summary .sum-r { margin-left: auto; font-size: 12.5px; font-weight: 600; color: #64748b; }
.tx-group.empty { background: #fafbfc; }
.trend-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
