/*
 * 보상히어로 테마 시스템
 * Big Tech 스타일 (Linear, Stripe, Vercel 참고)
 * 전문직(손해사정사)에 맞는 깔끔하고 신뢰감 있는 디자인
 */

/* Pretendard 모던 글립 + 숫자 사선 0 — 빅테크 트렌드 */
body {
  font-feature-settings: 'ss03', 'cv11';
  font-variant-numeric: slashed-zero;
}

:root {
  /* ===== 기본 배경 색상 (따뜻한 화이트 기반) ===== */
  --bg-primary: #ffffff;
  --bg-secondary: #F7F8FA;
  --bg-tertiary: #EEF0F3;
  --bg-card: #ffffff;
  --bg-hover: rgba(0, 0, 0, 0.04);
  --bg-active: rgba(0, 0, 0, 0.08);

  /* ===== 텍스트 색상 (Neutral 기반) ===== */
  --text-primary: #171717;
  --text-secondary: #525252;
  --text-tertiary: #737373;
  --text-muted: #a3a3a3;
  --text-inverse: #ffffff;

  /* ===== 테두리 색상 (섬세한 라인) ===== */
  --border-primary: rgba(0, 0, 0, 0.08);
  --border-secondary: rgba(0, 0, 0, 0.04);
  --border-strong: rgba(0, 0, 0, 0.12);

  /* ===== 액센트 색상 (밝은 블루 기반, 친근한 B2B 톤) ===== */
  --accent-primary: #1A7CFD;
  --accent-primary-hover: #0E6AE8;
  --accent-secondary: #0052CC;
  --accent-light: rgba(26, 124, 253, 0.1);
  --accent-ring: rgba(26, 124, 253, 0.4);

  /* ===== CTA (Pill 버튼 주 액션용 — 성공/주목 강조) ===== */
  --cta-primary: #00BC90;
  --cta-primary-hover: #00A47E;
  --cta-primary-bg: rgba(0, 188, 144, 0.1);
  --cta-accent: #FFE03C;
  --cta-accent-hover: #FFD700;

  /* ===== 사이드바 (라이트 — 토스/로톡/결제선생 한국 B2B 표준) ===== */
  --sidebar-bg: #ffffff;
  --sidebar-border: rgba(0, 0, 0, 0.06);
  --sidebar-text: #171717;
  --sidebar-text-muted: #737373;
  --sidebar-hover: rgba(0, 0, 0, 0.04);
  --sidebar-active: rgba(26, 124, 253, 0.08);

  /* ===== 컴포넌트 색상 ===== */
  --input-bg: #ffffff;
  --input-border: rgba(0, 0, 0, 0.12);
  --input-focus-ring: var(--accent-ring);
  --input-focus-border: var(--accent-primary);

  --button-primary-bg: var(--accent-primary);
  --button-primary-text: #ffffff;
  --button-primary-hover: var(--accent-primary-hover);

  --button-secondary-bg: #f5f5f5;
  --button-secondary-text: #525252;
  --button-secondary-hover: #e5e5e5;

  /* ===== 모달/오버레이 ===== */
  --modal-bg: #ffffff;
  --modal-overlay: rgba(0, 0, 0, 0.5);

  /* ===== 그림자 시스템 ===== */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* ===== 상태 색상 ===== */
  --status-pending-bg: rgba(251, 191, 36, 0.1);
  --status-pending-text: #d97706;
  --status-pending-border: rgba(251, 191, 36, 0.3);

  --status-success-bg: rgba(16, 185, 129, 0.1);
  --status-success-text: #059669;
  --status-success-border: rgba(16, 185, 129, 0.3);

  --status-error-bg: rgba(244, 63, 94, 0.1);
  --status-error-text: #e11d48;
  --status-error-border: rgba(244, 63, 94, 0.3);

  --status-info-bg: rgba(14, 165, 233, 0.1);
  --status-info-text: #0284c7;
  --status-info-border: rgba(14, 165, 233, 0.3);

  /* ===== Foundation 2차 — 신규 토큰 ===== */

  /* 긴급도 (사건/상담 시급성 표현) */
  --urgency-critical: #dc2626;     /* 3시간 이내 응답 필요 (빨강) */
  --urgency-critical-bg: rgba(220, 38, 38, 0.1);
  --urgency-high: #ea580c;         /* 1일 이내 (주황) */
  --urgency-high-bg: rgba(234, 88, 12, 0.1);
  --urgency-normal: #64748b;       /* 일반 (슬레이트) */
  --urgency-normal-bg: rgba(100, 116, 139, 0.08);

  /* Elevation (쿨 언더톤 — 차분하고 신뢰감 있는 그림자) */
  --elevation-1: 0 1px 2px rgba(15, 23, 42, 0.04);
  --elevation-2: 0 1px 4px rgba(15, 23, 42, 0.06), 0 0 1px rgba(15, 23, 42, 0.04);
  --elevation-3: 0 4px 12px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.06);
  --elevation-4: 0 8px 24px rgba(15, 23, 42, 0.12), 0 2px 4px rgba(15, 23, 42, 0.06);
  --elevation-5: 0 16px 48px rgba(15, 23, 42, 0.16), 0 4px 8px rgba(15, 23, 42, 0.08);

  /* Motion (모션 토큰) */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);        /* 진입 애니메이션 */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);     /* 상태 전환 */
  --ease-snap: cubic-bezier(0.34, 1.56, 0.64, 1);    /* 탭 피드백 (살짝 튕김) */
  --duration-instant: 100ms;
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
  --duration-slower: 600ms;

  /* Spacing (4px 그리드) */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Container widths (반응형 컨테이너) */
  --container-narrow: 720px;   /* 폼, 읽기 중심 */
  --container-base: 1000px;    /* 일반 페이지 */
  --container-wide: 1280px;    /* 대시보드, 테이블 */
  --container-full: 100%;

  /* Radius (라운드) */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-2xl: 28px;
  --radius-full: 9999px;
}

