/* ─────────────────────────────────────
 * ST88 Core — Minimal Pastel Mint Theme
 * ───────────────────────────────────── */

:root {
  /* 색상 */
  --bg: #F8FAFB;
  --bg-soft: #F1F5F4;
  --card: #FFFFFF;
  --border: #E5E9EC;
  --text: #1F2937;
  --text-soft: #6B7280;
  --text-muted: #9CA3AF;

  --mint: #10B981;
  --mint-soft: #D1FAE5;
  --mint-ultrasoft: #ECFDF5;

  --amber: #F59E0B;
  --amber-soft: #FEF3C7;

  --blue: #3B82F6;
  --blue-soft: #DBEAFE;

  --red: #EF4444;
  --red-soft: #FEE2E2;

  --gray: #9CA3AF;
  --gray-soft: #F3F4F6;

  /* 그림자 */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 10px 32px rgba(16, 24, 40, 0.08);

  /* 둥글기 */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-full: 9999px;

  /* 간격 */
  --header-h: 56px;
  --safe-top: env(safe-area-inset-top, 0);
  --safe-bottom: env(safe-area-inset-bottom, 0);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

@charset "UTF-8";

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Pretendard Variable', Pretendard, 'Apple SD Gothic Neo', 'Malgun Gothic', '맑은 고딕', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: contain;
}

.view {
  min-height: 100vh;
  min-height: 100dvh;
}

.view.hidden,
.hidden {
  display: none !important;
}

/* ─────────────────────────────────────
 * 로그인 (다크 테크 테마)
 * ───────────────────────────────────── */
#login-view.login-dark {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #050912;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

/* 다크 네이비 그라디언트 배경 + 노이즈 */
.login-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(59, 130, 246, 0.18) 0%, transparent 45%),
    radial-gradient(ellipse at 80% 70%, rgba(96, 165, 250, 0.12) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 100%, rgba(29, 78, 216, 0.25) 0%, transparent 60%),
    linear-gradient(180deg, #030712 0%, #0B1225 45%, #050912 100%);
  z-index: -3;
}

/* 별빛/입자 효과 */
.login-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 15% 20%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1px 1px at 35% 65%, rgba(147, 197, 253, 0.6), transparent),
    radial-gradient(1.5px 1.5px at 55% 15%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 75% 80%, rgba(191, 219, 254, 0.6), transparent),
    radial-gradient(1px 1px at 85% 40%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(2px 2px at 10% 85%, rgba(96, 165, 250, 0.5), transparent),
    radial-gradient(1.2px 1.2px at 45% 45%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 65% 30%, rgba(147, 197, 253, 0.6), transparent);
  background-size: 100% 100%;
  animation: twinkle 6s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes twinkle {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

/* 격자 그리드 오버레이 */
.login-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: -2;
  mask-image: radial-gradient(ellipse at center, black 25%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 25%, transparent 80%);
  animation: gridShift 30s linear infinite;
}

@keyframes gridShift {
  0% { background-position: 0 0; }
  100% { background-position: 50px 50px; }
}

/* 중앙 푸른 글로우 */
.login-glow {
  position: absolute;
  left: 50%;
  top: 45%;
  width: 800px;
  height: 800px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, rgba(59, 130, 246, 0.08) 35%, transparent 70%);
  z-index: -1;
  animation: pulseGlow 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.8; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
}

.login-wrap-dark {
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
  text-align: center;
}

.login-logo {
  width: 100%;
  max-width: 380px;
  height: auto;
  margin: 0 auto 24px;
  display: block;
  filter: drop-shadow(0 0 32px rgba(59, 130, 246, 0.45)) drop-shadow(0 8px 24px rgba(0, 0, 0, 0.6));
  animation: logoFloat 3.5s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* 다크 글래스모피즘 카드 */
.login-card-dark {
  background: linear-gradient(180deg, rgba(13, 21, 42, 0.75), rgba(9, 15, 30, 0.85));
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 20px;
  padding: 28px 24px 24px;
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.1) inset,
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(59, 130, 246, 0.15);
  position: relative;
}

/* 카드 상단 라이트 바 */
.login-card-dark::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #3B82F6, transparent);
  box-shadow: 0 0 8px #3B82F6;
}

/* 입력 필드 */
.login-field {
  position: relative;
  margin-bottom: 14px;
}

.login-field .login-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: rgba(148, 180, 224, 0.6);
  pointer-events: none;
  z-index: 1;
}

.login-card-dark input[type="text"],
.login-card-dark input[type="password"] {
  width: 100%;
  padding: 14px 16px 14px 46px;
  background: rgba(8, 15, 30, 0.6);
  border: 1.5px solid rgba(59, 130, 246, 0.25);
  border-radius: 12px;
  color: #E6F0FF;
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s;
  outline: none;
  caret-color: #60A5FA;
}

