/* NullSsay Integrated Management System — 디자인 토큰. Overwatch(console.css, 다크+시안)와
   확연히 다른 라이트 테마로 새로 잡는다. 토큰 "이름"은 console.css와 맞춰서 두 시스템이
   개념적으로는 계속 같은 언어를 쓰게 하되, 값은 완전히 새로 정의한다. */
:root {
  --bg: #f3f5fb;
  --bg-panel: #ffffff;
  --bg-panel-hover: #f7f8fd;
  --border: #e7e9f4;
  --border-strong: #d8dbee;

  --text: #1b2036;
  --text-secondary: #5b6178;
  --text-tertiary: #9297ab;

  /* 로고(은빛 말+금빛 검)에서 가져온 팔레트 — 인디고를 메인으로, 골드를 포인트로만 쓴다. */
  --accent: #4f5fee;
  --accent-strong: #3d4cd6;
  --accent-fill: #eceeff;
  --gold: #c9974a;
  --gold-fill: #faf3e5;

  --danger: #e5484d;
  --danger-fill: #fdecec;
  --success: #17a068;
  --success-fill: #e8f8f1;
  --warning: #d97a1f;
  --warning-fill: #fdf1e2;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(20, 25, 60, 0.05);
  --shadow-md: 0 8px 24px rgba(24, 30, 70, 0.08);

  --sidebar-width: 240px;
  --sidebar-bg: #11142a;
  --sidebar-bg-hover: #1b1f3d;
  --sidebar-text: #a3a8c9;
  --sidebar-text-active: #ffffff;
  --sidebar-border: #23274a;

  --topbar-height: 64px;

  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "Pretendard", "Malgun Gothic", sans-serif;

  color-scheme: light;
}

/* 다크 모드 — 시스템이 다크를 선호하고 사용자가 따로 고르지 않았으면 자동 적용, 명시적으로
   라이트를 고르면(data-theme="light") 시스템 설정과 무관하게 라이트를 유지한다. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0b13;
    --bg-panel: #12141f;
    --bg-panel-hover: #181b2a;
    --border: #232637;
    --border-strong: #2e3249;

    --text: #eef0fa;
    --text-secondary: #a7acc7;
    --text-tertiary: #767c9a;

    --accent: #6b78ff;
    --accent-strong: #8791ff;
    --accent-fill: #1d2150;
    --gold: #e0ab5e;
    --gold-fill: #2c2313;

    --danger: #f3676c;
    --danger-fill: #3a1a1e;
    --success: #35c98a;
    --success-fill: #123024;
    --warning: #f0a24a;
    --warning-fill: #33230e;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.45);

    --sidebar-bg: #0d0f1c;
    --sidebar-bg-hover: #171a2c;
    --sidebar-border: #1e2136;

    color-scheme: dark;
  }
}
/* 명시적으로 다크를 고른 경우(토글) — 시스템 설정과 무관하게 항상 적용. 위 미디어쿼리 블록과
   값을 동일하게 맞춘다. */
:root[data-theme="dark"] {
  --bg: #0a0b13;
  --bg-panel: #12141f;
  --bg-panel-hover: #181b2a;
  --border: #232637;
  --border-strong: #2e3249;

  --text: #eef0fa;
  --text-secondary: #a7acc7;
  --text-tertiary: #767c9a;

  --accent: #6b78ff;
  --accent-strong: #8791ff;
  --accent-fill: #1d2150;
  --gold: #e0ab5e;
  --gold-fill: #2c2313;

  --danger: #f3676c;
  --danger-fill: #3a1a1e;
  --success: #35c98a;
  --success-fill: #123024;
  --warning: #f0a24a;
  --warning-fill: #33230e;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.45);

  --sidebar-bg: #0d0f1c;
  --sidebar-bg-hover: #171a2c;
  --sidebar-border: #1e2136;

  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* 카드 안 스크롤 영역용 — 인텔 쪽과 같은 얇은 커스텀 스크롤바지만 라이트 테마 색으로. */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }
