@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css");

:root {
  --bg: #f8f9fa;
  /* 아주 연한 웜그레이 */
  --surface: #ffffff;
  --surface-soft: #fbfcfd;
  --line: #e2e8f0;
  /* 연하고 부드러운 테두리 */
  --text: #334155;
  /* 모던 슬레이트 텍스트 */
  --muted: #64748b;
  --primary: #1e293b;
  /* 모던 네이비 (메인 포인트) */
  --primary-2: #334155;
  /* 네이비 변형톤 */
  --accent: #d97a10;
  --danger: #ef4444;
  --success: #10b981;
  --warn: #f59e0b;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
  /* 부드러운 그림자 */
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 16px 28px;
  /* 위아래 여백을 조금 더 넓히기 */
  background: #0f172a;
  /* 깊이 있는 다크 모던 네이비 */
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  /* 경계선 부드럽게 */
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
  /* 더 부드럽고 얕은 그림자 */
}

.brand-wrap {
  display: grid;
  gap: 2px;
}

.brand {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-sub {
  font-size: 12px;
  color: #bdd7f4;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.menu {
  display: flex;
  align-items: center;
  align-content: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.menu .inline-form {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.menu a,
.menu .nav-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  min-width: 80px;
  padding: 0 16px;
  /* 패딩 확장 */
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  /* 부드러운 화이트 대비 테두리 */
  background: rgba(255, 255, 255, 0.05);
  /* 투명한 배경 */
  color: #f1f5f9;
  text-decoration: none;
  font-family: "Pretendard", sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.menu a:hover,
.menu .nav-logout-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  transform: translateY(-1px);
}

.menu .nav-logout-btn {
  min-height: 38px;
  padding: 0 16px;
  background: #334155;
  /* 모던 네이비 변형 톤 다크 그레이 */
  border-color: transparent;
  color: #f8f9fa;
}

.menu .nav-logout-btn:hover {
  background: #475569;
}

/* nav dropdown (대시보드 submenu) */
.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-dropdown-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;          /* gap 없이 바로 붙임 */
  left: 0;
  padding-top: 6px;   /* 버튼과 카드 사이 시각적 여백 (히트 영역은 연결) */
  background: transparent;
  min-width: 160px;
  z-index: 200;
}

.nav-dropdown-menu-inner {
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
}

.nav-dropdown.open .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-menu a {
  display: block;
  padding: 10px 16px;
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  background: transparent;
  letter-spacing: normal;
  text-transform: none;
  min-height: unset;
}

.nav-dropdown-menu a:first-child { border-radius: 6px 6px 0 0; }
.nav-dropdown-menu a:last-child  { border-radius: 0 0 6px 6px; }
.nav-dropdown-menu a:only-child  { border-radius: 6px; }

.nav-dropdown-menu a:hover {
  background: rgba(255,255,255,0.1);
  color: #ffffff;
}

.container {
  max-width: 1440px;
  /* B2B SaaS에 어울리게 넓게 */
  margin: 33px auto;
  /* 마진 증가 */
  padding: 0 30px 50px;
  /* 패딩 1.5배 증가 */
}

h1 {
  margin: 0 0 24px;
  font-size: 34px;
  font-weight: 800;
  /* 조금 더 묵직한 제목 두께 처리 */
  color: #0f172a;
  letter-spacing: -0.8px;
}

/* ── 공통 page-header (이미지2 기준) ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.page-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
  line-height: 1.3;
}

.page-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.page-header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
  padding-top: 2px;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.page-header-actions .btn,
.page-header-actions a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  min-height: 36px;
  height: 36px;
  padding: 0 16px;
  font-family: "Pretendard", sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  box-sizing: border-box;
  white-space: nowrap;
}

/* 브레드크럼 경로 (카테고리 > 서브카테고리) */
.page-header-breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.4;
  letter-spacing: 0;
}

.page-header-breadcrumb .ph-sep {
  color: #94a3b8;
  font-size: 11px;
  margin: 0 2px;
}

h2 {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.5px;
}

.card {
  margin-bottom: 24px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  /* 보일락 말락한 테두리 */
  border-radius: 20px;
  /* 모서리 더 둥글게 */
  background: var(--surface);
  box-shadow: var(--shadow);
  /* 부드러운 퍼지는 그림자 */
  padding: 27px;
  /* 1.5배 넓힘 */
}

.narrow {
  max-width: 460px;
}

.inline-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}

.inline-row>input,
.inline-row>select,
.inline-row>textarea {
  flex: 1 1 220px;
  min-width: 0;
}

.inline-row>button,
.inline-row>.btn {
  flex: 0 0 auto;
}

.form-grid {
  display: grid;
  gap: 10px;
}

input,
select,
textarea,
button {
  font-family: "Pretendard", sans-serif;
  /* 폰트 일관성 */
  font: inherit;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  min-height: 48px;
  /* 입력 폼 높이 키움 */
  border: 1px solid #cbd5e1;
  /* 연하고 모던한 테두리 배경보다 살짝 짙음 */
  border-radius: 10px;
  /* 약간 플랫하게 둥근 모서리 */
  background: #f1f5f9;
  /* 배경 플랫 그레이로 */
  color: var(--text);
  padding: 14px 18px;
  /* 패딩 넓히기 (1.5배) */
  outline: none;
  font-size: 15px;
  /* 입력 텍스트 키움 */
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  background: #ffffff;
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(30, 41, 59, 0.1);
  /* 포커스 네이비 링 효과 */
}

.btn {
  min-height: 48px;
  /* 높이 키움 */
  border: none;
  border-radius: 10px;
  /* 플랫 모서리 통일 */
  background: var(--primary);
  /* 그라데이션 대신 솔리드 모던 네이비 적용 */
  color: #fff;
  font-weight: 600;
  /* 깔끔한 굵기 */
  letter-spacing: 0.1px;
  padding: 12px 20px;
  /* 여백 1.5배 증가 */
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease, filter 0.16s ease;
}

.btn:hover {
  background: #334155;
  /* 모던 호버 톤 */
  transform: translateY(-1px);
}

.btn.small {
  min-height: 38px;
  padding: 8px 16px;
  font-size: 14px;
}

.btn.success {
  background: var(--success);
}

.btn.success:hover {
  background: #059669;
  /* 초록색 호버 톤 */
}

.btn.danger {
  background: var(--danger);
}

.btn.danger:hover {
  background: #dc2626;
  /* 빨강색 호버 톤 */
}

.btn.secondary {
  background: #64748b;
  /* 슬레이트 이차 컬러 */
}

.btn.secondary:hover {
  background: #475569;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.form-actions .btn {
  flex: 1 1 220px;
}

.settings-tabs {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 2px solid #e2e8f0;
  overflow-x: auto;
  padding-bottom: 0;
}

.settings-tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 46px;
  /* 높이 키움 */
  padding: 0 24px;
  /* 여백 증가 */
  border-radius: 10px 10px 0 0;
  /* 위쪽 둥글게 */
  border: none;
  /* 하드보더 제거 */
  background: transparent;
  color: #64748b;
  /* 다소 연한 탭 이름 */
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  position: relative;
  top: 2px;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-bottom 0.15s ease;
}

.settings-tab-btn:hover {
  background: #f8fafc;
  color: #1e293b;
}

.settings-tab-btn.active {
  background: #ffffff;
  color: #1e293b;
  border-bottom: 2px solid var(--primary);
  /* 하단 바 포커싱 */
}

.inline-form {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.filter-card {
  padding: 27px 30px;
  /* 필터 패딩 증가 */
}

.dashboard-metrics {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 24px;
  margin: 32px 0 30px;
  /* 대시보드 마진 크게 */
}

.grid-6.dashboard-metrics {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.dashboard-filter {
  margin: 0 0 32px;
  padding: 27px 30px;
}

.dashboard-metrics .metric {
  min-height: 128px;
  padding: 24px 28px;
}

.dashboard-metrics .metric-button {
  position: relative;
  overflow: hidden;
  width: 100%;
  border: 1px solid #d4dce8;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f7fb 100%);
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.dashboard-metrics .metric-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.06), rgba(15, 23, 42, 0));
  opacity: 0;
  transition: opacity 0.18s ease;
}

.dashboard-metrics .metric-button:hover {
  transform: translateY(-4px);
  border-color: #9fb4d8;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.1);
}

.dashboard-metrics .metric-button:hover::after {
  opacity: 1;
}

.dashboard-metrics .metric-button:active {
  transform: translateY(-1px) scale(0.995);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

.dashboard-metrics .metric-button.active {
  border-color: #1d4ed8;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 60%, #c7ddff 100%);
  box-shadow: 0 20px 38px rgba(29, 78, 216, 0.22);
}

.dashboard-metrics .metric-button.active::after {
  opacity: 1;
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.16), rgba(59, 130, 246, 0.04));
}

.dashboard-metrics .metric span {
  margin-bottom: 10px;
}

.dashboard-metrics .metric-button span,
.dashboard-metrics .metric-button strong {
  position: relative;
  z-index: 1;
}

.dashboard-metrics .metric-button.active span {
  color: #1e3a8a;
}

.dashboard-metrics .metric-button.active strong {
  color: #0f3ea8;
}

.dashboard-table-card {
  margin-top: 16px;
}

.table-meta {
  color: #475569;
  font-size: 14px;
  font-weight: 600;
}

.page-size-form {
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.page-size-form label {
  color: #475569;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 9px 12px;
  border: 1px solid #d6dbe5;
  border-radius: 12px;
  background: #fff;
  color: #334155;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.pagination-link:hover {
  border-color: #94a3b8;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.pagination-link.active {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #fff;
  box-shadow: 0 10px 22px rgba(29, 78, 216, 0.24);
}

.pagination-link.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0;
  min-width: 0;
}

.toolbar-form select {
  min-width: 120px;
  flex: 0 0 auto;
}

.toolbar-form input[type="text"] {
  width: 320px;
  max-width: 100%;
  min-width: 0;
  flex: 1 1 320px;
}

.toolbar-right-form {
  margin-left: auto;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.table-actions-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.table-actions-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
}

.table-actions-cluster {
  flex-wrap: wrap;
}

.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.check-col {
  width: 56px;
  text-align: center;
}

.row-check,
#select-all-shipments {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #1f7ad0;
  cursor: pointer;
}

table {
  width: 100%;
  border-collapse: collapse;
  /* 분리되었던 보더 제거 -> 병합 */
  border-spacing: 0;
  font-size: 15px;
  /* 데이터 테이블 시원한 크기 */
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  /* 바깥 메인 테두리 살림 */
}

th,
td {
  border-bottom: 1px solid var(--line);
  /* 행 구분선 플랫하게 */
  padding: 18px 16px;
  /* 1.5배 증가한 표 안 여백 넓히기 */
  text-align: left;
  vertical-align: middle;
  /* 세로 가운데 맞춤 */
}

th {
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: #f8fafc;
  /* 마우스 호버 시 살짝 구분 */
}

tbody tr:last-child td {
  border-bottom: none;
}

.small-text {
  color: var(--muted);
  font-size: 12px;
  max-width: 400px;
  word-break: break-all;
}

.flash {
  margin-bottom: 14px;
  border: 1px solid #bad2ea;
  border-radius: 12px;
  background: #e9f4ff;
  color: #17426b;
  padding: 10px 12px;
  white-space: pre-line;
}

.error {
  color: var(--danger);
}

.warn {
  color: #7f5700;
}

.hint {
  color: var(--muted);
  font-size: 13px;
}

.grid-6,
.grid-5,
.grid-4 {
  display: grid;
  gap: 10px;
}

.grid-6 {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.grid-5 {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.grid-5.dashboard-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric {
  border: 1px solid rgba(0, 0, 0, 0.03);
  /* 거의 없는 테두리 */
  border-radius: 20px;
  /* 더 둥글게 */
  padding: 24px;
  background: #ffffff;
  /* 하얀 바탕 */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  /* 부드럽게 강조 */
}

.metric span {
  display: block;
  color: #64748b;
  /* var(--muted) - 명확한 회색 */
  font-size: 14px;
  /* 메트릭 라벨 살짝 확대 */
  font-weight: 600;
}

.metric strong {
  font-size: 34px;
  font-weight: 800;
  color: #0f172a;
  /* 묵직한 네이비 텍스트 */
}

.badge {
  text-transform: lowercase;
  display: inline-block;
  padding: 6px 12px;
  /* 상하좌우 통일 넓게 */
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.badge.pending {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

.badge.packing {
  background: #fff7ed;
  border-color: #fdba74;
  color: #c2410c;
}

.badge.packed {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.badge.sent {
  background: #ecfdf5;
  border-color: #86efac;
  color: #15803d;
}

.badge.failed {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 12px 14px;
  font-weight: 600;
}

.status-timer {
  flex: 0 0 auto;
  min-width: 58px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.status.neutral {
  background: #eef1f9;
  border-color: #d8ddf0;
  color: #2d3b57;
}

.status.success {
  background: #e6f8ea;
  border-color: #b8e3c3;
  color: #1e5d33;
}

.status.error {
  background: #ffe9e9;
  border-color: #f1b9b9;
  color: #8a1414;
}

.status.warn {
  background: #fff4de;
  border-color: #f0d39a;
  color: #785400;
}

.row-ok {
  background: #f3fcf5 !important;
}

.pack-hero {
  margin: 6px 0 20px;
}

.pack-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  /* 서브텍스트 키움 */
}

.pack-grid {
  display: grid;
  grid-template-columns: minmax(360px, 480px) 1fr;
  /* 좌측 패널 넓히기 */
  gap: 24px;
  align-items: start;
}

.pack-panel {
  margin-bottom: 0;
}

.scan-panel {
  position: sticky;
  top: 96px;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
  /* 패널 스티키할때 그림자 강조 */
  padding: 27px;
  /* 1.5배 넓힘 */
  border: 1px solid var(--line);
}

.scan-step {
  margin-bottom: 20px;
}

.scan-step label {
  display: block;
  margin-bottom: 10px;
  font-weight: 700;
  color: #1e293b;
  font-size: 15px;
  /* 라벨 살짝 짙고 크게 */
}

.scan-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
}

.scan-input-row>* {
  min-width: 0;
}

.scan-input-row input {
  width: 100%;
  min-height: 60px;
  /* 입력폼 바코드 크게 */
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.scan-input-row .btn {
  width: auto;
  min-width: 136px;
  min-height: 60px;
  font-size: 17px;
  padding: 0 16px;
  white-space: nowrap;
  word-break: keep-all;
}

.progress-wrap {
  margin: 20px 0 16px;
  border: 1px solid var(--line);
  /* 연한 모던 라인으로 교체 */
  border-radius: 16px;
  padding: 18px;
  background: #f8f9fa;
  /* 연회색 넓은 배경 */
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-meta span {
  color: var(--muted);
  font-size: 13px;
}

.progress-meta strong {
  font-size: 22px;
  font-weight: 800;
}

.progress-track {
  height: 12px;
  border-radius: 999px;
  background: #dde7db;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #d97a10 0%, #efb13f 100%);
  transition: width 0.25s ease;
}

.pack-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.summary-chip {
  border: 1px solid var(--line);
  /* 모던 라인 */
  border-radius: 16px;
  background: #f8fafc;
  /* 시원하고 흰 연한파란 회색 */
  padding: 14px 16px;
  /* 패딩 확장 */
  min-height: 84px;
}

.summary-chip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.summary-chip strong {
  display: block;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.2px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-all;
  line-height: 1.15;
  color: #0f172a;
  /* 강조된 네이비 */
}

#items-table td:nth-child(3),
#items-table td:nth-child(4) {
  font-size: 17px;
  font-weight: 700;
}

.erp-preview-box {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #f8fafc;
  /* 플랫하고 모던한 카드형 배경 */
  padding: 24px;
}

.erp-preview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
}

.erp-preview-head h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #0f172a;
}

.erp-preview-head span {
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
}

.erp-top-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(300px, 1fr));
  gap: 16px 24px;
  margin-bottom: 20px;
}

.erp-top-field {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.erp-top-field label {
  margin: 0;
  font-weight: 700;
  color: #334155;
  letter-spacing: -0.1px;
  font-size: 15px;
}

.erp-top-field input,
.erp-top-field select {
  min-height: 50px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  /* ERP 폼 필드는 하얗게 구분 */
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 500;
  color: #1e293b;
}

#erp-io-date {
  font-family: "Pretendard", sans-serif;
  letter-spacing: 0.3px;
}

.erp-line-card {
  border: 1px solid #cbd5e1;
  /* 연하고 모던한 테두리로 교체 */
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.erp-line-table {
  width: 100%;
  margin: 0;
  border: none;
  border-radius: 0;
  border-collapse: collapse;
}

.erp-line-table thead th {
  background: #f1f5f9;
  /* 구분되는 회색 헤더 */
  border-bottom: 1px solid var(--line);
  text-transform: none;
  font-size: 14px;
  color: #475569;
  /* 부드러운 글자 */
  letter-spacing: 0.1px;
}

.erp-line-table tbody td {
  border-bottom: 1px solid var(--line);
  /* 로우 간 밑줄 추가 */
  font-size: 15px;
  color: #1e293b;
  padding: 18px 16px;
}

.erp-line-table tbody td:nth-child(3) {
  font-weight: 600;
  font-size: 15px;
}

.complete-btn {
  width: 100%;
  min-height: 64px;
  /* 버튼을 좀 더 무게감 있게 */
  margin-top: 20px;
  font-size: 20px;
  border-radius: 16px;
}

.bom-action-box {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fafc;
  padding: 18px;
}

.bom-action-head {
  margin-bottom: 12px;
}

.bom-action-head h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
}

.bom-action-list {
  display: grid;
  gap: 10px;
  min-height: 48px;
}

.bom-action-empty {
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
}

.bom-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
}