/* ===== 다크 모드 (진한 Neutral 기반) ===== */
.dark {
  /* ===== 배경 색상 ===== */
  --bg-primary: #0a0a0a;
  --bg-secondary: #171717;
  --bg-tertiary: #262626;
  --bg-card: #171717;
  --bg-hover: rgba(255, 255, 255, 0.06);
  --bg-active: rgba(255, 255, 255, 0.1);

  /* ===== 텍스트 색상 ===== */
  --text-primary: #fafafa;
  --text-secondary: #d4d4d4;
  --text-tertiary: #a3a3a3;
  --text-muted: #737373;
  --text-inverse: #171717;

  /* ===== 테두리 색상 ===== */
  --border-primary: rgba(255, 255, 255, 0.08);
  --border-secondary: rgba(255, 255, 255, 0.04);
  --border-strong: rgba(255, 255, 255, 0.12);

  /* ===== 액센트 색상 (다크 모드 — 밝은 블루) ===== */
  --accent-primary: #4C9FFF;
  --accent-primary-hover: #6BB0FF;
  --accent-secondary: #1A7CFD;
  --accent-light: rgba(76, 159, 255, 0.15);
  --accent-ring: rgba(76, 159, 255, 0.5);

  /* ===== CTA (다크 모드) ===== */
  --cta-primary: #10CC9D;
  --cta-primary-hover: #2BDCAE;
  --cta-primary-bg: rgba(16, 204, 157, 0.15);
  --cta-accent: #FFE961;
  --cta-accent-hover: #FFEC7B;

  /* ===== 사이드바 (다크 모드) ===== */
  --sidebar-bg: #0f172a;
  --sidebar-border: #1e293b;
  --sidebar-text: #cbd5e1;
  --sidebar-text-muted: #475569;
  --sidebar-hover: rgba(255,255,255,0.08);
  --sidebar-active: rgba(255,255,255,0.12);

  /* ===== 컴포넌트 색상 ===== */
  --input-bg: #262626;
  --input-border: rgba(255, 255, 255, 0.12);
  --input-focus-ring: var(--accent-ring);
  --input-focus-border: var(--accent-primary);

  --button-primary-bg: var(--accent-primary);
  --button-primary-text: #ffffff;
  --button-primary-hover: var(--accent-primary-hover);

  --button-secondary-bg: #262626;
  --button-secondary-text: #d4d4d4;
  --button-secondary-hover: #404040;

  /* ===== 모달/오버레이 ===== */
  --modal-bg: #171717;
  --modal-overlay: rgba(0, 0, 0, 0.7);

  /* ===== 그림자 시스템 (다크 모드용) ===== */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);

  /* ===== 상태 색상 ===== */
  --status-pending-bg: rgba(251, 191, 36, 0.15);
  --status-pending-text: #fbbf24;
  --status-pending-border: rgba(251, 191, 36, 0.3);

  --status-success-bg: rgba(16, 185, 129, 0.15);
  --status-success-text: #34d399;
  --status-success-border: rgba(16, 185, 129, 0.3);

  --status-error-bg: rgba(244, 63, 94, 0.15);
  --status-error-text: #fb7185;
  --status-error-border: rgba(244, 63, 94, 0.3);

  --status-info-bg: rgba(14, 165, 233, 0.15);
  --status-info-text: #38bdf8;
  --status-info-border: rgba(14, 165, 233, 0.3);

  /* ===== Foundation 2차 — 다크 모드 오버라이드 ===== */

  /* 긴급도 (다크 모드 — 명도 대비 강화) */
  --urgency-critical: #f87171;
  --urgency-critical-bg: rgba(248, 113, 113, 0.15);
  --urgency-high: #fb923c;
  --urgency-high-bg: rgba(251, 146, 60, 0.15);
  --urgency-normal: #94a3b8;
  --urgency-normal-bg: rgba(148, 163, 184, 0.12);

  /* Elevation (다크 모드 — 더 진한 그림자) */
  --elevation-1: 0 1px 2px rgba(0, 0, 0, 0.3);
  --elevation-2: 0 1px 4px rgba(0, 0, 0, 0.4), 0 0 1px rgba(0, 0, 0, 0.3);
  --elevation-3: 0 4px 12px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.35);
  --elevation-4: 0 8px 24px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.4);
  --elevation-5: 0 16px 48px rgba(0, 0, 0, 0.55), 0 4px 8px rgba(0, 0, 0, 0.4);
}

