/* ===== CSS Variables - Sell Pilot Design System ===== */

/* 기본 리셋 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  color-scheme: light;

  /* 준비된 업무 영역(.theme-ready)에서 사용하는 의미 토큰 */
  --ui-surface: #ffffff;
  --ui-surface-sunken: #f6f8fb;
  --ui-surface-raised: #ffffff;
  --ui-divider: #e3e8ef;
  --ui-control-bg: #ffffff;
  --ui-control-bg-hover: #f4f6f9;
  --ui-control-border: #8a94a2;
  --ui-control-border-hover: #667387;
  --ui-text: #2b3440;
  --ui-text-strong: #1b2330;
  --ui-text-muted: #5f6b7a;
  --ui-accent: #0d6efd;
  --ui-accent-hover: #0b5ed7;
  --ui-on-accent: #ffffff;
  --ui-accent-soft-bg: #eef4ff;
  --ui-accent-soft-border: #6b8ccc;
  --ui-accent-soft-text: #1d4ed8;
  --ui-focus: #0d6efd;
  --ui-shadow-popover: 0 10px 28px rgba(15, 23, 42, .16);
  --ui-success: #16a34a;
  --ui-success-text: #067647;
  --ui-success-soft-bg: #ecfdf3;
  --ui-danger: #b42318;
  --ui-danger-solid: #b42318; /* filled danger buttons (white text) */
  --ui-danger-soft-bg: #fef3f2;
  --ui-warning: #b54708;
  --ui-warning-soft-bg: #fffaeb;
  --ui-info: #175cd3;
  --ui-info-soft-bg: #eff8ff;


  /* 앱 틀: 기존 라이트 남색과 준비된 다크를 따로 보존한다. */
  --ui-shell-bg: #2c3e50;
  --ui-shell-raised-bg: #34495e;
  --ui-shell-level2-bg: rgba(0,0,0,.1);
  --ui-shell-level3-bg: rgba(0,0,0,.15);
  --ui-shell-avatar-bg: linear-gradient(135deg,var(--color-primary-gradient-start),var(--color-primary-gradient-end));
  --ui-shell-sunken-bg: rgba(0,0,0,.2);
  --ui-shell-text: rgba(255,255,255,.8);
  --ui-shell-strong: #ffffff;
  --ui-shell-muted: rgba(255,255,255,.7);
  --ui-shell-hover-bg: rgba(255,255,255,.08);
  --ui-shell-control-bg: rgba(255,255,255,.1);
  --ui-shell-control-hover-bg: rgba(255,255,255,.2);
  --ui-shell-divider: rgba(255,255,255,.1);
  --ui-shell-accent: #818cf8;
  --ui-shell-highlight: #a5b4fc;
  --ui-shell-active-bg: linear-gradient(90deg,rgba(102,126,234,.45),rgba(102,126,234,.08));
  --ui-shell-parent-bg: rgba(102,126,234,.1);
  --ui-shell-flyout-bg: #ffffff;
  --ui-shell-flyout-text: #334155;
  --ui-shell-flyout-muted: #64748b;
  --ui-shell-flyout-disabled: #94a3b8;
  --ui-shell-flyout-divider: #e5e7eb;
  --ui-shell-flyout-hover-bg: #eef2ff;
  --ui-shell-flyout-active-bg: #e0e7ff;
  --ui-shell-flyout-accent: #3730a3;
  --ui-control-disabled-bg: #e4e8ee;
  --ui-control-disabled-text: #667387;

  /* =========================== */
  /* 색상 팔레트 (Color Palette) */
  /* =========================== */
  
  /* 브랜드 컬러 */
  --color-primary: #007bff;
  --color-primary-gradient-start: #667eea;
  --color-primary-gradient-end: #764ba2;
  --color-secondary: #2c3e50;
  --color-accent: #34495e;
  --color-dark: #1a252f;
  
  /* 상태 컬러 */
  --color-success: #28a745;
  --color-success-light: #20c997;
  --color-warning: #ffc107;
  --color-warning-dark: #fd7e14;
  --color-danger: #dc3545;
  --color-info: #17a2b8;
  
  /* 그레이 스케일 */
  --color-gray-100: #f8f9fa;
  --color-gray-200: #f5f5f5;
  --color-gray-300: #dee2e6;
  --color-gray-400: #ced4da;
  --color-gray-500: #adb5bd;
  --color-gray-600: #666666;
  --color-gray-700: #555555;
  --color-gray-800: #333333;
  --color-gray-900: #212529;
  
  /* 텍스트 컬러 */
  --color-text-primary: #333333;
  --color-text-secondary: #555555;
  --color-text-muted: #666666;
  --color-text-light: #bdc3c7;
  --color-text-white: #ffffff;
  
  /* 배경 컬러 */
  --color-bg-body: #f5f5f5;
  --color-bg-white: #ffffff;
  --color-bg-light: #f8f9fa;
  --color-bg-sidebar: #2c3e50;
  --color-bg-sidebar-hover: #34495e;
  --color-bg-sidebar-active: #1a252f;
  
  /* 테두리 컬러 */
  --color-border-light: #dee2e6;
  --color-border-medium: #ced4da;
  --color-border-dark: #adb5bd;
  
  /* =========================== */
  /* 타이포그래피 (Typography) */
  /* =========================== */
  
  /* 폰트 패밀리 */
  --font-family-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-family-monospace: 'Courier New', monospace;
  
  /* 폰트 크기 */
  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-base: 13px;
  --font-size-md: 15px;
  --font-size-lg: 18px;
  --font-size-xl: 22px;
  --font-size-2xl: 28px;
  
  /* 폰트 두께 */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  /* 라인 높이 */
  --line-height-tight: 1.2;
  --line-height-base: 1.4;
  --line-height-relaxed: 1.6;
  
  /* =========================== */
  /* 간격 시스템 (Spacing) */
  /* =========================== */
  
  /* 기본 간격 */
  --spacing-xs: 4px;
  --spacing-sm: 6px;
  --spacing-md: 6px;
  --spacing-base: 10px;
  --spacing-lg: 12px;
  --spacing-xl: 15px;
  --spacing-2xl: 20px;
  --spacing-3xl: 30px;
  
  /* 패딩 프리셋 */
  --padding-btn: 8px 15px;
  --padding-input: 12px 15px;
  --padding-card: 10px 20px;
  --padding-sidebar: 10px 15px 10px 45px;
  --padding-modal: 15px;
  
  /* 마진 프리셋 */
  --margin-section: 20px 0;
  --margin-element: 10px 0;
  
  /* =========================== */
  /* 레이아웃 (Layout) */
  /* =========================== */
  
  /* 사이드바 크기 */
  --sidebar-width: 220px;  /* ✅ Phase 2.7.16: 280px → 220px */
  --sidebar-width-collapsed: 50px;  /* ✅ Phase 2.7.16: 60px → 50px */
  
  /* 헤더 크기 */
  --header-height: 60px;
  
  /* 진행바 크기 */
  --progress-bar-width: 300px;
  --progress-bar-height: 25px;

  /* 알림 시스템 크기 */
  --notification-dropdown-width: 300px;
  --notification-dropdown-max-height: 400px;
  --notification-badge-size: 18px;

  /* 컨테이너 최대 너비 */
  --container-max-width: 1200px;
  
  /* =========================== */
  /* 보더 반경 (Border Radius) */
  /* =========================== */
  
  --border-radius-sm: 4px;
  --border-radius-base: 6px;
  --border-radius-md: 8px;
  --border-radius-lg: 12px;
  --border-radius-xl: 20px;
  --border-radius-full: 50%;
  
  /* =========================== */
  /* 그림자 (Shadows) */
  /* =========================== */
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-base: 0 2px 6px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.2);
  
  /* =========================== */
  /* 전환 효과 (Transitions) */
  /* =========================== */
  
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;
  
  /* =========================== */
  /* Z-Index 레이어 */
  /* =========================== */
  
  --z-index-dropdown: 1000;
  --z-index-sticky: 1020;
  --z-index-fixed: 1030;
  --z-index-modal-backdrop: 1040;
  --z-index-modal: 1050;
  --z-index-popover: 1060;
  --z-index-tooltip: 1070;
  --z-index-toast: 10000;
  
  /* =========================== */
  /* 반응형 브레이크포인트 */
  /* =========================== */
  
  --breakpoint-sm: 576px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 992px;
  --breakpoint-xl: 1200px;
}

