/* ------------------------------
       1) 전역 스타일
    ------------------------------*/
* { box-sizing: border-box; }
body {
  margin: 0; padding: 0;
  font-family: "Malgun Gothic", sans-serif;
  font-size: 14px; background: #f7f7f7; color: #333;
}

/* 헤더 - 최대폭 480px, 가운데 배치, 오른쪽에 AI서비스 버튼 */
header {
  background: #2c3e50;
  color: #ecf0f1;
  position: relative;
  padding: 12px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}
header h1 {
  margin: 0;
  font-size: 1.2em;
}
header a.ai-service {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: #e67e22;
  color: #fff;
  padding: 8px 10px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9em;
  display: inline-flex;
  align-items: center;
  transition: background 0.2s;
}
header a.ai-service:hover {
  background: #d35400;
}
header a.ai-service::after {
  content: "→";
  margin-left: 4px;
}
#container {
  max-width: 480px; 
  margin: 0 auto;
  background: #fff; 
  min-height: 100vh;
  box-shadow: 0 0 8px rgba(0,0,0,0.1); 
  position: relative;
}

@media (max-width:480px) {
  body { font-size: 13px; }
  .month-table th, .month-table td { font-size: 0.7em; }
  .schedule-bar { font-size: 0.65em; }
  .schedule-week-item { font-size: 0.7em; }
}

/* ------------------------------
       2) 로그인
    ------------------------------*/
#login-container { padding: 20px; }
#login-container h2 { margin-top: 0; font-size: 1em; color: #2c3e50; }
.login-form { display: flex; flex-direction: column; gap: 10px; }
.login-form label { font-weight: bold; font-size: 0.85em; color: #555; }
.login-form input {
  padding: 8px; border: 1px solid #ccc;
  border-radius: 4px; font-size: 0.85em;
}
.login-form button {
  background: #2c3e50; color: #ecf0f1;
  border: none; padding: 10px;
  border-radius: 4px; font-size: 0.85em;
  cursor: pointer; transition: background 0.2s;
}
.login-form button:hover { background: #34495e; }
.login-form .reset-pw {
  background: #c0392b;
  margin-top: 8px;
}

/* ------------------------------
       3) 메인 메뉴
    ------------------------------*/
#main-menu {
  display: none; 
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
  background: #fafafa; 
  overflow-x: auto;
}
#main-menu button {
  flex: 1; padding: 10px;
  border: none; background: #eee;
  font-size: 0.8em; cursor: pointer;
  white-space: nowrap; transition: background 0.2s;
}
#main-menu button.active {
  background: #2c3e50; color: #ecf0f1;
}
#main-menu button:hover { background: #ccc; }

/* ------------------------------
       4) 섹션
    ------------------------------*/
section { display: none; padding: 12px; }
section.active { display: block; }

/* ------------------------------
       5) 월간 달력
    ------------------------------*/
#monthlySection { margin-bottom: 60px; }
.month-controls {
  display: flex; justify-content: space-between; margin-bottom: 8px;
}
.month-controls button {
  background: #2c3e50; color: #ecf0f1; border: none;
  padding: 4px 8px; border-radius: 4px;
  font-size: 0.8em; cursor: pointer; transition: background 0.2s;
}
.month-controls button:hover { background: #34495e; }
#monthLabel { font-size: 0.9em; font-weight: bold; color: #2c3e50; }
.month-table {
  width: 100%; border-collapse: collapse;
  table-layout: fixed; position: relative; margin-bottom: 10px;
}
.month-table th, .month-table td {
  border: 1px solid #ddd; height: 50px; vertical-align: top;
  position: relative; text-align: center; font-size: 0.75em; padding: 2px;
}
.month-table th {
  background: #f2f2f2; font-weight: bold; color: #555; height: 35px;
}
.day-number {
  position: absolute; top: 2px; right: 2px;
  z-index: 2; font-weight: bold; font-size: 0.7em;
}
#monthOverlay {
  position: absolute; left: 0; top: 0; right: 0; bottom: 0;
  pointer-events: none;
}
.schedule-bar {
  position: absolute; height: 16px; color: #fff;
  border-radius: 4px; font-size: 0.7em; padding: 2px 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2); cursor: pointer;
  pointer-events: auto; z-index: 1; background: #999;
  transition: opacity 0.2s;
}
.schedule-bar:hover { opacity: 0.8; }