/* ===== 유틸리티 클래스 ===== */

/* 배경 */
.bg-theme-primary { background-color: var(--bg-primary); }
.bg-theme-secondary { background-color: var(--bg-secondary); }
.bg-theme-tertiary { background-color: var(--bg-tertiary); }
.bg-theme-card { background-color: var(--bg-card); }
.bg-theme-hover { background-color: var(--bg-hover); }
.hover\:bg-theme-hover:hover { background-color: var(--bg-hover); }
.bg-theme-active { background-color: var(--bg-active); }

/* 텍스트 */
.text-theme-primary { color: var(--text-primary); }
.text-theme-secondary { color: var(--text-secondary); }
.text-theme-tertiary { color: var(--text-tertiary); }
.text-theme-muted { color: var(--text-muted); }
.text-theme-inverse { color: var(--text-inverse); }
.placeholder\:text-theme-muted::placeholder { color: var(--text-muted); }

/* 테두리 */
.border-theme-primary { border-color: var(--border-primary); }
.border-theme-secondary { border-color: var(--border-secondary); }
.border-theme-strong { border-color: var(--border-strong); }

/* 구분선 */
.divide-theme-primary > :not([hidden]) ~ :not([hidden]) { border-color: var(--border-primary); }
.divide-theme-secondary > :not([hidden]) ~ :not([hidden]) { border-color: var(--border-secondary); }

