/**
 * ProTalk Admin Panel CSS — admin.css
 * v1.1 (2026-07-29)
 * [v1.1] 모바일 터치 영역 최적화 + touch-action 설정
 */

/* ── 로그인 모달 ────────────────────────── */
#admin-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 99000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.adm-login-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
}
.adm-login-card {
  position: relative;
  background: #fff;
  border-radius: 20px;
  width: min(360px, 92vw);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.adm-login-header {
  background: linear-gradient(135deg, #1E3A5F, #2D4E7A);
  padding: 28px 24px 20px;
  text-align: center;
  color: #fff;
}
.adm-login-icon {
  font-size: 36px;
  margin-bottom: 8px;
  color: #93C5FD;
}
.adm-login-title { font-size: 20px; font-weight: 900; }
.adm-login-sub   { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 4px; }
.adm-login-body  { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.adm-field { display: flex; flex-direction: column; gap: 5px; }
.adm-field label { font-size: 12px; font-weight: 700; color: #374151; }
.adm-field input {
  padding: 11px 14px;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}
.adm-field input:focus { border-color: #7C3AED; }
.adm-pw-wrap { position: relative; }
.adm-pw-wrap input { width: 100%; box-sizing: border-box; padding-right: 44px; }
.adm-pw-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  border: none; background: none; cursor: pointer; color: #9CA3AF; font-size: 14px; padding: 4px;
}
.adm-login-err {
  background: #FEF2F2; border: 1px solid #FECACA;
  color: #EF4444; border-radius: 8px; padding: 8px 12px; font-size: 12px; font-weight: 600;
}
.adm-login-btn {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, #1E3A5F, #2563EB);
  color: #fff; border: none; border-radius: 12px;
  font-size: 15px; font-weight: 800; cursor: pointer; font-family: inherit;
  box-shadow: 0 4px 12px rgba(37,99,235,0.35);
  /* [v1.1] 모바일 터치 즉시 반응 */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .15s;
}
.adm-login-btn:active { opacity: .85; }
.adm-login-close {
  position: absolute; top: 12px; right: 12px;
  width: 28px; height: 28px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.2); color: #fff; font-size: 12px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}

/* ── 관리자 패널 ─────────────────────────── */
#admin-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 99000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0,0,0,0.5);
}
.adm-panel {
  width: 100%;
  max-width: 600px;
  max-height: 94dvh;
  background: #fff;
  border-radius: 24px 24px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.25);
}
.adm-panel-header {
  background: linear-gradient(135deg, #1E3A5F, #2D4E7A);
  padding: 16px 18px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.adm-panel-logo {
  font-size: 18px; font-weight: 900; color: #fff;
  display: flex; align-items: center; gap: 8px;
}
.adm-panel-logo span { color: #93C5FD; }
.adm-panel-logo i { color: #FCD34D; }
.adm-panel-header-right { display: flex; align-items: center; gap: 8px; }
.adm-panel-badge {
  background: rgba(255,255,255,0.2); color: #fff;
  font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 20px;
  letter-spacing: 0.5px;
}
.adm-panel-close {
  width: 30px; height: 30px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.2); color: #fff; font-size: 13px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
/* 탭 */
.adm-tabs {
  display: flex;
  background: #F8FAFC;
  border-bottom: 2px solid #E5E7EB;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.adm-tabs::-webkit-scrollbar { display: none; }
.adm-tab {
  flex: 1; min-width: 70px; padding: 11px 6px;
  border: none; background: none; cursor: pointer;
  font-size: 11px; font-weight: 700; color: #9CA3AF;
  font-family: inherit; display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: color .15s, border-color .15s;
  border-bottom: 2.5px solid transparent; margin-bottom: -2px;
  /* [v1.1] 모바일 터치 즉시 반응 */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  min-height: 44px; /* iOS 권장 최소 터치 영역 */
}
.adm-tab i { font-size: 14px; }
.adm-tab.active { color: #1E3A5F; border-color: #1E3A5F; }
/* 본문 */
.adm-panel-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── 통계 카드 ───────────────────────────── */
.adm-stats-row {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 8px;
}
.adm-stat-card {
  border-radius: 14px; padding: 12px 8px;
  text-align: center; display: flex; flex-direction: column; gap: 3px;
}
.adm-stat-total { background: linear-gradient(135deg,#EFF6FF,#DBEAFE); }
.adm-stat-free  { background: linear-gradient(135deg,#F0FDF4,#DCFCE7); }
.adm-stat-pro   { background: linear-gradient(135deg,#F5F3FF,#EDE9FE); }
.adm-stat-prem  { background: linear-gradient(135deg,#FFFBEB,#FEF3C7); }
.adm-stat-num { font-size: 22px; font-weight: 900; color: #1F2937; }
.adm-stat-label { font-size: 10px; font-weight: 700; color: #6B7280; }

/* ── 검색 바 ────────────────────────────── */
.adm-search-bar {
  display: flex; align-items: center; gap: 8px;
  background: #F9FAFB; border: 1.5px solid #E5E7EB; border-radius: 12px;
  padding: 9px 12px;
}
.adm-search-bar i { color: #9CA3AF; }
.adm-search-bar input {
  flex:1; border:none; background:none; outline:none;
  font-size:13px; color:#374151; font-family:inherit;
}
.adm-add-user-btn {
  padding: 7px 12px; border-radius: 20px; border: none;
  background: linear-gradient(135deg,#2563EB,#3B82F6);
  color: #fff; font-size: 11px; font-weight: 700; cursor: pointer;
  font-family: inherit; white-space: nowrap;
  display: flex; align-items: center; gap: 5px;
}

/* ── 회원 목록 ───────────────────────────── */
.adm-user-list { display: flex; flex-direction: column; gap: 8px; }
.adm-user-row {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid #F1F5F9;
  border-radius: 14px; padding: 10px 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.adm-user-blocked { opacity: 0.6; background: #FFF5F5; border-color: #FECACA; }
.adm-user-avatar {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg,#7C3AED,#9333EA);
  color: #fff; font-size: 16px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
}
.adm-user-info { flex: 1; min-width: 0; }
.adm-user-name { font-size: 14px; font-weight: 800; color: #1F2937; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.adm-user-email { font-size: 11px; color: #9CA3AF; margin-top: 1px; }
.adm-user-sub { display: flex; gap: 10px; margin-top: 3px; flex-wrap: wrap; }
.adm-user-sub span { font-size: 11px; color: #6B7280; display: flex; align-items: center; gap: 3px; }
.adm-user-actions { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.adm-action-btn {
  width: 28px; height: 28px; border-radius: 8px; border: none;
  background: #F3F4F6; color: #6B7280; font-size: 11px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s;
}
.adm-action-btn:hover { background: #E9D5FF; color: #7C3AED; }
.adm-btn-block:hover  { background: #FEE2E2; color: #EF4444; }
.adm-btn-unblock:hover{ background: #D1FAE5; color: #059669; }
.adm-btn-del:hover    { background: #FEE2E2; color: #DC2626; }

/* 뱃지 */
.adm-badge {
  font-size: 9px; font-weight: 800; padding: 2px 6px;
  border-radius: 6px; letter-spacing: 0.3px;
}
.adm-badge-free  { background: #F3F4F6; color: #6B7280; }
.adm-badge-pro   { background: #EDE9FE; color: #6D28D9; }
.adm-badge-prem  { background: #FEF3C7; color: #92400E; }

/* 회원 수 */
.adm-user-count {
  text-align: right; font-size: 11px; color: #9CA3AF; font-weight: 600;
}

/* ── 플랜 탭 ────────────────────────────── */
.adm-plan-header {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 8px;
}
.adm-plan-stat {
  background: #F9FAFB; border-radius: 14px; padding: 14px 8px;
  text-align: center; border: 1.5px solid #E5E7EB;
}
.adm-plan-stat span { display: block; font-size: 28px; font-weight: 900; color: #1F2937; }
.adm-plan-stat { font-size: 11px; font-weight: 700; color: #6B7280; }
.adm-plan-pro span  { color: #7C3AED; }
.adm-plan-prem span { color: #D97706; }
.adm-plan-cards { display: flex; gap: 10px; flex-wrap: wrap; }
.adm-plan-card {
  flex: 1; min-width: 140px; border-radius: 16px; border: 1.5px solid #E5E7EB;
  overflow: hidden; background: #fff;
}
.adm-plan-card-top { padding: 14px 12px; }
.adm-plan-card-name { font-size: 16px; font-weight: 900; color: #fff; }
.adm-plan-card-price { font-size: 12px; color: rgba(255,255,255,0.8); margin-top: 2px; }
.adm-plan-card-desc { font-size: 11px; color: #6B7280; padding: 10px 12px 4px; }
.adm-plan-card-count { font-size: 12px; font-weight: 800; color: #374151; padding: 0 12px 8px; }
.adm-plan-bulk-btn {
  width: calc(100% - 16px); margin: 0 8px 10px;
  padding: 8px; border-radius: 10px; border: none;
  background: #F3F4F6; color: #374151; font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.adm-plan-bulk-btn:hover { background: #EDE9FE; color: #7C3AED; }
.adm-plan-user-list { display: flex; flex-direction: column; gap: 6px; }
.adm-plan-user-row {
  display: flex; align-items: center; gap: 10px;
  background: #F9FAFB; border-radius: 12px; padding: 8px 12px;
}
.adm-plan-downgrade-btn {
  font-size: 10px; padding: 5px 10px; height: auto;
  width: auto; white-space: nowrap; border-radius: 8px;
  border: 1px solid #E5E7EB; background: #F9FAFB; color: #6B7280; gap: 4px;
}

/* ── 포인트 탭 ───────────────────────────── */
.adm-points-settings,
.adm-bulk-points,
.adm-app-settings { display: flex; flex-direction: column; gap: 10px; }
.adm-points-row {
  display: flex; align-items: center; gap: 10px;
}
.adm-points-row label { font-size: 13px; font-weight: 700; color: #374151; min-width: 140px; }
.adm-points-row input,
.adm-points-row select {
  flex: 1; padding: 9px 12px; border: 1.5px solid #E5E7EB; border-radius: 10px;
  font-size: 13px; font-family: inherit; outline: none; min-width: 0;
}
.adm-points-row input:focus,
.adm-points-row select:focus { border-color: #7C3AED; }
.adm-points-input-wrap { display: flex; align-items: center; gap: 6px; }
.adm-points-input-wrap span { font-size: 13px; font-weight: 700; color: #7C3AED; }
.adm-save-settings-btn {
  padding: 11px 20px; border-radius: 12px; border: none;
  background: linear-gradient(135deg,#1E3A5F,#2563EB);
  color: #fff; font-size: 14px; font-weight: 800; cursor: pointer;
  font-family: inherit; align-self: flex-start;
  display: flex; align-items: center; gap: 7px;
  box-shadow: 0 3px 10px rgba(37,99,235,0.3);
}
.adm-points-history { display: flex; flex-direction: column; gap: 6px; }
.adm-history-row {
  display: flex; align-items: flex-start; gap: 10px;
  background: #F9FAFB; border-radius: 10px; padding: 10px 12px;
}
.adm-history-icon {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg,#FEF3C7,#FDE68A);
  color: #D97706; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.adm-history-desc { font-size: 13px; font-weight: 600; color: #1F2937; }
.adm-history-date { font-size: 11px; color: #9CA3AF; margin-top: 2px; }

/* ── 앱 설정 탭 ─────────────────────────── */
.adm-setting-row {
  display: flex; align-items: center; gap: 10px;
}
.adm-setting-row label { font-size: 13px; font-weight: 700; color: #374151; min-width: 120px; }
.adm-setting-row input[type=text],
.adm-setting-row textarea {
  flex: 1; padding: 9px 12px; border: 1.5px solid #E5E7EB; border-radius: 10px;
  font-size: 13px; font-family: inherit; outline: none; resize: none;
}
.adm-setting-row input:focus,
.adm-setting-row textarea:focus { border-color: #7C3AED; }
/* 토글 */
.adm-toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.adm-toggle input { opacity: 0; width: 0; height: 0; }
.adm-toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #E5E7EB; border-radius: 12px; transition: background .2s;
}
.adm-toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; border-radius: 50%;
  left: 3px; top: 3px; background: #fff;
  transition: transform .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.adm-toggle input:checked + .adm-toggle-slider { background: #7C3AED; }
.adm-toggle input:checked + .adm-toggle-slider::before { transform: translateX(20px); }
.adm-data-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.adm-data-btn {
  padding: 9px 16px; border-radius: 10px; border: 1.5px solid #E5E7EB;
  background: #F9FAFB; color: #374151; font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  display: flex; align-items: center; gap: 6px;
}
.adm-danger-btn { border-color: #FCA5A5; background: #FEF2F2; color: #DC2626; }

/* ── 미니 모달 ───────────────────────────── */
.adm-mini-modal-overlay {
  position: fixed; inset: 0; z-index: 99100;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
}
.adm-mini-modal {
  background: #fff; border-radius: 20px;
  width: min(340px,92vw); padding: 24px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.adm-mini-modal-title {
  font-size: 16px; font-weight: 900; color: #1F2937;
  display: flex; align-items: center; gap: 8px;
}
.adm-mini-field {
  display: flex; align-items: center; gap: 10px;
}
.adm-mini-field label { font-size: 12px; font-weight: 700; color: #374151; min-width: 60px; }
.adm-plan-select-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.adm-plan-sel-btn {
  padding: 10px 18px; border-radius: 10px; border: 1.5px solid #E5E7EB;
  background: #F9FAFB; color: #374151; font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.adm-plan-sel-btn.active { background: #1A1A1A; color: #fff; border-color: #1A1A1A; }
.adm-mini-modal-btns { display: flex; gap: 8px; justify-content: flex-end; }
.adm-mini-cancel {
  padding: 9px 18px; border-radius: 10px; border: 1.5px solid #E5E7EB;
  background: #F9FAFB; color: #6B7280; font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.adm-mini-confirm {
  padding: 9px 18px; border-radius: 10px; border: none;
  font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit;
}

/* ── 섹션 타이틀 ─────────────────────────── */
.adm-section-title {
  font-size: 13px; font-weight: 800; color: #1E3A5F;
  display: flex; align-items: center; gap: 6px;
  padding-bottom: 6px; border-bottom: 2px solid #EFF6FF;
}

/* ── 빈 상태 ─────────────────────────────── */
.adm-empty {
  text-align: center; padding: 28px; color: #9CA3AF;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.adm-empty i { font-size: 30px; }
.adm-empty p { font-size: 13px; }

/* ── 토스트 ──────────────────────────────── */
.adm-toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #1F2937; color: #fff;
  padding: 10px 20px; border-radius: 24px;
  font-size: 13px; font-weight: 700;
  opacity: 0; transition: opacity .25s, transform .25s;
  z-index: 99999; white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  pointer-events: none;
}
.adm-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