/* ------------------------------
       6) 주간 달력
    ------------------------------*/
.week-controls {
  display: flex; justify-content: space-between; margin-bottom: 8px;
}
.week-controls button {
  background: #2c3e50; color: #ecf0f1; border: none;
  padding: 4px 8px; font-size: 0.8em; border-radius: 4px;
  cursor: pointer; transition: background 0.2s;
}
.week-controls button:hover { background: #34495e; }
#weekLabel { font-size: 0.9em; font-weight: bold; color: #2c3e50; }
.week-list { display: flex; flex-direction: column; gap: 8px; }
.week-day-block {
  border: 1px solid #ddd; padding: 5px; position: relative;
  font-size: 0.75em; background: #fafafa; border-radius: 4px;
}
.schedule-week-item {
  display: block; background: #fffbe5; border: 1px solid #ddd;
  border-radius: 4px; margin-bottom: 6px; padding: 4px; position: relative;
  font-size: 0.75em; cursor: pointer; min-width: 120px;
  transition: background 0.2s;
}
.schedule-week-item:hover { background: #fff9cc; }
.schedule-color-bar {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; border-radius: 4px 0 0 4px; background: #999;
}
.schedule-week-content {
  margin-left: 6px; padding-left: 4px;
}

/* ------------------------------
       7) 관리자 페이지
    ------------------------------*/
.admin-menu {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px;
}
.admin-menu button {
  background: #2c3e50; color: #ecf0f1;
  border: none; border-radius: 4px; padding: 6px;
  font-size: 0.75em; cursor: pointer; transition: background 0.2s;
}
.admin-menu button:hover { background: #34495e; }
.admin-pane {
  display: none; 
  border: 1px solid #ddd; 
  padding: 8px;
  margin-bottom: 10px; 
  border-radius: 4px; 
  background: #fafafa;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  width: 100%;
  overflow-x: hidden;
}
.admin-pane.active { display: block; }
.admin-pane h4 {
  margin-top: 0; font-size: 0.9em;
  border-bottom: 1px solid #ddd; padding-bottom: 4px;
  margin-bottom: 8px; color: #2c3e50;
}
.admin-form-row { margin-bottom: 6px; }
.admin-form-row label {
  display: block; font-size: 0.75em; font-weight: bold; margin-bottom: 2px;
}
.admin-form-row input,
.admin-form-row select,
.admin-form-row textarea {
  width: 100%;
  padding: 6px; 
  font-size: 0.75em;
  border: 1px solid #ccc; 
  border-radius: 4px;
  box-sizing: border-box;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75em;
  margin-bottom: 8px;
  table-layout: auto;
  word-break: break-word;
}
.admin-table th, .admin-table td {
  border: 1px solid #ddd; padding: 4px; text-align: center;
}
.admin-table th {
  background: #f2f2f2; font-weight: bold; color: #333;
}
.admin-btn {
  background: #2c3e50; color: #ecf0f1;
  border: none; padding: 3px 6px; font-size: 0.75em;
  border-radius: 4px; cursor: pointer; transition: background 0.2s;
}
.admin-btn:hover { background: #34495e; }

/* ------------------------------
       8) 스케줄 모달
    ------------------------------*/
#modal-background {
  display: none; position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4); z-index: 999;
}
.modal {
  background: #fff;
  width: 90%;
  max-width: 420px;
  margin: 20px auto;
  padding: 12px;
  border-radius: 6px;
  position: relative;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.modal h3 {
  margin: 0 0 8px; font-size: 0.9em; color: #2c3e50;
  border-bottom: 1px solid #ddd; padding-bottom: 4px;
}
#scheduleStatusLabel {
  position: absolute;
  top: 10px;
  right: 40px; /* X 버튼(오른쪽 10px)과 겹치지 않도록 오른쪽에서 40px 떨어지게 함 */
  font-size: 0.9em;
  color: #999;
}
.modal-row { margin-bottom: 6px; }
.modal-row label {
  display: block; font-size: 0.75em; font-weight: bold;
  margin-bottom: 2px; color: #555;
}
/* 모달 버튼 영역 - 두 줄로 나눔: 첫 줄에는 주 작업 버튼, 두번째 줄에는 이메일 발송과 타임 테이블 */
.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.modal-buttons .primary-buttons,
.modal-buttons .secondary-buttons {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.modal-buttons button {
  background: #2c3e50;
  color: #ecf0f1;
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 0.85em;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
  white-space: nowrap;
}
.modal-buttons button:hover {
  background: #34495e;
  transform: translateY(-1px);
}

/* ------------------------------
       9) 유저 수정 모달
    ------------------------------*/
#modalUserEditBg {
  display: none; position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4); z-index: 999;
}
#userEditModal {
  background: #fff; width: 90%; max-width: 420px;
  margin: 100px auto 0; padding: 12px; border-radius: 6px;
  position: relative; box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
#userEditModal h3 {
  margin: 0 0 8px; font-size: 0.9em; color: #2c3e50;
  border-bottom: 1px solid #ddd; padding-bottom: 4px;
}

