/* =====================================================================
   admin/styles.css · v.4 (2026-10-23) — 준호 관리 화면(PWA)
   v.4 qa 낮음: 거래처 카드 사무소 전화 링크(.tel-link) 누르기 영역 44px
   v.3 2단계: 홈·실거래·단지 상세·중개사무소 — 시안 admin.css m2 의 w- 조각(실거래 웹앱 모양)·cx- 그래프 조각을 복사하고,
       맨 뒤 "관리 화면 2단계" 부분(고르기 창 ps-·빈 칸·오류·거래처 짝 맞추기 등)만 새로 씀
   v.2 [hidden] 이 .stack 에 덮이지 않게 (직접 등록 화면의 새 사무소 칸)
   v.1 처음 작성. 시안 docs/시안/admin-m2/admin.css v.2 에서 1단계 화면(로그인·접수·거래처·직접 등록·홈 카드)에
       쓰는 부분만 골라 복사하고, 맨 뒤 "관리 화면 1단계 추가" 부분만 새로 씀.
   - 시안 admin.css 앞부분 = 사장님 앱 app/styles.css v.7 복사본 → 웹앱 색(#0B6E99)으로 덮어씀 (m2 부분)
   - 실거래·중개사무소·단지 상세 조각(w- 목록·그래프)은 2단계 때 가져옴
   - 사장님 앱(app/)과는 따로 배포되는 파일 (Cloudflare Pages 프로젝트 junho-admin)
   ===================================================================== */

:root {
  --bg: #F6F5F2;
  --card: #FFFFFF;
  --line: #E4E2DC;
  --line2: #D6D3CC;
  --soft: #F1EFEA;
  --ink: #1B1F24;
  --ink2: #3F444B;
  --muted: #5B6068;
  --accent: #195899;       /* 기본 (버튼·켜진 탭·링크 글씨) */
  --accent-soft: #E8F2FB;  /* 연한 바탕 */
  --accent-soft2: #E8F2FB; /* (예전 두 번째 연한 바탕 — 이제 같은 색) */
  --point: #0099E8;        /* 포인트: 글씨에는 쓰지 않음 (흰 바탕 대비 3.2) — 선·아이콘·강조 테두리만 */
  --hot: #9A3412;
  --hot-bg: #FDEBDD;
  --t: #195899;    /* 매매 글씨 */
  --t-bg: #E8F2FB; /* 매매 바탕 */
  --j: #5B3E96;    /* 전세 글씨 */
  --j-bg: #EFEAF7; /* 전세 바탕 */
  --w: #4A4E55;    /* 월세 글씨 */
  --w-bg: #EEEDEA; /* 월세 바탕 */
  --high-dot: #D92D20;              /* 그래프 신고가 빨간 점 */
  --high-bg: #FDEDEA;               /* v.7 신고가 줄 바탕 (기존 실거래 웹앱과 같은 색) */
  --high-line: #F1C6BF;             /* v.7 신고가 줄 테두리 */
  --high-badge: #A3261C;            /* v.7 신고가 배지 바탕 (흰 글씨 대비 약 7.4) */
  --chart-bar: rgba(25, 88, 153, .22); /* 그래프 월 거래 건수 막대 (기본색 #195899 를 옅게) */
  --off: #656A72;
  --danger: #B42318;
  --r: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Noto Sans KR', 'Noto Sans CJK KR', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden; /* 화면 안의 main 만 스크롤 */
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }

/* ---------- 틀 ---------- */
/* v.3: 높이(100dvh)로 틀 크기를 정하지 않고 화면에 못 박는다 (position: fixed).
   안드로이드 크롬 홈 화면 앱을 처음 켤 때 100dvh 가 실제 보이는 높이보다 크게 잡히고 다시 안 계산되면,
   맨 아래 탭이 화면 밖으로 밀리고 바로 위 "우리은행 이준호" 줄만 보이는 일이 있었음(준호 갤럭시).
   fixed + top/bottom 0 은 화면 크기가 바뀔 때마다 브라우저가 다시 맞춘다.
   --app-gap: main.js 가 "보이는 높이 < 화면 높이"를 발견했을 때만 아래를 그만큼 띄우는 대비책 (평소 0). */
