/* ═══════════════════════════════════════════════════════════
   셀러메이트 - Cafe24 상품 자동화
   ═══════════════════════════════════════════════════════════ */

/* ─── Reset & Variables ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:   #4f46e5;
  --primary-h: #4338ca;
  --danger:    #ef4444;
  --danger-h:  #dc2626;
  --warning:   #f59e0b;
  --success:   #10b981;
  --gray-50:   #f9fafb;
  --gray-100:  #f3f4f6;
  --gray-200:  #e5e7eb;
  --gray-400:  #9ca3af;
  --gray-600:  #4b5563;
  --gray-800:  #1f2937;
  --white:     #ffffff;
  --sidebar-w: 220px;
  --header-h:  60px;
  --shadow:    0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --radius:    8px;
  --font:      'Pretendard', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
}

html, body { height: 100%; font-family: var(--font); font-size: 14px; color: var(--gray-800); background: var(--gray-100); }

/* ─── Layout ──────────────────────────────────────────────── */
body { display: flex; }

.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--gray-800);
  color: #d1d5db;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Sidebar ─────────────────────────────────────────────── */
.sidebar-logo {
  padding: 20px 16px;
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  border-bottom: 1px solid #374151;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-menu { list-style: none; padding: 12px 0; flex: 1; }

.menu-item {
  padding: 10px 16px;
  cursor: pointer;
  border-radius: 6px;
  margin: 2px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  transition: background .15s, color .15s;
}
.menu-item:hover    { background: #374151; color: var(--white); }
.menu-item.active   { background: var(--primary); color: var(--white); }
.menu-icon          { font-size: 16px; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid #374151;
}

.mall-id-badge {
  background: #374151;
  color: #9ca3af;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── 사이드바 내 모바일 연결 폼 (데스크톱에서 숨김) ──────── */
.sidebar-connect-form { display: none; }
@media (max-width: 767px) {
  .sidebar-connect-form {
    display: block;
    margin-top: 10px;
  }
  .sidebar-connect-form input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #4b5563;
    background: #374151;
    color: white;
    font-size: 13px;
    outline: none;
  }
  .sidebar-connect-form input::placeholder { color: #9ca3af; }
  .sidebar-connect-form input:focus { border-color: var(--primary); }
}

/* ─── Top Header ──────────────────────────────────────────── */
.top-header {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 50;
}

.top-header h1 { font-size: 18px; font-weight: 600; }

.header-actions { display: flex; gap: 8px; align-items: center; }
.header-actions input {
  padding: 7px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 13px;
  width: 200px;
  outline: none;
}
.header-actions input:focus { border-color: var(--primary); }

/* ─── Tab Content ─────────────────────────────────────────── */
.tab-content { display: none; padding: 24px; flex: 1; }
.tab-content.active { display: block; }

/* ─── Card ────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin-bottom: 20px;
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, opacity .15s, transform .1s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.btn:active     { transform: scale(.97); }
.btn:disabled   { opacity: .5; cursor: not-allowed; }

.btn-primary  { background: var(--primary);  color: #fff; }
.btn-primary:hover   { background: var(--primary-h); }
.btn-danger   { background: var(--danger);   color: #fff; }
.btn-danger:hover    { background: var(--danger-h); }
.btn-warning  { background: var(--warning);  color: #fff; }
.btn-warning:hover   { background: #d97706; }
.btn-secondary { background: var(--gray-200); color: var(--gray-800); }
.btn-secondary:hover { background: var(--gray-200); filter: brightness(.95); }
.btn-outline  {
  background: var(--white);
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
}
.btn-outline:hover { background: var(--gray-50); }

.btn-sm  { padding: 5px 10px; font-size: 12px; }
.btn-lg  { padding: 10px 20px; font-size: 14px; }

/* ─── Table ───────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th,
.data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--gray-100);
  white-space: nowrap;
}
.data-table th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-600);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.data-table tbody tr:hover { background: var(--gray-50); }
.data-table tbody tr:last-child td { border-bottom: none; }

.empty-row { text-align: center; color: var(--gray-400); padding: 32px !important; }

/* ─── Search Bar ──────────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.search-bar input {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}
.search-bar input:focus { border-color: var(--primary); }

/* ─── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 0 4px;
}
#page-info { font-size: 13px; color: var(--gray-600); }

/* ─── Badge ───────────────────────────────────────────────── */
.badge {
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}
.badge-success { background: var(--success); }
.badge-warning { background: var(--warning); }
.badge-danger  { background: var(--danger); }
.badge-gray    { background: var(--gray-400); }

/* ─── Option Groups ───────────────────────────────────────── */
.option-group-item {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.option-group-item input[type="text"] {
  padding: 7px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}
.option-group-item input[type="text"]:focus { border-color: var(--primary); }
.option-group-name  { width: 150px; font-weight: 500; }
.option-group-values { flex: 1; min-width: 200px; }
.option-group-label { font-size: 12px; color: var(--gray-600); margin-bottom: 4px; }
.btn-remove-group {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 18px;
  padding: 0 4px;
  line-height: 1;
}

/* ─── Combinations Table ──────────────────────────────────── */
#combo-table input[type="number"] {
  width: 100px;
  padding: 5px 8px;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  font-size: 12px;
}

/* ─── Apply Section ───────────────────────────────────────── */
.apply-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-100);
}
.apply-section h3 { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.apply-mode-tabs { display: flex; gap: 16px; margin-bottom: 10px; }
.apply-mode-tabs label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; }
#apply-product-nos {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 13px;
  margin-top: 8px;
  outline: none;
}

