/* 2026-10-20 휴대폰 렌탈 견적서 품목 표(.q-table--rental): 칸 순서 No·제품명·단위·기간·단가·수량·금액에 맞춘 폭, 단위 칸은 숨김(기간 글자와 겹침) — 맨 아래 */
/* ===== core-legacy.css — 2026-10-15 core.css 1113~2499줄을 그대로 옮김 (옛 'Style Block 2': 인쇄 2열·사양 드롭다운·프로필·큰 모바일 묶음·이력 검색·필터·카탈로그 모바일·품목 창 바닥 시트·미리보기 아래 버튼·사양 관리·고객사 선택 창). 불러오는 순서 core.css 바로 뒤, core-ui.css 앞 — 바꾸지 말 것 ===== */
/* ========================================================
/* ===== Style Block 2 ===== */
.sv-wrap{background:#fff;border-radius:12px;padding:24px 28px;max-width:860px;width:100%;box-shadow:0 4px 24px rgba(27,58,107,.12);}
      .sv-header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:16px;border-bottom:2px solid ${thColor};padding-bottom:12px;}
      .sv-title{color:${thColor};font-size:22px;font-weight:800;margin:0 0 4px 0;}
      .sv-meta{font-size:11px;color:#64748b;}
      .sv-co{text-align:right;font-size:11px;color:#64748b;}
      .sv-party-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:14px;}
      .sv-party-box{border:1px solid #b8cde8;border-radius:8px;overflow:hidden;}
      .sv-party-hd{padding:7px 14px;display:flex;align-items:center;}
      .sv-party-hd span{font-size:12px;font-weight:700;color:#fff;letter-spacing:0.1em;}
      .sv-party-body{background:#fff;padding:10px 12px;}
      .sv-party-body table{font-size:12px;width:100%;border-collapse:collapse;}
      .sv-party-body td{color:#64748b;padding:3px 0;font-size:11px;}
      .sv-party-body td:last-child{color:#1e293b;font-weight:600;}
      .sv-info-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:14px;}
      .sv-info-box{border:1px solid #e2e8f0;border-radius:6px;overflow:hidden;}
      .sv-info-hd{background:#f1f5f9;padding:5px 10px;font-size:11px;font-weight:700;color:#1B3A6B;}
      .sv-info-body{padding:8px 12px;background:#fff;font-size:12px;min-height:40px;}
      .sv-info-row{display:flex;align-items:center;gap:8px;margin-bottom:4px;}
      .sv-info-lbl{font-size:11px;color:#64748b;min-width:72px;}
      .sv-info-val{font-size:12px;font-weight:600;color:#1e293b;}
      .sv-tbl-wrap{overflow-x:auto;margin-bottom:14px;}
      .sv-tbl{width:100%;border-collapse:collapse;font-size:12px;min-width:480px;}
      .sv-tbl th{background:${thColor};color:#fff;padding:8px 8px;font-weight:700;text-align:left;}
      .sv-tbl td{padding:7px 8px;border-bottom:1px solid #e8edf5;vertical-align:middle;}
      .sv-summary{display:flex;justify-content:flex-end;}
      .sv-sum-tbl{width:100%;max-width:280px;font-size:12px;border-collapse:collapse;}
      .sv-sum-tbl td{padding:5px 6px;}
      .sv-sum-tbl td:last-child{text-align:right;}
      .sv-sum-total td{font-weight:800;font-size:14px;color:${thColor};border-top:2px solid ${thColor};padding-top:8px;}
      .sv-footer{margin-top:16px;text-align:center;border-top:1px solid #e2e8f0;padding-top:10px;font-size:10px;color:#94a3b8;line-height:1.7;}
      @media screen and (max-width:600px){
        .sv-wrap{padding:14px 12px;border-radius:0;}
        .sv-party-grid{grid-template-columns:1fr;}
        .sv-info-grid{grid-template-columns:1fr;}
        .sv-title{font-size:18px;}
        .sv-header{flex-direction:column;gap:6px;}
        .sv-co{text-align:left;}
        .sv-tbl{min-width:360px;}
      }

/* ===== 인쇄(Print) 전용 – 수신/공급 좌우 2열 강제 유지 ===== */
@media print {
  /* 수신/공급 박스: 모바일 미디어쿼리 1열 오버라이드 방지 */
  .q-party-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  /* 납품/특이사항: flex 열 방향 유지 (grid 덮어쓰기 방지) */
  .q-info-grid {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: unset !important;
  }
  .q-rental-info-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0 !important;
  }
  /* 모든 1fr 1fr 인라인 스타일 grid도 보호 */
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* ══════════════════════════════════════════════════════════
   추가 스타일: 스펙 드롭다운 / 스펙 관리 / 프로필 드롭다운
   ══════════════════════════════════════════════════════════ */

/* ── 스펙 드롭다운 섹션 (구매/렌탈 모달) ── */
.spec-dropdown-section {
  margin-bottom: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}
.spec-dd-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
}
.spec-dd-row:last-child { border-bottom: none; }
.spec-dd-label {
  min-width: 60px;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
}
.spec-dd-select {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  padding: 4px 8px;
  height: 32px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: #1e293b;
  outline: none;
  cursor: pointer;
}
.spec-dd-select:focus { border-color: var(--p-blue); }
.spec-dd-price {
  width: 90px !important;
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  color: #374151 !important;
  font-weight: 500 !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 6px !important;
  background: #fff !important;
  padding: 0 8px !important;
  height: 32px !important;
  font-size: 12px !important;
  outline: none;
}
.spec-dd-price:focus { border-color: var(--p-blue) !important; outline: none !important; }
.r-spec-dd .spec-dd-label { color: var(--r-primary); }
.r-spec-dd-select:focus { border-color: var(--r-blue) !important; }
.r-spec-dd-price:focus { border-color: var(--r-blue) !important; }

/* ── 스펙 관리 패널 항목 ── */
.spec-cat-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  min-height: 44px;
  cursor: pointer;
  background: #fff;
  transition: background .15s;
}
.spec-cat-item:last-child { border-bottom: none; }
.spec-cat-item:hover { background: #f8fafc; }
.spec-cat-item.active { background: #eff6ff; }
.spec-cat-item-info {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.spec-cat-item-name {
  font-weight: 600; font-size: 12px; color: #1e293b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.spec-cat-item-meta {
  font-size: 10px; color: #94a3b8;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.spec-cat-item-actions {
  display: flex; gap: 4px; flex-shrink: 0;
}

/* ── 프로필 드롭다운 ── */
.profile-btn-wrap { position: relative; }
.profile-trigger {
  cursor: pointer;
  background: none;
  border: none;
  display: flex; align-items: center; gap: var(--ds-sp-2); /* 2026-10-09 동그라미 + 이름 */
  font-size: var(--ds-fs-base);
  color: var(--ds-gray-600);
  padding: var(--ds-sp-1) var(--ds-sp-2) var(--ds-sp-1) var(--ds-sp-1);
  border-radius: var(--ds-radius-pill);
  transition: background .15s;
  max-width: 220px;
  overflow: hidden;
  white-space: nowrap;
}
.profile-trigger:hover { background: var(--ds-gray-50); }
.profile-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: 200px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(27,58,107,.14);
  z-index: 9999;
  overflow: hidden;
}
.profile-dropdown.open { display: block; }
.pd-header {
  padding: 12px 14px 8px;
  border-bottom: 1px solid #f1f5f9;
}
.pd-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 10px 14px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  transition: background .12s;
}
.pd-item:hover { background: #f8fafc; }
.pd-divider { height: 1px; background: #f1f5f9; margin: 4px 0; }
.pd-logout { color: #ef4444; }
.pd-logout:hover { background: #fef2f2; }

  /* 별도 btn-logout 버튼 숨기기 — PC·모바일 모두 (로그아웃은 회원 메뉴 안에서). 2026-10-09 주석 정정 */
  .btn-logout { display: none; }

/* ══════════════════════════════════════════════════════════
   모바일 전면 최적화 (600px 이하)
   ══════════════════════════════════════════════════════════ */
@media screen and (max-width: 600px) {

  /* ── 헤더 ── 2026-10-09 머리·프로필 버튼 규칙 제거 (core.css 위쪽 '머리 영역'으로 통합) */
  .btn-logout { display: none; }
  .profile-btn-wrap { position: relative; }
  /* 프로필 드롭다운: 모바일에서 오른쪽 */
  .profile-dropdown {
    right: 0;
    left: auto;
    min-width: 180px;
    z-index: 9999;
  }

  /* ── 서브탭 ── */
  .sub-tabs { padding: 0 10px; height: 38px; }
  .sub-tab { padding: 0 16px; min-width: auto; font-size: 12px; }
  .admin-sub-tabs { padding: 0 8px; overflow-x: auto; scrollbar-width: none; }
  .admin-sub-tabs::-webkit-scrollbar { display: none; }
  .admin-sub-tab { padding: 0 14px; font-size: 12px; white-space: nowrap; }

  /* ── 레이아웃: 카탈로그+폼 수직 분할 ── */
  .split-layout {
    flex-direction: column !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }
  .catalog-panel {
    width: 100% !important;
    min-width: unset !important;
    height: auto !important;
    flex: none !important;
    border-right: none !important;
    border-bottom: 1.5px solid var(--border) !important;
  }
  /* 카탈로그 제품 목록: 수평 스크롤 그리드 */
  .product-list {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 8px 6px !important;
    gap: 6px !important;
    max-height: 140px !important;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }
  .product-card {
    flex: 0 0 150px !important;
    min-width: 150px !important;
    margin-bottom: 0 !important;
    scroll-snap-align: start;
  }
  .product-card .pc-name { font-size: 11px !important; }
  .product-card .pc-brand { font-size: 9.5px !important; }
  .product-card .pc-price { font-size: 11px !important; }

  /* ── 폼 패널 ── */
  .form-panel { flex: 1; min-height: 0; }
  .form-scroll { padding: 8px 6px !important; }
  .form-section { padding: 10px 10px !important; margin-bottom: 8px !important; }
  .section-title, .r-section-title {
    margin: -10px -10px 10px -10px !important;
    font-size: 11px !important;
    padding: 6px 10px !important;
  }
  .form-row {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
    margin-bottom: 6px !important;
  }
  .form-row.full { grid-template-columns: 1fr !important; }

  /* ── 견적 품목 표: 2026-10-09 가로 밀기 → 품목별 카드 (모바일 품목 표 규칙은 여기 한 곳) ──
     표 구조(HTML)는 그대로 두고 줄(tr)을 칸 배치(grid)로 바꿈.
     구매: [순서 | 제품 | 수정·삭제] / [사양] / [단가 | 수량]
     렌탈: [순서 | 제품 | 수정·삭제] / [사양] / [단위 단가] / [수량·기간]  (렌탈 가운데 칸은 클래스가 없어 순서로 지정: 1순서 2제품 3사양 4단위 5단가 6수량·기간 7수정·삭제) */
  #quote-items-area,
  #r-quote-items-area { overflow-x: visible !important; }
  .items-table { min-width: 0 !important; font-size: var(--ds-fs-base) !important; }
  .items-table thead { display: none; }
  .items-table, .items-table tbody { display: block; width: 100%; }
  .items-table tr {
    display: grid; column-gap: var(--ds-sp-2); row-gap: var(--ds-sp-2); align-items: center;
    padding: var(--ds-sp-3) 0; border-bottom: var(--ds-line) solid var(--ds-gray-200);
  }
  .items-table td { display: block; padding: 0 !important; border: 0 !important; width: auto !important; min-width: 0 !important; }

  #quote-items-area tr {
    grid-template-columns: 28px minmax(0,1fr) auto;
    grid-template-areas: "ord prod rm" "ord spec spec" "ord unit qty";
  }
  #quote-items-area .col-order   { grid-area: ord; align-self: start; }
  #quote-items-area .col-product { grid-area: prod; }
  #quote-items-area .col-spec    { grid-area: spec; }
  #quote-items-area .col-spec:has(> .text-muted:only-child) { display: none; } /* 사양 없음('-')이면 칸째 숨겨 빈 줄 없앰 */
  #quote-items-area .col-unit    { grid-area: unit; text-align: left; }
  #quote-items-area .col-qty     { grid-area: qty; justify-self: end; }
  #quote-items-area .col-rm      { grid-area: rm; align-self: start; justify-self: end; white-space: nowrap; }

  #r-quote-items-area tr {
    grid-template-columns: 28px auto minmax(0,1fr) auto;
    grid-template-areas: "ord prod prod rm" "ord spec spec spec" "ord type unit unit" "ord qty qty qty";
  }
  #r-quote-items-area .col-order { grid-area: ord; align-self: start; }
  #r-quote-items-area td:nth-child(2) { grid-area: prod; }
  #r-quote-items-area td:nth-child(3) { grid-area: spec; }
  #r-quote-items-area td:nth-child(3):has(> .text-muted:only-child) { display: none; }
  #r-quote-items-area td:nth-child(4) { grid-area: type; }
  #r-quote-items-area td:nth-child(5) { grid-area: unit; text-align: left; }
  #r-quote-items-area td:nth-child(6) { grid-area: qty; }
  #r-quote-items-area .col-rm { grid-area: rm; align-self: start; justify-self: end; white-space: nowrap; }
  #r-quote-items-area .tbl-name-cell { flex-direction: row; flex-wrap: wrap; gap: var(--ds-sp-2) var(--ds-sp-4); }

  .qty-stepper { gap: 2px !important; }
  .qty-btn { width: 32px !important; height: 32px !important; font-size: 16px !important; }
  .qty-display { min-width: 32px !important; font-size: var(--ds-fs-sm) !important; }
  .qi-order-btns { gap: 2px; }
  .items-table .qi-order-btn { width: 24px !important; height: 22px !important; font-size: var(--ds-fs-sm); }
  .items-table .btn-rm,
  .items-table .btn-edit-item { min-width: 32px; height: 32px; font-size: var(--ds-fs-sm); }

  /* ── 금액 요약 ── */
  .price-summary, .r-price-summary {
    padding: 10px 10px !important;
  }
  .price-row, .ps-row { font-size: 11.5px !important; }
  .price-row.total, .ps-row.total { font-size: 13px !important; }
  .ps-editable { flex-wrap: wrap !important; gap: 4px !important; }

  /* ── 액션 바 ── */
  .action-bar {
    padding: 8px 10px !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
  }
  .action-bar .btn {
    flex: 1;
    min-width: 80px;
    justify-content: center;
    font-size: 12px !important;
  }

  /* ── 모달 ── */
  .modal-overlay { padding: 0 !important; align-items: flex-start !important; }
  #modal-preview.modal-overlay,
  #r-modal-preview.modal-overlay {
    align-items: flex-start !important;
  }
  .modal-box {
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: 92dvh !important;
    border-radius: 16px 16px 0 0 !important;
  }
  .modal-box.wide,
  .preview-modal-box {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    align-items: stretch !important;
    align-self: flex-start !important;
  }
  #modal-preview .modal-body,
  #r-modal-preview .modal-body {
    flex: 1 !important;
    min-height: 0 !important;
  }
  #preview-footer,
  #r-preview-footer {
    justify-content: flex-end !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
  }
  #preview-footer .btn,
  #r-preview-footer .btn {
    flex: 0 0 auto !important;
    width: auto !important;
  }
  .modal-header { padding: 14px 16px !important; }
  .modal-body { padding: 14px 14px !important; }
  .modal-footer { padding: 10px 14px !important; gap: 6px !important; display:flex !important; flex-direction:row !important; align-items:center !important; justify-content:flex-end !important; }
  .modal-footer .btn { font-size: 12px !important; padding: 8px 12px !important; flex:0 0 auto !important; width:auto !important; }

  /* 미리보기 모달: 전체화면 */
  #modal-preview .modal-body,
  #r-modal-preview .modal-body {
    padding: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }
  #preview-content, #r-preview-content {
    padding: 0 !important;
    width: 100% !important;
    min-width: unset !important;
  }
  /* 모바일: 인쇄(PDF) 버튼 숨김 (btn-desktop-only) */
  .btn-desktop-only { display: none !important; }
  #btn-print-quote { display: none !important; }
  #r-btn-print-quote { display: none !important; }

  /* ── 견적서 본문 (qdoc) ── */
  .qdoc {
    padding: 14px 12px !important;
    font-size: 11px !important;
    min-width: unset !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
  .qdoc .q-header {
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 8px !important;
    justify-content: space-between !important;
  }
  .qdoc h1 { font-size: 18px !important; }
  .qdoc .q-logo-area img { height: 36px !important; }

  /* 수신/공급 박스: 모바일에서 세로로 */
  .q-party-grid { grid-template-columns: 1fr !important; gap: 8px !important; }
  .q-info-grid { display: flex !important; flex-direction: column !important; }
  .q-rental-info-grid { grid-template-columns: 1fr !important; }
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }

  /* 품목 테이블: 모바일에서 폴트 축소 */
  .q-table {
    min-width: unset !important;
    width: 100% !important;
    table-layout: fixed !important;
  }
  .q-table th, .q-table td {
    padding: 5px 4px !important;
    font-size: 10px !important;
    word-break: keep-all !important;
    overflow-wrap: break-word !important;
  }
  /* 품목명/사양 커럼: 충분한 너비 확보 */
  .q-table th:nth-child(3), .q-table td:nth-child(3) { width: auto !important; }
  .q-table th:nth-child(1), .q-table td:nth-child(1) { width: 22px !important; }
  .q-table th:nth-child(2), .q-table td:nth-child(2) { width: 52px !important; }
  .q-table th:nth-child(4), .q-table td:nth-child(4) { width: 68px !important; white-space: nowrap !important; }
  .q-table th:nth-child(5), .q-table td:nth-child(5) { width: 22px !important; }
  .q-table th:nth-child(6), .q-table td:nth-child(6) { width: 68px !important; white-space: nowrap !important; }

  .q-summary-table { width: 100% !important; margin-left: 0 !important; }
  .q-summary-table td:last-child { text-align: right !important; }
  .q-footer-bar { font-size: 9px !important; line-height: 1.6 !important; }

  /* ── 관리자 패널 ── */
  .admin-card { margin: 6px !important; }
  .admin-card-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    padding: 10px 12px !important;
  }
  .admin-card-header > div {
    width: 100% !important;
    flex-wrap: wrap !important;
  }
  /* 스펙 관리: 좌우 → 상하 */
  #admin-panel-spec [style*="grid-template-columns:280px 1fr"],
  #admin-panel-spec [style*="grid-template-columns: 280px 1fr"] {
    display: flex !important;
    flex-direction: column !important;
  }
  #admin-panel-spec [style*="border-right:1px solid var(--border)"],
  #admin-panel-spec [style*="border-right: 1px solid var(--border)"] {
    border-right: none !important;
    border-bottom: 1px solid var(--border) !important;
    max-height: 260px;
  }

  /* ── 이력: 테이블 숨기고 카드 표시 ── */
  .history-table-view { display: none !important; }
  .history-card-list  { display: flex !important; }

  /* ── 이력 래퍼 & 헤더 ── */
  /* .history-wrap overflow-y 삭제 — 2026-10-09: 스크롤은 카드 목록이 담당 */
  .history-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding-bottom: 10px !important;
    margin-bottom: 10px !important;
  }
  .history-search-row {
    width: 100% !important;
    gap: 6px !important;
  }
  .history-search-input {
    flex: 1 !important;
    width: auto !important;
    min-width: 0 !important;
  }
  .history-refresh-btn {
    padding: 0 12px !important;
  }
  /* 모바일 백업 바: 숨김 */
  .backup-bar, .r-backup-bar {
    display: none !important;
  }
  .admin-card > div[style*="overflow:auto"],
  .admin-card > div[style*="overflow: auto"] {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* ── 토스트 ── */
  #toast {
    bottom: 12px !important;
    right: 12px !important;
    left: 12px !important;
  }
  .toast-item { max-width: 100% !important; font-size: 12px !important; }

  /* ── 스펙 드롭다운 모달 ── */
  .spec-dd-row { padding: 6px 10px !important; }
  .spec-dd-label { min-width: 50px !important; font-size: 10.5px !important; }
  .spec-dd-select { font-size: 12px !important; height: 34px !important; }

  /* ── atq 2열 → 1열 ── */
  .atq-row-2col {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  /* ── 이력: 테이블 숨기고 카드 표시 ── */
  .history-table-view { display: none !important; }
  .history-card-list  { display: flex !important; }
}

/* ── modal-footer-col: 견적 추가 모달 하단 세로 레이아웃 ── */
.modal-footer-col {
  flex-direction: column !important;
  gap: 8px !important;
  align-items: stretch !important;
}

/* ══════════════════════════════════════════════════════════
   견적 이력 – 모바일 카드 리스트
   ══════════════════════════════════════════════════════════ */

/* 카드 리스트 컨테이너: 데스크탑에서는 숨김 */
.history-card-list {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 0 12px 12px;
}

/* 로딩/빈상태 */
.history-card-loading,
.history-card-empty {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
  font-size: 13px;
}

/* 개별 카드 */
.hc-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 4px rgba(27,58,107,.06);
  transition: box-shadow .15s, border-color .15s;
}
.hc-card.hc-card--rev { margin-left: 16px; background: #f8fafc; box-shadow: none; } /* rev: 원본 아래 들여쓰기 */
.hc-card:active {
  box-shadow: 0 2px 8px rgba(27,58,107,.12);
  border-color: #93c5fd;
}

/* 카드 상단: 견적번호 + 날짜 + 배지 */
.hc-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.hc-card-num {
  font-size: var(--ds-fs-md);
  font-weight: 700;
  color: var(--ds-brand);
  flex-shrink: 0;
}
.hc-card-date {
  font-size: var(--ds-fs-sm);
  color: var(--ds-gray-400);
  flex: 1;
  text-align: right;
}
.hc-card-badge {
  font-size: var(--ds-fs-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--ds-radius-sm);
  background: #f1f5f9;
  color: var(--ds-gray-600);
  flex-shrink: 0;
}

/* 카드 중간: 고객사/담당자 */
.hc-card-body {
  margin-bottom: 8px;
}
.hc-card-company {
  font-size: var(--ds-fs-lg);
  font-weight: 700;
  color: var(--ds-gray-900);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hc-card-contact {
  font-size: var(--ds-fs-md);
  color: var(--ds-gray-600);
}
/* 영업 상태 줄 (배지·태그) — 금액·버튼 줄 위 */
.hc-card-sales { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }

/* 카드 하단: 금액 + 버튼 (flex-wrap 허용, 아주 좁으면 버튼 줄바꿈) */
.hc-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid #f1f5f9;
  padding-top: 10px;
}
.hc-card-total {
  font-size: var(--ds-fs-lg);
  font-weight: 700;
  color: var(--ds-brand);
}
.hc-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;   /* 버튼 묶음은 줄어들지 않게, 필요 시 아래 줄로 */
  flex-wrap: nowrap;
}
.hc-card-actions .btn {
  padding: 6px 12px !important;
  font-size: 12px !important;
  border-radius: 8px !important;
}

/* ══════════════════════════════════════════════════════════
   공통 유틸 클래스 (모바일 관련 구조 보완)
   ══════════════════════════════════════════════════════════ */

/* ── 테이블 가로 스크롤 래퍼 ── */
.table-scroll-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.table-scroll-wrap .data-table {
  min-width: 540px;
}

/* ── 이력 검색 행 (구매/렌탈) ── */
.history-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.history-search-input {
  width: 180px;
}
@media screen and (max-width: 600px) {
  .history-search-row {
    width: 100%;
  }
  .history-search-input {
    flex: 1 !important;
    width: auto !important;
    min-width: 0 !important;
  }
}

/* ── 관리자 카드 액션 행 ── */
.admin-card-action-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.admin-search-input {
  width: 200px;
  font-size: 12px;
  padding: 5px 10px;
}
.toolbar-search {
  height: 32px;
  font-size: 12px;
  padding: 0 10px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  outline: none;
  background: #fff;
  color: #1a2e5a;
  width: 200px;
  min-width: 140px;
  max-width: 260px;
  transition: border .15s;
}

/* ── 이력 필터 셀렉트 ── */
.toolbar-select {
  height: 32px;
  padding: 0 10px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  background: #fff;
  color: #344054;
  cursor: pointer;
  min-width: 100px;
  outline: none;
  transition: border .15s;
}
.toolbar-select:focus { border-color: var(--p-blue); }

/* ── 초기화 버튼 ── */
.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--border);
  color: #667085;
  font-size: 12px;
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s;
}
.btn-ghost:hover { background: #f2f4f7; }

@media screen and (max-width: 600px) {
  .admin-card-action-row {
    width: 100%;
    justify-content: flex-end;
  }
  .admin-search-input {
    flex: 1 !important;
    width: auto !important;
    min-width: 0 !important;
    order: -1;
  }
  .admin-card-action-row .btn-sm {
    flex-shrink: 0;
    white-space: nowrap;
  }
}

/* ── 할인율/금액 입력 줄바꿈 개선 ── */
.ps-editable {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}
@media screen and (max-width: 480px) {
  .discount-row,
  .ps-editable {
    justify-content: flex-start;
  }
  .discount-input {
    width: 60px !important;
  }
}

/* ── 모바일에서 catalog-panel 필터 ── */
@media screen and (max-width: 600px) {
  .filter-area {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    padding: 6px 8px !important;
  }
  .filter-select {
    flex: 1 !important;
    min-width: 100px !important;
    font-size: 12px !important;
    padding: 5px 6px !important;
  }
  /* 모바일 action-bar: 미리보기/저장만 오른쪽, 초기화는 왼쪽 */
  .action-bar {
    justify-content: space-between !important;
  }
  .action-bar .btn:first-child {
    flex: 0 0 auto !important;
    min-width: auto !important;
  }
  .action-bar .btn:not(:first-child) {
    flex: 1;
  }
  /* 테이블 래퍼 가로 스크롤 */
  .table-scroll-wrap {
    margin: 0 -6px;
    padding: 0 6px;
  }
  .table-scroll-wrap .data-table {
    min-width: 480px;
  }
  /* 구매 이력 테이블 최소 너비 */
  #history-table { min-width: 480px; }
  #r-history-table { min-width: 540px; }
  /* 관리자 제품 테이블 최소 너비 */
  #admin-product-body ~ *, .admin-card .data-table { min-width: 560px; }
}

/* ══════════════════════════════════════════════════════════
   ■ 관리자 테이블 헤더 정렬 버튼
   ══════════════════════════════════════════════════════════ */
.data-table thead th {
  position: relative;
  user-select: none;
}

/* 고객사 관리 테이블 헤더 고정 */
#panel-clients .data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
}
.th-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  font-weight: 700;
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: color .13s;
}
.th-sort-btn:hover { color: #1B3A6B; }
.r-th-sort-btn:hover { color: var(--r-primary); }
.sort-icon {
  font-size: 11px;
  color: #c0cce0;
  font-style: normal;
  line-height: 1;
}
.sort-icon.active { color: #1B3A6B; font-weight: 900; }
.r-th-sort-btn .sort-icon.active { color: var(--r-primary); }

/* ══════════════════════════════════════════════════════════
   ■ 카탈로그 정렬 바
   ══════════════════════════════════════════════════════════ */
.sort-bar {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 5px 8px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.sort-btn {
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 99px;
  padding: 3px 9px;
  cursor: pointer;
  transition: all .13s;
  white-space: nowrap;
}
.sort-btn:hover { border-color: #93c5fd; color: #1B3A6B; background: #eff6ff; }
.sort-btn.active {
  background: #1B3A6B;
  color: #fff;
  border-color: #1B3A6B;
  font-weight: 700;
}
/* 렌탈 정렬버튼 active 색상 */
.r-sort-btn:hover { border-color: #93c5fd; color: var(--r-primary); background: #eff6ff; }
.r-sort-btn.active {
  background: var(--r-primary);
  color: #fff;
  border-color: var(--r-primary);
  font-weight: 700;
}

/* ══════════════════════════════════════════════════════════
   ■ 구매 모달 (aq-modal) – 스펙 선택 개편
   ══════════════════════════════════════════════════════════ */
/* 모달 박스: 약간 넓게 */
/* ══════════════════════════════════════════════════════════
   ■ 제품 상세 모달 (AQ) - 2열 컴팩트 레이아웃
   ══════════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════
   modal-aq  —  카탈로그 상세 / 직접입력 통일 스타일
   ═══════════════════════════════════════════════ */
.aq-modal-box { max-width: 540px !important; }
.aq-modal-body { padding: 10px 14px !important; gap: 7px; display: flex; flex-direction: column; }

/* ── 제품 정보 컴팩트 ── */
.aq-product-compact {
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px;
  padding: 7px 12px;
}
.aq-product-compact .atq-name {
  font-size: 13px; font-weight: 700; color: #1B3A6B;
  margin-bottom: 2px; display: flex; align-items: center; gap: 5px;
}
.aq-product-compact .atq-meta {
  font-size: 11px; color: #64748b; margin-bottom: 3px;
  display: flex; align-items: center; gap: 5px;
}
.aq-product-compact .atq-sep { color: #d1d5db; }
.aq-product-compact .atq-spec {
  font-size: 10.5px; color: #64748b; line-height: 1.55;
  background: #fff; border-radius: 4px; padding: 3px 8px;
  max-height: 120px; overflow-y: auto;
}
.aq-product-compact .atq-feature { font-size: 10px; color: #94a3b8; margin-top: 2px; }

/* ── 공통 블록 ── */
.aq-block {
  border: 1px solid #e2e8f0; border-radius: 7px;
  padding: 9px 12px; display: flex; flex-direction: column; gap: 6px;
  background: #f8fafc;
}
.aq-cost-block { background: #fff8f0; border-color: #fed7aa; }
.aq-block-title {
  font-size: 10.5px; font-weight: 700; color: #64748b;
  text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 1px solid #e2e8f0; padding-bottom: 5px; margin-bottom: 1px;
  display: flex; align-items: center; gap: 6px;
}
.aq-cost-block .aq-block-title { border-color: #fed7aa; }
.aq-internal-badge {
  font-size: 9px; background: #fbbf24; color: #78350f;
  border-radius: 3px; padding: 1px 5px; font-weight: 700;
}

/* ── 기본가 행 (label + input + unit 가로) ── */
.aq-fl-row { display: flex; align-items: center; gap: 6px; }
.aq-fl-lbl { font-size: 11px; font-weight: 600; color: #374151; white-space: nowrap; min-width: 38px; flex-shrink: 0; margin: 0; }
.aq-fl-val { flex: 1; min-width: 0; }
.aq-fl-val .field-input { margin: 0; text-align: right; }
.aq-fl-unit { font-size: 11px; color: #64748b; flex-shrink: 0; }

/* ── 기본가 강조 ── */
.aq-base-input { color: #1B3A6B !important; border-color: #c7d9f0 !important; }
.aq-num-input { text-align: right !important; }

/* ── 기준가 요약 (스펙 추가금 + 기준가) ── */
.aq-ref-summary {
  background: #eef4ff; border-radius: 5px;
  padding: 5px 10px; display: flex; flex-direction: column; gap: 2px;
}
.aq-ref-row { display: flex; justify-content: space-between; align-items: center; font-size: 11px; }
.aq-ref-lbl { color: #64748b; }
.aq-ref-val { font-weight: 600; color: #1B3A6B; }
.aq-ref-val.muted { color: #94a3b8; font-weight: 400; }
.aq-ref-total .aq-ref-lbl { font-weight: 700; color: #1B3A6B; }
.aq-ref-total .aq-ref-val { font-size: 13px; font-weight: 800; color: #1B3A6B; }

/* ── 원가&마진 2열 그리드 (직접입력 mi-grid-2col 동일 패턴) ── */
.aq-mi-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}

/* ── 마진 입력 색상 ── */
.aq-margin-input { color: #92400e !important; }

/* ── 수량 버튼 ── */
.aq-qty-btn {
  width: 26px; height: 26px; border: 1.5px solid #d1d5db; border-radius: 4px;
  background: #fff; font-size: 14px; font-weight: 700; color: #374151;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all .1s;
}
.aq-qty-btn:hover { border-color: #1B3A6B; background: #eff6ff; color: #1B3A6B; }
.aq-qty-input { text-align: center !important; }

/* ── 합계 인라인 바 ── */
.aq-inline-total {
  display: flex; justify-content: space-between; align-items: center;
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 5px;
  padding: 6px 12px; margin-top: 2px;
}
.aq-total-label { font-size: 12px; font-weight: 600; color: #374151; }
.aq-total-val { font-size: 15px; font-weight: 800; color: #1B3A6B; }

/* ── 하위 호환 최소 유지 ── */
.aq-margin-hint { font-size: 11px; white-space: nowrap; }
.aq-margin-hint.positive { color: #16a34a; }
.aq-margin-hint.negative { color: #dc2626; }

/* 견적 품목 내부 정보 */
.qi-internal {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 3px;
}
.qi-internal-item {
  font-size: var(--ds-fs-xs); padding: 1px 5px; border-radius: 3px;
  background: #f1f5f9; color: #475569; white-space: nowrap;
}
.qi-internal-item.positive { background: #dcfce7; color: #15803d; }
.qi-internal-item.negative { background: #fee2e2; color: #dc2626; }

/* 스펙 드롭다운 좌측 영역 조정 */
.aq-left .spec-dropdown-section { margin-bottom: 4px; }
.aq-left .spec-dd-row { padding: 4px 8px; }
.aq-left .spec-dd-select { height: 24px; font-size: 11px !important; padding: 2px 4px; }
.aq-left .spec-dd-price { width: 60px !important; height: 24px !important; font-size: 11px !important; padding: 2px 4px !important; text-align: right !important; }




/* ══════════════════════════════════════════════════════════
   ■ 견적 품목 테이블 – 정렬 버튼 포함
   ══════════════════════════════════════════════════════════ */
.items-table .col-order { width: 52px; text-align: center; }
.items-table .col-product { min-width: 120px; }
.items-table .col-spec { min-width: 140px; color: var(--ds-gray-600); font-size: var(--ds-fs-sm); }
.items-table th.col-spec { color: #1B3A6B; font-size: var(--ds-fs-md); } /* 2026-10-09 제목은 다른 제목과 같게 */
.items-table .col-unit { width: 90px; text-align: right; white-space: nowrap; font-size: var(--ds-fs-sm); font-weight: 700; }
.items-table .col-qty { width: 100px; text-align: center; }
.items-table .col-rm { width: 32px; text-align: center; }

.qi-order-btns {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.qi-order-btn {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  width: 20px;
  height: 16px;
  font-size: 8px;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .1s;
  line-height: 1;
}
.qi-order-btn:hover:not([disabled]) { border-color: #1B3A6B; color: #1B3A6B; background: #eff6ff; }
.qi-order-btn[disabled] { opacity: 0.25; cursor: default; }
.qi-num {
  font-size: var(--ds-fs-sm);
  font-weight: 700;
  color: #94a3b8;
  line-height: 1;
  margin: 1px 0;
}
.qi-meta-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}
.qi-brand {
  font-size: var(--ds-fs-sm);
  font-weight: 700;
  color: #1B3A6B;
  white-space: nowrap;
}
.qi-cat {
  font-size: var(--ds-fs-sm);
  color: #94a3b8;
  white-space: nowrap;
}
.qi-name {
  font-size: var(--ds-fs-sm);
  font-weight: 700;
  color: #1e293b;
  line-height: 1.4;
}
.qi-spec {
  font-size: var(--ds-fs-sm);
  color: var(--ds-gray-600);
  margin-top: 3px;
  line-height: 1.6;
  white-space: normal;
  word-break: keep-all;
}

/* ── 스펙 줄바꿈 표시 ── */
.spec-line {
  font-size: 10.5px;
  color: #64748b;
  line-height: 1.7;
  padding: 0;
  white-space: normal;
  word-break: keep-all;
}
.items-table .spec-line { font-size: var(--ds-fs-sm); } /* 2026-10-09 품목 표 안에서만 12px */

/* ══════════════════════════════════════════════════════════
   ■ 모바일 – 신규 스타일 반응형
   ══════════════════════════════════════════════════════════ */
@media screen and (max-width: 600px) {
  /* 정렬 바 */
  .sort-bar { padding: 4px 6px !important; gap: 3px !important; }
  .sort-btn { font-size: 10.5px !important; padding: 2px 7px !important; }

  /* ── 제품 상세(aq) 모달: bottom-sheet 스타일 ── */
  #modal-aq.modal-overlay.open {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  .aq-modal-box {
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: 92dvh !important;
    border-radius: 16px 16px 0 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .aq-modal-body {
    padding: 10px 12px !important;
    overflow-y: auto !important;
    flex: 1 !important;
    min-height: 0 !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .aq-base-row, .aq-unit-row, .aq-qty-row { padding: 7px 10px !important; }
  .aq-base-input { font-size: 14px !important; }
  .aq-unit-input { font-size: 15px !important; }
  .aq-base-hint, .aq-unit-hint { display: none; }

  /* 스펙 헤더 숨김 */
  .spec-dd-header { display: none !important; }
  .spec-dd-row {
    grid-template-columns: 50px 1fr 78px !important;
    gap: 5px !important;
    padding: 5px 8px !important;
  }
  .spec-dd-label { font-size: 10.5px !important; min-width: 0 !important; }
  .spec-dd-select { font-size: 11px !important; height: 28px !important; }
  .spec-dd-price { font-size: 11px !important; height: 28px !important; }

  /* ── 렌탈 제품 상세(r-atq) 모달도 bottom-sheet ── */
  #r-modal-atq.modal-overlay.open {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  #r-modal-atq .modal-box {
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: 92dvh !important;
    border-radius: 16px 16px 0 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
  }
  #r-modal-atq .modal-body {
    overflow-y: auto !important;
    flex: 1 !important;
    min-height: 0 !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* 품목 테이블: 2026-10-09 1394줄 '견적 품목 표' 묶음으로 일원화 (가로 밀기 폭·작은 순서 버튼 규칙 제거) */
}

/* ══ 미리보기 모달 footer: 항상 오른쪽 정렬 (최우선) ══ */
#modal-preview .modal-footer,
#r-modal-preview .modal-footer,
#preview-footer,
#r-preview-footer {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  justify-content: flex-end !important;
  align-items: center !important;
  padding: 10px 14px !important;
  gap: 8px !important;
}
#modal-preview .modal-footer .btn,
#r-modal-preview .modal-footer .btn,
#preview-footer .btn,
#r-preview-footer .btn {
  flex: 0 0 auto !important;
  width: auto !important;
}

/* ══ 스펙 관리 패널 ══ */
.spec-admin-wrap {
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 0;
  overflow: hidden;   /* 자식이 높이 넘치지 않도록 */
  flex: 1;
  min-height: 0;
}
.spec-admin-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-shrink: 0;
}
.spec-3col-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-items: start;    /* 각 열이 독립적인 높이 */
  padding: 12px;
  overflow-y: auto;      /* 그리드 전체가 넘치면 스크롤 */
  flex: 1;
  min-height: 0;
}
@media (max-width: 768px) {
  .spec-3col-grid {
    grid-template-columns: 1fr;
  }
}
.spec-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.spec-section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;  /* 헤더 높이 고정 */
}
.spec-cat-body {
  padding: 8px;
  max-height: 480px;    /* 카테고리 박스 최대 높이 */
  overflow-y: auto;
}
#cat-admin-list {
  /* spec-cat-body 스타일 상속 */
}
.spec-opt-body {
  max-height: 480px;    /* 카테고리와 동일한 최대 높이로 맞춤 */
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.spec-opt-body table {
  width: 100%;
  min-width: 300px;
  border-collapse: collapse;
  font-size: 12px;
}
.spec-opt-body th {
  background: #f8fafc;
  padding: 8px 10px;
  font-weight: 700;
  color: #374151;
  border-bottom: 1.5px solid var(--border);
  text-align: left;
  font-size: 11px;
  white-space: nowrap;
}
.spec-opt-body td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.spec-opt-body tr:last-child td { border-bottom: none; }
.spec-opt-body tr:hover td { background: #f8fafc; }
.spec-opt-body td:last-child {
  white-space: nowrap;
  text-align: right;
}

/* ══ 고객사 picker 모달 ══ */
/* 검색 input이 항상 클릭/터치 가능하도록 */
.cpi-search-wrap {
  position: relative;
  z-index: 10;
  pointer-events: auto;
}
.cpi-search-input {
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-user-select: text;
  user-select: text;
  position: relative;
  z-index: 10;
}
/* 모바일: picker 모달 — 상단 고정 (키보드 올라와도 input 안 가려짐) */
@media (max-width: 600px) {
  #modal-client-picker.modal-overlay,
  #modal-r-client-picker.modal-overlay {
    align-items: flex-start !important;
    padding: 0 !important;
    overflow-y: hidden !important;
  }
  #modal-client-picker .modal-box,
  #modal-r-client-picker .modal-box {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  #modal-client-picker .modal-header,
  #modal-r-client-picker .modal-header {
    flex-shrink: 0;
  }
  #modal-client-picker .cpi-search-wrap,
  #modal-r-client-picker .cpi-search-wrap {
    flex-shrink: 0;
    padding: 10px 14px 8px;
  }
  #modal-client-picker .cpi-body,
  #modal-r-client-picker .cpi-body {
    flex: 1 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
  }
  #modal-client-picker .modal-footer,
  #modal-r-client-picker .modal-footer {
    flex-shrink: 0;
  }
  /* input: iOS 자동줌 방지 + 터치 영역 확보 */
  #cpi-search,
  #r-cpi-search {
    font-size: 16px !important;
    padding: 10px 12px !important;
    touch-action: manipulation;
    -webkit-user-select: text;
    user-select: text;
  }
  /* cpi-item 터치 영역 확대 */
  .cpi-item {
    padding: 14px 16px !important;
    min-height: 52px;
  }
}

/* 2026-10-20 휴대폰 렌탈 견적서 품목 표: 위 .q-table 칸 폭 규칙은 구매(No·구분·제품명·단가·수량·금액) 기준이라 렌탈은 제품명이 52px 로 눌림 → 렌탈 칸 순서로 다시 정함 */
@media screen and (max-width: 600px) {
  .q-table.q-table--rental th:nth-child(1), .q-table.q-table--rental td:nth-child(1) { width: 22px !important; white-space: nowrap !important; }
  .q-table.q-table--rental th:nth-child(2), .q-table.q-table--rental td:nth-child(2) { width: auto !important; }
  .q-table.q-table--rental th:nth-child(3), .q-table.q-table--rental td:nth-child(3) { display: none !important; }   /* 단위(월·일)는 기간 글자(12개월·365일)와 겹쳐 휴대폰에선 숨김 */
  .q-table.q-table--rental th:nth-child(4), .q-table.q-table--rental td:nth-child(4) { width: 40px !important; white-space: nowrap !important; }
  .q-table.q-table--rental th:nth-child(5), .q-table.q-table--rental td:nth-child(5) { width: 54px !important; white-space: nowrap !important; }
  .q-table.q-table--rental th:nth-child(6), .q-table.q-table--rental td:nth-child(6) { width: 30px !important; white-space: nowrap !important; }
  .q-table.q-table--rental th:nth-child(7), .q-table.q-table--rental td:nth-child(7) { width: 70px !important; white-space: nowrap !important; }
  /* 표 칸 폭은 <colgroup> 의 col 폭이 정하므로 같이 맞춤 (제품명 = 남는 폭 전부) */
  .q-table--rental col:nth-child(1) { width: 22px !important; }
  .q-table--rental col:nth-child(2) { width: auto !important; }
  .q-table--rental col:nth-child(3) { display: none !important; }
  .q-table--rental col:nth-child(4) { width: 40px !important; }
  .q-table--rental col:nth-child(5) { width: 54px !important; }
  .q-table--rental col:nth-child(6) { width: 30px !important; }
  .q-table--rental col:nth-child(7) { width: 70px !important; }
}