.bom-action-row input {
  width: 100%;
  min-height: 60px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: #f1f5f9;
}

.bom-action-row .btn {
  width: auto;
  min-width: 136px;
  min-height: 60px;
  font-size: 17px;
  padding: 0 16px;
  white-space: nowrap;
  word-break: keep-all;
}

.bom-preview-box {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #f8fafc;
  padding: 24px;
}

.bom-preview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
}

.bom-preview-head h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #0f172a;
}

.bom-preview-head span {
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
  text-align: right;
}

.bom-line-card {
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  max-height: 360px;
  overflow-y: auto;
}

.bom-line-table {
  width: 100%;
  margin: 0;
  border: none;
  border-radius: 0;
  border-collapse: collapse;
}

.bom-line-table thead th {
  background: #f1f5f9;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: #475569;
  letter-spacing: 0.1px;
}

.bom-line-table tbody td {
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  color: #1e293b;
  padding: 16px;
}

.permission-editor,
.user-config-box {
  display: grid;
  gap: 10px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.permission-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.permission-check input {
  flex: 0 0 auto;
}

.permission-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.permission-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #1e293b;
  font-size: 13px;
  font-weight: 600;
}

.permission-pill.admin {
  background: #dbeafe;
  color: #1d4ed8;
}

.user-table {
  width: 100%;
}


.account-table {
  table-layout: auto;
}

.account-table th,
.account-table td {
  overflow-wrap: anywhere;
}

.worker-account-table col.col-id,
.external-account-table col.col-id {
  width: 72px;
}

.worker-account-table col.col-username {
  width: 210px;
}

.worker-account-table col.col-display-name {
  width: 180px;
}

.worker-account-table col.col-role {
  width: 120px;
}

.external-account-table col.col-purpose {
  width: 150px;
}

.external-account-table col.col-company {
  width: 140px;
}

.external-account-table col.col-default {
  width: 110px;
}

.account-table .status-col,
.account-table .status-cell {
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
}

.account-table .action-col,
.account-table .action-cell {
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
}

.user-action-row {
  flex-wrap: nowrap;
  justify-content: center;
  white-space: nowrap;
  gap: 8px;
}

.user-action-row .inline-form {
  flex: 0 0 auto;
}

.user-action-row .btn {
  white-space: nowrap;
}

.user-settings-toggle[aria-expanded="true"] {
  background: #475569;
}

.user-config-row td {
  background: #f8fafc;
  padding-top: 20px;
  padding-bottom: 20px;
}

.user-config-row[hidden] {
  display: none;
}

.user-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.worker-account-shell {
  padding: 26px 28px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #dfe8f5;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.worker-account-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.worker-account-copy {
  display: grid;
  justify-items: start;
  gap: 0;
  min-width: 0;
  flex: 1 1 auto;
}

.worker-account-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: #edf4ff;
  color: #0f172a;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.worker-account-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #0f172a;
  text-shadow: none;
}

.worker-account-description {
  margin: 0;
  max-width: 620px;
  color: #64748b;
  font-size: 15px;
  line-height: 1.5;
  text-shadow: none;
}

.worker-account-add-trigger {
  min-width: 140px;
  min-height: 48px;
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
  align-self: center;
}

.worker-account-shell .worker-account-kicker {
  min-height: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #0f172a;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: none;
}

.worker-account-list-card {
  padding: 24px 28px 24px;
  border: 1px solid #e1eaf5;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}

.worker-account-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.worker-account-list-copy {
  display: grid;
  justify-items: start;
  gap: 0;
  min-width: 0;
  flex: 1 1 auto;
}

.worker-account-list-title {
  margin: 0;
  font-size: 23px;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-shadow: none;
}

.worker-account-list-description {
  margin: 0;
  max-width: 640px;
  color: #64748b;
  line-height: 1.45;
  text-shadow: none;
}

.worker-account-count {
  display: inline-flex;
  align-items: center;
  align-self: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.worker-account-table-wrap {
  overflow: hidden;
  border: 1px solid #dbe5f1;
  border-radius: 22px;
  background: #fff;
}

.accounting-credit-table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
}

.accounting-credit-table-wrap .account-table {
  min-width: 1720px;
}

.worker-account-table .action-cell .btn {
  min-width: 78px;
}

.account-state-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: #e2e8f0;
  color: #475569;
}

.account-state-chip.is-active {
  background: #dcfce7;
  color: #15803d;
}

.account-state-chip.is-inactive {
  background: #fee2e2;
  color: #b91c1c;
}

.worker-account-drawer-open {
  overflow: hidden;
}

.worker-account-drawer {
  position: fixed;
  inset: 0;
  z-index: 1100;
}

.worker-account-drawer[hidden] {
  display: none;
}

.worker-account-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(3px);
}

.worker-account-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  height: 100%;
  background: #ffffff;
  box-shadow: -24px 0 48px rgba(15, 23, 42, 0.16);
  transform: translateX(100%);
  transition: transform 180ms ease;
}

.worker-account-drawer.open .worker-account-drawer-panel {
  transform: translateX(0);
}

.worker-account-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 28px 22px;
  border-bottom: 1px solid #e2e8f0;
}

.worker-account-drawer-kicker {
  margin: 0 0 6px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.worker-account-drawer-header h3 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: -0.04em;
  color: #0f172a;
}

.worker-account-drawer-header p {
  margin: 0;
  color: #64748b;
}

.worker-account-drawer-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: #f1f5f9;
  color: #475569;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.worker-account-drawer-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 24px 28px 32px;
}

.worker-account-drawer-body [hidden] {
  display: none !important;
}

.worker-account-drawer-stack {
  display: grid;
  gap: 18px;
}

.worker-account-drawer[data-mode="create"] #worker-edit-shell {
  display: none !important;
}

.worker-account-drawer[data-mode="edit"] #worker-create-form {
  display: none !important;
}

.worker-account-drawer-section {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.worker-account-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.worker-account-section-head h4 {
  margin: 0 0 4px;
  font-size: 18px;
  color: #0f172a;
}

.worker-account-section-head p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
}

.worker-account-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.worker-account-field {
  display: grid;
  gap: 8px;
}

.worker-account-field span {
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}

.worker-account-field-full {
  grid-column: 1 / -1;
}

.worker-account-drawer-form {
  display: grid;
  gap: 14px;
}

.worker-account-drawer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.worker-account-inline-note {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 16px;
  border: 1px dashed #c7d4e7;
  border-radius: 14px;
  background: #f8fbff;
  color: #475569;
  font-size: 14px;
  line-height: 1.5;
}

.worker-permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.worker-permission-card {
  position: relative;
  display: block;
  cursor: pointer;
}

.worker-permission-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.worker-permission-card-box {
  display: flex;
  align-items: center;
  min-height: 64px;
  padding: 0 16px;
  border: 1px solid #d7e1ee;
  border-radius: 18px;
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease, color 120ms ease;
}

.worker-permission-card.is-selected .worker-permission-card-box {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: 0 0 0 1px #3b82f6 inset;
}

.worker-permission-card.is-disabled {
  cursor: default;
}

.permission-management-meta {
  display: flex;
  justify-content: flex-end;
}

.permission-category-list {
  display: grid;
  gap: 14px;
}

.permission-category-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid #dbe5f1;
  border-radius: 18px;
  background: #ffffff;
}

.permission-category-head h5 {
  margin: 0 0 4px;
  font-size: 16px;
  color: #0f172a;
}

.permission-category-head p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

.permission-management-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.permission-category-placeholder {
  min-height: 52px;
  padding: 14px 16px;
  border: 1px dashed #d6deea;
  border-radius: 14px;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.worker-permission-card.is-disabled .worker-permission-card-box {
  opacity: 0.7;
}

.permission-modal {
  position: fixed;
  inset: 0;
  z-index: 1150;
}

.permission-modal[hidden] {
  display: none !important;
}

.permission-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(6px);
}

.permission-modal-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1180px, calc(100vw - 48px));
  max-height: calc(100vh - 40px);
  margin: 20px auto;
  border: 1px solid rgba(210, 221, 236, 0.9);
  border-radius: 28px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.22);
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  transition: opacity 180ms ease, transform 180ms ease;
}

.permission-modal.open .permission-modal-dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.permission-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 32px 20px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.permission-modal-header-copy {
  display: grid;
  gap: 8px;
}

.permission-modal-kicker {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.permission-modal-header h3 {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
  color: #0f172a;
}

.permission-modal-description {
  margin: 0;
  max-width: 760px;
  color: #64748b;
  font-size: 15px;
  line-height: 1.65;
}

.permission-modal-close {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 16px;
  background: #f1f5f9;
  color: #475569;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.permission-modal-form {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
}

.permission-modal-body {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 0;
  flex: 1 1 auto;
}

.permission-modal-aside {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 24px;
  border-right: 1px solid #e2e8f0;
  background: #f8fbff;
  overflow-y: auto;
}

.permission-modal-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 24px 28px;
  overflow-y: auto;
}

.permission-modal-aside-card,
.permission-section-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid #dbe5f1;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.05);
}

.permission-modal-card-head,
.permission-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.permission-modal-card-head h4,
.permission-modal-toolbar-copy h4 {
  margin: 0;
  font-size: 17px;
  color: #0f172a;
}

.permission-modal-account-grid {
  display: grid;
  gap: 12px;
}

.permission-modal-account-item {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #f8fafc;
}

.permission-modal-account-item span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.permission-modal-account-item strong {
  color: #0f172a;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.4;
  word-break: break-word;
}

.permission-modal-guide-text {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.65;
}

.permission-modal-guide-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.permission-modal-nav {
  display: grid;
  gap: 10px;
}

.permission-modal-nav-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #d7e1ee;
  border-radius: 16px;
  background: #ffffff;
  color: #334155;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.permission-modal-nav-btn:hover {
  border-color: #bfd2ea;
  background: #f8fbff;
}

.permission-modal-nav-btn strong {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.permission-modal-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 4px 2px 18px;
}

.permission-modal-toolbar-copy {
  display: grid;
  gap: 6px;
}

.permission-modal-toolbar-copy p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.6;
}

.permission-modal-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.permission-section-list {
  display: grid;
  gap: 16px;
}

.permission-section-head-main {
  flex: 1 1 auto;
  min-width: 0;
}

.permission-section-head-meta {
  flex: 0 0 auto;
}

.permission-section-count {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
}

.permission-section-count.is-muted {
  background: #f1f5f9;
  color: #64748b;
}

.permission-section-body {
  display: grid;
  gap: 14px;
}

.permission-tree-list {
  display: grid;
  gap: 12px;
}

.permission-tree-node {
  display: grid;
  gap: 12px;
}

.permission-tree-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.permission-tree-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.permission-tree-row-depth-2,
.permission-tree-row-depth-3,
.permission-tree-row-depth-4 {
  padding-left: 6px;
}

.permission-tree-toggle,
.permission-tree-toggle-spacer {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin-top: 4px;
}

.permission-tree-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: #eef2f7;
  color: #64748b;
  cursor: pointer;
}

.permission-tree-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 120ms ease;
}

.permission-tree-node.is-collapsed > .permission-tree-row .permission-tree-toggle svg {
  transform: rotate(-90deg);
}

.permission-tree-control,
.permission-tree-static {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid #dbe5f1;
  border-radius: 18px;
  background: #f8fafc;
}

.permission-tree-control.is-root,
.permission-tree-static.is-root {
  padding: 16px 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.permission-tree-control.is-root .permission-tree-title,
.permission-tree-static.is-root .permission-tree-title {
  font-size: 17px;
}

.permission-tree-control {
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.permission-tree-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.permission-tree-checkmark,
.permission-tree-static-mark {
  position: relative;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border-radius: 6px;
}

.permission-tree-checkmark {
  border: 1.5px solid #94a3b8;
  background: #ffffff;
}

.permission-tree-control.is-selected {
  border-color: #93c5fd;
  background: #eff6ff;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.18) inset;
}

.permission-tree-control.is-selected .permission-tree-checkmark {
  border-color: #2563eb;
  background: #2563eb;
}

.permission-tree-control.is-selected .permission-tree-checkmark::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 11px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.permission-tree-control.is-indeterminate .permission-tree-checkmark {
  border-color: #2563eb;
  background: #dbeafe;
}

.permission-tree-control.is-indeterminate .permission-tree-checkmark::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 8px;
  width: 10px;
  height: 2px;
  border-radius: 999px;
  background: #2563eb;
}

.permission-tree-control.is-disabled,
.permission-tree-control.is-disabled .permission-tree-copy {
  cursor: default;
  opacity: 0.72;
}

.permission-tree-static-mark {
  background: #e2e8f0;
}

.permission-tree-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.permission-tree-title {
  color: #0f172a;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
  word-break: keep-all;
}

.permission-tree-note {
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
}

.permission-tree-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

.permission-tree-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.permission-tree-chip.is-shared {
  background: #fff7ed;
  color: #c2410c;
}

.permission-tree-chip.is-placeholder {
  background: #f1f5f9;
  color: #64748b;
}

.permission-tree-children {
  margin-left: 18px;
  padding-left: 18px;
  border-left: 1px solid #e2e8f0;
}

.permission-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 28px 24px;
  border-top: 1px solid #e2e8f0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, #ffffff 100%);
}

.permission-modal-footer-note {
  margin: 0;
  color: #b45309;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}

.permission-modal-footer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
}

.worker-account-danger-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid #fecaca;
  border-radius: 18px;
  background: #fff7f7;
}

.worker-account-danger-box p {
  margin: 0;
  flex: 1 1 auto;
  color: #7f1d1d;
  font-size: 14px;
  line-height: 1.5;
}