/* ─── Bulk Form ───────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--gray-600); }
.form-group select,
.form-group input[type="number"],
.form-group input[type="text"],
.form-group input[type="datetime-local"]{
  padding: 8px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  min-width: 180px;
  background: white;
  color: var(--gray-700);
}
.form-group select:focus,
.form-group input:focus { border-color: var(--primary); }

/* datetime-local 캘린더 아이콘만 앱 색상으로 */
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-size: 14px 14px;
  background-repeat: no-repeat;
  background-position: center;
  width: 18px;
  height: 18px;
  cursor: pointer;
  opacity: .65;
  transition: opacity .15s;
}
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }

.form-row { display: flex; gap: 20px; flex-wrap: wrap; }

.input-with-suffix { display: flex; align-items: center; gap: 0; }
.input-with-suffix input { border-radius: 6px 0 0 6px; }
.input-with-suffix span {
  padding: 8px 10px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-left: none;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  color: var(--gray-600);
}

.radio-group { display: flex; gap: 12px; flex-wrap: wrap; }
.radio-card {
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color .15s, background .15s;
  min-width: 160px;
}
.radio-card:hover   { border-color: var(--primary); background: #eef2ff; }
.radio-card input[type="radio"] { accent-color: var(--primary); }
.radio-content { display: flex; flex-direction: column; gap: 2px; }
.radio-content strong { font-size: 13px; }
.radio-content small  { color: var(--gray-400); font-size: 11px; }

.sub-form { padding: 16px; background: var(--gray-50); border-radius: var(--radius); margin-top: 4px; }

.preview-box {
  margin-top: 10px;
  padding: 10px 14px;
  background: #fef9c3;
  border: 1px solid #fde047;
  border-radius: 6px;
  font-size: 12px;
  color: #78350f;
}

.hint { font-size: 11px; color: var(--gray-400); display: block; margin-top: 4px; }

/* ─── Template Grid ───────────────────────────────────────── */
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }

.template-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  position: relative;
}
.template-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.template-card h4 { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.template-card .template-options { font-size: 12px; color: var(--gray-600); line-height: 1.6; }
.template-card .btn-delete-template {
  position: absolute;
  top: 8px; right: 8px;
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px;
}
.template-card .btn-delete-template:hover { color: var(--danger); }

.empty-state {
  text-align: center;
  padding: 32px;
  color: var(--gray-400);
  font-size: 14px;
}

/* ─── Jobs Table ──────────────────────────────────────────── */
.jobs-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.jobs-header .card-title { margin-bottom: 0; }
.jobs-filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.jobs-filter select {
  padding: 6px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}

.auto-refresh-label { display: flex; align-items: center; gap: 4px; font-size: 12px; cursor: pointer; color: var(--gray-600); }

/* Progress Bar */
.progress-bar-wrap {
  background: var(--gray-200);
  border-radius: 10px;
  height: 8px;
  overflow: hidden;
  width: 120px;
  display: inline-block;
  vertical-align: middle;
}
.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 10px;
  transition: width .3s;
}
.progress-bar.completed { background: var(--success); }
.progress-bar.failed    { background: var(--danger); }

