:root {
  --brand: #1f4e8c;
  --brand-dark: #163a68;
  --bg-soft: #e4e9ef;
  /* 프리미엄(다크 네이비+골드) 톤 — 대시보드 배너/핵심 실적 카드/랭킹 카드에 사용 */
  --navy-deep: #0b1f3d;
  --navy-mid: #1a3763;
  --gold: #d8b46a;
  --gold-bright: #f0d38f;
}

body {
  background-color: var(--bg-soft);
  font-family: -apple-system, "Malgun Gothic", "Apple SD Gothic Neo", "Segoe UI", Roboto, sans-serif;
  /* 한글은 띄어쓰기가 없는 한 글자 한 글자가 브라우저 입장에선 다 "줄바꿈 가능한 지점"이라서,
     화면 확대(브라우저별 배율/줌 차이)로 칸이 좁아지면 "박민재" 같은 이름도 "박민" / "재"처럼
     중간에서 잘려 두 줄로 넘어갈 수 있다. word-break: keep-all은 띄어쓰기가 있는 곳에서만
     줄을 바꾸게 해서, 이름처럼 띄어쓰기 없는 한 단어는 화면 배율과 무관하게 항상 한 줄로
     붙어서 나오게 해준다(줄바꿈이 필요한 문장/설명 글은 원래 띄어쓰기가 있어서 거기서는
     그대로 줄바꿈된다 — 레이아웃이 깨지진 않는다). 사이트 전체에 적용해서 이름이 나오는
     모든 화면(표, 카드, 배너 등)에 한 번에 적용한다. */
  word-break: keep-all;
  /* 크롬 "홈 화면에 추가"로 설치해서 앱처럼 쓸 때, 화면 글자를 길게 누르면 안드로이드
     기본 텍스트 선택(복사/공유/모두 선택/웹 검색) 팝업이 떠서 웹페이지 느낌이 나던 것을
     막는다(2026-09-16 요청). 입력창(input/textarea 등)은 아래에서 다시 허용해서, 검색어
     입력 같은 정상적인 글자 입력/수정은 그대로 된다. */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
input, textarea, select, [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  --bs-offcanvas-width: 240px;
  flex-shrink: 0;
  background: var(--brand-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
}

/* 992px(대) 이상: 사이드바를 화면에 고정된 일반 메뉴로 표시.
   부트스트랩 offcanvas-lg가 이 크기에서 배경색을 transparent!important로 되돌리고
   폭도 별도로 지정하지 않으므로, 뒤에 로드되는 이 파일에서 다시 명시적으로 지정해야 함. */
@media (min-width: 992px) {
  .sidebar.offcanvas-lg {
    width: 240px !important;
    background: var(--brand-dark) !important;
    position: sticky;
    top: 0;
    height: 100vh;
  }
}

/* 991px(중/소) 이하: 사이드바는 평소 숨겨져 있다가 햄버거 버튼을 누르면
   화면 왼쪽에서 슬라이드로 나타나는 서랍(offcanvas) 형태로 표시됨 */
@media (max-width: 991.98px) {
  .sidebar.offcanvas-lg {
    color: #fff;
  }
}

/* 모바일 전용 상단 바: 햄버거 메뉴 버튼 + 로고. lg 이상에서는 layout.ejs의 d-lg-none이 숨김 처리
   2026-09-16: 로고(메타리치 새론본부)를 화면 가운데로 오게 하려고, 메뉴 버튼은
   position:absolute로 흐름에서 빼고 왼쪽에 고정시킨다. 그러면 남은 flex 아이템인 로고
   하나만 justify-content:center로 폭 전체의 정가운데에 놓이게 된다(버튼 폭과 무관하게
   항상 정확히 중앙). position:sticky도 relative처럼 위치 기준점이 되므로 별도 position 지정
   없이 이 컨테이너를 기준으로 버튼이 절대 위치된다. */
.mobile-topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  background: var(--brand-dark);
  color: #fff;
  padding: 0.7rem 1rem;
  margin: -1rem -1rem 1rem;
  position: sticky;
  top: 0;
  z-index: 1020;
}
.mobile-topbar-menu-btn {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

/* 대시보드로 가는 링크이기도 해서 기본 링크 밑줄/색을 지우고, 눌렀을 때 살짝
   반응이 보이도록 함(터치 피드백). */
.mobile-topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: inherit;
}
.mobile-topbar-brand:hover,
.mobile-topbar-brand:active {
  opacity: 0.85;
}

.mobile-topbar-logo {
  height: 20px;
  width: auto;
  flex-shrink: 0;
}

/* 데스크톱 사이드바와 동일하게 — "새론본부"가 우리 지사 이름이라 로고 옆에서 가장
   눈에 띄어야 한다. 골드 톤으로 크고 굵게, nowrap으로 글자 단위 줄바꿈 방지. */
.mobile-topbar-sub {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--gold-bright);
  white-space: nowrap;
}

.mobile-topbar .btn-outline-light {
  border-color: rgba(255,255,255,0.5);
}

/* 2026-09-30: 대시보드 보기 범위 토글(내/팀·본부) — 사원(지점장)·이은교(대표) 계정, 대시보드
   화면에서만 보임(views/layout.ejs dashScopeToggle, server.js에서 계산). 기존 가운데 정렬
   (justify-content:center) + 햄버거 버튼 absolute 방식은 토글까지 더하면 폭이 부족해 브랜드
   로고가 햄버거 버튼과 겹쳐 보이는 문제가 있어서, 이 화면(토글이 있는 버전)만 햄버거를
   원래 흐름대로 왼쪽 고정, 브랜드는 그 오른쪽, 토글은 margin-left:auto로 맨 오른쪽 —
   겹칠 걱정 없는 구조로 바꿨다. */
.mobile-topbar-dash {
  justify-content: flex-start;
}
.mobile-topbar-dash .mobile-topbar-menu-btn {
  position: static;
  transform: none;
  flex-shrink: 0;
}
.mobile-topbar-dash .mobile-topbar-brand {
  min-width: 0;
}
.mobile-topbar-dash .mobile-topbar-sub {
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-scope-toggle {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
  margin-left: auto;
}
.dash-scope-btn {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.5rem 0.7rem;
  border-radius: 999px;
  white-space: nowrap;
  line-height: 1;
  text-decoration: none;
}
.dash-scope-btn i { font-size: 0.75rem; }
.dash-scope-btn.active,
.dash-scope-btn:hover {
  background: #fff;
  color: var(--brand-dark);
}
.dash-scope-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.75);
}

/* 대시보드로 가는 링크이기도 해서 기본 링크 밑줄/색을 지우고, 마우스를 올리면
   살짝 반응이 보이도록 함. */
.sidebar-brand {
  padding: 0.95rem 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: inherit;
}
.sidebar-brand:hover,
.sidebar-brand:active {
  opacity: 0.85;
}

.sidebar-brand-logo {
  display: block;
  height: 19px;
  width: auto;
  flex-shrink: 0;
}

/* "새론본부"는 우리 지사 이름이라 로고 옆에서 가장 눈에 띄어야 한다 — 프리미엄 배너에
   쓰는 골드 톤으로 크고 굵게 강조하고, 폭이 좁은 사이드바에서 글자 단위로 줄바꿈되지
   않도록 nowrap 처리. */
.sidebar-brand-sub {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--gold-bright);
  line-height: 1.1;
  white-space: nowrap;
}

.sidebar-user {
  padding: 0.8rem 1rem;
  color: #dce6f5;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.sidebar-nav {
  flex: 1;
  padding-top: 0.5rem;
  overflow-y: auto;
}

.sidebar-nav .nav-link {
  color: #cfe0f5;
  padding: 0.6rem 1.1rem;
  border-left: 3px solid transparent;
}

.sidebar-nav .nav-link i {
  width: 1.3rem;
  display: inline-block;
}

.sidebar-nav .nav-link:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.sidebar-nav .nav-link.active {
  background: rgba(255,255,255,0.14);
  color: #fff;
  border-left-color: #ffc107;
  font-weight: 600;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,0.12);
}

.main-content {
  flex: 1;
  padding: 1.6rem 2rem;
  min-width: 0;
}

@media (max-width: 991.98px) {
  .main-content {
    padding: 1rem;
    /* 하단 고정 탭바(.mobile-bottom-nav)에 콘텐츠 끝부분이 가려지지 않도록 여유 공간 확보 */
    padding-bottom: calc(1rem + 4.4rem + env(safe-area-inset-bottom, 0));
  }
}

/* 모바일 전용 하단 탭바 — 전 직원 공통으로 자주 쓰는 5개 메뉴만 엄지로 바로 누를 수 있게.
   나머지(경리/회계·인사관리·시스템 설정 등 관리자·내근 전용 메뉴)는 기존처럼 햄버거 메뉴에서 이용. */
.mobile-bottom-nav {
  display: flex;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1030;
  background: #fff;
  border-top: 1px solid #e2e6ec;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.5rem 0.2rem 0.4rem;
  color: #8a94a6;
  text-decoration: none;
  font-size: 0.68rem;
  line-height: 1.1;
}

.mobile-bottom-nav-item i {
  font-size: 1.25rem;
}

.mobile-bottom-nav-item.active {
  color: var(--brand-dark);
  font-weight: 700;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.page-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
  color: #1c2b3a;
}

.card {
  border: none;
  box-shadow: 0 1px 5px rgba(0,0,0,0.12);
}

.stat-card {
  border-radius: 0.6rem;
  padding: 1.1rem 1.3rem;
  background: #fff;
  height: 100%;
  box-shadow: 0 1px 5px rgba(0,0,0,0.12);
}

.stat-card .stat-label {
  color: #6c7a89;
  font-size: 0.85rem;
}

.stat-card .stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--brand-dark);
  white-space: nowrap;
}
/* 계약관리 요약 카드 중 "건수 · 고객수"처럼 두 값을 한 칸에 같이 보여줄 때의 구분점
   (2026-09-18 추가) */
.stat-card .stat-value-sep {
  opacity: 0.45;
  font-weight: 400;
  margin: 0 0.05rem;
}
/* 클릭해서 관련 데이터로 넘어갈 수 있는 요약 카드(예: "정상 제외 보험료 합계") — 링크(<a>)를
   기존 .stat-card처럼 보이게 하고, 클릭 가능하다는 걸 살짝 드러낸다(2026-09-18 추가) */
.stat-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.stat-card-link:hover {
  box-shadow: 0 3px 12px rgba(0,0,0,0.18);
  transform: translateY(-1px);
  color: inherit;
}

/* 시스템 설정 - 사용자(계정) 관리: 폰 화면에서는 표(아이디/이름/연결직원/권한/등록기기/상태/
   작업 7열)가 가로 스크롤 없인 안 들어와서 보기 힘들다는 요청(2026-09-18)으로, 계정별 카드로
   풀어서 보여준다. 라벨(권한/등록기기)을 왼쪽에 짧게 고정해서 값과 나란히 보이게 한다. */
.user-admin-card-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.user-admin-card-label {
  flex: 0 0 52px;
  font-size: 0.78rem;
  color: #6c7a89;
  font-weight: 600;
}

/* 폰 화면에서는 요약 카드가 2열로 좁아지므로, 1억 단위 금액까지 줄바꿈 없이 한 줄에 들어가도록
   글자 크기와 여백을 조금 더 줄인다 */
@media (max-width: 767.98px) {
  .stat-card {
    padding: 0.8rem 0.9rem;
  }
  .stat-card .stat-value {
    font-size: 1.05rem;
  }
}

/* 직급 승급 기준표: 4개를 한 줄에(폰에서도) 표시하다 보니 칸이 좁아서, 글자가 중간에
   줄바꿈되지 않도록 폰 화면에서는 글자 크기/여백을 더 줄인다 */
.rank-tier-chip {
  white-space: nowrap;
}
@media (max-width: 575.98px) {
  .rank-tier-chip {
    font-size: 0.72rem;
  }
}

/* 경리/회계: 폰 화면이 깨진다는 요청(2026-09-18) — 시작월~끝월 입력이 데스크톱 기준
   고정폭(10.5rem)+큰 글씨(lg)라 좁은 화면에서 글자가 잘려 보였다. 폰에서만 입력칸을
   줄바꿈 없이 한 줄에 다 들어오도록 작게 줄인다. */
@media (max-width: 767.98px) {
  .accounting-month-form {
    width: 100%;
  }
  .accounting-month-input.form-control-lg {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.85rem;
    padding: 0.375rem 0.5rem;
  }
  .accounting-month-form .btn-lg {
    font-size: 0.85rem;
    padding: 0.375rem 0.75rem;
  }
}

/* 경리/회계의 출금·입금 내역 3개 표(분류/내용/수령인·거래처/금액)는 데스크톱 기준 고정폭
   열이라 폰에서는 글자가 심하게 줄바꿈되며 깨졌다(2026-09-18 요청) — 폰에서는 표 대신
   내역 하나당 한 줄짜리 카드로 풀어서 보여준다. */
.ledger-mobile-date {
  font-weight: 600;
  font-size: 0.78rem;
  color: #6c7a89;
  background: #f6f8fa;
  padding: 0.3rem 0.9rem;
}
.ledger-mobile-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid #eef1f5;
}
.ledger-mobile-row:last-child {
  border-bottom: none;
}
.ledger-mobile-row-main {
  min-width: 0;
  flex: 1 1 auto;
}
.ledger-mobile-row-amount {
  flex: 0 0 auto;
  text-align: right;
}

/* 계약관리 표: 같은 고객끼리 묶은 구간이 바뀌는 지점을 구분선으로 표시 */
.table > tbody > tr.table-group-start > td {
  border-top: 2px solid #c7d0da;
}

.table thead th {
  background: #eef2f7;
  font-size: 0.85rem;
  color: #4a5568;
  white-space: nowrap;
}

