/* 국제패션 입학관리 CRM — 스타일
   톤: 종이빛 배경 + 잉크 네이비, 포인트는 패션 핑크 한 곳.
   시그니처: 진행단계 배지의 박음질(스티치) 점선 테두리. */

:root {
  --bg: #F6F5F1;
  --surface: #FFFFFF;
  --ink: #23272F;
  --muted: #6F7480;
  --line: #E6E3DC;
  --navy: #2B3A55;
  --navy-deep: #1F2B40;
  --pink: #C9476F;
  --radius: 10px;
  /* 단계 색 (칩 배경/글자) */
  --c-gray-bg: #EFEEEA;  --c-gray-fg: #5A5E66;
  --c-amber-bg: #FBEFD8; --c-amber-fg: #8A5A0B;
  --c-blue-bg: #D9E8FF;  --c-blue-fg: #0B4FB3;
  --c-teal-bg: #DFF2EB;  --c-teal-fg: #0E6B52;
  --c-green-bg: #DDF6E6; --c-green-fg: #116B32;
  --c-red-bg: #FBE7E7;   --c-red-fg: #A03030;
}
[hidden] { display: none !important; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Pretendard Variable', Pretendard, 'Apple SD Gothic Neo',
               'Malgun Gothic', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}
button { font: inherit; cursor: pointer; }
a { color: var(--navy); }