#app {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--app-gap, 0px);
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* 틀 밖으로 넘치는 것 없이, 스크롤은 안쪽 main(.scroll)만 */
  background: var(--bg);
  padding-top: var(--safe-t);
}
.boot { margin: auto; color: var(--muted); font-weight: 700; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.top {
  padding: 16px 16px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}
.top h1 { margin: 0; font-size: 22px; font-weight: 700; }
.top-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.office { font-size: 13px; min-height: 1em; }
.scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px 20px;
}
.stack { display: flex; flex-direction: column; gap: 10px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.actionbar { padding: 8px 16px; background: var(--bg); flex-shrink: 0; }

/* 아래 탭 */
.tabs {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--card); border-top: 1px solid var(--line);
  padding: 4px 0 calc(6px + var(--safe-b));
  flex-shrink: 0;
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 52px; padding: 6px 0; border: 0; background: none;
  color: var(--muted); font-size: 12px; cursor: pointer;
}
.tab.on { color: var(--accent); font-weight: 700; }


/* ---------- 글자 ---------- */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.small-t { font-size: 13px; }
.b { font-weight: 700; }
.b5 { font-weight: 500; }
.n { font-weight: 400; }
.h2 { font-size: 20px; font-weight: 700; }
.big-t { font-size: 16px; }
.center { text-align: center; }
.pad { padding: 16px; }
.accent { color: var(--accent); }
.warn-text { color: var(--hot); }
.err { color: var(--danger); font-size: 14px; }
.err:empty { display: none; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grow { flex: 1; min-width: 0; }
.col { display: flex; flex-direction: column; }
.minw0 { min-width: 0; }
.sec { font-size: 13px; font-weight: 700; color: var(--ink2); margin-top: 4px; }
.memo { white-space: pre-wrap; word-break: break-word; font-size: 14px; color: var(--ink2); line-height: 1.6; }
.ico { display: inline-flex; flex-shrink: 0; }
.ico.accent { color: var(--point); } /* 아이콘만 포인트색 (글씨 아님) */

/* ---------- 칸·버튼 ---------- */
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid2.full { width: 100%; }
.field-s { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); min-width: 0; }
.field-s select, .sel {
  height: 44px; border-radius: 12px; border: 1px solid var(--line2); background: #fff;
  font-size: 15px; color: var(--ink); padding: 0 8px; width: 100%; min-width: 0;
}
.searchbox {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px;
  border-radius: 12px; background: var(--soft); color: var(--muted);
}
.searchbox input { border: 0; background: transparent; font-size: 15px; flex: 1; min-width: 0; outline: none; color: var(--ink); height: 44px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  height: 44px; min-height: 44px; padding: 0 14px; border-radius: 22px;
  border: 1px solid var(--line2); background: #fff; font-size: 14px; cursor: pointer;
}
.chip.sm { font-size: 13px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid transparent;
  font-size: 15px; font-weight: 500; cursor: pointer; text-decoration: none; text-align: center;
}
.btn.big { min-height: 52px; font-size: 17px; font-weight: 700; border-radius: 14px; width: 100%; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:disabled { background: #CFCCC5; color: var(--ink2); cursor: not-allowed; }
.btn.line { background: #fff; border-color: var(--line2); color: var(--ink); }
.btn.line:disabled { color: var(--off); background: var(--soft); }
.btn.soft { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-line { background: transparent; border-color: var(--line2); color: var(--danger); margin-top: 8px; }
.btn-s {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 10px;
  border-radius: 10px; border: 1px solid var(--line2); background: #fff; color: var(--ink2);
  font-size: 13px; cursor: pointer; white-space: nowrap;
}
.btn-s.strong { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.btn-s:disabled { opacity: .5; }
.head-btns { display: flex; gap: 6px; }
.icon-btn { min-width: 44px; min-height: 44px; border: 0; background: none; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; }
.icon-btn:disabled { opacity: .3; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; border: 0; background: none; color: var(--ink2); font-size: 14px; padding: 0; cursor: pointer; align-self: flex-start; }
.link { color: var(--accent); font-weight: 700; white-space: nowrap; }

.inp {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line2);
  background: #fff; font-size: 16px; /* 16px 미만이면 아이폰이 확대함 */
}
.inp.area { padding: 12px 14px; min-height: 84px; resize: vertical; line-height: 1.5; }
.inp.area.tall { min-height: 160px; }
.inp.date { width: 148px; min-height: 44px; padding: 0 8px; font-size: 15px; flex-shrink: 0; }
.inp:disabled { background: var(--soft); color: var(--off); border-color: var(--line); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.choice {
  min-height: 48px; border-radius: 12px; border: 1px solid var(--line2); background: #fff;
  font-size: 15px; cursor: pointer;
}
.grid3.small .choice { min-height: 44px; font-size: 13px; border-radius: 10px; }
.choice.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500; }
.chk { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); flex-shrink: 0; }
.consent { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.5; cursor: pointer; min-height: 44px; padding-top: 4px; }
.pick { display: flex; align-items: center; gap: 10px; min-height: 48px; cursor: pointer; }
.pick.card { align-items: flex-start; }

/* ---------- 카드 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.card.small-card { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.card.strong-border, .card.lead { border: 2px solid var(--point); } /* 강조 테두리 = 포인트색 */
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.card-title.nomargin { margin: 0; }
.notice {
  display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--ink2);
  line-height: 1.55; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft);
}
.notice .ico { color: var(--accent); margin-top: 2px; } /* 연한 파랑 바탕 위라 포인트색(대비 2.8)이 아니라 기본색 */
.banner {
  display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 1.5;
  padding: 10px 12px; border-radius: 12px; text-align: left; width: 100%;
}
.banner.warn { background: var(--hot-bg); color: #7C2D12; border: 0; }
.banner.ok { background: var(--accent-soft2); color: var(--accent); }
.banner.as-btn { cursor: pointer; min-height: 44px; }
.row-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }


/* 접수 현황 */
.tile { background: var(--soft); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile-v { font-size: 20px; font-weight: 700; }
.pill { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 8px; white-space: nowrap; flex-shrink: 0; }
.pill.s0 { background: var(--soft); color: var(--ink2); }
.pill.s1 { background: var(--t-bg); color: var(--t); }
.pill.s2 { background: var(--accent); color: #fff; } /* v.4 승인: 상담중(연한 파랑)과 구별 */
.pill.s3 { background: var(--ink); color: #fff; }
.pill.stop { background: var(--line); color: var(--muted); }
.dchip { font-size: 12px; color: var(--ink2); background: var(--soft); padding: 3px 8px; border-radius: 6px; }
.dchip.hot { color: var(--hot); background: var(--hot-bg); font-weight: 700; }

.ok-dot { width: 28px; height: 28px; border-radius: 14px; background: var(--accent-soft2); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }

/* 안내 화면 (카톡·링크 없음·아이폰 설치) */
.guard { margin: auto; min-height: 0; padding: 24px 20px; display: flex; flex-direction: column; gap: 14px; text-align: center; width: 100%; max-width: 420px; overflow-y: auto; }
.guard-icon { width: 64px; height: 64px; border-radius: 32px; background: var(--accent-soft2); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; margin: 0 auto; }
.steps-ol { text-align: left; margin: 0; padding-left: 22px; line-height: 1.8; color: var(--ink2); }


/* 알림 띠·창 */
#toast {
  /* 위쪽에 띄움 (아래 [고객 추가]·전화 버튼을 가리지 않게) */
  position: fixed; left: 50%; top: calc(12px + var(--safe-t)); transform: translateX(-50%) translateY(-20px);
  max-width: calc(100% - 32px); width: max-content; background: var(--ink); color: #fff; padding: 12px 16px;
  border-radius: 12px; font-size: 14px; line-height: 1.5; opacity: 0; pointer-events: none; transition: .2s; z-index: 50;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.modal { position: fixed; inset: 0; bottom: var(--app-gap, 0px); /* 틀과 같이 아래를 띄움 (v.3) */ background: rgba(27, 31, 36, .45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 40; }
.modal-box { background: #fff; border-radius: 16px; padding: 18px; width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 10px; }
.modal-title { font-size: 17px; font-weight: 700; }
.modal-body { font-size: 14px; color: var(--ink2); line-height: 1.55; }
.modal-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.modal-btns.stack { grid-template-columns: 1fr; }
.sheet-wrap { align-items: flex-end; padding: 0; }
.sheet { background: var(--bg); width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 8px 16px calc(20px + var(--safe-b)); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; position: sticky; top: -8px; background: var(--bg); padding: 4px 0; z-index: 1; }
.sheet .pick { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.stack.tight { gap: 8px; }

/* =====================================================================
   관리 화면 추가 (admin-m1 v.1)
   ===================================================================== */

/* 맨 위 가는 강조색 줄 — 사장님 앱과 한눈에 구별 */
#app { border-top: 4px solid var(--accent); }

/* 머리 첫 줄: [관리] 표시 + 이준호 상담사 + 로그아웃 */
.adm-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; }
.adm-who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-width: 0; }
.adm-badge {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 6px;
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .02em; flex-shrink: 0;
}
.adm-out { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin: -8px -6px -8px 0; padding: 0 6px; border: 0; background: none; color: var(--muted); font-size: 13px; }

/* 아래 탭 숫자 점 (새 접수) */
.tab .tab-ico { position: relative; display: inline-flex; }
.tab .nbadge {
  position: absolute; top: -5px; right: -12px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}

/* 접수 카드 */
.lead { display: flex; flex-direction: column; gap: 8px; }
.lead.new { border: 2px solid var(--point); }
.lead.stopped { background: #FAF9F7; }
.lead-name { font-size: 18px; font-weight: 700; }
.newtag { font-size: 11px; font-weight: 700; color: #fff; background: var(--danger); padding: 2px 6px; border-radius: 5px; flex-shrink: 0; }
.route { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 5px; flex-shrink: 0; }
.route.app { color: var(--accent); background: var(--accent-soft); }
.route.other { color: #7C2D12; background: var(--hot-bg); }
.meta { font-size: 13px; color: var(--ink2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dup {
  display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; line-height: 1.45;
  color: #7C2D12; background: var(--hot-bg); border-radius: 8px; padding: 6px 8px;
}
.dup .ico { margin-top: 1px; }
.callrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.callbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--accent); color: var(--accent); background: #fff; text-decoration: none;
  font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.callbtn.sms { font-weight: 500; padding: 0 14px; }

/* 단계 버튼 줄 (5칸) */
.stages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.stg {
  min-height: 44px; padding: 0 2px; border-radius: 10px; border: 1px solid var(--line2); background: #fff;
  color: var(--ink2); font-size: 12.5px; white-space: nowrap; letter-spacing: -.02em;
}
.stg.past { background: var(--accent-soft); border-color: #BFD5EC; color: var(--accent); }
.stg.now { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.stg.stop { background: var(--soft); color: var(--muted); }
.stg.stop.now { background: #6B7078; border-color: #6B7078; color: #fff; }
.stg-hint { font-size: 12px; color: var(--muted); }

/* 메모 한 줄 + 저장 */
.memo-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.memo-row .inp { min-height: 44px; font-size: 16px; }
.memo-lab { font-size: 12px; color: var(--muted); }

/* 되돌리기 띠 (탭 바로 위, 몇 초 뒤 사라짐) */
.undo {
  position: relative; display: flex; align-items: center; gap: 10px; margin: 0 10px 8px; padding: 6px 6px 6px 14px;
  background: var(--ink); color: #fff; border-radius: 12px; font-size: 14px; line-height: 1.4; flex-shrink: 0; overflow: hidden;
  box-shadow: 0 4px 14px rgba(27, 31, 36, .18);
}
.undo .grow { padding: 6px 0; }
.undo-btn { min-height: 44px; padding: 0 14px; border-radius: 9px; border: 0; background: #fff; color: var(--ink); font-weight: 700; font-size: 14px; flex-shrink: 0; }
.undo-left { position: absolute; left: 0; bottom: 0; height: 3px; width: 62%; background: var(--point); }

/* 위 요약 숫자 3칸 (작게) */
.mini-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.mini-tiles .tile { padding: 6px 10px; }
.mini-tiles .tile-v { font-size: 17px; }
.tile-v.hot { color: var(--danger); }

/* 사무소 카드 */
.office-card { display: flex; flex-direction: column; gap: 10px; }
.o-name { font-size: 17px; font-weight: 700; }
.o-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; background: var(--bg); border-radius: 10px; padding: 8px 4px; }
.o-num { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; }
.o-num .v { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.o-num .k { font-size: 11.5px; color: var(--muted); white-space: nowrap; letter-spacing: -.02em; }
.o-num .v.zero { color: var(--off); font-weight: 500; }
.lk { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; white-space: nowrap; flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px; }
.lk.on { color: #1E6B3A; background: #E6F3EA; }
.lk.none { color: var(--muted); background: var(--soft); }
.lk.cut { color: var(--danger); background: #FCEBE9; }
.o-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.btn-s.warn { color: #8A3A10; border-color: #E8C9B5; background: #FFF7F2; }
.btn-s.dang { color: var(--danger); border-color: #F0C4BF; }

/* 링크 발급 화면 */
.linkbox {
  display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 12px; border: 1px dashed var(--accent);
  background: var(--accent-soft); font-family: ui-monospace, Consolas, monospace; font-size: 14px; color: var(--ink); word-break: break-all;
}
.msg-prev { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; color: var(--ink2); }
.flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.flow .f { font-size: 12px; text-align: center; padding: 6px 2px; border-radius: 8px; background: var(--soft); color: var(--muted); }
.flow .f.done { background: var(--accent-soft); color: var(--accent); }
.flow .f.now { background: var(--accent); color: #fff; font-weight: 700; }

/* 단계 이력 */
.hist { display: flex; flex-direction: column; }
.hist-i { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 10px; padding-bottom: 12px; position: relative; }
.hist-i::before { content: ''; position: absolute; left: 6px; top: 14px; bottom: 0; width: 2px; background: var(--line); }
.hist-i:last-child { padding-bottom: 0; }
.hist-i:last-child::before { display: none; }
.hist-dot { width: 14px; height: 14px; border-radius: 7px; background: var(--accent); margin-top: 3px; }
.hist-dot.old { background: #C9C6BF; }
.hist-t { font-size: 14px; font-weight: 700; }
.hist-s { font-size: 12.5px; color: var(--muted); }

/* 로그인 */
.login { margin: auto 0; padding: 24px 20px; display: flex; flex-direction: column; gap: 14px; }
.login-logo { width: 64px; height: 64px; border-radius: 18px; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.login h1 { margin: 0; font-size: 24px; }

/* 시안 표시 */
.mock-note { font-size: 12px; color: var(--off); text-align: center; padding: 12px 0 4px; }
.req { color: var(--danger); font-weight: 700; }
.choice:disabled { color: var(--off); background: var(--soft); }
.sel-lg { height: 48px; font-size: 16px; }
/* 스크롤 칸 안의 카드·입력이 눌려 글자가 겹치지 않게 (동의 체크 카드) */
.scroll.stack > * { flex-shrink: 0; }

/* =====================================================================
   admin-m2 추가 (v.2) — 기존 실거래 웹앱(WebPage.html v.19) 느낌으로 맞춤
   1) 색·글꼴: 웹앱 :root 색 이름을 그대로 가져와 위 m1 색을 덮어씀
   2) 하단 탭 5개 (홈 · 접수 · 거래처 · 실거래 · 중개사무소)
   3) 웹앱 화면 조각: 이름 앞에 w- 를 붙여서 m1 의 .chip·.card·.hist 와 섞이지 않게 함
   ===================================================================== */

/* ---- 1) 색 (웹앱 밝은 화면 색) ---- */
:root {
  --bg: #F4F6F9;          /* 웹앱 --bg */
  --card: #FFFFFF;
  --line: #DDE3EA;        /* 웹앱 --line */
  --line2: #CDD5DE;
  --soft: #EEF2F6;
  --ink: #16202E;         /* 웹앱 --ink */
  --ink2: #2E3A4A;
  --muted: #4A5565;       /* 웹앱 --sub */
  --off: #5F6B7A;
  --accent: #0B6E99;      /* 웹앱 --accent */
  --accent-soft: #E3F1F7; /* 웹앱 --soft */
  --accent-soft2: #E3F1F7;
  --point: #0B6E99;
  --soft-ink: #0A5A7D;    /* 웹앱 --soft-ink */
  --chip: #DCE2E9;        /* 웹앱 --chip */
  --high: #A3261C; --high-bg: #FDEDEA; --high-line: #F1C6BF; --high-badge: #A3261C;
  --up: #1B6B3A; --up-bg: #E3F2E8; --down: #7A4300; --down-bg: #FCEBD5;
  --t: #0B6E99; --t-bg: #E3F1F7;
  --r: 12px;              /* 웹앱 카드 모서리 */
}
body { font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif; }
.stg.past { border-color: #B5D8E8; }

/* ---- 2) 하단 탭 5개 ---- */
.tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tab { font-size: 11px; letter-spacing: -.02em; text-decoration: none; min-height: 56px; justify-content: center; }
.tab .nbadge { right: -14px; }

/* ---- 3) 웹앱 화면 조각 ---- */
.nw { white-space: nowrap; }
.cut { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-sub { color: var(--muted); font-size: 12px; }
.w-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; }
a.w-card, a.w-item { color: var(--ink); text-decoration: none; }

/* 홈 */
.w-alert { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; min-height: 64px; border-radius: 12px; border: 2px solid var(--accent);
  background: var(--card); color: var(--ink); text-decoration: none; }
.w-alert-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.w-alert-t { display: block; font-size: 16px; font-weight: 700; }
.w-alert-t b { font-weight: 700; }
.w-alert-t b.hot { color: var(--danger); }
.w-alert > .ico { color: var(--muted); }
.w-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.w-tile { display: flex; flex-direction: column; gap: 1px; padding: 10px 14px; text-align: left; }
.w-tile .num { font-size: 22px; font-weight: 700; white-space: nowrap; }
.w-tile.high { background: var(--high-bg); border-color: var(--high-line); } .w-tile.high .num { color: var(--high); }

/* =====================================================================
   관리 화면 1단계 추가 (admin v.1) — 시안에 없던 실제 동작용 모양
   ===================================================================== */

/* 접수 상세 칸 (시안 admin.css 310·323줄 복사) */
.kv { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 6px 10px; font-size: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; word-break: break-word; }
.kv.wide { grid-template-columns: 84px minmax(0, 1fr); }

/* 가짜 자료 모드(?mock=1) 표시 — 실제 서버가 아님을 한눈에 */
.mock-ribbon {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 26px; padding: 3px 10px; background: #FFF4D6; color: #6B4A00; font-size: 12px; font-weight: 700;
  border-bottom: 1px solid #F0DCA0;
}

/* 불러오는 중 · 빈 목록 · 오류 */
.state-box { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 36px 12px; color: var(--muted); font-size: 14px; }
.state-box .btn { min-width: 160px; }
.skel { height: 148px; border-radius: var(--r); background: linear-gradient(90deg, var(--soft), #F7F9FB, var(--soft)); background-size: 200% 100%; animation: skel 1.2s infinite linear; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

/* 단계 버튼: 저장 중에는 흐리게 */
.stages.busy { opacity: .55; pointer-events: none; }
.stg:disabled { opacity: .45; }
.lead.purged { background: #FAFBFC; }
.lead.purged .lead-name { color: var(--muted); font-weight: 500; font-size: 15px; }
a.btn-s { text-decoration: none; justify-content: center; }
.lead .open-btn { justify-content: center; }

/* 되돌리기 띠: 남은 시간 막대가 줄어듦 (시간은 화면 코드가 transition 으로 줌) */
.undo-slot:empty { display: none; }
.undo-left { width: 100%; transition-property: width; transition-timing-function: linear; }
.undo-left.go { width: 0; }

/* 메모 글자 수 */
.memo-count { font-size: 12px; color: var(--muted); }
.memo-count.over { color: var(--danger); font-weight: 700; }

/* 준비 중 한 장 */
.soon { margin: auto 0; padding: 28px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.soon-ico { width: 64px; height: 64px; border-radius: 18px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.soon h2 { margin: 0; font-size: 19px; }
.soon ul { text-align: left; margin: 0; padding-left: 20px; color: var(--ink2); font-size: 14px; line-height: 1.8; }

/* 홈: 새 접수 카드 아래 숫자 2칸 */
.home-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.home-tiles .w-tile { cursor: pointer; border: 1px solid var(--line); font: inherit; color: inherit; }
.home-tiles .w-tile.hot .num { color: var(--danger); }
.w-alert { cursor: pointer; width: 100%; font: inherit; text-align: left; }

/* 탭: <button> 으로 만들어서 기본 모양 지우기 */
button.tab { font-family: inherit; }
.tab:focus-visible, .chip:focus-visible, .stg:focus-visible, .btn:focus-visible, .btn-s:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 직접 등록: 소개 경로 3칸, 상품 고르기 다시 누르면 꺼짐 */
.grid3 .choice[aria-pressed="true"] { font-weight: 700; }
.consent.card { padding: 12px 14px; }
.link-btn { border: 0; background: none; padding: 0; min-height: 44px; text-align: left; font-size: 13px; color: var(--accent); font-weight: 700; cursor: pointer; align-self: flex-start; }

/* 링크 화면: 링크 글자는 줄바꿈 허용 */
.linkbox .url { min-width: 0; overflow-wrap: anywhere; }

/* 로그인 화면: 전체 스크롤 */
.login-wrap { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.login .btn.big:disabled { opacity: .7; }
/* 보낼 글 미리보기: 긴 링크가 칸 밖으로 넘치지 않게 */
.msg-prev { overflow-wrap: anywhere; }
[hidden] { display: none !important; } /* v.2 .stack(flex) 이 hidden 을 덮지 않게 */

/* =====================================================================
   관리 화면 2단계 (styles v.3) — 시안 admin-m2 admin.css 의 w- 조각(웹앱 모양) 복사 + 실제 동작용 몇 가지
   ===================================================================== */
/* w- 단추들: 글꼴·글자색은 바탕을 따름 (:where = 우선순위 0 이라 아래 크기 규칙을 덮지 않음) */
:where(button.w-card, .w-item, .w-chip, .w-round, .w-seg button, .w-switch button, .w-cats button, .w-wide, .w-reg, .w-client-row) { font-family: inherit; color: inherit; cursor: pointer; line-height: 1.4; }
:root { --chart-bar: rgba(11, 110, 153, .22); }

/* 회색 바탕 고르기 (매매/전세/월세, 동별/단지별) */
.w-seg { display: grid; background: var(--chip); border-radius: 10px; padding: 3px; }
.w-seg button { height: 44px; border: none; border-radius: 8px; background: transparent; color: var(--muted); font-size: 15px; white-space: nowrap; padding: 0 10px; }
.w-seg button.on { background: var(--card); color: var(--ink); font-weight: 700; }
/* 실거래 맨 위 [거래 | 신고가] 전환 (아래 매매/전세 고르기와 헷갈리지 않게 강조색 테두리) */
.w-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 168px; border: 1px solid var(--accent); border-radius: 10px; overflow: hidden; flex-shrink: 0; }
.w-switch button { height: 44px; border: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; color: var(--accent); background: var(--card); }
.w-switch button.on { background: var(--accent); color: #fff; font-weight: 700; }
/* 조건 칸 (▾) · 둥근 기간 버튼 */
.w-chips { display: grid; gap: 8px; margin-top: 8px; }
.w-chip { height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font-size: 14px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--soft-ink); font-weight: 700; }
.w-chip:disabled { opacity: .45; cursor: default; }
.w-round { height: 44px; border: 1px solid var(--line); border-radius: 22px; background: var(--card); font-size: 14px; white-space: nowrap; padding: 0 8px; }
.w-round.on { border-color: var(--accent); background: var(--accent); color: #fff; font-weight: 700; }
/* 목록 */
.w-list { overflow: hidden; }
.w-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: none; border-bottom: 1px solid var(--line); background: none; width: 100%; text-align: left; font-size: 14px; }
.w-item:last-child { border-bottom: none; }
.w-rank { flex: none; width: 20px; font-size: 17px; font-weight: 700; color: var(--muted); }
.w-rank.first { color: var(--accent); }
.w-rank.hot { color: var(--high); }
.w-name { font-size: 16px; font-weight: 700; }
.w-price { font-size: 17px; font-weight: 700; white-space: nowrap; }
.w-tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; white-space: nowrap; vertical-align: 2px; }
.w-tag.high { color: #fff; background: var(--high-badge); }
.w-tag.up { color: var(--up); background: var(--up-bg); }
.w-tag.down { color: var(--down); background: var(--down-bg); }
.w-tag.first { color: var(--ink2); background: var(--soft); }
.w-deal { display: flex; align-items: center; gap: 10px; padding: 11px 12px; width: 100%; text-align: left; font-size: 14px; margin-top: 8px; }
.w-deal.high { background: var(--high-bg); border-color: var(--high-line); }
.w-note { font-size: 12px; color: var(--muted); padding: 8px 4px 0; }
.w-head2 { display: flex; align-items: center; gap: 8px; padding: 14px 0 8px; }
.w-head2 h2 { margin: 0; font-size: 16px; font-weight: 700; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* 홈 */
.w-tile.up { background: var(--up-bg); } .w-tile.up .num { color: var(--up); }
.w-bars { flex: none; display: flex; align-items: flex-end; gap: 2px; height: 26px; }
.w-bars i { display: block; width: 5px; min-height: 2px; background: var(--chip); border-radius: 1px; }
.w-bars i:last-child { background: var(--accent); }
.w-right { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; }
.w-count { font-size: 15px; font-weight: 700; }
/* 거래 요약 3칸 */
.w-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.w-stat { padding: 7px 10px; }
.w-stat b { display: block; font-size: 16px; white-space: nowrap; }
.w-stat.high { background: var(--high-bg); border-color: var(--high-line); }
/* 중개사무소 */
.w-cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.w-cats button { height: 48px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font-size: 14px; white-space: nowrap; }
.w-cats button.on { border-color: var(--up); background: var(--up-bg); color: var(--up); font-weight: 700; }
.w-field { margin-top: 8px; }
.w-field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.w-field input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font-size: 16px; }
.w-office { padding: 11px 12px; margin-top: 8px; }
.w-maps { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; margin-top: 8px; }
.w-map { height: 44px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; white-space: nowrap; color: var(--ink); text-decoration: none; background: var(--card); }
.w-map.kakao { border-color: var(--accent); background: var(--accent-soft); color: var(--soft-ink); font-weight: 700; }
.w-wide { width: 100%; min-height: 48px; padding: 8px 12px; margin-top: 10px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent-soft); color: var(--soft-ink); font-size: 14px; font-weight: 700; }
.w-wide:disabled { opacity: .6; cursor: default; }
.w-client { display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0; height: 24px; padding: 0 8px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; }
.w-client-row { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; margin-top: 8px; padding: 0 10px 0 12px; border: 0; border-radius: 8px; background: var(--accent-soft); color: var(--ink2); font-size: 13px; text-align: left; }
.w-client-row .accent { display: inline-flex; align-items: center; gap: 2px; color: var(--soft-ink); flex-shrink: 0; }
.w-reg { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 44px; margin-top: 8px; border-radius: 8px; border: 1px dashed var(--accent); color: var(--soft-ink); font-size: 14px; font-weight: 700; background: var(--card); }
.w-office-head { align-items: flex-start; }
.w-office-head .w-name { overflow-wrap: anywhere; }
.w-pair { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
/* 단지 상세 */
.w-cx-title { margin: 0; font-size: 22px; font-weight: 700; word-break: keep-all; overflow-wrap: anywhere; }
.cx-top { gap: 4px; }
.w-areas { display: flex; flex-wrap: wrap; gap: 8px; }
.w-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.w-max { padding: 10px 14px; display: flex; flex-direction: column; }
.w-max b { display: block; font-size: 19px; white-space: nowrap; }
.w-chart { padding: 12px 12px 8px; margin-top: 10px; }
.w-hist { display: grid; grid-template-columns: 96px 52px minmax(0, 1fr); align-items: center; gap: 4px; padding: 11px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.w-hist:last-child { border-bottom: none; }
.w-hist.high { background: var(--high-bg); }
.w-hist .p { text-align: right; font-size: 16px; font-weight: 700; white-space: nowrap; }
.w-hist-sub { display: block; font-weight: 400; }
/* 12개월 그래프 (사장님 앱 complex 그래프 조각, 색은 웹앱) */
.cx-svg { display: block; width: 100%; height: auto; margin-top: 6px; overflow: visible; }
.cx-grid { stroke: var(--line); stroke-dasharray: 3 3; }
.cx-base { stroke: var(--line2); }
.cx-axis { font-size: 11px; fill: var(--muted); }
.cx-cnt { font-size: 10px; fill: var(--muted); }
.cx-bar { fill: var(--chart-bar); }
.cx-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.cx-dot { fill: var(--accent); fill-opacity: .75; stroke: #fff; stroke-width: 1; }
.cx-dot.high { fill: var(--high-dot); fill-opacity: 1; stroke-width: 1.5; }
/* 빈 목록 · 불러오는 중 · 오류 · 흐리게 */
.w-empty { padding: 28px 12px; text-align: center; color: var(--muted); font-size: 14px; }
.w-busy { font-size: 13px; color: var(--soft-ink); background: var(--accent-soft); border-radius: 8px; padding: 8px 12px; margin-top: 8px; }
.w-err { font-size: 13px; color: var(--high); background: var(--high-bg); border: 1px solid var(--high-line); border-radius: 8px; padding: 10px 12px; margin-top: 8px; }
.w-up { color: var(--high); }
.dim { opacity: .5; }
/* 아래에서 올라오는 고르기 창 (웹앱 #sheet) */
.ps-wrap { position: fixed; inset: 0; bottom: var(--app-gap, 0px); z-index: 45; background: rgba(22, 32, 46, .55); display: flex; align-items: flex-end; justify-content: center; cursor: pointer; }
.ps { cursor: default; width: 100%; max-width: 560px; max-height: 82%; display: flex; flex-direction: column; background: var(--card); border-radius: 18px 18px 0 0; padding: 10px 16px calc(16px + var(--safe-b)); }
.ps-bar { flex: none; width: 44px; height: 4px; border-radius: 2px; background: var(--chip); margin: 0 auto 4px; }
.ps-head { flex: none; display: flex; align-items: center; justify-content: space-between; }
.ps-head h2 { margin: 0; font-size: 18px; font-weight: 700; }
.ps-close { min-height: 44px; padding: 0 8px; border: 0; background: none; font-size: 14px; color: var(--muted); cursor: pointer; font-family: inherit; }
.ps-find { flex: none; margin: 4px 0; min-height: 44px; }
.ps-opts { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.ps-opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 50px; padding: 6px 12px; border: 0; border-radius: 8px; background: none; font-size: 16px; text-align: left; cursor: pointer; font-family: inherit; color: var(--ink); }
.ps-opt.on { background: var(--accent-soft); color: var(--soft-ink); font-weight: 700; }
.ps-mark { flex: none; font-size: 13px; color: var(--muted); }
.ps-opt.on .ps-mark { color: var(--soft-ink); }
.ps-done { flex: none; display: grid; grid-template-columns: 1fr 2fr; gap: 8px; margin-top: 8px; }
.w-item:focus-visible, .w-chip:focus-visible, .w-round:focus-visible, .w-seg button:focus-visible, .w-switch button:focus-visible, .w-cats button:focus-visible, .w-deal:focus-visible, .ps-opt:focus-visible, .w-map:focus-visible, .w-reg:focus-visible, .w-client-row:focus-visible, .w-wide:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* v.4 거래처 카드의 사무소 전화 링크: 누르기 영역 44px 이상 */
.tel-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; text-decoration: underline; }