/* Status Badge */
.status-badge {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.status-pending    { background: #e5e7eb; color: #374151; }
.status-processing { background: #dbeafe; color: #1d4ed8; }
.status-completed  { background: #d1fae5; color: #065f46; }
.status-failed     { background: #fee2e2; color: #991b1b; }

/* ─── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 24px;
  min-width: 360px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.modal h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ─── Toast ───────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--gray-800);
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: var(--shadow-md);
  animation: slideIn .25s ease;
  max-width: 320px;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.warning { background: var(--warning); color: #1c1917; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── Checkbox ────────────────────────────────────────────── */
input[type="checkbox"] { accent-color: var(--primary); width: 15px; height: 15px; cursor: pointer; }

/* ─── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ─── Plan Badge (사이드바 플랜 표시) ─────────────────────── */
.plan-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  padding: 3px 8px;
  border-radius: 10px;
  margin-bottom: 4px;
  text-align: center;
}
.plan-free     { background: var(--gray-200); color: var(--gray-600); }
.plan-pro      { background: #dbeafe; color: #1d4ed8; }
.plan-business { background: #ede9fe; color: #6d28d9; }
.plan-trial    { background: #dcfce7; color: #15803d; }

/* ─── Plan Lock icon ──────────────────────────────────────── */
.plan-lock { font-size: 11px; margin-left: auto; opacity: .7; }

/* ─── Upgrade Modal ───────────────────────────────────────── */
.upgrade-plan-card {
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  position: relative;
  transition: border-color .2s;
}
.upgrade-plan-card.highlight {
  border-color: var(--primary);
  background: #f0f7ff;
}
.upgrade-plan-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 10px;
}
.upgrade-plan-name  { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.upgrade-plan-price { font-size: 16px; font-weight: 800; color: var(--primary); margin-bottom: 10px; }
.upgrade-plan-price small { font-size: 11px; font-weight: 400; color: var(--gray-500); }
.upgrade-plan-features {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 12px;
  text-align: left;
  line-height: 1.8;
}

/* ─── 전역: 가로 오버플로 차단 ───────────────────────────── */
html, body { max-width: 100%; overflow-x: hidden; }
.main-content { max-width: 100%; overflow-x: hidden; }
/* 테이블은 wrapper 안에서만 스크롤 */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ═══════════════════════════════════════════════════════════
   모바일 반응형 (≤767px) - 햄버거 메뉴 + 360px 지원
   ═══════════════════════════════════════════════════════════ */

/* ─── 햄버거 버튼 (데스크톱 숨김) ─────────────────────────── */
.btn-hamburger {
  display: none;                  /* 데스크톱: 숨김 */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;                    /* 터치 영역 충분히 확보 */
  height: 44px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  z-index: 60;                    /* 헤더(50)보다 위 */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: #374151;            /* var() 대신 직접 값 — 상속 문제 방지 */
  transition: transform .25s, opacity .25s;
  pointer-events: none;           /* 클릭 이벤트 버튼으로만 */
}

/* 열렸을 때 X 모양 */
body.sidebar-open .btn-hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.sidebar-open .btn-hamburger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
body.sidebar-open .btn-hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── 사이드바 오버레이 (모바일용 딤처리) ───────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 140;
  opacity: 0;
  transition: opacity .25s;
}
body.sidebar-open .sidebar-overlay {
  display: block;
  opacity: 1;
}

/* ─── 모바일 미디어쿼리 ────────────────────────────────────── */
@media (max-width: 767px) {

  /* 사이드바: 기본 오프스크린, 열리면 슬라이드인 */
  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
    transition: transform .25s ease;
    z-index: 150;
  }
  body.sidebar-open .sidebar { transform: translateX(0); }

  /* 메인 콘텐츠: 사이드바 공간 없애기 */
  .main-content { margin-left: 0; }

  /* 햄버거 버튼 표시 */
  .btn-hamburger { display: flex; }

  /* ── 헤더 레이아웃 재구성 ─────────────────────────────────
     [☰ 44px] [h1 고정] [빈공간 flex:1] [mall 뱃지]
     h1에 flex:1 주면 버튼 터치 영역 침범 → flex:1 제거
  ──────────────────────────────────────────────────────── */
  .top-header {
    padding: 0 10px;
    gap: 0;
    justify-content: flex-start;  /* space-between → flex-start */
  }
  .top-header h1 {
    font-size: 15px;
    flex: none;                   /* flex:1 제거 → 버튼 영역 침범 방지 */
    margin-left: 4px;
    white-space: nowrap;
  }
  /* 헤더 액션을 오른쪽 끝으로 밀기 */
  .header-actions {
    margin-left: auto;
    gap: 6px;
  }

  /* 모바일에서 연결폼 숨기고 연결된 mall 뱃지만 표시 */
  #mall-id-input { display: none; }
  #btn-connect   { display: none; }
  #mall-id-display {
    display: inline-block !important;
    font-size: 11px;
    padding: 4px 8px;
  }

  /* 카드 패딩 축소 */
  .card { padding: 14px; }

  /* 테이블: min-width 제거 → wrapper 안에서만 스크롤 */
  .data-table { min-width: 0; width: max-content; }
  .data-table th, .data-table td { padding: 8px 8px; font-size: 11px; white-space: nowrap; }

  /* 폼 행: 세로 쌓기 */
  .form-row { flex-direction: column; gap: 12px; }

  /* 라디오 카드 그룹: 2열 */
  .radio-group { grid-template-columns: 1fr 1fr; }

  /* 버튼 그룹: 세로 쌓기 */
  .card-actions { flex-direction: column; }
  .card-actions .btn { width: 100%; justify-content: center; }

  /* 서브폼 패딩 */
  .sub-form { padding: 14px; }

  /* 검색바 */
  .search-bar { flex-wrap: wrap; }
  .search-bar input { flex: 1; min-width: 0; }

  /* 페이지네이션 */
  .pagination { gap: 8px; }

  /* jobs 헤더 세로 쌓기 */
  .jobs-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .jobs-filter { flex-wrap: wrap; gap: 8px; width: 100%; }
  .jobs-filter select { flex: 1; min-width: 0; }

  /* 업그레이드 모달: 플랜 카드 세로 쌓기 */
  .modal { margin: 12px; padding: 20px 16px; }
  #modal-upgrade .modal > div[style*="grid"] {
    grid-template-columns: 1fr !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   선택 상품 전역 공유 UI - 칩 / 드롭다운 / 배너
   ═══════════════════════════════════════════════════════════ */

/* ─── 선택 칩 (헤더 상시 표시) ────────────────────────────── */
.selection-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  user-select: none;
  transition: background .15s;
}
.selection-chip:hover { background: var(--primary-h); }
.chip-clear {
  background: rgba(255,255,255,.25);
  border: none;
  color: white;
  border-radius: 50%;
  width: 17px;
  height: 17px;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  line-height: 1;
  transition: background .15s;
}
.chip-clear:hover { background: rgba(255,255,255,.45); }

/* ─── 선택 드롭다운 (칩 클릭 시 상품 목록) ─────────────────── */
.selection-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 260px;
  max-width: 340px;
  max-height: 280px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 200;
}
.selection-dropdown-list {
  overflow-y: auto;
  flex: 1;
}
.selection-dropdown-item {
  padding: 7px 14px;
  font-size: 12px;
  color: var(--gray-700);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.selection-dropdown-item:hover { background: var(--gray-50); }
.selection-dropdown-item .item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.selection-dropdown-item .item-no {
  color: var(--gray-400);
  font-size: 11px;
  flex-shrink: 0;
}
.selection-dropdown-footer {
  border-top: 1px solid var(--gray-100);
  padding: 8px 14px;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.selection-dropdown-header {
  padding: 8px 14px 6px;
  font-size: 11px;
  color: var(--gray-500);
  font-weight: 600;
  border-bottom: 1px solid var(--gray-100);
  flex-shrink: 0;
}

/* ─── 선택 배너 (각 탭 상단) ──────────────────────────────── */
.selection-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #1e40af;
}
.banner-icon { font-size: 15px; flex-shrink: 0; }
.banner-text { flex: 1; line-height: 1.4; }
.banner-text strong { font-weight: 700; }
.banner-goto {
  font-size: 11px;
  color: #3b82f6;
  cursor: pointer;
  text-decoration: underline;
  white-space: nowrap;
  background: none;
  border: none;
  padding: 0;
}
.banner-apply {
  background: var(--primary);
  color: white;
  border: none;
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.banner-apply:hover { background: var(--primary-h); }
.banner-dismiss {
  background: none;
  border: none;
  color: #93c5fd;
  font-size: 15px;
  cursor: pointer;
  padding: 0 2px;
  flex-shrink: 0;
  transition: color .15s;
}
.banner-dismiss:hover { color: #1e40af; }

@media (max-width: 767px) {
  .selection-banner { flex-wrap: wrap; }
  .banner-apply { width: 100%; text-align: center; justify-content: center; }
  .selection-chip { font-size: 11px; padding: 4px 8px 4px 10px; }
  .selection-dropdown { left: auto; right: 0; transform: none; min-width: 220px; }
}


/* ─── 무료 플랜 일괄수정 쿼터 뱃지 ───────────────────────────── */
.bulk-quota-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(255,255,255,.18);
  color: #d1fae5;
  margin-left: auto;
}
.bulk-quota-badge.quota-full {
  background: rgba(239,68,68,.25);
  color: #fca5a5;
}