.table td {
  vertical-align: middle;
  font-size: 0.92rem;
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 0.8rem;
  padding: 2.2rem 2rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.login-logo {
  height: 76px;
  width: auto;
}

@media (max-width: 420px) {
  .login-wrap {
    padding: 1rem;
  }
  .login-card {
    padding: 1.6rem 1.3rem;
  }
}

.badge-status-유지, .badge-status-정상, .badge-status-활동, .badge-status-재직, .badge-status-확정, .badge-status-지급완료 {
  background-color: #1f9d55 !important;
}
.badge-status-해지, .badge-status-철회, .badge-status-퇴사 {
  background-color: #c0392b !important;
}
.badge-status-만기, .badge-status-휴면, .badge-status-휴직, .badge-status-대기 {
  background-color: #b7791f !important;
}
.badge-status-청약중 {
  background-color: #2b6cb0 !important;
}
/* 계약상태 "실효"(2026-09-18 추가) — 해지/철회와는 구분되게 보이도록 별도 색상 */
.badge-status-실효 {
  background-color: #8e44ad !important;
}
/* 계약상태의 드문 값들(반송/취소/무효/품보 등, 2026-09-18 추가) — 성립되지 않은 청약/기타 상태로
   보고 중립적인 회색으로 표시 */
.badge-status-반송, .badge-status-취소, .badge-status-무효, .badge-status-품보 {
  background-color: #6b7280 !important;
}

.required::after {
  content: " *";
  color: #c0392b;
}

/* 메타시상: 사상1/2/3 요약 헤더를 클릭하면 상세가 펼쳐지는 카드 */
.award-summary-header {
  cursor: pointer;
}
.award-summary-header .toggle-chevron {
  display: inline-block; /* transform은 인라인 요소엔 적용되지 않으므로 필요 (표 안 아이콘 회전 안 되는 문제 방지) */
  transition: transform 0.2s ease;
}
.award-summary-header[aria-expanded="true"] .toggle-chevron {
  transform: rotate(180deg);
}
/* 시상 요약: 사상1/2/3을 옆으로 나란히(1x3) 배치 — .stat-card 스타일 재사용 */
.stat-card.award-summary-header:hover {
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}

/* 메타시상: 사상1/2/3을 엑셀 시트 탭처럼 클릭해서 전환 — 탭 아래에 내용이 바로 이어지는 느낌 */
.meta-award-tabs {
  border-bottom: 1px solid #d7dee6;
}
.meta-award-tabs .nav-link {
  border: 1px solid #d7dee6;
  border-bottom: none;
  border-radius: 0.6rem 0.6rem 0 0;
  background: #e4e9ef;
  color: #4a5568;
  padding: 0.6rem 0.5rem;
  text-align: center;
  margin-bottom: -1px;
}
.meta-award-tabs .nav-link .tab-amount {
  font-weight: 700;
  font-size: 1rem;
  margin-top: 0.1rem;
}
.meta-award-tabs .nav-link.active {
  background: #fff;
  color: var(--brand-dark);
  border-color: #d7dee6 #d7dee6 #fff;
}
.meta-award-tab-content {
  background: #fff;
  border: 1px solid #d7dee6;
  border-top: none;
  border-radius: 0 0 0.6rem 0.6rem;
  padding: 1rem;
  box-shadow: 0 1px 5px rgba(0,0,0,0.12);
}
@media (max-width: 767.98px) {
  .meta-award-tabs .nav-link {
    padding: 0.5rem 0.3rem;
    font-size: 0.85rem;
  }
  .meta-award-tabs .nav-link .tab-amount {
    font-size: 0.85rem;
  }
}

/* ============================================================
   메타시상 — 주차별 진행현황 / 계약내역 카드형 UI (남색+골드 톤)
   사용자가 보내준 참고 이미지의 구조(주차 알약 버튼 → 보험사별 카드 →
   계약자별 내역)를 사이트 기존 남색+골드 톤으로 옮긴 것.
============================================================ */
.meta-week-pill-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
}
@media (max-width: 575.98px) {
  .meta-week-pill-row { grid-template-columns: repeat(2, 1fr); }
}
.meta-week-pill {
  border: 2px solid #e2e8f0;
  background: #f7f9fc;
  border-radius: 0.75rem;
  padding: 0.55rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.meta-week-pill-line {
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
}
.meta-week-pill-no {
  font-weight: 700;
  color: var(--navy-mid);
}
.meta-week-pill-range {
  color: #8592a6;
}
.meta-week-pill-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #e4e9ef;
  color: #6c7789;
}
.meta-week-pill-done .meta-week-pill-badge { background: #dfe6ee; color: #5c6b80; }
.meta-week-pill-upcoming { opacity: 0.65; }
/* 진행중인(현재) 주차/구간은 클릭/선택 여부와 상관없이 항상 눈에 띄어야 해서, 테두리색만
   바꾸는 것으론 부족해 옅은 골드 배경 채우기 + 살짝 그림자, "진행중" 뱃지 자체도 골드로
   채워서 다른 상태(완료/예정)와 한눈에 구분되게 한다. (2026-09-13 가독성 개선 요청) */
.meta-week-pill-current {
  border-color: var(--gold);
  background: linear-gradient(135deg, #fff6df, #fbe6ad);
  box-shadow: 0 2px 10px rgba(216, 180, 106, 0.45);
}
.meta-week-pill-current .meta-week-pill-badge {
  background: var(--gold);
  color: #4a3600;
  font-weight: 700;
}
/* 알약을 눌러서 펼친(accordion으로 하나만 열림) 주차가 선택된 것처럼 강조 표시 */
.meta-week-pill[aria-expanded="true"] {
  background: linear-gradient(135deg, var(--navy-deep), var(--navy-mid));
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(11, 31, 61, 0.3);
}
.meta-week-pill[aria-expanded="true"] .meta-week-pill-no,
.meta-week-pill[aria-expanded="true"] .meta-week-pill-range { color: #fff; }
.meta-week-pill[aria-expanded="true"] .meta-week-pill-badge {
  background: var(--gold-bright);
  color: var(--navy-deep);
}

.meta-week-contracts-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

/* 보험사별 카드 — 계약 내역을 보험사 단위로 묶어서 보여준다 */
.meta-insurer-card {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0.6rem;
  background: #fff;
}
.meta-insurer-card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}
.meta-insurer-card-head .meta-insurer-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--insurer-color, #999);
  flex-shrink: 0;
}
.meta-insurer-name {
  font-weight: 700;
  color: var(--navy-deep);
}
.meta-insurer-planner {
  color: #8592a6;
  font-size: 0.85rem;
}
.meta-insurer-count-badge {
  margin-left: auto;
  background: var(--navy-mid);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
}
.meta-insurer-card-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 0.5rem 0.75rem;
}
.meta-insurer-stat-label {
  font-size: 0.72rem;
  color: #8592a6;
}
.meta-insurer-stat-value {
  font-weight: 700;
  color: var(--navy-deep);
  font-size: 0.95rem;
}
.meta-insurer-stat-award {
  background: linear-gradient(135deg, var(--navy-deep), var(--navy-mid));
  border-radius: 0.5rem;
  padding: 0.35rem 0.6rem;
}
.meta-insurer-stat-award .meta-insurer-stat-label { color: #cfe0f5; }
.meta-insurer-stat-award .meta-insurer-stat-value { color: var(--gold-bright); font-size: 1.05rem; }
.meta-insurer-card-detail {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px dashed #e2e8f0;
  font-size: 0.82rem;
  color: #64748b;
}
.meta-insurer-card-detail-label {
  font-weight: 600;
  color: #4a5568;
  margin-right: 0.3rem;
}
.meta-insurer-card-detail i { color: #8592a6; margin-right: 0.2rem; }

/* 사상2: 이전 구간에서 달성한 구간을 이번 구간에서도 채워야 브릿지(하나/둘)가 확정된다는
   안내 — 아직 못 채웠으면 주의를 끄는 톤(금색 테두리), 이미 채웠으면 축하 톤(초록)으로 구분 */
.meta-bridge-hint {
  margin-top: 0.6rem;
  padding: 0.5rem 0.7rem;
  border-radius: 0.5rem;
  font-size: 0.82rem;
  line-height: 1.4;
  background: #fff8e6;
  border: 1px solid #f2d98a;
  color: #7a5c00;
}
.meta-bridge-hint i { margin-right: 0.25rem; }
.meta-bridge-hint-met {
  background: #eafaf0;
  border-color: #b7e4c7;
  color: #1a7d43;
}

/* 사상2: 구간별 진행 현황 — 사상1의 주차 알약(.meta-week-pill)과 같은 톤을 쓰되, 구간은
   항상 3개뿐이라 폰 화면에서도 줄바꿈 없이 1x3 한 줄로 고정해서 보여준다(사상1은 4개라
   575px 이하에서 2열로 접힘 — 구간은 그렇게 접지 않음). 라벨/날짜는 세로로 쌓아서
   좁은 칸에서도 읽기 편하게. */
.meta-period-pill-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.meta-period-pill .meta-week-pill-line {
  margin-bottom: 0.45rem;
}
.meta-period-pill .meta-week-pill-no {
  display: block;
}
.meta-period-pill .meta-week-pill-range {
  display: block;
  font-size: 0.82rem;
}
@media (max-width: 575.98px) {
  .meta-period-pill {
    padding: 0.5rem 0.3rem;
  }
  .meta-period-pill .meta-week-pill-range {
    font-size: 0.72rem;
  }
}

/* 사상2: 회사별 다음 구간까지 타일 — 왼쪽에 뱃지(로고 자리), 오른쪽에 회사명/금액,
   그 아래 10/20/30/50만 구간 트래커 */
.meta-company-tile {
  border: 1px solid #e2e8f0;
  border-radius: 0.7rem;
  padding: 0.7rem 0.6rem;
  text-align: left;
  background: #fff;
  border-top: 3px solid var(--insurer-color, #999) !important;
  height: 100%;
}
/* 이번 구간 실적은 0이지만 저번 구간에서 이미 구간을 채워둔 회사 — 그냥 흰 배경 카드로
   묻히지 않도록 브릿지 힌트와 같은 톤(옅은 골드)으로 통째로 물들여서 "이어서 채워야 한다"는
   느낌을 바로 준다. (2026-09-13 요청으로 추가) */
.meta-company-tile-carryover {
  background: #fffbf0;
  border-color: #f2d98a;
}
.meta-company-tile-flag {
  font-size: 0.62rem;
  font-weight: 700;
  color: #7a5c00;
  background: #f7e4a8;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  white-space: nowrap;
}
.meta-company-tile-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--navy-deep);
}
/* 회사 타일을 누르면 그 회사의 이번 구간 계약 내역이 펼쳐진다 (2026-09-13 요청) */
.meta-company-tile-clickable {
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.meta-company-tile-clickable:hover {
  box-shadow: 0 2px 10px rgba(20, 30, 50, 0.1);
}
.meta-company-tile-clickable:active {
  transform: scale(0.99);
}
.meta-company-tile-expand-hint {
  margin-top: 0.4rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: #8592a6;
  text-align: center;
}
.meta-company-tile-expand-hint .bi-chevron-down {
  display: inline-block;
  transition: transform 0.2s ease;
}
.meta-company-tile-clickable[aria-expanded="true"] .meta-company-tile-expand-hint .bi-chevron-down {
  transform: rotate(180deg);
}
.meta-company-tile-detail {
  padding-top: 0.5rem;
}
/* 아직 실제 보험사 로고 이미지가 없어서, 회사명 색상을 배경으로 한 원형 이니셜 뱃지로
   대체 — 나중에 로고 파일을 받으면 이 자리에 <img>만 넣으면 된다. */
.meta-company-tile-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  height: 2.1rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--insurer-color, #999);
  color: #fff;
  font-size: 0.64rem;
  font-weight: 800;
  white-space: nowrap;
}

/* 카드 헤더의 달성/진행중/미달성 범례 */
.meta-tier-legend {
  display: flex;
  gap: 0.7rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: #6c7789;
  flex-wrap: wrap;
}
.meta-tier-legend-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  margin-right: 0.2rem;
  vertical-align: middle;
}
.meta-tier-legend-dot.is-done { background: var(--brand); }
.meta-tier-legend-dot.is-current { background: var(--gold); }
.meta-tier-legend-dot.is-future { background: #dbe2ea; }

/* 회사 타일 안의 10/20/30/50만 구간 트래커 — 점(달성 여부)과 연결선으로 진행 상태를 보여준다 */
.meta-tier-track {
  display: flex;
  align-items: center;
  margin: 0.15rem 0 0.15rem;
}
.meta-tier-dot {
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: #dbe2ea;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #dbe2ea;
}
.meta-tier-dot.is-done {
  background: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}
.meta-tier-dot.is-current {
  background: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}
.meta-tier-line {
  flex: 1 1 auto;
  height: 3px;
  background: #dbe2ea;
}
.meta-tier-line.is-done {
  background: var(--brand);
}
.meta-tier-track-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.6rem;
  color: #9aa5b5;
  margin-bottom: 0.4rem;
}
.meta-tier-status {
  font-size: 0.74rem;
}

/* 사상2: 아직 이번 구간 실적이 없는 회사는 화면을 크게 차지하지 않도록 회사명만 보이는
   반투명 칩으로 최대한 축소 — 계약이 들어오면 위쪽 상세 타일(.meta-company-tile)로 옮겨간다. */
.meta-company-inactive-label {
  font-size: 0.72rem;
  color: #9aa5b5;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.meta-company-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.meta-company-chip {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: #f1f3f6;
  border: 1px solid #e6e9ee;
  color: #a3aab6;
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.65;
  white-space: nowrap;
}

/* 계약관리 카드(모바일)·표(데스크톱): 보험사마다 다른 색 띠로 구분하고, 보험료·인정보험료
   같은 핵심 숫자는 포인트 컬러로 강조 — 색은 views/contracts/list.ejs에서 보험사명으로
   해시해 인라인 style로 지정하므로, 여기서는 카드/표 쪽 레이아웃만 정의한다. */
/* list-group-flush(모바일 카드 안 목록)가 border-width를 자기 규칙으로 덮어써서
   border-left를 그냥 주면 먹히지 않으므로, 의사요소로 왼쪽 색띠를 따로 그린다. */
.contract-card {
  position: relative;
  padding-left: calc(var(--bs-list-group-item-padding-x, 1rem) + 4px);
}
.contract-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--insurer-color, #cbd5e0);
}
.contract-card .insurer-name {
  color: var(--insurer-color, #4a5568);
  font-weight: 700;
}
.contract-card .contract-money {
  color: #dd6b20;
  font-weight: 700;
}
.contract-card .contract-money .bi {
  font-size: 0.85em;
}
.contract-card .contract-money-sub {
  color: #a0521f;
  font-weight: 600;
}

.table-insurer-dot {
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--insurer-color, #cbd5e0);
  margin-right: 0.35rem;
  flex: none;
}
.table td.contract-money-cell {
  color: #dd6b20;
  font-weight: 700;
}

/* ============================================================
   프리미엄(다크 네이비+골드) 테마 — 대시보드의 실적 배너/핵심 실적 카드/랭킹 카드에 사용.
   버튼·표 등 일반 UI는 기존 파란 브랜드 컬러 그대로 두고, "성과를 크게 보여주는" 영역에만
   이 클래스들을 얹는다. 다른 화면(영업순위, 메타시상 요약 등)에도 같은 느낌을 넓히고 싶으면
   이 클래스들을 그대로 갖다 쓰면 된다.
============================================================ */
.premium-banner {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  min-height: 190px;
  /* main-content의 상단/좌우 padding(1.6rem/2rem)을 상쇄해서 사진이 화면 위·좌·우 끝까지 꽉 차게 한다 */
  margin: -1.6rem -2rem 1rem;
  background: url('/public/img/banner-desktop.jpg') center 40%/cover no-repeat, linear-gradient(135deg, var(--navy-deep), var(--navy-mid) 60%, #24446f);
  box-shadow: 0 8px 24px rgba(11, 31, 61, 0.35);
}
.premium-banner-tall { min-height: 320px; }
/* 제목 한 줄 + 안내문구뿐인 배너(계약관리 등) — 데이터(통계 행)가 없어서 사진 아래쪽이 빈 채로
   남지 않도록, 내용 높이에 맞춰 배너 자체를 낮춘다. 2026-09-18: 계약관리의 유지율 도넛을
   우측 별도 줄에서 제목 옆 칩으로 옮기면서 내용이 더 낮아져, PC 기준 배너 높이를 한 단계
   더 줄였다. */
.premium-banner-compact { min-height: 100px; }
/* 사진 위에서 글자가 흐릿하게 안 보이도록: 위쪽(제목)과 아래쪽(수치)은 짙게 눌러주고,
   가운데는 옅게 남겨서 사진이 드러나 보이게 한다. */
.premium-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(11, 31, 61, 0.88) 0%,
    rgba(11, 31, 61, 0.55) 20%,
    rgba(11, 31, 61, 0.18) 42%,
    rgba(11, 31, 61, 0.14) 62%,
    rgba(11, 31, 61, 0.68) 100%);
}
.premium-banner-content {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.75rem 1.4rem 0.9rem;
  color: #fff;
}
/* 제목: "2026년"/"실적" 같은 일반 글자는 흰색으로 작게, 강조하는 월(예: 9월)만 금색+굵게 크게 —
   참고 이미지의 배치를 그대로 따른다. 기본은 가로 한 줄(대시보드), .premium-banner-title-stack을
   더하면 직급현황처럼 "2026년 9월" 줄 + "직급 현황" 큰 줄, 두 줄로 쌓는다. */
.premium-banner-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
}
.premium-banner-title-stack {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
}
.premium-banner-title-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.premium-banner-title-word {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7), 0 0 3px rgba(0, 0, 0, 0.9);
}
.premium-banner-title-accent {
  font-size: 2.7rem;
  font-weight: 900;
  color: var(--gold-bright);
  line-height: 1.1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75), 0 0 4px rgba(0, 0, 0, 0.9);
}
.premium-banner-title-big {
  display: block;
  font-size: 2.7rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.08;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75), 0 0 4px rgba(0, 0, 0, 0.9);
}
.premium-banner-sub {
  color: #eef2f9;
  font-size: 0.85rem;
  white-space: nowrap;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7), 0 0 3px rgba(0, 0, 0, 0.9);
}
.premium-banner-line {
  font-size: 0.88rem;
  white-space: nowrap;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7), 0 0 3px rgba(0, 0, 0, 0.9);
}
.premium-banner-script {
  color: var(--gold-bright);
  font-weight: 700;
}
.premium-banner-note-inline {
  color: #eef2f9;
}
/* 배너 맨 아래에 넣는 핵심 수치(제목+금액만, 아이콘 없이) — 대시보드의 새론본부/개인 실적용.
   행이 여러 개(전체 실적 + 개인 또는 수입·지출 등)일 수 있어서 wrap으로 한 번 더 묶는다. */
.premium-banner-stats-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.premium-banner-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem;
}
.premium-banner-stat-label {
  font-size: 0.92rem;
  color: #dbe4f2;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7), 0 0 3px rgba(0, 0, 0, 0.9);
}
.premium-banner-stat-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--gold-bright);
  line-height: 1.3;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7), 0 0 3px rgba(0, 0, 0, 0.9);
}
.premium-banner-stat-value.text-success { color: #8fe3a8; }
.premium-banner-stat-value.text-danger { color: #ff9d97; }
/* 계약관리처럼 배너 우측 한 줄 옆에 작게 곁들이는 유지율 표시용 — 기존 stat-label/value보다
   한 단계 작게, 안내문구 바로 아래에 붙는다. */
.premium-banner-stat-label-sm {
  font-size: 0.78rem;
  color: #dbe4f2;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7), 0 0 3px rgba(0, 0, 0, 0.9);
}
.premium-banner-stat-value-sm {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gold-bright);
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7), 0 0 3px rgba(0, 0, 0, 0.9);
}
/* 계약관리 배너의 유지율 표시 — /retention 화면의 동그란 도넛 그래프를 작게 가져와 "계약관리"
   제목과 같은 줄에 반투명 둥근모서리 칩으로 넣었다(2026-09-18 요청) — 제목 옆으로 옮기니
   배너 우측에 따로 한 줄을 차지하지 않아도 돼서 배너 자체 높이를 줄일 수 있었다. 사진 배경
   위에서도 잘 보이도록 칩 배경은 반투명, 도넛/글자 색은 대시보드 유지율 도넛과 같은
   골드(--gold)로 맞춰서 더 튀어 보이게 했다. */
.banner-retention-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(11, 31, 61, 0.35);
  border: 1px solid rgba(216, 180, 106, 0.55);
  border-radius: 0.8rem;
  padding: 0.25rem 0.65rem 0.25rem 0.3rem;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  transition: background 0.15s ease, transform 0.15s ease;
}
.banner-retention-chip:hover {
  background: rgba(11, 31, 61, 0.5);
  transform: translateY(-1px);
}
.banner-retention-donut {
  flex-shrink: 0;
}
.banner-retention-donut-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.3);
  stroke-width: 5;
}
.banner-retention-donut-fill {
  fill: none;
  stroke: var(--gold);
  stroke-width: 5;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  filter: drop-shadow(0 0 3px rgba(216, 180, 106, 0.9));
}
/* "유지율"이라는 글자 없이 숫자만 있으니 뭘 나타내는지 모르겠다는 피드백(2026-09-18) —
   칩 안에 작게 "유지율" 라벨을 값 위에 한 줄 더 넣었다. */
