/* === 사이드바 === */
.sidebar {
  width: 220px;
  background: white;
  border-right: 1px solid #e2e8f0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  height: 60px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.sidebar-nav { padding: 16px 0; flex: 1; overflow-y: auto; }
.sidebar-group { margin-bottom: 18px; }
.sidebar-group-title {
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
  padding: 0 20px 6px;
}
.sidebar-item {
  display: block;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 400;
  color: #475569;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: background 0.1s;
}
.sidebar-item:hover { background: #f8fafc; }
.sidebar-item.active {
  background: #f1f5f9;
  color: #475569;
  font-weight: 500;
  border-left-color: #475569;
}

/* === 헤더 === */
.app-header {
  background: white;
  border-bottom: 1px solid #e2e8f0;
  height: 60px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.page-title { font-size: 16px; font-weight: 600; color: #1e293b; }
.header-right { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.logout-link { color: #94a3b8; text-decoration: none; font-size: 13px; }
.logout-link:hover { color: #475569; }

/* === 메인 === */
.main { padding: 20px 24px; flex: 1; overflow-y: auto; overflow-x: hidden; }

/* === 페이지 툴바 === */
.page-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
}

/* === 카테고리 탭 === */
.category-tabs { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.cat-tab {
  padding: 7px 14px;
  background: white;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.cat-tab:hover { color: #475569; background: #f1f5f9; }
.cat-tab.active { background: #f1f5f9; color: #475569; border-color: #475569; }

/* === 테이블 === */
.ticket-table {
  width: 100%; background: white; border-radius: 8px;
  border-collapse: separate; border-spacing: 0;
  border: 1px solid #e2e8f0; overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.ticket-table th {
  text-align: left; padding: 11px 14px;
  background: #f8fafc; border-bottom: 1px solid #e2e8f0;
  color: #64748b; font-size: 12px; font-weight: 600;
}
.ticket-table th.sortable {
  cursor: pointer;
  user-select: none;
}
.ticket-table th.sortable:hover { color: #475569; }
.ticket-table th.sortable::after {
  content: ' ⇅';
  opacity: 0.35;
  font-size: 10px;
}
.ticket-table th.sortable.sort-asc::after { content: ' ↑'; opacity: 1; color: #475569; }
.ticket-table th.sortable.sort-desc::after { content: ' ↓'; opacity: 1; color: #475569; }

.ticket-table td {
  padding: 13px 14px; border-bottom: 1px solid #f1f5f9;
  font-size: 14px; color: #1e293b; font-weight: 600; vertical-align: middle;
}
.ticket-table tbody tr:hover { background: #f8fafc; cursor: pointer; }
.ticket-table tbody tr:last-child td { border-bottom: none; }

.status-pill { display: inline-block; padding: 3px 10px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.category-tag { display: inline-block; padding: 3px 9px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.empty-state { padding: 60px 20px; text-align: center; color: #94a3b8; font-size: 14px; font-weight: 600; }

/* 새 문의 버튼 */
.page-toolbar .btn { font-weight: 600; flex-shrink: 0; }

/* === 모달 === */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.4); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-backdrop.show { display: flex; }
.modal { width: 100%; max-width: 560px; background: white; border-radius: 12px; max-height: 90vh; overflow-y: auto; }
.modal-header { padding: 18px 22px; border-bottom: 1px solid #e2e8f0; font-size: 15px; font-weight: 600; color: #475569; }
.modal-body { padding: 18px 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid #e2e8f0; display: flex; gap: 8px; justify-content: flex-end; }
.modal-footer .btn.cancel { background: transparent; color: #64748b; border: 1px solid #cbd5e1; }
.modal-footer .btn.cancel:hover { background: #f1f5f9; }
.form-row { margin-bottom: 14px; }
.form-row textarea { width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 14px; resize: vertical; min-height: 100px; }
.form-row textarea:focus { outline: none; border-color: #475569; box-shadow: 0 0 0 3px rgba(71, 85, 105, 0.1); }

/* === 모달 내 첨부 영역 === */
.attach-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 6px;
  padding: 18px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  background: #f8fafc;
}
.attach-zone:hover, .attach-zone.dragover {
  border-color: #475569;
  background: #f1f5f9;
}
.attach-zone-text { color: #64748b; font-size: 13px; }
.attach-zone-link { color: #475569; text-decoration: underline; }
.attach-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.attach-preview-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; background: #f1f5f9;
  border-radius: 6px; font-size: 13px; color: #475569;
  max-width: 240px;
}
.attach-preview-img { width: 30px; height: 30px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.attach-preview-icon {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: white; border: 1px solid #e2e8f0; border-radius: 4px;
  font-size: 10px; font-weight: 600; color: #475569; flex-shrink: 0;
}
.attach-preview-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-preview-remove { cursor: pointer; color: #94a3b8; font-weight: 600; padding: 0 4px; flex-shrink: 0; font-size: 16px; line-height: 1; }
.attach-preview-remove:hover { color: #b91c1c; }

/* 완료 상태 행은 흐리게 */
.ticket-table tbody tr.done { opacity: 0.5; }
.ticket-table tbody tr.done:hover { opacity: 0.85; }

/* 헤더 + 본문 가운데 정렬, 문의제목 컬럼(5번째)만 좌측 */
.ticket-table th { text-align: center; }
.ticket-table td { text-align: center; }
.ticket-table td:nth-child(5) { text-align: left; }

/* 세로 구분선 */
.ticket-table th:not(:last-child),
.ticket-table td:not(:last-child) {
  border-right: 1px solid #f1f5f9;
}

/* 미세 조정 */
.ticket-table td:nth-child(5) { text-align: center; }
.ticket-table th:not(:last-child),
.ticket-table td:not(:last-child) {
  border-right: 1px solid #cbd5e1;
}
.cat-tab { min-width: 90px; text-align: center; }

/* 카테고리 탭 폭 강제 고정 */
.category-tabs .cat-tab {
  flex: 0 0 90px;
  min-width: 0;
  text-align: center;
}

/* 리스트 컬럼 폭 고정 */
.ticket-table { table-layout: fixed; }
.ticket-table th:nth-child(1) { width: 90px; }   /* 티켓번호 */
.ticket-table th:nth-child(2) { width: 130px; }  /* 문의분류 */
.ticket-table th:nth-child(3) { width: 130px; }  /* 상태 */
.ticket-table th:nth-child(4) { width: 240px; }  /* 업체명/게임사명 */
.ticket-table th:nth-child(6) { width: 130px; }  /* 담당자 */
.ticket-table th:nth-child(7) { width: 170px; }  /* 최초등록일 */
/* 5번째 (문의제목)는 명시 안 함 → 남은 공간 자동 차지 */

/* 모달 내 분류 버튼 */
.category-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.cat-btn {
  padding: 8px 16px;
  background: white;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.cat-btn:hover { background: #f8fafc; }

/* 게임사 직접입력 input - 비활성화 시 회색 */
#m_game_company:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

/* 직접입력 input 강제 늘림 (.input의 width:100% 덮어쓰기) */
#m_game_company {
  flex: 1 1 0% !important;
  width: auto !important;
  min-width: 0 !important;
}