.worker-account-danger-box .btn {
  flex: 0 0 auto;
  min-width: 120px;
  padding-left: 22px;
  padding-right: 22px;
  white-space: nowrap;
  word-break: keep-all;
  align-self: center;
}

.integration-shell,
.integration-settings-card {
  padding: 26px 28px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #dfe8f5;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.integration-list-card {
  padding: 24px 28px 24px;
  border: 1px solid #e1eaf5;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}

.integration-hero,
.integration-settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.integration-settings-form {
  display: grid;
  gap: 18px;
}

.integration-settings-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.integration-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.integration-description,
.integration-list-description {
  margin: 0;
  max-width: 720px;
  color: #64748b;
  font-size: 15px;
  line-height: 1.6;
}

.integration-form-section {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.integration-auto-section {
  background: linear-gradient(180deg, #f8fbff 0%, #f1f7ff 100%);
}

.integration-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.integration-field {
  display: grid;
  gap: 8px;
}

.integration-field span {
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}

.integration-field-full {
  grid-column: 1 / -1;
}

.integration-readonly-field {
  background: #f8fbff;
  color: #475569;
  border-color: #d9e5f4;
}

.integration-action-row,
.integration-drawer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.integration-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.integration-chip.is-default {
  background: #eef2ff;
  color: #4338ca;
}

.integration-chip.muted {
  background: #f1f5f9;
  color: #64748b;
}

.integration-chip.is-error {
  background: #fee2e2;
  color: #b91c1c;
}

.integration-chip.is-danger {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

.integration-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid #d7e1ee;
  border-radius: 16px;
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
}

.integration-inline-check input {
  width: 18px;
  height: 18px;
}

.integration-drawer-meta {
  display: flex;
  justify-content: flex-start;
}

.bank-drawer-meta {
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bank-account-table col.col-name {
  width: 22%;
}

.bank-account-table col.col-company {
  width: 18%;
}

.bank-account-table col.col-user {
  width: 18%;
}

.bank-account-table col.col-default {
  width: 18%;
}

.bank-account-table col.col-security {
  width: 14%;
}

.integration-drawer-actions .inline-form {
  display: inline-flex;
}

.integration-drawer-actions .btn {
  min-width: 120px;
}

.integration-list-card .worker-account-list-head {
  margin-bottom: 18px;
}

.bank-search-type-card {
  display: grid;
  gap: 12px;
  margin-top: 4px;
  padding: 16px;
  border: 1px solid #d7e1ee;
  border-radius: 18px;
  background: #f8fafc;
}

.bank-search-type-title {
  margin: 0;
  color: #0f172a;
  font-size: 14px;
  font-weight: 800;
}

.bank-search-type-option {
  position: relative;
  display: block;
  cursor: pointer;
}

.bank-search-type-option > input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.bank-search-type-box {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #d7e1ee;
  border-radius: 14px;
  background: #ffffff;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.bank-search-type-option.is-selected .bank-search-type-box {
  border-color: #93c5fd;
  background: #eff6ff;
  box-shadow: 0 0 0 1px #3b82f6 inset;
}

.bank-search-type-choice {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  width: 100%;
}

.bank-search-type-choice span {
  color: #334155;
  font-size: 14px;
  font-weight: 700;
}

.bank-search-type-dot {
  width: 18px;
  height: 18px;
  border: 2px solid #94a3b8;
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 0 0 4px #fff;
}

.bank-search-type-option.is-selected .bank-search-type-dot {
  border-color: #2563eb;
  background: #2563eb;
}

.bank-search-type-box input[type="text"] {
  display: block;
  width: 100% !important;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
}

.accounting-query-form {
  display: grid;
  gap: 18px;
}

.accounting-page-head {
  margin-bottom: 16px;
}

.accounting-view-switch {
  margin-top: 10px;
}

.accounting-query-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.accounting-query-modal[hidden] {
  display: none;
}

.accounting-query-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(3px);
}

.accounting-query-modal-panel {
  position: relative;
  width: min(1080px, 100%);
  max-height: min(88vh, 920px);
  overflow: auto;
  padding: 20px 22px 22px;
  border-radius: 22px;
  border: 1px solid #d7e1ee;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}

.accounting-query-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.accounting-query-modal-header h2 {
  margin: 0;
  font-size: 23px;
  font-weight: 900;
  color: #0f172a;
}

.accounting-query-modal-section {
  display: grid;
  gap: 8px;
}

.accounting-query-modal-section + .accounting-query-modal-section {
  margin-top: 0;
}

.accounting-modal-section-head h3 {
  margin: 0;
  color: #0f172a;
  font-size: 16px;
  font-weight: 800;
}

.accounting-account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.accounting-account-option {
  position: relative;
  display: flex;
  cursor: pointer;
}

.accounting-account-option > input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.accounting-account-box {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 56px;
  padding: 8px 14px;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.035);
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.accounting-account-option:hover .accounting-account-box {
  border-color: #cfd8e6;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  transform: translateY(-1px);
}

.accounting-account-option.is-selected .accounting-account-box {
  border-color: #90b4ee;
  background: linear-gradient(180deg, #f9fbff 0%, #f1f6ff 100%);
  box-shadow: 0 6px 14px rgba(59, 130, 246, 0.08), 0 0 0 1px rgba(59, 130, 246, 0.1) inset;
}

.accounting-account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.accounting-account-title {
  color: #0f172a;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  word-break: keep-all;
}

.accounting-period-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.accounting-period-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.accounting-search-card {
  margin-bottom: 16px;
}

.accounting-search-form {
  display: grid;
  grid-template-columns: minmax(150px, 180px) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.accounting-search-select,
.accounting-search-input {
  width: 100%;
  min-height: 40px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid #d7e1ee;
  border-radius: 12px;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
  box-sizing: border-box;
}

.accounting-search-select {
  padding-right: 38px;
}

.accounting-search-select:focus,
.accounting-search-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.accounting-search-select:disabled,
.accounting-search-input:disabled {
  background: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
}

.accounting-search-button {
  min-width: 74px;
  min-height: 40px;
  height: 40px;
  padding: 0 18px;
  white-space: nowrap;
}

.accounting-search-empty {
  margin-top: 12px;
}

.accounting-business-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  min-height: 36px;
  padding: 7px 12px 7px 10px;
  border: 1px solid var(--accounting-business-border);
  border-radius: 12px;
  background: var(--accounting-business-bg);
  color: var(--accounting-business-text);
  box-sizing: border-box;
}

.accounting-business-badge-bar {
  width: 4px;
  min-width: 4px;
  height: 18px;
  border-radius: 999px;
  background: var(--accounting-business-accent);
}

.accounting-business-badge-text {
  display: block;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.accounting-result-table th,
.accounting-result-table td {
  text-align: left;
  white-space: nowrap;
}

.accounting-result-table th {
  font-size: 13px;
}

.accounting-result-table td {
  vertical-align: middle;
}

.accounting-result-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 12px;
}

.accounting-result-head {
  align-items: center;
  margin-bottom: 12px;
}

.accounting-result-head h2 {
  margin-bottom: 0;
}

.accounting-result-actions-right {
  width: auto;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.accounting-result-actions-right .btn,
.accounting-result-actions-right a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  min-height: 40px;
  height: 40px;
  padding: 0 18px;
  font-family: "Pretendard", sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  box-sizing: border-box;
  white-space: nowrap;
}

.accounting-col-datetime {
  white-space: normal;
  min-width: 96px;
  line-height: 1.35;
}

.accounting-col-numeric {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
}

.accounting-note-cell {
  min-width: 210px;
}

.accounting-credit-category-cell {
  min-width: 230px;
}

.accounting-credit-category-stack {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.accounting-credit-category-preview {
  flex: 0 0 auto;
}

.accounting-credit-category-select {
  flex: 1 1 auto;
  min-width: 140px;
}

.accounting-note-input {
  width: 100%;
  min-height: 56px;
  resize: vertical;
  border: 1px solid #d7e1ee;
  border-radius: 12px;
  padding: 10px 12px;
  background: #ffffff;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.45;
  box-sizing: border-box;
}

.accounting-note-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.accounting-note-readonly {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #d7e1ee;
  border-radius: 12px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
  box-sizing: border-box;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 900px) {
  .accounting-search-form {
    grid-template-columns: 1fr;
  }

  .accounting-search-button {
    width: 100%;
  }
}

.accounting-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(2px);
}

.accounting-loading-overlay[hidden] {
  display: none;
}

.accounting-credit-status-wrap {
  display: flex;
  align-items: center;
}

.accounting-credit-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.accounting-credit-status.is-success {
  background: #e8f7ee;
  color: #177245;
}

.accounting-credit-status.is-error {
  background: #fdecec;
  color: #b42318;
}

.accounting-credit-status.is-idle {
  background: #eef2f6;
  color: #526070;
}

.accounting-credit-state-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.accounting-credit-state-badge.is-approved {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.accounting-credit-state-badge.is-posted {
  background: #ecfdf3;
  border-color: #b7ebc6;
  color: #027a48;
}

.accounting-credit-state-badge.is-cancelled {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #be123c;
}

.accounting-credit-state-badge.is-reversed {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

.accounting-credit-summary-head {
  margin-bottom: 16px;
}

.accounting-credit-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.accounting-credit-summary-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid #d9e0e7;
  border-radius: 14px;
  background: #f8fafc;
}

.accounting-credit-summary-item strong {
  font-size: 12px;
  color: #6b7280;
}

.accounting-credit-summary-item span {
  color: #0f172a;
  font-weight: 700;
  word-break: break-all;
}

.accounting-credit-path {
  font-size: 12px;
}

.accounting-credit-log {
  margin: 0;
  padding: 16px 18px;
  border-radius: 14px;
  background: #0f172a;
  color: #dbe7f3;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 420px;
  overflow: auto;
}

@media (max-width: 900px) {
  .accounting-credit-summary-grid {
    grid-template-columns: 1fr;
  }
}

.accounting-loading-card {
  width: min(520px, 100%);
  display: grid;
  gap: 12px;
  padding: 24px;
  border-radius: 20px;
  border: 1px solid #d7e1ee;
  background: #ffffff;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
}

.accounting-loading-card strong {
  color: #0f172a;
  font-size: 20px;
  font-weight: 900;
}

.accounting-loading-card p {
  margin: 0;
  color: #475569;
  font-size: 14px;
}

.accounting-loading-bar {
  position: relative;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.accounting-loading-bar span {
  position: absolute;
  top: 0;
  left: -36%;
  width: 36%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1d4ed8 0%, #60a5fa 100%);
  animation: accounting-loading-slide 1.2s ease-in-out infinite;
}

@keyframes accounting-loading-slide {
  0% {
    left: -36%;
  }
  100% {
    left: 100%;
  }
}

.integration-settings-card .worker-account-kicker {
  margin-bottom: 2px;
}

.integration-settings-card .worker-account-section-head,
.integration-shell .worker-account-section-head {
  align-items: flex-start;
}

.integration-settings-card .hint,
.integration-shell .hint {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

.worker-account-drawer[data-mode="create"] #external-edit-shell {
  display: none !important;
}

.worker-account-drawer[data-mode="edit"] #external-create-form {
  display: none !important;
}

@media (max-width: 1120px) {
  .pack-grid {
    grid-template-columns: 1fr;
  }

  .scan-panel {
    position: static;
  }

  .pack-summary {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .erp-top-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .erp-top-field {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .erp-top-field label {
    padding-left: 2px;
  }

  .accounting-query-modal {
    padding: 12px;
  }

  .accounting-query-modal-panel {
    padding: 14px 14px 16px;
    border-radius: 16px;
  }

  .accounting-query-modal-header h2 {
    font-size: 20px;
  }

  .accounting-account-grid {
    grid-template-columns: 1fr;
  }

  .accounting-period-grid {
    grid-template-columns: 1fr;
  }

  .user-action-row {
    flex-wrap: wrap;
    white-space: normal;
    justify-content: flex-start;
  }

  .worker-account-hero,
  .worker-account-list-head,
  .worker-account-section-head,
  .worker-account-danger-box,
  .integration-hero,
  .integration-settings-head,
  .integration-action-row,
  .integration-drawer-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .worker-account-field-grid,
  .worker-permission-grid,
  .integration-form-grid,
  .accounting-period-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 768px) {
  .topbar {
    padding: 10px 12px;
  }

  .brand {
    font-size: 22px;
  }

  .menu {
    gap: 6px;
  }

  .menu a,
  .menu .nav-logout-btn {
    min-height: 32px;
    font-size: 12px;
    padding: 0 9px;
  }

  .container {
    margin: 14px auto;
    padding: 0 10px 24px;
  }

  h1 {
    font-size: 30px;
  }

  .card {
    border-radius: 15px;
    padding: 14px;
  }

  .scan-input-row {
    grid-template-columns: 1fr;
  }

  .scan-input-row input,
  .scan-input-row .btn {
    width: 100%;
    min-height: 50px;
    font-size: 19px;
  }

  .toolbar-right-form {
    margin-left: 0;
  }

  .dashboard-metrics {
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 12px 0 16px;
  }

  .table-actions-right {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }

  .page-size-form {
    justify-content: flex-start;
  }

  .dashboard-filter {
    margin-bottom: 16px;
    padding: 12px;
  }

  .pack-summary {
    grid-template-columns: 1fr;
  }

  .permission-grid,
  .user-config-grid {
    grid-template-columns: 1fr;
  }

  .worker-account-shell,
  .worker-account-list-card,
  .integration-shell,
  .integration-list-card,
  .integration-settings-card {
    padding: 22px 18px;
  }

  .worker-account-drawer-panel {
    width: 100%;
  }

  .worker-account-drawer-header,
  .worker-account-drawer-body {
    padding-left: 18px;
    padding-right: 18px;
  }
}

@media (max-width: 960px) {
  .permission-modal-dialog {
    width: min(100vw - 24px, 100%);
    max-height: calc(100vh - 24px);
    margin: 12px auto;
    border-radius: 24px;
  }

  .permission-modal-body {
    grid-template-columns: 1fr;
  }

  .permission-modal-aside {
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
  }

  .permission-modal-main {
    padding: 20px;
  }

  .permission-modal-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .permission-modal-footer-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .permission-section-head,
  .permission-modal-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .permission-section-head-meta {
    align-self: flex-start;
  }
}

@media (max-width: 720px) {
  .permission-modal-header {
    padding: 22px 20px 18px;
  }

  .permission-modal-header h3 {
    font-size: 28px;
  }

  .permission-modal-aside,
  .permission-modal-main {
    padding: 18px;
  }

  .permission-tree-row {
    flex-direction: column;
  }

  .permission-tree-meta {
    justify-content: flex-start;
    padding-left: 38px;
  }

  .permission-tree-children {
    margin-left: 10px;
    padding-left: 12px;
  }

  .permission-modal-toolbar-actions {
    justify-content: stretch;
  }

  .permission-modal-toolbar-actions .btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 480px) {
  .permission-modal-dialog {
    width: calc(100vw - 12px);
    max-height: calc(100vh - 12px);
    margin: 6px auto;
    border-radius: 20px;
  }

  .permission-modal-header,
  .permission-modal-aside,
  .permission-modal-main,
  .permission-modal-footer {
    padding-left: 14px;
    padding-right: 14px;
  }

  .permission-tree-control,
  .permission-tree-static,
  .permission-section-card,
  .permission-modal-aside-card {
    border-radius: 18px;
  }
}

@media (max-width: 1200px) and (min-width: 769px) {
  .grid-5.dashboard-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid-6.dashboard-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 960px) and (min-width: 769px) {
  .grid-5.dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-6.dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ============================================================
   SIDEBAR LAYOUT  (2026-03-13)
   ============================================================ */

/* ── App Header ── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 24px;
  background: #0f172a;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
}

.app-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  width: 34px;
  height: 34px;
  background: #2563eb;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
  flex-shrink: 0;
}

.app-brand-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #f1f5f9;
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-header-username {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

.app-logout-btn {
  min-height: 34px !important;
  padding: 0 14px !important;
  font-size: 13px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 7px !important;
  color: rgba(255, 255, 255, 0.85) !important;
  transition: background 0.15s ease !important;
}

.app-logout-btn:hover {
  background: rgba(255, 255, 255, 0.16) !important;
  transform: none !important;
}

/* ── Notification Bell ── */
.notif-bell-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.notif-bell-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  position: relative;
  padding: 0;
  border-radius: 8px;
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
}
.notif-bell-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
}
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  border: 2px solid #0f172a;
}
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: -8px;
  width: 340px;
  max-height: 440px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(26,35,126,0.10), 0 1px 4px rgba(0,0,0,0.06);
  z-index: 9999;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.notif-dropdown-head {
  padding: 16px 20px 14px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.notif-dropdown-head strong {
  font-size: 14px;
  font-weight: 800;
  color: #1A237E;
}
.notif-dropdown-head button {
  background: none;
  border: none;
  color: #1A237E;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background .15s;
}
.notif-dropdown-head button:hover {
  background: #eef2ff;
}
.notif-dropdown-body {
  flex: 1;
  overflow-y: auto;
  max-height: 320px;
}
.notif-dropdown-foot {
  padding: 12px 20px;
  border-top: 1px solid #e2e8f0;
  text-align: center;
  background: #f8fafc;
  border-radius: 0 0 16px 16px;
}
.notif-dropdown-foot a {
  color: #1A237E;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.notif-dropdown-foot a:hover {
  text-decoration: underline;
}
.notif-filter-bar {
  display: flex; gap: 4px; padding: 8px 16px; border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.notif-filter-btn {
  padding: 4px 12px; border-radius: 8px; border: 1px solid #e2e8f0; background: #fff;
  font-size: 11px; font-weight: 700; color: #64748b; cursor: pointer; transition: all .15s;
}
.notif-filter-btn:hover { background: #eef2ff; color: #1A237E; border-color: #c7d2fe; }
.notif-filter-btn.active { background: #1A237E; color: #fff; border-color: #1A237E; }
.notif-type-badge {
  display: inline-flex; padding: 1px 6px; border-radius: 4px;
  font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.3px;
  margin-right: 4px; flex-shrink: 0;
}
.notif-type-mention { background: #eef2ff; color: #3730a3; }
.notif-type-assigned { background: #dbeafe; color: #1e40af; }
.notif-type-receiver_assigned { background: #fef3c7; color: #92400e; }
.notif-type-status { background: #ecfdf5; color: #059669; }
.notif-item {
  padding: 14px 20px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background .15s;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.notif-item:hover {
  background: #f8fafc;
}
.notif-item.unread {
  background: #f8fafc;
  border-left: 3px solid #1A237E;
}
.notif-item.unread:hover {
  background: #eef2ff;
}
.notif-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1A237E;
  flex-shrink: 0;
  margin-top: 6px;
}
.notif-dot.read {
  background: #cbd5e1;
}
.notif-msg {
  font-size: 13px;
  color: #334155;
  line-height: 1.5;
  flex: 1;
}
.notif-time {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Collaboration Panel ── */
.collab-panel {
  position: fixed; right: 0; top: 60px; bottom: 0; width: 400px;
  display: flex; z-index: 90; box-shadow: -4px 0 24px rgba(0,0,0,0.06);
}
.collab-rail {
  width: 52px; background: #fff; border-left: 1px solid #e2e8f0;
  display: flex; flex-direction: column; align-items: center; padding: 14px 0; gap: 4px;
}
.collab-rail-btn {
  width: 40px; height: 40px; border-radius: 10px; border: none; background: transparent;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  color: #94a3b8; transition: all .15s; position: relative;
}
.collab-rail-btn:hover { color: #1A237E; background: #f1f5f9; }
.collab-rail-btn.active { color: #1A237E; background: #eef2ff; }
.collab-rail-badge {
  position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px;
  background: #ef4444; color: #fff; font-size: 9px; font-weight: 800;
  border-radius: 999px; display: flex; align-items: center; justify-content: center;
  padding: 0 4px; line-height: 1;
}
.collab-rail-divider { width: 24px; height: 1px; background: #e2e8f0; margin: 6px 0; }
.collab-slide {
  flex: 1; background: #fff; border-left: 1px solid #f1f5f9;
  display: flex; flex-direction: column; overflow: hidden;
}
.collab-view { display: none; flex-direction: column; height: 100%; }
.collab-view.active { display: flex; }
.collab-view-head {
  padding: 18px 20px 14px; border-bottom: 1px solid #f1f5f9;
  display: flex; align-items: center; justify-content: space-between;
}
.collab-view-head strong { font-size: 15px; font-weight: 800; color: #0f172a; }
.collab-view-sub { display: block; font-size: 10px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.collab-action-btn {
  padding: 5px 14px; border-radius: 8px; border: none; background: #f1f5f9;
  font-size: 11px; font-weight: 700; color: #1A237E; cursor: pointer; transition: all .15s;
}
.collab-action-btn:hover { background: #eef2ff; }
.collab-filter-bar {
  display: flex; gap: 4px; padding: 10px 20px; border-bottom: 1px solid #f1f5f9; background: #fafbfc;
}
.collab-filter-btn {
  padding: 4px 12px; border-radius: 999px; border: 1px solid #e2e8f0; background: #fff;
  font-size: 11px; font-weight: 700; color: #64748b; cursor: pointer; transition: all .15s;
}
.collab-filter-btn:hover { border-color: #c7d2fe; color: #1A237E; }
.collab-filter-btn.active { background: #1A237E; color: #fff; border-color: #1A237E; }
.collab-view-body {
  flex: 1; overflow-y: auto;
}
.collab-view-body::-webkit-scrollbar { width: 4px; }
.collab-view-body::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 10px; }
.collab-view-foot {
  padding: 14px 20px; border-top: 1px solid #f1f5f9; text-align: center; background: #fafbfc;
}
.collab-view-foot a {
  font-size: 13px; font-weight: 700; color: #1A237E; text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
}
.collab-view-foot a:hover { text-decoration: underline; }
.collab-empty { padding: 40px 20px; text-align: center; color: #94a3b8; font-size: 13px; }

/* Notification items in panel */
.collab-notif-item {
  padding: 14px 20px; border-bottom: 1px solid #f7f9fc; cursor: pointer;
  transition: background .1s; display: flex; gap: 10px; align-items: flex-start;
}
.collab-notif-item:hover { background: #f8fafc; }
.collab-notif-item.unread { background: #f0f4ff; border-left: 3px solid #1A237E; }
.collab-notif-item.unread:hover { background: #e8eeff; }
.collab-notif-icon {
  width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; font-size: 14px;
}
.collab-notif-icon.mention { background: #eef2ff; color: #1A237E; }
.collab-notif-icon.assign { background: #dbeafe; color: #1e40af; }
.collab-notif-icon.receiver { background: #fef3c7; color: #92400e; }
.collab-notif-icon.status { background: #ecfdf5; color: #059669; }
.collab-notif-content { flex: 1; min-width: 0; }
.collab-notif-msg { font-size: 12px; font-weight: 500; color: #334155; line-height: 1.5; }
.collab-notif-meta {
  display: flex; align-items: center; gap: 6px; margin-top: 3px;
}
.collab-notif-chip {
  display: inline-flex; padding: 1px 6px; border-radius: 4px;
  font-size: 9px; font-weight: 800; letter-spacing: 0.3px;
}
.collab-notif-chip.mention { background: #eef2ff; color: #1A237E; }
.collab-notif-chip.assign { background: #dbeafe; color: #1e40af; }
.collab-notif-chip.receiver { background: #fef3c7; color: #92400e; }
.collab-notif-chip.status { background: #ecfdf5; color: #059669; }
.collab-notif-time { font-size: 10px; color: #94a3b8; white-space: nowrap; flex-shrink: 0; }
.collab-notif-issue { font-size: 10px; color: #94a3b8; font-weight: 600; }

/* Issue items in panel */
.collab-issue-item {
  padding: 14px 20px; border-bottom: 1px solid #f7f9fc; cursor: pointer;
  transition: background .1s; display: flex; gap: 10px; align-items: flex-start;
}
.collab-issue-item:hover { background: #f8fafc; }
.collab-issue-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px;
}
.collab-issue-dot.progress { background: #1A237E; }
.collab-issue-dot.hold { background: #f59e0b; }
.collab-issue-dot.done { background: #059669; }
.collab-issue-dot.pending { background: #94a3b8; }
.collab-issue-content { flex: 1; min-width: 0; }
.collab-issue-id { font-size: 11px; font-weight: 800; color: #1A237E; }
.collab-issue-title { font-size: 12px; font-weight: 600; color: #334155; margin-top: 2px; line-height: 1.4; }
.collab-issue-meta { display: flex; gap: 8px; margin-top: 4px; font-size: 10px; color: #94a3b8; }
.collab-issue-chip {
  padding: 1px 6px; border-radius: 4px; font-size: 9px; font-weight: 800;
}
.collab-issue-chip.p0 { background: #fee2e2; color: #dc2626; }
.collab-issue-chip.p1 { background: #fef3c7; color: #b45309; }
.collab-issue-chip.p2 { background: #dbeafe; color: #1e40af; }

/* ── App Layout (sidebar + content) ── */
.app-layout {
  display: flex;
  min-height: calc(100vh - 60px);
}

/* ── Sidebar ── */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #ffffff;
  border-right: 1px solid #e8edf3;
  padding: 14px 0 32px;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #e2e8f0 transparent;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 10px;
}

/* Top-level sidebar link */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #475569;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}

.sidebar-item:hover {
  background: #f1f5f9;
  color: #1e293b;
  transform: none;
}

.sidebar-item.active {
  background: #eff6ff;
  color: #1d4ed8;
}

/* Sidebar icon */
.sidebar-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  color: #94a3b8;
  transition: color 0.15s;
}

.sidebar-item:hover .sidebar-icon {
  color: #475569;
}

.sidebar-item.active .sidebar-icon {
  color: #1d4ed8;
}

.sidebar-group-btn:hover .sidebar-icon {
  color: #475569;
}

.sidebar-group.open > .sidebar-group-btn .sidebar-icon {
  color: #1d4ed8;
}

/* Sidebar accordion group */
.sidebar-group {
  display: flex;
  flex-direction: column;
}

.sidebar-group-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  font-size: 14px;
  font-weight: 600;
  font-family: "Pretendard", sans-serif;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: left;
  width: 100%;
}

.sidebar-group-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.sidebar-group.open .sidebar-group-btn {
  color: #1e293b;
}

.sidebar-chevron {
  width: 14px;
  height: 14px;
  margin-left: auto;
  flex-shrink: 0;
  color: #94a3b8;
  transition: transform 0.22s ease;
}

.sidebar-group.open > .sidebar-group-btn .sidebar-chevron {
  transform: rotate(180deg);
}

/* Accordion sub-items (max-height animation) */
.sidebar-group-items {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-left: 16px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.sidebar-group.open > .sidebar-group-items {
  max-height: 300px;
}

.sidebar-group-items a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 12px;
  border-radius: 6px;
  color: #64748b;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  transform: none;
  min-height: unset;
  min-width: unset;
  border: none;
  background: transparent;
  letter-spacing: normal;
}

.sidebar-group-items a::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #cbd5e1;
  flex-shrink: 0;
  transition: background 0.15s;
}

.sidebar-group-items a:hover {
  background: #f1f5f9;
  color: #1e293b;
  transform: none;
}

.sidebar-group-items a:hover::before {
  background: #64748b;
}

.sidebar-group-items a.active {
  background: #eff6ff;
  color: #1d4ed8;
}

.sidebar-group-items a.active::before {
  background: #1d4ed8;
}

/* ── Main Content Area ── */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 32px 36px 52px;
  background: #f8f9fa;
}

.main-content.no-sidebar {
  padding: 44px 52px 64px;
  max-width: 1440px;
  margin: 0 auto;
}

/* Adjust scan-panel sticky top for the new 60px header */
.main-content .scan-panel {
  top: 76px;
}

/* ── Responsive (mobile + tablet) ── */
@media (max-width: 1024px) {
  .app-header {
    padding: 0 14px;
    height: 54px;
  }

  .app-brand-name {
    font-size: 15px;
  }

  .brand-badge {
    width: 30px;
    height: 30px;
    font-size: 11px;
  }

  .app-layout {
    min-height: calc(100svh - 54px);
    min-height: -webkit-fill-available;
  }

  /* ── Mobile Sidebar: overlay drawer ── */
  .sidebar {
    position: fixed;
    top: 54px;
    left: 0;
    bottom: 0;
    width: 260px;
    z-index: 1000;
    transform: translateX(-100%);
    transition: none !important;
    box-shadow: none;
    border-right: 1px solid #e2e8f0;
  }

  /* 모바일에서 모든 불필요한 transition 비활성화 */
  .sidebar *,
  .sidebar-backdrop {
    transition: none !important;
  }

  .sidebar.mobile-open {
    transform: translateX(0) !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
    pointer-events: auto !important;
    opacity: 1 !important;
    overflow-y: auto !important;
  }

  .sidebar.collapsed {
    transform: translateX(-100%) !important;
  }

  /* ── Mobile Sidebar Backdrop ── */
  .sidebar-backdrop {
    display: none;
    position: fixed;
    top: 54px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.28s ease;
  }

  .sidebar-backdrop.visible {
    display: block;
    opacity: 1;
  }

  .main-content {
    padding: 16px 14px 44px;
    width: 100%;
  }

  /* ── Breadcrumb 가로 스크롤 ── */
  .breadcrumb {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding-bottom: 4px;
  }

  .breadcrumb li {
    flex-shrink: 0;
  }

  /* ── 페이지 타이틀 ── */
  .page-title {
    font-size: 20px;
  }

  h1 {
    font-size: 22px;
  }

  /* ── 대시보드 메트릭 카드: 3x2 그리드 ── */
  .grid-6.dashboard-metrics,
  .grid-5.dashboard-metrics {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px;
    margin: 12px 0 16px;
  }

  .dashboard-metrics .metric,
  .dashboard-metrics .metric-button {
    min-height: 80px;
    padding: 12px 8px;
  }

  .dashboard-metrics .metric span {
    font-size: 11px;
    margin-bottom: 4px;
  }

  .dashboard-metrics .metric strong {
    font-size: 22px;
  }

  /* ── 카드 ── */
  .card {
    border-radius: 12px;
    padding: 14px;
  }

  /* ── 필터 폼 세로 정렬 ── */
  .toolbar-form {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-form select,
  .toolbar-form input[type="text"],
  .toolbar-form input[type="search"],
  .toolbar-form input[type="date"] {
    width: 100%;
    min-width: 0;
    height: 44px !important;
    max-height: 44px;
    flex: 0 0 auto;
    box-sizing: border-box;
  }

  .toolbar-form .btn {
    width: 100%;
    height: 44px;
    flex: 0 0 auto;
  }

  /* ── 모든 테이블 가로 스크롤 ── */
  .dashboard-table-card,
  .returns-table-card,
  .returns-table-shell,
  .yt-db-table-card,
  .yt-search-table,
  .yt-settings-table,
  .sponsor-table,
  .table-scroll,
  .table-scroll-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .dashboard-table-card table,
  .returns-table-wrap table,
  .yt-db-table-wrap table,
  .yt-search-table-wrap table,
  .yt-settings-table-wrap table,
  .sponsor-table-wrap table,
  .table-scroll table,
  .table-scroll-wrap table {
    min-width: 600px;
  }

  table {
    font-size: 13px;
  }

  /* ── CS 테이블 가로 스크롤 ── */
  .cs-card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cs-table {
    min-width: 500px;
  }

  /* ── 테이블 액션 세로 정렬 ── */
  .table-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .table-actions-right {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }

  .page-size-form {
    justify-content: flex-start;
  }

  /* ── 필터 카드 ── */
  .dashboard-filter,
  .filter-card,
  .returns-filter-card,
  .yt-search-filter-card {
    margin-bottom: 12px;
    padding: 12px;
  }

  .returns-filter-form {
    flex-direction: column;
    gap: 8px;
  }

  .returns-filter-form select,
  .returns-filter-form input {
    width: 100%;
  }

  /* ── 모든 그리드 → 모바일 적응 ── */
  .grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
  }

  .form-grid,
  .integration-form-grid,
  .worker-account-field-grid,
  .bank-search-type-grid,
  .permission-modal-account-grid,
  .user-config-grid,
  .permission-grid,
  .acset-grid,
  .cashflow-form-grid,
  .accounting-account-grid {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }

  .yt-settings-grid,
  .yt-db-summary-grid,
  .yt-search-summary-grid,
  .sponsor-summary-grid,
  .sync-date-grid,
  .returns-detail-grid,
  .ref-upload-grid {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }

  /* ── 팩/스캔 레이아웃 ── */
  .pack-grid {
    grid-template-columns: 1fr !important;
  }

  .erp-top-grid {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }

  .scan-input-row {
    grid-template-columns: 1fr;
  }

  .scan-input-row input,
  .scan-input-row .btn {
    width: 100%;
    min-height: 48px;
    font-size: 16px;
  }

  /* ── 모달 풀 너비 ── */
  .cs-modal,
  .modal-box,
  .sync-modal,
  .acset-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    transform: none !important;
  }

  .permission-modal-dialog {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }

  .permission-modal-body {
    flex-direction: column;
  }

  .permission-modal-aside {
    width: 100%;
    max-width: 100%;
  }

  .permission-modal-main {
    width: 100%;
  }

  /* ── 드로어 패널 풀 너비 ── */
  .worker-account-drawer-panel,
  .slide-panel {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* ── 로그인 페이지 ── */
  .login-card {
    width: calc(100% - 32px);
    max-width: 100%;
    padding: 24px 20px;
  }

  /* ── 버튼 터치 최소 크기 ── */
  .btn {
    min-height: 40px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .btn.small {
    min-height: 34px;
  }

  /* ── select, input 터치 최적화 ── */
  select,
  input[type="text"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  input[type="search"],
  textarea {
    font-size: 16px !important;
    min-height: 40px;
  }

  /* ── 페이지 헤더 ── */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .page-header-breadcrumb {
    font-size: 12px;
  }

  /* ── 회계 검색 폼 ── */
  .accounting-search-form {
    grid-template-columns: 1fr !important;
  }

  /* ── 회계 크레딧 요약 ── */
  .accounting-credit-summary-grid {
    grid-template-columns: 1fr !important;
  }

  /* ── 오픈마켓 포탈 ── */
  .openmarket-embed-card iframe {
    min-height: 400px;
  }

  /* ── 셸/리스트 카드 패딩 축소 ── */
  .worker-account-shell,
  .worker-account-list-card,
  .integration-shell,
  .integration-list-card,
  .integration-settings-card {
    padding: 16px 12px;
  }

  /* ── 페이지네이션 ── */
  .pagination {
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
  }

  .pagination-link {
    min-width: 36px;
    min-height: 36px;
  }

  /* ── 배지/태그 ── */
  .badge {
    font-size: 11px;
    padding: 3px 8px;
  }

  /* ── 모바일 비디오 ── */
  video {
    max-width: 100%;
  }
}

/* ============================================================
   SIDEBAR v2 — 토글 + 개선된 카테고리 UI  (2026-03-13)
   ============================================================ */

/* ── Header Left Group ── */
.app-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Sidebar Toggle Button ── */
.sidebar-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
  padding: 0;
}

.sidebar-toggle-btn svg {
  width: 18px;
  height: 18px;
}

.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

/* ── Sidebar Collapse Animation ── */
.sidebar {
  transition: width 0.26s cubic-bezier(0.4, 0, 0.2, 1),
              min-width 0.26s cubic-bezier(0.4, 0, 0.2, 1),
              padding 0.26s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.22s ease,
              border-right-width 0.26s ease;
}

.sidebar.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  opacity: 0;
  overflow: hidden;
  border-right-width: 0 !important;
  pointer-events: none;
}

/* ── Sidebar Section Label ── */
.sidebar-section-label {
  padding: 6px 14px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #b0bac7;
  user-select: none;
}

/* ── Sidebar Item (refined) ── */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px 9px 12px;
  border-radius: 8px;
  color: #4a5568;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.3;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  cursor: pointer;
  position: relative;
}

.sidebar-item:hover {
  background: #f4f6f9;
  color: #1a202c;
  transform: none;
  box-shadow: none;
}

.sidebar-item.active {
  background: #eef3ff;
  color: #2563eb;
  font-weight: 600;
  box-shadow: inset 3px 0 0 #2563eb;
}

/* ── Sidebar Icon (refined) ── */
.sidebar-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #a0aec0;
  transition: color 0.15s;
  stroke-width: 1.8;
}

.sidebar-item:hover .sidebar-icon {
  color: #4a5568;
}

.sidebar-item.active .sidebar-icon {
  color: #2563eb;
}

.sidebar-group-btn:hover .sidebar-icon {
  color: #4a5568;
}

.sidebar-group.open > .sidebar-group-btn .sidebar-icon {
  color: #2563eb;
}

/* ── Sidebar Group Button (refined) ── */
.sidebar-group-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px 9px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #4a5568;
  font-size: 13.5px;
  font-weight: 500;
  font-family: "Pretendard", sans-serif;
  line-height: 1.3;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: left;
  width: 100%;
}

.sidebar-group-btn:hover {
  background: #f4f6f9;
  color: #1a202c;
}

.sidebar-group.open > .sidebar-group-btn {
  color: #1a202c;
  font-weight: 600;
}

/* ── Chevron ── */
.sidebar-chevron {
  width: 13px;
  height: 13px;
  margin-left: auto;
  flex-shrink: 0;
  color: #b0bac7;
  transition: transform 0.22s ease, color 0.15s;
}

.sidebar-group.open > .sidebar-group-btn .sidebar-chevron {
  transform: rotate(180deg);
  color: #6b7280;
}

/* ── Accordion Sub-items (refined) ── */
.sidebar-group-items {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-left: 14px;
  padding-left: 14px;
  border-left: 1.5px solid #e8edf3;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.26s cubic-bezier(0.4, 0, 0.2, 1),
              margin 0.26s ease,
              padding 0.26s ease;
  margin-top: 0;
  margin-bottom: 0;
}

.sidebar-group.open > .sidebar-group-items {
  max-height: 1400px;
  margin-top: 2px;
  margin-bottom: 4px;
}

.sidebar-nested-group {
  display: grid;
  gap: 2px;
}

.sidebar-sub-items {
  display: grid;
  gap: 1px;
  margin: 0 0 4px 14px;
  padding-left: 14px;
  border-left: 1px solid #e2e8f0;
}

.sidebar-sub-items a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  background: transparent;
  transition: background 0.14s, color 0.14s, font-weight 0.14s;
}

.sidebar-sub-items a::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #cbd5e1;
  flex-shrink: 0;
  transition: background 0.14s, transform 0.14s;
}

.sidebar-sub-items a:hover {
  background: #f8fafc;
  color: #334155;
}

.sidebar-sub-items a:hover::before {
  background: #94a3b8;
}

.sidebar-sub-items a.active {
  background: #eff6ff;
  color: #2563eb;
  font-weight: 600;
}

.sidebar-sub-items a.active::before {
  background: #2563eb;
  transform: scale(1.2);
}

.sidebar-sub-items-depth-2 {
  margin: 2px 0 0 12px;
  padding-left: 12px;
  border-left-style: dashed;
}

.sidebar-group-items a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  position: relative;
  z-index: 2;
  border-radius: 6px;
  color: #64748b;
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  transition: background 0.14s, color 0.14s, font-weight 0.14s;
  transform: none;
  min-height: unset;
  min-width: unset;
  border: none;
  background: transparent;
  letter-spacing: normal;
  line-height: 1.3;
}

.sidebar-group-items a::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d1d9e0;
  flex-shrink: 0;
  transition: background 0.14s, transform 0.14s;
}

.sidebar-group-items a:hover {
  background: #f4f6f9;
  color: #1a202c;
  transform: none;
}

.sidebar-group-items a:hover::before {
  background: #6b7280;
}

.sidebar-group-items a.active {
  background: #eef3ff;
  color: #2563eb;
  font-weight: 600;
}

.sidebar-group-items a.active::before {
  background: #2563eb;
  transform: scale(1.3);
}

.sidebar-group-nested {
  margin-top: 1px;
}

.sidebar-group-btn-nested {
  padding: 7px 10px 7px 10px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
}

.sidebar-group-items-nested {
  margin-left: 12px;
  padding-left: 12px;
  border-left-width: 1px;
  position: relative;
  z-index: 1;
}

/* ── Sidebar Divider (optional spacing between groups) ── */
.sidebar-divider {
  height: 1px;
  background: #f0f2f5;
  margin: 8px 14px;
}

/* ── Responsive for toggle button ── */
/* 모바일에서도 햄버거 버튼 표시 (드로어 토글용) */

/* ============================================================
   LOGIN PAGE  (2026-03-13)
   ============================================================ */

.login-page {
  margin: 0;
  background: #f3f4f8;
  min-height: 100vh;
}

.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 16px;
}

.login-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 420px;
}

/* ── Logo Badge ── */
.login-logo-wrap {
  margin-bottom: 20px;
}

.login-logo-badge {
  width: 60px;
  height: 60px;
  background: linear-gradient(140deg, #5b7cf7 0%, #2563eb 100%);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  box-shadow: 0 8px 28px rgba(37, 99, 235, 0.32);
}

/* ── Title / Subtitle ── */
.login-title {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  text-align: center;
  letter-spacing: -0.5px;
}

.login-subtitle {
  margin: 0 0 28px;
  font-size: 14px;
  color: #64748b;
  text-align: center;
  font-weight: 400;
}

/* ── Card ── */
.login-card {
  width: 100%;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  padding: 32px 32px 28px;
  margin-bottom: 20px;
}

/* ── Form ── */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.login-field label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.login-field input {
  width: 100%;
  min-height: 46px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
  color: #1f2937;
  padding: 12px 16px;
  font-size: 14.5px;
  font-family: "Pretendard", sans-serif;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.login-field input:focus {
  background: #fff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}

/* ── Password toggle ── */
.login-pw-wrap {
  position: relative;
}

.login-pw-wrap input {
  padding-right: 46px;
}

.login-pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  min-height: unset;
  transition: color 0.14s;
}

.login-pw-toggle:hover {
  color: #4b5563;
  background: none;
  transform: translateY(-50%);
}

.login-pw-toggle svg {
  width: 17px;
  height: 17px;
}

/* ── Error message ── */
.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 9px;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 500;
}

.login-error svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ── Submit Button ── */
.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  font-family: "Pretendard", sans-serif;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
  margin-top: 4px;
}

.login-btn svg {
  width: 17px;
  height: 17px;
}

.login-btn:hover {
  background: #1d4ed8;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.38);
  transform: translateY(-1px);
}

.login-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ── Footer ── */
.login-footer {
  font-size: 12.5px;
  color: #94a3b8;
  text-align: center;
  margin: 0;
  font-weight: 400;
}

/* ── 언어 전환 버튼 ── */
.lang-switcher {
  position: fixed;
  top: 20px;
  right: 24px;
  display: flex;
  gap: 3px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  z-index: 100;
}

.lang-btn {
  padding: 5px 13px;
  border: none;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #64748b;
  background: transparent;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.lang-btn:hover {
  background: #f1f5f9;
  color: #334155;
}

.lang-btn.active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 2px 6px rgba(37,99,235,0.3);
}

@media (max-width: 480px) {
  .login-card {
    padding: 24px 20px 20px;
  }

  .login-title {
    font-size: 22px;
  }

  .login-logo-badge {
    width: 52px;
    height: 52px;
    font-size: 17px;
    border-radius: 14px;
  }
}

/* ============================================================
   REFINED PREMIUM UI — 절제된 프리미엄 관리자 시스템 (2026-03-13-v3)
   Palette: #18263F · #223554 · #EEF3F8 · #D8E0EA · #2F5BFF · #6F7D90
   ============================================================ */

/* ── 1. Body / Main Background ── */
body { background: #eef3f8; }
.main-content { background: #eef3f8; padding: 28px 32px 40px; }

/* ── 2. App Header — deep navy, not black ── */
.app-header {
  background: #18263f !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
  box-shadow: 0 1px 8px rgba(10,18,36,0.22) !important;
  height: 56px;
}
.brand-badge {
  background: rgba(255,255,255,0.12) !important;
  border: 1px solid rgba(255,255,255,0.18) !important;
  box-shadow: none !important;
}
.app-brand-name {
  color: #d5dfef !important;
  font-weight: 600 !important;
  font-size: 15px;
  letter-spacing: -0.2px;
}
.app-header-username {
  color: rgba(180,200,230,0.6) !important;
  font-size: 13px;
  font-weight: 400;
}
.app-logout-btn {
  background: rgba(255,255,255,0.08) !important;
  border: 1px solid rgba(255,255,255,0.14) !important;
  color: rgba(255,255,255,0.7) !important;
  font-size: 12.5px !important;
  min-height: 32px !important;
  padding: 0 14px !important;
  border-radius: 6px !important;
}
.app-logout-btn:hover {
  background: rgba(255,255,255,0.15) !important;
  color: #fff !important;
}
.sidebar-toggle-btn { color: rgba(255,255,255,0.5) !important; }
.sidebar-toggle-btn:hover {
  color: rgba(255,255,255,0.85) !important;
  background: rgba(255,255,255,0.08) !important;
}

/* ── 3. Page Headings — subtle left accent ── */
.main-content h1 {
  font-size: 18px;
  font-weight: 700;
  color: #1f2a3d;
  letter-spacing: -0.3px;
  margin-bottom: 20px;
  padding: 0 0 14px 14px;
  border-left: 3px solid #2f5bff;
  border-bottom: 1px solid #d8e0ea;
}
.main-content h2 {
  font-size: 15px;
  font-weight: 700;
  color: #223554;
  letter-spacing: -0.2px;
  margin-bottom: 12px;
}

/* ── 4. Cards — clean, no aggressive shadows ── */
.card {
  border: 1px solid #d8e0ea;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(24,38,63,0.06);
  margin-bottom: 18px;
  padding: 22px 24px;
}

/* ── 5. Filter / Dashboard Filter Card — subtle left line ── */
.filter-card,
.dashboard-filter {
  background: #ffffff;
  border: 1px solid #d8e0ea;
  border-left: 3px solid #2f5bff;
  box-shadow: 0 1px 3px rgba(24,38,63,0.05);
  padding: 14px 20px !important;
}

/* ── 6. Table — removed dark navy override (uses global th style) ── */
tbody tr:hover { background: #f0f4fa; }
tbody tr:last-child td { border-bottom: none; }

/* Empty state */
tbody tr td[colspan] {
  text-align: center;
  padding: 48px 20px;
  color: #8b9ab0;
  font-size: 13.5px;
  font-weight: 400;
  background: #fafcfe;
}

/* ── 7. Badges — muted, not vivid ── */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  padding: 3px 9px;
  font-weight: 600;
  letter-spacing: 0.2px;
  border-radius: 5px;
  border: 1px solid transparent;
}
.badge.sent    { background: #e8f5ec; border-color: #b4dfc2; color: #1a6b3a; }
.badge.failed  { background: #fce8e8; border-color: #f0bfbf; color: #9a3030; }
.badge.pending { background: #f0f2f5; border-color: #d0d6df; color: #4a5568; }
.badge.packing { background: #fef6e0; border-color: #e8d49a; color: #7a5a10; }
.badge.packed  { background: #e8f0fe; border-color: #b4ccf0; color: #2a4a8a; }

/* ── 8. Dashboard Metric Cards — restrained ── */
.dashboard-metrics .metric-button {
  background: #ffffff;
  border: 1px solid #d8e0ea;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(24,38,63,0.05);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.dashboard-metrics .metric-button::after { display: none; }
.dashboard-metrics .metric-button:hover {
  border-color: #b0bdd0;
  box-shadow: 0 4px 14px rgba(24,38,63,0.09);
  transform: translateY(-2px);
}
.dashboard-metrics .metric-button.active {
  background: #223554;
  border-color: #223554;
  box-shadow: 0 4px 16px rgba(34,53,84,0.22);
}
.dashboard-metrics .metric-button.active span {
  color: rgba(192,206,224,0.8) !important;
}
.dashboard-metrics .metric-button.active strong {
  color: #ffffff !important;
}
.dashboard-metrics .metric span {
  color: #6f7d90;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.dashboard-metrics .metric strong {
  font-size: 30px;
  font-weight: 800;
  color: #1f2a3d;
  line-height: 1.15;
  letter-spacing: -0.5px;
}

/* ── 9. Table Actions Row ── */
.table-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 12px;
  border-bottom: 1px solid #e8ecf2;
  margin-bottom: 4px;
}
.table-meta {
  color: #1f2a3d;
  font-size: 13px;
  font-weight: 600;
}

/* ── 10. Pagination ── */
.pagination-link {
  border-radius: 7px;
  border: 1px solid #d8e0ea;
  font-size: 13px;
  font-weight: 600;
  color: #3a4d6a;
  min-width: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 0 10px;
  transition: all 0.15s;
}
.pagination-link:hover {
  border-color: #a0b0c8;
  background: #f0f4fa;
  color: #223554;
}
.pagination-link.active {
  background: #2f5bff;
  border-color: #2f5bff;
  color: #fff;
  box-shadow: 0 2px 8px rgba(47,91,255,0.22);
}
.pagination-link.disabled { opacity: 0.35; pointer-events: none; }

/* ── 11. Inputs and Selects ── */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select, textarea {
  background: #f5f7fa;
  border: 1px solid #cdd4e0;
  border-radius: 7px;
  color: #1f2a3d;
  min-height: 40px;
  padding: 10px 14px;
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
select:focus, textarea:focus {
  background: #ffffff;
  border-color: #2f5bff;
  box-shadow: 0 0 0 2px rgba(47,91,255,0.10);
  outline: none;
}

/* ── 12. File Input ── */
input[type="file"] {
  padding: 12px 16px !important;
  background: #f5f7fa !important;
  border: 1.5px dashed #b8c4d4 !important;
  border-radius: 7px !important;
  cursor: pointer !important;
  color: #4a5e78 !important;
  font-size: 13.5px !important;
  min-height: 46px !important;
  transition: border-color 0.15s, background 0.15s !important;
}
input[type="file"]:hover {
  background: #edf1f8 !important;
  border-color: #8a9cb8 !important;
}

/* ── 13. Buttons — cohesive system ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-weight: 600;
  font-size: 13.5px;
  min-height: 40px;
  padding: 0 18px;
  background: #18263f;
  color: #fff;
  line-height: 1;
  text-decoration: none;
  vertical-align: middle;
  box-shadow: 0 1px 2px rgba(24,38,63,0.12);
  transition: background 0.15s, box-shadow 0.15s, transform 0.12s;
}
.btn:hover {
  background: #223554;
  box-shadow: 0 2px 8px rgba(24,38,63,0.16);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }
.btn.secondary { background: #6e809b; }
.btn.secondary:hover { background: #5a6e88; }
.btn.danger { background: #d95c5c; color: #fff; }
.btn.danger:hover { background: #c24a4a; }
.btn.success { background: #3fae7a; }
.btn.success:hover { background: #339b68; }

/* ── 14. Settings Tabs ── */
.settings-tab-btn.active {
  background: #eef3f8;
  color: #223554;
  border-color: #b0bdd0;
}
.settings-tabs { border-bottom: 1px solid #d8e0ea; }

/* ── 15. Flash ── */
.flash {
  background: #eef3f8;
  border: 1px solid #c0cee0;
  border-left: 3px solid #2f5bff;
  border-radius: 8px;
  color: #223554;
  font-size: 13.5px;
  padding: 11px 14px;
  margin-bottom: 14px;
}

/* ── 16. Hint ── */
.hint { color: #6f7d90; font-size: 12.5px; line-height: 1.5; }

/* ── 17. Pack Summary Chips ── */
.pack-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.summary-chip {
  border-radius: 8px;
  border: 1px solid #d8e0ea;
  background: #f7f9fc;
  padding: 10px 14px;
}
.summary-chip span {
  display: block;
  color: #6f7d90;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 3px;
}
.summary-chip strong {
  display: block;
  color: #1f2a3d;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

/* ── 18. ERP Preview Box — unified navy accent ── */
.erp-preview-box {
  border: 1px solid #d8e0ea;
  background: #fafbfd;
  border-radius: 10px;
  padding: 18px;
  margin-top: 14px;
}
.erp-preview-head { margin-bottom: 14px; }
.erp-preview-head h3 {
  color: #1f2a3d;
  font-size: 14px;
  font-weight: 700;
  margin: 0;
}
.erp-line-card {
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  overflow: hidden;
}
.erp-top-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 14px;
  margin-bottom: 14px;
}
.erp-top-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.erp-top-field label {
  color: #4a5e78;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.erp-top-field select,
.erp-top-field input {
  min-height: 36px !important;
  font-size: 13px;
  padding: 6px 10px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── 19. BOM Boxes — same navy accent, no competing colors ── */
.bom-preview-box {
  border: 1px solid #d8e0ea;
  background: #fafbfd;
  border-radius: 10px;
  padding: 18px;
  margin-top: 14px;
}
.bom-action-box {
  border: 1px solid #d8e0ea;
  background: #fafbfd;
  border-radius: 10px;
  padding: 16px;
  margin-top: 14px;
}
.bom-preview-head, .bom-action-head { margin-bottom: 12px; }
.bom-preview-head h3, .bom-action-head h3 {
  color: #1f2a3d;
  font-size: 13px;
  font-weight: 700;
  margin: 0;
}
.bom-line-card {
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  overflow: hidden;
}

/* ── 20. Progress Bar ── */
.progress-wrap {
  background: #f5f7fa;
  border: 1px solid #d8e0ea;
  border-radius: 10px;
  padding: 12px 16px;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #4a5e78;
}
.progress-track {
  background: #d8e0ea;
  border-radius: 999px;
  height: 7px;
  overflow: hidden;
}
.progress-bar {
  background: #2f5bff;
  border-radius: 999px;
  height: 100%;
  transition: width 0.3s ease;
}

/* ── 21. Status Box ── */
#status-box, .status {
  border-radius: 8px;
  border: 1px solid;
  padding: 11px 14px;
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.status.neutral { background: #f0f3f8; border-color: #cdd4e0; color: #223554; }
.status.success { background: #edf8f0; border-color: #a8d8b8; color: #1a5e35; }
.status.error   { background: #fdf0f0; border-color: #e8b8b8; color: #8a2020; }

/* ── 22. Complete Button ── */
.complete-btn {
  width: 100% !important;
  background: #3fae7a !important;
  box-shadow: 0 2px 8px rgba(63,174,122,0.2) !important;
  border-radius: 8px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  min-height: 48px !important;
  margin: 4px 0;
}
.complete-btn:hover {
  background: #339b68 !important;
  box-shadow: 0 4px 14px rgba(63,174,122,0.28) !important;
  transform: translateY(-1px);
}

/* ── 23. Scan / List Panels — same border, no competing colors ── */
.scan-panel {
  border: 1px solid #d8e0ea !important;
  box-shadow: 0 1px 4px rgba(24,38,63,0.06) !important;
}
.list-panel {
  border: 1px solid #d8e0ea !important;
  box-shadow: 0 1px 4px rgba(24,38,63,0.06) !important;
}
.scan-step { margin-bottom: 14px; }
.scan-step label {
  display: block;
  color: #223554;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.scan-input-row { display: flex; gap: 8px; align-items: center; }
.scan-input-row input { flex: 1; }

/* ── 24. Upload Result Metrics ── */
.grid-4 .metric {
  border: 1px solid #d8e0ea;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(24,38,63,0.05);
  padding: 16px 18px;
}
.grid-4 .metric span {
  color: #6f7d90;
  font-size: 11px;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}
.grid-4 .metric strong {
  font-size: 28px;
  font-weight: 800;
  color: #1f2a3d;
  letter-spacing: -0.5px;
  display: block;
}

/* ── 25. Dashboard Table Card ── */
.dashboard-table-card {
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
}
.dashboard-table-card .table-actions {
  padding: 14px 20px 12px;
  border-bottom: 1px solid #e8ecf2;
}
.dashboard-table-card table {
  border-radius: 0;
  border: none;
  border-top: 1px solid #d8e0ea;
}

/* ── 26. Permission ── */
.permission-check {
  border: 1px solid #d8e0ea;
  background: #f7f9fc;
  border-radius: 7px;
  padding: 8px 12px;
}
.permission-pill {
  background: #edf0f5;
  color: #3a4d6a;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 4px;
}
.permission-pill.admin { background: #e0eaf8; color: #2a4580; }

/* ── 27. User Config Row ── */
.user-config-row td { background: #f7f9fc; }

/* ── 28. Sidebar scrollbar ── */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #cdd4e0; border-radius: 4px; }

/* ── 29. Utility ── */
.error { color: #d95c5c; }
.small-text { color: #6f7d90; font-size: 12px; }

/* ── 30. Toolbar form ── */
.toolbar-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.toolbar-form select,
.toolbar-form input[type="text"] { min-height: 38px; font-size: 13.5px; }
.toolbar-form .btn { min-height: 38px; padding: 0 16px; font-size: 13.5px; }

/* ── 31. Pack page grid ── */
.pack-grid {
  display: grid;
  grid-template-columns: minmax(360px, 420px) 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 960px) {
  .pack-grid { grid-template-columns: 1fr; }
  .pack-summary { grid-template-columns: repeat(2, 1fr); }
}

/* ── 32. BOM action items ── */
.bom-action-list { display: flex; flex-direction: column; gap: 6px; }
.bom-action-empty { color: #8b9ab0; font-size: 13px; padding: 8px 0; }

/* ── 33. Check-inline ── */
.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #4a5e78;
  cursor: pointer;
}

/* ── 34. Accounting empty state ── */
.main-content h1 + .card table tbody tr td[colspan] {
  padding: 72px 20px;
  font-size: 14px;
  color: #8b9ab0;
  background: #fafbfd;
}

/* ── 35. Settings form-actions buttons alignment ── */
.form-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

/* ── 36. Upload Page ── */
.upload-card {
  max-width: 600px;
  padding: 24px 28px !important;
}
.upload-section-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #6f7d90;
  margin-bottom: 8px;
}
.upload-file-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.upload-card input[type="file"] {
  display: block;
  width: 100% !important;
  padding: 16px 18px !important;
  background: #f5f7fa !important;
  border: 1.5px dashed #b0bdd0 !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  color: #4a5e78 !important;
  font-size: 13.5px !important;
  font-weight: 400 !important;
  min-height: 54px !important;
  transition: border-color 0.15s, background 0.15s !important;
}
.upload-card input[type="file"]:hover {
  background: #edf1f8 !important;
  border-color: #8a9cb8 !important;
}
.upload-card input[type="file"]:focus {
  border-color: #2f5bff !important;
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(47,91,255,0.10) !important;
}
.upload-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 24px;
  font-size: 14px;
  font-weight: 600;
}
.upload-submit-btn svg { width: 16px; height: 16px; }
.upload-guide {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 11px 14px;
  background: #f5f7fa;
  border: 1px solid #d8e0ea;
  border-radius: 7px;
  font-size: 13px;
  color: #4a5e78;
  line-height: 1.5;
}
.upload-guide svg {
  width: 14px; height: 14px;
  flex-shrink: 0; margin-top: 2px;
  color: #6f7d90;
}
.upload-guide strong { color: #223554; }
.upload-result-card { padding: 0 !important; overflow: hidden; }
.upload-result-head {
  padding: 14px 20px;
  border-bottom: 1px solid #e8ecf2;
  background: #f7f9fc;
  font-size: 14px;
  font-weight: 700;
  color: #1f2a3d;
}
.upload-result-metrics {
  padding: 18px 20px;
  border-bottom: 1px solid #e8ecf2;
}
.upload-result-table { padding: 0; }
.upload-dl-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #2f5bff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 14px;
  background: #eef3f8;
  border: 1px solid #d8e0ea;
  border-radius: 6px;
  margin: 14px 20px 0;
  transition: background 0.15s;
}
.upload-dl-link:hover { background: #e0e8f2; }

/* ── 37. Openmarket embed ── */
.openmarket-embed-card {
  position: relative;
  overflow: visible;
  padding: 0 !important;
  min-height: calc(100vh - 132px);
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.openmarket-embed-frame {
  display: block;
  width: 100%;
  min-height: calc(100vh - 132px);
  border: 0;
  background: transparent;
}

.openmarket-embed-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98));
  z-index: 2;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.openmarket-embed-loading[hidden],
.openmarket-embed-card.is-ready .openmarket-embed-loading {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.openmarket-embed-loading p {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

.openmarket-embed-loading-bar {
  width: 160px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(37,99,235,0.12), rgba(37,99,235,0.42), rgba(37,99,235,0.12));
  background-size: 200% 100%;
  animation: openmarketEmbedLoading 1.1s linear infinite;
}

@keyframes openmarketEmbedLoading {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ── 37. Log Pagination ── */
.log-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 0 6px;
}
.log-pagination .pagination-link { cursor: pointer; }

/* ── 38. ERP/BOM Line Tables — keep their own lighter header ── */
.erp-line-table,
.bom-line-table {
  width: 100%;
  margin: 0;
  border: none;
  border-radius: 0;
  border-collapse: collapse;
}
.erp-line-table thead,
.bom-line-table thead { background: #f0f4fa; }
.erp-line-table thead th,
.bom-line-table thead th {
  color: #4a5e78;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  background: transparent;
  border-bottom: 1px solid #d8e0ea;
  padding: 9px 12px;
  white-space: nowrap;
}
.erp-line-table tbody td,
.bom-line-table tbody td {
  font-size: 13px;
  padding: 9px 12px;
  border-bottom: 1px solid #edf0f5;
  color: #1f2a3d;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}
.erp-line-table tbody tr:last-child td,
.bom-line-table tbody tr:last-child td { border-bottom: none; }

/* ── 39. Pack page responsive grid ── */
@media (max-width: 1200px) {
  .erp-top-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .erp-top-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════
   40. Pack Page — Warm Gray & Gold Theme
   ══════════════════════════════════════════════════════ */

/* ── 40-1. Body & Main content background ── */
.page-pack { background: #f7f6f3 !important; }
.page-pack .main-content {
  background: #f7f6f3 !important;
}

/* ── 40-2. Page header — gold accent bar ── */
.page-pack .pack-hero {
  margin: 6px 0 16px;
  padding: 16px 0 0;
  border-bottom: 2px solid #e8e5de;
}
.page-pack .pack-hero h1 {
  font-size: 18px !important;
  font-weight: 800 !important;
  color: #292524 !important;
}
.page-pack .pack-hero h1::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #d4a017, #eab308);
  border-radius: 2px;
  margin-top: 6px;
}
.page-pack .page-header-breadcrumb {
  color: #a8a29e !important;
  font-size: 11px !important;
}
.page-pack .page-header-breadcrumb .ph-sep {
  color: #a8a29e !important;
}

/* ── 40-3. Warm Gray Card System (.wg-card) ── */
.wg-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e8e5de;
}
.wg-card-head {
  padding: 12px 18px;
  border-bottom: 1px solid #f5f3ef;
  font-size: 13px;
  font-weight: 700;
  color: #292524;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wg-card-head::before {
  content: '';
  width: 4px;
  height: 16px;
  background: #d4a017;
  border-radius: 2px;
  flex-shrink: 0;
}
.wg-card-body {
  padding: 16px 18px;
}

/* ── 40-4. Grid layout ── */
.page-pack .pack-grid {
  display: grid !important;
  grid-template-columns: 380px 1fr !important;
  gap: 18px !important;
  align-items: start !important;
}
.pack-left-col, .pack-right-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pack-left-col {
  position: sticky;
  top: 72px;
}
@media (max-width: 960px) {
  .page-pack .pack-grid { grid-template-columns: 1fr !important; }
  .pack-left-col { position: static; }
}

/* ── 40-5. Gold step numbers ── */
.wg-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #d4a017;
  color: #fff;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  margin-right: 4px;
  flex-shrink: 0;
}
.page-pack .scan-step label {
  color: #78716c !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.3px !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

/* ── 40-6. Input fields — warm gray ── */
.page-pack .scan-input-row input {
  background: #fafaf8 !important;
  border: 1.5px solid #d6d3d1 !important;
  border-radius: 8px !important;
  color: #292524 !important;
}
.page-pack .scan-input-row input::placeholder {
  color: #a8a29e !important;
}
.page-pack .scan-input-row input:focus {
  border-color: #d4a017 !important;
  box-shadow: 0 0 0 3px rgba(212,160,23,.1) !important;
}
.page-pack .scan-input-row input:disabled {
  background: #f0efec !important;
  color: #a8a29e !important;
}

/* ── 40-7. Buttons — dark warm ── */
.page-pack .scan-input-row .btn {
  background: #292524 !important;
  color: #fff !important;
  border-radius: 8px !important;
}
.page-pack .scan-input-row .btn:hover {
  background: #44403c !important;
}
.page-pack .scan-input-row .btn:disabled {
  background: #d6d3d1 !important;
  color: #a8a29e !important;
}

/* ── 40-8. Progress bar — gold gradient ── */
.page-pack .progress-wrap {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}
.page-pack .progress-meta span {
  color: #78716c !important;
}
.page-pack .progress-meta strong {
  color: #292524 !important;
}
.page-pack .progress-track {
  background: #e8e5de !important;
  height: 8px !important;
}
.page-pack .progress-bar {
  background: linear-gradient(90deg, #eab308, #d4a017) !important;
}

/* ── 40-9. Status box — warm gray neutral ── */
.page-pack .status {
  border-radius: 10px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}
.page-pack .status.neutral {
  background: #fafaf8 !important;
  border-color: #e8e5de !important;
  color: #78716c !important;
}
.page-pack .status.success {
  background: #dcfce7 !important;
  border-color: #86efac !important;
  color: #166534 !important;
}
.page-pack .status.error {
  background: #fef2f2 !important;
  border-color: #fecaca !important;
  color: #991b1b !important;
}
.page-pack .status.warn {
  background: #fefce8 !important;
  border-color: #fde68a !important;
  color: #854d0e !important;
}

/* ── 40-10. Summary chips — warm gray ── */
.page-pack .summary-chip {
  background: #fff !important;
  border: 1px solid #e8e5de !important;
  border-radius: 10px !important;
  padding: 16px 18px !important;
}
.page-pack .summary-chip span {
  color: #a8a29e !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}
.page-pack .summary-chip strong {
  color: #292524 !important;
  font-weight: 800 !important;
  font-size: 15px !important;
}

/* ── 40-11. Items table — warm gray ── */
.page-pack #items-table { width: 100%; border-collapse: collapse; }
.page-pack #items-table thead th {
  color: #a8a29e !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  padding: 10px 14px !important;
  border-bottom: 1px solid #e8e5de !important;
  background: transparent !important;
}
.page-pack #items-table tbody td {
  padding: 12px 14px !important;
  font-size: 13px !important;
  color: #44403c !important;
  border-bottom: 1px solid #f5f3ef !important;
}
.page-pack #items-table tbody tr:hover {
  background: #fafaf8 !important;
}
.page-pack .row-ok {
  background: #fafaf8 !important;
}

/* ── 40-12. Badges — warm tones ── */
.page-pack .badge.packed,
.page-pack .badge.ok {
  background: #dcfce7 !important;
  color: #166534 !important;
}
.page-pack .badge.packing,
.page-pack .badge.warn {
  background: #fef9c3 !important;
  color: #854d0e !important;
}
.page-pack .badge.wait {
  background: #f5f5f4 !important;
  color: #a8a29e !important;
}

/* ── 40-13. ERP form — warm gray ── */
.page-pack .erp-top-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 12px !important;
  margin-bottom: 14px !important;
}
.page-pack .erp-top-field {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}
.page-pack .erp-top-field label {
  color: #a8a29e !important;
  font-size: 10px !important;
  font-weight: 600 !important;
}
.page-pack .erp-top-field select,
.page-pack .erp-top-field input {
  min-height: 40px !important;
  background: #fafaf8 !important;
  border: 1.5px solid #d6d3d1 !important;
  border-radius: 8px !important;
  color: #292524 !important;
  font-size: 12px !important;
  padding: 10px 12px !important;
}
.page-pack .erp-top-field select:focus,
.page-pack .erp-top-field input:focus {
  border-color: #d4a017 !important;
  box-shadow: 0 0 0 3px rgba(212,160,23,.1) !important;
}
.page-pack .erp-line-card {
  border: 1px solid #e8e5de !important;
  border-radius: 8px !important;
}
.page-pack .erp-line-table thead,
.page-pack .bom-line-table thead {
  background: #fafaf8 !important;
}
.page-pack .erp-line-table thead th,
.page-pack .bom-line-table thead th {
  color: #a8a29e !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  border-bottom: 1px solid #e8e5de !important;
  background: transparent !important;
  padding: 10px 14px !important;
}
.page-pack .erp-line-table tbody td,
.page-pack .bom-line-table tbody td {
  color: #44403c !important;
  border-bottom: 1px solid #f5f3ef !important;
  font-size: 13px !important;
  padding: 12px 14px !important;
}
.page-pack .erp-line-table tbody tr:hover,
.page-pack .bom-line-table tbody tr:hover {
  background: #fafaf8 !important;
}
@media (max-width: 1200px) {
  .page-pack .erp-top-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 768px) {
  .page-pack .erp-top-grid { grid-template-columns: 1fr !important; }
}

/* ── 40-14. Complete button — dark with gold dot ── */
.page-pack .complete-btn {
  background: #292524 !important;
  color: #fff !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  min-height: 52px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
}
.page-pack .complete-btn::before {
  content: '' !important;
  width: 8px !important;
  height: 8px !important;
  background: #d4a017 !important;
  border-radius: 50% !important;
  display: inline-block !important;
}
.page-pack .complete-btn:hover {
  background: #44403c !important;
  box-shadow: none !important;
  transform: none !important;
}
.page-pack .complete-btn:disabled {
  background: #d6d3d1 !important;
  color: #a8a29e !important;
}
.page-pack .complete-btn:disabled::before {
  background: #a8a29e !important;
}

/* ── 40-15. BOM action box — warm gray ── */
.page-pack .bom-action-list {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}
.page-pack .bom-action-empty {
  color: #a8a29e !important;
  font-size: 12px !important;
}
.page-pack .bom-action-row {
  display: flex !important;
  gap: 8px !important;
}
.page-pack .bom-action-row input {
  background: #fafaf8 !important;
  border: 1.5px solid #d6d3d1 !important;
  color: #292524 !important;
}
.page-pack .bom-action-row input:focus {
  border-color: #d4a017 !important;
  box-shadow: 0 0 0 3px rgba(212,160,23,.1) !important;
}
.page-pack .bom-action-row .btn {
  background: #292524 !important;
  color: #fff !important;
}
.page-pack .bom-action-row .btn:hover {
  background: #44403c !important;
}
.page-pack .bom-action-row .btn:disabled {
  background: #e7e5e4 !important;
  color: #8b8581 !important;
  border-color: #d6d3d1 !important;
  cursor: not-allowed !important;
}
.page-pack .bom-action-row .btn:disabled:hover {
  background: #e7e5e4 !important;
  color: #8b8581 !important;
}

/* ── 40-16. BOM line card ── */
.page-pack .bom-line-card {
  border: 1px solid #e8e5de !important;
  border-radius: 8px !important;
}
.page-pack .bom-preview-head span {
  color: #a8a29e !important;
}
.page-pack .bom-line-card {
  border: 1px solid #e8e5de !important;
  border-radius: 8px !important;
}

.sidebar {
  display: flex;
  flex-direction: column;
}

.sidebar-nav {
  flex: 1 1 auto;
}

.sidebar-footer-tools {
  margin-top: auto;
  padding: 12px 10px 0;
  border-top: 1px solid #e8edf3;
}

.sidebar-share-link-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #d9e3ef;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.sidebar-share-link-btn:hover {
  border-color: #bfd0e6;
  background: #f3f8ff;
  color: #1e293b;
  transform: translateY(-1px);
}

.sidebar-share-link-btn.copied {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.sidebar-share-link-btn.is-error {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

.sidebar-share-link-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #64748b;
  transition: color 0.16s ease;
}

.sidebar-share-link-btn:hover .sidebar-share-link-icon {
  color: #334155;
}

.sidebar-share-link-btn.copied .sidebar-share-link-icon {
  color: #1d4ed8;
}

.sidebar-share-link-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   사이트 오류 신고 — 채널톡 스타일 떠있는 버튼 + 카드 팝업
   ============================================================ */
#site-error-report-root {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  pointer-events: none;
}
#site-error-report-root > * { pointer-events: auto; }

.site-error-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #6366F1;
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.42);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s;
  position: relative;
}
.site-error-fab:hover {
  background: #4f46e5;
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(99, 102, 241, 0.55);
}
.site-error-fab:active { transform: translateY(0); }

.site-error-bubble {
  position: absolute;
  right: 72px;
  bottom: 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.4;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  animation: site-error-bubble-in .35s ease;
}
.site-error-bubble::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-left: 7px solid #fff;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  filter: drop-shadow(1px 0 0 #e5e7eb);
}
@keyframes site-error-bubble-in {
  from { opacity: 0; transform: translateX(8px); }
  to   { opacity: 1; transform: translateX(0); }
}

.site-error-popup {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: 360px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: site-error-popup-in .2s ease;
}
@keyframes site-error-popup-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.site-error-head {
  background: linear-gradient(135deg, #6366F1 0%, #8b5cf6 100%);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.site-error-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
}
.site-error-close {
  background: transparent;
  border: none;
  color: #fff;
  opacity: .85;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 6px;
}
.site-error-close:hover { opacity: 1; background: rgba(255,255,255,0.18); }

.site-error-greeting {
  padding: 14px 18px;
  font-size: 13px;
  color: #475569;
  line-height: 1.6;
  border-bottom: 1px solid #f1f5f9;
}
.site-error-greeting b { color: #1e293b; font-weight: 700; }

.site-error-body {
  padding: 12px 18px 8px;
}

.site-error-editor {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  min-height: 130px;
  max-height: 260px;
  overflow-y: auto;
  padding: 10px 12px;
  font-size: 13px;
  color: #1e293b;
  line-height: 1.55;
  background: #f9fafb;
  outline: none;
  transition: border-color .15s, background .15s;
}
.site-error-editor:focus {
  border-color: #6366F1;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.site-error-editor:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  pointer-events: none;
}
.site-error-editor img {
  max-width: 100%;
  border-radius: 6px;
  margin: 4px 0;
  display: block;
}

.site-error-auto-info {
  margin-top: 8px;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.5;
}

.site-error-footer {
  padding: 10px 18px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #f1f5f9;
  background: #fafbfc;
}
.site-error-attach {
  background: transparent;
  border: none;
  color: #6366F1;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.site-error-attach:hover { background: #eef2ff; }

.site-error-submit {
  background: #6366F1;
  color: #fff;
  border: none;
  padding: 9px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.site-error-submit:hover { background: #4f46e5; }
.site-error-submit:disabled { background: #c7d2fe; cursor: wait; }

/* 신고 탭 하단 — 내가 신고한 결과 보기 링크 (신고 보내기와 같은 줄) */
.site-error-myreports {
  flex: 1 1 auto;
  margin: 0;
  padding: 9px 10px;
  text-align: center;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #4338ca;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s;
}
.site-error-myreports:hover { background: #eef2ff; }

/* ============================================================
   접수(개발/요청/신고) 신고 탭 — Indigo Glass v2
   ============================================================ */
/* 알림 탭: 받은/지난 알림 토글 */
.ct-alert-segs { display:flex; gap:4px; background:#f1f3f9; border-radius:999px; padding:3px; }
.ct-aseg { font-size:11.5px; font-weight:700; color:#64748b; background:transparent; border:none; border-radius:999px; padding:5px 12px; cursor:pointer; }
.ct-aseg.on { background:#fff; color:#4f46e5; box-shadow:0 1px 3px rgba(16,24,40,.12); }

/* 헤더 우측 '내 접수 내역' (접수 탭일 때만 표시) */
.ct-head-mine {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  font-size: 11.5px; font-weight: 700; text-decoration: none; color: #fff;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.32);
  padding: 5px 11px; border-radius: 999px; margin-right: 4px;
}
.ct-head-mine:hover { background: rgba(255,255,255,.28); }

#ctPaneReport.ct-pane { padding: 0; display: flex; flex-direction: column; min-height: 0; }
/* 접수 분류 — 라벨 정렬 + 큰분류 드롭다운 + 세부 다중 칩 */
.ser2-cat { padding: 14px 16px 2px; }
.ser2-cat-line { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ser2-cat-line.sub { align-items: flex-start; }
.ser2-cat-tag { flex: 0 0 34px; font-size: 11.5px; font-weight: 800; color: #64748b; padding-top: 2px; }
.ser2-cat-tag em { color: #ef4444; font-style: normal; margin-left: 1px; }
.ser2-catsel { flex: 1; font-size: 13px; font-weight: 700; color: #1e293b; border: 1px solid #cbd5e1; border-radius: 10px; padding: 9px 30px 9px 12px; background-color: #fff; cursor: pointer; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%2394a3b8' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.ser2-catsel:focus { outline: none; border-color: #c7c9fb; box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.ser2-cat-chips { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; }
.ser2-cat-chip { font-size: 12px; font-weight: 700; color: #475569; background: #f4f5f9; border: 1px solid #e6e8f1; border-radius: 999px; padding: 6px 12px; cursor: pointer; transition: .12s; }
.ser2-cat-chip:hover { background: #eceef5; }
.ser2-cat-chip.on { background: #4f46e5; border-color: #4f46e5; color: #fff; }
.ser2-cat-locknote { font-size: 11px; color: #94a3b8; padding: 2px 2px 0; }
.ser2-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 14px 16px 10px; }
.ser2-greet { font-size: 12.5px; color: #475569; line-height: 1.55; }
.ser2-greet b { color: #1e293b; }
.ser2-mine {
  flex: none; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  font-size: 11.5px; font-weight: 800; text-decoration: none; color: #4338ca;
  background: #eef0ff; border: 1px solid #c7c9fb; padding: 6px 11px; border-radius: 999px;
  box-shadow: 0 1px 2px rgba(67,56,202,.12);
}
.ser2-mine:hover { background: #e0e3ff; }
.ser2-seg { display: flex; gap: 4px; padding: 0 16px; margin-bottom: 12px; }
.ser2-seg { background: transparent; }
.ser2-seg button {
  flex: 1; border: none; cursor: pointer; padding: 9px 0; border-radius: 10px;
  font-size: 12.5px; font-weight: 700; color: #7a8398; background: #eef0f6; transition: .15s;
}
.ser2-seg button.on { background: #fff; color: #4f46e5; box-shadow: 0 2px 8px rgba(79,70,229,.16); border: 1px solid #e0e2ff; }
.ser2-body { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; padding: 0 16px; overflow-y: auto; }
.ser2-box { border: 1.5px solid #e6e8f2; border-radius: 14px; background: #fafbff; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; transition: .15s; }
.ser2-box:focus-within { border-color: #c7c9fb; background: #fff; box-shadow: 0 0 0 4px rgba(99,102,241,.1); }
.ser2-text { flex: 1 1 auto; min-height: 120px; padding: 13px 14px; font-size: 13px; line-height: 1.6; color: #1e293b; outline: none; overflow-y: auto; }
.ser2-text:empty::before { content: attr(data-placeholder); color: #9aa3b8; pointer-events: none; }
.ser2-thumbs { display: none; flex-wrap: wrap; gap: 8px; padding: 0 14px 6px; }
.ser2-thumb { position: relative; width: 54px; height: 54px; border-radius: 10px; overflow: hidden; border: 1px solid #e2e6f5; }
.ser2-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ser2-thumb-x { position: absolute; top: -2px; right: -2px; width: 18px; height: 18px; border: none; border-radius: 0 0 0 8px; background: rgba(15,23,42,.78); color: #fff; font-size: 12px; line-height: 1; cursor: pointer; }
.ser2-tool { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 11px; border-top: 1px solid #eef0f7; }
.ser2-clip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: #5b62f0; background: #eef0ff; border: 1px solid #e0e2ff; padding: 6px 12px; border-radius: 10px; cursor: pointer; }
.ser2-clip:hover { background: #e0e3ff; }
.ser2-hint { font-size: 10.5px; color: #b3bacb; }
.ser2-auto { font-size: 10.5px; color: #aab2c4; margin: 9px 0 4px; }
.ser2-foot { padding: 12px 16px 16px; }
.ser2-send { width: 100%; border: none; border-radius: 13px; padding: 12px; font-size: 13.5px; font-weight: 800; color: #fff; cursor: pointer; letter-spacing: -0.01em; background: linear-gradient(135deg,#6366f1,#7c3aed); box-shadow: 0 8px 18px -8px rgba(99,102,241,.7); }
.ser2-send:hover { filter: brightness(1.05); }
.ser2-send:disabled { opacity: .6; cursor: wait; }

/* 자세히 — 가운데 큰 에디터 팝업 */
dialog.serbig { border: none; border-radius: 20px; padding: 0; width: min(720px, 94vw); max-height: 88vh; box-shadow: 0 30px 80px rgba(15,23,42,.35); }
dialog.serbig::backdrop { background: rgba(15,23,42,.5); }
.serbig-top { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; color: #fff; background: linear-gradient(135deg,#6366f1,#7c3aed); }
.serbig-title { font-size: 16px; font-weight: 800; }
.serbig-x { width: 32px; height: 32px; border-radius: 9px; border: none; background: rgba(255,255,255,.18); color: #fff; font-size: 16px; cursor: pointer; }
.serbig-body { padding: 18px 20px; max-height: calc(88vh - 150px); overflow-y: auto; }
.serbig-editor { min-height: 300px; border: 1.5px solid #e6e8f2; border-radius: 14px; background: #fafbff; padding: 16px 18px; font-size: 14px; line-height: 1.8; color: #1e293b; outline: none; white-space: pre-wrap; }
.serbig-editor.drop { border-color: #6366f1; background: #eef2ff; }
.serbig-editor:empty::before { content: attr(data-placeholder); color: #9aa3b8; pointer-events: none; }
.serbig-editor img { max-width: 100%; border-radius: 8px; margin: 8px 0; display: block; }
.serbig-editor video { max-width: 100%; width: 100%; border-radius: 8px; margin: 8px 0; background: #000; }
.serbig-foot { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid #f1f5f9; }
.serbig-droptip { flex: 1; font-size: 11.5px; color: #94a3b8; }
.serbig-cancel { padding: 11px 18px; border-radius: 11px; border: 1.5px solid #e2e8f0; background: #fff; font-size: 13px; font-weight: 700; color: #475569; cursor: pointer; }
.serbig-send { border: none; border-radius: 11px; padding: 11px 22px; font-size: 13.5px; font-weight: 800; color: #fff; cursor: pointer; background: linear-gradient(135deg,#6366f1,#7c3aed); }
.serbig-send:disabled { opacity: .6; cursor: wait; }

@media (max-width: 480px) {
  #site-error-report-root { right: 16px; bottom: 16px; }
  .site-error-popup { width: calc(100vw - 32px); right: -8px; }
  .site-error-bubble { display: none !important; }
}

/* ============================================================
   채팅톡 (ChatTok) 통합 팝업 — 대화 + 신고 탭 구조
   ============================================================ */
.ct-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  line-height: 1;
}

.ct-popup {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: 420px;
  /* 위젯 바닥(96px) + 맨 위 검은 상단바(약 68px) + 여유(16px) = 180px 만큼 빼서
     팝업 머리(헤더)가 상단바에 가리지 않고 여유를 두고 열리게 한다. */
  height: min(780px, calc(100vh - 180px));
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 180px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: site-error-popup-in .2s ease;
}

.ct-head {
  background: linear-gradient(135deg, #6366F1 0%, #8b5cf6 100%);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}
.ct-head-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  min-width: 0;
}
.ct-head-icon { font-size: 17px; flex-shrink: 0; }
#ctHeadText {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ct-head-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.ct-head-back, .ct-head-close {
  background: transparent;
  border: none;
  color: #fff;
  opacity: .85;
  cursor: pointer;
  font-size: 18px;
  padding: 4px 10px;
  border-radius: 6px;
}
.ct-head-back:hover, .ct-head-close:hover { opacity: 1; background: rgba(255,255,255,0.18); }

.ct-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #f8fafc;
}
.ct-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* ===== 대화 목록 ===== */
.ct-thread-list {
  flex: 1;
  overflow-y: auto;
  background: #fff;
}
.ct-thread-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background .12s;
  position: relative;
}
.ct-thread-item:hover { background: #fafbfc; }
.ct-thread-main { flex: 1; min-width: 0; }
.ct-thread-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}
.ct-thread-name { font-size: 13px; font-weight: 700; color: #1e293b; }
.ct-thread-time { font-size: 11px; color: #94a3b8; flex-shrink: 0; }
.ct-thread-last { font-size: 12px; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-thread-unread {
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ct-new-chat-btn {
  margin: 12px 16px;
  padding: 11px 16px;
  background: #6366F1;
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .15s;
  flex-shrink: 0;
}
.ct-new-chat-btn:hover { background: #4f46e5; }

/* ===== 직원 검색 ===== */
.ct-search-bar { padding: 12px 16px; background: #fff; border-bottom: 1px solid #f1f5f9; flex-shrink: 0; }
.ct-search-bar input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  outline: none;
}
.ct-search-bar input:focus { border-color: #6366F1; box-shadow: 0 0 0 3px rgba(99,102,241,0.12); }
.ct-user-list { flex: 1; overflow-y: auto; background: #fff; }
.ct-user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background .12s;
}
.ct-user-item:hover { background: #fafbfc; }
.ct-user-name { font-size: 13px; font-weight: 600; color: #1e293b; flex: 1; }

/* ===== 아바타 공통 ===== */
.ct-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ===== 빈 상태 ===== */
.ct-empty {
  padding: 40px 20px;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.6;
}
.ct-empty-icon { font-size: 32px; margin-bottom: 8px; }

/* ===== 메시지창 ===== */
.ct-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #f8fafc;
}
.ct-msg { display: flex; align-items: flex-end; gap: 6px; max-width: 100%; }
.ct-msg.mine { justify-content: flex-end; }
.ct-msg.theirs { justify-content: flex-start; }
.ct-msg-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 14px;
}
.ct-msg-bubble {
  max-width: 75%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  position: relative;
  word-break: break-word;
}
.ct-msg.mine .ct-msg-bubble {
  background: #6366F1;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ct-msg.theirs .ct-msg-bubble {
  background: #fff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
}
.ct-msg-text { white-space: pre-wrap; }
.ct-msg-img {
  max-width: 220px;
  max-height: 220px;
  border-radius: 8px;
  display: block;
  margin: 2px 0;
}
.ct-msg-time {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 3px;
  text-align: right;
}
.ct-msg.mine .ct-msg-time { color: rgba(255,255,255,0.75); }

/* 메시지 거품 호버 액션 메뉴 (답장 / 회수) — 거품 옆에 가로로 표시 */
.ct-msg-bubble-wrap {
  position: relative;
  max-width: 75%;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 4px;
}
.ct-msg.mine .ct-msg-bubble-wrap { flex-direction: row-reverse; margin-left: auto; }
.ct-msg-bubble-wrap .ct-msg-bubble { max-width: 100%; }

.ct-msg-actions {
  display: flex;
  gap: 2px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 2px 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s;
  flex-shrink: 0;
  align-self: center;
  margin-bottom: 4px;
}
.ct-msg-bubble-wrap:hover .ct-msg-actions { opacity: 1; pointer-events: auto; }
.ct-msg-action {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 3px 6px;
  font-size: 12px;
  color: #475569;
  border-radius: 999px;
  transition: background .12s;
  line-height: 1;
}
.ct-msg-action:hover { background: #f1f5f9; color: #1e293b; }

/* 답장 인용 박스 (메시지 거품 안 위쪽) */
.ct-msg-quote {
  background: rgba(0,0,0,0.08);
  border-left: 3px solid rgba(0,0,0,0.25);
  padding: 5px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 11px;
  line-height: 1.4;
  cursor: pointer;
  transition: background .12s;
}
.ct-msg-quote:hover { background: rgba(0,0,0,0.13); }
.ct-msg.mine .ct-msg-quote {
  background: rgba(255,255,255,0.18);
  border-left-color: rgba(255,255,255,0.55);
  color: rgba(255,255,255,0.95);
}
.ct-msg.mine .ct-msg-quote:hover { background: rgba(255,255,255,0.25); }
.ct-msg-quote-sender { font-weight: 700; font-size: 11px; margin-bottom: 1px; opacity: .85; }
.ct-msg-quote-text {
  font-size: 11px;
  opacity: .9;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

/* 답장 대상 강조 (원본 메시지로 스크롤했을 때 잠깐 깜빡임) */
.ct-msg-flash .ct-msg-bubble {
  animation: ct-msg-flash-anim 1.2s ease;
}
@keyframes ct-msg-flash-anim {
  0% { box-shadow: 0 0 0 0 rgba(99,102,241,0.6); }
  40% { box-shadow: 0 0 0 6px rgba(99,102,241,0.25); }
  100% { box-shadow: 0 0 0 0 rgba(99,102,241,0); }
}

/* 입력칸 위 답장 미리보기 */
.ct-reply-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #eef2ff;
  border-top: 1px solid #c7d2fe;
  border-bottom: 1px solid #c7d2fe;
}
.ct-reply-preview-bar {
  width: 3px;
  align-self: stretch;
  background: #6366F1;
  border-radius: 2px;
  flex-shrink: 0;
}
.ct-reply-preview-text {
  flex: 1;
  min-width: 0;
}
.ct-reply-preview-label {
  font-size: 11px;
  font-weight: 700;
  color: #4338ca;
  margin-bottom: 2px;
}
.ct-reply-preview-content {
  font-size: 12px;
  color: #475569;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ct-reply-preview-close {
  background: transparent;
  border: none;
  color: #6366F1;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.ct-reply-preview-close:hover { background: rgba(99,102,241,0.12); }

/* 안 읽음 배지 (내 메시지 우측 시간 옆) */
.ct-msg-unread {
  display: inline-block;
  background: #f59e0b;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 999px;
  margin-right: 4px;
  vertical-align: middle;
  line-height: 1.3;
}

/* 회수된 메시지 — 본문 가리고 회색 텍스트로 표시 */
.ct-msg.recalled .ct-msg-bubble {
  background: #f1f5f9 !important;
  color: #94a3b8 !important;
  border: 1px dashed #cbd5e1 !important;
}
.ct-msg.mine.recalled .ct-msg-bubble {
  background: #f1f5f9 !important;
  color: #94a3b8 !important;
}
.ct-msg-recalled-text {
  font-style: italic;
  font-size: 12px;
  color: #94a3b8;
}
.ct-msg.mine.recalled .ct-msg-time,
.ct-msg.recalled .ct-msg-time {
  color: #cbd5e1 !important;
}

/* ===== 메시지 입력 ===== */
.ct-compose {
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.ct-attach {
  background: transparent;
  border: none;
  font-size: 17px;
  padding: 4px 6px;
  cursor: pointer;
  color: #6366F1;
}
.ct-attach:hover { background: #eef2ff; border-radius: 6px; }
#ctMsgInput {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  font-size: 13px;
  background: #f8fafc;
  outline: none;
}
#ctMsgInput:focus { background: #fff; border-color: #6366F1; box-shadow: 0 0 0 3px rgba(99,102,241,0.12); }
.ct-send {
  background: #6366F1;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.ct-send:hover { background: #4f46e5; }
.ct-send:disabled { background: #c7d2fe; cursor: wait; }

/* ===== 하단 탭바 ===== */
.ct-tabbar {
  display: flex;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.ct-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  transition: color .12s;
  position: relative;
}
.ct-tab:hover { color: #6366F1; }
.ct-tab.active { color: #6366F1; }
.ct-tab.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 3px;
  background: #6366F1;
  border-radius: 0 0 3px 3px;
}
.ct-tab-icon { font-size: 18px; }
.ct-tab-badge {
  position: absolute;
  top: 6px;
  right: 50%;
  margin-right: -22px;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  line-height: 1;
}

/* ===== 신고 패널 — 기존 폼이 ct-pane 안에서 동작하도록 ===== */
#ctPaneReport { background: #fff; overflow-y: auto; }
#ctPaneReport .site-error-greeting { padding: 14px 18px; font-size: 13px; color: #475569; line-height: 1.6; border-bottom: 1px solid #f1f5f9; }
#ctPaneReport .site-error-greeting b { color: #1e293b; font-weight: 700; }
/* 신고 탭: 입력칸이 남는 공간을 채우게(팝업이 PC 화면 크기에 맞게 커지면 같이 커짐) */
#ctPaneReport .site-error-body { padding: 12px 18px 8px; flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
#ctPaneReport .site-error-editor { flex: 1 1 auto; min-height: 160px; max-height: none; }
#ctPaneReport.se-dragover .site-error-editor { border-color: #6366F1; background: #eef2ff; box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
/* 첨부 · 결과보기 · 신고보내기 한 줄 */
#ctPaneReport .site-error-footer { padding: 10px 18px 14px; display: flex; align-items: center; gap: 8px; border-top: 1px solid #f1f5f9; background: #fafbfc; }
#ctPaneReport .site-error-attach { flex: 0 0 auto; }
#ctPaneReport .site-error-submit { flex: 0 0 auto; }

@media (max-width: 480px) {
  .ct-popup { width: calc(100vw - 32px); right: -8px; height: 78vh; }
}