/* 입력 필드 */
.input-theme {
  background-color: var(--input-bg);
  border-color: var(--input-border);
  color: var(--text-primary);
  transition: all 0.2s ease;
}
.input-theme::placeholder {
  color: var(--text-muted);
}
.input-theme:hover {
  border-color: var(--accent-primary);
}
.input-theme:focus {
  border-color: var(--input-focus-border);
  box-shadow: 0 0 0 3px var(--input-focus-ring);
  outline: none;
}

/* 버튼 — Foundation 표준 (12px radius) */
.btn-theme-primary {
  background-color: var(--button-primary-bg);
  color: var(--button-primary-text);
  border-radius: 0.75rem; /* 12px — #1004 Web theme.css와 동기화 */
  transition: all 0.2s ease;
}
.btn-theme-primary:hover {
  background-color: var(--button-primary-hover);
  transform: translateY(-1px);
}
.btn-theme-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-theme-secondary {
  background-color: var(--button-secondary-bg);
  color: var(--button-secondary-text);
  border-radius: 0.75rem; /* 12px */
  transition: all 0.2s ease;
}
.btn-theme-secondary:hover {
  background-color: var(--button-secondary-hover);
}
.btn-theme-secondary:active {
  transform: scale(0.98);
}

.btn-theme-danger {
  background-color: #ef4444;
  color: #ffffff;
  border-radius: 0.75rem; /* 12px */
  transition: all 0.2s ease;
}
.btn-theme-danger:hover {
  background-color: #dc2626;
}
.btn-theme-danger:active {
  transform: scale(0.98);
}

.btn-theme-danger {
  background-color: #ef4444;
  color: #ffffff;
  transition: all 0.2s ease;
}
.btn-theme-danger:hover {
  background-color: #dc2626;
}
.btn-theme-danger:active {
  transform: translateY(0);
}

/* 사이드바 유틸리티 */
.bg-sidebar { background-color: var(--sidebar-bg); }
.border-sidebar { border-color: var(--sidebar-border); }
.text-sidebar { color: var(--sidebar-text); }
.text-sidebar-muted { color: var(--sidebar-text-muted); }

/* 섹션 아이콘 (모노크롬) */
.section-icon {
  background-color: var(--accent-light);
  color: var(--accent-primary);
}

/* 모달 */
.modal-theme-overlay {
  background-color: var(--modal-overlay);
  backdrop-filter: blur(4px);
}
.modal-theme-content {
  background-color: var(--modal-bg);
}

/* 카드 */
.card-theme {
  background-color: var(--bg-card);
  border-color: var(--border-primary);
  box-shadow: var(--shadow-sm);
}

/* 그림자 */
.shadow-theme-xs { box-shadow: var(--shadow-xs); }
.shadow-theme-sm { box-shadow: var(--shadow-sm); }
.shadow-theme-md { box-shadow: var(--shadow-md); }
.shadow-theme-lg { box-shadow: var(--shadow-lg); }
.shadow-theme-xl { box-shadow: var(--shadow-xl); }

/* 액센트 */
.bg-accent { background-color: var(--accent-primary); }
.bg-accent-light { background-color: var(--accent-light); }
.text-accent { color: var(--accent-primary); }
.border-accent { border-color: var(--accent-primary); }
.ring-accent { --tw-ring-color: var(--accent-ring); }

/* 상태 배지 */
.badge-pending {
  background-color: var(--status-pending-bg);
  color: var(--status-pending-text);
  border-color: var(--status-pending-border);
}
.badge-success {
  background-color: var(--status-success-bg);
  color: var(--status-success-text);
  border-color: var(--status-success-border);
}
.badge-error {
  background-color: var(--status-error-bg);
  color: var(--status-error-text);
  border-color: var(--status-error-border);
}
.badge-info {
  background-color: var(--status-info-bg);
  color: var(--status-info-text);
  border-color: var(--status-info-border);
}

/* ===== 타이포그래피 체계 (한눈에 파악 중심, 큼직한 스케일) ===== */
.text-display {
  /* 페이지 히어로 — 36px 모바일 / 48px 데스크톱 */
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
}
@media (min-width: 768px) {
  .text-display { font-size: 3rem; }
}

