/* 메타툴즈 v2 — 디자인 시스템 "Precision Console"
   · 서체: Pretendard(고딕) 고정 + 데이터/라벨은 모노. 명조·이모지 금지.
   · 딥잉크 사이드바로 앵커 · 코발트 액센트 + 골드 마이크로포인트 · 정제된 뉴트럴 + 은은한 깊이. */
:root {
  /* 뉴트럴 캔버스/서피스 (레이어) */
  --bg: #e9edf2;              /* 앱 캔버스 — 흰 카드와 대비되는 차분한 슬레이트 */
  --surface: #ffffff;         /* 카드 */
  --surface-2: #f6f8fb;       /* 중첩/보조 표면 */
  --line: #e2e6ec;
  --line-soft: #edf0f4;

  /* 잉크 */
  --ink: #161b23;
  --ink-soft: #59616f;
  --ink-faint: #949cab;

  /* 딥잉크 사이드바 전용 */
  --nav-bg: #141b27;
  --nav-bg-2: #101722;
  --nav-ink: #a3adbd;
  --nav-ink-strong: #f3f6fa;
  --nav-line: rgba(255,255,255,.07);
  --nav-active-bg: rgba(255,255,255,.065);
  --nav-hover-bg: rgba(255,255,255,.035);

  /* 액센트 */
  --accent: #2a56d6;          /* 코발트 */
  --accent-strong: #1f45b8;
  --accent-soft: #e9eefc;
  --accent-line: #c4d2f6;
  --gold: #b0873c;            /* 골드 마이크로포인트 (파비콘·명세서 통일) */

  /* 시맨틱 */
  --ok: #157a4a;   --ok-soft: #e4f3ea;
  --warn: #a9701a; --warn-soft: #f9efdc;
  --danger: #b53131; --danger-soft: #fbe9e9;

  /* 형태 */
  --radius: 13px;
  --radius-sm: 9px;
  --sidebar-w: 232px;

  /* 깊이 */
  --shadow-sm: 0 1px 2px rgba(18,26,40,.06);
  --shadow: 0 1px 2px rgba(18,26,40,.05), 0 6px 20px -6px rgba(18,26,40,.10);
  --shadow-lg: 0 12px 40px -8px rgba(18,26,40,.22);
  --ring: 0 0 0 3px var(--accent-soft);

  --mono: ui-monospace, "SFMono-Regular", "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
/* HTML `hidden` 은 항상 display 를 이긴다 — 페이지 CSS 의 .modal{display:grid} 이 무시하지 못하게 전역 강제. */
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, sans-serif;
  color: var(--ink);
  font-size: 14.5px; line-height: 1.55; letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  /* 캔버스: 평면색이 아니라 아주 은은한 상단광 + 슬레이트 그라디언트로 깊이 */
  background:
    radial-gradient(1200px 520px at 78% -8%, #eef2f7 0%, rgba(238,242,247,0) 60%),
    var(--bg);
  background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
.mono { font-family: var(--mono); font-feature-settings: "tnum" 1, "zero" 1; }

/* ── 셸 ── */
.shell { display: flex; min-height: 100vh; }

/* ── 딥잉크 사이드바 ── */
.sidebar {
  width: var(--sidebar-w); flex: 0 0 auto;
  background: linear-gradient(180deg, var(--nav-bg) 0%, var(--nav-bg-2) 100%);
  color: var(--nav-ink);
  display: flex; flex-direction: column; padding: 20px 14px 16px;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid #0c121b;
}
.brand {
  display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16.5px;
  color: var(--nav-ink-strong); padding: 4px 10px 20px; letter-spacing: -.02em;
}
.brand-mark { width: 24px; height: 24px; color: #dbe6ff; flex: 0 0 auto; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding: 9.5px 11px; border-radius: 9px; color: var(--nav-ink);
  font-weight: 500; font-size: 14px; letter-spacing: -.01em;
  transition: background .14s ease, color .14s ease;
}
.nav-item svg { width: 18.5px; height: 18.5px; flex: 0 0 auto; opacity: .82; transition: opacity .14s; }
.nav-item:hover { background: var(--nav-hover-bg); color: var(--nav-ink-strong); }
.nav-item:hover svg { opacity: 1; }
.nav-item.active { background: var(--nav-active-bg); color: #fff; font-weight: 600; }
.nav-item.active svg { opacity: 1; color: #b9ccff; }
.nav-item.active::before {          /* 좌측 액센트 바 */
  content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--accent);
  box-shadow: 0 0 10px rgba(42,86,214,.6);
}
.nav-item.small { font-size: 13px; padding: 8px 11px; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 3px; padding-top: 12px; border-top: 1px solid var(--nav-line); }
.user-chip { display: flex; align-items: center; justify-content: space-between; padding: 12px 11px 3px; font-size: 13px; }
.user-chip .user-name { color: var(--nav-ink-strong); font-weight: 600; }
.user-chip .logout { color: var(--nav-ink); font-size: 12.5px; transition: color .14s; }
.user-chip .logout:hover { color: #ff8f8f; }

.content { flex: 1 1 auto; min-width: 0; padding: 34px 40px 56px; max-width: 1160px; }

/* ── 페이지 헤더 ── */
.page-eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin: 0 0 8px;
}
.page-title { font-size: 23px; font-weight: 730; letter-spacing: -.025em; margin: 0 0 5px; color: var(--ink); }
.page-desc { color: var(--ink-soft); margin: 0 0 26px; font-size: 14px; max-width: 68ch; }

/* ── 카드 ── */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 24px; margin-bottom: 18px;
  animation: rise .5s cubic-bezier(.2,.7,.2,1) both;
}
.card:nth-child(2) { animation-delay: .05s; }
.card:nth-child(3) { animation-delay: .10s; }
.card:nth-child(4) { animation-delay: .15s; }
.card:nth-child(5) { animation-delay: .20s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .card { animation: none; } }
.card h3 { margin: 0 0 15px; font-size: 15px; font-weight: 680; letter-spacing: -.015em; display: flex; align-items: center; gap: 8px; }
.card h3 svg { width: 17px; height: 17px; color: var(--accent); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ── 버튼 ── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: var(--radius-sm); padding: 8.5px 15px; font: inherit; font-weight: 600; font-size: 13.5px;
  letter-spacing: -.01em; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background .14s, border-color .14s, box-shadow .14s, transform .06s;
}
.btn:hover { background: var(--surface-2); border-color: #d3d9e1; }
.btn:active { transform: translateY(.5px); }
.btn.primary {
  background: linear-gradient(180deg, #3563e0 0%, var(--accent) 100%);
  border-color: var(--accent-strong); color: #fff;
  box-shadow: 0 1px 2px rgba(31,69,184,.4), 0 4px 12px -4px rgba(31,69,184,.5);
}
.btn.primary:hover { filter: brightness(1.05); box-shadow: 0 2px 4px rgba(31,69,184,.4), 0 8px 18px -4px rgba(31,69,184,.55); }
.btn.danger { color: var(--danger); border-color: #edcccc; }
.btn.danger:hover { background: var(--danger-soft); border-color: #e2b3b3; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn svg { width: 16px; height: 16px; }

/* ── 입력 ── */
.input, select.input, textarea.input {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8.5px 12px; min-width: 0;
  transition: border-color .14s, box-shadow .14s;
}
.input::placeholder { color: var(--ink-faint); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--ink-soft); font-weight: 600; letter-spacing: -.005em; }

/* ── 표 ── */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; color: var(--ink-faint); font-weight: 600; font-size: 11.5px;
  letter-spacing: .04em; text-transform: uppercase;
  padding: 9px 11px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 10px 11px; border-bottom: 1px solid var(--line-soft); }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover td { background: var(--surface-2); }

/* ── 뱃지 ── */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 650; letter-spacing: -.01em; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.neutral { background: #eef1f5; color: var(--ink-soft); }

/* ── 진행바 ── */
.progress { height: 7px; border-radius: 99px; background: #e4e8ee; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 99px; transition: width .3s cubic-bezier(.3,.7,.3,1);
  background: linear-gradient(90deg, var(--accent) 0%, #5b82ef 100%); }

/* ── 토스트 ── */
.toasts { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 9px; z-index: 1000; }
.toast {
  display: flex; align-items: center; gap: 9px;
  background: #1b2431; color: #eef2f7; padding: 11px 16px; border-radius: 11px;
  font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,.08);
  opacity: 0; transform: translateY(8px) scale(.98); transition: opacity .28s, transform .28s;
  max-width: 400px;
}
.toast::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #7f8ba0; flex: 0 0 auto; }
.toast.show { opacity: 1; transform: none; }
.toast.error::before { background: #f0736f; }
.toast.success::before { background: #4fc389; }
.toast.warning::before { background: #f0bf6a; }

/* ── 로그인 ── */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 500px at 50% -10%, #1c2739 0%, rgba(19,27,39,0) 60%),
    linear-gradient(180deg, var(--nav-bg) 0%, var(--nav-bg-2) 100%);
}
.login-card { width: 392px; box-shadow: var(--shadow-lg); animation: rise .5s cubic-bezier(.2,.7,.2,1) both; }
/* 로그인 카드는 밝은 표면 — 브랜드를 다크 잉크/액센트로(사이드바용 밝은색 오버라이드) */
.login-card .brand { color: var(--ink); }
.login-card .brand-mark { color: var(--accent); }