/* ---------- 상단 바 ---------- */
.topbar {
  display: flex; align-items: center; gap: 20px;
  background: var(--navy-deep); color: #F2F0EA;
  padding: 0 22px; height: 56px;
  position: sticky; top: 0; z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,.12);
}
.brand { font-weight: 600; font-size: 16px; letter-spacing: -0.2px; }
.brand b { color: #fff; }
.brand .stitch {
  display: block; height: 3px; margin-top: 2px; width: 56px;
  background: repeating-linear-gradient(90deg, var(--pink) 0 6px, transparent 6px 10px);
  border-radius: 2px;
}
.topbar .spacer { flex: 1; }
/* 갱신 시각 문구가 길어져도 탭바를 밀어내지 않도록 폭을 묶어둔다 */
.topbar .sync { font-size: 12.5px; color: #B9BFCB; flex: 0 1 auto; min-width: 0;
  max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .user { font-size: 13.5px; color: #DDE1E8; }
.nav-toggle { display: none; flex-direction: column; justify-content: center; gap: 4px;
  width: 38px; height: 38px; border: 0; background: transparent; cursor: pointer; padding: 8px; border-radius: 8px; }
.nav-toggle span { display: block; height: 2px; background: #EDEFF3; border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle:hover { background: rgba(255,255,255,.08); }
.btn-ghost {
  background: transparent; color: #C9CFDA;
  border: 1px solid #46546E; border-radius: 8px; padding: 5px 12px; font-size: 13px;
}
.btn-ghost:hover { color: #fff; border-color: #6B7A96; }

/* ---------- 필터 영역 ---------- */
.filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 16px 22px 6px;
}
.chip {
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 6px 14px; font-size: 13.5px; color: var(--ink);
}
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip.test-chip.on { background: #222; border-color: #222; color: #fff; }
.chip .n { color: var(--muted); margin-left: 5px; font-size: 12px; }
.chip.on .n { color: #C8D2E4; }
select.chip { appearance: auto; }
.search {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
}
.search input {
  width: 240px; padding: 8px 12px; font: inherit;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
}
.search input:focus { outline: 2px solid var(--navy); outline-offset: -1px; }

/* 학생관리: 학기 필터·검색줄을 메뉴(상단바) 바로 아래에 고정 — 긴 목록에서도 필터/검색을 바로 사용.
   z-index 5: 표 내용 위 / 상세 패널·오버레이(30·31) 아래. 상단바(1000) 아래. */
#view-students .filters {
  position: sticky; top: 56px; z-index: 5;
  background: var(--bg);
  box-shadow: 0 1px 0 var(--line), 0 6px 10px -8px rgba(0, 0, 0, .15);
}
@media (max-width: 1500px) { #view-students .filters { top: 52px; } }   /* 이 구간 상단바 높이 52px (햄버거 전환점과 같이 움직여야 함) */
@media (max-width: 720px)  { #view-students .filters { position: static; box-shadow: none; } } /* 모바일은 칩이 여러 줄이라 고정 해제 */

.stagebar { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 22px 14px; }

/* 단계 배지 — 박음질 점선 (시그니처) */
.stage {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 4px 12px; font-size: 12.5px; font-weight: 600;
  border: 1.5px dashed currentColor; background: var(--c-gray-bg); color: var(--c-gray-fg);
}
.stage.amber { background: var(--c-amber-bg); color: var(--c-amber-fg); }
.stage.blue  { background: var(--c-blue-bg);  color: var(--c-blue-fg); }
.stage.teal  { background: var(--c-teal-bg);  color: var(--c-teal-fg); }
.stage.green { background: var(--c-green-bg); color: var(--c-green-fg); }
.stage.red   { background: var(--c-red-bg);   color: var(--c-red-fg); }
button.stage { opacity: .55; }
button.stage.on, button.stage:hover { opacity: 1; }

/* ---------- 표 ---------- */
.tablewrap { padding: 0 22px 40px; overflow-x: auto; }
table.list {
  width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
table.list th, table.list td {
  padding: 11px 14px; text-align: left; font-size: 14px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.list th {
  background: #FBFAF7; color: var(--muted); font-size: 12.5px; font-weight: 600;
}
table.list tbody tr { cursor: pointer; }
table.list tbody tr:hover { background: #F4F7FB; }
table.list tbody tr:last-child td { border-bottom: 0; }
.muted { color: var(--muted); }
.empty { padding: 60px 0; text-align: center; color: var(--muted); }

/* ---------- 상세 슬라이드 패널 ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(25, 30, 40, .35);
  opacity: 0; pointer-events: none; transition: opacity .18s; z-index: 30;
}
.overlay.open { opacity: 1; pointer-events: auto; }
.panel {
  position: fixed; top: 56px; right: -560px; width: 540px; max-width: 96vw; height: calc(100% - 56px);
  background: var(--surface); box-shadow: -8px 0 28px rgba(0,0,0,.12);
  transition: right .22s ease; z-index: 31; display: flex; flex-direction: column;
}
.panel.open { right: 0; }
.panel-head {
  padding: 18px 22px 14px; border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; gap: 12px;
}
.panel-head h2 { margin: 0; font-size: 19px; font-weight: 700; }
.panel-head .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.panel-head .close {
  margin-left: auto; border: 0; background: transparent; font-size: 20px; color: var(--muted);
}
.panel-body { overflow-y: auto; padding: 6px 22px 40px; flex: 1; }

.sec { margin-top: 20px; }
.sec h3 {
  margin: 0 0 8px; font-size: 13px; color: var(--navy);
  letter-spacing: .4px; font-weight: 700;
  border-left: 3px solid var(--pink); padding-left: 8px;
}
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 5px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }
.form-grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.form-grid label { display: grid; gap: 4px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.form-grid input, .form-grid select, .form-grid textarea {
  width: 100%; min-width: 0; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 7px; font: inherit; color: var(--ink); background: #fff;
}
.memo {
  white-space: pre-wrap; background: #FBFAF7; border: 1px solid var(--line);
  border-radius: 8px; padding: 12px 14px; font-size: 13.5px; line-height: 1.7;
}
.tag-src {
  display: inline-block; font-size: 11px; font-weight: 700; color: var(--muted);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; margin-left: 6px;
  vertical-align: 1px;
}
.docs { display: flex; flex-wrap: wrap; gap: 6px; }
.doc { font-size: 12px; border-radius: 6px; padding: 3px 9px;
       background: var(--c-gray-bg); color: var(--c-gray-fg); }
.doc.y { background: var(--c-green-bg); color: var(--c-green-fg); }
.notice {
  background: var(--c-amber-bg); color: var(--c-amber-fg);
  border-radius: 8px; padding: 10px 14px; font-size: 13.5px; margin-top: 14px;
}
.placeholder {
  border: 1.5px dashed var(--line); border-radius: 8px; padding: 14px;
  color: var(--muted); font-size: 13px; text-align: center;
}
.tel { text-decoration: none; font-weight: 600; }

/* ---------- 로그인 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.login-card {
  width: 360px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 34px 32px 30px;
}
.login-card h1 { margin: 0 0 2px; font-size: 20px; font-weight: 700; color: var(--navy-deep); }
.login-card .stitch {
  display: block; height: 3px; margin: 8px 0 22px; width: 64px;
  background: repeating-linear-gradient(90deg, var(--pink) 0 6px, transparent 6px 10px);
  border-radius: 2px;
}
.login-card label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 5px; }
.login-card input {
  width: 100%; padding: 10px 12px; font: inherit;
  border: 1px solid var(--line); border-radius: 8px;
}
.login-card input:focus { outline: 2px solid var(--navy); outline-offset: -1px; }
.btn-primary {
  width: 100%; margin-top: 22px; padding: 11px; border: 0; border-radius: 8px;
  background: var(--navy); color: #fff; font-weight: 600; font-size: 15px;
}
.btn-primary:hover { background: var(--navy-deep); }
.login-err { color: var(--c-red-fg); font-size: 13px; min-height: 18px; margin-top: 10px; }

/* ---------- 모바일 ---------- */
@media (max-width: 720px) {
  .topbar { padding: 0 12px; gap: 8px; flex-wrap: wrap; height: auto; min-height: 52px; align-items: center; }
  .topbar .sync { display: none; }
  .topbar .spacer { display: block; flex: 1; }
  .brand { font-size: 15px; }
  /* 탭: 가로 스크롤로 폭 안 넘치게, 글자 키움 */
  .tabs {
    order: 3; width: 100%; margin-left: 0;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    gap: 2px; padding-bottom: 6px;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex-shrink: 0; font-size: 15px; padding: 9px 14px; white-space: nowrap; }
  .user { font-size: 13px; }
  .btn-ghost { padding: 6px 10px; font-size: 13px; }

  .filters, .stagebar, .tablewrap { padding-left: 12px; padding-right: 12px; }
  .search { margin-left: 0; width: 100%; }
  .search input { width: 100%; font-size: 15px; padding: 11px 14px; }
  .panel { width: 100%; }
  .kv { grid-template-columns: 84px 1fr; }
  .view { padding: 16px 0; }
  .view h1 { padding: 0 14px; font-size: 21px; }
  .view .date { padding: 0 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .panel, .overlay { transition: none; }
}

/* ===== [모바일 디자인 1단계] 본문 +1, 터치영역 확대, 작은 글씨 보정 =====
   ≤1300(폰·폴드·태블릿·Boox)은 본문 16px로 키워 가독성 향상. 데스크탑(>1300)은 15px 유지. */
@media (max-width: 1300px) {
  body { font-size: 16px; }
  input, select, textarea { font-size: 16px; }   /* 포커스 시 자동확대 방지 + 가독성 */
}
/* 폰·폴드6 커버 (≤720) — 터치 영역·작은 글씨 집중 보정 */
@media (max-width: 720px) {
  .kv { font-size: 15px; }
  .kv dt, .kv dd { font-size: 15px; }
  .hint, .panel-head .sub { font-size: 12.5px; }
  .item .when, .msglog-head .when, .stat .slabel, .stat-sub { font-size: 12px; }
  /* 터치 영역 확대 (권장 44px) */
  .btn { min-height: 44px; }
  .btn.sm { min-height: 38px; padding: 8px 12px; font-size: 13px; }
  .btn.xs { min-height: 32px; padding: 6px 11px; font-size: 12px; }
  .chip { min-height: 38px; display: inline-flex; align-items: center; }
  /* 상세 액션 버튼들이 너무 붙지 않게 */
  .item [class*="ds-"], .msglog-actions .btn { margin-left: 2px; }
}
/* ===== [모바일 디자인 1단계 추가] 깨진 레이아웃 보정 (폴드6 커버+펼침, ≤950) ===== */
@media (max-width: 950px) {
  /* 보고서 저장목록: 제목/메타 위, 액션버튼은 2열 그리드(세로로 길게 늘어지던 문제 해결) */
  .report-snapshot-row { grid-template-columns: 1fr; gap: 8px; }
  .snapshot-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .snapshot-actions .btn { width: 100%; }

  /* 알리고 CRM 전체 발송기록: 내부 위아래 스크롤 제거(페이지로 흐름) + 카드형으로 변환(가로 스크롤·보기버튼 넘침 해결) */
  .local-history-scroll { max-height: none; overflow: visible; border: 0; }
  .local-message-history thead { display: none; }
  .local-message-history, .local-message-history tbody { display: block; width: 100%; }
  .local-message-history tr {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 12px; padding: 12px 14px; margin-bottom: 9px;
  }
  .local-message-history td { display: block; border: 0 !important; padding: 0 !important; }
  .local-message-history td:nth-child(3) { order: 1; flex: 1; font-size: 15px; }      /* 수신자 */
  .local-message-history td:nth-child(6) { order: 2; margin-left: auto; }             /* 보기 버튼 */
  .local-message-history td:nth-child(1) { order: 3; flex-basis: 100%; color: var(--muted); font-size: 12px; } /* 일시 */
  .local-message-history td:nth-child(2) { order: 4; font-size: 12px; color: var(--muted); }   /* 채널 */
  .local-message-history td:nth-child(4) { order: 5; }                               /* 상태 */
  .local-message-history td:nth-child(5) { order: 6; flex-basis: 100%; font-size: 13px; color: var(--muted); } /* 내용 */
}

/* 상담기록 표: 좁은 화면에서 7칸이 눌려 '상담내용'이 세로(한 글자)로 깨지던 문제 → 카드형 변환 */
@media (max-width: 720px) {
  .consult-table thead { display: none; }
  .consult-table, .consult-table tbody { display: block; width: 100%; }
  .consult-table tr {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 12px; padding: 12px 14px; margin-bottom: 9px;
  }
  .consult-table td { display: block; border: 0 !important; padding: 0 !important; }
  .consult-table td:nth-child(3) { order: 1; flex: 1; font-size: 15px; }   /* 이름 */
  .consult-table td:nth-child(1) { order: 2; }                              /* 구분 */
  .consult-table td:nth-child(6) { order: 3; margin-left: auto; }           /* 접수 */
  .consult-table td:nth-child(2) { order: 4; flex-basis: 100%; color: var(--muted); font-size: 12px; } /* 날짜 */
  .consult-table td:nth-child(4) { order: 5; flex-basis: 100%; font-size: 13px; color: var(--muted); } /* 연락처 */
  .consult-table td.consult-content {       /* 상담내용 — 전체폭, 정상 줄바꿈 */
    order: 6; flex-basis: 100%; max-width: 100%; white-space: pre-wrap;
    word-break: break-word; font-size: 14px; color: var(--ink); margin-top: 2px;
  }
  .consult-table td.consult-actions { order: 7; flex-basis: 100%; display: flex; gap: 6px; margin-top: 6px; }
}

/* 폴드6 커버 등 초협소 (≤360) — 좌우 여백 최소화로 내용 폭 확보 */
@media (max-width: 360px) {
  .view { padding-left: 10px; padding-right: 10px; }
  .filters, .stagebar, .tablewrap { padding-left: 10px; padding-right: 10px; }
  .panel-body { padding-left: 12px; padding-right: 12px; }
  .topbar { padding: 0 10px; }
  .view h1 { padding-left: 10px; padding-right: 10px; }
}

/* ===== 태블릿 공통 (721~1300px): 메뉴 가로스크롤 + 글자 키움 ===== */
@media (min-width: 721px) and (max-width: 1300px) {
  .topbar { padding: 0 16px; gap: 12px; flex-wrap: wrap; height: auto; min-height: 56px; align-items: center; }
  .topbar .sync { display: none; }
  .topbar .spacer { flex: 1; }
  .brand { font-size: 17px; }
  .tabs { order: 3; width: 100%; margin-left: 0; overflow-x: auto; gap: 4px; padding-bottom: 6px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex-shrink: 0; font-size: 15.5px; padding: 9px 16px; white-space: nowrap; }
  .view { padding: 20px 18px; }
  .view h1 { font-size: 22px; }
  .stat .snum { font-size: 24px; }
  .stat .slabel { font-size: 12.5px; }
  .dash-2col { gap: 14px; }
  .panel { width: 72%; max-width: 700px; }
  .kv { grid-template-columns: 110px 1fr; }
  .kv dt, .kv dd { font-size: 14.5px; }
}

/* 좁은 태블릿 (721~950px): Fold 펼침·Boox 세로 — 학생목록은 카드 */
@media (min-width: 721px) and (max-width: 950px) {
  #studentsTable thead { display: none; }
  #studentsTable, #studentsTable tbody { display: block; width: 100%; }
  #studentsTable tr {
    display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 12px; padding: 14px 16px; margin-bottom: 11px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
  }
  #studentsTable td { display: block; border: 0 !important; padding: 0 !important; font-size: 15px; }
  #studentsTable td:nth-child(2) { order: 1; }
  #studentsTable td:nth-child(3) { order: 2; flex: 1; }
  #studentsTable td:nth-child(3) b { font-size: 17px; }
  #studentsTable td:nth-child(5) { order: 3; margin-left: auto; }
  #studentsTable td.td-phone { font-size: 0; }
  #studentsTable td.td-phone .row-actions { font-size: 15px; }
  #studentsTable td:nth-child(1) { order: 4; flex-basis: 100%; font-size: 13px; color: var(--muted); }
  #studentsTable td:nth-child(1)::before { content: "접수 "; }
  #studentsTable td:nth-child(4) { order: 5; font-size: 13px; color: var(--muted); }
  #studentsTable td:nth-child(6) { display: none; }
  #studentsTable td:nth-child(7) { order: 6; flex-basis: 100%; margin-top: 3px; }
  #studentsTable td:nth-child(8) { display: none; }
  .ic-btn { width: 40px; height: 40px; font-size: 18px; }
}

/* 넓은 태블릿 (951~1300px): Boox 가로 등 — 표 유지하되 컬럼 줄이고 글자 키움 */
@media (min-width: 951px) and (max-width: 1300px) {
  #studentsTable th, #studentsTable td { font-size: 14.5px; padding: 12px 9px; }
  #studentsTable th:nth-child(1), #studentsTable td:nth-child(1),  /* 접수일 */
  #studentsTable th:nth-child(8), #studentsTable td:nth-child(8) { /* 비고 */
    display: none;
  }
  .ic-btn { width: 36px; height: 36px; font-size: 16px; }
}

/* ===== e-ink 화면 (Boox 등) 가독성: 대비 강화 ===== */
@media (max-width: 1300px) {
  .muted { color: #5a5a5a; }
  .stat.zero { opacity: .6; }
  .sem-tag, .stage { font-weight: 700; }
}

/* 행 안의 전화/이메일 아이콘 버튼 */
.row-actions { display: inline-flex; gap: 5px; margin-left: 6px; vertical-align: middle; }
.ic-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; text-decoration: none;
  font-size: 14px; border: 1px solid var(--line); background: #fff; transition: transform .1s, background .15s;
}
.ic-btn.call { background: #EAF2FF; border-color: #CADEFB; }
.ic-btn.mail { background: #F0FBF3; border-color: #C5E8D1; }
.ic-btn:active { transform: scale(.9); }

/* ---------- Phase 2: 입력 폼 / 버튼 / 모달 ---------- */
.btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 8px; padding: 7px 14px; font-size: 13.5px;
}
.btn:hover { border-color: var(--navy); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--navy-deep); }
.btn.pink { background: var(--pink); border-color: var(--pink); color: #fff; font-weight: 600; }
.btn.sm { padding: 4px 10px; font-size: 12.5px; border-radius: 6px; }
.btn.danger { color: var(--c-red-fg); border-color: var(--c-red-fg); background: var(--surface); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.form-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.form-row input, .form-row select, .form-row textarea {
  padding: 8px 10px; font: inherit; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); min-width: 0;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: 2px solid var(--navy); outline-offset: -1px;
}
.form-row .grow { flex: 1; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

.timeline { margin-top: 8px; }
.timeline .item {
  border-left: 2px solid var(--line); padding: 2px 0 10px 12px; margin-left: 4px;
  font-size: 13.5px; position: relative;
}
.timeline .item::before {
  content: ''; position: absolute; left: -5px; top: 6px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--navy);
}
.timeline .item .when { color: var(--muted); font-size: 12px; }
.timeline .item.fail::before { background: var(--c-red-fg); }

.pill {
  display: inline-block; border-radius: 6px; padding: 1px 8px;
  font-size: 11.5px; font-weight: 700;
}
.pill.alim { background: var(--c-amber-bg); color: var(--c-amber-fg); }
.pill.lms  { background: var(--c-blue-bg); color: var(--c-blue-fg); }
.pill.ok   { background: var(--c-green-bg); color: var(--c-green-fg); }
.pill.fail { background: var(--c-red-bg); color: var(--c-red-fg); }
.pill.test { background: var(--c-gray-bg); color: var(--c-gray-fg); }
.pill.requested { background: var(--c-amber-bg); color: var(--c-amber-fg); }

/* 발송 모달 */
.modal-back {
  position: fixed; inset: 0; background: rgba(25,30,40,.45);
  display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px;
}
.modal-back.open { display: flex; }
.modal-back.modal-attention .modal { animation: modalNudge .18s ease-out; }
@keyframes modalNudge {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-4px); }
  70% { transform: translateX(4px); }
}
.modal {
  width: 520px; max-width: 100%; max-height: 92vh; overflow-y: auto;
  background: var(--surface); border-radius: 14px; padding: 22px 24px;
}
.modal h2 { margin: 0 0 4px; font-size: 17px; }
.modal .sub { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.msg-preview {
  white-space: pre-wrap; background: #FFFBEB; border: 1px solid #F1E4B8;
  border-radius: 12px; padding: 14px 16px; font-size: 13.5px; line-height: 1.7; margin-top: 10px;
}
.msg-preview.lms { background: #F2F7FD; border-color: #CBDEF2; }
.warn-box {
  background: var(--c-red-bg); color: var(--c-red-fg);
  border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-top: 10px;
}
.info-box {
  background: var(--c-gray-bg); color: var(--c-gray-fg);
  border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-top: 10px;
}
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* ---------- Phase 3: 탭 / 대시보드 / 큐 / 자동화 ---------- */
/* 넓은 화면의 가로 탭바.
   탭이 12개까지 늘어나면서, 폭이 모자랄 때 탭이 찌그러져 마지막 메뉴가 사라지는 일이 있었다.
   flex-shrink:0 으로 탭은 절대 찌그러지지 않게 하고, 그래도 넘치면 가로 스크롤로 넘긴다.
   (1500px 이하는 아래 미디어쿼리에서 햄버거 메뉴로 바뀌므로 여기까지 오지 않는다) */
.tabs { display: flex; gap: 4px; margin-left: 8px; min-width: 0;
  overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  background: transparent; color: #B9BFCB; border: 0; border-radius: 8px;
  padding: 7px 13px; font-size: 14px; font-weight: 500; position: relative;
  white-space: nowrap;     /* 탭 글자가 줄바꿈되어 메뉴가 2줄 되는 것 방지 */
  flex-shrink: 0;          /* 폭이 모자라도 탭을 찌그러뜨리지 않는다 */
}
.tab:hover { color: #fff; }
.tab.on { color: #fff; background: rgba(255,255,255,.1); font-weight: 600; }
.badge {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 3px;
  background: var(--pink); color: #fff; border-radius: 9px;
  font-size: 11px; font-weight: 700; text-align: center; line-height: 18px;
}
.view { padding: 22px; max-width: 1200px; margin-left: auto; margin-right: auto; }
/* 와이드 모니터 좌우 여백 낭비 줄이기 — 대시보드는 더 넓게 사용 */
@media (min-width: 1360px) { #view-dashboard.view { max-width: 1560px; } }
.view h1 { font-size: 20px; margin: 0 0 4px; }
.view .date { color: var(--muted); font-size: 13.5px; margin-bottom: 18px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(20, 24, 40, .04);
}
.card h3 {
  margin: 0 0 12px; font-size: 14px; color: var(--navy); font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.card h3 .cnt {
  margin-left: auto; background: var(--c-gray-bg); color: var(--c-gray-fg);
  border-radius: 8px; padding: 1px 9px; font-size: 12.5px;
}
.card h3.urgent .cnt { background: var(--c-red-bg); color: var(--c-red-fg); }
.card .row {
  display: flex; align-items: center; gap: 8px; padding: 7px 0;
  border-bottom: 1px solid var(--line); font-size: 13.5px; cursor: pointer;
}
.card .row:last-child { border-bottom: 0; }
.card .row:hover { color: var(--navy); }
.card .row .time { color: var(--muted); font-size: 12.5px; min-width: 44px; }
.card .row .nm { font-weight: 600; }
.card .empty-sm { color: var(--muted); font-size: 13px; padding: 8px 0; }

.qtable { width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qtable th, .qtable td { padding: 10px 12px; text-align: left; font-size: 13.5px;
  border-bottom: 1px solid var(--line); }
.qtable th { background: #FBFAF7; color: var(--muted); font-size: 12.5px; }
.qtable tbody tr:last-child td { border-bottom: 0; }
.qtable .msg { white-space: pre-wrap; color: var(--muted); font-size: 12.5px; max-width: 360px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar .btn { white-space: nowrap; }                 /* 버튼 글자가 한 글자씩 줄바꿈되지 않게 */
@media (max-width: 1300px) {
  .toolbar .hint { flex-basis: 100%; margin: 0; }      /* 긴 설명은 버튼 아래 줄로 → 버튼 3개가 한 줄 유지 */
}

.rule { background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 18px; margin-bottom: 10px; display: flex; align-items: center; gap: 14px; }
.rule .info { flex: 1; }
.rule .info .nm { font-weight: 600; font-size: 14.5px; }
.rule .info .desc { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.auto-rule { align-items: flex-start; }
.auto-template-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.auto-tpl-select { min-width: 260px; max-width: 520px; flex: 1 1 320px;
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 12.5px; background: #fff; }
.auto-tpl-select:disabled { background: #F4F2ED; color: var(--muted); }
.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #CCC8BF; border-radius: 26px;
  transition: .2s; cursor: pointer; }
.switch .slider::before { content: ''; position: absolute; width: 20px; height: 20px;
  left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--navy); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.rule-switch {
  width: auto; min-width: 138px; height: 34px; display: inline-flex; align-items: center; gap: 8px;
  justify-content: flex-end; padding: 3px 0; cursor: pointer;
}
.rule-switch .slider {
  position: relative; inset: auto; width: 66px; height: 32px; flex: 0 0 66px;
  background: #E1E4EA; border: 1px solid #A9B0BE; box-shadow: inset 0 0 0 1px rgba(0,0,0,.03);
}
.rule-switch .slider::before {
  width: 26px; height: 26px; left: 2px; top: 2px; background: #fff;
  box-shadow: 0 2px 5px rgba(20,24,40,.22);
}
.rule-switch input:checked + .slider {
  background: #137333; border-color: #0F672D;
}
.rule-switch input:checked + .slider::before { transform: translateX(34px); }
.rule-switch input:disabled + .slider { cursor: not-allowed; opacity: .65; }
.switch-mini {
  position: absolute; top: 50%; transform: translateY(-50%); font-size: 9px; font-weight: 900;
  letter-spacing: 0; pointer-events: none;
}
.switch-mini.off { right: 8px; color: #4F5665; }
.switch-mini.on { left: 9px; color: #fff; opacity: 0; }
.rule-switch input:checked + .slider .switch-mini.off { opacity: 0; }
.rule-switch input:checked + .slider .switch-mini.on { opacity: 1; }
.switch-state {
  display: none; min-width: 58px; font-size: 12px; font-weight: 800; white-space: nowrap;
}
.rule-switch input:checked ~ .switch-on { display: inline; color: #137333; }
.rule-switch input:not(:checked) ~ .switch-off { display: inline; color: #7B1E1E; }
.tag-mode { font-size: 11.5px; font-weight: 700; border-radius: 6px; padding: 2px 8px; }
.tag-mode.queue { background: var(--c-amber-bg); color: var(--c-amber-fg); }
.tag-mode.auto { background: var(--c-green-bg); color: var(--c-green-fg); }
.tag-mode.toggle { cursor: pointer; user-select: none; border: 1px solid transparent; }
.tag-mode.toggle:hover { border-color: currentColor; }

/* ---------- Phase 4: 템플릿 스튜디오 ---------- */
.tpl-status { font-size: 11.5px; font-weight: 700; border-radius: 6px; padding: 2px 9px; white-space: nowrap; }
.tpl-status.draft { background: var(--c-gray-bg); color: var(--c-gray-fg); }
.tpl-status.requested { background: var(--c-amber-bg); color: var(--c-amber-fg); }
.tpl-status.approved { background: var(--c-green-bg); color: var(--c-green-fg); }
.tpl-status.rejected { background: var(--c-red-bg); color: var(--c-red-fg); }
.tpl-status.stopped { background: #E8E6E1; color: #9A958C; }
.tpl-status.ok { background: var(--c-green-bg); color: var(--c-green-fg); }
.tpl-status.fail { background: var(--c-red-bg); color: var(--c-red-fg); }
.tpl-status.warn { background: var(--c-amber-bg); color: var(--c-amber-fg); }
.tpl-status.wait { background: #EAF1FC; color: #1A56C4; }   /* ⏳ 전송중 (도달결과 확인 전) */

.tpl-group { background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 4px 0; margin-bottom: 12px; }
.tpl-group .ghead { display: flex; align-items: center; gap: 10px; padding: 12px 18px 8px; }
.tpl-group .ghead .gtype { font-weight: 700; font-size: 15px; }
.tpl-group .ghead .gchan { font-size: 12px; }
.tpl-ver { display: flex; align-items: center; gap: 12px; padding: 9px 18px;
  border-top: 1px solid var(--line); font-size: 13.5px; }
.tpl-ver .tpl-check { width: 16px; height: 16px; flex-shrink: 0; }
.tpl-ver .vlabel { color: var(--muted); min-width: 42px; }
.tpl-ver .vname { flex: 1; }
.tpl-meta { display: block; margin-top: 3px; font-size: 11.5px; color: var(--muted); font-weight: 400; }
.tpl-ver.current { background: #FBFCFE; }
.tpl-ver .star { color: var(--pink); font-size: 12px; }
.reject-note { background: var(--c-red-bg); color: var(--c-red-fg); border-radius: 7px;
  padding: 6px 10px; font-size: 12.5px; margin: 0 18px 10px; }

.tpl-modal {
  width: clamp(1040px, 92vw, 1500px);
  min-width: 980px;
  max-width: calc(100vw - 32px);
  min-height: 600px;
  max-height: calc(100vh - 32px);
  resize: both;
  overflow: auto;
}
.tpl-modal-head {
  position: sticky; top: 0; z-index: 12; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border-bottom: 1px solid var(--line); padding: 16px 18px 12px; margin: -18px -18px 14px;
}
.tpl-modal-head h2 { margin: 0; }
.tpl-x { width: 36px; height: 36px; font-size: 26px; line-height: 1; border-radius: 8px; }
.tpl-edit { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; margin-top: 6px; align-items: start; }
.tpl-form label { display: block; font-size: 12.5px; color: var(--muted); margin: 12px 0 5px; }
.tpl-form input, .tpl-form textarea, .tpl-form select { width: 100%; padding: 9px 11px; font: inherit;
  border: 1px solid var(--line); border-radius: 8px; }
.tpl-form input:focus, .tpl-form textarea:focus, .tpl-form select:focus { outline: 2px solid var(--navy); outline-offset: -1px; }
.tpl-form textarea { resize: vertical; line-height: 1.6; font-family: inherit; }
.tpl-channel-info { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  background: #FBFAF7; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-size: 12.5px; color: var(--ink); }
.tpl-channel-info b { display: block; color: var(--muted); font-size: 11.5px; margin-bottom: 2px; }
.tpl-channel-info span { overflow-wrap: anywhere; }
.field-help { margin-top: 5px; color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.tpl-load-row, .tpl-insert-row, .tpl-button-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.tpl-image-options { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 8px; background: #FBFCFE; }
.tpl-image-options label { margin-top: 0; }
.tpl-image-options input, .tpl-image-options select { margin-top: 7px; }
.tpl-em-help { background: #F4F8FF; border: 1px solid #D6E4FB; color: #1f3557; border-radius: 10px;
  padding: 10px 12px; margin-top: 8px; font-size: 12.5px; line-height: 1.6; }
.tpl-em-help b { display: block; margin-bottom: 4px; color: var(--navy); }
.tpl-em-help span { display: block; }
.tpl-secure-opt { background: #FBFAF7; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; }
.tpl-channel-add { display: flex; align-items: flex-start; gap: 10px; background: #FFF7E3; border: 1px solid #F0C36D;
  border-radius: 10px; padding: 11px 12px; margin: 12px 0 4px; color: var(--ink) !important; }
.tpl-channel-add input, .tpl-fallback-check input { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 2px; }
.tpl-channel-add span, .tpl-fallback-check span { display: flex; flex-direction: column; gap: 2px; line-height: 1.45; }
.tpl-channel-add b, .tpl-fallback-check b { font-size: 13px; }
.tpl-channel-add small, .tpl-fallback-check small { color: var(--muted); font-weight: 400; }
.tpl-guide { margin: 10px 0; padding: 10px 12px; background: #FBFAF7; border: 1px solid var(--line); border-radius: 8px;
  font-size: 12.5px; line-height: 1.65; color: var(--ink); }
.tpl-guide span { color: #02A99C; font-weight: 800; }
.tpl-button-tools select { max-width: 220px; }
.tpl-button-help { margin: 9px 0 10px; font-size: 12.5px; color: var(--muted); display: grid; gap: 7px; }
.tpl-button-help-title { font-weight: 800; color: var(--ink); }
.tpl-button-help-card { border: 1px solid var(--line); background: #FBFAF7; border-radius: 8px; padding: 9px 11px; line-height: 1.55; }
.tpl-button-help-card.on { border-color: #B7C8E7; background: #F4F8FF; }
.tpl-button-help-card b { display: block; color: var(--ink); margin-bottom: 3px; }
.tpl-button-help-card span { display: block; white-space: pre-wrap; }
.tpl-button-list { display: flex; flex-direction: column; gap: 8px; }
.tpl-button-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #FBFAF7; }
.tpl-button-row-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.tpl-button-row input { margin-top: 6px; background: #fff; }
.tpl-memory-row { display: flex; flex-wrap: wrap; gap: 5px; margin: 5px 0 2px; }
.tpl-memory-chip { display: inline-flex; align-items: center; max-width: 100%; border: 1px solid #DCE4F2; border-radius: 999px; background: #fff; overflow: hidden; }
.tpl-memory-chip button { border: 0; background: transparent; color: var(--navy); font-size: 11.5px; padding: 4px 7px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-memory-chip .x { border-left: 1px solid #DCE4F2; color: var(--muted); padding: 4px 6px; }
.tpl-memory-chip button:hover { background: #F4F8FF; }
.tpl-json-details { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.tpl-json-details summary { cursor: pointer; margin-bottom: 6px; }
.tpl-body-editor { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 12px; align-items: stretch; }
.tpl-body-editor textarea { min-height: 360px; }
.tpl-special-rail { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 10px; min-width: 0; }
.tpl-special-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.tpl-special-head b { font-size: 13px; color: var(--ink); }
.tpl-special-panel { max-height: 310px; overflow: auto; padding-right: 2px; margin-top: 8px; }
.tpl-special-rail.collapsed .hint,
.tpl-special-rail.collapsed .tpl-special-panel { display: none; }
.special-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 8px; }
.special-tab { border: 1px solid var(--line); background: #FBFAF7; border-radius: 7px; padding: 7px 8px; font-size: 12px; font-weight: 800; color: var(--muted); }
.special-tab.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.special-pane { display: none; }
.special-pane.on { display: block; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
.emoji-chip { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 3px;
  display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 58px; }
.emoji-chip img { width: 30px; height: 30px; object-fit: contain; }
.emoji-chip span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; color: var(--muted); }
.emoji-chip:hover { border-color: var(--navy); background: #F4F8FF; }
.special-group + .special-group { border-top: 1px solid var(--line); margin-top: 9px; padding-top: 9px; }
.special-title { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.special-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.special-chip { min-width: 32px; min-height: 30px; border: 1px solid var(--line); border-radius: 6px;
  background: #FBFAF7; color: var(--ink); font: inherit; font-size: 12.5px; padding: 4px 7px; }
.special-group:first-child .special-chip { font-weight: 700; color: var(--navy); }
.special-chip:hover { border-color: var(--navy); color: var(--navy); background: #fff; }
.varbar { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.varbar button { font-size: 12px; border: 1px solid var(--line); background: #F8F7F4;
  border-radius: 6px; padding: 3px 8px; color: var(--navy); }
.varbar button:hover { background: var(--navy); color: #fff; border-color: var(--navy); }

.tpl-preview-pane { position: sticky; top: 68px; }
.kakao-phone { background: #fff; border: 1px solid var(--line); border-radius: 28px; padding: 18px 12px 14px;
  box-shadow: 0 1px 5px rgba(0,0,0,.08); }
.kakao-preview-title { text-align: center; font-weight: 800; margin-bottom: 10px; color: var(--ink); }
.kakao-bubble { background: #B2C7DA; border-radius: 6px; padding: 10px; font-size: 13px; line-height: 1.6;
  word-break: keep-all; overflow-wrap: anywhere; min-height: 330px; max-height: min(66vh, 620px); overflow-y: auto; }
.kakao-head { background: #FFE600; color: #111; text-align: center; padding: 9px 8px; font-weight: 700; margin-bottom: 0; }
.kakao-content, .kakao-extra { background: #fff; padding: 13px 14px; white-space: normal; }
.kakao-emoticon-img { width: 26px; height: 26px; object-fit: contain; vertical-align: middle; margin: 1px 2px; }
.kakao-emoticon-token { display: inline-flex; align-items: center; justify-content: center; min-width: 34px;
  margin: 1px 2px; padding: 2px 6px; border-radius: 999px; background: #FFF3C4; border: 1px solid #F3D46B;
  color: #6F4E00; font-size: 11.5px; font-weight: 800; vertical-align: middle; }
.kakao-extra { color: #777; font-size: 12px; border-top: 1px solid #eee; }
.kakao-count { text-align: right; color: #222; font-size: 12px; padding-top: 7px; }
.kakao-count.over, .hint.over, #tplFbCounter.over { color: var(--c-red-fg); font-weight: 800; }
.kakao-em-text { background: #fff; padding: 14px; border-bottom: 1px solid #eee; }
.kakao-em-text b { display: block; font-size: 17px; margin-bottom: 4px; }
.kakao-em-text span { display: block; color: #666; font-size: 12.5px; }
.kakao-image-box { background: #f7f7f7; border-bottom: 1px solid #eee; min-height: 110px; display: flex;
  align-items: center; justify-content: center; text-align: center; padding: 16px; color: #111; }
.kakao-image-box.logo { border: 1px dashed #ff6a6a; margin: 20px; min-height: 52px; }
.kakao-image-box.icon { flex-direction: column; gap: 8px; }
.kakao-image-box.icon b { border: 1px dashed #ff6a6a; padding: 8px 16px; }
.kakao-image-box.icon span { border: 1px dashed #ff6a6a; padding: 8px 18px; }
.kakao-image-box.textmix { justify-content: space-between; gap: 18px; align-items: flex-start; }
.kakao-image-box.textmix span, .kakao-image-box.textmix b { border: 1px dashed #ff6a6a; padding: 8px; font-size: 12px; }
.kakao-channel-note { background: #fff; color: #888; font-size: 12px; padding: 0 14px 10px; }
.kakao-channel-btn { background: #FFE600; border-radius: 5px; text-align: center; padding: 9px; margin: 0 4px 6px; font-weight: 700; }
.kakao-action-btn { background: #fff; border: 1px solid #e5e5e5; border-radius: 5px; text-align: center; padding: 9px; margin: 5px 4px 0; color: #2256a3; }
.tpl-pick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.tpl-pick-grid.preview { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.tpl-pick-card { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 12px;
  min-height: 112px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.tpl-pick-card:hover { border-color: var(--navy); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.tpl-pick-card b { font-size: 14px; color: var(--ink); }
.tpl-pick-card span { font-size: 12.5px; color: var(--ink); line-height: 1.55; }
.tpl-pick-card small { color: var(--muted); margin-top: auto; }
.tpl-pick-preview { background: #B2C7DA; border-radius: 6px; padding: 7px; max-height: 210px; overflow: hidden;
  border: 1px solid #9eb9cf; }
.tpl-pick-preview .kakao-bubble { min-height: 170px; max-height: 190px; overflow: hidden; }
.tpl-pick-preview .kakao-head { padding: 7px; font-size: 12px; }
.tpl-pick-preview .kakao-content,
.tpl-pick-preview .kakao-extra { padding: 9px 10px; font-size: 12px; line-height: 1.5; }
.tpl-pick-preview .kakao-em-text { padding: 9px 10px; }
.tpl-pick-preview .kakao-em-text b { font-size: 14px; }
.tpl-pick-preview .kakao-action-btn,
.tpl-pick-preview .kakao-channel-btn { padding: 6px; font-size: 12px; }
.tpl-fallback-panel { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; background: #FBFAF7; overflow: hidden; }
.tpl-fallback-panel > summary { cursor: pointer; display: flex; align-items: flex-start; justify-content: flex-start; gap: 12px;
  padding: 12px 14px; font-weight: 800; color: var(--ink); background: #fff; border-bottom: 1px solid var(--line); }
.tpl-fallback-check { display: flex; align-items: flex-start; gap: 10px; width: 100%; color: var(--ink) !important; }
.tpl-fallback-panel > summary::marker { content: ''; }
.tpl-fallback-grid { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 14px; padding: 14px; }
.tpl-fallback-form label { display: block; margin: 9px 0 5px; }
.seg { display: flex; gap: 10px; flex-wrap: wrap; }
.seg label { display: inline-flex; align-items: center; gap: 6px; margin: 0; border: 1px solid var(--line);
  background: #fff; border-radius: 8px; padding: 7px 12px; font-weight: 700; color: var(--ink); }
.seg label:has(input:checked) { border-color: var(--navy); background: #F4F8FF; color: var(--navy); }
.tpl-fb-tools { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 8px; }
.tpl-fallback-preview { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; align-self: start; }
.sms-preview { min-height: 220px; background: #B2C7DA; border-radius: 7px; padding: 14px; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.sms-preview b { display: block; margin-bottom: 10px; }
.tpl-fb-saved { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.tpl-fb-saved-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.tpl-fb-saved-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.tpl-fb-saved-card { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 9px; }
.tpl-fb-saved-card b { display: block; font-size: 12.5px; margin-bottom: 4px; color: var(--ink); }
.tpl-fb-saved-card span { display: block; font-size: 12px; color: var(--muted); line-height: 1.45; }
.precheck-box { margin-top: 12px; border-radius: 8px; padding: 9px 12px; font-size: 12.5px; }
.precheck-box.err { background: var(--c-red-bg); color: var(--c-red-fg); }
.precheck-box.warn { background: var(--c-amber-bg); color: var(--c-amber-fg); }
.precheck-box.ok { background: var(--c-green-bg); color: var(--c-green-fg); }
.precheck-box ul { margin: 4px 0 0; padding-left: 18px; }

@media (max-width: 720px) {
  .tpl-edit { grid-template-columns: 1fr; }
  .tpl-modal { width: 100%; min-width: 0; max-width: 100%; min-height: 0; resize: none; }
  .tpl-channel-info { grid-template-columns: 1fr; }
  .tpl-preview-pane { position: static; }
  .kakao-phone { border-radius: 18px; }
  .tpl-body-editor { grid-template-columns: 1fr; }
  .tpl-body-editor textarea { min-height: 280px; }
  .tpl-special-panel { max-height: 220px; }
  .tpl-pick-grid.preview { grid-template-columns: 1fr; }
  .tpl-fallback-panel > summary { align-items: flex-start; flex-direction: column; }
  .tpl-fallback-grid { grid-template-columns: 1fr; }
  .sms-preview { min-height: 160px; }
}

@media (min-width: 981px) and (max-width: 1280px) {
  .tpl-modal { width: 95vw; min-width: 900px; }
  .tpl-edit { grid-template-columns: minmax(0, 1fr) 320px; }
  .tpl-body-editor { grid-template-columns: minmax(0, 1fr) 220px; }
}

@media (min-width: 721px) and (max-width: 980px) {
  .tpl-modal { width: 95vw; min-width: 0; resize: vertical; }
  .tpl-edit { grid-template-columns: 1fr; }
  .tpl-preview-pane { position: static; }
  .tpl-body-editor { grid-template-columns: minmax(0, 1fr) 240px; }
}

/* ---------- Phase 5: 문서 / 보고서 / 학기전환 ---------- */
/* 넓은 표(월별비교·연도별실적)는 잘리지 않게 가로 스크롤 래퍼로 감싼다 */
.rep-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 20px; }
.rep-scroll > .rep-table { margin-bottom: 0; min-width: 640px; }
.rep-table { width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 20px; }
.rep-table th, .rep-table td { padding: 9px 12px; text-align: center; font-size: 13px;
  border-bottom: 1px solid var(--line); }
.rep-table th { background: #FBFAF7; color: var(--muted); font-size: 12px; }
.rep-table td:first-child, .rep-table th:first-child { text-align: left; font-weight: 600; }
.rep-table tbody tr:last-child td { border-bottom: 0; }

.funnel { display: flex; flex-direction: column; gap: 6px; max-width: 520px; margin-bottom: 8px; }
.funnel .step { display: flex; align-items: center; gap: 10px; }
.funnel .bar { height: 30px; background: linear-gradient(90deg, var(--navy), #4863857); 
  background: var(--navy); border-radius: 6px; min-width: 40px; display: flex; align-items: center;
  padding: 0 10px; color: #fff; font-size: 12.5px; font-weight: 600; transition: width .3s; }
.funnel .flabel { width: 76px; font-size: 13px; color: var(--ink); }
.funnel .fpct { font-size: 12px; color: var(--muted); }

.sem-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 18px; margin-bottom: 10px; display: flex; align-items: center; gap: 14px; }
.sem-card .sname { font-weight: 700; font-size: 15px; }
.sem-card .scount { color: var(--muted); font-size: 13px; }
.sem-card .sem-cnt { cursor: pointer; }
.sem-card .sem-cnt b { color: var(--ink); }
.sem-card .sem-cnt:hover b { text-decoration: underline; }
.sem-card .sstatus { font-size: 11.5px; font-weight: 700; border-radius: 6px; padding: 2px 10px; }
.sem-card .sstatus.open { background: var(--c-green-bg); color: var(--c-green-fg); }
.sem-card .sstatus.closed { background: #E8E6E1; color: #9A958C; }
.sem-card .sstatus.planned { background: var(--c-amber-bg); color: var(--c-amber-fg); }
.sem-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
/* 학기 카드 — 설정칸(납부시작·마감·등록금액·입학일)이 늘어 좁은 화면에서 글자가 세로로 찌그러지지 않게 줄바꿈 */
.sem-card { flex-wrap: wrap; }
.sem-card > .sname, .sem-card > .sstatus, .sem-card > .scount, .sem-card > .tui-badge, .sem-card > .adm-badge { white-space: nowrap; }
.sem-card .sem-actions .btn, .sem-adm label { white-space: nowrap; }
.wizard-box { background: #FBFCFE; border: 1.5px solid var(--c-blue-bg); border-radius: 12px;
  padding: 16px 18px; margin-bottom: 16px; }
.wizard-box h3 { margin: 0 0 8px; font-size: 14px; color: var(--navy); }
.wizard-box .desc { font-size: 13px; color: var(--muted); line-height: 1.7; }

/* ---------- 대시보드 요약 통계 타일 ---------- */
.stat-row { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 8px; }
.stat-row .stat { flex: 1 1 calc(16.66% - 9px); min-width: 90px; }
@media (max-width: 700px) { .stat-row .stat { flex: 1 1 calc(33.33% - 9px); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 10px; text-align: center; display: flex; flex-direction: column; gap: 5px;
  position: relative; transition: transform .12s, box-shadow .12s; box-shadow: 0 1px 2px rgba(20, 24, 40, .04); }
.stat .snum { font-size: 25px; font-weight: 800; color: var(--ink); line-height: 1; }
.stat .slabel { font-size: 11.5px; color: var(--muted); white-space: nowrap; font-weight: 600; }
/* 색 그룹: 짙은 상단 보더로 카테고리 직관화 */
.stat::before { content: ''; position: absolute; top: 0; left: 12px; right: 12px; height: 3px; border-radius: 0 0 3px 3px; background: transparent; }
.stat.accent { background: var(--navy); border-color: var(--navy); }
.stat.accent .snum, .stat.accent .slabel { color: #fff; }
.stat.accent .slabel { color: #C8D2E4; }
.stat.blue { background: #F4F8FF; border-color: #D6E4FB; }
.stat.blue .snum { color: #1A56C4; }
.stat.green { background: #F2FBF5; border-color: #C5E8D1; }
.stat.green .snum { color: #137333; }
.stat.red { background: #FEF6F5; border-color: #F6D6D2; }
.stat.red .snum { color: #C5221F; }
.stat.amber { background: #FFFBF2; border-color: #F5E4C0; }
.stat.amber .snum { color: #A6760B; }
.stat.teal { background: #EFF9F8; border-color: #BFE3DF; }
.stat.teal .snum { color: #0F766E; }   /* 등록완료 — 이미 개강한 학기의 등록자 */
.stat.gray { background: #FAFAFA; border-color: var(--line); }
.stat.gray .snum { color: #777; }
/* 0인 항목은 흐리게 — 중요한 숫자가 도드라지도록 */
.stat.zero { opacity: .45; }
.stat.zero .snum { font-weight: 600; }

/* ---------- 변수 버튼 툴팁 ---------- */
.varbar { position: relative; }
.var-tip {
  position: absolute; top: 100%; left: 0; margin-top: 4px; z-index: 10;
  background: var(--navy-deep); color: #fff; border-radius: 8px;
  padding: 9px 12px; font-size: 12px; line-height: 1.6; max-width: 320px;
  white-space: pre-line; box-shadow: 0 4px 14px rgba(0,0,0,.2);
}

/* ---------- 자동발송 템플릿 펼쳐보기 ---------- */
.tpl-peek { color: var(--navy); text-decoration: underline; font-size: 12.5px; }
.tpl-peek-box { margin-top: 8px; background: #FBFAF7; border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; }
.tpl-peek-box .peek-status { font-size: 11.5px; color: var(--muted); margin-bottom: 6px; }
.tpl-peek-box .peek-body { white-space: pre-wrap; font-size: 12.5px; line-height: 1.65; color: var(--ink); }
.tpl-suggest { color: var(--navy); text-decoration: underline; font-size: 12.5px; cursor: pointer; }
.tpl-peek-box .suggest-body { background: #EEF4FF; border: 1px solid #C9DBFA; border-radius: 6px; padding: 8px 10px; margin: 6px 0; }
.tpl-peek-box [data-copy-suggest] { margin-top: 2px; }

/* ---------- 직접발송 ---------- */
.ds-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.ds-tab { background: var(--surface); border: 1px solid var(--line); color: var(--muted);
  border-radius: 8px; padding: 8px 18px; font-size: 13.5px; font-weight: 500; }
.ds-tab.on { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.ds-choice-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.ds-choice-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ds-choice { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 11px 12px;
  display: flex; flex-direction: column; gap: 5px; cursor: pointer; min-width: 0; }
.ds-choice input { margin-right: 6px; }
.ds-choice span { display: block; color: var(--muted); font-size: 12px; line-height: 1.45; margin-left: 22px; }
.ds-choice.on { border-color: var(--navy); background: #F4F8FF; color: var(--navy); }
.ds-reserve-box { margin: 10px 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #FBFAF7; }
.ds-reserve-title { font-weight: 800; color: var(--ink); margin-bottom: 8px; }
.ds-reserve-modes { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.ds-reserve-modes label { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink); }
.field-label { font-size: 12.5px; font-weight: 800; color: var(--muted); min-width: 64px; }
.ds-split-row { align-items: center; color: var(--muted); font-size: 13px; }

.var-edit-box { margin-top: 10px; display: grid; gap: 8px; }
.var-edit-row { display: grid; grid-template-columns: minmax(160px, 260px) minmax(220px, 1fr);
  gap: 10px; align-items: center; padding: 9px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; }
.var-edit-meta { display: grid; gap: 3px; min-width: 0; }
.var-edit-meta b { font-size: 13px; color: var(--ink); }
.var-edit-meta code { font-size: 12px; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.var-edit-meta small { color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.var-edit-input { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid var(--line);
  border-radius: 7px; font: inherit; }
.var-add-row { display: grid; grid-template-columns: minmax(120px, 180px) minmax(160px, 1fr) auto;
  gap: 8px; align-items: center; padding: 9px 10px; border: 1px dashed var(--line);
  border-radius: 8px; background: #FBFAF7; }
.var-add-row input { min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; font: inherit; }

/* ---------- 변수표 (문자 작성 도우미) ---------- */
.var-palette { margin: 10px 0; border: 1px solid var(--line); border-radius: 10px; background: #FBFAF7;
  overflow: hidden; max-width: 100%; min-width: 0; }
.var-palette .vp-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 9px 12px; border-bottom: 1px solid var(--line); background: #fff; }
.var-palette .vp-title { font-size: 13px; color: var(--ink); }
.var-palette .vp-who { display: inline-flex; align-items: baseline; gap: 6px; font-size: 12.5px;
  min-width: 0; overflow: hidden; }
.var-palette .vp-who-on { font-weight: 800; color: var(--navy); }
.var-palette .vp-muted { color: var(--muted); font-size: 12px; font-weight: 400; }
.var-palette .vp-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-left: auto; min-width: 0; }
/* 좁은 칸에서도 넘치지 않게 검색칸이 먼저 줄어듭니다 */
.var-palette .vp-search { flex: 1 1 120px; min-width: 90px; max-width: 190px;
  padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; font: inherit; font-size: 12.5px; }
.var-palette .vp-chk { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.var-palette .vp-chk input { width: auto; margin: 0; }
.var-palette .vp-find { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 9px 12px; border-bottom: 1px dashed var(--line); }
.var-palette .vp-find-label { font-size: 12px; font-weight: 800; color: var(--muted); }
.var-palette .vp-find input { padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; font: inherit; font-size: 12.5px; }
.var-palette .vp-find-name { flex: 0 1 110px; min-width: 76px; }
.var-palette .vp-find-phone { flex: 1 1 150px; min-width: 110px; max-width: 180px; }
.var-palette .vp-find-msg { flex: 1 1 100%; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.var-palette .vp-find-msg:empty { display: none; }
.var-palette .vp-note { padding: 8px 12px; font-size: 12px; color: var(--muted); line-height: 1.5; border-bottom: 1px dashed var(--line); }
/* 세로 스크롤만 — 표를 폭에 맞춰 짜맞추므로 가로 스크롤은 생기지 않습니다 */
.var-palette .vp-body { max-height: 300px; overflow-y: auto; overflow-x: hidden; background: #fff; }
.var-palette .vp-empty { padding: 18px 12px; text-align: center; color: var(--muted); font-size: 12.5px; }
/* table-layout:fixed + 비율 고정 — 값이 길어도 다른 열을 밀어내지 않습니다
   (예전엔 값 열이 nowrap 이라 '뜻' 열이 한 글자 폭으로 찌그러졌습니다) */
.vp-table { width: 100%; max-width: 100%; table-layout: fixed; border-collapse: collapse; }
.vp-table th:nth-child(1), .vp-table td:nth-child(1) { width: 27%; }
.vp-table th:nth-child(2), .vp-table td:nth-child(2) { width: 24%; }
.vp-table th:nth-child(3), .vp-table td:nth-child(3) { width: 35%; }
.vp-table th:nth-child(4), .vp-table td:nth-child(4) { width: 14%; }
.vp-table th { position: sticky; top: 0; z-index: 1; background: #FBFAF7; color: var(--muted);
  font-size: 11.5px; font-weight: 700; text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.vp-table td { padding: 6px 10px; font-size: 12.5px; border-bottom: 1px solid #F2F0EB; vertical-align: middle;
  overflow-wrap: anywhere; word-break: break-word; }
.vp-table tr.vp-group td { background: #F6F5F1; color: var(--ink); font-size: 11.5px; font-weight: 800; padding: 5px 10px; }
.vp-table tr.vp-row { cursor: pointer; }
.vp-table tr.vp-row:hover { background: #F4F8FF; }
.vp-table tr.vp-row.used { background: #F1F8F3; }
.vp-table .vp-code { display: inline-block; padding: 2px 7px; border: 1px solid var(--line); border-radius: 6px;
  background: #fff; color: var(--navy); font-weight: 700; font-size: 12px; line-height: 1.5; }
.vp-table tr.vp-row:hover .vp-code { border-color: var(--navy); background: var(--navy); color: #fff; }
.vp-table .vp-used { margin-left: 5px; font-size: 10.5px; font-weight: 800; color: #116B32; white-space: nowrap; }
.vp-table .vp-sublabel { display: none; color: var(--muted); font-size: 11px; line-height: 1.35; margin-top: 2px; }
.vp-table .vp-label { color: var(--muted); line-height: 1.4; }
.vp-table .vp-val { color: var(--ink); font-weight: 700; line-height: 1.4; }
.vp-table .vp-none { color: #A03030; font-weight: 400; font-size: 12px; }
.vp-table .vp-act { text-align: right; }
.vp-table .vp-fix { padding: 3px 7px; font-size: 11px; white-space: nowrap; }
.vp-table .vp-fix-s { display: none; }

/* 좁은 자리(발송 모달 등): '뜻' 열을 접어 변수명 아래로 내리고 값 열에 폭을 몰아줍니다 */
.var-palette.vp-narrow .vp-table th.vp-label-h,
.var-palette.vp-narrow .vp-table td.vp-label { display: none; }
.var-palette.vp-narrow .vp-table .vp-sublabel { display: block; }
.var-palette.vp-narrow .vp-table td { vertical-align: top; padding: 7px 8px; }
.var-palette.vp-narrow .vp-table th:nth-child(1), .var-palette.vp-narrow .vp-table td:nth-child(1) { width: 45%; }
.var-palette.vp-narrow .vp-table th:nth-child(3), .var-palette.vp-narrow .vp-table td:nth-child(3) { width: 39%; }
.var-palette.vp-narrow .vp-table th:nth-child(4), .var-palette.vp-narrow .vp-table td:nth-child(4) { width: 16%; }
.var-palette.vp-narrow .vp-table .vp-fix-l { display: none; }
.var-palette.vp-narrow .vp-table .vp-fix-s { display: inline; }
/* 아주 좁을 때는 '값 그대로' 버튼 열까지 접습니다 (행을 눌러 변수는 그대로 넣을 수 있습니다) */
.var-palette.vp-tight .vp-table th:nth-child(4), .var-palette.vp-tight .vp-table td.vp-act { display: none; }
.var-palette.vp-tight .vp-table th:nth-child(1), .var-palette.vp-tight .vp-table td:nth-child(1) { width: 52%; }
.var-palette.vp-tight .vp-table th:nth-child(3), .var-palette.vp-tight .vp-table td:nth-child(3) { width: 48%; }
.var-palette .vp-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 8px 12px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); background: #FBFAF7; }
.var-palette .vp-foot b { color: var(--navy); }
.var-palette .vp-blank { color: #A03030; font-weight: 700; }
.ds-prow.bad td { background: #FDF4F4; }

/* ---------- 보고서 합계행 ---------- */
.rep-table tfoot .rep-total td { background: var(--navy); color: #fff; font-weight: 700;
  border-top: 2px solid var(--navy-deep); }

.report-note-box { display: grid; gap: 8px; }
.report-editor-toolbar { display: flex; flex-wrap: wrap; gap: 5px; align-items: center;
  padding: 7px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.report-editor-toolbar .tb-sep { width: 1px; height: 20px; background: var(--line); margin: 0 3px; }
.report-editor-toolbar .tb-label { font-size: 11.5px; color: var(--muted); font-weight: 700; margin-left: 2px; }
.report-editor-toolbar .tb-select { font-size: 12.5px; padding: 5px 6px; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; cursor: pointer; }
.report-editor-toolbar .tb-ic { min-width: 30px; text-align: center; }
.report-editor-toolbar .tb-swatch { width: 22px; height: 22px; padding: 0; border: 1px solid rgba(0,0,0,.25);
  border-radius: 5px; cursor: pointer; position: relative; overflow: hidden; display: inline-flex;
  align-items: center; justify-content: center; font-size: 11px; line-height: 1; }
.report-editor-toolbar .tb-swatch:hover { outline: 2px solid var(--navy); outline-offset: 1px; }
.report-editor-toolbar .tb-swatch-custom { background: #fff; }
.report-editor-toolbar .tb-swatch-custom input[type=color] { position: absolute; inset: 0; opacity: 0; cursor: pointer; padding: 0; border: 0; }
/* 편집기 폭 = 실제 보고서(A4) 콘텐츠 폭 172mm(=210 − 좌14 − 우24). 넘치면 가로 스크롤로 폭 유지 */
.report-editor-wrap { overflow-x: auto; padding-bottom: 2px; }
.report-editor { width: 172mm; max-width: 172mm; box-sizing: border-box; min-height: 240px;
  border: 1px solid var(--line); border-radius: 4px; background: #fff; padding: 12px 14px;
  font-size: 14px; line-height: 1.65; outline: none; box-shadow: 0 1px 8px rgba(20, 24, 40, .10); }
.report-editor:empty::before { content: attr(data-placeholder); color: var(--muted); }
.report-editor h3 { font-size: 18px; margin: 6px 0; color: var(--navy); }
.report-editor h4 { font-size: 15px; margin: 5px 0; color: var(--ink); }
.report-editor p, .report-editor div { margin: 4px 0; }
.report-editor ul, .report-editor ol { margin: 4px 0; padding-left: 22px; }
.report-editor li { margin: 2px 0; }
.report-editor s, .report-editor strike { text-decoration: line-through; }
.report-editor mark { background: #FFF2A8; padding: 0 3px; }
.report-editor img.report-inline-img {
  display: inline-block;
  max-width: 100%;
  max-height: 560px; /* 인쇄 시 상한(약 A4 절반=150mm)과 맞춰 편집화면에서도 한 화면을 넘지 않게 */
  height: auto;
  margin: 6px 8px 6px 0;
  vertical-align: top;
  border-radius: 6px;
  outline: 1px solid transparent;
}
.report-editor img.report-inline-img.selected {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
}
.report-image-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.report-image-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.report-img-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 9px; }
.report-img-card img { width: 96px; height: 72px; object-fit: contain; background: #F6F7F9; border-radius: 6px; }
.report-img-meta { display: grid; gap: 6px; min-width: 0; }
.report-img-meta b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.report-img-meta input, .report-img-meta select { width: 100%; min-width: 0; padding: 7px 9px;
  border: 1px solid var(--line); border-radius: 7px; font: inherit; }
.pill.test { background: #222; color: #fff; border-color: #222; margin-left: 4px; }
.report-snapshot-list { display: grid; gap: 8px; margin-top: 10px; }
.report-snapshot-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 10px 12px;
}
.snapshot-main { display: grid; gap: 2px; min-width: 0; }
.snapshot-main b { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.snapshot-main span, .snapshot-main small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.snapshot-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.report-preview-frame {
  width: min(980px, 86vw); height: min(760px, 78vh);
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}

/* ---------- 직접발송 채널/학생찾기 ---------- */
.ds-channel { border-radius: 8px; padding: 9px 12px; font-size: 13px; font-weight: 600; margin-top: 10px; }
.ds-channel.ok { background: var(--c-green-bg); color: var(--c-green-fg); }
.ds-channel.lms { background: var(--c-blue-bg); color: var(--c-blue-fg); }
.ds-found { background: #FBFAF7; border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 12px; font-size: 13px; margin-top: 8px; display: flex; flex-wrap: wrap;
  align-items: center; gap: 6px; }
.ds-found.ok { background: var(--c-green-bg); color: var(--c-green-fg); border-color: transparent; }
.ds-found.none { background: var(--c-gray-bg); color: var(--c-gray-fg); border-color: transparent; }

/* ---------- 직접발송 테스트모드 바 ---------- */
.ds-testbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-radius: 10px; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.ds-top-row { display: flex; align-items: stretch; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ds-top-row .point-panel { flex: 1 1 320px; margin: 0; max-width: none; }
.ds-top-row .ds-testbar { flex: 1 1 240px; margin: 0; align-items: center; flex-wrap: wrap; }
.ds-top-row .ds-testbar .ds-testbar-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.ds-top-row .ds-testbar .switch { margin-left: auto; }
@media (max-width: 760px) { .ds-top-row { flex-direction: column; } .ds-top-row .point-panel, .ds-top-row .ds-testbar { flex: 1 1 auto; } }
.ds-testbar.on { background: var(--c-amber-bg); color: var(--c-amber-fg); }
.ds-testbar.off { background: var(--c-red-bg); color: var(--c-red-fg); }

/* ---------- 여러건 템플릿 박스 ---------- */
.ds-tplbox { background: #FBFAF7; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; margin-top: 10px; }
.ds-tplbox .tpl-label { font-size: 11.5px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.ds-tplbox .tpl-content { white-space: pre-wrap; font-size: 12.5px; line-height: 1.6; color: var(--ink); }
.ds-tplbox .tpl-vars { margin-top: 8px; font-size: 12px; color: var(--muted); }
.ds-student-picker { background: #fff; }
.ds-student-picker .tpl-label { font-size: 13px; color: var(--ink); font-weight: 800; margin-bottom: 10px; }
.ds-source-tabs { display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #F8FAFC; }
.ds-source-tabs label { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 6px; color: var(--muted); font-size: 12.5px; font-weight: 800; cursor: pointer; }
.ds-source-tabs label.on { background: #fff; color: var(--navy); box-shadow: 0 1px 2px rgba(15,23,42,.08); }
.ds-source-tabs input { width: auto; margin: 0; }
.ds-filter-grid { display: grid; grid-template-columns: minmax(170px, 1fr) minmax(180px, 1fr) minmax(220px, 1.4fr) auto auto; gap: 8px; align-items: center; }
.ds-filter-grid input, .ds-filter-grid select { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.ds-filter-grid [hidden] { display: none !important; }
.ds-stage-multi { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 40px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #F8FAFC; }
.stage-multi-title { color: var(--muted); font-size: 12px; font-weight: 800; margin-right: 4px; }
.ds-stage-multi label { display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 12px; color: var(--ink); background: #fff; white-space: nowrap; }
.ds-stage-multi input { width: auto; }
.ds-pick-list { max-height: 320px; overflow: auto; margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.ds-pick-list:empty { display: none; }
.ds-pick-table { margin: 0; }
.ds-pick-table th, .ds-pick-table td { white-space: nowrap; }
.ds-pick-table .consult-content { min-width: 220px; max-width: 420px; white-space: pre-wrap; }
.ds-pick-actions { justify-content: flex-end; margin-top: 10px; }
.ds-editor-actions { justify-content: flex-end; margin: 8px 0 0; }
.empty.small { padding: 16px; font-size: 13px; }
.vchip { display: inline-block; background: var(--navy); color: #fff; border-radius: 5px;
  padding: 1px 7px; font-size: 11.5px; margin: 2px 2px 0 0; }
.sms-template-box .form-row { align-items: center; }
.sms-template-preview { margin-top: 8px; }
.sms-template-card { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 10px 12px; }
.sms-template-card b { display: block; margin-bottom: 4px; color: var(--ink); }
.sms-template-card span { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; }
.sms-template-card small { display: block; color: var(--muted); margin-top: 6px; }
.raw-history-details {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
}
.raw-history-details summary {
  font-weight: 800;
  color: var(--navy);
  cursor: pointer;
}
.ds-preview-grid { display: grid; grid-template-columns: minmax(240px, 320px) minmax(220px, 1fr); gap: 16px; align-items: start; }
.ds-preview-grid .kakao-bubble { min-height: 260px; }
.ds-preview-grid h3 { margin: 0 0 8px; font-size: 14px; }

@media (max-width: 720px) {
  .ds-tabs { display: grid; grid-template-columns: 1fr 1fr; }
  .ds-tab { padding: 9px 8px; }
  .ds-choice-row { grid-template-columns: 1fr; }
  .ds-filter-grid, .rule-radio-grid, .rule-time-grid, .consult-form, .consult-form.edit { grid-template-columns: 1fr; }
  .consult-form textarea, .consult-form.edit textarea { grid-column: auto; }
  .ds-preview-grid { grid-template-columns: 1fr; }
  .var-edit-row, .var-add-row { grid-template-columns: 1fr; }
  .form-grid.two, .report-snapshot-row { grid-template-columns: 1fr; }
  .snapshot-actions { justify-content: flex-start; }
  .report-img-card { grid-template-columns: 1fr; }
  .report-img-card img { width: 100%; height: 140px; }
  .ds-reserve-box .form-row { align-items: stretch; }
  .ds-split-row input, .ds-split-row select { width: 100% !important; }
}

/* ---------- 등록단계 바 ---------- */
.birth-inline { font-size: 13px; color: var(--muted); font-weight: 400; margin: 0 4px; }
/* 지역(주소 요약) 배지 — 남/여 앞에 표시 */
.region-tag { display: inline-block; padding: 0 6px; border-radius: 8px; font-size: 11.5px; font-weight: 700;
  background: #EEF1F8; color: #445; border: 1px solid #D6DCEA; }
/* 성별 배지 — 남=파랑, 여=분홍 */
.gender-tag { display: inline-block; padding: 0 7px; border-radius: 8px; font-size: 11.5px; font-weight: 700; }
.gender-tag.male { background: #E3ECFD; color: #1A56C4; }
.gender-tag.female { background: #FCE4EC; color: #C2185B; }
.gender-tag.none { background: #F1F1EE; color: #8A8D93; border: 1px dashed #C9CBCF; font-weight: 600; }
.gender-quick { cursor: pointer; }
.gender-quick:hover { background: #FFF4D6; color: #A6760B; border-color: #E8C46B; }
/* 상세화면 성별 수동 지정 */
.gender-wrap { display: inline-flex; align-items: center; gap: 4px; }
.gender-empty { font-size: 12px; color: var(--muted); }
.mini-edit { border: 1px solid var(--border, #D6DCEA); background: #fff; color: #667; border-radius: 6px;
  font-size: 11px; line-height: 1; padding: 2px 5px; cursor: pointer; }
.mini-edit:hover { border-color: #2B3A55; color: #223; }
.btn.gender-pick { min-width: 84px; font-weight: 700; }
.btn.gender-pick.male.on { background: #E3ECFD; color: #1A56C4; border-color: #1A56C4; }
.btn.gender-pick.female.on { background: #FCE4EC; color: #C2185B; border-color: #C2185B; }
.btn.gender-pick.none.on { background: #EEF1F8; color: #445; border-color: #99A; }
.regbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #FBFAF7; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-top: 12px; }
.regbar .reglabel { font-size: 12px; color: var(--muted); font-weight: 600; }
.regbar .regstep { background: #113D8F; color: #fff; border-radius: 6px; padding: 3px 11px; font-size: 12.5px; font-weight: 800; cursor: help; }
.regnext { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap;
  background: #D9E8FF; color: #0B4FB3; border: 1px solid #82AAEA;
  border-radius: 8px; padding: 4px 9px; font-size: 12.5px; font-weight: 800; }
.regnext.done { background: #DDF6E6; color: #116B32; border-color: #85D7A0; }
.regnext .desc { font-weight: 500; color: #41536F; }
.regdots { display: flex; gap: 3px; flex: 1; }
.regdot { width: 12px; height: 12px; border-radius: 50%; background: #E0DDD6; cursor: help; }
.regdot.on { background: #149447; }
.regdot.next { background: #0B4FB3; box-shadow: 0 0 0 3px #D9E8FF; }
.regdot.manual { outline: 2px solid var(--pink); outline-offset: 1px; }
.reg-optional { display: flex; flex-wrap: wrap; gap: 5px; width: 100%; padding-left: 66px; }
.regopt { border: 1px dashed #C9C3B8; color: #7B746C; background: #F1EFEA; border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 700; }
.regopt.on { border-style: solid; color: #8A5A0B; background: #FFF2CD; border-color: #E5BF61; }
.regopt.manual { outline: 2px solid var(--pink); outline-offset: 1px; }
/* 1회성 자동안내 발송완료 — "이미 나갔고 다시 안 나감"을 초록으로 표시 */
.reg-autosent { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; width: 100%; padding-left: 66px; }
.regopt.auto-sent { border-style: solid; color: #146C43; background: #E6F4EA; border-color: #9AD3AE; cursor: help; }
.regopt.auto-sent .muted { color: #4E8B66; font-weight: 600; }
/* 자동발송 타이밍 설정 카드 */
.auto-timing .timing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 10px 0 6px; }
.auto-timing .timing-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.auto-timing .timing-grid input, .auto-timing .timing-grid select { padding: 6px 8px; font-size: 13px; border: 1px solid var(--border, #D9D4CC); border-radius: 6px; }
/* 자동발송 규칙이 문자 저장문구로 발송될 때 카드에 표시 */
.pill.sms-mode { background: #E6F0FF; color: #1B4C9B; border: 1px solid #B9D2F7; font-weight: 700; }

/* ---------- 학생상황 문자 발송 ---------- */
.student-send-channel.compact { margin: 10px 0; }
.student-sms-panel {
  margin: 10px 0 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #FFFEFB;
}
.student-sms-panel textarea {
  width: 100%;
  min-height: 190px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.7;
  font-family: inherit;
  resize: vertical;
}
.student-send-reserve { margin-top: 10px; }
.ds-reserve-box.mode-now .reserve-date-row,
.ds-reserve-box.mode-now .reserve-split-row,
.ds-reserve-box.mode-reserve .reserve-split-row { display: none !important; }
.ds-reserve-box.mode-split .reserve-date-row,
.ds-reserve-box.mode-split .reserve-split-row { display: flex; }
.reg-manager { display: flex; flex-direction: column; gap: 8px; }
.reg-manager-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #FBFAF7; }
.reg-manager-row.on { background: #F2FBF5; border-color: #C5E8D1; }
.reg-manager-main { flex: 1; min-width: 0; }
.reg-manager-main b { font-size: 13.5px; }
.reg-manager-main .desc { color: var(--muted); font-size: 12px; margin-top: 2px; }
.reg-manager-status { display: inline-block; margin-left: 6px; border-radius: 6px; padding: 1px 7px; font-size: 11px; font-weight: 700; }
.reg-manager-status.auto { background: var(--c-green-bg); color: var(--c-green-fg); }
.reg-manager-status.manual { background: var(--c-red-bg); color: var(--c-red-fg); }
.reg-manager-status.off { background: var(--c-gray-bg); color: var(--c-gray-fg); }
.reg-manager-actions { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }

.status-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.status-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  min-width: 0;
}
.status-card .stage {
  margin: 0 4px 4px 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.status-card.next { background: #F8FAFC; }
.status-title {
  display: block;
  margin-bottom: 6px;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 800;
}
.status-reason {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.status-evidence {
  grid-column: 1 / -1;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #FBFAF7;
  font-size: 12px;
  color: var(--muted);
}
.status-evidence b { color: var(--ink); margin-right: 2px; }
.status-evidence span {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 2px 7px;
}
@media (max-width: 720px) {
  .reg-manager-row { align-items: flex-start; flex-direction: column; }
  .reg-manager-actions { width: 100%; justify-content: flex-start; }
  .status-overview { grid-template-columns: 1fr; }
}

/* ---------- 범용 모달 ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: none;
  align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-back.open { display: flex; }
/* 문자 작성 모드 — 변수표·에디터·미리보기가 함께 들어가므로 폭을 넓게 씁니다 */
.modal-back .modal.sms-wide { max-width: 880px; }
.modal-back .modal { background: var(--surface); border-radius: 14px; max-width: 560px; width: 100%;
  max-height: 85vh; overflow: auto; box-shadow: 0 12px 40px rgba(0,0,0,.2); }
.modal-head { display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-x { background: none; border: 0; font-size: 18px; cursor: pointer; color: var(--muted); }
.modal-body { padding: 16px 18px; }
.modal-back .modal.tpl-modal {
  width: clamp(1040px, 92vw, 1500px);
  min-width: 980px;
  max-width: calc(100vw - 32px);
  min-height: 600px;
  max-height: calc(100vh - 32px);
  resize: both;
  overflow: auto;
}

/* ---------- 기타알림발송 내역 ---------- */
.msglog-item { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.msglog-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 5px; }
.msglog-type { font-weight: 600; font-size: 13px; }
.msglog-date { color: var(--muted); font-size: 11.5px; margin-left: auto; }
.msglog-body { white-space: pre-wrap; font-size: 12.5px; line-height: 1.6; color: var(--ink);
  background: #FBFAF7; border-radius: 6px; padding: 8px 10px; margin-top: 4px; }

/* ---------- 학기별 색상 (접수~면접 구분용) ---------- */
.sem-tag { display: inline-block; border-radius: 5px; padding: 1px 8px; font-size: 11.5px; font-weight: 600; }
.sem-c0 { background: #E8F0FE; color: #1A56C4; }  /* 파랑 */
.sem-c1 { background: #FCE8E6; color: #C5221F; }  /* 빨강 */
.sem-c2 { background: #E6F4EA; color: #137333; }  /* 초록 */
.sem-c3 { background: #FEF7E0; color: #A6760B; }  /* 노랑 */
.sem-c4 { background: #F3E8FD; color: #7B2FBE; }  /* 보라 */
.sem-c5 { background: #E0F7F5; color: #0B7268; }  /* 청록 */
.row-sembar { border-left: 4px solid transparent; }
.row-sembar.sem-c0 { border-left-color: #1A56C4; }
.row-sembar.sem-c1 { border-left-color: #C5221F; }
.row-sembar.sem-c2 { border-left-color: #137333; }
.row-sembar.sem-c3 { border-left-color: #A6760B; }
.row-sembar.sem-c4 { border-left-color: #7B2FBE; }
.row-sembar.sem-c5 { border-left-color: #0B7268; }

/* ---------- 모바일/데스크탑 분리 ---------- */
/* 기본(데스크탑): desktop-only 보임, mobile-only 숨김 */
.mobile-only { display: none; }

@media (max-width: 720px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: block; }

  /* 학생 목록: 모바일에선 카드 형식으로 (테이블 → 카드, flex 기반) */
  #studentsTable thead { display: none; }
  #studentsTable, #studentsTable tbody { display: block; width: 100%; }
  #studentsTable tr {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 12px; padding: 12px 14px; margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
  }
  #studentsTable td { display: block; border: 0 !important; padding: 0 !important; font-size: 14px; }
  /* 1줄: 학기태그 + 이름 (왼쪽) ... 전화/메일 버튼 (오른쪽) */
  #studentsTable td:nth-child(2) { order: 1; }
  #studentsTable td:nth-child(3) { order: 2; flex: 1; font-size: 16px; }
  #studentsTable td:nth-child(3) b { font-size: 16.5px; }
  #studentsTable td:nth-child(5) { order: 3; margin-left: auto; }
  #studentsTable td.td-phone { font-size: 0; }
  #studentsTable td.td-phone .row-actions { font-size: 14px; }
  /* 2줄: 접수일 · 과정 · 단계 */
  #studentsTable td:nth-child(1) { order: 4; flex-basis: 100%; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
  #studentsTable td:nth-child(1)::before { content: "접수 "; }
  #studentsTable td:nth-child(4) { order: 5; font-size: 12.5px; color: var(--muted); }
  #studentsTable td:nth-child(6) { display: none; }
  #studentsTable td:nth-child(7) { order: 6; flex-basis: 100%; margin-top: 4px; }
  #studentsTable td:nth-child(8) { display: none; }
  .ic-btn { width: 40px; height: 40px; font-size: 18px; }

  /* 대시보드 통계 타일: 모바일은 3열 (flex) */
  .stat-row .stat { flex: 1 1 calc(33.33% - 9px); }
  /* 카드: 모바일은 1열 */
  .cards { grid-template-columns: 1fr !important; }
}

/* ---------- 보고서 출력 박스 ---------- */
.repbox { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 8px; }
.rep-modes { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.rep-mode { background: #FBFAF7; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; padding: 8px 16px; font-size: 13.5px; font-weight: 500; }
.rep-mode.on { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.rep-opts { margin: 8px 0; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.rep-opts label { font-size: 13px; color: var(--ink); }
.rep-opts input { margin-left: 4px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }
.rep-memo { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 6px; }

/* ===== 대시보드 개편 ===== */
/* 작년 비교 배너 */
.compare-banner { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; }
.cb-title { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 12px; }
.cb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.cb-item { display: flex; align-items: baseline; gap: 10px; padding: 10px 14px; background: #FBFAF7; border-radius: 8px; }
.cb-label { font-size: 13px; color: var(--muted); min-width: 32px; }
.cb-now { font-size: 26px; font-weight: 800; color: var(--ink); }
.cb-vs { font-size: 12.5px; color: var(--muted); }
.cb-vs .up { color: #137333; font-weight: 700; }
.cb-vs .down { color: #C5221F; font-weight: 700; }
.cb-vs .flat { color: #999; }
.cb-warn { margin-top: 12px; padding: 9px 12px; background: #FCE8E6; color: #C5221F; border-radius: 8px; font-size: 13px; font-weight: 600; }
.cb-focus-grid { display: grid; grid-template-columns: repeat(3, minmax(140px, 1fr)); gap: 10px; margin-top: 12px; }
.cb-focus {
  display: flex; align-items: baseline; justify-content: center; gap: 6px;
  min-height: 58px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--muted);
}
.cb-focus span { font-size: 12.5px; font-weight: 800; }
.cb-focus b { font-size: 30px; line-height: 1; color: var(--ink); }
.cb-focus em { font-size: 12px; font-style: normal; color: var(--muted); }
.cb-focus.hot { border-color: #CFE4D5; background: #F0FAF3; color: #137333; }
.cb-focus.hot b { color: #137333; }
.cb-focus.hot.blue { border-color: #C9D8F3; background: #F3F7FF; color: #1A56C4; }
.cb-focus.hot.blue b { color: #1A56C4; }
.cb-focus.hot.amber { border-color: #F2D9A4; background: #FFF7E3; color: #A6760B; }
.cb-focus.hot.amber b { color: #A6760B; }

/* ===== 상단 개요(벤토): 좌=KPI 2줄(오늘/N월), 우=목표+전환율 ===== */
/* 우측 컬럼이 좌측 카드 높이에 맞춰 늘어나도록 stretch — 전환율 카드가 아래까지 채워진다 */
.dash-overview { display: grid; grid-template-columns: 1.55fr 1fr; gap: 12px; margin-bottom: 14px; align-items: stretch; }
.dash-overview-left { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dash-overview-right { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.dash-overview-left .goal-box, .dash-overview-right .goal-box, .dash-overview-right .rate-card { margin-bottom: 0; }
/* 전환율 카드는 남는 세로 공간을 채우고, 목표 게이지는 그 아래 자연 높이로 붙는다 */
.dash-overview-right .rate-card { flex: 1 1 auto; display: flex; flex-direction: column; }
.kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpi-row.two { grid-template-columns: repeat(2, 1fr); }
.kpi-row.four { grid-template-columns: repeat(4, 1fr); }
.kpi-row.five { grid-template-columns: repeat(5, 1fr); }
.kpi-row + .kpi-row { margin-top: 10px; }
.kpi.clickable { cursor: pointer; transition: transform .1s, box-shadow .1s; }
.kpi.clickable:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(20,24,40,.12); }
.kpi.clickable::after { content: '›'; position: absolute; top: 7px; right: 9px; font-size: 13px; color: var(--muted); opacity: .5; }

/* KPI 카드 — 내용 가운데 정렬로 좌우 빈 공간 제거 */
.kpi { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 12px; box-shadow: 0 1px 2px rgba(20, 24, 40, .04); }
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 700; }
.kpi-num { margin-top: 3px; font-size: 26px; font-weight: 800; color: var(--ink); line-height: 1.04; }
.kpi-unit { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.kpi-sub { margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.kpi-delta b { font-weight: 800; }
.kpi-delta.up b { color: #137333; } .kpi-delta.down b { color: #C5221F; } .kpi-delta.flat b { color: #999; }
.kpi.t-green { background: #F2FBF5; border-color: #C5E8D1; } .kpi.t-green .kpi-num { color: #137333; }
.kpi.t-blue { background: #F4F8FF; border-color: #D6E4FB; } .kpi.t-blue .kpi-num { color: #1A56C4; }
.kpi.t-amber { background: #FFFBF2; border-color: #F5E4C0; } .kpi.t-amber .kpi-num { color: #A6760B; }
.kpi.cmp { background: var(--surface); }
.kpi.t-red { background: #FEF6F5; border-color: #E9A9A4; } .kpi.t-red .kpi-num { color: #C5221F; }
.kpi.t-red .kpi-label { color: #C5221F; }
/* 접수 부진 경고 — 이번 달 접수가 작년보다 적을 때 빨강 강조 */
.kpi.warn { background: #FEF6F5; border-color: #E9A9A4; box-shadow: 0 0 0 1px #E9A9A4 inset, 0 1px 2px rgba(197,34,31,.08); }
.kpi.warn .kpi-label { color: #C5221F; }
/* 납부 관리 밴드 라벨 */
.kpi-band-label { margin: 12px 2px 6px; font-size: 12.5px; font-weight: 700; color: var(--fg); }
.kpi-band-label .muted { font-weight: 400; font-size: 11.5px; }
.kpi-band-label .band-badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 10px;
  background: #C5221F; color: #fff; font-size: 11px; font-weight: 800; vertical-align: middle; }
/* 명단 모달 — 독촉(일괄/개별·문자·전화) */
.picklist-item.has-act { gap: 8px; }
.picklist-item .dun-cb { flex: 0 0 auto; width: 16px; height: 16px; }
.picklist-item .dun-btns { margin-left: auto; flex: 0 0 auto; display: inline-flex; gap: 4px; }
.dun-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 8px 10px; background: #FBFAF7; border-radius: 8px; flex-wrap: wrap; }
.dun-bar .hint { margin: 0; }
.dun-recent { color: #A6760B; font-weight: 700; }
.long-tag { display: inline-block; margin-right: 4px; padding: 0 6px; border-radius: 6px; background: #C5221F; color: #fff; font-size: 10px; font-weight: 800; vertical-align: middle; }
/* 주간 미수금 리포트 */
.recv-panel { margin-top: 14px; }
.recv-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.recv-table th, .recv-table td { padding: 7px 9px; border-bottom: 1px solid var(--line); text-align: left; }
.recv-table th { font-size: 12px; color: var(--muted); font-weight: 600; }
.recv-table .rv-up { color: #C5221F; font-weight: 700; margin-left: 4px; }
.recv-table .rv-down { color: #137333; font-weight: 700; margin-left: 4px; }
/* 학기카드 — 입학일 뱃지/입력 */
.adm-badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 8px;
  background: #EEF4FF; color: #1A56C4; font-size: 11px; font-weight: 700; }
.sem-adm { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.sem-adm input { padding: 3px 6px; }

/* D-day 배지 (명단 모달) — 임박할수록 빨강 */
.dday-badge { display: inline-block; min-width: 40px; text-align: center; font-size: 11px; font-weight: 800;
  padding: 2px 6px; border-radius: 7px; margin-right: 8px; vertical-align: middle; letter-spacing: -.3px; }
.dday-badge.d0 { background: #C5221F; color: #fff; }
.dday-badge.d-soon { background: #FDE7E5; color: #C5221F; }
.dday-badge.d-week { background: #FEF3D9; color: #A6760B; }
.dday-badge.d-far { background: #EEF1F6; color: #5A6478; }
.dday-badge.d-over { background: #C5221F; color: #fff; } /* 마감 경과(미납) */

/* 전환율 카드 — 2×2. 카드가 늘어난 만큼 타일도 같이 늘어나 아래 여백을 채운다 */
.rate-card .rate-grid { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 8px; flex: 1 1 auto; }
.rate-item { background: #FBFAF7; border: 1px solid var(--line); border-radius: 9px; padding: 9px 8px; text-align: center;
  display: flex; flex-direction: column; justify-content: center; }
.rate-item span { display: block; font-size: 11px; color: var(--muted); }
.rate-item b { display: block; margin-top: 2px; font-size: 21px; font-weight: 800; color: var(--navy-deep); }
.rate-item em { display: block; margin-top: 1px; font-size: 10.5px; color: var(--muted); font-style: normal; }

/* 태블릿 이하: 우측(목표·전환율)을 아래로 내려 1열로 */
@media (max-width: 920px) { .dash-overview { grid-template-columns: 1fr; } }

/* 2단 패널 (알림 + 할일) */
.dash-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.dash-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(20, 24, 40, .04); }
.dash-h { font-size: 14px; font-weight: 700; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.dash-h .cnt { background: var(--navy); color: #fff; font-size: 12px; border-radius: 10px; padding: 1px 8px; }

/* 자동 알림 목록 */
/* 목록은 약 6개까지만 보이고 넘으면 스크롤 (놓치면 안 되는 일) */
.alert-list { display: flex; flex-direction: column; gap: 6px; max-height: 270px; overflow-y: auto; }
.alert-item { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px; background: #FBFAF7; cursor: pointer; }
.alert-item:hover { background: #F4F7FB; }
.alert-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.alert-item.high .alert-dot { background: #C5221F; }
.alert-item.mid .alert-dot { background: #E8A23D; }
.alert-item.low .alert-dot { background: #999; }
.alert-text { flex: 1; font-size: 13px; color: var(--ink); min-width: 0; word-break: break-word; }
.alert-item.dismissed { opacity: 0.6; background: #F3F4F6; }
.alert-item.dismissed .alert-text { text-decoration: line-through; color: #999; }
.alert-item.dismissed .alert-dot { background: #BBB !important; }
.today-badge { display: inline-block; background: #1A56C4; color: #fff; font-size: 10px; font-weight: 700; padding: 0 5px; border-radius: 8px; vertical-align: middle; }
.alert-add { width: 24px; height: 24px; border: 1px solid var(--line); background: #fff; border-radius: 6px; font-size: 16px; color: var(--navy); cursor: pointer; line-height: 1; flex-shrink: 0; }
.alert-add:hover { background: var(--navy); color: #fff; }

/* 할 일 */
.todo-add { display: flex; gap: 6px; margin-bottom: 10px; }
.todo-add input#todoInput { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; }
.todo-add input#todoDue { padding: 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 12px; color: var(--muted); }
/* 정규 스케줄·오늘 할 일·앞으로 할 일 모두 약 6개까지만 보이고 넘으면 스크롤 */
.todo-list { display: flex; flex-direction: column; gap: 4px; max-height: 232px; overflow-y: auto; }
.todo-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; }
.todo-item:hover { background: #F4F7FB; }
.todo-chk { width: 17px; height: 17px; flex-shrink: 0; cursor: pointer; }
.todo-text { flex: 1; font-size: 13.5px; color: var(--ink); }
.todo-item.done .todo-text { text-decoration: line-through; color: var(--muted); }
.todo-stu { color: var(--navy); font-size: 12px; }
.todo-due { font-size: 11.5px; color: var(--muted); background: #FBFAF7; padding: 2px 7px; border-radius: 6px; }
.todo-del { border: 0; background: transparent; color: #bbb; font-size: 13px; cursor: pointer; flex-shrink: 0; }
.todo-del:hover { color: #C5221F; }
/* 할 일 추가줄 — 시간·알림까지 들어가서 좁은 화면에서는 다음 줄로 넘어갑니다 */
.todo-add-2line { flex-wrap: wrap; }
.todo-add-2line input#todoTime { padding: 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 12px; color: var(--muted); }
.todo-add-2line select#todoRemind { padding: 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 12px; background: #fff; }
.todo-remind-hint { margin: -4px 0 10px; line-height: 1.5; }
.todo-remind-hint .btn.xs { margin-left: 4px; }
/* 알림 배지 (⏰ 14:30) */
.todo-alarm { flex-shrink: 0; border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 6px; padding: 2px 7px; font-size: 11px; cursor: pointer; white-space: nowrap; }
.todo-alarm:hover { border-color: var(--navy); color: var(--navy); }
.todo-alarm.on { background: #EAF2FF; border-color: #9BB7E8; color: #1A56C4; font-weight: 700; }

/* ---------- 목록 선택 삭제(여러 개 한 번에) ---------- */
.dash-h-tools { margin-left: auto; display: flex; gap: 6px; }
/* .btn.xs 뒤에 오는 규칙이라 클래스를 하나 더 얹어 배경까지 확실히 덮습니다 */
.btn.xs.bulk-toggle.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.bulk-chk { display: none; width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; accent-color: #C5221F; }
.bulk-on .bulk-chk { display: inline-block; }
/* 목록이 길어도 버튼이 화면 밖으로 밀리지 않게 위쪽에 붙여 둡니다 */
.bulk-bar { position: sticky; top: 6px; z-index: 3;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 8px;
  padding: 8px 10px; border: 1px solid #C9B9A4; border-radius: 8px; background: #FFF6E2;
  box-shadow: 0 2px 6px rgba(120,95,40,.12); }
.bulk-bar .bulk-all { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--ink); }
.bulk-bar .bulk-all input { width: auto; margin: 0; }
.bulk-bar .bulk-cnt { font-size: 12px; font-weight: 700; color: var(--ink); margin-right: auto; }
/* 실행 버튼은 눈에 확 띄게 (테두리만 있으면 있는 줄 모르고 지나칩니다) */
.bulk-bar .btn.xs { padding: 4px 11px; font-weight: 700; }
.bulk-bar .btn.xs.danger { color: #fff; border-color: #A03030; background: #B33A3A; }
.bulk-bar .btn.xs.danger:hover { background: #932F2F; }
.bulk-bar .bulk-note { flex: 1 1 100%; font-size: 11.5px; color: #8A5A0B; line-height: 1.45; }

/* ---------- 예약 알림 팝업 ---------- */
.rem-back { position: fixed; inset: 0; z-index: 900; background: rgba(23,27,35,.45);
  display: flex; align-items: center; justify-content: center; padding: 16px; }
.rem-card { width: min(520px, 100%); background: var(--surface); border-radius: 14px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(0,0,0,.28); border-top: 5px solid var(--pink); animation: remPop .18s ease-out; }
@keyframes remPop { from { transform: translateY(10px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.rem-head { display: flex; align-items: center; gap: 8px; padding: 14px 18px 10px; font-size: 17px; font-weight: 800; color: var(--ink); }
.rem-head .rem-cnt { background: var(--pink); color: #fff; font-size: 12px; border-radius: 10px; padding: 1px 9px; }
.rem-list { max-height: 300px; overflow-y: auto; padding: 0 18px; display: flex; flex-direction: column; gap: 6px; }
.rem-item { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 9px; background: #FBFAF7; border: 1px solid var(--line); }
.rem-item.done { opacity: .5; }
.rem-item.done .rem-text { text-decoration: line-through; }
.rem-item .rem-time { font-weight: 800; color: var(--navy); font-size: 14px; white-space: nowrap; }
.rem-item .rem-text { flex: 1; font-size: 14px; line-height: 1.5; }
.rem-item .rem-stu { color: var(--navy); font-size: 12.5px; }
.rem-late { font-size: 11px; font-weight: 700; color: var(--c-red-fg); background: var(--c-red-bg); border-radius: 6px; padding: 2px 7px; white-space: nowrap; }
.rem-actions { display: flex; justify-content: flex-end; gap: 7px; padding: 14px 18px 6px; }
.rem-foot { padding: 0 18px 14px; font-size: 11.5px; color: var(--muted); line-height: 1.5; }

/* 면접 통합 3열 */
.itv-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.itv-col { background: #FBFAF7; border-radius: 8px; padding: 10px 12px; }
.itv-label { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }

@media (max-width: 720px) {
  .dash-2col { grid-template-columns: 1fr; gap: 10px; margin-bottom: 12px; }
  .itv-cols { grid-template-columns: 1fr; }
  .cb-focus-grid { grid-template-columns: 1fr; }
  .cb-now { font-size: 22px; }
  /* 모바일: 오늘 5장은 3+2, N월은 2열, 여백 줄이고 라벨 또렷하게 */
  .dash-overview { gap: 8px; margin-bottom: 12px; }
  .dash-overview-left { gap: 8px; }
  .kpi-row { gap: 7px; }
  .kpi-row.four { grid-template-columns: repeat(2, 1fr); }
  .kpi-row.five { grid-template-columns: repeat(3, 1fr); }
  .kpi-row + .kpi-row { margin-top: 7px; }
  .kpi { padding: 9px 6px; }
  .kpi-label { font-size: 12px; color: var(--ink); font-weight: 800; }
  .kpi-num { font-size: 22px; }
  .kpi-sub { font-size: 10.5px; }
  .kpi.clickable::after { top: 5px; right: 7px; }
  .dash-panel { padding: 12px 13px; margin-bottom: 12px; }
  .stat-section { margin-bottom: 10px; }
  .rate-card .rate-grid { gap: 6px; }
  .rate-item { padding: 8px 6px; }
}

/* 🔎 광고비 기간 조회 */
.kw-spend-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.kw-spend-form select, .kw-spend-form input[type="date"] { padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; }
.kw-spend-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0; }
.kw-spend-stat { background: #FBFAF7; border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; min-width: 130px; }
.kw-spend-stat span { display: block; font-size: 11.5px; color: var(--muted); }
.kw-spend-stat b { font-size: 16px; }
.kw-spend-prod { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.kw-spend-tbl-wrap { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.kw-spend-comp { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.kw-spend-advice { font-size: 12.5px; margin: 3px 0; }

/* 등록금 모드 배지 */
.tui-badge { background: #E6F4EA; color: #137333; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 10px; }

/* 보고서 화면 비교표 + 연도별 실적 색상 */
.rep-table.cmp-screen th { font-size: 11.5px; padding: 5px 4px; }
.rep-table.cmp-screen td { font-size: 12px; text-align: center; }
.rep-table .cell-green { color: #137333; font-weight: 700; }
.rep-table .cell-red { color: #C5221F; font-weight: 700; }
/* 접수·면접·등록·비율 그룹 구분선 — 확실하게 */
.rep-table.cmp-screen th.cmp-sep, .rep-table.cmp-screen td.cmp-sep { border-left: 3px solid var(--navy, #1F2A44); }

/* 대시보드 상단 + 데이터 갱신 */
.dash-top { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 10px; }
.sync-box { display: flex; align-items: center; gap: 8px; }
.sync-info { font-size: 12px; color: var(--muted); }
.dash-sync-inline { color: var(--muted); font-size: 13px; margin-left: 6px; }
@media (max-width: 720px) { .dash-top { flex-direction: column; } .sync-box { width: 100%; } }

/* 현황 섹션 (이번달/전체 두 줄) */
.stat-section { margin-bottom: 14px; }
.stat-title { font-size: 13.5px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.stat-sub { font-size: 11.5px; font-weight: 400; color: var(--muted); }
.stat.clickable { cursor: pointer; transition: transform .1s; }
.stat.clickable:hover { transform: translateY(-2px); box-shadow: 0 3px 10px rgba(0,0,0,.1); }
.stat .slabel { white-space: nowrap; }

/* 명단 팝업 */
.picklist { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow-y: auto; }
.picklist-item { display: flex; justify-content: space-between; align-items: center; padding: 11px 12px; border-radius: 8px; background: #FBFAF7; cursor: pointer; }
.picklist-item:hover { background: #F4F7FB; }
.picklist-item .nm { font-weight: 600; }
.picklist-item .muted { font-size: 12px; color: var(--muted); }

/* 알림 무시 버튼 */
.alert-dismiss { width: 22px; height: 22px; border: 0; background: transparent; color: #bbb; font-size: 13px; cursor: pointer; flex-shrink: 0; }
.alert-dismiss:hover { color: #C5221F; }

/* 목표 진척 게이지 */
.goal-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(20, 24, 40, .04); display: flex; flex-direction: column; justify-content: center; }
.goal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; flex-wrap: wrap; gap: 6px; }
.goal-title { font-size: 14px; font-weight: 700; }
.goal-num { font-size: 14px; color: var(--muted); }
.goal-num b { font-size: 20px; color: var(--navy); }
.goal-pct { color: #137333; font-weight: 700; }
.goal-edit { border: 0; background: transparent; cursor: pointer; font-size: 13px; margin-left: 4px; }
.goal-bar { height: 14px; background: #EEF1F8; border-radius: 8px; overflow: hidden; }
.goal-fill { height: 100%; background: linear-gradient(90deg, #2B6CB0, #137333); border-radius: 8px; transition: width .4s; }

/* 활동 타임라인 */
.tl-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid #F0F0F0; }
.tl-item:last-child { border-bottom: 0; }
.tl-icon { font-size: 16px; flex-shrink: 0; width: 22px; text-align: center; }
.tl-body { flex: 1; min-width: 0; }
.tl-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.tl-time { color: var(--muted); font-size: 12px; flex-shrink: 0; }
.tl-memo { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: pre-wrap; word-break: break-word; }

/* 할 일 완료 표시 + 단계 수동 변경 */
.todo-donemark { font-size: 11px; color: #137333; margin-left: 4px; }
.todo-due.nodate { background: transparent; color: #bbb; }
.btn.xs { font-size: 11px; padding: 2px 8px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; }
/* 위 .btn.xs 가 .btn.primary 배경을 덮어 흰 글씨가 안 보이던 문제 — 색 명시로 복구 */
.btn.xs.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.xs.primary:hover { background: var(--navy-deep); }
.btn.xs.pink { background: var(--pink); border-color: var(--pink); color: #fff; }
.manual-tag { font-size: 11px; background: #FEF3D9; color: #A6760B; padding: 2px 7px; border-radius: 9px; font-weight: 700; }
.auto-tag { font-size: 11px; background: #EEF1F4; color: #7A8694; padding: 2px 7px; border-radius: 9px; font-weight: 700; }
/* 발송내역 공통 컴포넌트 */
.send-log { margin-top: 4px; }
.slog-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.slog-summary { display: flex; gap: 6px; flex-wrap: wrap; }
.slog-stat { font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); }
.slog-stat.ok { background: #E6F4EA; color: #137333; border-color: #C5E8D1; }
.slog-stat.fail { background: #FCE8E6; color: #C5221F; border-color: #F6D6D2; }
.slog-stat.wait { background: #EAF1FC; color: #1A56C4; border-color: #D6E4FB; }
.slog-stat.warn { background: #FFF6E8; color: #8A5A0B; border-color: #F2E4C0; }
.slog-search { flex: 1; min-width: 160px; margin-left: auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.slog-group { margin-bottom: 10px; }
.slog-date { font-size: 12px; font-weight: 700; color: var(--muted); margin: 6px 0 4px; }
.slog-row { display: block; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 6px; cursor: pointer; }
.slog-row:hover { border-color: var(--navy); }
.slog-row.is-fail { border-left: 4px solid var(--c-red-fg); background: #FEF7F6; }
.slog-line1 { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.slog-title { display: inline-flex; align-items: center; max-width: 360px; padding: 2px 7px; border-radius: 999px; background: #EEF3FF; color: #3153A5; font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slog-name { font-size: 14.5px; }
.slog-type { font-size: 12.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; border: 1px solid transparent; }
.slog-type.st-gray { color: var(--navy); background: #EAF1FB; border-color: #D6E4FB; }
.slog-type.st-green { color: #137333; background: #E6F4EA; border-color: #C5E8D1; }
.slog-type.st-red { color: #C5221F; background: #FCE8E6; border-color: #F6D6D2; }
.slog-type.st-blue { color: #1A56C4; background: #E7EEFB; border-color: #D6E4FB; }
.slog-type.st-amber { color: #8A5A0B; background: #FFF6E8; border-color: #F2E4C0; }
.slog-type.st-teal { color: #0E6B52; background: #DFF2EB; border-color: #BFE6D8; }
.slog-time { margin-left: auto; color: var(--muted); font-size: 12px; }
.slog-line2 { margin-top: 3px; font-size: 12.5px; color: var(--muted); word-break: break-all; }
.slog-ch { font-weight: 600; color: #555; }
.slog-stat.cost { background: #F1F3F7; color: #44495A; border-color: var(--line); }
.slog-types { display: flex; flex-wrap: wrap; gap: 5px; width: 100%; }
.slog-typecount { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 7px; border: 1px solid transparent; }
.slog-typecount.st-gray { color: var(--navy); background: #EAF1FB; }
.slog-typecount.st-green { color: #137333; background: #E6F4EA; }
.slog-typecount.st-red { color: #C5221F; background: #FCE8E6; }
.slog-typecount.st-blue { color: #1A56C4; background: #E7EEFB; }
.slog-typecount.st-amber { color: #8A5A0B; background: #FFF6E8; }
.slog-typecount.st-teal { color: #0E6B52; background: #DFF2EB; }
.slog-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; width: 100%; }
.slog-tools .slog-search { flex: 1; min-width: 140px; margin-left: 0; }
.slog-toggle { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); }
.slog-csv { text-decoration: none; }
/* 누락 의심 목록 */
.gap-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid #F6D6D2; background: #FEF7F6; border-radius: 9px; margin-bottom: 6px; }
.gap-name { background: none; border: 0; font-weight: 700; color: var(--navy); cursor: pointer; text-decoration: underline; font-size: 14px; }
.gap-date, .gap-template, .gap-last { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 7px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #FFF8E6; color: #8B5E00; }
.gap-template { background: #EEF3FF; color: #3153A5; }
.gap-last { background: #F1F4F8; color: #5F6673; }
.gap-reason { margin-left: auto; font-size: 12.5px; font-weight: 700; color: #C5221F; }
.gap-actions { display: inline-flex; align-items: center; gap: 6px; }
/* ===== 네이버 키워드 순위 패널 (카드형) ===== */
.kw-panel { margin-top: 4px; }
.kw-panel .section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.kw-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kw-topn { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.kw-topn input { width: 54px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 7px; font: inherit; }
.kw-foot { margin-top: 10px; font-size: 11.5px; color: var(--muted); text-align: right; }

/* 2×2 정렬: 1열=학원(주요·상위), 2열=학교(주요·상위) → 개수 달라도 행이 맞음 */
.kw-grid { display: grid; gap: 14px; margin-top: 12px; align-items: start; }
.kw-grid.two { grid-template-columns: 1fr 1fr; }
/* 나란히 2장 (전략 카드용) — .two의 nth-child 고정배치를 쓰면 2장이 왼쪽에 세로로 쌓이므로 별도 클래스 */
.kw-grid.duo { grid-template-columns: 1fr 1fr; }
.kw-grid.two > .kw-card:nth-child(1) { grid-column: 1; grid-row: 1; }
.kw-grid.two > .kw-card:nth-child(2) { grid-column: 1; grid-row: 2; }
.kw-grid.two > .kw-card:nth-child(3) { grid-column: 2; grid-row: 1; }
.kw-grid.two > .kw-card:nth-child(4) { grid-column: 2; grid-row: 2; }
.kw-grid.one { grid-template-columns: 1fr; }

.kw-card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden;
  box-shadow: 0 1px 2px rgba(20, 24, 40, .05); display: flex; flex-direction: column; }
.kw-card-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.kw-card.is-pinned .kw-card-head { background: linear-gradient(180deg, #FFF8E8, #FFF3D6); border-bottom-color: #F0DDA8; }
.kw-card.is-top .kw-card-head { background: linear-gradient(180deg, #F0F4FF, #E6EDFF); border-bottom-color: #CFDBFA; }
.kw-brand { font-weight: 800; font-size: 12.5px; letter-spacing: -.2px; }
.kw-brand.academy { color: #1B4F9C; }
.kw-brand.school { color: #A22C6E; }
.kw-sec { font-weight: 800; font-size: 11.5px; }
.kw-card.is-pinned .kw-sec { color: #9A6700; }
.kw-card.is-top .kw-sec { color: #2D4ECC; }
.kw-cnt { margin-left: auto; background: rgba(255,255,255,.7); border: 1px solid rgba(0,0,0,.08); border-radius: 10px;
  padding: 1px 9px; font-size: 11px; font-weight: 800; color: #555; }
.kw-empty { padding: 18px 14px; font-size: 12.5px; color: var(--muted); text-align: center; }

.kw-tbl-wrap { overflow-x: auto; }
.kw-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.kw-table th { font-size: 10.5px; font-weight: 700; color: var(--muted); padding: 7px 8px; background: #FBFAF7;
  border-bottom: 1px solid var(--line); white-space: nowrap; text-align: center; }
.kw-table td { padding: 7px 8px; border-bottom: 1px solid #F2F0EA; text-align: center; }
.kw-table tbody tr:last-child td { border-bottom: 0; }
.kw-table tbody tr:nth-child(even) td { background: #FCFBF9; }
.kw-table tbody tr:hover td { background: #F4F7FF; }
.kw-table th.c-kw, .kw-table td.c-kw { text-align: left; }
.kw-table th.c-num, .kw-table td.c-num { text-align: right; }
.kw-table .c-kw { font-weight: 600; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kw-table .c-num { font-variant-numeric: tabular-nums; color: #2A2E37; white-space: nowrap; }
.kw-table .c-rank { width: 30px; }
.kw-table .c-brand { white-space: nowrap; }
.kw-table th.c-brand { white-space: normal; min-width: 44px; line-height: 1.25; }

/* 조회수 순위 번호 (1·2·3위 메달) */
.kw-no { display: inline-block; min-width: 20px; height: 20px; line-height: 20px; padding: 0 4px; border-radius: 6px;
  font-size: 11px; font-weight: 800; color: #6F7480; background: #EFEEEA; }
.kw-no.m1 { background: linear-gradient(180deg, #FFDD77, #F2B300); color: #5A3D00; }
.kw-no.m2 { background: linear-gradient(180deg, #E7EBF1, #C7CED8); color: #39414D; }
.kw-no.m3 { background: linear-gradient(180deg, #F3CB9E, #DFA168); color: #54310F; }

.kw-price { color: #5A5E66; }

/* 브랜드 순위 알약 — 그 행에서 세 학교 중 등수로 색: 1등 파랑·2등 노랑·3등 회색. 숫자 크게. */
.kw-rk { display: inline-block; min-width: 30px; padding: 3px 8px; border-radius: 8px;
  font-size: 15px; font-weight: 800; line-height: 1.15; }
.kw-rk.p0 { font-size: 13px; color: #B4B1AB; background: transparent; font-weight: 700; }   /* 미노출(-) */
.kw-rk.p1 { background: #DBE8FF; color: #0B47B0; }   /* 1등 파랑 */
.kw-rk.p2 { background: #FFF1BF; color: #876200; }   /* 2등 노랑 */
.kw-rk.p3 { background: #EAE9E5; color: #5A5E66; }   /* 3등 회색 */
.kw-gap { display: block; margin-top: 2px; font-size: 10.5px; font-weight: 800; color: #C5221F; white-space: nowrap; }

@media (max-width: 820px) {
  .kw-grid.two, .kw-grid.duo { grid-template-columns: 1fr; }
  .kw-grid.two > .kw-card { grid-column: 1 !important; grid-row: auto !important; }
}
/* 키워드 설정 모달 */
.kw-set-sec { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.kw-set-lbl { display: block; font-weight: 700; font-size: 13.5px; margin-bottom: 8px; }
.kw-pick-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.kw-pick-tabs .btn.on { background: var(--ink, #1f2a44); color: #fff; }
.kw-pick-search { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; margin-bottom: 8px; }
.kw-pick-list { max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; }
.kw-pick-item { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 3px 4px; border-radius: 6px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kw-pick-item:hover { background: #F4F6F8; }
.kw-last { margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.kw-last-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; font-size: 12.5px; }
.kw-last-row:nth-child(odd) { background: #FAFAF8; }
.modal-actions { display: flex; gap: 8px; margin-top: 10px; }
@media (max-width: 560px) { .kw-pick-list { grid-template-columns: 1fr; } }
.slog-failr { margin-top: 3px; font-size: 12px; color: var(--c-red-fg); font-weight: 600; }
.src-badge { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 6px; }
.src-badge.auto { background: #E7EEFB; color: #1A56C4; }
.src-badge.direct { background: #E9F6EE; color: #137333; }
.src-badge.manual { background: #FEF3D9; color: #A6760B; }
.src-badge.external { background: #EDE7F6; color: #5B3DA6; }
.slog-lastimport { font-size: 11.5px; color: var(--muted); margin: -4px 0 8px; }
/* 알림톡 수신불가 경고 */
.atblock-badge { display: inline-block; background: #FBE7E7; color: #A03030; border: 1px solid #F0C9C9;
  font-size: 11.5px; font-weight: 800; padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.risk-badge { display: inline-block; background: #FDEBD0; color: #9A4A00; border: 1px solid #F1C996;
  font-size: 11.5px; font-weight: 800; padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.ds-found.warn { margin-top: 6px; background: #FFF6E8; border: 1px solid #F2E4C0; color: #8A5A0B;
  padding: 8px 11px; border-radius: 8px; font-size: 13px; }
/* 대시보드 알림톡 불가 알림 배너 */
.atblock-notice { display: block; width: 100%; text-align: left; cursor: pointer; margin-bottom: 14px;
  background: #FFF6E8; border: 1px solid #F2E4C0; color: #7A4F08; border-radius: 10px; padding: 11px 14px; font-size: 13.5px; }
.atblock-notice:hover { background: #FCEFD3; }
.atblock-notice .atblock-more { color: #A6760B; font-weight: 700; }
.atblock-ic { font-size: 12px; }
.atblock-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.atblock-name[data-id] { cursor: pointer; }
.atblock-name[data-id]:hover { text-decoration: underline; }
.atblock-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.atblock-clear { white-space: nowrap; }
/* 날짜+시·분 입력 묶음 (달력 + 드롭다운) */
.dt-row { display: inline-flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.dt-row .dt-date { min-width: 132px; }
.time-sel { padding: 6px 6px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 13px; cursor: pointer; }
/* 과거 수정내역 모달 */
.hist-scroll { max-height: 330px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.hist-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.hist-row:last-child { border-bottom: 0; }
.hist-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.hist-info .when { color: var(--muted); font-size: 12px; white-space: nowrap; }
.hist-info b { font-size: 13px; }
.hist-revert { flex: none; background: #1f6feb; color: #fff; border: 1px solid #1f6feb; font-weight: 700; }
.hist-revert:hover { background: #1a5fd0; color: #fff; }
.hist-cant { flex: none; background: #F1F1F1; color: #999; border: 1px solid var(--line); cursor: default; }
/* 마감 변경이력 */
.deadline-hist { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.deadline-hist-h { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 5px; }
.deadline-hist-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 3px 0; font-size: 13px; }
.deadline-hist-row .hint { font-size: 11px; }
.finance-summary {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  margin: 8px 0 10px;
}
.finance-summary > div {
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #FBFAF7;
}
.finance-summary span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.finance-summary b { font-size: 16px; color: var(--navy); }
.finance-summary .finance-calc {
  grid-column: 1 / -1; font-size: 12.5px; color: var(--ink); background: #F5F8FC;
}
.finance-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
}
.finance-card {
  border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fff;
}
.finance-card h4 { margin: 0 0 9px; font-size: 13px; color: var(--navy); }
.finance-field { display: grid; gap: 4px; margin-top: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.finance-field input, .finance-field select, .finance-field textarea {
  width: 100%; min-width: 0; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 7px; font: inherit; color: var(--ink); background: #fff;
}
.finance-field textarea { resize: vertical; min-height: 84px; }
.finance-source {
  display: grid; gap: 2px; border-radius: 8px; padding: 8px 10px; margin-bottom: 8px;
  font-size: 12px; border: 1px solid var(--line);
}
.finance-source.fixed { background: var(--c-blue-bg); color: var(--c-blue-fg); }
.finance-source.crm { background: var(--c-green-bg); color: var(--c-green-fg); }
.finance-source span { font-weight: 600; opacity: .88; }
.finance-readonly {
  margin-top: 10px; padding: 9px 10px; border-radius: 8px; background: #F6F7F9;
  display: grid; gap: 2px; font-size: 12px;
}
.finance-readonly span { color: var(--muted); font-weight: 700; }
.finance-actions {
  display: flex; align-items: end; gap: 8px; margin-top: 10px;
}
.finance-actions .finance-reason { flex: 1; margin-top: 0; }
.finance-actions .req { color: var(--c-red-fg); font-size: 11px; }
.finance-history .deadline-hist-row { border-bottom: 1px dashed rgba(0,0,0,.08); padding: 6px 0; }
.finance-history .deadline-hist-row:last-child { border-bottom: 0; }
@media (max-width: 760px) {
  .finance-summary, .finance-grid { grid-template-columns: 1fr; }
  .finance-actions { align-items: stretch; flex-direction: column; }
  .finance-actions .btn { width: 100%; }
}
/* 목록 더보기 (7개 초과 시 펼치기) */
.sm-hidden { display: none !important; }
.show-more-btn { display: block; width: 100%; margin-top: 6px; background: #F6F7F9; color: var(--muted); border: 1px dashed var(--line); }
.show-more-btn:hover { background: #EEF1F4; }
/* 정보 섹션 헤더의 '내역' 버튼 */
.sec-hist-btn { float: right; }
.stage-picker { display: flex; flex-wrap: wrap; gap: 7px; }
.stage-pick { border: 0; padding: 7px 13px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; }
.stage-pick.gray { background: #ECEFF3; color: #555; }
.stage-pick.amber { background: #FEF3D9; color: #A6760B; }
.stage-pick.blue { background: #E3ECFD; color: #1A56C4; }
.stage-pick.teal { background: #D7F0EE; color: #0B7B8C; }
.stage-pick.green { background: #E6F4EA; color: #137333; }
.stage-pick.red { background: #FCE8E6; color: #C5221F; }
.stage-pick:hover { outline: 2px solid var(--navy); }

/* 과년도 학기별 표 */
.yearly-table .sem-sub td { background: #FBFAF7; font-size: 12px; color: #555; }
.yearly-table .sem-sub .sem-name { padding-left: 16px; }
.yearly-table .year-total td { background: #EEF2FB; border-top: 2px solid #C9CEDC; }

/* 접수(accent)는 0이어도 흐려지지 않음 */
.stat.accent.zero { opacity: 1; }

/* 예정된 할 일 */
.upcoming-head { font-size: 12px; font-weight: 700; color: var(--muted); margin: 12px 0 6px; padding-top: 10px; border-top: 1px dashed var(--line); }
.todo-item.upcoming { background: #FBFAF7; border-radius: 8px; margin-bottom: 3px; }
.todo-dday { font-size: 11px; font-weight: 700; color: #A6760B; background: #FEF3D9; padding: 2px 8px; border-radius: 9px; flex-shrink: 0; }

/* 상담 기록 */
.consult-entry-panel .dash-h { margin-bottom: 10px; }
/* 플렉스 래핑: 좁은 화면에서 넘치거나 세로로 흩어지지 않게. 날짜+시+분은 한 묶음(nowrap)으로 유지. */
.consult-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.consult-form select, .consult-form input, .consult-form textarea {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font: inherit;
  font-size: 14px;
  background: #fff;
}
/* 최상위 직접 자식만 플렉스 크기 지정 (dt-row 안의 컨트롤은 제외) */
.consult-form > select { flex: 0 1 110px; min-width: 92px; }
.consult-form > input  { flex: 1 1 150px; min-width: 0; }
.consult-form > button { flex: 0 0 auto; }
.consult-form .dt-row {
  flex: 1 1 220px; min-width: 0;
  display: flex; flex-wrap: nowrap; gap: 6px; align-items: center;
}
.consult-form .dt-row .dt-date { flex: 1 1 110px; min-width: 0; }
.consult-form .dt-row .time-sel { flex: 0 0 auto; }
.consult-form textarea {
  flex: 1 1 100%; width: 100%;
  min-height: 132px; line-height: 1.55; resize: vertical;
}
.consult-form.edit textarea { min-height: 170px; }
.consult-table td { font-size: 13px; vertical-align: top; }
.consult-actions { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; }
.consult-search input { max-width: 420px; }

.aligo-cards {
  display: none; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin: 14px 22px;
}
.aligo-cards .stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 14px 16px; min-height: 90px;
}
.aligo-cards .stat span { display: block; color: var(--muted); font-size: 12.5px; }
.aligo-cards .stat b { display: block; margin-top: 5px; font-size: 24px; color: var(--navy-deep); }
.aligo-cards .stat small { display: block; margin-top: 4px; color: var(--muted); }
.aligo-panel { margin: 14px 22px; }
.aligo-panel textarea {
  width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 8px;
  line-height: 1.55; font-family: inherit; resize: vertical;
}
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.form-row.compact { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.form-row.compact input { width: 220px; max-width: 100%; }
.aligo-remain-panel { margin: 14px 22px; }
.aligo-remain-panel.compact { margin: 12px 0; }
.remain-summary { display: grid; grid-template-columns: minmax(180px, 1.1fr) minmax(180px, 1fr) minmax(240px, 1.6fr); gap: 10px; align-items: stretch; }
.remain-main, .remain-sub, .remain-quick { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 12px 14px; }
.remain-main span, .remain-sub span { display: block; font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.remain-main b { color: var(--c-red-fg); font-size: 24px; }
.remain-sub b { color: var(--c-red-fg); font-size: 18px; }
.remain-sub em { display: inline-block; margin-left: 8px; border: 1px solid var(--line); border-radius: 7px; padding: 2px 8px; font-style: normal; font-size: 12px; color: var(--ink); }
.remain-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.remain-quick span { display: inline-flex; gap: 5px; align-items: center; border-radius: 999px; background: #F4F8FF; color: var(--navy); padding: 5px 9px; font-size: 12.5px; font-weight: 700; }
.remain-detail { display: grid; grid-template-columns: repeat(6, minmax(110px, 1fr)); gap: 8px; margin-top: 10px; }
.remain-detail div { border: 1px solid var(--line); background: #FBFAF7; border-radius: 8px; padding: 10px; text-align: center; }
.remain-detail span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.remain-detail b { color: var(--ink); font-size: 16px; }
.local-history-scroll { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.local-history-scroll .qtable { border: 0; border-radius: 0; }
.local-message-history th { position: sticky; top: 0; z-index: 1; }
.local-message-history small, .fail-reason { color: var(--muted); font-size: 11.5px; }
.local-message-history .fail-reason { color: var(--c-red-fg); }
.aligo-history .msg { max-width: 480px; }
.consult-content { white-space: pre-wrap; word-break: break-word; max-width: 360px; color: #444; }
.ckind { font-size: 12px; font-weight: 700; white-space: nowrap; }
.ckind.call { color: #1A56C4; }
.ckind.visit { color: #137333; }
.ckind.kakao { color: #A6760B; }
.ckind.admission { color: #7B2FBE; }
.consult-detail summary { cursor: pointer; color: #444; list-style: revert; }
.consult-detail summary:hover { color: #1A56C4; }
.consult-detail .consult-full { white-space: pre-wrap; word-break: break-word; margin-top: 4px; padding: 6px 8px; background: #F5F6FA; border-radius: 6px; font-size: 12px; }

/* 할 일 박스 분리 */
.todo-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; background: #fff; }
.todo-box-head { font-size: 13px; font-weight: 700; color: #2B2B40; margin-bottom: 8px; }
.todo-box-head .box-hint { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.routine-box { background: #F4F8FF; border-color: #D6E4FB; }
.upcoming-box { background: #FBFAF7; border-color: #F0E8D8; }

/* 정규 스케줄 카드 헤더의 [관리] 버튼 — 오른쪽 정렬 */
.todo-box-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.todo-box-head .box-hint { margin-left: 0; }
.rt-mgr-btn { margin-left: auto; font-weight: 600; }

/* 공지사항 — 항상 기억할 메모 (따뜻한 노랑 톤) */
.notice-box { background: #FFFDF3; border-color: #F1E4B8; }
.notice-list { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow-y: auto; }
.notice-item { display: flex; align-items: flex-start; gap: 7px; padding: 9px 11px; border-radius: 9px;
  background: #fff; border: 1px solid #F0E4BE; box-shadow: 0 1px 2px rgba(120,90,0,.05); }
.notice-item.pinned { background: #FFF8E1; border-color: #F0CE6A; box-shadow: 0 1px 3px rgba(180,140,10,.14); }
.notice-pin { flex-shrink: 0; width: 22px; height: 22px; border: none; border-radius: 6px; background: transparent;
  color: #C9B24A; font-size: 14px; cursor: pointer; line-height: 1.4; padding: 0; transition: transform .1s; }
.notice-pin:hover { transform: scale(1.2); }
.notice-pin.on { color: #E8A200; }
.notice-text { flex: 1; font-size: 13.5px; line-height: 1.55; color: #4A3D14; white-space: pre-wrap; word-break: break-word; font-weight: 600; }
.notice-item.pinned .notice-text { color: #3D3208; }
.notice-del { flex-shrink: 0; width: 22px; height: 22px; border: none; border-radius: 6px; background: transparent;
  color: #B9A24A; font-size: 14px; cursor: pointer; line-height: 1; transition: background .1s, color .1s; }
.notice-del:hover { background: #FBEBEB; color: #C5221F; }
.notice-box .todo-add { margin-bottom: 8px; }

/* ---------- 데이터 백업 카드 (현재 데이터 요약 + 지금 백업 + 이력 접기) ---------- */
.bk-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: #FAFCFF;
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.bk-summary { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.bk-stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px;
  font-size: 12.5px; color: var(--muted); font-weight: 600; }
.bk-stat b { display: block; font-size: 21px; font-weight: 800; color: var(--navy-deep); line-height: 1.1; }
.btn.bk-now { font-size: 15px; font-weight: 800; padding: 12px 30px; border-radius: 10px; }
.bk-note { font-size: 12px; color: var(--muted); line-height: 1.6; max-width: 560px; }
.bk-today { width: 100%; margin-top: 4px; padding-top: 12px; border-top: 1px dashed var(--line); }
.bk-today-h { font-size: 12.5px; font-weight: 700; color: #2B2B40; margin-bottom: 7px; }
.bk-today .backup-files { justify-content: center; }
.bk-history { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.bk-history > summary { cursor: pointer; padding: 11px 14px; font-size: 13px; font-weight: 700; color: #2B2B40;
  background: #F7F9FC; list-style: none; user-select: none; }
.bk-history > summary::-webkit-details-marker { display: none; }
.bk-history > summary::before { content: '▸ '; color: var(--muted); }
.bk-history[open] > summary::before { content: '▾ '; }
.bk-history .backup-list { padding: 4px 14px 12px; }
.backup-day { padding: 9px 0; border-top: 1px solid var(--line); }
.backup-day:first-child { border-top: none; }
.backup-files { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }

/* 발송 실패 시 관리자 문자 알림 옵션 */
.fail-sms-opt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 10px 0;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #FAFCFF; }
.fail-sms-opt #failSmsPhone { padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; width: 240px; max-width: 100%; }

/* 자동발송 내역 알림 (대시보드) — 확인하면 당일 취소선, 다음날 사라짐 */
.autosend-box { border: 1px solid #D6E4FB; background: #F4F8FF; border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.autosend-head { font-size: 13.5px; font-weight: 700; color: #1A3A6B; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.autosend-head .cnt { background: #1A56C4; color: #fff; font-size: 12px; border-radius: 10px; padding: 1px 8px; }
.autosend-head .box-hint { font-size: 11px; font-weight: 400; color: var(--muted); }
.autosend-head .autosend-bulk { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: #1A3A6B; }
.autosend-head .autosend-bulk label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.autosend-item .autosend-sel { margin: 0 4px 0 0; flex: none; cursor: pointer; }
.autosend-list { display: flex; flex-direction: column; gap: 5px; max-height: 260px; overflow-y: auto; }
.autosend-item { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 8px; background: #fff; border: 1px solid #E3ECFD; }
.autosend-item.acked { opacity: .55; }
.autosend-item.acked .autosend-text b { text-decoration: line-through; }
.autosend-chk { flex-shrink: 0; width: 24px; height: 24px; border: 1px solid #C7D8F5; border-radius: 6px; background: #fff; color: #1A56C4; font-size: 13px; cursor: pointer; line-height: 1; transition: background .1s; }
.autosend-chk:hover { background: #EAF1FC; }
.autosend-text { flex: 1; min-width: 0; font-size: 13px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.autosend-text[data-ipsi] { cursor: pointer; }
.autosend-text[data-ipsi]:hover b { text-decoration: underline; }
.autosend-type { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 7px; }
.autosend-ch { font-size: 11px; color: var(--muted); }
.autosend-time { flex-shrink: 0; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.rt-badge { font-size: 11px; font-weight: 700; color: #1A56C4; background: #E3ECFD; padding: 1px 6px; border-radius: 8px; }
.todo-item.routine { background: transparent; }

/* 정규 스케줄 관리 모달 */
.routine-add { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.routine-add input { flex: 1; min-width: 140px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; }
.routine-add select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; }
.routine-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; }
.routine-row.off { opacity: .5; }
.routine-row .rt-content { flex: 1; font-size: 14px; }
.routine-row .rt-days { font-size: 12px; color: #1A56C4; background: #E3ECFD; padding: 2px 9px; border-radius: 9px; font-weight: 600; }

/* 학생목록 단계 셀 클릭 가능 */
.stage-cell { cursor: pointer; }
.stage-cell:hover { background: #F0F4FF; }
.manual-dot { font-size: 11px; }

/* 템플릿 자동/수동 배지 + 옵션 */
.pill.mode-auto { background: #E6F4EA; color: #137333; }
.pill.mode-manual { background: #FEF3D9; color: #A6760B; }
.tpl-opts { display: flex; gap: 16px; flex-wrap: wrap; margin: 8px 0; align-items: flex-end; }
.tpl-opts .tpl-opt { flex: 1 1 180px; min-width: 0; }
.tpl-opts input, .tpl-opts select { width: 100%; }

/* ---------- 모바일 폭 안정화 ---------- */
/* overflow-x: clip 은 hidden 과 달리 스크롤 컨테이너를 만들지 않아 상단바(.topbar)의
   position:sticky 를 깨지 않으면서 가로 넘침을 막습니다. (hidden 으로 두면 데스크탑에서 메뉴가 고정 안 됨) */
html, body { max-width: 100%; overflow-x: clip; }
.view { width: min(100%, 1200px); }
.dash-panel, .card, .tpl-group, .rule { max-width: 100%; }
.rule-edit-form label { display: block; margin: 10px 0 5px; font-size: 12.5px; color: var(--muted); }
.rule-edit-form input, .rule-edit-form select, .rule-edit-form textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font: inherit;
}
.rule-helper { margin-top: 6px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #F7FAFC; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.rule-radio-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rule-radio { display: grid !important; grid-template-columns: auto 1fr; gap: 4px 8px; align-items: start; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #fff; color: var(--ink) !important; }
.rule-radio input { width: auto; margin-top: 2px; }
.rule-radio b { font-size: 13px; }
.rule-radio span { grid-column: 2; color: var(--muted); font-size: 12px; line-height: 1.35; }
.rule-radio.on { border-color: var(--navy); background: #F4F8FF; }
.rule-time-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.rule-enabled { display: inline-flex !important; align-items: center; gap: 8px; width: auto !important; margin-top: 12px !important; color: var(--ink) !important; font-weight: 700; }
.rule-enabled input { width: auto !important; margin: 0; }
.rule-enabled span { color: var(--muted); font-size: 12px; font-weight: 500; }
.ds-sms-options { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #FBFAF7; }

@media (max-width: 760px) {
  .view { padding-left: 14px; padding-right: 14px; overflow-x: hidden; }
  .toolbar { flex-wrap: wrap; align-items: stretch; }
  .toolbar .hint { flex-basis: 100%; }
  .toolbar .btn { flex: 1 1 calc(50% - 8px); min-height: 42px; white-space: normal; }
  .aligo-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dash-panel.aligo-panel { padding: 12px; }
  .aligo-remain-panel { margin: 12px 0; }
  .remain-summary { grid-template-columns: 1fr; }
  .remain-detail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .local-history-scroll { max-height: 360px; }
  .tpl-group { border-radius: 10px; overflow: hidden; }
  .tpl-group .ghead { flex-wrap: wrap; padding: 12px; }
  .tpl-ver { display: grid; grid-template-columns: 26px 38px minmax(0, 1fr); gap: 8px; align-items: start; padding: 12px; }
  .tpl-ver .vname { min-width: 0; word-break: keep-all; overflow-wrap: anywhere; line-height: 1.55; }
  .tpl-meta { white-space: normal; word-break: keep-all; overflow-wrap: anywhere; }
  .tpl-ver .tpl-status { justify-self: start; }
  .tpl-ver .btn { min-width: 0; width: auto; padding: 7px 9px; white-space: normal; }
  .tpl-ver > .tpl-status,
  .tpl-ver > .btn { grid-column: 3; }
  .auto-rule { display: block; padding: 14px; }
  .auto-template-row { align-items: stretch; }
  .auto-tpl-select { flex-basis: 100%; width: 100%; min-width: 0; max-width: 100%; }
  .slog-title { max-width: 100%; }
  .gap-reason { margin-left: 0; }
  .gap-actions { width: 100%; justify-content: flex-end; }
  .auto-template-row .btn,
  .auto-template-row .tpl-peek { flex: 1 1 auto; text-align: center; }
  .switch { margin-top: 10px; }
  .rule-switch {
    width: 100%; min-width: 0; justify-content: flex-end; margin-top: 12px; padding-top: 10px;
    border-top: 1px solid var(--line);
  }
  .rule-switch .switch-state { min-width: 68px; text-align: right; font-size: 13px; }
  .form-row { align-items: stretch; }
  .form-row input, .form-row select, .form-row textarea, .form-row .grow { flex-basis: 100%; width: 100% !important; }
  .modal-back { padding: 10px; align-items: flex-start; }
  .modal-back .modal, .tpl-modal { width: 100%; min-width: 0; max-width: 100%; max-height: 92vh; resize: none; }
  .tpl-edit { grid-template-columns: 1fr; gap: 12px; }
  .tpl-opts { gap: 8px; }
  .tpl-body-editor { grid-template-columns: 1fr; }
  .tpl-body-editor textarea { min-height: 280px; }
  .tpl-special-panel { max-height: 220px; }
  .tpl-fallback-grid { grid-template-columns: 1fr; }
}
.tpl-opt { display: flex; flex-direction: column; gap: 3px; }
.tpl-opt select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; }
.chk-inline { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.info-box.ok { background: #E6F4EA; border-color: #C5E8D1; color: #137333; }
.info-box.warn { background: #FCE8E6; border-color: #F6D6D2; color: #C5221F; }

@media (min-width: 981px) and (max-width: 1280px) {
  .modal-back .modal.tpl-modal { width: 95vw; min-width: 900px; }
}
@media (min-width: 721px) and (max-width: 980px) {
  .modal-back .modal.tpl-modal { width: 95vw; min-width: 0; resize: vertical; }
}
@media (max-width: 760px) {
  .modal-back .modal.tpl-modal { width: 100%; min-width: 0; max-width: 100%; min-height: 0; resize: none; }
}

/* 변수 관리 모달 */
.var-sec { margin-bottom: 14px; }
.var-sec-h { font-size: 13px; font-weight: 700; color: #2B2B40; margin-bottom: 6px; }
.var-sec-h .box-hint { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.var-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.var-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 9px; font-size: 13px; font-weight: 600; }
.var-chip.auto { background: #E3ECFD; color: #1A56C4; }
.var-chip.manual { background: #FEF3D9; color: #A6760B; }
.vc-del { border: 0; background: transparent; color: #C5221F; cursor: pointer; font-size: 12px; padding: 0; }
.var-add { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.var-add input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; }

.dash-rate-strip {
  display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px; margin: 10px 0 16px;
}
.dash-rate-strip > div {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 13px; min-width: 0;
}
.dash-rate-strip span { display: block; color: var(--muted); font-size: 12px; }
.dash-rate-strip b { display: block; margin-top: 3px; font-size: 20px; color: var(--navy-deep); }
.dash-rate-strip em { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); font-style: normal; }
.todo-item.overdue { border-color: #F6C7C1; background: #FFF7F6; }
.todo-overdue {
  display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 999px;
  background: #FCE8E6; color: #C5221F; font-size: 11px; font-weight: 700; white-space: nowrap;
}
.todo-reschedule {
  border: 1px solid var(--line); background: #fff; color: var(--navy);
  border-radius: 7px; padding: 4px 8px; font-size: 12px; cursor: pointer;
}
.current-year-table th, .current-year-table td { white-space: nowrap; }
.ds-many-sms-options { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #FBFAF7; }

.one-line {
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.tl-click {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.tl-click:hover { background: #F4F8FF; }
.tl-click .tl-body { min-width: 0; }
.tl-click .tl-memo { display: block; }
.msg-full {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 55vh;
  overflow: auto;
  background: #FBFAF7;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font-family: inherit;
}
.local-message-history .msg.one-line { max-width: 360px; }
.is-deleted {
  opacity: .62;
  background: #FAFAFA;
}
.tl-item.is-deleted {
  border-style: dashed;
}
.aligo-raw-fields {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--muted);
}
.aligo-raw-fields code {
  display: inline-block;
  margin: 3px 4px 0 0;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}

@media (max-width: 760px) {
  .dash-rate-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .todo-reschedule { padding: 5px 8px; }
  .current-year-table { font-size: 12px; }
}

/* ========== 잔여포인트 정보 패널 (직접발송, 컴팩트) ========== */
.point-panel { margin: 10px 0 14px; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 12px; background: #fff; max-width: 520px; }
.pp-head { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; }
.point-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.point-dot.on { background: #18A957; box-shadow: 0 0 0 3px rgba(24,169,87,.15); }
.point-dot.est { background: #EF9F27; box-shadow: 0 0 0 3px rgba(239,159,39,.15); }
.point-dot.off { background: #C9CDD6; box-shadow: 0 0 0 3px rgba(201,205,214,.15); }
.pp-title { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.pp-badge { font-size: 11px; font-weight: 600; color: var(--muted); background: #F2F4F8; padding: 2px 8px; border-radius: 999px; }
.pp-spacer { flex: 1; }
.pp-iconbtn { border: 1px solid var(--line); background: #fff; color: var(--muted); width: 26px; height: 26px;
  border-radius: 7px; cursor: pointer; font-size: 14px; line-height: 1; }
.pp-iconbtn:hover { background: #F4F8FF; color: var(--navy); }
.pp-linkbtn { border: 1px solid var(--navy); background: var(--navy); color: #fff; padding: 4px 11px;
  border-radius: 7px; cursor: pointer; font-size: 12px; font-weight: 700; }
.pp-linkbtn:hover { filter: brightness(1.08); }

.pp-figures { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.pp-point b { font-size: 22px; font-weight: 800; color: var(--navy-deep); letter-spacing: -.4px; }
.pp-exp { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--c-red-fg); font-weight: 700; }
.pp-exp span { white-space: nowrap; }
.pp-dday { font-style: normal; font-size: 11px; font-weight: 800; color: #fff; background: #C5221F; border-radius: 999px; padding: 1px 7px; }
.pp-exp small { color: var(--muted); font-weight: 500; font-size: 11px; }

.pp-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.pp-chip { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 7px; background: #F4F6FA; color: #3A4252; }
.pp-chip b { font-weight: 800; }
.pp-chip.k-s { background: #EAF2FE; color: #14478E; }
.pp-chip.k-l { background: #EAF6EE; color: #1E6E3C; }
.pp-chip.k-m { background: #FFF6E8; color: #8A5A0B; }
.pp-chip.k-a { background: #FFF3D6; color: #8A5A0B; }
.pp-note { margin-top: 9px; font-size: 11.5px; color: #A6760B; background: #FFFBF1; border: 1px solid #F2E4C0;
  border-radius: 7px; padding: 6px 9px; }

@media (max-width: 480px) {
  .point-panel { padding: 10px 11px; }
  .pp-point b { font-size: 20px; }
  .pp-chip { font-size: 11.5px; padding: 3px 8px; }
}

/* 포인트 연결 모달 */
.point-connect .pc-lead { font-size: 13px; color: var(--ink); line-height: 1.6; margin: 0 0 12px; }
.point-connect .pc-steps { margin: 0 0 12px; padding-left: 20px; font-size: 13px; line-height: 1.7; color: var(--ink); }
.point-connect .pc-steps li { margin-bottom: 8px; }
.pc-bookmarklet { display: inline-block; margin-top: 5px; padding: 7px 14px; border-radius: 9px;
  background: #1F3A6E; color: #fff !important; font-weight: 700; font-size: 13px; text-decoration: none;
  cursor: grab; border: 1px solid #1F3A6E; }
.point-connect textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 10px;
  font-family: inherit; font-size: 12.5px; resize: vertical; }
.pc-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.pc-msg { font-size: 12.5px; color: var(--muted); }
.pc-msg.ok { color: #137333; }
.pc-msg.warn { color: #C5221F; }
.point-connect .pc-foot { margin-top: 12px; font-size: 11.5px; color: var(--muted); }

/* 직접발송 특수문자·이모티콘 팔레트 + 붙여넣기 안내 */
.ds-special-panel { margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #FBFCFE; max-height: 260px; overflow-y: auto; }
.ds-paste-note { margin-top: 7px; font-size: 12px; color: #1A56C4; background: #F4F8FF; border: 1px solid #D6E4FB; border-radius: 7px; padding: 6px 10px; }
.ds-editor-actions { display: flex; gap: 6px; flex-wrap: wrap; }
/* 직접발송 본문/미리보기 접기·펼치기 */
.ds-body-acc { margin: 6px 0; }
.ds-body-acc > summary {
  cursor: pointer; user-select: none; list-style: none;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: #FBFAF7; font-weight: 700; font-size: 13.5px; color: var(--ink);
}
.ds-body-acc > summary::-webkit-details-marker { display: none; }
.ds-body-acc > summary::before { content: '▸ '; color: var(--muted); }
.ds-body-acc[open] > summary::before { content: '▾ '; }
.ds-body-acc[open] > summary { border-radius: 8px 8px 0 0; border-bottom: 0; }
.ds-body-acc > textarea { border-radius: 0 0 8px 8px !important; }

/* 학생 상세 — 접기/펴기 섹션 + 발송이력 리스트 */
.sec.collapsible > h3 { cursor: pointer; user-select: none; }
.sec-toggle { border: 0; background: none; cursor: pointer; padding: 0 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1; }
.sec-toggle::before { content: '▾'; display: inline-block; transition: transform .15s; }
.sec.collapsed .sec-toggle::before { transform: rotate(-90deg); }
.sec.collapsed .sec-body { display: none; }
.msglist .msglog { padding: 8px 0; border-bottom: 1px solid var(--line); }
.msglist .msglog:last-child { border-bottom: 0; }
.msglog-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.msglog-head.clickable { cursor: pointer; }
.msglog-head .when { color: var(--muted); font-size: 11.5px; }
.msglog-head b { font-size: 13px; }
.msglog-more { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--navy); background: #F4F8FF; border: 1px solid #D6E4FB; border-radius: 999px; padding: 1px 8px; }
.msglist .msglog-body { margin-top: 5px; font-size: 12.5px; color: #444; white-space: pre-wrap; line-height: 1.55; background: #FBFAF7; border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; }
/* 전송실패/대체 강조 — 한눈에 보이게 */
.pill.warn { background: var(--c-amber-bg); color: var(--c-amber-fg); }
.msglist .msglog.fail { background: #FEF6F5; border-left: 3px solid var(--c-red-fg); padding-left: 9px; }
.msglist .msglog.fallback { background: #FFFBF2; border-left: 3px solid var(--c-amber-fg); padding-left: 9px; }
.msglog-failr { margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--c-red-fg); }
.msglog-fbr { margin-top: 4px; font-size: 12px; color: var(--c-amber-fg); }
.qtable tr.row-fail td { background: #FEF6F5; }
.qtable tr.row-fail .fail-reason { color: var(--c-red-fg); }
.btn.xs { padding: 2px 9px; font-size: 11px; min-height: 0; border-radius: 6px; }

/* ====== 모바일/태블릿 메뉴 (햄버거 드롭다운) — 데스크톱(>1300) 제외 ====== */
/* 햄버거(서랍) 메뉴 전환점.
   메뉴가 12개가 되면서 가로 탭바는 약 1473px 이상이어야 다 들어간다.
   전환점이 1300px 이던 시절에는 1301~1472px(1366×768·1440×900 노트북)에서
   마지막 메뉴가 잘려 보이지 않았다. 그래서 1500px 로 올린다. */
@media (max-width: 1500px) {
  .topbar { flex-wrap: nowrap; height: 52px; min-height: 52px; gap: 10px; padding: 0 14px; align-items: center; }
  .nav-toggle { display: flex; order: 5; }
  .topbar .spacer { flex: 1; order: 2; }
  .topbar .sync { display: block; order: 3; font-size: 11px; color: #C2C8D4; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .user { order: 4; font-size: 12.5px; }
  .topbar .btn-ghost { order: 6; }
  .brand { order: 1; }

  .tabs { order: 99; position: absolute; top: 52px; left: auto; right: 0; width: min(330px, 100vw); margin: 0;
    flex-direction: column; gap: 3px; padding: 0; background: #162239;
    box-shadow: 0 12px 28px rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.10); border-top: 0;
    border-radius: 0 0 0 12px;
    max-height: 0; overflow: hidden; opacity: 0; pointer-events: none;
    transition: max-height .22s ease, opacity .18s ease; }
  .topbar.nav-open .tabs { max-height: 78vh; overflow-y: auto; opacity: 1; pointer-events: auto; padding: 8px; }
  .tab {
    display: flex; align-items: center; width: 100%; justify-content: flex-end; text-align: right; border-radius: 8px; font-size: 16px;
    padding: 13px 14px 13px 18px; min-height: 44px;
  }
  .tab.on { background: rgba(255,255,255,.14); box-shadow: inset -3px 0 0 #F3C4D8; }

  .topbar.nav-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .topbar.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .topbar.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .panel { top: 52px; height: calc(100% - 52px); }
}
@media (max-width: 520px) {
  .topbar .user { display: none; }
  .topbar .sync { max-width: 110px; }
}

/* ============================================================
   [모바일 디자인 2단계] 갤럭시 탭 S8 울트라(14.6") 등 대형 화면
   ① 대화면 공간 낭비 해소: 콘텐츠 폭 1200 → 1400 확장
   ② 큰 '터치' 태블릿(마우스 데스크탑 제외)만 글자·터치 키움
   ============================================================ */
/* ① 큰 화면에서 본문 폭 넓혀 양옆 빈 공간 줄임 (데스크탑 모니터에도 적용 — 가독 폭 내 유지) */
@media (min-width: 1366px) {
  .view { width: auto; max-width: 1400px; }
}
@media (min-width: 1700px) {
  .view { max-width: 1520px; }     /* 초대형 화면은 조금 더 활용 */
}
/* ② 대형 '터치' 태블릿 전용 (갤탭 울트라 가로 등) — 마우스 쓰는 데스크탑(pointer:fine)엔 영향 없음 */
@media (min-width: 1301px) and (pointer: coarse) {
  body { font-size: 16px; }
  .tab { font-size: 14.5px; padding: 10px 13px; }   /* 세로만 키워 터치성↑, 8개 한 줄 유지 */
  .btn { min-height: 42px; }
  .btn.sm { min-height: 36px; }
  .btn.xs { min-height: 32px; }
  .kv { font-size: 15px; }
  .kv dt, .kv dd { font-size: 15px; }
  .stat .snum { font-size: 27px; }
  .stat .slabel { font-size: 12.5px; }
  table.list th, table.list td { padding: 13px 16px; font-size: 15px; }  /* 학생표 더 시원하게 */
}

/* ============================================================
   [모바일 디자인 3단계] Boox 등 e-ink(전자잉크) 화면 전용 고대비
   - update:slow = 느린 화면(e-ink), monochrome = 흑백 화면 → e-ink 직접 감지
   - e-ink는 ①애니메이션/그림자/그라데이션이 잔상·번짐 ②파스텔(옅은 색)이 회색 떡짐
   → 애니메이션·그림자 제거 + 흑백 고대비로 가독성 확보
   ============================================================ */
@media (update: slow), (monochrome) {
  /* 색/테두리 변수: 흐린 회색 → 진하게 */
  :root { --line: #8C8C8C; --muted: #2F2F2F; }

  /* 애니메이션·전환 제거 (잔상·느린 refresh 방지) */
  *, *::before, *::after { transition: none !important; animation: none !important; }

  /* 그림자 제거 (e-ink에서 회색 번짐) */
  .topbar, .stat, .card, .dash-panel, .panel, .modal, .point-panel,
  .report-snapshot-row, table.list, .rep-table, .show-more-btn,
  .hist-revert, .stat.accent { box-shadow: none !important; }

  body { color: #000; }
  .muted, .hint, .tl-time, .tl-memo, .when, .slabel, .stat-sub,
  .snapshot-main span, .snapshot-main small, .kv dt { color: #2F2F2F !important; }

  /* 옅은 색 배경(파스텔 칩/카드/배지) → 흰 배경 + 검은 글자 + 진한 테두리 (회색 떡짐 방지) */
  .pill, .chip, .manual-tag, .auto-tag, .pp-chip, .pp-badge,
  .stat.blue, .stat.green, .stat.red, .stat.amber, .stat.gray, .stat.teal, .stat.accent {
    background: #fff !important; border: 1px solid #000 !important; color: #000 !important;
  }
  .stat .snum, .stat.accent .snum, .stat.accent .slabel { color: #000 !important; }
  .stat::before { display: none !important; }   /* 상단 색 강조바 제거 */

  /* 상태는 색이 아닌 '진하기'로 구분: 실패/위험은 검은 채움, 성공/완료는 두꺼운 테두리 */
  .pill.fail, .tpl-status.fail, .info-box.warn, .stat.red .snum {
    background: #000 !important; color: #fff !important; font-weight: 700;
  }
  .pill.ok, .tpl-status.ok { border-width: 2px !important; font-weight: 700; }

  /* 진행단계/학기 배지: 색 대신 글자 진하게 */
  .stage, .sem-tag { color: #000 !important; font-weight: 700; border-color: #000 !important; }

  /* 주요 버튼: 흑백 고대비 */
  .btn.primary, .btn.pink, .hist-revert { background: #000 !important; border-color: #000 !important; color: #fff !important; }
  .btn { border-color: #000 !important; }

  a, .tel { color: #000; text-decoration: underline; }

  /* 키워드 순위 카드: 색 제거하고 테두리·진하기로 구분 */
  .kw-card { box-shadow: none !important; border: 1.5px solid #000 !important; }
  .kw-card-head { background: #fff !important; border-bottom: 1.5px solid #000 !important; }
  .kw-brand, .kw-sec { color: #000 !important; }
  .kw-card.is-pinned .kw-card-head { border-bottom-width: 3px !important; }   /* 주요키워드는 굵은 밑줄로 구분 */
  .kw-cnt { background: #fff !important; border: 1px solid #000 !important; color: #000 !important; }
  .kw-table th { background: #fff !important; color: #000 !important; border-bottom: 1.5px solid #000 !important; }
  .kw-table tbody tr:nth-child(even) td, .kw-table tbody tr:hover td { background: #fff !important; }
  .kw-table td { border-bottom: 1px solid #000 !important; }
  .kw-no, .kw-rk { background: #fff !important; color: #000 !important; border: 1px solid #000 !important; font-weight: 800; }
  .kw-no.m1, .kw-rk.p1 { background: #000 !important; color: #fff !important; }   /* 1등만 검은 채움으로 강조 */
  .kw-rk.p3, .kw-rk.p0 { border-color: #8C8C8C !important; color: #2F2F2F !important; }
  .kw-gap { color: #000 !important; }
}

/* ===== 키워드 관리 — 전략 카드 · 전체 표(정렬/필터) · 놓친 키워드 ===== */
.kw-card.is-strategy { border-left: 3px solid #7C5CFC; }
.kw-st-sum { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.kw-st-sum b { color: var(--fg); }
.kw-st-list { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.kw-st-row { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; background: #FBFAF7; border-radius: 8px; }
.kw-st-badge { flex: 0 0 auto; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 8px; margin-top: 1px; }
.kw-st-badge.t-expose { background: #FDE7E5; color: #C5221F; }   /* 미노출 — 가장 아까운 자리 */
.kw-st-badge.t-flip   { background: #FEF3D9; color: #A6760B; }   /* 역전 — 경쟁사보다 뒤 */
.kw-st-badge.t-guard  { background: #E7F0FE; color: #1A56C4; }   /* 방어 — 1위 추격당함 */
.kw-st-badge.t-waste  { background: #EEF1F6; color: #5A6478; }   /* 저효율 — 비용 절감 */
.kw-st-main { flex: 1 1 auto; min-width: 0; }
.kw-st-main b { font-size: 13px; }
.kw-st-reason { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.kw-st-side { flex: 0 0 auto; text-align: right; display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; }
.kw-st-act { font-weight: 700; color: #7C5CFC; }
.kw-st-cost { color: #C5221F; font-weight: 600; }
.kw-card.is-all { margin-top: 12px; }
.kw-filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.kw-filter-bar .kw-q { flex: 1 1 160px; min-width: 140px; }
.kw-mv-lbl { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.kw-mv-lbl input { width: 70px; }
.kw-note { font-size: 12px; color: var(--muted); margin-left: auto; }
.kw-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.kw-table th.sortable:hover, .kw-table th.sortable.on { color: #1A56C4; }
.kw-all-wrap { max-height: 62vh; overflow: auto; }
.kw-all-wrap thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
/* 📈 순위 변동 바 */
.kw-chg-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 12.5px; }
.kw-chg-title { font-weight: 700; margin-right: 4px; white-space: nowrap; }
.kw-chg { display: inline-flex; gap: 4px; align-items: center; padding: 2px 9px; border-radius: 10px; font-size: 12px; white-space: nowrap; }
.kw-chg.bad { background: #FCE8E6; color: #C5221F; }
.kw-chg.good { background: #E6F4EA; color: #137333; }
/* 💰 네이버 유입 전환 바 */
.kw-roi-bar { margin-top: 8px; background: #FFF9EC; border: 1px solid #F0DFAF; border-radius: 10px;
  padding: 9px 12px; font-size: 13px; }
.kw-roi-bar .muted { font-size: 11.5px; margin-left: 6px; }
/* 💰 입찰 추천 힌트 (전략 카드) */
.kw-st-bid { display: block; font-size: 12px; font-weight: 700; color: #7B2FBE; }

/* ---- 키워드 관리 v84: 측정시각·당일 변동·전략 표·변동 그룹 ---- */
.kw-when { margin-left: auto; font-size: 11.5px; font-weight: 700; color: #9A6700; white-space: nowrap; }
.kw-kw-time { display: block; margin-top: 2px; font-size: 10.5px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.kw-delta { display: inline-block; margin-left: 4px; font-size: 10.5px; font-weight: 800; vertical-align: middle; }
.kw-delta.up { color: #137333; }
.kw-delta.down { color: #C5221F; }
/* 전략 카드 — 유형 칩 + 표 */
.kw-waste-sum { margin-left: auto; font-size: 12px; font-weight: 800; color: #C5221F; white-space: nowrap; }
.kw-st-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 2px; }
.kw-st-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 3px 11px; font-size: 12px; cursor: pointer; color: var(--muted); }
.kw-st-chip b { color: var(--fg); }
.kw-st-chip.on { border-color: #7C5CFC; background: #F3EFFF; color: #4B2ED6; font-weight: 700; }
.kw-st-chip.on b { color: #4B2ED6; }
.kw-st-tbl .c-type { width: 58px; }
.kw-st-tbl td.c-type { vertical-align: top; padding-top: 9px; }
.kw-st-tbl .c-diag { font-size: 12px; color: var(--muted); max-width: 260px; }
.kw-st-tbl td.c-kw b { font-size: 13px; }
.kw-st-nums { display: block; margin-top: 2px; font-size: 10.5px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.kw-st-tbl .c-cost { white-space: nowrap; }
.kw-st-tbl tr.st-expose td:first-child { box-shadow: inset 3px 0 0 #C5221F; }
.kw-st-tbl tr.st-flip td:first-child { box-shadow: inset 3px 0 0 #E8A70A; }
.kw-st-tbl tr.st-guard td:first-child { box-shadow: inset 3px 0 0 #1A56C4; }
.kw-st-tbl tr.st-waste td:first-child { box-shadow: inset 3px 0 0 #8A93A6; }
.kw-st-more { margin: 6px 12px 10px; }
/* 순위 변동 — 학교/학원 줄 구분 */
.kw-chg-bar { align-items: flex-start; }
.kw-chg-rows { display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; min-width: 0; }
.kw-chg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.kw-chg-who { font-weight: 700; white-space: nowrap; font-size: 12.5px; }
.kw-chg-who .chg-bad { color: #C5221F; margin-left: 4px; }
.kw-chg-who .chg-good { color: #137333; margin-left: 4px; }
.kw-chg-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
/* 설정 모달 — 주요키워드 관리 방식 */
.kw-src-opt { display: block; margin: 6px 0; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 12.5px; line-height: 1.5; cursor: pointer; }
.kw-src-opt:has(input:checked) { border-color: #7C5CFC; background: #F8F6FF; }
.kw-src-opt input { margin-right: 6px; }
/* v85: 시간대별 이력·단가 변동·급변 알림 */
.kw-clickable { cursor: pointer; }
.kw-clickable:hover { text-decoration: underline; color: #1A56C4; }
.kw-hist-day td { background: #F4F6FA; font-weight: 700; font-size: 11.5px; color: var(--muted); padding: 4px 10px; }
.kw-price-bar { border-color: #E8D9B0; background: #FFFDF5; }
.kw-alert-row { font-size: 12.5px; margin: 6px 0; }
.kw-alert-row input[type="number"] { padding: 3px 6px; }
/* ⭐ 주요키워드 고정 토글 (표 첫 칸) */
.kw-table .c-star { width: 30px; text-align: center; padding-left: 4px; padding-right: 4px; }
.kw-star { border: 0; background: none; cursor: pointer; font-size: 15px; line-height: 1; color: #C8CCD8; padding: 2px; }
.kw-star:hover { color: #E0A800; transform: scale(1.15); }
.kw-star.on { color: #E0A800; }
.kw-missing-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 50vh; overflow: auto; margin-top: 8px; }
.kw-chip { background: #F4F7FB; border: 1px solid var(--line); padding: 3px 10px; border-radius: 12px; font-size: 12.5px; }
@media (max-width: 760px) {
  .kw-st-row { flex-wrap: wrap; }
  .kw-st-side { text-align: left; }
  .kw-note { margin-left: 0; width: 100%; }
}

/* 키워드 관리 — 성과보고서(실데이터) 연동 */
.kw-report-remind { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0 10px;
  padding: 9px 12px; background: #FFFBF2; border: 1px solid #F5E4C0; border-radius: 9px; font-size: 13px; }
.kw-real-badge { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 8px;
  background: #E7F0FE; color: #1A56C4; font-size: 10.5px; font-weight: 800; vertical-align: middle; }

/* ===== 키워드관리 가독성 개편 (v88) =====
   · 학교/학원 순위 열을 한 표에 함께 — 그룹 헤더 2단 + 열 색으로 구분 (파랑=학교 검색판, 주황=학원 검색판)
   · 표 안 스크롤 시 머리글 고정(2단 모두), 카드 밖 [바로가기] 막대는 화면에 붙어 다님
   · 단가 구간 색: 70~3천 초록 / 3~6천 주황 / 6~9천 진주황 / 9천+ 빨강 */
.kw-tbl-wrap { overflow: auto; max-height: 68vh; }
.kw-tbl-wrap thead th { position: sticky; top: 0; z-index: 3; background: #FBFAF7;
  box-shadow: inset 0 -1px 0 var(--line); border-bottom: 0; }
.kw-table thead tr.kw-hrow1 th.kw-grp { height: 22px; padding: 3px 8px; font-size: 10.5px; line-height: 1.1;
  box-sizing: border-box; letter-spacing: .3px; }
.kw-tbl-wrap thead tr.kw-hrow2 th { top: 22px; z-index: 2; }
.kw-table th.kw-grp.g-school { background: #DCE8FB; color: #1A56C4; }
.kw-table th.kw-grp.g-academy { background: #FBE9D2; color: #A05A00; }
.kw-table th.c-brand.g-school { background: #EAF1FD; }
.kw-table th.c-brand.g-academy { background: #FBF1E1; }
.kw-table th.c-brand.our { color: #1A56C4; font-weight: 800; }
.kw-table th.g-first, .kw-table td.g-first { border-left: 2px solid #C6CCDA; }
.kw-table td.g-school { background: #F0F5FF; }
.kw-table tbody tr:nth-child(even) td.g-school { background: #E7EEFB; }
.kw-table tbody tr:hover td.g-school { background: #DCE7FA; }
.kw-table td.g-academy { background: #FDF6EC; }
.kw-table tbody tr:nth-child(even) td.g-academy { background: #F8EEDD; }
.kw-table tbody tr:hover td.g-academy { background: #F3E6CE; }
.kw-table td.c-xnone { color: #B7BBC4; font-weight: 400; }
.kw-dual { margin-left: 3px; font-weight: 800; color: #7B2FBE; font-size: 12px; }
/* 단가 구간 색 */
.kw-price.pb1 { color: #137333; font-weight: 700; }
.kw-price.pb2 { color: #B26A00; font-weight: 700; }
.kw-price.pb3 { color: #D14900; font-weight: 800; }
.kw-price.pb4 { color: #C5221F; font-weight: 800; }
.kw-price-legend { display: inline-flex; gap: 3px; align-items: center; font-size: 10.5px; color: var(--muted); margin-left: auto; }
.kw-price-legend i { font-style: normal; font-weight: 700; padding: 1px 5px; border-radius: 6px; }
.kw-price-legend .pb1 { color: #137333; background: #E7F4EA; }
.kw-price-legend .pb2 { color: #B26A00; background: #FCF2DF; }
.kw-price-legend .pb3 { color: #D14900; background: #FDEADC; }
.kw-price-legend .pb4 { color: #C5221F; background: #FDECEA; }
/* 진단 글씨 또렷하게 */
.kw-st-tbl .c-diag { font-size: 13px; color: #2A2E37; max-width: 340px; line-height: 1.5; }
/* 교차(반대 검색판에서 경쟁사만 노출) 유형 */
.kw-st-badge.t-cross { background: #F3EAFB; color: #7B2FBE; }
.kw-st-chip.t-cross.on { border-color: #7B2FBE; background: #F7F0FC; color: #7B2FBE; }
.kw-st-tbl tr.st-cross td:first-child { box-shadow: inset 3px 0 0 #7B2FBE; }
/* 바로가기 막대 — 스크롤해도 화면 위에 붙어 다님 */
.kw-nav { position: sticky; top: 6px; z-index: 30; display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; margin-top: 10px;
  box-shadow: 0 2px 8px rgba(20, 24, 40, .08); }
.kw-nav-lb { font-weight: 800; font-size: 12px; }
.kw-nav-btn { border: 1px solid var(--line); background: #FBFAF7; border-radius: 8px; padding: 4px 10px;
  font-size: 12.5px; font-weight: 700; cursor: pointer; }
.kw-nav-btn:hover { border-color: #1A56C4; color: #1A56C4; }
.kw-nav-hint { font-size: 11px; color: var(--muted); margin-left: auto; }
@media (max-width: 760px) { .kw-nav-hint { display: none; } }

/* 🧠 전문가 진단 카드 (v89) */
.kw-card.is-expert { border-color: #C9B7E8; }
.kw-card.is-expert .kw-card-head { background: #F7F2FD; }
.kw-exp-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.kw-exp-acc { line-height: 1.6; }
/* 확장검색(키워드 미지정 트래픽) — 키워드 목록에서 빠진 지출을 따로 보여주는 줄 */
.kw-exp-broad { margin-top: 4px; padding: 5px 9px; background: #F3F0FA; border-left: 3px solid #A78BDA;
  border-radius: 0 6px 6px 0; font-size: 12.5px; line-height: 1.55; }
.kw-exp-broad-warn { display: block; margin-top: 2px; color: #6B4FA0; font-size: 12px; }
.kw-exp-warn { background: #FDECEA; border: 1px solid #F5C6C0; color: #8A1A15; border-radius: 8px; padding: 8px 10px; line-height: 1.55; }
.kw-exp-sec { border-top: 1px dashed var(--line); padding-top: 8px; line-height: 1.6; }
.kw-exp-sec .kw-chg-chips { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; }
.kw-exp-check { margin: 6px 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 5px; line-height: 1.5; }
.kw-exp-check li.exp-high { font-weight: 700; }

/* 📈 월별 추이 카드 + 키워드 추이 모달 (v90) */
.kw-card.is-trend { border-color: #A7C4EF; }
.kw-card.is-trend .kw-card-head { background: #EFF5FD; }
.kw-trend-grid { display: flex; flex-wrap: wrap; gap: 18px; padding: 10px 12px 4px; }
.kw-trend-acc { flex: 1; min-width: 280px; }
.kw-trend-acc > b { display: block; margin-bottom: 4px; font-size: 13px; }
.kw-chart-scroll { overflow-x: auto; padding: 2px 0 4px; }
.kw-chart-scroll svg { display: block; }
.kw-chart-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2px; font-size: 12px; color: #475569; }
.kw-lg-item i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.kw-trend-sec { margin-bottom: 16px; }
.kw-trend-sec > b { display: inline-block; margin-bottom: 6px; font-size: 13.5px; }
.kw-trend-sec .muted { font-size: 12px; }
.kw-trend-tbl { width: auto; min-width: 340px; }
.kw-trend-tbl th, .kw-trend-tbl td { padding: 4px 10px; }
/* 월별/일별 실적이 1건뿐일 때의 한 줄 요약 */
.kw-trend-one { font-size: 13px; color: var(--ink); line-height: 1.7; padding: 6px 0; }
.modal-back .modal.kw-wide { max-width: 760px; }

/* ==========================================================
   학기 구분 표시 (1학기 / 2학기) + 생년 표시
   - 1학기 = 파랑, 2학기 = 보라. 색만 봐도 어느 학기 학생인지 구분됩니다.
   - .sem-chip : 이름 앞 뱃지 / .sem-split : 카드·타일의 "1학기 N · 2학기 M" 인원 분해
   ========================================================== */
:root {
  --sem1-bg: #DCE9FF; --sem1-fg: #0B4FB3;   /* 1학기 — 파랑 */
  --sem2-bg: #EEE2FB; --sem2-fg: #6A2FA8;   /* 2학기(다음/모집중) — 보라 */
  --sem2p-bg: #FFE7CC; --sem2p-fg: #A04A00;  /* 2학기(이미 개강, 예: 26-2) — 주황 */
  --sem0-bg: #EFEEEA; --sem0-fg: #5A5E66;   /* 학기 미상 */
}
.sem-chip { display: inline-block; margin-right: 5px; padding: 0 6px; border-radius: 7px;
  font-size: 10.5px; font-weight: 800; letter-spacing: -.3px; vertical-align: middle; line-height: 17px; }
.sem-chip.s1 { background: var(--sem1-bg); color: var(--sem1-fg); }
.sem-chip.s2 { background: var(--sem2-bg); color: var(--sem2-fg); }
.sem-chip.s2p { background: var(--sem2p-bg); color: var(--sem2p-fg); }
.sem-chip.s0 { background: var(--sem0-bg); color: var(--sem0-fg); }
/* 이름 뒤 생년 (예: 06년생) */
.birth-tag { margin-left: 5px; font-size: 11.5px; font-weight: 600; color: var(--muted); }

/* 학기별 인원 분해 줄 — KPI 카드 / 현황 타일 / 카드 제목 / 면접 컬럼 라벨 공통 */
.sem-split { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; margin-top: 4px; }
.sem-split b { padding: 0 6px; border-radius: 7px; font-size: 10.5px; font-weight: 800;
  letter-spacing: -.3px; line-height: 17px; white-space: nowrap; }
.sem-split b.s1 { background: var(--sem1-bg); color: var(--sem1-fg); }
.sem-split b.s2 { background: var(--sem2-bg); color: var(--sem2-fg); }
.sem-split b.s2p { background: var(--sem2p-bg); color: var(--sem2p-fg); }
.sem-split b.s0 { background: var(--sem0-bg); color: var(--sem0-fg); }
/* 카드 제목 안에서는 위 여백 없이 카운트 옆에 붙임 */
.card h3 .sem-split, .itv-label .sem-split { margin-top: 0; margin-left: 6px; }
.stat .sem-split { margin-top: 0; }
/* 색 타일(짙은 배경) 위에서도 읽히도록 */
.stat.accent .sem-split b { background: rgba(255, 255, 255, .18); color: #fff; }
.stat.zero .sem-split { display: none; }

@media (max-width: 720px) {
  .sem-chip, .sem-split b { font-size: 9.5px; padding: 0 4px; }
  .birth-tag { font-size: 10.5px; margin-left: 3px; }
}

/* ==========================================================
   진행단계 수동 고정 경고 — 학사시스템 원본과 어긋날 때
   "원본으로 되돌리기 / 수동 고정 유지"를 직접 고르게 한다
   ========================================================== */
.stage-conflict { margin: 0 18px 4px; padding: 11px 13px; border-radius: 10px;
  background: #FFF8E6; border: 1px solid #F0D9A0; }
.stage-conflict .sc-head { font-size: 13px; font-weight: 800; color: #8A5A0B; margin-bottom: 5px; }
.stage-conflict .sc-body { font-size: 12.5px; color: var(--ink); line-height: 1.65; }
.stage-conflict .sc-manual { color: #8A5A0B; }
.stage-conflict .sc-auto { color: #137333; }
.stage-conflict .sc-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
/* 학생 목록 — 원본과 어긋난 수동 지정 표시 */
.conflict-dot { font-size: 12px; cursor: help; }

/* 키워드 분석 기간 선택 바 — 무엇을 언제부터 언제까지 분석했는지 명확히 */
.kw-range-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 8px 11px; margin-bottom: 10px; border-radius: 9px;
  background: #F4F8FF; border: 1px solid #D6E4FB; font-size: 12.5px; }
.kw-range-bar label { font-weight: 700; color: #0B4FB3; display: flex; align-items: center; gap: 6px; }
.kw-range-bar select { font-size: 12.5px; padding: 3px 6px; border-radius: 6px; border: 1px solid #C3D6F5; background: #fff; }
.kw-range-now { font-weight: 700; color: var(--ink); }
.kw-range-now b { color: #0B4FB3; }
.kw-range-cov { color: var(--muted); }
.kw-range-src { margin-left: auto; padding: 1px 8px; border-radius: 8px; font-size: 11px; font-weight: 800;
  background: #DDF6E6; color: #116B32; cursor: help; }
.kw-range-src.warn { background: #FBEFD8; color: #8A5A0B; }
@media (max-width: 720px) {
  .kw-range-bar { font-size: 11.5px; gap: 7px; }
  .kw-range-src { margin-left: 0; }
}

/* ==========================================================
   🅿 파워컨텐츠 카드 — 파워링크와 지표 성격이 달라 별도 섹션
   ========================================================== */
.kw-card.is-pc { border-color: #D9CBEF; }
.kw-card.is-pc .kw-card-head { background: #F7F3FE; }
.pc-body { padding: 12px 14px; }
.pc-tag { display: inline-block; margin-left: 7px; padding: 1px 8px; border-radius: 9px;
  font-size: 10.5px; font-weight: 800; vertical-align: middle; }
.pc-tag.on { background: #DDF6E6; color: #116B32; }
.pc-tag.off { background: #EFEEEA; color: #5A5E66; cursor: help; }

.pc-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.pc-stat { flex: 1 1 120px; min-width: 110px; padding: 9px 11px; border-radius: 10px;
  background: #FAF8FE; border: 1px solid #E7DEF7; display: flex; flex-direction: column; gap: 2px; }
.pc-stat-l { font-size: 11px; color: var(--muted); font-weight: 700; }
.pc-stat-v { font-size: 17px; font-weight: 800; color: #5B2E9D; line-height: 1.15; }
.pc-stat-s { font-size: 10.5px; color: var(--muted); }
.pc-broad { margin-top: 8px; font-size: 12px; color: var(--muted); }

.pc-compare { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #F6F8FC; border: 1px solid #E2E7F0; }
.pc-compare > b { font-size: 12.5px; }
.pc-cmp-bar { height: 9px; border-radius: 5px; background: #DCE3EE; overflow: hidden; margin: 7px 0 6px; }
.pc-cmp-fill { display: block; height: 100%; background: #7B4BC9; }
.pc-cmp-nums { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--ink); }
.pc-cmp-nums b.good { color: #137333; }

.pc-spark { margin-top: 12px; }
.pc-spark-bars { display: flex; align-items: flex-end; gap: 2px; height: 38px; }
.pc-bar { flex: 1 1 auto; min-width: 2px; background: #B79BE6; border-radius: 2px 2px 0 0; cursor: help; }
.pc-bar:hover { background: #7B4BC9; }
.pc-spark-cap { margin-top: 4px; font-size: 10.5px; color: var(--muted); }

.pc-sec-title { margin: 15px 0 7px; font-size: 12.5px; font-weight: 800; color: var(--navy); }
.pc-tablewrap { overflow-x: auto; }
.pc-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 560px; }
.pc-table th, .pc-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.pc-table th { background: #FAF8FE; color: var(--muted); font-weight: 700; font-size: 11.5px; }
.pc-table td.num, .pc-table th.num { text-align: right; }
.pc-table td.num.bad { color: #C5221F; font-weight: 700; }
.pc-table .pc-kw { font-weight: 600; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.pc-win { padding: 1px 7px; border-radius: 8px; font-size: 10.5px; font-weight: 800; }
.pc-win.pc { background: #EEE2FB; color: #5B2E9D; }
.pc-win.pl { background: #D9E8FF; color: #0B4FB3; }

.pc-check { margin-bottom: 9px; padding: 9px 11px; border-radius: 9px; background: #F8F8F6; border: 1px solid var(--line); font-size: 12px; }
.pc-check.warn { background: #FFFBF2; border-color: #F0DDB4; }
.pc-check.bad { background: #FEF6F5; border-color: #EFC4C1; }
.pc-check ul { margin: 5px 0 0; padding-left: 18px; line-height: 1.7; }
.pc-rank-note { margin-top: 14px; padding: 9px 11px; border-radius: 9px;
  background: #F4F8FF; border: 1px solid #D6E4FB; font-size: 12px; line-height: 1.6; }

@media (max-width: 720px) {
  .pc-stat { flex: 1 1 45%; min-width: 0; }
  .pc-stat-v { font-size: 15px; }
  .pc-cmp-nums { gap: 8px; font-size: 11.5px; }
}

/* 💡 파워컨텐츠 추가 추천 카드 */
.kw-card.is-pcgap { border-color: #CFE3D3; }
.kw-card.is-pcgap .kw-card-head { background: #F3FAF5; }
.pc-rank { color: var(--muted); font-weight: 700; width: 30px; }
.pc-comp { padding: 1px 7px; border-radius: 8px; font-size: 10.5px; font-weight: 800; background: #EFEEEA; color: #5A5E66; }
.pc-comp.hi { background: #FBE7E7; color: #A03030; }
.pc-comp.lo { background: #DDF6E6; color: #116B32; }
.pc-why { white-space: normal; min-width: 220px; }
.pc-why-i { display: inline-block; margin: 1px 4px 1px 0; padding: 1px 7px; border-radius: 8px;
  background: #F1F4F9; color: #3C4759; font-size: 10.5px; font-weight: 600; }

/* 📝 상위 블로그 글 분석 모달 */
.pcb-tips { padding: 10px 12px; border-radius: 9px; background: #F4F8FF; border: 1px solid #D6E4FB;
  font-size: 12.5px; line-height: 1.75; margin-bottom: 10px; }
.pcb-tip { color: var(--ink); }
.pcb-words { margin-bottom: 10px; }
.pcb-words > b { font-size: 12.5px; }
.pcb-word-list { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 4px; }
.pcb-word { padding: 2px 8px; border-radius: 8px; background: #EEE2FB; color: #5B2E9D;
  font-size: 11.5px; font-weight: 600; }
.pcb-word b { color: #3E1D70; }
.pcb-list { max-height: 420px; overflow-y: auto; }
.pcb-item { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.pcb-item.ours { background: #F2FBF5; border-left: 3px solid #137333; }
.pcb-item.rival { background: #FEF6F5; border-left: 3px solid #C5221F; }
.pcb-head { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.pcb-rank { font-size: 11.5px; font-weight: 800; color: var(--muted); min-width: 16px; }
.pcb-title { font-size: 13px; font-weight: 700; color: var(--navy); text-decoration: none; }
.pcb-title:hover { text-decoration: underline; }
.pcb-tag { padding: 1px 7px; border-radius: 8px; font-size: 10px; font-weight: 800; }
.pcb-tag.ours { background: #DDF6E6; color: #116B32; }
.pcb-tag.rival { background: #FBE7E7; color: #A03030; }
.pcb-meta { margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.pcb-age { margin-left: 6px; padding: 0 6px; border-radius: 7px; background: #EFEEEA; font-size: 10.5px; font-weight: 700; }
.pcb-age.fresh { background: #DDF6E6; color: #116B32; }
.pcb-age.old { background: #FBEFD8; color: #8A5A0B; }
.pcb-desc { margin-top: 4px; font-size: 12px; color: #4A5160; line-height: 1.55; }
.pcb-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); font-size: 11.5px; }

/* ==========================================================
   📊 키워드 심화 분석 카드 (순위↔성과 · 접수상관 · 요일 · 예산 · 경쟁 · 발굴 · 블로그 · 시즌)
   ========================================================== */
.kw-card.is-ka { border-color: #D6DEEB; }
.kw-card.is-ka .kw-card-head { background: #F5F7FB; }
.ka-body { padding: 12px 14px; }
.ka-tips { padding: 9px 11px; border-radius: 9px; background: #F4F8FF; border: 1px solid #D6E4FB;
  font-size: 12.5px; line-height: 1.7; margin-bottom: 10px; }
.ka-tip { color: var(--ink); }
.ka-sec { margin: 14px 0 6px; font-size: 12.5px; font-weight: 800; color: var(--navy); }
.ka-ok { padding: 10px 12px; border-radius: 9px; background: #F2FBF5; border: 1px solid #C5E8D1;
  font-size: 12.5px; color: #137333; font-weight: 600; }
.ka-good { color: #137333; font-weight: 700; }
.ka-bad { color: #C5221F; font-weight: 700; }
.ka-tablewrap { overflow-x: auto; }
.pc-table.wide { min-width: 820px; }
.ka-why { white-space: normal; min-width: 200px; font-size: 11.5px; color: #4A5160; line-height: 1.5; }
tr.ka-row-good { background: #F5FCF7; }
tr.ka-row-bad { background: #FEF7F6; }
.ka-sev { padding: 1px 6px; border-radius: 7px; font-size: 10px; font-weight: 800; background: #FBEFD8; color: #8A5A0B; }
.ka-sev.high { background: #FBE7E7; color: #A03030; }

.ka-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.ka-stat { flex: 1 1 120px; min-width: 110px; padding: 9px 11px; border-radius: 10px;
  background: #F7F9FC; border: 1px solid #E2E7F0; display: flex; flex-direction: column; gap: 2px; }
.ka-stat span { font-size: 11px; color: var(--muted); font-weight: 700; }
.ka-stat b { font-size: 17px; font-weight: 800; color: var(--navy); line-height: 1.15; }
.ka-stat em { font-size: 10.5px; color: var(--muted); font-style: normal; }

.ka-spark { display: flex; align-items: flex-end; gap: 2px; height: 44px; margin-top: 4px; }
.ka-bar { flex: 1 1 auto; min-width: 2px; background: #A8BEDD; border-radius: 2px 2px 0 0; cursor: help; }
.ka-bar:hover { background: #2B3A55; }
.ka-bar.capped { background: #E38B87; }
.ka-bar.capped:hover { background: #C5221F; }
.ka-spark-cap { margin-top: 4px; font-size: 10.5px; color: var(--muted); }

.ka-season { display: flex; align-items: flex-end; gap: 5px; height: 52px; margin-top: 4px; }
.ka-season-col { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: help; }
.ka-season-bar { width: 100%; max-width: 26px; background: #A8BEDD; border-radius: 3px 3px 0 0; }
.ka-season-bar.peak { background: #E38B87; }
.ka-season-bar.low { background: #9FC6E8; }
.ka-season-m { font-size: 10px; color: var(--muted); font-weight: 700; }

@media (max-width: 720px) {
  .ka-stat { flex: 1 1 45%; min-width: 0; }
  .ka-stat b { font-size: 15px; }
  .ka-tips { font-size: 11.5px; }
}

/* 블로그 순위 자동 수집 상태 바 */
.ka-auto { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px;
  padding: 8px 10px; border-radius: 9px; background: #F7F9FC; border: 1px solid #E2E7F0; font-size: 11.5px; }
.ka-auto .muted { flex: 1 1 220px; }
.ka-auto-cnt { display: flex; align-items: center; gap: 5px; font-weight: 700; color: var(--navy); }
.ka-auto-cnt select { font-size: 11.5px; padding: 2px 5px; border-radius: 6px; border: 1px solid #C3D6F5; background: #fff; }
.ka-auto-list { margin-bottom: 9px; font-size: 11px; line-height: 1.9; }

/* 관련성 필터 — 걸러낸 내역 / 보류 구역 / 사전 관리 */
.ka-filter { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 8px;
  padding: 7px 10px; border-radius: 9px; background: #FBF7F7; border: 1px solid #E9DADA; font-size: 11.5px; }
.ka-filter b { color: #A03030; }
.ka-hold { margin-top: 12px; padding: 8px 10px; border-radius: 9px;
  background: #FFFCF4; border: 1px solid #EFE2C2; }
.ka-hold > summary { cursor: pointer; font-size: 12.5px; font-weight: 700; color: #8A5A0B; }
.ka-hold[open] > summary { margin-bottom: 8px; }
.kd-add { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.kd-add input { flex: 1 1 180px; padding: 5px 8px; border-radius: 7px; border: 1px solid var(--line); font-size: 12.5px; }
.kd-add select { padding: 5px 7px; border-radius: 7px; border: 1px solid var(--line); font-size: 12.5px; }
.kd-builtin { margin-top: 7px; font-size: 11px; line-height: 1.9; }
.kd-builtin b { display: block; margin: 7px 0 3px; font-size: 11.5px; color: var(--navy); }

/* ⑨ 입찰가 손익 판정 — 판정 뱃지 */
.ka-verdict { display: inline-block; padding: 1px 7px; border-radius: 8px; font-size: 10.5px; font-weight: 800; white-space: nowrap; }
.ka-verdict.ka-v-raise { background: #DDF6E6; color: #116B32; }
.ka-verdict.ka-v-lower { background: #FBE7E7; color: #A03030; }
.ka-verdict.ka-v-keep { background: #EFEEEA; color: #5A5E66; }
tr.ka-v-raise { background: #F6FCF8; }
tr.ka-v-lower { background: #FEF8F7; }

/* 키워드 화면 섹션 제목 — ① 파워링크 / ② 블로그 / ③ 파워컨텐츠 */
.kw-sec-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px;
  margin: 18px 0 8px; padding: 8px 12px; border-radius: 10px;
  background: linear-gradient(90deg, #EEF2F9, #F8FAFD); border: 1px solid #DCE3EE; }
.kw-sec-head:first-of-type { margin-top: 10px; }
.kw-sec-head .kw-sec-no { display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: #fff;
  font-size: 12px; font-weight: 800; }
.kw-sec-head b { font-size: 14px; color: var(--navy); }
.kw-sec-head .muted { font-size: 11.5px; }
.kw-nav-sep { display: inline-block; width: 1px; height: 14px; background: var(--line); margin: 0 3px; }
@media (max-width: 720px) {
  .kw-sec-head { margin: 14px 0 6px; padding: 7px 10px; }
  .kw-sec-head b { font-size: 13px; }
  .kw-sec-head .muted { display: none; }
}

/* 📝 블로그관리 — 우리 블로그 등록 상태 바 */
.kb-acc { display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 10px 0; padding: 9px 12px; border-radius: 10px; font-size: 12.5px; }
.kb-acc.ok { background: #F2FBF5; border: 1px solid #C5E8D1; }
.kb-acc.warn { background: #FFFBF2; border: 1px solid #F0D9A0; }
.kb-acc-i { padding: 1px 8px; border-radius: 8px; background: #fff; border: 1px solid var(--line);
  font-size: 11.5px; font-weight: 700; color: var(--navy); }
.kb-acc .muted { flex: 1 1 200px; font-size: 11.5px; }

/* 항목이 많은 분석 표 — 카드를 늘리지 않고 표 안에서 스크롤 (머리글 고정) */
.ka-tablewrap.ka-scroll { max-height: 360px; overflow-y: auto; overflow-x: auto;
  border: 1px solid var(--line); border-radius: 8px; }
.ka-tablewrap.ka-scroll table { border-collapse: separate; border-spacing: 0; }
.ka-tablewrap.ka-scroll thead th { position: sticky; top: 0; z-index: 2;
  background: #F3F6FB; box-shadow: inset 0 -1px 0 var(--line); }
@media (max-width: 720px) { .ka-tablewrap.ka-scroll { max-height: 300px; } }

/* 블로그관리 — 표시 개수 선택 바 */
.kb-showbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 6px 0 7px; font-size: 11.5px; }
.kb-showbar label { display: flex; align-items: center; gap: 5px; font-weight: 700; color: var(--navy); }
.kb-showbar select { font-size: 11.5px; padding: 2px 5px; border-radius: 6px; border: 1px solid #C3D6F5; background: #fff; }

/* ── 순위 알약 — 밝은 배경·어두운 배경 모두에서 읽히도록 바탕+글자+테두리를 함께 준다 ── */
.rk { display: inline-block; min-width: 40px; padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 800; line-height: 1.5; text-align: center; white-space: nowrap;
  border: 1px solid transparent; }
.rk-top  { background: #D8F5E3; color: #0B5C2A; border-color: #8FD9AE; }   /* 1~3위 */
.rk-mid  { background: #DBE9FF; color: #0B3D8F; border-color: #9DBFF0; }   /* 4~10위 */
.rk-low  { background: #FFE8CC; color: #8A4A00; border-color: #F0BC7A; }   /* 11~20위 */
.rk-out  { background: #E9E9E6; color: #4A4A4A; border-color: #C9C9C4; }   /* 권외 */
.rk-flat { background: #EFEFEC; color: #55585E; border-color: #D5D5D0; }
.rk-up   { background: #D8F5E3; color: #0B5C2A; border-color: #8FD9AE; }   /* 상승 */
.rk-down { background: #FFE0DE; color: #8E1B17; border-color: #F0A8A4; }   /* 하락 */
.rk-none { background: transparent; color: #9A9A96; border-color: transparent; min-width: 0; }
/* 어두운 배경에서도 대비 유지 */
@media (prefers-color-scheme: dark) {
  .rk-top  { background: #143D28; color: #7CE6A8; border-color: #2F7A50; }
  .rk-mid  { background: #12294D; color: #8FBEFF; border-color: #2C5A9E; }
  .rk-low  { background: #4A2E0A; color: #FFC786; border-color: #8A5A1E; }
  .rk-out, .rk-flat { background: #2C2C2C; color: #C8C8C4; border-color: #4A4A48; }
  .rk-up   { background: #143D28; color: #7CE6A8; border-color: #2F7A50; }
  .rk-down { background: #4A1A18; color: #FFA9A4; border-color: #8E3B36; }
}
/* 키워드 클릭 버튼 */
.kb-kw { background: none; border: none; padding: 0; font: inherit; font-weight: 700;
  color: var(--navy); cursor: pointer; text-align: left; text-decoration: underline;
  text-decoration-color: rgba(43,58,85,.3); text-underline-offset: 3px; }
.kb-kw:hover { text-decoration-color: currentColor; }
/* 순위 변화 그래프 */
.kbt-chart { border: 1px solid var(--line); border-radius: 9px; padding: 8px 6px 4px; background: #FBFCFE; }
.kbt-line { fill: none; stroke: #2B3A55; stroke-width: 2; }
.kbt-grid { stroke: #E2E7F0; stroke-width: 1; }
.kbt-top { fill: #16A34A; } .kbt-mid { fill: #2563EB; } .kbt-low { fill: #D97706; } .kbt-out { fill: #9A9A96; }
.kbt-axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: 2px; }

/* 블로그 표 — 800개 이상을 훑을 수 있게 약 20줄 높이 */
.ka-tablewrap.kb-tall { max-height: 640px; }
@media (max-width: 720px) { .ka-tablewrap.kb-tall { max-height: 460px; } }
/* 수집 대기열 진행 표시 */
.kb-queue { margin: 8px 0 10px; padding: 9px 11px; border-radius: 9px;
  background: #F4F8FF; border: 1px solid #D6E4FB; font-size: 12px; }
.kb-queue-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.kb-bar { height: 7px; border-radius: 4px; background: #DCE6F5; overflow: hidden; }
.kb-bar span { display: block; height: 100%; background: #2B3A55; transition: width .3s; }
@media (prefers-color-scheme: dark) {
  .kb-queue { background: #16233A; border-color: #2C4468; }
  .kb-bar { background: #2A3A54; } .kb-bar span { background: #7FA8E8; }
}

/* ───────────────── 📊 블로그모니터 ───────────────── */
.bm-status { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 12px;
  padding: 7px 11px; margin: 8px 0 12px; background: #F4F6FA; border: 1px solid var(--line); border-radius: 8px; }
.bm-sub { font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 4px 0 7px; display: flex; align-items: center; }
.bm-sub2 { font-size: 12.5px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }

/* 우리 블로그 / 경쟁 블로그를 각각 담는 칸 — 왼쪽 색띠로 구분한다 */
.bm-group { border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px 13px;
  margin-bottom: 13px; background: var(--surface); border-left: 4px solid var(--c-blue-fg); }
.bm-group.rival { border-left-color: #8A8F99; }
.bm-group-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 10px; }
.bm-group-head h3 { font-size: 14px; margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px; }
.bm-group-head h3 .muted { font-size: 11.5px; font-weight: 400; }
.bm-cnt { font-size: 12px; font-weight: 800; color: var(--c-blue-fg);
  background: var(--c-blue-bg); border-radius: 9px; padding: 2px 9px;
  font-variant-numeric: tabular-nums; }
.bm-cnt.posts { color: #5B2FA8; background: #EFE8FB; }
.bm-group.rival .bm-cnt { color: var(--c-gray-fg); background: var(--c-gray-bg); }
.bm-group.rival .bm-cnt.posts { color: #5B2FA8; background: #EFE8FB; }

/* 맨 위 총계 — 우리 / 경쟁 / 합계 */
.bm-total { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 14px; }
.bm-tot-cell { padding: 11px 14px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); border-left: 5px solid #8A8F99; }
.bm-tot-cell.ours { border-left-color: var(--c-blue-fg); background: #F5F9FF; }
.bm-tot-cell.rival { border-left-color: #8A8F99; background: #FAFAFB; }
.bm-tot-cell.all { border-left-color: #5B2FA8; background: #FAF8FE; }
.bm-tot-cell span { display: block; font-size: 12px; font-weight: 800; color: #4A5468; }
.bm-tot-cell b { display: block; font-size: 30px; font-weight: 800; line-height: 1.1; color: var(--navy);
  font-variant-numeric: tabular-nums; letter-spacing: -1px; margin: 2px 0 3px; }
.bm-tot-cell b i { font-size: 14px; font-weight: 700; font-style: normal; margin-left: 3px; letter-spacing: 0; }
.bm-tot-cell.ours b { color: #0B4FB3; }
.bm-tot-cell.all b { color: #5B2FA8; }
.bm-tot-cell em { display: block; font-size: 12px; font-weight: 700; font-style: normal; color: #3C4557;
  font-variant-numeric: tabular-nums; }
.bm-tot-cell u { display: block; font-size: 11px; color: var(--muted); text-decoration: none; margin-top: 2px; }
@media (max-width: 720px) { .bm-total { grid-template-columns: 1fr; gap: 7px; } }
.bm-group-act { display: flex; gap: 5px; flex-wrap: wrap; }
.bm-empty { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted);
  padding: 14px; text-align: center; border: 1px dashed var(--line); border-radius: 9px; }
.bm-gname { padding: 0 6px !important; line-height: 1.6; }
/* 우리 / 경쟁 사이 분리선 */
.bm-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 12px; }
.bm-divider::before, .bm-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.bm-divider span { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: 2px; }
.bm-newgroup { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; font-size: 11.5px; }

/* 카드 순서 바꾸기 */
.bm-move { display: inline-flex; gap: 2px; margin-right: 3px; }
.bm-move .btn { padding: 2px 6px !important; }
.bm-card[draggable="true"] { cursor: grab; }
.bm-card.dragging { opacity: .45; cursor: grabbing; }
.bm-grid.over { outline: 2px dashed var(--c-blue-fg); outline-offset: 4px; border-radius: 9px; }
/* 언제부터 모았는지 */
.bm-since { font-size: 11px; color: var(--ink); margin-top: 7px; display: flex;
  flex-wrap: wrap; gap: 5px; align-items: baseline; }
.bm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 11px; }

.bm-card { border: 1px solid var(--line); border-radius: 11px; background: var(--surface); padding: 11px 12px; }
.bm-card.off { opacity: .6; }
.bm-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.bm-name { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 13.5px; }
.bm-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-link { text-decoration: none; color: var(--muted); font-size: 12px; }
.bm-link:hover { color: var(--navy); }
.bm-kind { font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 7px; flex: none; }
.bm-kind.ours { background: var(--c-blue-bg); color: var(--c-blue-fg); }
.bm-kind.rival { background: var(--c-gray-bg); color: var(--c-gray-fg); }
.bm-grade { font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 10px; white-space: nowrap; flex: none; }
.bm-grade.good { background: var(--c-green-bg); color: var(--c-green-fg); }
.bm-grade.warn { background: var(--c-amber-bg); color: var(--c-amber-fg); }
.bm-grade.bad  { background: var(--c-red-bg); color: var(--c-red-fg); }
.bm-grade.col  { background: var(--c-gray-bg); color: var(--c-gray-fg); }
.bm-err { font-size: 11.5px; color: var(--c-red-fg); background: var(--c-red-bg); border-radius: 6px;
  padding: 4px 7px; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 숫자 칸 — 6개를 한 줄에 우겨넣으면 글자가 작아져 안 읽힌다. 3칸 × 2줄로 크게 보여준다.
   숫자는 tabular-nums 로 자릿수를 맞춰 위아래가 가지런히 떨어지게 한다. */
.bm-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 9px; }
.bm-n { text-align: center; padding: 7px 3px; background: #F4F7FC; border: 1px solid #E7EDF6; border-radius: 8px; }
.bm-n.hl { background: #E6EFFD; border-color: #C5D9F7; }
.bm-n.post { background: #F2EEFB; border-color: #DDD2F2; }
.bm-n span { display: block; font-size: 11px; color: #5A6478; font-weight: 700; letter-spacing: -.2px; }
.bm-n b { display: block; font-size: 20px; font-weight: 800; color: var(--navy); line-height: 1.15;
  font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.bm-n.hl b { color: #0B4FB3; }
.bm-n.post b { color: #5B2FA8; }
.bm-n em { display: block; font-size: 10px; color: #7A8296; font-style: normal; margin-top: 2px; }

.bm-chg { font-size: 10px; font-weight: 800; }
.bm-chg.up { color: #137333; } .bm-chg.down { color: #C5221F; } .bm-chg.flat { color: var(--muted); }

/* 막대 스파크라인 — 막대 하나가 하루 */
.bm-spark { display: flex; align-items: flex-end; gap: 1.5px; }
.bm-spark.empty { align-items: center; justify-content: center; font-size: 11px; color: var(--muted); height: 34px; }
/* max-width 는 첫 며칠(막대 1~2개)에 막대가 카드 전체로 늘어나 '로딩 막대'처럼 보이는 것을 막는다 */
.bm-spark i { flex: 1 1 auto; min-width: 2px; max-width: 16px; background: #A8BEDD; border-radius: 2px 2px 0 0; cursor: help; }
.bm-spark i.post { background: #1A56C4; }
.bm-spark i.part { background: repeating-linear-gradient(45deg, #D5DCE6 0 3px, #EDF0F5 3px 6px); }
.bm-spark i:hover { background: var(--navy); }
.bm-legend { display: inline-block; width: 9px; height: 9px; border-radius: 2px; vertical-align: -1px; }
.bm-legend.post { background: #1A56C4; }
.bm-legend.part { background: repeating-linear-gradient(45deg, #D5DCE6 0 3px, #EDF0F5 3px 6px); }

.bm-goal { font-size: 11.5px; font-weight: 700; margin-top: 7px; padding: 4px 8px; border-radius: 7px; }
.bm-goal.ok { background: var(--c-green-bg); color: var(--c-green-fg); }
.bm-goal.warn { background: var(--c-amber-bg); color: var(--c-amber-fg); }
.bm-goal.bad { background: var(--c-red-bg); color: var(--c-red-fg); }
.bm-advice { font-size: 11.5px; color: var(--ink); background: #FFFBEC; border: 1px solid #F0E3BC;
  border-radius: 7px; padding: 5px 8px; margin-top: 7px; line-height: 1.4; }
.bm-memo { font-size: 11.5px; color: var(--muted); margin-top: 6px; padding: 4px 8px;
  background: #F4F6FA; border-radius: 7px; line-height: 1.4; }
.bm-card-foot { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
/* 블로그관리에 등록된 블로그를 눌러서 바로 채우는 줄 */
.bm-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; font-size: 11.5px;
  padding: 7px 9px; margin-bottom: 10px; background: #F4F6FA; border: 1px solid var(--line); border-radius: 8px; }
/* 모달 하단 버튼줄에 섞이는 링크형 버튼도 버튼처럼 보이게 */
.modal-actions a.btn { display: inline-flex; align-items: center; text-decoration: none; }

/* 상세 모달 */
.bm-detail-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 11.5px; }
.bm-reasons { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.bm-reasons span { font-size: 11px; background: #F0F3F8; border: 1px solid var(--line);
  border-radius: 9px; padding: 2px 8px; color: var(--muted); font-weight: 600; }
.bmc-wrap { border: 1px solid var(--line); border-radius: 9px; padding: 8px 6px 5px; background: var(--surface); }
.bmc-area { fill: rgba(26,86,196,.10); stroke: none; }
.bmc-line { fill: none; stroke: #1A56C4; stroke-width: 2; stroke-linejoin: round; }
.bmc-avg { stroke: #A6760B; stroke-width: 1.2; stroke-dasharray: 5 3; }
.bmc-dot { fill: #1A56C4; }
.bmc-dot.post { fill: #C9476F; }
.bmc-dot.part { fill: #C3CBD8; }
.bmc-axis { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-top: 3px; }

.bm-anom { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.bm-anom-i { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 9px; }
.bm-anom-i.spike { background: var(--c-green-bg); color: var(--c-green-fg); }
.bm-anom-i.drop { background: var(--c-red-bg); color: var(--c-red-fg); }

.bm-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 13px; }
.bm-dow { display: flex; align-items: flex-end; gap: 4px; height: 78px; }
.bm-dow-i { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.bm-dow-i i { width: 100%; background: #A8BEDD; border-radius: 3px 3px 0 0; cursor: help; }
.bm-dow-i span { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.bm-pub { display: flex; gap: 6px; margin-bottom: 7px; }
.bm-pub div { flex: 1; text-align: center; background: #F7F9FC; border-radius: 7px; padding: 5px 3px; }
.bm-pub span { display: block; font-size: 10px; color: var(--muted); font-weight: 700; }
.bm-pub b { font-size: 14px; color: var(--navy); }
.bm-lastpost { font-size: 11.5px; line-height: 1.5; }
.bm-lastpost a { color: #1A56C4; }
.bm-advice-list { margin: 0; padding-left: 19px; font-size: 12.5px; line-height: 1.65; }

/* 시간대별 유입 */
.bm-intra { max-height: 340px; overflow-y: auto; overflow-x: hidden; }
/* 막대는 '남는 폭'을 쓰는 트랙 안에서만 늘어나야 한다.
   막대 자체에 width:%를 주면 100%일 때 옆 글자를 화면 밖으로 밀어낸다. */
.bm-intra-row { display: flex; align-items: center; gap: 7px; font-size: 11.5px; padding: 2px 0; }
.bm-intra-row .t { flex: none; width: 42px; color: var(--muted); font-weight: 700; }
.bm-intra-row .bar { flex: 1 1 auto; min-width: 30px; }
.bm-intra-row .bar i { display: block; height: 11px; background: #A8BEDD; border-radius: 3px; }
.bm-intra-row .v { flex: none; white-space: nowrap; }
.bm-intra-row .v em { color: var(--muted); font-style: normal; font-size: 10.5px; }
.bm-intra-row.hot .bar i { background: #C9476F; }
.bm-intra-row .flag { font-size: 10px; font-weight: 800; color: var(--c-red-fg);
  background: var(--c-red-bg); border-radius: 7px; padding: 1px 6px; }

.bm-legend-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 9px; font-size: 11.5px; }
.bm-leg { display: flex; align-items: center; gap: 4px; }
.bm-leg i { width: 14px; height: 3px; border-radius: 2px; display: block; }
.bm-leg em { color: var(--muted); font-style: normal; }

/* 입력 폼 */
.bm-form { display: flex; flex-direction: column; gap: 9px; }
.bm-form label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 700; color: var(--navy); }
.bm-form input, .bm-form select { padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px;
  font-size: 13px; font-weight: 400; background: var(--surface); color: var(--ink); }
.bm-form label.bm-check { flex-direction: row; align-items: center; gap: 6px; font-weight: 600; }
.bm-form label.bm-check input { width: auto; }

@media (max-width: 640px) {
  .bm-grid { grid-template-columns: 1fr; }
  .bm-two { grid-template-columns: 1fr; }
  .bm-nums { grid-template-columns: repeat(3, 1fr); }
}
/* 블로그모니터는 다크모드 전용 색을 두지 않는다.
   이 앱은 다크모드에서도 --bg/--surface 를 바꾸지 않는 "라이트 전용"이라,
   여기만 어두운 색을 주면 밝은 페이지 위에 검은 카드가 얹혀 오히려 읽기 나빠진다. */

/* 면접 일정 목록 — 학사시스템에서 면접완료자로 바뀐 학생 */
.itv-done-badge { display: inline-block; margin-left: 5px; padding: 0 6px; border-radius: 7px; font-size: 10.5px; font-weight: 800;
  line-height: 17px; background: #E6F4EA; color: #137333; vertical-align: middle; }


/* 예치금 마감일 요일 · 등록금잔액 */
.dl-dow { color: #1A56C4; font-weight: 800; }
.finance-readonly.tuition-remain b { font-size: 15px; }

/* template peek / queue full view */
.tpl-peek-box .peek-label, .peek-label { font-size: 11.5px; font-weight: 700; color: #1A3A6B; margin: 6px 0 2px; }
.q-full-body { white-space: pre-wrap; font-size: 13px; line-height: 1.7; background: #FBFAF7; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; max-height: 60vh; overflow: auto; }


/* 로컬 AI 요약·초안 (2026-11) */
.ai-box, .ai-reply { margin-top: 10px; background: #F5F8FF; border: 1px solid #CFDDF7; border-radius: 10px; padding: 10px 12px; }
.ai-reply summary { cursor: pointer; font-weight: 700; color: #1A3A6B; }
.ai-reply textarea { width: 100%; margin-top: 8px; }
.ai-head { font-size: 12.5px; font-weight: 700; color: #1A3A6B; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ai-head .muted { font-weight: 400; }
.ai-body { white-space: pre-wrap; font-size: 13.5px; line-height: 1.75; color: var(--ink); }
.ai-body-edit { width: 100%; font-size: 13.5px; line-height: 1.7; }
.ai-wait { font-size: 12.5px; color: var(--muted); }
.ai-err { font-size: 12.5px; color: #C5221F; }