.text-title-lg {
  /* 섹션 헤드 — 24px 모바일 / 32px 데스크톱 */
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.15;
}
@media (min-width: 768px) {
  .text-title-lg { font-size: 2rem; }
}

.text-title {
  /* 카드 타이틀 — 20px 모바일 / 24px 데스크톱 */
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
@media (min-width: 768px) {
  .text-title { font-size: 1.5rem; }
}

.text-subtitle {
  /* 소제목 / 리스트 행 제목 — 17px */
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
}

.text-body {
  /* 본문 — 16px (모바일 가독성 기준) */
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.55;
}

.text-body-sm {
  /* 보조 본문 — 14px */
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
}

.text-caption {
  /* 캡션 / 보조 정보 — 13px */
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
}

.text-overline {
  /* 오버라인 라벨 — 12px uppercase */
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.3;
}

/* ===== 트랜지션 ===== */
.theme-transition {
  transition: background-color 0.2s ease,
              border-color 0.2s ease,
              color 0.2s ease,
              box-shadow 0.2s ease,
              transform 0.2s ease;
}

/* ===== PWA 오프라인 인디케이터 ===== */
body.offline::before {
  content: '오프라인 상태입니다';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  padding: 8px 16px;
  background: var(--status-error-bg);
  color: var(--status-error-text);
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  border-bottom: 1px solid var(--status-error-border);
}

body.offline #app {
  padding-top: 40px;
}

/* PWA 설치 프롬프트 배너 */
.pwa-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-primary);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.pwa-install-banner__content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwa-install-banner__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.pwa-install-banner__text {
  color: var(--text-primary);
}

.pwa-install-banner__title {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 2px;
}

.pwa-install-banner__desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.pwa-install-banner__actions {
  display: flex;
  gap: 8px;
}

.pwa-install-banner__btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pwa-install-banner__btn--primary {
  background: var(--accent-primary);
  color: white;
  border: none;
}

.pwa-install-banner__btn--primary:hover {
  background: var(--accent-primary-hover);
}

.pwa-install-banner__btn--secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-primary);
}

.pwa-install-banner__btn--secondary:hover {
  background: var(--bg-hover);
}

/* ===== Foundation (하이브리드 — Stripe 뼈대 + 토스 감성) ===== */

/* 모던 카드 — subtle shadow 항상 있음, 정적 (hover 없음) */
.card-modern {
  background-color: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 1rem; /* rounded-2xl */
  box-shadow: var(--shadow-xs);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease-out;
}

/* 인터랙티브 카드 — hover 떠오름 + tap 피드백 (토스 시그니처) */
.card-modern-interactive {
  background-color: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 1rem;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease-out;
  cursor: pointer;
}
.card-modern-interactive:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.card-modern-interactive:active {
  transform: translateY(0) scale(0.98);
  box-shadow: var(--shadow-xs);
  transition-duration: 0.1s;
}
.card-modern-interactive:focus-visible {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

/* 고스트 버튼 — 투명 배경 + 탭 피드백 */
.btn-theme-ghost {
  background-color: transparent;
  color: var(--text-secondary);
  border-radius: 0.75rem; /* rounded-xl */
  transition: background-color 0.15s ease-out, color 0.15s ease-out, transform 0.15s ease-out;
}
.btn-theme-ghost:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}
.btn-theme-ghost:active {
  transform: scale(0.97);
}

/* 아이콘 버튼 — 40x40 정사각형 (헤더/툴바 공용) */
.icon-button-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  color: var(--text-secondary);
  background-color: transparent;
  transition: background-color 0.15s ease-out, color 0.15s ease-out, transform 0.15s ease-out;
  -webkit-tap-highlight-color: transparent;
}
.icon-button-theme:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}
.icon-button-theme:active {
  transform: scale(0.92);
}
.icon-button-theme:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-primary);
}

/* 탭 피드백 유틸 (클릭 가능한 요소에 부여) */
.tap-feedback {
  transition: transform 0.15s ease-out;
  -webkit-tap-highlight-color: transparent;
}
.tap-feedback:active {
  transform: scale(0.98);
}

