/* ============================================================
   지큐 Admin - CSS Variables, Reset, Base
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  /* Manager theme (emerald green) */
  --mg-primary: #10b981;
  --mg-primary-light: #d1fae5;
  --mg-primary-dark: #047857;
  --mg-header-bg: rgba(236, 253, 245, 0.85);
  --mg-gradient: linear-gradient(135deg, #34d399, #10b981);

  /* Admin theme (indigo purple) */
  --ad-primary: #6366f1;
  --ad-primary-light: #e0e7ff;
  --ad-primary-dark: #4338ca;
  --ad-header-bg: rgba(238, 242, 255, 0.85);
  --ad-gradient: linear-gradient(135deg, #818cf8, #6366f1);

  /* Neutral palette */
  --bg: #f8fafc;
  --bg-subtle: #f1f5f9;
  --white: #ffffff;
  --text: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  /* Status */
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --danger-bg: #fee2e2;
  --danger-border: #fecaca;
  --caution: #eab308;
  --caution-border: #fde047;
  --caution-light: #fef9c3;
  --caution-bg: #fefce8;
  --success: #10b981;
  --success-light: #ecfdf5;
  --success-bg: #d1fae5;
  --success-dark: #047857;
  --info: #3b82f6;
  --info-light: #eff6ff;
  /* 진한 앰버 액센트 (stat/health 뱃지 — caution 계열보다 진함) */
  --amber-bg: #fef3c7;
  --amber-text: #b45309;

  /* Spacing scale (4의 배수 기반, 점진적) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* Font size scale */
  --text-xs: 11px;     /* 라벨, 메타, 컬럼 헤더 */
  --text-sm: 12px;     /* 작은 부제목, 태그, 마이크로카피 */
  --text-base: 13px;   /* 본문 기본 (테이블 셀, 부제목) */
  --text-md: 14px;     /* 일반 텍스트, 버튼 */
  --text-lg: 15px;     /* 강조 행 (이름·제목) */
  --text-xl: 18px;     /* 카드 제목 */
  --text-2xl: 22px;    /* 페이지 제목 */
  --text-3xl: 28px;    /* Hero 숫자 (잔액·KPI) */

  /* Radius */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(15, 23, 42, 0.06), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 4px 20px rgba(15, 23, 42, 0.03), 0 1px 3px rgba(15, 23, 42, 0.02);

  --transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);

  /* Focus ring (키보드 포커스 인디케이터) */
  --focus-ring: 0 0 0 3px rgba(99, 102, 241, 0.15);
  --focus-ring-input: 0 0 0 3px rgba(99, 102, 241, 0.1);

  /* Desktop layout */
  --sidebar-width: 260px;
  --content-max: 1440px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  letter-spacing: -0.011em;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.hidden { display: none !important; }
.page { display: none; }
.page.active { display: block; }

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

::selection { background: rgba(124, 58, 237, 0.12); }

.login-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.4s ease;
}

.login-loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.login-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--ad-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.login-loading-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
