/**
 * 고객 페이지 모바일 최적화 스타일
 */

/* 모바일 기본 스타일 */
@media (max-width: 768px) {
  /* 페이지 컨텐츠 패딩 축소 */
  .page-content {
    padding: 1rem;
    border-radius: 0.75rem;
  }

  .app-main {
    padding: 1rem;
  }

  /* 페이지 헤더 */
  .page-header-with-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
  }

  .page-header-left {
    width: 100%;
  }

  .page-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
  }

  .page-description {
    font-size: 0.875rem;
  }

  .page-header-actions {
    width: 100%;
    justify-content: flex-end;
  }

  /* 카드 그리드 - 모바일에서 1열 */
  .card-grid,
  .overview-widgets {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  /* 통계 위젯 */
  .overview-widget {
    padding: 1rem !important;
  }

  .widget-value {
    font-size: 1.25rem !important;
  }

  /* 확인 필요 항목 카드 */
  .card[style*="border-left: 4px solid"] {
    padding: 1rem !important;
  }

  .card[style*="border-left: 4px solid"] > div {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
  }

  .card[style*="border-left: 4px solid"] .btn {
    width: 100%;
    margin-left: 0 !important;
  }

  /* 프로젝트 헤더 */
  .card[style*="background: linear-gradient"] {
    padding: 1rem !important;
  }

  .card[style*="background: linear-gradient"] > div {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  .card[style*="background: linear-gradient"] h2 {
    font-size: 1.125rem !important;
  }

  /* 테이블 모바일 최적화 - 가로 스크롤 방식 */
  /* 테이블 컨테이너 */
  div[style*="overflow-x: auto"] {
    overflow-x: auto !important;
    overflow-y: visible;
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    position: relative;
  }

  div[style*="overflow-x: auto"] > .table {
    display: table;
    width: 100%;
    min-width: 600px; /* 최소 너비 설정 */
    table-layout: auto;
    border-collapse: collapse;
  }

  /* 일반 테이블 - 가로 스크롤 방식 */
  .table,
  .orders-table {
    font-size: 0.8125rem;
    display: table;
    width: 100%;
    min-width: 600px; /* 최소 너비 설정 */
    table-layout: auto;
    border-collapse: collapse;
  }

  .table thead,
  .orders-table thead {
    display: table-header-group;
  }

  .table tbody,
  .orders-table tbody {
    display: table-row-group;
  }

  .table tr,
  .orders-table tr {
    display: table-row;
    border-bottom: 1px solid var(--color-border);
  }

  .table td,
  .orders-table td {
    display: table-cell;
    padding: 0.75rem;
    border: none;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
    font-size: 0.8125rem;
    vertical-align: middle;
  }

  .table td:last-child,
  .orders-table td:last-child {
    border-bottom: 1px solid #f1f5f9;
    white-space: normal;
  }

  .table td::before,
  .orders-table td::before {
    display: none; /* data-label 숨김 */
  }

  .table th,
  .orders-table th {
    display: table-cell;
    padding: 0.75rem;
    font-weight: 600;
    font-size: 0.75rem;
    white-space: nowrap;
    background: #f8fafc;
    border-bottom: 2px solid var(--color-border);
  }

  /* 견적서 목록 - 금액 관련 컬럼은 작게 */
  .table td[data-label="공급가액"],
  .table td[data-label="부가세"],
  .table td[data-label="총액"] {
    font-size: 0.75rem;
  }

  .table td[data-label="총액"] {
    font-weight: 700;
    color: #111827;
  }
  
  /* 견적서 목록 모바일에서 보기 버튼을 가장 앞에 */
  .invoice-mobile-first {
    order: -1;
  }
  
  .invoice-action-cell {
    min-width: 80px;
  }
  
  .invoice-view-btn {
    width: 100%;
    text-align: center;
    white-space: nowrap;
  }

  /* 버튼 그룹 */
  .btn-group,
  div[style*="display: flex"][style*="gap"] {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }

  /* 액션 버튼 */
  .action-btn {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.75rem !important;
  }

  /* 계약서/주문 카드 */
  .card[style*="border: 1px solid"] {
    padding: 1rem !important;
  }

  .card[style*="border: 1px solid"] > div[style*="display: flex"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
  }

  .card[style*="border: 1px solid"] > div[style*="display: flex"] > div[style*="flex: 1"] {
    width: 100%;
    min-width: 0;
  }

  /* 빠른 메뉴 그리드 */
  a[style*="text-decoration: none"][style*="display: block"][style*="padding: 1.25rem"] {
    padding: 1rem !important;
  }

  /* 자료 송부 카드 */
  .card[style*="margin-bottom"] {
    margin-bottom: 1rem !important;
  }

  /* 모달 */
  .modal-content {
    max-width: 95% !important;
    padding: 1rem !important;
    margin: 1rem;
  }

  /* 폼 요소 */
  .form-control {
    font-size: 0.9375rem;
    padding: 0.75rem;
  }

  textarea.form-control {
    font-size: 0.9375rem;
  }

  /* 배지 */
  .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }

  /* 결제 안내 카드 */
  .payment-info-card {
    padding: 1rem !important;
    margin-top: 1rem !important;
  }

  /* 프로젝트 진행 현황 */
  .card[style*="background: #ffffff"][style*="border: 1px solid"] {
    padding: 1rem !important;
  }

  .card[style*="background: #ffffff"][style*="border: 1px solid"] > div[style*="display: grid"] {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  /* 서비스 정보 그리드 */
  div[style*="grid-template-columns: repeat(auto-fit, minmax(280px, 1fr))"] {
    grid-template-columns: 1fr !important;
  }

  /* 계약서 상세 페이지 */
  .contract-print-area {
    padding: 1rem !important;
    max-width: 100% !important;
  }

  .contract-print-area > div {
    padding: 1rem !important;
  }

  .contract-print-area h1.contract-title {
    font-size: 1.5rem !important;
  }

  /* 계약 당사자 정보 그리드 */
  div[style*="grid-template-columns: 1fr 1fr"][style*="gap: 2rem"] {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  /* 계약서 헤더 */
  div[style*="display: flex"][style*="justify-content: space-between"][style*="margin-bottom: 2rem"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
  }

  div[style*="display: flex"][style*="justify-content: space-between"][style*="margin-bottom: 2rem"] img {
    width: 100px !important;
    max-width: 100px !important;
  }

  /* 인쇄 버튼 */
  .print-button-container {
    justify-content: center !important;
    margin-bottom: 1rem !important;
  }

  .print-button-container .btn {
    width: 100%;
  }

  /* 서명 영역 */
  #signature-section {
    margin-top: 2rem !important;
    padding-top: 1rem !important;
  }

  #signature-section > div[style*="display: grid"] {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  /* 페이지 액션 */
  .page-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .page-actions form {
    width: 100%;
  }

  .page-actions .btn {
    width: 100%;
  }

  /* 파일 업로드 모달 */
  #uploadModal .modal-content {
    max-width: 95% !important;
  }

  /* 인보이스/견적서 테이블 */
  table[class*="table"] {
    font-size: 0.75rem;
  }

  /* 주문 내역 테이블 특별 처리 */
  .orders-table td {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .orders-table td::before {
    margin-bottom: 0.25rem;
  }

  .orders-table td > div[style*="display: flex"][style*="flex-direction: column"] {
    width: 100%;
  }
  
  /* 주문내역 관리 부분 버튼 한줄로 */
  .orders-action-cell > div {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .orders-action-cell .action-btn {
    flex-shrink: 0;
    white-space: nowrap;
    min-width: 60px;
  }

  /* dashboard.php 확인 필요 항목 카드 */
  div[style*="display: flex"][style*="align-items: center"][style*="justify-content: space-between"][style*="padding: 1rem"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
  }

  div[style*="display: flex"][style*="align-items: center"][style*="justify-content: space-between"][style*="padding: 1rem"] > div[style*="flex: 1"] {
    width: 100%;
  }

  div[style*="display: flex"][style*="align-items: center"][style*="justify-content: space-between"][style*="padding: 1rem"] > a {
    width: 100%;
    margin-left: 0 !important;
    text-align: center;
  }

  /* dashboard.php 프로젝트 헤더 */
  div[style*="display: flex"][style*="justify-content: space-between"][style*="align-items: flex-start"][style*="flex-wrap: wrap"] {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  div[style*="display: flex"][style*="justify-content: space-between"][style*="align-items: flex-start"][style*="flex-wrap: wrap"] > div[style*="text-align: right"] {
    text-align: left !important;
    width: 100%;
    margin-top: 1rem;
  }

  /* progress.php 타임라인 */
  .card[style*="margin-bottom: var(--spacing-xl)"] {
    padding: 1rem !important;
    margin-bottom: 1rem !important;
  }

  div[style*="position: relative"][style*="padding-left: 2rem"] {
    padding-left: 1.5rem !important;
  }

  div[style*="position: absolute"][style*="left: 0.75rem"][style*="top: 0"][style*="bottom: 0"][style*="width: 2px"] {
    left: 0.5rem !important;
  }

  div[style*="position: absolute"][style*="left: -2rem"][style*="top: 0.25rem"] {
    left: -1.5rem !important;
    width: 1.5rem !important;
    height: 1.5rem !important;
  }

  /* progress.php 단계 내용 */
  div[style*="position: relative"][style*="margin-bottom: 2rem"][style*="padding-bottom: 2rem"] {
    padding-left: 0 !important;
    margin-left: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }

  div[style*="position: relative"][style*="margin-bottom: 2rem"][style*="padding-bottom: 2rem"] > div[style*="display: flex"][style*="align-items: center"] {
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
  }

  div[style*="position: relative"][style*="margin-bottom: 2rem"][style*="padding-bottom: 2rem"] h4 {
    font-size: 1rem !important;
  }

  div[style*="position: relative"][style*="margin-bottom: 2rem"][style*="padding-bottom: 2rem"] p {
    font-size: 0.8125rem !important;
    margin-bottom: 0.75rem !important;
  }

  /* progress.php 진행 중/완료 정보 박스 */
  div[style*="background: #eff6ff"][style*="padding: 1rem"] {
    padding: 0.75rem !important;
    font-size: 0.75rem !important;
    margin-bottom: 0.75rem !important;
  }

  div[style*="background: #eff6ff"][style*="padding: 1rem"] > div {
    font-size: 0.75rem !important;
    margin-bottom: 0.25rem !important;
  }

  div[style*="background: #f0fdf4"][style*="padding: 0.75rem"] {
    padding: 0.5rem !important;
    font-size: 0.75rem !important;
  }

  div[style*="background: #f0fdf4"][style*="padding: 0.75rem"] > div {
    font-size: 0.75rem !important;
  }

  /* progress.php 진행 요약 그리드 */
  .card-grid[style*="grid-template-columns: repeat(auto-fit, minmax(250px, 1fr))"] {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .card-grid[style*="grid-template-columns: repeat(auto-fit, minmax(250px, 1fr))"] .card {
    padding: 1rem !important;
  }

  .card-grid[style*="grid-template-columns: repeat(auto-fit, minmax(250px, 1fr))"] .card > div[style*="font-size: 2rem"] {
    font-size: 1.5rem !important;
  }

  /* services.php 서비스 카드 그리드 */
  .service-cards-grid {
    grid-template-columns: 1fr !important;
  }

  /* services.php 추천 상품 가로 스크롤 */
  .recommended-products {
    padding-bottom: 1rem;
  }

  .recommended-product {
    flex: 0 0 180px;
    min-width: 180px;
  }

  /* inquiries.php 폼 버튼 */
  div[style*="display: flex"][style*="justify-content: flex-end"] {
    flex-direction: column-reverse !important;
    gap: 0.5rem !important;
  }

  div[style*="display: flex"][style*="justify-content: flex-end"] > button {
    width: 100%;
  }

  /* 페이지 헤더 (견적서 목록 등) */
  div[style*="display: flex"][style*="justify-content: space-between"][style*="align-items: center"][style*="margin-bottom: 1.5rem"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
  }

  /* 프로젝트 헤더 포함 파일 */
  .project-header-card {
    padding: 1rem !important;
  }

  .project-header-card > div {
    flex-direction: column !important;
    gap: 1rem !important;
  }

  /* project-header.php 스타일 */
  div[style*="background: linear-gradient(135deg, #3b82f6"][style*="margin-bottom: var(--spacing-xl)"] {
    margin-bottom: 1rem !important;
  }

  div[style*="background: linear-gradient(135deg, #3b82f6"][style*="margin-bottom: var(--spacing-xl)"] > div {
    padding: 1rem !important;
  }

  div[style*="background: linear-gradient(135deg, #3b82f6"][style*="margin-bottom: var(--spacing-xl)"] h2 {
    font-size: 1.25rem !important;
  }

  div[style*="background: linear-gradient(135deg, #3b82f6"][style*="margin-bottom: var(--spacing-xl)"] div[style*="text-align: right"] {
    text-align: left !important;
    width: 100%;
    margin-top: 1rem;
  }

  div[style*="background: linear-gradient(135deg, #3b82f6"][style*="margin-bottom: var(--spacing-xl)"] div[style*="font-size: 2rem"] {
    font-size: 1.5rem !important;
  }

  /* invoice.php 견적서 페이지 */
  .invoice-container {
    padding: 1rem !important;
  }

  .invoice-header {
    flex-direction: column !important;
    gap: 1rem !important;
  }

  .invoice-header > div {
    width: 100%;
  }

  .invoice-header img {
    width: 100px !important;
    max-width: 100px !important;
  }

  /* 견적서 카드 */
  .card[style*="max-width: 900px"][id="invoice"] {
    max-width: 100% !important;
    margin: 0 !important;
  }

  .card[style*="max-width: 900px"][id="invoice"] > div {
    padding: 1rem !important;
  }

  /* 견적서 헤더 */
  div[style*="display: flex"][style*="justify-content: space-between"][style*="margin-bottom: 2rem"][style*="padding-bottom: 1.5rem"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
  }

  div[style*="display: flex"][style*="justify-content: space-between"][style*="margin-bottom: 2rem"][style*="padding-bottom: 1.5rem"] h1 {
    font-size: 1.5rem !important;
  }

  div[style*="display: flex"][style*="justify-content: space-between"][style*="margin-bottom: 2rem"][style*="padding-bottom: 1.5rem"] img {
    width: 100px !important;
    max-width: 100px !important;
  }

  /* 견적서 공급자/수신자 정보 그리드 */
  div[style*="grid-template-columns: 1fr 1fr"][style*="gap: 2rem"][style*="margin-bottom: 2rem"] {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  /* 견적서 테이블 (invoice.php) - 견적 항목 테이블 - 가로 스크롤 방식 */
  div[style*="margin-bottom: 2rem"] > table.table[style*="width: 100%"][style*="border-collapse: collapse"] {
    font-size: 0.75rem;
    display: table;
    width: 100%;
    min-width: 600px; /* 최소 너비 설정 */
    table-layout: auto;
    border-collapse: collapse;
  }

  div[style*="margin-bottom: 2rem"] {
    overflow-x: auto;
    overflow-y: visible;
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  table.table[style*="width: 100%"][style*="border-collapse: collapse"] {
    font-size: 0.75rem;
    display: table;
    width: 100%;
    min-width: 600px; /* 최소 너비 설정 */
    table-layout: auto;
    border-collapse: collapse;
  }

  table.table[style*="width: 100%"][style*="border-collapse: collapse"] thead {
    display: table-header-group;
  }

  table.table[style*="width: 100%"][style*="border-collapse: collapse"] tbody {
    display: table-row-group;
  }

  table.table[style*="width: 100%"][style*="border-collapse: collapse"] tr {
    display: table-row;
    border-bottom: 1px solid #e5e7eb;
  }

  table.table[style*="width: 100%"][style*="border-collapse: collapse"] td {
    display: table-cell;
    padding: 0.75rem;
    border: none;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
    vertical-align: middle;
    font-size: 0.8125rem;
  }

  table.table[style*="width: 100%"][style*="border-collapse: collapse"] td:last-child {
    white-space: normal;
  }

  table.table[style*="width: 100%"][style*="border-collapse: collapse"] td::before {
    display: none; /* data-label 숨김 */
  }

  table.table[style*="width: 100%"][style*="border-collapse: collapse"] th {
    display: table-cell;
    padding: 0.75rem;
    font-weight: 600;
    font-size: 0.75rem;
    white-space: nowrap;
    background: #1f2937 !important;
    color: #fff !important;
    border-bottom: 2px solid var(--color-border);
  }

  table.table[style*="width: 100%"][style*="border-collapse: collapse"] thead tr {
    background-color: #1f2937 !important;
  }

  table.table[style*="width: 100%"][style*="border-collapse: collapse"] thead tr th {
    background-color: #1f2937 !important;
    color: #fff !important;
  }

  /* 견적 항목 테이블 - 금액은 강조 */
  table.table[style*="width: 100%"][style*="border-collapse: collapse"] td[data-label="금액"] {
    font-weight: 700;
    color: #111827;
  }

  /* 견적 항목 테이블 - 단가와 수량은 작게 */
  table.table[style*="width: 100%"][style*="border-collapse: collapse"] td[data-label="단가"],
  table.table[style*="width: 100%"][style*="border-collapse: collapse"] td[data-label="수량"] {
    font-size: 0.75rem;
  }

  /* 견적서 하단 정보 그리드 */
  div[style*="grid-template-columns: 1fr 1fr"][style*="gap: 2rem"][style*="padding-top: 1.5rem"] {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  /* 견적서 요약 테이블 */
  table[style*="width: 100%"][style*="border-collapse: collapse"] {
    font-size: 0.875rem;
  }

  table[style*="width: 100%"][style*="border-collapse: collapse"] td {
    padding: 0.5rem !important;
  }

  /* 인쇄 버튼 */
  div[style*="display: flex"][style*="justify-content: space-between"][style*="margin-bottom: 1.5rem"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }

  div[style*="display: flex"][style*="justify-content: space-between"][style*="margin-bottom: 1.5rem"] > button {
    width: 100%;
  }

  /* 견적서 푸터 */
  div[style*="border-top: 1px solid"][style*="background-color: #f9fafb"][style*="padding: 1rem 2.5rem"] {
    padding: 1rem !important;
  }

  div[style*="border-top: 1px solid"][style*="background-color: #f9fafb"][style*="padding: 1rem 2.5rem"] > div {
    font-size: 0.875rem !important;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  div[style*="border-top: 1px solid"][style*="background-color: #f9fafb"][style*="padding: 1rem 2.5rem"] > div > span {
    margin-left: 0 !important;
    display: block;
  }

  /* dashboard.php 빠른 메뉴 그리드 */
  div[style*="grid-template-columns: repeat(auto-fit, minmax(200px, 1fr))"][style*="gap: 1rem"] {
    grid-template-columns: 1fr !important;
  }

  /* dashboard.php 작업 진행 현황 그리드 */
  div[style*="grid-template-columns: repeat(auto-fit, minmax(200px, 1fr))"][style*="gap: 1rem"][style*="margin-bottom: 1.5rem"] {
    grid-template-columns: 1fr !important;
  }

  /* dashboard.php 부가서비스 정보 그리드 */
  div[style*="grid-template-columns: repeat(auto-fit, minmax(280px, 1fr))"][style*="gap: 1rem"] {
    grid-template-columns: 1fr !important;
  }

  /* progress.php 프로젝트 목록 */
  div[style*="display: grid"][style*="gap: 1rem"] > a,
  .progress-project-list > a {
    padding: 1rem !important;
  }

  div[style*="display: grid"][style*="gap: 1rem"] > a > div[style*="display: flex"][style*="justify-content: space-between"],
  .progress-project-list > a > div[style*="display: flex"][style*="justify-content: space-between"] {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  
  /* progress.php 프로젝트 목록 모바일 최적화 */
  .progress-project-list > a > div[style*="display: flex"][style*="justify-content: space-between"] > div[style*="flex: 1"] {
    width: 100%;
  }
  
  .progress-project-list > a > div[style*="display: flex"][style*="justify-content: space-between"] > div[style*="color: #9ca3af"] {
    display: none;
  }

  /* services.php 모달 */
  .modal-overlay {
    padding: 1rem;
  }

  .modal-overlay .modal {
    max-width: 95% !important;
    margin: 0;
  }

  /* services.php 업그레이드 모달 */
  #upgradeModal .modal {
    max-width: 95% !important;
  }

  #upgradeModal .modal-body > div[style*="display: grid"] {
    grid-template-columns: 1fr !important;
  }

  /* materials.php 파일 업로드 모달 */
  #uploadModal {
    padding: 1rem;
  }

  #uploadModal .modal-content {
    max-width: 95% !important;
    margin: 0;
  }

  /* contracts.php 계약서 카드 */
  div[style*="display: flex"][style*="flex-direction: column"][style*="gap: 1rem"] > .card {
    padding: 1rem !important;
  }

  div[style*="display: flex"][style*="flex-direction: column"][style*="gap: 1rem"] > .card > div[style*="display: flex"][style*="justify-content: space-between"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
  }

  div[style*="display: flex"][style*="flex-direction: column"][style*="gap: 1rem"] > .card > div[style*="display: flex"][style*="gap: 0.5rem"] {
    width: 100%;
    flex-wrap: wrap;
  }

  div[style*="display: flex"][style*="flex-direction: column"][style*="gap: 1rem"] > .card > div[style*="display: flex"][style*="gap: 0.5rem"] > a {
    flex: 1;
    min-width: 120px;
    text-align: center;
  }

  /* profile.php 탭 메뉴 */
  div[style*="display: flex"][style*="gap: 0.5rem"][style*="margin-bottom: 1.5rem"][style*="border-bottom: 2px solid"] {
    flex-wrap: wrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  div[style*="display: flex"][style*="gap: 0.5rem"][style*="margin-bottom: 1.5rem"][style*="border-bottom: 2px solid"] > button {
    flex: 1;
    min-width: 100px;
    white-space: nowrap;
    font-size: 0.8125rem !important;
    padding: 0.5rem 1rem !important;
  }
  
  /* 요청/자료실 상단 탭 최적화 */
  .customer-resources-tabs {
    flex-wrap: nowrap !important;
    overflow-x: visible !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin;
    justify-content: space-between !important;
  }
  
  .customer-resources-tabs .tab-button {
    flex: 1 1 0 !important;
    flex-shrink: 1 !important;
    white-space: nowrap;
    min-width: 0 !important;
    font-size: 0.75rem !important;
    padding: 0.75rem 0.5rem !important;
  }
  
  .customer-resources-tabs .tab-icon.desktop-only {
    display: none !important;
  }
  
  .customer-resources-tabs .tab-label {
    font-size: 0.75rem !important;
  }
  
  /* 자주묻는 질문 모바일 최적화 */
  .faq-category-filter {
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
  }
  
  .faq-category-btn {
    font-size: 0.8125rem !important;
    padding: 0.5rem 0.875rem !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
  
  .faq-item {
    margin-bottom: 0.5rem !important;
  }
  
  .faq-question {
    padding: 0.875rem 1rem !important;
    font-size: 0.875rem !important;
  }
  
  .faq-answer {
    font-size: 0.8125rem !important;
    line-height: 1.6 !important;
  }
  
  .faq-answer.active {
    padding: 1rem !important;
  }
  
  /* 모바일에서 인쇄하기 → PDF 다운로드 */
  .print-download-btn .print-text {
    display: inline;
  }
  
  .print-download-btn .download-text {
    display: none;
  }
  
  @media (max-width: 768px) {
    .print-download-btn .print-text {
      display: none;
    }
    
    .print-download-btn .download-text {
      display: inline !important;
    }
  }
  
  /* PDF export 모드 - PC 레이아웃으로 강제 */
  body.pdf-export-mode #invoice,
  body.pdf-export-mode #contract {
    max-width: 900px !important;
    width: 900px !important;
    margin: 0 auto !important;
  }
  
  body.pdf-export-mode #invoice *,
  body.pdf-export-mode #contract * {
    font-size: inherit !important;
  }
  
  body.pdf-export-mode #invoice .contract-print-area,
  body.pdf-export-mode #contract .contract-print-area {
    padding: 2.5rem !important;
  }

  /* profile.php 회사 정보/담당자 정보 */
  div[style*="display: flex"][style*="flex-wrap: wrap"][style*="gap: 1.5rem"][style*="align-items: center"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
  }

  div[style*="display: flex"][style*="flex-wrap: wrap"][style*="gap: 1.5rem"][style*="align-items: center"] > div {
    width: 100%;
  }

  /* profile.php 버튼 그룹 */
  div[style*="display: flex"][style*="gap: 0.5rem"] {
    flex-wrap: wrap;
  }

  div[style*="display: flex"][style*="gap: 0.5rem"] > button {
    flex: 1;
    min-width: 100px;
  }

  /* profile.php 파일 테이블 - 가로 스크롤 방식 */
  div[id*="file-category-"][id*="-list"] {
    overflow-x: auto;
    overflow-y: visible;
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    position: relative;
  }

  div[id*="file-category-"][id*="-list"] > table.table {
    min-width: 600px; /* 최소 너비 설정 */
  }

  /* profile.php 파일 카테고리 카드 - 가로 100% */
  .card[style*="border: 1px solid"][style*="overflow: hidden"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* profile.php 파일 카테고리 헤더 - 모바일에서 아이콘 오른쪽 정렬 */
  div[style*="background: #f8fafc"][style*="padding: 1rem"][style*="border-bottom: 1px solid"][style*="cursor: pointer"][style*="display: flex"][style*="align-items: center"][style*="justify-content: space-between"] {
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
  }

  div[style*="background: #f8fafc"][style*="padding: 1rem"][style*="border-bottom: 1px solid"][style*="cursor: pointer"][style*="display: flex"][style*="align-items: center"][style*="justify-content: space-between"] > div[style*="display: flex"][style*="align-items: center"][style*="gap: 0.75rem"] {
    flex: 1;
    min-width: 0;
  }

  div[style*="background: #f8fafc"][style*="padding: 1rem"][style*="border-bottom: 1px solid"][style*="cursor: pointer"][style*="display: flex"][style*="align-items: center"][style*="justify-content: space-between"] > span[id*="-icon"] {
    flex-shrink: 0;
    margin-left: 0.75rem;
    font-size: 0.875rem;
    order: 2;
  }

  /* progress.php 진행과정 페이지 모바일 최적화 */
  .card[style*="margin-bottom: var(--spacing-xl)"] > div[style*="position: relative"][style*="padding-left: 2rem"] {
    padding-left: 1.5rem !important;
  }

  .card[style*="margin-bottom: var(--spacing-xl)"] > div[style*="position: relative"][style*="padding-left: 2rem"] > div[style*="position: absolute"][style*="left: 0.75rem"] {
    left: 0.5rem !important;
    width: 1.5rem !important;
    height: 1.5rem !important;
  }

  .card[style*="margin-bottom: var(--spacing-xl)"] > div[style*="position: relative"][style*="padding-left: 2rem"] > div[style*="position: relative"][style*="margin-bottom: 2rem"] {
    margin-bottom: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }

  .card[style*="margin-bottom: var(--spacing-xl)"] > div[style*="position: relative"][style*="padding-left: 2rem"] > div[style*="position: relative"] h4 {
    font-size: 1rem !important;
  }

  .card[style*="margin-bottom: var(--spacing-xl)"] > div[style*="position: relative"][style*="padding-left: 2rem"] > div[style*="position: relative"] p {
    font-size: 0.8125rem !important;
    line-height: 1.5 !important;
  }

  .card-grid[style*="display: grid"][style*="grid-template-columns: repeat(auto-fit, minmax(250px, 1fr))"] {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  table.table[style*="width: 100%"][style*="border-collapse: collapse"] {
    font-size: 0.75rem;
    display: table;
    width: 100%;
    min-width: 600px; /* 최소 너비 설정 */
    table-layout: auto;
    border-collapse: collapse;
  }

  table.table[style*="width: 100%"][style*="border-collapse: collapse"] thead {
    display: table-header-group;
  }

  table.table[style*="width: 100%"][style*="border-collapse: collapse"] tbody {
    display: table-row-group;
  }

  table.table[style*="width: 100%"][style*="border-collapse: collapse"] tr {
    display: table-row;
    border-bottom: 1px solid #e5e7eb;
  }

  table.table[style*="width: 100%"][style*="border-collapse: collapse"] td {
    display: table-cell;
    padding: 0.75rem;
    border: none;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
    vertical-align: middle;
  }

  table.table[style*="width: 100%"][style*="border-collapse: collapse"] td:last-child {
    white-space: normal;
  }

  table.table[style*="width: 100%"][style*="border-collapse: collapse"] td::before {
    display: none; /* data-label 숨김 */
  }

  table.table[style*="width: 100%"][style*="border-collapse: collapse"] th {
    display: table-cell;
    padding: 0.75rem;
    font-weight: 600;
    font-size: 0.75rem;
    white-space: nowrap;
    background: #f8fafc;
    border-bottom: 2px solid var(--color-border);
  }

  /* profile.php 계정정보/메모 카드 */
  div[style*="display: flex"][style*="justify-content: space-between"][style*="align-items: flex-start"][style*="gap: 1.5rem"] {
    flex-direction: column !important;
    gap: 1rem !important;
  }

  div[style*="display: flex"][style*="justify-content: space-between"][style*="align-items: flex-start"][style*="gap: 1.5rem"] > div[style*="font-size: 0.8125rem"][style*="text-align: right"] {
    text-align: left !important;
    width: 100%;
  }

  /* profile.php 모달 */
  .modal[style*="display: none"] {
    padding: 1rem;
  }

  .modal[style*="display: none"] .modal-content {
    max-width: 95% !important;
    margin: 0;
    padding: 1rem !important;
  }

  /* profile.php 파일 카테고리 카드 */
  .card[style*="border: 1px solid"][style*="overflow: hidden"] {
    margin-bottom: 1rem;
  }

  /* dashboard.php 최근 견적서 테이블 */
  table.table[style*="overflow-x: auto"] {
    font-size: 0.75rem;
  }

  /* progress.php 프로젝트 링크 */
  a[style*="display: block"][style*="padding: 1.5rem"] {
    padding: 1rem !important;
  }

  /* progress.php 상단 버튼 영역 */
  div[style*="margin-bottom: 1.5rem"][style*="display: flex"][style*="justify-content: space-between"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
  }

  div[style*="margin-bottom: 1.5rem"][style*="display: flex"][style*="justify-content: space-between"] > div[style*="display: flex"][style*="gap: 0.75rem"] {
    width: 100%;
    flex-direction: column !important;
    gap: 0.5rem !important;
  }

  div[style*="margin-bottom: 1.5rem"][style*="display: flex"][style*="justify-content: space-between"] > div[style*="display: flex"] > a.btn {
    width: 100%;
    justify-content: center;
  }

  /* project-files.php 차수별 파일 목록 */
  .card > div[style*="margin-bottom: 2rem"] {
    margin-bottom: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }

  .card > div[style*="margin-bottom: 2rem"] h4 {
    font-size: 0.9375rem !important;
  }

  .card > div[style*="margin-bottom: 2rem"] > div[style*="overflow-x: auto"] > table.table {
    font-size: 0.8125rem !important;
  }

  /* contact-info.php 담당자 카드 */
  div[style*="display: grid"][style*="grid-template-columns: repeat(auto-fill, minmax(280px, 1fr))"] {
    grid-template-columns: 1fr !important;
  }

  div[style*="padding: 1.5rem"][style*="background: #f9fafb"] {
    padding: 1rem !important;
  }

  a[style*="display: block"][style*="padding: 1.5rem"] > div[style*="display: flex"][style*="justify-content: space-between"] {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }

  /* progress.php 모달 */
  #project-files-modal,
  #contact-info-modal {
    width: 95% !important;
    max-width: 95% !important;
    max-height: 95vh !important;
  }

  #project-files-modal > div[style*="padding: 2rem"],
  #contact-info-modal > div[style*="padding: 2rem"] {
    padding: 1rem !important;
    max-height: calc(95vh - 60px) !important;
  }

  #project-files-modal h2,
  #contact-info-modal h2 {
    font-size: 1.125rem !important;
  }

  #project-files-modal h4,
  #contact-info-modal h3 {
    font-size: 0.9375rem !important;
  }

  #project-files-modal table.table {
    font-size: 0.8125rem !important;
    min-width: 500px !important;
  }

  #project-files-modal table.table th,
  #project-files-modal table.table td {
    padding: 0.5rem !important;
  }

  a[style*="display: block"][style*="padding: 1.5rem"] > div[style*="display: flex"][style*="justify-content: space-between"] > div[style*="flex: 1"] {
    width: 100%;
  }

  /* progress.php 뒤로가기 버튼 */
  div[style*="margin-bottom: 1.5rem"] > a {
    width: 100%;
    justify-content: center;
  }

  /* services.php 추천 상품 가로 스크롤 개선 */
  .recommended-products {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  /* materials.php 자료 요청 카드 */
  .card[style*="border: 1px solid"][style*="padding: 1.5rem"] {
    padding: 1rem !important;
  }

  .card[style*="border: 1px solid"][style*="padding: 1.5rem"] > div[style*="display: flex"][style*="justify-content: space-between"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
  }

  .card[style*="border: 1px solid"][style*="padding: 1.5rem"] > div[style*="display: flex"][style*="justify-content: space-between"] > button {
    width: 100%;
  }
  
  /* materials.php 표 헤더 모바일 최적화 - 가로 스크롤 방식 */
  div[id*="materials-files-tab"] {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
  }
  
  div[id*="materials-files-tab"] table.table {
    display: table !important;
    width: 100% !important;
    min-width: 600px !important;
    table-layout: auto !important;
    border-collapse: collapse !important;
  }
  
  div[id*="materials-files-tab"] table.table thead {
    display: table-header-group !important;
  }
  
  div[id*="materials-files-tab"] table.table thead tr {
    display: table-row !important;
  }
  
  div[id*="materials-files-tab"] table.table thead th {
    display: table-cell !important;
    white-space: nowrap !important;
    font-size: 0.75rem !important;
    padding: 0.5rem 0.75rem !important;
    text-align: left !important;
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    font-weight: 600 !important;
    color: #475569 !important;
    vertical-align: middle !important;
  }
  
  div[id*="materials-files-tab"] table.table tbody {
    display: table-row-group !important;
  }
  
  div[id*="materials-files-tab"] table.table tbody tr {
    display: table-row !important;
  }
  
  div[id*="materials-files-tab"] table.table tbody td {
    display: table-cell !important;
    white-space: normal !important;
    font-size: 0.75rem !important;
    padding: 0.5rem 0.75rem !important;
    vertical-align: middle !important;
    border-bottom: 1px solid #f1f5f9 !important;
  }
  
  div[id*="materials-files-tab"] table.table tbody td::before {
    display: none !important;
  }
  
  /* materials.php 탭 메뉴 모바일 최적화 */
  div[style*="display: flex"][style*="gap: 0.5rem"][style*="margin-bottom: 1.5rem"][style*="border-bottom: 1px solid"] {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }
  
  div[style*="display: flex"][style*="gap: 0.5rem"][style*="margin-bottom: 1.5rem"][style*="border-bottom: 1px solid"] > button {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 0.8125rem !important;
    padding: 0.625rem 1rem !important;
  }
  
  /* materials.php 프로젝트 자료 관리 h4 모바일 최적화 */
  .card[style*="border: 1px solid"][style*="margin-bottom: 1.5rem"] > div[style*="padding: 1.5rem"][style*="border-bottom: 1px solid"] > h4 {
    flex-wrap: wrap !important;
    word-break: break-word !important;
    line-height: 1.5 !important;
  }
  
  .card[style*="border: 1px solid"][style*="margin-bottom: 1.5rem"] > div[style*="padding: 1.5rem"][style*="border-bottom: 1px solid"] > h4 > span {
    display: block !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-top: 0.25rem !important;
  }
  
  .card[style*="border: 1px solid"][style*="margin-bottom: 1.5rem"] > div[style*="padding: 1.5rem"][style*="border-bottom: 1px solid"] > h4 > span:first-of-type {
    display: inline !important;
    width: auto !important;
    margin-top: 0 !important;
  }
  
  /* materials.php 파일 목록 테이블 모바일 최적화 */
  div[id*="materials-files-tab"] table.table {
    font-size: 0.75rem !important;
  }
  
  div[id*="materials-files-tab"] table.table th,
  div[id*="materials-files-tab"] table.table td {
    padding: 0.5rem !important;
  }

  /* inquiries.php 문의 카드 */
  .card[style*="border: 1px solid"][style*="padding: 1.5rem"] > div[style*="display: flex"][style*="justify-content: space-between"][style*="margin-bottom: 1rem"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
  }
}

/* 작은 모바일 (480px 이하) */
@media (max-width: 480px) {
  .page-content {
    padding: 0.75rem;
  }

  .app-main {
    padding: 0.75rem;
  }

  .page-title {
    font-size: 1.125rem;
  }

  .card {
    padding: 0.75rem !important;
  }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
  }

  .btn-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
  }

  h3 {
    font-size: 1rem;
  }

  h4 {
    font-size: 0.9375rem;
  }
}