.login-card-dark input::placeholder {
  color: rgba(148, 180, 224, 0.4);
  font-weight: 400;
}

.login-card-dark input:focus {
  border-color: #3B82F6;
  background: rgba(15, 25, 48, 0.8);
  box-shadow:
    0 0 0 4px rgba(59, 130, 246, 0.15),
    0 0 16px rgba(59, 130, 246, 0.25);
}

.login-card-dark input:focus + .login-icon,
.login-field:focus-within .login-icon {
  color: #60A5FA;
}

/* 로그인 버튼 */
.login-btn-dark {
  width: 100%;
  padding: 15px;
  margin-top: 6px;
  background: linear-gradient(135deg, #1E40AF 0%, #3B82F6 50%, #1E40AF 100%);
  background-size: 200% 100%;
  color: white;
  border: 1px solid rgba(96, 165, 250, 0.5);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  cursor: pointer;
  box-shadow:
    0 0 20px rgba(59, 130, 246, 0.4),
    0 8px 20px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.25s;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}

.login-btn-dark::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s;
}

.login-btn-dark:hover::before {
  left: 100%;
}

.login-btn-dark:hover {
  background-position: 100% 0;
  box-shadow:
    0 0 30px rgba(59, 130, 246, 0.6),
    0 10px 28px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.login-btn-dark:active {
  transform: translateY(0);
}

.login-btn-dark i {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}

.login-btn-dark:hover i {
  transform: translateX(3px);
}

.login-card-dark .error-msg {
  color: #F87171;
  text-shadow: 0 0 8px rgba(248, 113, 113, 0.4);
}

.login-footer {
  margin-top: 24px;
  font-size: 11px;
  color: rgba(148, 180, 224, 0.45);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* 로고 마크 (헤더 내부용 - 기존 유지) */
.logo-mark.sm {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #10B981, #059669);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
  position: relative;
}

.logo-mark.sm::before {
  content: '';
  position: absolute;
  inset: 8px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 4px;
}

.logo-mark.sm::after {
  content: '';
  position: absolute;
  left: 12px;
  top: 12px;
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, #10B981, #059669);
  border-radius: 2px;
}

.card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

form.card label {
  display: block;
  margin-bottom: 10px;
}

form.card label span {
  display: block;
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 4px;
  font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-soft);
  color: var(--text);
  transition: all 0.15s;
  height: 36px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--mint);
  background: white;
  box-shadow: 0 0 0 3px var(--mint-ultrasoft);
}

textarea {
  resize: vertical;
  min-height: 60px;
  height: auto;
  line-height: 1.5;
}

.btn-primary {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #10B981, #059669);
  color: white;
  border: none;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
  transition: transform 0.1s, box-shadow 0.15s;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  width: 100%;
  padding: 11px;
  background: var(--gray-soft);
  color: var(--text);
  border: none;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.btn-danger {
  background: #FEE2E2;
  color: #B91C1C;
}

.error-msg {
  color: var(--red);
  font-size: 13px;
  margin-top: 10px;
  min-height: 18px;
  text-align: center;
}

.muted { color: var(--text-soft); }
.small { font-size: 12px; }
.center { text-align: center; }

/* ─────────────────────────────────────
 * 헤더
 * ───────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--header-h) + var(--safe-top));
  padding-top: var(--safe-top);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  max-width: 1280px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-chip {
  font-size: 13px;
  color: var(--text-soft);
  padding: 6px 12px;
  background: var(--mint-ultrasoft);
  border-radius: var(--r-full);
  font-weight: 500;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s;
}

.icon-btn:active {
  background: var(--gray-soft);
}

.icon-btn i {
  width: 22px;
  height: 22px;
}

/* ─────────────────────────────────────
 * 메인 영역
 * ───────────────────────────────────── */
.main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 16px calc(96px + var(--safe-bottom));
}

/* ─────────────────────────────────────
 * 달력 뷰
 * ───────────────────────────────────── */
.calendar-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.calendar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.cal-nav-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: white;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: all 0.12s;
}

.cal-nav-btn:hover {
  background: var(--mint-ultrasoft);
  border-color: var(--mint);
  color: var(--mint);
}

.cal-nav-btn i {
  width: 18px;
  height: 18px;
}

.cal-title {
  flex: 1;
  text-align: center;
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.cal-today-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: white;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.12s;
}

.cal-today-btn:hover {
  background: var(--mint-ultrasoft);
  border-color: var(--mint);
  color: var(--mint);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  background: var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  padding: 1px;
}

.cal-weekday {
  background: var(--bg-soft);
  text-align: center;
  padding: 10px 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: 0.5px;
}