/* ------------------------------
       10) 스케줄 목록 표 (좌우 스크롤 적용)
         스케줄 목록만 좌우 스크롤이 적용되도록 함
    ------------------------------*/
.schedule-list-container {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 15px;
}

.schedule-list-container table {
  min-width: 1000px; /* 최소 너비 설정 - 화면보다 넓게 설정하여 스크롤 생성 */
  width: 100%;
}
/* -----------------------------------------
    PC 버전 모드 스타일 (화면 폭 2배 적용 + 20% 확대)
------------------------------------------ */
.pc-version header,
.pc-version #container {
  max-width: 960px;
  font-size: 1.2em; /* 20% 크기 확대 */
}

.pc-version .modal {
  max-width: 500px; /* 모달 크기도 확대 */
}

.pc-version .admin-table,
.pc-version .modal-row input,
.pc-version .modal-row textarea,
.pc-version .modal-row select {
  font-size: 1em; /* PC 모드에서 입력 필드 크기 확대 */
}

.pc-version .schedule-bar {
  height: 19px; /* 일정 바 높이 증가 */
}

/* 기존 PC 버전 관련 스타일 */
#monthCompanyFilter, #weekCompanyFilter {
  padding: 4px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.85em;
}

#adminAccessHistoryPane {
  border: 1px solid #ddd;
  padding: 10px;
  border-radius: 4px;
  background: #fafafa;
  margin-bottom: 10px;
}

#adminAccessHistoryPane.active {
  display: block;
}

#adminAccessHistoryPane h4 {
  margin-top: 0;
  font-size: 0.9em;
  border-bottom: 1px solid #ddd;
  padding-bottom: 4px;
  margin-bottom: 8px;
  color: #2c3e50;
}

#adminAccessHistoryBody tr:nth-child(even) {
  background-color: #f2f2f2;
}

#adminAccessHistoryBody tr:hover {
  background-color: #e9e9e9;
}
/* PC 버전 특화 스타일 */
.pc-version .schedule-list-container {
  max-width: 100%;
  overflow-x: auto;
}

.pc-version .schedule-list-container::-webkit-scrollbar {
  height: 8px;
}

.pc-version .schedule-list-container::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.pc-version .schedule-list-container::-webkit-scrollbar-thumb:hover {
  background: #555;
}
/* ------------------------------
       11) 히스토리 테이블 스타일 (좌우 스크롤 적용)
    ------------------------------*/
