/* ───────────────────────────────────────────────────────────────
   base.css 에 있던 반응형 @media 블록을 그대로 옮겨왔다.
   components.css 가 base 뒤에 로드되므로, 이 블록들이 그보다 더 뒤에
   와야 원래의 우선순위(모바일이 데스크톱 값을 덮어씀)가 유지된다.
   순서를 바꾸지 말 것.
   ─────────────────────────────────────────────────────────────── */
@media (max-width:700px){.home-top-split{grid-template-columns:1fr}}
@media (max-width:1024px){.home-split,.home-ac-split,.ac-fixed3{grid-template-columns:1fr!important}}
@media (max-width:900px){.memo-split{grid-template-columns:1fr}.memo-pane-write{position:static}#memoList{max-height:none}}
@media (max-width:820px){.memo-card.expanded{grid-column:auto}}
@media (max-width: 1024px) {
  /* 화면 밖 고정 패널(사이드바 드로어·학사 패널)이 만드는 유령 가로스크롤 차단 */
  html { overflow-x: clip; }
  body { display: block; }

  /* ── 사이드바 → 드로어 ── */
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; width: 264px; z-index: 1200; }
  body.nav-open .sidebar { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.28); }
  .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45);
                     opacity: 0; pointer-events: none; transition: opacity .22s ease; z-index: 1100; }
  body.nav-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }

  .main { margin-left: 0; width: 100%; }

  /* ── 상단바 ── */
  .topbar { padding: 0 12px; gap: 8px; height: 52px; }
  .hamburger { display: flex; align-items: center; justify-content: center;
               width: 38px; height: 38px; flex-shrink: 0; border: 1px solid #e2e8f0;
               border-radius: 8px; background: #fff; cursor: pointer; font-size: 17px;
               color: #475569; padding: 0; }
  .topbar-badge { display: none; }
  .topbar-title { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-search { display: none; }

  .page { padding: 12px 12px 40px; }
  .card { padding: 13px; border-radius: 11px; }
  .welcome-card { padding: 15px 16px; }

  /* ── 그리드/플렉스 자식이 min-content 때문에 안 줄어드는 문제 차단 ── */
  .main, .page, #pageContent, .card,
  [style*="display:grid"] > *, [style*="display:flex"] > * { min-width: 0; }

  /* ── 그리드 세로 스택 (인라인 style 이라 !important 필요) ──
     기본: 모든 그리드를 1열로. 통계 타일만 아래에서 예외 처리 ── */
  [style*="grid-template-columns"] { grid-template-columns: minmax(0,1fr) !important; }

  /* flex 2단 레이아웃(본문 + 고정폭 사이드) → 세로 스택 */
  [style*="align-items:flex-start"][style*="display:flex"] { flex-wrap: wrap; }
  [style*="width:190px;flex-shrink:0"], [style*="width:210px;flex-shrink:0"],
  [style*="width:220px;flex-shrink:0"] { width: 100% !important; }

  /* 클래스로 정의된 다단 레이아웃도 1열로 */
  .mid-row, .bottom-row, .cal-full-wrap, .two-col, .report-summary
    { grid-template-columns: minmax(0,1fr) !important; }

  /* 예외 ① 달력 — 7열 유지 (1열로 펴지면 깨짐) */
  [style*="repeat(7,1fr)"] { grid-template-columns: repeat(7, minmax(0,1fr)) !important; }
  .cal-days-hd, .cal-grid, .cal-full-days-hd, .cal-full-grid-cells
    { grid-template-columns: repeat(7, minmax(0,1fr)) !important; }
  .cal-cell { min-width: 0; overflow: hidden; min-height: 58px; padding: 3px 2px; }
  .cal-cell-num { font-size: 10.5px; }
  .cal-cell-num.today-num { width: 18px; height: 18px; font-size: 10px; }
  .cal-event { font-size: 8.5px; padding: 1px 3px; margin-top: 2px; }
  .cal-days-hd > *, .cal-full-days-hd > * { font-size: 10px; }

  /* 예외 ② 통계 타일 — 폭에 맞춰 자동 배치 (빈칸 생기지 않게) */
  .stat-row { grid-template-columns: repeat(auto-fit, minmax(150px,1fr)) !important; gap: 9px; }
  #_brMyStats[style*="grid-template-columns"],
  [style*="grid-template-columns"].stat-row { grid-template-columns: repeat(auto-fit, minmax(96px,1fr)) !important; }

  /* ── 표: 컨테이너를 가로 스크롤시킴 (table 자체는 건드리지 않아 열 정렬 유지) ── */
  .tbl-wrap, .card, #pageContent > div { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #pageContent table { min-width: max-content; }
  #pageContent td, #pageContent th { white-space: nowrap; }
  #pageContent td[title] { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
  [style*="min-width:900px"], [style*="min-width:750px"],
  [style*="min-width:600px"] { min-width: 0 !important; }

  /* ── 모달: 전체폭 ── */
  .modal { width: 100% !important; max-width: 100% !important; max-height: 92vh !important;
           border-radius: 14px 14px 0 0; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal-header { padding: 16px 16px 12px; }

  /* ── 브릭관리: 공유 조회 패널 숨김 (등록 시 중복체크가 같은 정보를 보여줌) ── */
  #_brSharedCard { display: none !important; }

  /* ── 학사 패널 ── */

  /* ── 터치 타겟 ── */
  .btn, .btn-primary { min-height: 38px; padding: 9px 14px; }
  .nav-item { padding: 11px 12px; font-size: 13.5px; }
  .form-group input, .form-group select, .form-group textarea { font-size: 16px; padding: 10px 11px; }
  input, select, textarea { font-size: 16px; }   /* iOS 자동 확대 방지 */
}
@media (max-width: 600px) {
  .page { padding: 10px 10px 40px; }
}

/* ═══════════════════════════════════════════════════════════════════
   mobile.css — PHASE 5 모바일 레이아웃
   base.css 의 1024px 블록이 기본 드로어·1열 스택을 담당하고,
   이 파일은 그보다 작은 화면(태블릿 세로·휴대폰)에서 실제로 손이 닿는
   크기·간격·겹침만 손본다. base.css 뒤에 로드되므로 여기 규칙이 이긴다.
   ═══════════════════════════════════════════════════════════════════ */

/* ── 태블릿 세로 이하 (≤768px) ───────────────────────────────────── */
@media (max-width: 768px){

  /* 우측 플로팅 학사일정 패널은 화면을 가린다 */
  #acPanel, #acPanelToggle { display: none !important; }

  /* 통계 타일 — 2열 고정. auto-fit 이면 4열이 눌려 글자가 깨진다 */
  .stat-row { grid-template-columns: repeat(2, minmax(0,1fr)) !important; gap: 8px; }
  .stat-card { padding: 12px 13px; }
  .stat-value { font-size: 19px; }
  .stat-label { font-size: 11px; }

  /* 페이지 제목줄 — 제목과 버튼이 한 줄에 안 들어간다 */
  .page-hd-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .page-action-btns { flex-wrap: wrap; }
  #pageActions { display: flex; flex-wrap: wrap; gap: 6px; max-width: 100%; min-width: 0; }
  #pageActions .btn, #pageActions button { flex: 0 1 auto; min-width: 0; max-width: 100%; }

  /* 탭 바 — 가로로 밀어서 본다. 스크롤바는 숨기고 끝에 여백 */
  [style*="border-bottom:2px solid #e5e7eb"][style*="display:flex"]{
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  [style*="border-bottom:2px solid #e5e7eb"][style*="display:flex"]::-webkit-scrollbar{ display: none; }

  /* ── 학사 캘린더 (3-4) ── 날짜 칸만 낮춘다. 요일 머리글은 건드리지 않는다 */
  .accal-cells > div { min-height: 62px !important; padding: 3px 3px 4px !important; }
  .accal-cells div[title] { font-size: 9px !important; padding: 0 3px !important; }

  /* ── 학생관리 상태 카드 4개 — 한 줄 가로 배치 ──────────────────
     base 의 1열 강제 규칙을 덮는다. 세로로 길게 쌓이면 화면을 다 먹는다. */
  .stu-stat4 { grid-template-columns: repeat(4, minmax(0,1fr)) !important;
               grid-template-rows: auto !important; gap: 6px !important; height: auto !important; }
  .stu-stat4 .stu-chip { margin: 0 !important; padding: 8px 4px !important; text-align: center;
                         display: flex; flex-direction: column; justify-content: center; min-height: 58px; }
  .stu-stat4 .stu-chip .label { font-size: 10.5px !important; white-space: nowrap; margin-bottom: 1px; }
  .stu-stat4 .stu-chip .value { font-size: 17px !important; line-height: 1.15; }
  /* '클릭하여 조회' 안내는 모바일에서 자리만 먹는다 */
  .stu-stat4 .stu-chip > div:last-child { display: none; }

  /* 둘째 줄 — 컨택일자 지난 DB / 예정·가망건 좌우 반반 */
  .stu-row2 { display: grid !important; grid-template-columns: 1fr 1fr !important;
              gap: 6px !important; height: auto !important; margin-top: 6px; }
  /* 위 4칸과 같이 가운데 정렬 — 왼쪽으로 쏠려 보이지 않게 */
  .stu-row2 .stu-chip2 { margin: 0 !important; padding: 9px 8px !important; min-height: 60px;
                         display: flex; flex-direction: column; justify-content: center;
                         align-items: center; text-align: center; }
  .stu-row2 .stu-chip2 .label { font-size: 11px !important; white-space: nowrap; text-align: center;
                                overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .stu-row2 .stu-chip2 .value { font-size: 18px !important; line-height: 1.15; text-align: center; }
  .stu-row2 .stu-chip2 > div:last-child { display: none; }

  /* ── 공지사항 3열 → 1열 (base 규칙이 잡지만 간격만 조정) ── */
  .notice-list-item { padding: 0; }

  /* ══ 학생 목록 — 표를 카드로 (모바일에서 가로 스크롤 없이 읽히게) ══
     .lead-tbl 만 바꾼다. 다른 표(브릭·FREE DB 등)는 기존대로 가로 스크롤.
     칸마다 data-c / data-lbl 이 붙어 있어 CSS 만으로 재배치한다.
     한 화면에 많이 들어오도록 최대한 눌러 담는다. */
  .lead-tbl { overflow-x: visible !important; background: none !important; }
  .lead-tbl table { min-width: 0 !important; width: 100% !important;
                    border-collapse: separate; border-spacing: 0; }
  .lead-tbl thead { display: none; }
  .lead-tbl tbody { display: block; }

  /* 한 행 = 한 카드
     [체크] [번호] [이름] ... [상태]
            [전화번호         ]
            [진행과정         ]
            [다음 컨택        ]
     왼쪽 색 띠는 각지게, 오른쪽만 둥글게. */
  .lead-tbl tbody tr {
    display: grid; grid-template-columns: auto auto minmax(0,1fr);
    column-gap: 7px; row-gap: 0; position: relative; align-items: center;
    background: #fff !important;
    border: 1px solid #e8edf5;
    border-left: 7px solid #cbd5e1;
    border-radius: 0 10px 10px 0;
    padding: 8px 10px 8px 9px; margin-bottom: 6px;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
  }
  /* 상태별 왼쪽 띠 — 표의 상태 뱃지 색과 맞춘다 */
  .lead-tbl tbody tr[data-status="가망"]      { border-left-color: #16a34a; }
  .lead-tbl tbody tr[data-status="가망높음"]  { border-left-color: #0d9488; }
  .lead-tbl tbody tr[data-status="결제예정"]  { border-left-color: #2563eb; }
  .lead-tbl tbody tr[data-status="등록완료"]  { border-left-color: #AE831F; }
  .lead-tbl tbody tr[data-status="장기"]      { border-left-color: #f43f5e; }
  .lead-tbl tbody tr[data-status="가망없음"]  { border-left-color: #9ca3af; }
  .lead-tbl tbody tr[data-status="부재"]      { border-left-color: #fb7185; }
  .lead-tbl tbody tr[data-status="환불"]      { border-left-color: #ea580c; }
  .lead-tbl tbody tr[data-status="FREE DB"]   { border-left-color: #8b5cf6; }
  /* 카드 아무 곳이나 누르면 상세(수정) 창 — 누를 수 있다는 표시 + 누르는 순간 반응 (table.js 모바일 탭) */
  .lead-tbl tbody tr[data-id] { cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .lead-tbl tbody tr[data-id]::after {
    content: '수정 ›'; position: absolute; right: 10px; bottom: 8px;
    font-size: 11px; font-weight: 700; color: var(--navy-600, #3A5F8F);
  }
  .lead-tbl tbody tr[data-id]:active { background: var(--navy-50, #F4F7FB) !important; }

  .lead-tbl tbody tr > td {
    border: none !important; padding: 0 !important;
    white-space: normal !important; max-width: none !important;
    width: auto !important; min-width: 0 !important;
  }

  /* 체크박스 — 왼쪽 열에 세로로 걸침 */
  .lead-tbl tbody tr > td:first-child:has(input[type=checkbox]) {
    grid-column: 1; grid-row: 1 / span 4; align-self: center;
  }
  .lead-tbl tbody tr > td input[type=checkbox] { width: 18px !important; height: 18px !important; }

  /* 1행 — 번호 + 이름 (상태는 오른쪽에 띄움) */
  .lead-tbl td[data-c="prospectNo"] {
    grid-column: 2; grid-row: 1;
    font-size: 11px !important; font-weight: 700; color: #94a3b8 !important;
    text-align: left !important; letter-spacing: .02em; font-variant-numeric: tabular-nums;
  }
  /* 원래 번호 글자는 숨기고 0 채운 값을 쓴다 */
  .lead-tbl td[data-c="prospectNo"] { font-size: 0 !important; }
  .lead-tbl td[data-c="prospectNo"]::before {
    content: attr(data-no); font-size: 11px; font-weight: 700; color: #94a3b8;
    letter-spacing: .02em; font-variant-numeric: tabular-nums;
  }
  .lead-tbl td[data-c="name"] {
    grid-column: 3; grid-row: 1;
    font-size: 14.5px; font-weight: 700; line-height: 1.3; padding-right: 72px !important;
  }
  .lead-tbl td[data-c="name"] strong { font-size: 14.5px; }

  /* 상태 뱃지 — 카드 오른쪽 위 고정 */
  .lead-tbl td[data-c="status"] { position: absolute; top: 7px; right: 9px; }

  /* 2~4행 — 번호 열부터 끝까지 가로질러 */
  .lead-tbl td[data-c="phone"],
  .lead-tbl td[data-c="course"],
  .lead-tbl td[data-c="nextRecontact"] { grid-column: 2 / -1; }
  .lead-tbl td[data-c="phone"]         { grid-row: 2; font-size: 12.5px; color: #334155 !important;
                                         font-weight: 500; line-height: 1.5; }
  .lead-tbl td[data-c="course"]        { grid-row: 3; font-size: 11.5px !important; color: #64748b !important;
                                         line-height: 1.5; white-space: nowrap !important;
                                         overflow: hidden; text-overflow: ellipsis; }
  .lead-tbl td[data-c="nextRecontact"] { grid-row: 4; font-size: 11.5px; line-height: 1.5; }
  .lead-tbl td[data-c="course"]::before,
  .lead-tbl td[data-c="nextRecontact"]::before {
    content: attr(data-lbl) " "; color: #b6c0cd; font-weight: 600; font-size: 10px; margin-right: 2px;
  }

  /* 자리만 먹는 칸은 접는다 — 상세 화면에서 본다.
     수정·복제·삭제도 폰에서는 숨긴다 (이름을 누르면 상세가 열린다) */
  .lead-tbl td[data-c="channel"],
  .lead-tbl td[data-c="distributedDate"],
  .lead-tbl td[data-c="education"],
  .lead-tbl td[data-c="assignedTo"],
  .lead-tbl td[data-c="score"],
  .lead-tbl td[data-c="unitPrice"],
  .lead-tbl td[data-c="memo"],
  .lead-tbl td[data-c="recontactToday"],
  .lead-tbl td[data-c="actions"] { display: none !important; }

  /* 호버 — base.css 의 표 전용 행 호버(칸마다 금색 테두리)는 카드에선 4겹으로 보인다.
     칸별 테두리를 끄고 카드 하나에만 테두리를 준다. */
  .lead-tbl tbody tr:hover > td,
  .lead-tbl tbody tr:hover > td:first-child,
  .lead-tbl tbody tr:hover > td:last-child { box-shadow: none !important; background: transparent !important; }
  .lead-tbl tbody tr:hover {
    border-color: #e0cfa0; box-shadow: 0 2px 10px rgba(174,131,31,.16);
  }
  .lead-tbl tbody tr:hover:has(> td[colspan]) { border-color: transparent; box-shadow: none; }

  /* '더 보기' · '데이터 없음' 줄은 카드로 만들지 않는다 */
  .lead-tbl tbody tr:has(> td[colspan]) {
    display: block; border: none; background: none; box-shadow: none;
    padding: 0; margin: 8px 0 0; border-radius: 0;
  }
  .lead-tbl tbody tr:has(> td[colspan]) > td { display: block; text-align: center; }

  /* ══ 팀원 가망노트 — 펼쳤을 때 표도 카드로 ══════════════════════
     학생 목록과 같은 모양. 여기도 .tp-tbl 만 바꾼다. */
  .tp-tbl { overflow-x: visible !important; background: none !important; }
  .tp-tbl table { min-width: 0 !important; width: 100% !important;
                  border-collapse: separate; border-spacing: 0; }
  .tp-tbl thead { display: none; }
  .tp-tbl tbody { display: block; padding: 8px 9px 9px; }

  .tp-tbl tbody tr {
    display: grid; grid-template-columns: minmax(0,1fr);
    row-gap: 0; position: relative;
    background: #fff; border: 1px solid #e8edf5;
    border-left: 7px solid #cbd5e1; border-radius: 0 10px 10px 0;
    padding: 8px 10px 8px 9px; margin-bottom: 6px;
  }
  .tp-tbl tbody tr:last-child { margin-bottom: 0; }
  .tp-tbl tbody tr[data-status="가망"]     { border-left-color: #16a34a; }
  .tp-tbl tbody tr[data-status="가망높음"] { border-left-color: #0d9488; }
  .tp-tbl tbody tr[data-status="결제예정"] { border-left-color: #2563eb; }
  .tp-tbl tbody tr[data-status="등록완료"] { border-left-color: #AE831F; }
  .tp-tbl tbody tr[data-status="장기"]     { border-left-color: #f43f5e; }
  .tp-tbl tbody tr[data-status="가망없음"] { border-left-color: #9ca3af; }
  .tp-tbl tbody tr[data-status="부재"]     { border-left-color: #fb7185; }
  .tp-tbl tbody tr[data-status="환불"]     { border-left-color: #ea580c; }
  .tp-tbl tbody tr[data-status="FREE DB"]  { border-left-color: #8b5cf6; }

  .tp-tbl tbody tr > td {
    border: none !important; padding: 0 !important;
    white-space: normal !important; max-width: none !important; width: auto !important;
  }
  /* 칸별 호버 테두리 끄고 카드 한 겹만 */
  .tp-tbl tbody tr:hover > td,
  .tp-tbl tbody tr:hover > td:first-child,
  .tp-tbl tbody tr:hover > td:last-child { box-shadow: none !important; background: transparent !important; }
  .tp-tbl tbody tr:hover { border-color: #e0cfa0; box-shadow: 0 2px 10px rgba(174,131,31,.16); }

  /* 이름 앞에 가망번호 */
  .tp-tbl td[data-c="name"] { font-size: 14.5px !important; font-weight: 700 !important;
                              line-height: 1.3; padding-right: 72px !important; }
  .tp-tbl td[data-c="name"]::before {
    content: attr(data-no) " "; font-size: 11px; font-weight: 700; color: #94a3b8;
    letter-spacing: .02em; font-variant-numeric: tabular-nums; margin-right: 4px;
  }
  .tp-tbl td[data-c="status"] { position: absolute; top: 7px; right: 9px; }
  .tp-tbl td[data-c="phone"] { font-size: 12.5px !important; color: #334155 !important;
                               font-weight: 500; line-height: 1.5; }
  .tp-tbl td[data-c="channel"],
  .tp-tbl td[data-c="nextRecontact"],
  .tp-tbl td[data-c="memo"] { font-size: 11.5px !important; color: #64748b !important; line-height: 1.5;
                              white-space: nowrap !important; overflow: hidden; text-overflow: ellipsis; }
  .tp-tbl td[data-lbl]::before {
    content: attr(data-lbl) " "; color: #b6c0cd; font-weight: 600; font-size: 10px; margin-right: 2px;
  }
  .tp-tbl td[data-c="phone"]::before { content: none; }
  .tp-tbl td[data-c="memo"] span { max-width: none !important; font-size: 11.5px !important; }

  /* '가망 DB 없음' 줄은 카드로 만들지 않는다 */
  .tp-tbl tbody tr:has(> td[colspan]) {
    display: block; border: none; background: none; padding: 0; margin: 0; border-radius: 0;
  }
  .tp-tbl tbody tr:has(> td[colspan]):hover { box-shadow: none; }

  /* 직원 머리줄 — 이름·건수가 한 줄에 안 들어간다 */
  #_tpBlockWrap .card > div:first-child { padding: 11px 13px !important; gap: 8px; }
  #_tpBlockWrap .card > div:first-child > div:last-child { gap: 8px !important; }

  /* 상단 요약 + 필터 드롭다운 */
  #_tpSummary { min-width: 0 !important; flex: 1 1 100% !important; font-size: 12.5px !important; }
  #tpStatusFilter, #tpChannelFilter { flex: 1 1 0; min-width: 0; font-size: 13px !important;
                                      padding: 8px 10px !important; }
  #tpFilter { width: 100%; font-size: 13px !important; padding: 9px 10px !important; }

  /* ══ 브릭 관리 — 내 후보 표를 카드로 ════════════════════════════
     이름 전화번호 / 년생 유입경로 / 면접날짜 면접시간 상태 / 메모
     데스크톱 표는 그대로. data-* 값으로 좌우 2칸을 만든다. */
  .br-tbl { overflow-x: visible !important; max-height: none !important; background: none !important; }
  .br-tbl table { min-width: 0 !important; width: 100% !important;
                  border-collapse: separate; border-spacing: 0; }
  .br-tbl thead { display: none; }
  .br-tbl tbody { display: block; }

  .br-tbl tbody tr {
    display: grid; grid-template-columns: minmax(0,1fr) auto;
    column-gap: 8px; row-gap: 2px; align-items: baseline;
    background: #fff; border: 1px solid #e8edf5;
    border-left: 7px solid #cbd5e1; border-radius: 0 10px 10px 0;
    padding: 9px 11px 9px 10px; margin-bottom: 6px;
  }
  .br-tbl tbody tr[data-status="합격"]     { border-left-color: #16a34a; }
  .br-tbl tbody tr[data-status="입사예정"] { border-left-color: #0d9488; }
  .br-tbl tbody tr[data-status="면접예정"] { border-left-color: #2563eb; }
  .br-tbl tbody tr[data-status="참석"]     { border-left-color: #AE831F; }
  .br-tbl tbody tr[data-status="불합격"]   { border-left-color: #dc2626; }
  .br-tbl tbody tr[data-status="불참석"]   { border-left-color: #9ca3af; }
  .br-tbl tbody tr[data-status="대기"]     { border-left-color: #cbd5e1; }

  .br-tbl tbody tr > td {
    border: none !important; padding: 0 !important; max-width: none !important;
    width: auto !important; white-space: normal !important; text-align: left !important;
  }
  .br-tbl tbody tr:hover > td,
  .br-tbl tbody tr:hover > td:first-child,
  .br-tbl tbody tr:hover > td:last-child { box-shadow: none !important; background: transparent !important; }
  .br-tbl tbody tr:hover { border-color: #e0cfa0; box-shadow: 0 2px 10px rgba(174,131,31,.16); }

  /* 1행 — 이름 | 전화번호 */
  .br-tbl td[data-c="name"]  { grid-column: 1; grid-row: 1; font-size: 14px !important; font-weight: 700; }
  .br-tbl td[data-c="name"] strong { font-size: 14px; }
  /* 이름 옆 년생 칩은 2행으로 옮기므로 1행에서는 숨긴다 */
  .br-tbl td[data-c="name"] span[title*="년생"] { display: none; }
  .br-tbl td[data-c="phone"] { grid-column: 2; grid-row: 1; font-size: 12.5px !important;
                               color: #334155 !important; font-weight: 500; white-space: nowrap !important; }

  /* 2행 — 년생 | 유입경로 (전화 칸의 data 값을 끌어다 쓴다) */
  .br-tbl td[data-c="name"]::after {
    content: attr(data-year); display: block; margin-top: 2px;
    font-size: 11px; font-weight: 600; color: #8B6718;
  }
  .br-tbl td[data-c="phone"]::after {
    content: attr(data-route); display: block; margin-top: 2px;
    font-size: 11px; font-weight: 500; color: #64748b; text-align: right;
  }

  /* 3행 — 면접날짜 면접시간 | 상태 */
  .br-tbl td[data-c="when"] { grid-column: 1; grid-row: 2; font-size: 0 !important; margin-top: 3px; }
  .br-tbl td[data-c="when"] > span { display: none !important; }
  .br-tbl td[data-c="when"]::before {
    content: attr(data-date) " " attr(data-time);
    font-size: 11.5px; font-weight: 600; color: #475569; white-space: nowrap;
  }
  .br-tbl td[data-c="status"] { grid-column: 2; grid-row: 2; justify-self: end;
                                line-height: 1.5 !important; margin-top: 3px; text-align: right !important; }

  /* 4행 — 메모 (한 줄 가로질러) */
  .br-tbl td[data-c="note"] {
    grid-column: 1 / -1; grid-row: 3; font-size: 11px !important; color: #64748b !important;
    margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .br-tbl td[data-c="note"]::before { content: attr(data-lbl) " "; color: #b6c0cd;
                                      font-weight: 600; font-size: 10px; margin-right: 2px; }
  /* 수정·삭제는 폰에서 숨긴다 — 공유 조회·상세에서 처리 */
  .br-tbl td[data-c="actions"] { display: none !important; }

  .br-tbl tbody tr:has(> td[colspan]) {
    display: block; border: none; background: none; padding: 0; margin: 0; border-radius: 0;
  }
  .br-tbl tbody tr:has(> td[colspan]):hover { box-shadow: none; }

  /* ══ 매출 보고 ════════════════════════════════════════════════
     KPI 4칸은 한 줄 가로, 그 아래 내 정보, 그 아래 조직목표·개인목표 좌우 반반 */
  .sr-kpi { grid-template-columns: repeat(4, minmax(0,1fr)) !important; gap: 6px !important; }
  .sr-kpi .stat-card { padding: 9px 5px !important; text-align: center; margin: 0 !important;
                       display: flex; flex-direction: column; justify-content: center; min-height: 66px; }
  .sr-kpi .stat-card .label { font-size: 9.5px !important; white-space: nowrap; letter-spacing: -.03em;
                              margin-bottom: 2px; }
  .sr-kpi .stat-card .value { font-size: 14px !important; line-height: 1.2; white-space: nowrap; }
  .sr-kpi .stat-card > div:last-child { font-size: 9px !important; margin-top: 1px !important;
                                        white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* 내 정보 — 한 줄 전체 */
  .sr-info-row { grid-template-columns: minmax(0,1fr) !important; gap: 10px !important; }
  .sr-me { padding: 13px 15px !important; }
  .sr-me > div:nth-child(2) { font-size: 17px !important; }

  /* 조직 목표 · 개인 목표 — 좌우 반반 유지 */
  .sr-goals { grid-template-columns: 1fr 1fr !important; gap: 10px !important; padding: 13px 14px !important; }
  .sr-goals > div:last-child { padding-left: 10px !important; }
  .sr-goals input[type=number] { font-size: 13px !important; padding: 7px 8px !important; }
  .sr-goals > div > div:first-child { font-size: 10.5px !important; }

  /* ══ 조직원별 매출 현황 — 한 줄 압축 ═══════════════════════════
     신의철 (나) 부장 14개월차 ↑김주민
     2건 · 30학점 · 8,300,000원   (금일 / 신규는 뒤에) */
  .sr-staff { overflow-x: visible !important; background: none !important; }
  /* table 을 block 으로 풀어야 tr 이 화면 폭을 다 쓴다 (flex 행이라 auto 폭이면 쪼그라든다) */
  .sr-staff table { display: block !important; min-width: 0 !important; width: 100% !important;
                    border-collapse: separate; border-spacing: 0; }
  .sr-staff thead { display: none; }
  .sr-staff tbody { display: block; width: 100%; padding: 8px 9px 9px; box-sizing: border-box; }
  .sr-staff tbody tr { width: 100%; box-sizing: border-box; }

  .sr-staff tbody tr {
    display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 5px; row-gap: 1px;
    background: #fff !important; border: 1px solid #eef1f5; border-left: 4px solid #e2e8f0;
    border-radius: 0 9px 9px 0; padding: 7px 10px 7px 9px; margin-bottom: 5px;
  }
  .sr-staff tbody tr[data-me] { border-left-color: #AE831F; background: #fffbeb !important; }
  .sr-staff tbody tr:last-child { margin-bottom: 0; }
  .sr-staff tbody tr:hover > td { box-shadow: none !important; background: transparent !important; }
  .sr-staff tbody tr:hover { border-color: #e0cfa0; }

  .sr-staff tbody tr > td {
    border: none !important; padding: 0 !important; white-space: nowrap !important;
    text-align: left !important; width: auto !important; max-width: none !important;
    font-size: 11px !important; color: #64748b !important; line-height: 1.6;
  }
  .sr-staff td[data-c="name"]   { font-size: 13px !important; font-weight: 700 !important; }
  .sr-staff td[data-c="title"]  { color: #94a3b8 !important; }
  .sr-staff td[data-c="career"] { color: #94a3b8 !important; }
  /* 직속 선임은 ↑이름 으로 */
  .sr-staff td[data-c="senior"] { font-size: 0 !important; }
  .sr-staff td[data-c="senior"]::before {
    content: "↑" attr(data-senior); font-size: 10.5px; color: #15803d;
    background: #f0fdf4; border-radius: 7px; padding: 1px 6px; font-weight: 600;
  }
  .sr-staff td[data-c="senior"][data-senior=""] { display: none; }
  /* 첫 줄이 남은 폭을 다 먹게 해서 둘째 줄부터 숫자가 오도록 */
  .sr-staff td[data-c="career"],
  .sr-staff td[data-c="senior"] { flex: 1 0 auto; }
  /* 둘째 줄 — 건수 · 학점 · 매출액 (한 줄에 붙여서) */
  .sr-staff td[data-c="cnt"] { margin-top: 2px; }
  .sr-staff td[data-c="cnt"],
  .sr-staff td[data-c="credits"],
  .sr-staff td[data-c="pay"] { font-size: 12px !important; color: #334155 !important; }
  .sr-staff td[data-c="cnt"]::after,
  .sr-staff td[data-c="credits"]::after { content: " ·"; color: #cbd5e1; }
  .sr-staff td[data-c="pay"] { font-weight: 700 !important; color: #1e293b !important; }
  .sr-staff td[data-c="todayPay"],
  .sr-staff td[data-c="newPay"] { font-size: 10.5px !important; }
  .sr-staff td[data-lbl]::before { content: attr(data-lbl) " "; color: #b6c0cd; font-size: 9.5px; margin-right: 1px; }
  /* 신규 건수·학점은 접는다 — 신규 매출액만 남긴다 */
  .sr-staff td[data-c="newCnt"],
  .sr-staff td[data-c="newCredits"] { display: none !important; }

  /* 합계 줄 */
  .sr-staff tfoot { display: block; padding: 0 9px 9px; }
  .sr-staff tfoot tr {
    display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 5px; width: 100%;
    box-sizing: border-box; background: #f8fafc !important; border: 1px solid #e8edf5;
    border-radius: 9px; padding: 8px 11px;
  }
  .sr-staff tfoot td { border: none !important; padding: 0 !important; white-space: nowrap !important;
                       text-align: left !important; font-size: 11.5px !important; }
  .sr-staff tfoot td[data-c="sum"] { flex: 1 0 auto; font-size: 12px !important; font-weight: 800; }
  .sr-staff tfoot td[data-c="cnt"] { margin-top: 2px; }
  .sr-staff tfoot td[data-c="cnt"]::after,
  .sr-staff tfoot td[data-c="credits"]::after { content: " ·"; color: #cbd5e1; }
  .sr-staff tfoot td[data-c="newCnt"],
  .sr-staff tfoot td[data-c="newCredits"] { display: none !important; }
  .sr-staff tfoot td[data-lbl]::before { content: attr(data-lbl) " "; color: #b6c0cd;
                                         font-size: 9.5px; margin-right: 1px; font-weight: 600; }

  /* ══ 금일 매출 — 카드 5개를 4열로. 마지막(참여 인원)은 아랫줄 전체폭 ══ */
  .ts-kpi { grid-template-columns: repeat(4, minmax(0,1fr)) !important; gap: 6px !important; }
  .ts-kpi > div { padding: 9px 6px !important; text-align: center; min-height: 68px;
                  display: flex; flex-direction: column; justify-content: center; }
  .ts-kpi > div > div:first-child { font-size: 9.5px !important; margin-bottom: 3px !important;
                                    white-space: nowrap; letter-spacing: -.03em; }
  .ts-kpi > div > div:nth-child(2) { font-size: 15px !important; line-height: 1.2; white-space: nowrap; }
  .ts-kpi > div > div:nth-child(3) { font-size: 9.5px !important; white-space: nowrap;
                                     overflow: hidden; text-overflow: ellipsis; }
  .ts-kpi > div:nth-child(5) { grid-column: 1 / -1; min-height: 0; padding: 8px 10px !important;
                               flex-direction: row; align-items: baseline; gap: 7px; }
  .ts-kpi > div:nth-child(5) > div:first-child { margin-bottom: 0 !important; }
  .ts-kpi > div:nth-child(5) > div:nth-child(2) { font-size: 14px !important; }

  /* ══ 교육원 info — 좌 목록 / 우 상세 2단을 위아래로 ═══════════
     base 의 "고정폭 사이드 → width:100%" 규칙 때문에 목록이 화면을 다 먹고
     상세 패널이 화면 밖으로 밀려 아무것도 안 보이던 것을 바로잡는다. */
  .dc-wrap { display: block !important; height: auto !important; overflow: visible !important; }
  .dc-side {
    width: 100% !important; flex-direction: row !important; flex-wrap: nowrap !important;
    overflow-x: auto !important; overflow-y: hidden !important;
    border-right: none !important; border-bottom: 1px solid #e5e7eb;
    padding: 8px !important; gap: 6px !important; margin-bottom: 12px;
    border-radius: 10px; scrollbar-width: none;
  }
  .dc-side::-webkit-scrollbar { display: none; }
  .dc-side > button {
    width: auto !important; flex: 0 0 auto; white-space: nowrap;
    padding: 8px 13px !important; margin-bottom: 0 !important; font-size: 12.5px !important;
  }
  #dcDetailPanel { padding: 0 !important; overflow: visible !important; }

  /* 교육원 상세 — 교육원마다 카드 한 장, 좌우로 넘겨 본다 */
  .dc-track {
    display: flex; flex: 1 1 auto; min-width: 0;
    overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    gap: 10px; padding: 0 0 10px; scrollbar-width: none;
  }
  .dc-track::-webkit-scrollbar { display: none; }
  .dc-card {
    flex: 0 0 100%; min-width: 0; scroll-snap-align: start;
    max-height: calc(100vh - 215px); overflow-y: auto; -webkit-overflow-scrolling: touch;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
    padding: 14px 13px; box-shadow: 0 1px 3px rgba(0,0,0,.05);
  }
  /* 카드 안은 폭이 좁다 — 2단 묶음과 표는 모두 한 줄로 */
  .dc-card .two-col { grid-template-columns: minmax(0,1fr) !important; display: grid !important; gap: 10px !important; }
  .dc-card table { width: 100% !important; min-width: 0 !important; }
  .dc-card table td, .dc-card table th { padding: 7px 9px !important; font-size: 11.5px !important; }
  .dc-card [style*="font-size:20px"] { font-size: 17px !important; }

  /* ══ 홈 진급 기준 카드 — 개인 실적 왼쪽 / 조직 실적 오른쪽 ══════ */
  .promo-grid  { grid-template-columns: minmax(0,1fr) !important; gap: 8px !important; }
  .promo-flags { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .promo-flag  { min-width: 0; }
  .promo-bars  { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

  /* ══ 개인 대시보드 — 상단 스탯 4장 가로 4등분 ══════════════════ */
  .dash-kpi { grid-template-columns: repeat(4, minmax(0,1fr)) !important; gap: 6px !important; }
  .dash-kpi > div { padding: 9px 5px !important; text-align: center; min-height: 70px;
                    display: flex; flex-direction: column; justify-content: center; }
  .dash-kpi > div > div:first-child { font-size: 9.5px !important; margin-bottom: 3px !important;
                                      white-space: nowrap; letter-spacing: -.03em;
                                      overflow: hidden; text-overflow: ellipsis; }
  .dash-kpi > div > div:nth-child(2) { font-size: 17px !important; line-height: 1.15; white-space: nowrap; }
  .dash-kpi > div > div:nth-child(2) span { font-size: 10px !important; }
  .dash-kpi > div > div:nth-child(3) { font-size: 9px !important; margin-top: 2px !important;
                                       white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* ══ 직원별 통계 — 카드 안 미니 스탯 4개를 가로 4등분 ══════════ */
  .ss-mini4 { grid-template-columns: repeat(4, minmax(0,1fr)) !important; gap: 5px !important; }
  .ss-mini4 > div { padding: 8px 3px !important; }
  .ss-mini4 > div > div:first-child { font-size: 9.5px !important; margin-bottom: 3px !important;
                                      letter-spacing: -.03em; }
  .ss-mini4 .ss-mini-val { font-size: 16px !important; }
  .ss-mini4 .ss-mini-sub { font-size: 9px !important; margin-top: 2px !important; letter-spacing: -.04em; }
  .staff-stat-card { padding: 13px 14px !important; }

  /* 직원 카드는 세로로 길게 쌓지 않고 좌우로 넘겨 본다 (손가락 스크롤 줄이기) */
  #staffCardsWrap {
    display: grid !important;
    grid-auto-flow: column; grid-auto-columns: 86%;
    grid-template-columns: none !important;
    overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    gap: 10px !important; padding-bottom: 8px;
    scrollbar-width: none;
  }
  #staffCardsWrap::-webkit-scrollbar { display: none; }
  #staffCardsWrap > .staff-stat-card { scroll-snap-align: center; }
  /* 마지막 카드도 가운데까지 오도록 양옆 여백 */
  #staffCardsWrap::before, #staffCardsWrap::after { content: ''; width: 1px; }

  /* 개인 대시보드 탭의 팀원 선택 칩도 좌우로 */
  #ssMemberGrid {
    flex-wrap: nowrap !important; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding-bottom: 4px;
  }
  #ssMemberGrid::-webkit-scrollbar { display: none; }
  #ssMemberGrid > * { flex: 0 0 auto; }

  /* ── 모달 ── 바닥까지 꽉 차게, 홈 인디케이터 영역 피하기 */
  .modal { max-height: 94vh !important; }
  .modal-inner { max-height: calc(94vh - 132px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .modal-footer { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .modal-footer .btn { flex: 1; min-height: 44px; }

  /* ── 터치 타겟 44px ── */
  .btn, .btn-primary, .btn-ghost { min-height: 44px; }
  .btn-sm, .memo-btn { min-height: 34px; padding: 7px 11px; }
  .nav-item { padding: 13px 14px; }
  input[type=checkbox], input[type=radio] { width: 18px; height: 18px; }

  /* ── 떠 있는 버튼들이 서로 겹치지 않게 (조사·전화번호·색) ── */
  #surveyFab   { right: 12px !important; bottom: calc(12px + env(safe-area-inset-bottom)) !important;
                 font-size: 12px !important; padding: 10px 13px !important; }
  #phoneFixFab { right: 12px !important; bottom: calc(62px + env(safe-area-inset-bottom)) !important;
                 font-size: 12px !important; padding: 10px 13px !important; }
  .admtheme-fab{ left: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); }
  .admtheme-grid { grid-template-columns: 1fr; }

  /* ── 표 가로 스크롤을 눈치챌 수 있게 오른쪽에 그림자 ── */
  .tbl-wrap { background:
    linear-gradient(90deg, #fff 30%, rgba(255,255,255,0)) left/26px 100% no-repeat,
    linear-gradient(270deg, #fff 30%, rgba(255,255,255,0)) right/26px 100% no-repeat,
    linear-gradient(90deg, rgba(15,23,42,.10), rgba(255,255,255,0)) left/9px 100% no-repeat,
    linear-gradient(270deg, rgba(15,23,42,.10), rgba(255,255,255,0)) right/9px 100% no-repeat;
    background-attachment: local, local, scroll, scroll; }
}

/* ── 휴대폰 (≤600px) ──────────────────────────────────────────────── */
@media (max-width: 600px){
  .page { padding: 10px 10px calc(40px + env(safe-area-inset-bottom)); }
  .topbar { padding: 0 10px; height: 50px; }
  .topbar-title { font-size: 13.5px; }

  /* 홈 상단 — 인사말과 진급 카드 */
  .welcome-card { padding: 13px 14px; }
  .welcome-greeting { font-size: 15px; }
  .welcome-sub { font-size: 11.5px; }

  /* 홈 프로필 카드는 숨긴다 — 사이드바에 같은 정보가 있다 */
  .page#page-home .profile-card { display: none !important; }
  .page#page-home [style*="grid-template-columns:auto 1fr"]{ grid-template-columns: minmax(0,1fr) !important; }

  /* 학사 캘린더 — 더 작게 */
  .accal-cells > div { min-height: 52px !important; }
  .accal-cells div[title] { font-size: 8.5px !important; line-height: 1.45 !important; }

  /* 학생관리 상태 카드 — 더 좁은 화면 */
  .stu-stat4 { gap: 5px !important; }
  .stu-stat4 .stu-chip { padding: 7px 2px !important; min-height: 52px; }
  .stu-stat4 .stu-chip .label { font-size: 9.5px !important; letter-spacing: -0.03em; }
  .stu-stat4 .stu-chip .value { font-size: 15.5px !important; }
  .stu-row2 { gap: 5px !important; }
  .stu-row2 .stu-chip2 { padding: 8px 6px !important; min-height: 54px; }
  .stu-row2 .stu-chip2 .label { font-size: 10px !important; letter-spacing: -0.03em; }
  .stu-row2 .stu-chip2 .value { font-size: 16px !important; }

  /* 좁은 화면에서 상단 버튼이 화면 밖으로 나가지 않게 */
  #pageActions { gap: 5px; }
  #pageActions .btn, #pageActions button { font-size: 12px; padding: 8px 10px; }

  /* 카드 묶음 간격 */
  .card { padding: 12px; border-radius: 10px; }
  .card-title { font-size: 13px; }
}

/* ── 작은 휴대폰 (≤380px) ─────────────────────────────────────────── */
@media (max-width: 380px){
  .stat-row { grid-template-columns: minmax(0,1fr) !important; }
  .stat-value { font-size: 18px; }
  .page { padding: 8px 8px calc(36px + env(safe-area-inset-bottom)); }
  .sidebar { width: 86vw; }
}

/* ── 가로 모드 휴대폰 — 높이가 모자라다 ──────────────────────────── */
@media (max-height: 480px) and (orientation: landscape){
  .modal { max-height: 96vh !important; }
  .modal-inner { max-height: calc(96vh - 108px); }
  .topbar { height: 46px; }
}

/* ══ 모바일 고정 레이아웃 보정 (2026-11-17) ══════════════════════════════
   세로 휴대폰은 기준 폭 390px 로 그린 뒤 기기 폭에 맞춰 비율 확대·축소 (index.html #lbViewport).
   여기서는 390px 기준으로 줄이 아무 데서나 꺾이지 않게 '정해진 틀'로 고정한다. */
@media (max-width: 760px) {
  /* 매출보고 — 조직원별 매출 현황: 3줄 틀 (이름·직급·근속 | 선임 / 건수·학점 | 매출 / 금일·신규) */
  .sr-staff tbody tr {
    display: grid !important; grid-template-columns: auto auto 1fr auto; column-gap: 6px; row-gap: 3px;
    align-items: baseline; border: 1px solid var(--line,#E2E8F0) !important; border-radius: 10px !important;
    padding: 10px 12px !important; background: #fff !important;
  }
  .sr-staff tbody tr[data-me] { background: var(--gold-50,#FFF9EF) !important; border-color: var(--gold-300,#FCD493) !important; }
  .sr-staff tbody tr > td { padding: 0 !important; border: 0 !important; white-space: nowrap !important; }
  .sr-staff td[data-c="name"]     { grid-row: 1; grid-column: 1; }
  .sr-staff td[data-c="title"]    { grid-row: 1; grid-column: 2; font-size: 11.5px !important; }
  .sr-staff td[data-c="career"]   { grid-row: 1; grid-column: 3; font-size: 11.5px !important; text-align: left !important; }
  .sr-staff td[data-c="senior"]   { grid-row: 1; grid-column: 4; justify-self: end; }
  .sr-staff td[data-c="cnt"]      { grid-row: 2; grid-column: 1; margin: 0 !important; }
  .sr-staff td[data-c="credits"]  { grid-row: 2; grid-column: 2 / 4; text-align: left !important; }
  .sr-staff td[data-c="pay"]      { grid-row: 2; grid-column: 4; justify-self: end; font-size: 14px !important; color: var(--navy-900,#0B2E56) !important; }
  .sr-staff td[data-c="cnt"]::after, .sr-staff td[data-c="credits"]::after { content: none !important; }
  .sr-staff td[data-c="todayPay"] { grid-row: 3; grid-column: 1 / 3; }
  .sr-staff td[data-c="newPay"]   { grid-row: 3; grid-column: 3 / 5; justify-self: end; }
  .sr-staff tbody tr > td:not([data-c]) { display: none !important; }

  /* 매출보고 — 내 정보 / 목표: 한 줄에 하나씩 */
  .sr-info-row { grid-template-columns: 1fr !important; }
  .sr-goals { grid-template-columns: 1fr !important; }
  .sr-goals > div { border-left: 0 !important; padding-left: 0 !important; }
  .sr-goals input { width: 100% !important; box-sizing: border-box; }
}