/* 프로그레스 바 공통 */
.progress-track {
  height: 0.375rem; /* h-1.5 */
  border-radius: 9999px;
  background-color: color-mix(in srgb, var(--bg-tertiary) 60%, transparent);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.7s ease-out;
}

/* ===== 어드민 레드 액센트 + 다크 사이드바 오버라이드 ===== */
.admin-theme {
  --accent-primary: #dc2626;
  --accent-primary-hover: #b91c1c;
  --accent-secondary: #991b1b;
  --accent-light: rgba(220, 38, 38, 0.1);
  --accent-ring: rgba(220, 38, 38, 0.5);

  /* 파트너센터 라이트 사이드바 전환(#686)에도 어드민은 다크 사이드바 유지 */
  --sidebar-bg: #0f172a;
  --sidebar-border: #1e293b;
  --sidebar-text: #e2e8f0;
  --sidebar-text-muted: #94a3b8;
  --sidebar-hover: rgba(255,255,255,0.08);
  --sidebar-active: rgba(220,38,38,0.18);
}

/* Shake 애니메이션 — 입력 유효성 실패 시 */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
.animate-shake {
  animation: shake 0.35s ease-in-out;
}

/* ================================================================
 * Foundation 2차 — 유틸리티 클래스 (2026-04-15)
 * 목적: 신규 토큰(elevation, motion, urgency, spacing)을 razor에서 사용
 * ================================================================ */

/* Elevation (카드/모달 그림자) */
.elevation-1 { box-shadow: var(--elevation-1); }
.elevation-2 { box-shadow: var(--elevation-2); }
.elevation-3 { box-shadow: var(--elevation-3); }
.elevation-4 { box-shadow: var(--elevation-4); }
.elevation-5 { box-shadow: var(--elevation-5); }

/* 긴급도 — 사건 시급성 시각화 */
.urgency-critical {
  color: var(--urgency-critical);
  background-color: var(--urgency-critical-bg);
}
.urgency-high {
  color: var(--urgency-high);
  background-color: var(--urgency-high-bg);
}
.urgency-normal {
  color: var(--urgency-normal);
  background-color: var(--urgency-normal-bg);
}

/* 긴급도 dot (인디케이터) */
.urgency-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
}
.urgency-dot.critical {
  background-color: var(--urgency-critical);
  box-shadow: 0 0 0 3px var(--urgency-critical-bg);
}
.urgency-dot.high {
  background-color: var(--urgency-high);
  box-shadow: 0 0 0 3px var(--urgency-high-bg);
}
.urgency-dot.normal {
  background-color: var(--urgency-normal);
}

/* Motion 유틸 */
.motion-snap { transition-timing-function: var(--ease-snap); }
.motion-out { transition-timing-function: var(--ease-out); }
.motion-in-out { transition-timing-function: var(--ease-in-out); }

.duration-instant { transition-duration: var(--duration-instant); }
.duration-fast { transition-duration: var(--duration-fast); }
.duration-normal { transition-duration: var(--duration-normal); }
.duration-slow { transition-duration: var(--duration-slow); }
.duration-slower { transition-duration: var(--duration-slower); }

/* 컨테이너 */
.container-narrow { max-width: var(--container-narrow); margin-left: auto; margin-right: auto; }
.container-base { max-width: var(--container-base); margin-left: auto; margin-right: auto; }
.container-wide { max-width: var(--container-wide); margin-left: auto; margin-right: auto; }

/* Surface 레이어 */
.surface-base { background-color: var(--bg-primary); }
.surface-subtle { background-color: var(--bg-secondary); }
.surface-raised { background-color: var(--bg-card); }

/* ================================================================
 * Foundation 2차 — 애니메이션 키프레임 (SidePanel/BottomSheet용)
 * ================================================================ */