/* 히스토리 테이블 컨테이너 스타일 */
#adminHistoryPane, #statusHistoryPane {
  overflow-x: auto; /* 가로 스크롤 추가 */
  max-width: 100%; /* 컨테이너 최대 폭 제한 */
  padding-bottom: 12px; /* 스크롤바 여유 공간 */
}

/* 히스토리 테이블 스타일 */
#adminHistoryPane table, #statusHistoryPane table {
  min-width: 1500px; /* 더 넓게 설정하여 충분한 스크롤 영역 확보 */
  table-layout: fixed; /* 고정 테이블 레이아웃 */
  width: auto; /* 테이블 너비 자동 설정 */
  margin-bottom: 15px; /* 아래 여백 */
}

/* 테이블 헤더 고정 스타일 */
#adminHistoryPane thead, #statusHistoryPane thead {
  position: sticky;
  top: 0;
  background-color: #f2f2f2;
  z-index: 1;
  box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

/* 테이블 셀 스타일 */
#adminHistoryPane th, #adminHistoryPane td,
#statusHistoryPane th, #statusHistoryPane td {
  white-space: nowrap; /* 텍스트 줄바꿈 방지 */
  overflow: hidden; /* 넘치는 텍스트 숨김 */
  text-overflow: ellipsis; /* 넘치는 텍스트는 ...으로 표시 */
  padding: 6px 8px; /* 셀 내부 여백 */
  min-width: 100px; /* 최소 너비 */
  max-width: 150px; /* 최대 너비 */
}

/* 더 좁은 셀: 시간, 구분 등 */
#adminHistoryPane th:first-child, #adminHistoryPane td:first-child,
#statusHistoryPane th:first-child, #statusHistoryPane td:first-child {
  width: 90px;
  min-width: 90px;
  max-width: 90px;
}

/* 더 넓은 셀: 상세 내용 등 */
#adminHistoryPane th:nth-child(8), #adminHistoryPane td:nth-child(8),
#statusHistoryPane th:nth-child(8), #statusHistoryPane td:nth-child(8) {
  min-width: 120px; /* 업체명 */
}

/* 짝수/홀수 행 구분 */
#adminHistoryPane tbody tr:nth-child(even),
#statusHistoryPane tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

#adminHistoryPane tbody tr:hover,
#statusHistoryPane tbody tr:hover {
  background-color: #f0f7ff;
}

/* 변경 내용 강조 표시 */
#adminHistoryPane td[data-changed="true"],
#statusHistoryPane td[data-changed="true"] {
  background-color: #fffacd; /* 연한 노란색 */
  font-weight: bold;
}

/* 긴 텍스트를 가진 셀에 마우스 오버 시 툴팁 효과 */
#adminHistoryPane td, #statusHistoryPane td {
  position: relative;
}

#adminHistoryPane td:hover::after, 
#statusHistoryPane td:hover::after {
  content: attr(title);
  position: absolute;
  left: 0;
  top: 100%;
  background: #fff;
  border: 1px solid #ddd;
  padding: 5px 8px;
  white-space: normal;
  max-width: 300px;
  z-index: 10;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
  word-break: break-word;
  border-radius: 4px;
  font-size: 12px;
  color: #333;
}

/* 히스토리 제목 영역 */
#adminHistoryPane h4, #statusHistoryPane h4 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

/* 히스토리 필터 영역 */
.history-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.history-filters select, 
.history-filters input {
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.85em;
}

.history-filters button {
  background: #2c3e50;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.85em;
  cursor: pointer;
}

/* 스크롤바 스타일 커스텀 (옵션) */
#adminHistoryPane::-webkit-scrollbar, 
#statusHistoryPane::-webkit-scrollbar {
  height: 8px;
  background-color: #f1f1f1;
}

#adminHistoryPane::-webkit-scrollbar-thumb, 
#statusHistoryPane::-webkit-scrollbar-thumb {
  background-color: #888;
  border-radius: 4px;
}

#adminHistoryPane::-webkit-scrollbar-thumb:hover, 
#statusHistoryPane::-webkit-scrollbar-thumb:hover {
  background-color: #666;
}