/* =========================== */
/* 준비된 영역만 OS 다크 모드 적용. 나머지 화면은 라이트 유지. */
/* =========================== */

@media (prefers-color-scheme: dark) {
  .theme-ready {
    color-scheme: dark;
    --ui-surface: #1c222c;
    --ui-surface-sunken: #161b23;
    --ui-surface-raised: #252c38;
    --ui-divider: #2e3746;
    --ui-control-bg: #232a36;
    --ui-control-bg-hover: #2a3241;
    --ui-control-border: #6d7b90;
    --ui-control-border-hover: #8b99ad;
    --ui-text: #e4e8ef;
    --ui-text-strong: #f3f5f9;
    --ui-text-muted: #9aa5b4;
    --ui-accent: #2d6fdb;
    --ui-accent-hover: #2b6dd8;
    --ui-on-accent: #ffffff;
    --ui-accent-soft-bg: rgba(61, 130, 246, .16);
    --ui-accent-soft-border: rgba(91, 150, 248, .8);
    --ui-accent-soft-text: #b9d0ff;
    --ui-focus: #7aa7ff;
    --ui-shadow-popover: 0 12px 32px rgba(0, 0, 0, .5);
    --ui-success: #22c55e;
    --ui-success-text: #75e0a7;
    --ui-success-soft-bg: rgba(34, 197, 94, .16);
    --ui-danger: #fda29b;
    --ui-danger-solid: #c4321f;
    --ui-danger-soft-bg: rgba(240, 68, 56, .16);
    --ui-warning: #fdb022;
    --ui-warning-soft-bg: rgba(247, 144, 9, .16);
    --ui-info: #84caff;
    --ui-info-soft-bg: rgba(46, 144, 250, .16);

    --ui-shell-bg: var(--ui-surface);
    --ui-shell-raised-bg: var(--ui-surface-sunken);
    --ui-shell-level2-bg: var(--ui-surface-sunken);
    --ui-shell-level3-bg: var(--ui-surface-sunken);
    --ui-shell-avatar-bg: var(--ui-accent);
    --ui-shell-sunken-bg: var(--ui-surface-sunken);
    --ui-shell-text: var(--ui-text);
    --ui-shell-strong: var(--ui-text);
    --ui-shell-muted: var(--ui-text-muted);
    --ui-shell-hover-bg: var(--ui-surface-sunken);
    --ui-shell-control-bg: var(--ui-control-bg);
    --ui-shell-control-hover-bg: var(--ui-control-bg-hover);
    --ui-shell-divider: var(--ui-divider);
    --ui-shell-accent: var(--ui-accent);
    --ui-shell-highlight: var(--ui-accent-soft-text);
    --ui-shell-active-bg: var(--ui-accent-soft-bg);
    --ui-shell-parent-bg: var(--ui-accent-soft-bg);
    --ui-shell-flyout-bg: var(--ui-surface);
    --ui-shell-flyout-text: var(--ui-text);
    --ui-shell-flyout-muted: var(--ui-text-muted);
    --ui-shell-flyout-disabled: var(--ui-text-muted);
    --ui-shell-flyout-divider: var(--ui-divider);
    --ui-shell-flyout-hover-bg: var(--ui-surface-sunken);
    --ui-shell-flyout-active-bg: var(--ui-accent-soft-bg);
    --ui-shell-flyout-accent: var(--ui-accent-soft-text);
    --ui-control-disabled-bg: #343d4b;
    --ui-control-disabled-text: #9aa5b4;
    --color-bg-body: #1a1a1a;
    --color-bg-white: #2d2d2d;
    --color-bg-light: #3a3a3a;
    --color-text-primary: #ffffff;
    --color-text-secondary: #cccccc;
    --color-text-muted: #999999;
    --color-border-light: #404040;
    --color-border-medium: #555555;
  }
}