@keyframes slide-in-right {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
@keyframes slide-out-right {
  from { transform: translateX(0); }
  to { transform: translateX(100%); }
}
@keyframes slide-in-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@keyframes slide-out-down {
  from { transform: translateY(0); }
  to { transform: translateY(100%); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

.animate-slide-in-right { animation: slide-in-right var(--duration-normal) var(--ease-out); }
.animate-slide-out-right { animation: slide-out-right var(--duration-normal) var(--ease-in-out); }
.animate-slide-in-up { animation: slide-in-up var(--duration-normal) var(--ease-out); }
.animate-slide-out-down { animation: slide-out-down var(--duration-normal) var(--ease-in-out); }
.animate-fade-in { animation: fade-in var(--duration-fast) var(--ease-out); }
.animate-fade-out { animation: fade-out var(--duration-fast) var(--ease-in-out); }

/* Scrollbar 숨김 (가로 스크롤 필터 등) */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* ================================================================
 * CTA Pill 버튼 (친근한 B2B 강조 액션)
 * 형태: 완전 둥근 pill (rounded-full) + 넉넉한 패딩 + 명확한 색
 * ================================================================ */

.btn-cta-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border-radius: 9999px;
  background-color: var(--cta-primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9375rem;
  transition: background-color 0.2s ease-out, transform 0.15s ease-out, box-shadow 0.2s ease-out;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.06);
  -webkit-tap-highlight-color: transparent;
  border: none;
  cursor: pointer;
}
.btn-cta-primary:hover {
  background-color: var(--cta-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.08);
}
.btn-cta-primary:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.06);
  transition-duration: 80ms;
}

.btn-cta-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border-radius: 9999px;
  background-color: var(--cta-accent);
  color: #2B2B2B;
  font-weight: 700;
  font-size: 0.9375rem;
  transition: background-color 0.2s ease-out, transform 0.15s ease-out;
  -webkit-tap-highlight-color: transparent;
  border: none;
  cursor: pointer;
}
.btn-cta-accent:hover {
  background-color: var(--cta-accent-hover);
  transform: translateY(-1px);
}
.btn-cta-accent:active {
  transform: translateY(1px);
}

/* Pill 버튼 공통 유틸 (기존 btn-theme-primary 를 pill 로 만들고 싶을 때) */
.btn-pill {
  border-radius: 9999px !important;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* ================================================================
 * 친근한 카드 (큰 라운드 + 충분한 패딩 + subtle shadow)
 * card-modern 보다 한 단계 더 큰 패딩/라운드
 * ================================================================ */

.card-soft {
  background-color: var(--bg-card);
  border-radius: 1.5rem; /* 24px */
  padding: 1.5rem; /* 24px */
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-primary);
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

/* Split View 패널 고정 높이 (Tailwind arbitrary-value calc 대체) */
.h-split-panel {
  height: calc(100vh - 7rem); /* 뷰포트 높이 - 112px (sticky top-[5.5rem] + 아래 여유) */
}
.top-split-panel {
  top: 5.5rem; /* sticky 위치 — 메인 헤더 h-14 + 여유 2rem */
}
/* Split View 패널 내부 3행 grid (header auto / tabs auto / content 1fr) */
.grid-split-panel {
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-height: 0;
}
@media (min-width: 768px) {
  .card-soft {
    border-radius: 1.75rem; /* 28px on desktop */
    padding: 2rem; /* 32px */
  }
}

.card-soft-interactive {
  background-color: var(--bg-card);
  border-radius: 1.5rem;
  padding: 1.5rem;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-primary);
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out, border-color 0.2s ease-out;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
@media (min-width: 768px) {
  .card-soft-interactive {
    border-radius: 1.75rem;
    padding: 2rem;
  }
}
.card-soft-interactive:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  border-color: var(--border-strong);
}
.card-soft-interactive:active {
  transform: translateY(0) scale(0.99);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.03);
  transition-duration: 80ms;
}

/* 큰 라운드 유틸 (개별 적용용) */
.rounded-soft { border-radius: 1.5rem; }
.rounded-soft-md { border-radius: 1.75rem; }
.rounded-soft-lg { border-radius: 2rem; }