/* 엑셀 다운로드 버튼 개선 */
.excel-download-btn {
  background: #27ae60;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 0.85em;
  cursor: pointer;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.excel-download-btn:hover {
  background: #219653;
}

.excel-download-btn::before {
  content: "📥";
  font-size: 1.1em;
}

/* 시작일/종료일, ETA/ETB/ETD 스타일 */
.schedule-date-container {
  display: flex;
  gap: 10px;
  width: 100%;
}

.schedule-date-item {
  flex: 1;
}

.schedule-date-item label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.75em;
  font-weight: bold;
}

.schedule-date-item input {
  width: 100%;
  padding: 6px;
  font-size: 0.75em;
  border: 1px solid #ccc;
  border-radius: 4px;
}

input[type="datetime-local"] {
  padding: 5px;
  font-size: 0.75em;
}

/* 날짜 입력 필드 스타일 수정 */
.date-input-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

.date-input-field {
  flex: 1;
  min-width: 140px;
}

.date-input-field label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.75em;
  font-weight: bold;
}

.date-input-field input {
  width: 100%;
  padding: 5px;
  box-sizing: border-box;
}

@media (max-width: 480px) {
  .date-input-container {
    flex-direction: column;
  }
  
  .date-input-field {
    width: 100%;
  }
}

.three-date-row {
  display: flex;
  flex-wrap: nowrap; /* 한 줄에 유지 */
  gap: 5px;        /* 필요한 경우 간격 조정 */
}
.three-date-row .date-input-field {
  flex: 1;
  min-width: 0;    /* 필드가 컨테이너 폭에 맞게 축소됨 */
}

.modal .modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  line-height: 1;
  color: #333;
}
.modal .modal-close:hover {
  color: #000;
}
#monthManagerFilter,
#weekManagerFilter {
  padding: 4px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.85em;
}
#modalStartDate,
#modalEndDate,
#modalETA,
#modalETB,
#modalETD {
  font-size: 13px;
}
#shipScheduleModal .admin-table {
  font-size: 0.65em;
}
#monthShipFilter {
  padding: 4px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.85em;
}
@media (max-width: 480px) {
  #monthCompanyFilterContainer {
    display: flex;
    flex-wrap: nowrap;
    gap: 2px;
    font-size: 0.65em;  /* 글씨 크기 축소 */
    width: 100%;
    overflow: hidden;
  }
  .filter-field {
    flex: 1 1 33%;
    min-width: 0;
    display: flex;
    align-items: center;
  }
  .filter-field label {
    margin-right: 2px;
    white-space: nowrap;
  }
  .filter-field select,
  .filter-field input {
    flex: 1;
    padding: 2px;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  .modal-row.flex-fields {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    width: 100%;
  }
  .modal-row.flex-fields > div {
    flex: 1;
    min-width: 0;
  }
  .modal-row.flex-fields label {
    font-size: 0.75em;
    white-space: nowrap;
  }
  .modal-row.flex-fields input {
    font-size: 0.75em;
    width: 100%;
    box-sizing: border-box;
  }
}
/* 수정된 테이블 스타일 */
.editable-table td[contenteditable="true"] {
    padding: 4px;
    min-height: 24px;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    transition: background-color 0.2s;
    max-height: 100px;  /* 셀 최대 높이 제한 */
    overflow-y: auto;   /* 세로 스크롤 적용 */
    white-space: pre-wrap; /* 줄바꿈 허용 */
    word-break: break-word; /* 단어 내에서 줄바꿈 허용 */
}

.editable-table td[contenteditable="true"]:hover {
    background-color: #f0f0f0;
}

.editable-table td[contenteditable="true"]:focus {
    background-color: #e5f2ff;
    outline: 2px solid #4a90e2;
    box-shadow: 0 0 4px rgba(74, 144, 226, 0.3);
}

/* SHIP NAME, 상세, 전달사항 필드 너비 두 배로 설정 */
.editable-table th[data-field="shipName"],
.editable-table th[data-field="details"],
.editable-table th[data-field="message"] {
    min-width: 200px !important;
    max-width: 600px !important;
    width: 300px !important;
}