.cal-weekday.sun { color: #DC2626; }
.cal-weekday.sat { color: #2563EB; }

.cal-day {
  background: white;
  min-height: 124px;
  padding: 7px 6px 6px;
  cursor: pointer;
  transition: background 0.12s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cal-day:hover {
  background: var(--bg-soft);
}

.cal-day.empty {
  background: var(--bg-soft);
  cursor: default;
  opacity: 0.4;
}

.cal-day.empty:hover {
  background: var(--bg-soft);
}

.cal-day.today {
  background: var(--mint-ultrasoft);
  box-shadow: inset 0 0 0 2px var(--mint);
}

.cal-day.today .cal-day-num {
  color: var(--mint);
  font-weight: 800;
}

.cal-day-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
  padding-left: 2px;
}

.cal-day.sun .cal-day-num { color: #DC2626; }
.cal-day.sat .cal-day-num { color: #2563EB; }

.cal-day-projects {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  flex: 1;
}

.cal-project {
  font-size: 11px;
  padding: 3px 6px 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  /* 진행중 = 노란 */
  background: #FEF9C3;
  color: #854D0E;
  border-left: 3px solid #EAB308;
  font-weight: 600;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 5px;
}

.cal-project:hover {
  filter: brightness(0.95);
}

/* 상태 표시 원형 점 */
.cal-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  animation: liveDot 1.6s ease-in-out infinite;
}

@keyframes liveDot {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); transform: scale(1); }
  50% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0); transform: scale(1.15); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); transform: scale(1); }
}

/* 완료 = 녹색 */
.cal-project.status-completed {
  background: #D1FAE5;
  color: #047857;
  border-left-color: #10B981;
}

.cal-project.status-completed .cal-dot {
  background: #10B981;
  animation: none;
  box-shadow: none;
}

/* 지연 = 주황 (깜빡 애니메이션) */
.cal-project.status-delayed {
  background: #FED7AA;
  color: #9A3412;
  border-left-color: #F97316;
}

.cal-project.status-delayed .cal-dot {
  background: #F97316;
  animation: liveDotAmber 1.6s ease-in-out infinite;
}

@keyframes liveDotAmber {
  0% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.6); transform: scale(1); }
  50% { box-shadow: 0 0 0 4px rgba(249, 115, 22, 0); transform: scale(1.15); }
  100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0); transform: scale(1); }
}

/* 보류 = 검정 */
.cal-project.status-hold {
  background: #1F2937;
  color: #FFFFFF;
  border-left-color: #111827;
}

.cal-project.status-hold .cal-dot {
  background: #6B7280;
  animation: none;
  box-shadow: none;
}

/* 긴급 = 빨강/파랑 교차 */
.cal-project.status-urgent {
  color: #FFFFFF;
  border-left-color: #FFFFFF;
  animation: urgentFlash 1.4s steps(1, end) infinite;
}

.cal-project.status-urgent .cal-dot {
  background: white;
  animation: urgentDot 1.4s ease-in-out infinite;
}

@keyframes urgentDot {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,255,255,0.8); }
  50% { transform: scale(1.3); box-shadow: 0 0 0 5px rgba(255,255,255,0); }
}

.cal-more {
  font-size: 9px;
  color: var(--text-muted);
  padding: 1px 4px;
  font-weight: 500;
}

/* 날짜별 모달 리스트 */
.day-projects-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.day-project-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--mint);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 0.12s;
}

.day-project-item:active {
  transform: scale(0.99);
  background: var(--bg-soft);
}