.banner-retention-chip-text-wrap {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.banner-retention-chip-label {
  font-size: 0.62rem;
  font-weight: 600;
  color: #eef2f9;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
.banner-retention-chip-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--gold);
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
/* 2026-09-18 요청(시안 단계): 대시보드 배너 우측 상단에 "이달의 나의 업적순위"를 사원
   화면에서 보여준다 — .banner-retention-chip과 같은 반투명 골드 톤 칩. 제목 줄과 같은
   flex 행의 우측 칸(안내문구 위)에 두어서, 모바일에서 그 칸 전체가 줄바꿈돼도 안내문구와
   같이 붙어 다닌다(따로 절대좌표로 안 뺌 — PC에서 안내문구와 겹치는 문제가 있었음). */
.banner-rank-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(11, 31, 61, 0.4);
  border: 1px solid rgba(216, 180, 106, 0.55);
  border-radius: 0.8rem;
  padding: 0.35rem 0.75rem 0.35rem 0.55rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.banner-rank-chip-icon {
  font-size: 1.3rem;
  color: var(--gold);
  filter: drop-shadow(0 0 3px rgba(216, 180, 106, 0.9));
  flex-shrink: 0;
}
.banner-rank-chip-text-wrap {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.banner-rank-chip-label {
  font-size: 0.62rem;
  font-weight: 600;
  color: #eef2f9;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
.banner-rank-chip-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--gold);
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
@media (max-width: 767.98px) {
  .banner-rank-chip { padding: 0.3rem 0.6rem 0.3rem 0.45rem; }
  .banner-rank-chip-icon { font-size: 1.1rem; }
  .banner-rank-chip-value { font-size: 0.92rem; }
}
/* 대시보드 배너 안의 "새론계약조회" 검색창 — 사진 배경 위에 얹히므로 입력창은 반투명한 흰색
   카드처럼, 라벨은 다른 배너 글자들과 같은 그림자를 줘서 어떤 사진에서도 잘 읽히게 한다. */
.premium-banner-search {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.85rem;
  max-width: 420px;
}
.premium-banner-search-label {
  flex: 0 0 auto;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7), 0 0 3px rgba(0, 0, 0, 0.9);
}
.premium-banner-search input[type="text"] {
  flex: 1 1 120px;
  min-width: 90px;
  background: rgba(255, 255, 255, 0.94);
  border: none;
}
.premium-banner-search button {
  flex: 0 0 auto;
  white-space: nowrap;
  font-weight: 600;
}
@media (max-width: 575.98px) {
  .premium-banner-search { margin-top: 0.6rem; max-width: none; }
  .premium-banner-search-label { font-size: 0.78rem; }
}

/* 통계 행("유지율" 등) 옆에 나란히 놓는 새론계약조회 검색창 — 반투명한 둥근모서리 박스로
   감싸서, 다른 라벨+금액 항목들과 줄이 깨지지 않고 자연스럽게 나란히 들어가게 한다. 박스 안의
   폼은 위의 .premium-banner-search를 그대로 재사용하되, 배너 맨 위 버전에 있던 margin-top/
   max-width는 이 박스 안에서는 필요 없어서 지운다. */
.premium-banner-search-box {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 0.9rem;
  padding: 0.5rem 0.85rem;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.premium-banner-search-box .premium-banner-search {
  margin-top: 0;
  max-width: none;
}
.premium-banner-search-box .premium-banner-search-label {
  font-size: 0.78rem;
}
/* 2026-09-22: 이 안의 검색창을 "보증 및 지원금" 화면과 같은 pill(.lookup-search-bar)로
   바꾸면서, 예전에 있던 input[type="text"] 폭 지정을 그 pill 자체에 옮겼다(버튼은
   .premium-banner-search > button으로 좁혀서, pill 안의 지우기(x) 버튼까지 이 작은
   글자크기가 적용되지 않게 함). */
.premium-banner-search-box .lookup-search-bar {
  flex: 0 1 160px;
  min-width: 90px;
  padding: 0.3rem 0.6rem;
}
.premium-banner-search-box .lookup-search-input {
  font-size: 0.82rem;
}
.premium-banner-search-box .premium-banner-search > button {
  font-size: 0.78rem;
  padding: 0.25rem 0.65rem;
}
@media (max-width: 575.98px) {
  .premium-banner-search-box { width: 100%; }
  .premium-banner-search-box .premium-banner-search { width: 100%; }
  .premium-banner-search-box .lookup-search-bar { flex: 1 1 auto; min-width: 60px; }
}

/* 유지율 상세(회차별 원본 리포트) — 열이 아주 많아 가로 스크롤이 꼭 필요한 표라서, 어디까지
   스크롤했든 "누구 줄인지" 계속 보이도록 첫 번째 열(사원명)만 고정한다. */
.retention-detail-scroll { max-height: 75vh; }
.retention-detail-table th, .retention-detail-table td { white-space: nowrap; }
.retention-detail-table thead th { position: sticky; top: 0; background: #fff; z-index: 2; }
.retention-detail-table th.sticky-col, .retention-detail-table td.sticky-col {
  position: sticky; left: 0; background: #fff; z-index: 1;
  box-shadow: 2px 0 4px rgba(0,0,0,0.06);
}
.retention-detail-table thead th.sticky-col { z-index: 3; }
@media (max-width: 991.98px) {
  .premium-banner { margin-left: -1rem; margin-right: -1rem; margin-top: 0; border-radius: 0; }
  /* 모바일 상단 바("메타리치 새론본부", 네이비)와 그 아래 배너(사진 위쪽도 네이비 톤 오버레이)
     사이에 여백이 보이지 않도록 붙인다 — 두 영역이 하나의 네이비 블록처럼 이어지게. */
  .mobile-topbar + .premium-banner { margin-top: -1rem; }
}
@media (max-width: 767.98px) {
  .premium-banner { background-image: url('/public/img/banner-mobile.jpg'), linear-gradient(135deg, var(--navy-deep), var(--navy-mid) 60%, #24446f); min-height: 165px; }
  /* 폰에서는 배너 사진 중 데이터가 없는 아래쪽 빈 부분이 남지 않도록, 내용에 맞춰 배너를
     타이트하게 잘라준다(사진 자체는 background cover라 잘리는 건 사진 아래쪽뿐, 글자는 그대로). */
  .premium-banner-tall { min-height: 235px; }
  .premium-banner-compact { min-height: 108px; }
}
@media (max-width: 575.98px) {
  .premium-banner-title-word { font-size: 1.05rem; }
  .premium-banner-title-accent { font-size: 2rem; }
  .premium-banner-title-big { font-size: 2rem; }
  .premium-banner-sub, .premium-banner-line { white-space: normal; }
  .premium-banner-stat-label { font-size: 0.8rem; }
  .premium-banner-stat-value { font-size: 1.4rem; }
}

/* ============================================================
   대시보드 관리자/내근 화면 개선 — 아이콘 KPI 카드, 유지율+실효관리 통합 카드,
   월별 인정보험료 막대그래프, 수당 TOP5 막대 리스트 (2026-09-16 요청 반영).
   시안 단계에서는 뷰 파일 안 <style>에 두고 확인했고, 반영 확정 후 여기로 옮김.
============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
/* 아주 좁은 화면에서는 2칸씩 나누면 "164,250,000원"처럼 긴 금액이 잘려 보이므로
   한 줄씩(1칸) 쌓아서 숫자가 항상 다 보이게 한다. */
@media (max-width: 360px) {
  .kpi-grid { grid-template-columns: 1fr; }
}
/* 2026-09-17: PC 화면(사이드바가 펼쳐지는 lg=992px 이상)에서는 데이터가 세로로 너무 퍼져
   보인다는 요청으로, 배너 안 KPI 4개를 가로 한 줄로 펼치고 — 아래 .insight-row로 유지율/
   실효관리 카드와 월별 추이 카드도 가로 2단으로 배치한다. 모바일/태블릿은 기존 그대로
   세로로 쌓인다(시안 이미지로 먼저 확인 후 반영). */
@media (min-width: 992px) {
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
  .insight-row { display: flex; gap: 1rem; align-items: stretch; }
  .insight-row > .insight-card { flex: 1 1 0; min-width: 0; margin-bottom: 0 !important; }
}

/* 2026-09-18 요청: 관리자 대시보드의 유지율/월별추이/메타시상1(원래 .insight-row)과
   영업순위/메타시상순위/메타시상2/최근입출금(원래 .row g-3) 카드를 CSS Grid 하나로 합쳐서,
   폰 화면에서 "유지율 → 월별추이 → 메타시상1 → 메타시상2 → 영업순위 → 메타시상순위 →
   최근입출금" 순서로 보이게 한다. 이름 붙은 영역(grid-area)으로 배치하므로, dashboard.ejs
   안에서 각 카드가 어떤 순서로 적혀 있는지는 화면에 보이는 순서와 무관하다 — 실제 순서는
   아래 두 grid-template-areas가 결정한다(PC는 기존 2행 3열 배치를 그대로 재현). */
.dashboard-admin-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  grid-template-areas:
    "retention"
    "trend"
    "meta1"
    "meta2"
    "salesrank"
    "metarank"
    "ledger";
}
.dashboard-admin-grid > * { min-width: 0; margin-bottom: 0 !important; }
@media (min-width: 992px) {
  .dashboard-admin-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-areas:
      "retention trend meta1"
      "salesrank metarank meta2"
      "ledger ledger ledger";
  }
}
.dga-retention { grid-area: retention; }
.dga-trend { grid-area: trend; }
.dga-meta1 { grid-area: meta1; }
.dga-meta2 { grid-area: meta2; }
.dga-salesrank { grid-area: salesrank; }
.dga-metarank { grid-area: metarank; }
.dga-ledger { grid-area: ledger; }

/* ============================================================
   2026-09-17: 대시보드 "메타시상1/2 진행중" 미니카드 — 유지율/월별추이 옆(PC 3번째 칸)의
   메타시상1, 그리고 영업순위/메타시상순위 옆(하단 3번째 칸)의 메타시상2 공용 스타일.
   ============================================================ */
.meta-mini-card { display: flex; flex-direction: column; }
.meta-mini-badge {
  display: inline-block; align-self: flex-start; background: #eef4ff; color: var(--brand);
  font-size: 0.72rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: 999px; margin-bottom: 0.6rem;
}
.meta-mini-row { display: flex; justify-content: space-between; align-items: center; padding: 0.3rem 0; font-size: 0.82rem; color: #495a72; }
.meta-mini-row-value { font-weight: 700; color: #1c2b3a; }
.meta-mini-row.is-highlight {
  background: #fff6ea; border: 1px solid #f3d9a8; border-radius: 0.5rem; padding: 0.4rem 0.6rem; margin-top: 0.15rem;
}
.meta-mini-row.is-highlight .meta-mini-row-value { color: #a15c00; }
.meta-mini-link { margin-top: auto; font-size: 0.78rem; color: var(--brand); text-decoration: none; align-self: flex-end; padding-top: 0.4rem; }
.meta-mini-link:hover { text-decoration: underline; }
.meta-mini-chip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.meta-mini-chip { background: #f7f9fc; border: 1px solid #e6e9ef; border-radius: 0.5rem; padding: 0.45rem 0.55rem; display: flex; flex-direction: column; gap: 0.15rem; }
.meta-mini-chip-name { font-size: 0.75rem; font-weight: 700; color: #1c2b3a; }
.meta-mini-chip-gap { font-size: 0.8rem; font-weight: 800; color: var(--brand); }
.meta-mini-chip-tag { font-size: 0.62rem; color: #a15c00; background: #fff6ea; border-radius: 999px; padding: 0.05rem 0.4rem; align-self: flex-start; }
/* 대시보드의 메타시상1 미니카드는 자리가 좁아서, .meta-week-pill-row의 기본 4열 대신 2열로
   줄여서 쓴다(2026-09-17. 알약 디자인 자체는 /meta-awards 화면과 동일). */
.meta-week-pill-row-compact { grid-template-columns: repeat(2, 1fr); }
/* 알약 안에 그 주차 달성금액을 한 줄 더 보여준다 — 날짜만 보이던 것에서, 주차별 금액도
   같이 보고 싶다는 요청(2026-09-17)으로 추가. */
.meta-week-pill-amount { font-size: 0.78rem; font-weight: 700; color: var(--navy-mid); margin-top: 0.25rem; }
.meta-week-pill-current .meta-week-pill-amount { color: #7a5c00; }
.kpi-tile {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(216, 180, 106, 0.35);
  border-radius: 0.7rem;
  padding: 0.65rem 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
  color: var(--navy-deep);
  background: var(--gold-bright);
}
.kpi-body { min-width: 0; }
.kpi-label {
  font-size: 0.72rem;
  color: #dbe4f2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.insight-card {
  background: #fff;
  border-radius: 0.9rem;
  border: 1px solid #e6e9ef;
  box-shadow: 0 2px 10px rgba(11,31,61,0.06);
  padding: 1rem;
}
.insight-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #495a72;
  margin-bottom: 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}
.donut {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(var(--gold) calc(var(--pct) * 1%), #eef1f5 0);
}
.donut-inner {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: var(--navy-deep);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.donut-inner-value { font-size: 1.15rem; font-weight: 800; }
.donut-inner-label { font-size: 0.6rem; color: #cfd9ec; }

/* 13회차/25회차 유지율은 도넛 옆이 아니라 아래쪽에 두고, 그렇게 비운 옆자리에 실효관리
   수치를 배치해서 카드 세로 길이를 줄인다. */
.donut-col {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.donut-below-stats {
  display: flex;
  gap: 0.9rem;
}
.donut-below-item {
  text-align: center;
}
.donut-below-item-label {
  font-size: 0.68rem;
  color: #7c8794;
  white-space: nowrap;
}
.donut-below-item-value {
  font-size: 0.85rem;
  font-weight: 800;
  color: #1c2b3a;
  white-space: nowrap;
}

.lapse-mini-row {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.55rem;
  min-width: 0;
}
.lapse-mini-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.6rem;
  background: #fff6ea;
  border: 1px solid #f3d9a8;
}
.lapse-mini-label {
  font-size: 0.8rem;
  color: #7a5417;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.lapse-mini-value {
  font-size: 0.98rem;
  font-weight: 800;
  color: #a15c00;
}
.lapse-mini-item.is-amount {
  background: #eef4ff;
  border-color: #c7d9f5;
}
.lapse-mini-item.is-amount .lapse-mini-label { color: #2c4a78; }
.lapse-mini-item.is-amount .lapse-mini-value { color: var(--brand); }
/* 도넛 옆으로 폭이 좁아지는 화면에서는 "라벨 + 금액"을 한 줄에 억지로 붙이면 겹치거나
   화면을 넘어가므로, 라벨 아래에 금액을 따로 한 줄 더 두는 형태로 바꾼다. */
@media (max-width: 400px) {
  .lapse-mini-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    padding: 0.5rem 0.6rem;
  }
  .lapse-mini-label { font-size: 0.72rem; }
  .lapse-mini-value { font-size: 0.92rem; }
}

/* 메인 홈화면(대시보드)에서 메타시상 카드·유지율 도넛·실효관리 카드를 눌러 각각 /meta-awards,
   /retention, /contracts/lapse-targets 화면으로 바로 이동할 수 있게 함(2026-09-16 요청) —
   <a> 태그로 감싸면서 기본 링크색/밑줄이 붙지 않게 리셋하고, 눌렀을 때 살짝 어두워지는
   피드백만 추가한다(모바일에서도 "누를 수 있는 곳"이라는 게 느껴지도록). */
a.kpi-tile,
a.donut-col,
a.lapse-mini-row {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
a.kpi-tile:hover,
a.kpi-tile:active {
  background: rgba(255,255,255,0.16);
}
a.donut-col:hover .donut,
a.donut-col:active .donut {
  filter: brightness(0.96);
}
a.lapse-mini-row:hover .lapse-mini-item,
a.lapse-mini-row:active .lapse-mini-item {
  filter: brightness(0.97);
}

.bar-list-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0;
}
.bar-list-rank {
  width: 20px;
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: #8a94a3;
  text-align: center;
}
.bar-list-main { flex: 1 1 auto; min-width: 0; }
.bar-list-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-bottom: 0.2rem;
}
.bar-list-name { font-weight: 600; color: #1c2b3a; }
.bar-list-value { font-weight: 700; color: var(--brand); }
.bar-list-track {
  height: 7px;
  border-radius: 999px;
  background: #eef1f5;
  overflow: hidden;
}
.bar-list-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--brand));
}

/* 월별 인정보험료 막대그래프 — 별도 차트 라이브러리 없이 막대 높이(%)만으로 표현 */
.month-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.4rem;
  height: 130px;
  padding-top: 1.4rem;
}
.month-bar-col {
  flex: 1 1 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}
.month-bar-value {
  font-size: 0.62rem;
  font-weight: 700;
  color: #495a72;
  margin-bottom: 0.3rem;
  white-space: nowrap;
}
.month-bar {
  width: 100%;
  max-width: 30px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, #b9c4d6, #8b9bb4);
  /* 실적이 0원인 달도 막대 모양이 아예 안 보이진 않게 최소 높이만 살짝 남겨둔다 — 높이(%)는
     이제 그 달의 실제 최댓값이 아니라 10만/100만/500만원 단위로 끊은 축 기준(scaleMax)으로
     계산해서, 데이터 차이가 실제 크기만큼 그대로 드러난다(2026-09-16 요청). */
  min-height: 3px;
}
.month-bar-col.is-current .month-bar {
  background: linear-gradient(180deg, var(--gold-bright), var(--brand));
}
.month-bar-col.is-current .month-bar-value { color: var(--brand); }
.month-bar-label {
  font-size: 0.72rem;
  color: #7c8794;
  margin-top: 0.4rem;
}
.month-bar-col.is-current .month-bar-label { color: #1c2b3a; font-weight: 700; }
@media (max-width: 340px) {
  .month-bar-value { font-size: 0.56rem; }
  .month-bar-label { font-size: 0.66rem; }
}

/* 검색/조회 폼(계약관리, 메타시상 등): 검색어·월 선택·조회 버튼이 화면 폭과 상관없이 항상
   가로 한 줄로 오도록 flex-nowrap으로 고정하고, 검색어 입력창은 좁은 화면에서 먼저 줄어들게 한다. */
.inline-search-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
}
.inline-search-row .inline-search-q {
  flex: 1 1 90px;
  min-width: 64px;
  max-width: 240px;
}
.inline-search-row .inline-search-month {
  flex: 0 0 auto;
  width: 150px;
}
.inline-search-row .inline-search-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
/* 월 input이 비어있을 때(=전체 기간) 그냥 빈칸으로 보이지 않도록 안내 문구를 덮어 보여주는 래퍼 */
.inline-search-row .inline-search-month-wrap {
  position: relative;
  flex: 0 0 auto;
  width: 150px;
}
.inline-search-row .inline-search-month-wrap .inline-search-month {
  width: 100%;
}
/* 2026-09-22(2): 시작월/끝월을 .lookup-date-pill로 바꾸면서, 이 pill도 위 .inline-search-month
   input과 마찬가지로 감싸는 wrap 칸을 꽉 채우게 한다(.lookup-date-pill 자체는 inline-flex라
   기본값으로는 내용 크기만큼만 차지함). */
.inline-search-month-wrap .lookup-date-pill {
  width: 100%;
}
.inline-search-month-hint {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #6c757d;
  background: #fff;
  border: 1px solid #ced4da;
  border-radius: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

/* 계약관리: 월 선택이 시작월~끝월 범위(두 칸)로 늘어난 화면 — 검색어 옆에서 하나의 묶음처럼
   보이게 하고, 화면이 좁으면(모바일) 검색어 아래 둘째 줄로 자연스럽게 넘어가게 한다. */
.inline-search-row-wrap {
  flex-wrap: wrap;
}
.inline-search-period {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1 1 auto;
}
/* 계약관리 검색줄: 고객명 검색·시작월·끝월 3칸을 항상 동일한 비율로(2026-09-18 요청) — 이
   화면은 시작월/끝월 칸을 감싸는 .inline-search-period 없이 검색어 칸과 같은 줄의 형제
   요소로 두므로(views/contracts/list.ejs 참고), 셋 다 패딩/테두리가 없는 wrap div를 flex
   아이템으로 두고 똑같은 flex 비율만 주면 된다(input을 직접 flex 아이템으로 두면 그
   input의 padding/border만큼 다른 두 칸보다 더 넓게 자라버린다). "~" 구분자와 검색
   버튼은 원래 크기 그대로 유지된다. */
.contract-search-row-equal .inline-search-q-wrap,
.contract-search-row-equal .inline-search-month-wrap {
  flex: 1 1 0;
  min-width: 84px;
  max-width: none;
}
.contract-search-row-equal .inline-search-q-wrap .inline-search-q {
  width: 100%;
  max-width: none;
}
.inline-search-period .inline-search-month-wrap {
  width: auto;
  flex: 1 1 108px;
  min-width: 92px;
}
.inline-search-period-sep {
  color: #94a3b8;
  flex: 0 0 auto;
}

/* 직급 현황(모바일): 표 대신 한 사람당 카드 한 줄 + 지표 줄로, 가로 스크롤 없이 평균·유지·승진을
   한 번에 보여준다. 지표 3개는 폭이 좁으면 자연스럽게 다음 줄로 넘어간다(줄바꿈 허용). */
.rank-summary-row {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}
.rank-summary-metrics {
  display: flex;
  flex-wrap: wrap;
  column-gap: 0.85rem;
  row-gap: 0.15rem;
  color: #64748b;
}
.rank-summary-metric strong {
  color: #1e293b;
}

.premium-stat-card {
  border-radius: 0.8rem;
  padding: 1.1rem 1.3rem;
  background: linear-gradient(135deg, var(--navy-deep), var(--navy-mid));
  border: 1px solid rgba(216, 180, 106, 0.5);
  color: #fff;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 4px 14px rgba(11, 31, 61, 0.3);
}
.premium-stat-icon {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  background: rgba(216, 180, 106, 0.18);
  color: var(--gold-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex: none;
}
.premium-stat-label {
  color: #cfd9ec;
  font-size: 0.82rem;
}
.premium-stat-value {
  color: var(--gold-bright);
  font-size: 1.4rem;
  font-weight: 800;
  white-space: nowrap;
}

/* 작은 실적 카드(본인 실적 등) 위 아이콘 동그라미 — 기존 .stat-card와 같이 사용 */
.stat-mini-icon {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: #e7edf6;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

/* 랭킹 카드 — 골드 테두리 + 다크 헤더 + 1~3위 메달 */
.premium-rank-card {
  border-radius: 0.9rem;
  overflow: hidden;
  border: 1px solid rgba(216, 180, 106, 0.6);
  box-shadow: 0 4px 14px rgba(11, 31, 61, 0.25);
}
.premium-rank-header {
  background: linear-gradient(135deg, var(--navy-deep), var(--navy-mid));
  color: var(--gold-bright);
  font-weight: 700;
  padding: 0.85rem 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.premium-rank-header a {
  color: #cfd9ec;
  font-size: 0.82rem;
}
.premium-rank-card .table thead th {
  background: #fbf3e0;
  color: #6b5a2e;
}
.premium-rank-card td.rank-amount {
  color: #b7791f;
  font-weight: 700;
}
.medal-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.8rem;
  color: #fff;
}
.medal-badge.medal-1 { background: linear-gradient(135deg, #f0d38f, #b7862c); }
.medal-badge.medal-2 { background: linear-gradient(135deg, #e4e8ee, #9aa4b2); }
.medal-badge.medal-3 { background: linear-gradient(135deg, #e3ac7c, #9c5a2e); }

/* ============================================================
   직급 현황 — 위 프리미엄 배너 아래에 이어지는 티어 배지(브론즈/실버/골드)와
   블루 톤 실적 패널. 배너 자체는 대시보드와 같은 .premium-banner를 재사용한다.
============================================================ */
.tier-card {
  border-radius: 0.8rem;
  padding: 0.9rem 0.6rem;
  text-align: center;
  height: 100%;
  background: #fff;
  border: 1px solid #e4e9ef;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08);
}
.tier-card-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 0.35rem;
  color: #fff;
}
.tier-card-min {
  color: #6c7a89;
  font-size: 0.75rem;
}
.tier-card-name {
  font-weight: 800;
  font-size: 1rem;
  white-space: nowrap;
}
.tier-card-1 .tier-card-icon { background: linear-gradient(135deg, #5b9bdb, #2b6cb0); }
.tier-card-1 .tier-card-name { color: #2b6cb0; }
.tier-card-2 .tier-card-icon { background: linear-gradient(135deg, #e3ac7c, #9c5a2e); }
.tier-card-2 .tier-card-name { color: #9c5a2e; }
.tier-card-3 .tier-card-icon { background: linear-gradient(135deg, #e4e8ee, #9aa4b2); }
.tier-card-3 .tier-card-name { color: #6b7684; }
.tier-card-4 .tier-card-icon { background: linear-gradient(135deg, #f0d38f, #b7862c); }
.tier-card-4 .tier-card-name { color: #9c7a1f; }
/* 좁은 화면에서도 4개를 한 줄(1x4)로 유지하되, 카드 안 여백/글자를 줄여서 겹치지 않게 한다 */
@media (max-width: 575.98px) {
  .tier-card { padding: 0.55rem 0.25rem; }
  .tier-card-icon { width: 1.8rem; height: 1.8rem; font-size: 0.9rem; margin-bottom: 0.2rem; }
  .tier-card-min { font-size: 0.6rem; }
  .tier-card-name { font-size: 0.72rem; }
}

/* 카드 오른쪽 위 짧은 격려문구 — 배너의 골드 손글씨 느낌을 카드에도 살짝 이어준다 */
.rank-quote {
  font-style: italic;
  color: var(--gold, #d8b46a);
  font-size: 0.78rem;
  text-align: right;
  line-height: 1.3;
}

/* 월별 실적 합계·평균 패널 — 기존 옅은 회색 박스 대신 아이콘+블루 톤으로 강조 */
.rank-metric-panel {
  border-radius: 0.7rem;
  background: #eaf2fc;
  padding: 0.5rem 0.55rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 100%;
}
.rank-metric-icon {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: #d7e6fb;
  color: #2b6cb0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  flex: none;
}
.rank-metric-label {
  color: #4a6f9c;
  font-size: 0.62rem;
  line-height: 1.15;
}
.rank-metric-value {
  color: #1f4e8c;
  font-weight: 800;
  font-size: 0.82rem;
  line-height: 1.2;
}

/* "앞으로 ~더 필요합니다" 같은 진행상황 안내 — 옅은 색 알약(pill) 모양으로 눈에 띄게 */
.info-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  background: #eaf2fc;
  color: #1f4e8c;
}
.info-pill-danger {
  background: #fbe9e7;
  color: #a0341f;
}

/* ============================================================
   캡처/다운로드 추적용 워터마크 (lib/watermark.js에서 이미지를 만들어 내려줌)
   — 화면 캡처나 이미지 저장을 막는 기능이 아니라, 유출됐을 때 계정을 추적하기 위한
   보조 장치. 절대 클릭/터치를 가로채면 안 되므로 pointer-events:none을 반드시 유지한다.
   ============================================================ */
.watermark-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  background-repeat: repeat;
}
/* 새론마켓 상품 이미지 등, 화면 전체가 아니라 이미지 한 장 위에만 찍을 때 — 반드시
   position:relative인 요소 안에 넣어서 써야 그 이미지 범위에만 딱 맞게 겹쳐진다. */
.watermark-overlay.watermark-overlay-local {
  position: absolute;
  z-index: 5;
}

/* 새론마켓 이미지 우클릭(다른 이름으로 저장)/드래그 저장을 어렵게 만든다 — 개발자도구 등으로
   원본을 받아가는 것 자체를 막을 수는 없지만, 일반적인 방법으로 쉽게 저장하지 못하게 한다. */
.no-copy-img {
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
}

/* ============================================================
   화면 캡처 방지 보조 장치 — "탭/창 포커스를 잃으면 어둡게" (2026-09-16, admin 계정 테스트용)
   캡처 이벤트 자체를 감지하는 게 아니라 blur/visibilitychange에 반응하는 것이라, 워터마크보다
   더 위(z-index)에 두고 완전히 가려야 의미가 있다. 평소엔 투명 + 클릭 통과, 활성화되면
   불투명 + 클릭 차단.
   ============================================================ */
.screen-guard-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}
.screen-guard-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* 관리자 "화면 보기"(임퍼소네이션) 중임을 계속 눈에 띄게 알려주는 배너(2026-09-17) —
   .main-content의 좌우 여백(padding)에 맞춰 카드 형태로 두고, sticky는 쓰지 않는다(부모
   padding-top 안에서 sticky를 쓰면 고정됐을 때 좌우 여백이 어긋나 보이는 문제가 있어서,
   대신 각 화면 맨 위에 항상 보이는 걸로 충분하다고 판단). */
.impersonate-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  background: linear-gradient(135deg, #4a3600, #7a5c00);
  color: #fff;
  border-radius: 0.6rem;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 10px rgba(74, 54, 0, 0.25);
}
.impersonate-banner strong { color: var(--gold-bright); }
.impersonate-banner form { margin: 0; }
.impersonate-banner .btn { font-weight: 600; white-space: nowrap; }
@media (max-width: 991.98px) {
  .impersonate-banner { margin-left: -1rem; margin-right: -1rem; margin-top: -1rem; border-radius: 0; }
}

/* ---------- 새론계약조회 화면 UI (카드형 리스트로 재디자인, 2026-09) ----------
   대시보드 검색창에서 바로 넘어오는 조회 화면. 예전에는 표(테이블) 형태였는데, 상단
   아이콘+제목/설명 + 검색바(사람 아이콘 + 지우기 버튼) + 최근 검색어 칩 + 모집인별 카드
   목록(보험사 아이콘 원 + 계약자이름 + 계약일자 + 보험료 + 계약상태 배지) 형태로 바꿨다. */
.lookup-header {
  margin-bottom: 1.1rem;
}
/* 제목(아이콘+"새론계약조회")과 버튼(이용안내·자료업로드)을 항상 한 줄에 같이 두고, 설명
   글(부제)만 그 아래 줄로 따로 뺀다 — 폰 화면에서 버튼이 줄바꿔 밀려 내려가지 않고 제목
   오른쪽 빈 공간에 바로 들어가게 하기 위함. 버튼이 늘어나면(관리자: 이용안내+자료업로드
   2개) 제목 쪽이 좁아지며 필요하면 말줄임(...)으로 줄어든다. */
.lookup-header-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}
.lookup-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 0.75rem;
  background: rgba(31, 78, 140, 0.1);
  color: var(--brand-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.lookup-header-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: #1c2b3a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lookup-header-sub {
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
  color: #6c7a89;
}
.lookup-header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}
.lookup-info-btn {
  background: #eaf1fb;
  color: var(--brand-dark);
  border: none;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}
.lookup-info-btn:hover {
  background: #dbe7f8;
  color: var(--brand-dark);
}
.lookup-upload-btn {
  white-space: nowrap;
}

/* 폰 화면: 아이콘·버튼 여백/글자를 조금 더 줄여서, 제목 글자가 너무 심하게 말줄임되지
   않고도 두 버튼이 한 줄에 같이 들어가게 한다. */
@media (max-width: 420px) {
  .lookup-header-icon {
    width: 34px;
    height: 34px;
    font-size: 1rem;
    border-radius: 0.65rem;
  }
  .lookup-header-title {
    font-size: 1.08rem;
  }
  .lookup-header-actions {
    gap: 0.3rem;
  }
  .lookup-info-btn {
    padding: 0.32rem 0.6rem;
    font-size: 0.72rem;
  }
  .lookup-upload-btn {
    padding: 0.32rem 0.55rem !important;
    font-size: 0.72rem !important;
  }
}
/* 관리자 화면(이용안내+자료업로드 버튼 2개)에서는, 좁은 폰에서까지 버튼 글자를 다 붙이고
   있으면 "새론계약조회" 제목이 "새론..." 처럼 알아보기 힘들 정도로 줄어든다. 그래서 버튼이
   2개일 때만(:has로 자료업로드 버튼 존재 여부 확인) 글자를 숨기고 아이콘만 남긴 동그란
   버튼으로 바꿔서, 제목이 줄어드는 대신 버튼 쪽이 줄어들게 한다. 버튼이 1개뿐인 설계사
   화면은 이 폭에서도 이미 제목이 잘리지 않으므로 그대로 글자를 유지한다. */
@media (max-width: 400px) {
  .lookup-header-actions:has(.lookup-upload-btn) .lookup-btn-text {
    display: none;
  }
  .lookup-header-actions:has(.lookup-upload-btn) .lookup-info-btn,
  .lookup-header-actions:has(.lookup-upload-btn) .lookup-upload-btn {
    padding: 0.4rem !important;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem !important;
  }
  .lookup-header-actions:has(.lookup-upload-btn) .lookup-info-btn i,
  .lookup-header-actions:has(.lookup-upload-btn) .lookup-upload-btn i {
    margin: 0;
  }
}

.lookup-search-form {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}
.lookup-search-bar {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}
.lookup-search-bar-icon {
  color: #9aa5b1;
  font-size: 1rem;
  flex-shrink: 0;
}
.lookup-search-input {
  border: none;
  outline: none;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.95rem;
  background: transparent;
}
.lookup-search-clear {
  border: none;
  background: #eef1f5;
  color: #6c7a89;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  flex-shrink: 0;
  padding: 0;
}
.lookup-search-submit {
  background: var(--brand-dark);
  color: #fff;
  border: none;
  border-radius: 0.9rem;
  padding: 0.55rem 1.1rem;
  font-weight: 600;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  white-space: nowrap;
}
.lookup-search-submit:hover {
  background: var(--brand);
  color: #fff;
}

/* 2026-09-22: "보증 및 지원금" 검색창 UI(위 .lookup-search-*)를 다른 화면들에도 그대로
   적용하면서 추가로 필요해진 변형들. */
/* 검색어 칸 옆에 부서/상태 같은 드롭다운이 더 붙는 화면(인사관리·설계사관리 등)에서, 폰
   화면처럼 좁을 때 다음 줄로 자연스럽게 넘어가게 한다(기본 .lookup-search-form은 nowrap). */
.lookup-search-form-wrap {
  flex-wrap: wrap;
}
.lookup-search-form-wrap .lookup-search-bar {
  flex: 1 1 220px;
  max-width: 320px;
}
.lookup-search-form-wrap .lookup-search-select {
  /* Bootstrap .form-select 자체에 width:100%가 박혀있어서 flex-basis:auto가 그 100%를 그대로
     가져가 버린다(내용 길이가 아니라) — width를 명시적으로 auto로 다시 지정해야 제 크기로 줄어든다. */
  flex: 0 0 auto;
  width: auto;
}
/* 계약관리 검색줄(시작월/끝월과 나란히), 로그인 기록 필터, 대시보드 배너 안처럼 폼 전체가
   아니라 다른 요소들과 한 줄에 나란히 들어가는 자리에 쓰는 더 낮은 높이의 pill. */
.lookup-search-bar-compact {
  padding: 0.35rem 0.7rem;
}
.lookup-search-bar-compact .lookup-search-input {
  font-size: 0.85rem;
}
/* 유지율 화면의 설계사명 검색창(탭들과 한 줄) — 기존 폭 비율을 그대로 유지 */
.retention-controls .lookup-search-bar {
  flex: 1 1 180px;
}

/* 2026-09-22(2): 검색창(.lookup-search-*) 옆에 있던 "전체 설계사"/"전체 상태" 같은 일반
   드롭다운, "시작월~끝월" 같은 일반 날짜 입력도 브라우저 기본 모양이라 검색창만 pill이고
   나머지는 예전 그대로라 안 어울린다는 요청으로, 유지율 화면의 날짜 선택(.retention-date-picker,
   흰 pill 안에 아이콘+select+chevron)과 같은 방식으로 전부 통일한다. */
.lookup-select-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
  font-size: 0.88rem;
  color: #33404d;
  flex-shrink: 0;
}
.lookup-select-pill i.lookup-select-pill-icon {
  color: #6c7a89;
  flex-shrink: 0;
  font-size: 0.95rem;
}
.lookup-select-pill i.bi-chevron-down {
  color: #9aa5b1;
  font-size: 0.7rem;
  flex-shrink: 0;
}
.lookup-select-pill select {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.88rem;
  color: #33404d;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  flex: 1 1 auto;
  min-width: 0;
  padding-right: 0.15rem;
}
/* 검색창(.lookup-search-form) 안, 또는 계약관리 검색줄처럼 다른 칸들과 한 줄에 나란히
   들어갈 때 쓰는 더 낮은 높이 버전. */
.lookup-select-pill-compact {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}
.lookup-select-pill-compact select {
  font-size: 0.85rem;
}

/* 날짜/월 선택도 같은 pill로 — 네이티브 달력 아이콘(브라우저마다 다르게 생김) 대신 우리
   달력 아이콘(bi-calendar3)을 왼쪽에 두고, 실제 input은 투명하게 깔아 그 자리를 채운다. */
.lookup-date-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
  font-size: 0.88rem;
  color: #33404d;
  position: relative;
  flex-shrink: 0;
}
.lookup-date-pill i.bi-calendar3 {
  color: #6c7a89;
  flex-shrink: 0;
  font-size: 0.95rem;
}
.lookup-date-pill input[type="date"],
.lookup-date-pill input[type="month"] {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.88rem;
  color: #33404d;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
}
.lookup-date-pill-compact {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}
.lookup-date-pill-compact input[type="date"],
.lookup-date-pill-compact input[type="month"] {
  font-size: 0.85rem;
}
/* 값이 비어있을 때(=전체 기간) "시작월"/"끝월" 안내 문구를 덮어 보여주는 라벨 — pill 안의
   아이콘 자리(왼쪽)는 항상 보이게 두고, 그 뒤쪽만 흰 배경으로 덮어서 안내 문구를 겹쳐 보여준다. */
.lookup-date-pill-hint {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 2rem;
  z-index: 1;
  display: flex;
  align-items: center;
  padding-right: 0.2rem;
  font-size: 0.85rem;
  color: #9aa5b1;
  background: #fff;
  border-radius: 0 999px 999px 0;
  pointer-events: none;
}

.lookup-recent-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}
.lookup-recent-label {
  font-size: 0.8rem;
  color: #6c7a89;
  flex-shrink: 0;
}
.lookup-recent-chips {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.lookup-recent-chip {
  background: #fff;
  border: 1px solid #dfe4ea;
  color: #425163;
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.78rem;
  line-height: 1.2;
}
.lookup-recent-chip:hover {
  background: #f3f6fa;
}
.lookup-recent-chip.active {
  border-color: var(--brand);
  color: var(--brand-dark);
  font-weight: 600;
  background: #eaf1fb;
}

.lookup-group-card {
  background: #fff;
  border-radius: 0.9rem;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
  margin-bottom: 0.9rem;
  overflow: hidden;
}
.lookup-group-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  background: #f6f8fb;
  font-weight: 700;
  color: #1c2b3a;
  font-size: 0.92rem;
  border-bottom: 1px solid #eef1f5;
}
.lookup-group-header i {
  color: var(--brand);
  font-size: 0.95rem;
}
.lookup-group-title {
  flex: 1 1 auto;
  min-width: 0;
}
.lookup-group-count {
  font-size: 0.75rem;
  color: #6c7a89;
  font-weight: 500;
  flex-shrink: 0;
}

.lookup-contract-list {
  display: flex;
  flex-direction: column;
}
.lookup-contract-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #f1f3f6;
}
.lookup-contract-item:last-child {
  border-bottom: none;
}
.lookup-contract-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.95rem;
}
.lookup-contract-main {
  flex: 1 1 auto;
  min-width: 0;
}
.lookup-contract-title {
  font-weight: 700;
  font-size: 1.02rem;
  color: #1c2b3a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lookup-contract-sub {
  font-size: 0.85rem;
  font-weight: 600;
  color: #4a5568;
  min-width: 0;
}
.lookup-contract-sub-name {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: 100%;
}
/* 이름 가운데 글자가 "*"로 가려진 자료가 검색어와 글자수·나머지 글자만 맞춰서 매칭됐을 때
   붙는 경고 배지 — "동일 인물이 확실하지 않다"는 걸 눈에 띄게 알려서, 실제로 확인 없이
   그대로 믿고 넘어가는 걸 막는 용도다(2026-09-16, 사용자 요청). */
.lookup-masked-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.2rem;
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  background: #fff4e0;
  color: #a15c00;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: normal;
  word-break: keep-all;
  border: 1px solid #f3d9a8;
  max-width: 100%;
}
.lookup-masked-badge i {
  flex-shrink: 0;
  font-size: 0.7rem;
}
.lookup-masked-badge-inline {
  vertical-align: middle;
  margin: 0 0.1rem;
}

/* 아주 좁은 화면에서는 배지 글자를 줄여서 카드 한 줄 폭 안에 더 여유 있게 들어가게 한다. */
@media (max-width: 380px) {
  .lookup-masked-badge {
    font-size: 0.62rem;
    padding: 0.12rem 0.35rem;
  }
}
.lookup-contract-col {
  text-align: center;
  flex-shrink: 0;
}
.lookup-contract-col-label {
  font-size: 0.74rem;
  color: #7c8794;
}
.lookup-contract-col-value {
  font-size: 0.92rem;
  color: #262f38;
  font-weight: 700;
  white-space: nowrap;
}
.lookup-contract-premium .lookup-contract-col-value {
  color: #1c2b3a;
  font-weight: 700;
}
.lookup-contract-status {
  flex-shrink: 0;
}
.lookup-contract-status .badge {
  font-size: 0.76rem;
  padding: 0.4rem 0.6rem;
}

/* 아주 좁은 화면(작은 폰)에서는 계약일 칼럼을 빼고 보험료·상태만 남겨서, 이름이 길어도
   줄바꿈 없이 한 줄에 들어가게 한다. */
@media (max-width: 380px) {
  .lookup-contract-date {
    display: none;
  }
  .lookup-header-sub {
    display: none;
  }
}

/* ---------- 약관검색 결과 카드 (2026-09-21 추가) ----------
   챗봇처럼 "질문 → 답 말풍선" 느낌을 주되, 실제로는 단순 키워드 검색이라 과장된 디자인
   대신 담담한 카드 형태로 보여준다(위 계약조회 카드와 톤을 맞춤). */
.policy-result-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.policy-result-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 0.9rem 1.1rem;
}
.policy-result-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.policy-result-product {
  font-size: 0.85rem;
  color: #6b7280;
}
.policy-result-page {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-left: auto;
}
.policy-result-title {
  font-weight: 600;
  color: #163a68;
  margin-bottom: 0.3rem;
}
.policy-result-snippet {
  font-size: 0.92rem;
  line-height: 1.55;
  color: #374151;
}
.policy-result-snippet mark {
  background: #fef08a;
  padding: 0 0.1rem;
  border-radius: 0.15rem;
}

/* ---------- 유지율 화면 UI (카드+도넛그래프로 재디자인, 2026-09) ----------
   상단 아이콘+제목/설명 + 기준일 선택(달력 아이콘 필박스) + 진한 남색 요약 카드(평균
   유지율 큰 글자 + 도넛 그래프 + 설계사수/유지/미유지) + 탭(전체/유지우수/주의대상) +
   설계사명 검색 + 표(순위 없이 설계사명·유지율(막대)·상태배지, 유지율 낮은 사람부터
   오름차순 정렬). */
.retention-header {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.retention-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 0.8rem;
  background: rgba(31, 78, 140, 0.1);
  color: var(--brand-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.retention-header-text {
  flex: 1 1 200px;
  min-width: 0;
}
.retention-header-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: #1c2b3a;
}
.retention-header-text p {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: #6c7a89;
}
.retention-header-actions {
  margin-left: auto;
}

.retention-date-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.8rem;
}
.retention-date-picker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
  font-size: 0.85rem;
  color: #33404d;
}
.retention-date-picker i.bi-calendar3 {
  color: #6c7a89;
}
.retention-date-picker i.bi-chevron-down {
  color: #9aa5b1;
  font-size: 0.7rem;
}
.retention-date-picker select {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.85rem;
  color: #33404d;
  appearance: none;
}

.retention-summary-card {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  background: linear-gradient(135deg, var(--navy-deep), var(--navy-mid) 70%);
  border-radius: 1rem;
  padding: 1.2rem 1.3rem;
  color: #fff;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.retention-summary-left {
  flex: 1 1 140px;
  min-width: 0;
}
.retention-summary-label {
  font-size: 0.85rem;
  color: #c3d0e3;
}
.retention-summary-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold-bright);
  line-height: 1.15;
  margin-top: 0.1rem;
}
.retention-summary-caption {
  font-size: 0.72rem;
  color: #93a5c0;
  margin-top: 0.3rem;
}
.retention-summary-donut {
  flex-shrink: 0;
}
.retention-donut-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 9;
}
.retention-donut-fill {
  fill: none;
  stroke: #5b9bf0;
  stroke-width: 9;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}
.retention-donut-text {
  fill: #fff;
  font-size: 19px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: middle;
}
.retention-summary-stats {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0.7rem;
  padding: 0.65rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.78rem;
  min-width: 118px;
}
.retention-summary-stats-row {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
}
.retention-summary-stats-row .label {
  color: #c3d0e3;
}
.retention-summary-stats-row .value {
  font-weight: 700;
}
.retention-summary-stats-row .value.danger {
  color: #ff9d9d;
}

.retention-controls {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
  align-items: center;
}
.retention-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.retention-tab {
  background: #fff;
  border: 1px solid #dfe4ea;
  color: #425163;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
}
.retention-tab:hover {
  background: #f3f6fa;
}
.retention-tab.active {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}
.retention-search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08);
  flex: 1 1 180px;
  min-width: 0;
}
.retention-search-bar i {
  color: #9aa5b1;
}
.retention-search-bar input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.85rem;
  flex: 1 1 auto;
  min-width: 0;
}

.retention-rate-cell {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 130px;
}
.retention-rate-value {
  font-weight: 700;
  font-size: 0.85rem;
  color: #1c2b3a;
  flex-shrink: 0;
  min-width: 46px;
}
.retention-rate-track {
  flex: 1 1 auto;
  min-width: 40px;
  height: 6px;
  background: #eef1f5;
  border-radius: 999px;
  overflow: hidden;
}
.retention-rate-fill {
  height: 100%;
  border-radius: 999px;
}
.retention-rate-fill-excellent {
  background: #2f9e64;
}
.retention-rate-fill-normal {
  background: #2f7dd8;
}
.retention-rate-fill-caution {
  background: #e0982f;
}

.retention-status-badge {
  font-size: 0.72rem;
  padding: 0.35rem 0.6rem;
  font-weight: 600;
}
.retention-status-excellent {
  background: #dcf5e6;
  color: #1f7a45;
}
.retention-status-normal {
  background: #e2edfc;
  color: #1f4e8c;
}
.retention-status-caution {
  background: #fbe8cf;
  color: #8a5a12;
}

@media (max-width: 420px) {
  .retention-summary-card {
    padding: 1rem;
    gap: 0.8rem;
  }
  .retention-summary-value {
    font-size: 1.7rem;
  }
  .retention-summary-donut {
    width: 72px;
    height: 72px;
  }
  .retention-summary-stats {
    min-width: 104px;
    font-size: 0.72rem;
  }
  .retention-rate-cell {
    min-width: 100px;
  }
}

/* 유지율 화면 — 13회차/25회차 유지율 칸 추가(2026-09). 아직 회사 초기라 당분간 대부분
   "-"로 보일 수 있다는 걸 표 위에 짧게 안내한다. */
.retention-period-note {
  font-size: 0.76rem;
  color: #6c7a89;
  background: #eef2f7;
  border-radius: 0.6rem;
  padding: 0.55rem 0.8rem;
  margin-bottom: 0.7rem;
}
.retention-period-col {
  text-align: center;
  font-size: 0.8rem;
  color: #425163;
  white-space: nowrap;
}

/* 좁은 화면에서는 칸이 5개(설계사명·유지율·13회차·25회차·상태)라 막대그래프까지 넣으면
   비좁아지므로, 유지율은 숫자만 남기고 막대는 숨긴다. */
@media (max-width: 420px) {
  .retention-rate-cell {
    min-width: 0;
  }
  .retention-rate-track {
    display: none;
  }
  .retention-period-col {
    font-size: 0.74rem;
  }
}

/* 실효관리 요약 카드(실효대상 건수·고객 수·수금액 합계) — 폰에서도 항상 1x3 한 줄로 보이게
   한다. 부트스트랩 3분할 그리드(각 칸을 무조건 1/3 너비로 고정)를 쓰지 않고 flex로 각
   카드가 자기 글자 길이만큼만 너비를 차지하게 해서("고객 수"처럼 짧은 칸은 좁게, "수금액
   합계"처럼 긴 칸은 넓게), 그렇게 남는 공간만큼 글자를 예전보다 훨씬 크게 키울 수 있게 한다. */
.lapse-stat-row {
  display: flex;
  gap: 0.8rem;
}
.lapse-stat-row .stat-card {
  flex: 0 1 auto;
  min-width: 0;
  padding: 0.7rem 1rem;
}
.lapse-stat-row .stat-card .stat-label {
  white-space: nowrap;
  font-size: 1.05rem;
}
.lapse-stat-row .stat-card .stat-value {
  white-space: nowrap;
  font-size: 1.15rem;
}
@media (max-width: 575.98px) {
  .lapse-stat-row {
    gap: 0.5rem;
  }
  .lapse-stat-row .stat-card {
    padding: 0.6rem 0.7rem;
  }
  .lapse-stat-row .stat-card .stat-label {
    font-size: 0.95rem;
  }
  .lapse-stat-row .stat-card .stat-value {
    font-size: 1rem;
  }
}
@media (max-width: 360px) {
  .lapse-stat-row .stat-card {
    padding: 0.55rem 0.55rem;
  }
  .lapse-stat-row .stat-card .stat-label {
    font-size: 0.85rem;
  }
  .lapse-stat-row .stat-card .stat-value {
    font-size: 0.9rem;
  }
}

/* ===== AI 챗봇 말풍선 위젯 (2026-09-19 추가) =====
   화면 우측 하단에 항상 떠 있는 채팅 버튼. 누르면 팝업 채팅창이 뜨고, 헤더를 누르면
   최소화/펼치기, X를 누르면 완전히 닫힌다. 지금은 프론트엔드 화면만 먼저 만든 단계라
   실제 답변(ERP 데이터 조회·보험약관 AI 검색)은 아직 연결 전 — layout.ejs의 스크립트에서
   예시 답변만 보여준다. */
.ai-chat-bubble {
  position: fixed;
  right: 1.25rem;
  bottom: 1.5rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-deep), var(--navy-mid));
  color: var(--gold-bright);
  border: none;
  box-shadow: 0 6px 18px rgba(11, 31, 61, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  z-index: 1040;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.ai-chat-bubble:hover { transform: scale(1.06); }
.ai-chat-bubble.is-hidden { display: none; }

/* 모바일에서는 하단 탭바(.mobile-bottom-nav, 대략 4.4rem 높이)에 가리지 않도록 위로 띄운다 */
@media (max-width: 991.98px) {
  .ai-chat-bubble {
    right: 1rem;
    bottom: calc(4.4rem + 0.85rem + env(safe-area-inset-bottom, 0));
  }
}

.ai-chat-popup {
  position: fixed;
  right: 1.25rem;
  bottom: calc(1.5rem + 56px + 0.75rem);
  width: 340px;
  max-width: calc(100vw - 2rem);
  height: 480px;
  max-height: calc(100vh - 8rem);
  /* 2026-09-20: 모바일에서 키보드가 올라오면 브라우저가 실제 보이는 화면 높이를 줄여주는데,
     대부분 모바일 브라우저는 100vh를 "키보드 뜨기 전" 값으로 고정해버려서 max-height가
     실제보다 커진 채로 남는다 → 팝업 박스가 화면보다 커져서 헤더/대화 내용이 화면 위로
     밀려 안 보이게 되는 문제가 있었다. 100dvh(동적 뷰포트 높이)는 키보드가 뜬 만큼 줄어든
     실제 보이는 높이를 반영해주므로, 지원하는 브라우저에서는 이 값이 위 선언을 덮어써서
     키보드가 떠 있어도 팝업이 화면 안에 맞게 줄어든다(지원 안 하면 위 vh값 그대로 유지). */
  max-height: calc(100dvh - 8rem);
  background: #fff;
  border-radius: 0.9rem;
  box-shadow: 0 10px 34px rgba(0,0,0,0.22);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1041;
}
.ai-chat-popup.is-open { display: flex; }

@media (max-width: 991.98px) {
  .ai-chat-popup {
    /* 모바일도 PC처럼 우측 하단에 떠 있는 형태로 — 좌우로 넓게 펼치지 않고 버블과 같은 폭
       기준(340px, 화면이 더 좁으면 max-width로 줄어듦)을 그대로 쓰고, 하단 탭바에 안 가리게
       bottom 값만 올려준다. */
    right: 1rem;
    bottom: calc(4.4rem + 56px + 1.6rem + env(safe-area-inset-bottom, 0));
    /* 하단 여백(탭바+버블)이 PC보다 더 크게 잡혀 있는 만큼 최대 높이도 그만큼 더 여유를 둔다 */
    max-height: calc(100vh - 10rem);
    max-height: calc(100dvh - 10rem);
  }
}

.ai-chat-popup-header {
  background: linear-gradient(135deg, var(--navy-deep), var(--navy-mid));
  color: #fff;
  padding: 0.7rem 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  flex-shrink: 0;
}
.ai-chat-popup-header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.92rem;
}
.ai-chat-popup-header-title i { color: var(--gold-bright); }
.ai-chat-popup-header-actions { display: flex; gap: 0.35rem; }
.ai-chat-popup-header-actions button {
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}
.ai-chat-popup-header-actions button:hover { background: rgba(255,255,255,0.25); }

.ai-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem;
  background: #f4f6f9;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.ai-chat-msg {
  max-width: 82%;
  font-size: 0.85rem;
  line-height: 1.4;
  padding: 0.5rem 0.75rem;
  border-radius: 0.85rem;
  white-space: pre-wrap;
  word-break: keep-all;
}
.ai-chat-msg.from-bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e2e6ec;
  color: #33394a;
  border-bottom-left-radius: 0.2rem;
}
.ai-chat-msg.from-user {
  align-self: flex-end;
  background: var(--navy-mid);
  color: #fff;
  border-bottom-right-radius: 0.2rem;
}

/* 2026-09-20: 카카오톡 채널봇/토스 등의 "추천 질문 버튼(quick reply)" UI를 벤치마킹해서
   추가. 안내 말풍선 바로 아래에 눌러서 바로 보낼 수 있는 알약(pill) 버튼들을 둔다. */
.ai-chat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-self: flex-start;
  max-width: 100%;
  padding-left: 0.1rem;
}
.ai-chat-quick-reply {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--navy-mid);
  background: #fff;
  color: var(--navy-mid);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.ai-chat-quick-reply i { font-size: 0.85rem; }
.ai-chat-quick-reply:hover,
.ai-chat-quick-reply:focus-visible {
  background: var(--navy-mid);
  color: #fff;
}

.ai-chat-input-row {
  flex-shrink: 0;
  display: flex;
  gap: 0.4rem;
  padding: 0.6rem;
  border-top: 1px solid #e2e6ec;
  background: #fff;
}
.ai-chat-input-row input {
  flex: 1;
  border: 1px solid #d7dce4;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  outline: none;
}
.ai-chat-input-row input:focus { border-color: var(--navy-mid); }
.ai-chat-input-row button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--navy-mid);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ai-chat-input-row button:hover { background: var(--navy-deep); }

/* ---------- 보증 및 지원금 - 모바일 카드형 리스트 (2026-09-21 추가) ----------
   표(칸 13개)를 폰 화면에 그대로 두면 계속 옆으로 스크롤해야 해서 한눈에 안 들어온다.
   그래서 좁은 화면(<768px)에서는 표 대신 사람별 카드로 보여주고, 지원금·채권 3종·합계·
   상환/해촉 상태를 카드 한 장 안에서 바로 볼 수 있게 한다(넓은 화면에서는 그대로 표를 씀). */
.sf-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.sf-card {
  position: relative;
  background: #fff;
  border-radius: 0.9rem;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
  padding: 0.85rem 1rem;
}
.sf-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.sf-card-name {
  font-weight: 700;
  font-size: 1.02rem;
  color: #1c2b3a;
}
.sf-card-agentno {
  font-size: 0.76rem;
  font-weight: 500;
  color: #7c8794;
  margin-left: 0.35rem;
}
.sf-card-status {
  flex-shrink: 0;
  font-size: 0.72rem;
}
.sf-card-badges {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
/* 대표(CEO) 개인자금이 섞인 건이라는 걸 눈에 확 띄게 알려주는 배지 — 상환 상태 배지와
   같은 크기/모양(.sf-card-status)을 쓰되, 빨간 박스에 하얀 글씨로 확실히 구분한다
   (2026-09-21 사용자 요청). */
.sf-card-badge-rep {
  background: #dc3545;
  color: #fff;
}
.sf-card-support {
  font-size: 0.9rem;
  color: #4a5568;
  margin-bottom: 0.55rem;
}
.sf-card-support strong {
  font-size: 1.15rem;
  color: var(--brand);
  margin-left: 0.3rem;
}
.sf-card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  padding-top: 0.5rem;
  border-top: 1px solid #f1f3f6;
}
.sf-card-cell {
  text-align: center;
  min-width: 0;
}
.sf-card-cell-label {
  font-size: 0.68rem;
  color: #7c8794;
}
.sf-card-cell-value {
  font-size: 0.82rem;
  font-weight: 700;
  color: #262f38;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sf-card-note {
  margin-top: 0.5rem;
  padding-top: 0.45rem;
  border-top: 1px solid #f1f3f6;
  font-size: 0.8rem;
  color: #6c7a89;
  word-break: break-word;
}
.sf-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  margin-top: 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand);
}
@media (max-width: 380px) {
  .sf-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 2026-09-23: 상품별 계산기 — 폰에서 보험사/상품명/익월수수료/총수수료/익월시상/익월합계
   6칸 표가 옆으로 스크롤돼야 해서 안 보인다는 문제. .sf-card-* 와 같은 구조(카드+grid)로
   상품 하나당 카드 한 장으로 보여준다. */
.cc-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.cc-card {
  position: relative;
  background: #fff;
  border-radius: 0.9rem;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
  padding: 0.85rem 1rem;
}
.cc-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.cc-card-insurer {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1c2b3a;
}
.cc-card-total {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--brand);
}
.cc-card-product {
  font-size: 0.88rem;
  color: #4a5568;
  margin-bottom: 0.55rem;
  word-break: break-word;
}
.cc-card-category {
  font-size: 0.76rem;
  color: #9aa5b1;
}
.cc-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  padding-top: 0.5rem;
  border-top: 1px solid #f1f3f6;
}
.cc-card-cell {
  text-align: center;
  min-width: 0;
}
.cc-card-cell-label {
  font-size: 0.68rem;
  color: #7c8794;
}
.cc-card-cell-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: #262f38;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 2026-09-30: 폰 카드에도 PC 표와 같은 NO·보험사 아바타·강조된 익월합계 배지를 맞춰준다
   (아바타 자체(.cc-insurer-avatar)는 표와 공유 — public/css/style.css의 표 쪽 정의 참고). */
.cc-card-insurer-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.cc-card-no {
  font-size: 0.72rem;
  color: #9aa5b1;
  font-weight: 600;
  flex-shrink: 0;
}
.cc-card-insurer {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cc-card-total {
  background: #eaf1fb;
  color: var(--brand-dark);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

/* 2026-09-30: 폰 화면 페이지네이션 — 버튼을 여러 개 늘어놓기엔 좁아서 이전/다음 +
   "1 / N" 표시로 대신한다(표 쪽 .cc-pagination-bar와 같은 currentPage/pageSize 공유). */
.cc-pagination-bar-mobile {
  align-items: center;
  justify-content: space-between;
  margin-top: 0.9rem;
  gap: 0.5rem;
}
.cc-page-arrow-btn {
  flex: 1 1 auto;
  border: 1px solid #d7dee6;
  background: #fff;
  color: #4a5568;
  border-radius: 0.7rem;
  padding: 0.5rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}
.cc-page-arrow-btn:disabled { color: #c3cbd4; }
.cc-page-indicator {
  font-size: 0.85rem;
  color: #6c7a89;
  white-space: nowrap;
  flex-shrink: 0;
}

/* 2026-09-28: 원수사 익월시상 관리 — 보험사 카드를 바둑판식(PC 화면 폭에 맞춰 2~3열, 좁아지면
   자동 1열)으로 나열해서, 카드 하나(=보험사 하나)에만 그 보험사의 시상 목록을 넣고 그 카드
   안에서만 추가·수정·저장이 되게 한다(다른 회사 카드에는 영향 없음). */
.bonus-insurer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1rem;
}
.bonus-insurer-card {
  background: #fff;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}
.bonus-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  background: #f7f9fc;
  border-bottom: 1px solid #eef1f6;
}
.bonus-card-head-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}
.bonus-card-icon {
  width: 30px;
  height: 30px;
  border-radius: 0.5rem;
  background: var(--brand-dark);
  color: #fff;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.bonus-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1c2b3a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bonus-card-count {
  font-size: 0.75rem;
  color: #6c7a89;
}
.bonus-add-row-btn {
  border: 1px dashed #b9c3d8;
  background: #fff;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 0.5rem;
  padding: 0.32rem 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.bonus-add-row-btn:hover { background: #eef3ff; }

table.bonus-table { width: 100%; border-collapse: collapse; }
table.bonus-table thead th {
  background: #fff;
  color: #6c7a89;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: left;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #eef1f6;
}
table.bonus-table thead th.num { text-align: right; }
table.bonus-table tbody td {
  padding: 0.45rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid #f3f5f8;
}
table.bonus-table tbody tr:last-child td { border-bottom: none; }
.bonus-cell-input {
  border: 1px solid #dfe4ec;
  border-radius: 0.45rem;
  padding: 0.32rem 0.5rem;
  font-size: 0.8rem;
  width: 100%;
  background: #fbfcfe;
}
.bonus-cell-input:focus { outline: none; border-color: var(--brand); background: #fff; }
.bonus-row-active td { background: #fbfcfe; }
.bonus-active-dot {
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: #2ea043; margin-right: 4px; flex-shrink: 0;
}
.bonus-row-remove-btn {
  width: 26px; height: 26px; border-radius: 0.4rem; border: 1px solid #eef1f6;
  background: #fff; color: #c23b3b; display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
}
.bonus-empty-body {
  padding: 1.6rem 1rem;
  text-align: center;
  color: #9aa2b1;
  font-size: 0.78rem;
}
.bonus-card-footer {
  margin-top: auto;
  padding: 0.55rem 1rem;
  border-top: 1px solid #eef1f6;
  background: #fafbfd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.bonus-card-footer-hint {
  font-size: 0.72rem;
  color: #9aa2b1;
}
.bonus-save-btn {
  background: var(--brand-dark);
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  padding: 0.4rem 0.9rem;
  font-weight: 700;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
/* 2026-09-28: 카드 안에 익월시상·13차월 시상 두 표를 나눠서 보여주는 구획 — 각 표 위에
   작은 구획 제목(bonus-section-label)과 그 구획 전용 "추가" 버튼을 둔다. */
.bonus-section + .bonus-section { border-top: 1px solid #eef1f6; }
.bonus-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 1rem 0.3rem;
}
.bonus-section-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #47546b;
}
.bonus-add-card {
  align-items: center;
  justify-content: center;
  min-height: 140px;
  border: 1px dashed #c3cbdc;
  background: transparent;
  box-shadow: none;
  color: var(--brand);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}
.bonus-add-card .bonus-add-inner {
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
}
.bonus-add-card i { font-size: 1.4rem; }

/* ============================================================
   원수사 시상(2026-09-28 개편, 2026-09-28(2) 전단지 업로드로 재개편) — 보험사가 많아지면
   위로 쌓지 않고 엑셀 시트 탭처럼 보험사 이름 탭을 눌러 전환(메타시상 사상1/2/3 탭과 같은
   원리). 항목을 직접 입력하는 대신 보험사 시책 전단지 PDF를 그대로 올리면 이미지로 바로
   보여준다(자동계산 항목은 표 형태로 그 아래에 별도로 붙는다).
============================================================ */
.insurer-award-tabs {
  border-bottom: 1px solid #d7dee6;
}
.insurer-award-tabs .nav-link {
  border: 1px solid #d7dee6;
  border-bottom: none;
  border-radius: 0.6rem 0.6rem 0 0;
  background: #e4e9ef;
  color: #4a5568;
  padding: 0.55rem 1rem;
  font-weight: 600;
  margin-bottom: -1px;
  margin-right: 0.25rem;
}
.insurer-award-tabs .nav-link.active {
  background: #fff;
  color: var(--navy-deep);
  border-color: #d7dee6 #d7dee6 #fff;
}
.insurer-award-tab-content {
  background: #fff;
  border: 1px solid #d7dee6;
  border-top: none;
  border-radius: 0 0 0.6rem 0.6rem;
  padding: 1rem;
  box-shadow: 0 1px 5px rgba(0,0,0,0.12);
}
@media (max-width: 767.98px) {
  .insurer-award-tabs .nav-link {
    padding: 0.5rem 0.7rem;
    font-size: 0.88rem;
  }
}

.award-flyer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.award-flyer-meta-actions { display: flex; gap: 0.4rem; }
.award-flyer-upload-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.award-flyer-upload-form input[type="file"] { max-width: 320px; }
.award-flyer-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.award-flyer-img {
  max-width: 100%;
  height: auto;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.award-flyer-empty {
  text-align: center;
  padding: 2rem 1rem;
  border: 1px dashed #c3cbdc;
  border-radius: 0.6rem;
  background: #f7f9fc;
}
.award-flyer-empty i { font-size: 2rem; color: #8592a6; }

/* 2026-10-15(2): 상품별 계산기 결과(.cc-main-results)와 시상안 이미지(.cc-award-flyer-aside)를
   웹에서는 좌우 2단으로(수수료랑 "한눈에" 보이게), 폰에서는 세로로 쌓는다. 모바일 기본값은
   column이라 DOM 순서대로 쌓이는데, 시상 이미지가 검색결과보다 먼저(위에) 보이는 게 자연스러워
   order:-1로 앞세운다 — md 이상에서는 가로(row)로 바뀌면서 order:2로 다시 뒤로(오른쪽 열로)
   보낸다. */
.cc-main-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.cc-main-results { min-width: 0; }
.cc-award-flyer-aside { order: -1; }
@media (min-width: 768px) {
  .cc-main-layout { flex-direction: row; align-items: flex-start; }
  .cc-main-results { flex: 1 1 auto; min-width: 0; }
  .cc-award-flyer-aside {
    order: 2;
    flex: 0 0 360px;
    max-width: 360px;
    position: sticky;
    top: 1rem;
  }
  /* 오른쪽 열에서는 카드 폭이 정해져 있으니 전체 이미지(.award-flyer-img)도 그 폭에 맞춘다 —
     기존 /insurer-awards 화면(최대 720px 중앙정렬)보다 좁게 보여야 함. */
  .cc-award-flyer-aside .award-flyer-pages { gap: 0.6rem; }
  .cc-award-flyer-aside .award-flyer-img { max-width: 100%; }
}

/* 2026-10-15: 상품별 계산기(/commission-calc)에서 보험사 선택 시 보여주는 시상안 카드 —
   PC는 위 .award-flyer-img를 그대로 재사용(전체 이미지를 크게), 폰은 작은 썸네일 줄 +
   탭하면 뜨는 전체화면 라이트박스. */
.cc-award-flyer-thumb-row {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}
.cc-award-flyer-thumb {
  width: 84px;
  height: 84px;
  object-fit: cover;
  object-position: top;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  flex: 0 0 auto;
  cursor: pointer;
}
.cc-award-flyer-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 2000;
}
.cc-award-flyer-lightbox.show { display: flex; }
.cc-award-flyer-lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 0.4rem;
}
.award-calc-items {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px dashed #e2e8f0;
}
.award-calc-items-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #8592a6;
  margin-bottom: 0.4rem;
}

/* ============================================================
   경리/회계 대시보드 리디자인 (2026-09-29) — 사용자가 보내준 참고 화면(카드형 KPI + 차트 +
   예산 게이지)의 "느낌"을 기존 데이터(수입/지출/카드, 매입·매출 개념 없음) 그대로 입힌다.
   차트 라이브러리는 새로 추가하지 않고, 이 사이트 기존 방식(.month-bar-chart 등)과 같이
   순수 CSS(막대 높이 %, conic-gradient 도넛)로 그린다.
   ============================================================ */

/* KPI 카드 — 아이콘 배지 + 라벨/값. 기존 .stat-card 레이아웃 위에 아이콘만 얹는 변형. */
.acct-kpi-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.acct-kpi-icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}
.acct-kpi-icon-blue { background: #e7f0ff; color: var(--brand); }
.acct-kpi-icon-green { background: #e5f7ec; color: #0ca30c; }
.acct-kpi-icon-red { background: #fdecec; color: #d03b3b; }
.acct-kpi-icon-gold { background: #fdf3df; color: #b9862f; }
.acct-kpi-body { min-width: 0; }
.acct-kpi-body .stat-label { white-space: normal; line-height: 1.25; }
.acct-kpi-body .stat-value { font-size: 1.15rem; }

/* 2026-09-29(8): 이번 달 입금/출금/지출 집행률 3개를 카드 하나로 통합 — 아이콘+라벨 3묶음을
   한 줄에 나란히 놓고 그 아래 집행률 게이지 바를 공유해서 붙인다. */
.acct-combo-row {
  display: flex;
  gap: 1.2rem;
  margin-bottom: 0.65rem;
}
.acct-combo-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex: 1 1 0;
  min-width: 0;
  padding-left: 1.2rem;
  border-left: 1px solid #eceff3;
}
.acct-combo-item:first-child { padding-left: 0; border-left: none; }
.acct-combo-card .acct-budget-bar-track { margin-bottom: 0.55rem; }

/* 2026-09-29(9): 하단 전표 탭 표가 카드 전체 폭(12칸)으로 늘어나면서 "내용"~"금액" 사이가
   너무 멀어져 가로로 눈이 오래 움직여야 하는 문제 — 표 자체를 colgroup에서 지정한 만큼만
   좁게(약 690px) 두고 왼쪽 정렬, 남는 오른쪽은 그냥 비워둔다. */
.acct-ledger-table { width: auto; }

/* 이번달 지출예산 게이지 카드 */
.acct-budget-card {
  background: #fff;
  border-radius: 0.6rem;
  padding: 1.1rem 1.3rem;
  height: 100%;
  box-shadow: 0 1px 5px rgba(0,0,0,0.12);
}
.acct-budget-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.3rem 0.8rem;
  margin-bottom: 0.5rem;
}
.acct-budget-title { color: #6c7a89; font-size: 0.85rem; }
.acct-budget-base { font-size: 1.15rem; font-weight: 700; color: var(--brand-dark); }
.acct-budget-bar-track {
  height: 10px;
  border-radius: 999px;
  background: #eef1f5;
  overflow: hidden;
  margin-bottom: 0.55rem;
}
.acct-budget-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}
.acct-budget-bar-fill.is-good { background: #0ca30c; }
.acct-budget-bar-fill.is-warning { background: #fab219; }
.acct-budget-bar-fill.is-critical { background: #d03b3b; }
.acct-budget-foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  font-size: 0.85rem;
  color: #6c7a89;
}
.acct-budget-foot strong { color: var(--brand-dark); }
.acct-budget-pct { font-weight: 800; }
.acct-budget-pct.is-good { color: #0ca30c; }
.acct-budget-pct.is-warning { color: #c98500; }
.acct-budget-pct.is-critical { color: #d03b3b; }

/* 월별 수입·지출 추이 — 막대 두 개(입금/출금)를 나란히, 기존 .month-bar-chart와 같은 틀 */
.acct-trend-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.78rem;
  color: #6c7a89;
  margin-bottom: 0.6rem;
}
.acct-trend-legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  margin-right: 0.35rem;
}
.acct-trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  height: 170px;
  padding-top: 0.5rem;
}
.acct-trend-col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  min-width: 0;
}
.acct-trend-bars {
  flex: 1 1 auto;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  width: 100%;
  justify-content: center;
}
.acct-trend-bar {
  width: 38%;
  max-width: 14px;
  border-radius: 3px 3px 0 0;
  min-height: 2px;
}
.acct-trend-bar-income { background: #0ca30c; }
.acct-trend-bar-expense { background: #d03b3b; }
.acct-trend-col-label {
  font-size: 0.7rem;
  color: #8592a6;
  margin-top: 0.4rem;
}
.acct-trend-col.is-current .acct-trend-col-label { color: var(--brand-dark); font-weight: 700; }

/* 2026-09-29(12): 월별 추이/지출 비중/최근 등록 내역을 카드 하나로 통합 — 왼쪽(추이+지출
   비중)과 소제목들, 오른쪽(최근 등록, 전체 높이) 사이 구분선. */
.acct-subsection-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #3a4657;
  margin-bottom: 0.6rem;
}
.acct-subsection-divider {
  margin: 1.1rem 0;
  border: none;
  border-top: 1px solid #eceff3;
}
.acct-recent-col {
  border-left: 1px solid #eceff3;
  padding-left: 1.2rem;
}
@media (max-width: 991.98px) {
  .acct-recent-col { border-left: none; padding-left: 0.75rem; margin-top: 1rem; border-top: 1px solid #eceff3; padding-top: 1rem; }
}

/* 2026-09-29(5): 월별 추이 차트 아래 "최근 등록 내역" 5건 미니 리스트 */
.acct-recent-list {
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1px solid #eceff3;
}
.acct-recent-list-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #6c7a89;
  margin-bottom: 0.5rem;
}
.acct-recent-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px dashed #eceff3;
  font-size: 0.82rem;
}
.acct-recent-row:last-child { border-bottom: none; }
.acct-recent-date { color: #8592a6; white-space: nowrap; }
.acct-recent-desc { flex: 1 1 auto; min-width: 0; color: #3a4657; }
.acct-recent-amt { font-weight: 700; white-space: nowrap; }

/* 지출 비중 도넛 (conic-gradient, 라이브러리 없이) */
.acct-donut-wrap {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.acct-donut {
  position: relative;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.acct-donut-hole {
  position: absolute;
  inset: 20%;
  background: #fff;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.acct-donut-hole .acct-donut-total-label { font-size: 0.82rem; color: #8592a6; }
.acct-donut-hole .acct-donut-total-value { font-size: 1.35rem; font-weight: 800; color: var(--brand-dark); }
.acct-donut-legend {
  flex: 1 1 260px;
  min-width: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.88rem;
}
.acct-donut-legend li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #f0f2f5;
}
.acct-donut-legend li:last-child { border-bottom: none; }
.acct-donut-legend-dot {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  border-radius: 3px;
}
.acct-donut-legend-name { flex: 1 1 auto; color: #3a4657; min-width: 0; }
.acct-donut-legend-pct { flex: 0 0 auto; width: 42px; text-align: right; color: #8592a6; }
.acct-donut-legend-amt { flex: 0 0 auto; width: 100px; text-align: right; font-weight: 700; color: var(--brand-dark); white-space: nowrap; }
.acct-empty-note { color: #8592a6; font-size: 0.85rem; padding: 1rem 0; text-align: center; }

/* 2026-09-29(10): "빠른 등록" 폼의 구분(지출/수입)을 참고 이미지처럼 둥근 알약 탭으로 —
   연한 회색 트랙 안에 버튼 2개, 활성 탭만 진한 남색 배경. */
.acct-quick-tabs {
  display: flex;
  gap: 4px;
  background: #eef1f5;
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 0.9rem;
}
.acct-quick-tab {
  flex: 1 1 0;
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #5c6b7d;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.acct-quick-tab.active {
  background: var(--navy-deep);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* 2026-09-29(12): "일자" 필드를 "YYYY. MM. DD." 형식으로 고정 표시 — 실제 date input은
   투명하게 전체를 덮어 클릭/피커 기능만 담당하고, 보이는 텍스트는 별도 읽기전용 입력칸. */
.acct-date-field { position: relative; }
.acct-date-display {
  padding-right: 2.1rem;
  background: #fff;
  cursor: pointer;
}
.acct-date-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none;
  margin: 0;
  padding: 0;
}
.acct-date-icon {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: #8592a6;
  font-size: 0.85rem;
  pointer-events: none;
}

/* 2026-09-29(14): 탭과 필터(전체구분/전체방법/필터 버튼)를 같은 줄에 좌우로 배치 —
   밑줄은 탭 쪽 대신 줄 전체에 하나로. */
.acct-ledger-tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  border-bottom: 1px solid #d7dee6;
}
.acct-ledger-tabs-row .acct-ledger-tabs { border-bottom: none; }

/* 2026-09-29(15): 현금·카드 탭 박스(왼쪽)와 계좌 입금내역 박스(오른쪽)의 내용 길이가 달라도
   아래쪽 테두리가 서로 맞도록, 두 칸 모두 행의 스트레치 높이를 그대로 이어받아 내용 박스를
   채운다. */
.acct-ledger-col {
  display: flex;
  flex-direction: column;
}
.acct-ledger-col > .acct-ledger-tab-content {
  flex: 1 1 auto;
}
.acct-ledger-filter-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

/* 2026-09-29(2): 전표 목록(현금·카드·입금)을 나란히 3칸으로 두던 것을 엑셀 시트 탭으로
   전환 — .insurer-award-tabs/.insurer-award-tab-content와 동일한 방식. */
.acct-ledger-tabs {
  border-bottom: 1px solid #d7dee6;
  flex-wrap: wrap;
}
.acct-ledger-tabs .nav-link {
  border: 1px solid #d7dee6;
  border-bottom: none;
  border-radius: 0.6rem 0.6rem 0 0;
  background: #e4e9ef;
  color: #4a5568;
  padding: 0.55rem 1rem;
  font-weight: 600;
  margin-bottom: -1px;
  margin-right: 0.25rem;
}
.acct-ledger-tabs .nav-link.active {
  background: #fff;
  color: var(--navy-deep);
  border-color: #d7dee6 #d7dee6 #fff;
}
.acct-ledger-tab-content {
  background: #fff;
  border: 1px solid #d7dee6;
  border-top: none;
  border-radius: 0 0 0.6rem 0.6rem;
  padding: 1rem;
  box-shadow: 0 1px 5px rgba(0,0,0,0.12);
}
@media (max-width: 767.98px) {
  .acct-ledger-tabs .nav-link {
    padding: 0.5rem 0.7rem;
    font-size: 0.88rem;
  }
}

@media (max-width: 767.98px) {
  .acct-kpi-icon { width: 38px; height: 38px; font-size: 1rem; }
  .acct-kpi-body .stat-value { font-size: 1rem; }
  .acct-donut { width: 150px; height: 150px; }
}

/* ============================================================
   경리/회계 "종합" 탭 리디자인 (2026-09-29(16))
   ============================================================ */
.acct-summary-subtitle {
  font-weight: 600;
  color: #1c2b3a;
  margin-bottom: 0.85rem;
}

/* 월별 KPI 카드 — 카드마다 --kpi-accent로 아이콘·스파크라인 색을 지정 */
.acct-summary-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.acct-summary-kpi-card {
  background: #fff;
  border-radius: 0.6rem;
  box-shadow: 0 1px 5px rgba(0,0,0,0.12);
  padding: 0.95rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-top: 3px solid var(--kpi-accent, #2a78d6);
}
.acct-summary-kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  background: color-mix(in srgb, var(--kpi-accent, #2a78d6) 14%, #fff);
  color: var(--kpi-accent, #2a78d6);
}
.acct-summary-kpi-label {
  color: #6c7a89;
  font-size: 0.78rem;
  margin-top: 0.15rem;
}
.acct-summary-kpi-value {
  font-size: 1.12rem;
  font-weight: 700;
  color: #1c2b3a;
  white-space: nowrap;
}
.acct-summary-kpi-sub {
  color: #9aa5b1;
  font-size: 0.72rem;
}
.acct-summary-kpi-spark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 26px;
  margin-top: 0.15rem;
}
.acct-summary-kpi-spark-bar {
  flex: 1 1 0;
  min-width: 3px;
  max-width: 8px;
  border-radius: 2px 2px 0 0;
  background: var(--kpi-accent, #2a78d6);
  opacity: 0.75;
}
.acct-summary-kpi-spark-empty {
  color: #c2c9d1;
  font-size: 0.68rem;
  align-self: center;
}

/* 컨트롤 바 (검색/필터/표시월/정렬/페이지당개수) */
.acct-summary-card { padding: 1rem 1.1rem 0.4rem; }
.acct-summary-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid #e9edf1;
  margin-bottom: 0.4rem;
}
.acct-summary-select { width: auto; flex: 0 0 auto; }
.acct-summary-search {
  position: relative;
  flex: 1 1 200px;
  min-width: 160px;
  max-width: 280px;
}
.acct-summary-search i {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9aa5b1;
  font-size: 0.85rem;
}
.acct-summary-search input {
  width: 100%;
  padding: 0.32rem 0.6rem 0.32rem 1.9rem;
  border: 1px solid #d7dee6;
  border-radius: 0.4rem;
  font-size: 0.85rem;
}
.acct-summary-search input:focus {
  outline: none;
  border-color: var(--brand);
}
.acct-summary-month-toggles {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  font-size: 0.82rem;
  color: #4a5568;
  flex: 1 1 auto;
}
.acct-summary-toggles-label { color: #9aa5b1; font-size: 0.78rem; }
.acct-summary-month-check {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  white-space: nowrap;
}
.acct-summary-month-check input { cursor: pointer; }

/* 표 — 월 헤더 색 강조, 정렬 헤더, 추이 스파크라인, 상세보기 버튼 */
.acct-summary-table thead th {
  color: #6c7a89;
  font-weight: 600;
  font-size: 0.82rem;
  border-bottom-width: 1px;
  white-space: nowrap;
}
.acct-summary-table thead th.summary-month-col {
  border-top: 2px solid var(--col-accent, #2a78d6);
  color: var(--col-accent, #2a78d6);
}
.acct-summary-table tbody td,
.acct-summary-table tfoot td {
  font-size: 0.86rem;
  vertical-align: middle;
}
.acct-summary-sort-th {
  cursor: pointer;
  user-select: none;
  color: var(--brand-dark) !important;
}
.acct-summary-sort-th:hover { text-decoration: underline; }
.acct-summary-no-col, .acct-summary-no-cell { width: 46px; }
.acct-summary-trend-col { width: 130px; }
.acct-summary-detail-col { width: 84px; }
.acct-summary-row-spark {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 22px;
}
.acct-summary-row-spark span {
  flex: 1 1 0;
  min-width: 3px;
  border-radius: 1px 1px 0 0;
}
.acct-summary-detail-btn {
  border-radius: 0.4rem;
  padding: 0.18rem 0.5rem;
}

/* 페이지네이션 */
.acct-summary-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.85rem 0;
}
.acct-summary-page-btn {
  border: 1px solid #d7dee6;
  background: #fff;
  color: #4a5568;
  border-radius: 0.35rem;
  min-width: 30px;
  height: 30px;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.acct-summary-page-btn.active {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}
.acct-summary-page-btn:disabled { opacity: 0.4; }

/* 상세보기 모달 내부 바 차트(월별/분류별 공용) */
.acct-summary-detail-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: #4a5568;
  margin-bottom: 0.5rem;
}
.acct-summary-detail-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
}
.acct-summary-detail-label {
  flex: 0 0 52px;
  color: #6c7a89;
}
.acct-summary-detail-track {
  flex: 1 1 auto;
  height: 8px;
  background: #eef1f5;
  border-radius: 4px;
  overflow: hidden;
}
.acct-summary-detail-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 4px;
}
.acct-summary-detail-fill.is-cat { background: #eb6834; }
.acct-summary-detail-value {
  flex: 0 0 auto;
  min-width: 78px;
  text-align: right;
  font-weight: 600;
  color: #1c2b3a;
}

@media (max-width: 767.98px) {
  .acct-summary-kpi-row { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .acct-summary-controls { flex-direction: column; align-items: stretch; }
  .acct-summary-search { max-width: none; }
  .acct-summary-select { width: 100%; }
}

/* ============================================================
   경리/회계 "월별" 화면 재개편 (2026-09-29(17)) — 참고 이미지 스타일
   ============================================================ */

/* 상단 내비게이션 바 (이전/다음 달 화살표 + 오늘/이번달/전체/종합 프리셋 + 개별 월 탭 +
   달력/엑셀다운로드/인쇄 아이콘) — _tabs.ejs에서 사용, list.ejs·summary.ejs 공통. */
.acct-nav-bar {
  background: #fff;
  border-radius: 0.6rem;
  box-shadow: 0 1px 5px rgba(0,0,0,0.12);
  padding: 0.7rem 1rem;
}
.acct-nav-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem;
}
.acct-nav-month-switch {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
}
.acct-nav-arrow {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4a5568;
  background: #f1f4f8;
  text-decoration: none;
}
.acct-nav-arrow:hover { background: #e4e9f0; color: #1c2b3a; }
.acct-nav-arrow.is-disabled { opacity: 0.35; pointer-events: none; }
.acct-nav-month-label {
  font-weight: 700;
  font-size: 1.02rem;
  color: #1c2b3a;
  white-space: nowrap;
  min-width: 108px;
  text-align: center;
}
.acct-nav-presets {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
}
.acct-nav-pill {
  padding: 0.3rem 0.75rem;
  border-radius: 0.4rem;
  font-size: 0.82rem;
  color: #4a5568;
  text-decoration: none;
  background: transparent;
  white-space: nowrap;
}
.acct-nav-pill:hover { background: #f1f4f8; color: #1c2b3a; }
.acct-nav-pill.active {
  background: var(--brand-dark);
  color: #fff;
  font-weight: 600;
}
.acct-nav-months {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1 1 auto;
  overflow-x: auto;
}
.acct-nav-month-tab {
  color: #7a869a;
  font-size: 0.9rem;
  text-decoration: none;
  padding-bottom: 0.15rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.acct-nav-month-tab:hover { color: var(--brand); }
.acct-nav-month-tab.active {
  color: var(--brand);
  font-weight: 700;
  border-bottom-color: var(--brand);
}
.acct-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
  margin-left: auto;
}
.acct-nav-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 0.4rem;
  border: 1px solid #d7dee6;
  background: #fff;
  color: #4a5568;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.acct-nav-icon-btn:hover { background: #f1f4f8; }
.acct-nav-excel-btn {
  border: 1px solid #d7dee6;
  background: #fff;
  color: #1e7e34;
  font-size: 0.82rem;
  padding: 0.32rem 0.7rem;
  border-radius: 0.4rem;
  white-space: nowrap;
}
.acct-nav-excel-btn:hover { background: #f1f8f3; }
.acct-nav-range-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid #eef1f5;
}
@media (max-width: 767.98px) {
  .acct-nav-months { order: 3; width: 100%; }
  .acct-nav-actions { margin-left: 0; }
}

/* KPI 카드 2세대 — 아이콘+값+전월대비 배지 위, 미니 스파크라인/상세 줄 아래 */
.acct-kpi2-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.acct-kpi2-top {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.acct-kpi2-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: #fff;
}
.acct-kpi2-icon-green { background: #0ca30c; }
.acct-kpi2-icon-red { background: #d03b3b; }
.acct-kpi2-icon-blue { background: var(--brand); }
.acct-kpi2-icon-gold { background: #eda100; }
.acct-kpi2-body { min-width: 0; }
.acct-kpi2-body .stat-label { white-space: normal; line-height: 1.25; }
.acct-kpi2-body .stat-value { font-size: 1.2rem; }
.acct-kpi2-delta {
  font-size: 0.74rem;
  color: #9aa5b1;
  margin-top: 0.15rem;
}
.acct-kpi2-delta.is-up, .acct-kpi2-delta.is-down-good { color: #0ca30c; }
.acct-kpi2-delta.is-down, .acct-kpi2-delta.is-up-bad { color: #d03b3b; }
.acct-kpi2-spark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 30px;
}
.acct-kpi2-spark-bar {
  flex: 1 1 0;
  min-width: 4px;
  border-radius: 2px 2px 0 0;
  opacity: 0.8;
}
.acct-kpi2-spark-bar.is-green { background: #0ca30c; }
.acct-kpi2-spark-bar.is-red { background: #d03b3b; }
.acct-kpi2-spark-bar.is-gold { background: #eda100; }
.acct-kpi2-detail {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: #6c7a89;
}
.acct-kpi2-detail > div { display: flex; justify-content: space-between; gap: 0.5rem; }
.acct-kpi2-detail strong { color: #1c2b3a; font-weight: 700; }
.acct-kpi2-detail strong.acct-budget-pct.is-good { color: #0ca30c; }
.acct-kpi2-detail strong.acct-budget-pct.is-warning { color: #c98500; }
.acct-kpi2-detail strong.acct-budget-pct.is-critical { color: #d03b3b; }

/* 전표 표 카드 — 탭 3개 + 필터(전체구분/전체계정과목/검색/상세검색) + 체크박스·등록자·관리
   컬럼을 갖춘 전체 폭 표 */
.acct-ledger-card { padding: 0; }
.acct-ledger-tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 0.5rem 1rem;
  border-bottom: 1px solid #d7dee6;
  padding: 0.6rem 1rem 0;
}
.acct-ledger-tabs-row .acct-ledger-tabs { border-bottom: none; flex: 0 0 auto; }
/* 2026-09-29(19): 필터 폼 전체를 tabs-row의 남은 폭만큼 늘려서(flex:1) 그 안의
   모든 필터(전체구분/전체계정과목/검색창/상세검색 버튼)를 justify-content:flex-end로
   한 덩어리째 맨 오른쪽 끝으로 정렬 — 탭만 왼쪽, 나머지는 전부 오른쪽. 한 줄 유지를
   위해 줄바꿈은 좁은 화면에서만 허용(아래 미디어쿼리). */
.acct-ledger-filter-form {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: nowrap;
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 0.5rem;
}
.acct-ledger-search-box {
  position: relative;
  flex: 0 1 220px;
}
@media (max-width: 991.98px) {
  .acct-ledger-tabs-row { flex-wrap: wrap; }
  .acct-ledger-filter-form { flex-wrap: wrap; justify-content: flex-start; }
}
.acct-ledger-search-box i {
  position: absolute;
  left: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9aa5b1;
  font-size: 0.82rem;
}
.acct-ledger-search-box input {
  width: 100%;
  padding: 0.3rem 0.6rem 0.3rem 1.8rem;
  border: 1px solid #d7dee6;
  border-radius: 1.2rem;
  font-size: 0.82rem;
}
.acct-ledger-search-box input:focus { outline: none; border-color: var(--brand); }
.acct-ledger-detail-search-btn {
  background: var(--brand-dark);
  color: #fff;
  border-radius: 1.2rem;
  font-size: 0.82rem;
  padding: 0.32rem 0.85rem;
  white-space: nowrap;
}
.acct-ledger-detail-search-btn:hover { background: var(--brand); color: #fff; }
.acct-full-ledger-table { font-size: 0.85rem; }
.acct-full-ledger-table thead th {
  color: #6c7a89;
  font-weight: 600;
  font-size: 0.78rem;
  white-space: nowrap;
}
.acct-full-ledger-table tbody td { vertical-align: middle; }

/* 2026-09-29: 상품별 계산기 재개편 — 필터 한 줄(직책=테이블/기준년월/보험사/검색/초기화),
   결과 개수·표시개수·표시항목 설정 줄, 표(NO·보험사 아바타·강조된 익월합계 정렬)·페이지네이션. */
.cc-filter-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  margin-bottom: 0.9rem;
}
.cc-filter-search { flex: 1 1 auto; min-width: 160px; }
.cc-reset-btn {
  background: #eef1f5;
  color: #4a5568;
  border: none;
  border-radius: 0.9rem;
  padding: 0.55rem 1rem;
  font-weight: 600;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.cc-reset-btn:hover { background: #e1e6ec; color: #4a5568; }
@media (max-width: 991.98px) {
  .cc-filter-form { flex-wrap: wrap; }
}

/* 2026-09-30: 폰 화면(<768px) 전용 — 테이블(직책)/기준년월/보험사 select 3개를 한 줄로,
   검색창+검색+초기화를 다른 한 줄로 접는다. 그 이상 화면에서는 display:contents로 이 두
   줄이 레이아웃에 아무 영향을 주지 않아서(.cc-filter-form의 원래 한 줄 flex 그대로 유지)
   위 .cc-filter-form 스타일이 그대로 적용된다.
   2026-09-30(2): 처음엔 이 줄 자체를 가로 스와이프되게 했었는데, 실사용 보험사 이름
   길이에 따라 세 번째(보험사) select가 화면 밖으로 잘려 보이는 문제가 있었다(테스트했던
   이름들보다 실제 목록에 긴 이름이 있으면 얼마나 잘리는지 예측이 안 됨). select 폭을
   고정값으로 못박고 넘치는 글자는 말줄임(…)으로 자르는 방식으로 바꿔서, 보험사 이름 길이와
   무관하게 3개가 항상 한 줄에 전부 보이게 한다(원하는 값은 눌러서 펼치면 그대로 다 보임 —
   잘리는 건 접힌 상태의 표시 글자일 뿐). */
.cc-filter-select-row,
.cc-filter-search-row {
  display: contents;
}
@media (max-width: 767.98px) {
  .cc-filter-form { flex-direction: column; align-items: stretch; flex-wrap: wrap; gap: 0.5rem; }
  .cc-filter-select-row {
    display: flex;
    gap: 0.35rem;
    flex-wrap: nowrap;
    width: 100%;
    min-width: 0;
  }
  .cc-filter-select-row > * { flex: 0 1 auto; min-width: 0; }
  .cc-filter-select-row .lookup-select-pill,
  .cc-filter-select-row .lookup-date-pill {
    padding: 0.35rem 0.55rem;
    gap: 0.3rem;
  }
  .cc-filter-select-row .lookup-select-pill select {
    width: 4.4rem;
    flex: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 0;
  }
  .cc-filter-select-row .cc-month-display {
    width: 4rem;
  }
  .cc-filter-search-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    min-width: 0;
  }
  .cc-filter-search-row .cc-filter-search {
    flex: 1 1 auto;
    min-width: 0;
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }
  .cc-filter-search-row .lookup-search-input { min-width: 0; }
  .cc-filter-search-row .lookup-search-submit,
  .cc-filter-search-row .cc-reset-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 0.5rem 0.6rem;
    font-size: 0.8rem;
    gap: 0.25rem;
  }
}

/* 기준년월 — 브라우저 로케일 문구 대신 항상 숫자만("2026. 09.") 보이게, 실제
   <input type="month">는 투명하게 뒤에 깔아 클릭하면 네이티브 달력피커가 뜬다
   (경리/회계 화면의 .acct-date-field와 같은 방식). */
.cc-month-field { position: relative; }
.cc-month-display {
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.88rem;
  color: #33404d;
  width: 4.6rem;
  padding: 0;
  cursor: pointer;
}
.cc-month-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none;
  margin: 0;
  padding: 0;
}

.cc-result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.cc-result-count {
  font-size: 0.92rem;
  color: #33404d;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.cc-result-count i { color: var(--brand); }
.cc-result-count strong { color: var(--brand-dark); font-size: 1.05rem; }
.cc-result-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cc-col-settings-wrap { position: relative; }
.cc-col-settings-btn {
  background: #fff;
  color: #33404d;
  border: 1px solid #d7dee6;
  border-radius: 0.9rem;
  padding: 0.35rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}
.cc-col-settings-btn:hover { background: #f4f6f8; }
.cc-col-settings-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  background: #fff;
  border: 1px solid #d7dee6;
  border-radius: 0.6rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 0.6rem 0.9rem;
  z-index: 20;
  min-width: 140px;
}
.cc-col-settings-panel.show { display: block; }
.cc-col-settings-panel label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #33404d;
  padding: 0.25rem 0;
  white-space: nowrap;
  cursor: pointer;
}

.cc-table-card { padding: 0; overflow: hidden; }
.cc-full-table { font-size: 0.85rem; }
.cc-full-table thead th {
  background: #f4f6f8;
  color: #6c7a89;
  font-weight: 600;
  font-size: 0.78rem;
  white-space: nowrap;
  border-bottom: 1px solid #d7dee6;
  padding: 0.7rem 0.75rem;
}
.cc-full-table tbody td {
  vertical-align: middle;
  padding: 0.65rem 0.75rem;
}
.cc-full-table tbody tr:hover { background: #f9fafb; }
.cc-product-name { max-width: 360px; }
.cc-col-highlight { background: #eaf1fb; }
.cc-full-table thead th.cc-col-highlight {
  background: #dbe7f8;
  color: var(--brand-dark);
}
.cc-full-table thead th.cc-col-highlight i { font-size: 0.7rem; margin-left: 0.2rem; }
.cc-full-table.cc-hide-next .col-next-mo,
.cc-full-table.cc-hide-total .col-total-mo,
.cc-full-table.cc-hide-bonus .col-bonus-mo {
  display: none;
}
.cc-insurer-cell { display: flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
.cc-insurer-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}
.cc-detail-btn {
  background: #f4f6f8;
  color: #6c7a89;
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}
.cc-detail-btn:hover:not(:disabled) { background: var(--brand-dark); color: #fff; }
.cc-detail-btn:disabled { cursor: not-allowed; opacity: 0.6; }

.cc-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.9rem;
}
.cc-pagination { display: flex; align-items: center; gap: 0.25rem; }
.cc-page-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 0.4rem;
  border: 1px solid #d7dee6;
  background: #fff;
  color: #4a5568;
  border-radius: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
}
.cc-page-btn:hover:not(:disabled) { background: #f4f6f8; }
.cc-page-btn.active {
  background: var(--brand-dark);
  color: #fff;
  border-color: var(--brand-dark);
}
.cc-page-btn:disabled { color: #c3cbd4; }
.cc-page-ellipsis { color: #9aa5b1; padding: 0 0.25rem; }

/* 사이드바 메뉴의 "대외비" 표시용 작은 자물쇠 아이콘(2026-10-02(3) 추가) — 보증 및 지원금,
   개인채무 관리처럼 딱 정해진 몇 명만 보는 메뉴 앞에 붙여서, 메뉴 목록만 봐도 민감한
   항목이라는 걸 바로 알 수 있게 한다. 메뉴 아이콘보다 작고 은은한 톤(금색 계열)으로 둬서
   너무 튀지 않게 한다. */
.nav-confidential-mark { font-size: 0.7rem; color: #e0b64a; vertical-align: 1px; margin-right: 0.1rem; }

/* "연락할 고객"(2026-10-20 추가 — 시범, 시스템관리자만) — 사이드바 배지, 대시보드 카드,
   고객관리 목록/상세의 연락 예정 표시, 통화 확인 모달에 쓰는 스타일을 모두 여기 모아둔다.
   /home/claude/follow-up-mockup.html 시안에서 그대로 옮겨왔다. 전 직원에게 열 때 CSS는
   그대로 두고 server.js/routes/views의 role==='admin' 조건만 고치면 된다. */
.nav-badge-count {
  margin-left: auto;
  background: #e5484d;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.08rem 0.45rem;
  min-width: 1.2rem;
  text-align: center;
  line-height: 1.4;
}
.followup-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid #eef1f5;
}
.followup-card-header h2 {
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #1c2b3a;
}
.followup-card-header h2 i { color: var(--brand); }
.followup-count-pill {
  background: #eef4ff;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}
.followup-list { list-style: none; margin: 0; padding: 0; }
.followup-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 1.1rem 0.75rem 0.85rem;
  border-bottom: 1px solid #f1f3f7;
  flex-wrap: wrap;
  position: relative;
}
.followup-item:last-child { border-bottom: none; }
/* 2026-10-22: 날짜 상태(지남/오늘/자동차)가 한눈에 보이게 항목 왼쪽에 색 띠를 둔다
   (모바일 가독성 개선 — views/dashboard.ejs가 li에 dateClass를 그대로 붙여준다). */
.followup-item.is-overdue::before,
.followup-item.is-today::before,
.followup-item.is-upcoming::before,
.followup-item.is-auto::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 4px;
  border-radius: 3px;
}
.followup-item.is-overdue::before { background: #d4302f; }
.followup-item.is-today::before { background: #c9860a; }
.followup-item.is-upcoming::before { background: var(--brand); opacity: 0.5; }
.followup-item.is-auto::before { background: #7c3fc9; }
.followup-check {
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  border: 2px solid #cdd5e0;
  flex: 0 0 auto;
}
.followup-check.is-disabled { border-color: #e3e8ef; background: #f6f8fb; }
.followup-main { flex: 1; min-width: 160px; }
.followup-name-row { display: flex; align-items: center; gap: 0.4rem; }
.followup-name { font-weight: 700; font-size: 0.92rem; color: #1c2b3a; }
.call-btn {
  width: 1.55rem; height: 1.55rem; border-radius: 50%;
  border: none; background: #e9f7ec; color: #1f9254;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.78rem; cursor: pointer; flex: 0 0 auto;
}
.call-btn:hover { background: #d7f0dd; }
.followup-memo { font-size: 0.8rem; color: #697892; margin-top: 0.1rem; }
.auto-tag {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.7rem; font-weight: 700; color: #6b3fa0; background: #f3eaff;
  border-radius: 999px; padding: 0.1rem 0.5rem; margin-top: 0.25rem;
}
/* 2026-10-22: 모바일에서 날짜가 잘 안 보인다는 피드백으로, 메모와 같은 줄의 작은 알약
   배지 대신 자기 줄로 내려서 더 크고 굵게(아이콘 포함) 보여준다 — followup-date-row가
   그 줄을 감싸고, followup-date-sub가 보조 날짜(M/D)를 작게 옆에 붙여준다. 고객 수정
   화면(clients/form.ejs)은 아직 예전처럼 알약 모양 하나만 쓰지만, 커진 폰트/패딩이어도
   줄바꿈만 될 뿐 깨지진 않는다. */
.followup-date-row { display: flex; align-items: baseline; gap: 0.4rem; margin-top: 0.45rem; flex-wrap: wrap; }
.followup-date {
  font-size: 0.86rem;
  font-weight: 800;
  padding: 0.22rem 0.65rem;
  border-radius: 0.4rem;
  white-space: nowrap;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.followup-date i { font-size: 0.8rem; }
.followup-date-sub { font-size: 0.72rem; color: #8592a6; font-weight: 600; }
.followup-date.is-overdue { background: #fdecec; color: #c0282d; }
.followup-date.is-today { background: #fff6ea; color: #a15c00; }
.followup-date.is-upcoming { background: #eef4ff; color: var(--brand); }
.followup-date.is-auto { background: #f3eaff; color: #6b3fa0; }
.followup-actions { display: flex; gap: 0.35rem; flex: 0 0 auto; }
.btn-mini {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.28rem 0.55rem;
  border-radius: 0.4rem;
  border: 1px solid #d7dee6;
  background: #fff;
  color: #51607a;
  white-space: nowrap;
  cursor: pointer;
}
.btn-mini-primary { background: var(--brand); border-color: var(--brand); color: #fff; }

.client-followup-chip {
  font-size: 0.74rem; font-weight: 700; padding: 0.22rem 0.6rem; border-radius: 999px;
  display: inline-block; white-space: nowrap;
}
.client-followup-chip.none { background: #f1f3f7; color: #8592a6; }
.client-followup-chip.set { background: #eef4ff; color: var(--brand); }
.client-followup-chip.overdue { background: #fdecec; color: #c0282d; }

.followup-form-card { padding: 1.1rem 1.2rem; }
.followup-form-card h3 { font-size: 0.92rem; font-weight: 800; margin: 0 0 0.8rem; }
.form-row { display: flex; gap: 0.7rem; margin-bottom: 0.7rem; flex-wrap: wrap; }
.form-field { flex: 1; min-width: 160px; }
.form-field label { display: block; font-size: 0.76rem; color: #697892; margin-bottom: 0.25rem; font-weight: 600; }
.form-field input, .form-field select {
  width: 100%; border: 1px solid #d7dee6; border-radius: 0.4rem; padding: 0.45rem 0.6rem; font-size: 0.86rem;
  background: #fbfcfe;
}
.form-actions { text-align: right; }
.btn-submit-mock {
  background: var(--brand); color: #fff; border: none; border-radius: 0.4rem;
  padding: 0.5rem 1.1rem; font-size: 0.85rem; font-weight: 700; cursor: pointer;
}

.call-modal-backdrop {
  position: fixed; inset: 0; background: rgba(10,20,35,0.45);
  display: none; align-items: center; justify-content: center; z-index: 1050; padding: 1rem;
}
.call-modal-backdrop.open { display: flex; }
.call-modal {
  background: #fff; border-radius: 0.9rem; padding: 1.6rem 1.5rem 1.3rem;
  width: 100%; max-width: 300px; text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.call-modal-icon {
  width: 3rem; height: 3rem; border-radius: 50%; background: #e9f7ec; color: #1f9254;
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem; margin: 0 auto 0.9rem;
}
.call-modal-title { font-weight: 800; font-size: 1rem; margin-bottom: 0.35rem; }
.call-modal-target { font-size: 0.85rem; color: #51607a; margin-bottom: 1.2rem; }
.call-modal-actions { display: flex; gap: 0.6rem; }
.call-modal-actions .btn-mini { flex: 1; padding: 0.55rem; font-size: 0.85rem; }

/* 자료보관함 클라우드 스타일 그리드/폴더(2026-10-22(4) 추가) — 구글드라이브/원드라이브처럼
   아이콘이 자동으로 줄 맞춰 정렬되는 방식(저장 위치를 기억하는 자유 배치가 아님). */
.file-breadcrumb { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; margin-bottom: 0.9rem; font-size: 0.92rem; }
.file-breadcrumb a { color: var(--brand); text-decoration: none; padding: 0.15rem 0.45rem; border-radius: 0.4rem; transition: background 0.15s; }
.file-breadcrumb a:hover { background: rgba(0,0,0,0.05); }
.file-breadcrumb a.drag-over { background: var(--brand); color: #fff; }
.file-breadcrumb .breadcrumb-sep { color: #9aa5b1; }
.file-breadcrumb .breadcrumb-current { color: #51607a; font-weight: 700; padding: 0.15rem 0.2rem; }

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.7rem;
  padding: 0.2rem 0 1rem;
}
@media (min-width: 768px) {
  .file-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.85rem; }
}

.folder-tile, .file-tile {
  position: relative;
  background: #fff;
  border: 1px solid #e7e9ec;
  border-radius: 0.65rem;
  padding: 0.65rem 0.4rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: box-shadow 0.15s, border-color 0.15s, background 0.15s;
}
.folder-tile:hover, .file-tile:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.08); border-color: #d7dbe0; }
.folder-tile.drag-over {
  border-color: var(--brand);
  background: rgba(13,110,253,0.07);
  box-shadow: 0 0 0 2px var(--brand) inset;
}

.folder-tile-link { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: inherit; width: 100%; }
.folder-tile-icon { font-size: 2.15rem; color: #e8b64a; margin-bottom: 0.3rem; }
.folder-tile-name, .file-tile-name {
  font-size: 0.78rem; color: #333; width: 100%; margin-top: 0.05rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.folder-tile-delete-form { position: absolute; top: 0.15rem; right: 0.15rem; }
.folder-tile-delete-btn {
  border: none; background: rgba(0,0,0,0.06); color: #888; border-radius: 50%;
  width: 1.4rem; height: 1.4rem; line-height: 1; font-size: 0.8rem; opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}
.folder-tile:hover .folder-tile-delete-btn { opacity: 1; }
.folder-tile-delete-btn:hover { background: #fdecec; color: #c0282d; }

.file-tile-body { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: inherit; width: 100%; cursor: grab; }
.file-tile-icon-wrap { width: 100%; height: 46px; display: flex; align-items: center; justify-content: center; margin-bottom: 0.3rem; }
.file-tile-icon { font-size: 1.95rem; }
.file-tile-thumb { max-width: 100%; max-height: 46px; border-radius: 0.3rem; object-fit: cover; }
.file-tile-meta { font-size: 0.68rem; color: #9aa5b1; margin-top: 0.1rem; }

.file-tile-menu-btn {
  position: absolute; top: 0.1rem; right: 0.1rem; border: none; background: transparent;
  color: #aab2bd; width: 1.5rem; height: 1.5rem; border-radius: 50%; line-height: 1;
}
.file-tile-menu-btn:hover { background: rgba(0,0,0,0.06); color: #555; }

/* 2026-10-23 추가 — 열기(file-tile-body)와 분리된, 항상 보이는 다운로드 버튼. */
.file-tile-download-btn {
  position: absolute; top: 0.1rem; left: 0.1rem; border: none; background: transparent;
  color: #aab2bd; width: 1.5rem; height: 1.5rem; border-radius: 50%; line-height: 1;
  display: flex; align-items: center; justify-content: center; font-size: 0.8rem;
  text-decoration: none; z-index: 5;
}
.file-tile-download-btn:hover { background: rgba(0,0,0,0.06); color: var(--brand); }

.file-tile-menu {
  display: none; position: absolute; top: 1.85rem; right: 0.2rem; z-index: 20;
  background: #fff; border: 1px solid #e1e4e8; border-radius: 0.55rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.14); padding: 0.4rem; min-width: 160px;
  text-align: left;
}
.file-tile-menu.open { display: block; }
.file-tile-menu a, .file-tile-menu button {
  display: flex; align-items: center; gap: 0.4rem; width: 100%; text-align: left;
  padding: 0.35rem 0.5rem; border-radius: 0.35rem; border: none; background: none;
  font-size: 0.82rem; color: #333; text-decoration: none;
}
.file-tile-menu a:hover, .file-tile-menu button:hover { background: #f1f3f5; }
.file-tile-menu select {
  width: 100%; font-size: 0.8rem; padding: 0.3rem; border-radius: 0.35rem;
  border: 1px solid #dadfe3; margin: 0.15rem 0; color: #333;
}
.file-tile-delete-btn { color: #d4302f !important; }

/* ===== 자료보관함 대시보드 스타일 개편(2026-10-23(5) 추가) =====
   위 .file-tile-* 계열은 이제 파일 목록에는 안 쓰이지만(파일은 표로 바뀜) 혹시 모를 참조를
   위해 그대로 둔다. 아래는 전부 새 디자인 전용 "mf-" 접두사 클래스. */

.mf-topbar { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.mf-topbar-icon {
  width: 42px; height: 42px; border-radius: 0.6rem; background: #eef1f6; color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0;
}
.mf-topbar-title { margin-right: 0.5rem; }
.mf-topbar-title h1 { font-size: 1.2rem; margin: 0; }
.mf-topbar-sub { font-size: 0.78rem; color: #8592a6; margin-top: 0.1rem; }
.mf-search {
  flex: 1; min-width: 220px; display: flex; align-items: center; gap: 0.5rem; background: #fff;
  border: 1px solid #e3e6eb; border-radius: 0.6rem; padding: 0.5rem 0.9rem; color: #9aa5b1;
}
.mf-search i { flex-shrink: 0; }
.mf-search input {
  border: none; outline: none; flex: 1; font-size: 0.85rem; color: #333; background: transparent;
}
.mf-icon-btn {
  width: 42px; height: 42px; border-radius: 0.6rem; background: #fff; border: 1px solid #e3e6eb;
  display: flex; align-items: center; justify-content: center; font-size: 1rem; color: #667;
  flex-shrink: 0; text-decoration: none;
}
.mf-icon-btn:hover { background: #f5f6f8; color: #d4302f; }
.mf-btn-upload {
  background: var(--brand); color: #fff; border: none; border-radius: 0.6rem; padding: 0.6rem 1.1rem;
  font-size: 0.86rem; font-weight: 700; display: flex; align-items: center; gap: 0.4rem; white-space: nowrap;
}

.mf-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; margin-bottom: 1.2rem; }
@media (max-width: 900px) { .mf-stat-grid { grid-template-columns: repeat(2, 1fr); } }
.mf-stat-card {
  background: #fff; border-radius: 0.75rem; padding: 0.9rem 1rem; display: flex; align-items: center;
  gap: 0.75rem; box-shadow: 0 1px 3px rgba(20,30,50,0.05);
}
.mf-stat-box { width: 42px; height: 42px; border-radius: 0.55rem; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; flex-shrink: 0; }
.mf-stat-box.blue { background: #e7edfd; color: var(--brand); }
.mf-stat-box.pink { background: #fde8ec; color: #c0286e; }
.mf-stat-box.green { background: #e3f6ea; color: #1f9254; }
.mf-stat-box.orange { background: #fdeeda; color: #c9860a; }
.mf-stat-info { flex: 1; min-width: 0; }
.mf-stat-label { font-size: 0.76rem; color: #8592a6; margin-bottom: 0.1rem; }
.mf-stat-value { font-size: 1.1rem; font-weight: 800; }
.mf-stat-value-sub { font-size: 0.68rem; color: #9aa5b1; font-weight: 500; }
.mf-mini-bar { height: 4px; border-radius: 3px; background: #e9edf3; margin-top: 0.35rem; overflow: hidden; }
.mf-mini-bar span { display: block; height: 100%; border-radius: 3px; }

.mf-search-banner {
  display: flex; align-items: center; justify-content: space-between; background: #fff;
  border: 1px solid #e3e6eb; border-radius: 0.6rem; padding: 0.6rem 0.9rem; margin-bottom: 0.9rem;
  font-size: 0.85rem;
}
.mf-search-banner a { color: var(--brand); font-weight: 600; text-decoration: none; white-space: nowrap; }

.mf-bottom-grid { display: grid; grid-template-columns: 2.1fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 992px) { .mf-bottom-grid { grid-template-columns: 1fr; } }

.mf-panel { background: #fff; border-radius: 0.75rem; padding: 1rem 1.1rem; box-shadow: 0 1px 3px rgba(20,30,50,0.05); margin-bottom: 1rem; }
.mf-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.85rem; flex-wrap: wrap; gap: 0.5rem; }
.mf-panel-left { display: flex; align-items: center; gap: 0.45rem; font-weight: 700; font-size: 0.95rem; }
.mf-panel-right { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.mf-toggle-group { display: flex; border: 1px solid #e3e6eb; border-radius: 0.5rem; overflow: hidden; }
.mf-toggle-group button { border: none; background: #fff; padding: 0.38rem 0.65rem; font-size: 0.76rem; color: #667; display: flex; align-items: center; gap: 0.3rem; }
.mf-toggle-group button.active { background: var(--brand); color: #fff; }
.mf-sort-select { border: 1px solid #e3e6eb; border-radius: 0.5rem; padding: 0.38rem 0.55rem; font-size: 0.76rem; color: #555; background: #fff; }

.mf-folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.75rem; }
.mf-folder-grid.mf-list-mode { grid-template-columns: 1fr; }
.mf-folder-tile {
  position: relative; border: 1px solid #ecedf1; border-radius: 0.65rem; padding: 0.8rem 0.85rem;
  transition: box-shadow 0.15s, border-color 0.15s, background 0.15s;
}
.mf-folder-tile:hover { box-shadow: 0 2px 10px rgba(20,30,50,0.07); border-color: #d7dbe0; }
.mf-folder-tile.drag-over { border-color: var(--brand); background: rgba(31,78,140,0.06); box-shadow: 0 0 0 2px var(--brand) inset; }
.mf-folder-tile-link { display: flex; flex-direction: column; gap: 0.55rem; text-decoration: none; color: inherit; }
.mf-list-mode .mf-folder-tile-link { flex-direction: row; align-items: center; gap: 0.7rem; }
.mf-folder-tile-iconbox {
  width: 38px; height: 38px; border-radius: 0.5rem; background: #fdf1d8; color: #e0a526;
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0;
}
.mf-folder-tile-info { min-width: 0; }
.mf-folder-tile-name { font-size: 0.85rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mf-folder-tile-meta { font-size: 0.7rem; color: #9aa5b1; margin-top: 0.1rem; }

.mf-dot-menu-btn { border: none; background: transparent; color: #aab2bd; width: 1.6rem; height: 1.6rem; border-radius: 50%; position: absolute; top: 0.3rem; right: 0.3rem; }
.mf-recent-table .mf-dot-menu-btn { position: static; }
.mf-dot-menu-btn:hover { background: rgba(0,0,0,0.06); color: #555; }
.mf-dot-menu {
  display: none; position: absolute; top: 2rem; right: 0.3rem; z-index: 20; background: #fff;
  border: 1px solid #e1e4e8; border-radius: 0.5rem; box-shadow: 0 4px 16px rgba(0,0,0,0.14);
  padding: 0.4rem; min-width: 170px; text-align: left;
}
.mf-recent-table td:last-child { position: relative; }
.mf-recent-table .mf-dot-menu { top: auto; right: 0.3rem; margin-top: 0.2rem; }
.mf-dot-menu.open { display: block; }
.mf-dot-menu a, .mf-dot-menu button {
  display: flex; align-items: center; gap: 0.4rem; width: 100%; text-align: left; padding: 0.35rem 0.5rem;
  border-radius: 0.35rem; border: none; background: none; font-size: 0.82rem; color: #333; text-decoration: none;
}
.mf-dot-menu a:hover, .mf-dot-menu button:hover { background: #f1f3f5; }
.mf-dot-menu select { width: 100%; font-size: 0.8rem; padding: 0.3rem; border-radius: 0.35rem; border: 1px solid #dadfe3; margin: 0.15rem 0; color: #333; }
.mf-dot-menu-danger { color: #d4302f !important; }

.mf-recent-table { font-size: 0.84rem; }
.mf-recent-table th { font-size: 0.72rem; color: #9aa5b1; font-weight: 600; border-top: none; }
.mf-recent-table td { vertical-align: middle; }
.mf-recent-table tr[draggable="true"] { cursor: grab; }
.mf-fname { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; color: #222; text-decoration: none; }
.mf-fico { width: 22px; height: 22px; border-radius: 0.3rem; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; color: #fff; flex-shrink: 0; }
.mf-fico-thumb { width: 22px; height: 22px; border-radius: 0.3rem; object-fit: cover; flex-shrink: 0; }

.mf-shortcut-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; }
.mf-shortcut-tile {
  border: none; border-radius: 0.65rem; padding: 0.85rem 0.5rem; text-align: center; text-decoration: none;
  display: block; cursor: pointer;
}
.mf-shortcut-tile.disabled { cursor: default; opacity: 0.65; }
.mf-shortcut-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; margin: 0 auto 0.4rem; color: #fff; }
.mf-shortcut-label { font-size: 0.8rem; font-weight: 700; color: #222; }
.mf-shortcut-sub { font-size: 0.66rem; color: #8592a6; margin-top: 0.1rem; }
.mf-shortcut-tile.upload { background: #eaf0fd; } .mf-shortcut-tile.upload .mf-shortcut-icon { background: var(--brand); }
.mf-shortcut-tile.newfolder { background: #e6f7ee; } .mf-shortcut-tile.newfolder .mf-shortcut-icon { background: #2bb673; }
.mf-shortcut-tile.share { background: #f1ecfb; } .mf-shortcut-tile.share .mf-shortcut-icon { background: #8a5cf6; }
.mf-shortcut-tile.trash { background: #fdecec; } .mf-shortcut-tile.trash .mf-shortcut-icon { background: #e04545; }

.mf-storage-note { font-size: 0.78rem; color: #51607a; margin-bottom: 0.1rem; }
.mf-storage-track { height: 8px; border-radius: 5px; background: #eef0f3; margin: 0.5rem 0 0.4rem; overflow: hidden; }
.mf-storage-fill { height: 100%; border-radius: 5px; }
.mf-storage-legend { font-size: 0.72rem; color: #8592a6; }