.editable-table td[data-field="shipName"],
.editable-table td[data-field="details"],
.editable-table td[data-field="message"] {
    min-width: 200px !important;
    max-width: 600px !important;
    width: 300px !important;
}

/* 긴 텍스트 필드의 스크롤 설정 */
.editable-table td[data-field="shipName"],
.editable-table td[data-field="details"],
.editable-table td[data-field="message"] {
    max-height: 100px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 스케줄 목록 테이블 컨테이너 스타일 수정 */
.resizable-table-container {
    width: 100%;
    overflow-x: auto; /* 가로 스크롤 추가 */
    max-height: calc(80vh - 200px); /* 전체화면 모드에서 버튼이 보이도록 높이 조정 */
    position: relative;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* 테이블 래퍼 스타일 수정 - 최소 폭 제거 */
.table-wrapper {
    width: auto; /* 자동 폭 설정 */
    min-width: 100%; /* 최소 폭은 컨테이너 너비로 설정 */
}

th.resizable {
    position: relative;
    resize: horizontal;
    overflow: auto;
    min-width: 100px;
    max-width: 300px;
    word-break: break-word;
}

/* SHIP NAME, 상세, 전달사항 헤더 너비 조정 */
th.resizable[data-field="shipName"],
th.resizable[data-field="details"],
th.resizable[data-field="message"] {
    min-width: 200px !important;
    max-width: 600px !important;
    width: 300px !important;
}

th.resizable::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background-color: #e0e0e0;
    cursor: col-resize;
}

/* 텍스트 영역도 스크롤 가능하게 */
.modal-row textarea {
    max-height: 150px;
    overflow-y: auto;
}

/* SELECT 필드도 스크롤 가능하게 */
.status-select {
    max-height: 100px;
    overflow-y: auto;
}

/* 풀스크린 모드 */
.fullscreen-table {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 1000;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.fullscreen-table .resizable-table-container {
    max-height: calc(100vh - 150px); /* 버튼이 보이도록 높이 조정 */
    flex: 1;
}

.fullscreen-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

/* 체크박스 스타일 */
.schedule-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 셀렉트 박스 스타일 */
.status-select {
    width: 100%;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
}

/* 날짜 입력 필드 */
.date-input {
    width: 100%;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* 변경된 셀 하이라이트 */
.cell-modified {
    background-color: rgba(255, 235, 59, 0.2) !important;
}

/* 행 작업 버튼 */
.row-action-btn {
    padding: 2px 5px;
    margin: 2px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8em;
}

.row-action-btn.delete {
    background: #e74c3c;
}

/* 전체화면 모드에서 하단 버튼 영역 스타일 추가 */
.fullscreen-table .bottom-controls {
    margin-top: 10px;
    padding: 10px 0;
    border-top: 1px solid #eee;
    background: #fff;
}

/* 스크롤바 스타일 개선 */
.resizable-table-container::-webkit-scrollbar {
    height: 12px;
    width: 12px;
    background-color: #f5f5f5;
}

.resizable-table-container::-webkit-scrollbar-thumb {
    background-color: #888;
    border-radius: 10px;
    border: 3px solid #f5f5f5;
}

.resizable-table-container::-webkit-scrollbar-thumb:hover {
    background-color: #555;
}

/* 테이블 헤더 고정 */
.editable-table thead,
.admin-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f2f2f2;
}

/* 날짜 필드 너비 조정 */
.editable-table th.resizable[data-field="startDate"],
.editable-table th.resizable[data-field="endDate"],
.editable-table th.resizable[data-field="eta"],
.editable-table th.resizable[data-field="etb"],
.editable-table th.resizable[data-field="etd"],
.editable-table th.resizable[data-field="departureDate"] {
    min-width: 120px;
    width: 120px;
}

/* 체크박스 열 너비 조정 */
.editable-table th.resizable[data-field="unavailable"] {
    min-width: 80px;
    width: 80px;
}

/* 작업 열 너비 조정 */
.editable-table th.resizable[data-field="action"] {
    min-width: 120px;
    width: 120px;
}

/* 상태 표시줄 스타일 */
.table-status-bar {
    margin-top: 10px;
    padding: 8px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-status-info {
    font-size: 0.9em;
    color: #666;
}

/* PC 버전에서의 스크롤 개선 */
.pc-version .resizable-table-container,
.pc-version .schedule-list-container {
    max-height: calc(80vh - 180px);
}

.pc-version .fullscreen-table .resizable-table-container {
    max-height: calc(100vh - 120px);
}

/* 관리자 스케줄 테이블과 상태 스케줄 테이블 통일된 스타일 */
#adminScheduleListBody td,
#statusScheduleListBody td {
    white-space: normal;
    word-break: break-word;
    vertical-align: top;
    padding: 6px;
}

/* 기본적인 테이블 셀 스타일 추가 */
.editable-table td,
.admin-table td {
    padding: 6px 8px;
}

/* 상태 관련 스케줄 목록 컨테이너도 동일하게 설정 */
.schedule-list-container {
    width: 100%;
    overflow-x: auto;
    max-height: calc(80vh - 250px);
    position: relative;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* 스크롤바 스타일 통일 */
.schedule-list-container::-webkit-scrollbar {
    height: 12px;
    width: 12px;
    background-color: #f5f5f5;
}

.schedule-list-container::-webkit-scrollbar-thumb {
    background-color: #888;
    border-radius: 10px;
    border: 3px solid #f5f5f5;
}

.schedule-list-container::-webkit-scrollbar-thumb:hover {
    background-color: #555;
}

/* 테이블 스크롤 조절 기능 개선 */
.resizable-table-container {
  overflow-x: auto !important;
  max-width: 100% !important;
  width: 100% !important;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 15px;
}

.editable-table {
  width: auto !important;
  min-width: 100% !important;
  border-collapse: collapse;
}

.column-resizer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 8px;
  cursor: col-resize;
  background-color: transparent;
  transition: background-color 0.2s;
}

.column-resizer:hover {
  background-color: rgba(0, 120, 215, 0.3);
}

.resizable-table-container::-webkit-scrollbar {
  height: 12px;
  width: 12px;
  background-color: #f5f5f5;
}

.resizable-table-container::-webkit-scrollbar-thumb {
  background-color: #888;
  border-radius: 6px;
  border: 3px solid #f5f5f5;
}

.resizable-table-container::-webkit-scrollbar-thumb:hover {
  background-color: #555;
}

/* 스크롤 기간 동안 헤더 고정 */
.editable-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #f2f2f2;
  box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

/* 흰색 배경으로 통일 */
.editable-table td input,
.editable-table td select,
.editable-table td textarea {
  background-color: #fff !important;
  border: 1px solid #ddd !important;
  padding: 4px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

  /* 테이블 헤더 리사이징 스타일 */
  #editableScheduleTable th {
    position: relative;
    overflow: visible; /* 중요: 오버플로우 허용 */
    resize: horizontal; /* 브라우저 기본 리사이징 활성화 */
    overflow: auto; /* 브라우저 기본 리사이징과 함께 사용 */
    min-width: 50px;
  }
  
  /* 사용자 정의 리사이저 스타일 */
  .column-resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 10px; /* 더 넓게 하여 클릭하기 쉽게 */
    height: 100%;
    cursor: col-resize;
    z-index: 100;
    background-color: transparent;
  }
  
  .column-resizer:hover, 
  .column-resizer.active {
    background-color: rgba(0, 120, 215, 0.3);
  }
  
  /* 테이블 컨테이너 스타일 */
  .resizable-table-container {
    overflow-x: auto;
    width: 100%;
  }
  
  /* 전체 테이블 스타일 */
  #editableScheduleTable {
    table-layout: auto !important; /* 중요: 자동 레이아웃으로 설정 */
    width: auto !important; /* 중요: 자동 너비로 설정 */
  }