.day-project-item.status-completed { border-left-color: #10B981; }
.day-project-item.status-delayed { border-left-color: #F97316; }
.day-project-item.status-hold { border-left-color: #1F2937; }
.day-project-item.status-in_progress { border-left-color: #EAB308; }
.day-project-item.status-urgent {
  border-left-color: #EF4444;
  animation: urgentBorderFlash 1.4s steps(1, end) infinite;
}

@keyframes urgentBorderFlash {
  0%, 49.99% { border-left-color: #EF4444; }
  50%, 100% { border-left-color: #3B82F6; }
}

.day-project-info {
  flex: 1;
  min-width: 0;
}

.day-project-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}

/* 모바일 달력 — 컴팩트 그리드 + 하단 아젠다 리스트 */
@media (max-width: 639px) {
  .main {
    padding: 12px 6px calc(96px + var(--safe-bottom));
  }
  .calendar-wrap {
    padding: 12px 8px;
  }
  .cal-title {
    font-size: 17px;
  }
  .cal-nav-btn {
    width: 32px;
    height: 32px;
  }
  .cal-today-btn {
    padding: 5px 11px;
    font-size: 11px;
  }
  .calendar-header {
    gap: 6px;
    margin-bottom: 10px;
  }
  .calendar-grid {
    gap: 2px;
  }
  .cal-day {
    min-height: 66px;
    padding: 5px 3px 3px;
    gap: 2px;
  }
  .cal-day-num {
    font-size: 12px;
    margin-bottom: 2px;
    padding-left: 1px;
    font-weight: 700;
  }
  .cal-weekday {
    font-size: 11px;
    padding: 7px 0;
  }
  .cal-day-projects {
    gap: 3px;
    align-items: center;
  }
  /* 모바일: 이름 숨기고 컬러 점들로 표시 */
  .cal-project {
    font-size: 0;
    line-height: 0;
    padding: 0;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border-left: none;
    display: inline-block;
    overflow: hidden;
    vertical-align: middle;
    flex: 0 0 7px;
  }
  .cal-project .cal-dot {
    display: none;
  }
  /* 모바일에선 projects 영역을 가로로 wrap */
  .cal-day-projects {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .cal-project {
    background: #EAB308;
  }
  .cal-project.status-completed {
    background: #10B981;
  }
  .cal-project.status-delayed {
    background: #F97316;
  }
  .cal-project.status-hold {
    background: #1F2937;
  }
  .cal-project.status-urgent {
    animation: urgentFlash 1.4s steps(1, end) infinite;
  }
  .cal-more {
    font-size: 9px;
    padding: 0;
    margin-top: 1px;
    width: 100%;
    line-height: 1;
  }

  /* 오늘 셀에 달력 아래 아젠다 표시할 경우를 위해 보조 스타일 */
  .cal-day.today {
    box-shadow: inset 0 0 0 2px var(--mint);
  }
}

/* 모바일 아젠다 리스트 (달력 하단에 오늘/이주 프로젝트) */
.mobile-agenda {
  display: none;
}

@media (max-width: 639px) {
  .mobile-agenda {
    display: block;
    margin-top: 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 12px;
  }
  .agenda-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
  }
  .agenda-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
  }
  .agenda-tabs {
    display: flex;
    gap: 4px;
  }
  .agenda-tab {
    padding: 4px 10px;
    background: var(--gray-soft);
    border: none;
    border-radius: var(--r-full);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-soft);
    cursor: pointer;
  }
  .agenda-tab.active {
    background: var(--mint);
    color: white;
  }
  .agenda-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .agenda-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-soft);
    border-left: 4px solid #EAB308;
    border-radius: var(--r-sm);
    cursor: pointer;
  }
  .agenda-item.status-completed { border-left-color: #10B981; }
  .agenda-item.status-delayed { border-left-color: #F97316; }
  .agenda-item.status-hold { border-left-color: #1F2937; }
  .agenda-item.status-urgent {
    animation: urgentFlash 1.4s steps(1, end) infinite;
    color: white;
  }
  .agenda-item-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .agenda-item.status-urgent .agenda-item-name,
  .agenda-item.status-hold .agenda-item-name {
    color: white;
  }
  .agenda-item-date {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
  }
  .agenda-item.status-urgent .agenda-item-date,
  .agenda-item.status-hold .agenda-item-date {
    color: rgba(255,255,255,0.8);
  }
  .agenda-empty {
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: var(--text-muted);
  }
}

/* 필터 탭 */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.filter-tabs::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  padding: 8px 16px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.filter-chip.active {
  background: var(--mint);
  border-color: var(--mint);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

/* 상태별 필터 칩 활성화 색상 */
.filter-chip.f-in_progress.active {
  background: #EAB308;
  border-color: #EAB308;
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.3);
}
.filter-chip.f-completed.active {
  background: #10B981;
  border-color: #10B981;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.filter-chip.f-delayed.active {
  background: #F97316;
  border-color: #F97316;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}
.filter-chip.f-hold.active {
  background: #1F2937;
  border-color: #1F2937;
  box-shadow: 0 4px 12px rgba(31, 41, 55, 0.3);
}
.filter-chip.f-urgent.active {
  color: white;
  border-color: transparent;
  animation: urgentFlash 1.4s steps(1, end) infinite;
}

/* 긴급 필터 칩 기본 상태에도 작은 강조 */
.filter-chip.f-urgent:not(.active) {
  border-color: #EF4444;
  color: #EF4444;
}

/* ─────────────────────────────────────
 * 프로젝트 카드 (토스트)
 * ───────────────────────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.project-card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #EAB308; /* 진행중 = 노란색 */
}

.project-card.status-completed::before { background: #10B981; } /* 완료 = 녹색 */
.project-card.status-delayed::before { background: #F97316; }   /* 지연 = 주황색 */
.project-card.status-hold::before { background: #1F2937; }      /* 보류 = 검은색 */
.project-card.status-urgent::before {
  animation: urgentFlash 1.4s steps(1, end) infinite;
}

.project-card:active {
  transform: scale(0.99);
  box-shadow: var(--shadow-md);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.card-company {
  font-size: 12px;
  color: var(--mint);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  margin: 2px 0 0;
  color: var(--text);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* 진행중 = 노란색 */
.status-badge.in_progress {
  background: #FEF9C3;
  color: #854D0E;
}

/* 완료 = 녹색 */
.status-badge.completed {
  background: #D1FAE5;
  color: #047857;
}

/* 지연 = 주황색 */
.status-badge.delayed {
  background: #FED7AA;
  color: #9A3412;
}

/* 보류 = 검은색 */
.status-badge.hold {
  background: #1F2937;
  color: #FFFFFF;
}

/* 긴급 = 빨강/파랑 교차 */
.status-badge.urgent {
  color: #FFFFFF;
  animation: urgentFlash 1.4s steps(1, end) infinite;
}

@keyframes urgentFlash {
  0%, 49.99% { background: #EF4444; }
  50%, 100% { background: #3B82F6; }
}

/* 긴급 카드 왼쪽 바 */
.project-card.status-urgent::before {
  background: #EF4444;
}

.card-dates {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 12px;
}

.card-dates i {
  width: 14px;
  height: 14px;
}

.progress-bar {
  height: 6px;
  background: var(--gray-soft);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10B981, #34D399);
  border-radius: var(--r-full);
  transition: width 0.4s ease;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.progress-percent {
  font-weight: 600;
  color: var(--text);
}

.card-meta {
  display: flex;
  gap: 14px;
  color: var(--text-muted);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.meta-item i {
  width: 13px;
  height: 13px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.empty-state i {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ─────────────────────────────────────
 * 프로젝트 상세 페이지
 * ───────────────────────────────────── */
.detail-header {
  margin-bottom: 20px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--text-soft);
  font-size: 14px;
  padding: 6px 0;
  cursor: pointer;
  margin-bottom: 12px;
}

.back-btn i {
  width: 18px;
  height: 18px;
}

/* 모바일: 뒤로가기 버튼 고정 (헤더 바로 아래) */
@media (max-width: 767px) {
  .back-btn {
    position: sticky;
    top: calc(var(--header-h) + var(--safe-top));
    z-index: 50;
    display: flex;
    width: calc(100% + 16px);
    margin: -12px -8px 10px -8px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-weight: 600;
    font-size: 15px;
  }
  .back-btn i {
    width: 20px;
    height: 20px;
  }
}

.detail-company {
  font-size: 13px;
  color: var(--mint);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.detail-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
  margin: 4px 0 14px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 16px;
}

.detail-meta i {
  width: 14px;
  height: 14px;
  vertical-align: text-bottom;
  margin-right: 4px;
}

.detail-progress-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 20px;
}

.detail-progress-card .progress-bar {
  height: 8px;
  margin: 10px 0 6px;
}

.detail-progress-card .progress-row {
  font-size: 13px;
}

/* 탭 (deprecated but kept for safety) */
.tab-bar {
  display: flex;
  gap: 4px;
  background: var(--gray-soft);
  padding: 4px;
  border-radius: var(--r-md);
  margin-bottom: 16px;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.15s;
}

.tab-btn.active {
  background: white;
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* 프로젝트 상세 섹션 레이아웃 (모바일에서 순서 변경 가능) */
.detail-layout {
  display: flex;
  flex-direction: column;
}

.detail-sec {
  display: block;
}

/* 데스크탑 순서 (기본) */
.sec-header { order: 1; }
.sec-progress { order: 2; }
.sec-vendors { order: 3; }
.sec-logs { order: 4; }
.sec-comments { order: 5; }

/* 모바일 순서: 로그(진행/수정)을 맨 위로, 정보는 아래 */
@media (max-width: 767px) {
  .sec-logs { order: 1; }
  .sec-header { order: 2; }
  .sec-progress { order: 3; }
  .sec-vendors { order: 4; }
  .sec-comments { order: 5; }
}

/* 진행/수정 상황 2컬럼 분할 뷰 */
.logs-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

@media (max-width: 767px) {
  .logs-split {
    grid-template-columns: 1fr;
  }
}

.logs-col {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-height: 240px;
}

.logs-col-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.logs-col-header i {
  width: 16px;
  height: 16px;
  color: var(--text-soft);
}

.logs-col[data-log-type="progress"] .logs-col-header {
  border-bottom-color: var(--mint);
}

.logs-col[data-log-type="progress"] .logs-col-header i {
  color: var(--mint);
}

.logs-col[data-log-type="revision"] .logs-col-header {
  border-bottom-color: #F59E0B;
}

.logs-col[data-log-type="revision"] .logs-col-header i {
  color: #F59E0B;
}

.logs-count {
  margin-left: auto;
  background: var(--gray-soft);
  color: var(--text-soft);
  padding: 2px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
}

.logs-col-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  margin-bottom: 10px;
  max-height: 400px;
  overflow-y: auto;
}

.logs-empty {
  padding: 24px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.logs-col .log-item {
  padding: 10px 12px;
  padding-right: 34px;
  background: var(--bg-soft);
  position: relative;
}

.logs-col .log-item .log-header {
  gap: 6px;
}

.logs-col .log-item .log-author {
  font-size: 11px;
}

.logs-col .log-item .log-time {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

.logs-col .log-item .log-content {
  font-size: 13px;
  margin-top: 2px;
}

.logs-col .log-delete {
  top: 6px;
  right: 6px;
}

/* 로그/코멘트 리스트 */
.log-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.log-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  padding-right: 36px;
  position: relative;
}

.log-item.type-progress {
  border-left: 3px solid var(--mint);
}

.log-item.type-revision {
  border-left: 3px solid var(--amber);
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.log-author {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.log-time {
  font-size: 11px;
  color: var(--text-muted);
}

.log-content {
  font-size: 14px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

.log-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}

.log-delete:active {
  background: var(--red-soft);
  color: var(--red);
}

.log-delete i {
  width: 14px;
  height: 14px;
}

/* 로그 입력 */
.log-input-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  margin-top: 8px;
}

.log-input-wrap textarea {
  border: none;
  background: transparent;
  padding: 6px 4px;
  min-height: 60px;
}

.log-input-wrap textarea:focus {
  box-shadow: none;
}

.log-input-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
}

.btn-sm {
  padding: 7px 16px;
  background: var(--mint);
  color: white;
  border: none;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-sm:disabled {
  background: var(--gray-soft);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* 코멘트 */
.comment-item {
  background: var(--mint-ultrasoft);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid #D1FAE5;
}

.comment-item .log-header .log-author { color: #047857; }

.role-tag {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--r-full);
  background: var(--mint);
  color: white;
  margin-left: 4px;
  font-weight: 600;
}

.role-tag.ceo { background: #8B5CF6; }
.role-tag.vendor { background: #3B82F6; }
.role-tag.admin { background: #EF4444; }
.role-tag.staff { background: #10B981; }

/* Section title */
.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  margin: 18px 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─────────────────────────────────────
 * Drawer (사이드 메뉴)
 * ───────────────────────────────────── */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
}

.drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  animation: fadeIn 0.2s;
}

.drawer-body {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  max-width: 80vw;
  background: white;
  padding: calc(var(--safe-top) + 20px) 16px 20px;
  animation: slideInRight 0.25s ease;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.08);
  overflow-y: auto;
}

.drawer-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--mint-ultrasoft);
  border-radius: var(--r-md);
  margin-bottom: 16px;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981, #059669);
  flex-shrink: 0;
}

.drawer-user .name {
  font-weight: 600;
  font-size: 14px;
}

.drawer-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.drawer-menu li a,
.drawer-menu li button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  background: transparent;
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  text-align: left;
}

.drawer-menu li a:active,
.drawer-menu li button:active {
  background: var(--gray-soft);
}

.drawer-menu li i {
  width: 18px;
  height: 18px;
  color: var(--text-soft);
}

/* ─────────────────────────────────────
 * FAB (+)
 * ───────────────────────────────────── */
.fab {
  position: fixed;
  right: 20px;
  bottom: calc(20px + var(--safe-bottom));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981, #059669);
  color: white;
  border: none;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  transition: transform 0.15s;
}

.fab:active {
  transform: scale(0.92);
}

.fab i {
  width: 26px;
  height: 26px;
}

/* ─────────────────────────────────────
 * 모달
 * ───────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 640px) {
  .modal {
    align-items: center;
  }
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  animation: fadeIn 0.2s;
}

.modal-body {
  position: relative;
  background: white;
  width: 100%;
  max-width: 720px;
  max-height: 92vh;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 18px 20px calc(18px + var(--safe-bottom));
  animation: slideUp 0.25s ease;
  overflow-y: auto;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
}

@media (min-width: 640px) {
  .modal-body {
    border-radius: var(--r-xl);
    animation: popIn 0.25s ease;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.modal-content label {
  display: block;
  margin-bottom: 10px;
}

.modal-content label > span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 4px;
  font-weight: 500;
  line-height: 1.4;
}

.modal-content .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.modal-content .row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

/* 데스크탑에서 폼 2-컬럼 */
@media (min-width: 640px) {
  .vendor-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
  }
  .vendor-section .vendor-header {
    grid-column: 1 / -1;
    margin-bottom: 4px;
    padding-bottom: 8px;
  }
  .vendor-section > label {
    margin-bottom: 0;
  }
  .vendor-section > .row {
    grid-column: 1 / -1;
  }
}

/* 기본 정보 영역도 2-컬럼 */
@media (min-width: 640px) {
  #project-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
  }
  #project-form > label {
    margin-bottom: 0;
  }
  #project-form > .row,
  #project-form > .vendor-selector,
  #project-form > #vendor-forms,
  #project-form > label:has(textarea),
  #project-form > button[type="submit"] {
    grid-column: 1 / -1;
  }
  #project-form .row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}

/* ─────────────────────────────────────
 * 토스트 알림
 * ───────────────────────────────────── */
.toast {
  position: fixed;
  top: calc(var(--header-h) + var(--safe-top) + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(31, 41, 55, 0.95);
  color: white;
  padding: 12px 20px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 500;
  animation: slideDown 0.3s ease;
  max-width: 80vw;
  text-align: center;
}

.toast.success { background: var(--mint); }
.toast.error { background: var(--red); }

/* ─────────────────────────────────────
 * 벤더 섹션 (체크박스 + 폼)
 * ───────────────────────────────────── */
.vendor-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 8px;
  padding: 0;
  background: transparent;
  border: none;
}

.vendor-selector .section-title {
  margin: 0;
  flex-shrink: 0;
  font-size: 11px;
}

.vendor-checks {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}

.modal-content label.vendor-check,
.vendor-check {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  margin: 0 !important;
  background: var(--gray-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
  line-height: 1;
}

.vendor-check input {
  width: 12px;
  height: 12px;
  accent-color: var(--mint);
  cursor: pointer;
  margin: 0;
}

.modal-content .vendor-check span,
.vendor-check span {
  display: inline !important;
  font-size: 11px;
  color: inherit;
  font-weight: 600;
  margin: 0 !important;
}

.vendor-check:has(input:checked) {
  background: var(--mint);
  border-color: var(--mint);
  color: white;
}

.vendor-section {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  margin-bottom: 14px;
  animation: fadeIn 0.25s;
}

.vendor-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
}

.vendor-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.vendor-tag.casino,
.vendor-tag.ace {
  background: #FEF3C7;
  color: #B45309;
}

.vendor-tag.crown {
  background: #FCE7F3;
  color: #9D174D;
}

.vendor-tag.st88 {
  background: #DBEAFE;
  color: #1E40AF;
}

.vendor-tag.skyhub {
  background: #E9D5FF;
  color: #6B21A8;
}

.vendor-tag.sports {
  background: #D1FAE5;
  color: #047857;
}

/* 플랫폼 선택 라디오 (ACE/CROWN) */
.platform-selector {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.modal-content label.platform-radio,
.platform-radio {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  padding: 4px 10px !important;
  margin: 0 !important;
  background: var(--gray-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
}

.platform-radio input {
  width: 12px;
  height: 12px;
  accent-color: var(--mint);
  margin: 0;
}

.modal-content .platform-radio span,
.platform-radio span {
  display: inline !important;
  font-size: 11px;
  color: inherit;
  font-weight: 600;
  margin: 0 !important;
}

.platform-radio:has(input:checked) {
  background: #FEF3C7;
  border-color: #F59E0B;
  color: #B45309;
}

.platform-radio:has(input[value="crown"]:checked) {
  background: #FCE7F3;
  border-color: #EC4899;
  color: #9D174D;
}

.platform-radio:has(input[value="switch"]:checked) {
  background: linear-gradient(90deg, #FEF3C7 50%, #FCE7F3 50%);
  border-color: #8B5CF6;
  color: #5B21B6;
  font-weight: 700;
}

/* 국내형 스포츠 사용 중 표시 */
.sports-on {
  color: #047857;
  font-size: 11px;
  font-weight: 700;
  margin-left: auto;
}

.vendor-sub-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  grid-column: 1 / -1;
}

.modal-content label.vendor-sub-check,
.vendor-sub-check {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--gray-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  margin: 0 !important;
  cursor: pointer;
  line-height: 1;
  transition: all 0.12s;
}

.vendor-sub-check input {
  width: 12px;
  height: 12px;
  accent-color: var(--mint);
  margin: 0;
}

.modal-content .vendor-sub-check span,
.vendor-sub-check span {
  display: inline !important;
  font-size: 11px;
  color: inherit;
  font-weight: 600;
  margin: 0 !important;
}

.vendor-sub-check:has(input:checked) {
  background: var(--mint);
  border-color: var(--mint);
  color: white;
}

/* 메모 + 빠른 입력 2컬럼 */
.memo-row {
  grid-column: 1 / -1 !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}

.memo-row > label {
  margin: 0 !important;
}

.memo-row textarea {
  min-height: 120px;
}

.quick-paste-wrap span {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.quick-parse-btn {
  font-size: 11px !important;
  padding: 4px 10px !important;
  float: none !important;
  background: linear-gradient(135deg, #3B82F6, #1E40AF) !important;
  color: white !important;
  border: none !important;
  border-radius: var(--r-sm) !important;
  cursor: pointer;
}

#quick-paste {
  font-family: 'SF Mono', Consolas, monospace !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
}

@media (max-width: 639px) {
  .memo-row {
    grid-template-columns: 1fr;
  }
}

/* 마감일 미정 토글 */
.modal-content label.tbd-toggle,
.tbd-toggle {
  display: inline-flex !important;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--text-soft);
  font-weight: 500;
  margin: 0 0 0 6px !important;
  cursor: pointer;
}

.tbd-toggle input {
  width: 12px;
  height: 12px;
  accent-color: var(--mint);
  margin: 0;
}

.modal-content label span.tbd-toggle,
label > span .tbd-toggle {
  display: inline-flex !important;
}

/* 상세 페이지의 벤더 카드 */
.vendor-display {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 24px;
  row-gap: 0;
}

.vendor-display .vendor-header {
  grid-column: 1 / -1;
  justify-content: space-between;
}

.vendor-display .skyhub-sub-pills {
  grid-column: 1 / -1;
}

@media (max-width: 767px) {
  .vendor-display {
    grid-template-columns: 1fr;
  }
}

.vendor-copy-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 4px 10px;
  font-size: 11px;
  color: var(--text-soft);
  cursor: pointer;
}

.vendor-copy-btn:hover {
  background: var(--gray-soft);
}

.vendor-field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed #F3F4F6;
  font-size: 13px;
}

.vendor-field-row:last-child {
  border-bottom: none;
}

.vendor-field-label {
  color: var(--text-soft);
  font-weight: 500;
  min-width: 110px;
  flex-shrink: 0;
}

.vendor-field-value {
  color: var(--text);
  word-break: break-all;
  text-align: right;
  font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
  font-size: 12px;
}

.vendor-field-value.empty {
  color: var(--text-muted);
  font-style: italic;
  font-family: inherit;
}

.skyhub-sub-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.skyhub-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
}

.skyhub-pill.on {
  background: var(--mint-soft);
  color: #047857;
}

.skyhub-pill.off {
  background: var(--gray-soft);
  color: var(--text-muted);
}

/* 카드의 벤더 뱃지 */
.card-vendor-tags {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.card-vendor-tags .vendor-tag {
  font-size: 9px;
  padding: 2px 8px;
}

/* ─────────────────────────────────────
 * 수정 로그 페이지
 * ───────────────────────────────────── */
.audit-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

#audit-search {
  flex: 1;
  min-width: 180px;
  height: 36px;
}

.audit-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.audit-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.audit-date {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  padding: 4px 0;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.audit-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.audit-item {
  display: flex;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  transition: all 0.12s;
}

.audit-item.clickable {
  cursor: pointer;
}

.audit-item.clickable:hover {
  background: var(--bg-soft);
  border-color: var(--mint);
}

.audit-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gray-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-soft);
}

.audit-icon i {
  width: 16px;
  height: 16px;
}

.audit-body {
  flex: 1;
  min-width: 0;
}

.audit-header-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.audit-action {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.audit-action.create {
  background: #D1FAE5;
  color: #047857;
}

.audit-action.update {
  background: #DBEAFE;
  color: #1D4ED8;
}

.audit-action.delete {
  background: #FEE2E2;
  color: #B91C1C;
}

.audit-type-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  background: var(--bg-soft);
  color: var(--text-soft);
  font-weight: 600;
}

.audit-user {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.audit-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

.audit-summary {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  word-break: break-word;
}

.audit-changes {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.6;
}

.audit-changes li {
  list-style: disc;
}

/* ─────────────────────────────────────
 * 계정 관리 (admin)
 * ───────────────────────────────────── */
.user-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
}

.user-item .avatar {
  width: 38px;
  height: 38px;
  font-size: 14px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.user-item .info {
  flex: 1;
  min-width: 0;
}

.user-item .info .name {
  font-weight: 600;
  font-size: 14px;
}

.user-item .info .username {
  font-size: 12px;
  color: var(--text-muted);
}

/* ─────────────────────────────────────
 * 애니메이션
 * ───────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideDown {
  from { transform: translate(-50%, -20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes popIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* 데스크탑 확장 */
@media (min-width: 768px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .project-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .project-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
